text
stringlengths
2
100k
meta
dict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>KRB5_KEYUSAGE_AD_MTE &mdash; MIT Kerberos Documentation</title> <link rel="stylesheet" href="../../../_static/agogo.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/kerb.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../../../', VERSION: '1.11.3', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script> <link rel="author" title="About these documents" href="../../../about.html" /> <link rel="copyright" title="Copyright" href="../../../copyright.html" /> <link rel="top" title="MIT Kerberos Documentation" href="../../../index.html" /> <link rel="up" title="krb5 simple macros" href="index.html" /> <link rel="next" title="KRB5_KEYUSAGE_AD_SIGNEDPATH" href="KRB5_KEYUSAGE_AD_SIGNEDPATH.html" /> <link rel="prev" title="KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM" href="KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM.html" /> </head> <body> <div class="header-wrapper"> <div class="header" style="padding-bottom: 0px;"> <h1><a href="../../../index.html" style="color: #5d1509; font-size: 120%; padding-top: 10px;">MIT Kerberos Documentation</a></h1> <div class="rel"> <a href="../../../index.html" title="Full Table of Contents" accesskey="C">Contents</a> | <a href="KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM.html" title="KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM" accesskey="P">previous</a> | <a href="KRB5_KEYUSAGE_AD_SIGNEDPATH.html" title="KRB5_KEYUSAGE_AD_SIGNEDPATH" accesskey="N">next</a> | <a href="../../../genindex.html" title="General Index" accesskey="I">index</a> | <a href="../../../search.html" title="Enter search criteria" accesskey="S">Search</a> | <a href="mailto:[email protected]?subject=Documentation__KRB5_KEYUSAGE_AD_MTE">feedback</a> </div> </div> </div> <div class="content-wrapper"> <div class="content"> <div class="sidebar" style="float: right; background: #F9F9F9"> <h2>On this page </h2> <ul> <li><a class="reference internal" href="#">KRB5_KEYUSAGE_AD_MTE</a></li> </ul> <br/> <h2>Table of contents</h2> <ul> <li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">For users</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">For administrators</a></li> <li class="toctree-l1"><a class="reference internal" href="../../index.html">For application developers</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../plugindev/index.html">For plugin module developers</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../build/index.html">Building Kerberos V5</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../basic/index.html">Kerberos V5 concepts</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../mitK5features.html">MIT Kerberos features</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../build_this.html">How to build this documentation from the source</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../about.html">The Kerberos Documentation Set</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../resources.html">Resources</a></li> </ul> <br/> <h4><a href="../../../index.html">Full Table of Contents </a></h4> <h4>Search</h4> <form class="search" action="../../../search.html" method="get"> <input type="text" name="q" size="18" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="krb5-keyusage-ad-mte"> <span id="krb5-keyusage-ad-mte-data"></span><h1>KRB5_KEYUSAGE_AD_MTE<a class="headerlink" href="#krb5-keyusage-ad-mte" title="Permalink to this headline">¶</a></h1> <dl class="data"> <dt id="KRB5_KEYUSAGE_AD_MTE"> <tt class="descname">KRB5_KEYUSAGE_AD_MTE</tt><a class="headerlink" href="#KRB5_KEYUSAGE_AD_MTE" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <table border="1" class="docutils"> <colgroup> <col width="55%" /> <col width="45%" /> </colgroup> <tbody valign="top"> <tr class="row-odd"><td><tt class="docutils literal"><span class="pre">KRB5_KEYUSAGE_AD_MTE</span></tt></td> <td><tt class="docutils literal"><span class="pre">20</span></tt></td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <div class="clearer" ></div> </div> </div> <div class="footer-wrapper" > <div class="footer" > <div class="right" ><i>Release: 1.11.3</i><br /> &copy; <a href="../../../copyright.html">Copyright</a> 1985-2013, MIT. </div> <div class="left" > <a href="../../../index.html" title="Full Table of Contents" >Contents</a> | <a href="KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM.html" title="KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM" >previous</a> | <a href="KRB5_KEYUSAGE_AD_SIGNEDPATH.html" title="KRB5_KEYUSAGE_AD_SIGNEDPATH" >next</a> | <a href="../../../genindex.html" title="General Index" >index</a> | <a href="../../../search.html" title="Enter search criteria" >Search</a> | <a href="mailto:[email protected]?subject=Documentation__KRB5_KEYUSAGE_AD_MTE">feedback</a> </div> </div> </div> </body> </html>
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright 2016, Cyril Bur, IBM Corp. * * Sending one self a signal should always get delivered. */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <altivec.h> #include "utils.h" #define MAX_ATTEMPT 500000 #define TIMEOUT 5 extern long signal_self(pid_t pid, int sig); static sig_atomic_t signaled; static sig_atomic_t fail; static void signal_handler(int sig) { if (sig == SIGUSR1) signaled = 1; else fail = 1; } static int test_signal() { int i; struct sigaction act; pid_t ppid = getpid(); pid_t pid; act.sa_handler = signal_handler; act.sa_flags = 0; sigemptyset(&act.sa_mask); if (sigaction(SIGUSR1, &act, NULL) < 0) { perror("sigaction SIGUSR1"); exit(1); } if (sigaction(SIGALRM, &act, NULL) < 0) { perror("sigaction SIGALRM"); exit(1); } /* Don't do this for MAX_ATTEMPT, its simply too long */ for(i = 0; i < 1000; i++) { pid = fork(); if (pid == -1) { perror("fork"); exit(1); } if (pid == 0) { signal_self(ppid, SIGUSR1); exit(1); } else { alarm(0); /* Disable any pending */ alarm(2); while (!signaled && !fail) asm volatile("": : :"memory"); if (!signaled) { fprintf(stderr, "Didn't get signal from child\n"); FAIL_IF(1); /* For the line number */ } /* Otherwise we'll loop too fast and fork() will eventually fail */ waitpid(pid, NULL, 0); } } for (i = 0; i < MAX_ATTEMPT; i++) { long rc; alarm(0); /* Disable any pending */ signaled = 0; alarm(TIMEOUT); rc = signal_self(ppid, SIGUSR1); if (rc) { fprintf(stderr, "(%d) Fail reason: %d rc=0x%lx", i, fail, rc); FAIL_IF(1); /* For the line number */ } while (!signaled && !fail) asm volatile("": : :"memory"); if (!signaled) { fprintf(stderr, "(%d) Fail reason: %d rc=0x%lx", i, fail, rc); FAIL_IF(1); /* For the line number */ } } return 0; } int main(void) { test_harness_set_timeout(300); return test_harness(test_signal, "signal"); }
{ "pile_set_name": "Github" }
#include "public/Message.h" #ifdef KERNEL #include <kern/assert.h> #else #include <cassert> #endif uint32_t Message_EncodedSize(const MessageHeader* messageHeader) { uint32_t size = sizeof(*messageHeader); for (unsigned i = 0; i < MessagePath_Count; ++i) { bool overflow = __builtin_uadd_overflow(messageHeader->pathSizesBytes[i], size, &size); assert(!overflow); // small constant plus small number of uint16_t should never overflow a uint32_t } return size; }
{ "pile_set_name": "Github" }
/* * bcm2835 sdhost driver. * * The 2835 has two SD controllers: The Arasan sdhci controller * (supported by the iproc driver) and a custom sdhost controller * (supported by this driver). * * The sdhci controller supports both sdcard and sdio. The sdhost * controller supports the sdcard only, but has better performance. * Also note that the rpi3 has sdio wifi, so driving the sdcard with * the sdhost controller allows to use the sdhci controller for wifi * support. * * The configuration is done by devicetree via pin muxing. Both * SD controller are available on the same pins (2 pin groups = pin 22 * to 27 + pin 48 to 53). So it's possible to use both SD controllers * at the same time with different pin groups. * * Author: Phil Elwell <[email protected]> * Copyright (C) 2015-2016 Raspberry Pi (Trading) Ltd. * * Based on * mmc-bcm2835.c by Gellert Weisz * which is, in turn, based on * sdhci-bcm2708.c by Broadcom * sdhci-bcm2835.c by Stephen Warren and Oleksandr Tymoshenko * sdhci.c and sdhci-pci.c by Pierre Ossman * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope 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/>. */ #include <linux/clk.h> #include <linux/delay.h> #include <linux/device.h> #include <linux/dmaengine.h> #include <linux/dma-mapping.h> #include <linux/err.h> #include <linux/highmem.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/platform_device.h> #include <linux/scatterlist.h> #include <linux/time.h> #include <linux/workqueue.h> #include <linux/mmc/host.h> #include <linux/mmc/mmc.h> #include <linux/mmc/sd.h> #define SDCMD 0x00 /* Command to SD card - 16 R/W */ #define SDARG 0x04 /* Argument to SD card - 32 R/W */ #define SDTOUT 0x08 /* Start value for timeout counter - 32 R/W */ #define SDCDIV 0x0c /* Start value for clock divider - 11 R/W */ #define SDRSP0 0x10 /* SD card response (31:0) - 32 R */ #define SDRSP1 0x14 /* SD card response (63:32) - 32 R */ #define SDRSP2 0x18 /* SD card response (95:64) - 32 R */ #define SDRSP3 0x1c /* SD card response (127:96) - 32 R */ #define SDHSTS 0x20 /* SD host status - 11 R/W */ #define SDVDD 0x30 /* SD card power control - 1 R/W */ #define SDEDM 0x34 /* Emergency Debug Mode - 13 R/W */ #define SDHCFG 0x38 /* Host configuration - 2 R/W */ #define SDHBCT 0x3c /* Host byte count (debug) - 32 R/W */ #define SDDATA 0x40 /* Data to/from SD card - 32 R/W */ #define SDHBLC 0x50 /* Host block count (SDIO/SDHC) - 9 R/W */ #define SDCMD_NEW_FLAG 0x8000 #define SDCMD_FAIL_FLAG 0x4000 #define SDCMD_BUSYWAIT 0x800 #define SDCMD_NO_RESPONSE 0x400 #define SDCMD_LONG_RESPONSE 0x200 #define SDCMD_WRITE_CMD 0x80 #define SDCMD_READ_CMD 0x40 #define SDCMD_CMD_MASK 0x3f #define SDCDIV_MAX_CDIV 0x7ff #define SDHSTS_BUSY_IRPT 0x400 #define SDHSTS_BLOCK_IRPT 0x200 #define SDHSTS_SDIO_IRPT 0x100 #define SDHSTS_REW_TIME_OUT 0x80 #define SDHSTS_CMD_TIME_OUT 0x40 #define SDHSTS_CRC16_ERROR 0x20 #define SDHSTS_CRC7_ERROR 0x10 #define SDHSTS_FIFO_ERROR 0x08 /* Reserved */ /* Reserved */ #define SDHSTS_DATA_FLAG 0x01 #define SDHSTS_TRANSFER_ERROR_MASK (SDHSTS_CRC7_ERROR | \ SDHSTS_CRC16_ERROR | \ SDHSTS_REW_TIME_OUT | \ SDHSTS_FIFO_ERROR) #define SDHSTS_ERROR_MASK (SDHSTS_CMD_TIME_OUT | \ SDHSTS_TRANSFER_ERROR_MASK) #define SDHCFG_BUSY_IRPT_EN BIT(10) #define SDHCFG_BLOCK_IRPT_EN BIT(8) #define SDHCFG_SDIO_IRPT_EN BIT(5) #define SDHCFG_DATA_IRPT_EN BIT(4) #define SDHCFG_SLOW_CARD BIT(3) #define SDHCFG_WIDE_EXT_BUS BIT(2) #define SDHCFG_WIDE_INT_BUS BIT(1) #define SDHCFG_REL_CMD_LINE BIT(0) #define SDVDD_POWER_OFF 0 #define SDVDD_POWER_ON 1 #define SDEDM_FORCE_DATA_MODE BIT(19) #define SDEDM_CLOCK_PULSE BIT(20) #define SDEDM_BYPASS BIT(21) #define SDEDM_WRITE_THRESHOLD_SHIFT 9 #define SDEDM_READ_THRESHOLD_SHIFT 14 #define SDEDM_THRESHOLD_MASK 0x1f #define SDEDM_FSM_MASK 0xf #define SDEDM_FSM_IDENTMODE 0x0 #define SDEDM_FSM_DATAMODE 0x1 #define SDEDM_FSM_READDATA 0x2 #define SDEDM_FSM_WRITEDATA 0x3 #define SDEDM_FSM_READWAIT 0x4 #define SDEDM_FSM_READCRC 0x5 #define SDEDM_FSM_WRITECRC 0x6 #define SDEDM_FSM_WRITEWAIT1 0x7 #define SDEDM_FSM_POWERDOWN 0x8 #define SDEDM_FSM_POWERUP 0x9 #define SDEDM_FSM_WRITESTART1 0xa #define SDEDM_FSM_WRITESTART2 0xb #define SDEDM_FSM_GENPULSES 0xc #define SDEDM_FSM_WRITEWAIT2 0xd #define SDEDM_FSM_STARTPOWDOWN 0xf #define SDDATA_FIFO_WORDS 16 #define FIFO_READ_THRESHOLD 4 #define FIFO_WRITE_THRESHOLD 4 #define SDDATA_FIFO_PIO_BURST 8 #define PIO_THRESHOLD 1 /* Maximum block count for PIO (0 = always DMA) */ struct bcm2835_host { spinlock_t lock; struct mutex mutex; void __iomem *ioaddr; u32 phys_addr; struct mmc_host *mmc; struct platform_device *pdev; int clock; /* Current clock speed */ unsigned int max_clk; /* Max possible freq */ struct work_struct dma_work; struct delayed_work timeout_work; /* Timer for timeouts */ struct sg_mapping_iter sg_miter; /* SG state for PIO */ unsigned int blocks; /* remaining PIO blocks */ int irq; /* Device IRQ */ u32 ns_per_fifo_word; /* cached registers */ u32 hcfg; u32 cdiv; struct mmc_request *mrq; /* Current request */ struct mmc_command *cmd; /* Current command */ struct mmc_data *data; /* Current data request */ bool data_complete:1;/* Data finished before cmd */ bool use_busy:1; /* Wait for busy interrupt */ bool use_sbc:1; /* Send CMD23 */ /* for threaded irq handler */ bool irq_block; bool irq_busy; bool irq_data; /* DMA part */ struct dma_chan *dma_chan_rxtx; struct dma_chan *dma_chan; struct dma_slave_config dma_cfg_rx; struct dma_slave_config dma_cfg_tx; struct dma_async_tx_descriptor *dma_desc; u32 dma_dir; u32 drain_words; struct page *drain_page; u32 drain_offset; bool use_dma; }; static void bcm2835_dumpcmd(struct bcm2835_host *host, struct mmc_command *cmd, const char *label) { struct device *dev = &host->pdev->dev; if (!cmd) return; dev_dbg(dev, "%c%s op %d arg 0x%x flags 0x%x - resp %08x %08x %08x %08x, err %d\n", (cmd == host->cmd) ? '>' : ' ', label, cmd->opcode, cmd->arg, cmd->flags, cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3], cmd->error); } static void bcm2835_dumpregs(struct bcm2835_host *host) { struct mmc_request *mrq = host->mrq; struct device *dev = &host->pdev->dev; if (mrq) { bcm2835_dumpcmd(host, mrq->sbc, "sbc"); bcm2835_dumpcmd(host, mrq->cmd, "cmd"); if (mrq->data) { dev_dbg(dev, "data blocks %x blksz %x - err %d\n", mrq->data->blocks, mrq->data->blksz, mrq->data->error); } bcm2835_dumpcmd(host, mrq->stop, "stop"); } dev_dbg(dev, "=========== REGISTER DUMP ===========\n"); dev_dbg(dev, "SDCMD 0x%08x\n", readl(host->ioaddr + SDCMD)); dev_dbg(dev, "SDARG 0x%08x\n", readl(host->ioaddr + SDARG)); dev_dbg(dev, "SDTOUT 0x%08x\n", readl(host->ioaddr + SDTOUT)); dev_dbg(dev, "SDCDIV 0x%08x\n", readl(host->ioaddr + SDCDIV)); dev_dbg(dev, "SDRSP0 0x%08x\n", readl(host->ioaddr + SDRSP0)); dev_dbg(dev, "SDRSP1 0x%08x\n", readl(host->ioaddr + SDRSP1)); dev_dbg(dev, "SDRSP2 0x%08x\n", readl(host->ioaddr + SDRSP2)); dev_dbg(dev, "SDRSP3 0x%08x\n", readl(host->ioaddr + SDRSP3)); dev_dbg(dev, "SDHSTS 0x%08x\n", readl(host->ioaddr + SDHSTS)); dev_dbg(dev, "SDVDD 0x%08x\n", readl(host->ioaddr + SDVDD)); dev_dbg(dev, "SDEDM 0x%08x\n", readl(host->ioaddr + SDEDM)); dev_dbg(dev, "SDHCFG 0x%08x\n", readl(host->ioaddr + SDHCFG)); dev_dbg(dev, "SDHBCT 0x%08x\n", readl(host->ioaddr + SDHBCT)); dev_dbg(dev, "SDHBLC 0x%08x\n", readl(host->ioaddr + SDHBLC)); dev_dbg(dev, "===========================================\n"); } static void bcm2835_reset_internal(struct bcm2835_host *host) { u32 temp; writel(SDVDD_POWER_OFF, host->ioaddr + SDVDD); writel(0, host->ioaddr + SDCMD); writel(0, host->ioaddr + SDARG); writel(0xf00000, host->ioaddr + SDTOUT); writel(0, host->ioaddr + SDCDIV); writel(0x7f8, host->ioaddr + SDHSTS); /* Write 1s to clear */ writel(0, host->ioaddr + SDHCFG); writel(0, host->ioaddr + SDHBCT); writel(0, host->ioaddr + SDHBLC); /* Limit fifo usage due to silicon bug */ temp = readl(host->ioaddr + SDEDM); temp &= ~((SDEDM_THRESHOLD_MASK << SDEDM_READ_THRESHOLD_SHIFT) | (SDEDM_THRESHOLD_MASK << SDEDM_WRITE_THRESHOLD_SHIFT)); temp |= (FIFO_READ_THRESHOLD << SDEDM_READ_THRESHOLD_SHIFT) | (FIFO_WRITE_THRESHOLD << SDEDM_WRITE_THRESHOLD_SHIFT); writel(temp, host->ioaddr + SDEDM); msleep(20); writel(SDVDD_POWER_ON, host->ioaddr + SDVDD); msleep(20); host->clock = 0; writel(host->hcfg, host->ioaddr + SDHCFG); writel(host->cdiv, host->ioaddr + SDCDIV); } static void bcm2835_reset(struct mmc_host *mmc) { struct bcm2835_host *host = mmc_priv(mmc); if (host->dma_chan) dmaengine_terminate_sync(host->dma_chan); bcm2835_reset_internal(host); } static void bcm2835_finish_command(struct bcm2835_host *host); static void bcm2835_wait_transfer_complete(struct bcm2835_host *host) { int timediff; u32 alternate_idle; alternate_idle = (host->mrq->data->flags & MMC_DATA_READ) ? SDEDM_FSM_READWAIT : SDEDM_FSM_WRITESTART1; timediff = 0; while (1) { u32 edm, fsm; edm = readl(host->ioaddr + SDEDM); fsm = edm & SDEDM_FSM_MASK; if ((fsm == SDEDM_FSM_IDENTMODE) || (fsm == SDEDM_FSM_DATAMODE)) break; if (fsm == alternate_idle) { writel(edm | SDEDM_FORCE_DATA_MODE, host->ioaddr + SDEDM); break; } timediff++; if (timediff == 100000) { dev_err(&host->pdev->dev, "wait_transfer_complete - still waiting after %d retries\n", timediff); bcm2835_dumpregs(host); host->mrq->data->error = -ETIMEDOUT; return; } cpu_relax(); } } static void bcm2835_dma_complete(void *param) { struct bcm2835_host *host = param; schedule_work(&host->dma_work); } static void bcm2835_transfer_block_pio(struct bcm2835_host *host, bool is_read) { unsigned long flags; size_t blksize; unsigned long wait_max; blksize = host->data->blksz; wait_max = jiffies + msecs_to_jiffies(500); local_irq_save(flags); while (blksize) { int copy_words; u32 hsts = 0; size_t len; u32 *buf; if (!sg_miter_next(&host->sg_miter)) { host->data->error = -EINVAL; break; } len = min(host->sg_miter.length, blksize); if (len % 4) { host->data->error = -EINVAL; break; } blksize -= len; host->sg_miter.consumed = len; buf = (u32 *)host->sg_miter.addr; copy_words = len / 4; while (copy_words) { int burst_words, words; u32 edm; burst_words = min(SDDATA_FIFO_PIO_BURST, copy_words); edm = readl(host->ioaddr + SDEDM); if (is_read) words = ((edm >> 4) & 0x1f); else words = SDDATA_FIFO_WORDS - ((edm >> 4) & 0x1f); if (words < burst_words) { int fsm_state = (edm & SDEDM_FSM_MASK); struct device *dev = &host->pdev->dev; if ((is_read && (fsm_state != SDEDM_FSM_READDATA && fsm_state != SDEDM_FSM_READWAIT && fsm_state != SDEDM_FSM_READCRC)) || (!is_read && (fsm_state != SDEDM_FSM_WRITEDATA && fsm_state != SDEDM_FSM_WRITESTART1 && fsm_state != SDEDM_FSM_WRITESTART2))) { hsts = readl(host->ioaddr + SDHSTS); dev_err(dev, "fsm %x, hsts %08x\n", fsm_state, hsts); if (hsts & SDHSTS_ERROR_MASK) break; } if (time_after(jiffies, wait_max)) { dev_err(dev, "PIO %s timeout - EDM %08x\n", is_read ? "read" : "write", edm); hsts = SDHSTS_REW_TIME_OUT; break; } ndelay((burst_words - words) * host->ns_per_fifo_word); continue; } else if (words > copy_words) { words = copy_words; } copy_words -= words; while (words) { if (is_read) *(buf++) = readl(host->ioaddr + SDDATA); else writel(*(buf++), host->ioaddr + SDDATA); words--; } } if (hsts & SDHSTS_ERROR_MASK) break; } sg_miter_stop(&host->sg_miter); local_irq_restore(flags); } static void bcm2835_transfer_pio(struct bcm2835_host *host) { struct device *dev = &host->pdev->dev; u32 sdhsts; bool is_read; is_read = (host->data->flags & MMC_DATA_READ) != 0; bcm2835_transfer_block_pio(host, is_read); sdhsts = readl(host->ioaddr + SDHSTS); if (sdhsts & (SDHSTS_CRC16_ERROR | SDHSTS_CRC7_ERROR | SDHSTS_FIFO_ERROR)) { dev_err(dev, "%s transfer error - HSTS %08x\n", is_read ? "read" : "write", sdhsts); host->data->error = -EILSEQ; } else if ((sdhsts & (SDHSTS_CMD_TIME_OUT | SDHSTS_REW_TIME_OUT))) { dev_err(dev, "%s timeout error - HSTS %08x\n", is_read ? "read" : "write", sdhsts); host->data->error = -ETIMEDOUT; } } static void bcm2835_prepare_dma(struct bcm2835_host *host, struct mmc_data *data) { int len, dir_data, dir_slave; struct dma_async_tx_descriptor *desc = NULL; struct dma_chan *dma_chan; dma_chan = host->dma_chan_rxtx; if (data->flags & MMC_DATA_READ) { dir_data = DMA_FROM_DEVICE; dir_slave = DMA_DEV_TO_MEM; } else { dir_data = DMA_TO_DEVICE; dir_slave = DMA_MEM_TO_DEV; } /* The block doesn't manage the FIFO DREQs properly for * multi-block transfers, so don't attempt to DMA the final * few words. Unfortunately this requires the final sg entry * to be trimmed. N.B. This code demands that the overspill * is contained in a single sg entry. */ host->drain_words = 0; if ((data->blocks > 1) && (dir_data == DMA_FROM_DEVICE)) { struct scatterlist *sg; u32 len; int i; len = min((u32)(FIFO_READ_THRESHOLD - 1) * 4, (u32)data->blocks * data->blksz); for_each_sg(data->sg, sg, data->sg_len, i) { if (sg_is_last(sg)) { WARN_ON(sg->length < len); sg->length -= len; host->drain_page = sg_page(sg); host->drain_offset = sg->offset + sg->length; } } host->drain_words = len / 4; } /* The parameters have already been validated, so this will not fail */ (void)dmaengine_slave_config(dma_chan, (dir_data == DMA_FROM_DEVICE) ? &host->dma_cfg_rx : &host->dma_cfg_tx); len = dma_map_sg(dma_chan->device->dev, data->sg, data->sg_len, dir_data); if (len > 0) { desc = dmaengine_prep_slave_sg(dma_chan, data->sg, len, dir_slave, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); } if (desc) { desc->callback = bcm2835_dma_complete; desc->callback_param = host; host->dma_desc = desc; host->dma_chan = dma_chan; host->dma_dir = dir_data; } } static void bcm2835_start_dma(struct bcm2835_host *host) { dmaengine_submit(host->dma_desc); dma_async_issue_pending(host->dma_chan); } static void bcm2835_set_transfer_irqs(struct bcm2835_host *host) { u32 all_irqs = SDHCFG_DATA_IRPT_EN | SDHCFG_BLOCK_IRPT_EN | SDHCFG_BUSY_IRPT_EN; if (host->dma_desc) { host->hcfg = (host->hcfg & ~all_irqs) | SDHCFG_BUSY_IRPT_EN; } else { host->hcfg = (host->hcfg & ~all_irqs) | SDHCFG_DATA_IRPT_EN | SDHCFG_BUSY_IRPT_EN; } writel(host->hcfg, host->ioaddr + SDHCFG); } static void bcm2835_prepare_data(struct bcm2835_host *host, struct mmc_command *cmd) { struct mmc_data *data = cmd->data; WARN_ON(host->data); host->data = data; if (!data) return; host->data_complete = false; host->data->bytes_xfered = 0; if (!host->dma_desc) { /* Use PIO */ int flags = SG_MITER_ATOMIC; if (data->flags & MMC_DATA_READ) flags |= SG_MITER_TO_SG; else flags |= SG_MITER_FROM_SG; sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags); host->blocks = data->blocks; } bcm2835_set_transfer_irqs(host); writel(data->blksz, host->ioaddr + SDHBCT); writel(data->blocks, host->ioaddr + SDHBLC); } static u32 bcm2835_read_wait_sdcmd(struct bcm2835_host *host, u32 max_ms) { struct device *dev = &host->pdev->dev; u32 value; int ret; ret = readl_poll_timeout(host->ioaddr + SDCMD, value, !(value & SDCMD_NEW_FLAG), 1, 10); if (ret == -ETIMEDOUT) /* if it takes a while make poll interval bigger */ ret = readl_poll_timeout(host->ioaddr + SDCMD, value, !(value & SDCMD_NEW_FLAG), 10, max_ms * 1000); if (ret == -ETIMEDOUT) dev_err(dev, "%s: timeout (%d ms)\n", __func__, max_ms); return value; } static void bcm2835_finish_request(struct bcm2835_host *host) { struct dma_chan *terminate_chan = NULL; struct mmc_request *mrq; cancel_delayed_work(&host->timeout_work); mrq = host->mrq; host->mrq = NULL; host->cmd = NULL; host->data = NULL; host->dma_desc = NULL; terminate_chan = host->dma_chan; host->dma_chan = NULL; if (terminate_chan) { int err = dmaengine_terminate_all(terminate_chan); if (err) dev_err(&host->pdev->dev, "failed to terminate DMA (%d)\n", err); } mmc_request_done(host->mmc, mrq); } static bool bcm2835_send_command(struct bcm2835_host *host, struct mmc_command *cmd) { struct device *dev = &host->pdev->dev; u32 sdcmd, sdhsts; unsigned long timeout; WARN_ON(host->cmd); sdcmd = bcm2835_read_wait_sdcmd(host, 100); if (sdcmd & SDCMD_NEW_FLAG) { dev_err(dev, "previous command never completed.\n"); bcm2835_dumpregs(host); cmd->error = -EILSEQ; bcm2835_finish_request(host); return false; } if (!cmd->data && cmd->busy_timeout > 9000) timeout = DIV_ROUND_UP(cmd->busy_timeout, 1000) * HZ + HZ; else timeout = 10 * HZ; schedule_delayed_work(&host->timeout_work, timeout); host->cmd = cmd; /* Clear any error flags */ sdhsts = readl(host->ioaddr + SDHSTS); if (sdhsts & SDHSTS_ERROR_MASK) writel(sdhsts, host->ioaddr + SDHSTS); if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) { dev_err(dev, "unsupported response type!\n"); cmd->error = -EINVAL; bcm2835_finish_request(host); return false; } bcm2835_prepare_data(host, cmd); writel(cmd->arg, host->ioaddr + SDARG); sdcmd = cmd->opcode & SDCMD_CMD_MASK; host->use_busy = false; if (!(cmd->flags & MMC_RSP_PRESENT)) { sdcmd |= SDCMD_NO_RESPONSE; } else { if (cmd->flags & MMC_RSP_136) sdcmd |= SDCMD_LONG_RESPONSE; if (cmd->flags & MMC_RSP_BUSY) { sdcmd |= SDCMD_BUSYWAIT; host->use_busy = true; } } if (cmd->data) { if (cmd->data->flags & MMC_DATA_WRITE) sdcmd |= SDCMD_WRITE_CMD; if (cmd->data->flags & MMC_DATA_READ) sdcmd |= SDCMD_READ_CMD; } writel(sdcmd | SDCMD_NEW_FLAG, host->ioaddr + SDCMD); return true; } static void bcm2835_transfer_complete(struct bcm2835_host *host) { struct mmc_data *data; WARN_ON(!host->data_complete); data = host->data; host->data = NULL; /* Need to send CMD12 if - * a) open-ended multiblock transfer (no CMD23) * b) error in multiblock transfer */ if (host->mrq->stop && (data->error || !host->use_sbc)) { if (bcm2835_send_command(host, host->mrq->stop)) { /* No busy, so poll for completion */ if (!host->use_busy) bcm2835_finish_command(host); } } else { bcm2835_wait_transfer_complete(host); bcm2835_finish_request(host); } } static void bcm2835_finish_data(struct bcm2835_host *host) { struct device *dev = &host->pdev->dev; struct mmc_data *data; data = host->data; host->hcfg &= ~(SDHCFG_DATA_IRPT_EN | SDHCFG_BLOCK_IRPT_EN); writel(host->hcfg, host->ioaddr + SDHCFG); data->bytes_xfered = data->error ? 0 : (data->blksz * data->blocks); host->data_complete = true; if (host->cmd) { /* Data managed to finish before the * command completed. Make sure we do * things in the proper order. */ dev_dbg(dev, "Finished early - HSTS %08x\n", readl(host->ioaddr + SDHSTS)); } else { bcm2835_transfer_complete(host); } } static void bcm2835_finish_command(struct bcm2835_host *host) { struct device *dev = &host->pdev->dev; struct mmc_command *cmd = host->cmd; u32 sdcmd; sdcmd = bcm2835_read_wait_sdcmd(host, 100); /* Check for errors */ if (sdcmd & SDCMD_NEW_FLAG) { dev_err(dev, "command never completed.\n"); bcm2835_dumpregs(host); host->cmd->error = -EIO; bcm2835_finish_request(host); return; } else if (sdcmd & SDCMD_FAIL_FLAG) { u32 sdhsts = readl(host->ioaddr + SDHSTS); /* Clear the errors */ writel(SDHSTS_ERROR_MASK, host->ioaddr + SDHSTS); if (!(sdhsts & SDHSTS_CRC7_ERROR) || (host->cmd->opcode != MMC_SEND_OP_COND)) { if (sdhsts & SDHSTS_CMD_TIME_OUT) { host->cmd->error = -ETIMEDOUT; } else { dev_err(dev, "unexpected command %d error\n", host->cmd->opcode); bcm2835_dumpregs(host); host->cmd->error = -EILSEQ; } bcm2835_finish_request(host); return; } } if (cmd->flags & MMC_RSP_PRESENT) { if (cmd->flags & MMC_RSP_136) { int i; for (i = 0; i < 4; i++) { cmd->resp[3 - i] = readl(host->ioaddr + SDRSP0 + i * 4); } } else { cmd->resp[0] = readl(host->ioaddr + SDRSP0); } } if (cmd == host->mrq->sbc) { /* Finished CMD23, now send actual command. */ host->cmd = NULL; if (bcm2835_send_command(host, host->mrq->cmd)) { if (host->data && host->dma_desc) /* DMA transfer starts now, PIO starts * after irq */ bcm2835_start_dma(host); if (!host->use_busy) bcm2835_finish_command(host); } } else if (cmd == host->mrq->stop) { /* Finished CMD12 */ bcm2835_finish_request(host); } else { /* Processed actual command. */ host->cmd = NULL; if (!host->data) bcm2835_finish_request(host); else if (host->data_complete) bcm2835_transfer_complete(host); } } static void bcm2835_timeout(struct work_struct *work) { struct delayed_work *d = to_delayed_work(work); struct bcm2835_host *host = container_of(d, struct bcm2835_host, timeout_work); struct device *dev = &host->pdev->dev; mutex_lock(&host->mutex); if (host->mrq) { dev_err(dev, "timeout waiting for hardware interrupt.\n"); bcm2835_dumpregs(host); if (host->data) { host->data->error = -ETIMEDOUT; bcm2835_finish_data(host); } else { if (host->cmd) host->cmd->error = -ETIMEDOUT; else host->mrq->cmd->error = -ETIMEDOUT; bcm2835_finish_request(host); } } mutex_unlock(&host->mutex); } static bool bcm2835_check_cmd_error(struct bcm2835_host *host, u32 intmask) { struct device *dev = &host->pdev->dev; if (!(intmask & SDHSTS_ERROR_MASK)) return false; if (!host->cmd) return true; dev_err(dev, "sdhost_busy_irq: intmask %08x\n", intmask); if (intmask & SDHSTS_CRC7_ERROR) { host->cmd->error = -EILSEQ; } else if (intmask & (SDHSTS_CRC16_ERROR | SDHSTS_FIFO_ERROR)) { if (host->mrq->data) host->mrq->data->error = -EILSEQ; else host->cmd->error = -EILSEQ; } else if (intmask & SDHSTS_REW_TIME_OUT) { if (host->mrq->data) host->mrq->data->error = -ETIMEDOUT; else host->cmd->error = -ETIMEDOUT; } else if (intmask & SDHSTS_CMD_TIME_OUT) { host->cmd->error = -ETIMEDOUT; } bcm2835_dumpregs(host); return true; } static void bcm2835_check_data_error(struct bcm2835_host *host, u32 intmask) { if (!host->data) return; if (intmask & (SDHSTS_CRC16_ERROR | SDHSTS_FIFO_ERROR)) host->data->error = -EILSEQ; if (intmask & SDHSTS_REW_TIME_OUT) host->data->error = -ETIMEDOUT; } static void bcm2835_busy_irq(struct bcm2835_host *host) { if (WARN_ON(!host->cmd)) { bcm2835_dumpregs(host); return; } if (WARN_ON(!host->use_busy)) { bcm2835_dumpregs(host); return; } host->use_busy = false; bcm2835_finish_command(host); } static void bcm2835_data_irq(struct bcm2835_host *host, u32 intmask) { /* There are no dedicated data/space available interrupt * status bits, so it is necessary to use the single shared * data/space available FIFO status bits. It is therefore not * an error to get here when there is no data transfer in * progress. */ if (!host->data) return; bcm2835_check_data_error(host, intmask); if (host->data->error) goto finished; if (host->data->flags & MMC_DATA_WRITE) { /* Use the block interrupt for writes after the first block */ host->hcfg &= ~(SDHCFG_DATA_IRPT_EN); host->hcfg |= SDHCFG_BLOCK_IRPT_EN; writel(host->hcfg, host->ioaddr + SDHCFG); bcm2835_transfer_pio(host); } else { bcm2835_transfer_pio(host); host->blocks--; if ((host->blocks == 0) || host->data->error) goto finished; } return; finished: host->hcfg &= ~(SDHCFG_DATA_IRPT_EN | SDHCFG_BLOCK_IRPT_EN); writel(host->hcfg, host->ioaddr + SDHCFG); } static void bcm2835_data_threaded_irq(struct bcm2835_host *host) { if (!host->data) return; if ((host->blocks == 0) || host->data->error) bcm2835_finish_data(host); } static void bcm2835_block_irq(struct bcm2835_host *host) { if (WARN_ON(!host->data)) { bcm2835_dumpregs(host); return; } if (!host->dma_desc) { WARN_ON(!host->blocks); if (host->data->error || (--host->blocks == 0)) bcm2835_finish_data(host); else bcm2835_transfer_pio(host); } else if (host->data->flags & MMC_DATA_WRITE) { bcm2835_finish_data(host); } } static irqreturn_t bcm2835_irq(int irq, void *dev_id) { irqreturn_t result = IRQ_NONE; struct bcm2835_host *host = dev_id; u32 intmask; spin_lock(&host->lock); intmask = readl(host->ioaddr + SDHSTS); writel(SDHSTS_BUSY_IRPT | SDHSTS_BLOCK_IRPT | SDHSTS_SDIO_IRPT | SDHSTS_DATA_FLAG, host->ioaddr + SDHSTS); if (intmask & SDHSTS_BLOCK_IRPT) { bcm2835_check_data_error(host, intmask); host->irq_block = true; result = IRQ_WAKE_THREAD; } if (intmask & SDHSTS_BUSY_IRPT) { if (!bcm2835_check_cmd_error(host, intmask)) { host->irq_busy = true; result = IRQ_WAKE_THREAD; } else { result = IRQ_HANDLED; } } /* There is no true data interrupt status bit, so it is * necessary to qualify the data flag with the interrupt * enable bit. */ if ((intmask & SDHSTS_DATA_FLAG) && (host->hcfg & SDHCFG_DATA_IRPT_EN)) { bcm2835_data_irq(host, intmask); host->irq_data = true; result = IRQ_WAKE_THREAD; } spin_unlock(&host->lock); return result; } static irqreturn_t bcm2835_threaded_irq(int irq, void *dev_id) { struct bcm2835_host *host = dev_id; unsigned long flags; bool block, busy, data; spin_lock_irqsave(&host->lock, flags); block = host->irq_block; busy = host->irq_busy; data = host->irq_data; host->irq_block = false; host->irq_busy = false; host->irq_data = false; spin_unlock_irqrestore(&host->lock, flags); mutex_lock(&host->mutex); if (block) bcm2835_block_irq(host); if (busy) bcm2835_busy_irq(host); if (data) bcm2835_data_threaded_irq(host); mutex_unlock(&host->mutex); return IRQ_HANDLED; } static void bcm2835_dma_complete_work(struct work_struct *work) { struct bcm2835_host *host = container_of(work, struct bcm2835_host, dma_work); struct mmc_data *data = host->data; mutex_lock(&host->mutex); if (host->dma_chan) { dma_unmap_sg(host->dma_chan->device->dev, data->sg, data->sg_len, host->dma_dir); host->dma_chan = NULL; } if (host->drain_words) { unsigned long flags; void *page; u32 *buf; if (host->drain_offset & PAGE_MASK) { host->drain_page += host->drain_offset >> PAGE_SHIFT; host->drain_offset &= ~PAGE_MASK; } local_irq_save(flags); page = kmap_atomic(host->drain_page); buf = page + host->drain_offset; while (host->drain_words) { u32 edm = readl(host->ioaddr + SDEDM); if ((edm >> 4) & 0x1f) *(buf++) = readl(host->ioaddr + SDDATA); host->drain_words--; } kunmap_atomic(page); local_irq_restore(flags); } bcm2835_finish_data(host); mutex_unlock(&host->mutex); } static void bcm2835_set_clock(struct bcm2835_host *host, unsigned int clock) { int div; /* The SDCDIV register has 11 bits, and holds (div - 2). But * in data mode the max is 50MHz wihout a minimum, and only * the bottom 3 bits are used. Since the switch over is * automatic (unless we have marked the card as slow...), * chosen values have to make sense in both modes. Ident mode * must be 100-400KHz, so can range check the requested * clock. CMD15 must be used to return to data mode, so this * can be monitored. * * clock 250MHz -> 0->125MHz, 1->83.3MHz, 2->62.5MHz, 3->50.0MHz * 4->41.7MHz, 5->35.7MHz, 6->31.3MHz, 7->27.8MHz * * 623->400KHz/27.8MHz * reset value (507)->491159/50MHz * * BUT, the 3-bit clock divisor in data mode is too small if * the core clock is higher than 250MHz, so instead use the * SLOW_CARD configuration bit to force the use of the ident * clock divisor at all times. */ if (clock < 100000) { /* Can't stop the clock, but make it as slow as possible * to show willing */ host->cdiv = SDCDIV_MAX_CDIV; writel(host->cdiv, host->ioaddr + SDCDIV); return; } div = host->max_clk / clock; if (div < 2) div = 2; if ((host->max_clk / div) > clock) div++; div -= 2; if (div > SDCDIV_MAX_CDIV) div = SDCDIV_MAX_CDIV; clock = host->max_clk / (div + 2); host->mmc->actual_clock = clock; /* Calibrate some delays */ host->ns_per_fifo_word = (1000000000 / clock) * ((host->mmc->caps & MMC_CAP_4_BIT_DATA) ? 8 : 32); host->cdiv = div; writel(host->cdiv, host->ioaddr + SDCDIV); /* Set the timeout to 500ms */ writel(host->mmc->actual_clock / 2, host->ioaddr + SDTOUT); } static void bcm2835_request(struct mmc_host *mmc, struct mmc_request *mrq) { struct bcm2835_host *host = mmc_priv(mmc); struct device *dev = &host->pdev->dev; u32 edm, fsm; /* Reset the error statuses in case this is a retry */ if (mrq->sbc) mrq->sbc->error = 0; if (mrq->cmd) mrq->cmd->error = 0; if (mrq->data) mrq->data->error = 0; if (mrq->stop) mrq->stop->error = 0; if (mrq->data && !is_power_of_2(mrq->data->blksz)) { dev_err(dev, "unsupported block size (%d bytes)\n", mrq->data->blksz); if (mrq->cmd) mrq->cmd->error = -EINVAL; mmc_request_done(mmc, mrq); return; } if (host->use_dma && mrq->data && (mrq->data->blocks > PIO_THRESHOLD)) bcm2835_prepare_dma(host, mrq->data); mutex_lock(&host->mutex); WARN_ON(host->mrq); host->mrq = mrq; edm = readl(host->ioaddr + SDEDM); fsm = edm & SDEDM_FSM_MASK; if ((fsm != SDEDM_FSM_IDENTMODE) && (fsm != SDEDM_FSM_DATAMODE)) { dev_err(dev, "previous command (%d) not complete (EDM %08x)\n", readl(host->ioaddr + SDCMD) & SDCMD_CMD_MASK, edm); bcm2835_dumpregs(host); if (mrq->cmd) mrq->cmd->error = -EILSEQ; bcm2835_finish_request(host); mutex_unlock(&host->mutex); return; } host->use_sbc = !!mrq->sbc && host->mrq->data && (host->mrq->data->flags & MMC_DATA_READ); if (host->use_sbc) { if (bcm2835_send_command(host, mrq->sbc)) { if (!host->use_busy) bcm2835_finish_command(host); } } else if (mrq->cmd && bcm2835_send_command(host, mrq->cmd)) { if (host->data && host->dma_desc) { /* DMA transfer starts now, PIO starts after irq */ bcm2835_start_dma(host); } if (!host->use_busy) bcm2835_finish_command(host); } mutex_unlock(&host->mutex); } static void bcm2835_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) { struct bcm2835_host *host = mmc_priv(mmc); mutex_lock(&host->mutex); if (!ios->clock || ios->clock != host->clock) { bcm2835_set_clock(host, ios->clock); host->clock = ios->clock; } /* set bus width */ host->hcfg &= ~SDHCFG_WIDE_EXT_BUS; if (ios->bus_width == MMC_BUS_WIDTH_4) host->hcfg |= SDHCFG_WIDE_EXT_BUS; host->hcfg |= SDHCFG_WIDE_INT_BUS; /* Disable clever clock switching, to cope with fast core clocks */ host->hcfg |= SDHCFG_SLOW_CARD; writel(host->hcfg, host->ioaddr + SDHCFG); mutex_unlock(&host->mutex); } static const struct mmc_host_ops bcm2835_ops = { .request = bcm2835_request, .set_ios = bcm2835_set_ios, .hw_reset = bcm2835_reset, }; static int bcm2835_add_host(struct bcm2835_host *host) { struct mmc_host *mmc = host->mmc; struct device *dev = &host->pdev->dev; char pio_limit_string[20]; int ret; if (!mmc->f_max || mmc->f_max > host->max_clk) mmc->f_max = host->max_clk; mmc->f_min = host->max_clk / SDCDIV_MAX_CDIV; mmc->max_busy_timeout = ~0 / (mmc->f_max / 1000); dev_dbg(dev, "f_max %d, f_min %d, max_busy_timeout %d\n", mmc->f_max, mmc->f_min, mmc->max_busy_timeout); /* host controller capabilities */ mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_NEEDS_POLL | MMC_CAP_HW_RESET | MMC_CAP_ERASE | MMC_CAP_CMD23; spin_lock_init(&host->lock); mutex_init(&host->mutex); if (IS_ERR_OR_NULL(host->dma_chan_rxtx)) { dev_warn(dev, "unable to initialise DMA channel. Falling back to PIO\n"); host->use_dma = false; } else { host->use_dma = true; host->dma_cfg_tx.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; host->dma_cfg_tx.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; host->dma_cfg_tx.slave_id = 13; /* DREQ channel */ host->dma_cfg_tx.direction = DMA_MEM_TO_DEV; host->dma_cfg_tx.src_addr = 0; host->dma_cfg_tx.dst_addr = host->phys_addr + SDDATA; host->dma_cfg_rx.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; host->dma_cfg_rx.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; host->dma_cfg_rx.slave_id = 13; /* DREQ channel */ host->dma_cfg_rx.direction = DMA_DEV_TO_MEM; host->dma_cfg_rx.src_addr = host->phys_addr + SDDATA; host->dma_cfg_rx.dst_addr = 0; if (dmaengine_slave_config(host->dma_chan_rxtx, &host->dma_cfg_tx) != 0 || dmaengine_slave_config(host->dma_chan_rxtx, &host->dma_cfg_rx) != 0) host->use_dma = false; } mmc->max_segs = 128; mmc->max_req_size = 524288; mmc->max_seg_size = mmc->max_req_size; mmc->max_blk_size = 1024; mmc->max_blk_count = 65535; /* report supported voltage ranges */ mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; INIT_WORK(&host->dma_work, bcm2835_dma_complete_work); INIT_DELAYED_WORK(&host->timeout_work, bcm2835_timeout); /* Set interrupt enables */ host->hcfg = SDHCFG_BUSY_IRPT_EN; bcm2835_reset_internal(host); ret = request_threaded_irq(host->irq, bcm2835_irq, bcm2835_threaded_irq, 0, mmc_hostname(mmc), host); if (ret) { dev_err(dev, "failed to request IRQ %d: %d\n", host->irq, ret); return ret; } ret = mmc_add_host(mmc); if (ret) { free_irq(host->irq, host); return ret; } pio_limit_string[0] = '\0'; if (host->use_dma && (PIO_THRESHOLD > 0)) sprintf(pio_limit_string, " (>%d)", PIO_THRESHOLD); dev_info(dev, "loaded - DMA %s%s\n", host->use_dma ? "enabled" : "disabled", pio_limit_string); return 0; } static int bcm2835_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct clk *clk; struct resource *iomem; struct bcm2835_host *host; struct mmc_host *mmc; const __be32 *regaddr_p; int ret; dev_dbg(dev, "%s\n", __func__); mmc = mmc_alloc_host(sizeof(*host), dev); if (!mmc) return -ENOMEM; mmc->ops = &bcm2835_ops; host = mmc_priv(mmc); host->mmc = mmc; host->pdev = pdev; spin_lock_init(&host->lock); iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->ioaddr = devm_ioremap_resource(dev, iomem); if (IS_ERR(host->ioaddr)) { ret = PTR_ERR(host->ioaddr); goto err; } /* Parse OF address directly to get the physical address for * DMA to our registers. */ regaddr_p = of_get_address(pdev->dev.of_node, 0, NULL, NULL); if (!regaddr_p) { dev_err(dev, "Can't get phys address\n"); ret = -EINVAL; goto err; } host->phys_addr = be32_to_cpup(regaddr_p); host->dma_chan = NULL; host->dma_desc = NULL; host->dma_chan_rxtx = dma_request_slave_channel(dev, "rx-tx"); clk = devm_clk_get(dev, NULL); if (IS_ERR(clk)) { ret = PTR_ERR(clk); if (ret != -EPROBE_DEFER) dev_err(dev, "could not get clk: %d\n", ret); goto err; } host->max_clk = clk_get_rate(clk); host->irq = platform_get_irq(pdev, 0); if (host->irq <= 0) { dev_err(dev, "get IRQ failed\n"); ret = -EINVAL; goto err; } ret = mmc_of_parse(mmc); if (ret) goto err; ret = bcm2835_add_host(host); if (ret) goto err; platform_set_drvdata(pdev, host); dev_dbg(dev, "%s -> OK\n", __func__); return 0; err: dev_dbg(dev, "%s -> err %d\n", __func__, ret); mmc_free_host(mmc); return ret; } static int bcm2835_remove(struct platform_device *pdev) { struct bcm2835_host *host = platform_get_drvdata(pdev); mmc_remove_host(host->mmc); writel(SDVDD_POWER_OFF, host->ioaddr + SDVDD); free_irq(host->irq, host); cancel_work_sync(&host->dma_work); cancel_delayed_work_sync(&host->timeout_work); mmc_free_host(host->mmc); platform_set_drvdata(pdev, NULL); return 0; } static const struct of_device_id bcm2835_match[] = { { .compatible = "brcm,bcm2835-sdhost" }, { } }; MODULE_DEVICE_TABLE(of, bcm2835_match); static struct platform_driver bcm2835_driver = { .probe = bcm2835_probe, .remove = bcm2835_remove, .driver = { .name = "sdhost-bcm2835", .of_match_table = bcm2835_match, }, }; module_platform_driver(bcm2835_driver); MODULE_ALIAS("platform:sdhost-bcm2835"); MODULE_DESCRIPTION("BCM2835 SDHost driver"); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Phil Elwell");
{ "pile_set_name": "Github" }
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. */ package org.topbraid.jenax.functions; import org.apache.jena.graph.Node; import org.apache.jena.sparql.expr.NodeValue; import org.apache.jena.sparql.function.FunctionEnv; /** * An abstract superclass for Functions with 4 arguments. * * @author Holger Knublauch */ public abstract class AbstractFunction4 extends AbstractFunction { @Override protected NodeValue exec(Node[] nodes, FunctionEnv env) { Node arg1 = nodes.length > 0 ? nodes[0] : null; Node arg2 = nodes.length > 1 ? nodes[1] : null; Node arg3 = nodes.length > 2 ? nodes[2] : null; Node arg4 = nodes.length > 3 ? nodes[3] : null; return exec(arg1, arg2, arg3, arg4, env); } protected abstract NodeValue exec(Node arg1, Node arg2, Node arg3, Node arg4, FunctionEnv env); }
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Goteo Package. * * (c) Platoniq y Fundación Goteo <[email protected]> * * For the full copyright and license information, please view the README.md * and LICENSE files that was distributed with this source code. */ use Goteo\Core\View; $element = $this['element']; ?> <?php if (isset($element->title)): ?> <h<?php echo $element->level ?> class="title"><?php echo htmlspecialchars($element->title) ?></h<?php echo $element->level ?>> <?php endif ?> <?php if ('' !== ($innerHTML = $element->getInnerHTML())): ?> <div class="contents"> <?php echo $innerHTML?> </div> <?php endif ?> <?php if (!empty($element->children) && $element->type == 'group'): ?> <div class="children"> <?php echo new View('superform/elements.html.php', $element->children) ?> </div> <?php endif ?>
{ "pile_set_name": "Github" }
From 09a0122c74ec076e08512f1b00b7ccb8a450282f Mon Sep 17 00:00:00 2001 From: Russell King <[email protected]> Date: Tue, 29 Nov 2016 10:15:43 +0000 Subject: ARM: dts: armada388-clearfog: document MPP usage Signed-off-by: Russell King <[email protected]> --- arch/arm/boot/dts/armada-388-clearfog-base.dts | 51 ++++++++++++++++++++++++++ arch/arm/boot/dts/armada-388-clearfog.dts | 50 +++++++++++++++++++++++++ 2 files changed, 101 insertions(+) --- a/arch/arm/boot/dts/armada-388-clearfog-base.dts +++ b/arch/arm/boot/dts/armada-388-clearfog-base.dts @@ -108,3 +108,54 @@ marvell,function = "gpio"; }; }; + +/* +MPP +18: pu gpio pca9655 int +19: gpio phy reset +20: pu gpio sd0 detect +21: sd0:cmd +22: pd gpio mikro int +23: + +24: ua1:rxd mikro rx +25: ua1:txd mikro tx +26: pu i2c1:sck +27: pu i2c1:sda +28: sd0:clk +29: pd gpio mikro rst +30: +31: + +32: +33: +34: +35: +36: +37: sd0:d3 +38: sd0:d0 +39: sd0:d1 + +40: sd0:d2 +41: +42: +43: spi1:cs2 mikro cs +44: gpio rear button sw3 +45: ref:clk_out0 phy#0 clock +46: ref:clk_out1 phy#1 clock +47: + +48: gpio J18 spare gpio +49: gpio U10 I2C_IRQ(GNSS) +50: gpio board id? +51: +52: +53: +54: gpio mikro pwm +55: + +56: pu spi1:mosi mikro mosi +57: pd spi1:sck mikro sck +58: spi1:miso mikro miso +59: +*/ --- a/arch/arm/boot/dts/armada-388-clearfog.dts +++ b/arch/arm/boot/dts/armada-388-clearfog.dts @@ -290,3 +290,53 @@ */ pinctrl-0 = <&spi1_pins &clearfog_spi1_cs_pins &mikro_spi_pins>; }; +/* ++#define A38x_CUSTOMER_BOARD_1_MPP16_23 0x00400011 +MPP18: gpio ? (pca9655 int?) +MPP19: gpio ? (clkreq?) +MPP20: gpio ? (sd0 detect) +MPP21: sd0:cmd x sd0 +MPP22: gpio x mikro int +MPP23: gpio x switch irq ++#define A38x_CUSTOMER_BOARD_1_MPP24_31 0x22043333 +MPP24: ua1:rxd x mikro rx +MPP25: ua1:txd x mikro tx +MPP26: i2c1:sck x mikro sck +MPP27: i2c1:sda x mikro sda +MPP28: sd0:clk x sd0 +MPP29: gpio x mikro rst +MPP30: ge1:txd2 ? (config) +MPP31: ge1:txd3 ? (config) ++#define A38x_CUSTOMER_BOARD_1_MPP32_39 0x44400002 +MPP32: ge1:txctl ? (unused) +MPP33: gpio ? (pic_com0) +MPP34: gpio x rear button (pic_com1) +MPP35: gpio ? (pic_com2) +MPP36: gpio ? (unused) +MPP37: sd0:d3 x sd0 +MPP38: sd0:d0 x sd0 +MPP39: sd0:d1 x sd0 ++#define A38x_CUSTOMER_BOARD_1_MPP40_47 0x41144004 +MPP40: sd0:d2 x sd0 +MPP41: gpio x switch reset +MPP42: gpio ? sw1-1 +MPP43: spi1:cs2 x mikro cs +MPP44: sata3:prsnt ? (unused) +MPP45: ref:clk_out0 ? +MPP46: ref:clk_out1 x switch clk +MPP47: 4 ? (unused) ++#define A38x_CUSTOMER_BOARD_1_MPP48_55 0x40333333 +MPP48: tdm:pclk +MPP49: tdm:fsync +MPP50: tdm:drx +MPP51: tdm:dtx +MPP52: tdm:int +MPP53: tdm:rst +MPP54: gpio ? (pwm) +MPP55: spi1:cs1 x slic ++#define A38x_CUSTOMER_BOARD_1_MPP56_63 0x00004444 +MPP56: spi1:mosi x mikro mosi +MPP57: spi1:sck x mikro sck +MPP58: spi1:miso x mikro miso +MPP59: spi1:cs0 x w25q32 +*/
{ "pile_set_name": "Github" }
/* * Copyright (c) 2003-2012 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _FILESEC_T #define _FILESEC_T struct _filesec; typedef struct _filesec *filesec_t; #endif /* _FILESEC_T */
{ "pile_set_name": "Github" }
// Copyright (c) 2016-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <bench/bench.h> #include <chainparams.h> #include <validation.h> #include <streams.h> #include <consensus/validation.h> namespace block_bench { #include <bench/data/block413567.raw.h> } // namespace block_bench // These are the two major time-sinks which happen after we have fully received // a block off the wire, but before we can relay the block on to peers using // compact block relay. static void DeserializeBlockTest(benchmark::State& state) { CDataStream stream((const char*)block_bench::block413567, (const char*)block_bench::block413567 + sizeof(block_bench::block413567), SER_NETWORK, PROTOCOL_VERSION); char a = '\0'; stream.write(&a, 1); // Prevent compaction while (state.KeepRunning()) { CBlock block; stream >> block; bool rewound = stream.Rewind(sizeof(block_bench::block413567)); assert(rewound); } } static void DeserializeAndCheckBlockTest(benchmark::State& state) { CDataStream stream((const char*)block_bench::block413567, (const char*)block_bench::block413567 + sizeof(block_bench::block413567), SER_NETWORK, PROTOCOL_VERSION); char a = '\0'; stream.write(&a, 1); // Prevent compaction const auto chainParams = CreateChainParams(CBaseChainParams::MAIN); while (state.KeepRunning()) { CBlock block; // Note that CBlock caches its checked state, so we need to recreate it here stream >> block; bool rewound = stream.Rewind(sizeof(block_bench::block413567)); assert(rewound); CValidationState validationState; bool checked = CheckBlock(block, validationState, *chainParams); assert(checked); } } BENCHMARK(DeserializeBlockTest, 130); BENCHMARK(DeserializeAndCheckBlockTest, 160);
{ "pile_set_name": "Github" }
/* sorted_vector.h -*- C++ -*- Jeremy Barnes, 6 March 2005 Copyright (c) 2005 Jeremy Barnes. All rights reserved. $Source:$ $Id:$ This file is part of "Jeremy's Machine Learning Library", copyright (c) 1999-2005 Jeremy Barnes. This program is available under the GNU General Public License, the terms of which are given by the file "license.txt" in the top level directory of the source code distribution. If this file is missing, you have no right to use the program; please contact the author. 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. --- Sorted vector<pair>, that acts like a memory-efficient map. */ #ifndef __utils__sorted_vector_h__ #define __utils__sorted_vector_h__ #include <vector> #include <algorithm> #include <utility> namespace ML { /*****************************************************************************/ /* SORTED_VECTOR */ /*****************************************************************************/ /** Class that looks like a map, but in fact stores its contents as a sorted vector, where searches are binary searches. */ template<class Key, class Data, class Compare = std::less<std::pair<Key, Data> > > class sorted_vector { typedef std::vector<std::pair<Key, Data> > base_type; /* Immutable map interface, but lives in a sorted vector. */ public: sorted_vector() { } template<class Iterator> sorted_vector(Iterator first, Iterator last) : base(first, last) { std::sort(base.begin(), base.end(), Compare()); } typedef std::pair<const Key, Data> value_type; typedef value_type & reference; typedef value_type * pointer; typedef typename base_type::iterator iterator; typedef typename base_type::const_iterator const_iterator; iterator begin() { return base.begin(); } iterator end() { return base.end(); } const_iterator begin() const { return base.begin(); } const_iterator end() const { return base.end(); } iterator find(const Key & key) { return std::binary_search(begin(), end(), key, Compare()); } const_iterator find(const Key & key) const { return std::binary_search(begin(), end(), key, Compare()); } iterator lower_bound(const Key & key) { return std::lower_bound(begin(), end(), key, Compare()); } const_iterator lower_bound(const Key & key) const { return std::lower_bound(begin(), end(), key, Compare()); } iterator upper_bound(const Key & key) { return std::upper_bound(begin(), end(), key, Compare()); } const_iterator upper_bound(const Key & key) const { return std::upper_bound(begin(), end(), key, Compare()); } size_t size() const { return base.size(); } bool empty() const { return base.empty(); } private: base_type base; }; } // namespace ML #endif /* __utils__sorted_vector_h__ */
{ "pile_set_name": "Github" }
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, dis- # tribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to the fol- # lowing conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. # from tests.unit import unittest from boto.ecs import ECSConnection from tests.unit import AWSMockServiceTestCase class TestECSConnection(AWSMockServiceTestCase): connection_class = ECSConnection def default_body(self): return b""" <Items> <Request> <IsValid>True</IsValid> <ItemLookupRequest> <ItemId>B00008OE6I</ItemId> </ItemLookupRequest> </Request> <Item> <ASIN>B00008OE6I</ASIN> <ItemAttributes> <Manufacturer>Canon</Manufacturer> <ProductGroup>Photography</ProductGroup> <Title>Canon PowerShot S400 4MP Digital Camera w/ 3x Optical Zoom</Title> </ItemAttributes> </Item> </Items> """ def test_item_lookup(self): self.set_http_response(status_code=200) item_set = self.service_connection.item_lookup( ItemId='0316067938', ResponseGroup='Reviews' ) self.assert_request_parameters( {'ItemId': '0316067938', 'Operation': 'ItemLookup', 'ResponseGroup': 'Reviews', 'Service': 'AWSECommerceService'}, ignore_params_values=['Version', 'AWSAccessKeyId', 'SignatureMethod', 'SignatureVersion', 'Timestamp']) items = list(item_set) self.assertEqual(len(items), 1) self.assertTrue(item_set.is_valid) self.assertEqual(items[0].ASIN, 'B00008OE6I')
{ "pile_set_name": "Github" }
--- title: Addons.Application Property (Visio) keywords: vis_sdr.chm12513090 f1_keywords: - vis_sdr.chm12513090 ms.prod: visio api_name: - Visio.Addons.Application ms.assetid: 9ff50b95-8ac5-407b-6c93-c5c805efb3ab ms.date: 06/08/2017 --- # Addons.Application Property (Visio) Returns the instance of Microsoft Visio that is associated with an object. Read-only. ## Syntax _expression_ . **Application** _expression_ A variable that represents an **Addons** object. ### Return Value Application ## Example The following Microsoft Visual Basic for Applications (VBA) macro gets the **Application** object associated with the active document and prints its process ID number in the Immediate window. ```vb Public Sub Application_Example() Dim vsoApplication As Visio.Application Dim vsoDocument As Visio.Document Set vsoDocument = ActiveDocument 'Get the instance of Visio associated with the Document object. Set vsoApplication = vsoDocument.Application Debug.Print "The process ID of the Application object associated with the active document is: " &; vsoApplication.ProcessID End Sub ```
{ "pile_set_name": "Github" }
/* * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Copyright (c) 1999 * Boris Fomitchev * * This material is provided "as is", with absolutely no warranty expressed * or implied. Any use is at your own risk. * * Permission to use or copy this software for any purpose is hereby granted * without fee, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. * */ #ifndef _STLP_HASH_MAP #define _STLP_HASH_MAP #ifndef _STLP_OUTERMOST_HEADER_ID # define _STLP_OUTERMOST_HEADER_ID 0x4028 # include <stl/_prolog.h> #endif #ifdef _STLP_PRAGMA_ONCE # pragma once #endif #if defined (_STLP_NO_EXTENSIONS) /* Comment following if you want to use hash constainers even if you ask for * no extension. */ # error The hash_map and hash_multimap class are STLport extensions. #endif #include <stl/_hash_map.h> #if (_STLP_OUTERMOST_HEADER_ID == 0x4028) # include <stl/_epilog.h> # undef _STLP_OUTERMOST_HEADER_ID #endif #endif /* _STLP_HASH_MAP */ // Local Variables: // mode:C++ // End:
{ "pile_set_name": "Github" }
<component name="libraryTable"> <library name="Maven: org.apache.commons:commons-compress:1.4.1"> <CLASSES> <root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar!/" /> </CLASSES> <JAVADOC> <root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1-javadoc.jar!/" /> </JAVADOC> <SOURCES> <root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1-sources.jar!/" /> </SOURCES> </library> </component>
{ "pile_set_name": "Github" }
/* @(#)rstat.x 2.2 88/08/01 4.0 RPCSRC */ /* * Copyright (c) 2010, Oracle America, Inc. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the "Oracle America, Inc." nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Gather statistics on remote machines */ #ifdef RPC_HDR %#ifndef FSCALE %/* % * Scale factor for scaled integers used to count load averages. % */ %#define FSHIFT 8 /* bits to right of fixed binary point */ %#define FSCALE (1<<FSHIFT) % %#endif /* ndef FSCALE */ #endif /* def RPC_HDR */ const CPUSTATES = 4; const DK_NDRIVE = 4; /* * GMT since 0:00, January 1, 1970 */ struct rstat_timeval { unsigned int tv_sec; /* seconds */ unsigned int tv_usec; /* and microseconds */ }; struct statstime { /* RSTATVERS_TIME */ int cp_time[CPUSTATES]; int dk_xfer[DK_NDRIVE]; unsigned int v_pgpgin; /* these are cumulative sum */ unsigned int v_pgpgout; unsigned int v_pswpin; unsigned int v_pswpout; unsigned int v_intr; int if_ipackets; int if_ierrors; int if_oerrors; int if_collisions; unsigned int v_swtch; int avenrun[3]; /* scaled by FSCALE */ rstat_timeval boottime; rstat_timeval curtime; int if_opackets; }; struct statsswtch { /* RSTATVERS_SWTCH */ int cp_time[CPUSTATES]; int dk_xfer[DK_NDRIVE]; unsigned int v_pgpgin; /* these are cumulative sum */ unsigned int v_pgpgout; unsigned int v_pswpin; unsigned int v_pswpout; unsigned int v_intr; int if_ipackets; int if_ierrors; int if_oerrors; int if_collisions; unsigned int v_swtch; unsigned int avenrun[3];/* scaled by FSCALE */ rstat_timeval boottime; int if_opackets; }; struct stats { /* RSTATVERS_ORIG */ int cp_time[CPUSTATES]; int dk_xfer[DK_NDRIVE]; unsigned int v_pgpgin; /* these are cumulative sum */ unsigned int v_pgpgout; unsigned int v_pswpin; unsigned int v_pswpout; unsigned int v_intr; int if_ipackets; int if_ierrors; int if_oerrors; int if_collisions; int if_opackets; }; program RSTATPROG { /* * Newest version includes current time and context switching info */ version RSTATVERS_TIME { statstime RSTATPROC_STATS(void) = 1; unsigned int RSTATPROC_HAVEDISK(void) = 2; } = 3; /* * Does not have current time */ version RSTATVERS_SWTCH { statsswtch RSTATPROC_STATS(void) = 1; unsigned int RSTATPROC_HAVEDISK(void) = 2; } = 2; /* * Old version has no info about current time or context switching */ version RSTATVERS_ORIG { stats RSTATPROC_STATS(void) = 1; unsigned int RSTATPROC_HAVEDISK(void) = 2; } = 1; } = 100001;
{ "pile_set_name": "Github" }
const map = new CartoMap({ container: 'map', background: 'black' }); const source = new carto.source.GeoJSON(sources['many-points']); const viz = new carto.Viz(` width: $numeric*5 strokeWidth: 1 order: asc(@w) @w: width() `); const layer = new carto.Layer('layer', source, viz); layer.addTo(map); layer.on('loaded', () => { window.loaded = true; });
{ "pile_set_name": "Github" }
#!/bin/sh . ../.function ## options.test -- Test options feature start_msg options #UTRACE="0 5M 0" #UOBJDUMP="0 100k 10" #USIMERR="error.sim" export UTRACE UOBJDUMP USIMERR # ---------------------------------------------------------------------------- # sample2.ggo # ---------------------------------------------------------------------------- # purpose "this is just a test program for gengetopt" # option "str-opt" s "A string option" string no # option "int-opt" i "A int option" int yes # option "short-opt" S "A short option" short no # option "long-opt" l "A long option" long yes # option "float-opt" f "A float option" float no # option "double-opt" d "A double option" double no # option "long-double-opt" L "A long double option" longdouble no # option "long-long-opt" y "A long long option" longlong no # option "func-opt" F "A function option" no # option "flag-opt" x "A flag option" flag off # ---------------------------------------------------------------------------- start_prg options -h # Test against expected output test_output_wc w options
{ "pile_set_name": "Github" }
@model UserViewModel @{ ViewBag.Title = SiteStrings.SiteSettings_UserManagement_AddEditor_Title; ViewData["UsersActive"] = true; } <script type="text/javascript"> $(document).ready(function () { // Form validation var validationRules = { NewUsername: { required: true }, Password: { required: true }, PasswordConfirmation: { required: true } }; var validation = new Roadkill.Web.Validation(); validation.Configure("#addedit-user-form", validationRules); }); </script> @Html.SiteSettingsNavigation() <div class="col-lg-6"> <h2> @SiteStrings.SiteSettings_UserManagement_AddEditor_Title </h2> @Html.BootstrapValidationSummary(SiteStrings.SiteSettings_UserManagement_AddUser_Error) <form role="form" method="post" id="addedit-user-form"> <div class="form-group"> <label for="NewUsername">@SiteStrings.Shared_Username_Label</label> @Html.BootstrapTextBoxFor(s => s.NewUsername, SiteStrings.SiteSettings_UserManagement_AddUser_Help) </div> <div class="form-group"> <label for="NewEmail">@SiteStrings.Shared_Email_Label</label> @Html.BootstrapTextBoxFor(s => s.NewEmail, SiteStrings.Shared_Email_Label) </div> <div class="form-group"> <label for="Password">@SiteStrings.Shared_Password_Label</label> @Html.BootstrapPasswordFor(s => s.Password, SiteStrings.Shared_Password_Label) </div> <div class="form-group"> <label for="PasswordConfirmation">@SiteStrings.Shared_PasswordConfirm_Label</label> @Html.BootstrapPasswordFor(s => s.PasswordConfirmation, SiteStrings.Shared_PasswordConfirm_Label) </div> <div class="form-group"> <input type="submit" value="@SiteStrings.Button_Save" class="btn btn-primary right" /> </div> </form> </div>
{ "pile_set_name": "Github" }
<%= @email_request.user.full_name %> has sent you an idea <%= @email_request.message %> Idea <%= @email_request.idea.id %>: <%= @email_request.idea.title %> <%= @email_request.idea.description %> Product: <%= @email_request.idea.product.name %> Votes: <%= @email_request.idea.votes.size %>
{ "pile_set_name": "Github" }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <stdint.h> namespace { // This is the SHA1 hash of the SubjectPublicKeyInfo of nist.der. static const char kNistSPKIHash[] = "\x15\x60\xde\x65\x4e\x03\x9f\xd0\x08\x82" "\xa9\x6a\xc4\x65\x8e\x6f\x92\x06\x84\x35"; // kTwitterSPKIs contains the SHA1 hashes of the SPKIs of the twitter-chain.pem // certificate chain, in order. static const char kTwitterSPKIs[3][21] = { "\x26\x9a\x19\xa3\x88\x28\xc1\xdd\x70\x1b" "\xa0\xca\x2c\x98\xdb\xc6\xe1\x4f\x37\x3e", "\x47\x49\xdf\x16\x57\xf4\x6c\x8b\xd2\x8c" "\x79\x1b\x99\xfb\x9f\x28\x81\x2a\x60\xe0", "\xb1\x81\x08\x1a\x19\xa4\xc0\x94\x1f\xfa" "\xe8\x95\x28\xc1\x24\xc9\x9b\x34\xac\xc7", }; // kTwitterSPKIsSHA256 contains the SHA256 hashes of the SPKIs of the // twitter-chain.pem certificate chain, in order. static const char kTwitterSPKIsSHA256[3][33] = { "\x20\xec\x5d\x0a\xfb\xc6\xc0\xe2\xe1\x95\x56\xc5\x35\x2b\x3c\x60" "\x78\xa6\xed\x95\x55\xc2\xfa\x86\x82\x40\x4f\xdb\x55\x29\xd3\xad", "\x80\xcc\x56\x3a\xb5\xf8\x3c\xc4\x1e\xb0\xaf\x6a\x14\xd6\xd8\x07" "\x18\xc1\x7e\x35\x2f\x96\x49\xff\xbc\xdd\x67\xf8\xbf\x65\x13\x91", "\x25\xb4\x1b\x50\x6e\x49\x30\x95\x28\x23\xa6\xeb\x9f\x1d\x31\xde" "\xf6\x45\xea\x38\xa5\xc6\xc6\xa9\x6d\x71\x95\x7e\x38\x4d\xf0\x58", }; // Certificates for test data. They're obtained with: // // $ openssl s_client -connect [host]:443 -showcerts > /tmp/host.pem < /dev/null // $ openssl x509 -inform PEM -outform DER < /tmp/host.pem > /tmp/host.der // $ xxd -i /tmp/host.der // // TODO(wtc): move these certificates to data files in the // src/net/data/ssl/certificates directory. // The linux compiler is nitty about unused variables. Declaring variables // in headers is not generally a good idea, but for our test data it is not // a big deal. Mark these as potentially unused so that the compiler won't // complain. #ifdef __GNUC__ #define VARIABLE_IS_NOT_USED __attribute__ ((unused)) #else #define VARIABLE_IS_NOT_USED #endif // Google's cert. unsigned char VARIABLE_IS_NOT_USED google_der[] = { 0x30, 0x82, 0x03, 0x21, 0x30, 0x82, 0x02, 0x8a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x01, 0x2a, 0x39, 0x76, 0x0d, 0x3f, 0x4f, 0xc9, 0x0b, 0xe7, 0xbd, 0x2b, 0xcf, 0x95, 0x2e, 0x7a, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x5a, 0x41, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x1c, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x28, 0x50, 0x74, 0x79, 0x29, 0x20, 0x4c, 0x74, 0x64, 0x2e, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0d, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x53, 0x47, 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x39, 0x30, 0x33, 0x32, 0x37, 0x32, 0x32, 0x32, 0x30, 0x30, 0x37, 0x5a, 0x17, 0x0d, 0x31, 0x30, 0x30, 0x33, 0x32, 0x37, 0x32, 0x32, 0x32, 0x30, 0x30, 0x37, 0x5a, 0x30, 0x68, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0d, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x56, 0x69, 0x65, 0x77, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0e, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xd6, 0xb9, 0xe1, 0xad, 0xb8, 0x61, 0x0b, 0x1f, 0x4e, 0xb6, 0x3c, 0x09, 0x3d, 0xab, 0xe8, 0xe3, 0x2b, 0xb6, 0xe8, 0xa4, 0x3a, 0x78, 0x2f, 0xd3, 0x51, 0x20, 0x22, 0x45, 0x95, 0xd8, 0x00, 0x91, 0x33, 0x9a, 0xa7, 0xa2, 0x48, 0xea, 0x30, 0x57, 0x26, 0x97, 0x66, 0xc7, 0x5a, 0xef, 0xf1, 0x9b, 0x0c, 0x3f, 0xe1, 0xb9, 0x7f, 0x7b, 0xc3, 0xc7, 0xcc, 0xaf, 0x9c, 0xd0, 0x1f, 0x3c, 0x81, 0x15, 0x10, 0x58, 0xfc, 0x06, 0xb3, 0xbf, 0xbc, 0x9c, 0x02, 0xb9, 0x51, 0xdc, 0xfb, 0xa6, 0xb9, 0x17, 0x42, 0xe6, 0x46, 0xe7, 0x22, 0xcf, 0x6c, 0x27, 0x10, 0xfe, 0x54, 0xe6, 0x92, 0x6c, 0x0c, 0x60, 0x76, 0x9a, 0xce, 0xf8, 0x7f, 0xac, 0xb8, 0x5a, 0x08, 0x4a, 0xdc, 0xb1, 0x64, 0xbd, 0xa0, 0x74, 0x41, 0xb2, 0xac, 0x8f, 0x86, 0x9d, 0x1a, 0xde, 0x58, 0x09, 0xfd, 0x6c, 0x0a, 0x25, 0xe0, 0x79, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0xe7, 0x30, 0x81, 0xe4, 0x30, 0x28, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x21, 0x30, 0x1f, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x04, 0x01, 0x30, 0x36, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x2f, 0x30, 0x2d, 0x30, 0x2b, 0xa0, 0x29, 0xa0, 0x27, 0x86, 0x25, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x72, 0x6c, 0x2e, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x53, 0x47, 0x43, 0x43, 0x41, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x72, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x66, 0x30, 0x64, 0x30, 0x22, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x16, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2e, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x3e, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x32, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x5f, 0x53, 0x47, 0x43, 0x5f, 0x43, 0x41, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x39, 0xb6, 0xfb, 0x11, 0xbc, 0x33, 0x2c, 0xc3, 0x90, 0x48, 0xe3, 0x6e, 0xc3, 0x9b, 0x38, 0xb1, 0x42, 0xd1, 0x00, 0x09, 0x58, 0x63, 0xa0, 0xe1, 0x98, 0x1c, 0x85, 0xf2, 0xef, 0x10, 0x1d, 0x60, 0x4e, 0x51, 0x09, 0x62, 0xf5, 0x05, 0xbd, 0x9d, 0x4f, 0x87, 0x6c, 0x98, 0x72, 0x07, 0x80, 0xc3, 0x59, 0x48, 0x14, 0xe2, 0xd6, 0xef, 0xd0, 0x8f, 0x33, 0x6a, 0x68, 0x31, 0xfa, 0xb7, 0xbb, 0x85, 0xcc, 0xf7, 0xc7, 0x47, 0x7b, 0x67, 0x93, 0x3c, 0xc3, 0x16, 0x51, 0x9b, 0x6f, 0x87, 0x20, 0xfd, 0x67, 0x4c, 0x2b, 0xea, 0x6a, 0x49, 0xdb, 0x11, 0xd1, 0xbd, 0xd7, 0x95, 0x22, 0x43, 0x7a, 0x06, 0x7b, 0x4e, 0xf6, 0x37, 0x8e, 0xa2, 0xb9, 0xcf, 0x1f, 0xa5, 0xd2, 0xbd, 0x3b, 0x04, 0x97, 0x39, 0xb3, 0x0f, 0xfa, 0x38, 0xb5, 0xaf, 0x55, 0x20, 0x88, 0x60, 0x93, 0xf2, 0xde, 0xdb, 0xff, 0xdf }; // webkit.org's cert. unsigned char VARIABLE_IS_NOT_USED webkit_der[] = { 0x30, 0x82, 0x05, 0x0d, 0x30, 0x82, 0x03, 0xf5, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x03, 0x43, 0xdd, 0x63, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x81, 0xca, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x07, 0x41, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x61, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0a, 0x53, 0x63, 0x6f, 0x74, 0x74, 0x73, 0x64, 0x61, 0x6c, 0x65, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x11, 0x47, 0x6f, 0x44, 0x61, 0x64, 0x64, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x33, 0x30, 0x31, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x2a, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x67, 0x6f, 0x64, 0x61, 0x64, 0x64, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x31, 0x30, 0x30, 0x2e, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x27, 0x47, 0x6f, 0x20, 0x44, 0x61, 0x64, 0x64, 0x79, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x05, 0x13, 0x08, 0x30, 0x37, 0x39, 0x36, 0x39, 0x32, 0x38, 0x37, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x38, 0x30, 0x33, 0x31, 0x38, 0x32, 0x33, 0x33, 0x35, 0x31, 0x39, 0x5a, 0x17, 0x0d, 0x31, 0x31, 0x30, 0x33, 0x31, 0x38, 0x32, 0x33, 0x33, 0x35, 0x31, 0x39, 0x5a, 0x30, 0x79, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x09, 0x43, 0x75, 0x70, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x6f, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0c, 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x46, 0x6f, 0x72, 0x67, 0x65, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0c, 0x2a, 0x2e, 0x77, 0x65, 0x62, 0x6b, 0x69, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xa7, 0x62, 0x79, 0x41, 0xda, 0x28, 0xf2, 0xc0, 0x4f, 0xe0, 0x25, 0xaa, 0xa1, 0x2e, 0x3b, 0x30, 0x94, 0xb5, 0xc9, 0x26, 0x3a, 0x1b, 0xe2, 0xd0, 0xcc, 0xa2, 0x95, 0xe2, 0x91, 0xc0, 0xf0, 0x40, 0x9e, 0x27, 0x6e, 0xbd, 0x6e, 0xde, 0x7c, 0xb6, 0x30, 0x5c, 0xb8, 0x9b, 0x01, 0x2f, 0x92, 0x04, 0xa1, 0xef, 0x4a, 0xb1, 0x6c, 0xb1, 0x7e, 0x8e, 0xcd, 0xa6, 0xf4, 0x40, 0x73, 0x1f, 0x2c, 0x96, 0xad, 0xff, 0x2a, 0x6d, 0x0e, 0xba, 0x52, 0x84, 0x83, 0xb0, 0x39, 0xee, 0xc9, 0x39, 0xdc, 0x1e, 0x34, 0xd0, 0xd8, 0x5d, 0x7a, 0x09, 0xac, 0xa9, 0xee, 0xca, 0x65, 0xf6, 0x85, 0x3a, 0x6b, 0xee, 0xe4, 0x5c, 0x5e, 0xf8, 0xda, 0xd1, 0xce, 0x88, 0x47, 0xcd, 0x06, 0x21, 0xe0, 0xb9, 0x4b, 0xe4, 0x07, 0xcb, 0x57, 0xdc, 0xca, 0x99, 0x54, 0xf7, 0x0e, 0xd5, 0x17, 0x95, 0x05, 0x2e, 0xe9, 0xb1, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0xce, 0x30, 0x82, 0x01, 0xca, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x05, 0xa0, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x57, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x50, 0x30, 0x4e, 0x30, 0x4c, 0xa0, 0x4a, 0xa0, 0x48, 0x86, 0x46, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x67, 0x6f, 0x64, 0x61, 0x64, 0x64, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x67, 0x6f, 0x64, 0x61, 0x64, 0x64, 0x79, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x69, 0x73, 0x73, 0x75, 0x69, 0x6e, 0x67, 0x33, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x52, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x4b, 0x30, 0x49, 0x30, 0x47, 0x06, 0x0b, 0x60, 0x86, 0x48, 0x01, 0x86, 0xfd, 0x6d, 0x01, 0x07, 0x17, 0x02, 0x30, 0x38, 0x30, 0x36, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x2a, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x67, 0x6f, 0x64, 0x61, 0x64, 0x64, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x30, 0x7f, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x73, 0x30, 0x71, 0x30, 0x23, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x17, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2e, 0x67, 0x6f, 0x64, 0x61, 0x64, 0x64, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x4a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x3e, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x67, 0x6f, 0x64, 0x61, 0x64, 0x64, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x67, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x48, 0xdf, 0x60, 0x32, 0xcc, 0x89, 0x01, 0xb6, 0xdc, 0x2f, 0xe3, 0x73, 0xb5, 0x9c, 0x16, 0x58, 0x32, 0x68, 0xa9, 0xc3, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xfd, 0xac, 0x61, 0x32, 0x93, 0x6c, 0x45, 0xd6, 0xe2, 0xee, 0x85, 0x5f, 0x9a, 0xba, 0xe7, 0x76, 0x99, 0x68, 0xcc, 0xe7, 0x30, 0x23, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x1c, 0x30, 0x1a, 0x82, 0x0c, 0x2a, 0x2e, 0x77, 0x65, 0x62, 0x6b, 0x69, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x82, 0x0a, 0x77, 0x65, 0x62, 0x6b, 0x69, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x1e, 0x6a, 0xe7, 0xe0, 0x4f, 0xe7, 0x4d, 0xd0, 0x69, 0x7c, 0xf8, 0x8f, 0x99, 0xb4, 0x18, 0x95, 0x36, 0x24, 0x0f, 0x0e, 0xa3, 0xea, 0x34, 0x37, 0xf4, 0x7d, 0xd5, 0x92, 0x35, 0x53, 0x72, 0x76, 0x3f, 0x69, 0xf0, 0x82, 0x56, 0xe3, 0x94, 0x7a, 0x1d, 0x1a, 0x81, 0xaf, 0x9f, 0xc7, 0x43, 0x01, 0x64, 0xd3, 0x7c, 0x0d, 0xc8, 0x11, 0x4e, 0x4a, 0xe6, 0x1a, 0xc3, 0x01, 0x74, 0xe8, 0x35, 0x87, 0x5c, 0x61, 0xaa, 0x8a, 0x46, 0x06, 0xbe, 0x98, 0x95, 0x24, 0x9e, 0x01, 0xe3, 0xe6, 0xa0, 0x98, 0xee, 0x36, 0x44, 0x56, 0x8d, 0x23, 0x9c, 0x65, 0xea, 0x55, 0x6a, 0xdf, 0x66, 0xee, 0x45, 0xe8, 0xa0, 0xe9, 0x7d, 0x9a, 0xba, 0x94, 0xc5, 0xc8, 0xc4, 0x4b, 0x98, 0xff, 0x9a, 0x01, 0x31, 0x6d, 0xf9, 0x2b, 0x58, 0xe7, 0xe7, 0x2a, 0xc5, 0x4d, 0xbb, 0xbb, 0xcd, 0x0d, 0x70, 0xe1, 0xad, 0x03, 0xf5, 0xfe, 0xf4, 0x84, 0x71, 0x08, 0xd2, 0xbc, 0x04, 0x7b, 0x26, 0x1c, 0xa8, 0x0f, 0x9c, 0xd8, 0x12, 0x6a, 0x6f, 0x2b, 0x67, 0xa1, 0x03, 0x80, 0x9a, 0x11, 0x0b, 0xe9, 0xe0, 0xb5, 0xb3, 0xb8, 0x19, 0x4e, 0x0c, 0xa4, 0xd9, 0x2b, 0x3b, 0xc2, 0xca, 0x20, 0xd3, 0x0c, 0xa4, 0xff, 0x93, 0x13, 0x1f, 0xfc, 0xba, 0x94, 0x93, 0x8c, 0x64, 0x15, 0x2e, 0x28, 0xa9, 0x55, 0x8c, 0x2c, 0x48, 0xd3, 0xd3, 0xc1, 0x50, 0x69, 0x19, 0xe8, 0x34, 0xd3, 0xf1, 0x04, 0x9f, 0x0a, 0x7a, 0x21, 0x87, 0xbf, 0xb9, 0x59, 0x37, 0x2e, 0xf4, 0x71, 0xa5, 0x3e, 0xbe, 0xcd, 0x70, 0x83, 0x18, 0xf8, 0x8a, 0x72, 0x85, 0x45, 0x1f, 0x08, 0x01, 0x6f, 0x37, 0xf5, 0x2b, 0x7b, 0xea, 0xb9, 0x8b, 0xa3, 0xcc, 0xfd, 0x35, 0x52, 0xdd, 0x66, 0xde, 0x4f, 0x30, 0xc5, 0x73, 0x81, 0xb6, 0xe8, 0x3c, 0xd8, 0x48, 0x8a }; // thawte.com's cert (it's EV-licious!). unsigned char VARIABLE_IS_NOT_USED thawte_der[] = { 0x30, 0x82, 0x04, 0xa5, 0x30, 0x82, 0x03, 0x8d, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x17, 0x76, 0x05, 0x88, 0x95, 0x58, 0xee, 0xbb, 0x00, 0xda, 0x10, 0xe5, 0xf0, 0xf3, 0x9c, 0xf0, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x81, 0x8b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0c, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x39, 0x30, 0x37, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x30, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x20, 0x61, 0x74, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x70, 0x73, 0x20, 0x28, 0x63, 0x29, 0x30, 0x36, 0x31, 0x2a, 0x30, 0x28, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x21, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x53, 0x4c, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x38, 0x31, 0x31, 0x31, 0x39, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x31, 0x30, 0x30, 0x31, 0x31, 0x37, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x81, 0xc7, 0x31, 0x13, 0x30, 0x11, 0x06, 0x0b, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x3c, 0x02, 0x01, 0x03, 0x13, 0x02, 0x55, 0x53, 0x31, 0x19, 0x30, 0x17, 0x06, 0x0b, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x3c, 0x02, 0x01, 0x02, 0x14, 0x08, 0x44, 0x65, 0x6c, 0x61, 0x77, 0x61, 0x72, 0x65, 0x31, 0x1b, 0x30, 0x19, 0x06, 0x03, 0x55, 0x04, 0x0f, 0x13, 0x12, 0x56, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x20, 0x35, 0x2e, 0x28, 0x62, 0x29, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x14, 0x0a, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x05, 0x13, 0x07, 0x33, 0x38, 0x39, 0x38, 0x32, 0x36, 0x31, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x14, 0x0d, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x56, 0x69, 0x65, 0x77, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x03, 0x14, 0x0e, 0x77, 0x77, 0x77, 0x2e, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xe7, 0x89, 0x68, 0xb5, 0x6e, 0x1d, 0x38, 0x19, 0xf6, 0x2d, 0x61, 0xc2, 0x00, 0xba, 0x6e, 0xab, 0x66, 0x92, 0xd6, 0x85, 0x87, 0x2d, 0xd5, 0xa8, 0x58, 0xa9, 0x7a, 0x75, 0x27, 0x9d, 0xed, 0x9e, 0xfe, 0x06, 0x71, 0x70, 0x2d, 0x21, 0x70, 0x4c, 0x3e, 0x9c, 0xb6, 0xd5, 0x5d, 0x44, 0x92, 0xb4, 0xe0, 0xee, 0x7c, 0x0a, 0x50, 0x4c, 0x0d, 0x67, 0x98, 0xaa, 0x01, 0x0e, 0x37, 0xa3, 0x2a, 0xef, 0xe6, 0xe0, 0x11, 0x7b, 0xee, 0xb0, 0xa2, 0xb4, 0x32, 0x64, 0xa7, 0x0d, 0xda, 0x6c, 0x15, 0xf8, 0xc5, 0xa5, 0x5a, 0x2c, 0xfc, 0xc9, 0xa6, 0x3c, 0x88, 0x88, 0xbf, 0xdf, 0xa7, 0x38, 0xf0, 0x78, 0xed, 0x81, 0x93, 0x29, 0x0c, 0xae, 0xc7, 0xab, 0x51, 0x21, 0x5e, 0xca, 0x95, 0xe5, 0x48, 0x52, 0x41, 0xb6, 0x18, 0x60, 0x04, 0x19, 0x6f, 0x3d, 0x80, 0x14, 0xd3, 0xaf, 0x23, 0x03, 0x10, 0x95, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x49, 0x30, 0x82, 0x01, 0x45, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x39, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x32, 0x30, 0x30, 0x30, 0x2e, 0xa0, 0x2c, 0xa0, 0x2a, 0x86, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x72, 0x6c, 0x2e, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x45, 0x56, 0x43, 0x41, 0x32, 0x30, 0x30, 0x36, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x42, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x3b, 0x30, 0x39, 0x30, 0x37, 0x06, 0x0b, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x45, 0x01, 0x07, 0x30, 0x01, 0x30, 0x28, 0x30, 0x26, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x1a, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x70, 0x73, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xcd, 0x32, 0xe2, 0xf2, 0x5d, 0x25, 0x47, 0x02, 0xaa, 0x8f, 0x79, 0x4b, 0x32, 0xee, 0x03, 0x99, 0xfd, 0x30, 0x49, 0xd1, 0x30, 0x76, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x6a, 0x30, 0x68, 0x30, 0x22, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x16, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2e, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x42, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x36, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x5f, 0x45, 0x56, 0x5f, 0x43, 0x41, 0x5f, 0x32, 0x30, 0x30, 0x36, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0xb2, 0xa0, 0x96, 0xdd, 0xec, 0x04, 0x38, 0x6b, 0xc3, 0x7a, 0xad, 0x23, 0x44, 0x91, 0xe5, 0x62, 0x8c, 0xb1, 0xf6, 0x9c, 0x03, 0x21, 0x1f, 0xef, 0x03, 0xd9, 0xca, 0x63, 0xb2, 0xf8, 0xdb, 0x5a, 0x93, 0xc2, 0xcc, 0xf1, 0x7c, 0x6f, 0xeb, 0x0f, 0x51, 0x7b, 0x4b, 0xe7, 0xb5, 0xfc, 0xbc, 0x9b, 0x87, 0x48, 0xcc, 0x5b, 0xf9, 0xc8, 0x66, 0xa4, 0x40, 0xac, 0xe9, 0x42, 0x5d, 0xed, 0xf3, 0x53, 0x13, 0xe7, 0xbd, 0x6e, 0x7f, 0x50, 0x53, 0x64, 0xb3, 0x95, 0xf1, 0x42, 0x4f, 0x36, 0x54, 0xb4, 0x1e, 0x7f, 0x18, 0x37, 0x39, 0x3b, 0x06, 0x5b, 0xe5, 0x13, 0xd9, 0x57, 0xbc, 0xd5, 0x68, 0xe3, 0x71, 0x5f, 0x5f, 0x2b, 0xf5, 0xa6, 0xc2, 0x8f, 0x67, 0x81, 0x3a, 0x44, 0x63, 0x8c, 0x36, 0xfa, 0xa8, 0xed, 0xfd, 0xd7, 0x5e, 0xa2, 0x9f, 0xb0, 0x9d, 0x47, 0x86, 0xfb, 0x71, 0x60, 0x8e, 0xc8, 0xd3, 0x45, 0x19, 0xb7, 0xda, 0xcd, 0x9e, 0xea, 0x70, 0x10, 0x87, 0x37, 0x10, 0xdd, 0x2c, 0x11, 0xdf, 0xee, 0x02, 0x21, 0xa6, 0x75, 0xe6, 0xd6, 0x9f, 0x54, 0x72, 0x61, 0xe6, 0x5c, 0x1e, 0x6e, 0x16, 0xf6, 0x8e, 0xb8, 0xfc, 0x47, 0x80, 0x05, 0x4b, 0xf7, 0x2d, 0x02, 0xee, 0x50, 0x26, 0xd1, 0x48, 0x01, 0x60, 0xdc, 0x3c, 0xa7, 0xdb, 0xeb, 0xca, 0x8b, 0xa6, 0xff, 0x9e, 0x47, 0x5d, 0x87, 0x40, 0xf8, 0xd2, 0x82, 0xd7, 0x13, 0x64, 0x0e, 0xd4, 0xb3, 0x29, 0x22, 0xa7, 0xe0, 0xc8, 0xcd, 0x8c, 0x4d, 0xf5, 0x11, 0x21, 0x26, 0x02, 0x43, 0x33, 0x8e, 0xa9, 0x3f, 0x91, 0xd4, 0x05, 0x97, 0xc9, 0xd3, 0x42, 0x6b, 0x05, 0x99, 0xf6, 0x16, 0x71, 0x67, 0x65, 0xc7, 0x96, 0xdf, 0x2a, 0xd7, 0x54, 0x63, 0x25, 0xc0, 0x28, 0xf7, 0x1c, 0xee, 0xcd, 0x8b, 0xe4, 0x9d, 0x32, 0xa3, 0x81, 0x55 }; // A certificate for www.paypal.com with a NULL byte in the common name. // From http://www.gossamer-threads.com/lists/fulldisc/full-disclosure/70363 unsigned char VARIABLE_IS_NOT_USED paypal_null_der[] = { 0x30, 0x82, 0x06, 0x44, 0x30, 0x82, 0x05, 0xad, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x03, 0x00, 0xf0, 0x9b, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x82, 0x01, 0x12, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x45, 0x53, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x09, 0x42, 0x61, 0x72, 0x63, 0x65, 0x6c, 0x6f, 0x6e, 0x61, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x09, 0x42, 0x61, 0x72, 0x63, 0x65, 0x6c, 0x6f, 0x6e, 0x61, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x20, 0x49, 0x50, 0x53, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x73, 0x2e, 0x6c, 0x2e, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x14, 0x25, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x43, 0x2e, 0x49, 0x2e, 0x46, 0x2e, 0x20, 0x20, 0x42, 0x2d, 0x42, 0x36, 0x32, 0x32, 0x31, 0x30, 0x36, 0x39, 0x35, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x25, 0x69, 0x70, 0x73, 0x43, 0x41, 0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x25, 0x69, 0x70, 0x73, 0x43, 0x41, 0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x39, 0x30, 0x32, 0x32, 0x34, 0x32, 0x33, 0x30, 0x34, 0x31, 0x37, 0x5a, 0x17, 0x0d, 0x31, 0x31, 0x30, 0x32, 0x32, 0x34, 0x32, 0x33, 0x30, 0x34, 0x31, 0x37, 0x5a, 0x30, 0x81, 0x94, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0d, 0x53, 0x61, 0x6e, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x69, 0x73, 0x63, 0x6f, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0b, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x31, 0x2f, 0x30, 0x2d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x26, 0x77, 0x77, 0x77, 0x2e, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x73, 0x73, 0x6c, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x63, 0x63, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xd2, 0x69, 0xfa, 0x6f, 0x3a, 0x00, 0xb4, 0x21, 0x1b, 0xc8, 0xb1, 0x02, 0xd7, 0x3f, 0x19, 0xb2, 0xc4, 0x6d, 0xb4, 0x54, 0xf8, 0x8b, 0x8a, 0xcc, 0xdb, 0x72, 0xc2, 0x9e, 0x3c, 0x60, 0xb9, 0xc6, 0x91, 0x3d, 0x82, 0xb7, 0x7d, 0x99, 0xff, 0xd1, 0x29, 0x84, 0xc1, 0x73, 0x53, 0x9c, 0x82, 0xdd, 0xfc, 0x24, 0x8c, 0x77, 0xd5, 0x41, 0xf3, 0xe8, 0x1e, 0x42, 0xa1, 0xad, 0x2d, 0x9e, 0xff, 0x5b, 0x10, 0x26, 0xce, 0x9d, 0x57, 0x17, 0x73, 0x16, 0x23, 0x38, 0xc8, 0xd6, 0xf1, 0xba, 0xa3, 0x96, 0x5b, 0x16, 0x67, 0x4a, 0x4f, 0x73, 0x97, 0x3a, 0x4d, 0x14, 0xa4, 0xf4, 0xe2, 0x3f, 0x8b, 0x05, 0x83, 0x42, 0xd1, 0xd0, 0xdc, 0x2f, 0x7a, 0xe5, 0xb6, 0x10, 0xb2, 0x11, 0xc0, 0xdc, 0x21, 0x2a, 0x90, 0xff, 0xae, 0x97, 0x71, 0x5a, 0x49, 0x81, 0xac, 0x40, 0xf3, 0x3b, 0xb8, 0x59, 0xb2, 0x4f, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x03, 0x21, 0x30, 0x82, 0x03, 0x1d, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x11, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x06, 0x40, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30, 0x0a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x61, 0x8f, 0x61, 0x34, 0x43, 0x55, 0x14, 0x7f, 0x27, 0x09, 0xce, 0x4c, 0x8b, 0xea, 0x9b, 0x7b, 0x19, 0x25, 0xbc, 0x6e, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x0e, 0x07, 0x60, 0xd4, 0x39, 0xc9, 0x1b, 0x5b, 0x5d, 0x90, 0x7b, 0x23, 0xc8, 0xd2, 0x34, 0x9d, 0x4a, 0x9a, 0x46, 0x39, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x1d, 0x12, 0x04, 0x15, 0x30, 0x13, 0x81, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x72, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d, 0x04, 0x65, 0x16, 0x63, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e, 0x4f, 0x54, 0x20, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x44, 0x2e, 0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x2f, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x02, 0x04, 0x22, 0x16, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x30, 0x43, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x04, 0x04, 0x36, 0x16, 0x34, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x46, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x03, 0x04, 0x39, 0x16, 0x37, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x72, 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x3f, 0x30, 0x43, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x07, 0x04, 0x36, 0x16, 0x34, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x72, 0x65, 0x6e, 0x65, 0x77, 0x61, 0x6c, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x3f, 0x30, 0x41, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x08, 0x04, 0x34, 0x16, 0x32, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x30, 0x81, 0x83, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x7c, 0x30, 0x7a, 0x30, 0x39, 0xa0, 0x37, 0xa0, 0x35, 0x86, 0x33, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x3d, 0xa0, 0x3b, 0xa0, 0x39, 0x86, 0x37, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x26, 0x30, 0x24, 0x30, 0x22, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x16, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x68, 0xee, 0x79, 0x97, 0x97, 0xdd, 0x3b, 0xef, 0x16, 0x6a, 0x06, 0xf2, 0x14, 0x9a, 0x6e, 0xcd, 0x9e, 0x12, 0xf7, 0xaa, 0x83, 0x10, 0xbd, 0xd1, 0x7c, 0x98, 0xfa, 0xc7, 0xae, 0xd4, 0x0e, 0x2c, 0x9e, 0x38, 0x05, 0x9d, 0x52, 0x60, 0xa9, 0x99, 0x0a, 0x81, 0xb4, 0x98, 0x90, 0x1d, 0xae, 0xbb, 0x4a, 0xd7, 0xb9, 0xdc, 0x88, 0x9e, 0x37, 0x78, 0x41, 0x5b, 0xf7, 0x82, 0xa5, 0xf2, 0xba, 0x41, 0x25, 0x5a, 0x90, 0x1a, 0x1e, 0x45, 0x38, 0xa1, 0x52, 0x58, 0x75, 0x94, 0x26, 0x44, 0xfb, 0x20, 0x07, 0xba, 0x44, 0xcc, 0xe5, 0x4a, 0x2d, 0x72, 0x3f, 0x98, 0x47, 0xf6, 0x26, 0xdc, 0x05, 0x46, 0x05, 0x07, 0x63, 0x21, 0xab, 0x46, 0x9b, 0x9c, 0x78, 0xd5, 0x54, 0x5b, 0x3d, 0x0c, 0x1e, 0xc8, 0x64, 0x8c, 0xb5, 0x50, 0x23, 0x82, 0x6f, 0xdb, 0xb8, 0x22, 0x1c, 0x43, 0x96, 0x07, 0xa8, 0xbb }; // DER-encoded X.509 DistinguishedNames. // // To output the subject or issuer of a certificate: // // openssl asn1parse -i -inform DER -in <cert> // // The output will contain // SEQUENCE [This is the issuer name] // ... // SEQUENCE [This is the validity period] // UTCTIME (or GENERALTIME) // UTCTIME // SEQUENCE [This is the subject] // ... // // The OFFSET is the first column before the column, e.g. for '21:d=2', the // offset is 21 for the SEQUENCE you're interested in. // The LENGTH is 'hl + l'. // // To generate the table, then use the following for a DER-encoded // certificate: // // xxd -i -s $OFFSET -l $LENGTH <cert> // // For PEM certificates, convert them to DER before, as in: // // openssl x509 -inform PEM -outform DER -in <cert> | // xxd -i -s $OFFSET -l $LENGTH // // 0:d=0 hl=2 l= 95 cons: SEQUENCE // 2:d=1 hl=2 l= 11 cons: SET // 4:d=2 hl=2 l= 9 cons: SEQUENCE // 6:d=3 hl=2 l= 3 prim: OBJECT :countryName // 11:d=3 hl=2 l= 2 prim: PRINTABLESTRING :US // 15:d=1 hl=2 l= 23 cons: SET // 17:d=2 hl=2 l= 21 cons: SEQUENCE // 19:d=3 hl=2 l= 3 prim: OBJECT :organizationName // 24:d=3 hl=2 l= 14 prim: PRINTABLESTRING :VeriSign, Inc. // 40:d=1 hl=2 l= 55 cons: SET // 42:d=2 hl=2 l= 53 cons: SEQUENCE // 44:d=3 hl=2 l= 3 prim: OBJECT :organizationalUnitName // 49:d=3 hl=2 l= 46 prim: PRINTABLESTRING : // Class 1 Public Primary Certification Authority const uint8_t VARIABLE_IS_NOT_USED VerisignDN[] = { 0x30, 0x5f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x37, 0x30, 0x35, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x31, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79}; // 0:d=0 hl=2 l= 125 cons: SEQUENCE // 2:d=1 hl=2 l= 11 cons: SET // 4:d=2 hl=2 l= 9 cons: SEQUENCE // 6:d=3 hl=2 l= 3 prim: OBJECT :countryName // 11:d=3 hl=2 l= 2 prim: PRINTABLESTRING :IL // 15:d=1 hl=2 l= 22 cons: SET // 17:d=2 hl=2 l= 20 cons: SEQUENCE // 19:d=3 hl=2 l= 3 prim: OBJECT :organizationName // 24:d=3 hl=2 l= 13 prim: PRINTABLESTRING :StartCom Ltd. // 39:d=1 hl=2 l= 43 cons: SET // 41:d=2 hl=2 l= 41 cons: SEQUENCE // 43:d=3 hl=2 l= 3 prim: OBJECT :organizationalUnitName // 48:d=3 hl=2 l= 34 prim: PRINTABLESTRING : // Secure Digital Certificate Signing // 84:d=1 hl=2 l= 41 cons: SET // 86:d=2 hl=2 l= 39 cons: SEQUENCE // 88:d=3 hl=2 l= 3 prim: OBJECT :commonName // 93:d=3 hl=2 l= 32 prim: PRINTABLESTRING : // StartCom Certification Authority const uint8_t VARIABLE_IS_NOT_USED StartComDN[] = { 0x30, 0x7d, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x49, 0x4c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x20, 0x4c, 0x74, 0x64, 0x2e, 0x31, 0x2b, 0x30, 0x29, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x22, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x44, 0x69, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x20, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79}; // 0:d=0 hl=3 l= 174 cons: SEQUENCE // 3:d=1 hl=2 l= 11 cons: SET // 5:d=2 hl=2 l= 9 cons: SEQUENCE // 7:d=3 hl=2 l= 3 prim: OBJECT :countryName // 12:d=3 hl=2 l= 2 prim: PRINTABLESTRING :US // 16:d=1 hl=2 l= 11 cons: SET // 18:d=2 hl=2 l= 9 cons: SEQUENCE // 20:d=3 hl=2 l= 3 prim: OBJECT :stateOrProvinceName // 25:d=3 hl=2 l= 2 prim: PRINTABLESTRING :UT // 29:d=1 hl=2 l= 23 cons: SET // 31:d=2 hl=2 l= 21 cons: SEQUENCE // 33:d=3 hl=2 l= 3 prim: OBJECT :localityName // 38:d=3 hl=2 l= 14 prim: PRINTABLESTRING :Salt Lake City // 54:d=1 hl=2 l= 30 cons: SET // 56:d=2 hl=2 l= 28 cons: SEQUENCE // 58:d=3 hl=2 l= 3 prim: OBJECT :organizationName // 63:d=3 hl=2 l= 21 prim: PRINTABLESTRING :The USERTRUST Network // 86:d=1 hl=2 l= 33 cons: SET // 88:d=2 hl=2 l= 31 cons: SEQUENCE // 90:d=3 hl=2 l= 3 prim: OBJECT :organizationalUnitName // 95:d=3 hl=2 l= 24 prim: PRINTABLESTRING :http://www.usertrust.com //121:d=1 hl=2 l= 54 cons: SET //123:d=2 hl=2 l= 52 cons: SEQUENCE //125:d=3 hl=2 l= 3 prim: OBJECT :commonName //130:d=3 hl=2 l= 45 prim: PRINTABLESTRING : // UTN-USERFirst-Client Authentication and Email const uint8_t VARIABLE_IS_NOT_USED UserTrustDN[] = { 0x30, 0x81, 0xae, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x02, 0x55, 0x54, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0e, 0x53, 0x61, 0x6c, 0x74, 0x20, 0x4c, 0x61, 0x6b, 0x65, 0x20, 0x43, 0x69, 0x74, 0x79, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x15, 0x54, 0x68, 0x65, 0x20, 0x55, 0x53, 0x45, 0x52, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x18, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x31, 0x36, 0x30, 0x34, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x2d, 0x55, 0x54, 0x4e, 0x2d, 0x55, 0x53, 0x45, 0x52, 0x46, 0x69, 0x72, 0x73, 0x74, 0x2d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x45, 0x6d, 0x61, 0x69, 0x6c}; // 0:d=0 hl=3 l= 190 cons: SEQUENCE // 3:d=1 hl=2 l= 63 cons: SET // 5:d=2 hl=2 l= 61 cons: SEQUENCE // 7:d=3 hl=2 l= 3 prim: OBJECT :commonName // 12:d=3 hl=2 l= 54 prim: UTF8STRING : // TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı // 68:d=1 hl=2 l= 11 cons: SET // 70:d=2 hl=2 l= 9 cons: SEQUENCE // 72:d=3 hl=2 l= 3 prim: OBJECT :countryName // 77:d=3 hl=2 l= 2 prim: PRINTABLESTRING :TR // 81:d=1 hl=2 l= 15 cons: SET // 83:d=2 hl=2 l= 13 cons: SEQUENCE // 85:d=3 hl=2 l= 3 prim: OBJECT :localityName // 90:d=3 hl=2 l= 6 prim: UTF8STRING :Ankara // 98:d=1 hl=2 l= 93 cons: SET //100:d=2 hl=2 l= 91 cons: SEQUENCE //102:d=3 hl=2 l= 3 prim: OBJECT :organizationName //107:d=3 hl=2 l= 84 prim: UTF8STRING : // TÜRKTRUST Bilgi İletişim ve Bilişim Güvenliği Hizmetleri A.Ş. // (c) Kasım 2005 const uint8_t VARIABLE_IS_NOT_USED TurkTrustDN[] = { 0x30, 0x81, 0xbe, 0x31, 0x3f, 0x30, 0x3d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x36, 0x54, 0xc3, 0x9c, 0x52, 0x4b, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x45, 0x6c, 0x65, 0x6b, 0x74, 0x72, 0x6f, 0x6e, 0x69, 0x6b, 0x20, 0x53, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x6b, 0x61, 0x20, 0x48, 0x69, 0x7a, 0x6d, 0x65, 0x74, 0x20, 0x53, 0x61, 0xc4, 0x9f, 0x6c, 0x61, 0x79, 0xc4, 0xb1, 0x63, 0xc4, 0xb1, 0x73, 0xc4, 0xb1, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x54, 0x52, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x06, 0x41, 0x6e, 0x6b, 0x61, 0x72, 0x61, 0x31, 0x5d, 0x30, 0x5b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x54, 0x54, 0xc3, 0x9c, 0x52, 0x4b, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x42, 0x69, 0x6c, 0x67, 0x69, 0x20, 0xc4, 0xb0, 0x6c, 0x65, 0x74, 0x69, 0xc5, 0x9f, 0x69, 0x6d, 0x20, 0x76, 0x65, 0x20, 0x42, 0x69, 0x6c, 0x69, 0xc5, 0x9f, 0x69, 0x6d, 0x20, 0x47, 0xc3, 0xbc, 0x76, 0x65, 0x6e, 0x6c, 0x69, 0xc4, 0x9f, 0x69, 0x20, 0x48, 0x69, 0x7a, 0x6d, 0x65, 0x74, 0x6c, 0x65, 0x72, 0x69, 0x20, 0x41, 0x2e, 0xc5, 0x9e, 0x2e, 0x20, 0x28, 0x63, 0x29, 0x20, 0x4b, 0x61, 0x73, 0xc4, 0xb1, 0x6d, 0x20, 0x32, 0x30, 0x30, 0x35, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x35, 0x31, 0x31, 0x30, 0x37, 0x31, 0x30, 0x30, 0x37, 0x35, 0x37}; // 33:d=2 hl=3 l= 207 cons: SEQUENCE // 36:d=3 hl=2 l= 11 cons: SET // 38:d=4 hl=2 l= 9 cons: SEQUENCE // 40:d=5 hl=2 l= 3 prim: OBJECT :countryName // 45:d=5 hl=2 l= 2 prim: PRINTABLESTRING :AT // 49:d=3 hl=3 l= 139 cons: SET // 52:d=4 hl=3 l= 136 cons: SEQUENCE // 55:d=5 hl=2 l= 3 prim: OBJECT :organizationName // 60:d=5 hl=3 l= 128 prim: BMPSTRING : // A-Trust Ges. für Sicherheitssysteme im elektr. Datenverkehr GmbH //191:d=3 hl=2 l= 24 cons: SET //193:d=4 hl=2 l= 22 cons: SEQUENCE //195:d=5 hl=2 l= 3 prim: OBJECT :organizationalUnitName //200:d=5 hl=2 l= 15 prim: PRINTABLESTRING :A-Trust-Qual-01 //217:d=3 hl=2 l= 24 cons: SET //219:d=4 hl=2 l= 22 cons: SEQUENCE //221:d=5 hl=2 l= 3 prim: OBJECT :commonName //226:d=5 hl=2 l= 15 prim: PRINTABLESTRING :A-Trust-Qual-01 const uint8_t VARIABLE_IS_NOT_USED ATrustQual01DN[] = { 0x30, 0x81, 0xcf, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x41, 0x54, 0x31, 0x81, 0x8b, 0x30, 0x81, 0x88, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x1e, 0x81, 0x80, 0x00, 0x41, 0x00, 0x2d, 0x00, 0x54, 0x00, 0x72, 0x00, 0x75, 0x00, 0x73, 0x00, 0x74, 0x00, 0x20, 0x00, 0x47, 0x00, 0x65, 0x00, 0x73, 0x00, 0x2e, 0x00, 0x20, 0x00, 0x66, 0x00, 0xfc, 0x00, 0x72, 0x00, 0x20, 0x00, 0x53, 0x00, 0x69, 0x00, 0x63, 0x00, 0x68, 0x00, 0x65, 0x00, 0x72, 0x00, 0x68, 0x00, 0x65, 0x00, 0x69, 0x00, 0x74, 0x00, 0x73, 0x00, 0x73, 0x00, 0x79, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x20, 0x00, 0x69, 0x00, 0x6d, 0x00, 0x20, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x72, 0x00, 0x2e, 0x00, 0x20, 0x00, 0x44, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x65, 0x00, 0x68, 0x00, 0x72, 0x00, 0x20, 0x00, 0x47, 0x00, 0x6d, 0x00, 0x62, 0x00, 0x48, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0f, 0x41, 0x2d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x2d, 0x51, 0x75, 0x61, 0x6c, 0x2d, 0x30, 0x31, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0f, 0x41, 0x2d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x2d, 0x51, 0x75, 0x61, 0x6c, 0x2d, 0x30, 0x31, 0x30, 0x1e, 0x17}; // 34:d=2 hl=3 l= 180 cons: SEQUENCE // 37:d=3 hl=2 l= 20 cons: SET // 39:d=4 hl=2 l= 18 cons: SEQUENCE // 41:d=5 hl=2 l= 3 prim: OBJECT :organizationName // 46:d=5 hl=2 l= 11 prim: PRINTABLESTRING :Entrust.net // 59:d=3 hl=2 l= 64 cons: SET // 61:d=4 hl=2 l= 62 cons: SEQUENCE // 63:d=5 hl=2 l= 3 prim: OBJECT :organizationalUnitName // 68:d=5 hl=2 l= 55 prim: T61STRING : // www.entrust.net/CPS_2048 incorp. by ref. (limits liab.) //125:d=3 hl=2 l= 37 cons: SET //127:d=4 hl=2 l= 35 cons: SEQUENCE //129:d=5 hl=2 l= 3 prim: OBJECT :organizationalUnitName //134:d=5 hl=2 l= 28 prim: PRINTABLESTRING : // (c) 1999 Entrust.net Limited //164:d=3 hl=2 l= 51 cons: SET //166:d=4 hl=2 l= 49 cons: SEQUENCE //168:d=5 hl=2 l= 3 prim: OBJECT :commonName //173:d=5 hl=2 l= 42 prim: PRINTABLESTRING : // Entrust.net Certification Authority (2048) const uint8_t VARIABLE_IS_NOT_USED EntrustDN[] = { 0x30, 0x81, 0xb4, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0b, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x31, 0x40, 0x30, 0x3e, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x14, 0x37, 0x77, 0x77, 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x43, 0x50, 0x53, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x20, 0x62, 0x79, 0x20, 0x72, 0x65, 0x66, 0x2e, 0x20, 0x28, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x20, 0x6c, 0x69, 0x61, 0x62, 0x2e, 0x29, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1c, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39, 0x39, 0x39, 0x20, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x31, 0x33, 0x30, 0x31, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x2a, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x28, 0x32, 0x30, 0x34, 0x38, 0x29}; // 46:d=2 hl=2 l= 76 cons: SEQUENCE // 48:d=3 hl=2 l= 11 cons: SET // 50:d=4 hl=2 l= 9 cons: SEQUENCE // 52:d=5 hl=2 l= 3 prim: OBJECT :countryName // 57:d=5 hl=2 l= 2 prim: PRINTABLESTRING :ZA // 61:d=3 hl=2 l= 37 cons: SET // 63:d=4 hl=2 l= 35 cons: SEQUENCE // 65:d=5 hl=2 l= 3 prim: OBJECT :organizationName // 70:d=5 hl=2 l= 28 prim: PRINTABLESTRING : // Thawte Consulting (Pty) Ltd. // 100:d=3 hl=2 l= 22 cons: SET // 102:d=4 hl=2 l= 20 cons: SEQUENCE // 104:d=5 hl=2 l= 3 prim: OBJECT :commonName // 109:d=5 hl=2 l= 13 prim: PRINTABLESTRING :Thawte SGC CA const uint8_t VARIABLE_IS_NOT_USED ThawteDN[] = { 0x30, 0x4C, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x5A, 0x41, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x13, 0x1C, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x43, 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74, 0x69, 0x6E, 0x67, 0x20, 0x28, 0x50, 0x74, 0x79, 0x29, 0x20, 0x4C, 0x74, 0x64, 0x2E, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0D, 0x54, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x53, 0x47, 0x43, 0x20, 0x43, 0x41}; // 47:d=2 hl=2 l= 108 cons: SEQUENCE // 49:d=3 hl=2 l= 11 cons: SET // 51:d=4 hl=2 l= 9 cons: SEQUENCE // 53:d=5 hl=2 l= 3 prim: OBJECT :countryName // 58:d=5 hl=2 l= 2 prim: PRINTABLESTRING :US // 62:d=3 hl=2 l= 22 cons: SET // 64:d=4 hl=2 l= 20 cons: SEQUENCE // 66:d=5 hl=2 l= 3 prim: OBJECT :stateOrProvinceName // 71:d=5 hl=2 l= 13 prim: PRINTABLESTRING :Massachusetts // 86:d=3 hl=2 l= 46 cons: SET // 88:d=4 hl=2 l= 44 cons: SEQUENCE // 90:d=5 hl=2 l= 3 prim: OBJECT :organizationName // 95:d=5 hl=2 l= 37 prim: PRINTABLESTRING : // Massachusetts Institute of Technology // 134:d=3 hl=2 l= 21 cons: SET // 136:d=4 hl=2 l= 19 cons: SEQUENCE // 138:d=5 hl=2 l= 3 prim: OBJECT :organizationalUnitName // 143:d=5 hl=2 l= 12 prim: PRINTABLESTRING :Client CA v1 const uint8_t VARIABLE_IS_NOT_USED MITDN[] = { 0x30, 0x6C, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0D, 0x4D, 0x61, 0x73, 0x73, 0x61, 0x63, 0x68, 0x75, 0x73, 0x65, 0x74, 0x74, 0x73, 0x31, 0x2E, 0x30, 0x2C, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x13, 0x25, 0x4D, 0x61, 0x73, 0x73, 0x61, 0x63, 0x68, 0x75, 0x73, 0x65, 0x74, 0x74, 0x73, 0x20, 0x49, 0x6E, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x6F, 0x66, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x79, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x13, 0x0C, 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x20, 0x43, 0x41, 0x20, 0x76, 0x31}; } // namespace
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <title>Api Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"> <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap.min.css'/> <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/prettify.css'/> <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap-responsive.min.css'/> <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/application.css'/> <!-- IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div id='container'> <ul class='breadcrumb'> <li> <a href='../../../apidoc/v2.cs_CZ.html'>Foreman v2</a> <span class='divider'>/</span> </li> <li> <a href='../../../apidoc/v2/config_templates.cs_CZ.html'> Config templates </a> <span class='divider'>/</span> </li> <li class='active'>clone</li> <li class='pull-right'> &nbsp;[ <a href="../../../apidoc/v2/config_templates/clone.ca.html">ca</a> | <b><a href="../../../apidoc/v2/config_templates/clone.cs_CZ.html">cs_CZ</a></b> | <a href="../../../apidoc/v2/config_templates/clone.de.html">de</a> | <a href="../../../apidoc/v2/config_templates/clone.en.html">en</a> | <a href="../../../apidoc/v2/config_templates/clone.en_GB.html">en_GB</a> | <a href="../../../apidoc/v2/config_templates/clone.es.html">es</a> | <a href="../../../apidoc/v2/config_templates/clone.fr.html">fr</a> | <a href="../../../apidoc/v2/config_templates/clone.gl.html">gl</a> | <a href="../../../apidoc/v2/config_templates/clone.it.html">it</a> | <a href="../../../apidoc/v2/config_templates/clone.ja.html">ja</a> | <a href="../../../apidoc/v2/config_templates/clone.ko.html">ko</a> | <a href="../../../apidoc/v2/config_templates/clone.nl_NL.html">nl_NL</a> | <a href="../../../apidoc/v2/config_templates/clone.pl.html">pl</a> | <a href="../../../apidoc/v2/config_templates/clone.pt_BR.html">pt_BR</a> | <a href="../../../apidoc/v2/config_templates/clone.ru.html">ru</a> | <a href="../../../apidoc/v2/config_templates/clone.sv_SE.html">sv_SE</a> | <a href="../../../apidoc/v2/config_templates/clone.zh_CN.html">zh_CN</a> | <a href="../../../apidoc/v2/config_templates/clone.zh_TW.html">zh_TW</a> ] </li> </ul> <div class='page-header'> <h1> POST /api/config_templates/:id/clone <br> <small>Clone a provision template</small> </h1> </div> <div> <h2><span class="translation_missing" title="translation missing: cs-CZ.apipie.examples">Examples</span></h2> <pre class="prettyprint">POST /api/config_templates/1007981701-centos5_3_pxelinux/clone { &quot;config_template&quot;: { &quot;name&quot;: &quot;&quot; } } 422 { &quot;error&quot;: { &quot;id&quot;: null, &quot;errors&quot;: { &quot;name&quot;: [ &quot;can&#39;t be blank&quot; ], &quot;operatingsystems&quot;: [ &quot;is invalid&quot; ] }, &quot;full_messages&quot;: [ &quot;Name can&#39;t be blank&quot;, &quot;Operatingsystems is invalid&quot; ] } }</pre> <h2><span class="translation_missing" title="translation missing: cs-CZ.apipie.params">Params</span></h2> <table class='table'> <thead> <tr> <th><span class="translation_missing" title="translation missing: cs-CZ.apipie.param_name">Param Name</span></th> <th><span class="translation_missing" title="translation missing: cs-CZ.apipie.description">Description</span></th> </tr> </thead> <tbody> <tr style='background-color:rgb(255,255,255);'> <td> <strong>location_id </strong><br> <small> <span class="translation_missing" title="translation missing: cs-CZ.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current location context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>organization_id </strong><br> <small> <span class="translation_missing" title="translation missing: cs-CZ.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current organization context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>id </strong><br> <small> <span class="translation_missing" title="translation missing: cs-CZ.apipie.required">Required</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>config_template </strong><br> <small> <span class="translation_missing" title="translation missing: cs-CZ.apipie.required">Required</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Hash</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(250,250,250);'> <td> <strong>config_template[name] </strong><br> <small> <span class="translation_missing" title="translation missing: cs-CZ.apipie.required">Required</span> </small> </td> <td> <p>název šablony</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> </tbody> </table> </div> </div> </div> <hr> <footer></footer> </div> <script type='text/javascript' src='../../../apidoc/javascripts/bundled/jquery.js'></script> <script type='text/javascript' src='../../../apidoc/javascripts/bundled/bootstrap-collapse.js'></script> <script type='text/javascript' src='../../../apidoc/javascripts/bundled/prettify.js'></script> <script type='text/javascript' src='../../../apidoc/javascripts/apipie.js'></script> </body> </html>
{ "pile_set_name": "Github" }
/* * A SPI driver for the Ricoh RS5C348 RTC * * Copyright (C) 2006 Atsushi Nemoto <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * The board specific init code should provide characteristics of this * device: * Mode 1 (High-Active, Shift-Then-Sample), High Avtive CS */ #include <linux/bcd.h> #include <linux/delay.h> #include <linux/device.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/slab.h> #include <linux/rtc.h> #include <linux/workqueue.h> #include <linux/spi/spi.h> #include <linux/module.h> #define RS5C348_REG_SECS 0 #define RS5C348_REG_MINS 1 #define RS5C348_REG_HOURS 2 #define RS5C348_REG_WDAY 3 #define RS5C348_REG_DAY 4 #define RS5C348_REG_MONTH 5 #define RS5C348_REG_YEAR 6 #define RS5C348_REG_CTL1 14 #define RS5C348_REG_CTL2 15 #define RS5C348_SECS_MASK 0x7f #define RS5C348_MINS_MASK 0x7f #define RS5C348_HOURS_MASK 0x3f #define RS5C348_WDAY_MASK 0x03 #define RS5C348_DAY_MASK 0x3f #define RS5C348_MONTH_MASK 0x1f #define RS5C348_BIT_PM 0x20 /* REG_HOURS */ #define RS5C348_BIT_Y2K 0x80 /* REG_MONTH */ #define RS5C348_BIT_24H 0x20 /* REG_CTL1 */ #define RS5C348_BIT_XSTP 0x10 /* REG_CTL2 */ #define RS5C348_BIT_VDET 0x40 /* REG_CTL2 */ #define RS5C348_CMD_W(addr) (((addr) << 4) | 0x08) /* single write */ #define RS5C348_CMD_R(addr) (((addr) << 4) | 0x0c) /* single read */ #define RS5C348_CMD_MW(addr) (((addr) << 4) | 0x00) /* burst write */ #define RS5C348_CMD_MR(addr) (((addr) << 4) | 0x04) /* burst read */ struct rs5c348_plat_data { struct rtc_device *rtc; int rtc_24h; }; static int rs5c348_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct spi_device *spi = to_spi_device(dev); struct rs5c348_plat_data *pdata = dev_get_platdata(&spi->dev); u8 txbuf[5+7], *txp; int ret; /* Transfer 5 bytes before writing SEC. This gives 31us for carry. */ txp = txbuf; txbuf[0] = RS5C348_CMD_R(RS5C348_REG_CTL2); /* cmd, ctl2 */ txbuf[1] = 0; /* dummy */ txbuf[2] = RS5C348_CMD_R(RS5C348_REG_CTL2); /* cmd, ctl2 */ txbuf[3] = 0; /* dummy */ txbuf[4] = RS5C348_CMD_MW(RS5C348_REG_SECS); /* cmd, sec, ... */ txp = &txbuf[5]; txp[RS5C348_REG_SECS] = bin2bcd(tm->tm_sec); txp[RS5C348_REG_MINS] = bin2bcd(tm->tm_min); if (pdata->rtc_24h) { txp[RS5C348_REG_HOURS] = bin2bcd(tm->tm_hour); } else { /* hour 0 is AM12, noon is PM12 */ txp[RS5C348_REG_HOURS] = bin2bcd((tm->tm_hour + 11) % 12 + 1) | (tm->tm_hour >= 12 ? RS5C348_BIT_PM : 0); } txp[RS5C348_REG_WDAY] = bin2bcd(tm->tm_wday); txp[RS5C348_REG_DAY] = bin2bcd(tm->tm_mday); txp[RS5C348_REG_MONTH] = bin2bcd(tm->tm_mon + 1) | (tm->tm_year >= 100 ? RS5C348_BIT_Y2K : 0); txp[RS5C348_REG_YEAR] = bin2bcd(tm->tm_year % 100); /* write in one transfer to avoid data inconsistency */ ret = spi_write_then_read(spi, txbuf, sizeof(txbuf), NULL, 0); udelay(62); /* Tcsr 62us */ return ret; } static int rs5c348_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct spi_device *spi = to_spi_device(dev); struct rs5c348_plat_data *pdata = dev_get_platdata(&spi->dev); u8 txbuf[5], rxbuf[7]; int ret; /* Transfer 5 byte befores reading SEC. This gives 31us for carry. */ txbuf[0] = RS5C348_CMD_R(RS5C348_REG_CTL2); /* cmd, ctl2 */ txbuf[1] = 0; /* dummy */ txbuf[2] = RS5C348_CMD_R(RS5C348_REG_CTL2); /* cmd, ctl2 */ txbuf[3] = 0; /* dummy */ txbuf[4] = RS5C348_CMD_MR(RS5C348_REG_SECS); /* cmd, sec, ... */ /* read in one transfer to avoid data inconsistency */ ret = spi_write_then_read(spi, txbuf, sizeof(txbuf), rxbuf, sizeof(rxbuf)); udelay(62); /* Tcsr 62us */ if (ret < 0) return ret; tm->tm_sec = bcd2bin(rxbuf[RS5C348_REG_SECS] & RS5C348_SECS_MASK); tm->tm_min = bcd2bin(rxbuf[RS5C348_REG_MINS] & RS5C348_MINS_MASK); tm->tm_hour = bcd2bin(rxbuf[RS5C348_REG_HOURS] & RS5C348_HOURS_MASK); if (!pdata->rtc_24h) { if (rxbuf[RS5C348_REG_HOURS] & RS5C348_BIT_PM) { tm->tm_hour -= 20; tm->tm_hour %= 12; tm->tm_hour += 12; } else tm->tm_hour %= 12; } tm->tm_wday = bcd2bin(rxbuf[RS5C348_REG_WDAY] & RS5C348_WDAY_MASK); tm->tm_mday = bcd2bin(rxbuf[RS5C348_REG_DAY] & RS5C348_DAY_MASK); tm->tm_mon = bcd2bin(rxbuf[RS5C348_REG_MONTH] & RS5C348_MONTH_MASK) - 1; /* year is 1900 + tm->tm_year */ tm->tm_year = bcd2bin(rxbuf[RS5C348_REG_YEAR]) + ((rxbuf[RS5C348_REG_MONTH] & RS5C348_BIT_Y2K) ? 100 : 0); if (rtc_valid_tm(tm) < 0) { dev_err(&spi->dev, "retrieved date/time is not valid.\n"); rtc_time_to_tm(0, tm); } return 0; } static const struct rtc_class_ops rs5c348_rtc_ops = { .read_time = rs5c348_rtc_read_time, .set_time = rs5c348_rtc_set_time, }; static struct spi_driver rs5c348_driver; static int rs5c348_probe(struct spi_device *spi) { int ret; struct rtc_device *rtc; struct rs5c348_plat_data *pdata; pdata = devm_kzalloc(&spi->dev, sizeof(struct rs5c348_plat_data), GFP_KERNEL); if (!pdata) return -ENOMEM; spi->dev.platform_data = pdata; /* Check D7 of SECOND register */ ret = spi_w8r8(spi, RS5C348_CMD_R(RS5C348_REG_SECS)); if (ret < 0 || (ret & 0x80)) { dev_err(&spi->dev, "not found.\n"); goto kfree_exit; } dev_info(&spi->dev, "spiclk %u KHz.\n", (spi->max_speed_hz + 500) / 1000); /* turn RTC on if it was not on */ ret = spi_w8r8(spi, RS5C348_CMD_R(RS5C348_REG_CTL2)); if (ret < 0) goto kfree_exit; if (ret & (RS5C348_BIT_XSTP | RS5C348_BIT_VDET)) { u8 buf[2]; struct rtc_time tm; if (ret & RS5C348_BIT_VDET) dev_warn(&spi->dev, "voltage-low detected.\n"); if (ret & RS5C348_BIT_XSTP) dev_warn(&spi->dev, "oscillator-stop detected.\n"); rtc_time_to_tm(0, &tm); /* 1970/1/1 */ ret = rs5c348_rtc_set_time(&spi->dev, &tm); if (ret < 0) goto kfree_exit; buf[0] = RS5C348_CMD_W(RS5C348_REG_CTL2); buf[1] = 0; ret = spi_write_then_read(spi, buf, sizeof(buf), NULL, 0); if (ret < 0) goto kfree_exit; } ret = spi_w8r8(spi, RS5C348_CMD_R(RS5C348_REG_CTL1)); if (ret < 0) goto kfree_exit; if (ret & RS5C348_BIT_24H) pdata->rtc_24h = 1; rtc = devm_rtc_device_register(&spi->dev, rs5c348_driver.driver.name, &rs5c348_rtc_ops, THIS_MODULE); if (IS_ERR(rtc)) { ret = PTR_ERR(rtc); goto kfree_exit; } pdata->rtc = rtc; return 0; kfree_exit: return ret; } static struct spi_driver rs5c348_driver = { .driver = { .name = "rtc-rs5c348", }, .probe = rs5c348_probe, }; module_spi_driver(rs5c348_driver); MODULE_AUTHOR("Atsushi Nemoto <[email protected]>"); MODULE_DESCRIPTION("Ricoh RS5C348 RTC driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS("spi:rtc-rs5c348");
{ "pile_set_name": "Github" }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = whilst; var _noop = require('lodash/noop'); var _noop2 = _interopRequireDefault(_noop); var _rest = require('./internal/rest'); var _rest2 = _interopRequireDefault(_rest); var _onlyOnce = require('./internal/onlyOnce'); var _onlyOnce2 = _interopRequireDefault(_onlyOnce); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when * stopped, or an error occurs. * * @name whilst * @static * @memberOf module:ControlFlow * @method * @category Control Flow * @param {Function} test - synchronous truth test to perform before each * execution of `iteratee`. Invoked with (). * @param {Function} iteratee - A function which is called each time `test` passes. * The function is passed a `callback(err)`, which must be called once it has * completed with an optional `err` argument. Invoked with (callback). * @param {Function} [callback] - A callback which is called after the test * function has failed and repeated execution of `iteratee` has stopped. `callback` * will be passed an error and any arguments passed to the final `iteratee`'s * callback. Invoked with (err, [results]); * @returns undefined * @example * * var count = 0; * async.whilst( * function() { return count < 5; }, * function(callback) { * count++; * setTimeout(function() { * callback(null, count); * }, 1000); * }, * function (err, n) { * // 5 seconds have passed, n = 5 * } * ); */ function whilst(test, iteratee, callback) { callback = (0, _onlyOnce2.default)(callback || _noop2.default); if (!test()) return callback(null); var next = (0, _rest2.default)(function (err, args) { if (err) return callback(err); if (test()) return iteratee(next); callback.apply(null, [null].concat(args)); }); iteratee(next); } module.exports = exports['default'];
{ "pile_set_name": "Github" }
{%- if "program_console" in nginx_default_sites -%} {%- set default_site = "default_server" -%} {%- else -%} {%- set default_site = "" -%} {%- endif -%} server { listen {{ PROGRAM_CONSOLE_NGINX_PORT }} {{ default_site }}; server_name ~^((stage|prod)-)?program-console.*; {% include "handle-tls-redirect-and-ip-disclosure.j2" %} location / { root /edx/app/program-console/program-console/dist; index index.html; } } server { listen {{ PROGRAM_CONSOLE_SSL_NGINX_PORT }} ssl; server_name ~^((stage|prod)-)?program-console.*; ssl_certificate /etc/ssl/certs/wildcard.sandbox.edx.org.pem; ssl_certificate_key /etc/ssl/private/wildcard.sandbox.edx.org.key; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; location / { root /edx/app/program-console/program-console/dist; index index.html; } }
{ "pile_set_name": "Github" }
Size: - 0.1 - 0.1 - 0.1 Color: - 0.72850806 - 0.94 - 0.66 - 1 Body: Animated Pose: - - -0.81089497 - 0.35992804 - -0.46141216 - 1.2925547 - - -0.14097175 - 0.645112 - 0.750971 - 4.558377 - - 0.56795806 - 0.67400473 - -0.47237837 - 8.948726 - - 0.0 - 0.0 - 0.0 - 1 Shape: Cube
{ "pile_set_name": "Github" }
class Talloc < Formula desc "Hierarchical, reference-counted memory pool with destructors" homepage "https://talloc.samba.org/" url "https://www.samba.org/ftp/talloc/talloc-2.3.1.tar.gz" sha256 "ef4822d2fdafd2be8e0cabc3ec3c806ae29b8268e932c5e9a4cd5585f37f9f77" revision 1 livecheck do url "https://www.samba.org/ftp/talloc/" regex(/href=.*?talloc[._-]v?(\d+(?:\.\d+)+)\.t/i) end bottle do cellar :any sha256 "82822d910206a4ad8e90bfc61b04c0fb6c744bf76e9bf0aa06e35ecc08b34ae4" => :catalina sha256 "8ee812d0bf59bb34fd25b0c294c642e921b1af65f8d94e649e1d824e7b5dbb03" => :mojave sha256 "91ece067e0ac677d93fa1bdfa3e7db825e2950dd1feae0ee031d8e2522260155" => :high_sierra sha256 "3efdc0acfd0497501508220d948cd2a9a35393adc59b89123ab81020fdf3edc0" => :x86_64_linux end depends_on "[email protected]" => :build def install system "./configure", "--prefix=#{prefix}", "--disable-rpath", "--without-gettext", "--disable-python" system "make", "install" end test do (testpath/"test.c").write <<~EOS #include <talloc.h> int main() { int ret; TALLOC_CTX *tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { ret = 1; goto done; } ret = 0; done: talloc_free(tmp_ctx); return ret; } EOS system ENV.cc, "-I#{include}", "-L#{lib}", "test.c", "-o", "test", "-ltalloc" system testpath/"test" end end
{ "pile_set_name": "Github" }
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Quote\Model\GuestCart; /** * Shipping address management interface for guest carts. * @api * @since 100.0.2 */ interface GuestShippingAddressManagementInterface { /** * Assign a specified shipping address to a specified cart. * * @param string $cartId The cart ID. * @param \Magento\Quote\Api\Data\AddressInterface $address The shipping address data. * @return int Address ID. * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist. * @throws \Magento\Framework\Exception\InputException The specified cart ID or address data is not valid. */ public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $address); /** * Return the shipping address for a specified quote. * * @param string $cartId The cart ID. * @return \Magento\Quote\Api\Data\AddressInterface Shipping address object. * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist. */ public function get($cartId); }
{ "pile_set_name": "Github" }
{ "images" : [ { "filename" : "Chinanago.png", "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "author" : "xcode", "version" : 1 } }
{ "pile_set_name": "Github" }
// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 50; objects = { /* Begin PBXBuildFile section */ 05E22B61DF4F674F4064C3A8 /* Pods_SampleObjC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63E8B918780D0A7BA4FE891B /* Pods_SampleObjC.framework */; }; 4FAED569221DD5F800747B77 /* BasicDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FAED568221DD5F800747B77 /* BasicDemoViewController.m */; }; 4FAED56C221E0E5200747B77 /* MenuScreenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FAED56B221E0E5200747B77 /* MenuScreenViewController.m */; }; 4FAED571221E10C500747B77 /* NearbyDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FAED570221E10C500747B77 /* NearbyDemoViewController.m */; }; 4FAED575221E1E6800747B77 /* SharedDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FAED574221E1E6800747B77 /* SharedDemoViewController.m */; }; 76C862FB21F253EF008A4362 /* AuthenticationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C862FA21F253EF008A4362 /* AuthenticationHelper.m */; }; 7F03D8ED232F848B00AE0D2A /* SensorStatusView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7F03D8EC232F848B00AE0D2A /* SensorStatusView.xib */; }; 7F03D8F6232FA64100AE0D2A /* LocationProviderSensorStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F03D8F5232FA64100AE0D2A /* LocationProviderSensorStatus.m */; }; 7F03D8F7232FB16500AE0D2A /* SensorStatusView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F03D8EF232F852C00AE0D2A /* SensorStatusView.m */; }; 7F3D3488232ABBFC0092912B /* CoarseRelocDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F3D3487232ABBFC0092912B /* CoarseRelocDemoViewController.m */; }; 9C5FAA4B20B734390067DA11 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C5FAA4A20B734390067DA11 /* AppDelegate.m */; }; 9C5FAA5020B734390067DA11 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C5FAA4F20B734390067DA11 /* BaseViewController.m */; }; 9C5FAA5320B734390067DA11 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C5FAA5120B734390067DA11 /* Main.storyboard */; }; 9C5FAA5520B7343A0067DA11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9C5FAA5420B7343A0067DA11 /* Assets.xcassets */; }; 9C5FAA5820B7343A0067DA11 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C5FAA5620B7343A0067DA11 /* LaunchScreen.storyboard */; }; 9C5FAA5B20B7343A0067DA11 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C5FAA5A20B7343A0067DA11 /* main.m */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 9C5FAA7520B886030067DA11 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 20F35C4CE9BB0E31C0F1F004 /* Pods-SampleObjC.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleObjC.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SampleObjC/Pods-SampleObjC.debug.xcconfig"; sourceTree = "<group>"; }; 4FAED568221DD5F800747B77 /* BasicDemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BasicDemoViewController.m; sourceTree = "<group>"; }; 4FAED56A221DD66500747B77 /* BasicDemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BasicDemoViewController.h; sourceTree = "<group>"; }; 4FAED56B221E0E5200747B77 /* MenuScreenViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MenuScreenViewController.m; sourceTree = "<group>"; }; 4FAED56D221E0E6400747B77 /* MenuScreenViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MenuScreenViewController.h; sourceTree = "<group>"; }; 4FAED570221E10C500747B77 /* NearbyDemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NearbyDemoViewController.m; sourceTree = "<group>"; }; 4FAED572221E10D500747B77 /* NearbyDemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NearbyDemoViewController.h; sourceTree = "<group>"; }; 4FAED573221E1E5B00747B77 /* SharedDemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SharedDemoViewController.h; sourceTree = "<group>"; }; 4FAED574221E1E6800747B77 /* SharedDemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SharedDemoViewController.m; sourceTree = "<group>"; }; 63E8B918780D0A7BA4FE891B /* Pods_SampleObjC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleObjC.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 76C862F921F15D71008A4362 /* AuthenticationHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AuthenticationHelper.h; sourceTree = "<group>"; }; 76C862FA21F253EF008A4362 /* AuthenticationHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AuthenticationHelper.m; sourceTree = "<group>"; }; 76FB1EC321B899CF000D13D2 /* SampleObjC.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SampleObjC.entitlements; sourceTree = "<group>"; }; 7F03D8EC232F848B00AE0D2A /* SensorStatusView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SensorStatusView.xib; sourceTree = "<group>"; }; 7F03D8EE232F84C900AE0D2A /* SensorStatusView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SensorStatusView.h; sourceTree = "<group>"; }; 7F03D8EF232F852C00AE0D2A /* SensorStatusView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SensorStatusView.m; sourceTree = "<group>"; }; 7F03D8F2232FA60200AE0D2A /* SensorStatus.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SensorStatus.h; sourceTree = "<group>"; }; 7F03D8F3232FA61A00AE0D2A /* SensorStatusModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SensorStatusModel.h; sourceTree = "<group>"; }; 7F03D8F4232FA62C00AE0D2A /* LocationProviderSensorStatus.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocationProviderSensorStatus.h; sourceTree = "<group>"; }; 7F03D8F5232FA64100AE0D2A /* LocationProviderSensorStatus.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocationProviderSensorStatus.m; sourceTree = "<group>"; }; 7F3D3486232ABB810092912B /* CoarseRelocDemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CoarseRelocDemoViewController.h; sourceTree = "<group>"; }; 7F3D3487232ABBFC0092912B /* CoarseRelocDemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CoarseRelocDemoViewController.m; sourceTree = "<group>"; }; 9C5FAA4620B734390067DA11 /* SampleObjC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleObjC.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9C5FAA4920B734390067DA11 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 9C5FAA4A20B734390067DA11 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; 9C5FAA4E20B734390067DA11 /* BaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = "<group>"; }; 9C5FAA4F20B734390067DA11 /* BaseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = "<group>"; }; 9C5FAA5220B734390067DA11 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 9C5FAA5420B7343A0067DA11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 9C5FAA5720B7343A0067DA11 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 9C5FAA5920B7343A0067DA11 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 9C5FAA5A20B7343A0067DA11 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; FDA68FD63A95BB1C3CF75880 /* Pods-SampleObjC.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleObjC.release.xcconfig"; path = "Pods/Target Support Files/Pods-SampleObjC/Pods-SampleObjC.release.xcconfig"; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 9C5FAA4320B734390067DA11 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 05E22B61DF4F674F4064C3A8 /* Pods_SampleObjC.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 7F03D8EB232F842600AE0D2A /* Views */ = { isa = PBXGroup; children = ( 7F03D8EC232F848B00AE0D2A /* SensorStatusView.xib */, 7F03D8EE232F84C900AE0D2A /* SensorStatusView.h */, 7F03D8EF232F852C00AE0D2A /* SensorStatusView.m */, ); path = Views; sourceTree = "<group>"; }; 7F03D8F1232FA5E800AE0D2A /* Models */ = { isa = PBXGroup; children = ( 7F03D8F2232FA60200AE0D2A /* SensorStatus.h */, 7F03D8F3232FA61A00AE0D2A /* SensorStatusModel.h */, 7F03D8F4232FA62C00AE0D2A /* LocationProviderSensorStatus.h */, 7F03D8F5232FA64100AE0D2A /* LocationProviderSensorStatus.m */, ); path = Models; sourceTree = "<group>"; }; 8487ABF5C761FBBE647B9D88 /* Pods */ = { isa = PBXGroup; children = ( 20F35C4CE9BB0E31C0F1F004 /* Pods-SampleObjC.debug.xcconfig */, FDA68FD63A95BB1C3CF75880 /* Pods-SampleObjC.release.xcconfig */, ); name = Pods; sourceTree = "<group>"; }; 9C5FAA3D20B734390067DA11 = { isa = PBXGroup; children = ( 9C5FAA4820B734390067DA11 /* SampleObjC */, 9C5FAA4720B734390067DA11 /* Products */, 9C5FAA6220B773880067DA11 /* Frameworks */, 8487ABF5C761FBBE647B9D88 /* Pods */, ); sourceTree = "<group>"; }; 9C5FAA4720B734390067DA11 /* Products */ = { isa = PBXGroup; children = ( 9C5FAA4620B734390067DA11 /* SampleObjC.app */, ); name = Products; sourceTree = "<group>"; }; 9C5FAA4820B734390067DA11 /* SampleObjC */ = { isa = PBXGroup; children = ( 7F03D8F1232FA5E800AE0D2A /* Models */, 7F03D8EB232F842600AE0D2A /* Views */, 9C5FAA5420B7343A0067DA11 /* Assets.xcassets */, 9C5FAA5A20B7343A0067DA11 /* main.m */, 9C5FAA4920B734390067DA11 /* AppDelegate.h */, 9C5FAA4A20B734390067DA11 /* AppDelegate.m */, 4FAED56D221E0E6400747B77 /* MenuScreenViewController.h */, 4FAED56B221E0E5200747B77 /* MenuScreenViewController.m */, 9C5FAA4E20B734390067DA11 /* BaseViewController.h */, 9C5FAA4F20B734390067DA11 /* BaseViewController.m */, 4FAED56A221DD66500747B77 /* BasicDemoViewController.h */, 4FAED568221DD5F800747B77 /* BasicDemoViewController.m */, 7F3D3486232ABB810092912B /* CoarseRelocDemoViewController.h */, 7F3D3487232ABBFC0092912B /* CoarseRelocDemoViewController.m */, 4FAED572221E10D500747B77 /* NearbyDemoViewController.h */, 4FAED570221E10C500747B77 /* NearbyDemoViewController.m */, 4FAED573221E1E5B00747B77 /* SharedDemoViewController.h */, 4FAED574221E1E6800747B77 /* SharedDemoViewController.m */, 76C862F921F15D71008A4362 /* AuthenticationHelper.h */, 76C862FA21F253EF008A4362 /* AuthenticationHelper.m */, 9C5FAA5920B7343A0067DA11 /* Info.plist */, 9C5FAA5120B734390067DA11 /* Main.storyboard */, 9C5FAA5620B7343A0067DA11 /* LaunchScreen.storyboard */, 76FB1EC321B899CF000D13D2 /* SampleObjC.entitlements */, ); path = SampleObjC; sourceTree = "<group>"; }; 9C5FAA6220B773880067DA11 /* Frameworks */ = { isa = PBXGroup; children = ( 63E8B918780D0A7BA4FE891B /* Pods_SampleObjC.framework */, ); name = Frameworks; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 9C5FAA4520B734390067DA11 /* SampleObjC */ = { isa = PBXNativeTarget; buildConfigurationList = 9C5FAA5E20B7343A0067DA11 /* Build configuration list for PBXNativeTarget "SampleObjC" */; buildPhases = ( D650D7C0A8C6454EC41703FB /* [CP] Check Pods Manifest.lock */, 9C5FAA4220B734390067DA11 /* Sources */, 9C5FAA4320B734390067DA11 /* Frameworks */, 9C5FAA4420B734390067DA11 /* Resources */, 9C5FAA7520B886030067DA11 /* Embed Frameworks */, 8AA874BD7EC07283E17B32DD /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = SampleObjC; productName = SampleObjC; productReference = 9C5FAA4620B734390067DA11 /* SampleObjC.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 9C5FAA3E20B734390067DA11 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 1000; ORGANIZATIONNAME = Microsoft; TargetAttributes = { 9C5FAA4520B734390067DA11 = { CreatedOnToolsVersion = 9.3.1; SystemCapabilities = { com.apple.Keychain = { enabled = 1; }; }; }; }; }; buildConfigurationList = 9C5FAA4120B734390067DA11 /* Build configuration list for PBXProject "SampleObjC" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 9C5FAA3D20B734390067DA11; productRefGroup = 9C5FAA4720B734390067DA11 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 9C5FAA4520B734390067DA11 /* SampleObjC */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 9C5FAA4420B734390067DA11 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9C5FAA5820B7343A0067DA11 /* LaunchScreen.storyboard in Resources */, 9C5FAA5520B7343A0067DA11 /* Assets.xcassets in Resources */, 7F03D8ED232F848B00AE0D2A /* SensorStatusView.xib in Resources */, 9C5FAA5320B734390067DA11 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 8AA874BD7EC07283E17B32DD /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SampleObjC/Pods-SampleObjC-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; D650D7C0A8C6454EC41703FB /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-SampleObjC-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 9C5FAA4220B734390067DA11 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 4FAED575221E1E6800747B77 /* SharedDemoViewController.m in Sources */, 4FAED571221E10C500747B77 /* NearbyDemoViewController.m in Sources */, 7F3D3488232ABBFC0092912B /* CoarseRelocDemoViewController.m in Sources */, 9C5FAA5020B734390067DA11 /* BaseViewController.m in Sources */, 4FAED56C221E0E5200747B77 /* MenuScreenViewController.m in Sources */, 4FAED569221DD5F800747B77 /* BasicDemoViewController.m in Sources */, 76C862FB21F253EF008A4362 /* AuthenticationHelper.m in Sources */, 9C5FAA5B20B7343A0067DA11 /* main.m in Sources */, 7F03D8F7232FB16500AE0D2A /* SensorStatusView.m in Sources */, 7F03D8F6232FA64100AE0D2A /* LocationProviderSensorStatus.m in Sources */, 9C5FAA4B20B734390067DA11 /* AppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 9C5FAA5120B734390067DA11 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 9C5FAA5220B734390067DA11 /* Base */, ); name = Main.storyboard; sourceTree = "<group>"; }; 9C5FAA5620B7343A0067DA11 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 9C5FAA5720B7343A0067DA11 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = "<group>"; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 9C5FAA5C20B7343A0067DA11 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; }; 9C5FAA5D20B7343A0067DA11 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_BITCODE = NO; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; name = Release; }; 9C5FAA5F20B7343A0067DA11 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 20F35C4CE9BB0E31C0F1F004 /* Pods-SampleObjC.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = SampleObjC/SampleObjC.entitlements; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_CONFIGURATION_BUILD_DIR}/ADAL\"/**", "\"${PODS_ROOT}/AzureSpatialAnchors/bin/frameworks\"", ); INFOPLIST_FILE = SampleObjC/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.spatialanchorsObjectiveCsample-df"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/SampleObjC"; }; name = Debug; }; 9C5FAA6020B7343A0067DA11 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = FDA68FD63A95BB1C3CF75880 /* Pods-SampleObjC.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = SampleObjC/SampleObjC.entitlements; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = SampleObjC/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.spatialanchorsObjectiveCsample-df"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/SampleObjC"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 9C5FAA4120B734390067DA11 /* Build configuration list for PBXProject "SampleObjC" */ = { isa = XCConfigurationList; buildConfigurations = ( 9C5FAA5C20B7343A0067DA11 /* Debug */, 9C5FAA5D20B7343A0067DA11 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9C5FAA5E20B7343A0067DA11 /* Build configuration list for PBXNativeTarget "SampleObjC" */ = { isa = XCConfigurationList; buildConfigurations = ( 9C5FAA5F20B7343A0067DA11 /* Debug */, 9C5FAA6020B7343A0067DA11 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 9C5FAA3E20B734390067DA11 /* Project object */; }
{ "pile_set_name": "Github" }
.highlight .hll { background-color: #ffffcc } .highlight { background: #eeffcc; } .highlight .c { color: #408090; font-style: italic } /* Comment */ .highlight .err { border: 1px solid #FF0000 } /* Error */ .highlight .k { color: #007020; font-weight: bold } /* Keyword */ .highlight .o { color: #666666 } /* Operator */ .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ .highlight .cp { color: #007020 } /* Comment.Preproc */ .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #A00000 } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #FF0000 } /* Generic.Error */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #00A000 } /* Generic.Inserted */ .highlight .go { color: #333333 } /* Generic.Output */ .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .highlight .gt { color: #0044DD } /* Generic.Traceback */ .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #007020 } /* Keyword.Pseudo */ .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #902000 } /* Keyword.Type */ .highlight .m { color: #208050 } /* Literal.Number */ .highlight .s { color: #4070a0 } /* Literal.String */ .highlight .na { color: #4070a0 } /* Name.Attribute */ .highlight .nb { color: #007020 } /* Name.Builtin */ .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ .highlight .no { color: #60add5 } /* Name.Constant */ .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ .highlight .ne { color: #007020 } /* Name.Exception */ .highlight .nf { color: #06287e } /* Name.Function */ .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #bb60d5 } /* Name.Variable */ .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #208050 } /* Literal.Number.Bin */ .highlight .mf { color: #208050 } /* Literal.Number.Float */ .highlight .mh { color: #208050 } /* Literal.Number.Hex */ .highlight .mi { color: #208050 } /* Literal.Number.Integer */ .highlight .mo { color: #208050 } /* Literal.Number.Oct */ .highlight .sa { color: #4070a0 } /* Literal.String.Affix */ .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ .highlight .sc { color: #4070a0 } /* Literal.String.Char */ .highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ .highlight .sx { color: #c65d09 } /* Literal.String.Other */ .highlight .sr { color: #235388 } /* Literal.String.Regex */ .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ .highlight .ss { color: #517918 } /* Literal.String.Symbol */ .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #06287e } /* Name.Function.Magic */ .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
{ "pile_set_name": "Github" }
#import "NMBStringify.h" #import <Nimble/Nimble-Swift.h> NSString *_Nonnull NMBStringify(id _Nullable anyObject) { return [NMBStringer stringify:anyObject]; }
{ "pile_set_name": "Github" }
{ "usingComponents": { "menu": "/components/common/menu", "header": "/components/common/header/header" } }
{ "pile_set_name": "Github" }
/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2006 Blender Foundation. * All rights reserved. */ /** \file * \ingroup gpu * * Manages materials, lights and textures. */ #include <math.h> #include <string.h> #include "MEM_guardedalloc.h" #include "DNA_material_types.h" #include "DNA_scene_types.h" #include "DNA_world_types.h" #include "BLI_ghash.h" #include "BLI_listbase.h" #include "BLI_math.h" #include "BLI_string.h" #include "BLI_string_utils.h" #include "BLI_utildefines.h" #include "BKE_main.h" #include "BKE_material.h" #include "BKE_node.h" #include "BKE_scene.h" #include "GPU_material.h" #include "GPU_shader.h" #include "GPU_texture.h" #include "GPU_uniform_buffer.h" #include "DRW_engine.h" #include "gpu_codegen.h" #include "gpu_node_graph.h" /* Structs */ #define MAX_COLOR_BAND 128 typedef struct GPUColorBandBuilder { float pixels[MAX_COLOR_BAND][CM_TABLE + 1][4]; int current_layer; } GPUColorBandBuilder; struct GPUMaterial { Scene *scene; /* DEPRECATED was only useful for lights. */ Material *ma; eGPUMaterialStatus status; const void *engine_type; /* attached engine type */ int options; /* to identify shader variations (shadow, probe, world background...) */ bool is_volume_shader; /* is volumetric shader */ /* Nodes */ GPUNodeGraph graph; /* for binding the material */ GPUPass *pass; /* XXX: Should be in Material. But it depends on the output node * used and since the output selection is different for GPUMaterial... */ bool has_volume_output; bool has_surface_output; /* Only used by Eevee to know which bsdf are used. */ eGPUMatFlag flag; /* Used by 2.8 pipeline */ GPUUniformBuf *ubo; /* UBOs for shader uniforms. */ /* Eevee SSS */ GPUUniformBuf *sss_profile; /* UBO containing SSS profile. */ GPUTexture *sss_tex_profile; /* Texture containing SSS profile. */ float sss_enabled; float sss_radii[3]; int sss_samples; short int sss_falloff; float sss_sharpness; bool sss_dirty; GPUTexture *coba_tex; /* 1D Texture array containing all color bands. */ GPUColorBandBuilder *coba_builder; GSet *used_libraries; #ifndef NDEBUG char name[64]; #endif }; enum { GPU_USE_SURFACE_OUTPUT = (1 << 0), GPU_USE_VOLUME_OUTPUT = (1 << 1), }; /* Functions */ /* Returns the address of the future pointer to coba_tex */ GPUTexture **gpu_material_ramp_texture_row_set(GPUMaterial *mat, int size, float *pixels, float *row) { /* In order to put all the color-bands into one 1D array texture, * we need them to be the same size. */ BLI_assert(size == CM_TABLE + 1); UNUSED_VARS_NDEBUG(size); if (mat->coba_builder == NULL) { mat->coba_builder = MEM_mallocN(sizeof(GPUColorBandBuilder), "GPUColorBandBuilder"); mat->coba_builder->current_layer = 0; } int layer = mat->coba_builder->current_layer; *row = (float)layer; if (*row == MAX_COLOR_BAND) { printf("Too many color band in shader! Remove some Curve, Black Body or Color Ramp Node.\n"); } else { float *dst = (float *)mat->coba_builder->pixels[layer]; memcpy(dst, pixels, sizeof(float) * (CM_TABLE + 1) * 4); mat->coba_builder->current_layer += 1; } return &mat->coba_tex; } static void gpu_material_ramp_texture_build(GPUMaterial *mat) { if (mat->coba_builder == NULL) { return; } GPUColorBandBuilder *builder = mat->coba_builder; mat->coba_tex = GPU_texture_create_1d_array( "mat_ramp", CM_TABLE + 1, builder->current_layer, 1, GPU_RGBA16F, (float *)builder->pixels); MEM_freeN(builder); mat->coba_builder = NULL; } static void gpu_material_free_single(GPUMaterial *material) { /* Cancel / wait any pending lazy compilation. */ DRW_deferred_shader_remove(material); gpu_node_graph_free(&material->graph); if (material->pass != NULL) { GPU_pass_release(material->pass); } if (material->ubo != NULL) { GPU_uniformbuf_free(material->ubo); } if (material->sss_tex_profile != NULL) { GPU_texture_free(material->sss_tex_profile); } if (material->sss_profile != NULL) { GPU_uniformbuf_free(material->sss_profile); } if (material->coba_tex != NULL) { GPU_texture_free(material->coba_tex); } BLI_gset_free(material->used_libraries, NULL); } void GPU_material_free(ListBase *gpumaterial) { LISTBASE_FOREACH (LinkData *, link, gpumaterial) { GPUMaterial *material = link->data; gpu_material_free_single(material); MEM_freeN(material); } BLI_freelistN(gpumaterial); } Scene *GPU_material_scene(GPUMaterial *material) { return material->scene; } GPUPass *GPU_material_get_pass(GPUMaterial *material) { return material->pass; } GPUShader *GPU_material_get_shader(GPUMaterial *material) { return material->pass ? GPU_pass_shader_get(material->pass) : NULL; } /* Return can be NULL if it's a world material. */ Material *GPU_material_get_material(GPUMaterial *material) { return material->ma; } GPUUniformBuf *GPU_material_uniform_buffer_get(GPUMaterial *material) { return material->ubo; } /** * Create dynamic UBO from parameters * * \param inputs: Items are #LinkData, data is #GPUInput (`BLI_genericNodeN(GPUInput)`). */ void GPU_material_uniform_buffer_create(GPUMaterial *material, ListBase *inputs) { #ifndef NDEBUG const char *name = material->name; #else const char *name = "Material"; #endif material->ubo = GPU_uniformbuf_create_from_list(inputs, name); } /* Eevee Subsurface scattering. */ /* Based on Separable SSS. by Jorge Jimenez and Diego Gutierrez */ #define SSS_SAMPLES 65 #define SSS_EXPONENT 2.0f /* Importance sampling exponent */ typedef struct GPUSssKernelData { float kernel[SSS_SAMPLES][4]; float param[3], max_radius; int samples; int pad[3]; } GPUSssKernelData; BLI_STATIC_ASSERT_ALIGN(GPUSssKernelData, 16) static void sss_calculate_offsets(GPUSssKernelData *kd, int count, float exponent) { float step = 2.0f / (float)(count - 1); for (int i = 0; i < count; i++) { float o = ((float)i) * step - 1.0f; float sign = (o < 0.0f) ? -1.0f : 1.0f; float ofs = sign * fabsf(powf(o, exponent)); kd->kernel[i][3] = ofs; } } #define GAUSS_TRUNCATE 12.46f static float gaussian_profile(float r, float radius) { const float v = radius * radius * (0.25f * 0.25f); const float Rm = sqrtf(v * GAUSS_TRUNCATE); if (r >= Rm) { return 0.0f; } return expf(-r * r / (2.0f * v)) / (2.0f * M_PI * v); } #define BURLEY_TRUNCATE 16.0f #define BURLEY_TRUNCATE_CDF 0.9963790093708328f // cdf(BURLEY_TRUNCATE) static float burley_profile(float r, float d) { float exp_r_3_d = expf(-r / (3.0f * d)); float exp_r_d = exp_r_3_d * exp_r_3_d * exp_r_3_d; return (exp_r_d + exp_r_3_d) / (4.0f * d); } static float cubic_profile(float r, float radius, float sharpness) { float Rm = radius * (1.0f + sharpness); if (r >= Rm) { return 0.0f; } /* custom variation with extra sharpness, to match the previous code */ const float y = 1.0f / (1.0f + sharpness); float Rmy, ry, ryinv; Rmy = powf(Rm, y); ry = powf(r, y); ryinv = (r > 0.0f) ? powf(r, y - 1.0f) : 0.0f; const float Rmy5 = (Rmy * Rmy) * (Rmy * Rmy) * Rmy; const float f = Rmy - ry; const float num = f * (f * f) * (y * ryinv); return (10.0f * num) / (Rmy5 * M_PI); } static float eval_profile(float r, short falloff_type, float sharpness, float param) { r = fabsf(r); if (falloff_type == SHD_SUBSURFACE_BURLEY || falloff_type == SHD_SUBSURFACE_RANDOM_WALK) { return burley_profile(r, param) / BURLEY_TRUNCATE_CDF; } if (falloff_type == SHD_SUBSURFACE_CUBIC) { return cubic_profile(r, param, sharpness); } return gaussian_profile(r, param); } /* Resolution for each sample of the precomputed kernel profile */ #define INTEGRAL_RESOLUTION 32 static float eval_integral(float x0, float x1, short falloff_type, float sharpness, float param) { const float range = x1 - x0; const float step = range / INTEGRAL_RESOLUTION; float integral = 0.0f; for (int i = 0; i < INTEGRAL_RESOLUTION; i++) { float x = x0 + range * ((float)i + 0.5f) / (float)INTEGRAL_RESOLUTION; float y = eval_profile(x, falloff_type, sharpness, param); integral += y * step; } return integral; } #undef INTEGRAL_RESOLUTION static void compute_sss_kernel( GPUSssKernelData *kd, const float radii[3], int sample_len, int falloff_type, float sharpness) { float rad[3]; /* Minimum radius */ rad[0] = MAX2(radii[0], 1e-15f); rad[1] = MAX2(radii[1], 1e-15f); rad[2] = MAX2(radii[2], 1e-15f); /* Christensen-Burley fitting */ float l[3], d[3]; if (falloff_type == SHD_SUBSURFACE_BURLEY || falloff_type == SHD_SUBSURFACE_RANDOM_WALK) { mul_v3_v3fl(l, rad, 0.25f * M_1_PI); const float A = 1.0f; const float s = 1.9f - A + 3.5f * (A - 0.8f) * (A - 0.8f); /* XXX 0.6f Out of nowhere to match cycles! Empirical! Can be tweak better. */ mul_v3_v3fl(d, l, 0.6f / s); mul_v3_v3fl(rad, d, BURLEY_TRUNCATE); kd->max_radius = MAX3(rad[0], rad[1], rad[2]); copy_v3_v3(kd->param, d); } else if (falloff_type == SHD_SUBSURFACE_CUBIC) { copy_v3_v3(kd->param, rad); mul_v3_fl(rad, 1.0f + sharpness); kd->max_radius = MAX3(rad[0], rad[1], rad[2]); } else { kd->max_radius = MAX3(rad[0], rad[1], rad[2]); copy_v3_v3(kd->param, rad); } /* Compute samples locations on the 1d kernel [-1..1] */ sss_calculate_offsets(kd, sample_len, SSS_EXPONENT); /* Weights sum for normalization */ float sum[3] = {0.0f, 0.0f, 0.0f}; /* Compute integral of each sample footprint */ for (int i = 0; i < sample_len; i++) { float x0, x1; if (i == 0) { x0 = kd->kernel[0][3] - fabsf(kd->kernel[0][3] - kd->kernel[1][3]) / 2.0f; } else { x0 = (kd->kernel[i - 1][3] + kd->kernel[i][3]) / 2.0f; } if (i == sample_len - 1) { x1 = kd->kernel[sample_len - 1][3] + fabsf(kd->kernel[sample_len - 2][3] - kd->kernel[sample_len - 1][3]) / 2.0f; } else { x1 = (kd->kernel[i][3] + kd->kernel[i + 1][3]) / 2.0f; } x0 *= kd->max_radius; x1 *= kd->max_radius; kd->kernel[i][0] = eval_integral(x0, x1, falloff_type, sharpness, kd->param[0]); kd->kernel[i][1] = eval_integral(x0, x1, falloff_type, sharpness, kd->param[1]); kd->kernel[i][2] = eval_integral(x0, x1, falloff_type, sharpness, kd->param[2]); sum[0] += kd->kernel[i][0]; sum[1] += kd->kernel[i][1]; sum[2] += kd->kernel[i][2]; } for (int i = 0; i < 3; i++) { if (sum[i] > 0.0f) { /* Normalize */ for (int j = 0; j < sample_len; j++) { kd->kernel[j][i] /= sum[i]; } } else { /* Avoid 0 kernel sum. */ kd->kernel[sample_len / 2][i] = 1.0f; } } /* Put center sample at the start of the array (to sample first) */ float tmpv[4]; copy_v4_v4(tmpv, kd->kernel[sample_len / 2]); for (int i = sample_len / 2; i > 0; i--) { copy_v4_v4(kd->kernel[i], kd->kernel[i - 1]); } copy_v4_v4(kd->kernel[0], tmpv); kd->samples = sample_len; } #define INTEGRAL_RESOLUTION 512 static void compute_sss_translucence_kernel(const GPUSssKernelData *kd, int resolution, short falloff_type, float sharpness, float **output) { float(*texels)[4]; texels = MEM_callocN(sizeof(float[4]) * resolution, "compute_sss_translucence_kernel"); *output = (float *)texels; /* Last texel should be black, hence the - 1. */ for (int i = 0; i < resolution - 1; i++) { /* Distance from surface. */ float d = kd->max_radius * ((float)i + 0.00001f) / ((float)resolution); /* For each distance d we compute the radiance incoming from an hypothetic parallel plane. */ /* Compute radius of the footprint on the hypothetic plane */ float r_fp = sqrtf(kd->max_radius * kd->max_radius - d * d); float r_step = r_fp / INTEGRAL_RESOLUTION; float area_accum = 0.0f; for (float r = 0.0f; r < r_fp; r += r_step) { /* Compute distance to the "shading" point through the medium. */ /* r_step * 0.5f to put sample between the area borders */ float dist = hypotf(r + r_step * 0.5f, d); float profile[3]; profile[0] = eval_profile(dist, falloff_type, sharpness, kd->param[0]); profile[1] = eval_profile(dist, falloff_type, sharpness, kd->param[1]); profile[2] = eval_profile(dist, falloff_type, sharpness, kd->param[2]); /* Since the profile and configuration are radially symmetrical we * can just evaluate it once and weight it accordingly */ float r_next = r + r_step; float disk_area = (M_PI * r_next * r_next) - (M_PI * r * r); mul_v3_fl(profile, disk_area); add_v3_v3(texels[i], profile); area_accum += disk_area; } /* Normalize over the disk. */ mul_v3_fl(texels[i], 1.0f / (area_accum)); } /* Normalize */ for (int j = resolution - 2; j > 0; j--) { texels[j][0] /= (texels[0][0] > 0.0f) ? texels[0][0] : 1.0f; texels[j][1] /= (texels[0][1] > 0.0f) ? texels[0][1] : 1.0f; texels[j][2] /= (texels[0][2] > 0.0f) ? texels[0][2] : 1.0f; } /* First texel should be white */ texels[0][0] = (texels[0][0] > 0.0f) ? 1.0f : 0.0f; texels[0][1] = (texels[0][1] > 0.0f) ? 1.0f : 0.0f; texels[0][2] = (texels[0][2] > 0.0f) ? 1.0f : 0.0f; /* dim the last few texels for smoother transition */ mul_v3_fl(texels[resolution - 2], 0.25f); mul_v3_fl(texels[resolution - 3], 0.5f); mul_v3_fl(texels[resolution - 4], 0.75f); } #undef INTEGRAL_RESOLUTION void GPU_material_sss_profile_create(GPUMaterial *material, float radii[3], const short *falloff_type, const float *sharpness) { copy_v3_v3(material->sss_radii, radii); material->sss_falloff = (falloff_type) ? *falloff_type : 0.0; material->sss_sharpness = (sharpness) ? *sharpness : 0.0; material->sss_dirty = true; material->sss_enabled = true; /* Update / Create UBO */ if (material->sss_profile == NULL) { material->sss_profile = GPU_uniformbuf_create(sizeof(GPUSssKernelData)); } } struct GPUUniformBuf *GPU_material_sss_profile_get(GPUMaterial *material, int sample_len, GPUTexture **tex_profile) { if (!material->sss_enabled) { return NULL; } if (material->sss_dirty || (material->sss_samples != sample_len)) { GPUSssKernelData kd; float sharpness = material->sss_sharpness; /* XXX Black magic but it seems to fit. Maybe because we integrate -1..1 */ sharpness *= 0.5f; compute_sss_kernel(&kd, material->sss_radii, sample_len, material->sss_falloff, sharpness); /* Update / Create UBO */ GPU_uniformbuf_update(material->sss_profile, &kd); /* Update / Create Tex */ float *translucence_profile; compute_sss_translucence_kernel( &kd, 64, material->sss_falloff, sharpness, &translucence_profile); if (material->sss_tex_profile != NULL) { GPU_texture_free(material->sss_tex_profile); } material->sss_tex_profile = GPU_texture_create_1d( "sss_tex_profile", 64, 1, GPU_RGBA16F, translucence_profile); MEM_freeN(translucence_profile); material->sss_samples = sample_len; material->sss_dirty = false; } if (tex_profile != NULL) { *tex_profile = material->sss_tex_profile; } return material->sss_profile; } struct GPUUniformBuf *GPU_material_create_sss_profile_ubo(void) { return GPU_uniformbuf_create(sizeof(GPUSssKernelData)); } #undef SSS_EXPONENT #undef SSS_SAMPLES ListBase GPU_material_attributes(GPUMaterial *material) { return material->graph.attributes; } ListBase GPU_material_textures(GPUMaterial *material) { return material->graph.textures; } ListBase GPU_material_volume_grids(GPUMaterial *material) { return material->graph.volume_grids; } void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link) { if (!material->graph.outlink) { material->graph.outlink = link; } } GPUNodeGraph *gpu_material_node_graph(GPUMaterial *material) { return &material->graph; } GSet *gpu_material_used_libraries(GPUMaterial *material) { return material->used_libraries; } /* Return true if the material compilation has not yet begin or begin. */ eGPUMaterialStatus GPU_material_status(GPUMaterial *mat) { return mat->status; } /* Code generation */ bool GPU_material_has_surface_output(GPUMaterial *mat) { return mat->has_surface_output; } bool GPU_material_has_volume_output(GPUMaterial *mat) { return mat->has_volume_output; } bool GPU_material_is_volume_shader(GPUMaterial *mat) { return mat->is_volume_shader; } void GPU_material_flag_set(GPUMaterial *mat, eGPUMatFlag flag) { mat->flag |= flag; } bool GPU_material_flag_get(GPUMaterial *mat, eGPUMatFlag flag) { return (mat->flag & flag) != 0; } GPUMaterial *GPU_material_from_nodetree_find(ListBase *gpumaterials, const void *engine_type, int options) { LISTBASE_FOREACH (LinkData *, link, gpumaterials) { GPUMaterial *current_material = (GPUMaterial *)link->data; if (current_material->engine_type == engine_type && current_material->options == options) { return current_material; } } return NULL; } /** * \note Caller must use #GPU_material_from_nodetree_find to re-use existing materials, * This is enforced since constructing other arguments to this function may be expensive * so only do this when they are needed. */ GPUMaterial *GPU_material_from_nodetree(Scene *scene, struct Material *ma, struct bNodeTree *ntree, ListBase *gpumaterials, const void *engine_type, const int options, const bool is_volume_shader, const char *vert_code, const char *geom_code, const char *frag_lib, const char *defines, const char *name, GPUMaterialEvalCallbackFn callback) { LinkData *link; bool has_volume_output, has_surface_output; /* Caller must re-use materials. */ BLI_assert(GPU_material_from_nodetree_find(gpumaterials, engine_type, options) == NULL); /* HACK: Eevee assume this to create Ghash keys. */ BLI_assert(sizeof(GPUPass) > 16); /* allocate material */ GPUMaterial *mat = MEM_callocN(sizeof(GPUMaterial), "GPUMaterial"); mat->ma = ma; mat->scene = scene; mat->engine_type = engine_type; mat->options = options; mat->is_volume_shader = is_volume_shader; #ifndef NDEBUG BLI_snprintf(mat->name, sizeof(mat->name), "%s", name); #else UNUSED_VARS(name); #endif mat->used_libraries = BLI_gset_new( BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "GPUMaterial.used_libraries"); /* localize tree to create links for reroute and mute */ bNodeTree *localtree = ntreeLocalize(ntree); ntreeGPUMaterialNodes(localtree, mat, &has_surface_output, &has_volume_output); gpu_material_ramp_texture_build(mat); mat->has_surface_output = has_surface_output; mat->has_volume_output = has_volume_output; if (mat->graph.outlink) { if (callback) { callback(mat, options, &vert_code, &geom_code, &frag_lib, &defines); } /* HACK: this is only for eevee. We add the define here after the nodetree evaluation. */ if (GPU_material_flag_get(mat, GPU_MATFLAG_SSS)) { defines = BLI_string_joinN(defines, "#ifndef USE_ALPHA_BLEND\n" "# define USE_SSS\n" "#endif\n"); } /* Create source code and search pass cache for an already compiled version. */ mat->pass = GPU_generate_pass(mat, &mat->graph, vert_code, geom_code, frag_lib, defines); if (GPU_material_flag_get(mat, GPU_MATFLAG_SSS)) { MEM_freeN((char *)defines); } if (mat->pass == NULL) { /* We had a cache hit and the shader has already failed to compile. */ mat->status = GPU_MAT_FAILED; gpu_node_graph_free(&mat->graph); } else { GPUShader *sh = GPU_pass_shader_get(mat->pass); if (sh != NULL) { /* We had a cache hit and the shader is already compiled. */ mat->status = GPU_MAT_SUCCESS; gpu_node_graph_free_nodes(&mat->graph); } else { mat->status = GPU_MAT_QUEUED; } } } else { mat->status = GPU_MAT_FAILED; gpu_node_graph_free(&mat->graph); } /* Only free after GPU_pass_shader_get where GPUUniformBuf * read data from the local tree. */ ntreeFreeLocalTree(localtree); MEM_freeN(localtree); /* note that even if building the shader fails in some way, we still keep * it to avoid trying to compile again and again, and simply do not use * the actual shader on drawing */ link = MEM_callocN(sizeof(LinkData), "GPUMaterialLink"); link->data = mat; BLI_addtail(gpumaterials, link); return mat; } void GPU_material_compile(GPUMaterial *mat) { bool success; BLI_assert(mat->status == GPU_MAT_QUEUED); BLI_assert(mat->pass); /* NOTE: The shader may have already been compiled here since we are * sharing GPUShader across GPUMaterials. In this case it's a no-op. */ #ifndef NDEBUG success = GPU_pass_compile(mat->pass, mat->name); #else success = GPU_pass_compile(mat->pass, __func__); #endif if (success) { GPUShader *sh = GPU_pass_shader_get(mat->pass); if (sh != NULL) { mat->status = GPU_MAT_SUCCESS; gpu_node_graph_free_nodes(&mat->graph); } } else { mat->status = GPU_MAT_FAILED; GPU_pass_release(mat->pass); mat->pass = NULL; gpu_node_graph_free(&mat->graph); } } void GPU_materials_free(Main *bmain) { Material *ma; World *wo; for (ma = bmain->materials.first; ma; ma = ma->id.next) { GPU_material_free(&ma->gpumaterial); } for (wo = bmain->worlds.first; wo; wo = wo->id.next) { GPU_material_free(&wo->gpumaterial); } BKE_material_defaults_free_gpu(); }
{ "pile_set_name": "Github" }
$! TESTSSL.COM $ $ __arch := VAX $ if f$getsyi("cpu") .ge. 128 then - __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") $ if __arch .eqs. "" then __arch := UNK $ texe_dir := sys$disk:[-.'__arch'.exe.test] $ exe_dir := sys$disk:[-.'__arch'.exe.apps] $ $ if p1 .eqs. "" $ then $ key="[-.apps]server.pem" $ else $ key=p1 $ endif $ if p2 .eqs. "" $ then $ cert="[-.apps]server.pem" $ else $ cert=p2 $ endif $ ssltest := mcr 'texe_dir'ssltest -key 'key' -cert 'cert' -c_key 'key' -c_cert 'cert' $ $ set noon $ define/user sys$output testssl-x509-output. $ define/user sys$error nla0: $ mcr 'exe_dir'openssl x509 -in 'cert' -text -noout $ define/user sys$error nla0: $ search/output=nla0: testssl-x509-output. "DSA Public Key"/exact $ if $severity .eq. 1 $ then $ dsa_cert := YES $ else $ dsa_cert := NO $ endif $ delete testssl-x509-output.;* $ $ if p3 .eqs. "" $ then $ copy/concatenate [-.certs]*.pem certs.tmp $ CA = """-CAfile"" certs.tmp" $ else $ CA = """-CAfile"" "+p3 $ endif $ $!########################################################################### $ $ write sys$output "test sslv2" $ 'ssltest' -ssl2 $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2 with server authentication" $ 'ssltest' -ssl2 -server_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ if .not. dsa_cert $ then $ write sys$output "test sslv2 with client authentication" $ 'ssltest' -ssl2 -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2 with both client and server authentication" $ 'ssltest' -ssl2 -server_auth -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ endif $ $ write sys$output "test sslv3" $ 'ssltest' -ssl3 $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv3 with server authentication" $ 'ssltest' -ssl3 -server_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv3 with client authentication" $ 'ssltest' -ssl3 -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv3 with both client and server authentication" $ 'ssltest' -ssl3 -server_auth -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2/sslv3" $ 'ssltest' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2/sslv3 with server authentication" $ 'ssltest' -server_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2/sslv3 with client authentication" $ 'ssltest' -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2/sslv3 with both client and server authentication" $ 'ssltest' -server_auth -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2 via BIO pair" $ 'ssltest' -bio_pair -ssl2 $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2 with server authentication via BIO pair" $ 'ssltest' -bio_pair -ssl2 -server_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ if .not. dsa_cert $ then $ write sys$output "test sslv2 with client authentication via BIO pair" $ 'ssltest' -bio_pair -ssl2 -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2 with both client and server authentication via BIO pair" $ 'ssltest' -bio_pair -ssl2 -server_auth -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ endif $ $ write sys$output "test sslv3 via BIO pair" $ 'ssltest' -bio_pair -ssl3 $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv3 with server authentication via BIO pair" $ 'ssltest' -bio_pair -ssl3 -server_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv3 with client authentication via BIO pair" $ 'ssltest' -bio_pair -ssl3 -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ write sys$output "test sslv3 with both client and server authentication via BIO pair" $ 'ssltest' -bio_pair -ssl3 -server_auth -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2/sslv3 via BIO pair" $ 'ssltest' $ if $severity .ne. 1 then goto exit3 $ $ if .not. dsa_cert $ then $ write sys$output "test sslv2/sslv3 w/o DHE via BIO pair" $ 'ssltest' -bio_pair -no_dhe $ if $severity .ne. 1 then goto exit3 $ endif $ $ write sys$output "test sslv2/sslv3 with 1024 bit DHE via BIO pair" $ 'ssltest' -bio_pair -dhe1024dsa -v $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2/sslv3 with server authentication" $ 'ssltest' -bio_pair -server_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2/sslv3 with client authentication via BIO pair" $ 'ssltest' -bio_pair -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $ write sys$output "test sslv2/sslv3 with both client and server authentication via BIO pair" $ 'ssltest' -bio_pair -server_auth -client_auth 'CA' $ if $severity .ne. 1 then goto exit3 $ $!########################################################################### $ $ define/user sys$output nla0: $ mcr 'exe_dir'openssl no-rsa $ no_rsa=$SEVERITY $ define/user sys$output nla0: $ mcr 'exe_dir'openssl no-dh $ no_dh=$SEVERITY $ $ if no_dh $ then $ write sys$output "skipping anonymous DH tests" $ else $ write sys$output "test tls1 with 1024bit anonymous DH, multiple handshakes" $ 'ssltest' -v -bio_pair -tls1 -cipher "ADH" -dhe1024dsa -num 10 -f -time $ if $severity .ne. 1 then goto exit3 $ endif $ $ if no_rsa $ then $ write sys$output "skipping RSA tests" $ else $ write sys$output "test tls1 with 1024bit RSA, no DHE, multiple handshakes" $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -no_dhe -num 10 -f -time $ if $severity .ne. 1 then goto exit3 $ $ if no_dh $ then $ write sys$output "skipping RSA+DHE tests" $ else $ write sys$output "test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes" $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -dhe1024dsa -num 10 -f -time $ if $severity .ne. 1 then goto exit3 $ endif $ endif $ $ RET = 1 $ goto exit $ exit3: $ RET = 3 $ exit: $ if p3 .eqs. "" then delete certs.tmp;* $ set on $ exit 'RET'
{ "pile_set_name": "Github" }
<?php // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Libraries; use App\Traits\Imageable; class ProfileCover { use Imageable; public $data; public $userId; private $availableIds = ['1', '2', '3', '4', '5', '6', '7', '8']; public function __construct($userId, $data) { $this->data = $data; $this->userId = $userId; } public function getMaxDimensions() { return [2400, 640]; } public function getFileRoot() { return 'user-profile-covers'; } public function getFileId() { return $this->userId; } public function getFileProperties() { return array_get($this->data, 'file'); } public function setFileProperties($props) { if ($this->data === null) { $this->data = []; } $this->data['file'] = $props; } public function hasCustomCover() { return !isset($this->data['id']) && isset($this->data['file']); } public function id() { if ($this->hasCustomCover()) { return; } if ($this->userId === null || $this->userId < 1) { return; } if (!in_array($this->data['id'] ?? null, $this->availableIds, true)) { return $this->availableIds[$this->userId % count($this->availableIds)]; } return $this->data['id']; } public function set($id, $file) { if ($id !== null && in_array($id, $this->availableIds, true)) { $this->data['id'] = $id; } else { $this->data['id'] = null; } if ($file !== null) { $this->storeFile($file->getRealPath()); } return array_only($this->data, ['id', 'file']); } public function url() { if ($this->hasCustomCover()) { return $this->fileUrl(); } $id = $this->id(); if ($id !== null) { return config('app.url').'/images/headers/profile-covers/c'.$id.'.jpg'; } } }
{ "pile_set_name": "Github" }
/* Copyright (C) 1995-1998 Eric Young ([email protected]) * All rights reserved. * * This package is an SSL implementation written * by Eric Young ([email protected]). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson ([email protected]). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young ([email protected])" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson ([email protected])" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #ifndef OPENSSL_HEADER_DH_H #define OPENSSL_HEADER_DH_H #include <openssl/base.h> #include <openssl/engine.h> #include <openssl/ex_data.h> #include <openssl/thread.h> #if defined(__cplusplus) extern "C" { #endif /* DH contains functions for performing Diffie-Hellman key agreement in * multiplicative groups. */ /* Allocation and destruction. */ /* DH_new returns a new, empty DH object or NULL on error. */ OPENSSL_EXPORT DH *DH_new(void); /* DH_free decrements the reference count of |dh| and frees it if the reference * count drops to zero. */ OPENSSL_EXPORT void DH_free(DH *dh); /* DH_up_ref increments the reference count of |dh| and returns one. */ OPENSSL_EXPORT int DH_up_ref(DH *dh); /* Properties. */ /* DH_get0_key sets |*out_pub_key| and |*out_priv_key|, if non-NULL, to |dh|'s * public and private key, respectively. If |dh| is a public key, the private * key will be set to NULL. */ OPENSSL_EXPORT void DH_get0_key(const DH *dh, const BIGNUM **out_pub_key, const BIGNUM **out_priv_key); /* DH_get0_pqg sets |*out_p|, |*out_q|, and |*out_g|, if non-NULL, to |dh|'s p, * q, and g parameters, respectively. */ OPENSSL_EXPORT void DH_get0_pqg(const DH *dh, const BIGNUM **out_p, const BIGNUM **out_q, const BIGNUM **out_g); /* Standard parameters. * * These functions return new DH objects with standard parameters. They return * NULL on allocation failure. The |engine| parameter is ignored. */ /* These parameters are taken from RFC 5114. */ OPENSSL_EXPORT DH *DH_get_1024_160(const ENGINE *engine); OPENSSL_EXPORT DH *DH_get_2048_224(const ENGINE *engine); OPENSSL_EXPORT DH *DH_get_2048_256(const ENGINE *engine); /* BN_get_rfc3526_prime_1536 sets |*ret| to the 1536-bit MODP group from RFC * 3526 and returns |ret|. If |ret| is NULL then a fresh |BIGNUM| is allocated * and returned. It returns NULL on allocation failure. */ OPENSSL_EXPORT BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *ret); /* Parameter generation. */ #define DH_GENERATOR_2 2 #define DH_GENERATOR_5 5 /* DH_generate_parameters_ex generates a suitable Diffie-Hellman group with a * prime that is |prime_bits| long and stores it in |dh|. The generator of the * group will be |generator|, which should be |DH_GENERATOR_2| unless there's a * good reason to use a different value. The |cb| argument contains a callback * function that will be called during the generation. See the documentation in * |bn.h| about this. In addition to the callback invocations from |BN|, |cb| * will also be called with |event| equal to three when the generation is * complete. */ OPENSSL_EXPORT int DH_generate_parameters_ex(DH *dh, int prime_bits, int generator, BN_GENCB *cb); /* Diffie-Hellman operations. */ /* DH_generate_key generates a new, random, private key and stores it in * |dh|. It returns one on success and zero on error. */ OPENSSL_EXPORT int DH_generate_key(DH *dh); /* DH_compute_key calculates the shared key between |dh| and |peers_key| and * writes it as a big-endian integer into |out|, which must have |DH_size| * bytes of space. It returns the number of bytes written, or a negative number * on error. */ OPENSSL_EXPORT int DH_compute_key(uint8_t *out, const BIGNUM *peers_key, DH *dh); /* Utility functions. */ /* DH_size returns the number of bytes in the DH group's prime. */ OPENSSL_EXPORT int DH_size(const DH *dh); /* DH_num_bits returns the minimum number of bits needed to represent the * absolute value of the DH group's prime. */ OPENSSL_EXPORT unsigned DH_num_bits(const DH *dh); #define DH_CHECK_P_NOT_PRIME 0x01 #define DH_CHECK_P_NOT_SAFE_PRIME 0x02 #define DH_CHECK_UNABLE_TO_CHECK_GENERATOR 0x04 #define DH_CHECK_NOT_SUITABLE_GENERATOR 0x08 #define DH_CHECK_Q_NOT_PRIME 0x10 #define DH_CHECK_INVALID_Q_VALUE 0x20 #define DH_CHECK_INVALID_J_VALUE 0x40 /* These are compatibility defines. */ #define DH_NOT_SUITABLE_GENERATOR DH_CHECK_NOT_SUITABLE_GENERATOR #define DH_UNABLE_TO_CHECK_GENERATOR DH_CHECK_UNABLE_TO_CHECK_GENERATOR /* DH_check checks the suitability of |dh| as a Diffie-Hellman group. and sets * |DH_CHECK_*| flags in |*out_flags| if it finds any errors. It returns one if * |*out_flags| was successfully set and zero on error. * * Note: these checks may be quite computationally expensive. */ OPENSSL_EXPORT int DH_check(const DH *dh, int *out_flags); #define DH_CHECK_PUBKEY_TOO_SMALL 0x1 #define DH_CHECK_PUBKEY_TOO_LARGE 0x2 #define DH_CHECK_PUBKEY_INVALID 0x4 /* DH_check_pub_key checks the suitability of |pub_key| as a public key for the * DH group in |dh| and sets |DH_CHECK_PUBKEY_*| flags in |*out_flags| if it * finds any errors. It returns one if |*out_flags| was successfully set and * zero on error. */ OPENSSL_EXPORT int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *out_flags); /* DHparams_dup allocates a fresh |DH| and copies the parameters from |dh| into * it. It returns the new |DH| or NULL on error. */ OPENSSL_EXPORT DH *DHparams_dup(const DH *dh); /* ASN.1 functions. */ /* DH_parse_parameters decodes a DER-encoded DHParameter structure (PKCS #3) * from |cbs| and advances |cbs|. It returns a newly-allocated |DH| or NULL on * error. */ OPENSSL_EXPORT DH *DH_parse_parameters(CBS *cbs); /* DH_marshal_parameters marshals |dh| as a DER-encoded DHParameter structure * (PKCS #3) and appends the result to |cbb|. It returns one on success and zero * on error. */ OPENSSL_EXPORT int DH_marshal_parameters(CBB *cbb, const DH *dh); /* ex_data functions. * * See |ex_data.h| for details. */ OPENSSL_EXPORT int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); OPENSSL_EXPORT int DH_set_ex_data(DH *d, int idx, void *arg); OPENSSL_EXPORT void *DH_get_ex_data(DH *d, int idx); /* Deprecated functions. */ /* DH_generate_parameters behaves like |DH_generate_parameters_ex|, which is * what you should use instead. It returns NULL on error, or a newly-allocated * |DH| on success. This function is provided for compatibility only. */ OPENSSL_EXPORT DH *DH_generate_parameters(int prime_len, int generator, void (*callback)(int, int, void *), void *cb_arg); /* d2i_DHparams parses an ASN.1, DER encoded Diffie-Hellman parameters structure * from |len| bytes at |*inp|. If |ret| is not NULL then, on exit, a pointer to * the result is in |*ret|. Note that, even if |*ret| is already non-NULL on * entry, it will not be written to. Rather, a fresh |DH| is allocated and the * previous one is freed. * * On successful exit, |*inp| is advanced past the DER structure. It * returns the result or NULL on error. * * Use |DH_parse_parameters| instead. */ OPENSSL_EXPORT DH *d2i_DHparams(DH **ret, const unsigned char **inp, long len); /* i2d_DHparams marshals |in| to an ASN.1, DER structure. If |outp| is not NULL * then the result is written to |*outp| and |*outp| is advanced just past the * output. It returns the number of bytes in the result, whether written or * not, or a negative value on error. * * Use |DH_marshal_parameters| instead. */ OPENSSL_EXPORT int i2d_DHparams(const DH *in, unsigned char **outp); struct dh_st { BIGNUM *p; BIGNUM *g; BIGNUM *pub_key; /* g^x mod p */ BIGNUM *priv_key; /* x */ /* priv_length contains the length, in bits, of the private value. If zero, * the private value will be the same length as |p|. */ unsigned priv_length; CRYPTO_MUTEX method_mont_p_lock; BN_MONT_CTX *method_mont_p; /* Place holders if we want to do X9.42 DH */ BIGNUM *q; BIGNUM *j; unsigned char *seed; int seedlen; BIGNUM *counter; int flags; CRYPTO_refcount_t references; CRYPTO_EX_DATA ex_data; }; #if defined(__cplusplus) } /* extern C */ extern "C++" { namespace bssl { BORINGSSL_MAKE_DELETER(DH, DH_free) } // namespace bssl } /* extern C++ */ #endif #define DH_R_BAD_GENERATOR 100 #define DH_R_INVALID_PUBKEY 101 #define DH_R_MODULUS_TOO_LARGE 102 #define DH_R_NO_PRIVATE_VALUE 103 #define DH_R_DECODE_ERROR 104 #define DH_R_ENCODE_ERROR 105 #endif /* OPENSSL_HEADER_DH_H */
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2009 The Android Open Source Project 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. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/reslogo120dpi" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/reslogo160dpi" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/reslogo240dpi" /> </LinearLayout>
{ "pile_set_name": "Github" }
import {Component, ElementRef, Input, OnInit, ViewChild} from "@angular/core"; import {Monitor, Rect} from "../lib/rat_lite"; @Component({selector : 'monitor-canvas', templateUrl : './monitorcanvas.component.html'}) export class MonitorsCanvasComponent implements OnInit { @ViewChild('thiscanvas') ThisCanvas: ElementRef; @Input() Monitor: Monitor; ngOnInit(): void { if (this.ThisCanvas && this.ThisCanvas.nativeElement ) { this.ThisCanvas.nativeElement.width = this.getScalingFactor()*this.Monitor.Width; this.ThisCanvas.nativeElement.height =this.getScalingFactor()* this.Monitor.Height; } } public getScalingFactor(): number{ return (1 / this.Monitor.Scaling); } public onFrameChanged(image: HTMLImageElement, monitor: Monitor, rect: Rect): void { if (this.Monitor && this.ThisCanvas && this.ThisCanvas.nativeElement && this.Monitor.Id == monitor.Id) { this.ThisCanvas.nativeElement.getContext("2d").drawImage(image,this.getScalingFactor()* rect.Origin.X, this.getScalingFactor()*rect.Origin.Y, this.getScalingFactor()*image.width, this.getScalingFactor()*image.height); } } public onNewFrame(image: HTMLImageElement, monitor: Monitor, rect: Rect): void { if (this.Monitor && this.ThisCanvas && this.ThisCanvas.nativeElement && this.Monitor.Id == monitor.Id) { this.ThisCanvas.nativeElement.getContext("2d").drawImage(image, 0, 0, this.getScalingFactor()*image.width, this.getScalingFactor()*image.height); } } }
{ "pile_set_name": "Github" }
{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# Copyright 2014 Brett Slatkin, Pearson Education Inc.\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", "# You may obtain a copy of the License at\n", "#\n", "# http://www.apache.org/licenses/LICENSE-2.0\n", "#\n", "# Unless required by applicable law or agreed to in writing, software\n", "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", "# See the License for the specific language governing permissions and\n", "# limitations under the License.\n", "\n", "# Preamble to mimick book environment\n", "import logging\n", "from pprint import pprint\n", "from sys import stdout as STDOUT" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### returning None is error prone!" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Example 1\n", "def divide(a, b):\n", " try:\n", " return a / b\n", " except ZeroDivisionError:\n", " return None\n", "\n", "assert divide(4, 2) == 2\n", "assert divide(0, 1) == 0\n", "assert divide(3, 6) == 0.5\n", "assert divide(1, 0) == None" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Invalid inputs\n" ] } ], "source": [ "# Example 2\n", "x, y = 1, 0\n", "result = divide(x, y)\n", "if result is None:\n", " print('Invalid inputs')\n", "else:\n", " print('Result is %.1f' % result)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### This is WRONG!!" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Invalid inputs\n" ] } ], "source": [ "# Example 3\n", "x, y = 0, 5\n", "result = divide(x, y)\n", "if not result:\n", " print('Invalid inputs') # This is wrong!\n", "else:\n", " assert False" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(True, 0.0)\n" ] } ], "source": [ "# Example 4\n", "def divide(a, b):\n", " try:\n", " return True, a / b\n", " except ZeroDivisionError:\n", " return False, None\n", "print(divide(0, 5))" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Invalid inputs\n" ] } ], "source": [ "# Example 5\n", "x, y = 5, 0\n", "success, result = divide(x, y)\n", "if not success:\n", " print('Invalid inputs')" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Invalid inputs\n", "Invalid inputs\n" ] } ], "source": [ "# Example 6\n", "x, y = 5, 0\n", "_, result = divide(x, y)\n", "if not result:\n", " print('Invalid inputs') # This is right\n", "\n", "x, y = 0, 5\n", "_, result = divide(x, y)\n", "if not result:\n", " print('Invalid inputs') # This is wrong" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Example 7\n", "def divide(a, b):\n", " try:\n", " return a / b\n", " except ZeroDivisionError as e:\n", " raise ValueError('Invalid inputs') from e" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Result is 2.5\n" ] } ], "source": [ "# Example 8\n", "x, y = 5, 2\n", "try:\n", " result = divide(x, y)\n", "except ValueError:\n", " print('Invalid inputs')\n", "else:\n", " print('Result is %.1f' % result)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.1" } }, "nbformat": 4, "nbformat_minor": 0 }
{ "pile_set_name": "Github" }
<vector android:height="@dimen/iconHeight" android:viewportHeight="40.0" android:viewportWidth="60.0" android:width="@dimen/iconWidth" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="#E30A17" android:pathData="M0,0h60v40H0z"/> <path android:fillColor="#FFF" android:pathData="M29.7,25.3c-1.8,2.8 -4.9,4.7 -8.5,4.7 -5.5,0 -10,-4.5 -10,-10s4.5,-10 10,-10c3.6,0 6.7,1.9 8.5,4.7 -1.5,-1.6 -3.6,-2.7 -6,-2.7 -4.4,0 -8,3.6 -8,8s3.6,8 8,8c2.4,0 4.5,-1 6,-2.7zM36.1,20l2.1,-2.9 -3.5,1.1 -2.1,-2.9v3.6L29.2,20l3.5,1.1v3.6l2.1,-2.9 3.5,1.1 -2.2,-2.9z"/> </vector>
{ "pile_set_name": "Github" }
/****************************************************************************** * * Copyright(c) 2007 - 2017 Realtek Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License 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 General Public License for * more details. * * The full GNU General Public License is included in this distribution in the * file called LICENSE. * * Contact Information: * wlanfae <[email protected]> * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, * Hsinchu 300, Taiwan. * * Larry Finger <[email protected]> * *****************************************************************************/ #include "mp_precomp.h" #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) #if RT_PLATFORM == PLATFORM_MACOSX #include "phydm_precomp.h" #else #include "../phydm_precomp.h" #endif #else #include "../../phydm_precomp.h" #endif #if (RTL8822B_SUPPORT == 1) /*@---------------------------Define Local Constant---------------------------*/ void phydm_get_read_counter_8822b(struct dm_struct *dm) { u32 counter = 0x0, rf_reg; while (1) { rf_reg = odm_get_rf_reg(dm, RF_PATH_A, RF_0x8, MASK20BITS); if (rf_reg == 0xabcde || counter > 300) break; counter++; ODM_delay_ms(1); } odm_set_rf_reg(dm, RF_PATH_A, RF_0x8, MASK20BITS, 0x0); RF_DBG(dm, DBG_RF_IQK, "[IQK]counter = %d\n", counter); } /*@---------------------------Define Local Constant---------------------------*/ #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) void do_iqk_8822b(void *dm_void, u8 delta_thermal_index, u8 thermal_value, u8 threshold) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_iqk_info *iqk = &dm->IQK_info; dm->rf_calibrate_info.thermal_value_iqk = thermal_value; halrf_segment_iqk_trigger(dm, true, iqk->segment_iqk); } #else /*Originally config->do_iqk is hooked phy_iq_calibrate_8822b*/ /*But do_iqk_8822b and phy_iq_calibrate_8822b have different arguments*/ void do_iqk_8822b(void *dm_void, u8 delta_thermal_index, u8 thermal_value, u8 threshold) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_iqk_info *iqk = &dm->IQK_info; boolean is_recovery = (boolean)delta_thermal_index; halrf_segment_iqk_trigger(dm, true, iqk->segment_iqk); } #endif void _iqk_rf_set_check_8822b(struct dm_struct *dm, u8 path, u16 add, u32 data) { u32 i; odm_set_rf_reg(dm, (enum rf_path)path, add, MASK20BITS, data); for (i = 0; i < 100; i++) { if (odm_get_rf_reg(dm, (enum rf_path)path, add, MASK20BITS) == data) break; ODM_delay_us(10); odm_set_rf_reg(dm, (enum rf_path)path, add, MASK20BITS, data); } } void _iqk_rf0xb0_workaround_8822b(struct dm_struct *dm) { /*add 0xb8 control for the bad phase noise after switching channel*/ odm_set_rf_reg(dm, (enum rf_path)0x0, RF_0xb8, MASK20BITS, 0x00a00); odm_set_rf_reg(dm, (enum rf_path)0x0, RF_0xb8, MASK20BITS, 0x80a00); } void _iqk_fill_iqk_report_8822b(void *dm_void, u8 ch) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_iqk_info *iqk = &dm->IQK_info; u32 tmp1 = 0x0, tmp2 = 0x0, tmp3 = 0x0, data; u8 i; for (i = 0; i < SS_8822B; i++) { tmp1 += ((iqk->iqk_fail_report[ch][i][TX_IQK] & 1) << i); tmp2 += ((iqk->iqk_fail_report[ch][i][RX_IQK] & 1) << (i + 4)); tmp3 += ((iqk->rxiqk_fail_code[ch][i] & 0x3) << (i * 2 + 8)); } odm_write_4byte(dm, 0x1b00, 0xf8000008); odm_set_bb_reg(dm, R_0x1bf0, 0x0000ffff, tmp1 | tmp2 | tmp3); for (i = 0; i < 2; i++) { data = ((iqk->rxiqk_agc[ch][(i * 2) + 1] << 16) | iqk->rxiqk_agc[ch][i * 2]); odm_write_4byte(dm, 0x1be8 + (i * 4), data); } } void _iqk_fail_count_8822b(void *dm_void) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_iqk_info *iqk = &dm->IQK_info; u8 i; dm->n_iqk_cnt++; if (odm_get_rf_reg(dm, RF_PATH_A, RF_0x1bf0, BIT(16)) == 1) iqk->is_reload = true; else iqk->is_reload = false; if (!iqk->is_reload) { for (i = 0; i < 8; i++) { if (odm_get_bb_reg(dm, R_0x1bf0, BIT(i)) == 1) dm->n_iqk_fail_cnt++; } } RF_DBG(dm, DBG_RF_IQK, "[IQK]All/Fail = %d %d\n", dm->n_iqk_cnt, dm->n_iqk_fail_cnt); } void _iqk_iqk_fail_report_8822b(struct dm_struct *dm) { u32 tmp1bf0 = 0x0; u8 i; tmp1bf0 = odm_read_4byte(dm, 0x1bf0); for (i = 0; i < 4; i++) { if (tmp1bf0 & (0x1 << i)) #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) RF_DBG(dm, DBG_RF_IQK, "[IQK] please check S%d TXIQK\n", i); #else panic_printk("[IQK] please check S%d TXIQK\n", i); #endif if (tmp1bf0 & (0x1 << (i + 12))) #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) RF_DBG(dm, DBG_RF_IQK, "[IQK] please check S%d RXIQK\n", i); #else panic_printk("[IQK] please check S%d RXIQK\n", i); #endif } } void _iqk_backup_mac_bb_8822b(struct dm_struct *dm, u32 *MAC_backup, u32 *BB_backup, u32 *backup_mac_reg, u32 *backup_bb_reg) { u32 i; for (i = 0; i < MAC_REG_NUM_8822B; i++) MAC_backup[i] = odm_read_4byte(dm, backup_mac_reg[i]); for (i = 0; i < BB_REG_NUM_8822B; i++) BB_backup[i] = odm_read_4byte(dm, backup_bb_reg[i]); #if 0 /* RF_DBG(dm, DBG_RF_IQK, "[IQK]BackupMacBB Success!!!!\n"); */ #endif } void _iqk_backup_rf_8822b(struct dm_struct *dm, u32 RF_backup[][2], u32 *bkup_reg) { u32 i; for (i = 0; i < RF_REG_NUM_8822B; i++) { RF_backup[i][RF_PATH_A] = odm_get_rf_reg(dm, RF_PATH_A, bkup_reg[i], MASK20BITS); RF_backup[i][RF_PATH_B] = odm_get_rf_reg(dm, RF_PATH_B, bkup_reg[i], MASK20BITS); } #if 0 /* RF_DBG(dm, DBG_RF_IQK, "[IQK]BackupRF Success!!!!\n"); */ #endif } void _iqk_agc_bnd_int_8822b(struct dm_struct *dm) { /*initialize RX AGC bnd, it must do after bbreset*/ odm_write_4byte(dm, 0x1b00, 0xf8000008); odm_write_4byte(dm, 0x1b00, 0xf80a7008); odm_write_4byte(dm, 0x1b00, 0xf8015008); odm_write_4byte(dm, 0x1b00, 0xf8000008); #if 0 /*RF_DBG(dm, DBG_RF_IQK, "[IQK]init. rx agc bnd\n");*/ #endif } void _iqk_bb_reset_8822b(struct dm_struct *dm) { boolean cca_ing = false; u32 count = 0; u32 bit_mask = (BIT(27) | BIT(26) | BIT(25) | BIT(24)); odm_set_rf_reg(dm, RF_PATH_A, RF_0x0, MASK20BITS, 0x10000); odm_set_rf_reg(dm, RF_PATH_B, RF_0x0, MASK20BITS, 0x10000); /*reset BB report*/ odm_set_bb_reg(dm, R_0x8f8, 0x0ff00000, 0x0); while (1) { odm_write_4byte(dm, 0x8fc, 0x0); odm_set_bb_reg(dm, R_0x198c, 0x7, 0x7); cca_ing = (boolean)odm_get_bb_reg(dm, R_0xfa0, BIT(3)); if (count > 30) cca_ing = false; if (cca_ing) { ODM_delay_ms(1); count++; } else { /*RX ant off*/ odm_write_1byte(dm, 0x808, 0x0); /*CCK RX path off*/ odm_set_bb_reg(dm, R_0xa04, bit_mask, 0x0); /*BBreset*/ odm_set_bb_reg(dm, R_0x0, BIT(16), 0x0); odm_set_bb_reg(dm, R_0x0, BIT(16), 0x1); if (odm_get_bb_reg(dm, R_0x660, BIT(16))) odm_write_4byte(dm, 0x6b4, 0x89000006); #if 0 /*RF_DBG(dm, DBG_RF_IQK, "[IQK]BBreset!!!!\n");*/ #endif break; } } } void _iqk_afe_setting_8822b(struct dm_struct *dm, boolean do_iqk) { if (do_iqk) { odm_write_4byte(dm, 0xc60, 0x50000000); odm_write_4byte(dm, 0xc60, 0x70070040); odm_write_4byte(dm, 0xe60, 0x50000000); odm_write_4byte(dm, 0xe60, 0x70070040); odm_write_4byte(dm, 0xc58, 0xd8000402); odm_write_4byte(dm, 0xc5c, 0xd1000120); odm_write_4byte(dm, 0xc6c, 0x00000a15); odm_write_4byte(dm, 0xe58, 0xd8000402); odm_write_4byte(dm, 0xe5c, 0xd1000120); odm_write_4byte(dm, 0xe6c, 0x00000a15); _iqk_bb_reset_8822b(dm); #if 0 /* RF_DBG(dm, DBG_RF_IQK, "[IQK]AFE setting for IQK mode!!!!\n"); */ #endif } else { odm_write_4byte(dm, 0xc60, 0x50000000); odm_write_4byte(dm, 0xc60, 0x70038040); odm_write_4byte(dm, 0xe60, 0x50000000); odm_write_4byte(dm, 0xe60, 0x70038040); odm_write_4byte(dm, 0xc58, 0xd8020402); odm_write_4byte(dm, 0xc5c, 0xde000120); odm_write_4byte(dm, 0xc6c, 0x0000122a); odm_write_4byte(dm, 0xe58, 0xd8020402); odm_write_4byte(dm, 0xe5c, 0xde000120); odm_write_4byte(dm, 0xe6c, 0x0000122a); #if 0 /* RF_DBG(dm, DBG_RF_IQK, "[IQK]AFE setting for Normal mode!!!!\n"); */ #endif } /*0x9a4[31]=0: Select da clock*/ odm_set_bb_reg(dm, R_0x9a4, BIT(31), 0x0); } void _iqk_restore_mac_bb_8822b(struct dm_struct *dm, u32 *MAC_backup, u32 *BB_backup, u32 *backup_mac_reg, u32 *backup_bb_reg) { u32 i; for (i = 0; i < MAC_REG_NUM_8822B; i++) odm_write_4byte(dm, backup_mac_reg[i], MAC_backup[i]); for (i = 0; i < BB_REG_NUM_8822B; i++) odm_write_4byte(dm, backup_bb_reg[i], BB_backup[i]); #if 0 /* RF_DBG(dm, DBG_RF_IQK, "[IQK]RestoreMacBB Success!!!!\n"); */ #endif } void _iqk_restore_rf_8822b(struct dm_struct *dm, u32 *backup_rf_reg, u32 RF_backup[][2]) { u32 i; odm_set_rf_reg(dm, RF_PATH_A, RF_0xef, MASK20BITS, 0x0); odm_set_rf_reg(dm, RF_PATH_B, RF_0xef, MASK20BITS, 0x0); /*0xdf[4]=0*/ _iqk_rf_set_check_8822b(dm, RF_PATH_A, 0xdf, RF_backup[0][RF_PATH_A] & (~BIT(4))); _iqk_rf_set_check_8822b(dm, RF_PATH_B, 0xdf, RF_backup[0][RF_PATH_B] & (~BIT(4))); #if 0 /*odm_set_rf_reg(dm, RF_PATH_A, RF_0xdf, MASK20BITS, RF_backup[0][RF_PATH_A] & (~BIT(4)));*/ /*odm_set_rf_reg(dm, RF_PATH_B, RF_0xdf, MASK20BITS, RF_backup[0][RF_PATH_B] & (~BIT(4)));*/ #endif for (i = 1; i < RF_REG_NUM_8822B; i++) { odm_set_rf_reg(dm, RF_PATH_A, backup_rf_reg[i], MASK20BITS, RF_backup[i][RF_PATH_A]); odm_set_rf_reg(dm, RF_PATH_B, backup_rf_reg[i], MASK20BITS, RF_backup[i][RF_PATH_B]); } #if 0 /* RF_DBG(dm, DBG_RF_IQK, "[IQK]RestoreRF Success!!!!\n"); */ #endif } void _iqk_backup_iqk_8822b_subfunction(struct dm_struct *dm) { struct dm_iqk_info *iqk = &dm->IQK_info; u8 i, j, k; iqk->iqk_channel[1] = iqk->iqk_channel[0]; for (i = 0; i < 2; i++) { iqk->lok_idac[1][i] = iqk->lok_idac[0][i]; iqk->rxiqk_agc[1][i] = iqk->rxiqk_agc[0][i]; iqk->bypass_iqk[1][i] = iqk->bypass_iqk[0][i]; iqk->rxiqk_fail_code[1][i] = iqk->rxiqk_fail_code[0][i]; for (j = 0; j < 2; j++) { iqk->iqk_fail_report[1][i][j] = iqk->iqk_fail_report[0][i][j]; for (k = 0; k < 8; k++) { iqk->iqk_cfir_real[1][i][j][k] = iqk->iqk_cfir_real[0][i][j][k]; iqk->iqk_cfir_imag[1][i][j][k] = iqk->iqk_cfir_imag[0][i][j][k]; } } } } void _iqk_backup_iqk_8822b(struct dm_struct *dm, u8 step, u8 path) { struct dm_iqk_info *iqk = &dm->IQK_info; u8 i, j; switch (step) { case 0: _iqk_backup_iqk_8822b_subfunction(dm); for (i = 0; i < 4; i++) { iqk->rxiqk_fail_code[0][i] = 0x0; iqk->rxiqk_agc[0][i] = 0x0; for (j = 0; j < 2; j++) { iqk->iqk_fail_report[0][i][j] = true; iqk->gs_retry_count[0][i][j] = 0x0; } for (j = 0; j < 3; j++) iqk->retry_count[0][i][j] = 0x0; } /*backup channel*/ iqk->iqk_channel[0] = iqk->rf_reg18; break; case 1: /*LOK backup*/ iqk->lok_idac[0][path] = odm_get_rf_reg(dm, (enum rf_path)path, RF_0x58, MASK20BITS); break; case 2: /*TXIQK backup*/ case 3: /*RXIQK backup*/ phydm_get_iqk_cfir(dm, (step - 2), path, false); break; } } void _iqk_reload_iqk_setting_8822b(struct dm_struct *dm, u8 ch, u8 reload_idx /*1: reload TX, 2: reload LO, TX, RX*/) { struct dm_iqk_info *iqk = &dm->IQK_info; u8 i, path, idx; u16 iqk_apply[2] = {0xc94, 0xe94}; u32 tmp, data; u32 bmask13_12 = (BIT(13) | BIT(12)); u32 bmask20_16 = (BIT(20) | BIT(19) | BIT(18) | BIT(17) | BIT(16)); boolean report; for (path = 0; path < 2; path++) { if (reload_idx == 2) { #if 0 /*odm_set_rf_reg(dm, (enum rf_path)path, RF_0xdf, BIT(4), 0x1);*/ #endif tmp = odm_get_rf_reg(dm, (enum rf_path)path, RF_0xdf, MASK20BITS) | BIT(4); _iqk_rf_set_check_8822b(dm, (enum rf_path)path, 0xdf, tmp); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x58, MASK20BITS, iqk->lok_idac[ch][path]); } for (idx = 0; idx < reload_idx; idx++) { odm_set_bb_reg(dm, R_0x1b00, MASKDWORD, 0xf8000008 | path << 1); odm_set_bb_reg(dm, R_0x1b2c, MASKDWORD, 0x7); odm_set_bb_reg(dm, R_0x1b38, MASKDWORD, 0x20000000); odm_set_bb_reg(dm, R_0x1b3c, MASKDWORD, 0x20000000); odm_set_bb_reg(dm, R_0x1bcc, MASKDWORD, 0x00000000); if (idx == 0) odm_set_bb_reg(dm, R_0x1b0c, bmask13_12, 0x3); else odm_set_bb_reg(dm, R_0x1b0c, bmask13_12, 0x1); odm_set_bb_reg(dm, R_0x1bd4, bmask20_16, 0x10); for (i = 0; i < 8; i++) { data = ((0xc0000000 >> idx) + 0x3) + (i * 4) + (iqk->iqk_cfir_real[ch][path][idx][i] << 9); odm_write_4byte(dm, 0x1bd8, data); data = ((0xc0000000 >> idx) + 0x1) + (i * 4) + (iqk->iqk_cfir_imag[ch][path][idx][i] << 9); odm_write_4byte(dm, 0x1bd8, data); } if (idx == 0) { report = !(iqk->iqk_fail_report[ch][path][idx]); odm_set_bb_reg(dm, iqk_apply[path], BIT(0), report); } else { report = !(iqk->iqk_fail_report[ch][path][idx]); odm_set_bb_reg(dm, iqk_apply[path], BIT(10), report); } } odm_set_bb_reg(dm, R_0x1bd8, MASKDWORD, 0x0); odm_set_bb_reg(dm, R_0x1b0c, bmask13_12, 0x0); } } boolean _iqk_reload_iqk_8822b(struct dm_struct *dm, boolean reset) { struct dm_iqk_info *iqk = &dm->IQK_info; u8 i; iqk->is_reload = false; if (reset) { for (i = 0; i < 2; i++) iqk->iqk_channel[i] = 0x0; } else { iqk->rf_reg18 = odm_get_rf_reg(dm, RF_PATH_A, RF_0x18, MASK20BITS); for (i = 0; i < 2; i++) { if (iqk->rf_reg18 == iqk->iqk_channel[i]) { _iqk_reload_iqk_setting_8822b(dm, i, 2); _iqk_fill_iqk_report_8822b(dm, i); RF_DBG(dm, DBG_RF_IQK, "[IQK]reload IQK result before!!!!\n"); iqk->is_reload = true; } } } /*report*/ odm_set_bb_reg(dm, R_0x1bf0, BIT(16), (u8)iqk->is_reload); return iqk->is_reload; } void _iqk_rfe_setting_8822b(struct dm_struct *dm, boolean ext_pa_on) { if (ext_pa_on) { /*RFE setting*/ odm_write_4byte(dm, 0xcb0, 0x77777777); odm_write_4byte(dm, 0xcb4, 0x00007777); odm_write_4byte(dm, 0xcbc, 0x0000083B); odm_write_4byte(dm, 0xeb0, 0x77777777); odm_write_4byte(dm, 0xeb4, 0x00007777); odm_write_4byte(dm, 0xebc, 0x0000083B); #if 0 /*odm_write_4byte(dm, 0x1990, 0x00000c30);*/ #endif RF_DBG(dm, DBG_RF_IQK, "[IQK]external PA on!!!!\n"); } else { /*RFE setting*/ odm_write_4byte(dm, 0xcb0, 0x77777777); odm_write_4byte(dm, 0xcb4, 0x00007777); odm_write_4byte(dm, 0xcbc, 0x00000100); odm_write_4byte(dm, 0xeb0, 0x77777777); odm_write_4byte(dm, 0xeb4, 0x00007777); odm_write_4byte(dm, 0xebc, 0x00000100); #if 0 /*odm_write_4byte(dm, 0x1990, 0x00000c30);*/ /*RF_DBG(dm, DBG_RF_IQK, "[IQK]external PA off!!!!\n");*/ #endif } } void _iqk_rf_setting_8822b(struct dm_struct *dm) { u8 path; u32 tmp; odm_write_4byte(dm, 0x1b00, 0xf8000008); odm_write_4byte(dm, 0x1bb8, 0x00000000); for (path = 0; path < 2; path++) { /*0xdf:B11 = 1,B4 = 0, B1 = 1*/ tmp = odm_get_rf_reg(dm, (enum rf_path)path, RF_0xdf, MASK20BITS); tmp = (tmp & (~BIT(4))) | BIT(1) | BIT(11); _iqk_rf_set_check_8822b(dm, (enum rf_path)path, 0xdf, tmp); #if 0 /*odm_set_rf_reg(dm, (enum rf_path)path, RF_0xdf, MASK20BITS, tmp);*/ #endif /*release 0x56 TXBB*/ odm_set_rf_reg(dm, (enum rf_path)path, RF_0x65, MASK20BITS, 0x09000); if (*dm->band_type == ODM_BAND_5G) { odm_set_rf_reg(dm, (enum rf_path)path, RF_0xef, BIT(19), 0x1); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x33, MASK20BITS, 0x00026); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x3e, MASK20BITS, 0x00037); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x3f, MASK20BITS, 0xdefce); odm_set_rf_reg(dm, (enum rf_path)path, RF_0xef, BIT(19), 0x0); } else { odm_set_rf_reg(dm, (enum rf_path)path, RF_0xef, BIT(19), 0x1); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x33, MASK20BITS, 0x00026); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x3e, MASK20BITS, 0x00037); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x3f, MASK20BITS, 0x5efce); odm_set_rf_reg(dm, (enum rf_path)path, RF_0xef, BIT(19), 0x0); } } } void _iqk_configure_macbb_8822b(struct dm_struct *dm) { /*MACBB register setting*/ odm_write_1byte(dm, 0x522, 0x7f); odm_set_bb_reg(dm, R_0x550, BIT(11) | BIT(3), 0x0); /*0x90c[15]=1: dac_buf reset selection*/ odm_set_bb_reg(dm, R_0x90c, BIT(15), 0x1); /*0xc94[0]=1, 0xe94[0]=1: Let tx from IQK*/ odm_set_bb_reg(dm, R_0xc94, BIT(0), 0x1); odm_set_bb_reg(dm, R_0xe94, BIT(0), 0x1); odm_set_bb_reg(dm, R_0xc94, (BIT(11) | BIT(10)), 0x1); odm_set_bb_reg(dm, R_0xe94, (BIT(11) | BIT(10)), 0x1); /* 3-wire off*/ odm_write_4byte(dm, 0xc00, 0x00000004); odm_write_4byte(dm, 0xe00, 0x00000004); /*disable PMAC*/ odm_set_bb_reg(dm, R_0xb00, BIT(8), 0x0); /*disable CCK block*/ odm_set_bb_reg(dm, R_0x808, BIT(28), 0x0); /*disable OFDM CCA*/ odm_set_bb_reg(dm, R_0x838, BIT(3) | BIT(2) | BIT(1), 0x7); #if 0 /*RF_DBG(dm, DBG_RF_IQK, "[IQK]Set MACBB setting for IQK!!!!\n");*/ #endif } void _iqk_lok_setting_8822b(struct dm_struct *dm, u8 path) { odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); odm_write_4byte(dm, 0x1bcc, 0x9); odm_write_1byte(dm, 0x1b23, 0x00); switch (*dm->band_type) { case ODM_BAND_2_4G: odm_write_1byte(dm, 0x1b2b, 0x00); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x56, MASK20BITS, 0x50df2); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x8f, MASK20BITS, 0xadc00); /* WE_LUT_TX_LOK*/ odm_set_rf_reg(dm, (enum rf_path)path, RF_0xef, BIT(4), 0x1); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x33, BIT(1) | BIT(0), 0x0); break; case ODM_BAND_5G: odm_write_1byte(dm, 0x1b2b, 0x80); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x56, MASK20BITS, 0x5086c); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x8f, MASK20BITS, 0xa9c00); /* WE_LUT_TX_LOK*/ odm_set_rf_reg(dm, (enum rf_path)path, RF_0xef, BIT(4), 0x1); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x33, BIT(1) | BIT(0), 0x1); break; } #if 0 /* RF_DBG(dm, DBG_RF_IQK, "[IQK]Set LOK setting!!!!\n");*/ #endif } void _iqk_txk_setting_8822b(struct dm_struct *dm, u8 path) { odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); odm_write_4byte(dm, 0x1bcc, 0x9); odm_write_4byte(dm, 0x1b20, 0x01440008); if (path == 0x0) odm_write_4byte(dm, 0x1b00, 0xf800000a); else odm_write_4byte(dm, 0x1b00, 0xf8000008); odm_write_4byte(dm, 0x1bcc, 0x3f); switch (*dm->band_type) { case ODM_BAND_2_4G: odm_set_rf_reg(dm, (enum rf_path)path, RF_0x56, MASK20BITS, 0x50df2); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x8f, MASK20BITS, 0xadc00); odm_write_1byte(dm, 0x1b2b, 0x00); break; case ODM_BAND_5G: odm_set_rf_reg(dm, (enum rf_path)path, RF_0x56, MASK20BITS, 0x500ef); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x8f, MASK20BITS, 0xa9c00); odm_write_1byte(dm, 0x1b2b, 0x80); break; } #if 0 /*RF_DBG(dm, DBG_RF_IQK, "[IQK]Set TXK setting!!!!\n");*/ #endif } void _iqk_rxk1_setting_8822b(struct dm_struct *dm, u8 path) { odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); switch (*dm->band_type) { case ODM_BAND_2_4G: odm_write_1byte(dm, 0x1bcc, 0x9); odm_write_1byte(dm, 0x1b2b, 0x00); odm_write_4byte(dm, 0x1b20, 0x01450008); odm_write_4byte(dm, 0x1b24, 0x01460c88); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x56, MASK20BITS, 0x510e0); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x8f, MASK20BITS, 0xacc00); break; case ODM_BAND_5G: odm_write_1byte(dm, 0x1bcc, 0x09); odm_write_1byte(dm, 0x1b2b, 0x80); odm_write_4byte(dm, 0x1b20, 0x00850008); odm_write_4byte(dm, 0x1b24, 0x00460048); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x56, MASK20BITS, 0x510e0); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x8f, MASK20BITS, 0xadc00); break; } #if 0 /*RF_DBG(dm, DBG_RF_IQK, "[IQK]Set RXK setting!!!!\n");*/ #endif } void _iqk_rxk2_setting_8822b(struct dm_struct *dm, u8 path, boolean is_gs) { struct dm_iqk_info *iqk = &dm->IQK_info; odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); switch (*dm->band_type) { case ODM_BAND_2_4G: if (is_gs) iqk->tmp1bcc = 0x12; odm_write_1byte(dm, 0x1bcc, iqk->tmp1bcc); odm_write_1byte(dm, 0x1b2b, 0x00); odm_write_4byte(dm, 0x1b20, 0x01450008); odm_write_4byte(dm, 0x1b24, 0x01460848); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x56, MASK20BITS, 0x510e0); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x8f, MASK20BITS, 0xa9c00); break; case ODM_BAND_5G: if (is_gs) { if (path == RF_PATH_A) iqk->tmp1bcc = 0x12; else iqk->tmp1bcc = 0x09; } odm_write_1byte(dm, 0x1bcc, iqk->tmp1bcc); odm_write_1byte(dm, 0x1b2b, 0x80); odm_write_4byte(dm, 0x1b20, 0x00850008); odm_write_4byte(dm, 0x1b24, 0x00460848); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x56, MASK20BITS, 0x51060); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x8f, MASK20BITS, 0xa9c00); break; } #if 0 /* RF_DBG(dm, DBG_RF_IQK, "[IQK]Set RXK setting!!!!\n");*/ #endif } void halrf_iqk_set_rf0x8(struct dm_struct *dm, u8 path) { u16 c = 0x0; while (c < 30000) { odm_set_rf_reg(dm, (enum rf_path)path, RF_0xef, MASK20BITS, 0x0); odm_set_rf_reg(dm, (enum rf_path)path, RF_0x8, MASK20BITS, 0x0); if (odm_get_rf_reg(dm, (enum rf_path)path, RF_0x8, MASK20BITS) == 0x0) break; c++; } } void halrf_iqk_check_if_reload(struct dm_struct *dm) { struct dm_iqk_info *iqk = &dm->IQK_info; iqk->is_reload = (boolean)odm_get_bb_reg(dm, R_0x1bf0, BIT(16)); } boolean _iqk_check_cal_8822b(struct dm_struct *dm, u8 path, u8 cmd) { boolean notready = true, fail = true; u32 delay_count = 0x0; while (notready) { if (odm_get_rf_reg(dm, (enum rf_path)path, RF_0x8, MASK20BITS) == 0x12345) { if (cmd == 0x0) /*LOK*/ fail = false; else fail = (boolean) odm_get_bb_reg(dm, R_0x1b08, BIT(26)); notready = false; } else { ODM_delay_ms(1); delay_count++; } if (delay_count >= 50) { fail = true; RF_DBG(dm, DBG_RF_IQK, "[IQK]IQK timeout!!!\n"); break; } } halrf_iqk_set_rf0x8(dm, path); RF_DBG(dm, DBG_RF_IQK, "[IQK]delay count = 0x%x!!!\n", delay_count); return fail; } boolean _iqk_rxk_gsearch_fail_8822b(struct dm_struct *dm, u8 path, u8 step) { struct dm_iqk_info *iqk = &dm->IQK_info; boolean fail = true; u32 IQK_CMD = 0x0, rf_reg0, tmp, bb_idx; u8 IQMUX[4] = {0x9, 0x12, 0x1b, 0x24}; u8 idx; if (step == RXIQK1) { RF_DBG(dm, DBG_RF_IQK, "[IQK]============ S%d RXIQK GainSearch ============\n", path); IQK_CMD = 0xf8000208 | (1 << (path + 4)); RF_DBG(dm, DBG_RF_IQK, "[IQK]S%d GS%d_Trigger = 0x%x\n", path, step, IQK_CMD); odm_write_4byte(dm, 0x1b00, IQK_CMD); odm_write_4byte(dm, 0x1b00, IQK_CMD + 0x1); ODM_delay_ms(GS_delay_8822B); fail = _iqk_check_cal_8822b(dm, path, 0x1); } else if (step == RXIQK2) { for (idx = 0; idx < 4; idx++) { if (iqk->tmp1bcc == IQMUX[idx]) break; } odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); odm_write_4byte(dm, 0x1bcc, iqk->tmp1bcc); IQK_CMD = 0xf8000308 | (1 << (path + 4)); RF_DBG(dm, DBG_RF_IQK, "[IQK]S%d GS%d_Trigger = 0x%x\n", path, step, IQK_CMD); odm_write_4byte(dm, 0x1b00, IQK_CMD); odm_write_4byte(dm, 0x1b00, IQK_CMD + 0x1); ODM_delay_ms(GS_delay_8822B); fail = _iqk_check_cal_8822b(dm, path, 0x1); rf_reg0 = odm_get_rf_reg(dm, (enum rf_path)path, RF_0x0, MASK20BITS); odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); RF_DBG(dm, DBG_RF_IQK, "[IQK]S%d RF0x0=0x%x tmp1bcc=0x%x idx=%d 0x1b3c=0x%x\n", path, rf_reg0, iqk->tmp1bcc, idx, odm_read_4byte(dm, 0x1b3c)); tmp = (rf_reg0 & 0x1fe0) >> 5; iqk->lna_idx = tmp >> 5; bb_idx = tmp & 0x1f; if (bb_idx == 0x1) { if (iqk->lna_idx != 0x0) iqk->lna_idx--; else if (idx != 3) idx++; else iqk->isbnd = true; fail = true; } else if (bb_idx == 0xa) { if (idx != 0) idx--; else if (iqk->lna_idx != 0x7) iqk->lna_idx++; else iqk->isbnd = true; fail = true; } else { fail = false; } if (iqk->isbnd) fail = false; iqk->tmp1bcc = IQMUX[idx]; if (fail) { odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); tmp = (odm_read_4byte(dm, 0x1b24) & 0xffffe3ff) | (iqk->lna_idx << 10); odm_write_4byte(dm, 0x1b24, tmp); } } return fail; } boolean _lok_one_shot_8822b(void *dm_void, u8 path) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_iqk_info *iqk = &dm->IQK_info; boolean LOK_notready = false; u32 LOK_temp = 0; u32 IQK_CMD = 0x0; RF_DBG(dm, DBG_RF_IQK, "[IQK]==========S%d LOK ==========\n", path); IQK_CMD = 0xf8000008 | (1 << (4 + path)); RF_DBG(dm, DBG_RF_IQK, "[IQK]LOK_Trigger = 0x%x\n", IQK_CMD); odm_write_4byte(dm, 0x1b00, IQK_CMD); odm_write_4byte(dm, 0x1b00, IQK_CMD + 1); /*LOK: CMD ID = 0 {0xf8000018, 0xf8000028}*/ /*LOK: CMD ID = 0 {0xf8000019, 0xf8000029}*/ ODM_delay_ms(LOK_delay_8822B); LOK_notready = _iqk_check_cal_8822b(dm, path, 0x0); if (!LOK_notready) _iqk_backup_iqk_8822b(dm, 0x1, path); if (DBG_RF_IQK) { if (!LOK_notready) { LOK_temp = odm_get_rf_reg(dm, (enum rf_path)path, RF_0x58, MASK20BITS); RF_DBG(dm, DBG_RF_IQK, "[IQK]0x58 = 0x%x\n", LOK_temp); } else { RF_DBG(dm, DBG_RF_IQK, "[IQK]==>S%d LOK Fail!!!\n", path); } } iqk->lok_fail[path] = LOK_notready; return LOK_notready; } boolean _iqk_one_shot_8822b(void *dm_void, u8 path, u8 idx) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_iqk_info *iqk = &dm->IQK_info; u8 delay_count = 0; boolean fail = true; u32 IQK_CMD = 0x0, tmp; u16 iqk_apply[2] = {0xc94, 0xe94}; if (idx == TXIQK) RF_DBG(dm, DBG_RF_IQK, "[IQK]============ S%d WBTXIQK ============\n", path); else if (idx == RXIQK1) RF_DBG(dm, DBG_RF_IQK, "[IQK]============ S%d WBRXIQK STEP1============\n", path); else RF_DBG(dm, DBG_RF_IQK, "[IQK]============ S%d WBRXIQK STEP2============\n", path); if (idx == TXIQK) { IQK_CMD = 0xf8000008 | ((*dm->band_width + 4) << 8) | (1 << (path + 4)); RF_DBG(dm, DBG_RF_IQK, "[IQK]TXK_Trigger = 0x%x\n", IQK_CMD); /*{0xf8000418, 0xf800042a} ==> 20 WBTXK (CMD = 4)*/ /*{0xf8000518, 0xf800052a} ==> 40 WBTXK (CMD = 5)*/ /*{0xf8000618, 0xf800062a} ==> 80 WBTXK (CMD = 6)*/ } else if (idx == RXIQK1) { if (*dm->band_width == 2) IQK_CMD = 0xf8000808 | (1 << (path + 4)); else IQK_CMD = 0xf8000708 | (1 << (path + 4)); RF_DBG(dm, DBG_RF_IQK, "[IQK]RXK1_Trigger = 0x%x\n", IQK_CMD); /*{0xf8000718, 0xf800072a} ==> 20 WBTXK (CMD = 7)*/ /*{0xf8000718, 0xf800072a} ==> 40 WBTXK (CMD = 7)*/ /*{0xf8000818, 0xf800082a} ==> 80 WBTXK (CMD = 8)*/ } else if (idx == RXIQK2) { IQK_CMD = 0xf8000008 | ((*dm->band_width + 9) << 8) | (1 << (path + 4)); RF_DBG(dm, DBG_RF_IQK, "[IQK]RXK2_Trigger = 0x%x\n", IQK_CMD); /*{0xf8000918, 0xf800092a} ==> 20 WBRXK (CMD = 9)*/ /*{0xf8000a18, 0xf8000a2a} ==> 40 WBRXK (CMD = 10)*/ /*{0xf8000b18, 0xf8000b2a} ==> 80 WBRXK (CMD = 11)*/ odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); tmp = (odm_read_4byte(dm, 0x1b24) & 0xffffe3ff) | ((iqk->lna_idx & 0x7) << 10); odm_write_4byte(dm, 0x1b24, tmp); } odm_write_4byte(dm, 0x1b00, IQK_CMD); odm_write_4byte(dm, 0x1b00, IQK_CMD + 0x1); ODM_delay_ms(WBIQK_delay_8822B); fail = _iqk_check_cal_8822b(dm, path, 0x1); if (dm->debug_components & DBG_RF_IQK) { odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); RF_DBG(dm, DBG_RF_IQK, "[IQK]S%d ==> 0x1b00 = 0x%x, 0x1b08 = 0x%x\n", path, odm_read_4byte(dm, 0x1b00), odm_read_4byte(dm, 0x1b08)); RF_DBG(dm, DBG_RF_IQK, "[IQK]S%d ==> delay_count = 0x%x\n", path, delay_count); if (idx != TXIQK) RF_DBG(dm, DBG_RF_IQK, "[IQK]S%d ==> RF0x0 = 0x%x, RF0x56 = 0x%x\n", path, odm_get_rf_reg(dm, (enum rf_path)path, RF_0x0, MASK20BITS), odm_get_rf_reg(dm, (enum rf_path)path, RF_0x56, MASK20BITS)); } odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); if (idx == TXIQK) { if (fail) odm_set_bb_reg(dm, iqk_apply[path], BIT(0), 0x0); else _iqk_backup_iqk_8822b(dm, 0x2, path); } if (idx == RXIQK2) { iqk->rxiqk_agc[0][path] = (u16)(((odm_get_rf_reg(dm, (enum rf_path)path, RF_0x0, MASK20BITS) >> 5) & 0xff) | (iqk->tmp1bcc << 8)); odm_write_4byte(dm, 0x1b38, 0x20000000); if (fail) odm_set_bb_reg(dm, iqk_apply[path], (BIT(11) | BIT(10)), 0x0); else _iqk_backup_iqk_8822b(dm, 0x3, path); } if (idx == TXIQK) iqk->iqk_fail_report[0][path][TXIQK] = fail; else iqk->iqk_fail_report[0][path][RXIQK] = fail; return fail; } boolean _iqk_rx_iqk_by_path_8822b(void *dm_void, u8 path) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_iqk_info *iqk = &dm->IQK_info; boolean KFAIL = true, gonext, gs_limit; #if 1 switch (iqk->rxiqk_step) { case 1: /*gain search_RXK1*/ _iqk_rxk1_setting_8822b(dm, path); gonext = false; while (1) { KFAIL = _iqk_rxk_gsearch_fail_8822b(dm, path, RXIQK1); if (KFAIL && iqk->gs_retry_count[0][path][0] < 2) { iqk->gs_retry_count[0][path][0]++; } else if (KFAIL) { iqk->rxiqk_fail_code[0][path] = 0; iqk->rxiqk_step = 5; gonext = true; } else { iqk->rxiqk_step++; gonext = true; } if (gonext) break; } halrf_iqk_xym_read(dm, path, 0x2); break; case 2: /*gain search_RXK2*/ _iqk_rxk2_setting_8822b(dm, path, true); iqk->isbnd = false; while (1) { KFAIL = _iqk_rxk_gsearch_fail_8822b(dm, path, RXIQK2); gs_limit = (iqk->gs_retry_count[0][path][1] < rxiqk_gs_limit); if (KFAIL && gs_limit) { iqk->gs_retry_count[0][path][1]++; } else { iqk->rxiqk_step++; break; } } halrf_iqk_xym_read(dm, path, 0x3); break; case 3: /*RXK1*/ _iqk_rxk1_setting_8822b(dm, path); gonext = false; while (1) { KFAIL = _iqk_one_shot_8822b(dm, path, RXIQK1); if (KFAIL && iqk->retry_count[0][path][RXIQK1] < 2) { iqk->retry_count[0][path][RXIQK1]++; } else if (KFAIL) { iqk->rxiqk_fail_code[0][path] = 1; iqk->rxiqk_step = 5; gonext = true; } else { iqk->rxiqk_step++; gonext = true; } if (gonext) break; } halrf_iqk_xym_read(dm, path, 0x4); break; case 4: /*RXK2*/ _iqk_rxk2_setting_8822b(dm, path, false); gonext = false; while (1) { KFAIL = _iqk_one_shot_8822b(dm, path, RXIQK2); if (KFAIL && iqk->retry_count[0][path][RXIQK2] < 2) { iqk->retry_count[0][path][RXIQK2]++; } else if (KFAIL) { iqk->rxiqk_fail_code[0][path] = 2; iqk->rxiqk_step = 5; gonext = true; } else { iqk->rxiqk_step++; gonext = true; } if (gonext) break; } halrf_iqk_xym_read(dm, path, 0x0); break; } return KFAIL; #endif } void _iqk_iqk_by_path_8822b_subfunction(void *dm_void, u8 rf_path) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_iqk_info *iqk = &dm->IQK_info; boolean KFAIL = true; while (1) { KFAIL = _iqk_rx_iqk_by_path_8822b(dm, rf_path); RF_DBG(dm, DBG_RF_IQK, "[IQK]S%dRXK KFail = 0x%x\n", rf_path, KFAIL); if (iqk->rxiqk_step == 5) { dm->rf_calibrate_info.iqk_step++; iqk->rxiqk_step = 1; if (KFAIL) RF_DBG(dm, DBG_RF_IQK, "[IQK]S%dRXK fail code: %d!!!\n", rf_path, iqk->rxiqk_fail_code[0][rf_path]); break; } } iqk->kcount++; } void _iqk_iqk_by_path_8822b(void *dm_void, boolean segment_iqk) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_iqk_info *iqk = &dm->IQK_info; boolean KFAIL = true; u8 i, kcount_limit; #if 0 /* RF_DBG(dm, DBG_RF_IQK, "[IQK]iqk_step = 0x%x\n", dm->rf_calibrate_info.iqk_step); */ #endif if (*dm->band_width == 2) kcount_limit = kcount_limit_80m; else kcount_limit = kcount_limit_others; while (1) { #if 1 switch (dm->rf_calibrate_info.iqk_step) { case 1: /*S0 LOK*/ #if 1 _iqk_lok_setting_8822b(dm, RF_PATH_A); _lok_one_shot_8822b(dm, RF_PATH_A); #endif dm->rf_calibrate_info.iqk_step++; break; case 2: /*S1 LOK*/ #if 1 _iqk_lok_setting_8822b(dm, RF_PATH_B); _lok_one_shot_8822b(dm, RF_PATH_B); #endif dm->rf_calibrate_info.iqk_step++; break; case 3: /*S0 TXIQK*/ #if 1 _iqk_txk_setting_8822b(dm, RF_PATH_A); KFAIL = _iqk_one_shot_8822b(dm, RF_PATH_A, TXIQK); iqk->kcount++; RF_DBG(dm, DBG_RF_IQK, "[IQK]S0TXK KFail = 0x%x\n", KFAIL); if (KFAIL && iqk->retry_count[0][RF_PATH_A][TXIQK] < 3) iqk->retry_count[0][RF_PATH_A][TXIQK]++; else #endif dm->rf_calibrate_info.iqk_step++; halrf_iqk_xym_read(dm, RF_PATH_A, 0x1); break; case 4: /*S1 TXIQK*/ #if 1 _iqk_txk_setting_8822b(dm, RF_PATH_B); KFAIL = _iqk_one_shot_8822b(dm, RF_PATH_B, TXIQK); iqk->kcount++; RF_DBG(dm, DBG_RF_IQK, "[IQK]S1TXK KFail = 0x%x\n", KFAIL); if (KFAIL && iqk->retry_count[0][RF_PATH_B][TXIQK] < 3) iqk->retry_count[0][RF_PATH_B][TXIQK]++; else #endif dm->rf_calibrate_info.iqk_step++; halrf_iqk_xym_read(dm, RF_PATH_B, 0x1); break; case 5: /*S0 RXIQK*/ _iqk_iqk_by_path_8822b_subfunction(dm, RF_PATH_A); break; case 6: /*S1 RXIQK*/ _iqk_iqk_by_path_8822b_subfunction(dm, RF_PATH_B); break; } if (dm->rf_calibrate_info.iqk_step == 7) { RF_DBG(dm, DBG_RF_IQK, "[IQK]==========LOK summary ==========\n"); RF_DBG(dm, DBG_RF_IQK, "[IQK]A_LOK_notready = %d B_LOK_notready = %d\n", iqk->lok_fail[RF_PATH_A], iqk->lok_fail[RF_PATH_B]); RF_DBG(dm, DBG_RF_IQK, "[IQK]==========IQK summary ==========\n"); RF_DBG(dm, DBG_RF_IQK, "[IQK]A_TXIQK_fail = %d, B_TXIQK_fail = %d\n", iqk->iqk_fail_report[0][RF_PATH_A][TXIQK], iqk->iqk_fail_report[0][RF_PATH_B][TXIQK]); RF_DBG(dm, DBG_RF_IQK, "[IQK]A_RXIQK_fail = %d, B_RXIQK_fail = %d\n", iqk->iqk_fail_report[0][RF_PATH_A][RXIQK], iqk->iqk_fail_report[0][RF_PATH_B][RXIQK]); RF_DBG(dm, DBG_RF_IQK, "[IQK]A_TXIQK_retry = %d, B_TXIQK_retry = %d\n", iqk->retry_count[0][RF_PATH_A][TXIQK], iqk->retry_count[0][RF_PATH_B][TXIQK]); RF_DBG(dm, DBG_RF_IQK, "[IQK]A_RXK1_retry = %d A_RXK2_retry = %d\n", iqk->retry_count[0][RF_PATH_A][RXIQK1], iqk->retry_count[0][RF_PATH_A][RXIQK2]); RF_DBG(dm, DBG_RF_IQK, "[IQK]B_RXK1_retry = %d B_RXK2_retry = %d\n", iqk->retry_count[0][RF_PATH_B][RXIQK1], iqk->retry_count[0][RF_PATH_B][RXIQK2]); RF_DBG(dm, DBG_RF_IQK, "[IQK]A_GS1_retry = %d A_GS2_retry = %d\n", iqk->gs_retry_count[0][RF_PATH_A][0], iqk->gs_retry_count[0][RF_PATH_A][1]); RF_DBG(dm, DBG_RF_IQK, "[IQK]B_GS1_retry = %d B_GS2_retry = %d\n", iqk->gs_retry_count[0][RF_PATH_B][0], iqk->gs_retry_count[0][RF_PATH_B][1]); for (i = 0; i < 2; i++) { odm_write_4byte(dm, 0x1b00, 0xf8000008 | i << 1); odm_write_4byte(dm, 0x1b2c, 0x7); odm_write_4byte(dm, 0x1bcc, 0x0); odm_write_4byte(dm, 0x1b38, 0x20000000); } break; } if (segment_iqk && iqk->kcount == kcount_limit) break; #endif } } void _iqk_start_iqk_8822b(struct dm_struct *dm, boolean segment_iqk) { u32 tmp; /*GNT_WL = 1*/ tmp = odm_get_rf_reg(dm, RF_PATH_A, RF_0x1, MASK20BITS); tmp = tmp | BIT(5) | BIT(0); odm_set_rf_reg(dm, RF_PATH_A, RF_0x1, MASK20BITS, tmp); tmp = odm_get_rf_reg(dm, RF_PATH_B, RF_0x1, MASK20BITS); tmp = tmp | BIT(5) | BIT(0); odm_set_rf_reg(dm, RF_PATH_B, RF_0x1, MASK20BITS, tmp); _iqk_iqk_by_path_8822b(dm, segment_iqk); } void _iq_calibrate_8822b_init(struct dm_struct *dm) { struct dm_iqk_info *iqk = &dm->IQK_info; u8 i, j, k, m; static boolean firstrun = true; if (firstrun) { firstrun = false; RF_DBG(dm, DBG_RF_IQK, "[IQK]=====>PHY_IQCalibrate_8822B_Init\n"); for (i = 0; i < SS_8822B; i++) { for (j = 0; j < 2; j++) { iqk->lok_fail[i] = true; iqk->iqk_fail[j][i] = true; iqk->iqc_matrix[j][i] = 0x20000000; } } for (i = 0; i < 2; i++) { iqk->iqk_channel[i] = 0x0; for (j = 0; j < SS_8822B; j++) { iqk->lok_idac[i][j] = 0x0; iqk->rxiqk_agc[i][j] = 0x0; iqk->bypass_iqk[i][j] = 0x0; for (k = 0; k < 2; k++) { iqk->iqk_fail_report[i][j][k] = true; for (m = 0; m < 8; m++) { iqk->iqk_cfir_real[i][j][k][m] = 0x0; iqk->iqk_cfir_imag[i][j][k][m] = 0x0; } } for (k = 0; k < 3; k++) iqk->retry_count[i][j][k] = 0x0; } } } /*parameters init.*/ /*cu_distance (IQK result variation)=111*/ odm_write_4byte(dm, 0x1b10, 0x88011c00); } boolean _iqk_rximr_rxk1_test_8822b(struct dm_struct *dm, u8 path, u32 tone_index) { boolean fail = true; u32 IQK_CMD, reg_1b20, reg_1b24; odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); reg_1b20 = (odm_read_4byte(dm, 0x1b20) & 0x000fffff); odm_write_4byte(dm, 0x1b20, reg_1b20 | ((tone_index & 0xfff) << 20)); reg_1b24 = (odm_read_4byte(dm, 0x1b24) & 0x000fffff); odm_write_4byte(dm, 0x1b24, reg_1b24 | ((tone_index & 0xfff) << 20)); IQK_CMD = 0xf8000208 | (1 << (path + 4)); odm_write_4byte(dm, 0x1b00, IQK_CMD); odm_write_4byte(dm, 0x1b00, IQK_CMD + 0x1); ODM_delay_ms(GS_delay_8822B); fail = _iqk_check_cal_8822b(dm, path, 0x1); return fail; } u32 _iqk_tximr_selfcheck_8822b(void *dm_void, u8 tone_index, u8 path) { u32 tx_ini_power_H[2], tx_ini_power_L[2]; u32 tmp1, tmp2, tmp3, tmp4, tmp5; u32 IQK_CMD; u32 tximr = 0x0; u8 i; struct dm_struct *dm = (struct dm_struct *)dm_void; /*backup*/ odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); odm_write_4byte(dm, 0x1bc8, 0x80000000); odm_write_4byte(dm, 0x8f8, 0x41400080); tmp1 = odm_read_4byte(dm, 0x1b0c); tmp2 = odm_read_4byte(dm, 0x1b14); tmp3 = odm_read_4byte(dm, 0x1b1c); tmp4 = odm_read_4byte(dm, 0x1b20); tmp5 = odm_read_4byte(dm, 0x1b24); /*setup*/ odm_write_4byte(dm, 0x1b0c, 0x00003000); odm_write_4byte(dm, 0x1b1c, 0xA2193C32); odm_write_1byte(dm, 0x1b15, 0x00); odm_write_4byte(dm, 0x1b20, (u32)(tone_index << 20 | 0x00040008)); odm_write_4byte(dm, 0x1b24, (u32)(tone_index << 20 | 0x00060008)); odm_write_4byte(dm, 0x1b2c, 0x07); odm_write_4byte(dm, 0x1b38, 0x20000000); odm_write_4byte(dm, 0x1b3c, 0x20000000); /* ======derive pwr1========*/ for (i = 0; i < 2; i++) { odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); if (i == 0) odm_write_4byte(dm, 0x1bcc, 0x0f); else odm_write_4byte(dm, 0x1bcc, 0x09); /* One Shot*/ IQK_CMD = 0x00000800; odm_write_4byte(dm, 0x1b34, IQK_CMD + 1); odm_write_4byte(dm, 0x1b34, IQK_CMD); ODM_delay_ms(1); odm_write_4byte(dm, 0x1bd4, 0x00040001); tx_ini_power_H[i] = odm_read_4byte(dm, 0x1bfc); odm_write_4byte(dm, 0x1bd4, 0x000C0001); tx_ini_power_L[i] = odm_read_4byte(dm, 0x1bfc); } /*restore*/ odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); odm_write_4byte(dm, 0x1b0c, tmp1); odm_write_4byte(dm, 0x1b14, tmp2); odm_write_4byte(dm, 0x1b1c, tmp3); odm_write_4byte(dm, 0x1b20, tmp4); odm_write_4byte(dm, 0x1b24, tmp5); if (tx_ini_power_H[1] == tx_ini_power_H[0]) tximr = (3 * (halrf_psd_log2base(tx_ini_power_L[0] << 2) - halrf_psd_log2base(tx_ini_power_L[1]))) / 100; else tximr = 0; return tximr; } void _iqk_start_tximr_test_8822b(struct dm_struct *dm, u8 imr_limit) { boolean KFAIL; u8 path, i, tone_index; u32 imr_result; for (path = 0; path < 2; path++) { _iqk_txk_setting_8822b(dm, path); KFAIL = _iqk_one_shot_8822b(dm, path, TXIQK); for (i = 0x0; i < imr_limit; i++) { tone_index = (u8)(0x08 | i << 4); imr_result = _iqk_tximr_selfcheck_8822b(dm, tone_index, path); RF_DBG(dm, DBG_RF_IQK, "[IQK]path=%x, toneindex = %x, TXIMR = %d\n", path, tone_index, imr_result); } RF_DBG(dm, DBG_RF_IQK, "\n"); } } u32 _iqk_rximr_selfcheck_8822b(void *dm_void, u32 tone_index, u8 path, u32 tmp1b38) { /*[0]: psd tone; [1]: image tone*/ u32 rx_ini_power_H[2], rx_ini_power_L[2]; u32 tmp1, tmp2, tmp3, tmp4, tmp5; u32 IQK_CMD; u8 i, count = 0x0; u32 rximr = 0x0; struct dm_struct *dm = (struct dm_struct *)dm_void; /*backup*/ odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); tmp1 = odm_read_4byte(dm, 0x1b0c); tmp2 = odm_read_4byte(dm, 0x1b14); tmp3 = odm_read_4byte(dm, 0x1b1c); tmp4 = odm_read_4byte(dm, 0x1b20); tmp5 = odm_read_4byte(dm, 0x1b24); odm_write_4byte(dm, 0x1b0c, 0x00001000); odm_write_1byte(dm, 0x1b15, 0x00); odm_write_4byte(dm, 0x1b1c, 0x82193d31); odm_write_4byte(dm, 0x1b20, (u32)(tone_index << 20 | 0x00040008)); odm_write_4byte(dm, 0x1b24, (u32)(tone_index << 20 | 0x00060048)); odm_write_4byte(dm, 0x1b2c, 0x07); odm_write_4byte(dm, 0x1b38, tmp1b38); odm_write_4byte(dm, 0x1b3c, 0x20000000); for (i = 0; i < 2; i++) { if (i == 0) odm_write_4byte(dm, 0x1b1c, 0x82193d31); else odm_write_4byte(dm, 0x1b1c, 0xa2193d31); IQK_CMD = 0x00000800; odm_write_4byte(dm, 0x1b34, IQK_CMD + 1); odm_write_4byte(dm, 0x1b34, IQK_CMD); ODM_delay_ms(2); odm_write_1byte(dm, 0x1bd6, 0xb); while (count < 100) { count++; if (odm_get_bb_reg(dm, R_0x1bfc, BIT(1)) == 1) break; ODM_delay_ms(1); } if (1) { odm_write_1byte(dm, 0x1bd6, 0x5); rx_ini_power_H[i] = odm_read_4byte(dm, 0x1bfc); odm_write_1byte(dm, 0x1bd6, 0xe); rx_ini_power_L[i] = odm_read_4byte(dm, 0x1bfc); } else { rx_ini_power_H[i] = 0x0; rx_ini_power_L[i] = 0x0; } } /*restore*/ odm_write_4byte(dm, 0x1b0c, tmp1); odm_write_4byte(dm, 0x1b14, tmp2); odm_write_4byte(dm, 0x1b1c, tmp3); odm_write_4byte(dm, 0x1b20, tmp4); odm_write_4byte(dm, 0x1b24, tmp5); for (i = 0; i < 2; i++) rx_ini_power_H[i] = (rx_ini_power_H[i] & 0xf8000000) >> 27; if (rx_ini_power_H[0] != rx_ini_power_H[1]) switch (rx_ini_power_H[0]) { case 1: rx_ini_power_L[0] = (u32)((rx_ini_power_L[0] >> 1) | 0x80000000); rx_ini_power_L[1] = (u32)rx_ini_power_L[1] >> 1; break; case 2: rx_ini_power_L[0] = (u32)((rx_ini_power_L[0] >> 2) | 0x80000000); rx_ini_power_L[1] = (u32)rx_ini_power_L[1] >> 2; break; case 3: rx_ini_power_L[0] = (u32)((rx_ini_power_L[0] >> 2) | 0xc0000000); rx_ini_power_L[1] = (u32)rx_ini_power_L[1] >> 2; break; case 4: rx_ini_power_L[0] = (u32)((rx_ini_power_L[0] >> 3) | 0x80000000); rx_ini_power_L[1] = (u32)rx_ini_power_L[1] >> 3; break; case 5: rx_ini_power_L[0] = (u32)((rx_ini_power_L[0] >> 3) | 0xa0000000); rx_ini_power_L[1] = (u32)rx_ini_power_L[1] >> 3; break; case 6: rx_ini_power_L[0] = (u32)((rx_ini_power_L[0] >> 3) | 0xc0000000); rx_ini_power_L[1] = (u32)rx_ini_power_L[1] >> 3; break; case 7: rx_ini_power_L[0] = (u32)((rx_ini_power_L[0] >> 3) | 0xe0000000); rx_ini_power_L[1] = (u32)rx_ini_power_L[1] >> 3; break; default: break; } rximr = (u32)(3 * ((halrf_psd_log2base(rx_ini_power_L[0] / 100) - halrf_psd_log2base(rx_ini_power_L[1] / 100))) / 100); #if 0 /* RF_DBG(dm, DBG_RF_IQK, "%-20s: 0x%x, 0x%x, 0x%x, 0x%x,0x%x, tone_index=%x, rximr= %d\n", (path == 0) ? "PATH A RXIMR ": "PATH B RXIMR", rx_ini_power_H[0], rx_ini_power_L[0], rx_ini_power_H[1], rx_ini_power_L[1], tmp1bcc, tone_index, rximr); */ #endif return rximr; } boolean _iqk_get_rxk1_8822b(struct dm_struct *dm, u8 path, u8 imr_limit, u8 side, u32 temp[][15]) { struct dm_iqk_info *iqk = &dm->IQK_info; boolean kfail = true; u8 i, count = 0; u32 tone_index; for (i = 0; i < imr_limit; i++) { if (side == 0) tone_index = 0xff8 - (i << 4); else tone_index = 0x08 | (i << 4); while (count < 3) { _iqk_rxk1_setting_8822b(dm, path); kfail = _iqk_rximr_rxk1_test_8822b(dm, path, tone_index); RF_DBG(dm, DBG_RF_IQK, "[IQK]path = %x, kfail = %x\n", path, kfail); if (kfail) { count++; if (count == 3) { temp[side][i] = 0x20000000; RF_DBG(dm, DBG_RF_IQK, "[IQK]path = %x", path); RF_DBG(dm, DBG_RF_IQK, "toneindex = %x rxk1 fail\n", tone_index); } } else { odm_write_4byte(dm, 0x1b00, 0xf8000008 | path << 1); odm_write_4byte(dm, 0x1b1c, 0xa2193c32); odm_write_4byte(dm, 0x1b14, 0xe5); odm_write_4byte(dm, 0x1b14, 0x0); temp[side][i] = odm_read_4byte(dm, 0x1b38); RF_DBG(dm, DBG_RF_IQK, "[IQK]path = 0x%x", path); RF_DBG(dm, DBG_RF_IQK, "[tone_idx = 0x%x", tone_index); RF_DBG(dm, DBG_RF_IQK, "[tmp1b38 = 0x%x\n", temp[side][i]); break; } } } return kfail; } void _iqk_get_rxk2_8822b(struct dm_struct *dm, u8 path, u8 imr_limit, u8 side, u32 temp[][15]) { struct dm_iqk_info *iqk = &dm->IQK_info; u8 i; u32 tone_index, imr_result; char *freq[15] = { "1.25MHz", "3.75MHz", "6.25MHz", "8.75MHz", "11.25MHz", "13.75MHz", "16.25MHz", "18.75MHz", "21.25MHz", "23.75MHz", "26.25MHz", "28.75MHz", "31.25MHz", "33.75MHz", "36.25MHz"}; for (i = 0x0; i < imr_limit; i++) { if (side == 0) tone_index = 0xff8 - (i << 4); else tone_index = 0x08 | (i << 4); _iqk_rxk2_setting_8822b(dm, path, false); imr_result = _iqk_rximr_selfcheck_8822b(dm, tone_index, path, temp[side][i]); RF_DBG(dm, DBG_RF_IQK, "[IQK]tone_idx = 0x%5x,", tone_index); RF_DBG(dm, DBG_RF_IQK, "freq =%s%10s,", (side == 0) ? "-" : " ", freq[i]); RF_DBG(dm, DBG_RF_IQK, "RXIMR = %5d dB\n", imr_result); } } void _iqk_rximr_test_8822b(struct dm_struct *dm, u8 path, u8 imr_limit) { struct dm_iqk_info *iqk = &dm->IQK_info; boolean kfail; u8 i, step, count, side; u32 imr_result = 0, tone_index; u32 temp = 0, temp1b38[2][15]; u32 cmd = 0xf8000008; for (step = 1; step < 5; step++) { count = 0; switch (step) { case 1: /*gain search_RXK1*/ _iqk_rxk1_setting_8822b(dm, path); while (count < 3) { kfail = _iqk_rxk_gsearch_fail_8822b(dm, path, RXIQK1); RF_DBG(dm, DBG_RF_IQK, "[IQK]path = %x, kfail = %x\n", path, kfail); if (kfail) { count++; if (count == 3) step = 5; } else { break; } } break; case 2: /*gain search_RXK2*/ _iqk_rxk2_setting_8822b(dm, path, true); iqk->isbnd = false; while (count < 8) { kfail = _iqk_rxk_gsearch_fail_8822b(dm, path, RXIQK2); RF_DBG(dm, DBG_RF_IQK, "[IQK]path = %x, kfail = %x\n", path, kfail); if (kfail) { count++; if (count == 8) step = 5; } else { break; } } break; case 3: /*get RXK1 IQC*/ odm_write_4byte(dm, 0x1b00, cmd | path << 1); temp = odm_read_4byte(dm, 0x1b1c); for (side = 0; side < 2; side++) { kfail = _iqk_get_rxk1_8822b(dm, path, imr_limit, side, temp1b38); if (kfail) { step = 5; break; } } break; case 4: /*get RX IMR*/ for (side = 0; side < 2; side++) { _iqk_get_rxk2_8822b(dm, path, imr_limit, side, temp1b38); odm_write_4byte(dm, 0x1b00, cmd | path << 1); odm_write_4byte(dm, 0x1b1c, temp); odm_write_4byte(dm, 0x1b38, 0x20000000); } break; } } } void _iqk_start_rximr_test_8822b(struct dm_struct *dm, u8 imr_limit) { u8 path; for (path = 0; path < 2; path++) _iqk_rximr_test_8822b(dm, path, imr_limit); } void _iqk_start_imr_test_8822b(void *dm_void) { u8 imr_limit; struct dm_struct *dm = (struct dm_struct *)dm_void; if (*dm->band_width == 2) imr_limit = 0xf; else if (*dm->band_width == 1) imr_limit = 0x8; else imr_limit = 0x4; #if 0 /* _iqk_start_tximr_test_8822b(dm, imr_limit);*/ #endif _iqk_start_rximr_test_8822b(dm, imr_limit); } void _phy_iq_calibrate_8822b(struct dm_struct *dm, boolean reset, boolean segment_iqk) { u32 MAC_backup[MAC_REG_NUM_8822B], BB_backup[BB_REG_NUM_8822B]; u32 RF_backup[RF_REG_NUM_8822B][SS_8822B]; u32 backup_mac_reg[MAC_REG_NUM_8822B] = {0x520, 0x550}; u32 backup_bb_reg[BB_REG_NUM_8822B] = { 0x808, 0x90c, 0xc00, 0xcb0, 0xcb4, 0xcbc, 0xe00, 0xeb0, 0xeb4, 0xebc, 0x1990, 0x9a4, 0xa04, 0xb00, 0x838}; u32 backup_rf_reg[RF_REG_NUM_8822B] = {0xdf, 0x8f, 0x65, 0x0, 0x1}; boolean is_mp = false; struct dm_iqk_info *iqk = &dm->IQK_info; if (*dm->mp_mode) is_mp = true; if (!is_mp) if (_iqk_reload_iqk_8822b(dm, reset)) return; RF_DBG(dm, DBG_RF_IQK, "[IQK]==========IQK strat!!!!!==========\n"); RF_DBG(dm, DBG_RF_IQK, "[IQK]band_type=%s band_width=%d ExtPA2G=%d ext_pa_5g=%d\n", (*dm->band_type == ODM_BAND_5G) ? "5G" : "2G", *dm->band_width, dm->ext_pa, dm->ext_pa_5g); RF_DBG(dm, DBG_RF_IQK, "[IQK]Interface = %d, cut_version = %x\n", dm->support_interface, dm->cut_version); iqk->iqk_times++; iqk->kcount = 0; dm->rf_calibrate_info.iqk_step = 1; iqk->rxiqk_step = 1; _iqk_backup_iqk_8822b(dm, 0x0, 0x0); _iqk_backup_mac_bb_8822b(dm, MAC_backup, BB_backup, backup_mac_reg, backup_bb_reg); _iqk_backup_rf_8822b(dm, RF_backup, backup_rf_reg); #if 0 _iqk_configure_macbb_8822b(dm); _iqk_afe_setting_8822b(dm, true); _iqk_rfe_setting_8822b(dm, false); _iqk_agc_bnd_int_8822b(dm); _iqk_rf_setting_8822b(dm); #endif while (1) { _iqk_configure_macbb_8822b(dm); _iqk_afe_setting_8822b(dm, true); _iqk_rfe_setting_8822b(dm, false); _iqk_agc_bnd_int_8822b(dm); _iqk_rf_setting_8822b(dm); _iqk_start_iqk_8822b(dm, segment_iqk); _iqk_afe_setting_8822b(dm, false); _iqk_restore_mac_bb_8822b(dm, MAC_backup, BB_backup, backup_mac_reg, backup_bb_reg); _iqk_restore_rf_8822b(dm, backup_rf_reg, RF_backup); if (dm->rf_calibrate_info.iqk_step == 7) break; iqk->kcount = 0; RF_DBG(dm, DBG_RF_IQK, "[IQK]delay 50ms!!!\n"); ODM_delay_ms(50); }; if (segment_iqk) _iqk_reload_iqk_setting_8822b(dm, 0x0, 0x1); #if 0 _iqk_afe_setting_8822b(dm, false); _iqk_restore_mac_bb_8822b(dm, MAC_backup, BB_backup, backup_mac_reg, backup_bb_reg); _iqk_restore_rf_8822b(dm, backup_rf_reg, RF_backup); #endif _iqk_fill_iqk_report_8822b(dm, 0); _iqk_rf0xb0_workaround_8822b(dm); RF_DBG(dm, DBG_RF_IQK, "[IQK]==========IQK end!!!!!==========\n"); } void _phy_iq_calibrate_by_fw_8822b(void *dm_void, u8 clear, u8 segment_iqk) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_iqk_info *iqk = &dm->IQK_info; enum hal_status status = HAL_STATUS_FAILURE; if (*dm->mp_mode) clear = 0x1; #if 0 /* else if (dm->is_linked)*/ /* segment_iqk = 0x1;*/ #endif iqk->iqk_times++; status = odm_iq_calibrate_by_fw(dm, clear, segment_iqk); if (status == HAL_STATUS_SUCCESS) RF_DBG(dm, DBG_RF_IQK, "[IQK]FWIQK OK!!!\n"); else RF_DBG(dm, DBG_RF_IQK, "[IQK]FWIQK fail!!!\n"); } /*IQK_version:0x2f, NCTL:0x8*/ /*1.disable CCK block and OFDM CCA block while IQKing*/ void phy_iq_calibrate_8822b(void *dm_void, boolean clear, boolean segment_iqk) { struct dm_struct *dm = (struct dm_struct *)dm_void; if (*dm->mp_mode) halrf_iqk_hwtx_check(dm, true); /*FW IQK*/ if (dm->fw_offload_ability & PHYDM_RF_IQK_OFFLOAD) { _phy_iq_calibrate_by_fw_8822b(dm, clear, (u8)(segment_iqk)); phydm_get_read_counter_8822b(dm); halrf_iqk_check_if_reload(dm); } else { _iq_calibrate_8822b_init(dm); _phy_iq_calibrate_8822b(dm, clear, segment_iqk); } _iqk_fail_count_8822b(dm); if (*dm->mp_mode) halrf_iqk_hwtx_check(dm, false); #if (DM_ODM_SUPPORT_TYPE & ODM_AP) _iqk_iqk_fail_report_8822b(dm); #endif halrf_iqk_dbg(dm); } void _phy_imr_measure_8822b(struct dm_struct *dm) { u32 MAC_backup[MAC_REG_NUM_8822B], BB_backup[BB_REG_NUM_8822B]; u32 RF_backup[RF_REG_NUM_8822B][SS_8822B]; u32 backup_mac_reg[MAC_REG_NUM_8822B] = {0x520, 0x550}; u32 backup_bb_reg[BB_REG_NUM_8822B] = { 0x808, 0x90c, 0xc00, 0xcb0, 0xcb4, 0xcbc, 0xe00, 0xeb0, 0xeb4, 0xebc, 0x1990, 0x9a4, 0xa04, 0xb00}; u32 backup_rf_reg[RF_REG_NUM_8822B] = {0xdf, 0x8f, 0x65, 0x0, 0x1}; _iqk_backup_iqk_8822b(dm, 0x0, 0x0); _iqk_backup_mac_bb_8822b(dm, MAC_backup, BB_backup, backup_mac_reg, backup_bb_reg); _iqk_backup_rf_8822b(dm, RF_backup, backup_rf_reg); _iqk_configure_macbb_8822b(dm); _iqk_afe_setting_8822b(dm, true); _iqk_rfe_setting_8822b(dm, false); _iqk_agc_bnd_int_8822b(dm); _iqk_rf_setting_8822b(dm); _iqk_start_imr_test_8822b(dm); _iqk_afe_setting_8822b(dm, false); _iqk_restore_mac_bb_8822b(dm, MAC_backup, BB_backup, backup_mac_reg, backup_bb_reg); _iqk_restore_rf_8822b(dm, backup_rf_reg, RF_backup); } void do_imr_test_8822b(void *dm_void) { struct dm_struct *dm = (struct dm_struct *)dm_void; RF_DBG(dm, DBG_RF_IQK, "[IQK] ************IMR Test *****************\n"); _phy_imr_measure_8822b(dm); RF_DBG(dm, DBG_RF_IQK, "[IQK] **********End IMR Test *******************\n"); } #endif
{ "pile_set_name": "Github" }
package io.purplejs.core.internal.nashorn import jdk.nashorn.api.scripting.ScriptObjectMirror import jdk.nashorn.internal.runtime.ScriptRuntime import spock.lang.Specification import javax.script.ScriptEngine import java.text.SimpleDateFormat class NashornHelperTest extends Specification { def ScriptEngine engine; private ScriptEngine createEngine() { final ClassLoader classLoader = getClass().getClassLoader(); final NashornRuntimeFactory runtimeFactory = new NashornRuntimeFactory(); return runtimeFactory.newRuntime( classLoader ).getEngine(); } def setup() { this.engine = createEngine(); } def "new instance"() { when: def helper = new NashornHelper(); then: helper != null; } def "newScriptEngine"() { when: def engine1 = createEngine(); then: engine1 != null; when: def engine2 = createEngine(); then: engine2 != null; engine1 != engine2; } def "isUndefined"() { expect: expected == value; where: expected | value true | NashornHelper.isUndefined( null ) false | NashornHelper.isUndefined( 11 ) true | NashornHelper.isUndefined( ScriptRuntime.UNDEFINED ) } def "isDateType"() { when: def result = execute( 'var result = {}; result;' ); then: !NashornHelper.isDateType( result ); when: result = execute( 'var result = new Date(); result;' ); then: NashornHelper.isDateType( result ); } def "isArrayType"() { when: def result = execute( 'var result = 11; result;' ); then: !NashornHelper.isArrayType( result ); when: result = execute( 'var result = {}; result;' ); then: !NashornHelper.isArrayType( result ); when: result = execute( 'var result = []; result;' ); then: NashornHelper.isArrayType( result ); } def "isObjectType"() { when: def result = execute( 'var result = 11; result;' ); then: !NashornHelper.isObjectType( result ); when: result = execute( 'var result = []; result;' ); then: !NashornHelper.isObjectType( result ); when: result = execute( 'var result = {}; result;' ); then: NashornHelper.isObjectType( result ); } def "toDate"() { setup: def format = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" ); format.setTimeZone( TimeZone.getTimeZone( "UTC" ) ); when: def value = execute( 'var result = new Date(Date.parse(\'1995-11-12T22:24:25Z\')); result;' ); def date = NashornHelper.toDate( value ); then: format.format( date ) == "1995-11-12T22:24:25+0000"; } def "addToArray"() { when: def array = (ScriptObjectMirror) execute( 'var result = []; result;' ); then: array.size() == 0; when: NashornHelper.addToArray( array, 10 ); then: array.size() == 1; } def "addToObject"() { when: def object = (ScriptObjectMirror) execute( 'var result = {}; result;' ); then: object.keySet().size() == 0; when: NashornHelper.addToObject( object, 'a', 10 ); then: object.keySet().size() == 1; } private Object execute( final String script ) { return this.engine.eval( script ); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>name</key> <string>CSS3</string> <key>ordering</key> <array> <string>28BA8DCA-2EDD-4367-8D90-07A25959CBF1</string> <string>264AE7EC-1BFD-4C80-91BD-6EED113FC81D</string> <string>41399407-27E9-4143-A151-58FE5E6CE5EF</string> <string>4F2EDD78-285A-4F7C-A94B-AB54D83A3A26</string> <string>3FF32D6B-18BD-49F8-9DB6-81A5B61B6AE3</string> <string>7E37E885-7CF4-4DE0-8728-58578CE9C0BA</string> <string>D0EB1605-D170-4362-ABD3-51AAF8E9121C</string> <string>B4232B63-5C00-4854-AADC-F79E2EB3C1BB</string> <string>EF969779-7E27-4F18-85BA-C37504BE65B4</string> <string>3188E7A4-2D57-4BA3-8829-A0DBD382A827</string> <string>4B7F6466-94FD-4E86-B3DD-2150EA3DE65F</string> <string>46D02FCA-E2D3-42F6-BBB5-7C890AA5556B</string> <string>08745BCE-F647-490E-AF53-BEBBC703C097</string> <string>362B66EA-539D-4480-B7BD-0FD1450D547E</string> <string>212AE077-EC15-4EEC-92C1-3DAF507E95C6</string> <string>ED78F67A-E12C-4B5D-AA2B-9FACBE1A0F75</string> <string>68F2D996-EB85-4D4B-9808-3A5733F685C7</string> <string>AFDB48C0-B8F2-4D19-B882-99BFDF7FDA5D</string> <string>0F78561A-8979-4931-8679-C90455CFF11C</string> </array> <key>uuid</key> <string>85E81ECF-99D2-48E9-8166-A3DCC2C601AE</string> </dict> </plist>
{ "pile_set_name": "Github" }
<html> <head> <title>403 Forbidden</title> </head> <body> <p>Directory access is forbidden.</p> </body> </html>
{ "pile_set_name": "Github" }
require 'test/unit' class TestDefined < Test::Unit::TestCase class Foo def foo p :foo end protected :foo def bar(f) yield(defined?(self.foo)) yield(defined?(f.foo)) end def baz(f) end attr_accessor :attr def attrasgn_test yield(defined?(self.attr = 1)) end end def defined_test return !defined?(yield) end def test_defined $x = nil assert(defined?($x)) # global variable assert_equal('global-variable', defined?($x))# returns description assert_nil(defined?(foo)) # undefined foo=5 assert(defined?(foo)) # local variable assert(defined?(Array)) # constant assert(defined?(::Array)) # toplevel constant assert(defined?(File::Constants)) # nested constant assert(defined?(Object.new)) # method assert(defined?(Object::new)) # method assert(!defined?(Object.print)) # private method assert(defined?(1 == 2)) # operator expression f = Foo.new assert_nil(defined?(f.foo)) # protected method f.bar(f) { |v| assert(v) } assert_nil(defined?(f.quux)) # undefined method assert_nil(defined?(f.baz(x))) # undefined argument x = 0 assert(defined?(f.baz(x))) assert_nil(defined?(f.quux(x))) assert(defined?(print(x))) assert_nil(defined?(quux(x))) assert(defined?(f.attr = 1)) f.attrasgn_test { |v| assert(v) } assert(defined_test) # not iterator assert(!defined_test{}) # called as iterator /a/ =~ '' assert_equal nil, defined?($&) assert_equal nil, defined?($`) assert_equal nil, defined?($') assert_equal nil, defined?($+) assert_equal nil, defined?($1) assert_equal nil, defined?($2) /a/ =~ 'a' assert_equal 'global-variable', defined?($&) assert_equal 'global-variable', defined?($`) assert_equal 'global-variable', defined?($') assert_equal nil, defined?($+) assert_equal nil, defined?($1) assert_equal nil, defined?($2) /(a)/ =~ 'a' assert_equal 'global-variable', defined?($&) assert_equal 'global-variable', defined?($`) assert_equal 'global-variable', defined?($') assert_equal 'global-variable', defined?($+) assert_equal 'global-variable', defined?($1) assert_equal nil, defined?($2) /(a)b/ =~ 'ab' assert_equal 'global-variable', defined?($&) assert_equal 'global-variable', defined?($`) assert_equal 'global-variable', defined?($') assert_equal 'global-variable', defined?($+) assert_equal 'global-variable', defined?($1) assert_equal nil, defined?($2) end end
{ "pile_set_name": "Github" }
module.exports = function(hljs) { var CPP = hljs.getLanguage('cpp').exports; return { keywords: { keyword: 'boolean byte word string String array ' + CPP.keywords.keyword, built_in: 'setup loop while catch for if do goto try switch case else ' + 'default break continue return ' + 'KeyboardController MouseController SoftwareSerial ' + 'EthernetServer EthernetClient LiquidCrystal ' + 'RobotControl GSMVoiceCall EthernetUDP EsploraTFT ' + 'HttpClient RobotMotor WiFiClient GSMScanner ' + 'FileSystem Scheduler GSMServer YunClient YunServer ' + 'IPAddress GSMClient GSMModem Keyboard Ethernet ' + 'Console GSMBand Esplora Stepper Process ' + 'WiFiUDP GSM_SMS Mailbox USBHost Firmata PImage ' + 'Client Server GSMPIN FileIO Bridge Serial ' + 'EEPROM Stream Mouse Audio Servo File Task ' + 'GPRS WiFi Wire TFT GSM SPI SD ' + 'runShellCommandAsynchronously analogWriteResolution ' + 'retrieveCallingNumber printFirmwareVersion ' + 'analogReadResolution sendDigitalPortPair ' + 'noListenOnLocalhost readJoystickButton setFirmwareVersion ' + 'readJoystickSwitch scrollDisplayRight getVoiceCallStatus ' + 'scrollDisplayLeft writeMicroseconds delayMicroseconds ' + 'beginTransmission getSignalStrength runAsynchronously ' + 'getAsynchronously listenOnLocalhost getCurrentCarrier ' + 'readAccelerometer messageAvailable sendDigitalPorts ' + 'lineFollowConfig countryNameWrite runShellCommand ' + 'readStringUntil rewindDirectory readTemperature ' + 'setClockDivider readLightSensor endTransmission ' + 'analogReference detachInterrupt countryNameRead ' + 'attachInterrupt encryptionType readBytesUntil ' + 'robotNameWrite readMicrophone robotNameRead cityNameWrite ' + 'userNameWrite readJoystickY readJoystickX mouseReleased ' + 'openNextFile scanNetworks noInterrupts digitalWrite ' + 'beginSpeaker mousePressed isActionDone mouseDragged ' + 'displayLogos noAutoscroll addParameter remoteNumber ' + 'getModifiers keyboardRead userNameRead waitContinue ' + 'processInput parseCommand printVersion readNetworks ' + 'writeMessage blinkVersion cityNameRead readMessage ' + 'setDataMode parsePacket isListening setBitOrder ' + 'beginPacket isDirectory motorsWrite drawCompass ' + 'digitalRead clearScreen serialEvent rightToLeft ' + 'setTextSize leftToRight requestFrom keyReleased ' + 'compassRead analogWrite interrupts WiFiServer ' + 'disconnect playMelody parseFloat autoscroll ' + 'getPINUsed setPINUsed setTimeout sendAnalog ' + 'readSlider analogRead beginWrite createChar ' + 'motorsStop keyPressed tempoWrite readButton ' + 'subnetMask debugPrint macAddress writeGreen ' + 'randomSeed attachGPRS readString sendString ' + 'remotePort releaseAll mouseMoved background ' + 'getXChange getYChange answerCall getResult ' + 'voiceCall endPacket constrain getSocket writeJSON ' + 'getButton available connected findUntil readBytes ' + 'exitValue readGreen writeBlue startLoop IPAddress ' + 'isPressed sendSysex pauseMode gatewayIP setCursor ' + 'getOemKey tuneWrite noDisplay loadImage switchPIN ' + 'onRequest onReceive changePIN playFile noBuffer ' + 'parseInt overflow checkPIN knobRead beginTFT ' + 'bitClear updateIR bitWrite position writeRGB ' + 'highByte writeRed setSpeed readBlue noStroke ' + 'remoteIP transfer shutdown hangCall beginSMS ' + 'endWrite attached maintain noCursor checkReg ' + 'checkPUK shiftOut isValid shiftIn pulseIn ' + 'connect println localIP pinMode getIMEI ' + 'display noBlink process getBand running beginSD ' + 'drawBMP lowByte setBand release bitRead prepare ' + 'pointTo readRed setMode noFill remove listen ' + 'stroke detach attach noTone exists buffer ' + 'height bitSet circle config cursor random ' + 'IRread setDNS endSMS getKey micros ' + 'millis begin print write ready flush width ' + 'isPIN blink clear press mkdir rmdir close ' + 'point yield image BSSID click delay ' + 'read text move peek beep rect line open ' + 'seek fill size turn stop home find ' + 'step tone sqrt RSSI SSID ' + 'end bit tan cos sin pow map abs max ' + 'min get run put', literal: 'DIGITAL_MESSAGE FIRMATA_STRING ANALOG_MESSAGE ' + 'REPORT_DIGITAL REPORT_ANALOG INPUT_PULLUP ' + 'SET_PIN_MODE INTERNAL2V56 SYSTEM_RESET LED_BUILTIN ' + 'INTERNAL1V1 SYSEX_START INTERNAL EXTERNAL ' + 'DEFAULT OUTPUT INPUT HIGH LOW' }, contains: [ CPP.preprocessor, hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, hljs.C_NUMBER_MODE ] }; };
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?><module fritzingVersion="0.7.2b" moduleId="SparkFun-PowerIC-MCP73831-"> <!-- generated from Sparkfun Eagle Library 'SparkFun-PowerIC' MCP73831 --> <version>4</version> <date>2013-02-13</date> <label>U</label> <author>www.fritzing.org</author> <description>Miniature single cell, fully integrated Li-Ion, Li-polymer charge management controller&lt;br&gt; http://ww1.microchip.com/downloads/en/DeviceDoc/21984a.pdf</description> <title>MCP73831</title> <tags> <tag>MCP73831</tag> <tag>SOT23-5</tag> </tags> <properties> <property name="package">sot23-5</property> <property name="family">sparkfun Battery Charger IC</property> <property name="chip">MCP73831</property> <property name="technology">Li-ion/Li-poly</property> </properties> <views> <breadboardView> <layers image="breadboard/sparkfun-poweric_sot23-5_breadboard.svg"> <layer layerId="breadboard"/> </layers> </breadboardView> <schematicView> <layers image="schematic/sparkfun-poweric_mcp73831_schematic.svg"> <layer layerId="schematic"/> </layers> </schematicView> <pcbView> <layers image="pcb/sparkfun-poweric_sot23-5_pcb.svg"> <layer layerId="copper1"/> <layer layerId="silkscreen"/> </layers> </pcbView> <iconView> <layers image="breadboard/sparkfun-poweric_sot23-5_breadboard.svg"> <layer layerId="icon"/> </layers> </iconView> </views> <connectors> <connector id="connector4" name="PROG" type="male"> <description>PROG</description> <views> <breadboardView> <p layer="breadboard" svgId="connector4pin"/> </breadboardView> <schematicView> <p layer="schematic" svgId="connector4pin" terminalId="connector4terminal"/> </schematicView> <pcbView> <p layer="copper1" svgId="connector4pad"/> </pcbView> </views> </connector> <connector id="connector0" name="STAT" type="male"> <description>STAT</description> <views> <breadboardView> <p layer="breadboard" svgId="connector0pin"/> </breadboardView> <schematicView> <p layer="schematic" svgId="connector0pin" terminalId="connector0terminal"/> </schematicView> <pcbView> <p layer="copper1" svgId="connector0pad"/> </pcbView> </views> </connector> <connector id="connector2" name="VBAT" type="male"> <description>VBAT</description> <views> <breadboardView> <p layer="breadboard" svgId="connector2pin"/> </breadboardView> <schematicView> <p layer="schematic" svgId="connector2pin" terminalId="connector2terminal"/> </schematicView> <pcbView> <p layer="copper1" svgId="connector2pad"/> </pcbView> </views> </connector> <connector id="connector3" name="VIN" type="male"> <description>VIN</description> <views> <breadboardView> <p layer="breadboard" svgId="connector3pin"/> </breadboardView> <schematicView> <p layer="schematic" svgId="connector3pin" terminalId="connector3terminal"/> </schematicView> <pcbView> <p layer="copper1" svgId="connector3pad"/> </pcbView> </views> </connector> <connector id="connector1" name="VSS" type="male"> <description>VSS</description> <views> <breadboardView> <p layer="breadboard" svgId="connector1pin"/> </breadboardView> <schematicView> <p layer="schematic" svgId="connector1pin" terminalId="connector1terminal"/> </schematicView> <pcbView> <p layer="copper1" svgId="connector1pad"/> </pcbView> </views> </connector> </connectors> <buses> </buses> </module>
{ "pile_set_name": "Github" }
JASC-PAL 0100 16 82 180 82 213 197 139 180 164 98 148 131 65 123 98 32 255 213 90 106 189 255 255 123 172 164 222 115 131 172 82 139 189 139 98 148 98 82 82 82 115 115 115 189 189 197 238 238 255
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <html> <head> <title>Pixel rounding testcase</title> <style type="text/css"> html, body { margin: 0; border: none; padding: 0; } body > div { margin: 10px; height: 80px; position: relative; } body > div > div { position: absolute; top: -0.1px; left: 0; height: 10.5px; width: 10px; } body > div > div { background: green; } .tl { top: 19.9px; } .tr { margin-top: 40px; } .bl { left: 20px; } .br { margin-left: 40px; } div.one > div.tl { border-top-left-radius: 1px; } div.one > div.tr { border-top-right-radius: 1px; } div.one > div.bl { border-bottom-left-radius: 1px; } div.one > div.br { border-bottom-right-radius: 1px; } div.four > div.tl { border-top-left-radius: 4px; } div.four > div.tr { border-top-right-radius: 4px; } div.four > div.bl { border-bottom-left-radius: 4px; } div.four > div.br { border-bottom-right-radius: 4px; } </style> </head> <body> <div class="one"> <div></div> <div class="tl"></div> <div class="tr"></div> <div class="bl"></div> <div class="br"></div> <div class="tl tr"></div> <div class="tl bl"></div> <div class="tl br"></div> <div class="tr bl"></div> <div class="tr br"></div> <div class="bl br"></div> <div class="tl tr bl"></div> <div class="tl tr br"></div> <div class="tl bl br"></div> <div class="tr bl br"></div> <div class="tl tr bl br"></div> </div> <div class="four"> <div></div> <div class="tl"></div> <div class="tr"></div> <div class="bl"></div> <div class="br"></div> <div class="tl tr"></div> <div class="tl bl"></div> <div class="tl br"></div> <div class="tr bl"></div> <div class="tr br"></div> <div class="bl br"></div> <div class="tl tr bl"></div> <div class="tl tr br"></div> <div class="tl bl br"></div> <div class="tr bl br"></div> <div class="tl tr bl br"></div> </div> </body> </html>
{ "pile_set_name": "Github" }
## 介绍 HTTP是现代应用常用的一种交换数据和媒体的网络方式,高效地使用HTTP能让资源加载更快,节省带宽。高效的HTTP客户端,它有以下默认特性: 支持HTTP/2,允许所有同一个主机地址的请求共享同一个socket连接 连接池减少请求延时 透明的GZIP压缩减少响应数据的大小 缓存响应内容,避免一些完全重复的请求 当网络出现问题的时候依然坚守自己的职责,它会自动恢复一般的连接问题,如果你的服务有多个IP地址,当第一个IP请求失败时,会交替尝试你配置的其他IP,使用现代TLS技术(SNI, ALPN)初始化新的连接,当握手失败时会回退到TLS 1.0。 ### Httpd 使用 1.1. 异步GET请求 -new Httpd; -构造Request对象; -通过前两步中的对象构建Call对象; -通过Call#enqueue(Callback)方法来提交异步请求; ``` String url = "http://wwww.baidu.com"; Httpd httpd = new Httpd(); final Request request = new Request.Builder() .url(url) .get()//默认就是GET请求,可以不写 .build(); NewCall call = httpd.newCall(request); call.enqueue(new Callback() { @Override public void onFailure(NewCall call, IOException e) { Logger.info("onFailure: "); } @Override public void onResponse(NewCall call, Response response) throws IOException { Logger.info("onResponse: " + response.body().string()); } }); ``` 1.2. 同步GET请求 前面几个步骤和异步方式一样,只是最后一部是通过 NewCall#execute() 来提交请求,注意这种方式会阻塞调用线程,所以在Android中应放在子线程中执行,否则有可能引起ANR异常,Android3.0 以后已经不允许在主线程访问网络。 ``` String url = "http://wwww.baidu.com"; Httpd httpd = new Httpd(); final Request request = new Request.Builder() .url(url) .build(); final NewCall call = httpd.newCall(request); new Thread(new Runnable() { @Override public void run() { try { Response response = call.execute(); Logger.info("run: " + response.body().string()); } catch (IOException e) { e.printStackTrace(); } } }).start(); ``` 2.1. POST方式提交String 这种方式与前面的区别就是在构造Request对象时,需要多构造一个RequestBody对象,用它来携带我们要提交的数据。在构造 RequestBody 需要指定MediaType,用于描述请求/响应 body 的内容类型,关于 MediaType 的更多信息可以查看 RFC 2045,RequstBody的几种构造方式: ``` MediaType mediaType = MediaType.valueOf("text/x-markdown; charsets=utf-8"); String requestBody = "I am Jdqm."; Request request = new Request.Builder() .url("https://api.github.com/markdown/raw") .post(RequestBody.create(mediaType, requestBody)) .build(); Httpd httpd = new Httpd(); httpd.newCall(request).enqueue(new Callback() { @Override public void onFailure(NewCall call, IOException e) { Logger.info("onFailure: " + e.getMessage()); } @Override public void onResponse(NewCall call, Response response) throws IOException { Logger.info(response.protocol() + " " + response.code() + " " + response.message()); Headers headers = response.headers(); for (int i = 0; i < headers.size(); i++) { Logger.info(headers.name(i) + ":" + headers.value(i)); } Logger.info("onResponse: " + response.body().string()); } }); ``` 响应内容 ``` http/1.1 200 OK Date:Sat, 10 Mar 2018 05:23:20 GMT Content-Type:text/html;charsets=utf-8 Content-Length:18 Server:GitHub.com Status:200 OK X-RateLimit-Limit:60 X-RateLimit-Remaining:52 X-RateLimit-Reset:1520661052 X-CommonMarker-Version:0.17.4 Access-Control-Expose-Headers:ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval Access-Control-Allow-Origin:* Content-Security-Policy:default-src 'none' Strict-Transport-Security:max-age=31536000; includeSubdomains; preload X-Content-Type-Options:nosniff X-Frame-Options:deny X-XSS-Protection:1; mode=block X-Runtime-rack:0.019668 Vary:Accept-Encoding X-GitHub-Request-Id:1474:20A83:5CC0B6:7A7C1B:5AA36BC8 onResponse: <p>I am Jdqm.</p> ``` 2.2 POST方式提交流 ``` RequestBody requestBody = new RequestBody() { @Override public MediaType contentType() { return MediaType.valueOf("text/x-markdown; charsets=utf-8"); } @Override public void writeTo(BufferSink sink) throws IOException { sink.writeUtf8("I am Jdqm."); } }; Request request = new Request.Builder() .url("https://api.github.com/markdown/raw") .post(requestBody) .build(); Httpd httpd = new Httpd(); httpd.newCall(request).enqueue(new Callback() { @Override public void onFailure(NewCall call, IOException e) { Logger.info("onFailure: " + e.getMessage()); } @Override public void onResponse(NewCall call, Response response) throws IOException { Logger.info(response.protocol() + " " + response.code() + " " + response.message()); Headers headers = response.headers(); for (int i = 0; i < headers.size(); i++) { Logger.info(headers.name(i) + ":" + headers.value(i)); } Logger.info("onResponse: " + response.body().string()); } }); ``` 2.3. POST提交文件 ``` MediaType mediaType = MediaType.valueOf("text/x-markdown; charsets=utf-8"); Httpd httpd = new Httpd(); File file = new File("test.md"); Request request = new Request.Builder() .url("https://api.github.com/markdown/raw") .post(RequestBody.create(mediaType, file)) .build(); httpd.newCall(request).enqueue(new Callback() { @Override public void onFailure(NewCall call, IOException e) { Logger.info("onFailure: " + e.getMessage()); } @Override public void onResponse(NewCall call, Response response) throws IOException { Logger.info(response.protocol() + " " + response.code() + " " + response.message()); Headers headers = response.headers(); for (int i = 0; i < headers.size(); i++) { Logger.info(headers.name(i) + ":" + headers.value(i)); } Logger.info("onResponse: " + response.body().string()); } }); ``` 2.4. POST方式提交表单 ``` Httpd httpd = new Httpd(); RequestBody requestBody = new FormBody.Builder() .add("search", "Jurassic Park") .build(); Request request = new Request.Builder() .url("https://en.wikipedia.org/w/index.php") .post(requestBody) .build(); httpd.newCall(request).enqueue(new Callback() { @Override public void onFailure(NewCall call, IOException e) { Logger.info("onFailure: " + e.getMessage()); } @Override public void onResponse(NewCall call, Response response) throws IOException { Logger.info(response.protocol() + " " + response.code() + " " + response.message()); Headers headers = response.headers(); for (int i = 0; i < headers.size(); i++) { Logger.info(headers.name(i) + ":" + headers.value(i)); } Logger.info("onResponse: " + response.body().string()); } }); ``` 2.5. POST方式提交分块请求 MultipartBody 可以构建复杂的请求体,与HTML文件上传形式兼容。多块请求体中每块请求都是一个请求体,可以定义自己的请求头。这些请求头可以用来描述这块请求,例如它的 Content-Disposition 。如果 Content-Length 和 Content-Type 可用的话,他们会被自动添加到请求头中 ``` Httpd client = new Httpd(); MultipartBody body = new MultipartBody.Builder("AaB03x") .setType(MediaType.MULTIPART_FORM_DATA_TYPE) .addPart( Headers.of("Content-Disposition", "form-data; name=\"title\""), RequestBody.create(null, "Square Logo")) .addPart( Headers.of("Content-Disposition", "form-data; name=\"image\""), RequestBody.create( MediaType.valueOf("image/png"), new File("website/static/logo-square.png"))) .build(); Request request = new Request.Builder() .header("Authorization", "Client-ID " + "...") .url("https://api.imgur.com/3/image") .post(body) .build(); NewCall call = client.newCall(request); call.enqueue(new Callback() { @Override public void onFailure(NewCall call, IOException e) { } @Override public void onResponse(NewCall call, Response response) throws IOException { Logger.info(response.body().string()); } }); ``` 3.1. 拦截器 Httpd的拦截器链可谓是其整个框架的精髓,用户可传入的 interceptor 分为两类: ①一类是全局的 interceptor,该类 interceptor 在整个拦截器链中最早被调用,通过 Httpd.Builder#addInterceptor(Interceptor) 传入; ②另外一类是非网页请求的 interceptor ,这类拦截器只会在非网页请求中被调用,并且是在组装完请求之后,真正发起网络请求前被调用,所有的 interceptor 被保存在 List<Interceptor> interceptors 集合中,按照添加顺序来逐个调用,具体可参考 RealCall#getResponseWithInterceptorChain() 方法。通过 Httpd.Builder#addNetworkInterceptor(Interceptor) 传入; 这里举一个简单的例子,例如有这样一个需求,我要监控App通过 Httpd 发出的所有原始请求,以及整个请求所耗费的时间,针对这样的需求就可以使用第一类全局的 interceptor 在拦截器链头去做。 ``` public class LoggingInterceptor implements Interceptor { @Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); long startTime = System.nanoTime(); Logger.info(String.format("Sending request %s on %s%n%s", request.url(), chain.connection(), request.headers())); Response response = chain.proceed(request); long endTime = System.nanoTime(); Logger.info(String.format("Received response for %s in %.1fms%n%s", response.request().url(), (endTime - startTime) / 1e6d, response.headers())); return response; } } ``` ``` Httpd httpd = new Httpd.Builder() .addInterceptor(new LoggingInterceptor()) .build(); Request request = new Request.Builder() .url("http://www.publicobject.com/helloworld.txt") .header("User-Agent", "Httpd Example") .build(); httpd.newCall(request).enqueue(new Callback() { @Override public void onFailure(NewCall call, IOException e) { Logger.info("onFailure: " + e.getMessage()); } @Override public void onResponse(NewCall call, Response response) throws IOException { ResponseBody body = response.body(); if (body != null) { Logger.info("onResponse: " + response.body().string()); body.close(); } } }); ``` 针对这个请求,打印出来的结果 ``` Sending request http://www.publicobject.com/helloworld.txt on null User-Agent: Httpd Example Received response for https://publicobject.com/helloworld.txt in 1265.9ms Server: nginx/1.10.0 (Ubuntu) Date: Wed, 28 Mar 2018 08:19:48 GMT Content-Type: text/plain Content-Length: 1759 Last-Modified: Tue, 27 May 2014 02:35:47 GMT Connection: keep-alive ETag: "5383fa03-6df" Accept-Ranges: bytes ``` 注意到一点是这个请求做了重定向,原始的 request url 是 http://www.publicobject.com/helloworld.tx,而响应的 request url 是 https://publicobject.com/helloworld.txt,这说明一定发生了重定向,但是做了几次重定向其实我们这里是不知道的,要知道这些的话,可以使用 addNetworkInterceptor()去做。更多的关于 interceptor的使用以及它们各自的优缺点 ## 其他 1. 推荐让 Httpd 保持单例,用同一个 Httpd 实例来执行你的所有请求,因为每一个 Httpd 实例都拥有自己的连接池和线程池,重用这些资源可以减少延时和节省资源,如果为每个请求创建一个 Httpd 实例,显然就是一种资源的浪费。当然,也可以使用如下的方式来创建一个新的 Httpd 实例,它们共享连接池、线程池和配置信息。 ``` Httpd client = Httpd.newBuilder() .readTimeout(500, TimeUnit.MILLISECONDS) .build(); Response response = client.newCall(request).execute(); ``` 2. 每一个Call(其实现是RealCall)只能执行一次,否则会报异常,具体参见 RealCall#execute() ### Httpv 使用 - 支持URL 占位符 - 支持Lambda 回调 - 支持JSON自动封装解析 - 支持异步预处理器 - 支持回调执行器 - 支持全局监听器 - 支持回调阻断机制 - 支持过程控制 - 支持进度监听 * `sync(String url)` 开始一个同步 Http 请求 * `async(String url)` 开始一个异步 Http 请求 * `webSocket(String url)` 开始一个 WebSocket 连接 * `cancel(String tag)` 按标签取消(同步 | 异步 | WebSocket)连接 * `cancelAll()` 取消所有(同步 | 异步 | WebSocket)连接 * `request(Request request)` Httpv 原生 HTTP 请求 * `webSocket(Request request, WebSocketListener listener)` Httpv 原生 WebSocket 连接 * `newBuilder()` 用于重新构建一个 Httpv 实例 ``` Httpv http = Httpv.builder() .baseUrl("http://api.example.com") .addMsgConvertor(new GsonMsgConvertor()); .build(); ``` ### 同步请求   使用方法`sync(String url)`开始一个同步请求: ``` List<User> users = http.sync("/users") // http://api.example.com/users .get() // GET请求 .getBody() // 获取响应报文体 .toList(User.class); // 得到目标数据 ```   方法`sync`返回一个同步`CoverHttp`,可链式使用。 ### 异步请求   使用方法`async(String url)`开始一个异步请求: ``` http.async("/users/1") // http://api.aoju.org/users/1 .setOnResponse((HttpResult result) -> { // 得到目标数据 User user = result.getBody().toBean(User.class); }) .get(); // GET请求 ```   方法`async`返回一个异步`CoverHttp`,可链式使用。 ### WebSocket   使用方法`webSocket(String url)`开始一个 WebSocket 通讯: ``` http.webSocket("/chat") .setOnOpen((WebSocket ws, HttpResult res) -> { ws.send("向服务器问好"); }) .setOnMessage((WebSocket ws,Message msg) -> { // 从服务器接收消息(自动反序列化) Chat chat = msg.toBean(Chat.class); // 相同的消息发送给服务器(自动序列化 Chat 对象) ws.send(chat); }) .listen(); // 启动监听 ``` 方法`webSocket`返回一个支持 WebSocket 的`CoverHttp`,也可链式使用。 #### 第一步、确定请求方式 同步 Httpv(`sync`)、异步 Httpv(`async`)或 WebSocket(`webSocket`) #### 第二步、构建请求任务 * `addXxxPara` - 添加请求参数 * `setOnXxxx` - 设置回调函数 * `tag` - 添加标签 * ... #### 第三步、调用请求方法 Httpv 请求方法: * `get()` - GET 请求 * `post()` - POST 请求 * `put()` - PUT 请求 * `delete()` - DELETE 请求 * ... Websocket 方法: * `listen()` - 启动监听 #### 任意请求,都遵循请求三部曲! * `sync(String url)` 开始一个同步 HTTP 请求 * `async(String url)` 开始一个异步 HTTP 请求 * `webSocket(String url)` 开始一个 WebSocket 连接 * `cancel(String tag)` 按标签取消(同步 | 异步 | WebSocket)连接 * `cancelAll()` 取消所有(同步 | 异步 | WebSocket)连接 * `request(Request request)` OkHttp 原生 HTTP 请求 * `webSocket(Request request, WebSocketListener listener)` Httpv 原生 WebSocket 连接 ``` Httpv.async("https://api.aoju.org/auth/login") .addBodyPara("username", "jack") .addBodyPara("password", "xxxx") .setOnResponse((HttpResult result) -> { // 得到返回数据,使用 Mapper 可省去定义一个实体类 Mapper mapper = result.getBody().toMapper(); // 登录是否成功 boolean success = mapper.getBool("success"); }) .post(); ``` ### 配置`Httpv` 工具类`Httpv`还支持以 SPI 方式注入自定义配置,分以下两步: #### 第一步、新建一个配置类,实现[`org.aoju.bus.http.metric.Config`]接口 例如: ``` public class HttpvConfig implements Config { @Override public void with(Httpv.Builder builder) { // 在这里对 HTTP.Builder 做一些自定义的配置 builder.baseUrl("https://api.aoju.org"); // 如果项目中添加了 fastjson 或 gson 或 jackson 依赖 // Httpv 会自动注入它们提供的 Convertor // 所以这里就不需要再配置 Convertor 了 (内部实现自动注入的原理也是 SPI) // 但如果没有添加这些依赖,那还需要自定义一个 Convertor builder.addMsgConvertor(new MyMsgConvertor()); } } ``` ## 文件下载   Httpv 并没有把文件的下载排除在常规的请求之外,同一套API,它优雅的设计使得下载与常规请求融合的毫无违和感,一个最简单的示例: ``` http.sync("bus-http/test.zip") .get() // 使用 GET 方法(其它方法也可以,看服务器支持) .getBody() // 得到报文体 .toFile("bus-http/test.zip") // 下载到指定的路径 .start(); // 启动下载 http.sync("/download/test.zip").get().getBody() .toFolder("bus-http") // 下载到指定的目录,文件名将根据下载信息自动生成 .start(); ```   或使用异步连接方式: ``` http.async("bus-http/test.zip") .setOnResponse((HttpResult result) -> { result.getBody().toFolder("bus-http").start(); }) .get(); ```   这里要说明一下:`sync`与`async`的区别在于连接服务器并得到响应这个过程的同步与异步(这个过程的耗时在大文件下载中占比极小),而`start`方法启动的下载过程则都是异步的。 ### 下载进度监听   就直接上代码啦,诸君一看便懂: ``` http.sync("/download/test.zip") .get() .getBody() .stepBytes(1024) // 设置每接收 1024 个字节执行一次进度回调(不设置默认为 8192) // .stepRate(0.01) // 设置每接收 1% 执行一次进度回调(不设置以 StepBytes 为准) .setOnProcess((Process process) -> { // 下载进度回调 long doneBytes = process.getDoneBytes(); // 已下载字节数 long totalBytes = process.getTotalBytes(); // 总共的字节数 double rate = process.getRate(); // 已下载的比例 boolean isDone = process.isDone(); // 是否下载完成 }) .toFolder("bus-http/") // 指定下载的目录,文件名将根据下载信息自动生成 // .toFile("bus-http/test.zip") // 指定下载的路径,若文件已存在则覆盖 .setOnSuccess((File file) -> { // 下载成功回调 }) .start(); ```   值得一提的是:由于 Httpv 并没有把下载做的很特别,这里设置的进度回调不只对下载文件起用作,即使对响应JSON的常规请求,只要设置了进度回调,它也会告诉你报文接收的进度(提前是服务器响应的报文有`Content-Length`头),例如: ``` List<User> users = http.sync("/users") .get() .getBody() .stepBytes(2) .setOnProcess((Process process) -> { System.out.println(process.getRate()); }) .toList(User.class); ``` ### 下载过程控制   过于简单:还是直接上代码: ``` Ctrl ctrl = http.sync("bus-http/test.zip") .get() .getBody() .setOnProcess((Process process) -> { System.out.println(process.getRate()); }) .toFolder("bus-http/") .start(); // 该方法返回一个下载过程控制器 ctrl.status(); // 下载状态 ctrl.pause(); // 暂停下载 ctrl.resume(); // 恢复下载 ctrl.cancel(); // 取消下载(同时会删除文件,不可恢复) ```   无论是同步还是异步发起的下载请求,都可以做以上的控制: ``` http.async("bus-http/test.zip") .setOnResponse((HttpResult result) -> { // 拿到下载控制器 Ctrl ctrl = result.getBody().toFolder("bus-http/").start(); }) .get(); ``` ### 实现断点续传   Httpv 对断点续传并没有再做更高层次的封装,因为这是app该去做的事情,它在设计上使各种网络问题的处理变简单的同时力求纯粹。下面的例子可以看到,Httpv 通过一个失败回调拿到 **断点**,便将复杂的问题变得简单: ``` http.sync("bus-http/test.zip") .get() .getBody() .toFolder("bus-http/") .setOnFailure((Failure failure) -> { // 下载失败回调,以便接收诸如网络错误等失败信息 IOException e = failure.getException(); // 具体的异常信息 long doneBytes = failure.getDoneBytes(); // 已下载的字节数(断点),需要保存,用于断点续传 File file = failure.getFile(); // 下载生成的文件,需要保存 ,用于断点续传(只保存路径也可以) }) .start(); ```   下面代码实现续传: ``` long doneBytes = ... // 拿到保存的断点 File file = ... // 待续传的文件 http.sync("bus-http/test.zip") .setRange(doneBytes) // 设置断点(已下载的字节数) .get() .getBody() .toFile(file) // 下载到同一个文件里 .setAppended() // 开启文件追加模式 .setOnSuccess((File file) -> { }) .setOnFailure((Failure failure) -> { }) .start(); ``` ### 实现分块下载   当文件很大时,有时候我们会考虑分块下载,与断点续传的思路是一样的,示例代码: ``` private static String url = "https://www.aoju.org/dl/test.zip"; private static Httpv httpv; public static void httpv() { Httpv.Builder builder = Httpv.builder(); ConvertProvider.inject(builder); Config.config(builder); httpv = builder.build(); long totalSize = httpv.sync(url).get().getBody() .close() // 因为这次请求只是为了获得文件大小,不消费报文体,所以直接关闭 .getLength(); // 获得待下载文件的大小(由于未消费报文体,所以该请求不会消耗下载报文体的时间和网络流量) download(totalSize, 0); // 从第 0 块开始下载 sleep(50000); // 等待下载完成(不然本例的主线程就结束啦) } static void download(long totalSize, int index) { long size = 3 * 1024 * 1024; // 每块下载 3M long start = index * size; long end = Math.min(start + size, totalSize); httpv.sync(url) .setRange(start, end) // 设置本次下载的范围 .get().getBody() .toFile("bus-http/test.zip") // 下载到同一个文件里 .setAppended() // 开启文件追加模式 .setOnSuccess((File file) -> { if (end < totalSize) { // 若未下载完,则继续下载下一块 download(totalSize, index + 1); } else { System.out.println("下载完成"); } }) .start(); } ``` ## 文件上传   一个简单文件上传的示例: ``` http.sync("/upload") .addFilePara("test", "bus-http/test.zip") .post(); // 上传发法一般使用 POST 或 PUT,看服务器支持 ```   异步上传也是完全一样: ``` http.async("/upload") .addFilePara("test", "bus-http/test.zip") .post(); ``` ``` http.async("/upload") .bodyType("multipart/form") .addFilePara("test", "bus-http/test.zip") .post(); ``` ### 上传进度监听   Httpv 的上传进度监听,监听的是所有请求报文体的发送进度,示例代码: ``` http.sync("/upload") .addBodyPara("name", "Jack") .addBodyPara("age", 20) .addFilePara("avatar", "bus-http/avatar.jpg") .stepBytes(1024) // 设置每发送 1024 个字节执行一次进度回调(不设置默认为 8192) // .stepRate(0.01) // 设置每发送 1% 执行一次进度回调(不设置以 StepBytes 为准) .setOnProcess((Process process) -> { // 上传进度回调 long doneBytes = process.getDoneBytes(); // 已发送字节数 long totalBytes = process.getTotalBytes(); // 总共的字节数 double rate = process.getRate(); // 已发送的比例 boolean isDone = process.isDone(); // 是否发送完成 }) .post(); ```   咦!怎么感觉和下载的进度回调的一样?没错!Httpv 还是使用同一套API处理上传和下载的进度回调,区别只在于上传是在`get/post`方法之前使用这些API,下载是在`getBody`方法之后使用。很好理解:`get/post`之前是准备发送请求时段,有上传的含义,而`getBody`之后,已是报文响应的时段,当然是下载。 ### 上传过程控制   上传文件的过程控制就很简单,和常规请求一样,只有异步发起的上传可以取消: ``` HttpCall call = http.async("/upload") .addFilePara("test", "bus-http/test.zip") .setOnProcess((Process process) -> { System.out.println(process.getRate()); }) .post(); call.cancel(); // 取消上传 ``` ### Httpx 使用 - 暂无 ### Httpz 使用 - 支持多线程异步请求 - 支持Http/Https协议 - 支持同步/异步请求 - 支持异步延迟执行 - 支持Cookie持久化 - 支持JSON、表单提交 - 支持文件和图片上传/批量上传,支持同步/异步上传,支持进度提示 - 支持文件流上传 1.同步Get请求(访问百度首页,自动处理https单向认证) ``` String url = "https://www.baidu.com"; String resp = Httpz.get().url(url).build().execute().string(); ``` 2.异步Get请求(访问百度首页) ``` Httpz.get().url("https://www.baidu.com").build(). executeAsync(new StringCallback() { @Override public void onFailure(NewCall call, Exception e, int id) { Logger.error(e.getMessage(), e); } @Override public void onSuccess(NewCall call, String response, int id) { Logger.info("response:{}", response); } }); ``` 3.百度搜索关键字'微信机器人' ``` Httpz.get(). url("http://www.baidu.com/s"). addParams("wd", "微信机器人"). addParams("tn", "baidu"). build(). execute(). string(); ``` 4.异步下载一张百度图片,有下载进度,保存为/tmp/tmp.jpg ``` String savePath = "tmp.jpg"; String imageUrl = "http://t7.baidu.com/it/u=3204887199,3790688592&fm=79&app=86&f=JPEG"; Httpz.newBuilder().addNetworkInterceptor(new FileInterceptor() { @Override public void updateProgress(long downloadLenth, long totalLength, boolean isFinish) { Logger.info("updateProgress downloadLenth:" + downloadLenth + ",totalLength:" + totalLength + ",isFinish:" + isFinish); } }).build(). get(). url(imageUrl). build(). executeAsync(new FileCallback(savePath) {//save file to /tmp/tmp.jpg @Override public void onFailure(NewCall call, Exception e, int id) { Logger.error(e.getMessage(), e); } @Override public void onSuccess(NewCall call, File file, int id) { Logger.info("filePath:" + file.getAbsolutePath()); } @Override public void onSuccess(NewCall call, InputStream fileStream, int id) { Logger.info("onSuccessWithInputStream"); } }); ``` 5.同步下载文件 ``` String savePath = "tmp.jpg"; String imageUrl = "http://t7.baidu.com/it/u=3204887199,3790688592&fm=79&app=86&f=JPEG"; InputStream is = Httpz.get().url(imageUrl).build().execute().byteStream(); ... ``` 6.上传文件 ``` String url = "https://www.xxx.com"; byte[] imageContent = FileKit.readBytes("/tmp/test.png"); Response response = FastHttpClient.post() .url(url) .addFile("file", "b.jpg", imageContent) .build() .execute(); System.out.println(response.body().string()); ``` 7.上传文件(通过文件流) ``` InputStream is = new FileInputStream("/tmp/logo.jpg"); HttpResponse response = Httpz.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .build() .post() .url("上传地址") .addFile("file", "logo.jpg", is) .build() .execute(); Logger.info(response.body().string()); ``` 8.设置网络代理 ``` Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 1088)); Authenticator.setDefault(new Authenticator(){//如果没有设置账号密码,则可以注释掉这块 private PasswordAuthentication authentication = new PasswordAuthentication("username","password".toCharArray()); @Override protected PasswordAuthentication getPasswordAuthentication(){ return authentication; } }); HttpResponse response = Httpz. newBuilder(). proxy(proxy). build(). get(). url("http://ip111.cn/"). build(). execute(); Logger.info(response.string()); ``` 9.设置Http头部信息 ``` String url="https://www.baidu.com"; HttpResponse response=Httpz. get(). addHeader("Referer","http://news.baidu.com/"). addHeader("cookie", "uin=test;skey=111111;"). url(url). build(). execute(); System.out.println(response.string()); ``` 9.设置https证书 ``` SSLContext sslContext = getxxx(); Response response = Httpz .get() .sslContext(sslContext) .url(url) .build() .execute(); System.out.println(response.toString()); ``` 10.自动携带Cookie进行请求 ``` private static class LocalCookieJar implements CookieJar { List<Cookie> cookies; @Override public List<Cookie> loadForRequest(UnoUrl arg0) { if (cookies != null) { return cookies; } return new ArrayList<>(); } @Override public void saveFromResponse(UnoUrl arg0, List<Cookie> cookies) { this.cookies = cookies; } } LocalCookieJar cookie = new LocalCookieJar(); Httpz.Client client = Httpz.newBuilder() .followRedirects(false) //禁制Httpd的重定向操作,我们自己处理重定向 .followSslRedirects(false) .cookieJar(cookie) //为Httpd设置自动携带Cookie的功能 .build(); String url = "https://www.baidu.com/"; client.get().addHeader("Referer", "https://www.baidu.com/").url(url) .build() .execute(); System.out.println(cookie.cookies); ``` 11.设置Content-Type为application/json ``` String url="https://wx.qq.com"; HttpResponse response=Httpz.post(). addHeader("Content-Type","application/json"). body("{\"username\":\"test\",\"password\":\"111111\"}"). url(url). build(). execute(); ``` 12.取消请求 ``` RequestCall call = Httpz.get(). url("https://www.baidu.com"). build(); HttpResponse response = call.execute(); call.cancel(); System.out.println(response.string()); ```
{ "pile_set_name": "Github" }
package io.ebeaninternal.dbmigration.ddlgeneration.platform; import io.ebean.config.DatabaseConfig; import io.ebean.config.dbplatform.DatabasePlatform; import io.ebean.config.dbplatform.DbPlatformType; import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer; import io.ebeaninternal.dbmigration.ddlgeneration.DdlHandler; import io.ebeaninternal.dbmigration.migration.AlterColumn; import java.io.IOException; import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; public abstract class AbstractHanaDdl extends PlatformDdl { private static final Pattern ARRAY_PATTERN = Pattern.compile("(\\w+)\\s*\\[\\s*\\]\\s*(\\(\\d+\\))?", Pattern.CASE_INSENSITIVE); public AbstractHanaDdl(DatabasePlatform platform) { super(platform); this.addColumn = "add ("; this.addColumnSuffix = ")"; this.alterColumn = "alter ("; this.alterColumnSuffix = ")"; this.columnDropDefault = " default null"; this.columnSetDefault = " default"; this.columnSetNotnull = " not null"; this.columnSetNull = " null"; this.dropColumn = "drop ("; this.dropColumnSuffix = ")"; this.dropConstraintIfExists = "drop constraint "; this.dropIndexIfExists = "drop index "; this.dropSequenceIfExists = "drop sequence "; this.dropTableCascade = " cascade"; this.dropTableIfExists = "drop table "; this.fallbackArrayType = "nvarchar(1000)"; this.historyDdl = new HanaHistoryDdl(); this.identitySuffix = " generated by default as identity"; } @Override public String alterColumnBaseAttributes(AlterColumn alter) { String tableName = alter.getTableName(); String columnName = alter.getColumnName(); String currentType = alter.getCurrentType(); String type = alter.getType() != null ? alter.getType() : currentType; type = convert(type); currentType = convert(currentType); boolean notnull = (alter.isNotnull() != null) ? alter.isNotnull() : Boolean.TRUE.equals(alter.isCurrentNotnull()); String notnullClause = notnull ? " not null" : ""; String defaultValue = DdlHelp.isDropDefault(alter.getDefaultValue()) ? "null" : (alter.getDefaultValue() != null ? alter.getDefaultValue() : alter.getCurrentDefaultValue()); String defaultValueClause = (defaultValue == null || defaultValue.isEmpty()) ? "" : " default " + defaultValue; try { DdlBuffer buffer = new BaseDdlBuffer(null); if (!isConvertible(currentType, type)) { // add an intermediate conversion if possible if (isNumberType(currentType)) { // numbers can always be converted to decimal buffer.append("alter table ").append(tableName).append(" ").append(alterColumn).append(" ").append(columnName) .append(" decimal ").append(defaultValueClause).append(notnullClause).append(alterColumnSuffix) .endOfStatement(); } else if (isStringType(currentType)) { // strings can always be converted to nclob buffer.append("alter table ").append(tableName).append(" ").append(alterColumn).append(" ").append(columnName) .append(" nclob ").append(defaultValueClause).append(notnullClause).append(alterColumnSuffix) .endOfStatement(); } } buffer.append("alter table ").append(tableName).append(" ").append(alterColumn).append(" ").append(columnName) .append(" ").append(type).append(defaultValueClause).append(notnullClause).append(alterColumnSuffix); return buffer.getBuffer(); } catch (IOException e) { throw new RuntimeException(e); } } @Override public String alterColumnDefaultValue(String tableName, String columnName, String defaultValue) { throw new UnsupportedOperationException(); } @Override public String alterColumnNotnull(String tableName, String columnName, boolean notnull) { return null; } @Override public DdlHandler createDdlHandler(DatabaseConfig config) { return new HanaDdlHandler(config, this); } @Override public String alterColumnType(String tableName, String columnName, String type) { return null; } @Override protected String convertArrayType(String logicalArrayType) { Matcher matcher = ARRAY_PATTERN.matcher(logicalArrayType); if (matcher.matches()) { return convert(matcher.group(1)) + " array" + (matcher.group(2) == null ? "" : matcher.group(2)); } else { return fallbackArrayType; } } @Override public String alterTableAddUniqueConstraint(String tableName, String uqName, String[] columns, String[] nullableColumns) { if (nullableColumns == null || nullableColumns.length == 0) { return super.alterTableAddUniqueConstraint(tableName, uqName, columns, nullableColumns); } else { return "-- cannot create unique index \"" + uqName + "\" on table \"" + tableName + "\" with nullable columns"; } } @Override public String alterTableDropUniqueConstraint(String tableName, String uniqueConstraintName) { DdlBuffer buffer = new BaseDdlBuffer(null); try { buffer.append("delimiter $$").newLine(); buffer.append("do").newLine(); buffer.append("begin").newLine(); buffer.append("declare exit handler for sql_error_code 397 begin end").endOfStatement(); buffer.append("exec 'alter table ").append(tableName).append(" ").append(dropUniqueConstraint).append(" ") .append(maxConstraintName(uniqueConstraintName)).append("'").endOfStatement(); buffer.append("end").endOfStatement(); buffer.append("$$"); return buffer.getBuffer(); } catch (IOException e) { throw new RuntimeException(e); } } @Override public String alterTableDropConstraint(String tableName, String constraintName) { return alterTableDropUniqueConstraint(tableName, constraintName); } /** * It is rather complex to delete a column on HANA as there must not exist any * foreign keys. That's why we call a user stored procedure here */ @Override public void alterTableDropColumn(DdlBuffer buffer, String tableName, String columnName) throws IOException { buffer.append("CALL usp_ebean_drop_column('").append(tableName).append("', '").append(columnName).append("')") .endOfStatement(); } /** * Check if a data type can be converted to another data type. Data types can't * be converted if the target type has a lower precision than the source type. * * @param sourceType The source data type * @param targetType the target data type * @return {@code true} if the type can be converted, {@code false} otherwise */ private boolean isConvertible(String sourceType, String targetType) { if (Objects.equals(sourceType, targetType)) { return true; } if (sourceType == null || targetType == null) { return true; } if ("bigint".equals(sourceType)) { if ("integer".equals(targetType) || "smallint".equals(targetType) || "tinyint".equals(targetType)) { return false; } } else if ("integer".equals(sourceType)) { if ("smallint".equals(targetType) || "tinyint".equals(targetType)) { return false; } } else if ("smallint".equals(sourceType)) { if ("tinyint".equals(targetType)) { return false; } } else if ("double".equals(sourceType)) { if ("real".equals(targetType)) { return false; } } DbPlatformType dbPlatformSourceType = DbPlatformType.parse(sourceType); if ("float".equals(dbPlatformSourceType.getName())) { if ("real".equals(targetType)) { return false; } } else if ("varchar".equals(dbPlatformSourceType.getName()) || "nvarchar".equals(dbPlatformSourceType.getName())) { DbPlatformType dbPlatformTargetType = DbPlatformType.parse(targetType); if ("varchar".equals(dbPlatformTargetType.getName()) || "nvarchar".equals(dbPlatformTargetType.getName())) { if (dbPlatformSourceType.getDefaultLength() > dbPlatformTargetType.getDefaultLength()) { return false; } } } else if ("decimal".equals(dbPlatformSourceType.getName())) { DbPlatformType dbPlatformTargetType = DbPlatformType.parse(targetType); if ("decimal".equals(dbPlatformTargetType.getName())) { if (dbPlatformSourceType.getDefaultLength() > dbPlatformTargetType.getDefaultLength() || dbPlatformSourceType.getDefaultScale() > dbPlatformTargetType.getDefaultScale()) { return false; } } } return true; } private boolean isNumberType(String type) { return type != null && ("bigint".equals(type) || "integer".equals(type) || "smallint".equals(type) || "tinyint".equals(type) || type.startsWith("float") || "real".equals(type) || "double".equals(type) || type.startsWith("decimal")); } private boolean isStringType(String type) { return type != null && (type.startsWith("varchar") || type.startsWith("nvarchar") || "clob".equals(type) || "nclob".equals(type)); } }
{ "pile_set_name": "Github" }
source "https://rubygems.org" gem "rake"
{ "pile_set_name": "Github" }
<%~ %% date: 10/21/2006 -author("Yariv Sadan"). -import(widgets, [foo/1, bar/2, baz/3]). %> <%! This is a sample ErlTL template that renders a list of albums %> <html> <body> <% [album(A) || A <- Data] %> </body> </html> <%@ album({Title, Artist, Songs}) %> Title: <b><% Title %></b><br> Artist: <b><% Artist %></b><br> Songs: <br> <table> <% [song(Number, Name) || {Number, Name} <- Songs] %> </table> <%@ song(Number, Name) when size(Name) > 15 %> <%? <<First:13/binary, Rest/binary>> = Name %> <% song(Number, [First, <<"...">>]) %> <%@ song(Number, Name) %> <%? Class = case Number rem 2 of 0 -> <<"even">>; 1 -> <<"odd">> end %> <tr> <td class="<% Class %>"><% integer_to_list(Number) %></td> <td class="<% Class %>"><% Name %></td> </tr>
{ "pile_set_name": "Github" }
#ifndef ES1_GLEXT_H_GUARD #define ES1_GLEXT_H_GUARD #include <OpenGLES/ES1/gl.h> #include <OpenGLES/OpenGLESAvailability.h> #ifdef __cplusplus extern "C" { #endif /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free ** Software License B, Version 1.0 (the "License"), the contents of this ** file are subject only to the provisions of the License. You may not use ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: ** ** http://oss.sgi.com/projects/FreeB ** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. ** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. ** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X ** Window System(R) (Version 1.3), released October 19, 1998. This software ** was created using the OpenGL(R) version 1.2.1 Sample Implementation ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ #define GL_APPLE_copy_texture_levels 1 #define GL_APPLE_framebuffer_multisample 1 #define GL_APPLE_texture_2D_limited_npot 1 #define GL_APPLE_texture_format_BGRA8888 1 #define GL_APPLE_texture_max_level 1 #define GL_EXT_blend_minmax 1 #define GL_EXT_debug_label 1 #define GL_EXT_debug_marker 1 #define GL_EXT_discard_framebuffer 1 #define GL_EXT_map_buffer_range 1 #define GL_EXT_read_format_bgra 1 #define GL_EXT_texture_filter_anisotropic 1 #define GL_EXT_texture_lod_bias 1 #define GL_EXT_texture_storage 1 #define GL_IMG_read_format 1 #define GL_IMG_texture_compression_pvrtc 1 #define GL_OES_blend_equation_separate 1 #define GL_OES_blend_func_separate 1 #define GL_OES_blend_subtract 1 #define GL_OES_depth24 1 #define GL_OES_element_index_uint 1 #define GL_OES_fbo_render_mipmap 1 #define GL_OES_framebuffer_object 1 #define GL_OES_mapbuffer 1 #define GL_OES_packed_depth_stencil 1 #define GL_OES_rgb8_rgba8 1 #define GL_OES_stencil_wrap 1 #define GL_OES_stencil8 1 #define GL_OES_texture_mirrored_repeat 1 #define GL_OES_vertex_array_object 1 /*------------------------------------------------------------------------* * APPLE extension tokens *------------------------------------------------------------------------*/ #if GL_APPLE_framebuffer_multisample #define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 #define GL_MAX_SAMPLES_APPLE 0x8D57 #define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 #define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 #define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 #define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA #endif #if GL_APPLE_texture_format_BGRA8888 #define GL_BGRA_EXT 0x80E1 #endif #if GL_APPLE_texture_format_BGRA8888 || GL_IMG_read_format #define GL_BGRA 0x80E1 #endif #if GL_APPLE_texture_max_level #define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D #endif /*------------------------------------------------------------------------* * EXT extension tokens *------------------------------------------------------------------------*/ #if GL_EXT_blend_minmax #define GL_MIN_EXT 0x8007 #define GL_MAX_EXT 0x8008 #endif #if GL_EXT_debug_label #define GL_BUFFER_OBJECT_EXT 0x9151 #define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 #endif #if GL_EXT_discard_framebuffer #define GL_COLOR_EXT 0x1800 #define GL_DEPTH_EXT 0x1801 #define GL_STENCIL_EXT 0x1802 #endif #if GL_EXT_map_buffer_range #define GL_MAP_READ_BIT_EXT 0x0001 #define GL_MAP_WRITE_BIT_EXT 0x0002 #define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 #define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 #define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 #define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 #endif #if GL_EXT_read_format_bgra #define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 #endif #if GL_EXT_read_format_bgra || GL_IMG_read_format #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 #endif #if GL_EXT_texture_filter_anisotropic #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #endif #if GL_EXT_texture_lod_bias #define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD #define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 #define GL_TEXTURE_LOD_BIAS_EXT 0x8501 #endif #if GL_EXT_texture_storage #define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F #define GL_ALPHA8_EXT 0x803C #define GL_LUMINANCE8_EXT 0x8040 #define GL_LUMINANCE8_ALPHA8_EXT 0x8045 #define GL_BGRA8_EXT 0x93A1 #endif /*------------------------------------------------------------------------* * IMG extension tokens *------------------------------------------------------------------------*/ #if GL_IMG_read_format #define GL_BGRA_IMG 0x80E1 #define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 #endif #if GL_IMG_texture_compression_pvrtc #define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 #define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 #endif /*------------------------------------------------------------------------* * OES extension tokens *------------------------------------------------------------------------*/ #if GL_OES_blend_equation_separate #define GL_BLEND_EQUATION_RGB_OES 0x8009 #define GL_BLEND_EQUATION_ALPHA_OES 0x883D #endif #if GL_OES_blend_func_separate #define GL_BLEND_DST_RGB_OES 0x80C8 #define GL_BLEND_SRC_RGB_OES 0x80C9 #define GL_BLEND_DST_ALPHA_OES 0x80CA #define GL_BLEND_SRC_ALPHA_OES 0x80CB #endif #if GL_OES_blend_subtract #define GL_BLEND_EQUATION_OES 0x8009 #define GL_FUNC_ADD_OES 0x8006 #define GL_FUNC_SUBTRACT_OES 0x800A #define GL_FUNC_REVERSE_SUBTRACT_OES 0x800B #endif #if GL_OES_depth24 #define GL_DEPTH_COMPONENT24_OES 0x81A6 #endif #if GL_OES_element_index_uint #define GL_UNSIGNED_INT_OES 0x1405 #endif #if GL_OES_framebuffer_object #define GL_FRAMEBUFFER_OES 0x8D40 #define GL_RENDERBUFFER_OES 0x8D41 #define GL_RGBA4_OES 0x8056 #define GL_RGB5_A1_OES 0x8057 #define GL_RGB565_OES 0x8D62 #define GL_DEPTH_COMPONENT16_OES 0x81A5 #define GL_RENDERBUFFER_WIDTH_OES 0x8D42 #define GL_RENDERBUFFER_HEIGHT_OES 0x8D43 #define GL_RENDERBUFFER_INTERNAL_FORMAT_OES 0x8D44 #define GL_RENDERBUFFER_RED_SIZE_OES 0x8D50 #define GL_RENDERBUFFER_GREEN_SIZE_OES 0x8D51 #define GL_RENDERBUFFER_BLUE_SIZE_OES 0x8D52 #define GL_RENDERBUFFER_ALPHA_SIZE_OES 0x8D53 #define GL_RENDERBUFFER_DEPTH_SIZE_OES 0x8D54 #define GL_RENDERBUFFER_STENCIL_SIZE_OES 0x8D55 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES 0x8CD0 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES 0x8CD1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES 0x8CD2 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES 0x8CD3 #define GL_COLOR_ATTACHMENT0_OES 0x8CE0 #define GL_DEPTH_ATTACHMENT_OES 0x8D00 #define GL_STENCIL_ATTACHMENT_OES 0x8D20 #define GL_FRAMEBUFFER_COMPLETE_OES 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES 0x8CD7 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES 0x8CD9 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES 0x8CDA #define GL_FRAMEBUFFER_UNSUPPORTED_OES 0x8CDD #define GL_FRAMEBUFFER_BINDING_OES 0x8CA6 #define GL_RENDERBUFFER_BINDING_OES 0x8CA7 #define GL_MAX_RENDERBUFFER_SIZE_OES 0x84E8 #define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506 #endif #if GL_OES_mapbuffer #define GL_WRITE_ONLY_OES 0x88B9 #define GL_BUFFER_ACCESS_OES 0x88BB #define GL_BUFFER_MAPPED_OES 0x88BC #define GL_BUFFER_MAP_POINTER_OES 0x88BD #endif #if GL_OES_packed_depth_stencil #define GL_DEPTH_STENCIL_OES 0x84F9 #define GL_UNSIGNED_INT_24_8_OES 0x84FA #define GL_DEPTH24_STENCIL8_OES 0x88F0 #endif #if GL_OES_rgb8_rgba8 #define GL_RGB8_OES 0x8051 #define GL_RGBA8_OES 0x8058 #endif #if GL_OES_stencil_wrap #define GL_INCR_WRAP_OES 0x8507 #define GL_DECR_WRAP_OES 0x8508 #endif #if GL_OES_stencil8 #define GL_STENCIL_INDEX8_OES 0x8D48 #endif #if GL_OES_texture_mirrored_repeat #define GL_MIRRORED_REPEAT_OES 0x8370 #endif #if GL_OES_vertex_array_object #define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 #endif /**************************************************************************/ /*------------------------------------------------------------------------* * APPLE extension functions *------------------------------------------------------------------------*/ #if GL_APPLE_copy_texture_levels GL_API GLvoid glCopyTextureLevelsAPPLE(GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount) OPENGLES_DEPRECATED(ios(6.0, 12.0), tvos(9.0, 12.0)); #endif #if GL_APPLE_framebuffer_multisample GL_API GLvoid glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) OPENGLES_DEPRECATED(ios(4.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid glResolveMultisampleFramebufferAPPLE(void) ; #endif /*------------------------------------------------------------------------* * EXT extension functions *------------------------------------------------------------------------*/ #if GL_EXT_debug_label GL_API GLvoid glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const char *label) OPENGLES_DEPRECATED(ios(5.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, char *label) OPENGLES_DEPRECATED(ios(5.0, 12.0), tvos(9.0, 12.0)); #endif #if GL_EXT_debug_marker GL_API GLvoid glInsertEventMarkerEXT(GLsizei length, const char *marker) OPENGLES_DEPRECATED(ios(5.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid glPushGroupMarkerEXT(GLsizei length, const char *marker) OPENGLES_DEPRECATED(ios(5.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid glPopGroupMarkerEXT(void) OPENGLES_DEPRECATED(ios(5.0, 12.0), tvos(9.0, 12.0)); #endif #if GL_EXT_discard_framebuffer GL_API GLvoid GL_APIENTRY glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments) OPENGLES_DEPRECATED(ios(4.0, 12.0), tvos(9.0, 12.0)); #endif #if GL_EXT_map_buffer_range GL_API GLvoid *glMapBufferRangeEXT(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) OPENGLES_DEPRECATED(ios(6.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid glFlushMappedBufferRangeEXT(GLenum target, GLintptr offset, GLsizeiptr length) OPENGLES_DEPRECATED(ios(6.0, 12.0), tvos(9.0, 12.0)); #endif #if GL_EXT_texture_storage GL_API GLvoid glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) OPENGLES_DEPRECATED(ios(6.0, 12.0), tvos(9.0, 12.0)); #endif /*------------------------------------------------------------------------* * OES extension functions *------------------------------------------------------------------------*/ #if GL_OES_blend_equation_separate GL_API GLvoid GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha) OPENGLES_DEPRECATED(ios(3.1, 12.0), tvos(9.0, 12.0)); #endif #if GL_OES_blend_func_separate GL_API GLvoid GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) OPENGLES_DEPRECATED(ios(3.1, 12.0), tvos(9.0, 12.0)); #endif #if GL_OES_blend_subtract GL_API GLvoid GL_APIENTRY glBlendEquationOES (GLenum mode); #endif #if GL_OES_framebuffer_object GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint* renderbuffers) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint* renderbuffers) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint* params) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint* framebuffers) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint* framebuffers) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint* params) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid GL_APIENTRY glGenerateMipmapOES (GLenum target) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); #endif #if GL_OES_mapbuffer GL_API GLvoid GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid **params) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid * GL_APIENTRY glMapBufferOES (GLenum target, GLenum access) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target) OPENGLES_DEPRECATED(ios(2.0, 12.0), tvos(9.0, 12.0)); #endif #if GL_OES_vertex_array_object GL_API GLvoid glBindVertexArrayOES(GLuint array) OPENGLES_DEPRECATED(ios(4.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays) OPENGLES_DEPRECATED(ios(4.0, 12.0), tvos(9.0, 12.0)); GL_API GLvoid glGenVertexArraysOES(GLsizei n, GLuint *arrays) OPENGLES_DEPRECATED(ios(4.0, 12.0), tvos(9.0, 12.0)); GL_API GLboolean glIsVertexArrayOES(GLuint array) OPENGLES_DEPRECATED(ios(4.0, 12.0), tvos(9.0, 12.0)); #endif #ifdef __cplusplus } #endif #endif /* ES1_GLEXT_H_GUARD */
{ "pile_set_name": "Github" }
<?php /** * AdditionalPropertiesString * * PHP version 7.2 * * @category Class * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech */ /** * OpenAPI Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.0.0-SNAPSHOT */ /** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ namespace OpenAPI\Client\Model; use \ArrayAccess; use \OpenAPI\Client\ObjectSerializer; /** * AdditionalPropertiesString Class Doc Comment * * @category Class * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech */ class AdditionalPropertiesString implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ protected static $openAPIModelName = 'AdditionalPropertiesString'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $openAPITypes = [ 'name' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] */ protected static $openAPIFormats = [ 'name' => null ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ public static function openAPITypes() { return self::$openAPITypes; } /** * Array of property to format mappings. Used for (de)serialization * * @return array */ public static function openAPIFormats() { return self::$openAPIFormats; } /** * Array of attributes where the key is the local name, * and the value is the original name * * @var string[] */ protected static $attributeMap = [ 'name' => 'name' ]; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = [ 'name' => 'setName' ]; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = [ 'name' => 'getName' ]; /** * Array of attributes where the key is the local name, * and the value is the original name * * @return array */ public static function attributeMap() { return self::$attributeMap; } /** * Array of attributes to setter functions (for deserialization of responses) * * @return array */ public static function setters() { return self::$setters; } /** * Array of attributes to getter functions (for serialization of requests) * * @return array */ public static function getters() { return self::$getters; } /** * The original name of the model. * * @return string */ public function getModelName() { return self::$openAPIModelName; } /** * Associative array for storing property values * * @var mixed[] */ protected $container = []; /** * Constructor * * @param mixed[] $data Associated array of property values * initializing the model */ public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; } /** * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { $invalidProperties = parent::listInvalidProperties(); return $invalidProperties; } /** * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { return count($this->listInvalidProperties()) === 0; } /** * Gets name * * @return string|null */ public function getName() { return $this->container['name']; } /** * Sets name * * @param string|null $name name * * @return $this */ public function setName($name) { $this->container['name'] = $name; return $this; } /** * Returns true if offset exists. False otherwise. * * @param integer $offset Offset * * @return boolean */ public function offsetExists($offset) { return isset($this->container[$offset]); } /** * Gets offset. * * @param integer $offset Offset * * @return mixed */ public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * * @param integer $offset Offset * @param mixed $value Value to be set * * @return void */ public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } /** * Unsets offset. * * @param integer $offset Offset * * @return void */ public function offsetUnset($offset) { unset($this->container[$offset]); } /** * Gets the string presentation of the object * * @return string */ public function __toString() { return json_encode( ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT ); } /** * Gets a header-safe presentation of the object * * @return string */ public function toHeaderValue() { return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title></title> <link rel="Stylesheet" href="../css/analysis.css" /> <script type="text/javascript"> function init() { if (window.location.hash) { var parentDiv, nodes, i, helpInfo, helpId, helpInfoArr, helpEnvFilter, envContent, hideEnvClass, hideNodes; helpInfo = window.location.hash.substring(1); if(helpInfo.indexOf("-")) { helpInfoArr = helpInfo.split("-"); helpId = helpInfoArr[0]; helpEnvFilter = helpInfoArr[1]; } else { helpId = helpInfo; } parentDiv = document.getElementById("topics"); nodes = parentDiv.children; hideEnvClass = (helpEnvFilter === "OnlineOnly"? "PortalOnly": "OnlineOnly"); if(document.getElementsByClassName) { hideNodes = document.getElementsByClassName(hideEnvClass); } else { hideNodes = document.querySelectorAll(hideEnvClass); } for(i=0; i < nodes.length; i++) { if(nodes[i].id !== helpId) { nodes[i].style.display ="none"; } } for(i=0; i < hideNodes.length; i++) { hideNodes[i].style.display ="none"; } } } </script> </head> <body onload="init()"> <div id="topics"> <div id="toolDescription" class="smallsize"> <h2>Izreži sloj</h2><p/> <h2><img src="../images/GUID-3F6A1ED7-A7F5-4F5C-BB2A-5D94403F2230-web.png" alt="Izreži sloj"></h2> <hr/> <p>Alat Izreži sloj izdvaja ulazne točkaste, linijske ili poligonalne geoobjekte koji prekrivaju područja isječaka. Izlazna je vrijednost podskup va&scaron;ih ulaznih podataka na temelju područja interesa. Slijede primjeri korisnosti alata: <ul> <li>Koje su velike rijeke u državi Nebraska? </li> <li>Koje su kuće u obalnoj poplavnoj zoni? </li> <li>Koji su uragani do&scaron;li do kopna 2011. godine? </li> </ul> </p> </div> <!--Parameter divs for each param--> <div id="inputLayer"> <div><h2>Izaberite geoobjekte za izrezivanje</h2></div> <hr/> <div> <p>Točkasti, linijski ili poligonalni sloj koji će se izrezati. Izradit ćete podskup tih geoobjekata. </p> <p>Osim odabira sloja s va&scaron;e karte, možete odabrati <b>Izaberi sloj za analizu</b> na dnu padajućeg popisa za pretraživanje va&scaron;ih sadržaja za skup podataka za dijeljenje datoteka velikih podataka ili sloj geoobjekta. Dodatno možete primijeniti filtar na sloj unosa ili primijeniti odabir na hostiranim slojevima koji su dodani va&scaron;oj karti. Filtri i odabiri samo se primjenjuju za analizu. </p> </div> </div> <div id="clipLayer"> <div><h2>Izaberite odredište za izrezivanje</h2></div> <hr/> <div> <p>Poligonalni sloj na koji ćete prikvačiti ulazne slojeve geoobjekata. Ta područja određuju granice podskupa. </p> <p>Osim odabira sloja s va&scaron;e karte, možete odabrati <b>Izaberi sloj za analizu</b> na dnu padajućeg popisa za pretraživanje va&scaron;ih sadržaja za skup podataka za dijeljenje datoteka velikih podataka ili sloj geoobjekta. Dodatno možete primijeniti filtar na sloj unosa ili primijeniti odabir na hostiranim slojevima koji su dodani va&scaron;oj karti. Filtri i odabiri samo se primjenjuju za analizu. </p> </div> </div> <div id="outputName"> <div><h2>Naziv sloja rezultata</h2></div> <hr/> <div> <p> Naziv sloja koji će se stvoriti. Ako pi&scaron;ete na ArcGIS Data Store, va&scaron;i će se rezultati spremiti u <b>Mojem sadržaju</b> i dodati karti. Ako pi&scaron;ete na dijeljenje datoteka velikih podataka, va&scaron;i će se rezultati pohraniti u dijeljenje datoteka velikih podataka i dodati u manifest. Neće se dodati karti. Zadani naziv temelji se na nazivu alata i nazivu sloja unosa. Ako sloj već postoji, alat neće biti uspje&scaron;an. </p> <p>Kada pi&scaron;ete na ArcGIS Data Store (relacijski ili prostorno-vremenski spremnik velikih podataka), upotrebom padajućeg izbornika <b>Spremi rezultat u</b> možete odrediti naziv mape u dijelu <b>Moj sadržaj</b> gdje će se spremiti rezultat. </p> </div> </div> </div> </html>
{ "pile_set_name": "Github" }
/****************************************************************************** * * This file is provided under a dual BSD/GPLv2 license. When using or * redistributing this file, you may do so under either license. * * GPL LICENSE SUMMARY * * Copyright(c) 2017 Intel Deutschland GmbH * Copyright(c) 2018 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License 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 * General Public License for more details. * * BSD LICENSE * * Copyright(c) 2017 Intel Deutschland GmbH * Copyright(c) 2018 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *****************************************************************************/ #include "iwl-trans.h" #include "iwl-prph.h" #include "iwl-context-info.h" #include "iwl-context-info-gen3.h" #include "internal.h" /* * Start up NIC's basic functionality after it has been reset * (e.g. after platform boot, or shutdown via iwl_pcie_apm_stop()) * NOTE: This does not load uCode nor start the embedded processor */ static int iwl_pcie_gen2_apm_init(struct iwl_trans *trans) { int ret = 0; IWL_DEBUG_INFO(trans, "Init card's basic functions\n"); /* * Use "set_bit" below rather than "write", to preserve any hardware * bits already set by default after reset. */ /* * Disable L0s without affecting L1; * don't wait for ICH L0s (ICH bug W/A) */ iwl_set_bit(trans, CSR_GIO_CHICKEN_BITS, CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX); /* Set FH wait threshold to maximum (HW error during stress W/A) */ iwl_set_bit(trans, CSR_DBG_HPET_MEM_REG, CSR_DBG_HPET_MEM_REG_VAL); /* * Enable HAP INTA (interrupt from management bus) to * wake device's PCI Express link L1a -> L0s */ iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG, CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A); iwl_pcie_apm_config(trans); /* * Set "initialization complete" bit to move adapter from * D0U* --> D0A* (powered-up active) state. */ iwl_set_bit(trans, CSR_GP_CNTRL, BIT(trans->cfg->csr->flag_init_done)); /* * Wait for clock stabilization; once stabilized, access to * device-internal resources is supported, e.g. iwl_write_prph() * and accesses to uCode SRAM. */ ret = iwl_poll_bit(trans, CSR_GP_CNTRL, BIT(trans->cfg->csr->flag_mac_clock_ready), BIT(trans->cfg->csr->flag_mac_clock_ready), 25000); if (ret < 0) { IWL_DEBUG_INFO(trans, "Failed to init the card\n"); return ret; } set_bit(STATUS_DEVICE_ENABLED, &trans->status); return 0; } static void iwl_pcie_gen2_apm_stop(struct iwl_trans *trans, bool op_mode_leave) { IWL_DEBUG_INFO(trans, "Stop card, put in low power state\n"); if (op_mode_leave) { if (!test_bit(STATUS_DEVICE_ENABLED, &trans->status)) iwl_pcie_gen2_apm_init(trans); /* inform ME that we are leaving */ iwl_set_bit(trans, CSR_DBG_LINK_PWR_MGMT_REG, CSR_RESET_LINK_PWR_MGMT_DISABLED); iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG, CSR_HW_IF_CONFIG_REG_PREPARE | CSR_HW_IF_CONFIG_REG_ENABLE_PME); mdelay(1); iwl_clear_bit(trans, CSR_DBG_LINK_PWR_MGMT_REG, CSR_RESET_LINK_PWR_MGMT_DISABLED); mdelay(5); } clear_bit(STATUS_DEVICE_ENABLED, &trans->status); /* Stop device's DMA activity */ iwl_pcie_apm_stop_master(trans); iwl_trans_sw_reset(trans); /* * Clear "initialization complete" bit to move adapter from * D0A* (powered-up Active) --> D0U* (Uninitialized) state. */ iwl_clear_bit(trans, CSR_GP_CNTRL, BIT(trans->cfg->csr->flag_init_done)); } void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans, bool low_power) { struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); lockdep_assert_held(&trans_pcie->mutex); if (trans_pcie->is_down) return; trans_pcie->is_down = true; /* Stop dbgc before stopping device */ iwl_write_prph(trans, DBGC_IN_SAMPLE, 0); udelay(100); iwl_write_prph(trans, DBGC_OUT_CTRL, 0); /* tell the device to stop sending interrupts */ iwl_disable_interrupts(trans); /* device going down, Stop using ICT table */ iwl_pcie_disable_ict(trans); /* * If a HW restart happens during firmware loading, * then the firmware loading might call this function * and later it might be called again due to the * restart. So don't process again if the device is * already dead. */ if (test_and_clear_bit(STATUS_DEVICE_ENABLED, &trans->status)) { IWL_DEBUG_INFO(trans, "DEVICE_ENABLED bit was set and is now cleared\n"); iwl_pcie_gen2_tx_stop(trans); iwl_pcie_rx_stop(trans); } iwl_pcie_ctxt_info_free_paging(trans); if (trans->cfg->device_family == IWL_DEVICE_FAMILY_22560) iwl_pcie_ctxt_info_gen3_free(trans); else iwl_pcie_ctxt_info_free(trans); /* Make sure (redundant) we've released our request to stay awake */ iwl_clear_bit(trans, CSR_GP_CNTRL, BIT(trans->cfg->csr->flag_mac_access_req)); /* Stop the device, and put it in low power state */ iwl_pcie_gen2_apm_stop(trans, false); iwl_trans_sw_reset(trans); /* * Upon stop, the IVAR table gets erased, so msi-x won't * work. This causes a bug in RF-KILL flows, since the interrupt * that enables radio won't fire on the correct irq, and the * driver won't be able to handle the interrupt. * Configure the IVAR table again after reset. */ iwl_pcie_conf_msix_hw(trans_pcie); /* * Upon stop, the APM issues an interrupt if HW RF kill is set. * This is a bug in certain verions of the hardware. * Certain devices also keep sending HW RF kill interrupt all * the time, unless the interrupt is ACKed even if the interrupt * should be masked. Re-ACK all the interrupts here. */ iwl_disable_interrupts(trans); /* clear all status bits */ clear_bit(STATUS_SYNC_HCMD_ACTIVE, &trans->status); clear_bit(STATUS_INT_ENABLED, &trans->status); clear_bit(STATUS_TPOWER_PMI, &trans->status); /* * Even if we stop the HW, we still want the RF kill * interrupt */ iwl_enable_rfkill_int(trans); /* re-take ownership to prevent other users from stealing the device */ iwl_pcie_prepare_card_hw(trans); } void iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans, bool low_power) { struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); bool was_in_rfkill; mutex_lock(&trans_pcie->mutex); trans_pcie->opmode_down = true; was_in_rfkill = test_bit(STATUS_RFKILL_OPMODE, &trans->status); _iwl_trans_pcie_gen2_stop_device(trans, low_power); iwl_trans_pcie_handle_stop_rfkill(trans, was_in_rfkill); mutex_unlock(&trans_pcie->mutex); } static int iwl_pcie_gen2_nic_init(struct iwl_trans *trans) { struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); /* TODO: most of the logic can be removed in A0 - but not in Z0 */ spin_lock(&trans_pcie->irq_lock); iwl_pcie_gen2_apm_init(trans); spin_unlock(&trans_pcie->irq_lock); iwl_op_mode_nic_config(trans->op_mode); /* Allocate the RX queue, or reset if it is already allocated */ if (iwl_pcie_gen2_rx_init(trans)) return -ENOMEM; /* Allocate or reset and init all Tx and Command queues */ if (iwl_pcie_gen2_tx_init(trans)) return -ENOMEM; /* enable shadow regs in HW */ iwl_set_bit(trans, CSR_MAC_SHADOW_REG_CTRL, 0x800FFFFF); IWL_DEBUG_INFO(trans, "Enabling shadow registers in device\n"); return 0; } void iwl_trans_pcie_gen2_fw_alive(struct iwl_trans *trans, u32 scd_addr) { struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); iwl_pcie_reset_ict(trans); /* make sure all queue are not stopped/used */ memset(trans_pcie->queue_stopped, 0, sizeof(trans_pcie->queue_stopped)); memset(trans_pcie->queue_used, 0, sizeof(trans_pcie->queue_used)); /* now that we got alive we can free the fw image & the context info. * paging memory cannot be freed included since FW will still use it */ iwl_pcie_ctxt_info_free(trans); /* * Re-enable all the interrupts, including the RF-Kill one, now that * the firmware is alive. */ iwl_enable_interrupts(trans); mutex_lock(&trans_pcie->mutex); iwl_pcie_check_hw_rf_kill(trans); mutex_unlock(&trans_pcie->mutex); } int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans, const struct fw_img *fw, bool run_in_rfkill) { struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); bool hw_rfkill; int ret; /* This may fail if AMT took ownership of the device */ if (iwl_pcie_prepare_card_hw(trans)) { IWL_WARN(trans, "Exit HW not ready\n"); ret = -EIO; goto out; } iwl_enable_rfkill_int(trans); iwl_write32(trans, CSR_INT, 0xFFFFFFFF); /* * We enabled the RF-Kill interrupt and the handler may very * well be running. Disable the interrupts to make sure no other * interrupt can be fired. */ iwl_disable_interrupts(trans); /* Make sure it finished running */ iwl_pcie_synchronize_irqs(trans); mutex_lock(&trans_pcie->mutex); /* If platform's RF_KILL switch is NOT set to KILL */ hw_rfkill = iwl_pcie_check_hw_rf_kill(trans); if (hw_rfkill && !run_in_rfkill) { ret = -ERFKILL; goto out; } /* Someone called stop_device, don't try to start_fw */ if (trans_pcie->is_down) { IWL_WARN(trans, "Can't start_fw since the HW hasn't been started\n"); ret = -EIO; goto out; } /* make sure rfkill handshake bits are cleared */ iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); /* clear (again), then enable host interrupts */ iwl_write32(trans, CSR_INT, 0xFFFFFFFF); ret = iwl_pcie_gen2_nic_init(trans); if (ret) { IWL_ERR(trans, "Unable to init nic\n"); goto out; } if (trans->cfg->device_family == IWL_DEVICE_FAMILY_22560) ret = iwl_pcie_ctxt_info_gen3_init(trans, fw); else ret = iwl_pcie_ctxt_info_init(trans, fw); if (ret) goto out; /* re-check RF-Kill state since we may have missed the interrupt */ hw_rfkill = iwl_pcie_check_hw_rf_kill(trans); if (hw_rfkill && !run_in_rfkill) ret = -ERFKILL; out: mutex_unlock(&trans_pcie->mutex); return ret; }
{ "pile_set_name": "Github" }
# TPC-H Data Setup This is a step-by-step guide for setting up TPC-H data in different databases. This guide will use 1GB data. This guide assumes you have basic knowledge about issuing commands in a terminal application. ## Download Data Go to your work directory (say `/home/username/workspace`) and download the data: ```bash $ cd /home/username/workspace $ curl http://dbgroup-internal.eecs.umich.edu/projects/verdictdb/tpch1g.zip -o tpch1g.zip ``` Unzip the downloaded file: ```bash $ unzip tpch1g.zip ``` It will create a new directory named `tpch1g` under your work directory. The directory contains 8 sub-directories for each of 8 tables. ## MySQL ### Create tables Connect to your MySQL database. Make sure you have already added MySQL to your PATH. ```bash $ mysql --local-infile -h 127.0.0.1 -uroot ``` Create a schema for test. (In mysql shell) ```bash > create database tpch1g; > use tpch1g; ``` Create empty tables; simply copy and paste the following table definition statements into the MySQL shell. We will import the data later into these tables. ```sql -- nation CREATE TABLE IF NOT EXISTS tpch1g.nation ( `n_nationkey` INT, `n_name` CHAR(25), `n_regionkey` INT, `n_comment` VARCHAR(152), `n_dummy` VARCHAR(10), PRIMARY KEY (`n_nationkey`)); -- region CREATE TABLE IF NOT EXISTS tpch1g.region ( `r_regionkey` INT, `r_name` CHAR(25), `r_comment` VARCHAR(152), `r_dummy` VARCHAR(10), PRIMARY KEY (`r_regionkey`)); -- supplier CREATE TABLE IF NOT EXISTS tpch1g.supplier ( `s_suppkey` INT, `s_name` CHAR(25), `s_address` VARCHAR(40), `s_nationkey` INT, `s_phone` CHAR(15), `s_acctbal` DECIMAL(15,2), `s_comment` VARCHAR(101), `s_dummy` varchar(10), PRIMARY KEY (`s_suppkey`)); -- customer CREATE TABLE IF NOT EXISTS tpch1g.customer ( `c_custkey` INT, `c_name` VARCHAR(25), `c_address` VARCHAR(40), `c_nationkey` INT, `c_phone` CHAR(15), `c_acctbal` DECIMAL(15,2), `c_mktsegment` CHAR(10), `c_comment` VARCHAR(117), `c_dummy` VARCHAR(10), PRIMARY KEY (`c_custkey`)); -- part CREATE TABLE IF NOT EXISTS tpch1g.part ( `p_partkey` INT, `p_name` VARCHAR(55), `p_mfgr` CHAR(25), `p_brand` CHAR(10), `p_type` VARCHAR(25), `p_size` INT, `p_container` CHAR(10), `p_retailprice` DECIMAL(15,2) , `p_comment` VARCHAR(23) , `p_dummy` VARCHAR(10), PRIMARY KEY (`p_partkey`)); -- partsupp CREATE TABLE IF NOT EXISTS tpch1g.partsupp ( `ps_partkey` INT, `ps_suppkey` INT, `ps_availqty` INT, `ps_supplycost` DECIMAL(15,2), `ps_comment` VARCHAR(199), `ps_dummy` VARCHAR(10), PRIMARY KEY (`ps_partkey`)); -- orders CREATE TABLE IF NOT EXISTS tpch1g.orders ( `o_orderkey` INT, `o_custkey` INT, `o_orderstatus` CHAR(1), `o_totalprice` DECIMAL(15,2), `o_orderdate` DATE, `o_orderpriority` CHAR(15), `o_clerk` CHAR(15), `o_shippriority` INT, `o_comment` VARCHAR(79), `o_dummy` VARCHAR(10), PRIMARY KEY (`o_orderkey`)); -- lineitem CREATE TABLE IF NOT EXISTS tpch1g.lineitem ( `l_orderkey` INT, `l_partkey` INT, `l_suppkey` INT, `l_linenumber` INT, `l_quantity` DECIMAL(15,2), `l_extendedprice` DECIMAL(15,2), `l_discount` DECIMAL(15,2), `l_tax` DECIMAL(15,2), `l_returnflag` CHAR(1), `l_linestatus` CHAR(1), `l_shipdate` DATE, `l_commitdate` DATE, `l_receiptdate` DATE, `l_shipinstruct` CHAR(25), `l_shipmode` CHAR(10), `l_comment` VARCHAR(44), `l_dummy` VARCHAR(10)); ``` ### Import Data Suppose your work directory is `/home/username/workspace` and the tpch1g data is stored in `/home/username/workspace/tpch1g`. Then, issue the following commands in the MySQL shell to load the data. ```sql LOAD DATA LOCAL INFILE '/home/username/workspace/tpch1g/region/region.tbl' INTO TABLE region FIELDS TERMINATED BY '|'; LOAD DATA LOCAL INFILE '/home/username/workspace/tpch1g/nation/nation.tbl' INTO TABLE nation FIELDS TERMINATED BY '|'; LOAD DATA LOCAL INFILE '/home/username/workspace/tpch1g/customer/customer.tbl' INTO TABLE customer FIELDS TERMINATED BY '|'; LOAD DATA LOCAL INFILE '/home/username/workspace/tpch1g/supplier/supplier.tbl' INTO TABLE supplier FIELDS TERMINATED BY '|'; LOAD DATA LOCAL INFILE '/home/username/workspace/tpch1g/part/part.tbl' INTO TABLE part FIELDS TERMINATED BY '|'; LOAD DATA LOCAL INFILE '/home/username/workspace/tpch1g/partsupp/partsupp.tbl' INTO TABLE partsupp FIELDS TERMINATED BY '|'; LOAD DATA LOCAL INFILE '/home/username/workspace/tpch1g/orders/orders.tbl' INTO TABLE orders FIELDS TERMINATED BY '|'; LOAD DATA LOCAL INFILE '/home/username/workspace/tpch1g/lineitem/lineitem.tbl' INTO TABLE lineitem FIELDS TERMINATED BY '|'; ``` ## PostgreSQL ### Create tables Connect to your Postgresql database. ```bash $ psql ``` Create a schema for testing. ``` postgres=# create schema tpch1g; postgres=# set search_path to tpch1g; ``` Create empty tables; simply copy and paste the following table definition statements into the PostgreSQL prompt. We will import the data later into these tables. ```sql -- nation CREATE TABLE IF NOT EXISTS "nation" ( "n_nationkey" INT, "n_name" CHAR(25), "n_regionkey" INT, "n_comment" VARCHAR(152), "n_dummy" VARCHAR(10), PRIMARY KEY ("n_nationkey")); -- region CREATE TABLE IF NOT EXISTS "region" ( "r_regionkey" INT, "r_name" CHAR(25), "r_comment" VARCHAR(152), "r_dummy" VARCHAR(10), PRIMARY KEY ("r_regionkey")); -- supplier CREATE TABLE IF NOT EXISTS "supplier" ( "s_suppkey" INT, "s_name" CHAR(25), "s_address" VARCHAR(40), "s_nationkey" INT, "s_phone" CHAR(15), "s_acctbal" DECIMAL(15,2), "s_comment" VARCHAR(101), "s_dummy" VARCHAR(10), PRIMARY KEY ("s_suppkey")); -- customer CREATE TABLE IF NOT EXISTS "customer" ( "c_custkey" INT, "c_name" VARCHAR(25), "c_address" VARCHAR(40), "c_nationkey" INT, "c_phone" CHAR(15), "c_acctbal" DECIMAL(15,2), "c_mktsegment" CHAR(10), "c_comment" VARCHAR(117), "c_dummy" VARCHAR(10), PRIMARY KEY ("c_custkey")); -- part CREATE TABLE IF NOT EXISTS "part" ( "p_partkey" INT, "p_name" VARCHAR(55), "p_mfgr" CHAR(25), "p_brand" CHAR(10), "p_type" VARCHAR(25), "p_size" INT, "p_container" CHAR(10), "p_retailprice" DECIMAL(15,2) , "p_comment" VARCHAR(23) , "p_dummy" VARCHAR(10), PRIMARY KEY ("p_partkey")); -- partsupp CREATE TABLE IF NOT EXISTS "partsupp" ( "ps_partkey" INT, "ps_suppkey" INT, "ps_availqty" INT, "ps_supplycost" DECIMAL(15,2), "ps_comment" VARCHAR(199), "ps_dummy" VARCHAR(10), PRIMARY KEY ("ps_partkey")); -- orders CREATE TABLE IF NOT EXISTS "orders" ( "o_orderkey" INT, "o_custkey" INT, "o_orderstatus" CHAR(1), "o_totalprice" DECIMAL(15,2), "o_orderdate" DATE, "o_orderpriority" CHAR(15), "o_clerk" CHAR(15), "o_shippriority" INT, "o_comment" VARCHAR(79), "o_dummy" VARCHAR(10), PRIMARY KEY ("o_orderkey")); -- lineitem CREATE TABLE IF NOT EXISTS "lineitem"( "l_orderkey" INT, "l_partkey" INT, "l_suppkey" INT, "l_linenumber" INT, "l_quantity" DECIMAL(15,2), "l_extendedprice" DECIMAL(15,2), "l_discount" DECIMAL(15,2), "l_tax" DECIMAL(15,2), "l_returnflag" CHAR(1), "l_linestatus" CHAR(1), "l_shipdate" DATE, "l_commitdate" DATE, "l_receiptdate" DATE, "l_shipinstruct" CHAR(25), "l_shipmode" CHAR(10), "l_comment" VARCHAR(44), "l_dummy" VARCHAR(10)); ``` ### Import Data Suppose your work directory is `/home/username/workspace` and the tpch1g data is stored in `/home/username/workspace/tpch1g`. Then, issue the following commands in the PostgreSQL prompt to load the data. ```bash \copy "region" from '/home/username/workspace/tpch1g/region/region.tbl' DELIMITER '|' CSV; \copy "nation" from '/home/username/workspace/tpch1g/nation/nation.tbl' DELIMITER '|' CSV; \copy "customer" from '/home/username/workspace/tpch1g/customer/customer.tbl' DELIMITER '|' CSV; \copy "supplier" from '/home/username/workspace/tpch1g/supplier/supplier.tbl' DELIMITER '|' CSV; \copy "part" from '/home/username/workspace/tpch1g/part/part.tbl' DELIMITER '|' CSV; \copy "partsupp" from '/home/username/workspace/tpch1g/partsupp/partsupp.tbl' DELIMITER '|' CSV; \copy "orders" from '/home/username/workspace/tpch1g/orders/orders.tbl' DELIMITER '|' CSV; \copy "lineitem" from '/home/username/workspace/tpch1g/lineitem/lineitem.tbl' DELIMITER '|' CSV; ``` ## Apache Spark ### Put data to HDFS Use following commands to put data into HDFS. Suppose the tpch1g data is stored in `/home/username/workspace/tpch1g` and you hope to put your data in `/tmp/tpch1g` in HDFS. ```bash $ hdfs dfs -mkdir -p /tmp/tpch1g/region $ hdfs dfs -mkdir -p /tmp/tpch1g/nation $ hdfs dfs -mkdir -p /tmp/tpch1g/customer $ hdfs dfs -mkdir -p /tmp/tpch1g/supplier $ hdfs dfs -mkdir -p /tmp/tpch1g/part $ hdfs dfs -mkdir -p /tmp/tpch1g/partsupp $ hdfs dfs -mkdir -p /tmp/tpch1g/orders $ hdfs dfs -mkdir -p /tmp/tpch1g/lineitem $ hdfs dfs -put /home/username/workspace/tpch1g/region/region.tbl /tmp/tpch1g/region $ hdfs dfs -put /home/username/workspace/tpch1g/nation/nation.tbl /tmp/tpch1g/nation $ hdfs dfs -put /home/username/workspace/tpch1g/customer/customer.tbl /tmp/tpch1g/customer $ hdfs dfs -put /home/username/workspace/tpch1g/supplier/supplier.tbl /tmp/tpch1g/supplier $ hdfs dfs -put /home/username/workspace/tpch1g/part/part.tbl /tmp/tpch1g/part $ hdfs dfs -put /home/username/workspace/tpch1g/partsupp/partsupp.tbl /tmp/tpch1g/partsupp $ hdfs dfs -put /home/username/workspace/tpch1g/orders/orders.tbl /tmp/tpch1g/orders $ hdfs dfs -put /home/username/workspace/tpch1g/lineitem/lineitem.tbl /tmp/tpch1g/lineitem ``` If you encounter write permission problem in the next step when creating tables, you can use command ```bash $ hdfs dfs -chmod -R 777 /tmp/tpch1g ``` to give full access to your directory. ### Create table and load data Simply copy and paste following queries to spark to set up TPC-H tables. ```sql -- nation CREATE TABLE IF NOT EXISTS nation ( `n_nationkey` INT, `n_name` CHAR(25), `n_regionkey` INT, `n_comment` VARCHAR(152), `n_dummy` VARCHAR(10)) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tmp/tpch1g/nation/nation'; -- region CREATE TABLE IF NOT EXISTS region ( `r_regionkey` INT, `r_name` CHAR(25), `r_comment` VARCHAR(152), `r_dummy` VARCHAR(10)) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tmp/tpch1g/region/region'; -- supplier CREATE TABLE IF NOT EXISTS supplier ( `s_suppkey` INT, `s_name` CHAR(25), `s_address` VARCHAR(40), `s_nationkey` INT, `s_phone` CHAR(15), `s_acctbal` DECIMAL(15,2), `s_comment` VARCHAR(101), `s_dummy` varchar(10)) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tmp/tpch1g/supplier/supplier'; -- customer CREATE TABLE IF NOT EXISTS customer ( `c_custkey` INT, `c_name` VARCHAR(25), `c_address` VARCHAR(40), `c_nationkey` INT, `c_phone` CHAR(15), `c_acctbal` DECIMAL(15,2), `c_mktsegment` CHAR(10), `c_comment` VARCHAR(117), `c_dummy` VARCHAR(10)) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tmp/tpch1g/customer/customer'; -- part CREATE TABLE IF NOT EXISTS part ( `p_partkey` INT, `p_name` VARCHAR(55), `p_mfgr` CHAR(25), `p_brand` CHAR(10), `p_type` VARCHAR(25), `p_size` INT, `p_container` CHAR(10), `p_retailprice` DECIMAL(15,2) , `p_comment` VARCHAR(23) , `p_dummy` VARCHAR(10)) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tmp/tpch1g/part/part'; -- partsupp CREATE TABLE IF NOT EXISTS partsupp ( `ps_partkey` INT, `ps_suppkey` INT, `ps_availqty` INT, `ps_supplycost` DECIMAL(15,2), `ps_comment` VARCHAR(199), `ps_dummy` VARCHAR(10)) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tmp/tpch1g/partsupp/partsupp'; -- orders CREATE TABLE IF NOT EXISTS orders ( `o_orderkey` INT, `o_custkey` INT, `o_orderstatus` CHAR(1), `o_totalprice` DECIMAL(15,2), `o_orderdate` DATE, `o_orderpriority` CHAR(15), `o_clerk` CHAR(15), `o_shippriority` INT, `o_comment` VARCHAR(79), `o_dummy` VARCHAR(10)) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tmp/tpch1g/orders/orders'; -- lineitem CREATE TABLE IF NOT EXISTS lineitem ( `l_orderkey` INT, `l_partkey` INT, `l_suppkey` INT, `l_linenumber` INT, `l_quantity` DECIMAL(15,2), `l_extendedprice` DECIMAL(15,2), `l_discount` DECIMAL(15,2), `l_tax` DECIMAL(15,2), `l_returnflag` CHAR(1), `l_linestatus` CHAR(1), `l_shipdate` DATE, `l_commitdate` DATE, `l_receiptdate` DATE, `l_shipinstruct` CHAR(25), `l_shipmode` CHAR(10), `l_comment` VARCHAR(44), `l_dummy` VARCHAR(10)) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tmp/tpch1g/lineitem/lineitem'; ``` ## Redshift ### Create tables Use SQL query tools like [SQL Workbench/J](http://www.sql-workbench.eu/) to connect with your Redshift Cluster. First, Create a schema for testing ```sql create schema "tpch1g"; ``` Then Create empty tables. ```sql -- nation CREATE TABLE IF NOT EXISTS "tpch1g"."nation" ( "n_nationkey" INT, "n_name" CHAR(25), "n_regionkey" INT, "n_comment" VARCHAR(152), "n_dummy" VARCHAR(10), PRIMARY KEY ("n_nationkey")); -- region CREATE TABLE IF NOT EXISTS "tpch1g"."region" ( "r_regionkey" INT, "r_name" CHAR(25), "r_comment" VARCHAR(152), "r_dummy" VARCHAR(10), PRIMARY KEY ("r_regionkey")); -- supplier CREATE TABLE IF NOT EXISTS "tpch1g"."supplier" ( "s_suppkey" INT, "s_name" CHAR(25), "s_address" VARCHAR(40), "s_nationkey" INT, "s_phone" CHAR(15), "s_acctbal" DECIMAL(15,2), "s_comment" VARCHAR(101), "s_dummy" VARCHAR(10), PRIMARY KEY ("s_suppkey")); -- customer CREATE TABLE IF NOT EXISTS "tpch1g"."customer" ( "c_custkey" INT, "c_name" VARCHAR(25), "c_address" VARCHAR(40), "c_nationkey" INT, "c_phone" CHAR(15), "c_acctbal" DECIMAL(15,2), "c_mktsegment" CHAR(10), "c_comment" VARCHAR(117), "c_dummy" VARCHAR(10), PRIMARY KEY ("c_custkey")); -- part CREATE TABLE IF NOT EXISTS "tpch1g"."part" ( "p_partkey" INT, "p_name" VARCHAR(55), "p_mfgr" CHAR(25), "p_brand" CHAR(10), "p_type" VARCHAR(25), "p_size" INT, "p_container" CHAR(10), "p_retailprice" DECIMAL(15,2) , "p_comment" VARCHAR(23) , "p_dummy" VARCHAR(10), PRIMARY KEY ("p_partkey")); -- partsupp CREATE TABLE IF NOT EXISTS "tpch1g"."partsupp" ( "ps_partkey" INT, "ps_suppkey" INT, "ps_availqty" INT, "ps_supplycost" DECIMAL(15,2), "ps_comment" VARCHAR(199), "ps_dummy" VARCHAR(10), PRIMARY KEY ("ps_partkey")); -- orders CREATE TABLE IF NOT EXISTS "tpch1g"."orders" ( "o_orderkey" INT, "o_custkey" INT, "o_orderstatus" CHAR(1), "o_totalprice" DECIMAL(15,2), "o_orderdate" DATE, "o_orderpriority" CHAR(15), "o_clerk" CHAR(15), "o_shippriority" INT, "o_comment" VARCHAR(79), "o_dummy" VARCHAR(10), PRIMARY KEY ("o_orderkey")); -- lineitem CREATE TABLE IF NOT EXISTS "tpch1g"."lineitem"( "l_orderkey" INT, "l_partkey" INT, "l_suppkey" INT, "l_linenumber" INT, "l_quantity" DECIMAL(15,2), "l_extendedprice" DECIMAL(15,2), "l_discount" DECIMAL(15,2), "l_tax" DECIMAL(15,2), "l_returnflag" CHAR(1), "l_linestatus" CHAR(1), "l_shipdate" DATE, "l_commitdate" DATE, "l_receiptdate" DATE, "l_shipinstruct" CHAR(25), "l_shipmode" CHAR(10), "l_comment" VARCHAR(44), "l_dummy" VARCHAR(10)); ``` ### Load Data For Redshift, we use Java method to help inserting our data into Redshift tables. `schema` is the Redshift schema you create your TPC-H tables and `table` is the table name of TPCH-table, such as `nation`, `region`. `conn` is the Connection class you get from connecting your Redshift cluster using Redshift JDBC driver. Suppose your work directory is `/home/username/workspace` and the tpch1g data is stored in `/home/username/workspace/tpch1g`. ```java static void loadRedshiftData(String schema, String table, Connection conn) throws IOException { Statement stmt = conn.createStatement(); String concat = ""; File file = new File(String.format("/home/username/workspace/tpch1g/%s/%s.tbl", table, table)); ResultSet columnMeta = stmt.execute( String.format( "select data_type, ordinal_position from INFORMATION_SCHEMA.COLUMNS where table_name='%s' and table_schema='%s'", table, schema)); List<Boolean> quotedNeeded = new ArrayList<>(); for (int i = 0; i < columnMeta.getRowCount(); i++) { quotedNeeded.add(true); } while (columnMeta.next()) { String columnType = columnMeta.getString(1); int columnIndex = columnMeta.getInt(2); if (columnType.equals("integer") || columnType.equals("numeric")) { quotedNeeded.set(columnIndex - 1, false); } } String content = Files.toString(file, Charsets.UTF_8); for (String row : content.split("\n")) { String[] values = row.split("\\|"); row = ""; for (int i = 0; i < values.length - 1; i++) { if (quotedNeeded.get(i)) { row = row + getQuoted(values[i]) + ","; } else { row = row + values[i] + ","; } } row = row + "''"; if (concat.equals("")) { concat = concat + "(" + row + ")"; } else concat = concat + "," + "(" + row + ")"; } stmt.execute(String.format("insert into \"%s\".\"%s\" values %s", schema, table, concat)); } ``` ## Cloudera Impala ### Put data to HDFS Use following commands to put data into HDFS. Suppose the tpch1g data is stored in `/home/username/workspace/tpch1g` and you hope to put your data in `/tmp/tpch1g` in HDFS. ```bash $ hdfs dfs -mkdir -p /tmp/tpch1g/region $ hdfs dfs -mkdir -p /tmp/tpch1g/nation $ hdfs dfs -mkdir -p /tmp/tpch1g/customer $ hdfs dfs -mkdir -p /tmp/tpch1g/supplier $ hdfs dfs -mkdir -p /tmp/tpch1g/part $ hdfs dfs -mkdir -p /tmp/tpch1g/partsupp $ hdfs dfs -mkdir -p /tmp/tpch1g/orders $ hdfs dfs -mkdir -p /tmp/tpch1g/lineitem $ hdfs dfs -put /home/username/workspace/tpch1g/region/region.tbl /tmp/tpch1g/region $ hdfs dfs -put /home/username/workspace/tpch1g/nation/nation.tbl /tmp/tpch1g/nation $ hdfs dfs -put /home/username/workspace/tpch1g/customer/customer.tbl /tmp/tpch1g/customer $ hdfs dfs -put /home/username/workspace/tpch1g/supplier/supplier.tbl /tmp/tpch1g/supplier $ hdfs dfs -put /home/username/workspace/tpch1g/part/part.tbl /tmp/tpch1g/part $ hdfs dfs -put /home/username/workspace/tpch1g/partsupp/partsupp.tbl /tmp/tpch1g/partsupp $ hdfs dfs -put /home/username/workspace/tpch1g/orders/orders.tbl /tmp/tpch1g/orders $ hdfs dfs -put /home/username/workspace/tpch1g/lineitem/lineitem.tbl /tmp/tpch1g/lineitem ``` If you encounter write permission problem in the next step when creating tables, you can use command ```bash $ hdfs dfs -chmod -R 777 /tmp/tpch1g ``` to give full access to your directory. ### Create tables and load data Connect to Impala. ```bash $ impala-shell ``` Create a schema for testing. ``` create schema `tpch1g`; ``` Create tables and load data. Simply copy and paste the following table definition statements into the Impala shell. ```sql -- nation CREATE EXTERNAL TABLE IF NOT EXISTS `tpch1g`.`nation` ( `n_nationkey` INT, `n_name` STRING, `n_regionkey` INT, `n_comment` STRING, `n_dummy` STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LOCATION '/tmp/tpch1g/nation'; -- region CREATE EXTERNAL TABLE IF NOT EXISTS `tpch1g`.`region` ( `r_regionkey` INT, `r_name` STRING, `r_comment` STRING, `r_dummy` STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LOCATION '/tmp/tpch1g/region'; -- supplier CREATE EXTERNAL TABLE IF NOT EXISTS `tpch1g`.`supplier` ( `s_suppkey` INT, `s_name` STRING, `s_address` STRING, `s_nationkey` INT, `s_phone` STRING, `s_acctbal` DECIMAL(15,2), `s_comment` STRING, `s_dummy` STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LOCATION '/tmp/tpch1g/supplier'; -- customer CREATE EXTERNAL TABLE IF NOT EXISTS `tpch1g`.`customer` ( `c_custkey` INT, `c_name` STRING, `c_address` STRING, `c_nationkey` INT, `c_phone` STRING, `c_acctbal` DECIMAL(15,2), `c_mktsegment` STRING, `c_comment` STRING, `c_dummy` STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LOCATION '/tmp/tpch1g/customer'; -- part CREATE EXTERNAL TABLE IF NOT EXISTS `tpch1g`.`part` ( `p_partkey` INT, `p_name` STRING, `p_mfgr` STRING, `p_brand` STRING, `p_type` STRING, `p_size` INT, `p_container` STRING, `p_retailprice` DECIMAL(15,2) , `p_comment` STRING , `p_dummy` STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LOCATION '/tmp/tpch1g/part'; -- partsupp CREATE EXTERNAL TABLE IF NOT EXISTS `tpch1g`.`partsupp` ( `ps_partkey` INT, `ps_suppkey` INT, `ps_availqty` INT, `ps_supplycost` DECIMAL(15,2), `ps_comment` STRING, `ps_dummy` STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LOCATION '/tmp/tpch1g/partsupp'; -- orders CREATE EXTERNAL TABLE IF NOT EXISTS `tpch1g`.`orders` ( `o_orderkey` INT, `o_custkey` INT, `o_orderstatus` STRING, `o_totalprice` DECIMAL(15,2), `o_orderdate` TIMESTAMP, `o_orderpriority` STRING, `o_clerk` STRING, `o_shippriority` INT, `o_comment` STRING, `o_dummy` STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LOCATION '/tmp/tpch1g/orders'; -- lineitem CREATE EXTERNAL TABLE IF NOT EXISTS `tpch1g`.`lineitem`( `l_orderkey` INT, `l_partkey` INT, `l_suppkey` INT, `l_linenumber` INT, `l_quantity` DECIMAL(15,2), `l_extendedprice` DECIMAL(15,2), `l_discount` DECIMAL(15,2), `l_tax` DECIMAL(15,2), `l_returnflag` STRING, `l_linestatus` STRING, `l_shipdate` TIMESTAMP, `l_commitdate` TIMESTAMP, `l_receiptdate` TIMESTAMP, `l_shipinstruct` STRING, `l_shipmode` STRING, `l_comment` STRING, `l_dummy` STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LOCATION '/tmp/tpch1g/lineitem'; ```
{ "pile_set_name": "Github" }
package gorm import ( "fmt" ) type search struct { db *DB whereConditions []map[string]interface{} orConditions []map[string]interface{} notConditions []map[string]interface{} havingConditions []map[string]interface{} joinConditions []map[string]interface{} initAttrs []interface{} assignAttrs []interface{} selects map[string]interface{} omits []string orders []interface{} preload []searchPreload offset interface{} limit interface{} group string tableName string raw bool Unscoped bool ignoreOrderQuery bool } type searchPreload struct { schema string conditions []interface{} } func (s *search) clone() *search { clone := *s return &clone } func (s *search) Where(query interface{}, values ...interface{}) *search { s.whereConditions = append(s.whereConditions, map[string]interface{}{"query": query, "args": values}) return s } func (s *search) Not(query interface{}, values ...interface{}) *search { s.notConditions = append(s.notConditions, map[string]interface{}{"query": query, "args": values}) return s } func (s *search) Or(query interface{}, values ...interface{}) *search { s.orConditions = append(s.orConditions, map[string]interface{}{"query": query, "args": values}) return s } func (s *search) Attrs(attrs ...interface{}) *search { s.initAttrs = append(s.initAttrs, toSearchableMap(attrs...)) return s } func (s *search) Assign(attrs ...interface{}) *search { s.assignAttrs = append(s.assignAttrs, toSearchableMap(attrs...)) return s } func (s *search) Order(value interface{}, reorder ...bool) *search { if len(reorder) > 0 && reorder[0] { s.orders = []interface{}{} } if value != nil && value != "" { s.orders = append(s.orders, value) } return s } func (s *search) Select(query interface{}, args ...interface{}) *search { s.selects = map[string]interface{}{"query": query, "args": args} return s } func (s *search) Omit(columns ...string) *search { s.omits = columns return s } func (s *search) Limit(limit interface{}) *search { s.limit = limit return s } func (s *search) Offset(offset interface{}) *search { s.offset = offset return s } func (s *search) Group(query string) *search { s.group = s.getInterfaceAsSQL(query) return s } func (s *search) Having(query interface{}, values ...interface{}) *search { if val, ok := query.(*expr); ok { s.havingConditions = append(s.havingConditions, map[string]interface{}{"query": val.expr, "args": val.args}) } else { s.havingConditions = append(s.havingConditions, map[string]interface{}{"query": query, "args": values}) } return s } func (s *search) Joins(query string, values ...interface{}) *search { s.joinConditions = append(s.joinConditions, map[string]interface{}{"query": query, "args": values}) return s } func (s *search) Preload(schema string, values ...interface{}) *search { var preloads []searchPreload for _, preload := range s.preload { if preload.schema != schema { preloads = append(preloads, preload) } } preloads = append(preloads, searchPreload{schema, values}) s.preload = preloads return s } func (s *search) Raw(b bool) *search { s.raw = b return s } func (s *search) unscoped() *search { s.Unscoped = true return s } func (s *search) Table(name string) *search { s.tableName = name return s } func (s *search) getInterfaceAsSQL(value interface{}) (str string) { switch value.(type) { case string, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64: str = fmt.Sprintf("%v", value) default: s.db.AddError(ErrInvalidSQL) } if str == "-1" { return "" } return }
{ "pile_set_name": "Github" }
# Translation of Odoo Server. # This file contains the translation of the following modules: # * account_balance_line # # Translators: msgid "" msgstr "" "Project-Id-Version: account-financial-tools (8.0)\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-07-01 13:26+0000\n" "PO-Revision-Date: 2018-06-28 05:01+0000\n" "Last-Translator: Osoul <[email protected]>\n" "Language-Team: Arabic (http://www.transifex.com/oca/OCA-account-financial-" "tools-8-0/language/ar/)\n" "Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" "X-Generator: Weblate 3.0.1\n" #. module: account_balance_line #: model_terms:ir.ui.view,arch_db:account_balance_line.account_move_line_balance_tree #: model_terms:ir.ui.view,arch_db:account_balance_line.account_move_line_balance_tree_grouped msgid "Total Balance" msgstr "الرصيد" #~ msgid "Journal Items" #~ msgstr "عناصر دفتر اليومية"
{ "pile_set_name": "Github" }
--region *.lua --Date --此文件由[BabeLua]插件自动生成 CameraCtrl = class("CameraCtrl"); function CameraCtrl:initialize(camera, target) self.mCamera = camera; self.mTarget = target; self.mDelta = self.mCamera.transform.position - self.mTarget.position; end function CameraCtrl:Zoom(offset) self.mCamera.transform.position = self.mCamera.transform.position + self.mCamera.transform.forward * offset; self.mDelta = self.mCamera.transform.position - self.mTarget.position; end function CameraCtrl:Update() if self.mTarget.hasChanged then self.mCamera.transform.position = self.mTarget.position + self.mDelta; self.mTarget.hasChanged = false; end end --endregion
{ "pile_set_name": "Github" }
//////////////////////////////////////////////////////////////////// // // Copyright 2019 Samsung Electronics 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. // //////////////////////////////////////////////////////////////////// package smartfs_dump_parser.handlers; import java.io.File; import javax.inject.Inject; import org.eclipse.e4.core.di.annotations.Execute; import org.eclipse.e4.ui.model.application.ui.basic.MPart; import org.eclipse.e4.ui.workbench.modeling.EPartService; import org.eclipse.swt.widgets.Shell; import smartfs_dump_parser.data_model.SmartFileSystem; import smartfs_dump_parser.parts.DirectoryViewer; import smartfs_dump_parser.parts.GeometryViewer; import smartfs_dump_parser.parts.JournalViewer; import smartfs_dump_parser.parts.SectorViewer; import smartfs_dump_visualizer.controllers.SmartFSOrganizer; public class DumpHandler { private final String initialFileName = "Dump_File.txt"; private String filteredFileName = initialFileName + "_parsed"; private String parsedFileName = filteredFileName + "_binary"; private String srcPath; private File outputFile; @Inject EPartService partService; @Execute public void execute(Shell shell) { try { File file = new File(this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI()); srcPath = file.getCanonicalPath() + "/python/"; outputFile = new File(srcPath, initialFileName); if (outputFile.exists()) { if (outputFile.delete()) { outputFile = new File(srcPath, initialFileName); } else { System.err.println("Failed to delete " + initialFileName); } } String filteredFilePath = outputFile.getCanonicalPath() + "_parsed"; String parsedFilePath = filteredFilePath + "_binary"; Thread pythonRunner = new Thread(new PythonRunner(srcPath, outputFile)); pythonRunner.start(); Thread dumpFileFilter = new Thread(new DumpFileFilter(outputFile, parsedFilePath)); dumpFileFilter.start(); pythonRunner.join(); System.out.println("Python script for SmartFS dumping is executed!!\n"); dumpFileFilter.join(); System.out.println("Dumped SmartFS file is parsed!!\n"); MPart geometry_part = partService.findPart("smartfs_dump_parser.part.geometry_information"); GeometryViewer gv = (GeometryViewer)geometry_part.getObject(); MPart directory_part = partService.findPart("smartfs_dump_parser.part.directory_structure"); DirectoryViewer dv = (DirectoryViewer)directory_part.getObject(); MPart sector_part = partService.findPart("smartfs_dump_parser.part.sector_list"); SectorViewer sv = (SectorViewer)sector_part.getObject(); MPart journal_part = partService.findPart("smartfs_dump_parser.part.journal_information"); JournalViewer jv = (JournalViewer)journal_part.getObject(); if (SmartFSOrganizer.organizeSmartFS(srcPath, parsedFileName)) { gv.updateGeometry(SmartFileSystem.getSectorSize(), SmartFileSystem.getNumberOfSectors()); dv.getDirectoryViewer().refresh(); sv.getSectorViewer().refresh(); jv.getJournalViewer().refresh(); } } catch (Exception e) { e.printStackTrace(); } } }
{ "pile_set_name": "Github" }
package com.fastweixin.api.entity; /** * 标签对象 * @author peiyu * @since 1.3.9 */ public class Tag extends BaseModel { private Integer id; private String name; private Integer count; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 6ce40bec54ad382449f80ef0e1028101 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <!-- This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> <!-- * This file tests the moz-anno protocol, which was added in Bug 316077 and how * it loads favicons. --> <window title="Favicon Annotation Protocol Test" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="test();"> <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"/> <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> <script type="application/javascript"> <![CDATA[ var Cc = Components.classes; var Ci = Components.interfaces; var Cr = Components.results; let fs = Cc["@mozilla.org/browser/favicon-service;1"]. getService(Ci.nsIFaviconService); // Test descriptions that will be printed in the case of failure. let testDescriptions = [ "moz-anno URI with no data in the database loads default icon", "URI added to the database is properly loaded", ]; // URIs to load (will be compared with expectedURIs of the same index). let testURIs = [ "http://mozilla.org/2009/made-up-favicon/places-rocks/", "http://mozilla.org/should-be-barney/", ]; // URIs to load for expected results. let expectedURIs = [ fs.defaultFavicon.spec, "data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%10%00%00%00%10%08%06%00%00%00%1F%F3%FFa%00%00%00%04gAMA%00%00%AF%C87%05%8A%E9%00%00%00%19tEXtSoftware%00Adobe%20ImageReadyq%C9e%3C%00%00%01%D6IDATx%DAb%FC%FF%FF%3F%03%25%00%20%80%98%909%EF%DF%BFg%EF%EC%EC%FC%AD%AC%AC%FC%DF%95%91%F1%BF%89%89%C9%7F%20%FF%D7%EA%D5%AB%B7%DF%BBwO%16%9B%01%00%01%C4%00r%01%08%9F9s%C6%CD%D8%D8%F8%BF%0B%03%C3%FF3%40%BC%0A%88%EF%02q%1A%10%BB%40%F1%AAU%ABv%C1%D4%C30%40%00%81%89%993g%3E%06%1A%F6%3F%14%AA%11D%97%03%F1%7Fc%08%0D%E2%2B))%FD%17%04%89%A1%19%00%10%40%0C%D00%F8%0F3%00%C8%F8%BF%1B%E4%0Ac%88a%E5%60%17%19%FF%0F%0D%0D%05%1B%02v%D9%DD%BB%0A0%03%00%02%08%AC%B9%A3%A3%E3%17%03%D4v%90%01%EF%18%106%C3%0Cz%07%C5%BB%A1%DE%82y%07%20%80%A0%A6%08B%FCn%0C1%60%26%D4%20d%C3VA%C3%06%26%BE%0A%EA-%80%00%82%B9%E0%F7L4%0D%EF%90%F8%C6%60%2F%0A%82%BD%01%13%07%0700%D0%01%02%88%11%E4%02P%B41%DC%BB%C7%D0%014%0D%E8l%06W%20%06%BA%88%A1%1C%1AS%15%40%7C%16%CA6.%2Fgx%BFg%0F%83%CB%D9%B3%0C%7B%80%7C%80%00%02%BB%00%E8%9F%ED%20%1B%3A%A0%A6%9F%81%DA%DC%01%C5%B0%80%ED%80%FA%BF%BC%BC%FC%3F%83%12%90%9D%96%F6%1F%20%80%18%DE%BD%7B%C7%0E%8E%05AD%20%FEGr%A6%A0%A0%E0%7F%25P%80%02%9D%0F%D28%13%18%23%C6%C0%B0%02E%3D%C8%F5%00%01%04%8F%05P%A8%BA%40my%87%E4%12c%A8%8D%20%8B%D0%D3%00%08%03%04%10%9C%01R%E4%82d%3B%C8%A0%99%C6%90%90%C6%A5%19%84%01%02%08%9E%17%80%C9x%F7%7B%A0%DBVC%F9%A0%C0%5C%7D%16%2C%CE%00%F4%C6O%5C%99%09%20%800L%04y%A5%03%1A%95%A0%80%05%05%14.%DBA%18%20%80%18)%CD%CE%00%01%06%00%0C'%94%C7%C0k%C9%2C%00%00%00%00IEND%AEB%60%82", ]; /** * The event listener placed on our test windows used to determine when it is * safe to compare the two windows. */ let _results = []; function loadEventHandler() { _results.push(snapshotWindow(window)); loadNextTest(); } /** * This runs the comparison. */ function compareResults(aIndex, aImage1, aImage2) { let [correct, data1, data2] = compareSnapshots(aImage1, aImage2, true); SimpleTest.ok(correct, "Test '" + testDescriptions[aIndex] + "' matches expectations. " + "Data from window 1 is '" + data1 + "'. " + "Data from window 2 is '" + data2 + "'"); } /** * Loads the next set of URIs to compare against. */ let _counter = -1; function loadNextTest() { _counter++; // If we have no more tests, finish. if (_counter / 2 == testDescriptions.length) { for (let i = 0; i < _results.length; i = i + 2) compareResults(i / 2, _results[i], _results[i + 1]); SimpleTest.finish(); return; } let nextURI = function() { let index = Math.floor(_counter / 2); if ((_counter % 2) == 0) return "moz-anno:favicon:" + testURIs[index]; return expectedURIs[index]; } let img = document.getElementById("favicon"); img.setAttribute("src", nextURI()); } function test() { SimpleTest.waitForExplicitFinish(); let db = Cc["@mozilla.org/browser/nav-history-service;1"]. getService(Ci.nsPIPlacesDatabase). DBConnection; // Empty any old favicons db.executeSimpleSQL("DELETE FROM moz_favicons"); let ios = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService); let uri = function(aSpec) { return ios.newURI(aSpec, null, null); }; let pageURI = uri("http://example.com/favicon_annotations"); let history = Cc["@mozilla.org/browser/history;1"] .getService(Ci.mozIAsyncHistory); history.updatePlaces( { uri: pageURI, visits: [{ transitionType: Ci.nsINavHistoryService.TRANSITION_TYPED, visitDate: Date.now() * 1000 }], }, { handleError: function UP_handleError() { ok(false, "Unexpected error in adding visit."); }, handleResult: function () {}, handleCompletion: function UP_handleCompletion() { // Set the favicon data. Note that the "moz-anno:" protocol requires // the favicon to be stored in the database, but the // replaceFaviconDataFromDataURL function will not save the favicon // unless it is associated with a page. Thus, we must associate the // icon with a page explicitly in order for it to be visible through // the protocol. var systemPrincipal = Cc["@mozilla.org/systemprincipal;1"] .createInstance(Ci.nsIPrincipal); fs.replaceFaviconDataFromDataURL(uri(testURIs[1]), expectedURIs[1], (Date.now() + 60 * 60 * 24 * 1000) * 1000, systemPrincipal); fs.setAndFetchFaviconForPage(pageURI, uri(testURIs[1]), true, fs.FAVICON_LOAD_NON_PRIVATE, null, systemPrincipal); // And start our test process. loadNextTest(); } } ); } ]]> </script> <body xmlns="http://www.w3.org/1999/xhtml"> <img id="favicon" onload="loadEventHandler();"/> <p id="display"></p> <div id="content" style="display:none;"></div> <pre id="test"></pre> </body> </window>
{ "pile_set_name": "Github" }
/* The MIT License (MIT) Copyright (c) 2014 Graeme Hill (http://graemehill.ca) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #pragma once #include <iostream> #include <vector> #include <sstream> #include <string> #include <iomanip> #include <stdint.h> #ifdef GUID_ANDROID #include <jni.h> #endif // Class to represent a GUID/UUID. Each instance acts as a wrapper around a // 16 byte value that can be passed around by value. It also supports // conversion to string (via the stream operator <<) and conversion from a // string via constructor. class Guid { public: // create a guid from vector of bytes Guid(const std::vector<unsigned char> &bytes); // create a guid from array of bytes Guid(const unsigned char *bytes); // Create a guid from array of words. Guid(const uint16_t *bytes, bool reverse); // create a guid from string Guid(const std::string &fromString); // create empty guid Guid(); // copy constructor Guid(const Guid &other); // overload assignment operator Guid &operator=(const Guid &other); // overload equality and inequality operator bool operator==(const Guid &other) const; bool operator!=(const Guid &other) const; const std::string toString() const; std::vector<unsigned char>::const_iterator begin() { return _bytes.begin(); } std::vector<unsigned char>::const_iterator end() { return _bytes.end(); } std::vector<unsigned char>::const_reverse_iterator rbegin() { return _bytes.rbegin(); } std::vector<unsigned char>::const_reverse_iterator rend() { return _bytes.rend(); } private: // actual data std::vector<unsigned char> _bytes; // make the << operator a friend so it can access _bytes friend std::ostream &operator<<(std::ostream &s, const Guid &guid); }; // Class that can create new guids. The only reason this exists instead of // just a global "newGuid" function is because some platforms will require // that there is some attached context. In the case of android, we need to // know what JNIEnv is being used to call back to Java, but the newGuid() // function would no longer be cross-platform if we parameterized the android // version. Instead, construction of the GuidGenerator may be different on // each platform, but the use of newGuid is uniform. class GuidGenerator { public: #ifdef GUID_ANDROID GuidGenerator(JNIEnv *env); #else GuidGenerator() { } #endif Guid newGuid(); #ifdef GUID_ANDROID private: JNIEnv *_env; jclass _uuidClass; jmethodID _newGuidMethod; jmethodID _mostSignificantBitsMethod; jmethodID _leastSignificantBitsMethod; #endif };
{ "pile_set_name": "Github" }
# Fun with WebGL 2.0 - 007 - Quads **Description**: In today's lesson we start filling up our 3d space with new objects to render. We're moving onto using triangles to create a fundamental 3d shape, the quad. This is the most simplest shape we can create but its also the one shape that is the most versatile in our toolbox. Heres just a few things you can do with a quad: render tons of grass, display text since each letter is a textured quad, texture quads in particle effects. Beyond that we explore different ways to render multiple objects on screen, eventually settling on batch creation of quads into a single vertice array that allows use to use a single draw call to render hundreds of quads in one go. ### Links * [Lession Live Demo](http://rawgit.com/sketchpunk/FunWithWebGL2/master/lesson_007/demo.html) * [Lesson on Youtube](https://www.youtube.com/watch?v=ZkHHjNec3l0) * [Youtube Series PlayList](https://www.youtube.com/playlist?list=PLMinhigDWz6emRKVkVIEAaePW7vtIkaIF)
{ "pile_set_name": "Github" }
// Copyright 2008, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Author: [email protected] (Zhanyong Wan) // A helper program for testing how Google Test determines whether to use // colors in the output. It prints "YES" and returns 1 if Google Test // decides to use colors, and prints "NO" and returns 0 otherwise. #include <stdio.h> #include "gtest/gtest.h" // Indicates that this translation unit is part of Google Test's // implementation. It must come before gtest-internal-inl.h is // included, or there will be a compiler error. This trick is to // prevent a user from accidentally including gtest-internal-inl.h in // his code. #define GTEST_IMPLEMENTATION_ 1 #include "src/gtest-internal-inl.h" #undef GTEST_IMPLEMENTATION_ using testing::internal::ShouldUseColor; // The purpose of this is to ensure that the UnitTest singleton is // created before main() is entered, and thus that ShouldUseColor() // works the same way as in a real Google-Test-based test. We don't actual // run the TEST itself. TEST(GTestColorTest, Dummy) { } int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); if (ShouldUseColor(true)) { // Google Test decides to use colors in the output (assuming it // goes to a TTY). printf("YES\n"); return 1; } else { // Google Test decides not to use colors in the output. printf("NO\n"); return 0; } }
{ "pile_set_name": "Github" }
class TheCavePattern{ // The cave private theCave: TheCave; // Constructor constructor(theCave: TheCave){ this.theCave = theCave; } // Public methods public draw(renderArea: RenderArea, x: number, y: number): void{ // Called to let the pattern draw stuff } public ended(): boolean{ // Called to know if the pattern should end return false; } public getSentence(): string{ // Called so that the pattern can easily show a sentence below the cave ascii art return null; } public move(type: TheCaveMoveType): void{ // Called when the player moves } // Public getters public getTheCave(): TheCave{ return this.theCave; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Source Files"> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> </Filter> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\..\..\src\arena.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\background_thread.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\base.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\bitmap.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\ckh.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\ctl.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\extent.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\extent_dss.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\extent_mmap.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\hash.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\hooks.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\jemalloc.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\large.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\malloc_io.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\mutex.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\mutex_pool.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\nstime.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\pages.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\prng.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\prof.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\rtree.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\stats.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\sz.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\tcache.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\ticker.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\tsd.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\witness.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\log.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\bin.c"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\..\..\..\src\div.c"> <Filter>Source Files</Filter> </ClCompile> </ItemGroup> </Project>
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_144) on Tue Oct 03 09:17:58 PDT 2017 --> <title>LruCache (glide API)</title> <meta name="date" content="2017-10-03"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="LruCache (glide API)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/bumptech/glide/util/LogTime.html" title="class in com.bumptech.glide.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../com/bumptech/glide/util/MarkEnforcingInputStream.html" title="class in com.bumptech.glide.util"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/bumptech/glide/util/LruCache.html" target="_top">Frames</a></li> <li><a href="LruCache.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">com.bumptech.glide.util</div> <h2 title="Class LruCache" class="title">Class LruCache&lt;T,Y&gt;</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>com.bumptech.glide.util.LruCache&lt;T,Y&gt;</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt><span class="paramLabel">Type Parameters:</span></dt> <dd><code>T</code> - The type of the keys.</dd> <dd><code>Y</code> - The type of the values.</dd> </dl> <dl> <dt>Direct Known Subclasses:</dt> <dd><a href="../../../../com/bumptech/glide/load/engine/cache/LruResourceCache.html" title="class in com.bumptech.glide.load.engine.cache">LruResourceCache</a></dd> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">LruCache&lt;T,Y&gt;</span> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> <div class="block">A general purpose size limited cache that evicts items using an LRU algorithm. By default every item is assumed to have a size of one. Subclasses can override <a href="../../../../com/bumptech/glide/util/LruCache.html#getSize-Y-"><code>getSize(Object)</code></a>} to change the size on a per item basis.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#LruCache-int-">LruCache</a></span>(int&nbsp;size)</code> <div class="block">Constructor for LruCache.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#clearMemory--">clearMemory</a></span>()</code> <div class="block">Clears all items in the cache.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#contains-T-">contains</a></span>(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">T</a>&nbsp;key)</code> <div class="block">Returns true if there is a value for the given key in the cache.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#get-T-">get</a></span>(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">T</a>&nbsp;key)</code> <div class="block">Returns the item in the cache for the given key or null if no such item exists.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>protected int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#getCount--">getCount</a></span>()</code> <div class="block">Returns the number of entries stored in cache.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#getCurrentSize--">getCurrentSize</a></span>()</code> <div class="block">Returns the sum of the sizes of all items in the cache.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#getMaxSize--">getMaxSize</a></span>()</code> <div class="block">Returns the current maximum size of the cache in bytes.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>protected int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#getSize-Y-">getSize</a></span>(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a>&nbsp;item)</code> <div class="block">Returns the size of a given item, defaulting to one.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#onItemEvicted-T-Y-">onItemEvicted</a></span>(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">T</a>&nbsp;key, <a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a>&nbsp;item)</code> <div class="block">A callback called whenever an item is evicted from the cache.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code><a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#put-T-Y-">put</a></span>(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">T</a>&nbsp;key, <a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a>&nbsp;item)</code> <div class="block">Adds the given item to the cache with the given key and returns any previous entry for the given key that may have already been in the cache.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code><a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#remove-T-">remove</a></span>(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">T</a>&nbsp;key)</code> <div class="block">Removes the item at the given key and returns the removed item if present, and null otherwise.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#setSizeMultiplier-float-">setSizeMultiplier</a></span>(float&nbsp;multiplier)</code> <div class="block">Sets a size multiplier that will be applied to the size provided in the constructor to put the new size of the cache.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/bumptech/glide/util/LruCache.html#trimToSize-int-">trimToSize</a></span>(int&nbsp;size)</code> <div class="block">Removes the least recently used items from the cache until the current size is less than the given size.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="LruCache-int-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>LruCache</h4> <pre>public&nbsp;LruCache(int&nbsp;size)</pre> <div class="block">Constructor for LruCache.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>size</code> - The maximum size of the cache, the units must match the units used in <a href="../../../../com/bumptech/glide/util/LruCache.html#getSize-Y-"><code>getSize(Object)</code></a>.</dd> </dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="setSizeMultiplier-float-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setSizeMultiplier</h4> <pre>public&nbsp;void&nbsp;setSizeMultiplier(float&nbsp;multiplier)</pre> <div class="block">Sets a size multiplier that will be applied to the size provided in the constructor to put the new size of the cache. If the new size is less than the current size, entries will be evicted until the current size is less than or equal to the new size.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>multiplier</code> - The multiplier to apply.</dd> </dl> </li> </ul> <a name="getSize-java.lang.Object-"> <!-- --> </a><a name="getSize-Y-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSize</h4> <pre>protected&nbsp;int&nbsp;getSize(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a>&nbsp;item)</pre> <div class="block">Returns the size of a given item, defaulting to one. The units must match those used in the size passed in to the constructor. Subclasses can override this method to return sizes in various units, usually bytes.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>item</code> - The item to get the size of.</dd> </dl> </li> </ul> <a name="getCount--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getCount</h4> <pre>protected&nbsp;int&nbsp;getCount()</pre> <div class="block">Returns the number of entries stored in cache.</div> </li> </ul> <a name="onItemEvicted-java.lang.Object-java.lang.Object-"> <!-- --> </a><a name="onItemEvicted-T-Y-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>onItemEvicted</h4> <pre>protected&nbsp;void&nbsp;onItemEvicted(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">T</a>&nbsp;key, <a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a>&nbsp;item)</pre> <div class="block">A callback called whenever an item is evicted from the cache. Subclasses can override.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>key</code> - The key of the evicted item.</dd> <dd><code>item</code> - The evicted item.</dd> </dl> </li> </ul> <a name="getMaxSize--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getMaxSize</h4> <pre>public&nbsp;int&nbsp;getMaxSize()</pre> <div class="block">Returns the current maximum size of the cache in bytes.</div> </li> </ul> <a name="getCurrentSize--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getCurrentSize</h4> <pre>public&nbsp;int&nbsp;getCurrentSize()</pre> <div class="block">Returns the sum of the sizes of all items in the cache.</div> </li> </ul> <a name="contains-java.lang.Object-"> <!-- --> </a><a name="contains-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>contains</h4> <pre>public&nbsp;boolean&nbsp;contains(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">T</a>&nbsp;key)</pre> <div class="block">Returns true if there is a value for the given key in the cache.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>key</code> - The key to check.</dd> </dl> </li> </ul> <a name="get-java.lang.Object-"> <!-- --> </a><a name="get-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>get</h4> <pre><a href="http://d.android.com/reference/android/support/annotation/Nullable.html?is-external=true" title="class or interface in android.support.annotation">@Nullable</a> public&nbsp;<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a>&nbsp;get(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">T</a>&nbsp;key)</pre> <div class="block">Returns the item in the cache for the given key or null if no such item exists.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>key</code> - The key to check.</dd> </dl> </li> </ul> <a name="put-java.lang.Object-java.lang.Object-"> <!-- --> </a><a name="put-T-Y-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>put</h4> <pre>public&nbsp;<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a>&nbsp;put(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">T</a>&nbsp;key, <a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a>&nbsp;item)</pre> <div class="block">Adds the given item to the cache with the given key and returns any previous entry for the given key that may have already been in the cache. <p> If the size of the item is larger than the total cache size, the item will not be added to the cache and instead <a href="../../../../com/bumptech/glide/util/LruCache.html#onItemEvicted-T-Y-"><code>onItemEvicted(Object, Object)</code></a> will be called synchronously with the given key and item. </p></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>key</code> - The key to add the item at.</dd> <dd><code>item</code> - The item to add.</dd> </dl> </li> </ul> <a name="remove-java.lang.Object-"> <!-- --> </a><a name="remove-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>remove</h4> <pre><a href="http://d.android.com/reference/android/support/annotation/Nullable.html?is-external=true" title="class or interface in android.support.annotation">@Nullable</a> public&nbsp;<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">Y</a>&nbsp;remove(<a href="../../../../com/bumptech/glide/util/LruCache.html" title="type parameter in LruCache">T</a>&nbsp;key)</pre> <div class="block">Removes the item at the given key and returns the removed item if present, and null otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>key</code> - The key to remove the item at.</dd> </dl> </li> </ul> <a name="clearMemory--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>clearMemory</h4> <pre>public&nbsp;void&nbsp;clearMemory()</pre> <div class="block">Clears all items in the cache.</div> </li> </ul> <a name="trimToSize-int-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>trimToSize</h4> <pre>protected&nbsp;void&nbsp;trimToSize(int&nbsp;size)</pre> <div class="block">Removes the least recently used items from the cache until the current size is less than the given size.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>size</code> - The size the cache should be less than.</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/bumptech/glide/util/LogTime.html" title="class in com.bumptech.glide.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../com/bumptech/glide/util/MarkEnforcingInputStream.html" title="class in com.bumptech.glide.util"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/bumptech/glide/util/LruCache.html" target="_top">Frames</a></li> <li><a href="LruCache.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "pile_set_name": "Github" }
name: bga_issue_blog description: Flutter 抓取 GitHub 上的 Issues,结合 GitHub Pages 搭建个人博客站点,支持 GitHub 登录和评论 version: 1.0.0+1 environment: sdk: ">=2.1.0 <3.0.0" dependencies: flutter: sdk: flutter cupertino_icons: ^0.1.2 json_annotation: ^3.0.0 # https://pub.flutter-io.cn/packages/json_annotation transparent_image: ^1.0.0 # https://pub.flutter-io.cn/packages/transparent_image provider: ^3.1.0+1 # https://pub.flutter-io.cn/packages/provider url_launcher: ^5.2.5 # https://pub.flutter-io.cn/packages/url_launcher dio: ^3.0.3 # https://github.com/flutterchina/dio flutter_html: ^0.11.0 # https://github.com/Sub6Resources/flutter_html markdown: ^2.1.1 # https://github.com/dart-lang/markdown flutter_markdown: ^0.2.0 # https://github.com/flutter/flutter_markdown fluro: ^1.5.1 # https://pub.dev/packages/fluro dev_dependencies: build_runner: ^1.7.2 # https://pub.flutter-io.cn/packages/build_runner json_serializable: ^3.2.3 # 可以配置别名 alias genjson="flutter packages pub run build_runner build --delete-conflicting-outputs" https://pub.flutter-io.cn/packages/json_serializable flutter_test: sdk: flutter shelf_static: ^0.2.8 # https://pub.flutter-io.cn/packages/shelf_static flutter: uses-material-design: true assets: - images/favicon.ico - images/no-data.png - images/enter-icon.svg - images/next-page-hover.png - images/next-page-normal.png - images/pre-page-hover.png - images/pre-page-normal.png - images/git.png - images/github.png - images/qq-group.png
{ "pile_set_name": "Github" }
{% load i18n %} <div class="server-errors" data-bind="visible: hasServerError"> <h2>{% trans "Oh, no!" %}</h2> <p class="lead">{% trans "Well, this is embarrassing..." %}</p> <p> {% blocktrans %} It seems our servers are having issues processing new accounts right now. {% endblocktrans %} </p> <p> {% blocktrans %} It's most definitely our fault, and we sincerely apologize. Our best developers are already on the case, don't worry. {% endblocktrans %} </p> <p> {% blocktrans %} Please try back in an hour and hopefully everything will be fixed. We are very sorry for the inconvenience. {% endblocktrans %} </p> </div>
{ "pile_set_name": "Github" }
package system // import "github.com/docker/docker/pkg/system" // Umask is not supported on the windows platform. func Umask(newmask int) (oldmask int, err error) { // should not be called on cli code path return 0, ErrNotSupportedPlatform }
{ "pile_set_name": "Github" }
// +build fixtures package flavors // ListOutput is a sample response of a flavor List request. const ListOutput = ` { "flavors": [ { "OS-FLV-EXT-DATA:ephemeral": 0, "OS-FLV-WITH-EXT-SPECS:extra_specs": { "class": "performance1", "disk_io_index": "40", "number_of_data_disks": "0", "policy_class": "performance_flavor", "resize_policy_class": "performance_flavor" }, "disk": 20, "id": "performance1-1", "links": [ { "href": "https://iad.servers.api.rackspacecloud.com/v2/864477/flavors/performance1-1", "rel": "self" }, { "href": "https://iad.servers.api.rackspacecloud.com/864477/flavors/performance1-1", "rel": "bookmark" } ], "name": "1 GB Performance", "ram": 1024, "rxtx_factor": 200, "swap": "", "vcpus": 1 }, { "OS-FLV-EXT-DATA:ephemeral": 20, "OS-FLV-WITH-EXT-SPECS:extra_specs": { "class": "performance1", "disk_io_index": "40", "number_of_data_disks": "1", "policy_class": "performance_flavor", "resize_policy_class": "performance_flavor" }, "disk": 40, "id": "performance1-2", "links": [ { "href": "https://iad.servers.api.rackspacecloud.com/v2/864477/flavors/performance1-2", "rel": "self" }, { "href": "https://iad.servers.api.rackspacecloud.com/864477/flavors/performance1-2", "rel": "bookmark" } ], "name": "2 GB Performance", "ram": 2048, "rxtx_factor": 400, "swap": "", "vcpus": 2 } ] }` // GetOutput is a sample response from a flavor Get request. Its contents correspond to the // Performance1Flavor struct. const GetOutput = ` { "flavor": { "OS-FLV-EXT-DATA:ephemeral": 0, "OS-FLV-WITH-EXT-SPECS:extra_specs": { "class": "performance1", "disk_io_index": "40", "number_of_data_disks": "0", "policy_class": "performance_flavor", "resize_policy_class": "performance_flavor" }, "disk": 20, "id": "performance1-1", "links": [ { "href": "https://iad.servers.api.rackspacecloud.com/v2/864477/flavors/performance1-1", "rel": "self" }, { "href": "https://iad.servers.api.rackspacecloud.com/864477/flavors/performance1-1", "rel": "bookmark" } ], "name": "1 GB Performance", "ram": 1024, "rxtx_factor": 200, "swap": "", "vcpus": 1 } } ` // Performance1Flavor is the expected result of parsing GetOutput, or the first element of // ListOutput. var Performance1Flavor = Flavor{ ID: "performance1-1", Disk: 20, RAM: 1024, Name: "1 GB Performance", RxTxFactor: 200.0, Swap: 0, VCPUs: 1, ExtraSpecs: ExtraSpecs{ NumDataDisks: 0, Class: "performance1", DiskIOIndex: 0, PolicyClass: "performance_flavor", }, } // Performance2Flavor is the second result expected from parsing ListOutput. var Performance2Flavor = Flavor{ ID: "performance1-2", Disk: 40, RAM: 2048, Name: "2 GB Performance", RxTxFactor: 400.0, Swap: 0, VCPUs: 2, ExtraSpecs: ExtraSpecs{ NumDataDisks: 0, Class: "performance1", DiskIOIndex: 0, PolicyClass: "performance_flavor", }, } // ExpectedFlavorSlice is the slice of Flavor structs that are expected to be parsed from // ListOutput. var ExpectedFlavorSlice = []Flavor{Performance1Flavor, Performance2Flavor}
{ "pile_set_name": "Github" }
""" Tests for the PyPy cStringIO implementation. """ class AppTestcStringIO: def setup_class(cls): cls.w_io = cls.space.appexec([], "(): import cStringIO; return cStringIO") cls.w_bytes = cls.space.wrap('some bytes') def test_reset(self): """ Test that the reset method of cStringIO objects sets the position marker to the beginning of the stream. """ io = self.io.StringIO() io.write(self.bytes) assert io.read() == '' io.reset() assert io.read() == self.bytes io = self.io.StringIO(self.bytes) assert io.read() == self.bytes assert io.read() == '' io.reset() assert io.read() == self.bytes
{ "pile_set_name": "Github" }
package de.lessvoid.nifty.effects; import de.lessvoid.xml.xpp3.Attributes; import org.junit.Before; import org.junit.Test; import java.util.Properties; import static org.junit.Assert.*; public class EffectPropertiesTest { private EffectProperties effectProperties; @Before public void before() { effectProperties = new EffectProperties(new Properties()); } @Test public void testEmpty() { assertNull(effectProperties.getInterpolator()); assertFalse(effectProperties.isTimeInterpolator()); } @Test public void testAddWithTime() { Attributes p = new Attributes(); p.set("time", "1"); p.set("value", "2"); effectProperties.addEffectValue(p); assertTrue(effectProperties.isTimeInterpolator()); assertNotNull(effectProperties.getInterpolator()); } @Test public void testAddWithoutTime() { Attributes p = new Attributes(); p.set("t", "1"); p.set("value", "2"); effectProperties.addEffectValue(p); assertFalse(effectProperties.isTimeInterpolator()); assertNull(effectProperties.getInterpolator()); } }
{ "pile_set_name": "Github" }
<?php $type='TrueTypeUnicode'; $name='DejaVuSerifCondensed'; $desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>5,'Flags'=>32,'FontBBox'=>'[-692 -347 1511 1242]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>540); $up=-63; $ut=44; $dw=540; $cw=array( 0=>540,32=>286,33=>361,34=>414,35=>754,36=>572,37=>855,38=>801,39=>247,40=>351, 41=>351,42=>450,43=>754,44=>286,45=>304,46=>286,47=>303,48=>572,49=>572,50=>572, 51=>572,52=>572,53=>572,54=>572,55=>572,56=>572,57=>572,58=>303,59=>303,60=>754, 61=>754,62=>754,63=>482,64=>900,65=>650,66=>661,67=>688,68=>721,69=>657,70=>624, 71=>719,72=>785,73=>355,74=>360,75=>672,76=>598,77=>921,78=>787,79=>738,80=>605, 81=>738,82=>677,83=>616,84=>600,85=>758,86=>650,87=>925,88=>641,89=>594,90=>625, 91=>351,92=>303,93=>351,94=>754,95=>450,96=>450,97=>536,98=>576,99=>504,100=>576, 101=>532,102=>333,103=>576,104=>580,105=>288,106=>279,107=>545,108=>288,109=>853,110=>580, 111=>542,112=>576,113=>576,114=>430,115=>461,116=>361,117=>580,118=>508,119=>770,120=>507, 121=>508,122=>474,123=>572,124=>303,125=>572,126=>754,8364=>572,8218=>286,402=>333,8222=>466, 8230=>900,8224=>450,8225=>450,710=>450,8240=>1208,352=>616,8249=>360,338=>1023,381=>625,8216=>286, 8217=>286,8220=>460,8221=>460,8226=>531,8211=>450,8212=>900,732=>450,8482=>900,353=>461,8250=>360, 339=>890,382=>474,376=>594,160=>286,161=>361,162=>572,163=>572,164=>572,165=>572,166=>303, 167=>450,168=>450,169=>900,170=>427,171=>550,172=>754,173=>304,174=>900,175=>450,176=>450, 177=>754,178=>360,179=>360,180=>450,181=>584,182=>572,183=>286,184=>450,185=>360,186=>423, 187=>550,188=>872,189=>872,190=>872,191=>482,192=>650,193=>650,194=>650,195=>650,196=>650, 197=>650,198=>901,199=>688,200=>657,201=>657,202=>657,203=>657,204=>355,205=>355,206=>355, 207=>355,208=>726,209=>787,210=>738,211=>738,212=>738,213=>738,214=>738,215=>754,216=>738, 217=>758,218=>758,219=>758,220=>758,221=>594,222=>608,223=>601,224=>536,225=>536,226=>536, 227=>536,228=>536,229=>536,230=>846,231=>504,232=>532,233=>532,234=>532,235=>532,236=>288, 237=>288,238=>288,239=>288,240=>542,241=>580,242=>542,243=>542,244=>542,245=>542,246=>542, 247=>754,248=>542,249=>580,250=>580,251=>580,252=>580,253=>508,254=>576,255=>508,256=>650, 257=>536,258=>650,259=>536,260=>650,261=>536,262=>688,263=>504,264=>688,265=>504,266=>688, 267=>504,268=>688,269=>504,270=>721,271=>576,272=>726,273=>576,274=>657,275=>532,276=>657, 277=>532,278=>657,279=>532,280=>657,281=>532,282=>657,283=>532,284=>719,285=>576,286=>719, 287=>576,288=>719,289=>576,290=>719,291=>576,292=>785,293=>580,294=>785,295=>580,296=>355, 297=>288,298=>355,299=>288,300=>355,301=>288,302=>355,303=>288,304=>355,305=>288,306=>721, 307=>479,308=>360,309=>279,310=>672,311=>545,312=>545,313=>598,314=>288,315=>598,316=>288, 317=>598,318=>288,319=>598,320=>288,321=>602,322=>292,323=>787,324=>580,325=>787,326=>580, 327=>787,328=>580,329=>779,330=>758,331=>580,332=>738,333=>542,334=>738,335=>542,336=>738, 337=>542,340=>677,341=>430,342=>677,343=>430,344=>677,345=>430,346=>616,347=>461,348=>616, 349=>461,350=>616,351=>461,354=>600,355=>361,356=>600,357=>361,358=>600,359=>361,360=>758, 361=>580,362=>758,363=>580,364=>758,365=>580,366=>758,367=>580,368=>758,369=>580,370=>758, 371=>580,372=>925,373=>770,374=>594,375=>508,377=>625,378=>474,379=>625,380=>474,383=>333, 384=>576,385=>661,386=>661,387=>576,388=>661,389=>576,390=>688,391=>688,392=>504,393=>726, 394=>721,395=>661,396=>576,397=>542,398=>657,399=>738,400=>561,401=>624,403=>719,404=>641, 405=>839,406=>355,407=>355,408=>672,409=>545,410=>288,411=>570,412=>853,413=>787,414=>580, 415=>738,416=>738,417=>542,418=>936,419=>726,420=>605,421=>576,422=>677,423=>616,424=>461, 425=>636,426=>292,427=>361,428=>600,429=>361,430=>600,431=>758,432=>580,433=>746,434=>684, 435=>664,436=>596,437=>625,438=>474,439=>508,440=>508,441=>508,443=>572,444=>618,445=>508, 446=>482,448=>265,449=>443,450=>413,451=>265,452=>1347,453=>1195,454=>1050,455=>958,456=>876, 457=>567,458=>1148,459=>1066,460=>858,461=>650,462=>536,463=>355,464=>288,465=>738,466=>542, 467=>758,468=>580,469=>758,470=>580,471=>758,472=>580,473=>758,474=>580,475=>758,476=>580, 477=>532,478=>650,479=>536,480=>650,481=>536,482=>901,483=>846,484=>763,485=>576,486=>719, 487=>576,488=>672,489=>545,490=>738,491=>542,492=>738,493=>542,494=>508,495=>508,496=>288, 497=>1347,498=>1195,499=>1050,500=>719,501=>576,502=>1038,504=>787,505=>580,506=>650,507=>536, 508=>901,509=>846,510=>738,511=>542,512=>650,513=>536,514=>650,515=>536,516=>657,517=>532, 518=>657,519=>532,520=>355,521=>288,522=>355,523=>288,524=>738,525=>542,526=>738,527=>542, 528=>677,529=>430,530=>677,531=>430,532=>758,533=>580,534=>758,535=>580,536=>616,537=>461, 538=>600,539=>361,540=>564,541=>469,542=>785,543=>580,544=>758,545=>732,548=>625,549=>474, 550=>650,551=>536,552=>657,553=>532,554=>738,555=>542,556=>738,557=>542,558=>738,559=>542, 560=>738,561=>542,562=>594,563=>508,564=>450,565=>748,566=>444,567=>279,568=>864,569=>864, 570=>650,571=>688,572=>504,573=>598,574=>600,575=>461,576=>474,577=>525,578=>417,581=>650, 592=>536,593=>576,594=>576,595=>576,596=>504,597=>504,598=>582,599=>614,600=>532,601=>532, 602=>759,603=>466,604=>458,605=>695,606=>552,607=>283,608=>615,609=>576,610=>489,611=>641, 612=>507,613=>580,614=>580,615=>580,616=>288,617=>353,618=>288,619=>342,620=>409,621=>326, 622=>633,623=>853,624=>853,625=>853,626=>579,627=>624,628=>581,629=>542,630=>711,631=>583, 632=>542,633=>451,634=>451,635=>496,636=>430,637=>430,638=>407,639=>407,640=>534,641=>534, 642=>461,643=>244,644=>333,645=>438,646=>292,647=>361,648=>361,649=>580,650=>558,651=>547, 652=>508,653=>770,654=>508,655=>589,656=>537,657=>504,658=>508,659=>504,660=>482,661=>482, 662=>482,663=>461,664=>738,665=>506,666=>552,667=>588,668=>600,669=>329,670=>545,671=>581, 672=>615,673=>482,674=>482,675=>896,676=>930,677=>898,678=>728,679=>538,680=>704,681=>804, 682=>582,683=>608,684=>538,685=>398,686=>703,687=>690,688=>389,689=>387,690=>237,691=>312, 692=>312,693=>387,694=>352,695=>527,696=>381,697=>250,699=>286,700=>286,701=>286,702=>276, 703=>276,704=>252,705=>252,711=>450,712=>247,713=>450,716=>247,720=>303,721=>303,722=>276, 723=>276,726=>295,728=>450,729=>450,730=>450,731=>450,733=>450,734=>375,736=>402,737=>218, 738=>303,739=>381,740=>252,741=>444,742=>444,743=>444,744=>444,745=>444,750=>435,768=>0, 769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, 779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0, 789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0, 799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0, 809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, 819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0, 829=>0,830=>0,831=>0,835=>0,847=>0,856=>0,865=>0,880=>666,881=>478,884=>250, 885=>250,890=>450,891=>504,892=>504,893=>504,894=>303,900=>450,901=>450,902=>650,903=>286, 904=>810,905=>935,906=>505,908=>751,910=>808,911=>767,912=>353,913=>650,914=>661,915=>624, 916=>650,917=>657,918=>625,919=>785,920=>738,921=>355,922=>672,923=>650,924=>921,925=>787, 926=>633,927=>738,928=>785,929=>605,931=>636,932=>600,933=>594,934=>738,935=>641,936=>789, 937=>746,938=>355,939=>594,940=>607,941=>466,942=>539,943=>353,944=>547,945=>607,946=>520, 947=>538,948=>542,949=>466,950=>488,951=>539,952=>542,953=>353,954=>563,955=>570,956=>584, 957=>547,958=>496,959=>542,960=>591,961=>529,962=>504,963=>614,964=>498,965=>547,966=>630, 967=>545,968=>706,969=>734,970=>353,971=>547,972=>542,973=>547,974=>734,976=>524,977=>643, 978=>618,979=>787,980=>618,981=>613,982=>734,983=>561,984=>738,985=>542,986=>688,987=>504, 988=>624,989=>417,990=>531,991=>593,992=>704,993=>519,1008=>561,1009=>529,1010=>504,1011=>279, 1012=>738,1013=>504,1014=>504,1015=>608,1016=>576,1017=>688,1018=>921,1019=>637,1020=>529,1021=>688, 1022=>688,1023=>688,1024=>657,1025=>657,1026=>719,1027=>596,1028=>688,1029=>616,1030=>355,1031=>355, 1032=>360,1033=>976,1034=>1006,1035=>785,1036=>696,1037=>785,1038=>650,1039=>785,1040=>681,1041=>661, 1042=>661,1043=>596,1044=>731,1045=>657,1046=>1011,1047=>561,1048=>785,1049=>785,1050=>696,1051=>751, 1052=>921,1053=>785,1054=>738,1055=>785,1056=>605,1057=>688,1058=>600,1059=>650,1060=>747,1061=>641, 1062=>785,1063=>695,1064=>1027,1065=>1027,1066=>715,1067=>885,1068=>606,1069=>688,1070=>1074,1071=>727, 1072=>536,1073=>542,1074=>506,1075=>471,1076=>554,1077=>532,1078=>828,1079=>491,1080=>600,1081=>600, 1082=>563,1083=>571,1084=>700,1085=>600,1086=>542,1087=>600,1088=>576,1089=>504,1090=>498,1091=>529, 1092=>704,1093=>507,1094=>579,1095=>595,1096=>836,1097=>836,1098=>572,1099=>716,1100=>490,1101=>504, 1102=>783,1103=>567,1104=>532,1105=>532,1106=>561,1107=>471,1108=>504,1109=>461,1110=>288,1111=>288, 1112=>279,1113=>759,1114=>774,1115=>580,1116=>563,1117=>600,1118=>529,1119=>590,1122=>686,1123=>542, 1124=>1016,1125=>750,1130=>1011,1131=>828,1136=>849,1137=>812,1138=>738,1139=>497,1140=>773,1141=>610, 1164=>636,1165=>490,1168=>604,1169=>476,1170=>596,1171=>471,1172=>655,1173=>552,1174=>1011,1175=>828, 1176=>572,1177=>483,1178=>696,1179=>545,1182=>696,1183=>563,1184=>801,1185=>645,1186=>785,1187=>577, 1188=>1025,1189=>767,1190=>1084,1191=>847,1194=>688,1195=>504,1196=>600,1197=>498,1198=>594,1199=>508, 1200=>594,1201=>508,1202=>641,1203=>507,1204=>856,1205=>659,1206=>674,1207=>621,1210=>674,1211=>580, 1216=>355,1217=>1011,1218=>828,1219=>672,1220=>545,1223=>785,1224=>600,1227=>674,1228=>600,1231=>288, 1232=>681,1233=>536,1234=>681,1235=>536,1236=>901,1237=>846,1238=>657,1239=>532,1240=>738,1241=>532, 1242=>738,1243=>532,1244=>1011,1245=>828,1246=>561,1247=>491,1248=>508,1249=>508,1250=>785,1251=>600, 1252=>785,1253=>600,1254=>738,1255=>542,1256=>738,1257=>542,1258=>738,1259=>542,1260=>688,1261=>504, 1262=>650,1263=>529,1264=>650,1265=>529,1266=>650,1267=>529,1268=>695,1269=>595,1270=>596,1271=>471, 1272=>885,1273=>716,1296=>561,1297=>491,1298=>751,1299=>571,1300=>1078,1301=>827,1306=>738,1307=>576, 1308=>925,1309=>770,4256=>650,4257=>765,4258=>745,4259=>773,4260=>659,4261=>883,4262=>824,4263=>991, 4264=>510,4265=>675,4266=>866,4267=>847,4268=>668,4269=>967,4270=>807,4271=>746,4272=>936,4273=>660, 4274=>602,4275=>914,4276=>843,4277=>917,4278=>658,4279=>659,4280=>659,4281=>660,4282=>791,4283=>843, 4284=>642,4285=>679,4286=>660,4287=>862,4288=>900,4289=>632,4290=>777,4291=>660,4292=>753,4293=>855, 4304=>486,4305=>514,4306=>530,4307=>750,4308=>505,4309=>501,4310=>556,4311=>774,4312=>503,4313=>491, 4314=>959,4315=>527,4316=>527,4317=>743,4318=>513,4319=>522,4320=>741,4321=>546,4322=>673,4323=>628, 4324=>733,4325=>526,4326=>772,4327=>511,4328=>534,4329=>527,4330=>607,4331=>528,4332=>523,4333=>518, 4334=>550,4335=>615,4336=>514,4337=>542,4338=>514,4339=>514,4340=>513,4341=>584,4342=>797,4343=>563, 4344=>523,4345=>557,4346=>514,4347=>393,4348=>318,7426=>846,7432=>458,7433=>288,7444=>890,7446=>542, 7447=>542,7453=>663,7454=>853,7455=>853,7468=>409,7469=>567,7470=>417,7472=>454,7473=>413,7474=>413, 7475=>453,7476=>494,7477=>224,7478=>227,7479=>423,7480=>376,7481=>580,7482=>496,7483=>496,7484=>464, 7486=>381,7487=>426,7488=>378,7489=>478,7490=>583,7491=>347,7492=>347,7493=>360,7494=>556,7495=>360, 7496=>360,7497=>348,7498=>348,7499=>306,7500=>306,7501=>360,7502=>157,7503=>328,7504=>552,7505=>359, 7506=>347,7507=>312,7508=>347,7509=>347,7510=>360,7511=>222,7512=>359,7513=>417,7514=>552,7515=>335, 7522=>181,7523=>312,7524=>359,7525=>335,7543=>576,7544=>494,7547=>334,7557=>288,7579=>360,7580=>312, 7581=>312,7582=>347,7583=>306,7584=>199,7585=>206,7586=>360,7587=>359,7588=>210,7589=>219,7590=>210, 7591=>210,7592=>207,7593=>158,7594=>157,7595=>330,7596=>552,7597=>552,7598=>366,7599=>364,7600=>359, 7601=>347,7602=>347,7603=>295,7604=>190,7605=>222,7606=>359,7607=>350,7609=>338,7610=>335,7611=>297, 7612=>297,7613=>297,7614=>327,7615=>347,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0, 7680=>650,7681=>536,7682=>661,7683=>576,7684=>661,7685=>576,7686=>661,7687=>576,7688=>688,7689=>504, 7690=>721,7691=>576,7692=>721,7693=>576,7694=>721,7695=>576,7696=>721,7697=>576,7698=>721,7699=>576, 7700=>657,7701=>532,7702=>657,7703=>532,7704=>657,7705=>532,7706=>657,7707=>532,7708=>657,7709=>532, 7710=>624,7711=>333,7712=>719,7713=>576,7714=>785,7715=>580,7716=>785,7717=>580,7718=>785,7719=>580, 7720=>785,7721=>580,7722=>785,7723=>580,7724=>355,7725=>288,7728=>672,7729=>545,7730=>672,7731=>545, 7732=>672,7733=>545,7734=>598,7735=>288,7736=>598,7737=>288,7738=>598,7739=>288,7740=>598,7741=>288, 7742=>921,7743=>853,7744=>921,7745=>853,7746=>921,7747=>853,7748=>787,7749=>580,7750=>787,7751=>580, 7752=>787,7753=>580,7754=>787,7755=>580,7756=>738,7757=>542,7760=>738,7761=>542,7762=>738,7763=>542, 7764=>605,7765=>576,7766=>605,7767=>576,7768=>677,7769=>430,7770=>677,7771=>430,7772=>677,7773=>430, 7774=>677,7775=>430,7776=>616,7777=>461,7778=>616,7779=>461,7784=>616,7785=>461,7786=>600,7787=>361, 7788=>600,7789=>361,7790=>600,7791=>361,7792=>600,7793=>361,7794=>758,7795=>580,7796=>758,7797=>580, 7798=>758,7799=>580,7800=>758,7801=>580,7802=>758,7803=>580,7804=>650,7805=>508,7806=>650,7807=>508, 7808=>925,7809=>770,7810=>925,7811=>770,7812=>925,7813=>770,7814=>925,7815=>770,7816=>925,7817=>770, 7818=>641,7819=>507,7820=>641,7821=>507,7822=>594,7823=>508,7824=>625,7825=>474,7826=>625,7827=>474, 7828=>625,7829=>474,7830=>580,7831=>361,7832=>770,7833=>508,7834=>813,7835=>333,7838=>746,7839=>542, 7840=>650,7841=>536,7842=>650,7843=>536,7852=>650,7853=>536,7854=>650,7855=>536,7856=>650,7857=>536, 7858=>650,7859=>536,7860=>650,7861=>536,7862=>650,7863=>536,7864=>657,7865=>532,7866=>657,7867=>532, 7868=>657,7869=>532,7878=>657,7879=>532,7880=>355,7881=>288,7882=>355,7883=>288,7884=>738,7885=>542, 7886=>738,7887=>542,7896=>738,7897=>542,7908=>758,7909=>580,7910=>758,7911=>580,7922=>594,7923=>508, 7924=>594,7925=>508,7926=>594,7927=>508,7928=>594,7929=>508,7936=>607,7937=>607,7938=>607,7939=>607, 7940=>607,7941=>607,7942=>607,7943=>607,7944=>650,7945=>650,7946=>782,7947=>782,7948=>660,7949=>687, 7950=>650,7951=>650,7952=>483,7953=>483,7954=>483,7955=>483,7956=>483,7957=>483,7960=>768,7961=>757, 7962=>960,7963=>969,7964=>907,7965=>931,7968=>539,7969=>539,7970=>539,7971=>539,7972=>539,7973=>539, 7974=>539,7975=>539,7976=>898,7977=>893,7978=>1090,7979=>1101,7980=>1043,7981=>1064,7982=>988,7983=>985, 7984=>353,7985=>353,7986=>353,7987=>353,7988=>353,7989=>353,7990=>353,7991=>353,7992=>469,7993=>461, 7994=>661,7995=>664,7996=>611,7997=>635,7998=>561,7999=>553,8000=>542,8001=>542,8002=>542,8003=>542, 8004=>542,8005=>542,8008=>738,8009=>773,8010=>1008,8011=>1015,8012=>843,8013=>867,8016=>547,8017=>547, 8018=>547,8019=>547,8020=>547,8021=>547,8022=>547,8023=>547,8025=>765,8027=>971,8029=>939,8031=>857, 8032=>734,8033=>734,8034=>734,8035=>734,8036=>734,8037=>734,8038=>734,8039=>734,8040=>746,8041=>783, 8042=>1018,8043=>1023,8044=>852,8045=>878,8046=>844,8047=>873,8048=>607,8049=>607,8050=>483,8051=>483, 8052=>539,8053=>539,8054=>353,8055=>353,8056=>542,8057=>542,8058=>547,8059=>547,8060=>734,8061=>734, 8064=>607,8065=>607,8066=>607,8067=>607,8068=>607,8069=>607,8070=>607,8071=>607,8072=>650,8073=>650, 8074=>782,8075=>782,8076=>660,8077=>687,8078=>650,8079=>650,8080=>539,8081=>539,8082=>539,8083=>539, 8084=>539,8085=>539,8086=>539,8087=>539,8088=>898,8089=>893,8090=>1090,8091=>1101,8092=>1043,8093=>1064, 8094=>988,8095=>985,8096=>734,8097=>734,8098=>734,8099=>734,8100=>734,8101=>734,8102=>734,8103=>734, 8104=>746,8105=>783,8106=>1018,8107=>1023,8108=>852,8109=>878,8110=>844,8111=>873,8112=>607,8113=>607, 8114=>607,8115=>607,8116=>607,8118=>607,8119=>607,8120=>650,8121=>650,8122=>650,8123=>650,8124=>650, 8125=>450,8126=>450,8127=>450,8128=>450,8129=>450,8130=>539,8131=>539,8132=>539,8134=>539,8135=>539, 8136=>820,8137=>810,8138=>956,8139=>935,8140=>785,8141=>450,8142=>450,8143=>450,8144=>353,8145=>353, 8146=>353,8147=>353,8150=>353,8151=>353,8152=>355,8153=>355,8154=>529,8155=>505,8157=>450,8158=>450, 8159=>450,8160=>547,8161=>547,8162=>547,8163=>547,8164=>529,8165=>529,8166=>547,8167=>547,8168=>594, 8169=>594,8170=>829,8171=>808,8172=>711,8173=>450,8174=>450,8175=>450,8178=>734,8179=>734,8180=>734, 8182=>734,8183=>734,8184=>865,8185=>751,8186=>886,8187=>767,8188=>746,8189=>450,8190=>450,8192=>450, 8193=>900,8194=>450,8195=>900,8196=>296,8197=>225,8198=>150,8199=>572,8200=>286,8201=>180,8202=>89, 8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>304,8209=>304,8210=>572,8213=>900,8214=>450, 8215=>450,8219=>286,8223=>460,8227=>531,8228=>300,8229=>600,8234=>0,8235=>0,8236=>0,8237=>0, 8238=>0,8239=>180,8241=>1560,8242=>204,8243=>336,8244=>468,8245=>204,8246=>336,8247=>468,8248=>305, 8252=>475,8253=>482,8254=>450,8258=>900,8260=>150,8261=>351,8262=>351,8263=>878,8264=>678,8265=>678, 8267=>572,8268=>450,8269=>450,8270=>450,8271=>303,8273=>450,8274=>404,8275=>900,8279=>597,8287=>200, 8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0, 8303=>0,8304=>360,8305=>181,8308=>360,8309=>360,8310=>360,8311=>360,8312=>360,8313=>360,8314=>475, 8315=>475,8316=>475,8317=>221,8318=>221,8319=>389,8320=>360,8321=>360,8322=>360,8323=>360,8324=>360, 8325=>360,8326=>360,8327=>360,8328=>360,8329=>360,8330=>475,8331=>475,8332=>475,8333=>221,8334=>221, 8336=>347,8337=>348,8338=>347,8339=>381,8340=>348,8358=>594,8367=>951,8369=>635,8372=>702,8373=>572, 8450=>716,8451=>1006,8457=>942,8461=>850,8462=>580,8463=>580,8469=>822,8470=>852,8473=>677,8474=>784, 8477=>748,8484=>657,8486=>746,8487=>746,8490=>672,8491=>650,8508=>659,8509=>594,8510=>639,8511=>850, 8512=>642,8513=>697,8514=>501,8515=>501,8516=>549,8517=>780,8518=>629,8519=>572,8520=>342,8521=>325, 8523=>801,8531=>872,8532=>872,8533=>872,8534=>872,8535=>872,8536=>872,8537=>872,8538=>872,8539=>872, 8540=>872,8541=>872,8542=>872,8543=>511,8544=>355,8545=>531,8546=>707,8547=>870,8548=>650,8549=>883, 8550=>1059,8551=>1234,8552=>838,8553=>641,8554=>839,8555=>1015,8556=>598,8557=>688,8558=>721,8559=>921, 8560=>288,8561=>576,8562=>863,8563=>796,8564=>508,8565=>796,8566=>1084,8567=>1372,8568=>795,8569=>507, 8570=>795,8571=>1083,8572=>288,8573=>504,8574=>576,8575=>853,8576=>1085,8577=>721,8578=>1085,8579=>688, 8580=>504,8592=>754,8593=>754,8594=>754,8595=>754,8596=>754,8597=>754,8598=>754,8599=>754,8600=>754, 8601=>754,8602=>754,8603=>754,8604=>754,8605=>754,8606=>754,8607=>754,8608=>754,8609=>754,8610=>754, 8611=>754,8612=>754,8613=>754,8614=>754,8615=>754,8616=>754,8617=>754,8618=>754,8619=>754,8620=>754, 8621=>754,8622=>754,8623=>754,8624=>754,8625=>754,8626=>754,8627=>754,8628=>754,8629=>754,8630=>754, 8631=>754,8632=>754,8633=>754,8634=>754,8635=>754,8636=>754,8637=>754,8638=>754,8639=>754,8640=>754, 8641=>754,8642=>754,8643=>754,8644=>754,8645=>754,8646=>754,8647=>754,8648=>754,8649=>754,8650=>754, 8651=>754,8652=>754,8653=>754,8654=>754,8655=>754,8656=>754,8657=>754,8658=>754,8659=>754,8660=>754, 8661=>754,8662=>754,8663=>754,8664=>754,8665=>754,8666=>754,8667=>754,8668=>754,8669=>754,8670=>754, 8671=>754,8672=>754,8673=>754,8674=>754,8675=>754,8676=>754,8677=>754,8678=>754,8679=>754,8680=>754, 8681=>754,8682=>754,8683=>754,8684=>754,8685=>754,8686=>754,8687=>754,8688=>754,8689=>754,8690=>754, 8691=>754,8692=>754,8693=>754,8694=>754,8695=>754,8696=>754,8697=>754,8698=>754,8699=>754,8700=>754, 8701=>754,8702=>754,8703=>754,8704=>543,8706=>465,8707=>488,8708=>488,8710=>628,8711=>628,8712=>666, 8713=>666,8715=>666,8716=>666,8719=>716,8720=>716,8721=>642,8722=>754,8723=>754,8724=>754,8725=>303, 8727=>611,8728=>441,8729=>441,8730=>573,8731=>573,8732=>573,8733=>609,8734=>750,8735=>754,8736=>754, 8739=>262,8740=>431,8741=>416,8742=>570,8743=>659,8744=>659,8745=>754,8746=>754,8747=>469,8748=>766, 8749=>1063,8760=>754,8761=>754,8762=>754,8763=>754,8764=>754,8765=>754,8770=>754,8771=>754,8776=>754, 8784=>754,8785=>754,8786=>754,8787=>754,8788=>930,8789=>930,8800=>754,8801=>754,8804=>754,8805=>754, 8834=>754,8835=>754,8836=>754,8837=>754,8838=>754,8839=>754,8844=>754,8845=>754,8846=>754,8847=>761, 8848=>761,8849=>761,8850=>761,8851=>754,8852=>754,8853=>754,8854=>754,8855=>754,8856=>754,8857=>754, 8858=>754,8859=>754,8860=>754,8861=>754,8862=>754,8863=>754,8864=>754,8865=>754,8866=>773,8867=>773, 8868=>846,8869=>846,8870=>510,8871=>510,8872=>773,8873=>773,8874=>773,8875=>927,8876=>773,8877=>773, 8878=>773,8879=>927,8901=>308,8962=>687,8968=>351,8969=>351,8970=>351,8971=>351,8976=>754,8977=>461, 8984=>900,8985=>754,8992=>469,8993=>469,8997=>900,9000=>1299,9085=>827,9134=>469,9167=>850,9251=>687, 9472=>542,9473=>542,9474=>542,9475=>542,9476=>542,9477=>542,9478=>542,9479=>542,9480=>542,9481=>542, 9482=>542,9483=>542,9484=>542,9485=>542,9486=>542,9487=>542,9488=>542,9489=>542,9490=>542,9491=>542, 9492=>542,9493=>542,9494=>542,9495=>542,9496=>542,9497=>542,9498=>542,9499=>542,9500=>542,9501=>542, 9502=>542,9503=>542,9504=>542,9505=>542,9506=>542,9507=>542,9508=>542,9509=>542,9510=>542,9511=>542, 9512=>542,9513=>542,9514=>542,9515=>542,9516=>542,9517=>542,9518=>542,9519=>542,9520=>542,9521=>542, 9522=>542,9523=>542,9524=>542,9525=>542,9526=>542,9527=>542,9528=>542,9529=>542,9530=>542,9531=>542, 9532=>542,9533=>542,9534=>542,9535=>542,9536=>542,9537=>542,9538=>542,9539=>542,9540=>542,9541=>542, 9542=>542,9543=>542,9544=>542,9545=>542,9546=>542,9547=>542,9548=>542,9549=>542,9550=>542,9551=>542, 9552=>542,9553=>542,9554=>542,9555=>542,9556=>542,9557=>542,9558=>542,9559=>542,9560=>542,9561=>542, 9562=>542,9563=>542,9564=>542,9565=>542,9566=>542,9567=>542,9568=>542,9569=>542,9570=>542,9571=>542, 9572=>542,9573=>542,9574=>542,9575=>542,9576=>542,9577=>542,9578=>542,9579=>542,9580=>542,9581=>542, 9582=>542,9583=>542,9584=>542,9585=>542,9586=>542,9587=>542,9588=>542,9589=>542,9590=>542,9591=>542, 9592=>542,9593=>542,9594=>542,9595=>542,9596=>542,9597=>542,9598=>542,9599=>542,9600=>692,9601=>692, 9602=>692,9603=>692,9604=>692,9605=>692,9606=>692,9607=>692,9608=>692,9609=>692,9610=>692,9611=>692, 9612=>692,9613=>692,9614=>692,9615=>692,9616=>692,9617=>692,9618=>692,9619=>692,9620=>692,9621=>692, 9622=>692,9623=>692,9624=>692,9625=>692,9626=>692,9627=>692,9628=>692,9629=>692,9630=>692,9631=>692, 9632=>850,9633=>850,9634=>850,9635=>850,9636=>850,9637=>850,9638=>850,9639=>850,9640=>850,9641=>850, 9642=>610,9643=>610,9644=>850,9645=>850,9646=>495,9647=>495,9648=>692,9649=>692,9650=>692,9651=>692, 9652=>452,9653=>452,9654=>692,9655=>692,9656=>452,9657=>452,9658=>692,9659=>692,9660=>692,9661=>692, 9662=>452,9663=>452,9664=>692,9665=>692,9666=>452,9667=>452,9668=>692,9669=>692,9670=>692,9671=>692, 9672=>692,9673=>785,9674=>444,9675=>785,9676=>785,9677=>785,9678=>785,9679=>785,9680=>785,9681=>785, 9682=>785,9683=>785,9684=>785,9685=>785,9686=>474,9687=>474,9688=>712,9689=>873,9690=>873,9691=>873, 9692=>348,9693=>348,9694=>348,9695=>348,9696=>785,9697=>785,9698=>692,9699=>692,9700=>692,9701=>692, 9702=>531,9703=>850,9704=>850,9705=>850,9706=>850,9707=>850,9708=>692,9709=>692,9710=>692,9711=>1007, 9712=>850,9713=>850,9714=>850,9715=>850,9716=>785,9717=>785,9718=>785,9719=>785,9720=>692,9721=>692, 9722=>692,9723=>747,9724=>747,9725=>659,9726=>659,9727=>692,9728=>807,9784=>807,9785=>807,9786=>807, 9787=>807,9788=>807,9791=>552,9792=>658,9793=>658,9794=>807,9795=>807,9796=>807,9797=>807,9798=>807, 9799=>807,9824=>807,9825=>807,9826=>807,9827=>807,9828=>807,9829=>807,9830=>807,9831=>807,9833=>424, 9834=>574,9835=>807,9836=>807,9837=>424,9838=>321,9839=>435,10145=>754,10181=>351,10182=>351,10208=>444, 10216=>351,10217=>351,10224=>754,10225=>754,10226=>754,10227=>754,10228=>930,10229=>1290,10230=>1290,10231=>1290, 10232=>1290,10233=>1290,10234=>1290,10235=>1290,10236=>1290,10237=>1290,10238=>1290,10239=>1290,10240=>659,10241=>659, 10242=>659,10243=>659,10244=>659,10245=>659,10246=>659,10247=>659,10248=>659,10249=>659,10250=>659,10251=>659, 10252=>659,10253=>659,10254=>659,10255=>659,10256=>659,10257=>659,10258=>659,10259=>659,10260=>659,10261=>659, 10262=>659,10263=>659,10264=>659,10265=>659,10266=>659,10267=>659,10268=>659,10269=>659,10270=>659,10271=>659, 10272=>659,10273=>659,10274=>659,10275=>659,10276=>659,10277=>659,10278=>659,10279=>659,10280=>659,10281=>659, 10282=>659,10283=>659,10284=>659,10285=>659,10286=>659,10287=>659,10288=>659,10289=>659,10290=>659,10291=>659, 10292=>659,10293=>659,10294=>659,10295=>659,10296=>659,10297=>659,10298=>659,10299=>659,10300=>659,10301=>659, 10302=>659,10303=>659,10304=>659,10305=>659,10306=>659,10307=>659,10308=>659,10309=>659,10310=>659,10311=>659, 10312=>659,10313=>659,10314=>659,10315=>659,10316=>659,10317=>659,10318=>659,10319=>659,10320=>659,10321=>659, 10322=>659,10323=>659,10324=>659,10325=>659,10326=>659,10327=>659,10328=>659,10329=>659,10330=>659,10331=>659, 10332=>659,10333=>659,10334=>659,10335=>659,10336=>659,10337=>659,10338=>659,10339=>659,10340=>659,10341=>659, 10342=>659,10343=>659,10344=>659,10345=>659,10346=>659,10347=>659,10348=>659,10349=>659,10350=>659,10351=>659, 10352=>659,10353=>659,10354=>659,10355=>659,10356=>659,10357=>659,10358=>659,10359=>659,10360=>659,10361=>659, 10362=>659,10363=>659,10364=>659,10365=>659,10366=>659,10367=>659,10368=>659,10369=>659,10370=>659,10371=>659, 10372=>659,10373=>659,10374=>659,10375=>659,10376=>659,10377=>659,10378=>659,10379=>659,10380=>659,10381=>659, 10382=>659,10383=>659,10384=>659,10385=>659,10386=>659,10387=>659,10388=>659,10389=>659,10390=>659,10391=>659, 10392=>659,10393=>659,10394=>659,10395=>659,10396=>659,10397=>659,10398=>659,10399=>659,10400=>659,10401=>659, 10402=>659,10403=>659,10404=>659,10405=>659,10406=>659,10407=>659,10408=>659,10409=>659,10410=>659,10411=>659, 10412=>659,10413=>659,10414=>659,10415=>659,10416=>659,10417=>659,10418=>659,10419=>659,10420=>659,10421=>659, 10422=>659,10423=>659,10424=>659,10425=>659,10426=>659,10427=>659,10428=>659,10429=>659,10430=>659,10431=>659, 10432=>659,10433=>659,10434=>659,10435=>659,10436=>659,10437=>659,10438=>659,10439=>659,10440=>659,10441=>659, 10442=>659,10443=>659,10444=>659,10445=>659,10446=>659,10447=>659,10448=>659,10449=>659,10450=>659,10451=>659, 10452=>659,10453=>659,10454=>659,10455=>659,10456=>659,10457=>659,10458=>659,10459=>659,10460=>659,10461=>659, 10462=>659,10463=>659,10464=>659,10465=>659,10466=>659,10467=>659,10468=>659,10469=>659,10470=>659,10471=>659, 10472=>659,10473=>659,10474=>659,10475=>659,10476=>659,10477=>659,10478=>659,10479=>659,10480=>659,10481=>659, 10482=>659,10483=>659,10484=>659,10485=>659,10486=>659,10487=>659,10488=>659,10489=>659,10490=>659,10491=>659, 10492=>659,10493=>659,10494=>659,10495=>659,10496=>754,10497=>754,10498=>754,10499=>754,10500=>754,10501=>754, 10502=>754,10503=>754,10504=>754,10505=>754,10506=>754,10507=>754,10508=>754,10509=>754,10510=>754,10511=>754, 10512=>754,10513=>754,10514=>754,10515=>754,10516=>754,10517=>754,10518=>754,10519=>754,10520=>754,10521=>754, 10522=>754,10523=>754,10524=>754,10525=>754,10526=>754,10527=>754,10528=>754,10529=>754,10530=>754,10531=>754, 10532=>754,10533=>754,10534=>754,10535=>754,10536=>754,10537=>754,10538=>754,10539=>754,10540=>754,10541=>754, 10542=>754,10543=>754,10544=>754,10545=>754,10546=>754,10547=>754,10548=>754,10549=>754,10550=>754,10551=>754, 10552=>754,10553=>754,10554=>754,10555=>754,10556=>754,10557=>754,10558=>754,10559=>754,10560=>754,10561=>754, 10562=>754,10563=>754,10564=>754,10565=>754,10566=>754,10567=>754,10568=>754,10569=>754,10570=>754,10571=>754, 10572=>754,10573=>754,10574=>754,10575=>754,10576=>754,10577=>754,10578=>754,10579=>754,10580=>754,10581=>754, 10582=>754,10583=>754,10584=>754,10585=>754,10586=>754,10587=>754,10588=>754,10589=>754,10590=>754,10591=>754, 10592=>754,10593=>754,10594=>754,10595=>754,10596=>754,10597=>754,10598=>754,10599=>754,10600=>754,10601=>754, 10602=>754,10603=>754,10604=>754,10605=>754,10606=>754,10607=>754,10608=>754,10609=>754,10610=>754,10611=>754, 10612=>754,10613=>754,10614=>754,10615=>883,10616=>754,10617=>754,10618=>886,10619=>754,10620=>754,10621=>754, 10622=>754,10623=>754,10731=>444,10764=>1361,10765=>469,10766=>469,10799=>754,11008=>754,11009=>754,11010=>754, 11011=>754,11012=>754,11013=>754,11014=>754,11015=>754,11016=>754,11017=>754,11018=>754,11019=>754,11020=>754, 11021=>754,11022=>754,11023=>754,11024=>754,11025=>754,11026=>850,11027=>850,11028=>850,11029=>850,11030=>692, 11031=>692,11032=>692,11033=>692,11034=>850,11364=>677,11367=>785,11368=>580,11369=>672,11370=>545,11371=>625, 11372=>474,11374=>921,11375=>650,11381=>666,11382=>500,11383=>630,11385=>451,11386=>542,11388=>237,11389=>409, 11520=>695,11521=>571,11522=>569,11523=>592,11524=>568,11525=>866,11526=>680,11527=>864,11528=>555,11529=>581, 11530=>866,11531=>568,11532=>581,11533=>866,11534=>580,11535=>779,11536=>865,11537=>580,11538=>580,11539=>863, 11540=>851,11541=>777,11542=>580,11543=>581,11544=>580,11545=>584,11546=>619,11547=>571,11548=>883,11549=>613, 11550=>608,11551=>766,11552=>861,11553=>569,11554=>580,11555=>582,11556=>674,11557=>822,11800=>482,11810=>351, 11811=>351,11812=>351,11813=>351,11822=>482,42564=>616,42565=>461,42566=>355,42567=>353,42576=>994,42577=>799, 42580=>1074,42581=>783,42582=>1025,42583=>809,42760=>444,42761=>444,42762=>444,42763=>444,42764=>444,42765=>444, 42766=>444,42767=>444,42768=>444,42769=>444,42770=>444,42771=>444,42772=>444,42773=>444,42774=>444,42779=>332, 42780=>332,42781=>228,42782=>228,42783=>228,42891=>361,42892=>247,62464=>588,62465=>598,62466=>642,62467=>853, 62468=>598,62469=>593,62470=>652,62471=>888,62472=>598,62473=>598,62474=>1131,62475=>614,62476=>613,62477=>857, 62478=>598,62479=>613,62480=>898,62481=>671,62482=>718,62483=>672,62484=>850,62485=>613,62486=>842,62487=>612, 62488=>619,62489=>613,62490=>655,62491=>613,62492=>619,62493=>599,62494=>656,62495=>795,62496=>598,62497=>635, 62498=>599,62499=>598,62500=>598,62501=>649,62502=>865,62504=>813,63173=>542,63185=>450,63188=>450,64256=>639, 64257=>600,64258=>600,64259=>925,64260=>927,64261=>694,64262=>839,65024=>0,65025=>0,65026=>0,65027=>0, 65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0, 65038=>0,65039=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>923); $enc=''; $diff=''; $file='dejavuserifcondensed.z'; $ctg='dejavuserifcondensed.ctg.z'; $originalsize=295840; ?>
{ "pile_set_name": "Github" }
/* * ipheth.c - Apple iPhone USB Ethernet driver * * Copyright (c) 2009 Diego Giagio <[email protected]> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of GIAGIO.COM nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * Alternatively, provided that this notice is retained in full, this * software may be distributed under the terms of the GNU General * Public License ("GPL") version 2, in which case the provisions of the * GPL apply INSTEAD OF those given above. * * The provided data structures and external interfaces from this code * are not restricted to be used by modules with a GPL compatible license. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * Attention: iPhone device must be paired, otherwise it won't respond to our * driver. For more info: http://giagio.com/wiki/moin.cgi/iPhoneEthernetDriver * */ #include <linux/kernel.h> #include <linux/errno.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/ethtool.h> #include <linux/usb.h> #include <linux/workqueue.h> #define USB_VENDOR_APPLE 0x05ac #define IPHETH_USBINTF_CLASS 255 #define IPHETH_USBINTF_SUBCLASS 253 #define IPHETH_USBINTF_PROTO 1 #define IPHETH_BUF_SIZE 1516 #define IPHETH_IP_ALIGN 2 /* padding at front of URB */ #define IPHETH_TX_TIMEOUT (5 * HZ) #define IPHETH_INTFNUM 2 #define IPHETH_ALT_INTFNUM 1 #define IPHETH_CTRL_ENDP 0x00 #define IPHETH_CTRL_BUF_SIZE 0x40 #define IPHETH_CTRL_TIMEOUT (5 * HZ) #define IPHETH_CMD_GET_MACADDR 0x00 #define IPHETH_CMD_CARRIER_CHECK 0x45 #define IPHETH_CARRIER_CHECK_TIMEOUT round_jiffies_relative(1 * HZ) #define IPHETH_CARRIER_ON 0x04 static const struct usb_device_id ipheth_table[] = { { USB_VENDOR_AND_INTERFACE_INFO(USB_VENDOR_APPLE, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO) }, { } }; MODULE_DEVICE_TABLE(usb, ipheth_table); struct ipheth_device { struct usb_device *udev; struct usb_interface *intf; struct net_device *net; struct urb *tx_urb; struct urb *rx_urb; unsigned char *tx_buf; unsigned char *rx_buf; unsigned char *ctrl_buf; u8 bulk_in; u8 bulk_out; struct delayed_work carrier_work; bool confirmed_pairing; }; static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags); static int ipheth_alloc_urbs(struct ipheth_device *iphone) { struct urb *tx_urb = NULL; struct urb *rx_urb = NULL; u8 *tx_buf = NULL; u8 *rx_buf = NULL; tx_urb = usb_alloc_urb(0, GFP_KERNEL); if (tx_urb == NULL) goto error_nomem; rx_urb = usb_alloc_urb(0, GFP_KERNEL); if (rx_urb == NULL) goto free_tx_urb; tx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE, GFP_KERNEL, &tx_urb->transfer_dma); if (tx_buf == NULL) goto free_rx_urb; rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE, GFP_KERNEL, &rx_urb->transfer_dma); if (rx_buf == NULL) goto free_tx_buf; iphone->tx_urb = tx_urb; iphone->rx_urb = rx_urb; iphone->tx_buf = tx_buf; iphone->rx_buf = rx_buf; return 0; free_tx_buf: usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, tx_buf, tx_urb->transfer_dma); free_rx_urb: usb_free_urb(rx_urb); free_tx_urb: usb_free_urb(tx_urb); error_nomem: return -ENOMEM; } static void ipheth_free_urbs(struct ipheth_device *iphone) { usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf, iphone->rx_urb->transfer_dma); usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf, iphone->tx_urb->transfer_dma); usb_free_urb(iphone->rx_urb); usb_free_urb(iphone->tx_urb); } static void ipheth_kill_urbs(struct ipheth_device *dev) { usb_kill_urb(dev->tx_urb); usb_kill_urb(dev->rx_urb); } static void ipheth_rcvbulk_callback(struct urb *urb) { struct ipheth_device *dev; struct sk_buff *skb; int status; char *buf; int len; dev = urb->context; if (dev == NULL) return; status = urb->status; switch (status) { case -ENOENT: case -ECONNRESET: case -ESHUTDOWN: case -EPROTO: return; case 0: break; default: dev_err(&dev->intf->dev, "%s: urb status: %d\n", __func__, status); return; } if (urb->actual_length <= IPHETH_IP_ALIGN) { dev->net->stats.rx_length_errors++; return; } len = urb->actual_length - IPHETH_IP_ALIGN; buf = urb->transfer_buffer + IPHETH_IP_ALIGN; skb = dev_alloc_skb(len); if (!skb) { dev_err(&dev->intf->dev, "%s: dev_alloc_skb: -ENOMEM\n", __func__); dev->net->stats.rx_dropped++; return; } skb_put_data(skb, buf, len); skb->dev = dev->net; skb->protocol = eth_type_trans(skb, dev->net); dev->net->stats.rx_packets++; dev->net->stats.rx_bytes += len; dev->confirmed_pairing = true; netif_rx(skb); ipheth_rx_submit(dev, GFP_ATOMIC); } static void ipheth_sndbulk_callback(struct urb *urb) { struct ipheth_device *dev; int status = urb->status; dev = urb->context; if (dev == NULL) return; if (status != 0 && status != -ENOENT && status != -ECONNRESET && status != -ESHUTDOWN) dev_err(&dev->intf->dev, "%s: urb status: %d\n", __func__, status); if (status == 0) netif_wake_queue(dev->net); else // on URB error, trigger immediate poll schedule_delayed_work(&dev->carrier_work, 0); } static int ipheth_carrier_set(struct ipheth_device *dev) { struct usb_device *udev; int retval; if (!dev->confirmed_pairing) return 0; udev = dev->udev; retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP), IPHETH_CMD_CARRIER_CHECK, /* request */ 0xc0, /* request type */ 0x00, /* value */ 0x02, /* index */ dev->ctrl_buf, IPHETH_CTRL_BUF_SIZE, IPHETH_CTRL_TIMEOUT); if (retval < 0) { dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n", __func__, retval); return retval; } if (dev->ctrl_buf[0] == IPHETH_CARRIER_ON) { netif_carrier_on(dev->net); if (dev->tx_urb->status != -EINPROGRESS) netif_wake_queue(dev->net); } else { netif_carrier_off(dev->net); netif_stop_queue(dev->net); } return 0; } static void ipheth_carrier_check_work(struct work_struct *work) { struct ipheth_device *dev = container_of(work, struct ipheth_device, carrier_work.work); ipheth_carrier_set(dev); schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT); } static int ipheth_get_macaddr(struct ipheth_device *dev) { struct usb_device *udev = dev->udev; struct net_device *net = dev->net; int retval; retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP), IPHETH_CMD_GET_MACADDR, /* request */ 0xc0, /* request type */ 0x00, /* value */ 0x02, /* index */ dev->ctrl_buf, IPHETH_CTRL_BUF_SIZE, IPHETH_CTRL_TIMEOUT); if (retval < 0) { dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n", __func__, retval); } else if (retval < ETH_ALEN) { dev_err(&dev->intf->dev, "%s: usb_control_msg: short packet: %d bytes\n", __func__, retval); retval = -EINVAL; } else { memcpy(net->dev_addr, dev->ctrl_buf, ETH_ALEN); retval = 0; } return retval; } static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags) { struct usb_device *udev = dev->udev; int retval; usb_fill_bulk_urb(dev->rx_urb, udev, usb_rcvbulkpipe(udev, dev->bulk_in), dev->rx_buf, IPHETH_BUF_SIZE, ipheth_rcvbulk_callback, dev); dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; retval = usb_submit_urb(dev->rx_urb, mem_flags); if (retval) dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n", __func__, retval); return retval; } static int ipheth_open(struct net_device *net) { struct ipheth_device *dev = netdev_priv(net); struct usb_device *udev = dev->udev; int retval = 0; usb_set_interface(udev, IPHETH_INTFNUM, IPHETH_ALT_INTFNUM); retval = ipheth_carrier_set(dev); if (retval) return retval; retval = ipheth_rx_submit(dev, GFP_KERNEL); if (retval) return retval; schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT); return retval; } static int ipheth_close(struct net_device *net) { struct ipheth_device *dev = netdev_priv(net); cancel_delayed_work_sync(&dev->carrier_work); netif_stop_queue(net); return 0; } static int ipheth_tx(struct sk_buff *skb, struct net_device *net) { struct ipheth_device *dev = netdev_priv(net); struct usb_device *udev = dev->udev; int retval; /* Paranoid */ if (skb->len > IPHETH_BUF_SIZE) { WARN(1, "%s: skb too large: %d bytes\n", __func__, skb->len); dev->net->stats.tx_dropped++; dev_kfree_skb_any(skb); return NETDEV_TX_OK; } memcpy(dev->tx_buf, skb->data, skb->len); if (skb->len < IPHETH_BUF_SIZE) memset(dev->tx_buf + skb->len, 0, IPHETH_BUF_SIZE - skb->len); usb_fill_bulk_urb(dev->tx_urb, udev, usb_sndbulkpipe(udev, dev->bulk_out), dev->tx_buf, IPHETH_BUF_SIZE, ipheth_sndbulk_callback, dev); dev->tx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; netif_stop_queue(net); retval = usb_submit_urb(dev->tx_urb, GFP_ATOMIC); if (retval) { dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n", __func__, retval); dev->net->stats.tx_errors++; dev_kfree_skb_any(skb); netif_wake_queue(net); } else { dev->net->stats.tx_packets++; dev->net->stats.tx_bytes += skb->len; dev_consume_skb_any(skb); } return NETDEV_TX_OK; } static void ipheth_tx_timeout(struct net_device *net, unsigned int txqueue) { struct ipheth_device *dev = netdev_priv(net); dev_err(&dev->intf->dev, "%s: TX timeout\n", __func__); dev->net->stats.tx_errors++; usb_unlink_urb(dev->tx_urb); } static u32 ipheth_ethtool_op_get_link(struct net_device *net) { struct ipheth_device *dev = netdev_priv(net); return netif_carrier_ok(dev->net); } static const struct ethtool_ops ops = { .get_link = ipheth_ethtool_op_get_link }; static const struct net_device_ops ipheth_netdev_ops = { .ndo_open = ipheth_open, .ndo_stop = ipheth_close, .ndo_start_xmit = ipheth_tx, .ndo_tx_timeout = ipheth_tx_timeout, }; static int ipheth_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_device *udev = interface_to_usbdev(intf); struct usb_host_interface *hintf; struct usb_endpoint_descriptor *endp; struct ipheth_device *dev; struct net_device *netdev; int i; int retval; netdev = alloc_etherdev(sizeof(struct ipheth_device)); if (!netdev) return -ENOMEM; netdev->netdev_ops = &ipheth_netdev_ops; netdev->watchdog_timeo = IPHETH_TX_TIMEOUT; strcpy(netdev->name, "eth%d"); dev = netdev_priv(netdev); dev->udev = udev; dev->net = netdev; dev->intf = intf; dev->confirmed_pairing = false; /* Set up endpoints */ hintf = usb_altnum_to_altsetting(intf, IPHETH_ALT_INTFNUM); if (hintf == NULL) { retval = -ENODEV; dev_err(&intf->dev, "Unable to find alternate settings interface\n"); goto err_endpoints; } for (i = 0; i < hintf->desc.bNumEndpoints; i++) { endp = &hintf->endpoint[i].desc; if (usb_endpoint_is_bulk_in(endp)) dev->bulk_in = endp->bEndpointAddress; else if (usb_endpoint_is_bulk_out(endp)) dev->bulk_out = endp->bEndpointAddress; } if (!(dev->bulk_in && dev->bulk_out)) { retval = -ENODEV; dev_err(&intf->dev, "Unable to find endpoints\n"); goto err_endpoints; } dev->ctrl_buf = kmalloc(IPHETH_CTRL_BUF_SIZE, GFP_KERNEL); if (dev->ctrl_buf == NULL) { retval = -ENOMEM; goto err_alloc_ctrl_buf; } retval = ipheth_get_macaddr(dev); if (retval) goto err_get_macaddr; INIT_DELAYED_WORK(&dev->carrier_work, ipheth_carrier_check_work); retval = ipheth_alloc_urbs(dev); if (retval) { dev_err(&intf->dev, "error allocating urbs: %d\n", retval); goto err_alloc_urbs; } usb_set_intfdata(intf, dev); SET_NETDEV_DEV(netdev, &intf->dev); netdev->ethtool_ops = &ops; retval = register_netdev(netdev); if (retval) { dev_err(&intf->dev, "error registering netdev: %d\n", retval); retval = -EIO; goto err_register_netdev; } // carrier down and transmit queues stopped until packet from device netif_carrier_off(netdev); netif_tx_stop_all_queues(netdev); dev_info(&intf->dev, "Apple iPhone USB Ethernet device attached\n"); return 0; err_register_netdev: ipheth_free_urbs(dev); err_alloc_urbs: err_get_macaddr: err_alloc_ctrl_buf: kfree(dev->ctrl_buf); err_endpoints: free_netdev(netdev); return retval; } static void ipheth_disconnect(struct usb_interface *intf) { struct ipheth_device *dev; dev = usb_get_intfdata(intf); if (dev != NULL) { unregister_netdev(dev->net); ipheth_kill_urbs(dev); ipheth_free_urbs(dev); kfree(dev->ctrl_buf); free_netdev(dev->net); } usb_set_intfdata(intf, NULL); dev_info(&intf->dev, "Apple iPhone USB Ethernet now disconnected\n"); } static struct usb_driver ipheth_driver = { .name = "ipheth", .probe = ipheth_probe, .disconnect = ipheth_disconnect, .id_table = ipheth_table, .disable_hub_initiated_lpm = 1, }; module_usb_driver(ipheth_driver); MODULE_AUTHOR("Diego Giagio <[email protected]>"); MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver"); MODULE_LICENSE("Dual BSD/GPL");
{ "pile_set_name": "Github" }
record_types { type_info { name: "SuperSpeaker" size: 16 alignment: 8 referenced_type: "_ZTI12SuperSpeaker" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h" linker_set_key: "_ZTI12SuperSpeaker" self_type: "_ZTI12SuperSpeaker" } fields { referenced_type: "_ZTIi" field_offset: 64 field_name: "mSpeakderId" access: private_access } vtable_layout { vtable_components { kind: OffsetToTop mangled_component_name: "" component_value: 0 is_pure: false } vtable_components { kind: RTTI mangled_component_name: "_ZTI12SuperSpeaker" component_value: 0 is_pure: false } vtable_components { kind: FunctionPointer mangled_component_name: "_ZN12SuperSpeaker5SpeakEv" component_value: 0 is_pure: true } vtable_components { kind: FunctionPointer mangled_component_name: "_ZN12SuperSpeaker6ListenEv" component_value: 0 is_pure: true } vtable_components { kind: CompleteDtorPointer mangled_component_name: "_ZN12SuperSpeakerD1Ev" component_value: 0 is_pure: false } vtable_components { kind: DeletingDtorPointer mangled_component_name: "_ZN12SuperSpeakerD0Ev" component_value: 0 is_pure: false } } access: public_access record_kind: class_kind } record_types { type_info { name: "LowVolumeSpeaker" size: 24 alignment: 8 referenced_type: "_ZTI16LowVolumeSpeaker" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h" linker_set_key: "_ZTI16LowVolumeSpeaker" self_type: "_ZTI16LowVolumeSpeaker" } fields { referenced_type: "_ZTIj" field_offset: 96 field_name: "speaker_uint_t" access: public_access } fields { referenced_type: "_ZTIPf" field_offset: 128 field_name: "speaker_float_star" access: public_access } base_specifiers { referenced_type: "_ZTI12SuperSpeaker" is_virtual: false access: public_access } vtable_layout { vtable_components { kind: OffsetToTop mangled_component_name: "" component_value: 0 is_pure: false } vtable_components { kind: RTTI mangled_component_name: "_ZTI16LowVolumeSpeaker" component_value: 0 is_pure: false } vtable_components { kind: FunctionPointer mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv" component_value: 0 is_pure: false } vtable_components { kind: FunctionPointer mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv" component_value: 0 is_pure: false } vtable_components { kind: CompleteDtorPointer mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev" component_value: 0 is_pure: false } vtable_components { kind: DeletingDtorPointer mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev" component_value: 0 is_pure: false } } access: public_access record_kind: class_kind } record_types { type_info { name: "HighVolumeSpeaker" size: 16 alignment: 8 referenced_type: "_ZTI17HighVolumeSpeaker" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h" linker_set_key: "_ZTI17HighVolumeSpeaker" self_type: "_ZTI17HighVolumeSpeaker" } base_specifiers { referenced_type: "_ZTI12SuperSpeaker" is_virtual: false access: public_access } vtable_layout { vtable_components { kind: OffsetToTop mangled_component_name: "" component_value: 0 is_pure: false } vtable_components { kind: RTTI mangled_component_name: "_ZTI17HighVolumeSpeaker" component_value: 0 is_pure: false } vtable_components { kind: FunctionPointer mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv" component_value: 0 is_pure: false } vtable_components { kind: FunctionPointer mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv" component_value: 0 is_pure: false } vtable_components { kind: CompleteDtorPointer mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev" component_value: 0 is_pure: false } vtable_components { kind: DeletingDtorPointer mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev" component_value: 0 is_pure: false } } access: public_access record_kind: class_kind } enum_types { type_info { name: "SuperSpeaker::Volume" size: 4 alignment: 4 referenced_type: "_ZTIN12SuperSpeaker6VolumeE" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h" linker_set_key: "_ZTIN12SuperSpeaker6VolumeE" self_type: "_ZTIN12SuperSpeaker6VolumeE" } underlying_type: "_ZTIj" enum_fields { enum_field_value: 1 name: "SuperSpeaker::Loud" } enum_fields { enum_field_value: 2 name: "SuperSpeaker::Louder" } enum_fields { enum_field_value: 3 name: "SuperSpeaker::Loudest" } enum_fields { enum_field_value: 0 name: "SuperSpeaker::Lower" } access: private_access } pointer_types { type_info { name: "SuperSpeaker *" size: 8 alignment: 8 referenced_type: "_ZTI12SuperSpeaker" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h" linker_set_key: "_ZTIP12SuperSpeaker" self_type: "_ZTIP12SuperSpeaker" } } pointer_types { type_info { name: "LowVolumeSpeaker *" size: 8 alignment: 8 referenced_type: "_ZTI16LowVolumeSpeaker" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h" linker_set_key: "_ZTIP16LowVolumeSpeaker" self_type: "_ZTIP16LowVolumeSpeaker" } } pointer_types { type_info { name: "HighVolumeSpeaker *" size: 8 alignment: 8 referenced_type: "_ZTI17HighVolumeSpeaker" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h" linker_set_key: "_ZTIP17HighVolumeSpeaker" self_type: "_ZTIP17HighVolumeSpeaker" } } pointer_types { type_info { name: "float *" size: 8 alignment: 8 referenced_type: "_ZTIf" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h" linker_set_key: "_ZTIPf" self_type: "_ZTIPf" } } builtin_types { type_info { name: "float" size: 4 alignment: 4 referenced_type: "_ZTIf" source_file: "" linker_set_key: "_ZTIf" self_type: "_ZTIf" } is_unsigned: false is_integral: false } builtin_types { type_info { name: "int" size: 4 alignment: 4 referenced_type: "_ZTIi" source_file: "" linker_set_key: "_ZTIi" self_type: "_ZTIi" } is_unsigned: false is_integral: true } builtin_types { type_info { name: "unsigned int" size: 4 alignment: 4 referenced_type: "_ZTIj" source_file: "" linker_set_key: "_ZTIj" self_type: "_ZTIj" } is_unsigned: true is_integral: true } builtin_types { type_info { name: "void" size: 0 alignment: 0 referenced_type: "_ZTIv" source_file: "" linker_set_key: "_ZTIv" self_type: "_ZTIv" } is_unsigned: false is_integral: false } functions { return_type: "_ZTIv" function_name: "SuperSpeaker::SpeakLouder" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h" parameters { referenced_type: "_ZTIP12SuperSpeaker" default_arg: false is_this_ptr: true } linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv" access: public_access } functions { return_type: "_ZTIP12SuperSpeaker" function_name: "SuperSpeaker::CreateSuperSpeaker" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h" parameters { referenced_type: "_ZTIi" default_arg: false is_this_ptr: false } linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi" access: private_access } functions { return_type: "_ZTIN12SuperSpeaker6VolumeE" function_name: "SuperSpeaker::SpeakLoud" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h" parameters { referenced_type: "_ZTIP12SuperSpeaker" default_arg: false is_this_ptr: true } linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv" access: public_access } functions { return_type: "_ZTIv" function_name: "LowVolumeSpeaker::Speak" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h" parameters { referenced_type: "_ZTIP16LowVolumeSpeaker" default_arg: false is_this_ptr: true } linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv" access: public_access } functions { return_type: "_ZTIv" function_name: "LowVolumeSpeaker::Listen" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h" parameters { referenced_type: "_ZTIP16LowVolumeSpeaker" default_arg: false is_this_ptr: true } linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv" access: public_access } functions { return_type: "_ZTIP17HighVolumeSpeaker" function_name: "HighVolumeSpeaker::BadPractice" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h" parameters { referenced_type: "_ZTIP17HighVolumeSpeaker" default_arg: false is_this_ptr: true } parameters { referenced_type: "_ZTIf" default_arg: false is_this_ptr: false } linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf" access: public_access } functions { return_type: "_ZTIv" function_name: "HighVolumeSpeaker::Speak" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h" parameters { referenced_type: "_ZTIP17HighVolumeSpeaker" default_arg: false is_this_ptr: true } linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv" access: public_access } functions { return_type: "_ZTIv" function_name: "HighVolumeSpeaker::Listen" source_file: "development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h" parameters { referenced_type: "_ZTIP17HighVolumeSpeaker" default_arg: false is_this_ptr: true } linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv" access: public_access } elf_functions { name: "_Z26test_virtual_function_callP12SuperSpeaker" binding: Global } elf_functions { name: "_ZN12NotReferenced" binding: Global } elf_functions { name: "_ZN12SuperSpeaker11SpeakLouderEv" binding: Global } elf_functions { name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi" binding: Global } elf_functions { name: "_ZN12SuperSpeaker9SpeakLoudEv" binding: Global } elf_functions { name: "_ZN16LowVolumeSpeaker5SpeakEv" binding: Global } elf_functions { name: "_ZN16LowVolumeSpeaker6ListenEv" binding: Global } elf_functions { name: "_ZN17HighVolumeSpeaker11BadPracticeEf" binding: Global } elf_functions { name: "_ZN17HighVolumeSpeaker5SpeakEv" binding: Global } elf_functions { name: "_ZN17HighVolumeSpeaker6ListenEv" binding: Global } elf_objects { name: "_ZTV16LowVolumeSpeaker" binding: Global } elf_objects { name: "_ZTV17HighVolumeSpeaker" binding: Global }
{ "pile_set_name": "Github" }
LIBRARY WINHTTP.dll EXPORTS WinHttpAddRequestHeaders WinHttpAutoProxySvcMain WinHttpCheckPlatform WinHttpCloseHandle WinHttpConnect WinHttpConnectionDeletePolicyEntries WinHttpConnectionDeleteProxyInfo WinHttpConnectionFreeNameList WinHttpConnectionFreeProxyInfo WinHttpConnectionFreeProxyList WinHttpConnectionGetNameList WinHttpConnectionGetProxyInfo WinHttpConnectionGetProxyList WinHttpConnectionSetPolicyEntries WinHttpConnectionSetProxyInfo WinHttpConnectionUpdateIfIndexTable WinHttpCrackUrl WinHttpCreateProxyResolver WinHttpCreateUrl WinHttpDetectAutoProxyConfigUrl WinHttpFreeProxyResult WinHttpFreeProxyResultEx WinHttpFreeProxySettings WinHttpGetDefaultProxyConfiguration WinHttpGetIEProxyConfigForCurrentUser WinHttpGetProxyForUrl WinHttpGetProxyForUrlEx WinHttpGetProxyForUrlEx2 WinHttpGetProxyForUrlHvsi WinHttpGetProxyResult WinHttpGetProxyResultEx WinHttpGetProxySettingsVersion WinHttpGetTunnelSocket WinHttpOpen WinHttpOpenRequest WinHttpProbeConnectivity WinHttpQueryAuthSchemes WinHttpQueryDataAvailable WinHttpQueryHeaders WinHttpQueryOption WinHttpReadData WinHttpReadProxySettings WinHttpReadProxySettingsHvsi WinHttpReceiveResponse WinHttpResetAutoProxy WinHttpSaveProxyCredentials WinHttpSendRequest WinHttpSetCredentials WinHttpSetDefaultProxyConfiguration WinHttpSetOption WinHttpSetStatusCallback WinHttpSetTimeouts WinHttpTimeFromSystemTime WinHttpTimeToSystemTime WinHttpWebSocketClose WinHttpWebSocketCompleteUpgrade WinHttpWebSocketQueryCloseStatus WinHttpWebSocketReceive WinHttpWebSocketSend WinHttpWebSocketShutdown WinHttpWriteData WinHttpWriteProxySettings
{ "pile_set_name": "Github" }
# Copyright (C) 2013 Zentyal S.L. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as # published by the Free Software Foundation. # # 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 use strict; use warnings; use EBox::Exceptions::MissingArgument; package EBox::Samba::DNS::Record; sub new { my ($class, %params) = @_; throw EBox::Exceptions::MissingArgument('type') unless defined $params{type}; my $self = {}; $self->{type} = $params{type}; bless ($self, $class); return $self; } sub type { my ($self) = @_; return $self->{type}; } sub _decode_DNS_COUNT_NAME { my ($self, $blob) = @_; my ($length, $labelCount, $rawName) = unpack ('C C a*', $blob); my @labels; for (my $i=1; $i <= $labelCount; $i++) { my ($labelLength, $label) = unpack ("C \@0C/a*", $rawName); push (@labels, $label); $rawName = substr ($rawName, $labelLength+1); } return join ('.', @labels); } 1;
{ "pile_set_name": "Github" }
.class public Landroid/support/v7/app/NotificationCompat$DecoratedMediaCustomViewStyle; .super Landroid/support/v4/media/app/NotificationCompat$DecoratedMediaCustomViewStyle; # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Landroid/support/v7/app/NotificationCompat; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x9 name = "DecoratedMediaCustomViewStyle" .end annotation .annotation runtime Ljava/lang/Deprecated; .end annotation # direct methods .method public constructor <init>()V .locals 0 .annotation runtime Ljava/lang/Deprecated; .end annotation invoke-direct {p0}, Landroid/support/v4/media/app/NotificationCompat$DecoratedMediaCustomViewStyle;-><init>()V return-void .end method
{ "pile_set_name": "Github" }
/*! \mainpage * * \section intro_sec Introduction and links * This is the source documentation for the \b %MaNGOS (Massive Network Game %Object Server) project.\n * %MaNGOS is an object-oriented Massively Multiplayer Online Role-Playing Game Server (MMORPGS).\n * The project documentation and the bug tracker can be found on the <A HREF="http://getmangos.com/wiki">%MaNGOS wiki</A>. * * \section begin Where to begin? * If you are interested in understanding the source code of this project you can begin * - <A HREF="http://getmangos.com/wiki/">On the wiki</A> to get an overview of the different modules of the server * - <A HREF="./modules.html">In this source doumentation</A>, starting at the module hierarchy */ /*! \defgroup realmd Realm Daemon */ /*! \defgroup mangos Mangos Deamon */ /*! \defgroup mangosd Daemon starter \ingroup mangos */ /*! \defgroup u2w User Connections \ingroup mangos */ /*! \defgroup world The World \ingroup mangos */
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> </configuration>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <Keyboards> <!-- Dictionary attributes: "nameResId" : the name of the keyboard. Should be short. Reference to a string in values.xml "defaultDictionaryLocale" : the ID of the keyboard's (ISO) locale, e.g., "en", "iw", "ar", "ru", etc. The dictionary should declare the same locale. "id" : UUID for this keyboard. Obtain from here: http://www.famkruithof.net/uuid/uuidgen "iconResId" : a reference to a drawable which can be used to show a flag in the notification bar. "layoutResId" : a reference to a keyboard layout XML. See res/xml/qwerty.xml --> <Keyboard nameResId="@string/sardinian_keyboard" iconResId="@drawable/ic_status_sardinian" layoutResId="@xml/sardinian_qwerty" landscapeResId="@xml/sardinian_qwerty" id="31cfcca0-1118-11e9-b56e-0800200c9a66" defaultDictionaryLocale="sc" description="Sardinian QWERTY" index="1" /> </Keyboards>
{ "pile_set_name": "Github" }
/*============================================================================== Program: 3D Slicer Copyright (c) Kitware Inc. See COPYRIGHT.txt or http://www.slicer.org/copyright/copyright.txt for details. 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. This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc. and was partially funded by NIH grant 3P41RR013218-12S1 ==============================================================================*/ #ifndef __qSlicerCoreApplication_h #define __qSlicerCoreApplication_h // Qt includes #include <QApplication> #include <QMetaType> #include <QProcessEnvironment> #include <QStringList> #include <QVariant> // CTK includes #include <ctkVTKObject.h> // SlicerCore includes #include "vtkSlicerConfigure.h" // For Slicer_USE_PYTHONQT #include "qSlicerBaseQTCoreExport.h" #ifdef Slicer_BUILD_DICOM_SUPPORT class ctkDICOMDatabase; #endif class ctkErrorLogAbstractModel; class QSettings; class qSlicerCoreIOManager; class qSlicerCoreCommandOptions; class qSlicerCoreApplicationPrivate; class qSlicerModuleManager; #ifdef Slicer_USE_PYTHONQT class qSlicerCorePythonManager; class ctkPythonConsole; #endif #ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT class qSlicerExtensionsManagerModel; #endif class vtkDataIOManagerLogic; class vtkSlicerApplicationLogic; class vtkMRMLApplicationLogic; class vtkMRMLRemoteIOLogic; class vtkMRMLScene; class Q_SLICER_BASE_QTCORE_EXPORT qSlicerCoreApplication : public QApplication { Q_OBJECT QVTK_OBJECT Q_ENUMS(ReturnCode) /// This property holds the path where the Slicer application is. /// For example, for an installed Slicer on Windows, the path can be /// "C:\Program Files (x86)\Slicer 4.4.0\". /// \sa slicerHome(), temporaryPath, isInstalled Q_PROPERTY(QString slicerHome READ slicerHome CONSTANT) Q_PROPERTY(QString defaultScenePath READ defaultScenePath WRITE setDefaultScenePath) Q_PROPERTY(QString slicerSharePath READ slicerSharePath CONSTANT) Q_PROPERTY(QString temporaryPath READ temporaryPath WRITE setTemporaryPath) Q_PROPERTY(QString launcherExecutableFilePath READ launcherExecutableFilePath CONSTANT) Q_PROPERTY(QString launcherSettingsFilePath READ launcherSettingsFilePath CONSTANT) Q_PROPERTY(QString slicerDefaultSettingsFilePath READ slicerDefaultSettingsFilePath CONSTANT) Q_PROPERTY(QString slicerUserSettingsFilePath READ slicerUserSettingsFilePath CONSTANT) Q_PROPERTY(QString slicerRevisionUserSettingsFilePath READ slicerRevisionUserSettingsFilePath CONSTANT) Q_PROPERTY(QString extensionsInstallPath READ extensionsInstallPath WRITE setExtensionsInstallPath) Q_PROPERTY(QString intDir READ intDir CONSTANT) Q_PROPERTY(bool isInstalled READ isInstalled CONSTANT) Q_PROPERTY(QString releaseType READ releaseType CONSTANT) Q_PROPERTY(QString repositoryUrl READ repositoryUrl CONSTANT) Q_PROPERTY(QString repositoryBranch READ repositoryBranch CONSTANT) Q_PROPERTY(QString repositoryRevision READ repositoryRevision CONSTANT) Q_PROPERTY(QString revision READ revision CONSTANT) Q_PROPERTY(int majorVersion READ majorVersion CONSTANT) Q_PROPERTY(int minorVersion READ minorVersion CONSTANT) Q_PROPERTY(QString platform READ platform CONSTANT) Q_PROPERTY(QString arch READ arch CONSTANT) Q_PROPERTY(QString os READ os CONSTANT) Q_PROPERTY(bool isCustomMainApplication READ isCustomMainApplication CONSTANT) Q_PROPERTY(QString mainApplicationName READ mainApplicationName CONSTANT) Q_PROPERTY(QString mainApplicationRepositoryUrl READ mainApplicationRepositoryUrl CONSTANT) Q_PROPERTY(QString mainApplicationRepositoryRevision READ mainApplicationRepositoryRevision CONSTANT) Q_PROPERTY(QString mainApplicationRevision READ mainApplicationRevision CONSTANT) Q_PROPERTY(int mainApplicationMajorVersion READ mainApplicationMajorVersion CONSTANT) Q_PROPERTY(int mainApplicationMinorVersion READ mainApplicationMinorVersion CONSTANT) Q_PROPERTY(int mainApplicationPatchVersion READ mainApplicationPatchVersion CONSTANT) public: typedef QApplication Superclass; qSlicerCoreApplication(int &argc, char **argv); ~qSlicerCoreApplication() override; /// Return a reference to the application singleton static qSlicerCoreApplication* application(); /// Used in addition to existing QCoreApplication attribute. /// \sa Qt::ApplicationAttribute enum ApplicationAttribute { AA_DisablePython = 1000, AA_EnableTesting }; /// \sa QCoreApplication::setAttribute static void setAttribute(qSlicerCoreApplication::ApplicationAttribute attribute, bool on = true); /// \sa QCoreApplication::testAttribute static bool testAttribute(qSlicerCoreApplication::ApplicationAttribute attribute); /// \brief Returns the environment without the Slicer specific values. /// /// Path environment variables like `PATH`, `LD_LIBRARY_PATH` or `PYTHONPATH` /// will not contain values found in the launcher settings. /// /// Similarly `key=value` environment variables also found in the launcher /// settings are excluded. Note that if a value was associated with a key prior /// starting Slicer, it will not be set in the environment returned by this /// function. /// /// The function excludes both the Slicer launcher settings and the revision /// specific launcher settings. /// /// \sa launcherSettingsFilePath(), launcherRevisionSpecificUserSettingsFilePath() /// \sa repositoryRevision() /// \sa environment() Q_INVOKABLE QProcessEnvironment startupEnvironment() const; /// \brief Returns the current environment. /// /// The returned environment contains all values found in the launcher /// settings. /// /// \note Environment variables set from python updating `os.environ` or /// set from c++ directly calling `putenv()` will **NOT** be found in the /// environment returned by this function. /// /// \sa setEnvironmentVariable(const QString& key, const QString& value); Q_INVOKABLE QProcessEnvironment environment() const; /// \brief Convenient function to set an environment variable. /// /// \note Using this function will ensure that the environment is up-to-date for /// processes started using QProcess or other alternative methods. void setEnvironmentVariable(const QString& key, const QString& value); /// Returns True if environment variable identified by \a key is set to \a value bool isEnvironmentVariableValueSet(const QString& key, const QString& value); /// Convenient function allowing to prepend \a value to environment variable identified by /// by \a key using \a separator void prependEnvironmentVariable(const QString& key, const QString& value, QChar separator = ';'); /// Convenient function allowing to append \a value to environment variable identified by /// by \a key using \a separator void appendEnvironmentVariable(const QString& key, const QString& value, QChar separator = ';'); /// Parse arguments /// \note If exitWhenDone is True, it's your responsibility to exit the application void parseArguments(bool& exitWhenDone); enum ReturnCode{ ExitNotRequested = -1, ExitSuccess = EXIT_SUCCESS, ExitFailure = EXIT_FAILURE }; /// Return exit code that may be set before the main event loop started or after /// it exited. /// /// After parsing arguments and before starting the event loop using exec(), /// returnCode is set if early exit was requested or if there was a parsing error. /// /// After exiting the event loop, returnCode is set if there was an error /// during cleanup performed in onAboutToQuit(). /// /// Returns -1 if the application has not been asked to exit. /// EXIT_SUCCESS (0) if the application must return in success. /// EXIT_FAILURE (1) if the application failed. /// /// \sa exec() int returnCode()const; /// Enters the main event loop and waits until exit(), quit() or terminate() is called. /// /// To ensure that python exceptions occurring during the module unloading performed /// in onAboutToQuit() are considered, it is important to start the event loop directly /// calling this function. /// /// Note that the override of return code if an exception is raised during module /// cleanup happens only if testing mode is enabled. /// /// \sa QApplication::exec(), returnCode() /// \sa qSlicerCoreCommandOptions::isTestingEnabled() static int exec(); /// Get MRML Scene Q_INVOKABLE vtkMRMLScene* mrmlScene() const; /// Get application logic Q_INVOKABLE vtkSlicerApplicationLogic* applicationLogic() const; /// Get slicer home directory /// \sa slicerHome QString slicerHome() const; /// Get default scene directory /// /// This returns the full path where scenes are saved to by default /// QString defaultScenePath() const; /// Set default slicer scene directory void setDefaultScenePath(const QString& path); /// Get slicer share directory /// /// This returns the partial path where slicer resources are located, which /// is normally of the form <code>"share/Slicer-<i>version</i>"</code>. /// /// \sa slicerSharePath, slicerHome() QString slicerSharePath() const; /// Returns True if module identified by \a moduleFileName is a descendant of slicer home. /// \sa slicerHome() bool isEmbeddedModule(const QString& moduleFileName)const; /// Get slicer default temporary directory QString defaultTemporaryPath() const; /// Get slicer temporary directory QString temporaryPath() const; /// Set slicer temporary directory void setTemporaryPath(const QString& path); /// If any, return slicer launcher executable file path. QString launcherExecutableFilePath()const; /// If any, return slicer launcher settings file path. QString launcherSettingsFilePath()const; /// If any, return slicer user settings file path specific to a given revision of Slicer. QString launcherRevisionSpecificUserSettingsFilePath()const; /// If any, return slicer default settings file path. /// \sa defaultSettings() QString slicerDefaultSettingsFilePath()const; /// Return slicer user settings file path. /// \sa userSettings() QString slicerUserSettingsFilePath()const; /// Return slicer settings file path specific to a given revision of Slicer. /// \sa revisionUserSettings() QString slicerRevisionUserSettingsFilePath()const; /// Get slicer default extensions path QString defaultExtensionsInstallPath() const; /// Get slicer extension directory QString extensionsInstallPath() const; /// Set slicer extension directory void setExtensionsInstallPath(const QString& path); void gatherExtensionsHistoryInformationOnStartup(); /// If any, this method return the build intermediate directory /// See $(IntDir) on http://msdn.microsoft.com/en-us/library/c02as0cs%28VS.71%29.aspx QString intDir()const; /// Return true is this instance of Slicer is running from an installed directory bool isInstalled()const; /// \brief Return the release type of this instance of Slicer. /// /// Release type can be `Experimental`, `Nightly` or `Stable`. QString releaseType()const; /// Associate a module with a node type. /// It is currently only used for determining which module can edit a specific node. /// If multiple modules are registered for the same class then the node widget's /// nodeEditable method is used for determining which module is the most suitable for editing. Q_INVOKABLE void addModuleAssociatedNodeType(const QString& nodeClassName, const QString& moduleName); /// Remove association between a module and a node type. Q_INVOKABLE void removeModuleAssociatedNodeType(const QString& nodeClassName, const QString& moduleName); /// List of all modules that are associated with the specified node type. Q_INVOKABLE QStringList modulesAssociatedWithNodeType(const QString& nodeClassName) const; /// List of all node types that are associated with any module. Q_INVOKABLE QStringList allModuleAssociatedNodeTypes() const; #ifdef Slicer_USE_PYTHONQT /// Get python manager qSlicerCorePythonManager* corePythonManager()const; /// Set the IO manager /// \note qSlicerCoreApplication takes ownership of the object void setCorePythonManager(qSlicerCorePythonManager* pythonManager); /// Get python console ctkPythonConsole* pythonConsole()const; /// Set the python console /// \note qSlicerCoreApplication will not take ownership of the object, /// because it will be owned by the widget that it is part of /// (either it is part of the main window or a top-level window). void setPythonConsole(ctkPythonConsole* pythonConsole); #endif #ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT /// Get extension manager model Q_INVOKABLE qSlicerExtensionsManagerModel* extensionsManagerModel()const; /// Set the extension manager model /// \note qSlicerCoreApplication takes ownership of the object void setExtensionsManagerModel(qSlicerExtensionsManagerModel* model); #endif /// Get errorLogModel Q_INVOKABLE ctkErrorLogAbstractModel* errorLogModel()const; /// Get the module manager Q_INVOKABLE qSlicerModuleManager* moduleManager()const; /// Get the IO manager Q_INVOKABLE qSlicerCoreIOManager* coreIOManager()const; /// Set the IO manager /// \note qSlicerCoreApplication takes ownership of the object void setCoreIOManager(qSlicerCoreIOManager* ioManager); /// Get coreCommandOptions qSlicerCoreCommandOptions* coreCommandOptions()const; /// Set coreCommandOptions /// \note qSlicerCoreApplication takes ownership of the object void setCoreCommandOptions(qSlicerCoreCommandOptions* options); /// Get slicer application default settings. /// \sa slicerDefaultSettingsFilePath() Q_INVOKABLE QSettings* defaultSettings()const; /// Get slicer application user settings /// \note It will also instantiate a QSettings object if required. /// \sa slicerUserSettingsFilePath() Q_INVOKABLE QSettings* userSettings()const; /// This function has been deprecated: userSettings() should be used. /// \deprecated /// \sa userSettings() Q_INVOKABLE QSettings* settings()const; /// Get revision specific slicer application user settings /// \note It will also instantiate a QSettings object if required. /// \sa slicerRevisionSpecificUserSettingsFilePath() Q_INVOKABLE QSettings* revisionUserSettings()const; /// \brief Return if main application is custom application (not Slicer). bool isCustomMainApplication()const; /// \brief Return the name of the main application. QString mainApplicationName()const; /// Return the main application's source repository URL associated with this build. /// Useful for custom applications. /// \sa qSlicerCoreApplicationPrivate::discoverRepository QString mainApplicationRepositoryUrl()const; /// Return the main application's source repository Revision associated with this build. /// Useful for custom applications. /// \sa qSlicerCoreApplicationPrivate::discoverRepository QString mainApplicationRepositoryRevision()const; /// Return the main application's user-friendly revision identifier. /// Useful for custom applications. QString mainApplicationRevision()const; /// Return the main application's major version number. /// Useful for custom applications. int mainApplicationMajorVersion() const; /// Return the main application's minor version number. /// Useful for custom applications. int mainApplicationMinorVersion() const; /// Return the main application's patch version number. /// Useful for custom applications. int mainApplicationPatchVersion() const; /// Return the copyrights of Slicer virtual QString copyrights()const; /// Return the acknowledgment text of Slicer virtual QString acknowledgment()const; /// Return the libraries of Slicer virtual QString libraries()const; /// Return the Slicer source repository URL associated with this build /// \sa qSlicerCoreApplicationPrivate::discoverRepository QString repositoryUrl()const; /// Return the Slicer source repository Branch associated with this build /// \sa qSlicerCoreApplicationPrivate::discoverRepository QString repositoryBranch()const; /// Return the Slicer source repository Revision associated with this build /// \sa qSlicerCoreApplicationPrivate::discoverRepository QString repositoryRevision()const; /// Return Slicer's user-friendly revision identifier. QString revision()const; /// Return the Slicer major version number int majorVersion() const; /// Return the Slicer minor version number int minorVersion() const; /// Return the \a platform associated to this build /// \sa qSlicerCoreApplicationPrivate::discoverRepository QString platform()const; /// Return the \a arch associated to this build /// \sa qSlicerCoreApplicationPrivate::discoverRepository QString arch()const; /// Return the \a os associated to this build /// \sa qSlicerCoreApplicationPrivate::discoverRepository QString os()const; #ifdef Slicer_BUILD_DICOM_SUPPORT /// Return the application's main DICOM database. Q_INVOKABLE ctkDICOMDatabase* dicomDatabase() const; /// Return the application's main DICOM database as a shared pointer /// (not Python-wrappable). QSharedPointer<ctkDICOMDatabase> dicomDatabaseShared() const; #endif static void loadTranslations(const QString& dir); static void loadLanguage(); /// Load certificates bundled into '<slicerHome>/<SLICER_SHARE_DIR>/Slicer.crt'. /// For more details, see Slicer/Base/QTCore/Resources/Certs/README /// Returns \a False if 'Slicer.crt' failed to be loaded. /// \sa QSslSocket::defaultCaCertificates() static bool loadCaCertificates(const QString& slicerHome); Q_INVOKABLE int registerResource(const QByteArray& data); /// Print message on console. /// If error is true then the message is printed on stderr, otherwise on stdout. Q_INVOKABLE void showConsoleMessage(QString message, bool error=true) const; public slots: /// Restart the application with the arguments passed at startup time /// \sa QCoreApplication::arguments() static void restart(); bool unregisterResource(int handle); /// Calls setRenderPaused(pause) on the current layout manager. /// Emits pauseRenderRequested() if pause is true and resumeRenderRequested() if pause is false. /// The caller is responsible for making sure that each setRenderPaused(true) is paired with /// setRenderPaused(false). /// Implemented in qSlicerApplication /// \sa qSlicerApplication::setRenderPaused() virtual void setRenderPaused(bool pause) { Q_UNUSED(pause); }; /// Equivalent to setRenderPaused(true) /// \sa setRenderPaused virtual void pauseRender() {}; /// Equivalent to setRenderPaused(false) /// \sa setRenderPaused virtual void resumeRender() {}; protected: /// Process command line arguments **before** the applicaton event loop is started. /// \sa handleCommandLineArguments() /// \sa qSlicerApplication::startupCompleted() virtual void handlePreApplicationCommandLineArguments(); /// Set MRML Scene /// \sa vtkSlicerApplicationLogic::SetMRMLSceneDataIO virtual void setMRMLScene(vtkMRMLScene * scene); protected slots: /// Process command line arguments **atfer** the applicaton event loop is started. /// \sa handlePreApplicationCommandLineArguments() /// \sa qSlicerApplication::startupCompleted() virtual void handleCommandLineArguments(); virtual void onSlicerApplicationLogicModified(); virtual void onUserInformationModified(); void onSlicerApplicationLogicRequest(vtkObject*, void* , unsigned long); void processAppLogicModified(); void processAppLogicReadData(); void processAppLogicWriteData(); /// Editing of a MRML node has been requested. /// Implemented in qSlicerApplication. virtual void editNode(vtkObject*, void*, unsigned long) {}; /// Set the ReturnCode flag and call QCoreApplication::exit() void terminate(int exitCode = qSlicerCoreApplication::ExitSuccess); /// Perform application cleanup following a call to QCoreApplication::exit(). virtual void onAboutToQuit(); /// Called when the application logic requests a delayed event invocation. /// When the singleton application logic fires the RequestInvokeEvent, /// \sa invokeEvent(), vtkMRMLApplicationLogic::InvokeRequest /// \sa onSlicerApplicationLogicRequest(), processAppLogicModified() void requestInvokeEvent(vtkObject* caller, void* callData); /// a timer is created, and on timeout, \a invokeEvent() is called to /// propagate the requested event invocation. /// \sa invokeEventRequested(), requestInvokeEvent(), invokeEvent() void scheduleInvokeEvent(unsigned int delay, void* caller, unsigned long event, void* callData); /// Internal method called only when a special QTimer times out. /// The timer contains dynamic properties describing an event to invoke on /// a specific object. /// \sa requestInvokeEvent void invokeEvent(); signals: void mrmlSceneChanged(vtkMRMLScene* mrmlScene); /// Signal is emmited when a url argument is processed with the slicer:// protocol /// The url string is emitted with the signal. /// Modules can connect to this signal to handle url arguments. void urlReceived(QString url); /// Internal method used to move an invocation from a thread to the main thread. /// \sa requestInvokeEvent(), scheduleInvokeEvent() void invokeEventRequested(unsigned int delay, void* caller, unsigned long event, void* callData); protected: qSlicerCoreApplication(qSlicerCoreApplicationPrivate* pimpl, int &argc, char **argv); QScopedPointer<qSlicerCoreApplicationPrivate> d_ptr; private: Q_DECLARE_PRIVATE(qSlicerCoreApplication); Q_DISABLE_COPY(qSlicerCoreApplication); }; Q_DECLARE_METATYPE(qSlicerCoreApplication::ReturnCode) #endif
{ "pile_set_name": "Github" }
################################################################################ # # python-pytz # ################################################################################ PYTHON_PYTZ_VERSION = 2017.3 PYTHON_PYTZ_SOURCE = pytz-$(PYTHON_PYTZ_VERSION).zip PYTHON_PYTZ_SITE = https://pypi.python.org/packages/60/88/d3152c234da4b2a1f7a989f89609ea488225eaea015bc16fbde2b3fdfefa PYTHON_PYTZ_SETUP_TYPE = setuptools PYTHON_PYTZ_LICENSE = MIT PYTHON_PYTZ_LICENSE_FILES = LICENSE.txt define PYTHON_PYTZ_EXTRACT_CMDS unzip $(PYTHON_PYTZ_DL_DIR)/$(PYTHON_PYTZ_SOURCE) -d $(@D) mv $(@D)/pytz-$(PYTHON_PYTZ_VERSION)/* $(@D) rmdir $(@D)/pytz-$(PYTHON_PYTZ_VERSION) endef $(eval $(python-package))
{ "pile_set_name": "Github" }
# Bash !!! tip "Run Bash Files" You can find the bash code files for this section in this [link](https://github.com/ritchieng/deep-learning-wizard/blob/master/docs/programming/bash). ## Creating and Running a Bash File ### Create bash file ```bash touch hello_world.sh ``` ### Edit bash file with Hello World You can edit with anything like Vim, Sublime, etc. ```bash echo Hello World! ``` ### Run bash file ```bash bash hello_world.sh ``` This will print out, in your bash: ```bash Hello World! ``` ## Calculating ```bash # Add echo $((10+10)) # Subtract echo $((10-10)) # Divide echo $((10/10)) # Multiple echo $((10*10)) # Modulo echo $((10%10)) # Multiple Operations: Divide and Add echo $((10/10 + 10)) ``` ```bash 20 0 1 100 0 11 ``` ## Loops and Conditional ### For Loop ```bash for i in 'A' 'B' 'C' do echo $i done ``` ```bash A B C ``` ## For Loop With Range This will echo the digits 0 to 10 without explicitly requiring to define the whole range of numbers/alphabets like above. ```bash for ((i=0; i<=10; i++)); do echo $i done ``` ```bash 0 1 2 3 4 5 6 7 8 9 10 ``` ### If Else Conditional This is a simple if-else to check if the day of the week is 5, meaning if it is a Friday. ```bash day=$(date +%u) if [ $day == 5 ]; then echo "Friday is here!" else echo "Friday is not here :(" echo "Today is day $day of the week" fi ``` ### Sequentially Running of Python Scripts This snippet allows you to to run 3 python scripts sequentially, waiting for each to finish before proceeding to the next. ```bash python script_1.py wait python script_2.py wait python script_3.py wait echo "Finished running all 3 scripts in sequence!" ``` ### Parallel Running of Python Scripts ```bash python script_1.py && script_2.py && script_3.py wait echo "Finished running all 3 scripts in parallel in sequence" ``` ## Reading and Writing Operations ### Reading logs and texts Create a text file called `random_text.txt` with the following contents ```text Row 1 Row 2 Row 3 Row 4 Row 5 Row 6 Row 7 Row 8 Row 9 Row 10 ``` Then run the following command to read it in bash then print it. ```bash text_file=$(cat random_text.txt) echo $text_file ``` ```text Row 1 Row 2 Row 3 Row 4 Row 5 Row 6 Row 7 Row 8 Row 9 Row 10 ``` ## Date Operations ### Getting Current Date This will return the date in the format YYYY-MM-DD for example 2019-06-03. ```bash DATE=`date +%Y-%m-%d` echo $DATE ``` ### Getting Current Day of Week This will return 1, 2, 3, 4, 5, 6, 7 depending on the day of the week. ```bash DAY=$(date +%u) echo $DAY ``` ### Changing System Dates By 1 Day You can change system dates based on this. Surprisingly, you'll find it useful for testing an environment for deployments in the next day and then shifting it back to the actual day. ```bash sudo date -s 'next day' sudo date -s 'yesterday' ``` If you are running some tests via bash and want to disable typing in password you can edit the sudoer file via `sudo visudo` and adding the following line. Only use `sudo visudo` and nothing else, as they've a special syntax. ```bash <username> ALL=(ALL) NOPASSWD: /bin/date ``` To find out your username, simply just run the command `whoami`. ## Jupyter Utility Commands ### Convert Notebook to HTML/Markdown ```bash jupyter nbconvert --to markdown python.ipynb jupyter nbconvert --to html python.ipynb ``` ## Bash Convenient Commands ### List directories only `ls -d */` ### List non-directories only `ls -p | grep -v '/$'` ### Check IP `ifconfig | sed -En "s/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p"` ### Check internet speed `ethtool eno1` ### Check disk space `df -h` ### Check ubuntu version `lsb_release -a` ### Check truncated system logs `tail /var/log/syslog` ### Check CUDA version `nvcc -V` ### Check cuDNN version `cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2` ### Check username `whoami` ### Untar file `tar -xvzf file_name` ### Open PDF file `gvfs-open file_name` ### Download file from link rapidly with aria `aria2c -x16 -c url_link` ### Kill all python processes `ps ax | grep python | cut -c1-5 | xargs kill -9` ### Install .deb files `sudo apt-get install -f file_name.deb` ### Empty thrash ```bash sudo apt-get install trash-cli thrash-empty ``` ## Conda Commands ### Check conda environment `conda env list` ### Create conda kernel ```bash conda create -n kernel_name python=3.6 source activate kernel_name ``` ### Install conda kernel ```bash conda install ipykernel source activate kernel_name python -m ipykernel install --user --name kernel_name --display-name kernel_name ``` ### Remove conda kernel `conda env remove -n kernel_name` ### Recovering problematic conda installation ```bash # Download miniconda according to your environment # Link: https://docs.conda.io/en/latest/miniconda.html # Backup existing miniconda environment that may have problems mv miniconda3 miniconda3_backup # Install miniconda bash Miniconda3-latest-Linux-x86_64.sh # Restore old environment settings rsync -a miniconda3_backup/ miniconda3/ ``` ## Internet Operations ### Checking Internet Availability This script will return whether your internet is fine or not without using pings. Pings can often be rendered unusable when the network administrator disables ICMP to prevent the origination of ping floods from the data centre. ```bash if nc -zw1 google.com 443; then echo "INTERNET: OK" else echo "INTERNET: NOT OK" fi ``` ## Cron Operations ### Edit Cron Formatting follows this syntax with full credits on this beautiful diagram to [fedorqui from Stack Overflow](https://stackoverflow.com/questions/18919151/crontab-day-of-the-week-syntax): ```text ┌────────── minute (0 - 59) │ ┌──────── hour (0 - 23) │ │ ┌────── day of month (1 - 31) │ │ │ ┌──── month (1 - 12) │ │ │ │ ┌── day of week (0 - 6 => Sunday - Saturday, or │ │ │ │ │ 1 - 7 => Monday - Sunday) ↓ ↓ ↓ ↓ ↓ * * * * * command to be executed ``` Edit cron with this command: ```bash sudo crontab -e ``` ### List Cron ```bash sudo crontab -l ``` ### Status, Start, Stop and Restart ```bash sudo service cron status sudo service cron stop sudo service cron start sudo service cron restart ``` ### Cron Debugging Install postfix for local routing of errors (choose local option): ```bash sudo apt-get install postfix ``` Restart cron to see for any errors posted (if not errors, there will be no file, be patient before errors are posted): ```bash sudo cat /var/mail/root ``` ### Cron Bash Fix Cron uses `/bin/sh` as the default shell. Typically you would realize you're using `/bin/bash` as your shell, so this typically needs to be rectified before you can use cron to schedule commands as if it were your usual bash. Edit your cron file via `sudo crontab -e` and paste the following lines at the end of the file prior to your command like so. Take note for `PATH`, you've to paste the output of `echo PATH=$PATH` in there instead! ```text SHELL=/bin/bash PATH=/usr/lib.... # Your command schedule here! ``` ### Cron Conda Environment This is an example of enabling an anaconda environment, for example the default `base`, and running a python script. Take note you need to put your python script in the right directory or simply navigate to that path with `cd` prior to `"$(conda shell.bash hook)"`. ```text SHELL=/bin/bash PATH=/usr/lib.... * * * * 1-5 eval "$(conda shell.bash hook)" && conda activate base && python python_script_name.py ``` ### Cron Running Processes Some times you want to see the status of running tasks and may want to get the PID to end it. This is a very handy command. ```python ps -o pid,sess,cmd afx | egrep -A20 "( |/)cron( -f)?$" ``` You can get the PID of the cron process and then end it with `sudo pkill -s <PID>` ## Hardware Information ### Comprehensive CPU Information ```bash cat /proc/cpuinfo ``` ### Number of CPU Threads ```bash !grep -c ^processor /proc/cpuinfo ``` or ```bash nproc ``` ### CPU Model Name ```bash !cat /proc/cpuinfo | grep "model name" ``` ### Check Available RAM #### In MB ```bash free -m ``` #### In GB ```bash free -g ```
{ "pile_set_name": "Github" }
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import "KWReceiveMatcher.h" #import "KWFormatter.h" #import "KWInvocationCapturer.h" #import "KWMessagePattern.h" #import "KWMessageTracker.h" #import "KWObjCUtilities.h" #import "KWStringUtilities.h" #import "KWWorkarounds.h" #import "NSObject+KiwiStubAdditions.h" static NSString * const MatchVerifierKey = @"MatchVerifierKey"; static NSString * const CountTypeKey = @"CountTypeKey"; static NSString * const CountKey = @"CountKey"; static NSString * const StubValueKey = @"StubValueKey"; @interface KWReceiveMatcher() #pragma mark - #pragma mark Properties @property (nonatomic, readwrite, retain) KWMessageTracker *messageTracker; @end @implementation KWReceiveMatcher #pragma mark - #pragma mark Initializing - (id)initWithSubject:(id)anObject { if ((self = [super initWithSubject:anObject])) { self.willEvaluateMultipleTimes = NO; } return self; } - (void)dealloc { [messageTracker release]; [super dealloc]; } #pragma mark - #pragma mark Properties @synthesize messageTracker; @synthesize willEvaluateMultipleTimes; #pragma mark - #pragma mark Getting Matcher Strings + (NSArray *)matcherStrings { return [NSArray arrayWithObjects:@"receive:", @"receive:withCount:", @"receive:withCountAtLeast:", @"receive:withCountAtMost:", @"receive:andReturn:", @"receive:andReturn:withCount:", @"receive:andReturn:withCountAtLeast:", @"receive:andReturn:withCountAtMost:", @"receiveMessagePattern:countType:count:", @"receiveMessagePattern:andReturn:countType:count:", nil]; } #pragma mark - #pragma mark Matching - (BOOL)shouldBeEvaluatedAtEndOfExample { return YES; } - (BOOL)evaluate { BOOL succeeded = [self.messageTracker succeeded]; if (!self.willEvaluateMultipleTimes) { [self.messageTracker stopTracking]; } return succeeded; } #pragma mark - #pragma mark Getting Failure Messages - (NSString *)failureMessageForShould { return [NSString stringWithFormat:@"expected subject to receive -%@ %@, but received it %@", [self.messageTracker.messagePattern stringValue], [self.messageTracker expectedCountPhrase], [self.messageTracker receivedCountPhrase]]; } - (NSString *)failureMessageForShouldNot { return [NSString stringWithFormat:@"expected subject not to receive -%@, but received it %@", [self.messageTracker.messagePattern stringValue], [self.messageTracker receivedCountPhrase]]; } #pragma mark - #pragma mark Configuring Matchers - (void)receive:(SEL)aSelector { KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector]; [self receiveMessagePattern:messagePattern countType:KWCountTypeExact count:1]; } - (void)receive:(SEL)aSelector withCount:(NSUInteger)aCount { KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector]; return [self receiveMessagePattern:messagePattern countType:KWCountTypeExact count:aCount]; } - (void)receive:(SEL)aSelector withCountAtLeast:(NSUInteger)aCount { KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector]; return [self receiveMessagePattern:messagePattern countType:KWCountTypeAtLeast count:aCount]; } - (void)receive:(SEL)aSelector withCountAtMost:(NSUInteger)aCount { KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector]; return [self receiveMessagePattern:messagePattern countType:KWCountTypeAtMost count:aCount]; } - (void)receive:(SEL)aSelector andReturn:(id)aValue { KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector]; [self receiveMessagePattern:messagePattern andReturn:aValue countType:KWCountTypeExact count:1]; } - (void)receive:(SEL)aSelector andReturn:(id)aValue withCount:(NSUInteger)aCount { KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector]; [self receiveMessagePattern:messagePattern andReturn:aValue countType:KWCountTypeExact count:aCount]; } - (void)receive:(SEL)aSelector andReturn:(id)aValue withCountAtLeast:(NSUInteger)aCount { KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector]; [self receiveMessagePattern:messagePattern andReturn:aValue countType:KWCountTypeAtLeast count:aCount]; } - (void)receive:(SEL)aSelector andReturn:(id)aValue withCountAtMost:(NSUInteger)aCount { KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector]; [self receiveMessagePattern:messagePattern andReturn:aValue countType:KWCountTypeAtMost count:aCount]; } - (void)receiveMessagePattern:(KWMessagePattern *)aMessagePattern countType:(KWCountType)aCountType count:(NSUInteger)aCount { #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG @try { #endif // #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG self.messageTracker = [KWMessageTracker messageTrackerWithSubject:self.subject messagePattern:aMessagePattern countType:aCountType count:aCount]; #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG } @catch(NSException *exception) { KWSetExceptionFromAcrossInvocationBoundary(exception); } #endif // #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG } - (void)receiveMessagePattern:(KWMessagePattern *)aMessagePattern andReturn:(id)aValue countType:(KWCountType)aCountType count:(NSUInteger)aCount { #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG @try { #endif // #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG [self.subject stubMessagePattern:aMessagePattern andReturn:aValue]; self.messageTracker = [KWMessageTracker messageTrackerWithSubject:self.subject messagePattern:aMessagePattern countType:aCountType count:aCount]; #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG } @catch(NSException *exception) { KWSetExceptionFromAcrossInvocationBoundary(exception); } #endif // #if KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG } #pragma mark - #pragma mark Capturing Invocations + (NSMethodSignature *)invocationCapturer:(KWInvocationCapturer *)anInvocationCapturer methodSignatureForSelector:(SEL)aSelector { KWMatchVerifier *verifier = [anInvocationCapturer.userInfo objectForKey:MatchVerifierKey]; if ([verifier.subject respondsToSelector:aSelector]) return [verifier.subject methodSignatureForSelector:aSelector]; NSString *encoding = KWEncodingForVoidMethod(); return [NSMethodSignature signatureWithObjCTypes:[encoding UTF8String]]; } + (void)invocationCapturer:(KWInvocationCapturer *)anInvocationCapturer didCaptureInvocation:(NSInvocation *)anInvocation { NSDictionary *userInfo = anInvocationCapturer.userInfo; id verifier = [userInfo objectForKey:MatchVerifierKey]; KWCountType countType = [[userInfo objectForKey:CountTypeKey] unsignedIntegerValue]; NSUInteger count = [[userInfo objectForKey:CountKey] unsignedIntegerValue]; NSValue *stubValue = [userInfo objectForKey:StubValueKey]; KWMessagePattern *messagePattern = [KWMessagePattern messagePatternFromInvocation:anInvocation]; if (stubValue != nil) [verifier receiveMessagePattern:messagePattern andReturn:[stubValue nonretainedObjectValue] countType:countType count:count]; else [verifier receiveMessagePattern:messagePattern countType:countType count:count]; } @end @implementation KWMatchVerifier(KWReceiveMatcherAdditions) #pragma mark - #pragma mark Verifying - (void)receive:(SEL)aSelector withArguments:(id)firstArgument, ... { va_list argumentList; va_start(argumentList, firstArgument); KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector firstArgumentFilter:firstArgument argumentList:argumentList]; [(id)self receiveMessagePattern:messagePattern countType:KWCountTypeExact count:1]; } - (void)receive:(SEL)aSelector withCount:(NSUInteger)aCount arguments:(id)firstArgument, ... { va_list argumentList; va_start(argumentList, firstArgument); KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector firstArgumentFilter:firstArgument argumentList:argumentList]; [(id)self receiveMessagePattern:messagePattern countType:KWCountTypeExact count:aCount]; } - (void)receive:(SEL)aSelector withCountAtLeast:(NSUInteger)aCount arguments:(id)firstArgument, ... { va_list argumentList; va_start(argumentList, firstArgument); KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector firstArgumentFilter:firstArgument argumentList:argumentList]; [(id)self receiveMessagePattern:messagePattern countType:KWCountTypeAtLeast count:aCount]; } - (void)receive:(SEL)aSelector withCountAtMost:(NSUInteger)aCount arguments:(id)firstArgument, ... { va_list argumentList; va_start(argumentList, firstArgument); KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector firstArgumentFilter:firstArgument argumentList:argumentList]; [(id)self receiveMessagePattern:messagePattern countType:KWCountTypeAtMost count:aCount]; } - (void)receive:(SEL)aSelector andReturn:(id)aValue withArguments:(id)firstArgument, ... { va_list argumentList; va_start(argumentList, firstArgument); KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector firstArgumentFilter:firstArgument argumentList:argumentList]; [(id)self receiveMessagePattern:messagePattern andReturn:aValue countType:KWCountTypeExact count:1]; } - (void)receive:(SEL)aSelector andReturn:(id)aValue withCount:(NSUInteger)aCount arguments:(id)firstArgument, ... { va_list argumentList; va_start(argumentList, firstArgument); KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector firstArgumentFilter:firstArgument argumentList:argumentList]; [(id)self receiveMessagePattern:messagePattern andReturn:aValue countType:KWCountTypeExact count:aCount]; } - (void)receive:(SEL)aSelector andReturn:(id)aValue withCountAtLeast:(NSUInteger)aCount arguments:(id)firstArgument, ... { va_list argumentList; va_start(argumentList, firstArgument); KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector firstArgumentFilter:firstArgument argumentList:argumentList]; [(id)self receiveMessagePattern:messagePattern andReturn:aValue countType:KWCountTypeAtLeast count:aCount]; } - (void)receive:(SEL)aSelector andReturn:(id)aValue withCountAtMost:(NSUInteger)aCount arguments:(id)firstArgument, ... { va_list argumentList; va_start(argumentList, firstArgument); KWMessagePattern *messagePattern = [KWMessagePattern messagePatternWithSelector:aSelector firstArgumentFilter:firstArgument argumentList:argumentList]; [(id)self receiveMessagePattern:messagePattern andReturn:aValue countType:KWCountTypeAtMost count:aCount]; } #pragma mark Invocation Capturing Methods - (NSDictionary *)userInfoForReceiveMatcherWithCountType:(KWCountType)aCountType count:(NSUInteger)aCount { return [NSDictionary dictionaryWithObjectsAndKeys:self, MatchVerifierKey, [NSNumber numberWithUnsignedInteger:aCountType], CountTypeKey, [NSNumber numberWithUnsignedInteger:aCount], CountKey, nil]; } - (NSDictionary *)userInfoForReceiveMatcherWithCountType:(KWCountType)aCountType count:(NSUInteger)aCount value:(id)aValue { return [NSDictionary dictionaryWithObjectsAndKeys:self, MatchVerifierKey, [NSNumber numberWithUnsignedInteger:aCountType], CountTypeKey, [NSNumber numberWithUnsignedInteger:aCount], CountKey, [NSValue valueWithNonretainedObject:aValue], StubValueKey, nil]; } - (id)receive { NSDictionary *userInfo = [self userInfoForReceiveMatcherWithCountType:KWCountTypeExact count:1]; return [KWInvocationCapturer invocationCapturerWithDelegate:[KWReceiveMatcher class] userInfo:userInfo]; } - (id)receiveWithCount:(NSUInteger)aCount { NSDictionary *userInfo = [self userInfoForReceiveMatcherWithCountType:KWCountTypeExact count:aCount]; return [KWInvocationCapturer invocationCapturerWithDelegate:[KWReceiveMatcher class] userInfo:userInfo]; } - (id)receiveWithCountAtLeast:(NSUInteger)aCount { NSDictionary *userInfo = [self userInfoForReceiveMatcherWithCountType:KWCountTypeAtLeast count:aCount]; return [KWInvocationCapturer invocationCapturerWithDelegate:[KWReceiveMatcher class] userInfo:userInfo]; } - (id)receiveWithCountAtMost:(NSUInteger)aCount { NSDictionary *userInfo = [self userInfoForReceiveMatcherWithCountType:KWCountTypeAtMost count:aCount]; return [KWInvocationCapturer invocationCapturerWithDelegate:[KWReceiveMatcher class] userInfo:userInfo]; } - (id)receiveAndReturn:(id)aValue { NSDictionary *userInfo = [self userInfoForReceiveMatcherWithCountType:KWCountTypeExact count:1 value:aValue]; return [KWInvocationCapturer invocationCapturerWithDelegate:[KWReceiveMatcher class] userInfo:userInfo]; } - (id)receiveAndReturn:(id)aValue withCount:(NSUInteger)aCount { NSDictionary *userInfo = [self userInfoForReceiveMatcherWithCountType:KWCountTypeExact count:aCount value:aValue]; return [KWInvocationCapturer invocationCapturerWithDelegate:[KWReceiveMatcher class] userInfo:userInfo]; } - (id)receiveAndReturn:(id)aValue withCountAtLeast:(NSUInteger)aCount { NSDictionary *userInfo = [self userInfoForReceiveMatcherWithCountType:KWCountTypeAtLeast count:aCount value:aValue]; return [KWInvocationCapturer invocationCapturerWithDelegate:[KWReceiveMatcher class] userInfo:userInfo]; } - (id)receiveAndReturn:(id)aValue withCountAtMost:(NSUInteger)aCount { NSDictionary *userInfo = [self userInfoForReceiveMatcherWithCountType:KWCountTypeAtMost count:aCount value:aValue]; return [KWInvocationCapturer invocationCapturerWithDelegate:[KWReceiveMatcher class] userInfo:userInfo]; } @end
{ "pile_set_name": "Github" }
using System; using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Shapes; namespace NAudioWpfDemo { /// <summary> /// Interaction logic for PolylineWaveFormControl.xaml /// </summary> public partial class PolylineWaveFormControl : UserControl, IWaveFormRenderer { int renderPosition; double yTranslate = 40; double yScale = 40; int blankZone = 10; readonly Polyline topLine = new Polyline(); readonly Polyline bottomLine = new Polyline(); public PolylineWaveFormControl() { SizeChanged += OnSizeChanged; InitializeComponent(); topLine.Stroke = Foreground; bottomLine.Stroke = Foreground; topLine.StrokeThickness = 1; bottomLine.StrokeThickness = 1; mainCanvas.Children.Add(topLine); mainCanvas.Children.Add(bottomLine); } void OnSizeChanged(object sender, SizeChangedEventArgs e) { // We will remove everything as we are going to rescale vertically renderPosition = 0; ClearAllPoints(); yTranslate = ActualHeight / 2; yScale = ActualHeight / 2; } private void ClearAllPoints() { topLine.Points.Clear(); bottomLine.Points.Clear(); } public void AddValue(float maxValue, float minValue) { int pixelWidth = (int)ActualWidth; if (pixelWidth > 0) { CreatePoint(maxValue, minValue); if (renderPosition > ActualWidth) { renderPosition = 0; } int erasePosition = (renderPosition + blankZone) % pixelWidth; if (erasePosition < topLine.Points.Count) { double yPos = SampleToYPosition(0); topLine.Points[erasePosition] = new Point(erasePosition, yPos); bottomLine.Points[erasePosition] = new Point(erasePosition, yPos); } } } private double SampleToYPosition(float value) { return yTranslate + value * yScale; } private void CreatePoint(float topValue, float bottomValue) { double topLinePos = SampleToYPosition(topValue); double bottomLinePos = SampleToYPosition(bottomValue); if (renderPosition >= topLine.Points.Count) { topLine.Points.Add(new Point(renderPosition, topLinePos)); bottomLine.Points.Add(new Point(renderPosition, bottomLinePos)); } else { topLine.Points[renderPosition] = new Point(renderPosition, topLinePos); bottomLine.Points[renderPosition] = new Point(renderPosition, bottomLinePos); } renderPosition++; } /// <summary> /// Clears the waveform and repositions on the left /// </summary> public void Reset() { renderPosition = 0; ClearAllPoints(); } } }
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/coordination/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" ) // LeaseLister helps list Leases. type LeaseLister interface { // List lists all Leases in the indexer. List(selector labels.Selector) (ret []*v1.Lease, err error) // Leases returns an object that can list and get Leases. Leases(namespace string) LeaseNamespaceLister LeaseListerExpansion } // leaseLister implements the LeaseLister interface. type leaseLister struct { indexer cache.Indexer } // NewLeaseLister returns a new LeaseLister. func NewLeaseLister(indexer cache.Indexer) LeaseLister { return &leaseLister{indexer: indexer} } // List lists all Leases in the indexer. func (s *leaseLister) List(selector labels.Selector) (ret []*v1.Lease, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1.Lease)) }) return ret, err } // Leases returns an object that can list and get Leases. func (s *leaseLister) Leases(namespace string) LeaseNamespaceLister { return leaseNamespaceLister{indexer: s.indexer, namespace: namespace} } // LeaseNamespaceLister helps list and get Leases. type LeaseNamespaceLister interface { // List lists all Leases in the indexer for a given namespace. List(selector labels.Selector) (ret []*v1.Lease, err error) // Get retrieves the Lease from the indexer for a given namespace and name. Get(name string) (*v1.Lease, error) LeaseNamespaceListerExpansion } // leaseNamespaceLister implements the LeaseNamespaceLister // interface. type leaseNamespaceLister struct { indexer cache.Indexer namespace string } // List lists all Leases in the indexer for a given namespace. func (s leaseNamespaceLister) List(selector labels.Selector) (ret []*v1.Lease, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1.Lease)) }) return ret, err } // Get retrieves the Lease from the indexer for a given namespace and name. func (s leaseNamespaceLister) Get(name string) (*v1.Lease, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(v1.Resource("lease"), name) } return obj.(*v1.Lease), nil }
{ "pile_set_name": "Github" }
<a><bab><c2c>
{ "pile_set_name": "Github" }
--- title: Azure Cosmos DB での Gremlin のサポート description: Apache TinkerPop の Gremlin 言語について説明します。 Azure Cosmos DB で使用できる機能と手順について説明します。 author: LuisBosquez ms.service: cosmos-db ms.subservice: cosmosdb-graph ms.topic: overview ms.date: 04/23/2020 ms.author: lbosq ms.openlocfilehash: ba3b20f263f37d85389bb11c0674584408a0c223 ms.sourcegitcommit: 58faa9fcbd62f3ac37ff0a65ab9357a01051a64f ms.translationtype: HT ms.contentlocale: ja-JP ms.lasthandoff: 04/29/2020 ms.locfileid: "82161641" --- # <a name="azure-cosmos-db-gremlin-graph-support"></a>Azure Cosmos DB での Gremlin グラフのサポート Azure Cosmos DB は、[Gremlin](https://tinkerpop.apache.org/docs/3.3.2/reference/#graph-traversal-steps) と呼ばれる、[Apache TinkerPop](https://tinkerpop.apache.org) のグラフ トラバーサル言語をサポートしています。 Gremlin 言語を使用して、グラフ エンティティ (頂点と辺) の作成、エンティティ内のプロパティの変更、クエリとトラバーサルの実行、エンティティの削除を行うことができます。 この記事では、Gremlin の簡単なチュートリアルを提供し、Gremlin API でサポートされている Gremlin の機能を紹介します。 ## <a name="compatible-client-libraries"></a>互換性のあるクライアント ライブラリ 次の表に、Azure Cosmos DB に対して使用できる一般的な Gremlin ドライバーを示します。 | ダウンロード | source | 作業の開始 | サポートされているコネクタのバージョン | | --- | --- | --- | --- | | [.NET](https://tinkerpop.apache.org/docs/3.3.1/reference/#gremlin-DotNet) | [GitHub の Gremlin.NET](https://github.com/apache/tinkerpop/tree/master/gremlin-dotnet) | [.NET を使用してグラフを作成する](create-graph-dotnet.md) | 3.4.0-RC2 | | [Java](https://mvnrepository.com/artifact/com.tinkerpop.gremlin/gremlin-java) | [Gremlin JavaDoc](https://tinkerpop.apache.org/javadocs/current/full/) | [Java を使用してグラフを作成する](create-graph-java.md) | 3.2.0 以降 | | [Node.js](https://www.npmjs.com/package/gremlin) | [GitHub の Gremlin-JavaScript](https://github.com/apache/tinkerpop/tree/master/gremlin-javascript) | [Node.js を使用してグラフを作成する](create-graph-nodejs.md) | 3.3.4 以降 | | [Python](https://tinkerpop.apache.org/docs/3.3.1/reference/#gremlin-python) | [GitHub の Gremlin-Python](https://github.com/apache/tinkerpop/tree/master/gremlin-python) | [Python を使用してグラフを作成する](create-graph-python.md) | 3.2.7 | | [PHP](https://packagist.org/packages/brightzone/gremlin-php) | [GitHub の Gremlin-PHP](https://github.com/PommeVerte/gremlin-php) | [PHP を使用してグラフを作成する](create-graph-php.md) | 3.1.0 | | [Gremlin コンソール](https://tinkerpop.apache.org/downloads.html) | [TinkerPop ドキュメント](https://tinkerpop.apache.org/docs/current/reference/#gremlin-console) | [Gremlin コンソールを使用してグラフを作成する](create-graph-gremlin-console.md) | 3.2.0 以降 | ## <a name="supported-graph-objects"></a>サポートされているグラフ オブジェクト TinkerPop は、さまざまなグラフ テクノロジに対応する標準です。 そのため、グラフ プロバイダーによって提供される機能を説明する標準的な用語があります。 Azure Cosmos DB は、複数のサーバーまたはクラスター間でパーティション分割できる、永続的でコンカレンシーの高い書き込み可能なグラフ データベースを提供します。 次の表に、Azure Cosmos DB で実装されている TinkerPop の機能を示します。 | カテゴリ | Azure Cosmos DB 実装 | Notes | | --- | --- | --- | | グラフ機能 | 永続化と同時アクセスが提供されます。 トランザクションをサポートするように設計されています。 | コンピューターのメソッドは、Spark コネクタを介して実装できます。 | | 変数機能 | ブール値、整数、Byte、Double、Float、Long、文字列をサポートしています。 | プリミティブ型をサポートしています。データ モデルを介して複雑な型と互換性があります。 | | 頂点機能 | RemoveVertices、MetaProperties、AddVertices、MultiProperties、StringIds、UserSuppliedIds、AddProperty、RemoveProperty をサポートしています。 | 頂点の作成、変更、削除をサポートしています。 | | 頂点プロパティ機能 | StringIds、UserSuppliedIds、AddProperty、RemoveProperty、BooleanValues、ByteValues、DoubleValues、FloatValues、IntegerValues、LongValues、StringValues | 頂点プロパティの作成、変更、削除をサポートしています。 | | 辺機能 | AddEdges、RemoveEdges、StringIds、UserSuppliedIds、AddProperty、RemoveProperty | 辺の作成、変更、削除をサポートしています。 | | 辺プロパティ機能 | Properties、BooleanValues、ByteValues、DoubleValues、FloatValues、IntegerValues、LongValues、StringValues | 辺プロパティの作成、変更、削除をサポートしています。 | ## <a name="gremlin-wire-format"></a>Gremlin のワイヤ形式 Azure Cosmos DB では、Gremlin の操作から結果を返すときに JSON 形式を使用します。 Azure Cosmos DB では現在、JSON 形式がサポートされています。 たとえば、次のスニペットは、Azure Cosmos DB から "*クライアントに返される*" JSON による頂点の表現を示しています。 ```json { "id": "a7111ba7-0ea1-43c9-b6b2-efc5e3aea4c0", "label": "person", "type": "vertex", "outE": { "knows": [ { "id": "3ee53a60-c561-4c5e-9a9f-9c7924bc9aef", "inV": "04779300-1c8e-489d-9493-50fd1325a658" }, { "id": "21984248-ee9e-43a8-a7f6-30642bc14609", "inV": "a8e3e741-2ef7-4c01-b7c8-199f8e43e3bc" } ] }, "properties": { "firstName": [ { "value": "Thomas" } ], "lastName": [ { "value": "Andersen" } ], "age": [ { "value": 45 } ] } } ``` JSON 形式で使用される頂点のプロパティを次に説明します。 | プロパティ | 説明 | | --- | --- | --- | | `id` | 頂点の ID。 一意である必要があります (該当する場合は、`_partition` の値との組み合わせにおいて一意である必要があります)。 値が指定されていない場合は、GUID が自動的に提供されます | | `label` | 頂点のラベル。 このプロパティは、エンティティの種類を示すために使用します。 | | `type` | 頂点とグラフ以外のドキュメントを区別するために使用します。 | | `properties` | 頂点に関連付けられているユーザー定義プロパティのバッグ。 各プロパティには複数の値を指定できます。 | | `_partition` | 頂点のパーティション キー。 [グラフのパーティション分割](graph-partitioning.md)に使用されます。 | | `outE` | このプロパティには、頂点からの外向きの辺のリストが含まれます。 頂点と共に隣接情報を格納することで、トラバーサルの高速実行が可能になります。 辺はラベルに基づいてグループ化されます。 | 辺には、グラフの他の部分へのナビゲーションに役立つ次の情報が含まれています。 | プロパティ | 説明 | | --- | --- | | `id` | 辺の ID。 一意である必要があります (該当する場合は、`_partition` の値との組み合わせにおいて一意である必要があります) | | `label` | 辺のラベル。 このプロパティは省略可能です。関係の種類を示すために使用します。 | | `inV` | このプロパティには、辺の頂点一覧が含まれています。 辺と共に隣接情報を格納することで、トラバーサルの高速実行が可能になります。 頂点はラベルに基づいてグループ化されます。 | | `properties` | 辺に関連付けられているユーザー定義プロパティのバッグ。 各プロパティには複数の値を指定できます。 | 各プロパティでは、配列内に複数の値を格納できます。 | プロパティ | 説明 | | --- | --- | | `value` | プロパティの値。 ## <a name="gremlin-steps"></a>Gremlin のステップ 次に、Azure Cosmos DB でサポートされている Gremlin のステップを見てみましょう。 Gremlin の完全なリファレンスについては、[TinkerPop リファレンス](https://tinkerpop.apache.org/docs/3.3.2/reference)をご覧ください。 | ステップ | 説明 | TinkerPop 3.2 ドキュメント | | --- | --- | --- | | `addE` | 2 つの頂点の間に辺を追加します。 | [addE ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#addedge-step) | | `addV` | グラフに頂点を追加します。 | [addV ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#addvertex-step) | | `and` | すべてのトラバーサルが値を返すようにします。 | [and ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#and-step) | | `as` | ステップの出力に変数を割り当てるステップ モジュレーター。 | [as ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#as-step) | | `by` | `group` および `order` と共に使用するステップ モジュレーター。 | [by ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#by-step) | | `coalesce` | 結果を返す最初のトラバーサルを返します。 | [coalesce ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#coalesce-step) | | `constant` | 定数値を返します。 `coalesce` と共に使用します。| [constant ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#constant-step) | | `count` | トラバーサルからカウントを返します。 | [count ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#count-step) | | `dedup` | 重複を削除して値を返します。 | [dedup ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#dedup-step) | | `drop` | 値 (頂点/辺) を破棄します。 | [drop ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#drop-step) | | `executionProfile` | 実行された Gremlin ステップによって生成されたすべての操作の記述を作成します | [executionProfile ステップ](graph-execution-profile.md) | | `fold` | 結果の集計を計算するバリアとして機能します。| [fold ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#fold-step) | | `group` | 指定されたラベルに基づいて値をグループ化します。| [group ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#group-step) | | `has` | プロパティ、頂点、辺をフィルター処理するときに使用します。 `hasLabel`、`hasId`、`hasNot`、`has` の各バリアントをサポートします。 | [has ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#has-step) | | `inject` | 値をストリームに挿入します。| [inject ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#inject-step) | | `is` | ブール式を使用してフィルターを実行するときに使用します。 | [is ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#is-step) | | `limit` | トラバーサルで項目の数を制限するときに使用します。| [limit ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#limit-step) | | `local` | サブクエリと同様に、トラバーサルのセクションをローカルでラップします。 | [local ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#local-step) | | `not` | フィルターの否定を生成するときに使用します。 | [not ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#not-step) | | `optional` | 指定されたトラバーサルの結果が生成された場合は、その結果を返します。それ以外の場合は、呼び出し元の要素を返します。 | [optional ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#optional-step) | | `or` | 少なくとも 1 つのトラバーサルで値が返されるようにします。 | [or ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#or-step) | | `order` | 指定された並べ替え順序で結果を返します。 | [order ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#order-step) | | `path` | トラバーサルの完全なパスを返します。 | [path ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#path-step) | | `project` | プロパティをマップとして投影します。 | [project ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#project-step) | | `properties` | 指定されたラベルのプロパティを返します。 | [properties ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#_properties_step) | | `range` | 値の指定された範囲にフィルターを適用します。| [range ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#range-step) | | `repeat` | ステップを指定された回数繰り返します。 ループに使用します。 | [repeat ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#repeat-step) | | `sample` | トラバーサルの結果をサンプリングするときに使用します。 | [sample ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#sample-step) | | `select` | トラバーサルの結果を予想するときに使用します。 | [select ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#select-step) | | `store` | トラバーサルの非ブロッキング集計に使用します。 | [store ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#store-step) | | `TextP.startingWith(string)` | 文字列フィルター処理関数。 この関数は、指定された文字列で始まるプロパティを照合するための `has()` ステップの述語として使用されます。 | [TextP 述語](https://tinkerpop.apache.org/docs/3.4.0/reference/#a-note-on-predicates) | | `TextP.endingWith(string)` | 文字列フィルター処理関数。 この関数は、指定された文字列で終わるプロパティを照合するための `has()` ステップの述語として使用されます。 | [TextP 述語](https://tinkerpop.apache.org/docs/3.4.0/reference/#a-note-on-predicates) | | `TextP.containing(string)` | 文字列フィルター処理関数。 この関数は、指定された文字列の内容を含むプロパティを照合するための `has()` ステップの述語として使用されます。 | [TextP 述語](https://tinkerpop.apache.org/docs/3.4.0/reference/#a-note-on-predicates) | | `TextP.notStartingWith(string)` | 文字列フィルター処理関数。 この関数は、指定された文字列で始まらないプロパティを照合するための `has()` ステップの述語として使用されます。 | [TextP 述語](https://tinkerpop.apache.org/docs/3.4.0/reference/#a-note-on-predicates) | | `TextP.notEndingWith(string)` | 文字列フィルター処理関数。 この関数は、指定された文字列で終わらないプロパティを照合するための `has()` ステップの述語として使用されます。 | [TextP 述語](https://tinkerpop.apache.org/docs/3.4.0/reference/#a-note-on-predicates) | | `TextP.notContaining(string)` | 文字列フィルター処理関数。 この関数は、指定された文字列を含んでいないプロパティを照合するための `has()` ステップの述語として使用されます。 | [TextP 述語](https://tinkerpop.apache.org/docs/3.4.0/reference/#a-note-on-predicates) | | `tree` | 頂点からのパスを集計してツリーを形成します。 | [tree ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#tree-step) | | `unfold` | 反復子をステップとしてアンロールします。| [unfold ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#unfold-step) | | `union` | 複数のトラバーサルの結果をマージします。| [union ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#union-step) | | `V` | 頂点および辺の間でのトラバーサルに必要なステップ (`V`、`E`、`out`、`in`、`both`、`outE`、`inE`、`bothE`、`outV`、`inV`、`bothV`、`otherV`) が含まれています。 | [vertex ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#vertex-steps) | | `where` | トラバーサルの結果をフィルター処理するときに使用します。 `eq`、`neq`、`lt`、`lte`、`gt`、`gte`、`between` の各演算子をサポートします。 | [where ステップ](https://tinkerpop.apache.org/docs/3.3.2/reference/#where-step) | Azure Cosmos DB によって提供された書き込みに最適化されたエンジンは、頂点および辺内のすべてのプロパティの自動インデックス作成を既定でサポートしています。 そのため、任意のプロパティでのフィルターを使用するクエリ、範囲クエリ、並べ替え、または集計は、インデックスに基づいて処理され、効率的に提供されます。 Azure Cosmos DB におけるインデックス作成のしくみの詳細については、[スキーマに依存しないインデックス作成](https://www.vldb.org/pvldb/vol8/p1668-shukla.pdf)に関する論文をご覧ください。 ## <a name="next-steps"></a>次のステップ * [SDK を使用](create-graph-dotnet.md)してグラフ アプリケーションの構築を開始する * Azure Cosmos DB の[グラフ サポート](graph-introduction.md)の詳細について説明します。
{ "pile_set_name": "Github" }
package org.bouncycastle.crypto.params; import java.math.BigInteger; import java.security.SecureRandom; import org.bouncycastle.crypto.KeyGenerationParameters; public class RSAKeyGenerationParameters extends KeyGenerationParameters { private BigInteger publicExponent; private int certainty; public RSAKeyGenerationParameters( BigInteger publicExponent, SecureRandom random, int strength, int certainty) { super(random, strength); if (strength < 12) { throw new IllegalArgumentException("key strength too small"); } // // public exponent cannot be even // if (!publicExponent.testBit(0)) { throw new IllegalArgumentException("public exponent cannot be even"); } this.publicExponent = publicExponent; this.certainty = certainty; } public BigInteger getPublicExponent() { return publicExponent; } public int getCertainty() { return certainty; } }
{ "pile_set_name": "Github" }
diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c --- src.orig/fs/proc/meminfo.c 2020-05-12 11:14:29.250791853 -0400 +++ src/fs/proc/meminfo.c 2020-05-12 11:15:13.848859021 -0400 @@ -153,6 +153,7 @@ static int meminfo_proc_show(struct seq_ static int __init proc_meminfo_init(void) { + printk("a\n"); proc_create_single("meminfo", 0, NULL, meminfo_proc_show); return 0; }
{ "pile_set_name": "Github" }
# - FindSciPythonLibs: This module finds Python, its include dirs, and # its libraries. Unlike the module that comes with cmake, this module # works off the python that is found in one's path. If none found, # then it reverts to using cmake's FindPythonLibs. # # INPUTS(not sought if defined) # # PYTHON_INCLUDE_PATH - path to where Python.h is found. # For compatibility with the CMake module, one can # instead define Python_INCLUDE_DIR # PYTHON_LIBRARY - path to the python library # For compatibility with the CMake module, one can # instead define Python_LIBRARY # # OUTPUTS # # PYTHONLIBS_FOUND - whether the Python libs have been found # Python_LIBRARIES - path to the python library # Python_LIB - the CMake style name of the python library # Python_INCLUDE_DIRS - path to where Python.h is found # Python_DEBUG_LIBRARIES - path to the debug library # # PYTHON - full path to python # Python_STLIBS - the static library if found, otherwise whatever # python library is found. # Python_STLIB - deprecated. Synonym for ${Python_STLIB}. # Python_LIBS - deprecated. Synonym for ${Python_STLIB}. ###################################################################### # # FindSciPythonLibs.cmake: Wrap cmake's python finder to fix for mingw # # $Id: FindSciPythonLibs.cmake 1245 2012-01-31 21:36:22Z dws $ # # Copyright 2010-2012 Tech-X Corporation. # Arbitrary redistribution allowed provided this copyright remains. # ###################################################################### option(ENABLE_PYTHON "Whether to enable Python" ON) if (ENABLE_PYTHON) message("") message("--------- SciPythonLibs looking for Python libraries ---------") # Backward compatibility if (PYTHON_INCLUDE_PATH) message("--------- Setting Python_INCLUDE_DIRS") set(Python_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH}) endif () if (PYTHON_LIBRARY) message("--------- Setting Python_LIBRARIES") set(Python_LIBRARIES ${Python_LIBRARY}) endif () # If already defined, done if (Python_INCLUDE_DIRS AND Python_LIBRARIES) set(PYTHONLIBS_FOUND TRUE) # Search for python on unix using path elseif (NOT WIN32) find_program(PYTHON python) if (DEBUG_CMAKE) message(STATUS "PYTHON = ${PYTHON}.") endif () # Use python to find its include and library dirs if (PYTHON) # Get version execute_process(COMMAND ${PYTHON} -V ERROR_VARIABLE Python_VERSION) message(STATUS "Python_VERSION = ${Python_VERSION}.") string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" Python_VERSION "${Python_VERSION}" ) if (DEBUG_CMAKE) message(STATUS "Python_VERSION = ${Python_VERSION}.") endif () string(REGEX MATCH "^[0-9]+\\.[0-9]" Python_MAJMIN "${Python_VERSION}" ) if (DEBUG_CMAKE) message(STATUS "Python_MAJMIN = ${Python_MAJMIN}.") endif () set(Python_LIB python${Python_MAJMIN} CACHE STRING "Python library name + major.minor") # Should check here that version >2.5. # Find includes if (NOT Python_INCLUDE_DIRS) execute_process(COMMAND ${PYTHON} -c "import os, sys; print os.path.join(sys.prefix, 'include', 'python')" OUTPUT_VARIABLE Python_INCDIR) string(STRIP "${Python_INCDIR}" Python_INCDIR) set(Python_INCLUDE_DIRS "${Python_INCDIR}${Python_MAJMIN}") endif () if (DEBUG_CMAKE) message(STATUS "Python_INCLUDE_DIRS = ${Python_INCLUDE_DIRS}.") endif () execute_process(COMMAND python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1,1)" OUTPUT_VARIABLE Python_TOPLIBDIR) string(STRIP "${Python_TOPLIBDIR}" Python_TOPLIBDIR) if (DEBUG_CMAKE) message(STATUS "Python_TOPLIBDIR = ${Python_TOPLIBDIR}.") endif () # Find libraries if (NOT Python_LIBRARIES) if (DEBUG_CMAKE) message(STATUS "Looking for library, ${Python_LIB}.") endif () find_library(Python_LIBRARIES ${Python_LIB} PATHS ${Python_TOPLIBDIR}/config ${Python_TOPLIBDIR}/libs NO_DEFAULT_PATH) endif () if (Python_INCLUDE_DIRS AND Python_LIBRARIES) set(PYTHONLIBS_FOUND TRUE) endif () endif () endif () # Python not found so find python using cmake's module if (NOT PYTHONLIBS_FOUND) find_package(PythonLibs) if (PYTHONLIBS_FOUND) option(HAVE_PYTHON "Python library" ON) set (Python_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}) set (Python_LIBRARIES ${PYTHON_LIBRARY}) message(STATUS "Python_LIBRARY = ${Python_LIBRARIES}") # MinGW requires one to separate the dir and the lib, and then # the library needs to have a possible leading lib removed. if (USING_MINGW) get_filename_component(Python_LIBDIR ${PYTHON_LIBRARIES}/.. REALPATH) get_filename_component(Python_lLIB ${PYTHON_LIBRARIES} NAME_WE) string(REGEX REPLACE "^lib" "" PYTHON_LLIB ${PYTHON_LLIB}) set(Python_LIBS "-L${PYTHON_LIBDIR} -l${PYTHON_LLIB}") else () set(Python_LIBS ${PYTHON_LIBRARIES}) endif () endif () endif () # Get static libraries if (PYTHONLIBS_FOUND) get_filename_component(Python_LIBRARY_DIRS ${Python_LIBRARIES}/.. REALPATH) get_filename_component(Python_PYLIBDIR ${Python_LIBRARY_DIRS}/.. REALPATH) # Seek static library SciGetStaticLibs("${Python_LIBRARIES}" PYTHON_STLIBS) # This may not give the static library, but it is the best we have if (NOT PYTHON_LIBS) if (PYTHON_STLIBS) set(Python_LIBS ${PYTHON_STLIBS}) set(Python_STLIB ${PYTHON_STLIBS}) # Backwards compatibility else () set(Python_LIBS ${Python_LIBRARIES}) endif () endif () endif () # Print result if (PYTHONLIBS_FOUND) execute_process(COMMAND python -c "import sys; print sys.version[:3]" OUTPUT_VARIABLE Python_VERSION) string(STRIP "${Python_VERSION}" Python_VERSION) if (WIN32) string(REGEX REPLACE "\\." "" Python_VERSION_WINSTR "${Python_VERSION}") endif () set(HAVE_PYTHON 1 CACHE BOOL "Whether have Python") # I think this is not needed, as SciFixDynExec will find needed shared objects if (0) if (NOT Python_LIBRARY AND LINUX) message(STATUS "REALPATH: ${PYTHON}/../../lib/lib${Python_LIB}.so") get_filename_component(Python_LIBRARY_REALPATH "${PYTHON}/../../lib/lib${Python_LIB}.so" REALPATH) set(Python_LIBRARY "${Python_LIBRARY_REALPATH}" CACHE STRING "Path to Python dynamic lib") endif () endif () endif () set(PYTHON_VERSION ${Python_VERSION}) message(STATUS "RESULTS FOR PYTHON:") message(STATUS " PYTHON = ${PYTHON}") message(STATUS " PYTHON_VERSION = ${PYTHON_VERSION}") message(STATUS " Python_VERSION = ${Python_VERSION}") message(STATUS " Python_INCLUDE_DIRS = ${Python_INCLUDE_DIRS}") message(STATUS " Python_LIBRARY_DIRS = ${Python_LIBRARY_DIRS}") message(STATUS " Python_PYLIBDIR = ${Python_PYLIBDIR}") message(STATUS " Python_LIBRARIES = ${Python_LIBRARIES}") message(STATUS " Python_LIB = ${Python_LIB}") message(STATUS " Python_STLIBS = ${Python_STLIBS}") endif ()
{ "pile_set_name": "Github" }
/* ---------------------------------------------------------------------- * Copyright (C) 2010-2014 ARM Limited. All rights reserved. * * $Date: 31. July 2014 * $Revision: V1.4.4 * * Project: CMSIS DSP Library * Title: arm_mat_mult_fast_q31.c * * Description: Q31 matrix multiplication (fast variant). * * Target Processor: Cortex-M4/Cortex-M3 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * - Neither the name of ARM LIMITED nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * -------------------------------------------------------------------- */ #include "arm_math.h" /** * @ingroup groupMatrix */ /** * @addtogroup MatrixMult * @{ */ /** * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 * @param[in] *pSrcA points to the first input matrix structure * @param[in] *pSrcB points to the second input matrix structure * @param[out] *pDst points to output matrix structure * @return The function returns either * <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking. * * @details * <b>Scaling and Overflow Behavior:</b> * * \par * The difference between the function arm_mat_mult_q31() and this fast variant is that * the fast variant use a 32-bit rather than a 64-bit accumulator. * The result of each 1.31 x 1.31 multiplication is truncated to * 2.30 format. These intermediate results are accumulated in a 32-bit register in 2.30 * format. Finally, the accumulator is saturated and converted to a 1.31 result. * * \par * The fast version has the same overflow behavior as the standard version but provides * less precision since it discards the low 32 bits of each multiplication result. * In order to avoid overflows completely the input signals must be scaled down. * Scale down one of the input matrices by log2(numColsA) bits to * avoid overflows, as a total of numColsA additions are computed internally for each * output element. * * \par * See <code>arm_mat_mult_q31()</code> for a slower implementation of this function * which uses 64-bit accumulation to provide higher precision. */ arm_status arm_mat_mult_fast_q31( const arm_matrix_instance_q31 * pSrcA, const arm_matrix_instance_q31 * pSrcB, arm_matrix_instance_q31 * pDst) { q31_t *pIn1 = pSrcA->pData; /* input data matrix pointer A */ q31_t *pIn2 = pSrcB->pData; /* input data matrix pointer B */ q31_t *pInA = pSrcA->pData; /* input data matrix pointer A */ // q31_t *pSrcB = pSrcB->pData; /* input data matrix pointer B */ q31_t *pOut = pDst->pData; /* output data matrix pointer */ q31_t *px; /* Temporary output data matrix pointer */ q31_t sum; /* Accumulator */ uint16_t numRowsA = pSrcA->numRows; /* number of rows of input matrix A */ uint16_t numColsB = pSrcB->numCols; /* number of columns of input matrix B */ uint16_t numColsA = pSrcA->numCols; /* number of columns of input matrix A */ uint16_t col, i = 0u, j, row = numRowsA, colCnt; /* loop counters */ arm_status status; /* status of matrix multiplication */ q31_t inA1, inA2, inA3, inA4, inB1, inB2, inB3, inB4; #ifdef ARM_MATH_MATRIX_CHECK /* Check for matrix mismatch condition */ if((pSrcA->numCols != pSrcB->numRows) || (pSrcA->numRows != pDst->numRows) || (pSrcB->numCols != pDst->numCols)) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; } else #endif /* #ifdef ARM_MATH_MATRIX_CHECK */ { /* The following loop performs the dot-product of each row in pSrcA with each column in pSrcB */ /* row loop */ do { /* Output pointer is set to starting address of the row being processed */ px = pOut + i; /* For every row wise process, the column loop counter is to be initiated */ col = numColsB; /* For every row wise process, the pIn2 pointer is set ** to the starting address of the pSrcB data */ pIn2 = pSrcB->pData; j = 0u; /* column loop */ do { /* Set the variable sum, that acts as accumulator, to zero */ sum = 0; /* Initiate the pointer pIn1 to point to the starting address of pInA */ pIn1 = pInA; /* Apply loop unrolling and compute 4 MACs simultaneously. */ colCnt = numColsA >> 2; /* matrix multiplication */ while(colCnt > 0u) { /* c(m,n) = a(1,1)*b(1,1) + a(1,2) * b(2,1) + .... + a(m,p)*b(p,n) */ /* Perform the multiply-accumulates */ inB1 = *pIn2; pIn2 += numColsB; inA1 = pIn1[0]; inA2 = pIn1[1]; inB2 = *pIn2; pIn2 += numColsB; inB3 = *pIn2; pIn2 += numColsB; sum = (q31_t) ((((q63_t) sum << 32) + ((q63_t) inA1 * inB1)) >> 32); sum = (q31_t) ((((q63_t) sum << 32) + ((q63_t) inA2 * inB2)) >> 32); inA3 = pIn1[2]; inA4 = pIn1[3]; inB4 = *pIn2; pIn2 += numColsB; sum = (q31_t) ((((q63_t) sum << 32) + ((q63_t) inA3 * inB3)) >> 32); sum = (q31_t) ((((q63_t) sum << 32) + ((q63_t) inA4 * inB4)) >> 32); pIn1 += 4u; /* Decrement the loop counter */ colCnt--; } /* If the columns of pSrcA is not a multiple of 4, compute any remaining output samples here. ** No loop unrolling is used. */ colCnt = numColsA % 0x4u; while(colCnt > 0u) { /* c(m,n) = a(1,1)*b(1,1) + a(1,2) * b(2,1) + .... + a(m,p)*b(p,n) */ /* Perform the multiply-accumulates */ sum = (q31_t) ((((q63_t) sum << 32) + ((q63_t) * pIn1++ * (*pIn2))) >> 32); pIn2 += numColsB; /* Decrement the loop counter */ colCnt--; } /* Convert the result from 2.30 to 1.31 format and store in destination buffer */ *px++ = sum << 1; /* Update the pointer pIn2 to point to the starting address of the next column */ j++; pIn2 = pSrcB->pData + j; /* Decrement the column loop counter */ col--; } while(col > 0u); /* Update the pointer pInA to point to the starting address of the next row */ i = i + numColsB; pInA = pInA + numColsA; /* Decrement the row loop counter */ row--; } while(row > 0u); /* set status as ARM_MATH_SUCCESS */ status = ARM_MATH_SUCCESS; } /* Return to application */ return (status); } /** * @} end of MatrixMult group */
{ "pile_set_name": "Github" }
// Code generated by protoc-gen-go. // source: vrrp_interface_info.proto // DO NOT EDIT! /* Package cisco_ios_xr_ipv4_vrrp_oper_vrrp_ipv4_interfaces_interface is a generated protocol buffer package. It is generated from these files: vrrp_interface_info.proto It has these top-level messages: VrrpInterfaceInfo_KEYS VrrpInterfaceInfo */ package cisco_ios_xr_ipv4_vrrp_oper_vrrp_ipv4_interfaces_interface import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // VRRP Interface statistics type VrrpInterfaceInfo_KEYS struct { InterfaceName string `protobuf:"bytes,1,opt,name=interface_name,json=interfaceName" json:"interface_name,omitempty"` } func (m *VrrpInterfaceInfo_KEYS) Reset() { *m = VrrpInterfaceInfo_KEYS{} } func (m *VrrpInterfaceInfo_KEYS) String() string { return proto.CompactTextString(m) } func (*VrrpInterfaceInfo_KEYS) ProtoMessage() {} func (*VrrpInterfaceInfo_KEYS) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (m *VrrpInterfaceInfo_KEYS) GetInterfaceName() string { if m != nil { return m.InterfaceName } return "" } type VrrpInterfaceInfo struct { // IM Interface Interface string `protobuf:"bytes,50,opt,name=interface" json:"interface,omitempty"` // Invalid checksum InvalidChecksumCount uint32 `protobuf:"varint,51,opt,name=invalid_checksum_count,json=invalidChecksumCount" json:"invalid_checksum_count,omitempty"` // Unknown/unsupported version InvalidVersionCount uint32 `protobuf:"varint,52,opt,name=invalid_version_count,json=invalidVersionCount" json:"invalid_version_count,omitempty"` // Invalid vrID InvalidVridCount uint32 `protobuf:"varint,53,opt,name=invalid_vrid_count,json=invalidVridCount" json:"invalid_vrid_count,omitempty"` // Bad packet lengths InvalidPacketLengthCount uint32 `protobuf:"varint,54,opt,name=invalid_packet_length_count,json=invalidPacketLengthCount" json:"invalid_packet_length_count,omitempty"` } func (m *VrrpInterfaceInfo) Reset() { *m = VrrpInterfaceInfo{} } func (m *VrrpInterfaceInfo) String() string { return proto.CompactTextString(m) } func (*VrrpInterfaceInfo) ProtoMessage() {} func (*VrrpInterfaceInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *VrrpInterfaceInfo) GetInterface() string { if m != nil { return m.Interface } return "" } func (m *VrrpInterfaceInfo) GetInvalidChecksumCount() uint32 { if m != nil { return m.InvalidChecksumCount } return 0 } func (m *VrrpInterfaceInfo) GetInvalidVersionCount() uint32 { if m != nil { return m.InvalidVersionCount } return 0 } func (m *VrrpInterfaceInfo) GetInvalidVridCount() uint32 { if m != nil { return m.InvalidVridCount } return 0 } func (m *VrrpInterfaceInfo) GetInvalidPacketLengthCount() uint32 { if m != nil { return m.InvalidPacketLengthCount } return 0 } func init() { proto.RegisterType((*VrrpInterfaceInfo_KEYS)(nil), "cisco_ios_xr_ipv4_vrrp_oper.vrrp.ipv4.interfaces.interface.vrrp_interface_info_KEYS") proto.RegisterType((*VrrpInterfaceInfo)(nil), "cisco_ios_xr_ipv4_vrrp_oper.vrrp.ipv4.interfaces.interface.vrrp_interface_info") } func init() { proto.RegisterFile("vrrp_interface_info.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ // 264 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xd1, 0xc1, 0x4b, 0xc3, 0x30, 0x14, 0x06, 0x70, 0xea, 0x41, 0x58, 0x60, 0x22, 0x99, 0x4a, 0x44, 0x0f, 0x63, 0x20, 0xec, 0x20, 0x3d, 0x6c, 0xd5, 0x83, 0xe0, 0x41, 0x86, 0x27, 0x45, 0x64, 0x82, 0xe0, 0xe9, 0x11, 0xb3, 0xcc, 0x85, 0xad, 0x49, 0x78, 0xc9, 0x8a, 0x7f, 0x83, 0x7f, 0xb5, 0xf4, 0x35, 0x6d, 0x2f, 0xbb, 0x85, 0xef, 0xfb, 0x7e, 0xaf, 0x87, 0xb2, 0xcb, 0x0a, 0xd1, 0x83, 0xb1, 0x51, 0xe3, 0x5a, 0x2a, 0x0d, 0xc6, 0xae, 0x5d, 0xee, 0xd1, 0x45, 0xc7, 0x1f, 0x94, 0x09, 0xca, 0x81, 0x71, 0x01, 0x7e, 0x11, 0x8c, 0xaf, 0x0a, 0xa0, 0xb1, 0xf3, 0x1a, 0xf3, 0xfa, 0x95, 0xd7, 0x59, 0xde, 0xd9, 0xd0, 0x3f, 0x27, 0x4f, 0x4c, 0x1c, 0x38, 0x0c, 0x2f, 0xcf, 0x5f, 0x1f, 0xfc, 0x86, 0x9d, 0xf4, 0xb1, 0x95, 0xa5, 0x16, 0xd9, 0x38, 0x9b, 0x0e, 0x96, 0xc3, 0x2e, 0x7d, 0x93, 0xa5, 0x9e, 0xfc, 0x1d, 0xb1, 0xd1, 0x81, 0x1b, 0xfc, 0x9a, 0x0d, 0xba, 0x44, 0xcc, 0x48, 0xf6, 0x01, 0x2f, 0xd8, 0x85, 0xb1, 0x95, 0xdc, 0x99, 0x15, 0xa8, 0x8d, 0x56, 0xdb, 0xb0, 0x2f, 0x41, 0xb9, 0xbd, 0x8d, 0x62, 0x3e, 0xce, 0xa6, 0xc3, 0xe5, 0x59, 0x6a, 0x17, 0xa9, 0x5c, 0xd4, 0x1d, 0x9f, 0xb1, 0xf3, 0x56, 0x55, 0x1a, 0x83, 0x71, 0x36, 0xa1, 0x82, 0xd0, 0x28, 0x95, 0x9f, 0x4d, 0xd7, 0x98, 0x5b, 0xc6, 0x3b, 0x83, 0xf5, 0xe7, 0x08, 0xdc, 0x11, 0x38, 0x6d, 0x01, 0x9a, 0x55, 0xb3, 0x7e, 0x64, 0x57, 0xed, 0xda, 0x4b, 0xb5, 0xd5, 0x11, 0x76, 0xda, 0xfe, 0xc4, 0x4d, 0x62, 0xf7, 0xc4, 0x44, 0x9a, 0xbc, 0xd3, 0xe2, 0x95, 0x06, 0xc4, 0xbf, 0x8f, 0xe9, 0x97, 0xcc, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x35, 0xf5, 0x2c, 0x23, 0xaf, 0x01, 0x00, 0x00, }
{ "pile_set_name": "Github" }
$TEST_SQL_SHUTDOWN_OPT
{ "pile_set_name": "Github" }