text
stringlengths
2
100k
meta
dict
strict digraph "SetIndex<Element : Hashable> - Type Hierarchy - SwiftDoc.org" { pad="0.1,0.8" node [shape=box, style="filled,rounded", color="#999999", fillcolor="#999999", fontcolor=white, fontname=Helvetica, fontnames="Helvetica,sansserif", fontsize=12, margin="0.07,0.05", height="0.3"] edge [color="#cccccc"] "Comparable" [URL="/protocol/Comparable/hierarchy/"] "Equatable" [URL="/protocol/Equatable/hierarchy/"] "ForwardIndexType" [URL="/protocol/ForwardIndexType/hierarchy/"] "SetIndex<Element : Hashable>" [URL="/type/SetIndex/", style="filled", fillcolor="#ee543d", color="#ee543d"] "_Incrementable" [URL="/protocol/_Incrementable/hierarchy/"] "ForwardIndexType" -> "SetIndex<Element : Hashable>" "Comparable" -> "SetIndex<Element : Hashable>" "_Incrementable" -> "ForwardIndexType" "Equatable" -> "_Incrementable" "Equatable" -> "Comparable" subgraph Types { rank = max; "SetIndex<Element : Hashable>"; } }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 06a7728798142eb4992387d3436a0a11 NativeFormatImporter: externalObjects: {} mainObjectFileID: 2100000 userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.template.soy.passes; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.template.soy.base.internal.IdGenerator; import com.google.template.soy.base.internal.Identifier; import com.google.template.soy.base.internal.SoyFileKind; import com.google.template.soy.error.ErrorReporter; import com.google.template.soy.error.SoyErrorKind; import com.google.template.soy.error.SoyErrorKind.StyleAllowance; import com.google.template.soy.error.SoyErrors; import com.google.template.soy.exprtree.TemplateLiteralNode; import com.google.template.soy.soytree.ImportsContext.ImportsTemplateRegistry; import com.google.template.soy.soytree.SoyFileNode; import com.google.template.soy.soytree.SoyTreeUtils; import com.google.template.soy.soytree.TemplateMetadata; /** * Visitor to check that there are no external calls. Used by backends that disallow external calls, * such as the Tofu (JavaObj) backend. */ public final class StrictDepsPass implements CompilerFileSetPass { private static final SoyErrorKind CALL_TO_UNDEFINED_TEMPLATE = SoyErrorKind.of("Undefined template ''{0}''.{1}", StyleAllowance.NO_PUNCTUATION); private static final SoyErrorKind CALL_TO_INDIRECT_DEPENDENCY = SoyErrorKind.of( "Call is satisfied only by indirect dependency {0}. Add it as a direct dependency." , StyleAllowance.NO_PUNCTUATION); private final ErrorReporter errorReporter; public StrictDepsPass(ErrorReporter errorReporter) { this.errorReporter = errorReporter; } @Override public Result run(ImmutableList<SoyFileNode> sourceFiles, IdGenerator idGenerator) { for (SoyFileNode file : sourceFiles) { for (TemplateLiteralNode node : SoyTreeUtils.getAllNodesOfType(file, TemplateLiteralNode.class)) { checkTemplateLiteralNode(node, file.getTemplateRegistry()); } } return Result.CONTINUE; } // TODO(gboyer): Consider some deltemplate checking, but it's hard to make a coherent case for // deltemplates since it's legitimate to have zero implementations, or to have the implementation // in a different part of the dependency graph (if it's late-bound). private void checkTemplateLiteralNode( TemplateLiteralNode node, ImportsTemplateRegistry registry) { TemplateMetadata callee = registry.getBasicTemplateOrElement(node.getResolvedName()); if (callee == null) { reportUndefinedTemplateErrors(node, registry); } else { SoyFileKind calleeKind = callee.getSoyFileKind(); String callerFilePath = node.getSourceLocation().getFilePath(); String calleeFilePath = callee.getSourceLocation().getFilePath(); if (calleeKind == SoyFileKind.INDIRECT_DEP) { errorReporter.report( node.getSourceLocation(), CALL_TO_INDIRECT_DEPENDENCY, calleeFilePath); } } } private void reportUndefinedTemplateErrors( TemplateLiteralNode node, ImportsTemplateRegistry registry) { Identifier ident = node.getIdentifier(); // Cross-check the called template's name against the list of imported symbols and the list of // known fully-namespaced file names, and report suggestions for the undefined template. String closestImportedSymbol = SoyErrors.getClosest(registry.getImportedSymbols(), ident.originalName()); if (!Strings.isNullOrEmpty(closestImportedSymbol)) { // Clarify that imports shouldn't be called with a "." closestImportedSymbol = "'" + closestImportedSymbol + "' (with no '.')"; } String extraErrorMessage = SoyErrors.getDidYouMeanMessage( closestImportedSymbol, SoyErrors.getClosest(registry.getBasicTemplateOrElementNames(), ident.identifier())); errorReporter.report( node.getSourceLocation(), CALL_TO_UNDEFINED_TEMPLATE, ident.identifier(), extraErrorMessage); } }
{ "pile_set_name": "Github" }
//----------------------------------------------- // Copyright 2009 Wellcome Trust Sanger Institute // Written by Jared Simpson ([email protected]) // Released under the GPL //----------------------------------------------- // // OverlapCommon - Common functions used in overlap methods // #ifndef OVERLAPCOMMON_H #define OVERLAPCOMMON_H #include "Util.h" #include "overlap.h" #include "SuffixArray.h" #include "SGACommon.h" #include "Timer.h" #include "ReadInfoTable.h" namespace OverlapCommon { // Parse a line from a .hits file into a variety of overlap-related data void parseHitsString(const std::string& hitString, const ReadInfoTable* pQueryRIT, const ReadInfoTable* pTargetRIT, const SuffixArray* pFwdSAI, const SuffixArray* pRevSAI, bool bCheckIDs, size_t& readIdx, size_t& sumBlockSize, OverlapVector& outVector, bool& isSubstring); }; #endif
{ "pile_set_name": "Github" }
/* * Linux OS Independent Layer * * $Copyright Open Broadcom Corporation$ * * $Id: linux_osl.h 503131 2014-09-17 12:16:08Z $ */ #ifndef _linux_osl_h_ #define _linux_osl_h_ #include <typedefs.h> #define DECLSPEC_ALIGN(x) __attribute__ ((aligned(x))) /* Linux Kernel: File Operations: start */ extern void * osl_os_open_image(char * filename); extern int osl_os_get_image_block(char * buf, int len, void * image); extern void osl_os_close_image(void * image); extern int osl_os_image_size(void *image); /* Linux Kernel: File Operations: end */ #ifdef BCMDRIVER /* OSL initialization */ #ifdef SHARED_OSL_CMN extern osl_t *osl_attach(void *pdev, uint bustype, bool pkttag, void **osh_cmn); #else extern osl_t *osl_attach(void *pdev, uint bustype, bool pkttag); #endif /* SHARED_OSL_CMN */ extern void osl_detach(osl_t *osh); extern int osl_static_mem_init(osl_t *osh, void *adapter); extern int osl_static_mem_deinit(osl_t *osh, void *adapter); extern void osl_set_bus_handle(osl_t *osh, void *bus_handle); extern void* osl_get_bus_handle(osl_t *osh); /* Global ASSERT type */ extern uint32 g_assert_type; /* ASSERT */ #if defined(BCMASSERT_LOG) #define ASSERT(exp) \ do { if (!(exp)) osl_assert(#exp, __FILE__, __LINE__); } while (0) extern void osl_assert(const char *exp, const char *file, int line); #else #ifdef __GNUC__ #define GCC_VERSION \ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #if GCC_VERSION > 30100 #define ASSERT(exp) do {} while (0) #else /* ASSERT could cause segmentation fault on GCC3.1, use empty instead */ #define ASSERT(exp) #endif /* GCC_VERSION > 30100 */ #endif /* __GNUC__ */ #endif /* bcm_prefetch_32B */ static inline void bcm_prefetch_32B(const uint8 *addr, const int cachelines_32B) { #if defined(BCM47XX_CA9) && (__LINUX_ARM_ARCH__ >= 5) switch (cachelines_32B) { case 4: __asm__ __volatile__("pld\t%a0" :: "p"(addr + 96) : "cc"); case 3: __asm__ __volatile__("pld\t%a0" :: "p"(addr + 64) : "cc"); case 2: __asm__ __volatile__("pld\t%a0" :: "p"(addr + 32) : "cc"); case 1: __asm__ __volatile__("pld\t%a0" :: "p"(addr + 0) : "cc"); } #endif } /* microsecond delay */ #define OSL_DELAY(usec) osl_delay(usec) extern void osl_delay(uint usec); #define OSL_SLEEP(ms) osl_sleep(ms) extern void osl_sleep(uint ms); #define OSL_PCMCIA_READ_ATTR(osh, offset, buf, size) \ osl_pcmcia_read_attr((osh), (offset), (buf), (size)) #define OSL_PCMCIA_WRITE_ATTR(osh, offset, buf, size) \ osl_pcmcia_write_attr((osh), (offset), (buf), (size)) extern void osl_pcmcia_read_attr(osl_t *osh, uint offset, void *buf, int size); extern void osl_pcmcia_write_attr(osl_t *osh, uint offset, void *buf, int size); /* PCI configuration space access macros */ #define OSL_PCI_READ_CONFIG(osh, offset, size) \ osl_pci_read_config((osh), (offset), (size)) #define OSL_PCI_WRITE_CONFIG(osh, offset, size, val) \ osl_pci_write_config((osh), (offset), (size), (val)) extern uint32 osl_pci_read_config(osl_t *osh, uint offset, uint size); extern void osl_pci_write_config(osl_t *osh, uint offset, uint size, uint val); /* PCI device bus # and slot # */ #define OSL_PCI_BUS(osh) osl_pci_bus(osh) #define OSL_PCI_SLOT(osh) osl_pci_slot(osh) #define OSL_PCIE_DOMAIN(osh) osl_pcie_domain(osh) #define OSL_PCIE_BUS(osh) osl_pcie_bus(osh) extern uint osl_pci_bus(osl_t *osh); extern uint osl_pci_slot(osl_t *osh); extern uint osl_pcie_domain(osl_t *osh); extern uint osl_pcie_bus(osl_t *osh); extern struct pci_dev *osl_pci_device(osl_t *osh); /* Pkttag flag should be part of public information */ typedef struct { bool pkttag; bool mmbus; /* Bus supports memory-mapped register accesses */ pktfree_cb_fn_t tx_fn; /* Callback function for PKTFREE */ void *tx_ctx; /* Context to the callback function */ void *unused[3]; } osl_pubinfo_t; extern void osl_flag_set(osl_t *osh, uint32 mask); extern bool osl_is_flag_set(osl_t *osh, uint32 mask); #define PKTFREESETCB(osh, _tx_fn, _tx_ctx) \ do { \ ((osl_pubinfo_t*)osh)->tx_fn = _tx_fn; \ ((osl_pubinfo_t*)osh)->tx_ctx = _tx_ctx; \ } while (0) /* host/bus architecture-specific byte swap */ #define BUS_SWAP32(v) (v) #define MALLOC(osh, size) osl_malloc((osh), (size)) #define MALLOCZ(osh, size) osl_mallocz((osh), (size)) #define MFREE(osh, addr, size) osl_mfree((osh), (addr), (size)) #define MALLOCED(osh) osl_malloced((osh)) #define MEMORY_LEFTOVER(osh) osl_check_memleak(osh) extern void *osl_malloc(osl_t *osh, uint size); extern void *osl_mallocz(osl_t *osh, uint size); extern void osl_mfree(osl_t *osh, void *addr, uint size); extern uint osl_malloced(osl_t *osh); extern uint osl_check_memleak(osl_t *osh); #define MALLOC_FAILED(osh) osl_malloc_failed((osh)) extern uint osl_malloc_failed(osl_t *osh); /* allocate/free shared (dma-able) consistent memory */ #define DMA_CONSISTENT_ALIGN osl_dma_consistent_align() #define DMA_ALLOC_CONSISTENT(osh, size, align, tot, pap, dmah) \ osl_dma_alloc_consistent((osh), (size), (align), (tot), (pap)) #define DMA_FREE_CONSISTENT(osh, va, size, pa, dmah) \ osl_dma_free_consistent((osh), (void*)(va), (size), (pa)) #define DMA_ALLOC_CONSISTENT_FORCE32(osh, size, align, tot, pap, dmah) \ osl_dma_alloc_consistent((osh), (size), (align), (tot), (pap)) #define DMA_FREE_CONSISTENT_FORCE32(osh, va, size, pa, dmah) \ osl_dma_free_consistent((osh), (void*)(va), (size), (pa)) #if defined(BCMPCIE) #if defined(CONFIG_DHD_USE_STATIC_BUF) && defined(DHD_USE_STATIC_FLOWRING) #define DMA_ALLOC_CONSISTENT_STATIC(osh, size, align, tot, pap, dmah, idx) \ osl_dma_alloc_consistent_static((osh), (size), (align), (tot), (pap), (idx)) #define DMA_FREE_CONSISTENT_STATIC(osh, va, size, pa, dmah, idx) \ osl_dma_free_consistent_static((osh), (void*)(va), (size), (pa), (idx)) extern void *osl_dma_alloc_consistent_static(osl_t *osh, uint size, uint16 align, uint *tot, dmaaddr_t *pap, uint16 idx); extern void osl_dma_free_consistent_static(osl_t *osh, void *va, uint size, dmaaddr_t pa, uint16 idx); #endif /* CONFIG_DHD_USE_STATIC_BUF && DHD_USE_STATIC_FLOWRING */ #endif /* BCMPCIE */ extern uint osl_dma_consistent_align(void); extern void *osl_dma_alloc_consistent(osl_t *osh, uint size, uint16 align, uint *tot, dmaaddr_t *pap); extern void osl_dma_free_consistent(osl_t *osh, void *va, uint size, dmaaddr_t pa); /* map/unmap direction */ #define DMA_TX 1 /* TX direction for DMA */ #define DMA_RX 2 /* RX direction for DMA */ /* map/unmap shared (dma-able) memory */ #define DMA_UNMAP(osh, pa, size, direction, p, dmah) \ osl_dma_unmap((osh), (pa), (size), (direction)) extern dmaaddr_t osl_dma_map(osl_t *osh, void *va, uint size, int direction, void *p, hnddma_seg_map_t *txp_dmah); extern void osl_dma_unmap(osl_t *osh, uint pa, uint size, int direction); /* API for DMA addressing capability */ #define OSL_DMADDRWIDTH(osh, addrwidth) ({BCM_REFERENCE(osh); BCM_REFERENCE(addrwidth);}) #if (defined(BCM47XX_CA9) && defined(__ARM_ARCH_7A__)) extern void osl_cache_flush(void *va, uint size); extern void osl_cache_inv(void *va, uint size); extern void osl_prefetch(const void *ptr); #define OSL_CACHE_FLUSH(va, len) osl_cache_flush((void *) va, len) #define OSL_CACHE_INV(va, len) osl_cache_inv((void *) va, len) #define OSL_PREFETCH(ptr) osl_prefetch(ptr) #ifdef __ARM_ARCH_7A__ extern int osl_arch_is_coherent(void); #define OSL_ARCH_IS_COHERENT() osl_arch_is_coherent() #else #define OSL_ARCH_IS_COHERENT() NULL #endif /* __ARM_ARCH_7A__ */ #else #define OSL_CACHE_FLUSH(va, len) BCM_REFERENCE(va) #define OSL_CACHE_INV(va, len) BCM_REFERENCE(va) #define OSL_PREFETCH(ptr) BCM_REFERENCE(ptr) #define OSL_ARCH_IS_COHERENT() NULL #endif /* register access macros */ #if defined(BCMSDIO) #include <bcmsdh.h> #define OSL_WRITE_REG(osh, r, v) (bcmsdh_reg_write(osl_get_bus_handle(osh), \ (uintptr)(r), sizeof(*(r)), (v))) #define OSL_READ_REG(osh, r) (bcmsdh_reg_read(osl_get_bus_handle(osh), \ (uintptr)(r), sizeof(*(r)))) #elif defined(BCM47XX_ACP_WAR) extern void osl_pcie_rreg(osl_t *osh, ulong addr, void *v, uint size); #define OSL_READ_REG(osh, r) \ ({\ __typeof(*(r)) __osl_v; \ osl_pcie_rreg(osh, (uintptr)(r), (void *)&__osl_v, sizeof(*(r))); \ __osl_v; \ }) #endif #if defined(BCM47XX_ACP_WAR) #define SELECT_BUS_WRITE(osh, mmap_op, bus_op) ({BCM_REFERENCE(osh); mmap_op;}) #define SELECT_BUS_READ(osh, mmap_op, bus_op) ({BCM_REFERENCE(osh); bus_op;}) #else #if defined(BCMSDIO) #define SELECT_BUS_WRITE(osh, mmap_op, bus_op) if (((osl_pubinfo_t*)(osh))->mmbus) \ mmap_op else bus_op #define SELECT_BUS_READ(osh, mmap_op, bus_op) (((osl_pubinfo_t*)(osh))->mmbus) ? \ mmap_op : bus_op #else #define SELECT_BUS_WRITE(osh, mmap_op, bus_op) ({BCM_REFERENCE(osh); mmap_op;}) #define SELECT_BUS_READ(osh, mmap_op, bus_op) ({BCM_REFERENCE(osh); mmap_op;}) #endif #endif /* BCM47XX_ACP_WAR */ #define OSL_ERROR(bcmerror) osl_error(bcmerror) extern int osl_error(int bcmerror); /* the largest reasonable packet buffer driver uses for ethernet MTU in bytes */ #define PKTBUFSZ 2048 /* largest reasonable packet buffer, driver uses for ethernet MTU */ #define OSH_NULL NULL /* * BINOSL selects the slightly slower function-call-based binary compatible osl. * Macros expand to calls to functions defined in linux_osl.c . */ #include <linuxver.h> /* use current 2.4.x calling conventions */ #include <linux/kernel.h> /* for vsn/printf's */ #include <linux/string.h> /* for mem*, str* */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 29) #define OSL_SYSUPTIME() ((uint32)jiffies_to_msecs(jiffies)) #else #define OSL_SYSUPTIME() ((uint32)jiffies * (1000 / HZ)) #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 29) */ #define printf(fmt, args...) printk(fmt , ## args) #include <linux/kernel.h> /* for vsn/printf's */ #include <linux/string.h> /* for mem*, str* */ /* bcopy's: Linux kernel doesn't provide these (anymore) */ #define bcopy(src, dst, len) memcpy((dst), (src), (len)) #define bcmp(b1, b2, len) memcmp((b1), (b2), (len)) #define bzero(b, len) memset((b), '\0', (len)) /* register access macros */ #define R_REG(osh, r) (\ SELECT_BUS_READ(osh, \ ({ \ __typeof(*(r)) __osl_v; \ switch (sizeof(*(r))) { \ case sizeof(uint8): __osl_v = \ readb((volatile uint8*)(r)); break; \ case sizeof(uint16): __osl_v = \ readw((volatile uint16*)(r)); break; \ case sizeof(uint32): __osl_v = \ readl((volatile uint32*)(r)); break; \ } \ __osl_v; \ }), \ OSL_READ_REG(osh, r)) \ ) #define W_REG(osh, r, v) do { \ SELECT_BUS_WRITE(osh, \ switch (sizeof(*(r))) { \ case sizeof(uint8): writeb((uint8)(v), (volatile uint8*)(r)); break; \ case sizeof(uint16): writew((uint16)(v), (volatile uint16*)(r)); break; \ case sizeof(uint32): writel((uint32)(v), (volatile uint32*)(r)); break; \ }, \ (OSL_WRITE_REG(osh, r, v))); \ } while (0) #define AND_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) & (v)) #define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v)) /* bcopy, bcmp, and bzero functions */ #define bcopy(src, dst, len) memcpy((dst), (src), (len)) #define bcmp(b1, b2, len) memcmp((b1), (b2), (len)) #define bzero(b, len) memset((b), '\0', (len)) /* uncached/cached virtual address */ #define OSL_UNCACHED(va) ((void *)va) #define OSL_CACHED(va) ((void *)va) #define OSL_PREF_RANGE_LD(va, sz) BCM_REFERENCE(va) #define OSL_PREF_RANGE_ST(va, sz) BCM_REFERENCE(va) /* get processor cycle count */ #if defined(__i386__) #define OSL_GETCYCLES(x) rdtscl((x)) #else #define OSL_GETCYCLES(x) ((x) = 0) #endif /* dereference an address that may cause a bus exception */ #define BUSPROBE(val, addr) ({ (val) = R_REG(NULL, (addr)); 0; }) /* map/unmap physical to virtual I/O */ #if !defined(CONFIG_MMC_MSM7X00A) #define REG_MAP(pa, size) ioremap_nocache((unsigned long)(pa), (unsigned long)(size)) #else #define REG_MAP(pa, size) (void *)(0) #endif /* !defined(CONFIG_MMC_MSM7X00A */ #define REG_UNMAP(va) iounmap((va)) /* shared (dma-able) memory access macros */ #define R_SM(r) *(r) #define W_SM(r, v) (*(r) = (v)) #define BZERO_SM(r, len) memset((r), '\0', (len)) /* Because the non BINOSL implemenation of the PKT OSL routines are macros (for * performance reasons), we need the Linux headers. */ #include <linuxver.h> /* use current 2.4.x calling conventions */ /* packet primitives */ #ifdef BCMDBG_CTRACE #define PKTGET(osh, len, send) osl_pktget((osh), (len), __LINE__, __FILE__) #define PKTDUP(osh, skb) osl_pktdup((osh), (skb), __LINE__, __FILE__) #else #define PKTGET(osh, len, send) osl_pktget((osh), (len)) #define PKTDUP(osh, skb) osl_pktdup((osh), (skb)) #endif /* BCMDBG_CTRACE */ #define PKTLIST_DUMP(osh, buf) BCM_REFERENCE(osh) #define PKTDBG_TRACE(osh, pkt, bit) BCM_REFERENCE(osh) #define PKTFREE(osh, skb, send) osl_pktfree((osh), (skb), (send)) #ifdef CONFIG_DHD_USE_STATIC_BUF #define PKTGET_STATIC(osh, len, send) osl_pktget_static((osh), (len)) #define PKTFREE_STATIC(osh, skb, send) osl_pktfree_static((osh), (skb), (send)) #else #define PKTGET_STATIC PKTGET #define PKTFREE_STATIC PKTFREE #endif /* CONFIG_DHD_USE_STATIC_BUF */ #define PKTDATA(osh, skb) ({BCM_REFERENCE(osh); (((struct sk_buff*)(skb))->data);}) #define PKTLEN(osh, skb) ({BCM_REFERENCE(osh); (((struct sk_buff*)(skb))->len);}) #define PKTHEADROOM(osh, skb) (PKTDATA(osh, skb)-(((struct sk_buff*)(skb))->head)) #define PKTEXPHEADROOM(osh, skb, b) \ ({ \ BCM_REFERENCE(osh); \ skb_realloc_headroom((struct sk_buff*)(skb), (b)); \ }) #define PKTTAILROOM(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ skb_tailroom((struct sk_buff*)(skb)); \ }) #define PKTPADTAILROOM(osh, skb, padlen) \ ({ \ BCM_REFERENCE(osh); \ skb_pad((struct sk_buff*)(skb), (padlen)); \ }) #define PKTNEXT(osh, skb) ({BCM_REFERENCE(osh); (((struct sk_buff*)(skb))->next);}) #define PKTSETNEXT(osh, skb, x) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->next = (struct sk_buff*)(x)); \ }) #define PKTSETLEN(osh, skb, len) \ ({ \ BCM_REFERENCE(osh); \ __skb_trim((struct sk_buff*)(skb), (len)); \ }) #define PKTPUSH(osh, skb, bytes) \ ({ \ BCM_REFERENCE(osh); \ skb_push((struct sk_buff*)(skb), (bytes)); \ }) #define PKTPULL(osh, skb, bytes) \ ({ \ BCM_REFERENCE(osh); \ skb_pull((struct sk_buff*)(skb), (bytes)); \ }) #define PKTTAG(skb) ((void*)(((struct sk_buff*)(skb))->cb)) #define PKTSETPOOL(osh, skb, x, y) BCM_REFERENCE(osh) #define PKTPOOL(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb); FALSE;}) #define PKTFREELIST(skb) PKTLINK(skb) #define PKTSETFREELIST(skb, x) PKTSETLINK((skb), (x)) #define PKTPTR(skb) (skb) #define PKTID(skb) ({BCM_REFERENCE(skb); 0;}) #define PKTSETID(skb, id) ({BCM_REFERENCE(skb); BCM_REFERENCE(id);}) #define PKTSHRINK(osh, m) ({BCM_REFERENCE(osh); m;}) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) #define PKTORPHAN(skb) skb_orphan(skb) #else #define PKTORPHAN(skb) ({BCM_REFERENCE(skb); 0;}) #endif /* LINUX VERSION >= 3.6 */ #ifdef BCMDBG_CTRACE #define DEL_CTRACE(zosh, zskb) { \ unsigned long zflags; \ spin_lock_irqsave(&(zosh)->ctrace_lock, zflags); \ list_del(&(zskb)->ctrace_list); \ (zosh)->ctrace_num--; \ (zskb)->ctrace_start = 0; \ (zskb)->ctrace_count = 0; \ spin_unlock_irqrestore(&(zosh)->ctrace_lock, zflags); \ } #define UPDATE_CTRACE(zskb, zfile, zline) { \ struct sk_buff *_zskb = (struct sk_buff *)(zskb); \ if (_zskb->ctrace_count < CTRACE_NUM) { \ _zskb->func[_zskb->ctrace_count] = zfile; \ _zskb->line[_zskb->ctrace_count] = zline; \ _zskb->ctrace_count++; \ } \ else { \ _zskb->func[_zskb->ctrace_start] = zfile; \ _zskb->line[_zskb->ctrace_start] = zline; \ _zskb->ctrace_start++; \ if (_zskb->ctrace_start >= CTRACE_NUM) \ _zskb->ctrace_start = 0; \ } \ } #define ADD_CTRACE(zosh, zskb, zfile, zline) { \ unsigned long zflags; \ spin_lock_irqsave(&(zosh)->ctrace_lock, zflags); \ list_add(&(zskb)->ctrace_list, &(zosh)->ctrace_list); \ (zosh)->ctrace_num++; \ UPDATE_CTRACE(zskb, zfile, zline); \ spin_unlock_irqrestore(&(zosh)->ctrace_lock, zflags); \ } #define PKTCALLER(zskb) UPDATE_CTRACE((struct sk_buff *)zskb, (char *)__FUNCTION__, __LINE__) #endif /* BCMDBG_CTRACE */ #ifdef CTFPOOL #define CTFPOOL_REFILL_THRESH 3 typedef struct ctfpool { void *head; spinlock_t lock; uint max_obj; uint curr_obj; uint obj_size; uint refills; uint fast_allocs; uint fast_frees; uint slow_allocs; } ctfpool_t; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) #define FASTBUF (1 << 0) #define PKTSETFAST(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ ((((struct sk_buff*)(skb))->pktc_flags) |= FASTBUF); \ }) #define PKTCLRFAST(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ ((((struct sk_buff*)(skb))->pktc_flags) &= (~FASTBUF)); \ }) #define PKTISFAST(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ ((((struct sk_buff*)(skb))->pktc_flags) & FASTBUF); \ }) #define PKTFAST(osh, skb) (((struct sk_buff*)(skb))->pktc_flags) #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) #define FASTBUF (1 << 16) #define PKTSETFAST(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ ((((struct sk_buff*)(skb))->mac_len) |= FASTBUF); \ }) #define PKTCLRFAST(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ ((((struct sk_buff*)(skb))->mac_len) &= (~FASTBUF)); \ }) #define PKTISFAST(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ ((((struct sk_buff*)(skb))->mac_len) & FASTBUF); \ }) #define PKTFAST(osh, skb) (((struct sk_buff*)(skb))->mac_len) #else #define FASTBUF (1 << 0) #define PKTSETFAST(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ ((((struct sk_buff*)(skb))->__unused) |= FASTBUF); \ }) #define PKTCLRFAST(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ ((((struct sk_buff*)(skb))->__unused) &= (~FASTBUF)); \ }) #define PKTISFAST(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ ((((struct sk_buff*)(skb))->__unused) & FASTBUF); \ }) #define PKTFAST(osh, skb) (((struct sk_buff*)(skb))->__unused) #endif /* 2.6.22 */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) #define CTFPOOLPTR(osh, skb) (((struct sk_buff*)(skb))->ctfpool) #define CTFPOOLHEAD(osh, skb) (((ctfpool_t *)((struct sk_buff*)(skb))->ctfpool)->head) #else #define CTFPOOLPTR(osh, skb) (((struct sk_buff*)(skb))->sk) #define CTFPOOLHEAD(osh, skb) (((ctfpool_t *)((struct sk_buff*)(skb))->sk)->head) #endif extern void *osl_ctfpool_add(osl_t *osh); extern void osl_ctfpool_replenish(osl_t *osh, uint thresh); extern int32 osl_ctfpool_init(osl_t *osh, uint numobj, uint size); extern void osl_ctfpool_cleanup(osl_t *osh); extern void osl_ctfpool_stats(osl_t *osh, void *b); #else /* CTFPOOL */ #define PKTSETFAST(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTCLRFAST(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTISFAST(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb); FALSE;}) #endif /* CTFPOOL */ #define PKTSETCTF(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTCLRCTF(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTISCTF(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb); FALSE;}) #ifdef HNDCTF #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) #define SKIPCT (1 << 2) #define CHAINED (1 << 3) #define PKTSETSKIPCT(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->pktc_flags |= SKIPCT); \ }) #define PKTCLRSKIPCT(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->pktc_flags &= (~SKIPCT)); \ }) #define PKTSKIPCT(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->pktc_flags & SKIPCT); \ }) #define PKTSETCHAINED(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->pktc_flags |= CHAINED); \ }) #define PKTCLRCHAINED(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->pktc_flags &= (~CHAINED)); \ }) #define PKTISCHAINED(skb) (((struct sk_buff*)(skb))->pktc_flags & CHAINED) #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) #define SKIPCT (1 << 18) #define CHAINED (1 << 19) #define PKTSETSKIPCT(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->mac_len |= SKIPCT); \ }) #define PKTCLRSKIPCT(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->mac_len &= (~SKIPCT)); \ }) #define PKTSKIPCT(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->mac_len & SKIPCT); \ }) #define PKTSETCHAINED(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->mac_len |= CHAINED); \ }) #define PKTCLRCHAINED(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->mac_len &= (~CHAINED)); \ }) #define PKTISCHAINED(skb) (((struct sk_buff*)(skb))->mac_len & CHAINED) #else /* 2.6.22 */ #define SKIPCT (1 << 2) #define CHAINED (1 << 3) #define PKTSETSKIPCT(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->__unused |= SKIPCT); \ }) #define PKTCLRSKIPCT(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->__unused &= (~SKIPCT)); \ }) #define PKTSKIPCT(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->__unused & SKIPCT); \ }) #define PKTSETCHAINED(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->__unused |= CHAINED); \ }) #define PKTCLRCHAINED(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->__unused &= (~CHAINED)); \ }) #define PKTISCHAINED(skb) (((struct sk_buff*)(skb))->__unused & CHAINED) #endif /* 2.6.22 */ typedef struct ctf_mark { uint32 value; } ctf_mark_t; #define CTF_MARK(m) (m.value) #else /* HNDCTF */ #define PKTSETSKIPCT(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTCLRSKIPCT(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTSKIPCT(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define CTF_MARK(m) ({BCM_REFERENCE(m); 0;}) #endif /* HNDCTF */ #if defined(BCM_GMAC3) /** pktalloced accounting in devices using GMAC Bulk Forwarding to DHD */ /* Account for packets delivered to downstream forwarder by GMAC interface. */ extern void osl_pkt_tofwder(osl_t *osh, void *skbs, int skb_cnt); #define PKTTOFWDER(osh, skbs, skb_cnt) \ osl_pkt_tofwder(((osl_t *)osh), (void *)(skbs), (skb_cnt)) /* Account for packets received from downstream forwarder. */ #if defined(BCMDBG_CTRACE) /* pkt logging */ extern void osl_pkt_frmfwder(osl_t *osh, void *skbs, int skb_cnt, int line, char *file); #define PKTFRMFWDER(osh, skbs, skb_cnt) \ osl_pkt_frmfwder(((osl_t *)osh), (void *)(skbs), (skb_cnt), \ __LINE__, __FILE__) #else /* ! (BCMDBG_PKT || BCMDBG_CTRACE) */ extern void osl_pkt_frmfwder(osl_t *osh, void *skbs, int skb_cnt); #define PKTFRMFWDER(osh, skbs, skb_cnt) \ osl_pkt_frmfwder(((osl_t *)osh), (void *)(skbs), (skb_cnt)) #endif /** GMAC Forwarded packet tagging for reduced cache flush/invalidate. * In FWDERBUF tagged packet, only FWDER_PKTMAPSZ amount of data would have * been accessed in the GMAC forwarder. This may be used to limit the number of * cachelines that need to be flushed or invalidated. * Packets sent to the DHD from a GMAC forwarder will be tagged w/ FWDERBUF. * DHD may clear the FWDERBUF tag, if more than FWDER_PKTMAPSZ was accessed. * Likewise, a debug print of a packet payload in say the ethernet driver needs * to be accompanied with a clear of the FWDERBUF tag. */ /** Forwarded packets, have a HWRXOFF sized rx header (etc.h) */ #define FWDER_HWRXOFF (30) /** Maximum amount of a pktadat that a downstream forwarder (GMAC) may have * read into the L1 cache (not dirty). This may be used in reduced cache ops. * * Max 56: ET HWRXOFF[30] + BRCMHdr[4] + EtherHdr[14] + VlanHdr[4] + IP[4] */ #define FWDER_PKTMAPSZ (FWDER_HWRXOFF + 4 + 14 + 4 + 4) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) #define FWDERBUF (1 << 4) #define PKTSETFWDERBUF(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->pktc_flags |= FWDERBUF); \ }) #define PKTCLRFWDERBUF(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->pktc_flags &= (~FWDERBUF)); \ }) #define PKTISFWDERBUF(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->pktc_flags & FWDERBUF); \ }) #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) #define FWDERBUF (1 << 20) #define PKTSETFWDERBUF(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->mac_len |= FWDERBUF); \ }) #define PKTCLRFWDERBUF(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->mac_len &= (~FWDERBUF)); \ }) #define PKTISFWDERBUF(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->mac_len & FWDERBUF); \ }) #else /* 2.6.22 */ #define FWDERBUF (1 << 4) #define PKTSETFWDERBUF(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->__unused |= FWDERBUF); \ }) #define PKTCLRFWDERBUF(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->__unused &= (~FWDERBUF)); \ }) #define PKTISFWDERBUF(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->__unused & FWDERBUF); \ }) #endif /* 2.6.22 */ #else /* ! BCM_GMAC3 */ #define PKTSETFWDERBUF(osh, skb) ({ BCM_REFERENCE(osh); BCM_REFERENCE(skb); }) #define PKTCLRFWDERBUF(osh, skb) ({ BCM_REFERENCE(osh); BCM_REFERENCE(skb); }) #define PKTISFWDERBUF(osh, skb) ({ BCM_REFERENCE(osh); BCM_REFERENCE(skb); FALSE;}) #endif /* ! BCM_GMAC3 */ #ifdef HNDCTF /* For broadstream iqos */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) #define TOBR (1 << 5) #define PKTSETTOBR(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->pktc_flags |= TOBR); \ }) #define PKTCLRTOBR(osh, skb) \ ({ \ BCM_REFERENCE(osh); \ (((struct sk_buff*)(skb))->pktc_flags &= (~TOBR)); \ }) #define PKTISTOBR(skb) (((struct sk_buff*)(skb))->pktc_flags & TOBR) #define PKTSETCTFIPCTXIF(skb, ifp) (((struct sk_buff*)(skb))->ctf_ipc_txif = ifp) #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) #define PKTSETTOBR(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTCLRTOBR(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTISTOBR(skb) ({BCM_REFERENCE(skb); FALSE;}) #define PKTSETCTFIPCTXIF(skb, ifp) ({BCM_REFERENCE(skb); BCM_REFERENCE(ifp);}) #else /* 2.6.22 */ #define PKTSETTOBR(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTCLRTOBR(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTISTOBR(skb) ({BCM_REFERENCE(skb); FALSE;}) #define PKTSETCTFIPCTXIF(skb, ifp) ({BCM_REFERENCE(skb); BCM_REFERENCE(ifp);}) #endif /* 2.6.22 */ #else /* HNDCTF */ #define PKTSETTOBR(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTCLRTOBR(osh, skb) ({BCM_REFERENCE(osh); BCM_REFERENCE(skb);}) #define PKTISTOBR(skb) ({BCM_REFERENCE(skb); FALSE;}) #endif /* HNDCTF */ #ifdef BCMFA #ifdef BCMFA_HW_HASH #define PKTSETFAHIDX(skb, idx) (((struct sk_buff*)(skb))->napt_idx = idx) #else #define PKTSETFAHIDX(skb, idx) ({BCM_REFERENCE(skb); BCM_REFERENCE(idx);}) #endif /* BCMFA_SW_HASH */ #define PKTGETFAHIDX(skb) (((struct sk_buff*)(skb))->napt_idx) #define PKTSETFADEV(skb, imp) (((struct sk_buff*)(skb))->dev = imp) #define PKTSETRXDEV(skb) (((struct sk_buff*)(skb))->rxdev = ((struct sk_buff*)(skb))->dev) #define AUX_TCP_FIN_RST (1 << 0) #define AUX_FREED (1 << 1) #define PKTSETFAAUX(skb) (((struct sk_buff*)(skb))->napt_flags |= AUX_TCP_FIN_RST) #define PKTCLRFAAUX(skb) (((struct sk_buff*)(skb))->napt_flags &= (~AUX_TCP_FIN_RST)) #define PKTISFAAUX(skb) (((struct sk_buff*)(skb))->napt_flags & AUX_TCP_FIN_RST) #define PKTSETFAFREED(skb) (((struct sk_buff*)(skb))->napt_flags |= AUX_FREED) #define PKTCLRFAFREED(skb) (((struct sk_buff*)(skb))->napt_flags &= (~AUX_FREED)) #define PKTISFAFREED(skb) (((struct sk_buff*)(skb))->napt_flags & AUX_FREED) #define PKTISFABRIDGED(skb) PKTISFAAUX(skb) #else #define PKTISFAAUX(skb) ({BCM_REFERENCE(skb); FALSE;}) #define PKTISFABRIDGED(skb) ({BCM_REFERENCE(skb); FALSE;}) #define PKTISFAFREED(skb) ({BCM_REFERENCE(skb); FALSE;}) #define PKTCLRFAAUX(skb) BCM_REFERENCE(skb) #define PKTSETFAFREED(skb) BCM_REFERENCE(skb) #define PKTCLRFAFREED(skb) BCM_REFERENCE(skb) #endif /* BCMFA */ extern void osl_pktfree(osl_t *osh, void *skb, bool send); extern void *osl_pktget_static(osl_t *osh, uint len); extern void osl_pktfree_static(osl_t *osh, void *skb, bool send); extern void osl_pktclone(osl_t *osh, void **pkt); #ifdef BCMDBG_CTRACE #define PKT_CTRACE_DUMP(osh, b) osl_ctrace_dump((osh), (b)) extern void *osl_pktget(osl_t *osh, uint len, int line, char *file); extern void *osl_pkt_frmnative(osl_t *osh, void *skb, int line, char *file); extern int osl_pkt_is_frmnative(osl_t *osh, struct sk_buff *pkt); extern void *osl_pktdup(osl_t *osh, void *skb, int line, char *file); struct bcmstrbuf; extern void osl_ctrace_dump(osl_t *osh, struct bcmstrbuf *b); #else extern void *osl_pkt_frmnative(osl_t *osh, void *skb); extern void *osl_pktget(osl_t *osh, uint len); extern void *osl_pktdup(osl_t *osh, void *skb); #endif /* BCMDBG_CTRACE */ extern struct sk_buff *osl_pkt_tonative(osl_t *osh, void *pkt); #ifdef BCMDBG_CTRACE #define PKTFRMNATIVE(osh, skb) osl_pkt_frmnative(((osl_t *)osh), \ (struct sk_buff*)(skb), __LINE__, __FILE__) #define PKTISFRMNATIVE(osh, skb) osl_pkt_is_frmnative((osl_t *)(osh), (struct sk_buff *)(skb)) #else #define PKTFRMNATIVE(osh, skb) osl_pkt_frmnative(((osl_t *)osh), (struct sk_buff*)(skb)) #endif /* BCMDBG_CTRACE */ #define PKTTONATIVE(osh, pkt) osl_pkt_tonative((osl_t *)(osh), (pkt)) #define PKTLINK(skb) (((struct sk_buff*)(skb))->prev) #define PKTSETLINK(skb, x) (((struct sk_buff*)(skb))->prev = (struct sk_buff*)(x)) #define PKTPRIO(skb) (((struct sk_buff*)(skb))->priority) #define PKTSETPRIO(skb, x) (((struct sk_buff*)(skb))->priority = (x)) #define PKTSUMNEEDED(skb) (((struct sk_buff*)(skb))->ip_summed == CHECKSUM_HW) #define PKTSETSUMGOOD(skb, x) (((struct sk_buff*)(skb))->ip_summed = \ ((x) ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE)) /* PKTSETSUMNEEDED and PKTSUMGOOD are not possible because skb->ip_summed is overloaded */ #define PKTSHARED(skb) (((struct sk_buff*)(skb))->cloned) #ifdef CONFIG_NF_CONNTRACK_MARK #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)) #define PKTMARK(p) (((struct sk_buff *)(p))->mark) #define PKTSETMARK(p, m) ((struct sk_buff *)(p))->mark = (m) #else /* !2.6.0 */ #define PKTMARK(p) (((struct sk_buff *)(p))->nfmark) #define PKTSETMARK(p, m) ((struct sk_buff *)(p))->nfmark = (m) #endif /* 2.6.0 */ #else /* CONFIG_NF_CONNTRACK_MARK */ #define PKTMARK(p) 0 #define PKTSETMARK(p, m) #endif /* CONFIG_NF_CONNTRACK_MARK */ #define PKTALLOCED(osh) osl_pktalloced(osh) extern uint osl_pktalloced(osl_t *osh); #define OSL_RAND() osl_rand() extern uint32 osl_rand(void); #define DMA_MAP(osh, va, size, direction, p, dmah) \ osl_dma_map((osh), (va), (size), (direction), (p), (dmah)) #ifdef PKTC /* Use 8 bytes of skb tstamp field to store below info */ struct chain_node { struct sk_buff *link; unsigned int flags:3, pkts:9, bytes:20; }; #define CHAIN_NODE(skb) ((struct chain_node*)(((struct sk_buff*)skb)->pktc_cb)) #define PKTCSETATTR(s, f, p, b) ({CHAIN_NODE(s)->flags = (f); CHAIN_NODE(s)->pkts = (p); \ CHAIN_NODE(s)->bytes = (b);}) #define PKTCCLRATTR(s) ({CHAIN_NODE(s)->flags = CHAIN_NODE(s)->pkts = \ CHAIN_NODE(s)->bytes = 0;}) #define PKTCGETATTR(s) (CHAIN_NODE(s)->flags << 29 | CHAIN_NODE(s)->pkts << 20 | \ CHAIN_NODE(s)->bytes) #define PKTCCNT(skb) (CHAIN_NODE(skb)->pkts) #define PKTCLEN(skb) (CHAIN_NODE(skb)->bytes) #define PKTCGETFLAGS(skb) (CHAIN_NODE(skb)->flags) #define PKTCSETFLAGS(skb, f) (CHAIN_NODE(skb)->flags = (f)) #define PKTCCLRFLAGS(skb) (CHAIN_NODE(skb)->flags = 0) #define PKTCFLAGS(skb) (CHAIN_NODE(skb)->flags) #define PKTCSETCNT(skb, c) (CHAIN_NODE(skb)->pkts = (c)) #define PKTCINCRCNT(skb) (CHAIN_NODE(skb)->pkts++) #define PKTCADDCNT(skb, c) (CHAIN_NODE(skb)->pkts += (c)) #define PKTCSETLEN(skb, l) (CHAIN_NODE(skb)->bytes = (l)) #define PKTCADDLEN(skb, l) (CHAIN_NODE(skb)->bytes += (l)) #define PKTCSETFLAG(skb, fb) (CHAIN_NODE(skb)->flags |= (fb)) #define PKTCCLRFLAG(skb, fb) (CHAIN_NODE(skb)->flags &= ~(fb)) #define PKTCLINK(skb) (CHAIN_NODE(skb)->link) #define PKTSETCLINK(skb, x) (CHAIN_NODE(skb)->link = (struct sk_buff*)(x)) #define FOREACH_CHAINED_PKT(skb, nskb) \ for (; (skb) != NULL; (skb) = (nskb)) \ if ((nskb) = (PKTISCHAINED(skb) ? PKTCLINK(skb) : NULL), \ PKTSETCLINK((skb), NULL), 1) #define PKTCFREE(osh, skb, send) \ do { \ void *nskb; \ ASSERT((skb) != NULL); \ FOREACH_CHAINED_PKT((skb), nskb) { \ PKTCLRCHAINED((osh), (skb)); \ PKTCCLRFLAGS((skb)); \ PKTFREE((osh), (skb), (send)); \ } \ } while (0) #define PKTCENQTAIL(h, t, p) \ do { \ if ((t) == NULL) { \ (h) = (t) = (p); \ } else { \ PKTSETCLINK((t), (p)); \ (t) = (p); \ } \ } while (0) #endif /* PKTC */ #else /* ! BCMDRIVER */ /* ASSERT */ #define ASSERT(exp) do {} while (0) /* MALLOC and MFREE */ #define MALLOC(o, l) malloc(l) #define MFREE(o, p, l) free(p) #include <stdlib.h> /* str* and mem* functions */ #include <string.h> /* *printf functions */ #include <stdio.h> /* bcopy, bcmp, and bzero */ extern void bcopy(const void *src, void *dst, size_t len); extern int bcmp(const void *b1, const void *b2, size_t len); extern void bzero(void *b, size_t len); #endif /* ! BCMDRIVER */ typedef struct sec_cma_info { struct sec_mem_elem *sec_alloc_list; struct sec_mem_elem *sec_alloc_list_tail; } sec_cma_info_t; #ifdef BCM_SECURE_DMA #define SECURE_DMA_MAP(osh, va, size, direction, p, dmah, pcma, offset) \ osl_sec_dma_map((osh), (va), (size), (direction), (p), (dmah), (pcma), (offset)) #define SECURE_DMA_DD_MAP(osh, va, size, direction, p, dmah) \ osl_sec_dma_dd_map((osh), (va), (size), (direction), (p), (dmah)) #define SECURE_DMA_MAP_TXMETA(osh, va, size, direction, p, dmah, pcma) \ osl_sec_dma_map_txmeta((osh), (va), (size), (direction), (p), (dmah), (pcma)) #define SECURE_DMA_UNMAP(osh, pa, size, direction, p, dmah, pcma, offset) \ osl_sec_dma_unmap((osh), (pa), (size), (direction), (p), (dmah), (pcma), (offset)) #define SECURE_DMA_UNMAP_ALL(osh, pcma) \ osl_sec_dma_unmap_all((osh), (pcma)) #if defined(__ARM_ARCH_7A__) #define ACP_WAR_ENAB() 0 #define ACP_WIN_LIMIT 0 #define arch_is_coherent() 0 #define CMA_BUFSIZE_4K 4096 #define CMA_BUFSIZE_2K 2048 #define CMA_BUFSIZE_512 512 #define CMA_BUFNUM 2048 #define SEC_CMA_COHERENT_BLK 0x8000 /* 32768 */ #define SEC_CMA_COHERENT_MAX 32 #define CMA_DMA_DESC_MEMBLOCK (SEC_CMA_COHERENT_BLK * SEC_CMA_COHERENT_MAX) #define CMA_DMA_DATA_MEMBLOCK (CMA_BUFSIZE_4K*CMA_BUFNUM) #define CMA_MEMBLOCK (CMA_DMA_DESC_MEMBLOCK + CMA_DMA_DATA_MEMBLOCK) #define CONT_ARMREGION 0x02 /* Region CMA */ #else #define CONT_MIPREGION 0x00 /* To access the MIPs mem, Not yet... */ #endif /* !defined __ARM_ARCH_7A__ */ #define SEC_DMA_ALIGN (1<<16) typedef struct sec_mem_elem { size_t size; int direction; phys_addr_t pa_cma; /* physical address */ void *va; /* virtual address of driver pkt */ dma_addr_t dma_handle; /* bus address assign by linux */ void *vac; /* virtual address of cma buffer */ struct sec_mem_elem *next; } sec_mem_elem_t; extern dma_addr_t osl_sec_dma_map(osl_t *osh, void *va, uint size, int direction, void *p, hnddma_seg_map_t *dmah, void *ptr_cma_info, uint offset); extern dma_addr_t osl_sec_dma_dd_map(osl_t *osh, void *va, uint size, int direction, void *p, hnddma_seg_map_t *dmah); extern dma_addr_t osl_sec_dma_map_txmeta(osl_t *osh, void *va, uint size, int direction, void *p, hnddma_seg_map_t *dmah, void *ptr_cma_info); extern void osl_sec_dma_unmap(osl_t *osh, dma_addr_t dma_handle, uint size, int direction, void *p, hnddma_seg_map_t *map, void *ptr_cma_info, uint offset); extern void osl_sec_dma_unmap_all(osl_t *osh, void *ptr_cma_info); #endif /* BCM_SECURE_DMA */ #endif /* _linux_osl_h_ */
{ "pile_set_name": "Github" }
=== RUN TestVet === PAUSE TestVet === RUN TestVetAsm === PAUSE TestVetAsm === RUN TestVetDirs === PAUSE TestVetDirs === RUN TestTags === PAUSE TestTags === RUN TestVetVerbose === PAUSE TestVetVerbose === CONT TestVet === CONT TestTags === CONT TestVetVerbose === RUN TestTags/testtag === PAUSE TestTags/testtag === CONT TestVetDirs === CONT TestVetAsm === RUN TestVet/0 === PAUSE TestVet/0 === RUN TestVet/1 === PAUSE TestVet/1 === RUN TestVet/2 === PAUSE TestVet/2 === RUN TestVet/3 === PAUSE TestVet/3 === RUN TestVet/4 === RUN TestTags/x_testtag_y === PAUSE TestVet/4 === RUN TestVet/5 === PAUSE TestVet/5 === PAUSE TestTags/x_testtag_y === RUN TestVet/6 === RUN TestTags/x,testtag,y === PAUSE TestTags/x,testtag,y === RUN TestVetDirs/testingpkg === PAUSE TestVet/6 === CONT TestTags/x,testtag,y === PAUSE TestVetDirs/testingpkg === RUN TestVetDirs/divergent === RUN TestVet/7 === PAUSE TestVet/7 === PAUSE TestVetDirs/divergent === CONT TestTags/x_testtag_y === CONT TestTags/testtag === RUN TestVetDirs/buildtag === PAUSE TestVetDirs/buildtag === CONT TestVet/0 === CONT TestVet/4 === RUN TestVetDirs/incomplete === PAUSE TestVetDirs/incomplete === RUN TestVetDirs/cgo === PAUSE TestVetDirs/cgo === CONT TestVet/7 === CONT TestVet/6 --- PASS: TestVetVerbose (0.04s) === CONT TestVet/5 === CONT TestVet/3 === CONT TestVet/2 --- PASS: TestTags (0.00s) --- PASS: TestTags/x_testtag_y (0.04s) vet_test.go:187: -tags=x testtag y --- PASS: TestTags/x,testtag,y (0.04s) vet_test.go:187: -tags=x,testtag,y --- PASS: TestTags/testtag (0.04s) vet_test.go:187: -tags=testtag === CONT TestVet/1 === CONT TestVetDirs/testingpkg === CONT TestVetDirs/buildtag === CONT TestVetDirs/divergent === CONT TestVetDirs/incomplete === CONT TestVetDirs/cgo --- PASS: TestVet (0.39s) --- PASS: TestVet/5 (0.07s) vet_test.go:114: files: ["testdata/copylock_func.go" "testdata/rangeloop.go"] --- PASS: TestVet/3 (0.07s) vet_test.go:114: files: ["testdata/composite.go" "testdata/nilfunc.go"] --- PASS: TestVet/6 (0.07s) vet_test.go:114: files: ["testdata/copylock_range.go" "testdata/shadow.go"] --- PASS: TestVet/2 (0.07s) vet_test.go:114: files: ["testdata/bool.go" "testdata/method.go" "testdata/unused.go"] --- PASS: TestVet/0 (0.13s) vet_test.go:114: files: ["testdata/assign.go" "testdata/httpresponse.go" "testdata/structtag.go"] --- PASS: TestVet/4 (0.16s) vet_test.go:114: files: ["testdata/copylock.go" "testdata/print.go"] --- PASS: TestVet/1 (0.07s) vet_test.go:114: files: ["testdata/atomic.go" "testdata/lostcancel.go" "testdata/unsafeptr.go"] --- PASS: TestVet/7 (0.19s) vet_test.go:114: files: ["testdata/deadcode.go" "testdata/shift.go"] --- PASS: TestVetDirs (0.01s) --- PASS: TestVetDirs/testingpkg (0.06s) --- PASS: TestVetDirs/divergent (0.05s) --- PASS: TestVetDirs/buildtag (0.06s) --- PASS: TestVetDirs/incomplete (0.05s) --- PASS: TestVetDirs/cgo (0.04s) --- PASS: TestVetAsm (0.75s) PASS ok cmd/vet (cached)
{ "pile_set_name": "Github" }
import 'package:flutter/material.dart'; class ExpandingDisplayItem extends StatefulWidget { /// The title of the item in the BottomNavigationBar final String title; /// The icon in the item of the BottomNavigationBar final IconData icon; /// The height of the box (Carries the BottomNavigationBar height). final double height; /// The animation controller to control the flip animation. final AnimationController controller; /// Callback for when the box is selected (Not when the box is reversed). final VoidCallback onTapped; /// The color of the icon and background when selected final Color color; ExpandingDisplayItem( this.title, this.icon, this.height, this.controller, this.onTapped, this.color, ); @override _ExpandingDisplayItemState createState() => _ExpandingDisplayItemState(); } class _ExpandingDisplayItemState extends State<ExpandingDisplayItem> with TickerProviderStateMixin { /// Tween for going from 0 to pi/2 radian and vice versa. Animation animation; /// Controller for controlling the Box. AnimationController controller; @override void initState() { super.initState(); if (widget.controller == null) { controller = AnimationController( vsync: this, duration: Duration(milliseconds: 100)); } else { controller = widget.controller; } animation = Tween(begin: 0.0, end: 1.0).animate( CurvedAnimation(parent: controller, curve: Curves.linear), ); controller.addListener(() { if (mounted) { setState(() {}); } }); } @override Widget build(BuildContext context) { return InkWell( onTap: () { widget.onTapped(); }, child: Container( decoration: BoxDecoration( color: Color.fromRGBO( widget.color.red, widget.color.green, widget.color.blue, animation.value / 2.5, ), borderRadius: BorderRadius.circular(100.0), ), padding: EdgeInsets.all(8.0), child: Row( children: <Widget>[ Padding( padding: const EdgeInsets.all(6.0), child: Icon( widget.icon, color: widget.color, size: widget.height / 3.5, ), ), Padding( padding: const EdgeInsets.all(4.0), child: animation.value != 0.0 ? Text( widget.title, style: TextStyle( color: widget.color, fontSize: (widget.height / 4) * animation.value, ), ) : Container(), ), ], ), ), ); } } /// An item in the ExpandingBottomBar class ExpandingBottomBarItem { /// Icon to be displayed in the BottomNavigationBar IconData icon; /// Title of the item String text; /// The color of the selected item Color selectedColor; ExpandingBottomBarItem({ @required this.icon, @required this.text, @required this.selectedColor, }); } /// Main BottomNavigationBar class class ExpandingBottomBar extends StatefulWidget { /// Height of the navigation bar item final double navBarHeight; /// Items in the BottomNavigationBar final List<ExpandingBottomBarItem> items; /// Duration of the selection animation final Duration animationDuration; /// The selected index of the bar final int selectedIndex; /// Callback when an item is selected final ValueChanged<int> onIndexChanged; /// The background color of the BottomNavigationBar final Color backgroundColor; ExpandingBottomBar({ this.navBarHeight = 100.0, @required this.items, this.animationDuration = const Duration(milliseconds: 200), @required this.selectedIndex, @required this.onIndexChanged, this.backgroundColor = Colors.white, }) : assert(items.length >= 2); @override _ExpandingBottomBarState createState() => _ExpandingBottomBarState(); } class _ExpandingBottomBarState extends State<ExpandingBottomBar> with TickerProviderStateMixin { /// Hosts all the controllers controlling the boxes. List<AnimationController> _controllers = []; /// The current chosen index int indexChosen = 0; @override void initState() { super.initState(); // Initialise all animation controllers. for (int i = 0; i < widget.items.length; i++) { _controllers.add( AnimationController( vsync: this, duration: widget.animationDuration, ), ); } // Start animation for initially selected controller. _controllers[widget.selectedIndex].forward(); } @override Widget build(BuildContext context) { _changeValue(); return Container( height: widget.navBarHeight, color: widget.backgroundColor, child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: widget.items.map((item) { int index = widget.items.indexOf(item); return ExpandingDisplayItem( item.text, item.icon, widget.navBarHeight, _controllers[index], () { widget.onIndexChanged(index); }, item.selectedColor, ); }).toList(), ), ), ); } void _changeValue() { _controllers.forEach((controller) => controller.reverse()); _controllers[widget.selectedIndex].forward(); } }
{ "pile_set_name": "Github" }
# This class implements the Psigate gateway for the ActiveMerchant module. # Psigate = http://www.psigate.com/ The class is currently set up to use # the psigate test server while rails is in testing or developement mode. # The real server will be used while in production mode. # # Modifications by Sean O'Hara ( sohara at sohara dot com ) # # Usage for a PreAuth (authorize) is as follows: # # twenty = 2000 # gateway = PsigateGateway.new( # :login => 'teststore', # :password => 'psigate1234' # ) # # creditcard = CreditCard.new( # :number => '4242424242424242', # :month => 8, # :year => 2006, # :first_name => 'Longbob', # :last_name => 'Longsen' # ) # response = @gateway.authorize(twenty, creditcard, # :order_id => 1234, # :billing_address => { # :address1 => '123 fairweather Lane', # :address2 => 'Apt B', # :city => 'New York', # :state => 'NY', # :country => 'U.S.A.', # :zip => '10010' # }, # :email => '[email protected]' # ) require 'rexml/document' module ActiveMerchant #:nodoc: module Billing #:nodoc: class PsigateGateway < Gateway TEST_URL = 'https://dev.psigate.com:7989/Messenger/XMLMessenger' LIVE_URL = 'https://secure.psigate.com:7934/Messenger/XMLMessenger' self.supported_cardtypes = [:visa, :master, :american_express] self.supported_countries = ['CA'] self.homepage_url = 'http://www.psigate.com/' self.display_name = 'Psigate' SUCCESS_MESSAGE = 'Success' FAILURE_MESSAGE = 'The transaction was declined' def initialize(options = {}) requires!(options, :login, :password) @options = options super end # Psigate PreAuth def authorize(money, creditcard, options = {}) requires!(options, :order_id) options.update({ :CardAction => "1" }) commit(money, creditcard, options) end # Psigate Sale def purchase(money, creditcard, options = {}) requires!(options, :order_id) options.update({ :CardAction => "0" }) commit(money, creditcard, options) end # Psigate PostAuth def capture(money, authorization, options = {}) options.update({ :CardAction => "2", :order_id => authorization }) commit(money, nil, options) end # Psigate Credit def credit(money, authorization, options = {}) options.update({ :CardAction => "3", :order_id => authorization }) commit(money, nil, options) end private def commit(money, creditcard, options = {}) response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, post_data(money, creditcard, options))) Response.new(successful?(response), message_from(response), response, :test => test?, :authorization => response[:orderid], :avs_result => { :code => response[:avsresult] }, :cvv_result => response[:cardidresult] ) end def successful?(response) response[:approved] == "APPROVED" end def parse(xml) response = {:message => "Global Error Receipt", :complete => false} xml = REXML::Document.new(xml) xml.elements.each('//Result/*') do |node| response[node.name.downcase.to_sym] = normalize(node.text) end unless xml.root.nil? response end def post_data(money, creditcard, options) xml = REXML::Document.new xml << REXML::XMLDecl.new root = xml.add_element("Order") for key, value in parameters(money, creditcard, options) root.add_element(key.to_s).text = value if value end xml.to_s end # Set up the parameters hash just once so we don't have to do it # for every action. def parameters(money, creditcard, options = {}) params = { # General order paramters :StoreID => @options[:login], :Passphrase => @options[:password], :TestResult => options[:test_result], :OrderID => options[:order_id], :UserID => options[:user_id], :Phone => options[:phone], :Fax => options[:fax], :Email => options[:email], # Credit Card paramaters :PaymentType => "CC", :CardAction => options[:CardAction], # Financial paramters :CustomerIP => options[:ip], :SubTotal => amount(money), :Tax1 => options[:tax1], :Tax2 => options[:tax2], :ShippingTotal => options[:shipping_total], } if creditcard exp_month = sprintf("%.2i", creditcard.month) unless creditcard.month.blank? exp_year = creditcard.year.to_s[2,2] unless creditcard.year.blank? card_id_code = creditcard.verification_value.blank? ? nil : "1" params.update( :CardNumber => creditcard.number, :CardExpMonth => exp_month, :CardExpYear => exp_year, :CardIDCode => card_id_code, :CardIDNumber => creditcard.verification_value ) end if address = options[:billing_address] || options[:address] params[:Bname] = address[:name] || creditcard.name params[:Baddress1] = address[:address1] unless address[:address1].blank? params[:Baddress2] = address[:address2] unless address[:address2].blank? params[:Bcity] = address[:city] unless address[:city].blank? params[:Bprovince] = address[:state] unless address[:state].blank? params[:Bpostalcode] = address[:zip] unless address[:zip].blank? params[:Bcountry] = address[:country] unless address[:country].blank? params[:Bcompany] = address[:company] unless address[:company].blank? end if address = options[:shipping_address] params[:Sname] = address[:name] || creditcard.name params[:Saddress1] = address[:address1] unless address[:address1].blank? params[:Saddress2] = address[:address2] unless address[:address2].blank? params[:Scity] = address[:city] unless address[:city].blank? params[:Sprovince] = address[:state] unless address[:state].blank? params[:Spostalcode] = address[:zip] unless address[:zip].blank? params[:Scountry] = address[:country] unless address[:country].blank? params[:Scompany] = address[:company] unless address[:company].blank? end return params end def message_from(response) if response[:approved] == "APPROVED" return SUCCESS_MESSAGE else return FAILURE_MESSAGE if response[:errmsg].blank? return response[:errmsg].gsub(/[^\w]/, ' ').split.join(" ").capitalize end end # Make a ruby type out of the response string def normalize(field) case field when "true" then true when "false" then false when "" then nil when "null" then nil else field end end end end end
{ "pile_set_name": "Github" }
import { AjaxObservable, AjaxCreationMethod } from './AjaxObservable'; /** * There is an ajax operator on the Rx object. * * It creates an observable for an Ajax request with either a request object with * url, headers, etc or a string for a URL. * * ## Using ajax.getJSON() to fetch data from API. * ```javascript * import { ajax } from 'rxjs/ajax'; * import { map, catchError } from 'rxjs/operators'; * * const obs$ = ajax.getJSON(`https://api.github.com/users?per_page=5`).pipe( * map(userResponse => console.log('users: ', userResponse)), * catchError(error => console.log('error: ', error)) * )); * ``` */ export const ajax: AjaxCreationMethod = AjaxObservable.create;
{ "pile_set_name": "Github" }
package info.xiancloud.rpcnettyserver; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import info.xiancloud.core.util.LOG; import info.xiancloud.core.util.StringUtil; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; /** * 我们rpc传输的数据都是json格式的,这里定义个通用的json解析器,避免二次解析消息带来的性能损耗 * * @author happyyangyuan */ public class RpcServerJsonDecoder extends SimpleChannelInboundHandler<String> { @Override protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception { if (StringUtil.isEmpty(msg)) { LOG.error("Empty message is not allowed."); } else { //为了通信协议的灵活性,我们在这里并没有解码为强类型的bean,而是解码为弱类型json JSONObject jsonObject = JSON.parseObject(msg); ctx.fireChannelRead(jsonObject); } } }
{ "pile_set_name": "Github" }
/****************************************************************************** * * Module Name: aecommon - common include for the AcpiExec utility * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * *****************************************************************************/ #ifndef _AECOMMON #define _AECOMMON #ifdef _MSC_VER /* disable some level-4 warnings */ #pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */ #endif #include "acpi.h" #include "accommon.h" #include "acparser.h" #include "amlcode.h" #include "acnamesp.h" #include "acdebug.h" #include "actables.h" #include "acinterp.h" #include "acapps.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <signal.h> extern FILE *AcpiGbl_DebugFile; extern BOOLEAN AcpiGbl_IgnoreErrors; extern UINT8 AcpiGbl_RegionFillValue; extern UINT8 AcpiGbl_UseHwReducedFadt; extern BOOLEAN AcpiGbl_DisplayRegionAccess; /* Check for unexpected exceptions */ #define AE_CHECK_STATUS(Name, Status, Expected) \ if (Status != Expected) \ { \ AcpiOsPrintf ("Unexpected %s from %s (%s-%d)\n", \ AcpiFormatException (Status), #Name, _AcpiModuleName, __LINE__); \ } /* Check for unexpected non-AE_OK errors */ #define AE_CHECK_OK(Name, Status) AE_CHECK_STATUS (Name, Status, AE_OK); typedef struct ae_table_desc { ACPI_TABLE_HEADER *Table; struct ae_table_desc *Next; } AE_TABLE_DESC; /* * Debug Regions */ typedef struct ae_region { ACPI_PHYSICAL_ADDRESS Address; UINT32 Length; void *Buffer; void *NextRegion; UINT8 SpaceId; } AE_REGION; typedef struct ae_debug_regions { UINT32 NumberOfRegions; AE_REGION *RegionList; } AE_DEBUG_REGIONS; #define TEST_OUTPUT_LEVEL(lvl) if ((lvl) & OutputLevel) #define OSD_PRINT(lvl,fp) TEST_OUTPUT_LEVEL(lvl) {\ AcpiOsPrintf PARAM_LIST(fp);} void ACPI_SYSTEM_XFACE AeCtrlCHandler ( int Sig); ACPI_STATUS AeBuildLocalTables ( UINT32 TableCount, AE_TABLE_DESC *TableList); ACPI_STATUS AeInstallTables ( void); void AeDumpNamespace ( void); void AeDumpObject ( char *MethodName, ACPI_BUFFER *ReturnObj); void AeDumpBuffer ( UINT32 Address); void AeExecute ( char *Name); void AeSetScope ( char *Name); void AeCloseDebugFile ( void); void AeOpenDebugFile ( char *Name); ACPI_STATUS AeDisplayAllMethods ( UINT32 DisplayCount); ACPI_STATUS AeInstallEarlyHandlers ( void); ACPI_STATUS AeInstallLateHandlers ( void); void AeMiscellaneousTests ( void); ACPI_STATUS AeRegionHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext); UINT32 AeGpeHandler ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, void *Context); void AeGlobalEventHandler ( UINT32 Type, ACPI_HANDLE GpeDevice, UINT32 EventNumber, void *Context); #endif /* _AECOMMON */
{ "pile_set_name": "Github" }
package dns // Holds a bunch of helper functions for dealing with labels. // SplitDomainName splits a name string into it's labels. // www.miek.nl. returns []string{"www", "miek", "nl"} // .www.miek.nl. returns []string{"", "www", "miek", "nl"}, // The root label (.) returns nil. Note that using // strings.Split(s) will work in most cases, but does not handle // escaped dots (\.) for instance. // s must be a syntactically valid domain name, see IsDomainName. func SplitDomainName(s string) (labels []string) { if len(s) == 0 { return nil } fqdnEnd := 0 // offset of the final '.' or the length of the name idx := Split(s) begin := 0 if IsFqdn(s) { fqdnEnd = len(s) - 1 } else { fqdnEnd = len(s) } switch len(idx) { case 0: return nil case 1: // no-op default: for _, end := range idx[1:] { labels = append(labels, s[begin:end-1]) begin = end } } return append(labels, s[begin:fqdnEnd]) } // CompareDomainName compares the names s1 and s2 and // returns how many labels they have in common starting from the *right*. // The comparison stops at the first inequality. The names are downcased // before the comparison. // // www.miek.nl. and miek.nl. have two labels in common: miek and nl // www.miek.nl. and www.bla.nl. have one label in common: nl // // s1 and s2 must be syntactically valid domain names. func CompareDomainName(s1, s2 string) (n int) { // the first check: root label if s1 == "." || s2 == "." { return 0 } l1 := Split(s1) l2 := Split(s2) j1 := len(l1) - 1 // end i1 := len(l1) - 2 // start j2 := len(l2) - 1 i2 := len(l2) - 2 // the second check can be done here: last/only label // before we fall through into the for-loop below if equal(s1[l1[j1]:], s2[l2[j2]:]) { n++ } else { return } for { if i1 < 0 || i2 < 0 { break } if equal(s1[l1[i1]:l1[j1]], s2[l2[i2]:l2[j2]]) { n++ } else { break } j1-- i1-- j2-- i2-- } return } // CountLabel counts the number of labels in the string s. // s must be a syntactically valid domain name. func CountLabel(s string) (labels int) { if s == "." { return } off := 0 end := false for { off, end = NextLabel(s, off) labels++ if end { return } } } // Split splits a name s into its label indexes. // www.miek.nl. returns []int{0, 4, 9}, www.miek.nl also returns []int{0, 4, 9}. // The root name (.) returns nil. Also see SplitDomainName. // s must be a syntactically valid domain name. func Split(s string) []int { if s == "." { return nil } idx := make([]int, 1, 3) off := 0 end := false for { off, end = NextLabel(s, off) if end { return idx } idx = append(idx, off) } } // NextLabel returns the index of the start of the next label in the // string s starting at offset. // The bool end is true when the end of the string has been reached. // Also see PrevLabel. func NextLabel(s string, offset int) (i int, end bool) { if s == "" { return 0, true } for i = offset; i < len(s)-1; i++ { if s[i] != '.' { continue } j := i - 1 for j >= 0 && s[j] == '\\' { j-- } if (j-i)%2 == 0 { continue } return i + 1, false } return i + 1, true } // PrevLabel returns the index of the label when starting from the right and // jumping n labels to the left. // The bool start is true when the start of the string has been overshot. // Also see NextLabel. func PrevLabel(s string, n int) (i int, start bool) { if s == "" { return 0, true } if n == 0 { return len(s), false } l := len(s) - 1 if s[l] == '.' { l-- } for ; l >= 0 && n > 0; l-- { if s[l] != '.' { continue } j := l - 1 for j >= 0 && s[j] == '\\' { j-- } if (j-l)%2 == 0 { continue } n-- if n == 0 { return l + 1, false } } return 0, n > 1 } // equal compares a and b while ignoring case. It returns true when equal otherwise false. func equal(a, b string) bool { // might be lifted into API function. la := len(a) lb := len(b) if la != lb { return false } for i := la - 1; i >= 0; i-- { ai := a[i] bi := b[i] if ai >= 'A' && ai <= 'Z' { ai |= 'a' - 'A' } if bi >= 'A' && bi <= 'Z' { bi |= 'a' - 'A' } if ai != bi { return false } } return true }
{ "pile_set_name": "Github" }
/* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" ) // Invoke sends the RPC request on the wire and returns after response is // received. This is typically called by generated code. // // All errors returned by Invoke are compatible with the status package. func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...CallOption) error { // allow interceptor to see all applicable call options, which means those // configured as defaults from dial option as well as per-call options opts = combine(cc.dopts.callOptions, opts) if cc.dopts.unaryInt != nil { return cc.dopts.unaryInt(ctx, method, args, reply, cc, invoke, opts...) } return invoke(ctx, method, args, reply, cc, opts...) } func combine(o1 []CallOption, o2 []CallOption) []CallOption { // we don't use append because o1 could have extra capacity whose // elements would be overwritten, which could cause inadvertent // sharing (and race conditions) between concurrent calls if len(o1) == 0 { return o2 } else if len(o2) == 0 { return o1 } ret := make([]CallOption, len(o1)+len(o2)) copy(ret, o1) copy(ret[len(o1):], o2) return ret } // Invoke sends the RPC request on the wire and returns after response is // received. This is typically called by generated code. // // DEPRECATED: Use ClientConn.Invoke instead. func Invoke(ctx context.Context, method string, args, reply interface{}, cc *ClientConn, opts ...CallOption) error { return cc.Invoke(ctx, method, args, reply, opts...) } var unaryStreamDesc = &StreamDesc{ServerStreams: false, ClientStreams: false} func invoke(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, opts ...CallOption) error { cs, err := newClientStream(ctx, unaryStreamDesc, cc, method, opts...) if err != nil { return err } if err := cs.SendMsg(req); err != nil { return err } return cs.RecvMsg(reply) }
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -triple=x86_64-linux-gnu using size_t = decltype(sizeof(int)); namespace std { struct string {}; } template<typename T, typename U> struct same_type; template<typename T> struct same_type<T, T> {}; namespace std_example { long double operator "" _w(long double); std::string operator "" _w(const char16_t*, size_t); unsigned operator "" _w(const char*); int main() { auto v1 = 1.2_w; // calls operator""_w(1.2L) auto v2 = u"one"_w; // calls operator""_w(u"one", 3) auto v3 = 12_w; // calls operator""_w("12") "two"_w; // expected-error {{no matching literal operator for call to 'operator""_w' with arguments of types 'const char *' and 'unsigned long'}} same_type<decltype(v1), long double> test1; same_type<decltype(v2), std::string> test2; same_type<decltype(v3), unsigned> test3; } }
{ "pile_set_name": "Github" }
/* * Copyright 2020 The Bazel Authors. 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 com.google.devtools.build.android.desugar.typehierarchy.testlib.pkgx; import com.google.devtools.build.android.desugar.typehierarchy.testlib.pkgy.PieCY; /** * @see {@link com.google.devtools.build.android.desugar.typehierarchy.TypeHierarchyTest} for type * inheritance structure and dynamic-dispatchable method relationships. */ abstract class PieCX extends PieCY { abstract long withTwoOperands(long x, long y); }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!-- Description: RSS1 feed w/ item dc:description Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.plainText() == 'XML is...' --> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc='http://purl.org/dc/elements/1.1/'> <channel rdf:about="http://www.xml.com/xml/news.rss"> <title>Test</title> <link>http://xml.com/pub</link> <dc:description>another description</dc:description> </channel> <item> <dc:description>XML is...</dc:description> <title>XML: A Disruptive Technology</title> <link>http://c.moreover.com/click/here.pl?r123</link> <description> XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet. </description> <!-- <dc:creator>Simon St.Laurent (mailto:[email protected])</dc:creator> <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights> <dc:subject>XML</dc:subject>--> </item> <item> <dc:publisher>The O'Reilly Network</dc:publisher> <dc:description> XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet 2. </dc:description> <title>XML: A Disruptive Technology</title> </item> </rdf:RDF>
{ "pile_set_name": "Github" }
#region LICENSE // The contents of this file are subject to the Common Public Attribution // License Version 1.0. (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // https://github.com/NiclasOlofsson/MiNET/blob/master/LICENSE. // The License is based on the Mozilla Public License Version 1.1, but Sections 14 // and 15 have been added to cover use of software over a computer network and // provide for limited attribution for the Original Developer. In addition, Exhibit A has // been modified to be consistent with Exhibit B. // // Software distributed under the License is distributed on an "AS IS" basis, // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for // the specific language governing rights and limitations under the License. // // The Original Code is MiNET. // // The Original Developer is the Initial Developer. The Initial Developer of // the Original Code is Niclas Olofsson. // // All portions of the code written by Niclas Olofsson are Copyright (c) 2014-2018 Niclas Olofsson. // All Rights Reserved. #endregion namespace MiNET.Worlds { public enum GameMode { /// <summary> /// Players fight against the enviornment, mobs, and players /// with limited resources. /// </summary> Survival = 0, S = 0, /// <summary> /// Players are given unlimited resources, flying, and /// invulnerability. /// </summary> Creative = 1, C = 1, /// <summary> /// Similar to survival, with the exception that players may /// not place or remove blocks. /// </summary> Adventure = 2, /// <summary> /// Similar to creative, with the exception that players may /// not place or remove blocks. /// </summary> Spectator = 3 } }
{ "pile_set_name": "Github" }
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build ppc64,linux package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 PathMax = 0x1000 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 _ [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 _ [4]byte Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 _ [4]byte Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Dev uint64 Ino uint64 Nlink uint64 Mode uint32 Uid uint32 Gid uint32 _ int32 Rdev uint64 Size int64 Blksize int64 Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec _ uint64 _ uint64 _ uint64 } type StatxTimestamp struct { Sec int64 Nsec uint32 _ int32 } type Statx_t struct { Mask uint32 Blksize uint32 Attributes uint64 Nlink uint32 Uid uint32 Gid uint32 Mode uint16 _ [1]uint16 Ino uint64 Size uint64 Blocks uint64 Attributes_mask uint64 Atime StatxTimestamp Btime StatxTimestamp Ctime StatxTimestamp Mtime StatxTimestamp Rdev_major uint32 Rdev_minor uint32 Dev_major uint32 Dev_minor uint32 _ [14]uint64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]uint8 _ [5]byte } type Fsid struct { Val [2]int32 } type Flock_t struct { Type int16 Whence int16 _ [4]byte Start int64 Len int64 Pid int32 _ [4]byte } type FscryptPolicy struct { Version uint8 Contents_encryption_mode uint8 Filenames_encryption_mode uint8 Flags uint8 Master_key_descriptor [8]uint8 } type FscryptKey struct { Mode uint32 Raw [64]uint8 Size uint32 } type KeyctlDHParams struct { Private int32 Prime int32 Base int32 } const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrInet4 struct { Family uint16 Port uint16 Addr [4]byte /* in_addr */ Zero [8]uint8 } type RawSockaddrInet6 struct { Family uint16 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Family uint16 Path [108]int8 } type RawSockaddrLinklayer struct { Family uint16 Protocol uint16 Ifindex int32 Hatype uint16 Pkttype uint8 Halen uint8 Addr [8]uint8 } type RawSockaddrNetlink struct { Family uint16 Pad uint16 Pid uint32 Groups uint32 } type RawSockaddrHCI struct { Family uint16 Dev uint16 Channel uint16 } type RawSockaddrL2 struct { Family uint16 Psm uint16 Bdaddr [6]uint8 Cid uint16 Bdaddr_type uint8 _ [1]byte } type RawSockaddrRFCOMM struct { Family uint16 Bdaddr [6]uint8 Channel uint8 _ [1]byte } type RawSockaddrCAN struct { Family uint16 _ [2]byte Ifindex int32 Addr [8]byte } type RawSockaddrALG struct { Family uint16 Type [14]uint8 Feat uint32 Mask uint32 Name [64]uint8 } type RawSockaddrVM struct { Family uint16 Reserved1 uint16 Port uint32 Cid uint32 Zero [4]uint8 } type RawSockaddrXDP struct { Family uint16 Flags uint16 Ifindex uint32 Queue_id uint32 Shared_umem_fd uint32 } type RawSockaddrPPPoX [0x1e]byte type RawSockaddr struct { Family uint16 Data [14]uint8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]uint8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4]byte /* in_addr */ Ifindex int32 } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type PacketMreq struct { Ifindex int32 Type uint16 Alen uint16 Address [8]uint8 } type Msghdr struct { Name *byte Namelen uint32 _ [4]byte Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type Inet4Pktinfo struct { Ifindex int32 Spec_dst [4]byte /* in_addr */ Addr [4]byte /* in_addr */ } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Data [8]uint32 } type Ucred struct { Pid int32 Uid uint32 Gid uint32 } type TCPInfo struct { State uint8 Ca_state uint8 Retransmits uint8 Probes uint8 Backoff uint8 Options uint8 _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 Rcv_mss uint32 Unacked uint32 Sacked uint32 Lost uint32 Retrans uint32 Fackets uint32 Last_data_sent uint32 Last_ack_sent uint32 Last_data_recv uint32 Last_ack_recv uint32 Pmtu uint32 Rcv_ssthresh uint32 Rtt uint32 Rttvar uint32 Snd_ssthresh uint32 Snd_cwnd uint32 Advmss uint32 Reordering uint32 Rcv_rtt uint32 Rcv_space uint32 Total_retrans uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x70 SizeofSockaddrUnix = 0x6e SizeofSockaddrLinklayer = 0x14 SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 SizeofSockaddrXDP = 0x10 SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofPacketMreq = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 SizeofInet4Pktinfo = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 ) const ( IFA_UNSPEC = 0x0 IFA_ADDRESS = 0x1 IFA_LOCAL = 0x2 IFA_LABEL = 0x3 IFA_BROADCAST = 0x4 IFA_ANYCAST = 0x5 IFA_CACHEINFO = 0x6 IFA_MULTICAST = 0x7 IFLA_UNSPEC = 0x0 IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 IFLA_STATS = 0x7 IFLA_COST = 0x8 IFLA_PRIORITY = 0x9 IFLA_MASTER = 0xa IFLA_WIRELESS = 0xb IFLA_PROTINFO = 0xc IFLA_TXQLEN = 0xd IFLA_MAP = 0xe IFLA_WEIGHT = 0xf IFLA_OPERSTATE = 0x10 IFLA_LINKMODE = 0x11 IFLA_LINKINFO = 0x12 IFLA_NET_NS_PID = 0x13 IFLA_IFALIAS = 0x14 IFLA_NUM_VF = 0x15 IFLA_VFINFO_LIST = 0x16 IFLA_STATS64 = 0x17 IFLA_VF_PORTS = 0x18 IFLA_PORT_SELF = 0x19 IFLA_AF_SPEC = 0x1a IFLA_GROUP = 0x1b IFLA_NET_NS_FD = 0x1c IFLA_EXT_MASK = 0x1d IFLA_PROMISCUITY = 0x1e IFLA_NUM_TX_QUEUES = 0x1f IFLA_NUM_RX_QUEUES = 0x20 IFLA_CARRIER = 0x21 IFLA_PHYS_PORT_ID = 0x22 IFLA_CARRIER_CHANGES = 0x23 IFLA_PHYS_SWITCH_ID = 0x24 IFLA_LINK_NETNSID = 0x25 IFLA_PHYS_PORT_NAME = 0x26 IFLA_PROTO_DOWN = 0x27 IFLA_GSO_MAX_SEGS = 0x28 IFLA_GSO_MAX_SIZE = 0x29 IFLA_PAD = 0x2a IFLA_XDP = 0x2b IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd RT_SCOPE_HOST = 0xfe RT_SCOPE_NOWHERE = 0xff RT_TABLE_UNSPEC = 0x0 RT_TABLE_COMPAT = 0xfc RT_TABLE_DEFAULT = 0xfd RT_TABLE_MAIN = 0xfe RT_TABLE_LOCAL = 0xff RT_TABLE_MAX = 0xffffffff RTA_UNSPEC = 0x0 RTA_DST = 0x1 RTA_SRC = 0x2 RTA_IIF = 0x3 RTA_OIF = 0x4 RTA_GATEWAY = 0x5 RTA_PRIORITY = 0x6 RTA_PREFSRC = 0x7 RTA_METRICS = 0x8 RTA_MULTIPATH = 0x9 RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf RTA_MARK = 0x10 RTA_MFC_STATS = 0x11 RTA_VIA = 0x12 RTA_NEWDST = 0x13 RTA_PREF = 0x14 RTA_ENCAP_TYPE = 0x15 RTA_ENCAP = 0x16 RTA_EXPIRES = 0x17 RTA_PAD = 0x18 RTA_UID = 0x19 RTA_TTL_PROPAGATE = 0x1a RTA_IP_PROTO = 0x1b RTA_SPORT = 0x1c RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 RTN_BROADCAST = 0x3 RTN_ANYCAST = 0x4 RTN_MULTICAST = 0x5 RTN_BLACKHOLE = 0x6 RTN_UNREACHABLE = 0x7 RTN_PROHIBIT = 0x8 RTN_THROW = 0x9 RTN_NAT = 0xa RTN_XRESOLVE = 0xb RTNLGRP_NONE = 0x0 RTNLGRP_LINK = 0x1 RTNLGRP_NOTIFY = 0x2 RTNLGRP_NEIGH = 0x3 RTNLGRP_TC = 0x4 RTNLGRP_IPV4_IFADDR = 0x5 RTNLGRP_IPV4_MROUTE = 0x6 RTNLGRP_IPV4_ROUTE = 0x7 RTNLGRP_IPV4_RULE = 0x8 RTNLGRP_IPV6_IFADDR = 0x9 RTNLGRP_IPV6_MROUTE = 0xa RTNLGRP_IPV6_ROUTE = 0xb RTNLGRP_IPV6_IFINFO = 0xc RTNLGRP_IPV6_PREFIX = 0x12 RTNLGRP_IPV6_RULE = 0x13 RTNLGRP_ND_USEROPT = 0x14 SizeofNlMsghdr = 0x10 SizeofNlMsgerr = 0x14 SizeofRtGenmsg = 0x1 SizeofNlAttr = 0x4 SizeofRtAttr = 0x4 SizeofIfInfomsg = 0x10 SizeofIfAddrmsg = 0x8 SizeofRtMsg = 0xc SizeofRtNexthop = 0x8 ) type NlMsghdr struct { Len uint32 Type uint16 Flags uint16 Seq uint32 Pid uint32 } type NlMsgerr struct { Error int32 Msg NlMsghdr } type RtGenmsg struct { Family uint8 } type NlAttr struct { Len uint16 Type uint16 } type RtAttr struct { Len uint16 Type uint16 } type IfInfomsg struct { Family uint8 _ uint8 Type uint16 Index int32 Flags uint32 Change uint32 } type IfAddrmsg struct { Family uint8 Prefixlen uint8 Flags uint8 Scope uint8 Index uint32 } type RtMsg struct { Family uint8 Dst_len uint8 Src_len uint8 Tos uint8 Table uint8 Protocol uint8 Scope uint8 Type uint8 Flags uint32 } type RtNexthop struct { Len uint16 Flags uint8 Hops uint8 Ifindex int32 } const ( SizeofSockFilter = 0x8 SizeofSockFprog = 0x10 ) type SockFilter struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type SockFprog struct { Len uint16 _ [6]byte Filter *SockFilter } type InotifyEvent struct { Wd int32 Mask uint32 Cookie uint32 Len uint32 } const SizeofInotifyEvent = 0x10 type PtraceRegs struct { Gpr [32]uint64 Nip uint64 Msr uint64 Orig_gpr3 uint64 Ctr uint64 Link uint64 Xer uint64 Ccr uint64 Softe uint64 Trap uint64 Dar uint64 Dsisr uint64 Result uint64 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 _ [4]byte Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]uint8 _ [4]byte } type Utsname struct { Sysname [65]byte Nodename [65]byte Release [65]byte Version [65]byte Machine [65]byte Domainname [65]byte } type Ustat_t struct { Tfree int32 _ [4]byte Tinode uint64 Fname [6]uint8 Fpack [6]uint8 _ [4]byte } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } const ( AT_EMPTY_PATH = 0x1000 AT_FDCWD = -0x64 AT_NO_AUTOMOUNT = 0x800 AT_REMOVEDIR = 0x200 AT_STATX_SYNC_AS_STAT = 0x0 AT_STATX_FORCE_SYNC = 0x2000 AT_STATX_DONT_SYNC = 0x4000 AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x100 AT_EACCESS = 0x200 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLIN = 0x1 POLLPRI = 0x2 POLLOUT = 0x4 POLLRDHUP = 0x2000 POLLERR = 0x8 POLLHUP = 0x10 POLLNVAL = 0x20 ) type Sigset_t struct { Val [16]uint64 } const RNDGETENTCNT = 0x40045200 const PERF_IOC_FLAG_GROUP = 0x1 type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [19]uint8 Line uint8 Ispeed uint32 Ospeed uint32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } type Taskstats struct { Version uint16 _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 } const ( TASKSTATS_CMD_UNSPEC = 0x0 TASKSTATS_CMD_GET = 0x1 TASKSTATS_CMD_NEW = 0x2 TASKSTATS_TYPE_UNSPEC = 0x0 TASKSTATS_TYPE_PID = 0x1 TASKSTATS_TYPE_TGID = 0x2 TASKSTATS_TYPE_STATS = 0x3 TASKSTATS_TYPE_AGGR_PID = 0x4 TASKSTATS_TYPE_AGGR_TGID = 0x5 TASKSTATS_TYPE_NULL = 0x6 TASKSTATS_CMD_ATTR_UNSPEC = 0x0 TASKSTATS_CMD_ATTR_PID = 0x1 TASKSTATS_CMD_ATTR_TGID = 0x2 TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 ) type CGroupStats struct { Sleeping uint64 Running uint64 Stopped uint64 Uninterruptible uint64 Io_wait uint64 } const ( CGROUPSTATS_CMD_UNSPEC = 0x3 CGROUPSTATS_CMD_GET = 0x4 CGROUPSTATS_CMD_NEW = 0x5 CGROUPSTATS_TYPE_UNSPEC = 0x0 CGROUPSTATS_TYPE_CGROUP_STATS = 0x1 CGROUPSTATS_CMD_ATTR_UNSPEC = 0x0 CGROUPSTATS_CMD_ATTR_FD = 0x1 ) type Genlmsghdr struct { Cmd uint8 Version uint8 Reserved uint16 } const ( CTRL_CMD_UNSPEC = 0x0 CTRL_CMD_NEWFAMILY = 0x1 CTRL_CMD_DELFAMILY = 0x2 CTRL_CMD_GETFAMILY = 0x3 CTRL_CMD_NEWOPS = 0x4 CTRL_CMD_DELOPS = 0x5 CTRL_CMD_GETOPS = 0x6 CTRL_CMD_NEWMCAST_GRP = 0x7 CTRL_CMD_DELMCAST_GRP = 0x8 CTRL_CMD_GETMCAST_GRP = 0x9 CTRL_ATTR_UNSPEC = 0x0 CTRL_ATTR_FAMILY_ID = 0x1 CTRL_ATTR_FAMILY_NAME = 0x2 CTRL_ATTR_VERSION = 0x3 CTRL_ATTR_HDRSIZE = 0x4 CTRL_ATTR_MAXATTR = 0x5 CTRL_ATTR_OPS = 0x6 CTRL_ATTR_MCAST_GROUPS = 0x7 CTRL_ATTR_OP_UNSPEC = 0x0 CTRL_ATTR_OP_ID = 0x1 CTRL_ATTR_OP_FLAGS = 0x2 CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 CTRL_ATTR_MCAST_GRP_NAME = 0x1 CTRL_ATTR_MCAST_GRP_ID = 0x2 ) type cpuMask uint64 const ( _CPU_SETSIZE = 0x400 _NCPUBITS = 0x40 ) const ( BDADDR_BREDR = 0x0 BDADDR_LE_PUBLIC = 0x1 BDADDR_LE_RANDOM = 0x2 ) type PerfEventAttr struct { Type uint32 Size uint32 Config uint64 Sample uint64 Sample_type uint64 Read_format uint64 Bits uint64 Wakeup uint32 Bp_type uint32 Ext1 uint64 Ext2 uint64 Branch_sample_type uint64 Sample_regs_user uint64 Sample_stack_user uint32 Clockid int32 Sample_regs_intr uint64 Aux_watermark uint32 _ uint32 } type PerfEventMmapPage struct { Version uint32 Compat_version uint32 Lock uint32 Index uint32 Offset int64 Time_enabled uint64 Time_running uint64 Capabilities uint64 Pmc_width uint16 Time_shift uint16 Time_mult uint32 Time_offset uint64 Time_zero uint64 Size uint32 _ [948]uint8 Data_head uint64 Data_tail uint64 Data_offset uint64 Data_size uint64 Aux_head uint64 Aux_tail uint64 Aux_offset uint64 Aux_size uint64 } const ( PerfBitDisabled uint64 = CBitFieldMaskBit0 PerfBitInherit = CBitFieldMaskBit1 PerfBitPinned = CBitFieldMaskBit2 PerfBitExclusive = CBitFieldMaskBit3 PerfBitExcludeUser = CBitFieldMaskBit4 PerfBitExcludeKernel = CBitFieldMaskBit5 PerfBitExcludeHv = CBitFieldMaskBit6 PerfBitExcludeIdle = CBitFieldMaskBit7 PerfBitMmap = CBitFieldMaskBit8 PerfBitComm = CBitFieldMaskBit9 PerfBitFreq = CBitFieldMaskBit10 PerfBitInheritStat = CBitFieldMaskBit11 PerfBitEnableOnExec = CBitFieldMaskBit12 PerfBitTask = CBitFieldMaskBit13 PerfBitWatermark = CBitFieldMaskBit14 PerfBitPreciseIPBit1 = CBitFieldMaskBit15 PerfBitPreciseIPBit2 = CBitFieldMaskBit16 PerfBitMmapData = CBitFieldMaskBit17 PerfBitSampleIDAll = CBitFieldMaskBit18 PerfBitExcludeHost = CBitFieldMaskBit19 PerfBitExcludeGuest = CBitFieldMaskBit20 PerfBitExcludeCallchainKernel = CBitFieldMaskBit21 PerfBitExcludeCallchainUser = CBitFieldMaskBit22 PerfBitMmap2 = CBitFieldMaskBit23 PerfBitCommExec = CBitFieldMaskBit24 PerfBitUseClockID = CBitFieldMaskBit25 PerfBitContextSwitch = CBitFieldMaskBit26 ) const ( PERF_TYPE_HARDWARE = 0x0 PERF_TYPE_SOFTWARE = 0x1 PERF_TYPE_TRACEPOINT = 0x2 PERF_TYPE_HW_CACHE = 0x3 PERF_TYPE_RAW = 0x4 PERF_TYPE_BREAKPOINT = 0x5 PERF_COUNT_HW_CPU_CYCLES = 0x0 PERF_COUNT_HW_INSTRUCTIONS = 0x1 PERF_COUNT_HW_CACHE_REFERENCES = 0x2 PERF_COUNT_HW_CACHE_MISSES = 0x3 PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4 PERF_COUNT_HW_BRANCH_MISSES = 0x5 PERF_COUNT_HW_BUS_CYCLES = 0x6 PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7 PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8 PERF_COUNT_HW_REF_CPU_CYCLES = 0x9 PERF_COUNT_HW_CACHE_L1D = 0x0 PERF_COUNT_HW_CACHE_L1I = 0x1 PERF_COUNT_HW_CACHE_LL = 0x2 PERF_COUNT_HW_CACHE_DTLB = 0x3 PERF_COUNT_HW_CACHE_ITLB = 0x4 PERF_COUNT_HW_CACHE_BPU = 0x5 PERF_COUNT_HW_CACHE_NODE = 0x6 PERF_COUNT_HW_CACHE_OP_READ = 0x0 PERF_COUNT_HW_CACHE_OP_WRITE = 0x1 PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2 PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0 PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1 PERF_COUNT_SW_CPU_CLOCK = 0x0 PERF_COUNT_SW_TASK_CLOCK = 0x1 PERF_COUNT_SW_PAGE_FAULTS = 0x2 PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3 PERF_COUNT_SW_CPU_MIGRATIONS = 0x4 PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6 PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7 PERF_COUNT_SW_EMULATION_FAULTS = 0x8 PERF_COUNT_SW_DUMMY = 0x9 PERF_SAMPLE_IP = 0x1 PERF_SAMPLE_TID = 0x2 PERF_SAMPLE_TIME = 0x4 PERF_SAMPLE_ADDR = 0x8 PERF_SAMPLE_READ = 0x10 PERF_SAMPLE_CALLCHAIN = 0x20 PERF_SAMPLE_ID = 0x40 PERF_SAMPLE_CPU = 0x80 PERF_SAMPLE_PERIOD = 0x100 PERF_SAMPLE_STREAM_ID = 0x200 PERF_SAMPLE_RAW = 0x400 PERF_SAMPLE_BRANCH_STACK = 0x800 PERF_SAMPLE_BRANCH_USER = 0x1 PERF_SAMPLE_BRANCH_KERNEL = 0x2 PERF_SAMPLE_BRANCH_HV = 0x4 PERF_SAMPLE_BRANCH_ANY = 0x8 PERF_SAMPLE_BRANCH_ANY_CALL = 0x10 PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20 PERF_SAMPLE_BRANCH_IND_CALL = 0x40 PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1 PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2 PERF_FORMAT_ID = 0x4 PERF_FORMAT_GROUP = 0x8 PERF_RECORD_MMAP = 0x1 PERF_RECORD_LOST = 0x2 PERF_RECORD_COMM = 0x3 PERF_RECORD_EXIT = 0x4 PERF_RECORD_THROTTLE = 0x5 PERF_RECORD_UNTHROTTLE = 0x6 PERF_RECORD_FORK = 0x7 PERF_RECORD_READ = 0x8 PERF_RECORD_SAMPLE = 0x9 PERF_CONTEXT_HV = -0x20 PERF_CONTEXT_KERNEL = -0x80 PERF_CONTEXT_USER = -0x200 PERF_CONTEXT_GUEST = -0x800 PERF_CONTEXT_GUEST_KERNEL = -0x880 PERF_CONTEXT_GUEST_USER = -0xa00 PERF_FLAG_FD_NO_GROUP = 0x1 PERF_FLAG_FD_OUTPUT = 0x2 PERF_FLAG_PID_CGROUP = 0x4 ) const ( CBitFieldMaskBit0 = 0x8000000000000000 CBitFieldMaskBit1 = 0x4000000000000000 CBitFieldMaskBit2 = 0x2000000000000000 CBitFieldMaskBit3 = 0x1000000000000000 CBitFieldMaskBit4 = 0x800000000000000 CBitFieldMaskBit5 = 0x400000000000000 CBitFieldMaskBit6 = 0x200000000000000 CBitFieldMaskBit7 = 0x100000000000000 CBitFieldMaskBit8 = 0x80000000000000 CBitFieldMaskBit9 = 0x40000000000000 CBitFieldMaskBit10 = 0x20000000000000 CBitFieldMaskBit11 = 0x10000000000000 CBitFieldMaskBit12 = 0x8000000000000 CBitFieldMaskBit13 = 0x4000000000000 CBitFieldMaskBit14 = 0x2000000000000 CBitFieldMaskBit15 = 0x1000000000000 CBitFieldMaskBit16 = 0x800000000000 CBitFieldMaskBit17 = 0x400000000000 CBitFieldMaskBit18 = 0x200000000000 CBitFieldMaskBit19 = 0x100000000000 CBitFieldMaskBit20 = 0x80000000000 CBitFieldMaskBit21 = 0x40000000000 CBitFieldMaskBit22 = 0x20000000000 CBitFieldMaskBit23 = 0x10000000000 CBitFieldMaskBit24 = 0x8000000000 CBitFieldMaskBit25 = 0x4000000000 CBitFieldMaskBit26 = 0x2000000000 CBitFieldMaskBit27 = 0x1000000000 CBitFieldMaskBit28 = 0x800000000 CBitFieldMaskBit29 = 0x400000000 CBitFieldMaskBit30 = 0x200000000 CBitFieldMaskBit31 = 0x100000000 CBitFieldMaskBit32 = 0x80000000 CBitFieldMaskBit33 = 0x40000000 CBitFieldMaskBit34 = 0x20000000 CBitFieldMaskBit35 = 0x10000000 CBitFieldMaskBit36 = 0x8000000 CBitFieldMaskBit37 = 0x4000000 CBitFieldMaskBit38 = 0x2000000 CBitFieldMaskBit39 = 0x1000000 CBitFieldMaskBit40 = 0x800000 CBitFieldMaskBit41 = 0x400000 CBitFieldMaskBit42 = 0x200000 CBitFieldMaskBit43 = 0x100000 CBitFieldMaskBit44 = 0x80000 CBitFieldMaskBit45 = 0x40000 CBitFieldMaskBit46 = 0x20000 CBitFieldMaskBit47 = 0x10000 CBitFieldMaskBit48 = 0x8000 CBitFieldMaskBit49 = 0x4000 CBitFieldMaskBit50 = 0x2000 CBitFieldMaskBit51 = 0x1000 CBitFieldMaskBit52 = 0x800 CBitFieldMaskBit53 = 0x400 CBitFieldMaskBit54 = 0x200 CBitFieldMaskBit55 = 0x100 CBitFieldMaskBit56 = 0x80 CBitFieldMaskBit57 = 0x40 CBitFieldMaskBit58 = 0x20 CBitFieldMaskBit59 = 0x10 CBitFieldMaskBit60 = 0x8 CBitFieldMaskBit61 = 0x4 CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit63 = 0x1 ) type SockaddrStorage struct { Family uint16 _ [118]uint8 _ uint64 } type TCPMD5Sig struct { Addr SockaddrStorage Flags uint8 Prefixlen uint8 Keylen uint16 _ uint32 Key [80]uint8 } type HDDriveCmdHdr struct { Command uint8 Number uint8 Feature uint8 Count uint8 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 _ [4]byte Start uint64 } type HDDriveID struct { Config uint16 Cyls uint16 Reserved2 uint16 Heads uint16 Track_bytes uint16 Sector_bytes uint16 Sectors uint16 Vendor0 uint16 Vendor1 uint16 Vendor2 uint16 Serial_no [20]uint8 Buf_type uint16 Buf_size uint16 Ecc_bytes uint16 Fw_rev [8]uint8 Model [40]uint8 Max_multsect uint8 Vendor3 uint8 Dword_io uint16 Vendor4 uint8 Capability uint8 Reserved50 uint16 Vendor5 uint8 TPIO uint8 Vendor6 uint8 TDMA uint8 Field_valid uint16 Cur_cyls uint16 Cur_heads uint16 Cur_sectors uint16 Cur_capacity0 uint16 Cur_capacity1 uint16 Multsect uint8 Multsect_valid uint8 Lba_capacity uint32 Dma_1word uint16 Dma_mword uint16 Eide_pio_modes uint16 Eide_dma_min uint16 Eide_dma_time uint16 Eide_pio uint16 Eide_pio_iordy uint16 Words69_70 [2]uint16 Words71_74 [4]uint16 Queue_depth uint16 Words76_79 [4]uint16 Major_rev_num uint16 Minor_rev_num uint16 Command_set_1 uint16 Command_set_2 uint16 Cfsse uint16 Cfs_enable_1 uint16 Cfs_enable_2 uint16 Csf_default uint16 Dma_ultra uint16 Trseuc uint16 TrsEuc uint16 CurAPMvalues uint16 Mprc uint16 Hw_config uint16 Acoustic uint16 Msrqs uint16 Sxfert uint16 Sal uint16 Spg uint32 Lba_capacity_2 uint64 Words104_125 [22]uint16 Last_lun uint16 Word127 uint16 Dlf uint16 Csfo uint16 Words130_155 [26]uint16 Word156 uint16 Words157_159 [3]uint16 Cfa_power uint16 Words161_175 [15]uint16 Words176_205 [30]uint16 Words206_254 [49]uint16 Integrity_word uint16 } type Statfs_t struct { Type int64 Bsize int64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int64 Frsize int64 Flags int64 Spare [4]int64 } const ( ST_MANDLOCK = 0x40 ST_NOATIME = 0x400 ST_NODEV = 0x4 ST_NODIRATIME = 0x800 ST_NOEXEC = 0x8 ST_NOSUID = 0x2 ST_RDONLY = 0x1 ST_RELATIME = 0x1000 ST_SYNCHRONOUS = 0x10 ) type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } type Tpacket2Hdr struct { Status uint32 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Nsec uint32 Vlan_tci uint16 Vlan_tpid uint16 _ [4]uint8 } type Tpacket3Hdr struct { Next_offset uint32 Sec uint32 Nsec uint32 Snaplen uint32 Len uint32 Status uint32 Mac uint16 Net uint16 Hv1 TpacketHdrVariant1 _ [8]uint8 } type TpacketHdrVariant1 struct { Rxhash uint32 Vlan_tci uint32 Vlan_tpid uint16 _ uint16 } type TpacketBlockDesc struct { Version uint32 To_priv uint32 Hdr [40]byte } type TpacketReq struct { Block_size uint32 Block_nr uint32 Frame_size uint32 Frame_nr uint32 } type TpacketReq3 struct { Block_size uint32 Block_nr uint32 Frame_size uint32 Frame_nr uint32 Retire_blk_tov uint32 Sizeof_priv uint32 Feature_req_word uint32 } type TpacketStats struct { Packets uint32 Drops uint32 } type TpacketStatsV3 struct { Packets uint32 Drops uint32 Freeze_q_cnt uint32 } type TpacketAuxdata struct { Status uint32 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Vlan_tci uint16 Vlan_tpid uint16 } const ( TPACKET_V1 = 0x0 TPACKET_V2 = 0x1 TPACKET_V3 = 0x2 ) const ( SizeofTpacketHdr = 0x20 SizeofTpacket2Hdr = 0x20 SizeofTpacket3Hdr = 0x30 ) const ( NF_INET_PRE_ROUTING = 0x0 NF_INET_LOCAL_IN = 0x1 NF_INET_FORWARD = 0x2 NF_INET_LOCAL_OUT = 0x3 NF_INET_POST_ROUTING = 0x4 NF_INET_NUMHOOKS = 0x5 ) const ( NF_NETDEV_INGRESS = 0x0 NF_NETDEV_NUMHOOKS = 0x1 ) const ( NFPROTO_UNSPEC = 0x0 NFPROTO_INET = 0x1 NFPROTO_IPV4 = 0x2 NFPROTO_ARP = 0x3 NFPROTO_NETDEV = 0x5 NFPROTO_BRIDGE = 0x7 NFPROTO_IPV6 = 0xa NFPROTO_DECNET = 0xc NFPROTO_NUMPROTO = 0xd ) type Nfgenmsg struct { Nfgen_family uint8 Version uint8 Res_id uint16 } const ( NFNL_BATCH_UNSPEC = 0x0 NFNL_BATCH_GENID = 0x1 ) const ( NFT_REG_VERDICT = 0x0 NFT_REG_1 = 0x1 NFT_REG_2 = 0x2 NFT_REG_3 = 0x3 NFT_REG_4 = 0x4 NFT_REG32_00 = 0x8 NFT_REG32_01 = 0x9 NFT_REG32_02 = 0xa NFT_REG32_03 = 0xb NFT_REG32_04 = 0xc NFT_REG32_05 = 0xd NFT_REG32_06 = 0xe NFT_REG32_07 = 0xf NFT_REG32_08 = 0x10 NFT_REG32_09 = 0x11 NFT_REG32_10 = 0x12 NFT_REG32_11 = 0x13 NFT_REG32_12 = 0x14 NFT_REG32_13 = 0x15 NFT_REG32_14 = 0x16 NFT_REG32_15 = 0x17 NFT_CONTINUE = -0x1 NFT_BREAK = -0x2 NFT_JUMP = -0x3 NFT_GOTO = -0x4 NFT_RETURN = -0x5 NFT_MSG_NEWTABLE = 0x0 NFT_MSG_GETTABLE = 0x1 NFT_MSG_DELTABLE = 0x2 NFT_MSG_NEWCHAIN = 0x3 NFT_MSG_GETCHAIN = 0x4 NFT_MSG_DELCHAIN = 0x5 NFT_MSG_NEWRULE = 0x6 NFT_MSG_GETRULE = 0x7 NFT_MSG_DELRULE = 0x8 NFT_MSG_NEWSET = 0x9 NFT_MSG_GETSET = 0xa NFT_MSG_DELSET = 0xb NFT_MSG_NEWSETELEM = 0xc NFT_MSG_GETSETELEM = 0xd NFT_MSG_DELSETELEM = 0xe NFT_MSG_NEWGEN = 0xf NFT_MSG_GETGEN = 0x10 NFT_MSG_TRACE = 0x11 NFT_MSG_NEWOBJ = 0x12 NFT_MSG_GETOBJ = 0x13 NFT_MSG_DELOBJ = 0x14 NFT_MSG_GETOBJ_RESET = 0x15 NFT_MSG_MAX = 0x19 NFTA_LIST_UNPEC = 0x0 NFTA_LIST_ELEM = 0x1 NFTA_HOOK_UNSPEC = 0x0 NFTA_HOOK_HOOKNUM = 0x1 NFTA_HOOK_PRIORITY = 0x2 NFTA_HOOK_DEV = 0x3 NFT_TABLE_F_DORMANT = 0x1 NFTA_TABLE_UNSPEC = 0x0 NFTA_TABLE_NAME = 0x1 NFTA_TABLE_FLAGS = 0x2 NFTA_TABLE_USE = 0x3 NFTA_CHAIN_UNSPEC = 0x0 NFTA_CHAIN_TABLE = 0x1 NFTA_CHAIN_HANDLE = 0x2 NFTA_CHAIN_NAME = 0x3 NFTA_CHAIN_HOOK = 0x4 NFTA_CHAIN_POLICY = 0x5 NFTA_CHAIN_USE = 0x6 NFTA_CHAIN_TYPE = 0x7 NFTA_CHAIN_COUNTERS = 0x8 NFTA_CHAIN_PAD = 0x9 NFTA_RULE_UNSPEC = 0x0 NFTA_RULE_TABLE = 0x1 NFTA_RULE_CHAIN = 0x2 NFTA_RULE_HANDLE = 0x3 NFTA_RULE_EXPRESSIONS = 0x4 NFTA_RULE_COMPAT = 0x5 NFTA_RULE_POSITION = 0x6 NFTA_RULE_USERDATA = 0x7 NFTA_RULE_PAD = 0x8 NFTA_RULE_ID = 0x9 NFT_RULE_COMPAT_F_INV = 0x2 NFT_RULE_COMPAT_F_MASK = 0x2 NFTA_RULE_COMPAT_UNSPEC = 0x0 NFTA_RULE_COMPAT_PROTO = 0x1 NFTA_RULE_COMPAT_FLAGS = 0x2 NFT_SET_ANONYMOUS = 0x1 NFT_SET_CONSTANT = 0x2 NFT_SET_INTERVAL = 0x4 NFT_SET_MAP = 0x8 NFT_SET_TIMEOUT = 0x10 NFT_SET_EVAL = 0x20 NFT_SET_OBJECT = 0x40 NFT_SET_POL_PERFORMANCE = 0x0 NFT_SET_POL_MEMORY = 0x1 NFTA_SET_DESC_UNSPEC = 0x0 NFTA_SET_DESC_SIZE = 0x1 NFTA_SET_UNSPEC = 0x0 NFTA_SET_TABLE = 0x1 NFTA_SET_NAME = 0x2 NFTA_SET_FLAGS = 0x3 NFTA_SET_KEY_TYPE = 0x4 NFTA_SET_KEY_LEN = 0x5 NFTA_SET_DATA_TYPE = 0x6 NFTA_SET_DATA_LEN = 0x7 NFTA_SET_POLICY = 0x8 NFTA_SET_DESC = 0x9 NFTA_SET_ID = 0xa NFTA_SET_TIMEOUT = 0xb NFTA_SET_GC_INTERVAL = 0xc NFTA_SET_USERDATA = 0xd NFTA_SET_PAD = 0xe NFTA_SET_OBJ_TYPE = 0xf NFT_SET_ELEM_INTERVAL_END = 0x1 NFTA_SET_ELEM_UNSPEC = 0x0 NFTA_SET_ELEM_KEY = 0x1 NFTA_SET_ELEM_DATA = 0x2 NFTA_SET_ELEM_FLAGS = 0x3 NFTA_SET_ELEM_TIMEOUT = 0x4 NFTA_SET_ELEM_EXPIRATION = 0x5 NFTA_SET_ELEM_USERDATA = 0x6 NFTA_SET_ELEM_EXPR = 0x7 NFTA_SET_ELEM_PAD = 0x8 NFTA_SET_ELEM_OBJREF = 0x9 NFTA_SET_ELEM_LIST_UNSPEC = 0x0 NFTA_SET_ELEM_LIST_TABLE = 0x1 NFTA_SET_ELEM_LIST_SET = 0x2 NFTA_SET_ELEM_LIST_ELEMENTS = 0x3 NFTA_SET_ELEM_LIST_SET_ID = 0x4 NFT_DATA_VALUE = 0x0 NFT_DATA_VERDICT = 0xffffff00 NFTA_DATA_UNSPEC = 0x0 NFTA_DATA_VALUE = 0x1 NFTA_DATA_VERDICT = 0x2 NFTA_VERDICT_UNSPEC = 0x0 NFTA_VERDICT_CODE = 0x1 NFTA_VERDICT_CHAIN = 0x2 NFTA_EXPR_UNSPEC = 0x0 NFTA_EXPR_NAME = 0x1 NFTA_EXPR_DATA = 0x2 NFTA_IMMEDIATE_UNSPEC = 0x0 NFTA_IMMEDIATE_DREG = 0x1 NFTA_IMMEDIATE_DATA = 0x2 NFTA_BITWISE_UNSPEC = 0x0 NFTA_BITWISE_SREG = 0x1 NFTA_BITWISE_DREG = 0x2 NFTA_BITWISE_LEN = 0x3 NFTA_BITWISE_MASK = 0x4 NFTA_BITWISE_XOR = 0x5 NFT_BYTEORDER_NTOH = 0x0 NFT_BYTEORDER_HTON = 0x1 NFTA_BYTEORDER_UNSPEC = 0x0 NFTA_BYTEORDER_SREG = 0x1 NFTA_BYTEORDER_DREG = 0x2 NFTA_BYTEORDER_OP = 0x3 NFTA_BYTEORDER_LEN = 0x4 NFTA_BYTEORDER_SIZE = 0x5 NFT_CMP_EQ = 0x0 NFT_CMP_NEQ = 0x1 NFT_CMP_LT = 0x2 NFT_CMP_LTE = 0x3 NFT_CMP_GT = 0x4 NFT_CMP_GTE = 0x5 NFTA_CMP_UNSPEC = 0x0 NFTA_CMP_SREG = 0x1 NFTA_CMP_OP = 0x2 NFTA_CMP_DATA = 0x3 NFT_RANGE_EQ = 0x0 NFT_RANGE_NEQ = 0x1 NFTA_RANGE_UNSPEC = 0x0 NFTA_RANGE_SREG = 0x1 NFTA_RANGE_OP = 0x2 NFTA_RANGE_FROM_DATA = 0x3 NFTA_RANGE_TO_DATA = 0x4 NFT_LOOKUP_F_INV = 0x1 NFTA_LOOKUP_UNSPEC = 0x0 NFTA_LOOKUP_SET = 0x1 NFTA_LOOKUP_SREG = 0x2 NFTA_LOOKUP_DREG = 0x3 NFTA_LOOKUP_SET_ID = 0x4 NFTA_LOOKUP_FLAGS = 0x5 NFT_DYNSET_OP_ADD = 0x0 NFT_DYNSET_OP_UPDATE = 0x1 NFT_DYNSET_F_INV = 0x1 NFTA_DYNSET_UNSPEC = 0x0 NFTA_DYNSET_SET_NAME = 0x1 NFTA_DYNSET_SET_ID = 0x2 NFTA_DYNSET_OP = 0x3 NFTA_DYNSET_SREG_KEY = 0x4 NFTA_DYNSET_SREG_DATA = 0x5 NFTA_DYNSET_TIMEOUT = 0x6 NFTA_DYNSET_EXPR = 0x7 NFTA_DYNSET_PAD = 0x8 NFTA_DYNSET_FLAGS = 0x9 NFT_PAYLOAD_LL_HEADER = 0x0 NFT_PAYLOAD_NETWORK_HEADER = 0x1 NFT_PAYLOAD_TRANSPORT_HEADER = 0x2 NFT_PAYLOAD_CSUM_NONE = 0x0 NFT_PAYLOAD_CSUM_INET = 0x1 NFT_PAYLOAD_L4CSUM_PSEUDOHDR = 0x1 NFTA_PAYLOAD_UNSPEC = 0x0 NFTA_PAYLOAD_DREG = 0x1 NFTA_PAYLOAD_BASE = 0x2 NFTA_PAYLOAD_OFFSET = 0x3 NFTA_PAYLOAD_LEN = 0x4 NFTA_PAYLOAD_SREG = 0x5 NFTA_PAYLOAD_CSUM_TYPE = 0x6 NFTA_PAYLOAD_CSUM_OFFSET = 0x7 NFTA_PAYLOAD_CSUM_FLAGS = 0x8 NFT_EXTHDR_F_PRESENT = 0x1 NFT_EXTHDR_OP_IPV6 = 0x0 NFT_EXTHDR_OP_TCPOPT = 0x1 NFTA_EXTHDR_UNSPEC = 0x0 NFTA_EXTHDR_DREG = 0x1 NFTA_EXTHDR_TYPE = 0x2 NFTA_EXTHDR_OFFSET = 0x3 NFTA_EXTHDR_LEN = 0x4 NFTA_EXTHDR_FLAGS = 0x5 NFTA_EXTHDR_OP = 0x6 NFTA_EXTHDR_SREG = 0x7 NFT_META_LEN = 0x0 NFT_META_PROTOCOL = 0x1 NFT_META_PRIORITY = 0x2 NFT_META_MARK = 0x3 NFT_META_IIF = 0x4 NFT_META_OIF = 0x5 NFT_META_IIFNAME = 0x6 NFT_META_OIFNAME = 0x7 NFT_META_IIFTYPE = 0x8 NFT_META_OIFTYPE = 0x9 NFT_META_SKUID = 0xa NFT_META_SKGID = 0xb NFT_META_NFTRACE = 0xc NFT_META_RTCLASSID = 0xd NFT_META_SECMARK = 0xe NFT_META_NFPROTO = 0xf NFT_META_L4PROTO = 0x10 NFT_META_BRI_IIFNAME = 0x11 NFT_META_BRI_OIFNAME = 0x12 NFT_META_PKTTYPE = 0x13 NFT_META_CPU = 0x14 NFT_META_IIFGROUP = 0x15 NFT_META_OIFGROUP = 0x16 NFT_META_CGROUP = 0x17 NFT_META_PRANDOM = 0x18 NFT_RT_CLASSID = 0x0 NFT_RT_NEXTHOP4 = 0x1 NFT_RT_NEXTHOP6 = 0x2 NFT_RT_TCPMSS = 0x3 NFT_HASH_JENKINS = 0x0 NFT_HASH_SYM = 0x1 NFTA_HASH_UNSPEC = 0x0 NFTA_HASH_SREG = 0x1 NFTA_HASH_DREG = 0x2 NFTA_HASH_LEN = 0x3 NFTA_HASH_MODULUS = 0x4 NFTA_HASH_SEED = 0x5 NFTA_HASH_OFFSET = 0x6 NFTA_HASH_TYPE = 0x7 NFTA_META_UNSPEC = 0x0 NFTA_META_DREG = 0x1 NFTA_META_KEY = 0x2 NFTA_META_SREG = 0x3 NFTA_RT_UNSPEC = 0x0 NFTA_RT_DREG = 0x1 NFTA_RT_KEY = 0x2 NFT_CT_STATE = 0x0 NFT_CT_DIRECTION = 0x1 NFT_CT_STATUS = 0x2 NFT_CT_MARK = 0x3 NFT_CT_SECMARK = 0x4 NFT_CT_EXPIRATION = 0x5 NFT_CT_HELPER = 0x6 NFT_CT_L3PROTOCOL = 0x7 NFT_CT_SRC = 0x8 NFT_CT_DST = 0x9 NFT_CT_PROTOCOL = 0xa NFT_CT_PROTO_SRC = 0xb NFT_CT_PROTO_DST = 0xc NFT_CT_LABELS = 0xd NFT_CT_PKTS = 0xe NFT_CT_BYTES = 0xf NFT_CT_AVGPKT = 0x10 NFT_CT_ZONE = 0x11 NFT_CT_EVENTMASK = 0x12 NFTA_CT_UNSPEC = 0x0 NFTA_CT_DREG = 0x1 NFTA_CT_KEY = 0x2 NFTA_CT_DIRECTION = 0x3 NFTA_CT_SREG = 0x4 NFT_LIMIT_PKTS = 0x0 NFT_LIMIT_PKT_BYTES = 0x1 NFT_LIMIT_F_INV = 0x1 NFTA_LIMIT_UNSPEC = 0x0 NFTA_LIMIT_RATE = 0x1 NFTA_LIMIT_UNIT = 0x2 NFTA_LIMIT_BURST = 0x3 NFTA_LIMIT_TYPE = 0x4 NFTA_LIMIT_FLAGS = 0x5 NFTA_LIMIT_PAD = 0x6 NFTA_COUNTER_UNSPEC = 0x0 NFTA_COUNTER_BYTES = 0x1 NFTA_COUNTER_PACKETS = 0x2 NFTA_COUNTER_PAD = 0x3 NFTA_LOG_UNSPEC = 0x0 NFTA_LOG_GROUP = 0x1 NFTA_LOG_PREFIX = 0x2 NFTA_LOG_SNAPLEN = 0x3 NFTA_LOG_QTHRESHOLD = 0x4 NFTA_LOG_LEVEL = 0x5 NFTA_LOG_FLAGS = 0x6 NFTA_QUEUE_UNSPEC = 0x0 NFTA_QUEUE_NUM = 0x1 NFTA_QUEUE_TOTAL = 0x2 NFTA_QUEUE_FLAGS = 0x3 NFTA_QUEUE_SREG_QNUM = 0x4 NFT_QUOTA_F_INV = 0x1 NFT_QUOTA_F_DEPLETED = 0x2 NFTA_QUOTA_UNSPEC = 0x0 NFTA_QUOTA_BYTES = 0x1 NFTA_QUOTA_FLAGS = 0x2 NFTA_QUOTA_PAD = 0x3 NFTA_QUOTA_CONSUMED = 0x4 NFT_REJECT_ICMP_UNREACH = 0x0 NFT_REJECT_TCP_RST = 0x1 NFT_REJECT_ICMPX_UNREACH = 0x2 NFT_REJECT_ICMPX_NO_ROUTE = 0x0 NFT_REJECT_ICMPX_PORT_UNREACH = 0x1 NFT_REJECT_ICMPX_HOST_UNREACH = 0x2 NFT_REJECT_ICMPX_ADMIN_PROHIBITED = 0x3 NFTA_REJECT_UNSPEC = 0x0 NFTA_REJECT_TYPE = 0x1 NFTA_REJECT_ICMP_CODE = 0x2 NFT_NAT_SNAT = 0x0 NFT_NAT_DNAT = 0x1 NFTA_NAT_UNSPEC = 0x0 NFTA_NAT_TYPE = 0x1 NFTA_NAT_FAMILY = 0x2 NFTA_NAT_REG_ADDR_MIN = 0x3 NFTA_NAT_REG_ADDR_MAX = 0x4 NFTA_NAT_REG_PROTO_MIN = 0x5 NFTA_NAT_REG_PROTO_MAX = 0x6 NFTA_NAT_FLAGS = 0x7 NFTA_MASQ_UNSPEC = 0x0 NFTA_MASQ_FLAGS = 0x1 NFTA_MASQ_REG_PROTO_MIN = 0x2 NFTA_MASQ_REG_PROTO_MAX = 0x3 NFTA_REDIR_UNSPEC = 0x0 NFTA_REDIR_REG_PROTO_MIN = 0x1 NFTA_REDIR_REG_PROTO_MAX = 0x2 NFTA_REDIR_FLAGS = 0x3 NFTA_DUP_UNSPEC = 0x0 NFTA_DUP_SREG_ADDR = 0x1 NFTA_DUP_SREG_DEV = 0x2 NFTA_FWD_UNSPEC = 0x0 NFTA_FWD_SREG_DEV = 0x1 NFTA_OBJREF_UNSPEC = 0x0 NFTA_OBJREF_IMM_TYPE = 0x1 NFTA_OBJREF_IMM_NAME = 0x2 NFTA_OBJREF_SET_SREG = 0x3 NFTA_OBJREF_SET_NAME = 0x4 NFTA_OBJREF_SET_ID = 0x5 NFTA_GEN_UNSPEC = 0x0 NFTA_GEN_ID = 0x1 NFTA_GEN_PROC_PID = 0x2 NFTA_GEN_PROC_NAME = 0x3 NFTA_FIB_UNSPEC = 0x0 NFTA_FIB_DREG = 0x1 NFTA_FIB_RESULT = 0x2 NFTA_FIB_FLAGS = 0x3 NFT_FIB_RESULT_UNSPEC = 0x0 NFT_FIB_RESULT_OIF = 0x1 NFT_FIB_RESULT_OIFNAME = 0x2 NFT_FIB_RESULT_ADDRTYPE = 0x3 NFTA_FIB_F_SADDR = 0x1 NFTA_FIB_F_DADDR = 0x2 NFTA_FIB_F_MARK = 0x4 NFTA_FIB_F_IIF = 0x8 NFTA_FIB_F_OIF = 0x10 NFTA_FIB_F_PRESENT = 0x20 NFTA_CT_HELPER_UNSPEC = 0x0 NFTA_CT_HELPER_NAME = 0x1 NFTA_CT_HELPER_L3PROTO = 0x2 NFTA_CT_HELPER_L4PROTO = 0x3 NFTA_OBJ_UNSPEC = 0x0 NFTA_OBJ_TABLE = 0x1 NFTA_OBJ_NAME = 0x2 NFTA_OBJ_TYPE = 0x3 NFTA_OBJ_DATA = 0x4 NFTA_OBJ_USE = 0x5 NFTA_TRACE_UNSPEC = 0x0 NFTA_TRACE_TABLE = 0x1 NFTA_TRACE_CHAIN = 0x2 NFTA_TRACE_RULE_HANDLE = 0x3 NFTA_TRACE_TYPE = 0x4 NFTA_TRACE_VERDICT = 0x5 NFTA_TRACE_ID = 0x6 NFTA_TRACE_LL_HEADER = 0x7 NFTA_TRACE_NETWORK_HEADER = 0x8 NFTA_TRACE_TRANSPORT_HEADER = 0x9 NFTA_TRACE_IIF = 0xa NFTA_TRACE_IIFTYPE = 0xb NFTA_TRACE_OIF = 0xc NFTA_TRACE_OIFTYPE = 0xd NFTA_TRACE_MARK = 0xe NFTA_TRACE_NFPROTO = 0xf NFTA_TRACE_POLICY = 0x10 NFTA_TRACE_PAD = 0x11 NFT_TRACETYPE_UNSPEC = 0x0 NFT_TRACETYPE_POLICY = 0x1 NFT_TRACETYPE_RETURN = 0x2 NFT_TRACETYPE_RULE = 0x3 NFTA_NG_UNSPEC = 0x0 NFTA_NG_DREG = 0x1 NFTA_NG_MODULUS = 0x2 NFTA_NG_TYPE = 0x3 NFTA_NG_OFFSET = 0x4 NFT_NG_INCREMENTAL = 0x0 NFT_NG_RANDOM = 0x1 ) type RTCTime struct { Sec int32 Min int32 Hour int32 Mday int32 Mon int32 Year int32 Wday int32 Yday int32 Isdst int32 } type RTCWkAlrm struct { Enabled uint8 Pending uint8 _ [2]byte Time RTCTime } type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgIoctlArg struct { Op int32 Flags int32 Datalen int32 _ [4]byte Data *byte } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x20001269 BLKPG_ADD_PARTITION = 0x1 BLKPG_DEL_PARTITION = 0x2 BLKPG_RESIZE_PARTITION = 0x3 ) const ( NETNSA_NONE = 0x0 NETNSA_NSID = 0x1 NETNSA_PID = 0x2 NETNSA_FD = 0x3 ) type XDPRingOffset struct { Producer uint64 Consumer uint64 Desc uint64 } type XDPMmapOffsets struct { Rx XDPRingOffset Tx XDPRingOffset Fr XDPRingOffset Cr XDPRingOffset } type XDPUmemReg struct { Addr uint64 Len uint64 Size uint32 Headroom uint32 } type XDPStatistics struct { Rx_dropped uint64 Rx_invalid_descs uint64 Tx_invalid_descs uint64 } type XDPDesc struct { Addr uint64 Len uint32 Options uint32 } const ( NCSI_CMD_UNSPEC = 0x0 NCSI_CMD_PKG_INFO = 0x1 NCSI_CMD_SET_INTERFACE = 0x2 NCSI_CMD_CLEAR_INTERFACE = 0x3 NCSI_ATTR_UNSPEC = 0x0 NCSI_ATTR_IFINDEX = 0x1 NCSI_ATTR_PACKAGE_LIST = 0x2 NCSI_ATTR_PACKAGE_ID = 0x3 NCSI_ATTR_CHANNEL_ID = 0x4 NCSI_PKG_ATTR_UNSPEC = 0x0 NCSI_PKG_ATTR = 0x1 NCSI_PKG_ATTR_ID = 0x2 NCSI_PKG_ATTR_FORCED = 0x3 NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 NCSI_CHANNEL_ATTR_UNSPEC = 0x0 NCSI_CHANNEL_ATTR = 0x1 NCSI_CHANNEL_ATTR_ID = 0x2 NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 NCSI_CHANNEL_ATTR_ACTIVE = 0x7 NCSI_CHANNEL_ATTR_FORCED = 0x8 NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 NCSI_CHANNEL_ATTR_VLAN_ID = 0xa ) const ( SOF_TIMESTAMPING_TX_HARDWARE = 0x1 SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 SOF_TIMESTAMPING_RX_HARDWARE = 0x4 SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 SOF_TIMESTAMPING_SOFTWARE = 0x10 SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 SOF_TIMESTAMPING_OPT_ID = 0x80 SOF_TIMESTAMPING_TX_SCHED = 0x100 SOF_TIMESTAMPING_TX_ACK = 0x200 SOF_TIMESTAMPING_OPT_CMSG = 0x400 SOF_TIMESTAMPING_OPT_TSONLY = 0x800 SOF_TIMESTAMPING_OPT_STATS = 0x1000 SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 SOF_TIMESTAMPING_LAST = 0x4000 SOF_TIMESTAMPING_MASK = 0x7fff )
{ "pile_set_name": "Github" }
{ "name": "js2xmlparser", "description": "Parses JavaScript objects into XML", "keywords": [ "convert", "converter", "js", "json", "object", "objects", "parse", "parser", "xml" ], "homepage": "http://www.kourlas.net", "version": "0.1.7", "author": { "name": "Michael Kourlas", "email": "[email protected]" }, "main": "./lib/js2xmlparser.js", "repository": { "type": "git", "url": "git://github.com/michaelkourlas/node-js2xmlparser.git" }, "devDependencies": { "mocha": "*", "should": "*" }, "license": "MIT", "gitHead": "787d4a0f624f805a24fe334ad79d6cf127b0c146", "bugs": { "url": "https://github.com/michaelkourlas/node-js2xmlparser/issues" }, "_id": "[email protected]", "scripts": {}, "_shasum": "c8a4bf9ba00577c4b2ce0bd6e714ee8341a586ae", "_from": "js2xmlparser@~0.1.0", "_npmVersion": "1.4.28", "_npmUser": { "name": "michaelkourlas", "email": "[email protected]" }, "maintainers": [ { "name": "michaelkourlas", "email": "[email protected]" } ], "dist": { "shasum": "c8a4bf9ba00577c4b2ce0bd6e714ee8341a586ae", "tarball": "http://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.7.tgz" }, "directories": {}, "_resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.7.tgz" }
{ "pile_set_name": "Github" }
--- # Purpose: Creates the Kerberos principals needed # # Notes: # - Executed on KDC server as it requires kadmin.local # - The principal database must already exit - name: Determine existing principals shell: kadmin.local -q 'listprincs' register: principal_list changed_when: false - debug: var=principal_list.stdout_lines - name: Add administrator and kerberos principals command: kadmin.local -q 'addprinc -pw krbsekret {{ KRB_ADMIN }}/admin@{{ KRB_REALM }}' when: principal_list.stdout.find('{{ KRB_ADMIN }}/admin@{{ KRB_REALM }}') == -1 - command: kadmin.local -q 'addprinc -pw krbsekret {{ KRB_ADMIN }}@{{ KRB_REALM }}' when: principal_list.stdout.find('{{ KRB_ADMIN }}@{{ KRB_REALM }}') == -1 - command: kadmin.local -q 'addprinc -pw krbsekret krbtgt/{{ KRB_REALM }}@{{ KRB_REALM }}' when: principal_list.stdout.find('krbtgt/{{ KRB_REALM }}@{{ KRB_REALM }}') == -1 - name: Add user principals command: kadmin.local -q 'addprinc -pw {{ item.user }} {{ item.user }}@{{ KRB_REALM }}' with_items: - "{{ END_USERS }}" when: principal_list.stdout.find('{{ item.user }}@{{ KRB_REALM }}') == -1 - name: Add service principals command: kadmin.local -q 'add_principal -randkey {{ item[1] }}/{{ item[0] }}.{{ CLUSTER_DOMAIN }}@{{ KRB_REALM }}' with_nested: - "{{ groups.all }}" - "{{ KRB_PRINCIPALS }}" when: principal_list.stdout.find('{{ item[1] }}/{{ item[0] }}.{{ CLUSTER_DOMAIN }}@{{ KRB_REALM }}') == -1 - name: Export keytabs into root account file: path=/root/keytabs owner=root group=root mode=700 state=directory # usually a services has its own principal and the special HTTP principal for its web UIs... - command: kadmin.local -q 'xst -k /root/keytabs/{{ item[1] }}-{{ item[0] }}.keytab -norandkey -q {{ item[1] }}/{{ item[0] }}.{{ CLUSTER_DOMAIN }}@{{ KRB_REALM }} HTTP/{{ item[0] }}.{{ CLUSTER_DOMAIN }}@{{ KRB_REALM }}' args: creates: /root/keytabs/{{ item[1] }}-{{ item[0] }}.keytab with_nested: - "{{ groups.all }}" - "{{ KRB_SERVICES_WITH_HTTP }}" # but for the history server there is only a single principal in the keytab - command: kadmin.local -q 'xst -k /root/keytabs/mapred-{{ item }}.keytab -norandkey -q mapred/{{ item }}@{{ KRB_REALM }}' args: creates: /root/keytabs/mapred-{{ item }}.keytab with_items: - groups.historyserver # finally also export the normal user principals - command: kadmin.local -q 'xst -k /root/keytabs/{{ item.user }}.keytab -norandkey -q {{ item.user }}@{{ KRB_REALM }}' args: creates: /root/keytabs/{{ item.user }}.keytab with_items: - "{{ END_USERS }}" - name: Download keytabs to orchestration server fetch: src=/root/keytabs/{{ item[1] }}-{{ item[0] }}.keytab dest=files/keytabs/ flat=yes failonmissing=yes with_nested: - "{{ groups.all }}" - "{{ KRB_SERVICES_WITH_HTTP }}" - fetch: src=/root/keytabs/{{ item.user }}.keytab dest=files/keytabs/ flat=yes failonmissing=yes with_items: - "{{ END_USERS }}"
{ "pile_set_name": "Github" }
CC = gcc CFLAG = -c -Wall EXECUTE = mod-rs485-iso all: $(EXECUTE) $(EXECUTE): i2c.o main.o $(CC) i2c.o main.o -o $(EXECUTE) main.o: main.c $(CC) $(CFLAG) main.c i2c.o: i2c.c $(CC) $(CFLAG) i2c.c clean: rm -rf *.o $(EXECUTE)
{ "pile_set_name": "Github" }
//***************************************************************************** // (c) Copyright 2013 - 2014 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant any // rights to the materials distributed herewith. Except as // otherwise provided in a valid license issued to you by // Xilinx, and to the maximum extent permitted by applicable // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // (2) Xilinx shall not be liable (whether in contract or tort, // including negligence, or under any other theory of // liability) for any loss or damage of any kind or nature // related to, arising under or in connection with these // materials, including for any direct, or any indirect, // special, incidental, or consequential loss or damage // (including loss of data, profits, goodwill, or any type of // loss or damage suffered as a result of any action brought // by a third party) even if such damage or loss was // reasonably foreseeable or Xilinx had been advised of the // possibility of the same. // // CRITICAL APPLICATIONS // Xilinx products are not designed or intended to be fail- // safe, or for use in any application requiring fail-safe // performance, such as life-support or safety devices or // systems, Class III medical devices, nuclear facilities, // applications related to the deployment of airbags, or any // other applications that could lead to death, personal // injury, or severe property or environmental damage // (individually and collectively, "Critical // Applications"). Customer assumes the sole risk and // liability of any use of Xilinx products in Critical // Applications, subject only to applicable laws and // regulations governing limitations on product liability. // // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // PART OF THIS FILE AT ALL TIMES. // //***************************************************************************** // ____ ____ // / /\/ / // /___/ \ / Vendor : Xilinx // \ \ \/ Version : 1.1 // \ \ Application : MIG // / / Filename : ddr4_v2_2_3_mc_ecc_dec_fix.sv // /___/ /\ Date Last Modified : $Date$ // \ \ / \ Date Created : Tue May 13 2014 // \___\/\___\ // //Device : UltraScale //Design Name : DDR4 SDRAM & DDR3 SDRAM //Purpose : // ddr4_v2_2_3_mc_ecc_dec_fix module //Reference : //Revision History : //***************************************************************************** `timescale 1ns/100ps module ddr4_v2_2_3_mc_ecc_dec_fix #( parameter TCQ = 100, parameter PAYLOAD_WIDTH = 64, parameter CODE_WIDTH = 72, parameter DATA_WIDTH = 64, parameter DQ_WIDTH = 72, parameter ECC_WIDTH = 8, ADDR_FIFO_WIDTH = 30, S_HEIGHT = 1, LR_WIDTH = 1, MEM = "DDR4", COLBITS = 10, ABITS = 18, parameter nCK_PER_CLK = 4 ) ( /*AUTOARG*/ // Outputs rd_data, ecc_single, ecc_multiple, ecc_err_addr, // Inputs clk, rst, h_rows, phy_rddata, correct_en, ecc_status_valid, non_per_rd_cas, ecc_status_valid_nxt, winPortEncC, cmdRmw, cmdRank, cmdLRank, cmdRow, cmdCol, cmdBank, cmdGroup ); localparam ADDR_FIFO_FULL_THRESHOLD = 15; input clk; input rst; // Compute syndromes. input [CODE_WIDTH*ECC_WIDTH-1:0] h_rows; input [2*nCK_PER_CLK*DQ_WIDTH-1:0] phy_rddata; wire [2*nCK_PER_CLK*ECC_WIDTH-1:0] syndrome_ns; genvar k; genvar m; generate // Swizzle data and check bits from the XiPhy interface's // systematic format to the ECC block's per burst systematic format. for (k=0; k<2*nCK_PER_CLK; k=k+1) begin : ecc_word for (m=0; m<ECC_WIDTH; m=m+1) begin : ecc_bit assign syndrome_ns[k*ECC_WIDTH+m] = ^(phy_rddata[k*DQ_WIDTH+:CODE_WIDTH] & h_rows[m*CODE_WIDTH+:CODE_WIDTH]); end end endgenerate reg [2*nCK_PER_CLK*ECC_WIDTH-1:0] syndrome_r; always @(posedge clk) syndrome_r <= #TCQ syndrome_ns; // Extract payload bits from raw DRAM bits and register. wire [2*nCK_PER_CLK*PAYLOAD_WIDTH-1:0] ecc_rddata_ns; genvar i; generate for (i=0; i<2*nCK_PER_CLK; i=i+1) begin : extract_payload assign ecc_rddata_ns[i*PAYLOAD_WIDTH+:PAYLOAD_WIDTH] = phy_rddata[i*DQ_WIDTH+:PAYLOAD_WIDTH]; end endgenerate reg [2*nCK_PER_CLK*PAYLOAD_WIDTH-1:0] ecc_rddata_r; always @(posedge clk) ecc_rddata_r <= #TCQ ecc_rddata_ns; // Regenerate h_matrix from h_rows leaving out the identity part // since we're not going to correct the ECC bits themselves. genvar n; genvar p; wire [ECC_WIDTH-1:0] h_matrix [DATA_WIDTH-1:0]; generate for (n=0; n<DATA_WIDTH; n=n+1) begin : h_col for (p=0; p<ECC_WIDTH; p=p+1) begin : h_bit assign h_matrix [n][p] = h_rows [p*CODE_WIDTH+n]; end end endgenerate // Compute flip bits. wire [2*nCK_PER_CLK*DATA_WIDTH-1:0] flip_bits; genvar q; genvar r; generate for (q=0; q<2*nCK_PER_CLK; q=q+1) begin : flip_word for (r=0; r<DATA_WIDTH; r=r+1) begin : flip_bit assign flip_bits[q*DATA_WIDTH+r] = h_matrix[r] == syndrome_r[q*ECC_WIDTH+:ECC_WIDTH]; end end endgenerate // Correct data. output reg [2*nCK_PER_CLK*PAYLOAD_WIDTH-1:0] rd_data; input correct_en; integer s; always @(/*AS*/correct_en or ecc_rddata_r or flip_bits) for (s=0; s<2*nCK_PER_CLK; s=s+1) if (correct_en) rd_data[s*PAYLOAD_WIDTH+:DATA_WIDTH] = ecc_rddata_r[s*PAYLOAD_WIDTH+:DATA_WIDTH] ^ flip_bits[s*DATA_WIDTH+:DATA_WIDTH]; else rd_data[s*PAYLOAD_WIDTH+:DATA_WIDTH] = ecc_rddata_r[s*PAYLOAD_WIDTH+:DATA_WIDTH]; // Copy raw payload bits if ECC_TEST is ON. localparam RAW_BIT_WIDTH = PAYLOAD_WIDTH - DATA_WIDTH; genvar t; generate if (RAW_BIT_WIDTH > 0) for (t=0; t<2*nCK_PER_CLK; t=t+1) begin : copy_raw_bits always @(/*AS*/ecc_rddata_r) rd_data[(t+1)*PAYLOAD_WIDTH-1-:RAW_BIT_WIDTH] = ecc_rddata_r[(t+1)*PAYLOAD_WIDTH-1-:RAW_BIT_WIDTH]; end endgenerate // Generate status information. input ecc_status_valid; output wire [2*nCK_PER_CLK-1:0] ecc_single; output wire [2*nCK_PER_CLK-1:0] ecc_multiple; genvar v; generate for (v=0; v<2*nCK_PER_CLK; v=v+1) begin : compute_status wire zero = ~|syndrome_r[v*ECC_WIDTH+:ECC_WIDTH]; wire odd = ^syndrome_r[v*ECC_WIDTH+:ECC_WIDTH]; assign ecc_single[v] = ecc_status_valid && ~zero && odd; assign ecc_multiple[v] = ecc_status_valid && ~zero && ~odd; end endgenerate // Implement FIFO to store and return transaction address for error logging // --------------------------------------------------------------------------- input ecc_status_valid_nxt; input [1:0] winPortEncC; input non_per_rd_cas; input [3:0] cmdRmw; input [7:0] cmdRank; input [4*LR_WIDTH-1:0] cmdLRank; input [4*ABITS-1:0] cmdRow; input [4*COLBITS-1:0] cmdCol; input [7:0] cmdBank; input [7:0] cmdGroup; output reg [ADDR_FIFO_WIDTH-1:0] ecc_err_addr; reg [ADDR_FIFO_WIDTH-1:0] addr_fifo [15:0]; reg [ADDR_FIFO_WIDTH-1:0] addr_fifo_nxt [15:0]; reg [3:0] addr_fifo_rptr; reg [3:0] addr_fifo_wptr; wire [ADDR_FIFO_WIDTH-1:0] addr_fifo_load_value; generate if (S_HEIGHT > 1) begin assign addr_fifo_load_value[51:48] = {{4-LR_WIDTH{1'b0}}, cmdLRank[winPortEncC*LR_WIDTH+:LR_WIDTH]}; assign addr_fifo_load_value[47:45] = 3'b0; end else if (MEM == "DDR4") begin assign addr_fifo_load_value[51:48] = 4'b0; assign addr_fifo_load_value[47:45] = 3'b0; end endgenerate assign addr_fifo_load_value[ 44] = cmdRmw [winPortEncC]; assign addr_fifo_load_value[43:24] = cmdRow [winPortEncC*ABITS+:ABITS]; generate // Arrange column address bits into DRAM pinout format for 10 bit DDR4 and up to 12 bit 8G DDR3 assign addr_fifo_load_value[23: 8] = ( COLBITS == 12 ) ? { 2'b0, cmdCol[winPortEncC*COLBITS+11], 1'b0, cmdCol[winPortEncC*COLBITS+10], 1'b0, cmdCol[winPortEncC*COLBITS+:10] } : ( COLBITS == 11 ) ? { 4'b0, cmdCol[winPortEncC*COLBITS+10], 1'b0, cmdCol[winPortEncC*COLBITS+:10] } : { { ( 16 - COLBITS ) { 1'b0 } }, cmdCol[winPortEncC*COLBITS+:10] } ; endgenerate assign addr_fifo_load_value[ 7: 4] = cmdRank [winPortEncC*2+:2]; assign addr_fifo_load_value[ 3: 0] = ( MEM == "DDR4" ) ? { cmdGroup[winPortEncC*2+:2], cmdBank[winPortEncC*2+:2] } : { cmdGroup[winPortEncC*2+:1], cmdBank[winPortEncC*2+:2] }; always @(*) begin addr_fifo_nxt = addr_fifo; addr_fifo_nxt[addr_fifo_wptr] = addr_fifo_load_value; end wire [4:0] addr_fifo_rptr_nxt = addr_fifo_rptr + { 3'b0, ecc_status_valid_nxt }; wire [4:0] addr_fifo_wptr_nxt = addr_fifo_wptr + { 3'b0, non_per_rd_cas }; // General reset flops always @(posedge clk) begin if (rst) begin addr_fifo_rptr <= #TCQ '0; addr_fifo_wptr <= #TCQ '0; end else begin addr_fifo_rptr <= #TCQ addr_fifo_rptr_nxt[3:0]; addr_fifo_wptr <= #TCQ addr_fifo_wptr_nxt[3:0]; end end // General flops always @(posedge clk) begin addr_fifo <= #TCQ addr_fifo_nxt; ecc_err_addr <= #TCQ addr_fifo[addr_fifo_rptr]; end //synopsys translate_off `ifdef MEM_INTERNAL // Events - When asserted high in a test that passes all verification checks, these coverage // properties indicate that a functional coverage event has been hit. // --------------------------------------------------------------------------------------------- // Address fifo half full wire e_mc_ecc_dec_000 = ( addr_fifo_wptr - addr_fifo_rptr ) > ( ADDR_FIFO_FULL_THRESHOLD/2 ); always @(posedge clk) mc_ecc_dec_000: if (~rst) cover property (e_mc_ecc_dec_000); // Address fifo 3/4 full wire e_mc_ecc_dec_001 = ( addr_fifo_wptr - addr_fifo_rptr ) > ( ( ADDR_FIFO_FULL_THRESHOLD*3 )/4 ); always @(posedge clk) mc_ecc_dec_001: if (~rst) cover property (e_mc_ecc_dec_001); // Address fifo full wire e_mc_ecc_dec_002 = ( addr_fifo_wptr - addr_fifo_rptr ) == ADDR_FIFO_FULL_THRESHOLD; always @(posedge clk) mc_ecc_dec_002: if (~rst) cover property (e_mc_ecc_dec_002); // Address fifo almost full wire e_mc_ecc_dec_003 = ( addr_fifo_wptr - addr_fifo_rptr ) == ( ADDR_FIFO_FULL_THRESHOLD - 1 ); always @(posedge clk) mc_ecc_dec_003: if (~rst) cover property (e_mc_ecc_dec_003); // Asserts - When asserted high, an illegal condition has been detected and the test has failed. // --------------------------------------------------------------------------------------------- // Address fifo overflow wire a_mc_ecc_dec_000 = ( ( addr_fifo_wptr - addr_fifo_rptr ) == ADDR_FIFO_FULL_THRESHOLD ) & ~ecc_status_valid_nxt & non_per_rd_cas; always @(posedge clk) if (~rst) assert property (~a_mc_ecc_dec_000); // Address fifo underflow wire a_mc_ecc_dec_001 = ( addr_fifo_wptr == addr_fifo_rptr ) & ecc_status_valid_nxt; always @(posedge clk) if (~rst) assert property (~a_mc_ecc_dec_001); `endif //synopsys translate_on endmodule
{ "pile_set_name": "Github" }
/* * AutoRefactor - Eclipse plugin to automatically refactor Java code bases. * * Copyright (C) 2017 Andrei Paikin - Initial API and implementation * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * 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 under LICENSE-GNUGPL. If not, see * <http://www.gnu.org/licenses/>. * * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution under LICENSE-ECLIPSE, and is * available at http://www.eclipse.org/legal/epl-v10.html */ package org.autorefactor.jdt.internal.ui.fix; import java.util.List; import org.autorefactor.jdt.internal.corext.dom.ASTNodes; import org.autorefactor.util.Utils; import org.eclipse.jdt.core.dom.IExtendedModifier; import org.eclipse.jdt.core.dom.ITypeBinding; import org.eclipse.jdt.core.dom.MethodDeclaration; import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.core.dom.Statement; import org.eclipse.jdt.core.dom.SuperConstructorInvocation; import org.eclipse.jdt.core.dom.Type; import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.text.edits.TextEditGroup; /** See {@link #getDescription()} method. */ public class ImplicitDefaultConstructorRatherThanWrittenOneCleanUp extends AbstractCleanUpRule { @Override public String getName() { return MultiFixMessages.ImplicitDefaultConstructorRatherThanWrittenOneCleanUp_name; } @Override public String getDescription() { return MultiFixMessages.ImplicitDefaultConstructorRatherThanWrittenOneCleanUp_description; } @Override public String getReason() { return MultiFixMessages.ImplicitDefaultConstructorRatherThanWrittenOneCleanUp_reason; } @SuppressWarnings("unchecked") @Override public boolean visit(final TypeDeclaration node) { if (!node.isInterface()) { MethodDeclaration uniqueConstructor= null; boolean isPublicClass= false; boolean isProtectedClass= false; boolean isPackageClass= true; boolean isPrivateClass= false; for (IExtendedModifier extendedModifier : (List<IExtendedModifier>) node.modifiers()) { if (extendedModifier.isModifier()) { Modifier modifier= (Modifier) extendedModifier; if (modifier.isPublic()) { isPublicClass= true; isPackageClass= false; break; } if (modifier.isProtected()) { isProtectedClass= true; isPackageClass= false; break; } if (modifier.isPrivate()) { isPrivateClass= true; isPackageClass= false; break; } } } for (MethodDeclaration methodDeclaration : node.getMethods()) { if (methodDeclaration.isConstructor()) { if (uniqueConstructor != null) { // Too much constructors return true; } uniqueConstructor= methodDeclaration; } } if (uniqueConstructor != null && (!isCheckedExceptionThrown(uniqueConstructor) || node.getSuperclassType() == null || ASTNodes.hasType(node.getSuperclassType().resolveBinding(), Object.class.getCanonicalName())) && Utils.isEmpty(uniqueConstructor.parameters()) && isDefaultStatements(uniqueConstructor)) { if (uniqueConstructor.modifiers() != null && uniqueConstructor.modifiers().size() == 1) { IExtendedModifier extendedModifier= (IExtendedModifier) uniqueConstructor.modifiers().get(0); if (extendedModifier.isModifier()) { Modifier modifier= (Modifier) extendedModifier; if (modifier.isPublic() && isPublicClass || modifier.isProtected() && isProtectedClass || modifier.isPrivate() && isPrivateClass) { TextEditGroup group= new TextEditGroup(MultiFixMessages.ImplicitDefaultConstructorRatherThanWrittenOneCleanUp_description); cuRewrite.getASTRewrite().remove(uniqueConstructor, group); return false; } } } else if (Utils.isEmpty(uniqueConstructor.modifiers()) && isPackageClass) { TextEditGroup group= new TextEditGroup(MultiFixMessages.ImplicitDefaultConstructorRatherThanWrittenOneCleanUp_description); cuRewrite.getASTRewrite().remove(uniqueConstructor, group); return false; } } } return true; } private boolean isDefaultStatements(final MethodDeclaration uniqueConstructor) { @SuppressWarnings("unchecked") List<Statement> statements= uniqueConstructor.getBody().statements(); if (Utils.isEmpty(statements)) { return true; } if (statements.size() == 1) { SuperConstructorInvocation superStatement= ASTNodes.as(statements.get(0), SuperConstructorInvocation.class); return superStatement != null && Utils.isEmpty(superStatement.arguments()); } return false; } private boolean isCheckedExceptionThrown(final MethodDeclaration uniqueConstructor) { if (uniqueConstructor.thrownExceptionTypes() != null) { for (Object type : uniqueConstructor.thrownExceptionTypes()) { if (isChecked((Type) type)) { return true; } } } return false; } private boolean isChecked(final Type type) { ITypeBinding binding= type.resolveBinding(); return !ASTNodes.instanceOf(binding, RuntimeException.class.getCanonicalName()) && !ASTNodes.instanceOf(binding, Error.class.getCanonicalName()); } }
{ "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. */ /** \file * \ingroup freestyle */ #pragma once #include "../BPy_StrokeShader.h" #ifdef __cplusplus extern "C" { #endif /////////////////////////////////////////////////////////////////////////////////////////// extern PyTypeObject ConstantColorShader_Type; #define BPy_ConstantColorShader_Check(v) \ (PyObject_IsInstance((PyObject *)v, (PyObject *)&ConstantColorShader_Type)) /*---------------------------Python BPy_ConstantColorShader structure definition----------*/ typedef struct { BPy_StrokeShader py_ss; } BPy_ConstantColorShader; /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif
{ "pile_set_name": "Github" }
/* Generated by RuntimeBrowser. */ @protocol PXUIWidgetFooterViewDelegate <NSObject> @optional - (void)widgetFooterView:(PXUIWidgetFooterView *)arg1 didSelectDisclosure:(UIButton *)arg2; @end
{ "pile_set_name": "Github" }
{ "locale": "hi-IN", "date": { "ca": [ "gregory", "generic" ], "hourNo0": true, "hour12": true, "formats": { "short": "{1}, {0}", "medium": "{1}, {0}", "full": "{1} को {0}", "long": "{1} को {0}", "availableFormats": { "d": "d", "E": "ccc", "Ed": "E d", "Ehm": "E h:mm a", "EHm": "E HH:mm", "Ehms": "E h:mm:ss a", "EHms": "E HH:mm:ss", "Gy": "y G", "GyMMM": "MMM G y", "GyMMMd": "d MMM y G", "GyMMMEd": "E, d MMM y G", "h": "h a", "H": "HH", "hm": "h:mm a", "Hm": "HH:mm", "hms": "h:mm:ss a", "Hms": "HH:mm:ss", "hmsv": "h:mm:ss a v", "Hmsv": "HH:mm:ss v", "hmv": "h:mm a v", "Hmv": "HH:mm v", "M": "L", "Md": "d/M", "MEd": "E, d/M", "MMdd": "dd/MM", "MMM": "LLL", "MMMd": "d MMM", "MMMEd": "E, d MMM", "MMMMd": "d MMMM", "MMMMEd": "E, d MMMM", "ms": "mm:ss", "y": "y", "yM": "M/y", "yMd": "d/M/y", "yMEd": "E, d/M/y", "yMM": "MM/y", "yMMdd": "dd/MM/y", "yMMM": "MMM y", "yMMMd": "d MMM y", "yMMMEd": "E, d MMM y", "yMMMM": "MMMM y", "yQQQ": "QQQ y", "yQQQQ": "QQQQ y" }, "dateFormats": { "yMMMMEEEEd": "EEEE, d MMMM y", "yMMMMd": "d MMMM y", "yMMMd": "dd/MM/y", "yMd": "d/M/yy" }, "timeFormats": { "hmmsszzzz": "h:mm:ss a zzzz", "hmsz": "h:mm:ss a z", "hms": "h:mm:ss a", "hm": "h:mm a" } }, "calendars": { "generic": { "months": { "narrow": [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ], "short": [ "M01", "M02", "M03", "M04", "M05", "M06", "M07", "M08", "M09", "M10", "M11", "M12" ], "long": [ "M01", "M02", "M03", "M04", "M05", "M06", "M07", "M08", "M09", "M10", "M11", "M12" ] }, "days": { "narrow": [ "र", "सो", "मं", "बु", "गु", "शु", "श" ], "short": [ "रवि", "सोम", "मंगल", "बुध", "गुरु", "शुक्र", "शनि" ], "long": [ "रविवार", "सोमवार", "मंगलवार", "बुधवार", "गुरुवार", "शुक्रवार", "शनिवार" ] }, "eras": { "narrow": [ "ERA0", "ERA1" ], "short": [ "ERA0", "ERA1" ], "long": [ "ERA0", "ERA1" ] }, "dayPeriods": { "am": "पूर्वाह्न", "pm": "अपराह्न" } }, "gregory": { "months": { "narrow": [ "ज", "फ़", "मा", "अ", "म", "जू", "जु", "अ", "सि", "अ", "न", "दि" ], "short": [ "जन॰", "फ़र॰", "मार्च", "अप्रैल", "मई", "जून", "जुल॰", "अग॰", "सित॰", "अक्तू॰", "नव॰", "दिस॰" ], "long": [ "जनवरी", "फ़रवरी", "मार्च", "अप्रैल", "मई", "जून", "जुलाई", "अगस्त", "सितंबर", "अक्तूबर", "नवंबर", "दिसंबर" ] }, "days": { "narrow": [ "र", "सो", "मं", "बु", "गु", "शु", "श" ], "short": [ "रवि", "सोम", "मंगल", "बुध", "गुरु", "शुक्र", "शनि" ], "long": [ "रविवार", "सोमवार", "मंगलवार", "बुधवार", "गुरुवार", "शुक्रवार", "शनिवार" ] }, "eras": { "narrow": [ "ईसा-पूर्व", "ईस्वी", "ईसवी पूर्व", "ईसवी" ], "short": [ "ईसा-पूर्व", "ईस्वी", "ईसवी पूर्व", "ईसवी" ], "long": [ "ईसा-पूर्व", "ईसवी सन", "ईसवी पूर्व", "ईसवी" ] }, "dayPeriods": { "am": "पूर्वाह्न", "pm": "अपराह्न" } } } }, "number": { "nu": [ "latn" ], "patterns": { "decimal": { "positivePattern": "{number}", "negativePattern": "{minusSign}{number}" }, "currency": { "positivePattern": "{currency}{number}", "negativePattern": "{minusSign}{currency}{number}" }, "percent": { "positivePattern": "{number}{percentSign}", "negativePattern": "{minusSign}{number}{percentSign}" }, "secondaryGroupSize": 2 }, "symbols": { "deva": { "decimal": ".", "group": ",", "nan": "NaN", "plusSign": "+", "minusSign": "-", "percentSign": "%", "infinity": "∞" }, "latn": { "decimal": ".", "group": ",", "nan": "NaN", "plusSign": "+", "minusSign": "-", "percentSign": "%", "infinity": "∞" } }, "currencies": { "AUD": "A$", "BRL": "R$", "CAD": "CA$", "CNY": "CN¥", "EUR": "€", "GBP": "£", "HKD": "HK$", "ILS": "₪", "INR": "₹", "JPY": "JP¥", "KRW": "₩", "MXN": "MX$", "NZD": "NZ$", "THB": "฿", "TWD": "NT$", "USD": "$", "VND": "₫", "XAF": "FCFA", "XCD": "EC$", "XOF": "CFA", "XPF": "CFPF" } } }
{ "pile_set_name": "Github" }
// Copyright (c) Microsoft Corporation // Licensed under the MIT license. See LICENSE file in the project root for full license information. #pragma once #include "system_internal.h" #include "xsapi/multiplayer.h" namespace xbox { namespace services { namespace tournaments { class tournament_team_result; }}} namespace xbox { namespace services { namespace multiplayer { class multiplayer_invite_handle_post_request { public: /// <summary> /// Internal function /// </summary> multiplayer_invite_handle_post_request(); /// <summary> /// Internal function /// </summary> multiplayer_invite_handle_post_request( _In_ multiplayer_session_reference sessionReference, _In_ uint32_t version, _In_ string_t invitedXboxUserId, _In_ uint32_t titleId, _In_ string_t contextString, _In_ string_t customActivationContext ); /// <summary> /// Internal function /// </summary> const multiplayer_session_reference& session_reference() const; /// <summary> /// Internal function /// </summary> uint32_t version() const; /// <summary> /// Internal function /// </summary> const string_t& invited_xbox_user_id() const; /// <summary> /// Internal function /// </summary> uint32_t title_id() const; /// <summary> /// Internal function /// </summary> const string_t& context_string() const; /// <summary> /// Internal function /// </summary> const string_t& custom_activation_context() const; /// <summary> /// Internal function /// </summary> web::json::value serialize() const; private: multiplayer_session_reference m_sessionReference; uint32_t m_version; string_t m_invitedXboxUserId; uint32_t m_titleId; string_t m_contextString; string_t m_customActivationContext; }; class multiplayer_subscription : public xbox::services::real_time_activity::real_time_activity_subscription { public: multiplayer_subscription( _In_ const std::function<void(const multiplayer_session_change_event_args&)>& multiplayerSessionChangeHandler, _In_ const std::function<void()>& multiplayerSubscriptionLostHandler, _In_ const std::function<void(const xbox::services::real_time_activity::real_time_activity_subscription_error_event_args&)>& subscriptionErrorHandler ); void _Set_state(_In_ xbox::services::real_time_activity::real_time_activity_subscription_state newState) override; const string_t& rta_connection_id() const; pplx::task_completion_event<xbox_live_result<string_t>> task; protected: void on_subscription_created(_In_ uint32_t id, _In_ const web::json::value& data) override; void on_event_received(_In_ const web::json::value& data) override; private: string_t m_mpConnectionId; std::function<void(const multiplayer_session_change_event_args&)> m_multiplayerSessionChangeHandler; std::function<void()> m_multiplayerSubscriptionLostHandler; }; class multiplayer_activity_query_post_request { public: multiplayer_activity_query_post_request(); multiplayer_activity_query_post_request(_In_ string_t scid, _In_ std::vector<string_t> xuids); multiplayer_activity_query_post_request(_In_ string_t scid, _In_ string_t socialGroup, _In_ string_t socialGroupXuid); const string_t& scid() const; const std::vector<string_t>& xuids() const; const string_t& social_group() const; const string_t& social_group_xuid() const; web::json::value serialize(); private: string_t m_scid; std::vector<string_t> m_xuids; string_t m_socialGroupXuid; string_t m_socialGroup; }; class multiplayer_session_member_request { public: multiplayer_session_member_request(); multiplayer_session_member_request( _In_ bool writeRequest, _In_ string_t memberId, _In_ string_t xboxUserId, _In_ web::json::value memberConstants, _In_ bool addInitializePropertyToRequest, _In_ bool initializeRequested ); bool write_request() const; bool write_constants() const; const string_t& member_id() const; const web::json::value& custom_constants() const; const web::json::value& custom_properties() const; void set_custom_properties(_In_ web::json::value customProperties); std::error_code set_custom_properties_property( _In_ string_t name, _In_ web::json::value customProperty ); const string_t& xbox_user_id() const; bool is_active() const; void set_is_active(_In_ bool isActive); bool write_is_active() const; void set_write_is_active(_In_ bool writeIsActive); const string_t& service_device_address_base64() const; void set_secure_device_address_base64(_In_ string_t deviceAddress); void set_role_info(_In_ const std::unordered_map<string_t, string_t>& roles); bool write_secure_device_address_base64() const; void set_write_secure_device_address_base64(_In_ bool shouldWrite); bool does_initialized_requested_exist() const; bool initialize_requested() const; const web::json::value& member_measurements_json() const; void set_member_measurements_json(_In_ web::json::value memberMeasurements); bool write_member_measurements_json() const; void set_write_member_measurements_json(_In_ bool shouldWrite); const web::json::value& member_server_measurements_json() const; void set_member_server_measurements_json(_In_ web::json::value json); bool write_member_server_measurements_json() const; void set_write_member_server_measurements_json(_In_ bool shouldWrite); std::vector<uint32_t> members_in_group() const; void set_members_in_group(_In_ std::vector<uint32_t> membersInGroup); bool write_members_in_group() const; void set_write_members_in_group(_In_ bool writeMembersInGroup); const std::vector<string_t>& groups() const; void set_groups(_In_ std::vector<string_t> groups); const std::vector<string_t>& encounters() const; void set_encounters(_In_ std::vector<string_t> encounters); bool write_subscribed_change_types() const; void set_write_subscribed_change_types(_In_ bool shouldWrite); multiplayer_session_change_types subscribed_change_types() const; void set_subscribed_change_types(_In_ multiplayer_session_change_types changeTypes); const string_t& subscription_id() const; void set_subscription_id(_In_ string_t subscriptionId); const string_t& rta_connection_id() const; void set_rta_connection_id(_In_ string_t connectionId); const std::unordered_map<string_t, xbox::services::tournaments::tournament_team_result>& results() const; void set_result(_In_ const string_t& team, _In_ const xbox::services::tournaments::tournament_team_result& result); void set_results(_In_ const std::unordered_map<string_t, xbox::services::tournaments::tournament_team_result>& results); web::json::value serialize(); private: static std::vector<string_t> get_vector_view_for_change_types(_In_ multiplayer_session_change_types changeTypes); bool m_writeRequest; bool m_writeConstants; string_t m_memberId; web::json::value m_customConstants; web::json::value m_customProperties; string_t m_xboxUserId; bool m_writeIsActive; bool m_isActive; std::unordered_map<string_t, string_t> m_roles; bool m_writeRoleInfo; string_t m_serviceDeviceAddressBase64; bool m_writeSecureDeviceAddressBase64; bool m_addInitializePropertyToRequest; bool m_initializeRequested; bool m_writeMemberMeasurementsJson; web::json::value m_memberMeasurementsJson; bool m_writeMemberServerMeasurementsJson; web::json::value m_memberServerMeasurementsJson; bool m_writeMembersInGroup; std::vector<uint32_t> m_membersInGroup; std::vector<string_t> m_groups; std::vector<string_t> m_encounters; bool m_writeSubscribedChangeType; multiplayer_session_change_types m_changeTypes; string_t m_subscriptionId; string_t m_rtaConnectionId; std::unordered_map<string_t, xbox::services::tournaments::tournament_team_result> m_results; }; /// <summary> /// Represents a reference to member in a multiplayer session. /// </summary> class multiplayer_session_request { public: multiplayer_session_request(); multiplayer_session_request( _In_opt_ std::shared_ptr<multiplayer_session_constants> multiplayerSessionConstants ); std::shared_ptr<multiplayer_session_request> create_deep_copy(); std::shared_ptr<multiplayer_session_member_request> add_member_request( _In_ bool writeRequest, _In_ bool isMe, _In_ string_t xboxUserId, _In_ web::json::value memberConstants, _In_ bool addInitializePropertyToRequest, _In_ bool initializedRequested ); void leave_session(); void set_leave_session(_In_ bool leaveSession); const multiplayer_session_reference& session_reference() const; void set_session_reference(_In_ multiplayer_session_reference sessionReference); std::shared_ptr<multiplayer_session_constants> session_constants() const; void set_session_constants(_In_ std::shared_ptr<multiplayer_session_constants> sessionConstants); const std::vector<string_t>& session_properties_keywords() const; void set_session_properties_keywords(_In_ std::vector<string_t> keywords); const std::vector<uint32_t>& session_properties_turns() const; void set_session_properties_turns(_In_ std::vector<uint32_t> sessionProperties); multiplayer_session_restriction join_restriction() const; void set_join_restriction(_In_ multiplayer_session_restriction joinRestriction); multiplayer_session_restriction read_restriction() const; void set_read_restriction(_In_ multiplayer_session_restriction readRestriction); const web::json::value& session_properties_custom_properties() const; void set_session_custom_properties(_In_ web::json::value sessionCustomProperties); bool write_matchmaking_client_result() const; void set_write_matchmaking_client_result(_In_ bool writeMatchmakingClientResult); bool write_matchmaking_session_constants() const; void set_write_matchmaking_session_constants(_In_ bool matchmakingSessionConstant); const web::json::value& session_properties_target_sessions_constants() const; void set_session_properties_target_sessions_constants(_In_ web::json::value targetSessionsConstants); bool write_initialization_status() const; void set_write_initialization_status(_In_ bool status); bool initialization_succeeded() const; void set_initialization_succeeded(_In_ bool succeeded); bool write_host_device_token() const; void set_write_host_device_token(_In_ bool writeToken); const string_t& host_device_token() const; void set_host_device_token(_In_ string_t deviceToken); bool write_matchmaking_server_connection_path() const; void set_write_matchmaking_server_connection_path(_In_ bool writePath); const string_t& matchmaking_server_connection_path() const; void set_matchmaking_server_connection_path(_In_ string_t serverPath); bool write_matchmaking_resubmit() const; void set_write_matchmaking_resubmit(_In_ bool writeMatchmakingResubmit); bool matchmaking_match_resubmit() const; void set_matchmaking_match_resubmit(_In_ bool matchmakingResubmit); bool write_server_connection_string_candidates() const; void set_write_server_connection_string_candidates(_In_ bool writeCandidates); const std::vector<string_t>& server_connection_string_candidates() const; void set_server_connection_string_candidates(_In_ std::vector<string_t> candidates); const std::vector<std::shared_ptr<multiplayer_session_member_request>>& members() const; void set_members(_In_ std::vector<std::shared_ptr<multiplayer_session_member_request>> members); web::json::value servers() const; void set_servers(_In_ web::json::value servers); bool write_closed() const; void set_write_closed(_In_ bool writeClosed); bool closed() const; void set_closed(_In_ bool closed); bool write_locked() const; void set_write_locked(_In_ bool writeLocked); bool locked() const; void set_locked(_In_ bool locked); bool write_allocate_cloud_compute() const; void set_write_allocate_cloud_compute(_In_ bool writeAllocateCloudCompute); bool allocate_cloud_compute() const; void set_allocate_cloud_compute(_In_ bool allocateCloudCompute); void set_mutable_role_settings(_In_ const std::unordered_map<string_t, multiplayer_role_type>& roleTypes); web::json::value create_properties_json(); web::json::value create_matchmaking_json(); web::json::value create_role_types_json(); web::json::value serialize(); private: void deep_copy_from( _In_ const multiplayer_session_request& other ); multiplayer_session_reference m_sessionReference; std::unordered_map<string_t, multiplayer_role_type> m_roleTypes; std::shared_ptr<multiplayer_session_constants> m_sessionConstants; multiplayer_session_member_request m_memberRequest; std::vector<string_t> m_sessionPropertiesKeywords; std::vector<uint32_t> m_sessionPropertiesTurns; multiplayer_session_restriction m_joinRestriction; multiplayer_session_restriction m_readRestriction; web::json::value m_sessionPropertiesCustomProperties; bool m_writeMatchmakingClientResult; bool m_writeMatchmakingSessionConstants; web::json::value m_sessionPropertiesTargetSessionsConstants; bool m_writeInitializationStatus; bool m_initializationSucceeded; bool m_writeHostDeviceToken; string_t m_hostDeviceToken; bool m_writeMatchmakingServerConnectionPath; string_t m_matchmakingServerConnectionPath; bool m_writeMatchmakingResubmit; bool m_matchmakingMatchResubmit; bool m_writeServerConnectionStringCandidates; std::vector<string_t> m_serverConnectionStringCandidates; std::vector<std::shared_ptr<multiplayer_session_member_request>> m_members; web::json::value m_servers; uint32_t m_memberRequestIndex; bool m_bLeaveSession; xbox::services::system::xbox_live_mutex m_lock; bool m_writeClosed; bool m_closed; bool m_writeLocked; bool m_locked; bool m_writeAllocateCloudCompute; bool m_allocateCloudCompute; }; class multiplayer_invite { public: multiplayer_invite(); const string_t& handle_id() const; static xbox_live_result<multiplayer_invite> deserialize(_In_ const web::json::value& inputJson); private: string_t m_handleId; }; class multiplayer_activity_handle_post_request { public: multiplayer_activity_handle_post_request(); multiplayer_activity_handle_post_request(_In_ multiplayer_session_reference sessionReference, _In_ uint32_t version); const multiplayer_session_reference& session_reference() const; uint32_t version() const; web::json::value serialize() const; private: multiplayer_session_reference m_sessionReference; uint32_t m_version; }; class multiplayer_transfer_handle_post_request { public: multiplayer_transfer_handle_post_request(); multiplayer_transfer_handle_post_request( _In_ multiplayer_session_reference targetSessionReference, _In_ multiplayer_session_reference originSessionReference, _In_ uint32_t version ); const multiplayer_session_reference& origin_session_reference() const; const multiplayer_session_reference& target_session_reference() const; uint32_t version() const; web::json::value serialize() const; private: multiplayer_session_reference m_originSessionReference; multiplayer_session_reference m_targetSessionReference; uint32_t m_version; }; class multiplayer_service_impl : public std::enable_shared_from_this<multiplayer_service_impl> { public: multiplayer_service_impl( _In_ std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> rtaService ); void multiplayer_session_changed(_In_ const multiplayer_session_change_event_args& eventArgs); void multiplayer_subscription_lost(); pplx::task<xbox_live_result<string_t>> ensure_multiplayer_subscription(); std::error_code enable_multiplayer_subscriptions(); void disable_multiplayer_subscriptions(); bool subscriptions_enabled(); function_context add_multiplayer_session_changed_handler(_In_ std::function<void(const multiplayer_session_change_event_args&)> handler); void remove_multiplayer_session_changed_handler(_In_ function_context context); function_context add_multiplayer_subscription_lost_handler(_In_ std::function<void()> handler); void remove_multiplayer_subscription_lost_handler(_In_ function_context context); ~multiplayer_service_impl(); private: std::shared_ptr<real_time_activity::real_time_activity_service> m_realTimeActivityService; std::shared_ptr<multiplayer_subscription> m_subscription; std::unordered_map<uint32_t, std::function<void(const multiplayer_session_change_event_args&)>> m_sessionChangeEventHandler; std::unordered_map<uint32_t, std::function<void()>> m_multiplayerSubscriptionLostEventHandler; function_context m_sessionChangeEventHandlerCounter; function_context m_multiplayerSubscriptionLostEventHandlerCounter; bool m_subscriptionEnabled; xbox::services::system::xbox_live_mutex m_subscriptionEnabledLock; xbox::services::system::xbox_live_mutex m_subscriptionLock; function_context m_multiplayerJoinabilityChangeCounter; }; }}}
{ "pile_set_name": "Github" }
;(function(window) { 'use strict'; var angular = window.angular; angular .module('tuchong-daily') .service('share', [ '$ionicLoading', '$ionicActionSheet', share ]); function share($ionicLoading, $ionicActionSheet) { this.popup = showPopup; function showPopup(image, post) { var sheet = {}; sheet.titleText = '与朋友们分享好图'; sheet.cancelText = '算了'; sheet.buttonClicked = buttonClicked; sheet.buttons = [{ text: '<i class="icon ion-at"></i> 分享给微信小伙伴' }, { text: '<i class="icon ion-chatbubbles"></i> 分享到微信朋友圈' }, { text: '<i class="icon ion-star"></i> 添加到微信收藏夹' }]; $ionicActionSheet.show(sheet); function buttonClicked(index) { if (!window.Wechat) return; var title = post.title; var thumbnail = image || null; var description = post.site && post.site.description ? post.site.description : ''; if (thumbnail && thumbnail.excerpt) title += (' - ' + thumbnail.excerpt); if (post && post.author && post.author.name) title += (' @' + post.author.name); description += ' 图虫日报,精选每日图虫热门图片。' Wechat.share({ message: { title: title, description: description, thumb: thumbnail ? thumbnail.uri_grid + '.jpg': 'http://ww2.sinaimg.cn/large/61ff0de3gw1emj19ju7p4j2030030745.jpg' , media: { type: Wechat.Type.WEBPAGE, webpageUrl: post.url } }, scene: index }); } } } })(this);
{ "pile_set_name": "Github" }
package com.github.zxh0.luago.vm; import com.github.zxh0.luago.api.LuaVM; @FunctionalInterface public interface OpAction { void execute(int i, LuaVM vm); }
{ "pile_set_name": "Github" }
--- title: New York Department of Sanitation Monthly Tonnage homepage: https://data.cityofnewyork.us/City-Government/DSNY-Monthly-Tonnage-Data/ebb7-mvp5 category: Government description: "DSNY Monthly Tonnage Data provides monthly collection tonnages that the Department of Sanitation collects from NYC residences and institutions. For more information about DSNY services, see: http://www1.nyc.gov/assets/dsny/site/services. Please note that in the face of economic hardship, and to ensure the City can continue to devote resources to essential safety, health, shelter, and food security needs, the New York City Department of Sanitation announced the suspension of the curbside composting program, beginning May 4, 2020. During the suspension, any food scraps and yard waste set out for composting will be collected as trash. The suspension is currently planned through June 30, 2021." keywords: sanitation temporal: access_level: public copyrights: accrual_periodicity: specification: data_quality: false data_dictionary: language: en publisher: - name: web: organization: - name: web: sources: - name: access_url: references: - title: reference:
{ "pile_set_name": "Github" }
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "bytes" "io" "io/ioutil" "golang.org/x/crypto/openpgp/errors" ) // OpaquePacket represents an OpenPGP packet as raw, unparsed data. This is // useful for splitting and storing the original packet contents separately, // handling unsupported packet types or accessing parts of the packet not yet // implemented by this package. type OpaquePacket struct { // Packet type Tag uint8 // Reason why the packet was parsed opaquely Reason error // Binary contents of the packet data Contents []byte } func (op *OpaquePacket) parse(r io.Reader) (err error) { op.Contents, err = ioutil.ReadAll(r) return } // Serialize marshals the packet to a writer in its original form, including // the packet header. func (op *OpaquePacket) Serialize(w io.Writer) (err error) { err = serializeHeader(w, packetType(op.Tag), len(op.Contents)) if err == nil { _, err = w.Write(op.Contents) } return } // Parse attempts to parse the opaque contents into a structure supported by // this package. If the packet is not known then the result will be another // OpaquePacket. func (op *OpaquePacket) Parse() (p Packet, err error) { hdr := bytes.NewBuffer(nil) err = serializeHeader(hdr, packetType(op.Tag), len(op.Contents)) if err != nil { op.Reason = err return op, err } p, err = Read(io.MultiReader(hdr, bytes.NewBuffer(op.Contents))) if err != nil { op.Reason = err p = op } return } // OpaqueReader reads OpaquePackets from an io.Reader. type OpaqueReader struct { r io.Reader } func NewOpaqueReader(r io.Reader) *OpaqueReader { return &OpaqueReader{r: r} } // Read the next OpaquePacket. func (or *OpaqueReader) Next() (op *OpaquePacket, err error) { tag, _, contents, err := readHeader(or.r) if err != nil { return } op = &OpaquePacket{Tag: uint8(tag), Reason: err} err = op.parse(contents) if err != nil { consumeAll(contents) } return } // OpaqueSubpacket represents an unparsed OpenPGP subpacket, // as found in signature and user attribute packets. type OpaqueSubpacket struct { SubType uint8 Contents []byte } // OpaqueSubpackets extracts opaque, unparsed OpenPGP subpackets from // their byte representation. func OpaqueSubpackets(contents []byte) (result []*OpaqueSubpacket, err error) { var ( subHeaderLen int subPacket *OpaqueSubpacket ) for len(contents) > 0 { subHeaderLen, subPacket, err = nextSubpacket(contents) if err != nil { break } result = append(result, subPacket) contents = contents[subHeaderLen+len(subPacket.Contents):] } return } func nextSubpacket(contents []byte) (subHeaderLen int, subPacket *OpaqueSubpacket, err error) { // RFC 4880, section 5.2.3.1 var subLen uint32 if len(contents) < 1 { goto Truncated } subPacket = &OpaqueSubpacket{} switch { case contents[0] < 192: subHeaderLen = 2 // 1 length byte, 1 subtype byte if len(contents) < subHeaderLen { goto Truncated } subLen = uint32(contents[0]) contents = contents[1:] case contents[0] < 255: subHeaderLen = 3 // 2 length bytes, 1 subtype if len(contents) < subHeaderLen { goto Truncated } subLen = uint32(contents[0]-192)<<8 + uint32(contents[1]) + 192 contents = contents[2:] default: subHeaderLen = 6 // 5 length bytes, 1 subtype if len(contents) < subHeaderLen { goto Truncated } subLen = uint32(contents[1])<<24 | uint32(contents[2])<<16 | uint32(contents[3])<<8 | uint32(contents[4]) contents = contents[5:] } if subLen > uint32(len(contents)) || subLen == 0 { goto Truncated } subPacket.SubType = contents[0] subPacket.Contents = contents[1:subLen] return Truncated: err = errors.StructuralError("subpacket truncated") return } func (osp *OpaqueSubpacket) Serialize(w io.Writer) (err error) { buf := make([]byte, 6) n := serializeSubpacketLength(buf, len(osp.Contents)+1) buf[n] = osp.SubType if _, err = w.Write(buf[:n+1]); err != nil { return } _, err = w.Write(osp.Contents) return }
{ "pile_set_name": "Github" }
<?php namespace Faker\Provider\nl_BE; class Address extends \Faker\Provider\Address { protected static $postcodes = array( '2970', '3700', '7510', '9420', '8511', '3800', '9300', '9880', '3200', '8700', '8211', '2630', '4557', '4280', '3930', '5590', '5362', '4219', '6280', '9991', '8660', '1790', '9051', '5544', '4317', '5310', '6250', '5070', '3570', '5550', '4432', '1652', '8690', '4540', '6680', '6953', '4770', '6997', '7750', '5300', '1070', '6150', '4821', '4031', '7387', '5537', '6721', '6890', '4430', '5500', '5520', '4520', '4160', '7640', '2000', '2018', '2020', '2030', '2040', '2050', '2060', '2099', '7910', '8570', '9200', '9400', '5170', '7811', '4990', '1390', '8850', '2370', '4601', '6700', '7181', '5060', '6870', '3665', '9404', '9890', '7040', '1730', '8310', '1007', '9960', '6860', '3460', '5330', '9800', '7800', '6791', '3404', '3384', '6717', '7941', '6790', '7972', '4880', '5660', '6880', '7382', '6706', '1367', '5580', '8630', '8580', '4260', '3271', '4340', '4400', '6900', '4630', '4920', '3128', '9310', '2387', '4837', '6464', '6460', '5555', '7730', '5377', '7380', '1470', '5190', '9860', '2490', '6951', '6500', '4671', '5570', '7534', '5370', '6940', '7971', '4983', '4690', '9968', '7830', '6600', '3870', '4651', '7130', '7331', '7870', '7604', '1401', '9520', '8531', '9150', '4052', '6980', '1320', '6594', '7532', '3960', ); protected static $streetAddressFormats = array( '{{streetName}} {{buildingNumber}}' ); protected static $streetNameFormats = array('{{lastName}}{{streetSuffix}}'); protected static $cityFormats = array('{{cityName}}'); protected static $addressFormats = array( "{{streetAddress}}\n {{postcode}} {{city}}", ); protected static $streetSuffix = array( 'baan', 'boulevard', 'dreef', 'hof', 'laan', 'pad', 'ring', 'singel', 'steeg', 'straat', 'weg', ); /** * Export of BAG (http://bag.vrom.nl/) * last updated 2012/11/09 * * @var array */ protected static $cityNames = array( 'Aalst', 'Aarlen', 'Aarschot', 'Aat', 'Andenne', 'Antoing', 'Antwerpen', 'Bastenaken', 'Beringen', 'Beaumont', 'Beauraing', 'Bergen', 'Bilzen', 'Binche', 'Blankenberge', 'Borgloon', 'Borgworm', 'Bouillon', 'Bree', 'Brugge', 'Brussel', 'Charleroi', 'Châtelet', 'Chièvres', 'Chimay', 'Chiny', 'Ciney', 'Couvin', 'Damme', 'Deinze', 'Dendermonde', 'Diest', 'Diksmuide', 'Dilsen-Stokkem', 'Dinant', 'Doornik', 'Durbuy', 'Edingen', 'Eeklo', 'Eupen', 'Fleurus', 'Florenville', 'Fontaine-l\'Evêque', 'Fosses-la-Ville', 'Geel', 'Geldenaken', 'Gembloers', 'Genepiën', 'Genk', 'Gent', 'Geraardsbergen', 'Gistel', '\'s-Gravenbrakel', 'Halen', 'Halle', 'Hamont-Achel', 'Hannuit', 'Harelbeke', 'Hasselt', 'Herentals', 'Herk-de-Stad', 'Herstal', 'Herve', 'Hoei', 'Hoogstraten', 'Houffalize', 'Ieper', 'Izegem', 'Komen-Waasten', 'Kortrijk', 'La Louvière', 'La Roche-en-Ardenne', 'Landen', 'Le Rœulx', 'Lessen', 'Leuze-en-Hainaut', 'Leuven', 'Lier', 'Limburg', 'Lo-Reninge', 'Lokeren', 'Lommel', 'Luik', 'Maaseik', 'Malmedy', 'Marche-en-Famenne', 'Mechelen', 'Menen', 'Mesen', 'Moeskroen', 'Mortsel', 'Namen', 'Neufchâteau', 'Nieuwpoort', 'Nijvel', 'Ninove', 'Oostende', 'Ottignies', 'Oudenaarde', 'Oudenburg', 'Peer', 'Péruwelz', 'Philippeville', 'Poperinge', 'Rochefort', 'Roeselare', 'Ronse', 'Saint-Ghislain', 'Saint-Hubert', 'Sankt Vith', 'Scherpenheuvel-Zichem', 'Seraing', 'Sint-Niklaas', 'Sint-Truiden', 'Spa', 'Stavelot', 'Thuin', 'Tielt', 'Tienen', 'Tongeren', 'Torhout', 'Turnhout', 'Verviers', 'Veurne', 'Vilvoorde', 'Virton', 'Walcourt', 'Waregem', 'Waver', 'Wervik', 'Wezet', 'Zinnik', 'Zottegem', 'Zoutleeuw' ); protected static $state = array( 'Antwerpen', 'Limburg', 'Oost-Vlaanderen', 'Vlaams-Brabant', 'West-Vlaanderen', 'Henegouwen', 'Luik', 'Luxemburg', 'Namen', 'Waals-Brabant' ); protected static $country = array( 'Afghanistan', 'Albanië', 'Algerije', 'Amerikaans-Samoa', 'Andorra', 'Angola', 'Amerikaanse Virgineilanden', 'Anguilla', 'Antartica', 'Antigua en Barbuda', 'Argentinië', 'Armenië', 'Aruba', 'Australië', 'Azerbeidzjan', 'Bahamas', 'Bahrein', 'Bangladesh', 'Barbados', 'België', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnië-Herzegovina', 'Botswana', 'Bouvet Eiland (Bouvetoya)', 'Brazilië', 'Britse Maagdeneilanden', 'Brunei Darussalam', 'Bulgarije', 'Burkina Faso', 'Burundi', 'Cambodja', 'Canada', 'Centraal-Afrikaanse Republiek', 'Chili', 'China', 'Christmaseiland', 'Cocoseilanden', 'Colombia', 'Comoren', 'Congo', 'Cookeilanden', 'Costa Rica', 'Cuba', 'Cyprus', 'Denemarken', 'Djibouti', 'Dominica', 'Dominicaanse Republiek', 'Duitsland', 'Ecuador', 'Egypte', 'El salvador', 'Equatoriaal-Guinea', 'Eritrea', 'Estland', 'Ethiopië', 'Faroe Eilanden', 'Falklandeilanden', 'Fiji', 'Finland', 'Frankrijk', 'Frans-Guyana', 'Frans-Polynesië', 'Franse Zuidelijke en Antarctische Gebieden', 'Gabon', 'Gambia', 'Georgië', 'Ghana', 'Gibraltar', 'Griekenland', 'Groenland', 'Grenada', 'Guadeloupe', 'Guam', 'Guatemala', 'Guernsey', 'Guinee', 'Guinee-Bissau', 'Guyana', 'Haïti', 'Heard en McDonaldeilanden', 'Honduras', 'Hong Kong', 'Hongarije', 'IJsland', 'India', 'Indonesië', 'Iran', 'Irak', 'Ierland', 'Man', 'Israel', 'Ivoorkust', 'Italië', 'Jamaica', 'Japan', 'Jersey', 'Jordanië', 'Jemen', 'Kazachstan', 'Kenia', 'Kleinere afgelegen eilanden van de Verenigde staten', 'Kiribati', 'Korea', 'Koeweit', 'Kirgizië', 'Kameroen', 'Kaapverdië', 'Kaaimaneilanden', 'Kroatië', 'Laos', 'Letland', 'Libanon', 'Lesotho', 'Liberia', 'Libië', 'Liechtenstein', 'Litouwen', 'Luxemburg', 'Macau', 'Macedonië', 'Madagascar', 'Malawi', 'Maleisië', 'Maldiven', 'Mali', 'Malta', 'Marshalleilanden', 'Martinique', 'Mauritus', 'Mauritania', 'Mayotte', 'Mexico', 'Micronesië', 'Moldavië', 'Monaco', 'Mongolië', 'Montenegro', 'Monsterrat', 'Marokko', 'Mozambique', 'Myanmar', 'Namibië', 'Nauru', 'Nepal', 'Nederlandse Antillen', 'Nederland', 'Nieuw-Caledonië', 'Nieuw-Zeeland', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Norfolk', 'Noordelijke Marianen', 'Noorwegen', 'Oman', 'Oostenrijk', 'Oeganda', 'Oekraïne', 'Oezbakistan', 'Pakistan', 'Palau', 'Palestina', 'Panama', 'Papoea-Nieuw-Guinea', 'Paraguay', 'Peru', 'Filipijnen', 'Pitcairneilanden', 'Polen', 'Portugal', 'Puerto Rico', 'Qatar', 'Réunion', 'Roemenië', 'Rusland', 'Rwanda', 'Rwanda', 'Sint-Bartholomeus', 'Sint-Helena', 'Saint Kitts en Nevis', 'Saint Lucia', 'Sint Maarten', 'Saint-Pierre en Miquelon', 'Saint Vincent en de Grenadines', 'Samoa', 'San Marino', 'Sao Toma en Principe', 'Saoedi-Arabië', 'Senegal', 'Servië', 'Seychellen', 'Sierra Leone', 'Singapore', 'Slovenië', 'Salomonseilanden', 'Somalië', 'Spanje', 'Sri Lanka', 'Soedan', 'Suriname', 'Spitsbergen en Jan Mayen', 'Swaziland', 'Zweden', 'Zwitserland', 'Syrië', 'Taiwan', 'Tadzjikistan', 'Tanzania', 'Thailand', 'Tsjaad', 'Timor-Leste', 'Togo', 'Tokelau-eilanden', 'Tonga', 'Trinidad en Trobago', 'Tunesië', 'Turkije', 'Turkmenistan', 'Turks- en Caicoseilanden', 'Tuvalu', 'Tsjechische Republiek', 'Uruguay', 'Vanuatu', 'Venezuela', 'Verenigde Arabische Emiraten', 'Verenigd Koninkrijk', 'Verenigde Staten van Amerika', 'Vaticaanstad', 'Vietnam', 'Wallis en Futuna', 'Westerlijke Shara', 'Wit-Rusland', 'Zambia', 'Zuid-Afrika', 'Zuid-Georgia en de Zuidelijke Sandwicheilanden', 'Zimbabwe' ); public static function postcode() { return static::randomElement(static::$postcodes); } /** * @example 'Gelderland' */ public static function state() { return static::randomElement(static::$state); } /** * @see parent */ public function cityName() { return static::randomElement(static::$cityNames); } }
{ "pile_set_name": "Github" }
define([ 'jquery', './utils' ], function ($, CompatUtils) { // No-op CSS adapter that discards all classes by default function _containerAdapter (clazz) { return null; } function ContainerCSS () { } ContainerCSS.prototype.render = function (decorated) { var $container = decorated.call(this); var containerCssClass = this.options.get('containerCssClass') || ''; if ($.isFunction(containerCssClass)) { containerCssClass = containerCssClass(this.$element); } var containerCssAdapter = this.options.get('adaptContainerCssClass'); containerCssAdapter = containerCssAdapter || _containerAdapter; if (containerCssClass.indexOf(':all:') !== -1) { containerCssClass = containerCssClass.replace(':all:', ''); var _cssAdapter = containerCssAdapter; containerCssAdapter = function (clazz) { var adapted = _cssAdapter(clazz); if (adapted != null) { // Append the old one along with the adapted one return adapted + ' ' + clazz; } return clazz; }; } var containerCss = this.options.get('containerCss') || {}; if ($.isFunction(containerCss)) { containerCss = containerCss(this.$element); } CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter); $container.css(containerCss); $container.addClass(containerCssClass); return $container; }; return ContainerCSS; });
{ "pile_set_name": "Github" }
# RUN: clangd -input-style=delimited -sync < %s 2>&1 | FileCheck %s # RUN: clangd -lit-test -sync < %s 2>&1 | FileCheck %s # {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}} --- {"jsonrpc":"2.0","id":3,"method":"shutdown"} --- {"jsonrpc":"2.0","method":"exit"} # CHECK-NOT: JSON parse error
{ "pile_set_name": "Github" }
package com.googlecode.objectify; /** * Just like the EJB options. See http://docs.oracle.com/javaee/6/api/javax/ejb/TransactionAttributeType.html * * @author Jeff Schnitzer <[email protected]> */ public enum TxnType { /** Require that there must already be a transaction running. If no transaction, throw an IllegalStateException. */ MANDATORY, /** Require that there must NOT be a transaction running. If there is, throw an IllegalStateException. */ NEVER, /** Execute the work without a transaction, pausing an existing transaction if there is one. */ NOT_SUPPORTED, /** Use the existing transaction (if present), or start a new transaction if not. */ REQUIRED, /** Start a new transaction, pausing the old one. */ REQUIRES_NEW, /** Inherits previous transaction state. */ SUPPORTS; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_project_file> <FileVersion major="1" minor="6" /> <Project> <Option title="udis86" /> <Option pch_mode="2" /> <Option compiler="gcc" /> <Build> <Target title="Release"> <Option platforms="Unix;" /> <Option output="bin/Release/udis86" prefix_auto="1" extension_auto="1" /> <Option working_dir="" /> <Option object_output="obj/Release/" /> <Option type="2" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Compiler> <Add option="-O3" /> <Add option="-Wall" /> </Compiler> <Linker> <Add option="-s" /> </Linker> </Target> <Target title="Debug"> <Option platforms="Unix;" /> <Option output="bin/Debug/udis86" prefix_auto="1" extension_auto="1" /> <Option working_dir="" /> <Option object_output="obj/Debug/" /> <Option type="2" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Compiler> <Add option="-Wall" /> <Add option="-g" /> </Compiler> </Target> <Target title="Win32 Release"> <Option platforms="Windows;" /> <Option output="bin/Release/udis86" prefix_auto="1" extension_auto="1" /> <Option working_dir="" /> <Option object_output="obj/Release/" /> <Option type="2" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Compiler> <Add option="-O3" /> <Add option="-Wall" /> </Compiler> <Linker> <Add option="-s" /> </Linker> </Target> <Target title="Win32 Debug"> <Option platforms="Windows;" /> <Option output="bin/Debug/udis86" prefix_auto="1" extension_auto="1" /> <Option working_dir="" /> <Option object_output="obj/Debug/" /> <Option type="2" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Compiler> <Add option="-Wall" /> <Add option="-g" /> </Compiler> </Target> <Target title="MacOS Release"> <Option platforms="Mac;" /> <Option output="bin/Release/udis86" prefix_auto="1" extension_auto="1" /> <Option working_dir="" /> <Option object_output="obj/Release/" /> <Option type="2" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Compiler> <Add option="-O3" /> <Add option="-Wall" /> <Add option="-arch i386" /> <Add option="-arch x86_64" /> </Compiler> <Linker> <Add option="-s" /> </Linker> </Target> <Target title="MacOS Debug"> <Option platforms="Mac;" /> <Option output="bin/Debug/udis86" prefix_auto="1" extension_auto="1" /> <Option working_dir="" /> <Option object_output="obj/Debug/" /> <Option type="2" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Compiler> <Add option="-Wall" /> <Add option="-g" /> <Add option="-arch i386" /> <Add option="-arch x86_64" /> </Compiler> </Target> </Build> <Unit filename="libudis86/decode.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="libudis86/decode.h"> <Option target="&lt;{~None~}&gt;" /> </Unit> <Unit filename="libudis86/extern.h"> <Option target="&lt;{~None~}&gt;" /> </Unit> <Unit filename="libudis86/itab.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="libudis86/itab.h"> <Option target="&lt;{~None~}&gt;" /> </Unit> <Unit filename="libudis86/syn-att.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="libudis86/syn-intel.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="libudis86/syn.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="libudis86/syn.h"> <Option target="&lt;{~None~}&gt;" /> </Unit> <Unit filename="libudis86/types.h"> <Option target="&lt;{~None~}&gt;" /> </Unit> <Unit filename="libudis86/udint.h"> <Option target="&lt;{~None~}&gt;" /> </Unit> <Unit filename="libudis86/udis86.c"> <Option compilerVar="CC" /> </Unit> <Extensions> <code_completion /> <debugger /> </Extensions> </Project> </CodeBlocks_project_file>
{ "pile_set_name": "Github" }
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2011 Gael Guennebaud <[email protected]> // Copyright (C) 2012, 2014 Kolja Brix <[email protected]> // // 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/. #ifndef EIGEN_GMRES_H #define EIGEN_GMRES_H namespace Eigen { namespace internal { /** * Generalized Minimal Residual Algorithm based on the * Arnoldi algorithm implemented with Householder reflections. * * Parameters: * \param mat matrix of linear system of equations * \param Rhs right hand side vector of linear system of equations * \param x on input: initial guess, on output: solution * \param precond preconditioner used * \param iters on input: maximum number of iterations to perform * on output: number of iterations performed * \param restart number of iterations for a restart * \param tol_error on input: relative residual tolerance * on output: residuum achieved * * \sa IterativeMethods::bicgstab() * * * For references, please see: * * Saad, Y. and Schultz, M. H. * GMRES: A Generalized Minimal Residual Algorithm for Solving Nonsymmetric Linear Systems. * SIAM J.Sci.Stat.Comp. 7, 1986, pp. 856 - 869. * * Saad, Y. * Iterative Methods for Sparse Linear Systems. * Society for Industrial and Applied Mathematics, Philadelphia, 2003. * * Walker, H. F. * Implementations of the GMRES method. * Comput.Phys.Comm. 53, 1989, pp. 311 - 320. * * Walker, H. F. * Implementation of the GMRES Method using Householder Transformations. * SIAM J.Sci.Stat.Comp. 9, 1988, pp. 152 - 163. * */ template<typename MatrixType, typename Rhs, typename Dest, typename Preconditioner> bool gmres(const MatrixType & mat, const Rhs & rhs, Dest & x, const Preconditioner & precond, Index &iters, const Index &restart, typename Dest::RealScalar & tol_error) { using std::sqrt; using std::abs; typedef typename Dest::RealScalar RealScalar; typedef typename Dest::Scalar Scalar; typedef Matrix < Scalar, Dynamic, 1 > VectorType; typedef Matrix < Scalar, Dynamic, Dynamic, ColMajor> FMatrixType; RealScalar tol = tol_error; const Index maxIters = iters; iters = 0; const Index m = mat.rows(); // residual and preconditioned residual VectorType p0 = rhs - mat*x; VectorType r0 = precond.solve(p0); const RealScalar r0Norm = r0.norm(); // is initial guess already good enough? if(r0Norm == 0) { tol_error = 0; return true; } // storage for Hessenberg matrix and Householder data FMatrixType H = FMatrixType::Zero(m, restart + 1); VectorType w = VectorType::Zero(restart + 1); VectorType tau = VectorType::Zero(restart + 1); // storage for Jacobi rotations std::vector < JacobiRotation < Scalar > > G(restart); // storage for temporaries VectorType t(m), v(m), workspace(m), x_new(m); // generate first Householder vector Ref<VectorType> H0_tail = H.col(0).tail(m - 1); RealScalar beta; r0.makeHouseholder(H0_tail, tau.coeffRef(0), beta); w(0) = Scalar(beta); for (Index k = 1; k <= restart; ++k) { ++iters; v = VectorType::Unit(m, k - 1); // apply Householder reflections H_{1} ... H_{k-1} to v // TODO: use a HouseholderSequence for (Index i = k - 1; i >= 0; --i) { v.tail(m - i).applyHouseholderOnTheLeft(H.col(i).tail(m - i - 1), tau.coeffRef(i), workspace.data()); } // apply matrix M to v: v = mat * v; t.noalias() = mat * v; v = precond.solve(t); // apply Householder reflections H_{k-1} ... H_{1} to v // TODO: use a HouseholderSequence for (Index i = 0; i < k; ++i) { v.tail(m - i).applyHouseholderOnTheLeft(H.col(i).tail(m - i - 1), tau.coeffRef(i), workspace.data()); } if (v.tail(m - k).norm() != 0.0) { if (k <= restart) { // generate new Householder vector Ref<VectorType> Hk_tail = H.col(k).tail(m - k - 1); v.tail(m - k).makeHouseholder(Hk_tail, tau.coeffRef(k), beta); // apply Householder reflection H_{k} to v v.tail(m - k).applyHouseholderOnTheLeft(Hk_tail, tau.coeffRef(k), workspace.data()); } } if (k > 1) { for (Index i = 0; i < k - 1; ++i) { // apply old Givens rotations to v v.applyOnTheLeft(i, i + 1, G[i].adjoint()); } } if (k<m && v(k) != (Scalar) 0) { // determine next Givens rotation G[k - 1].makeGivens(v(k - 1), v(k)); // apply Givens rotation to v and w v.applyOnTheLeft(k - 1, k, G[k - 1].adjoint()); w.applyOnTheLeft(k - 1, k, G[k - 1].adjoint()); } // insert coefficients into upper matrix triangle H.col(k-1).head(k) = v.head(k); tol_error = abs(w(k)) / r0Norm; bool stop = (k==m || tol_error < tol || iters == maxIters); if (stop || k == restart) { // solve upper triangular system Ref<VectorType> y = w.head(k); H.topLeftCorner(k, k).template triangularView <Upper>().solveInPlace(y); // use Horner-like scheme to calculate solution vector x_new.setZero(); for (Index i = k - 1; i >= 0; --i) { x_new(i) += y(i); // apply Householder reflection H_{i} to x_new x_new.tail(m - i).applyHouseholderOnTheLeft(H.col(i).tail(m - i - 1), tau.coeffRef(i), workspace.data()); } x += x_new; if(stop) { return true; } else { k=0; // reset data for restart p0.noalias() = rhs - mat*x; r0 = precond.solve(p0); // clear Hessenberg matrix and Householder data H.setZero(); w.setZero(); tau.setZero(); // generate first Householder vector r0.makeHouseholder(H0_tail, tau.coeffRef(0), beta); w(0) = Scalar(beta); } } } return false; } } template< typename _MatrixType, typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> > class GMRES; namespace internal { template< typename _MatrixType, typename _Preconditioner> struct traits<GMRES<_MatrixType,_Preconditioner> > { typedef _MatrixType MatrixType; typedef _Preconditioner Preconditioner; }; } /** \ingroup IterativeLinearSolvers_Module * \brief A GMRES solver for sparse square problems * * This class allows to solve for A.x = b sparse linear problems using a generalized minimal * residual method. The vectors x and b can be either dense or sparse. * * \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix. * \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner * * The maximal number of iterations and tolerance value can be controlled via the setMaxIterations() * and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations * and NumTraits<Scalar>::epsilon() for the tolerance. * * This class can be used as the direct solver classes. Here is a typical usage example: * \code * int n = 10000; * VectorXd x(n), b(n); * SparseMatrix<double> A(n,n); * // fill A and b * GMRES<SparseMatrix<double> > solver(A); * x = solver.solve(b); * std::cout << "#iterations: " << solver.iterations() << std::endl; * std::cout << "estimated error: " << solver.error() << std::endl; * // update b, and solve again * x = solver.solve(b); * \endcode * * By default the iterations start with x=0 as an initial guess of the solution. * One can control the start using the solveWithGuess() method. * * GMRES can also be used in a matrix-free context, see the following \link MatrixfreeSolverExample example \endlink. * * \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner */ template< typename _MatrixType, typename _Preconditioner> class GMRES : public IterativeSolverBase<GMRES<_MatrixType,_Preconditioner> > { typedef IterativeSolverBase<GMRES> Base; using Base::matrix; using Base::m_error; using Base::m_iterations; using Base::m_info; using Base::m_isInitialized; private: Index m_restart; public: using Base::_solve_impl; typedef _MatrixType MatrixType; typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; typedef _Preconditioner Preconditioner; public: /** Default constructor. */ GMRES() : Base(), m_restart(30) {} /** Initialize the solver with matrix \a A for further \c Ax=b solving. * * This constructor is a shortcut for the default constructor followed * by a call to compute(). * * \warning this class stores a reference to the matrix A as well as some * precomputed values that depend on it. Therefore, if \a A is changed * this class becomes invalid. Call compute() to update it with the new * matrix A, or modify a copy of A. */ template<typename MatrixDerived> explicit GMRES(const EigenBase<MatrixDerived>& A) : Base(A.derived()), m_restart(30) {} ~GMRES() {} /** Get the number of iterations after that a restart is performed. */ Index get_restart() { return m_restart; } /** Set the number of iterations after that a restart is performed. * \param restart number of iterations for a restarti, default is 30. */ void set_restart(const Index restart) { m_restart=restart; } /** \internal */ template<typename Rhs,typename Dest> void _solve_with_guess_impl(const Rhs& b, Dest& x) const { bool failed = false; for(Index j=0; j<b.cols(); ++j) { m_iterations = Base::maxIterations(); m_error = Base::m_tolerance; typename Dest::ColXpr xj(x,j); if(!internal::gmres(matrix(), b.col(j), xj, Base::m_preconditioner, m_iterations, m_restart, m_error)) failed = true; } m_info = failed ? NumericalIssue : m_error <= Base::m_tolerance ? Success : NoConvergence; m_isInitialized = true; } /** \internal */ template<typename Rhs,typename Dest> void _solve_impl(const Rhs& b, MatrixBase<Dest> &x) const { x = b; if(x.squaredNorm() == 0) return; // Check Zero right hand side _solve_with_guess_impl(b,x.derived()); } protected: }; } // end namespace Eigen #endif // EIGEN_GMRES_H
{ "pile_set_name": "Github" }
<?php namespace mageekguy\atoum\tests\units\writer\decorators; require_once __DIR__ . '/../../../runner.php'; use mageekguy\atoum; use mageekguy\atoum\writer\decorators\trim as testedClass; class trim extends atoum { public function testDecorate() { $this ->if($decorator = new testedClass()) ->then ->string($decorator->decorate($message = uniqid()))->isEqualTo($message) ->string($decorator->decorate(($message = uniqid()) . PHP_EOL))->isEqualTo($message) ->string($decorator->decorate(' ' . ($message = uniqid()) . PHP_EOL . PHP_EOL))->isEqualTo($message) ; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Qt 4.6: sym_iap_util.h Example File (network/qftp/sym_iap_util.h)</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">sym_iap_util.h Example File<br /><span class="small-subtitle">network/qftp/sym_iap_util.h</span> </h1> <pre><span class="comment"> /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation ([email protected]) ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at [email protected]. ** $QT_END_LICENSE$ ** ****************************************************************************/</span> #ifndef QSYM_IAP_UTIL_H #define QSYM_IAP_UTIL_H <span class="comment"> // Symbian</span> #include &lt;utf.h&gt; #include &lt;es_sock.h&gt; #include &lt;in_sock.h&gt; #include &lt;es_enum.h&gt; #include &lt;in_iface.h&gt; #include &lt;commdbconnpref.h&gt; #include &lt;e32cmn.h&gt; <span class="comment"> // OpenC</span> #include &lt;sys/socket.h&gt; #include &lt;net/if.h&gt; <span class="comment"> //Qt</span> #include &lt;QSettings&gt; #include &lt;QStringList&gt; <span class="comment"> //#include &lt;QTextCodec&gt;</span> _LIT(KIapNameSetting, &quot;IAP\\Name&quot;); <span class="comment">// text - mandatory</span> _LIT(KIapDialogPref, &quot;IAP\\DialogPref&quot;); <span class="comment">// TUnit32 - optional</span> _LIT(KIapService, &quot;IAP\\IAPService&quot;); <span class="comment">// TUnit32 - mandatory</span> _LIT(KIapServiceType, &quot;IAP\\IAPServiceType&quot;); <span class="comment">// text - mandatory</span> _LIT(KIapBearer, &quot;IAP\\IAPBearer&quot;); <span class="comment">// TUint32 - optional</span> _LIT(KIapBearerType, &quot;IAP\\IAPBearerType&quot;); <span class="comment">// text - optional</span> _LIT(KIapNetwork, &quot;IAP\\IAPNetwork&quot;); <span class="comment">// TUint32 - optional</span> const QLatin1String qtOrganizationTag(&quot;Trolltech&quot;); const QLatin1String qtNetworkModuleTag(&quot;QtNetwork&quot;); const QLatin1String iapGroupTag(&quot;IAP&quot;); const QLatin1String iapNamesArrayTag(&quot;Names&quot;); const QLatin1String iapNameItemTag(&quot;Name&quot;); static QTextCodec *utf16LETextCodec = 0; void clearIapNamesSettings(QSettings &amp;settings) { settings.beginGroup(qtNetworkModuleTag); settings.beginGroup(iapGroupTag); settings.remove(iapNamesArrayTag); settings.endGroup(); settings.endGroup(); } void writeIapNamesSettings(QSettings &amp;settings, const QStringList&amp; iapNames) { clearIapNamesSettings(settings); settings.beginGroup(qtNetworkModuleTag); settings.beginGroup(iapGroupTag); settings.beginWriteArray(iapNamesArrayTag); for (int index = 0; index &lt; iapNames.size(); ++index) { settings.setArrayIndex(index); settings.setValue(iapNameItemTag, iapNames.at(index)); } settings.endArray(); settings.endGroup(); settings.endGroup(); } void readIapNamesSettings(QSettings &amp;settings, QStringList&amp; iapNames) { settings.beginGroup(qtNetworkModuleTag); settings.beginGroup(iapGroupTag); int last = settings.beginReadArray(iapNamesArrayTag); for (int index = 0; index &lt; last; ++index) { settings.setArrayIndex(index); iapNames.append(settings.value(iapNameItemTag).toString()); } settings.endArray(); settings.endGroup(); settings.endGroup(); } static QString qt_TNameToQString(TName data) { if(utf16LETextCodec == 0) utf16LETextCodec = QTextCodec::codecForName(&quot;UTF-16LE&quot;); QByteArray tmpByteArray = QByteArray::fromRawData((char*)(data.PtrZ()), data.Length() * 2); return utf16LETextCodec-&gt;toUnicode(tmpByteArray); } static QString qt_InterfaceInfoL() { QString output; TBuf8&lt;512&gt; buffer; TBuf&lt;128&gt; t; TAutoClose&lt;RSocketServ&gt; ss; User::LeaveIfError(ss.iObj.Connect()); ss.PushL(); TAutoClose&lt;RSocket&gt; sock; User::LeaveIfError(sock.iObj.Open(ss.iObj, _L(&quot;udp&quot;))); sock.PushL(); User::LeaveIfError(sock.iObj.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl)); TProtocolDesc in; User::LeaveIfError(sock.iObj.Info(in)); printf(&quot;EPOC32 IP Configuration TCPIP Version %d.%d.%d\n&quot;, in.iVersion.iMajor, in.iVersion.iMinor, in.iVersion.iBuild); TPckgBuf&lt;TSoInetInterfaceInfo&gt; info, next; TInt res=sock.iObj.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, info); if(res!=KErrNone) User::Leave(res); TInt count = 0; while(res==KErrNone) { res=sock.iObj.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, next); if(info().iName != _L(&quot;&quot;) &amp;&amp; info().iName != _L(&quot;loop6&quot;) &amp;&amp; info().iName != _L(&quot;loop4&quot;)) { printf(&quot;Interface %d\n&quot;, count++); printf(&quot;Name \&quot;%s\&quot;\n&quot;, qt_TNameToQString(info().iName).toLatin1().data()); printf(&quot;NIF tag \&quot;%s\&quot;\n&quot;, qt_TNameToQString(info().iTag).toLatin1().data()); printf(&quot;State &quot;); switch (info().iState) { case EIfPending: printf(&quot;pending\n&quot;); break; case EIfUp: printf(&quot;up\n&quot;); break; case EIfBusy: printf(&quot;busy\n&quot;); break; default: printf(&quot;down\n&quot;); break; } printf(&quot;Mtu %d\n&quot;, info().iMtu); printf(&quot;Speed Metric %d\n&quot;, info().iSpeedMetric); printf(&quot;Features:&quot;); info().iFeatures &amp; KIfIsLoopback ? printf(&quot; loopback&quot;) : printf(&quot;&quot;); info().iFeatures &amp; KIfIsDialup ? printf(&quot; dialup&quot;) : printf(&quot;&quot;); info().iFeatures &amp; KIfIsPointToPoint ? printf(&quot; pointtopoint&quot;) : printf(&quot;&quot;); info().iFeatures &amp; KIfCanBroadcast ? printf(&quot; canbroadcast&quot;) : printf(&quot;&quot;); info().iFeatures &amp; KIfCanMulticast ? printf(&quot; canmulticast&quot;) : printf(&quot;&quot;); info().iFeatures &amp; KIfCanSetMTU ? printf(&quot; cansetmtu&quot;) : printf(&quot;&quot;); info().iFeatures &amp; KIfHasHardwareAddr ? printf(&quot; hardwareaddr&quot;) : printf(&quot;&quot;); info().iFeatures &amp; KIfCanSetHardwareAddr ? printf(&quot; cansethardwareaddr&quot;) : printf(&quot;&quot;); printf(&quot;\n&quot;); TName address; info().iAddress.Output(address); printf(&quot;Addr: %s\n&quot;, qt_TNameToQString(address).toLatin1().data()); if(info().iAddress.IsLinkLocal()) { printf(&quot; -link local\n&quot;); } else if(info().iAddress.IsSiteLocal()) { printf(&quot; -site local\n&quot;); } else { printf(&quot; -global\n&quot;); } info().iNetMask.Output(address); printf(&quot;Netmask %s\n&quot;, qt_TNameToQString(address).toLatin1().data()); info().iBrdAddr.Output(address); printf(&quot;Broadcast address %s\n&quot;, qt_TNameToQString(address).toLatin1().data()); info().iDefGate.Output(address); printf(&quot;Gatew: %s\n&quot;, qt_TNameToQString(address).toLatin1().data()); info().iNameSer1.Output(address); printf(&quot;DNS 1: %s\n&quot;, qt_TNameToQString(address).toLatin1().data()); info().iNameSer2.Output(address); printf(&quot;DNS 2: %s\n&quot;, qt_TNameToQString(address).toLatin1().data()); if (info().iHwAddr.Family() != KAFUnspec) { printf(&quot;Hardware address &quot;); TUint j; for(j = sizeof(SSockAddr) ; j &lt; sizeof(SSockAddr) + 6 ; ++j) { if(j &lt; (TUint)info().iHwAddr.Length()) { printf(&quot;%02X&quot;, info().iHwAddr[j]); } else { printf(&quot;??&quot;); } if(j &lt; sizeof(SSockAddr) + 5) printf(&quot;-&quot;); else printf(&quot;\n&quot;); } } } if(res == KErrNone) { info = next; printf(&quot;\n&quot;); } else { printf(&quot;\n&quot;); } } sock.Pop(); ss.Pop(); return output; } static QString qt_RouteInfoL() { QString output; TAutoClose&lt;RSocketServ&gt; ss; User::LeaveIfError(ss.iObj.Connect()); ss.PushL(); TAutoClose&lt;RSocket&gt; sock; User::LeaveIfError(sock.iObj.Open(ss.iObj, _L(&quot;udp&quot;))); sock.PushL(); TSoInetRouteInfo routeInfo; TPckg&lt;TSoInetRouteInfo&gt; routeInfoPkg(routeInfo); TName destAddr; TName netMask; TName gateway; TName ifAddr; <span class="comment">// Begins enumeration of routes by setting this option</span> User::LeaveIfError(sock.iObj.SetOpt(KSoInetEnumRoutes, KSolInetRtCtrl)); <span class="comment">// The TSoInetRouteInfo contains information for a new route each time GetOpt returns KErrNone</span> for(TInt i = 0; sock.iObj.GetOpt(KSoInetNextRoute, KSolInetRtCtrl, routeInfoPkg) == KErrNone ; i++) { <span class="comment">// Extract the destination and netmask</span> routeInfo.iDstAddr.Output(destAddr); routeInfo.iNetMask.Output(netMask); routeInfo.iGateway.Output(gateway); routeInfo.iIfAddr.Output(ifAddr); <span class="comment"> /* if(destAddr.Length() &lt;= 2) continue; if(netMask.Find(_L(&quot;255.255.255.255&quot;)) != KErrNotFound || netMask.Find(_L(&quot;0.0.0.0&quot;)) != KErrNotFound || netMask.Find(_L(&quot;ffff:ffff:ffff:ffff&quot;)) != KErrNotFound) continue; */</span> printf(&quot;Route Info #[%i]\n&quot;, i); printf(&quot;DstAddr %s\n&quot;, qt_TNameToQString(destAddr).toLatin1().data()); printf(&quot;NetMask %s\n&quot;, qt_TNameToQString(netMask).toLatin1().data()); printf(&quot;Gateway %s\n&quot;, qt_TNameToQString(gateway).toLatin1().data()); printf(&quot;IfAddr %s\n&quot;, qt_TNameToQString(ifAddr).toLatin1().data()); printf(&quot;\n&quot;); } sock.Pop(); ss.Pop(); return output; } QString qt_TDesC2QStringL(const TDesC&amp; aDescriptor) { #ifdef QT_NO_UNICODE return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length()); #else return QString::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length()); #endif } static bool qt_SetDefaultIapName(const QString &amp;iapName, int &amp;error) { struct ifreq ifReq; <span class="comment">// clear structure</span> memset(&amp;ifReq, 0, sizeof(struct ifreq)); <span class="comment">// set IAP name value</span> <span class="comment">// make sure it is in UTF8</span> strcpy(ifReq.ifr_name, iapName.toUtf8().data()); if(setdefaultif(&amp;ifReq) == 0) { <span class="comment">// OK</span> error = 0; return true; } else { error = errno; return false; } } static bool qt_SetDefaultSnapId(const int snapId, int &amp;error) { struct ifreq ifReq; <span class="comment">// clear structure</span> memset(&amp;ifReq, 0, sizeof(struct ifreq)); <span class="comment">// set SNAP ID value</span> ifReq.ifr_ifru.snap_id = snapId; if(setdefaultif(&amp;ifReq) == 0) { <span class="comment">// OK</span> error = 0; return true; } else { error = errno; return false; } } static void qt_SaveIapName(QSettings&amp; settings, QStringList&amp; iapNames, QString&amp; iapNameValue) { if(iapNames.contains(iapNameValue) &amp;&amp; iapNames.first() == iapNameValue) { <span class="comment">// no need to update</span> } else { if(iapNameValue != QString(&quot;Easy WLAN&quot;)) { <span class="comment">// new selection alway on top</span> iapNames.removeAll(iapNameValue); iapNames.prepend(iapNameValue); writeIapNamesSettings(settings, iapNames); } else { <span class="comment">// Unbeliveable ... if IAP dodn't exist before</span> <span class="comment">// no matter what you choose from IAP selection list</span> <span class="comment">// you will get &quot;Easy WLAN&quot; as IAP name value</span> <span class="comment">// somehow commsdb is not in sync</span> } } } static QString qt_OfferIapDialog() { TBuf8&lt;256&gt; iapName; RSocketServ socketServ; CleanupClosePushL(socketServ); RConnection connection; CleanupClosePushL(connection); socketServ.Connect(); connection.Open(socketServ); connection.Start(); connection.GetDesSetting(TPtrC(KIapNameSetting), iapName); <span class="comment">//connection.Stop();</span> iapName.ZeroTerminate(); QString strIapName((char*)iapName.Ptr()); int error = 0; if(!qt_SetDefaultIapName(strIapName, error)) { <span class="comment">//printf(&quot;failed setdefaultif @ %i with %s and errno = %d \n&quot;, __LINE__, strIapName.toUtf8().data(), error);</span> strIapName = QString(&quot;&quot;); } CleanupStack::PopAndDestroy(&amp;connection); CleanupStack::PopAndDestroy(&amp;socketServ); return strIapName; } static QString qt_CheckForActiveConnection() { TUint count; RSocketServ serv; CleanupClosePushL(serv); RConnection conn; CleanupClosePushL(conn); serv.Connect(); conn.Open(serv); TConnectionInfoBuf connInfo; TBuf8&lt;256&gt; iapName; TBuf8&lt;256&gt; iapServiceType; QString strIapName; if (conn.EnumerateConnections(count) == KErrNone) { if(count &gt; 0) { for (TUint i = 1; i &lt;= count; i++) { if (conn.GetConnectionInfo(i, connInfo) == KErrNone) { RConnection tempConn; CleanupClosePushL(tempConn); tempConn.Open(serv); if (tempConn.Attach(connInfo, RConnection::EAttachTypeNormal) == KErrNone) { tempConn.GetDesSetting(TPtrC(KIapNameSetting), iapName); tempConn.GetDesSetting(TPtrC(KIapServiceType), iapServiceType); <span class="comment">//tempConn.Stop();</span> iapName.ZeroTerminate(); iapServiceType.ZeroTerminate(); <span class="comment"> // if(iapServiceType.Find(_L8(&quot;LANService&quot;)) </span>!= KErrNotFound) { <span class="comment"> // activeLanConnectionFound = ETrue;</span> <span class="comment"> // break;</span> <span class="comment"> // }</span> strIapName = QString((char*)iapName.Ptr()); int error = 0; if(!qt_SetDefaultIapName(strIapName, error)) { <span class="comment">//printf(&quot;failed setdefaultif @ %i with %s and errno = %d \n&quot;, __LINE__, strIapName.toUtf8().data(), error);</span> strIapName = QString(&quot;&quot;); } CleanupStack::PopAndDestroy(&amp;tempConn); break; } } } } } <span class="comment">//conn.Stop();</span> CleanupStack::PopAndDestroy(&amp;conn); CleanupStack::PopAndDestroy(&amp;serv); return strIapName; } static QString qt_CheckSettingsForConnection(QStringList&amp; iapNames) { QString strIapName; for(int index = 0; index &lt; iapNames.size(); ++index) { strIapName = iapNames.at(index); int error = 0; if(!qt_SetDefaultIapName(strIapName, error)) { <span class="comment">//printf(&quot;failed setdefaultif @ %i with %s and errno = %d \n&quot;, __LINE__, strIapName.toUtf8().data(), error);</span> strIapName = QString(&quot;&quot;); } else { return strIapName; } } return strIapName; } static void qt_SetDefaultIapL() { <span class="comment">// settings @ /c/data/.config/Trolltech.com</span> QSettings settings(QSettings::UserScope, qtOrganizationTag); <span class="comment">// populate iap name list</span> QStringList iapNames; readIapNamesSettings(settings, iapNames); QString iapNameValue; iapNameValue = qt_CheckForActiveConnection(); if(!iapNameValue.isEmpty()) { qt_SaveIapName(settings, iapNames, iapNameValue); return; } iapNameValue = qt_CheckSettingsForConnection(iapNames); if(!iapNameValue.isEmpty()) { qt_SaveIapName(settings, iapNames, iapNameValue); return; } <span class="comment">/* * no active LAN connections yet * no IAP in settings * offer IAP dialog to user */</span> iapNameValue = qt_OfferIapDialog(); qt_SaveIapName(settings, iapNames, iapNameValue); return; } static int qt_SetDefaultIap() { #ifndef __WINS__ TRAPD(err1, qt_SetDefaultIapL()); <span class="comment"> // TRAPD(err2, qt_InterfaceInfoL());</span> <span class="comment"> // TRAPD(err3, qt_RouteInfoL());</span> return err1; #else return 0; <span class="comment">// IAP dialog not required for emulator</span> #endif } #endif <span class="comment">// QSYM_IAP_UTIL_H</span></pre> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.0</div></td> </tr></table></div></address></body> </html>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Copyright (c) 2010-2017 Evolveum and contributors ~ ~ This work is dual-licensed under the Apache License 2.0 ~ and European Union Public License. See LICENSE file for details. --> <connector oid="cccccccc-cccc-cccc-cccc-000000000004" xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:ns2="http://www.w3.org/2001/04/xmlenc#" xmlns:ns3="http://www.w3.org/2000/09/xmldsig#"> <c:name>ICF com.evolveum.icf.dummy.connector.DummyConnector</c:name> <c:framework>http://midpoint.evolveum.com/xml/ns/public/connector/icf-1</c:framework> <c:connectorType>com.evolveum.icf.dummy.connector.DummyConnector</c:connectorType> <c:connectorVersion>2.0</c:connectorVersion> <c:connectorBundle>com.evolveum.icf.dummy</c:connectorBundle> <c:namespace>http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.icf.dummy/com.evolveum.icf.dummy.connector.DummyConnector</c:namespace> <c:schema> <definition xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:qn915="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3" xmlns:tns="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.icf.dummy/com.evolveum.icf.dummy.connector.DummyConnector" xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3" xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" elementFormDefault="qualified" targetNamespace="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.icf.dummy/com.evolveum.icf.dummy.connector.DummyConnector"> <xsd:import namespace="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3"/> <xsd:import namespace="http://prism.evolveum.com/xml/ns/public/annotation-3"/> <xsd:import namespace="http://midpoint.evolveum.com/xml/ns/public/common/common-3"/> <xsd:complexType name="ConfigurationPropertiesType"> <xsd:sequence> <xsd:element minOccurs="0" name="uselessString" type="xsd:string"> <xsd:annotation> <xsd:appinfo> <a:displayName>UI_INSTANCE_USELESS_STRING</a:displayName> <a:help>UI_INSTANCE_USELESS_STRING</a:help> </xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element minOccurs="0" name="instanceId" type="xsd:string"> <xsd:annotation> <xsd:appinfo> <a:displayName>Instance identifier</a:displayName> <a:help>Instance identifier</a:help> </xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element minOccurs="0" name="supportSchema" type="xsd:boolean"> <xsd:annotation> <xsd:appinfo> <a:displayName>UI_SUPPORT_SCHEMA</a:displayName> <a:help>UI_SUPPORT_SCHEMA</a:help> </xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element minOccurs="0" name="uselessGuardedString" type="t:ProtectedStringType"> <xsd:annotation> <xsd:appinfo> <a:displayName>UI_INSTANCE_USELESS_GUARDED_STRING</a:displayName> <a:help>UI_INSTANCE_USELESS_GUARDED_STRING</a:help> </xsd:appinfo> </xsd:annotation> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ConfigurationType"> <xsd:sequence> <xsd:element minOccurs="0" ref="qn915:connectorPoolConfiguration"> <xsd:annotation> <xsd:appinfo> <a:type>qn915:ConnectorPoolConfigurationType</a:type> </xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element minOccurs="0" ref="qn915:producerBufferSize"/> <xsd:element minOccurs="0" ref="qn915:timeouts"> <xsd:annotation> <xsd:appinfo> <a:type>qn915:TimeoutsType</a:type> </xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element ref="qn915:configurationProperties"> <xsd:annotation> <xsd:appinfo> <a:type>tns:ConfigurationPropertiesType</a:type> <a:container/> </xsd:appinfo> </xsd:annotation> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:element name="connectorConfiguration" type="tns:ConfigurationType"> <xsd:annotation> <xsd:appinfo> <a:container/> </xsd:appinfo> </xsd:annotation> </xsd:element> </xsd:schema> </definition> </c:schema> </connector>
{ "pile_set_name": "Github" }
/* Copyright (C) 2012 Kristian Lauszus, TKJ Electronics. All rights reserved. This software may be distributed and modified under the terms of the GNU General Public License version 2 (GPL2) as published by the Free Software Foundation and appearing in the file GPL2.TXT included in the packaging of this file. Please note that GPL2 Section 2[b] requires that all works based on this software must also be made publicly available under the terms of the GPL2 ("Copyleft"). Contact information ------------------- Kristian Lauszus, TKJ Electronics Web : http://www.tkjelectronics.com e-mail : [email protected] getBatteryLevel and checkStatus functions made by timstamp.co.uk found using BusHound from Perisoft.net */ #include "XBOXRECV.h" // To enable serial debugging see "settings.h" //#define EXTRADEBUG // Uncomment to get even more debugging data //#define PRINTREPORT // Uncomment to print the report send by the Xbox 360 Controller XBOXRECV::XBOXRECV(USB *p) : pUsb(p), // pointer to USB class instance - mandatory bAddress(0), // device address - mandatory bPollEnable(false) { // don't start polling before dongle is connected for(uint8_t i = 0; i < XBOX_MAX_ENDPOINTS; i++) { epInfo[i].epAddr = 0; epInfo[i].maxPktSize = (i) ? 0 : 8; epInfo[i].bmSndToggle = 0; epInfo[i].bmRcvToggle = 0; epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER; } if(pUsb) // register in USB subsystem pUsb->RegisterDeviceClass(this); //set devConfig[] entry } uint8_t XBOXRECV::ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed) { const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR); uint8_t buf[constBufSize]; USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf); uint8_t rcode; UsbDevice *p = NULL; EpInfo *oldep_ptr = NULL; uint16_t PID, VID; AddressPool &addrPool = pUsb->GetAddressPool(); // Get memory address of USB device address pool #ifdef EXTRADEBUG Notify(PSTR("\r\nXBOXRECV Init"), 0x80); #endif if(bAddress) { // Check if address has already been assigned to an instance #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nAddress in use"), 0x80); #endif return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE; } p = addrPool.GetUsbDevicePtr(0); // Get pointer to pseudo device with address 0 assigned if(!p) { #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nAddress not found"), 0x80); #endif return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; } if(!p->epinfo) { #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nepinfo is null"), 0x80); #endif return USB_ERROR_EPINFO_IS_NULL; } oldep_ptr = p->epinfo; // Save old pointer to EP_RECORD of address 0 p->epinfo = epInfo; // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence p->lowspeed = lowspeed; rcode = pUsb->getDevDescr(0, 0, constBufSize, (uint8_t*)buf); // Get device descriptor - addr, ep, nbytes, data p->epinfo = oldep_ptr; // Restore p->epinfo if(rcode) goto FailGetDevDescr; VID = udd->idVendor; PID = udd->idProduct; if((VID != XBOX_VID && VID != MADCATZ_VID && VID != JOYTECH_VID) || (PID != XBOX_WIRELESS_RECEIVER_PID && PID != XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID)) { // Check if it's a Xbox receiver using the Vendor ID and Product ID #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nYou'll need a wireless receiver for this libary to work"), 0x80); #endif goto FailUnknownDevice; } bAddress = addrPool.AllocAddress(parent, false, port); // Allocate new address according to device class if(!bAddress) { #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nOut of address space"), 0x80); #endif return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL; } epInfo[0].maxPktSize = udd->bMaxPacketSize0; // Extract Max Packet Size from device descriptor delay(20); // Wait a little before resetting device return USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET; /* Diagnostic messages */ FailGetDevDescr: #ifdef DEBUG_USB_HOST NotifyFailGetDevDescr(rcode); #endif if(rcode != hrJERR) rcode = USB_ERROR_FailGetDevDescr; goto Fail; FailUnknownDevice: #ifdef DEBUG_USB_HOST NotifyFailUnknownDevice(VID, PID); #endif rcode = USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED; Fail: #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nXbox 360 Init Failed, error code: "), 0x80); NotifyFail(rcode); #endif Release(); return rcode; }; uint8_t XBOXRECV::Init(uint8_t parent, uint8_t port, bool lowspeed) { uint8_t rcode; AddressPool &addrPool = pUsb->GetAddressPool(); #ifdef EXTRADEBUG Notify(PSTR("\r\nBTD Init"), 0x80); #endif UsbDevice *p = addrPool.GetUsbDevicePtr(bAddress); // Get pointer to assigned address record if(!p) { #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nAddress not found"), 0x80); #endif return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; } delay(300); // Assign new address to the device rcode = pUsb->setAddr(0, 0, bAddress); // Assign new address to the device if(rcode) { #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nsetAddr: "), 0x80); D_PrintHex<uint8_t > (rcode, 0x80); #endif p->lowspeed = false; goto Fail; } #ifdef EXTRADEBUG Notify(PSTR("\r\nAddr: "), 0x80); D_PrintHex<uint8_t > (bAddress, 0x80); #endif p->lowspeed = false; p = addrPool.GetUsbDevicePtr(bAddress); // Get pointer to assigned address record if(!p) { #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nAddress not found"), 0x80); #endif return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; } p->lowspeed = lowspeed; rcode = pUsb->setEpInfoEntry(bAddress, 1, epInfo); // Assign epInfo to epinfo pointer - only EP0 is known if(rcode) goto FailSetDevTblEntry; /* The application will work in reduced host mode, so we can save program and data memory space. After verifying the VID we will use known values for the configuration values for device, interface, endpoints and HID for the XBOX360 Wireless receiver */ /* Initialize data structures for endpoints of device */ epInfo[ XBOX_INPUT_PIPE_1 ].epAddr = 0x01; // XBOX 360 report endpoint - poll interval 1ms epInfo[ XBOX_INPUT_PIPE_1 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT; epInfo[ XBOX_INPUT_PIPE_1 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints epInfo[ XBOX_INPUT_PIPE_1 ].maxPktSize = EP_MAXPKTSIZE; epInfo[ XBOX_INPUT_PIPE_1 ].bmSndToggle = 0; epInfo[ XBOX_INPUT_PIPE_1 ].bmRcvToggle = 0; epInfo[ XBOX_OUTPUT_PIPE_1 ].epAddr = 0x01; // XBOX 360 output endpoint - poll interval 8ms epInfo[ XBOX_OUTPUT_PIPE_1 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT; epInfo[ XBOX_OUTPUT_PIPE_1 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints epInfo[ XBOX_OUTPUT_PIPE_1 ].maxPktSize = EP_MAXPKTSIZE; epInfo[ XBOX_OUTPUT_PIPE_1 ].bmSndToggle = 0; epInfo[ XBOX_OUTPUT_PIPE_1 ].bmRcvToggle = 0; epInfo[ XBOX_INPUT_PIPE_2 ].epAddr = 0x03; // XBOX 360 report endpoint - poll interval 1ms epInfo[ XBOX_INPUT_PIPE_2 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT; epInfo[ XBOX_INPUT_PIPE_2 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints epInfo[ XBOX_INPUT_PIPE_2 ].maxPktSize = EP_MAXPKTSIZE; epInfo[ XBOX_INPUT_PIPE_2 ].bmSndToggle = 0; epInfo[ XBOX_INPUT_PIPE_2 ].bmRcvToggle = 0; epInfo[ XBOX_OUTPUT_PIPE_2 ].epAddr = 0x03; // XBOX 360 output endpoint - poll interval 8ms epInfo[ XBOX_OUTPUT_PIPE_2 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT; epInfo[ XBOX_OUTPUT_PIPE_2 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints epInfo[ XBOX_OUTPUT_PIPE_2 ].maxPktSize = EP_MAXPKTSIZE; epInfo[ XBOX_OUTPUT_PIPE_2 ].bmSndToggle = 0; epInfo[ XBOX_OUTPUT_PIPE_2 ].bmRcvToggle = 0; epInfo[ XBOX_INPUT_PIPE_3 ].epAddr = 0x05; // XBOX 360 report endpoint - poll interval 1ms epInfo[ XBOX_INPUT_PIPE_3 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT; epInfo[ XBOX_INPUT_PIPE_3 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints epInfo[ XBOX_INPUT_PIPE_3 ].maxPktSize = EP_MAXPKTSIZE; epInfo[ XBOX_INPUT_PIPE_3 ].bmSndToggle = 0; epInfo[ XBOX_INPUT_PIPE_3 ].bmRcvToggle = 0; epInfo[ XBOX_OUTPUT_PIPE_3 ].epAddr = 0x05; // XBOX 360 output endpoint - poll interval 8ms epInfo[ XBOX_OUTPUT_PIPE_3 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT; epInfo[ XBOX_OUTPUT_PIPE_3 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints epInfo[ XBOX_OUTPUT_PIPE_3 ].maxPktSize = EP_MAXPKTSIZE; epInfo[ XBOX_OUTPUT_PIPE_3 ].bmSndToggle = 0; epInfo[ XBOX_OUTPUT_PIPE_3 ].bmRcvToggle = 0; epInfo[ XBOX_INPUT_PIPE_4 ].epAddr = 0x07; // XBOX 360 report endpoint - poll interval 1ms epInfo[ XBOX_INPUT_PIPE_4 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT; epInfo[ XBOX_INPUT_PIPE_4 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints epInfo[ XBOX_INPUT_PIPE_4 ].maxPktSize = EP_MAXPKTSIZE; epInfo[ XBOX_INPUT_PIPE_4 ].bmSndToggle = 0; epInfo[ XBOX_INPUT_PIPE_4 ].bmRcvToggle = 0; epInfo[ XBOX_OUTPUT_PIPE_4 ].epAddr = 0x07; // XBOX 360 output endpoint - poll interval 8ms epInfo[ XBOX_OUTPUT_PIPE_4 ].epAttribs = USB_TRANSFER_TYPE_INTERRUPT; epInfo[ XBOX_OUTPUT_PIPE_4 ].bmNakPower = USB_NAK_NOWAIT; // Only poll once for interrupt endpoints epInfo[ XBOX_OUTPUT_PIPE_4 ].maxPktSize = EP_MAXPKTSIZE; epInfo[ XBOX_OUTPUT_PIPE_4 ].bmSndToggle = 0; epInfo[ XBOX_OUTPUT_PIPE_4 ].bmRcvToggle = 0; rcode = pUsb->setEpInfoEntry(bAddress, 9, epInfo); if(rcode) goto FailSetDevTblEntry; delay(200); //Give time for address change rcode = pUsb->setConf(bAddress, epInfo[ XBOX_CONTROL_PIPE ].epAddr, 1); if(rcode) goto FailSetConfDescr; #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nXbox Wireless Receiver Connected\r\n"), 0x80); #endif XboxReceiverConnected = true; bPollEnable = true; checkStatusTimer = 0; // Reset timer return 0; // Successful configuration /* Diagnostic messages */ FailSetDevTblEntry: #ifdef DEBUG_USB_HOST NotifyFailSetDevTblEntry(); goto Fail; #endif FailSetConfDescr: #ifdef DEBUG_USB_HOST NotifyFailSetConfDescr(); #endif Fail: #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nXbox 360 Init Failed, error code: "), 0x80); NotifyFail(rcode); #endif Release(); return rcode; } /* Performs a cleanup after failed Init() attempt */ uint8_t XBOXRECV::Release() { XboxReceiverConnected = false; for(uint8_t i = 0; i < 4; i++) Xbox360Connected[i] = 0x00; pUsb->GetAddressPool().FreeAddress(bAddress); bAddress = 0; bPollEnable = false; return 0; } uint8_t XBOXRECV::Poll() { if(!bPollEnable) return 0; if(!checkStatusTimer || ((millis() - checkStatusTimer) > 3000)) { // Run checkStatus every 3 seconds checkStatusTimer = millis(); checkStatus(); } uint8_t inputPipe; uint16_t bufferSize; for(uint8_t i = 0; i < 4; i++) { if(i == 0) inputPipe = XBOX_INPUT_PIPE_1; else if(i == 1) inputPipe = XBOX_INPUT_PIPE_2; else if(i == 2) inputPipe = XBOX_INPUT_PIPE_3; else inputPipe = XBOX_INPUT_PIPE_4; bufferSize = EP_MAXPKTSIZE; // This is the maximum number of bytes we want to receive pUsb->inTransfer(bAddress, epInfo[ inputPipe ].epAddr, &bufferSize, readBuf); if(bufferSize > 0) { // The number of received bytes #ifdef EXTRADEBUG Notify(PSTR("Bytes Received: "), 0x80); D_PrintHex<uint16_t > (bufferSize, 0x80); Notify(PSTR("\r\n"), 0x80); #endif readReport(i); #ifdef PRINTREPORT printReport(i, bufferSize); // Uncomment "#define PRINTREPORT" to print the report send by the Xbox 360 Controller #endif } } return 0; } void XBOXRECV::readReport(uint8_t controller) { if(readBuf == NULL) return; // This report is send when a controller is connected and disconnected if(readBuf[0] == 0x08 && readBuf[1] != Xbox360Connected[controller]) { Xbox360Connected[controller] = readBuf[1]; #ifdef DEBUG_USB_HOST Notify(PSTR("Controller "), 0x80); Notify(controller, 0x80); #endif if(Xbox360Connected[controller]) { #ifdef DEBUG_USB_HOST const char* str = 0; switch(readBuf[1]) { case 0x80: str = PSTR(" as controller\r\n"); break; case 0x40: str = PSTR(" as headset\r\n"); break; case 0xC0: str = PSTR(" as controller+headset\r\n"); break; } Notify(PSTR(": connected"), 0x80); Notify(str, 0x80); #endif onInit(controller); } #ifdef DEBUG_USB_HOST else Notify(PSTR(": disconnected\r\n"), 0x80); #endif return; } // Controller status report if(readBuf[1] == 0x00 && readBuf[3] & 0x13 && readBuf[4] >= 0x22) { controllerStatus[controller] = ((uint16_t)readBuf[3] << 8) | readBuf[4]; return; } if(readBuf[1] != 0x01) // Check if it's the correct report - the receiver also sends different status reports return; // A controller must be connected if it's sending data if(!Xbox360Connected[controller]) Xbox360Connected[controller] |= 0x80; ButtonState[controller] = (uint32_t)(readBuf[9] | ((uint16_t)readBuf[8] << 8) | ((uint32_t)readBuf[7] << 16) | ((uint32_t)readBuf[6] << 24)); hatValue[controller][LeftHatX] = (int16_t)(((uint16_t)readBuf[11] << 8) | readBuf[10]); hatValue[controller][LeftHatY] = (int16_t)(((uint16_t)readBuf[13] << 8) | readBuf[12]); hatValue[controller][RightHatX] = (int16_t)(((uint16_t)readBuf[15] << 8) | readBuf[14]); hatValue[controller][RightHatY] = (int16_t)(((uint16_t)readBuf[17] << 8) | readBuf[16]); //Notify(PSTR("\r\nButtonState: "), 0x80); //PrintHex<uint32_t>(ButtonState[controller], 0x80); if(ButtonState[controller] != OldButtonState[controller]) { buttonStateChanged[controller] = true; ButtonClickState[controller] = (ButtonState[controller] >> 16) & ((~OldButtonState[controller]) >> 16); // Update click state variable, but don't include the two trigger buttons L2 and R2 if(((uint8_t)OldButtonState[controller]) == 0 && ((uint8_t)ButtonState[controller]) != 0) // The L2 and R2 buttons are special as they are analog buttons R2Clicked[controller] = true; if((uint8_t)(OldButtonState[controller] >> 8) == 0 && (uint8_t)(ButtonState[controller] >> 8) != 0) L2Clicked[controller] = true; OldButtonState[controller] = ButtonState[controller]; } } void XBOXRECV::printReport(uint8_t controller, uint8_t nBytes) { //Uncomment "#define PRINTREPORT" to print the report send by the Xbox 360 Controller #ifdef PRINTREPORT if(readBuf == NULL) return; Notify(PSTR("Controller "), 0x80); Notify(controller, 0x80); Notify(PSTR(": "), 0x80); for(uint8_t i = 0; i < nBytes; i++) { D_PrintHex<uint8_t > (readBuf[i], 0x80); Notify(PSTR(" "), 0x80); } Notify(PSTR("\r\n"), 0x80); #endif } uint8_t XBOXRECV::getButtonPress(ButtonEnum b, uint8_t controller) { if(b == L2) // These are analog buttons return (uint8_t)(ButtonState[controller] >> 8); else if(b == R2) return (uint8_t)ButtonState[controller]; return (bool)(ButtonState[controller] & ((uint32_t)pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]) << 16)); } bool XBOXRECV::getButtonClick(ButtonEnum b, uint8_t controller) { if(b == L2) { if(L2Clicked[controller]) { L2Clicked[controller] = false; return true; } return false; } else if(b == R2) { if(R2Clicked[controller]) { R2Clicked[controller] = false; return true; } return false; } uint16_t button = pgm_read_word(&XBOX_BUTTONS[(uint8_t)b]); bool click = (ButtonClickState[controller] & button); ButtonClickState[controller] &= ~button; // clear "click" event return click; } int16_t XBOXRECV::getAnalogHat(AnalogHatEnum a, uint8_t controller) { return hatValue[controller][a]; } bool XBOXRECV::buttonChanged(uint8_t controller) { bool state = buttonStateChanged[controller]; buttonStateChanged[controller] = false; return state; } /* ControllerStatus Breakdown ControllerStatus[controller] & 0x0001 // 0 ControllerStatus[controller] & 0x0002 // normal batteries, no rechargeable battery pack ControllerStatus[controller] & 0x0004 // controller starting up / settling ControllerStatus[controller] & 0x0008 // headset adapter plugged in, but no headphones connected (mute?) ControllerStatus[controller] & 0x0010 // 0 ControllerStatus[controller] & 0x0020 // 1 ControllerStatus[controller] & 0x0040 // battery level (high bit) ControllerStatus[controller] & 0x0080 // battery level (low bit) ControllerStatus[controller] & 0x0100 // 1 ControllerStatus[controller] & 0x0200 // 1 ControllerStatus[controller] & 0x0400 // headset adapter plugged in ControllerStatus[controller] & 0x0800 // 0 ControllerStatus[controller] & 0x1000 // 1 ControllerStatus[controller] & 0x2000 // 0 ControllerStatus[controller] & 0x4000 // 0 ControllerStatus[controller] & 0x8000 // 0 */ uint8_t XBOXRECV::getBatteryLevel(uint8_t controller) { return ((controllerStatus[controller] & 0x00C0) >> 6); } void XBOXRECV::XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes) { #ifdef EXTRADEBUG uint8_t rcode; #endif uint8_t outputPipe; switch(controller) { case 0: outputPipe = XBOX_OUTPUT_PIPE_1; break; case 1: outputPipe = XBOX_OUTPUT_PIPE_2; break; case 2: outputPipe = XBOX_OUTPUT_PIPE_3; break; case 3: outputPipe = XBOX_OUTPUT_PIPE_4; break; default: return; } #ifdef EXTRADEBUG rcode = #endif pUsb->outTransfer(bAddress, epInfo[ outputPipe ].epAddr, nbytes, data); #ifdef EXTRADEBUG if(rcode) Notify(PSTR("Error sending Xbox message\r\n"), 0x80); #endif } void XBOXRECV::disconnect(uint8_t controller) { writeBuf[0] = 0x00; writeBuf[1] = 0x00; writeBuf[2] = 0x08; writeBuf[3] = 0xC0; XboxCommand(controller, writeBuf, 4); } void XBOXRECV::setLedRaw(uint8_t value, uint8_t controller) { writeBuf[0] = 0x00; writeBuf[1] = 0x00; writeBuf[2] = 0x08; writeBuf[3] = value | 0x40; XboxCommand(controller, writeBuf, 4); } void XBOXRECV::setLedOn(LEDEnum led, uint8_t controller) { if(led == OFF) setLedRaw(0, controller); else if(led != ALL) // All LEDs can't be on a the same time setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]) + 4, controller); } void XBOXRECV::setLedBlink(LEDEnum led, uint8_t controller) { setLedRaw(pgm_read_byte(&XBOX_LEDS[(uint8_t)led]), controller); } void XBOXRECV::setLedMode(LEDModeEnum ledMode, uint8_t controller) { // This function is used to do some speciel LED stuff the controller supports setLedRaw((uint8_t)ledMode, controller); } /* PC runs this at interval of approx 2 seconds Thanks to BusHound from Perisoft.net for the Windows USB Analysis output Found by timstamp.co.uk */ void XBOXRECV::checkStatus() { if(!bPollEnable) return; // Get controller info writeBuf[0] = 0x08; writeBuf[1] = 0x00; writeBuf[2] = 0x0f; writeBuf[3] = 0xc0; for(uint8_t i = 0; i < 4; i++) { XboxCommand(i, writeBuf, 4); } // Get battery status writeBuf[0] = 0x00; writeBuf[1] = 0x00; writeBuf[2] = 0x00; writeBuf[3] = 0x40; for(uint8_t i = 0; i < 4; i++) { if(Xbox360Connected[i]) XboxCommand(i, writeBuf, 4); } } void XBOXRECV::setRumbleOn(uint8_t lValue, uint8_t rValue, uint8_t controller) { writeBuf[0] = 0x00; writeBuf[1] = 0x01; writeBuf[2] = 0x0f; writeBuf[3] = 0xc0; writeBuf[4] = 0x00; writeBuf[5] = lValue; // big weight writeBuf[6] = rValue; // small weight XboxCommand(controller, writeBuf, 7); } void XBOXRECV::onInit(uint8_t controller) { if(pFuncOnInit) pFuncOnInit(); // Call the user function else { LEDEnum led; if(controller == 0) led = static_cast<LEDEnum>(LED1); else if(controller == 1) led = static_cast<LEDEnum>(LED2); else if(controller == 2) led = static_cast<LEDEnum>(LED3); else led = static_cast<LEDEnum>(LED4); setLedOn(led, controller); } }
{ "pile_set_name": "Github" }
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import 'package:analysis_server/src/services/correction/fix.dart'; import 'package:analyzer_plugin/utilities/fixes/fixes.dart'; import 'package:test_reflective_loader/test_reflective_loader.dart'; import 'fix_processor.dart'; void main() { defineReflectiveSuite(() { defineReflectiveTests(RemoveParenthesesInGetterInvocationTest); }); } @reflectiveTest class RemoveParenthesesInGetterInvocationTest extends FixProcessorTest { @override FixKind get kind => DartFixKind.REMOVE_PARENTHESIS_IN_GETTER_INVOCATION; Future<void> test_noArguments() async { await resolveTestUnit(''' class A { int get foo => 0; } main(A a) { a.foo(); } '''); await assertHasFix(''' class A { int get foo => 0; } main(A a) { a.foo; } '''); } }
{ "pile_set_name": "Github" }
This is a generated file for the l3build validation system. Don't change this file in any respect. SQRT x Completed box being shipped out [2] \hbox(0.0+0.0)x0.0 .\mathon .\hbox(10.24+2.73999)x14.78 ..\vbox(0.66+11.65999)x9.28, shifted -8.92 ...\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#1164 ..\vbox(10.24+0.09)x5.5 ...\kern0.66 ...\rule(0.66+0.0)x* ...\kern4.51 ...\hbox(4.41+0.09)x5.5 ....\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#2524 .\mathoff SQRT x squared Completed box being shipped out [2] \hbox(0.0+0.0)x0.0 .\mathon .\hbox(11.94516+1.03484)x19.03 ..\vbox(0.66+11.65999)x9.28, shifted -10.62515 ...\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#1164 ..\vbox(11.94516+0.09)x9.75 ...\kern0.66 ...\rule(0.66+0.0)x* ...\kern2.80486 ...\hbox(7.8203+0.09)x9.75 ....\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#2524 ....\hbox(5.07+0.0)x4.25, shifted -2.75029 .....\TU/XITSMath-Regular.otf(1)/m/n/7.5 glyph#51 .\mathoff SQRT FRAC x y Completed box being shipped out [2] \hbox(0.0+0.0)x0.0 .\mathon .\hbox(14.90994+10.35005)x19.14 ..\vbox(0.66+23.93999)x11.24, shifted -13.58994 ...\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#3706 ..\vbox(14.90994+8.83075)x7.9 ...\kern0.66 ...\rule(0.66+0.0)x* ...\kern3.37932 ...\hbox(10.21062+8.83075)x7.9 ....\hbox(0.0+0.0)x1.2, shifted -2.50027 ....\vbox(10.21062+8.83075)x5.5 .....\hbox(4.41+0.09)x5.5 ......\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#2524 .....\kern2.88037 .....\rule(0.65993+0.0)x* .....\kern4.77106 .....\hbox(4.4+1.83)x5.5, glue set 0.27fil ......\glue 0.0 plus 1.0fil minus 1.0fil ......\TU/XITSMath-Regular.otf(1)/m/n/10 glyph#2525 ......\glue 0.0 plus 1.0fil minus 1.0fil ....\hbox(0.0+0.0)x1.2, shifted -2.50027 .\mathoff *************** Compilation 1 of test file completed with exit status 0
{ "pile_set_name": "Github" }
{ Copyright 2019 Espressif Systems (Shanghai) PTE LTD SPDX-License-Identifier: Apache-2.0 } { ------------------------------ Helper functions from libcmdlinerunner.dll ------------------------------ } function ProcStart(cmdline, workdir: string): Longword; external 'proc_start@files:cmdlinerunner.dll cdecl'; function ProcGetExitCode(inst: Longword): DWORD; external 'proc_get_exit_code@files:cmdlinerunner.dll cdecl'; function ProcGetOutput(inst: Longword; dest: PAnsiChar; sz: DWORD): DWORD; external 'proc_get_output@files:cmdlinerunner.dll cdecl'; procedure ProcEnd(inst: Longword); external 'proc_end@files:cmdlinerunner.dll cdecl'; { ------------------------------ WinAPI functions ------------------------------ } #ifdef UNICODE #define AW "W" #else #define AW "A" #endif function SetEnvironmentVariable(lpName: string; lpValue: string): BOOL; external 'SetEnvironmentVariable{#AW}@kernel32.dll stdcall'; { ------------------------------ Functions to query the registry ------------------------------ } { Utility to search in HKLM and HKCU for an installation path. Looks in both 64-bit & 32-bit registry. } function GetInstallPath(key, valuename : String) : String; var value: String; begin Result := ''; if RegQueryStringValue(HKEY_LOCAL_MACHINE, key, valuename, value) then begin Result := value; exit; end; if RegQueryStringValue(HKEY_CURRENT_USER, key, valuename, value) then begin Result := value; exit; end; { This is 32-bit setup running on 64-bit Windows, but ESP-IDF can use 64-bit tools also } if IsWin64 and RegQueryStringValue(HKLM64, key, valuename, value) then begin Result := value; exit; end; if IsWin64 and RegQueryStringValue(HKCU64, key, valuename, value) then begin Result := value; exit; end; end; { ------------------------------ Function to exit from the installer ------------------------------ } procedure AbortInstallation(Message: String); begin MsgBox(Message, mbError, MB_OK); Abort(); end; { ------------------------------ File system related functions ------------------------------ } function DirIsEmpty(DirName: String): Boolean; var FindRec: TFindRec; begin Result := True; if FindFirst(DirName+'\*', FindRec) then begin try repeat if (FindRec.Name <> '.') and (FindRec.Name <> '..') then begin Result := False; break; end; until not FindNext(FindRec); finally FindClose(FindRec); end; end; end; type TFindFileCallback = procedure(Filename: String); procedure FindFileRecusive(Directory: string; FileName: string; Callback: TFindFileCallback); var FindRec: TFindRec; FilePath: string; begin if FindFirst(Directory + '\*', FindRec) then begin try repeat if (FindRec.Name = '.') or (FindRec.Name = '..') then continue; FilePath := Directory + '\' + FindRec.Name; if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0 then begin FindFileRecusive(FilePath, FileName, Callback); end else if CompareText(FindRec.Name, FileName) = 0 then begin Callback(FilePath); end; until not FindNext(FindRec); finally FindClose(FindRec); end; end; end; { ------------------------------ Version related functions ------------------------------ } function VersionExtractMajorMinor(Version: String; var Major: Integer; var Minor: Integer): Boolean; var Delim: Integer; MajorStr, MinorStr: String; OrigVersion, ExpectedPrefix: String; begin Result := False; OrigVersion := Version; Delim := Pos('.', Version); if Delim = 0 then exit; MajorStr := Version; Delete(MajorStr, Delim, Length(MajorStr)); Delete(Version, 1, Delim); Major := StrToInt(MajorStr); Delim := Pos('.', Version); if Delim = 0 then Delim := Length(MinorStr); MinorStr := Version; Delete(MinorStr, Delim, Length(MinorStr)); Delete(Version, 1, Delim); Minor := StrToInt(MinorStr); { Sanity check } ExpectedPrefix := IntToStr(Major) + '.' + IntToStr(Minor); if Pos(ExpectedPrefix, OrigVersion) <> 1 then begin Log('VersionExtractMajorMinor: version=' + OrigVersion + ', expected=' + ExpectedPrefix); exit; end; Result := True; end;
{ "pile_set_name": "Github" }
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ /* * This file is part of The Croco Library * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2.1 of the GNU Lesser 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. * * You should have received a copy of the GNU Lesser 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 * * Author: Dodji Seketeli. * See the COPYRIGHTS file for copyright information. */ #ifndef __CR_PARSING_LOCATION_H__ #define __CR_PARSING_LOCATION_H__ #include "cr-utils.h" G_BEGIN_DECLS /** *@file *The declaration of the CRParsingLocation *object. This object keeps track of line/column/byte offset/ *at which the parsing of a given CSS construction appears. */ typedef struct _CRParsingLocation CRParsingLocation; struct _CRParsingLocation { guint line ; guint column ; guint byte_offset ; } ; enum CRParsingLocationSerialisationMask { DUMP_LINE = 1, DUMP_COLUMN = 1 << 1, DUMP_BYTE_OFFSET = 1 << 2 } ; CRParsingLocation * cr_parsing_location_new (void) ; enum CRStatus cr_parsing_location_init (CRParsingLocation *a_this) ; enum CRStatus cr_parsing_location_copy (CRParsingLocation *a_to, CRParsingLocation const *a_from) ; gchar * cr_parsing_location_to_string (CRParsingLocation const *a_this, enum CRParsingLocationSerialisationMask a_mask) ; void cr_parsing_location_dump (CRParsingLocation const *a_this, enum CRParsingLocationSerialisationMask a_mask, FILE *a_fp) ; void cr_parsing_location_destroy (CRParsingLocation *a_this) ; G_END_DECLS #endif
{ "pile_set_name": "Github" }
[android-components](../../index.md) / [mozilla.components.browser.state.state.content](../index.md) / [DownloadState](index.md) / [status](./status.md) # status `val status: `[`Status`](-status/index.md) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/browser/state/src/main/java/mozilla/components/browser/state/state/content/DownloadState.kt#L38) The current status of the download. ### Property `status` - The current status of the download.
{ "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>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIconFile</key> <string></string> <key>CFBundleIdentifier</key> <string>com.airwindows.audiounit.${PRODUCT_NAME:identifier}</string> <key>CFBundleName</key> <string>${PROJECTNAMEASIDENTIFIER}</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> <string>BNDL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>Dthr</string> <key>CFBundleVersion</key> <string>1.0</string> <key>CSResourcesFileMapped</key> <true/> </dict> </plist>
{ "pile_set_name": "Github" }
// ========================================================== // Bitmap conversion routines // // Design and implementation by // - Riley McNiff ([email protected]) // // This file is part of FreeImage 3 // // COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES // THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE // OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED // CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT // THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY // SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL // PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER // THIS DISCLAIMER. // // Use at your own risk! // ========================================================== #include "FreeImage.h" #include "Utilities.h" // ---------------------------------------------------------- // internal conversions X to 4 bits // ---------------------------------------------------------- void DLL_CALLCONV FreeImage_ConvertLine1To4(BYTE *target, BYTE *source, int width_in_pixels) { BOOL hinibble = TRUE; for (int cols = 0; cols < width_in_pixels; cols++){ if (hinibble == TRUE){ target[cols >> 1] = ((source[cols >> 3] & (0x80 >> (cols & 0x07))) != 0 ? 15 : 0) << 4; } else { target[cols >> 1] |= ((source[cols >> 3] & (0x80 >> (cols & 0x07))) != 0 ? 15 : 0); } hinibble = !hinibble; } } void DLL_CALLCONV FreeImage_ConvertLine8To4(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette) { BOOL hinibble = TRUE; BYTE index; for (int cols = 0; cols < width_in_pixels; cols++){ index = GREY(palette[source[cols]].rgbRed, palette[source[cols]].rgbGreen, palette[source[cols]].rgbBlue); if (hinibble) { target[cols >> 1] = (index & 0xF0); } else { target[cols >> 1] |= (index >> 4); } hinibble = !hinibble; } } void DLL_CALLCONV FreeImage_ConvertLine16To4_555(BYTE *target, BYTE *source, int width_in_pixels) { WORD *bits = (WORD *)source; BOOL hinibble = TRUE; for (int cols = 0; cols < width_in_pixels; cols++) { if (hinibble) { target[cols >> 1] = GREY((((bits[cols] & FI16_555_RED_MASK) >> FI16_555_RED_SHIFT) * 0xFF) / 0x1F, (((bits[cols] & FI16_555_GREEN_MASK) >> FI16_555_GREEN_SHIFT) * 0xFF) / 0x1F, (((bits[cols] & FI16_555_BLUE_MASK) >> FI16_555_BLUE_SHIFT) * 0xFF) / 0x1F) & 0xF0; } else { target[cols >> 1] |= GREY((((bits[cols] & FI16_555_RED_MASK) >> FI16_555_RED_SHIFT) * 0xFF) / 0x1F, (((bits[cols] & FI16_555_GREEN_MASK) >> FI16_555_GREEN_SHIFT) * 0xFF) / 0x1F, (((bits[cols] & FI16_555_BLUE_MASK) >> FI16_555_BLUE_SHIFT) * 0xFF) / 0x1F) >> 4; } hinibble = !hinibble; } } void DLL_CALLCONV FreeImage_ConvertLine16To4_565(BYTE *target, BYTE *source, int width_in_pixels) { WORD *bits = (WORD *)source; BOOL hinibble = TRUE; for (int cols = 0; cols < width_in_pixels; cols++) { if (hinibble) { target[cols >> 1] = GREY((((bits[cols] & FI16_565_RED_MASK) >> FI16_565_RED_SHIFT) * 0xFF) / 0x1F, (((bits[cols] & FI16_565_GREEN_MASK) >> FI16_565_GREEN_SHIFT) * 0xFF) / 0x3F, (((bits[cols] & FI16_565_BLUE_MASK) >> FI16_565_BLUE_SHIFT) * 0xFF) / 0x1F) & 0xF0; } else { target[cols >> 1] |= GREY((((bits[cols] & FI16_565_RED_MASK) >> FI16_565_RED_SHIFT) * 0xFF) / 0x1F, (((bits[cols] & FI16_565_GREEN_MASK) >> FI16_565_GREEN_SHIFT) * 0xFF) / 0x3F, (((bits[cols] & FI16_565_BLUE_MASK) >> FI16_565_BLUE_SHIFT) * 0xFF) / 0x1F) >> 4; } hinibble = !hinibble; } } void DLL_CALLCONV FreeImage_ConvertLine24To4(BYTE *target, BYTE *source, int width_in_pixels) { BOOL hinibble = TRUE; for (int cols = 0; cols < width_in_pixels; cols++) { if (hinibble) { target[cols >> 1] = GREY(source[FI_RGBA_RED], source[FI_RGBA_GREEN], source[FI_RGBA_BLUE]) & 0xF0; } else { target[cols >> 1] |= GREY(source[FI_RGBA_RED], source[FI_RGBA_GREEN], source[FI_RGBA_BLUE]) >> 4; } source += 3; hinibble = !hinibble; } } void DLL_CALLCONV FreeImage_ConvertLine32To4(BYTE *target, BYTE *source, int width_in_pixels) { BOOL hinibble = TRUE; for (int cols = 0; cols < width_in_pixels; cols++) { if (hinibble) { target[cols >> 1] = GREY(source[FI_RGBA_RED], source[FI_RGBA_GREEN], source[FI_RGBA_BLUE]) & 0xF0; } else { target[cols >> 1] |= GREY(source[FI_RGBA_RED], source[FI_RGBA_GREEN], source[FI_RGBA_BLUE]) >> 4; } source += 4; hinibble = !hinibble; } } // ---------------------------------------------------------- // smart convert X to 4 bits // ---------------------------------------------------------- FIBITMAP * DLL_CALLCONV FreeImage_ConvertTo4Bits(FIBITMAP *dib) { if(!FreeImage_HasPixels(dib)) return NULL; const int bpp = FreeImage_GetBPP(dib); if(bpp != 4) { const int width = FreeImage_GetWidth(dib); const int height = FreeImage_GetHeight(dib); FIBITMAP *new_dib = FreeImage_Allocate(width, height, 4); if(new_dib == NULL) { return NULL; } // copy metadata from src to dst FreeImage_CloneMetadata(new_dib, dib); // Build a greyscale palette (*always* needed for image processing) RGBQUAD *new_pal = FreeImage_GetPalette(new_dib); for(int i = 0; i < 16; i++) { new_pal[i].rgbRed = (BYTE)((i << 4) + i); new_pal[i].rgbGreen = (BYTE)((i << 4) + i); new_pal[i].rgbBlue = (BYTE)((i << 4) + i); } switch(bpp) { case 1: { if(FreeImage_GetColorType(dib) == FIC_PALETTE) { // Copy the palette RGBQUAD *old_pal = FreeImage_GetPalette(dib); memcpy(&new_pal[0], &old_pal[0], sizeof(RGBQUAD)); memcpy(&new_pal[15], &old_pal[1], sizeof(RGBQUAD)); } else if(FreeImage_GetColorType(dib) == FIC_MINISWHITE) { // Reverse the grayscale palette for(int i = 0; i < 16; i++) { new_pal[i].rgbRed = new_pal[i].rgbGreen = new_pal[i].rgbBlue = (BYTE)(255 - ((i << 4) + i)); } } // Expand and copy the bitmap data for (int rows = 0; rows < height; rows++) { FreeImage_ConvertLine1To4(FreeImage_GetScanLine(new_dib, rows), FreeImage_GetScanLine(dib, rows), width); } return new_dib; } case 8 : { // Expand and copy the bitmap data for (int rows = 0; rows < height; rows++) { FreeImage_ConvertLine8To4(FreeImage_GetScanLine(new_dib, rows), FreeImage_GetScanLine(dib, rows), width, FreeImage_GetPalette(dib)); } return new_dib; } case 16 : { // Expand and copy the bitmap data for (int rows = 0; rows < height; rows++) { if ((FreeImage_GetRedMask(dib) == FI16_565_RED_MASK) && (FreeImage_GetGreenMask(dib) == FI16_565_GREEN_MASK) && (FreeImage_GetBlueMask(dib) == FI16_565_BLUE_MASK)) { FreeImage_ConvertLine16To4_565(FreeImage_GetScanLine(new_dib, rows), FreeImage_GetScanLine(dib, rows), width); } else { FreeImage_ConvertLine16To4_555(FreeImage_GetScanLine(new_dib, rows), FreeImage_GetScanLine(dib, rows), width); } } return new_dib; } case 24 : { // Expand and copy the bitmap data for (int rows = 0; rows < height; rows++) { FreeImage_ConvertLine24To4(FreeImage_GetScanLine(new_dib, rows), FreeImage_GetScanLine(dib, rows), width); } return new_dib; } case 32 : { // Expand and copy the bitmap data for (int rows = 0; rows < height; rows++) { FreeImage_ConvertLine32To4(FreeImage_GetScanLine(new_dib, rows), FreeImage_GetScanLine(dib, rows), width); } return new_dib; } } } return FreeImage_Clone(dib); }
{ "pile_set_name": "Github" }
# This file is distributed under the same license as the Django package. # # Translators: # Michael Wolf <[email protected]>, 2016 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-10-09 17:42+0200\n" "PO-Revision-Date: 2017-09-23 00:02+0000\n" "Last-Translator: Michael Wolf <[email protected]>\n" "Language-Team: Lower Sorbian (http://www.transifex.com/django/django/" "language/dsb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: dsb\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" "%100==4 ? 2 : 3);\n" msgid "Redirects" msgstr "Dalejpósrědnjenja" msgid "site" msgstr "sedło" msgid "redirect from" msgstr "dalejpósrědnjenje wót" msgid "" "This should be an absolute path, excluding the domain name. Example: '/" "events/search/'." msgstr "" "To by dejało absolutna sćažka byś, mimo domenowego mjenja. Pśikład: '/events/" "search/'." msgid "redirect to" msgstr "dalejpósrědnjenje do" msgid "" "This can be either an absolute path (as above) or a full URL starting with " "'http://'." msgstr "" "To móžo pak absolutna sćažka byś (ako górjejce) pak dopołny URL, kótaryž " "zachopina se z 'http://'." msgid "redirect" msgstr "dalejpósrědnjenje" msgid "redirects" msgstr "dalejpósrědnjenja"
{ "pile_set_name": "Github" }
{ "id": "sepia-puzzle-flooring", "name": "Sepia Puzzle Flooring", "games": { "nh": { "sellPrice": { "currency": "bells", "value": 362 }, "buyPrices": [ { "currency": "bells", "value": 1450 } ] } }, "category": "Flooring" }
{ "pile_set_name": "Github" }
// Copyright 2005, 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) #include <gtest/gtest.h> #include "sample4.h" // Tests the Increment() method. TEST(Counter, Increment) { Counter c; // EXPECT_EQ() evaluates its arguments exactly once, so they // can have side effects. EXPECT_EQ(0, c.Increment()); EXPECT_EQ(1, c.Increment()); EXPECT_EQ(2, c.Increment()); }
{ "pile_set_name": "Github" }
[29A045CE-ABA9060E-C:46] Name=Hydro Thunder (F) Cheat0="Always 1st",812C56A6 0001 Cheat1="Infinite\Time",812B52A0 42C8 Cheat2="Infinite\Boosts\Player 1",812C56AC 4190 Cheat3="Have All\Ships",50000702 0000,812B66B2 0101 Cheat4="Have All\Races",50000702 0000,812B66A4 0101 Cheat5="Infinite\Boosts\Player 2",812C59DC 4190
{ "pile_set_name": "Github" }
package analysisutils import ( "fmt" "go/ast" "reflect" "golang.org/x/tools/go/analysis" "golang.org/x/tools/go/analysis/passes/inspect" ) // StdlibFunctionCallExprAnalyzer returns an Analyzer for standard library function *ast.CallExpr func StdlibFunctionCallExprAnalyzer(analyzerName string, packagePath string, functionName string) *analysis.Analyzer { return &analysis.Analyzer{ Name: analyzerName, Doc: fmt.Sprintf("find %s.%s() calls for later passes", packagePath, functionName), Requires: []*analysis.Analyzer{ inspect.Analyzer, }, Run: StdlibFunctionCallExprRunner(packagePath, functionName), ResultType: reflect.TypeOf([]*ast.CallExpr{}), } }
{ "pile_set_name": "Github" }
#!/bin/sh dirList=`cd $1 && find lib tests -mindepth 1 -maxdepth 1 -type d` #echo "dirList="$dirList for dir in $dirList do gcnoList=`find $dir -name "*.gcno" -and \( -not -name "CMakeC*CompilerId.gcno" \)` #echo "gcnoList="$gcnoList for gcno in $gcnoList do #echo "gcno="$gcno srcName=`basename -s .gcno $gcno` #echo "srcName="$srcName src=`find $1/$dir -name $srcName` #echo "src="$src gcov -o $gcno $src done done
{ "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>ACPI</key> <dict> <key>DSDT</key> <dict> <key>Debug</key> <false/> <key>DropOEM_DSM</key> <false/> <key>ReuseFFFF</key> <false/> </dict> <key>SSDT</key> <dict> <key>DropOem</key> <false/> <key>Generate</key> <dict> <key>CStates</key> <true/> <key>PStates</key> <true/> </dict> </dict> </dict> <key>Boot</key> <dict> <key>Arguments</key> <string>-v dart=0</string> <key>Debug</key> <false/> <key>DefaultVolume</key> <string>macOS</string> <key>Legacy</key> <string>PBR</string> <key>Secure</key> <false/> <key>Timeout</key> <integer>0</integer> <key>XMPDetection</key> <false/> </dict> <key>Devices</key> <dict> <key>Audio</key> <dict> <key>Inject</key> <string>No</string> </dict> <key>USB</key> <dict> <key>AddClockID</key> <true/> <key>FixOwnership</key> <true/> <key>Inject</key> <true/> </dict> </dict> <key>DisableDrivers</key> <array> <string>Nothing</string> </array> <key>GUI</key> <dict> <key>Hide</key> <array> <string>BOOTX64.EFI</string> <string>Windows</string> </array> <key>Language</key> <string>zh_CN:0</string> <key>Mouse</key> <dict> <key>DoubleClick</key> <integer>500</integer> <key>Enabled</key> <true/> <key>Mirror</key> <false/> <key>Speed</key> <integer>8</integer> </dict> <key>Scan</key> <dict> <key>Entries</key> <true/> <key>Legacy</key> <true/> <key>Linux</key> <false/> <key>Tool</key> <true/> </dict> <key>Theme</key> <string>black_green</string> </dict> <key>Graphics</key> <dict> <key>Inject</key> <dict> <key>ATI</key> <false/> <key>Intel</key> <false/> <key>NVidia</key> <false/> </dict> </dict> <key>KernelAndKextPatches</key> <dict> <key>AppleIntelCPUPM</key> <true/> <key>AppleRTC</key> <true/> <key>KernelPm</key> <true/> <key>KextsToPatch</key> <array> <dict> <key>Comment</key> <string>External icons patch</string> <key>Disabled</key> <false/> <key>Find</key> <data> RXh0ZXJuYWw= </data> <key>Name</key> <string>AppleAHCIPort</string> <key>Replace</key> <data> SW50ZXJuYWw= </data> </dict> <dict> <key>Comment</key> <string>change 15 port limit to 30 in AppleUSBXHCIPCI</string> <key>Disabled</key> <false/> <key>Find</key> <data> g710////EA== </data> <key>Name</key> <string>AppleUSBXHCIPCI</string> <key>Replace</key> <data> g710////Gw== </data> </dict> </array> </dict> <key>RtVariables</key> <dict> <key>BooterConfig</key> <string>0x28</string> <key>CsrActiveConfig</key> <string>0x67</string> </dict> <key>SMBIOS</key> <dict> <key>BiosReleaseDate</key> <string>08/08/2017</string> <key>BiosVendor</key> <string>Apple Inc.</string> <key>BiosVersion</key> <string>MP61.88Z.0120.B00.1708080652</string> <key>Board-ID</key> <string>Mac-F60DEB81FF30ACF6</string> <key>BoardManufacturer</key> <string>Apple Inc.</string> <key>BoardSerialNumber</key> <string>F5K634405GUF2FRAD</string> <key>BoardType</key> <integer>11</integer> <key>BoardVersion</key> <string>MacPro6,1</string> <key>ChassisAssetTag</key> <string>Pro-Enclosure</string> <key>ChassisManufacturer</key> <string>Apple Inc.</string> <key>ChassisType</key> <string>0x02</string> <key>Family</key> <string>MacPro</string> <key>FirmwareFeatures</key> <string>0xE80FE136</string> <key>FirmwareFeaturesMask</key> <string>0xFF1FFF3F</string> <key>LocationInChassis</key> <string>Part Component</string> <key>Manufacturer</key> <string>Apple Inc.</string> <key>Mobile</key> <false/> <key>PlatformFeature</key> <string>0x04</string> <key>ProductName</key> <string>MacPro6,1</string> <key>SerialNumber</key> <string>F5KS8R6DF9VM</string> <key>Version</key> <string>1.0</string> </dict> <key>SystemParameters</key> <dict> <key>InjectKexts</key> <string>Detect</string> <key>InjectSystemID</key> <true/> </dict> </dict> </plist>
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: fa9b3e3e21af64ed4899fd281d15ba00 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {fileID: 2800000, guid: f4c59e5c7eed94aefa9f60ed1e800dfb, type: 3} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
#include "robomongo/gui/dialogs/FunctionTextEditor.h" #include <QApplication> #include <QHBoxLayout> #include <QLineEdit> #include <QPushButton> #include <QMessageBox> #include <QLabel> #include <QDialogButtonBox> #include <Qsci/qscilexerjavascript.h> #include <Qsci/qsciscintilla.h> #include "robomongo/gui/editors/JSLexer.h" #include "robomongo/gui/editors/FindFrame.h" #include "robomongo/gui/editors/PlainJavaScriptEditor.h" #include "robomongo/gui/widgets/workarea/IndicatorLabel.h" #include "robomongo/gui/GuiRegistry.h" #include "robomongo/core/utils/QtUtils.h" namespace Robomongo { FunctionTextEditor::FunctionTextEditor(const QString &server, const QString &database, const MongoFunction &function, QWidget *parent) : QDialog(parent), _function(function) { setMinimumWidth(700); setMinimumHeight(550); Indicator *databaseIndicator = new Indicator(GuiRegistry::instance().databaseIcon(), database); Indicator *serverIndicator = new Indicator(GuiRegistry::instance().serverIcon(), server); _nameEdit = new QLineEdit(QtUtils::toQString(function.name())); _queryText = new FindFrame(this); _configureQueryText(); _queryText->sciScintilla()->setText(QtUtils::toQString(_function.code())); QFrame *hline = new QFrame(this); hline->setFrameShape(QFrame::HLine); hline->setFrameShadow(QFrame::Sunken); QHBoxLayout *hlayout = new QHBoxLayout(); hlayout->setContentsMargins(2, 0, 5, 1); hlayout->setSpacing(0); hlayout->addWidget(serverIndicator, 0, Qt::AlignLeft); hlayout->addWidget(databaseIndicator, 0, Qt::AlignLeft); hlayout->addStretch(1); QDialogButtonBox *buttonBox = new QDialogButtonBox(this); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save); VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()))); VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()))); QHBoxLayout *bottomlayout = new QHBoxLayout(); bottomlayout->addStretch(1); bottomlayout->addWidget(buttonBox); QVBoxLayout *layout = new QVBoxLayout(); layout->addLayout(hlayout); layout->addWidget(hline); layout->addWidget(new QLabel("Name:")); layout->addWidget(_nameEdit); layout->addWidget(new QLabel("Code:")); layout->addWidget(_queryText); layout->addLayout(bottomlayout); setLayout(layout); _nameEdit->setFocus(); } void FunctionTextEditor::setCursorPosition(int line, int column) { _queryText->sciScintilla()->setCursorPosition(line, column); } void FunctionTextEditor::setCode(const QString &code) { _queryText->sciScintilla()->setText(code); } void FunctionTextEditor::accept() { if (_nameEdit->text().isEmpty() && _queryText->sciScintilla()->text().isEmpty()) return; _function.setName(QtUtils::toStdString(_nameEdit->text())); _function.setCode(QtUtils::toStdString(_queryText->sciScintilla()->text())); BaseClass::accept(); } /* ** Configure QsciScintilla query widget */ void FunctionTextEditor::_configureQueryText() { const QFont &textFont = GuiRegistry::instance().font(); QsciLexerJavaScript *javaScriptLexer = new JSLexer(this); javaScriptLexer->setFont(textFont); _queryText->sciScintilla()->setAppropriateBraceMatching(); _queryText->sciScintilla()->setFont(textFont); _queryText->sciScintilla()->setPaper(QColor(255, 0, 0, 127)); _queryText->sciScintilla()->setLexer(javaScriptLexer); _queryText->sciScintilla()->setWrapMode((QsciScintilla::WrapMode)QsciScintilla::SC_WRAP_WORD); _queryText->sciScintilla()->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); _queryText->sciScintilla()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); _queryText->sciScintilla()->setStyleSheet("QFrame { background-color: rgb(73, 76, 78); border: 1px solid #c7c5c4; border-radius: 4px; margin: 0px; padding: 0px;}"); } }
{ "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="ko"> <head> <!-- Generated by javadoc (1.8.0_191) on Tue Mar 03 19:55:19 KST 2020 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>GsoHeaderProperty (HWP Library 1.0.1 API)</title> <meta name="date" content="2020-03-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="GsoHeaderProperty (HWP Library 1.0.1 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,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":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="class-use/GsoHeaderProperty.html">Use</a></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>Prev&nbsp;Class</li> <li><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/HeightCriterion.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html" target="_top">Frames</a></li> <li><a href="GsoHeaderProperty.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">kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso</div> <h2 title="Class GsoHeaderProperty" class="title">Class GsoHeaderProperty</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>kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.GsoHeaderProperty</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="typeNameLabel">GsoHeaderProperty</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">그리기 객체 컨트롤의 속성을 나타내는 객체</div> <dl> <dt><span class="simpleTagLabel">Author:</span></dt> <dd>neolord</dd> </dl> </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="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#GsoHeaderProperty--">GsoHeaderProperty</a></span>()</code> <div class="block">생성자</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><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/HeightCriterion.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">HeightCriterion</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#getHeightCriterion--">getHeightCriterion</a></span>()</code> <div class="block">오브젝트 높이의 기준을 반환한다 (18~19 bit)</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/RelativeArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">RelativeArrange</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#getHorzRelativeArrange--">getHorzRelativeArrange</a></span>()</code> <div class="block">HorzRelTo에 대한 상대적인 배열방식을 반환한다. (10~12 bit)</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/HorzRelTo.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">HorzRelTo</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#getHorzRelTo--">getHorzRelTo</a></span>()</code> <div class="block">가로 위치의 기준을 반환한다. (8~9 bit)</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/ObjectNumberSort.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">ObjectNumberSort</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#getObjectNumberSort--">getObjectNumberSort</a></span>()</code> <div class="block">개체가 속하는 번호 범주를 반환한다. (26~28 bit)</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/TextFlowMethod.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">TextFlowMethod</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#getTextFlowMethod--">getTextFlowMethod</a></span>()</code> <div class="block">오브젝트 주위를 텍스트가 어떻게 흘러갈지 지정하는 옵션을 반환한다. (21~23 bit)</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/TextHorzArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">TextHorzArrange</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#getTextHorzArrange--">getTextHorzArrange</a></span>()</code> <div class="block">오브젝트의 좌/우 어느 쪽에 글을 배치할지 지정하는 옵션을 반환한다. (24~25 bit)</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#getValue--">getValue</a></span>()</code> <div class="block">파일에 저장되는 정수값을 반환한다.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/RelativeArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">RelativeArrange</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#getVertRelativeArrange--">getVertRelativeArrange</a></span>()</code> <div class="block">세로 위치의 기준에 대한 상대적인 배열방식을 반환한다. (5~7 bit)</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/VertRelTo.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">VertRelTo</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#getVertRelTo--">getVertRelTo</a></span>()</code> <div class="block">세로 위치의 기준을 반환한다. (3~4 bit)</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/WidthCriterion.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">WidthCriterion</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#getWidthCriterion--">getWidthCriterion</a></span>()</code> <div class="block">오브젝트 폭의 기준을 반환한다. (15~17 bit)</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#isAllowOverlap--">isAllowOverlap</a></span>()</code> <div class="block">다른 오브젝트와 겹치는 것을 허용할지 여부을 반한한다. (14 bit)</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#isApplyLineSpace--">isApplyLineSpace</a></span>()</code> <div class="block">줄 간격에 영향을 줄지 여부를 반환한다. (2 bit)</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#isLikeWord--">isLikeWord</a></span>()</code> <div class="block">글자처럼 취급 여부을 반환한다. (0 bit)</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#isProtectSize--">isProtectSize</a></span>()</code> <div class="block">VertRelTo이 para일 때 크기 보호 여부을 반환한다. (20 bit)</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#isVertRelToParaLimit--">isVertRelToParaLimit</a></span>()</code> <div class="block">VertRelTo이 ‘para’일 때 오브젝트의 세로 위치를 본문 영역으로 제한할지 여부를 반환한다. (13 bit)</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setAllowOverlap-boolean-">setAllowOverlap</a></span>(boolean&nbsp;allowOverlap)</code> <div class="block">다른 오브젝트와 겹치는 것을 허용할지 여부을 설정한다. (14 bit)</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setApplyLineSpace-boolean-">setApplyLineSpace</a></span>(boolean&nbsp;applyLineSpace)</code> <div class="block">줄 간격에 영향을 줄지 여부를 설정한다. (2 bit)</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setHeightCriterion-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.HeightCriterion-">setHeightCriterion</a></span>(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/HeightCriterion.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">HeightCriterion</a>&nbsp;heightCriterion)</code> <div class="block">오브젝트 높이의 기준을 설정한다. (18~19 bit)</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setHorzRelativeArrange-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.RelativeArrange-">setHorzRelativeArrange</a></span>(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/RelativeArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">RelativeArrange</a>&nbsp;horzRelativeArrange)</code> <div class="block">HorzRelTo에 대한 상대적인 배열방식을 설정한다. (10~12 bit)</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setHorzRelTo-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.HorzRelTo-">setHorzRelTo</a></span>(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/HorzRelTo.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">HorzRelTo</a>&nbsp;horzRelTo)</code> <div class="block">가로 위치의 기준을 설정한다. (8~9 bit)</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setLikeWord-boolean-">setLikeWord</a></span>(boolean&nbsp;likeWord)</code> <div class="block">글자처럼 취급 여부를 설정한다. (0 bit)</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setObjectNumberSort-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.ObjectNumberSort-">setObjectNumberSort</a></span>(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/ObjectNumberSort.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">ObjectNumberSort</a>&nbsp;objectNumberSort)</code> <div class="block">개체가 속하는 번호 범주를 설정한다. (26~28 bit)</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setProtectSize-boolean-">setProtectSize</a></span>(boolean&nbsp;protectSize)</code> <div class="block">VertRelTo이 para일 때 크기 보호 여부를 설정한다.</div> </td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setTextFlowMethod-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.TextFlowMethod-">setTextFlowMethod</a></span>(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/TextFlowMethod.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">TextFlowMethod</a>&nbsp;textFlowMethod)</code> <div class="block">오브젝트 주위를 텍스트가 어떻게 흘러갈지 지정하는 옵션을 설정한다. (21~23 bit)</div> </td> </tr> <tr id="i24" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setTextHorzArrange-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.TextHorzArrange-">setTextHorzArrange</a></span>(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/TextHorzArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">TextHorzArrange</a>&nbsp;textHorzArrange)</code> <div class="block">오브젝트의 좌/우 어느 쪽에 글을 배치할지 지정하는 옵션을 설정한다. (24~25 bit)</div> </td> </tr> <tr id="i25" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setValue-long-">setValue</a></span>(long&nbsp;value)</code> <div class="block">파일에 저장되는 정수값을 설정한다.</div> </td> </tr> <tr id="i26" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setVertRelativeArrange-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.RelativeArrange-">setVertRelativeArrange</a></span>(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/RelativeArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">RelativeArrange</a>&nbsp;vertRelativeArrange)</code> <div class="block">세로 위치의 기준에 대한 상대적인 배열방식를 설정한다. (5~7 bit)</div> </td> </tr> <tr id="i27" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setVertRelTo-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.VertRelTo-">setVertRelTo</a></span>(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/VertRelTo.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">VertRelTo</a>&nbsp;vertRelTo)</code> <div class="block">세로 위치의 기준을 설정한다. (3~4 bit)</div> </td> </tr> <tr id="i28" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setVertRelToParaLimit-boolean-">setVertRelToParaLimit</a></span>(boolean&nbsp;vertRelToParaLimit)</code> <div class="block">VertRelTo이 ‘para’일 때 오브젝트의 세로 위치를 본문 영역으로 제한할지 여부을 설정한다.</div> </td> </tr> <tr id="i29" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html#setWidthCriterion-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.WidthCriterion-">setWidthCriterion</a></span>(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/WidthCriterion.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">WidthCriterion</a>&nbsp;widthCriterion)</code> <div class="block">오브젝트 폭의 기준을 설정한다. (15~17 bit)</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="GsoHeaderProperty--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>GsoHeaderProperty</h4> <pre>public&nbsp;GsoHeaderProperty()</pre> <div class="block">생성자</div> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getValue--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getValue</h4> <pre>public&nbsp;long&nbsp;getValue()</pre> <div class="block">파일에 저장되는 정수값을 반환한다.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>파일에 저장되는 정수값</dd> </dl> </li> </ul> <a name="setValue-long-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setValue</h4> <pre>public&nbsp;void&nbsp;setValue(long&nbsp;value)</pre> <div class="block">파일에 저장되는 정수값을 설정한다.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - 파일에 저장되는 정수값</dd> </dl> </li> </ul> <a name="isLikeWord--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isLikeWord</h4> <pre>public&nbsp;boolean&nbsp;isLikeWord()</pre> <div class="block">글자처럼 취급 여부을 반환한다. (0 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>글자처럼 취급 여부</dd> </dl> </li> </ul> <a name="setLikeWord-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setLikeWord</h4> <pre>public&nbsp;void&nbsp;setLikeWord(boolean&nbsp;likeWord)</pre> <div class="block">글자처럼 취급 여부를 설정한다. (0 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>likeWord</code> - 글자처럼 취급 여부</dd> </dl> </li> </ul> <a name="isApplyLineSpace--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isApplyLineSpace</h4> <pre>public&nbsp;boolean&nbsp;isApplyLineSpace()</pre> <div class="block">줄 간격에 영향을 줄지 여부를 반환한다. (2 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>줄 간격에 영향을 줄지 여부</dd> </dl> </li> </ul> <a name="setApplyLineSpace-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setApplyLineSpace</h4> <pre>public&nbsp;void&nbsp;setApplyLineSpace(boolean&nbsp;applyLineSpace)</pre> <div class="block">줄 간격에 영향을 줄지 여부를 설정한다. (2 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>applyLineSpace</code> - 줄 간격에 영향을 줄지 여부</dd> </dl> </li> </ul> <a name="getVertRelTo--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getVertRelTo</h4> <pre>public&nbsp;<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/VertRelTo.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">VertRelTo</a>&nbsp;getVertRelTo()</pre> <div class="block">세로 위치의 기준을 반환한다. (3~4 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>세로 위치의 기준</dd> </dl> </li> </ul> <a name="setVertRelTo-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.VertRelTo-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setVertRelTo</h4> <pre>public&nbsp;void&nbsp;setVertRelTo(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/VertRelTo.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">VertRelTo</a>&nbsp;vertRelTo)</pre> <div class="block">세로 위치의 기준을 설정한다. (3~4 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>vertRelTo</code> - 세로 위치의 기준</dd> </dl> </li> </ul> <a name="getVertRelativeArrange--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getVertRelativeArrange</h4> <pre>public&nbsp;<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/RelativeArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">RelativeArrange</a>&nbsp;getVertRelativeArrange()</pre> <div class="block">세로 위치의 기준에 대한 상대적인 배열방식을 반환한다. (5~7 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>세로 위치의 기준에 대한 상대적인 배열방식</dd> </dl> </li> </ul> <a name="setVertRelativeArrange-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.RelativeArrange-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setVertRelativeArrange</h4> <pre>public&nbsp;void&nbsp;setVertRelativeArrange(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/RelativeArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">RelativeArrange</a>&nbsp;vertRelativeArrange)</pre> <div class="block">세로 위치의 기준에 대한 상대적인 배열방식를 설정한다. (5~7 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>vertRelativeArrange</code> - 세로 위치의 기준에 대한 상대적인 배열방식</dd> </dl> </li> </ul> <a name="getHorzRelTo--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHorzRelTo</h4> <pre>public&nbsp;<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/HorzRelTo.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">HorzRelTo</a>&nbsp;getHorzRelTo()</pre> <div class="block">가로 위치의 기준을 반환한다. (8~9 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>가로 위치의 기준</dd> </dl> </li> </ul> <a name="setHorzRelTo-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.HorzRelTo-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setHorzRelTo</h4> <pre>public&nbsp;void&nbsp;setHorzRelTo(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/HorzRelTo.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">HorzRelTo</a>&nbsp;horzRelTo)</pre> <div class="block">가로 위치의 기준을 설정한다. (8~9 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>horzRelTo</code> - 가로 위치의 기준</dd> </dl> </li> </ul> <a name="getHorzRelativeArrange--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHorzRelativeArrange</h4> <pre>public&nbsp;<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/RelativeArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">RelativeArrange</a>&nbsp;getHorzRelativeArrange()</pre> <div class="block">HorzRelTo에 대한 상대적인 배열방식을 반환한다. (10~12 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>HorzRelTo에 대한 상대적인 배열방식</dd> </dl> </li> </ul> <a name="setHorzRelativeArrange-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.RelativeArrange-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setHorzRelativeArrange</h4> <pre>public&nbsp;void&nbsp;setHorzRelativeArrange(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/RelativeArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">RelativeArrange</a>&nbsp;horzRelativeArrange)</pre> <div class="block">HorzRelTo에 대한 상대적인 배열방식을 설정한다. (10~12 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>horzRelativeArrange</code> - HorzRelTo에 대한 상대적인 배열방식</dd> </dl> </li> </ul> <a name="isVertRelToParaLimit--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isVertRelToParaLimit</h4> <pre>public&nbsp;boolean&nbsp;isVertRelToParaLimit()</pre> <div class="block">VertRelTo이 ‘para’일 때 오브젝트의 세로 위치를 본문 영역으로 제한할지 여부를 반환한다. (13 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>VertRelTo이 ‘para’일 때 오브젝트의 세로 위치를 본문 영역으로 제한할지 여부</dd> </dl> </li> </ul> <a name="setVertRelToParaLimit-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setVertRelToParaLimit</h4> <pre>public&nbsp;void&nbsp;setVertRelToParaLimit(boolean&nbsp;vertRelToParaLimit)</pre> <div class="block">VertRelTo이 ‘para’일 때 오브젝트의 세로 위치를 본문 영역으로 제한할지 여부을 설정한다.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>vertRelToParaLimit</code> - VertRelTo이 ‘para’일 때 오브젝트의 세로 위치를 본문 영역으로 제한할지 여부</dd> </dl> </li> </ul> <a name="isAllowOverlap--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isAllowOverlap</h4> <pre>public&nbsp;boolean&nbsp;isAllowOverlap()</pre> <div class="block">다른 오브젝트와 겹치는 것을 허용할지 여부을 반한한다. (14 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>다른 오브젝트와 겹치는 것을 허용할지 여부</dd> </dl> </li> </ul> <a name="setAllowOverlap-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setAllowOverlap</h4> <pre>public&nbsp;void&nbsp;setAllowOverlap(boolean&nbsp;allowOverlap)</pre> <div class="block">다른 오브젝트와 겹치는 것을 허용할지 여부을 설정한다. (14 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>allowOverlap</code> - 다른 오브젝트와 겹치는 것을 허용할지 여부</dd> </dl> </li> </ul> <a name="getWidthCriterion--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getWidthCriterion</h4> <pre>public&nbsp;<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/WidthCriterion.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">WidthCriterion</a>&nbsp;getWidthCriterion()</pre> <div class="block">오브젝트 폭의 기준을 반환한다. (15~17 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>오브젝트 폭의 기준</dd> </dl> </li> </ul> <a name="setWidthCriterion-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.WidthCriterion-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setWidthCriterion</h4> <pre>public&nbsp;void&nbsp;setWidthCriterion(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/WidthCriterion.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">WidthCriterion</a>&nbsp;widthCriterion)</pre> <div class="block">오브젝트 폭의 기준을 설정한다. (15~17 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>widthCriterion</code> - 오브젝트 폭의 기준</dd> </dl> </li> </ul> <a name="getHeightCriterion--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHeightCriterion</h4> <pre>public&nbsp;<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/HeightCriterion.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">HeightCriterion</a>&nbsp;getHeightCriterion()</pre> <div class="block">오브젝트 높이의 기준을 반환한다 (18~19 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>오브젝트 높이의 기준</dd> </dl> </li> </ul> <a name="setHeightCriterion-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.HeightCriterion-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setHeightCriterion</h4> <pre>public&nbsp;void&nbsp;setHeightCriterion(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/HeightCriterion.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">HeightCriterion</a>&nbsp;heightCriterion)</pre> <div class="block">오브젝트 높이의 기준을 설정한다. (18~19 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>heightCriterion</code> - 오브젝트 높이의 기준</dd> </dl> </li> </ul> <a name="isProtectSize--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isProtectSize</h4> <pre>public&nbsp;boolean&nbsp;isProtectSize()</pre> <div class="block">VertRelTo이 para일 때 크기 보호 여부을 반환한다. (20 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>VertRelTo이 para일 때 크기 보호 여부</dd> </dl> </li> </ul> <a name="setProtectSize-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setProtectSize</h4> <pre>public&nbsp;void&nbsp;setProtectSize(boolean&nbsp;protectSize)</pre> <div class="block">VertRelTo이 para일 때 크기 보호 여부를 설정한다.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>protectSize</code> - VertRelTo이 para일 때 크기 보호 여부</dd> </dl> </li> </ul> <a name="getTextFlowMethod--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTextFlowMethod</h4> <pre>public&nbsp;<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/TextFlowMethod.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">TextFlowMethod</a>&nbsp;getTextFlowMethod()</pre> <div class="block">오브젝트 주위를 텍스트가 어떻게 흘러갈지 지정하는 옵션을 반환한다. (21~23 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>오브젝트 주위를 텍스트가 어떻게 흘러갈지 지정하는 옵션</dd> </dl> </li> </ul> <a name="setTextFlowMethod-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.TextFlowMethod-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setTextFlowMethod</h4> <pre>public&nbsp;void&nbsp;setTextFlowMethod(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/TextFlowMethod.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">TextFlowMethod</a>&nbsp;textFlowMethod)</pre> <div class="block">오브젝트 주위를 텍스트가 어떻게 흘러갈지 지정하는 옵션을 설정한다. (21~23 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>textFlowMethod</code> - 오브젝트 주위를 텍스트가 어떻게 흘러갈지 지정하는 옵션</dd> </dl> </li> </ul> <a name="getTextHorzArrange--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTextHorzArrange</h4> <pre>public&nbsp;<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/TextHorzArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">TextHorzArrange</a>&nbsp;getTextHorzArrange()</pre> <div class="block">오브젝트의 좌/우 어느 쪽에 글을 배치할지 지정하는 옵션을 반환한다. (24~25 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>오브젝트의 좌/우 어느 쪽에 글을 배치할지 지정하는 옵션</dd> </dl> </li> </ul> <a name="setTextHorzArrange-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.TextHorzArrange-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setTextHorzArrange</h4> <pre>public&nbsp;void&nbsp;setTextHorzArrange(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/TextHorzArrange.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">TextHorzArrange</a>&nbsp;textHorzArrange)</pre> <div class="block">오브젝트의 좌/우 어느 쪽에 글을 배치할지 지정하는 옵션을 설정한다. (24~25 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>textHorzArrange</code> - 오브젝트의 좌/우 어느 쪽에 글을 배치할지 지정하는 옵션</dd> </dl> </li> </ul> <a name="getObjectNumberSort--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getObjectNumberSort</h4> <pre>public&nbsp;<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/ObjectNumberSort.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">ObjectNumberSort</a>&nbsp;getObjectNumberSort()</pre> <div class="block">개체가 속하는 번호 범주를 반환한다. (26~28 bit)</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>개체가 속하는 번호 범주</dd> </dl> </li> </ul> <a name="setObjectNumberSort-kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso.ObjectNumberSort-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>setObjectNumberSort</h4> <pre>public&nbsp;void&nbsp;setObjectNumberSort(<a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/ObjectNumberSort.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso">ObjectNumberSort</a>&nbsp;objectNumberSort)</pre> <div class="block">개체가 속하는 번호 범주를 설정한다. (26~28 bit)</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>objectNumberSort</code> - 개체가 속하는 번호 범주</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="class-use/GsoHeaderProperty.html">Use</a></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>Prev&nbsp;Class</li> <li><a href="../../../../../../../../kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/HeightCriterion.html" title="enum in kr.dogfoot.hwplib.object.bodytext.control.ctrlheader.gso"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?kr/dogfoot/hwplib/object/bodytext/control/ctrlheader/gso/GsoHeaderProperty.html" target="_top">Frames</a></li> <li><a href="GsoHeaderProperty.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 ======= --> <p class="legalCopy"><small>Copyright &#169; 2020. All rights reserved.</small></p> </body> </html>
{ "pile_set_name": "Github" }
apiVersion: v1 kind: Service metadata: name: apiv2 spec: ports: - name: apiv2 protocol: "TCP" port: 31415 selector: {} --- apiVersion: v1 kind: Service metadata: name: lmtpd spec: ports: - name: lmtpd protocol: "TCP" port: 2525 selector: {} --- kind: Endpoints apiVersion: v1 metadata: name: apiv2 subsets: - addresses: - ip: 172.17.0.1 ports: - port: 31415 name: "apiv2" --- kind: Endpoints apiVersion: v1 metadata: name: lmtpd subsets: - addresses: - ip: 172.17.0.1 ports: - port: 2525 name: "lmtpd"
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: dd7302bc1ae794849a4709f37390df95 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
it('should check ng-bind', function() { var nameInput = element(by.model('name')); expect(element(by.binding('name')).getText()).toBe('Whirled'); nameInput.clear(); nameInput.sendKeys('world'); expect(element(by.binding('name')).getText()).toBe('world'); });
{ "pile_set_name": "Github" }
**Are you the copyright holder or authorized to act on the copyright owner's behalf?** Yes, I am authorized to act on the copyright owner's behalf. **Please describe the nature of your copyright ownership or authorization to act on the owner's behalf.** I am writing on behalf of CASIO, which is a member of REACT (also known as the Anti-Counterfeiting Network ). REACT actively fights the trade-in counterfeiting products on behalf of its members. Additional information about our organization can be found at www.react.org. **Please provide a detailed description of the original copyrighted work that has allegedly been infringed. If possible, include a URL to where it is posted online.** It came to our attention that the below-mentioned repository is using copyrighted source code in order to modify Casio's copyrighted program. Link to the original content: https://support.casio.com/en/support/download.php?cid=004&pid=729 **What files should be taken down? Please provide URLs for each file, or if the entire repository, the repository’s URL.** The entire repository is infringing. In accordance with your Guide, I explicitly confirm that all of the content at the URL infringes. Repository URL: https://github.com/nulldotptr/casioex **Have you searched for any forks of the allegedly infringing files or repositories? Each fork is a distinct repository and must be identified separately if you believe it is infringing and wish to have it taken down.** The code the repository contains is proprietary and not to be publicly published. The hosted content is a direct, literal copy of our client’s work. **Is the work licensed under an open source license? If so, which open source license? Are the allegedly infringing files being used under the open source license, or are they in violation of the license?** The proprietary, copyrighted, nature of the code is, inter alia, evidenced by the reference to Casio domains and internal properties. **What would be the best solution for the alleged infringement? Are there specific changes the other person can make other than removal? Can the repository be made private?** I hereby summon you to take expeditious action: to remove or to disable access to the infringing content immediately, but in any case no later than ten days as of today. **Do you have the alleged infringer’s contact information? If so, please provide it.** We were not able to reach this user directly for they have not included up-to-date contact information in the repo or their profile page. **I have a good faith belief that use of the copyrighted materials described above on the infringing web pages is not authorized by the copyright owner, or its agent, or the law.** **I have taken <a href="https://www.lumendatabase.org/topics/22">fair use</a> into consideration.** **I swear, under penalty of perjury, that the information in this notification is accurate and that I am the copyright owner, or am authorized to act on behalf of the owner, of an exclusive right that is allegedly infringed.** **I have read and understand GitHub's <a href="https://help.github.com/articles/guide-to-submitting-a-dmca-takedown-notice/">Guide to Submitting a DMCA Takedown Notice</a>.** **So that we can get back to you, please provide either your telephone number or physical address.** Telephone number: [private] | Physical Address: [private] **Please type your full legal name below to sign this request.** [private]
{ "pile_set_name": "Github" }
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 19 AND `SourceEntry` IN (13408,13409,13410,13411); INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES (19, 0, 13408, 0, 0, 15, 0, 1503, 0, 0, 0, 0, '', 'Hellfire Fortifications - Alliance -All classes other than dk'), (19, 0, 13409, 0, 0, 15, 0, 1503, 0, 0, 0, 0, '', 'Hellfire Fortifications - Horde -All classes other than dk'), (19, 0, 13410, 0, 0, 15, 0, 32, 0, 0, 0, 0, '', 'Hellfire Fortifications - Alliance -Only dk'), (19, 0, 13411, 0, 0, 15, 0, 32, 0, 0, 0, 0, '', 'Hellfire Fortifications - Horde -Only dk');
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -triple i386-unknown-unknown -O3 -emit-llvm %s -o - | FileCheck %s // CHECK: ret i32 9 struct s0 { int *var; int addend; }; static void f0(struct s0 *p) { *p->var += p->addend; } int f1(void) { int var = 0; { struct s0 x __attribute__((cleanup(f0))) = { &var, 2 }; struct s0 y __attribute__((cleanup(f0))) = { &var, 3 }; { struct s0 y __attribute__((cleanup(f0))) = { &var, 4 }; } } return var; }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 25 2017 03:49:04). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <objc/NSObject.h> #import "TNodeObserverProtocol-Protocol.h" @class NSString, TBrowserContainerController, TWindowHistoryEntry; @interface TWindowHistory : NSObject <TNodeObserverProtocol> { struct TNSRef<NSMutableArray, void> _historyList; long long _historyPosition; struct shared_ptr<TNodeObserverCocoaBridge> _nodeObserver; struct TNSWeakPtr<TBrowserContainerController, void> _weakController; } @property(nonatomic) long long historyPosition; // @synthesize historyPosition=_historyPosition; - (id).cxx_construct; - (void).cxx_destruct; - (void)nodeObserver:(struct TNodeObserver *)arg1 nodeMoved:(const struct TFENode *)arg2; - (void)nodeObserver:(struct TNodeObserver *)arg1 nodeDeleted:(const struct TFENode *)arg2 fromObservedNode:(const struct TFENode *)arg3; - (id)currentEntry; - (void)updateCurrentEntryWindowState:(id)arg1; - (void)startObservingNodes:(const struct TFENodeVector *)arg1; - (void)stopObservingNodes:(const struct TFENodeVector *)arg1; - (void)removeNodeFromHistory:(const struct TFENode *)arg1; - (void)addToHistory:(const struct TFENodeVector *)arg1 windowState:(id)arg2; @property(readonly, nonatomic) TWindowHistoryEntry *next; @property(readonly, nonatomic) TWindowHistoryEntry *previous; @property(readonly, nonatomic) _Bool atEnd; @property(readonly, nonatomic) _Bool atBeginning; - (long long)endPosition; - (void)removeEntry:(id)arg1; - (id)entryAtPosition:(long long)arg1; @property(readonly, nonatomic) long long entryCount; @property __weak TBrowserContainerController *controller; // @dynamic controller; - (void)aboutToTearDown; - (void)dealloc; - (id)initWithBrowserContainer:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
{ "pile_set_name": "Github" }
glabel func_80AEC93C /* 01D2C 80AEC93C 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 /* 01D30 80AEC940 AFB00028 */ sw $s0, 0x0028($sp) /* 01D34 80AEC944 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 01D38 80AEC948 10A00019 */ beq $a1, $zero, .L80AEC9B0 /* 01D3C 80AEC94C AFBF002C */ sw $ra, 0x002C($sp) /* 01D40 80AEC950 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 /* 01D44 80AEC954 0C028800 */ jal SkelAnime_GetFrameCount /* 01D48 80AEC958 248478E4 */ addiu $a0, $a0, 0x78E4 ## $a0 = 060078E4 /* 01D4C 80AEC95C 44822000 */ mtc1 $v0, $f4 ## $f4 = 0.00 /* 01D50 80AEC960 3C01C100 */ lui $at, 0xC100 ## $at = C1000000 /* 01D54 80AEC964 44814000 */ mtc1 $at, $f8 ## $f8 = -8.00 /* 01D58 80AEC968 468021A0 */ cvt.s.w $f6, $f4 /* 01D5C 80AEC96C 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000 /* 01D60 80AEC970 24A578E4 */ addiu $a1, $a1, 0x78E4 ## $a1 = 060078E4 /* 01D64 80AEC974 2604014C */ addiu $a0, $s0, 0x014C ## $a0 = 0000014C /* 01D68 80AEC978 3C063F80 */ lui $a2, 0x3F80 ## $a2 = 3F800000 /* 01D6C 80AEC97C 24070000 */ addiu $a3, $zero, 0x0000 ## $a3 = 00000000 /* 01D70 80AEC980 E7A60010 */ swc1 $f6, 0x0010($sp) /* 01D74 80AEC984 AFA00014 */ sw $zero, 0x0014($sp) /* 01D78 80AEC988 0C029468 */ jal SkelAnime_ChangeAnimation /* 01D7C 80AEC98C E7A80018 */ swc1 $f8, 0x0018($sp) /* 01D80 80AEC990 860E0032 */ lh $t6, 0x0032($s0) ## 00000032 /* 01D84 80AEC994 44805000 */ mtc1 $zero, $f10 ## $f10 = 0.00 /* 01D88 80AEC998 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 01D8C 80AEC99C 2418000B */ addiu $t8, $zero, 0x000B ## $t8 = 0000000B /* 01D90 80AEC9A0 01C17821 */ addu $t7, $t6, $at /* 01D94 80AEC9A4 A60F0032 */ sh $t7, 0x0032($s0) ## 00000032 /* 01D98 80AEC9A8 AE180264 */ sw $t8, 0x0264($s0) ## 00000264 /* 01D9C 80AEC9AC E60A026C */ swc1 $f10, 0x026C($s0) ## 0000026C .L80AEC9B0: /* 01DA0 80AEC9B0 8FBF002C */ lw $ra, 0x002C($sp) /* 01DA4 80AEC9B4 8FB00028 */ lw $s0, 0x0028($sp) /* 01DA8 80AEC9B8 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 /* 01DAC 80AEC9BC 03E00008 */ jr $ra /* 01DB0 80AEC9C0 00000000 */ nop
{ "pile_set_name": "Github" }
package com.dotcms.util; import com.dotcms.UnitTestBase; import com.dotcms.repackage.org.apache.commons.io.FileUtils; import com.dotmarketing.portlets.fileassets.business.FileAsset; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Date; /** * MimeTypeUtils unit test. * @author jsanca */ public class MimeTypeUtilsTest extends UnitTestBase { @BeforeClass public static void prepare() throws Exception { //Setting web app environment IntegrationTestInitService.getInstance().init(); } @Test public void test_wrong_mime_MimeType_all(){ boolean match = MimeTypeUtils.match("*/pdf", "pdf"); Assert.assertFalse("* must not match", match); } @Test public void test_match_MimeType_all() throws IOException { boolean match = MimeTypeUtils.match("*/*", "image/jpeg"); Assert.assertTrue("* must match with image/jpeg", match); match = MimeTypeUtils.match("*/*", "application/pdf"); Assert.assertTrue("* must match with application/pdf", match); match = MimeTypeUtils.match("*/*", "text/plain"); Assert.assertTrue("* must match with text/plain", match); } @Test public void test_match_MimeType_partial_image() throws IOException { boolean match = MimeTypeUtils.match("image/*", "image/jpeg"); Assert.assertTrue("image/* must match with image/jpeg", match); match = MimeTypeUtils.match("image/*", "image/webp"); Assert.assertTrue("image/* must match with image/webp", match); match = MimeTypeUtils.match("image/*", "image/png"); Assert.assertTrue("image/* must match with image/png", match); match = MimeTypeUtils.match("image/*", "application/vnd.hzn-3d-crossword"); Assert.assertFalse("image/* must not match with application/vnd.hzn-3d-crossword", match); } @Test public void test_match_MimeType_partial_application() throws IOException { boolean match = MimeTypeUtils.match("application/*", "application/vnd.hzn-3d-crossword"); Assert.assertTrue("application/* must match with application/vnd.hzn-3d-crossword", match); match = MimeTypeUtils.match("application/*", "application/x-7z-compressed"); Assert.assertTrue("application/* must match with application/x-7z-compressed", match); match = MimeTypeUtils.match("application/*", "application/pdf"); Assert.assertTrue("application/* must match with application/pdf", match); match = MimeTypeUtils.match("application/*", "image/png"); Assert.assertFalse("application/* must not match with image/png", match); } @Test public void test_match_MimeType_partial_text() throws IOException { boolean match = MimeTypeUtils.match("text/*", "text/x-asm"); Assert.assertTrue("text/* must match with text/x-asm", match); match = MimeTypeUtils.match("text/*", "text/css"); Assert.assertTrue("text/* must match with text/css", match); match = MimeTypeUtils.match("text/*", "text/csv"); Assert.assertTrue("text/* must match with text/csv", match); match = MimeTypeUtils.match("text/*", "image/png"); Assert.assertFalse("text/* must not match with image/png", match); } @Test public void test_match_MimeType_total_text() throws IOException { boolean match = MimeTypeUtils.match("text/x-asm", "text/x-asm"); Assert.assertTrue("text/x-asm must match with text/x-asm", match); match = MimeTypeUtils.match("text/css", "text/css"); Assert.assertTrue("text/css must match with text/css", match); match = MimeTypeUtils.match("text/csv", "text/csv"); Assert.assertTrue("text/csv must match with text/csv", match); match = MimeTypeUtils.match("text/csv", "image/png"); Assert.assertFalse("text/csv must not match with image/png", match); match = MimeTypeUtils.match("aplication/pdf", "image/png"); Assert.assertFalse("aplication/pdf must not match with image/png", match); } @Test public void test_match_MimeType_unknown() throws IOException { boolean match = MimeTypeUtils.match("text/x-asm", FileAsset.UNKNOWN_MIME_TYPE); Assert.assertFalse("text/x-asm must match with text/x-asm", match); match = MimeTypeUtils.match("text/*", FileAsset.UNKNOWN_MIME_TYPE); Assert.assertFalse("text/css must match with text/css", match); match = MimeTypeUtils.match("*/*", FileAsset.UNKNOWN_MIME_TYPE); Assert.assertTrue("text/csv must match with text/csv", match); } @Test public void test_getMimeType_text_plain() throws IOException { final File tempTestFile = File .createTempFile("csvTest_" + new Date().getTime(), ".txt"); FileUtils.writeStringToFile(tempTestFile, "Test"); final String mimeType = MimeTypeUtils.getMimeType(tempTestFile); Assert.assertEquals("The mime type should be application/text","text/plain", mimeType); } @Test public void test_getMimeType_image_png() throws IOException { final File tempTestFile = File .createTempFile("image" + new Date().getTime(), ".png"); final int width = 200; final int height = 200; final BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); final Graphics2D graphics2D = bufferedImage.createGraphics(); final Font font = new Font("TimesRoman", Font.BOLD, 20); final String message = "Test"; final FontMetrics fontMetrics = graphics2D.getFontMetrics(); graphics2D.setFont(font); final int stringWidth = fontMetrics.stringWidth(message); final int stringHeight = fontMetrics.getAscent(); graphics2D.setPaint(Color.black); graphics2D.drawString(message, (width - stringWidth) / 2, height / 2 + stringHeight / 4); ImageIO.write(bufferedImage, "PNG", tempTestFile); final String mimeType = MimeTypeUtils.getMimeType(tempTestFile); Assert.assertEquals("The mime type should be image/png","image/png", mimeType); } }
{ "pile_set_name": "Github" }
+++ weight = 10 title = "Starting plan" subtitle = "Working with url accross pages" currency = "USD" price = "$9.99/mo" # highlight = true button_text = "Start at $9.99/mo" button_url = "/dev/events/payment?event=pricing:change&product=Starting plan&price=$9.99/mo&currency=usd" [[features]] text = "**Basic** feature" icon = "fas fa-check" [[features]] text = "**Email** support" icon = "fas fa-check" +++
{ "pile_set_name": "Github" }
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS
{ "pile_set_name": "Github" }
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """Class used for operating the city map.""" import math import os try: import numpy as np except ImportError: raise RuntimeError('cannot import numpy, make sure numpy package is installed') try: from PIL import Image except ImportError: raise RuntimeError('cannot import PIL, make sure pillow package is installed') from .graph import Graph from .graph import sldist from .grid import Grid from .converter import Converter def color_to_angle(color): return (float(color) / 255.0) * 2 * math.pi class CarlaMap(object): def __init__(self, city, pixel_density, node_density): dir_path = os.path.dirname(__file__) city_file = os.path.join(dir_path, city + '.txt') city_map_file = os.path.join(dir_path, city + '.png') city_map_file_lanes = os.path.join(dir_path, city + 'Lanes.png') city_map_file_center = os.path.join(dir_path, city + 'Central.png') # The built graph. This is the exact same graph that unreal builds. This # is a generic structure used for many cases self._graph = Graph(city_file, node_density) self._pixel_density = pixel_density self._grid = Grid(self._graph) # The number of game units per pixel. For now this is fixed. self._converter = Converter(city_file, pixel_density, node_density) # Load the lanes image self.map_image_lanes = Image.open(city_map_file_lanes) self.map_image_lanes.load() self.map_image_lanes = np.asarray(self.map_image_lanes, dtype="int32") # Load the image self.map_image = Image.open(city_map_file) self.map_image.load() self.map_image = np.asarray(self.map_image, dtype="int32") # Load the lanes image self.map_image_center = Image.open(city_map_file_center) self.map_image_center.load() self.map_image_center = np.asarray(self.map_image_center, dtype="int32") def get_graph_resolution(self): return self._graph.get_resolution() def get_map(self, height=None): if height is not None: img = Image.fromarray(self.map_image.astype(np.uint8)) aspect_ratio = height / float(self.map_image.shape[0]) img = img.resize((int(aspect_ratio * self.map_image.shape[1]), height), Image.ANTIALIAS) img.load() return np.asarray(img, dtype="int32") return np.fliplr(self.map_image) def get_map_lanes(self, size=None): if size is not None: img = Image.fromarray(self.map_image_lanes.astype(np.uint8)) img = img.resize((size[1], size[0]), Image.ANTIALIAS) img.load() return np.fliplr(np.asarray(img, dtype="int32")) return np.fliplr(self.map_image_lanes) def get_lane_orientation(self, world): """Get the lane orientation of a certain world position.""" pixel = self.convert_to_pixel(world) ori = self.map_image_lanes[int(pixel[1]), int(pixel[0]), 2] ori = color_to_angle(ori) return (-math.cos(ori), -math.sin(ori)) def convert_to_node(self, input_data): """ Receives a data type (Can Be Pixel or World ) :param input_data: position in some coordinate :return: A node object """ return self._converter.convert_to_node(input_data) def convert_to_pixel(self, input_data): """ Receives a data type (Can Be Node or World ) :param input_data: position in some coordinate :return: A node object """ return self._converter.convert_to_pixel(input_data) def convert_to_world(self, input_data): """ Receives a data type (Can Be Pixel or Node ) :param input_data: position in some coordinate :return: A node object """ return self._converter.convert_to_world(input_data) def get_walls_directed(self, node_source, source_ori, node_target, target_ori): """ This is the most hacky function. Instead of planning on two ways, we basically use a one way road and interrupt the other road by adding an artificial wall. """ final_walls = self._grid.get_wall_source(node_source, source_ori, node_target) final_walls = final_walls.union(self._grid.get_wall_target( node_target, target_ori, node_source)) return final_walls def get_walls(self): return self._grid.get_walls() def get_distance_closest_node(self, pos): distance = [] for node_iter in self._graph.intersection_nodes(): distance.append(sldist(node_iter, pos)) return sorted(distance)[0] def get_intersection_nodes(self): return self._graph.intersection_nodes() def search_on_grid(self,node): return self._grid.search_on_grid(node[0], node[1])
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0-or-later /* * Generic driver for CS4231 chips * Copyright (c) by Jaroslav Kysela <[email protected]> * Originally the CS4232/CS4232A driver, modified for use on CS4231 by * Tugrul Galatali <[email protected]> */ #include <linux/init.h> #include <linux/err.h> #include <linux/isa.h> #include <linux/time.h> #include <linux/wait.h> #include <linux/module.h> #include <sound/core.h> #include <sound/wss.h> #include <sound/mpu401.h> #include <sound/initval.h> #define CRD_NAME "Generic CS4231" #define DEV_NAME "cs4231" MODULE_DESCRIPTION(CRD_NAME); MODULE_AUTHOR("Jaroslav Kysela <[email protected]>"); MODULE_LICENSE("GPL"); MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4231}}"); static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */ static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 9,11,12,15 */ static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ module_param_array(index, int, NULL, 0444); MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard."); module_param_array(id, charp, NULL, 0444); MODULE_PARM_DESC(id, "ID string for " CRD_NAME " soundcard."); module_param_array(enable, bool, NULL, 0444); MODULE_PARM_DESC(enable, "Enable " CRD_NAME " soundcard."); module_param_hw_array(port, long, ioport, NULL, 0444); MODULE_PARM_DESC(port, "Port # for " CRD_NAME " driver."); module_param_hw_array(mpu_port, long, ioport, NULL, 0444); MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver."); module_param_hw_array(irq, int, irq, NULL, 0444); MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver."); module_param_hw_array(mpu_irq, int, irq, NULL, 0444); MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver."); module_param_hw_array(dma1, int, dma, NULL, 0444); MODULE_PARM_DESC(dma1, "DMA1 # for " CRD_NAME " driver."); module_param_hw_array(dma2, int, dma, NULL, 0444); MODULE_PARM_DESC(dma2, "DMA2 # for " CRD_NAME " driver."); static int snd_cs4231_match(struct device *dev, unsigned int n) { if (!enable[n]) return 0; if (port[n] == SNDRV_AUTO_PORT) { dev_err(dev, "please specify port\n"); return 0; } if (irq[n] == SNDRV_AUTO_IRQ) { dev_err(dev, "please specify irq\n"); return 0; } if (dma1[n] == SNDRV_AUTO_DMA) { dev_err(dev, "please specify dma1\n"); return 0; } return 1; } static int snd_cs4231_probe(struct device *dev, unsigned int n) { struct snd_card *card; struct snd_wss *chip; int error; error = snd_card_new(dev, index[n], id[n], THIS_MODULE, 0, &card); if (error < 0) return error; error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], dma2[n], WSS_HW_DETECT, 0, &chip); if (error < 0) goto out; card->private_data = chip; error = snd_wss_pcm(chip, 0); if (error < 0) goto out; strlcpy(card->driver, "CS4231", sizeof(card->driver)); strlcpy(card->shortname, chip->pcm->name, sizeof(card->shortname)); if (dma2[n] < 0) snprintf(card->longname, sizeof(card->longname), "%s at 0x%lx, irq %d, dma %d", chip->pcm->name, chip->port, irq[n], dma1[n]); else snprintf(card->longname, sizeof(card->longname), "%s at 0x%lx, irq %d, dma %d&%d", chip->pcm->name, chip->port, irq[n], dma1[n], dma2[n]); error = snd_wss_mixer(chip); if (error < 0) goto out; error = snd_wss_timer(chip, 0); if (error < 0) goto out; if (mpu_port[n] > 0 && mpu_port[n] != SNDRV_AUTO_PORT) { if (mpu_irq[n] == SNDRV_AUTO_IRQ) mpu_irq[n] = -1; if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232, mpu_port[n], 0, mpu_irq[n], NULL) < 0) dev_warn(dev, "MPU401 not detected\n"); } error = snd_card_register(card); if (error < 0) goto out; dev_set_drvdata(dev, card); return 0; out: snd_card_free(card); return error; } static int snd_cs4231_remove(struct device *dev, unsigned int n) { snd_card_free(dev_get_drvdata(dev)); return 0; } #ifdef CONFIG_PM static int snd_cs4231_suspend(struct device *dev, unsigned int n, pm_message_t state) { struct snd_card *card = dev_get_drvdata(dev); struct snd_wss *chip = card->private_data; snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); chip->suspend(chip); return 0; } static int snd_cs4231_resume(struct device *dev, unsigned int n) { struct snd_card *card = dev_get_drvdata(dev); struct snd_wss *chip = card->private_data; chip->resume(chip); snd_power_change_state(card, SNDRV_CTL_POWER_D0); return 0; } #endif static struct isa_driver snd_cs4231_driver = { .match = snd_cs4231_match, .probe = snd_cs4231_probe, .remove = snd_cs4231_remove, #ifdef CONFIG_PM .suspend = snd_cs4231_suspend, .resume = snd_cs4231_resume, #endif .driver = { .name = DEV_NAME } }; module_isa_driver(snd_cs4231_driver, SNDRV_CARDS);
{ "pile_set_name": "Github" }
/** * Copyright 2019, OpenCensus 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. */ import { HeaderGetter, HeaderSetter } from '@opencensus/web-core'; import { spanContextToTraceParent, TraceContextFormat, traceParentToSpanContext, } from '../src/'; type HeaderValue = string | string[]; class FakeHeaders implements HeaderSetter, HeaderGetter { private readonly headers = new Map<string, HeaderValue>(); getHeader(header: string): HeaderValue | undefined { return this.headers.get(header); } setHeader(header: string, value: HeaderValue) { this.headers.set(header, value); } } describe('traceParentToSpanContext', () => { it('returns null for invalid trace headers', () => { expect(traceParentToSpanContext('totally invalid header!')).toBe(null); expect(traceParentToSpanContext('1f-2f-3f-4f')).toBe(null); // Trace IDs with all zeros are invalid. expect( traceParentToSpanContext( '00-00000000000000000000000000000000-b7ad6b7169203331-01' ) ).toBe(null); }); it('extracts traceId, spanId and options for valid header', () => { expect( traceParentToSpanContext( '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01' ) ).toEqual({ traceId: '0af7651916cd43dd8448eb211c80319c', spanId: 'b7ad6b7169203331', options: 0x1, }); }); }); describe('spanContextToTraceParent', () => { it('formats traceId, spanId and options into header', () => { expect( spanContextToTraceParent({ traceId: '0af7651916cd43dd8448eb211c80319c', spanId: 'b7ad6b7169203331', options: 0x1, }) ).toBe('00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01'); }); }); describe('TraceContextFormat', () => { let headers: FakeHeaders; const traceContextFormat = new TraceContextFormat(); beforeEach(() => { headers = new FakeHeaders(); }); describe('extract', () => { it('extracts traceId, spanId and options from traceparent header', () => { headers.setHeader( 'traceparent', '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01' ); expect(traceContextFormat.extract(headers)).toEqual({ traceId: '0af7651916cd43dd8448eb211c80319c', spanId: 'b7ad6b7169203331', options: 0x1, }); }); it('returns null if traceparent header is missing', () => { expect(traceContextFormat.extract(headers)).toEqual(null); }); it('returns null if traceparent header is invalid', () => { headers.setHeader('traceparent', 'invalid!'); expect(traceContextFormat.extract(headers)).toEqual(null); }); it('extracts tracestate from header', () => { headers.setHeader( 'traceparent', '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01' ); headers.setHeader('tracestate', 'a=b'); expect(traceContextFormat.extract(headers)).toEqual({ traceId: '0af7651916cd43dd8448eb211c80319c', spanId: 'b7ad6b7169203331', options: 0x1, traceState: 'a=b', }); }); it('combines multiple tracestate headers', () => { headers.setHeader( 'traceparent', '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-00' ); headers.setHeader('tracestate', ['a=b', 'c=d']); expect(traceContextFormat.extract(headers)).toEqual({ traceId: '0af7651916cd43dd8448eb211c80319c', spanId: 'b7ad6b7169203331', options: 0x0, traceState: 'a=b,c=d', }); }); }); describe('inject', () => { it('sets traceparent header', () => { traceContextFormat.inject(headers, { traceId: '0af7651916cd43dd8448eb211c80319c', spanId: 'b7ad6b7169203331', options: 0x1, }); expect(headers.getHeader('traceparent')).toBe( '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01' ); }); it('sets tracestate header if tracestate specified', () => { traceContextFormat.inject(headers, { traceId: '0af7651916cd43dd8448eb211c80319c', spanId: 'b7ad6b7169203331', options: 0x1, traceState: 'a=b', }); expect(headers.getHeader('traceparent')).toBe( '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01' ); expect(headers.getHeader('tracestate')).toBe('a=b'); }); }); describe('generate', () => { const SPAN_ID_REGEX = /[0-9a-f]{16}/; const TRACE_ID_REGEX = /[0-9a-f]{32}/; it('generates unique and valid trace and span IDs', () => { const trials = 20; const traceIds = new Set<string>(); const spanIds = new Set<string>(); for (let i = 0; i < trials; i++) { const spanContext = traceContextFormat.generate(); expect(spanContext.traceId).toMatch(TRACE_ID_REGEX); expect(spanContext.spanId).toMatch(SPAN_ID_REGEX); traceIds.add(spanContext.traceId); spanIds.add(spanContext.spanId); expect(spanContext.traceState).toBe(undefined); expect(spanContext.options).toBe(0x0); } // Test trace/span IDs for uniqueness. expect(traceIds.size).toBe(trials); expect(spanIds.size).toBe(trials); }); }); });
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@android:color/white" /> <corners android:radius="512dp" /> </shape>
{ "pile_set_name": "Github" }
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.fineract.infrastructure.configuration.service; import java.util.Collection; import org.apache.fineract.infrastructure.campaigns.sms.data.MessageGatewayConfigurationData; import org.apache.fineract.infrastructure.configuration.data.ExternalServicesPropertiesData; import org.apache.fineract.infrastructure.configuration.data.S3CredentialsData; import org.apache.fineract.infrastructure.configuration.data.SMTPCredentialsData; import org.apache.fineract.infrastructure.gcm.domain.NotificationConfigurationData; public interface ExternalServicesPropertiesReadPlatformService { S3CredentialsData getS3Credentials(); SMTPCredentialsData getSMTPCredentials(); MessageGatewayConfigurationData getSMSGateway(); Collection<ExternalServicesPropertiesData> retrieveOne(String serviceName); NotificationConfigurationData getNotificationConfiguration(); }
{ "pile_set_name": "Github" }
module.exports = require('./assignInAll');
{ "pile_set_name": "Github" }
#[macro_export] macro_rules! visit_attrs { ($_self:ident, $attrs:ident) => { for it in $attrs { $_self.visit_attribute_mut(it) } }; } #[macro_export] macro_rules! visit_punctuated { ($_self:ident, $ele:expr, $method:ident) => { for mut el in Punctuated::pairs_mut($ele) { $_self.$method(el.value_mut()); } }; }
{ "pile_set_name": "Github" }
/* * Copyright 2015 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include <linux/device.h> #include <linux/export.h> #include <linux/pid.h> #include <linux/err.h> #include <linux/slab.h> #include <drm/amd_rdma.h> #include "kfd_priv.h" #include "amdgpu_amdkfd.h" struct rdma_cb { struct list_head node; struct amd_p2p_info amd_p2p_data; void (*free_callback)(void *client_priv); void *client_priv; }; /** * This function makes the pages underlying a range of GPU virtual memory * accessible for DMA operations from another PCIe device * * \param address - The start address in the Unified Virtual Address * space in the specified process * \param length - The length of requested mapping * \param pid - Pointer to structure pid to which address belongs. * Could be NULL for current process address space. * \param p2p_data - On return: Pointer to structure describing * underlying pages/locations * \param free_callback - Pointer to callback which will be called when access * to such memory must be stopped immediately: Memory * was freed, GECC events, etc. * Client should immediately stop any transfer * operations and returned as soon as possible. * After return all resources associated with address * will be release and no access will be allowed. * \param client_priv - Pointer to be passed as parameter on * 'free_callback; * * \return 0 if operation was successful */ static int get_pages(uint64_t address, uint64_t length, struct pid *pid, struct amd_p2p_info **amd_p2p_data, void (*free_callback)(void *client_priv), void *client_priv) { struct kfd_bo *buf_obj; struct kgd_mem *mem; struct sg_table *sg_table_tmp; struct kfd_dev *dev; uint64_t last = address + length - 1; uint64_t offset; struct kfd_process *p; struct rdma_cb *rdma_cb_data; int ret = 0; p = kfd_lookup_process_by_pid(pid); if (!p) { pr_err("Could not find the process\n"); return -EINVAL; } mutex_lock(&p->mutex); buf_obj = kfd_process_find_bo_from_interval(p, address, last); if (!buf_obj) { pr_err("Cannot find a kfd_bo for the range\n"); ret = -EINVAL; goto out; } rdma_cb_data = kmalloc(sizeof(*rdma_cb_data), GFP_KERNEL); if (!rdma_cb_data) { *amd_p2p_data = NULL; ret = -ENOMEM; goto out; } mem = buf_obj->mem; dev = buf_obj->dev; offset = address - buf_obj->it.start; ret = amdgpu_amdkfd_gpuvm_pin_get_sg_table(dev->kgd, mem, offset, length, &sg_table_tmp); if (ret) { pr_err("amdgpu_amdkfd_gpuvm_pin_get_sg_table failed.\n"); *amd_p2p_data = NULL; goto free_mem; } rdma_cb_data->amd_p2p_data.va = address; rdma_cb_data->amd_p2p_data.size = length; rdma_cb_data->amd_p2p_data.pid = pid; rdma_cb_data->amd_p2p_data.priv = buf_obj; rdma_cb_data->amd_p2p_data.pages = sg_table_tmp; rdma_cb_data->amd_p2p_data.kfd_proc = p; rdma_cb_data->free_callback = free_callback; rdma_cb_data->client_priv = client_priv; list_add(&rdma_cb_data->node, &buf_obj->cb_data_head); kfd_inc_compute_active(dev); *amd_p2p_data = &rdma_cb_data->amd_p2p_data; goto out; free_mem: kfree(rdma_cb_data); out: mutex_unlock(&p->mutex); return ret; } static int put_pages_helper(struct amd_p2p_info *p2p_data) { struct kfd_bo *buf_obj; struct kfd_dev *dev; struct sg_table *sg_table_tmp; struct rdma_cb *rdma_cb_data; if (!p2p_data) { pr_err("amd_p2p_info pointer is invalid.\n"); return -EINVAL; } rdma_cb_data = container_of(p2p_data, struct rdma_cb, amd_p2p_data); buf_obj = p2p_data->priv; dev = buf_obj->dev; sg_table_tmp = p2p_data->pages; list_del(&rdma_cb_data->node); kfree(rdma_cb_data); amdgpu_amdkfd_gpuvm_unpin_put_sg_table(buf_obj->mem, sg_table_tmp); kfd_dec_compute_active(dev); return 0; } void run_rdma_free_callback(struct kfd_bo *buf_obj) { struct rdma_cb *tmp, *rdma_cb_data; list_for_each_entry_safe(rdma_cb_data, tmp, &buf_obj->cb_data_head, node) { if (rdma_cb_data->free_callback) rdma_cb_data->free_callback( rdma_cb_data->client_priv); } list_for_each_entry_safe(rdma_cb_data, tmp, &buf_obj->cb_data_head, node) put_pages_helper(&rdma_cb_data->amd_p2p_data); } /** * * This function release resources previously allocated by get_pages() call. * * \param p_p2p_data - A pointer to pointer to amd_p2p_info entries * allocated by get_pages() call. * * \return 0 if operation was successful */ static int put_pages(struct amd_p2p_info **p_p2p_data) { int ret = 0; if (!(*p_p2p_data)) { pr_err("amd_p2p_info pointer is invalid.\n"); return -EINVAL; } ret = put_pages_helper(*p_p2p_data); if (!ret) { kfd_unref_process((*p_p2p_data)->kfd_proc); *p_p2p_data = NULL; } return ret; } /** * Check if given address belongs to GPU address space. * * \param address - Address to check * \param pid - Process to which given address belongs. * Could be NULL if current one. * * \return 0 - This is not GPU address managed by AMD driver * 1 - This is GPU address managed by AMD driver */ static int is_gpu_address(uint64_t address, struct pid *pid) { struct kfd_bo *buf_obj; struct kfd_process *p; p = kfd_lookup_process_by_pid(pid); if (!p) { pr_debug("Could not find the process\n"); return 0; } buf_obj = kfd_process_find_bo_from_interval(p, address, address); kfd_unref_process(p); if (!buf_obj) return 0; return 1; } /** * Return the single page size to be used when building scatter/gather table * for given range. * * \param address - Address * \param length - Range length * \param pid - Process id structure. Could be NULL if current one. * \param page_size - On return: Page size * * \return 0 if operation was successful */ static int get_page_size(uint64_t address, uint64_t length, struct pid *pid, unsigned long *page_size) { /* * As local memory is always consecutive, we can assume the local * memory page size to be arbitrary. * Currently we assume the local memory page size to be the same * as system memory, which is 4KB. */ *page_size = PAGE_SIZE; return 0; } /** * Singleton object: rdma interface function pointers */ static const struct amd_rdma_interface rdma_ops = { .get_pages = get_pages, .put_pages = put_pages, .is_gpu_address = is_gpu_address, .get_page_size = get_page_size, }; /** * amdkfd_query_rdma_interface - Return interface (function pointers table) for * rdma interface * * * \param interace - OUT: Pointer to interface * * \return 0 if operation was successful. */ int amdkfd_query_rdma_interface(const struct amd_rdma_interface **ops) { *ops = &rdma_ops; return 0; } EXPORT_SYMBOL(amdkfd_query_rdma_interface);
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd"> <!-- Copyright © 1991-2013 Unicode, Inc. CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/) For terms of use, see http://www.unicode.org/copyright.html --> <ldml> <identity> <version number="$Revision: 9838 $"/> <generation date="$Date: 2014-02-27 11:17:08 -0600 (Thu, 27 Feb 2014) $"/> <language type="ca"/> <territory type="ES"/> <variant type="VALENCIA"/> </identity> </ldml>
{ "pile_set_name": "Github" }
# The RxJS Contract ### Assume the RxJS Grammar Messages sent to instances of the `Observer` object follow the following grammar: onNext* (onCompleted | onError)? This grammar allows observable sequences to send any amount (0 or more) of `onNext` messages to the subscribed observer instance, optionally followed by a single success (`onCompleted`) or failure (`onError`) message. The single message indicating that an observable sequence has finished ensures that consumers of the observable sequence can deterministically establish that it is safe to perform cleanup operations. A single failure further ensures that abort semantics can be maintained for operators that work on multiple observable sequences. #### Sample #### ```js var count = 0; xs.subscribe( () => count++, err => console.log('Error: %s', err.message), () => console.log('OnNext has been called %d times', count) ); ``` In this sample we safely assume that the total amount of calls to the OnNext method won’t change once the OnCompleted method is called as the observable sequence follows the Rx grammar. #### When to ignore this guideline #### Ignore this guideline only when working with a non-conforming implementation of the Observable object. ### Assume resources are cleaned up after an `onError` or `onCompleted` message Paragraph 3.1 states that no more messages should arrive after an `onError` or `onCompleted` message. This makes it possible to cleanup any resource used by the subscription the moment an `onError` or `onCompleted` arrives. Cleaning up resources immediately will make sure that any side-effect occurs in a predictable fashion. It also makes sure that the runtime can reclaim these resources. #### Sample #### ```js var fs = require('fs'); var Rx = require('rx'); function appendAsync(fd, buffer) { /* impl */ } function openFile(path, flags) { var fd = fs.openSync(path, flags); return Rx.Disposable.create(() => fs.closeSync(fd)); } Rx.Observable. using( () => openFile('temp.txt', 'w+'), fd => Rx.Observable.range(0, 10000).map(v => Buffer(v)).flatMap(buffer => appendAsync(fd, buffer)) ).subscribe(); ``` In this sample the `using` operator creates a resource that will be disposed upon unsubscription. The Rx contract for cleanup ensures that unsubscription will be called automatically once an `onError` or `onCompleted` message is sent. #### When to ignore this guideline #### There are currently no known cases where to ignore this guideline. ### Assume a best effort to stop all outstanding work on Unsubscribe ### When unsubscribe is called on an observable subscription, the observable sequence will make a best effort attempt to stop all outstanding work. This means that any queued work that has not been started will not start. Any work that is already in progress might still complete as it is not always safe to abort work that is in progress. Results from this work will not be signaled to any previously subscribed observer instances. #### Sample 1 ```js Observable.timer(2000).subscribe(...).dispose() ``` In this sample subscribing to the observable sequence generated by Timer will queue an action on the `Scheduler.timeout` scheduler to send out an `onNext` message in 2 seconds. The subscription then gets canceled immediately. As the scheduled action has not started yet, it will be removed from the scheduler. #### Sample 2 ```js Rx.Observable.startAsync(() => Q.delay(2000)).subscribe(...).dispose(); ``` In this sample the `startAsync` operator will immediately schedule the execution of the lambda provided as its argument. The subscription registers the observer instance as a listener to this execution. As the lambda is already running once the subscription is disposed, it will keep running and its return value is ignored.
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <html> <head> <title>Empty Player test</title> <script type="text/javascript" src="../../../tests/qunit/qunit-bootstrap.js"></script> <script type="text/javascript" src="../../../mwEmbedLoader.php"></script> <script type="text/javascript" src="../../../docs/js/doc-bootstrap.js"></script> <script type="text/javascript"> function jsKalturaPlayerTest( videoId ){ var kdp = document.getElementById( videoId ); // Name this module module( "Empty Player" ); var $iframe = $('#' + videoId + '_ifp').contents(); var iframeContext = window.frames['kaltura_player_ifp']; // listen for the empty kdp event: window.runEmptyEventTest = function(){ asyncTest( "Empty KDP", function(){ ok( true, 'Empty event fired' ); ok( typeof kdp.sendNotification != 'undefined', "Player Api present" ); window[ 'onKdpEntryReady' ] = function(){ doKdpEntryReadyTest(); start(); } // Add a listner for entry ready: kdp.addJsListener( 'entryReady', 'onKdpEntryReady' ); // Change player entry: kdp.sendNotification( "changeMedia", { 'entryId' : '0_uka1msg4' } ); }); }; // Add empty player listener: kdp.addJsListener( 'kdpEmpty', 'runEmptyEventTest' ); window.doKdpEntryReadyTest = function(){ asyncTest( "Change entry called on empty player", function(){ ok( true, 'Changed entry event fired'); var entry = kdp.evaluate('{mediaProxy.entry}'); equal( '0_uka1msg4', entry.id, "Entry ids match"); start(); }) } } </script> <!-- qunit-kaltura must come after qunit-bootstrap.js and after mwEmbedLoader.php and after any jsCallbackReady stuff--> <script type="text/javascript" src="resources/qunit-kaltura-bootstrap.js"></script> </head> <body> <h2> Empty Player test </h2> <br /> <object id="kaltura_player" name="kaltura_player" type="application/x-shockwave-flash" allowFullScreen="true" allowNetworking="all" allowScriptAccess="always" height="333" width="400" xmlns:dc="http://purl.org/dc/terms/" xmlns:media="http://search.yahoo.com/searchmonkey/media/" rel="media:video" resource="http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/12905712/" data="http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/12905712/"> <param name="allowFullScreen" value="true" /> <param name="allowNetworking" value="all" /> <param name="allowScriptAccess" value="always" /> <param name="bgcolor" value="#000000" /> <param name="flashVars" value="&" /> <param name="movie" value="http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/12905712/" /> </object> </body> </html>
{ "pile_set_name": "Github" }
/* Copyright (c) 2015-2016 Boundless and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/org/documents/edl-v10.html * * Contributors: * Gabriel Roldan (Boundless) - initial implementation */ package org.locationtech.geogig.storage.impl; import java.util.Collections; import java.util.List; import java.util.Optional; import org.locationtech.geogig.storage.BlobStore; import com.google.common.base.Charsets; import com.google.common.base.Splitter; /** * Utility methods to manipulate BLOBs in a {@link BlobStore} */ public class Blobs { public static String SPARSE_FILTER_BLOB_KEY = "sparse_filter"; public static void putBlob(BlobStore blobStore, String blobName, CharSequence contents) { byte[] blob = contents.toString().getBytes(Charsets.UTF_8); blobStore.putBlob(blobName, blob); } public static Optional<String> getBlobAsString(BlobStore blobStore, String blobName) { Optional<byte[]> blob = getBlob(blobStore, blobName); Optional<String> str = Optional.empty(); if (blob.isPresent()) { str = Optional.of(new String(blob.get(), Charsets.UTF_8)); } return str; } public static Optional<byte[]> getBlob(BlobStore blobStore, final String blobName) { Optional<byte[]> blob = blobStore.getBlob(blobName); return blob; } public static List<String> readLines(Optional<byte[]> blob) { List<String> lines = Collections.emptyList(); if (blob.isPresent()) { String contents = new String(blob.get(), Charsets.UTF_8); lines = Splitter.on("\n").splitToList(contents); } return lines; } public static List<String> readLines(BlobStore blobStore, String blobName) { Optional<byte[]> blob = getBlob(blobStore, blobName); return readLines(blob); } }
{ "pile_set_name": "Github" }
# p2p-adb # https://github.com/kosborn/p2p-adb/ # @theKos # [email protected] # Registering command registerCommand "5:getAccounts:Steal Accounts" getAccounts(){ echo $ISROOT if [ $ISROOT -le 1 ]; then DATAPATH="/data/system/accounts.db" echo 'We are root...' getData "$DATAPATH" else echo $ISROOT fi }
{ "pile_set_name": "Github" }
#' Mean log loss #' #' Compute the logarithmic loss of a classification model. #' #' Log loss is a measure of the performance of a classification model. A #' perfect model has a log loss of `0`. #' #' Compared with [accuracy()], log loss #' takes into account the uncertainty in the prediction and gives a more #' detailed view into the actual performance. For example, given two input #' probabilities of `.6` and `.9` where both are classified as predicting #' a positive value, say, `"Yes"`, the accuracy metric would interpret them #' as having the same value. If the true output is `"Yes"`, log loss penalizes #' `.6` because it is "less sure" of it's result compared to the probability #' of `.9`. #' #' @family class probability metrics #' @templateVar metric_fn mn_log_loss #' @template return #' #' @section Multiclass: #' Log loss has a known multiclass extension, and is simply the sum of the #' log loss values for each class prediction. Because of this, no averaging #' types are supported. #' #' @inheritParams pr_auc #' #' @param sum A `logical`. Should the sum of the likelihood contributions be #' returned (instead of the mean value)? #' #' @author Max Kuhn #' #' @examples #' # Two class #' data("two_class_example") #' mn_log_loss(two_class_example, truth, Class1) #' #' # Multiclass #' library(dplyr) #' data(hpc_cv) #' #' # You can use the col1:colN tidyselect syntax #' hpc_cv %>% #' filter(Resample == "Fold01") %>% #' mn_log_loss(obs, VF:L) #' #' # Groups are respected #' hpc_cv %>% #' group_by(Resample) %>% #' mn_log_loss(obs, VF:L) #' #' #' # Vector version #' # Supply a matrix of class probabilities #' fold1 <- hpc_cv %>% #' filter(Resample == "Fold01") #' #' mn_log_loss_vec( #' truth = fold1$obs, #' matrix( #' c(fold1$VF, fold1$F, fold1$M, fold1$L), #' ncol = 4 #' ) #' ) #' #' # Supply `...` with quasiquotation #' prob_cols <- levels(two_class_example$truth) #' mn_log_loss(two_class_example, truth, Class1) #' mn_log_loss(two_class_example, truth, !! prob_cols[1]) #' #' @export mn_log_loss <- function(data, ...) { UseMethod("mn_log_loss") } mn_log_loss <- new_prob_metric( mn_log_loss, direction = "minimize" ) #' @export #' @rdname mn_log_loss #' @importFrom rlang quo mn_log_loss.data.frame <- function(data, truth, ..., na_rm = TRUE, sum = FALSE, event_level = yardstick_event_level()) { estimate <- dots_to_estimate(data, !!! enquos(...)) metric_summarizer( metric_nm = "mn_log_loss", metric_fn = mn_log_loss_vec, data = data, truth = !!enquo(truth), estimate = !!estimate, na_rm = na_rm, event_level = event_level, # Extra argument for mn_log_loss_impl() metric_fn_options = list(sum = sum) ) } #' @rdname mn_log_loss #' @importFrom stats model.matrix #' @export mn_log_loss_vec <- function(truth, estimate, na_rm = TRUE, sum = FALSE, event_level = yardstick_event_level(), ...) { estimator <- finalize_estimator(truth, metric_class = "mn_log_loss") # estimate here is a matrix of class prob columns mn_log_loss_impl <- function(truth, estimate, sum = FALSE) { mn_log_loss_estimator_impl(truth, estimate, estimator, event_level, sum) } metric_vec_template( metric_impl = mn_log_loss_impl, truth = truth, estimate = estimate, na_rm = na_rm, estimator = estimator, cls = c("factor", "numeric"), ..., sum = sum ) } mn_log_loss_estimator_impl <- function(truth, estimate, estimator, event_level, sum = FALSE) { if (is_binary(estimator)) { mn_log_loss_binary(truth, estimate, event_level, sum) } else { mn_log_loss_multiclass(truth, estimate, sum) } } mn_log_loss_binary <- function(truth, estimate, event_level, sum) { if (!is_event_first(event_level)) { lvls <- levels(truth) truth <- relevel(truth, lvls[[2]]) } estimate <- matrix(c(estimate, 1 - estimate), ncol = 2) mn_log_loss_multiclass(truth, estimate, sum) } # We apply the min/max rule to avoid undefined log() values (#103) # (Standard seems to be to use `eps = 1e-15`, but base R uses # .Machine$double.eps in many places when they do this, # and it should be more precise) # https://github.com/wch/r-source/blob/582d94805aeee0c91f9bd9bdd63e421dd60e441f/src/library/stats/R/family.R#L83 mn_log_loss_multiclass <- function(truth, estimate, sum) { y <- model.matrix(~ truth - 1) eps <- .Machine$double.eps estimate <- pmax(pmin(estimate, 1 - eps), eps) out <- -sum(y * log(estimate)) if (!sum) { out <- out / length(truth) } out }
{ "pile_set_name": "Github" }
/* * Copyright 2020 ThoughtWorks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.thoughtworks.go.spark; public class Link { private String name; private String href; public Link(String name, String href) { this.name = name; this.href = href; } public String getName() { return name; } public String getHref() { return href; } }
{ "pile_set_name": "Github" }
// Copyright (C) 2016-2019 Jonathan Müller <[email protected]> // This file is subject to the license terms in the LICENSE file // found in the top-level directory of this distribution. #ifndef STANDARDESE_THREAD_POOL_HPP_INCLUDED #define STANDARDESE_THREAD_POOL_HPP_INCLUDED #include <future> #include <thread> #include <vector> #include <ThreadPool.h> namespace standardese_tool { using thread_pool = ::ThreadPool; inline unsigned default_no_threads() { return std::max(std::thread::hardware_concurrency(), 1u); } template <typename Fnc, typename... Args> auto add_job(thread_pool& p, Fnc f, Args&&... args) -> std::future<typename std::result_of<Fnc(Args...)>::type> { return p.enqueue(f, std::forward<Args>(args)...); } } // namespace standardese_tool #endif // STANDARDESE_THREAD_POOL_HPP_INCLUDED
{ "pile_set_name": "Github" }
#pragma warning disable /* * Warewolf - Once bitten, there's no going back * Copyright 2019 by Warewolf Ltd <[email protected]> * Licensed under GNU Affero General Public License 3.0 or later. * Some rights reserved. * Visit our website for more information <http://warewolf.io/> * AUTHORS <http://warewolf.io/authors.php> , CONTRIBUTORS <http://warewolf.io/contributors.php> * @license GNU Affero General Public License <http://www.gnu.org/licenses/agpl-3.0.html> */ using System; using System.Collections.Generic; using System.Linq; using Dev2.Common.DateAndTime; using Dev2.Common.Interfaces.Core.Convertors.DateAndTime; using Dev2.Data.Interfaces; using Dev2.Data.Interfaces.Enums; using Dev2.DataList.Contract; using Dev2.Intellisense.Provider; using Dev2.Studio.Interfaces; namespace Dev2.Studio.InterfaceImplementors { public class DateTimeIntellisenseProvider : IIntellisenseProvider { #region Class Members List<IIntellisenseResult> _intellisenseResults; #endregion Class Members #region Constructors public DateTimeIntellisenseProvider() { Optional = false; IntellisenseProviderType = IntellisenseProviderType.NonDefault; var dateTimeParser = DateTimeConverterFactory.CreateStandardParser(); _intellisenseResults = dateTimeParser.DateTimeFormatParts.Select(p => { var intellisenseResult = IntellisenseFactory.CreateDateTimeResult(IntellisenseFactory.CreateDateTimePart(p.Value, p.Description)); return intellisenseResult; }).OrderBy(p => p.Option.DisplayValue).ToList(); } public DateTimeIntellisenseProvider(List<IIntellisenseResult> intellisenseResults) { Optional = false; _intellisenseResults = intellisenseResults; } #endregion Constructors #region Override Methods public IntellisenseProviderType IntellisenseProviderType { get; private set; } public string PerformResultInsertion(string input, IntellisenseProviderContext context) { throw new NotSupportedException(); } public IList<IntellisenseProviderResult> GetIntellisenseResults(IntellisenseProviderContext context) { if(context == null) { return new List<IntellisenseProviderResult>(); } var oldResults = GetIntellisenseResultsImpl(context); var results = new List<IntellisenseProviderResult>(); if (oldResults != null) { foreach (IIntellisenseResult currentResult in oldResults) { if (currentResult.ErrorCode != enIntellisenseErrorCode.None && currentResult.Type == enIntellisenseResultType.Error && currentResult.IsClosedRegion) { results.Add(new IntellisenseProviderResult(this, currentResult.Option.DisplayValue, currentResult.Message, currentResult.Message, true)); } if (currentResult.Type == enIntellisenseResultType.Selectable) { results.Add(new IntellisenseProviderResult(this, currentResult.Option.DisplayValue, currentResult.Option.Description, currentResult.Option.Description, false)); } } } return results; } public IList<IIntellisenseResult> GetIntellisenseResultsImpl(IntellisenseProviderContext context) { var searchText = context.FindTextToSearch(); var results = new List<IIntellisenseResult>(); if (context.DesiredResultSet == IntellisenseDesiredResultSet.EntireSet) { results.AddRange(IntellisenseResults); } else { if (!InLiteralRegion(context.InputText, context.CaretPosition)) { var filteredResults = IntellisenseResults.Where(i => i.Option.DisplayValue.ToLower(System.Globalization.CultureInfo.CurrentCulture).StartsWith(searchText.ToLower(System.Globalization.CultureInfo.CurrentCulture))); results.AddRange(filteredResults); } } return results; } public void Dispose() { _intellisenseResults = null; } #endregion Override Methods #region Private Methods /// <summary> /// Determines if the caret in a literal region /// </summary> public static bool InLiteralRegion(string inputText, int caretPosition) { var inLiteralRegion = false; var text = inputText; if (caretPosition <= text.Length) { text = text.Replace("\\\\", "##").Replace("\\'", "##").Replace("'''", "###"); inLiteralRegion = text.Substring(0, caretPosition).Count(s => s == '\'') % 2 != 0; } return inLiteralRegion; } #endregion Private Methods #region Properties public bool Optional { get; set; } public bool HandlesResultInsertion { get; set; } public List<IIntellisenseResult> IntellisenseResults => _intellisenseResults; #endregion Properties } }
{ "pile_set_name": "Github" }
#!/bin/sh ./compile-and-run-gambit-fixnum-benchmark boyer ./compile-and-run-gambit-fixnum-benchmark browse ./compile-and-run-gambit-fixnum-benchmark cpstak ./compile-and-run-gambit-fixnum-benchmark ctak ./compile-and-run-gambit-fixnum-benchmark dderiv ./compile-and-run-gambit-fixnum-benchmark deriv ./compile-and-run-gambit-fixnum-benchmark destruct ./compile-and-run-gambit-fixnum-benchmark div-iter ./compile-and-run-gambit-fixnum-benchmark div-rec ./compile-and-run-gambit-benchmark fft ./compile-and-run-gambit-fixnum-benchmark fprint ./compile-and-run-gambit-fixnum-benchmark fread ./compile-and-run-gambit-fixnum-benchmark puzzle ./compile-and-run-gambit-fixnum-benchmark tak ./compile-and-run-gambit-fixnum-benchmark takl ./compile-and-run-gambit-fixnum-benchmark takr ./compile-and-run-gambit-fixnum-benchmark tprint ./compile-and-run-gambit-fixnum-benchmark traverse ./compile-and-run-gambit-fixnum-benchmark traverse-init ./compile-and-run-gambit-fixnum-benchmark fannkuch ./compile-and-run-gambit-benchmark simplex ./compile-and-run-gambit-benchmark em-functional ./compile-and-run-gambit-benchmark em-functional-partial-split ./compile-and-run-gambit-benchmark em-functional-split ./compile-and-run-gambit-benchmark em-functional-do-split ./compile-and-run-gambit-benchmark em-imperative ./compile-and-run-gambit-benchmark em-imperative-split ./compile-and-run-gambit-benchmark nfm ./compile-and-run-gambit-benchmark integ ./compile-and-run-gambit-benchmark integ2 ./compile-and-run-gambit-benchmark gold ./compile-and-run-gambit-benchmark gold2 ./compile-and-run-gambit-benchmark sort ./compile-and-run-gambit-benchmark sort2 ./compile-and-run-gambit-fixnum-benchmark dfa ./compile-and-run-gambit-fixnum-benchmark dfa2 ./compile-and-run-gambit-fixnum-benchmark graphs ./compile-and-run-gambit-fixnum-benchmark lattice
{ "pile_set_name": "Github" }
<!-- start of file --> <!-- This .xml file is part of the Traffic-Control-HOWTO document --> <!-- $Id$ --> <!-- The article was authored by Martin A. Brown <[email protected]> for the linux community, and has been released under the GNU Free Documentation License (GFDL) through The Linux Documentation Project (TLDP). This was initially authored while Martin A. Brown worked for SecurePipe, Inc. (acquired by TrustWave in 2006, which itself was acquired by Singapore Telecom in 2015). This HOWTO is likely available at the following address: http://tldp.org/HOWTO/Traffic-Control-HOWTO/ --> <!-- conventions used in this documentation.... - each section is a separate file --> <section id="intro"> <title>Introduction to Linux Traffic Control</title> <para> Linux offers a very rich set of tools for managing and manipulating the transmission of packets. The larger Linux community is very familiar with the tools available under Linux for packet mangling and firewalling (netfilter, and before that, ipchains) as well as hundreds of network services which can run on the operating system. Few inside the community and fewer outside the Linux community are aware of the tremendous power of the traffic control subsystem which has grown and matured under kernels 2.2 and 2.4. </para> <para> This HOWTO purports to introduce the <link linkend="overview">concepts of traffic control</link>, <link linkend="elements">the traditional elements (in general)</link>, <link linkend="components">the components of the Linux traffic control implementation</link> and provide some <link linkend="rules">guidelines</link> <!-- and <link linkend="examples">examples</link> -->. This HOWTO represents the collection, amalgamation and synthesis of the &url-lartc-howto;, documentation from individual projects and importantly the &url-lartc-mailinglist; over a period of study. </para> <para> The impatient soul, who simply wishes to experiment right now, is recommended to the &url-tcng-htb-howto; and &url-lartc-howto; for immediate satisfaction. </para> <para> </para> <section id="i-assumptions"> <title>Target audience and assumptions about the reader</title> <para> The target audience for this HOWTO is the network administrator or savvy home user who desires an introduction to the field of traffic control and an overview of the tools available under Linux for implementing traffic control. </para> <para> I assume that the reader is comfortable with UNIX concepts and the command line and has a basic knowledge of IP networking. Users who wish to implement traffic control may require the ability to patch, compile and install a kernel or software package <footnote> <para> See <xref linkend="software"/> for more details on the use or installation of a particular traffic control mechanism, kernel or command line utility. </para> </footnote>. For users with newer kernels (2.4.20+, see also <xref linkend="s-kernel"/>), however, the ability to install and use software may be all that is required. </para> <para> Broadly speaking, this HOWTO was written with a sophisticated user in mind, perhaps one who has already had experience with traffic control under Linux. I assume that the reader may have no prior traffic control experience. </para> </section> <section id="i-conventions"> <title>Conventions</title> <para> This text was written in <ulink url="http://www.docbook.org/">DocBook</ulink> (<ulink url="http://www.docbook.org/xml/4.2/index.html">version 4.2</ulink>) with <ulink url="http://vim.sourceforge.net/"><command>vim</command></ulink>. All formatting has been applied by <ulink url="http://xmlsoft.org/XSLT/">xsltproc</ulink> based on <ulink url="http://docbook.sourceforge.net/projects/xsl/">DocBook XSL</ulink> and <ulink url="http://www.tldp.org/LDP/LDP-Author-Guide/usingldpxsl.html">LDP XSL</ulink> stylesheets. Typeface formatting and display conventions are similar to most printed and electronically distributed technical documentation. </para> </section> <section id="i-recommendation"> <title>Recommended approach</title> <para> I strongly recommend to the eager reader making a first foray into the discipline of traffic control, to become only casually familiar with the &link-tc; command line utility, before concentrating on &link-tcng;. The &tcng; software package defines an entire language for describing traffic control structures. At first, this language may seem daunting, but mastery of these basics will quickly provide the user with a much wider ability to employ (and deploy) traffic control configurations than the direct use of &tc; would afford. </para> <para> Where possible, I'll try to prefer describing the behaviour of the Linux traffic control system in an abstract manner, although in many cases I'll need to supply the syntax of one or the other common systems for defining these structures. I may not supply examples in both the &tcng; language and the &tc; command line, so the wise user will have some familiarity with both. </para> <para> </para> </section> <section id="i-missing"> <title>Missing content, corrections and feedback</title> <para> There is content yet missing from this HOWTO. In particular, the following items will be added at some point to this documentation. </para> <itemizedlist> <listitem> <para> A section of examples. </para> </listitem> <listitem> <para> A section detailing the classifiers. </para> </listitem> <listitem> <para> A section discussing the techniques for measuring traffic. </para> </listitem> <listitem> <para> A section covering meters. </para> </listitem> <listitem> <para> More details on &tcng;. </para> </listitem> <listitem> <para> Descriptions of newer qdiscs, specifically, Controlled Delay (codel), Fair Queue Controlled Delay (fq_codel), Proportional Integrated controller Enhanced (pie), Stochastic Fair Blue (sfb), Heavy Hitter Filter (hhf), Choke (choke). </para> </listitem> </itemizedlist> <para> I welcome suggestions, corrections and feedback at &email;. All errors and omissions are strictly my fault. Although I have made every effort to verify the factual correctness of the content presented herein, I cannot accept any responsibility for actions taken under the influence of this documentation. </para> <para> </para> </section> </section> <!-- end of file -->
{ "pile_set_name": "Github" }
'use strict' function id (e) { return e } var prop = require('../util/prop') var filter = require('./filter') //drop items you have already seen. module.exports = function unique (field, invert) { field = prop(field) || id var seen = {} return filter(function (data) { var key = field(data) if(seen[key]) return !!invert //false, by default else seen[key] = true return !invert //true by default }) }
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0 /* * Intel(R) Trace Hub pci driver * * Copyright (C) 2014-2015 Intel Corporation. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/types.h> #include <linux/module.h> #include <linux/device.h> #include <linux/sysfs.h> #include <linux/pci.h> #include "intel_th.h" #define DRIVER_NAME "intel_th_pci" enum { TH_PCI_CONFIG_BAR = 0, TH_PCI_STH_SW_BAR = 2, TH_PCI_RTIT_BAR = 4, }; #define BAR_MASK (BIT(TH_PCI_CONFIG_BAR) | BIT(TH_PCI_STH_SW_BAR)) #define PCI_REG_NPKDSC 0x80 #define NPKDSC_TSACT BIT(5) static int intel_th_pci_activate(struct intel_th *th) { struct pci_dev *pdev = to_pci_dev(th->dev); u32 npkdsc; int err; if (!INTEL_TH_CAP(th, tscu_enable)) return 0; err = pci_read_config_dword(pdev, PCI_REG_NPKDSC, &npkdsc); if (!err) { npkdsc |= NPKDSC_TSACT; err = pci_write_config_dword(pdev, PCI_REG_NPKDSC, npkdsc); } if (err) dev_err(&pdev->dev, "failed to read NPKDSC register\n"); return err; } static void intel_th_pci_deactivate(struct intel_th *th) { struct pci_dev *pdev = to_pci_dev(th->dev); u32 npkdsc; int err; if (!INTEL_TH_CAP(th, tscu_enable)) return; err = pci_read_config_dword(pdev, PCI_REG_NPKDSC, &npkdsc); if (!err) { npkdsc |= NPKDSC_TSACT; err = pci_write_config_dword(pdev, PCI_REG_NPKDSC, npkdsc); } if (err) dev_err(&pdev->dev, "failed to read NPKDSC register\n"); } static int intel_th_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct intel_th_drvdata *drvdata = (void *)id->driver_data; struct resource resource[TH_MMIO_END + TH_NVEC_MAX] = { [TH_MMIO_CONFIG] = pdev->resource[TH_PCI_CONFIG_BAR], [TH_MMIO_SW] = pdev->resource[TH_PCI_STH_SW_BAR], }; int err, r = TH_MMIO_SW + 1, i; struct intel_th *th; err = pcim_enable_device(pdev); if (err) return err; err = pcim_iomap_regions_request_all(pdev, BAR_MASK, DRIVER_NAME); if (err) return err; if (pdev->resource[TH_PCI_RTIT_BAR].start) { resource[TH_MMIO_RTIT] = pdev->resource[TH_PCI_RTIT_BAR]; r++; } err = pci_alloc_irq_vectors(pdev, 1, 8, PCI_IRQ_ALL_TYPES); if (err > 0) for (i = 0; i < err; i++, r++) { resource[r].flags = IORESOURCE_IRQ; resource[r].start = pci_irq_vector(pdev, i); } th = intel_th_alloc(&pdev->dev, drvdata, resource, r); if (IS_ERR(th)) return PTR_ERR(th); th->activate = intel_th_pci_activate; th->deactivate = intel_th_pci_deactivate; pci_set_master(pdev); return 0; } static void intel_th_pci_remove(struct pci_dev *pdev) { struct intel_th *th = pci_get_drvdata(pdev); intel_th_free(th); pci_free_irq_vectors(pdev); } static const struct intel_th_drvdata intel_th_2x = { .tscu_enable = 1, .has_mintctl = 1, }; static const struct pci_device_id intel_th_pci_id_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9d26), .driver_data = (kernel_ulong_t)0, }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa126), .driver_data = (kernel_ulong_t)0, }, { /* Apollo Lake */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x5a8e), .driver_data = (kernel_ulong_t)0, }, { /* Broxton */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0a80), .driver_data = (kernel_ulong_t)0, }, { /* Broxton B-step */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1a8e), .driver_data = (kernel_ulong_t)0, }, { /* Kaby Lake PCH-H */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa2a6), .driver_data = (kernel_ulong_t)0, }, { /* Denverton */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x19e1), .driver_data = (kernel_ulong_t)0, }, { /* Lewisburg PCH */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa1a6), .driver_data = (kernel_ulong_t)0, }, { /* Lewisburg PCH */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa226), .driver_data = (kernel_ulong_t)0, }, { /* Gemini Lake */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x318e), .driver_data = (kernel_ulong_t)&intel_th_2x, }, { /* Cannon Lake H */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa326), .driver_data = (kernel_ulong_t)&intel_th_2x, }, { /* Cannon Lake LP */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9da6), .driver_data = (kernel_ulong_t)&intel_th_2x, }, { /* Cedar Fork PCH */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x18e1), .driver_data = (kernel_ulong_t)&intel_th_2x, }, { /* Ice Lake PCH */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x34a6), .driver_data = (kernel_ulong_t)&intel_th_2x, }, { /* Comet Lake */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x02a6), .driver_data = (kernel_ulong_t)&intel_th_2x, }, { /* Ice Lake NNPI */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x45c5), .driver_data = (kernel_ulong_t)&intel_th_2x, }, { /* Tiger Lake PCH */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa0a6), .driver_data = (kernel_ulong_t)&intel_th_2x, }, { 0 }, }; MODULE_DEVICE_TABLE(pci, intel_th_pci_id_table); static struct pci_driver intel_th_pci_driver = { .name = DRIVER_NAME, .id_table = intel_th_pci_id_table, .probe = intel_th_pci_probe, .remove = intel_th_pci_remove, }; module_pci_driver(intel_th_pci_driver); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("Intel(R) Trace Hub PCI controller driver"); MODULE_AUTHOR("Alexander Shishkin <[email protected]>");
{ "pile_set_name": "Github" }
package com.jnape.palatable.lambda.functions.builtin.fn3; import org.junit.Test; import static com.jnape.palatable.lambda.functions.builtin.fn3.Clamp.clamp; import static org.junit.Assert.assertEquals; public class ClampTest { @Test public void clampsValueBetweenBounds() { assertEquals((Integer) 5, clamp(1, 10, 5)); assertEquals((Integer) 1, clamp(1, 10, -1)); assertEquals((Integer) 10, clamp(1, 10, 11)); } }
{ "pile_set_name": "Github" }
# Options for keepalived. See `keepalived --help' output and keepalived(8) and # keepalived.conf(5) man pages for a list of all options. Here are the most # common ones : # # --vrrp -P Only run with VRRP subsystem. # --check -C Only run with Health-checker subsystem. # --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop. # --dont-release-ipvs -I Dont remove IPVS topology on daemon stop. # --dump-conf -d Dump the configuration data. # --log-detail -D Detailed log messages. # --log-facility -S 0-7 Set local syslog facility (default=LOG_DAEMON) # KEEPALIVED_OPTIONS="-D"
{ "pile_set_name": "Github" }
/** @file kdtree.c ** @brief KD-tree - Definition ** @author Andrea Vedaldi, David Novotny **/ /* Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. All rights reserved. This file is part of the VLFeat library and is made available under the terms of the BSD license (see the COPYING file). */ /** <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> @page kdtree KD-trees and forests @author Andrea Vedaldi @author David Novotny <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> @ref kdtree.h implements a KD-tree object, a data structure that can efficiently index moderately dimensional vector spaces. Both best-bin-first @cite{beis97shape} and randomized KD-tree forests are implemented @cite{silpa-anan08optimised},@cite{muja09fast}. Applications include fast matching of feature descriptors. - @ref kdtree-overview - @ref kdtree-tech <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> @section kdtree-overview Overview <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> To create a ::VlKDForest object use ::vl_kdforest_new specifying the dimensionality of the data and the number of trees in the forest. With one tree only, the algorithm is analogous to @cite{beis97shape} (best-bin KDTree). Multiple trees correspond to the randomized KDTree forest as in @cite{silpa-anan08optimised},@cite{muja09fast}. To let the KD-tree index some data use ::vl_kdforest_build. Note that for efficiency KD-tree does not copy the data but retains a pointer to it. Therefore the data must exist (and not change) until the KD-tree is deleted. To delete the KD-tree object, use ::vl_kdforest_delete. To find the N nearest neighbors to a query point first instantiate a ::VlKDForestSearcher and then start search using a ::vl_kdforest_query with the searcher object as an argument. To set a maximum number of comparisons per query and calculate approximate nearest neighbors use ::vl_kdforest_set_max_num_comparisons. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> @section kdtree-tech Technical details <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> ::VlKDForest implements the best-bin-first kd-tree of @cite{beis97shape}. <b>Construction.</b> Given a set of points @f$ x_1,\dots,x_n \in \mathbb{R}^d @f$, the algorithm recursively partitions the @e d dimensional Euclidean space @f$ \mathbb{R}^d @f$ into (hyper-) rectangles. Partitions are organized into a binary tree with the root corresponding to the whole space @f$ \mathbb{R}^d @f$. The algorithm refines each partition by dividing it into two halves by thresholding along a given dimension. Both the splitting dimension and the threshold are determined as a statistic of the data points contained in the partition. The splitting dimension is the one which has largest sample variance and the splitting threshold is either the sample mean or the median. Leaves are atomic partitions and they contain a list of zero or more data points (typically one). <b>Querying.</b> Querying amounts to finding the N data points closer to a given query point @f$ x_q \in \mathbb{R}^d @f$. This is done by branch-and-bound. A search state is an active partition (initially the root) and it is weighed by the lower bound on the distance of any point in the partition and the query point. Such a lower bound is trivial to compute because partitions are hyper-rectangles. <b>Querying usage.</b> As said before a user has to create an instance ::VlKDForestSearcher using ::vl_kdforest_new_searcher in order to be able to make queries. When a user wants to delete a KD-Tree all the searchers bound to the given KD-Forest are erased automatically. If a user wants to delete some of the searchers before the KD-Tree erase, he could do it using the vl_kdforest_delete_searcher method. **/ #include "kdtree.h" #include "generic.h" #include "random.h" #include "mathop.h" #include <stdlib.h> #if defined(_OPENMP) #include <omp.h> #endif #define VL_HEAP_prefix vl_kdforest_search_heap #define VL_HEAP_type VlKDForestSearchState #define VL_HEAP_cmp(v,x,y) (v[x].distanceLowerBound - v[y].distanceLowerBound) #include "heap-def.h" #define VL_HEAP_prefix vl_kdtree_split_heap #define VL_HEAP_type VlKDTreeSplitDimension #define VL_HEAP_cmp(v,x,y) (v[x].variance - v[y].variance) #include "heap-def.h" #define VL_HEAP_prefix vl_kdforest_neighbor_heap #define VL_HEAP_type VlKDForestNeighbor #define VL_HEAP_cmp(v,x,y) (v[y].distance - v[x].distance) #include "heap-def.h" /** ------------------------------------------------------------------ ** @internal ** @brief Allocate a new node from the tree pool **/ static vl_uindex vl_kdtree_node_new (VlKDTree * tree, vl_uindex parentIndex) { VlKDTreeNode * node = NULL ; vl_uindex nodeIndex = tree->numUsedNodes ; tree -> numUsedNodes += 1 ; assert (tree->numUsedNodes <= tree->numAllocatedNodes) ; node = tree->nodes + nodeIndex ; node -> parent = parentIndex ; node -> lowerChild = 0 ; node -> upperChild = 0 ; node -> splitDimension = 0 ; node -> splitThreshold = 0 ; return nodeIndex ; } /** ------------------------------------------------------------------ ** @internal ** @brief Compare KDTree index entries for sorting **/ VL_INLINE int vl_kdtree_compare_index_entries (void const * a, void const * b) { double delta = ((VlKDTreeDataIndexEntry const*)a) -> value - ((VlKDTreeDataIndexEntry const*)b) -> value ; if (delta < 0) return -1 ; if (delta > 0) return +1 ; return 0 ; } /** ------------------------------------------------------------------ ** @internal ** @brief Build KDTree recursively ** @param forest forest to which the tree belongs. ** @param tree tree being built. ** @param nodeIndex node to process. ** @param dataBegin begin of data for this node. ** @param dataEnd end of data for this node. ** @param depth depth of this node. **/ static void vl_kdtree_build_recursively (VlKDForest * forest, VlKDTree * tree, vl_uindex nodeIndex, vl_uindex dataBegin, vl_uindex dataEnd, unsigned int depth) { vl_uindex d, i, medianIndex, splitIndex ; VlKDTreeNode * node = tree->nodes + nodeIndex ; VlKDTreeSplitDimension * splitDimension ; /* base case: there is only one data point */ if (dataEnd - dataBegin <= 1) { if (tree->depth < depth) tree->depth = depth ; node->lowerChild = - dataBegin - 1; node->upperChild = - dataEnd - 1 ; return ; } /* compute the dimension with largest variance > 0 */ forest->splitHeapNumNodes = 0 ; for (d = 0 ; d < forest->dimension ; ++ d) { double mean = 0 ; /* unnormalized */ double secondMoment = 0 ; double variance = 0 ; vl_size numSamples = VL_KDTREE_VARIANCE_EST_NUM_SAMPLES; vl_bool useAllData = VL_FALSE; if(dataEnd - dataBegin <= VL_KDTREE_VARIANCE_EST_NUM_SAMPLES) { useAllData = VL_TRUE; numSamples = dataEnd - dataBegin; } for (i = 0; i < numSamples ; ++ i) { vl_uint32 sampleIndex; vl_index di; double datum ; if(useAllData == VL_TRUE) { sampleIndex = (vl_uint32)i; } else { sampleIndex = (vl_rand_uint32(forest->rand) % VL_KDTREE_VARIANCE_EST_NUM_SAMPLES); } sampleIndex += dataBegin; di = tree->dataIndex[sampleIndex].index ; switch(forest->dataType) { case VL_TYPE_FLOAT: datum = ((float const*)forest->data) [di * forest->dimension + d] ; break ; case VL_TYPE_DOUBLE: datum = ((double const*)forest->data) [di * forest->dimension + d] ; break ; default: abort() ; } mean += datum ; secondMoment += datum * datum ; } mean /= numSamples ; secondMoment /= numSamples ; variance = secondMoment - mean * mean ; if (variance <= 0) continue ; /* keep splitHeapSize most varying dimensions */ if (forest->splitHeapNumNodes < forest->splitHeapSize) { VlKDTreeSplitDimension * splitDimension = forest->splitHeapArray + forest->splitHeapNumNodes ; splitDimension->dimension = (unsigned int)d ; splitDimension->mean = mean ; splitDimension->variance = variance ; vl_kdtree_split_heap_push (forest->splitHeapArray, &forest->splitHeapNumNodes) ; } else { VlKDTreeSplitDimension * splitDimension = forest->splitHeapArray + 0 ; if (splitDimension->variance < variance) { splitDimension->dimension = (unsigned int)d ; splitDimension->mean = mean ; splitDimension->variance = variance ; vl_kdtree_split_heap_update (forest->splitHeapArray, forest->splitHeapNumNodes, 0) ; } } } /* additional base case: the maximum variance is equal to 0 (overlapping points) */ if (forest->splitHeapNumNodes == 0) { node->lowerChild = - dataBegin - 1 ; node->upperChild = - dataEnd - 1 ; return ; } /* toss a dice to decide the splitting dimension (variance > 0) */ splitDimension = forest->splitHeapArray + (vl_rand_uint32(forest->rand) % VL_MIN(forest->splitHeapSize, forest->splitHeapNumNodes)) ; node->splitDimension = splitDimension->dimension ; /* sort data along largest variance dimension */ for (i = dataBegin ; i < dataEnd ; ++ i) { vl_index di = tree->dataIndex[i].index ; double datum ; switch (forest->dataType) { case VL_TYPE_FLOAT: datum = ((float const*)forest->data) [di * forest->dimension + splitDimension->dimension] ; break ; case VL_TYPE_DOUBLE: datum = ((double const*)forest->data) [di * forest->dimension + splitDimension->dimension] ; break ; default: abort() ; } tree->dataIndex [i] .value = datum ; } qsort (tree->dataIndex + dataBegin, dataEnd - dataBegin, sizeof (VlKDTreeDataIndexEntry), vl_kdtree_compare_index_entries) ; /* determine split threshold */ switch (forest->thresholdingMethod) { case VL_KDTREE_MEAN : node->splitThreshold = splitDimension->mean ; for (splitIndex = dataBegin ; splitIndex < dataEnd && tree->dataIndex[splitIndex].value <= node->splitThreshold ; ++ splitIndex) ; splitIndex -= 1 ; /* If the mean does not provide a proper partition, fall back to * median. This usually happens if all points have the same * value and the zero variance test fails for numerical accuracy * reasons. In this case, also due to numerical accuracy, the * mean value can be smaller, equal, or larger than all * points. */ if (dataBegin <= splitIndex && splitIndex + 1 < dataEnd) break ; case VL_KDTREE_MEDIAN : medianIndex = (dataBegin + dataEnd - 1) / 2 ; splitIndex = medianIndex ; node -> splitThreshold = tree->dataIndex[medianIndex].value ; break ; default: abort() ; } /* divide subparts */ node->lowerChild = vl_kdtree_node_new (tree, nodeIndex) ; vl_kdtree_build_recursively (forest, tree, node->lowerChild, dataBegin, splitIndex + 1, depth + 1) ; node->upperChild = vl_kdtree_node_new (tree, nodeIndex) ; vl_kdtree_build_recursively (forest, tree, node->upperChild, splitIndex + 1, dataEnd, depth + 1) ; } /** ------------------------------------------------------------------ ** @brief Create new KDForest object ** @param dataType type of data (::VL_TYPE_FLOAT or ::VL_TYPE_DOUBLE) ** @param dimension data dimensionality. ** @param numTrees number of trees in the forest. ** @param distance type of distance norm (::VlDistanceL1 or ::VlDistanceL2). ** @return new KDForest. ** ** The data dimension @a dimension and the number of trees @a ** numTrees must not be smaller than one. **/ VlKDForest * vl_kdforest_new (vl_type dataType, vl_size dimension, vl_size numTrees, VlVectorComparisonType distance) { VlKDForest * self = vl_calloc (sizeof(VlKDForest), 1) ; assert(dataType == VL_TYPE_FLOAT || dataType == VL_TYPE_DOUBLE) ; assert(dimension >= 1) ; assert(numTrees >= 1) ; self -> rand = vl_get_rand () ; self -> dataType = dataType ; self -> numData = 0 ; self -> data = 0 ; self -> dimension = dimension ; self -> numTrees = numTrees ; self -> trees = 0 ; self -> thresholdingMethod = VL_KDTREE_MEDIAN ; self -> splitHeapSize = VL_MIN(numTrees, VL_KDTREE_SPLIT_HEAP_SIZE) ; self -> splitHeapNumNodes = 0 ; self -> distance = distance; self -> maxNumNodes = 0 ; self -> numSearchers = 0 ; self -> headSearcher = 0 ; switch (self->dataType) { case VL_TYPE_FLOAT: self -> distanceFunction = (void(*)(void)) vl_get_vector_comparison_function_f (distance) ; break; case VL_TYPE_DOUBLE : self -> distanceFunction = (void(*)(void)) vl_get_vector_comparison_function_d (distance) ; break ; default : abort() ; } return self ; } /** ------------------------------------------------------------------ ** @brief Create a KDForest searcher object, used for processing queries ** @param kdforest a forest to which the queries should be pointing. ** @return KDForest searcher object. ** ** A searcher is an object attached to the forest which must be created ** before running the queries. Each query has to be invoked with the ** searcher as its argument. ** ** When using a multi-threaded approach a user should at first instantiate ** a correct number of searchers - each used in one thread. ** Then in each thread a query to the given searcher could be run. ** **/ VlKDForestSearcher * vl_kdforest_new_searcher (VlKDForest * kdforest) { VlKDForestSearcher * self = vl_calloc(sizeof(VlKDForestSearcher), 1); if(kdforest->numSearchers == 0) { kdforest->headSearcher = self; self->previous = NULL; self->next = NULL; } else { VlKDForestSearcher * lastSearcher = kdforest->headSearcher; while (1) { if(lastSearcher->next) { lastSearcher = lastSearcher->next; } else { lastSearcher->next = self; self->previous = lastSearcher; self->next = NULL; break; } } } kdforest->numSearchers++; self->forest = kdforest; self->searchHeapArray = vl_malloc (sizeof(VlKDForestSearchState) * kdforest->maxNumNodes) ; self->searchIdBook = vl_calloc (sizeof(vl_uindex), kdforest->numData) ; return self ; } /** ------------------------------------------------------------------ ** @brief Delete object ** @param self object. **/ void vl_kdforestsearcher_delete (VlKDForestSearcher * self) { if (self->previous && self->next) { self->previous->next = self->next; self->next->previous = self->previous; } else if (self->previous && !self->next) { self->previous->next = NULL; } else if (!self->previous && self->next) { self->next->previous = NULL; self->forest->headSearcher = self->next; } else { self->forest->headSearcher = NULL; } self->forest->numSearchers -- ; vl_free(self->searchHeapArray) ; vl_free(self->searchIdBook) ; vl_free(self) ; } VlKDForestSearcher * vl_kdforest_get_searcher (VlKDForest const * self, vl_uindex pos) { VlKDForestSearcher * lastSearcher = self->headSearcher ; vl_uindex i ; for(i = 0; (i < pos) & (lastSearcher != NULL) ; ++i) { lastSearcher = lastSearcher->next ; } return lastSearcher ; } /** ------------------------------------------------------------------ ** @brief Delete KDForest object ** @param self KDForest object to delete ** @sa ::vl_kdforest_new **/ void vl_kdforest_delete (VlKDForest * self) { vl_uindex ti ; VlKDForestSearcher * searcher ; while ((searcher = vl_kdforest_get_searcher(self, 0))) { vl_kdforestsearcher_delete(searcher) ; } if (self->trees) { for (ti = 0 ; ti < self->numTrees ; ++ ti) { if (self->trees[ti]) { if (self->trees[ti]->nodes) vl_free (self->trees[ti]->nodes) ; if (self->trees[ti]->dataIndex) vl_free (self->trees[ti]->dataIndex) ; vl_free (self->trees[ti]) ; } } vl_free (self->trees) ; } vl_free (self) ; } /** ------------------------------------------------------------------ ** @internal @brief Compute tree bounds recursively ** @param tree KDTree object instance. ** @param nodeIndex node index to start from. ** @param searchBounds 2 x numDimension array of bounds. **/ static void vl_kdtree_calc_bounds_recursively (VlKDTree * tree, vl_uindex nodeIndex, double * searchBounds) { VlKDTreeNode * node = tree->nodes + nodeIndex ; vl_uindex i = node->splitDimension ; double t = node->splitThreshold ; node->lowerBound = searchBounds [2 * i + 0] ; node->upperBound = searchBounds [2 * i + 1] ; //VL_PRINT("%f %f\n",node->lowerBound,node->upperBound); if (node->lowerChild > 0) { searchBounds [2 * i + 1] = t ; vl_kdtree_calc_bounds_recursively (tree, node->lowerChild, searchBounds) ; searchBounds [2 * i + 1] = node->upperBound ; } if (node->upperChild > 0) { searchBounds [2 * i + 0] = t ; vl_kdtree_calc_bounds_recursively (tree, node->upperChild, searchBounds) ; searchBounds [2 * i + 0] = node->lowerBound ; } } /** ------------------------------------------------------------------ ** @brief Build KDTree from data ** @param self KDTree object ** @param numData number of data points. ** @param data pointer to the data. ** ** The function builds the KDTree by processing the data @a data. For ** efficiency, KDTree does not make a copy the data, but retains a ** pointer to it. Therefore the data buffer must be valid and ** unchanged for the lifespan of the object. ** ** The number of data points @c numData must not be smaller than one. **/ void vl_kdforest_build (VlKDForest * self, vl_size numData, void const * data) { vl_uindex di, ti ; vl_size maxNumNodes ; double * searchBounds; assert(data) ; assert(numData >= 1) ; /* need to check: if alredy built, clean first */ self->data = data ; self->numData = numData ; self->trees = vl_malloc (sizeof(VlKDTree*) * self->numTrees) ; maxNumNodes = 0 ; for (ti = 0 ; ti < self->numTrees ; ++ ti) { self->trees[ti] = vl_malloc (sizeof(VlKDTree)) ; self->trees[ti]->dataIndex = vl_malloc (sizeof(VlKDTreeDataIndexEntry) * self->numData) ; for (di = 0 ; di < self->numData ; ++ di) { self->trees[ti]->dataIndex[di].index = di ; } self->trees[ti]->numUsedNodes = 0 ; /* num. nodes of a complete binary tree with numData leaves */ self->trees[ti]->numAllocatedNodes = 2 * self->numData - 1 ; self->trees[ti]->nodes = vl_malloc (sizeof(VlKDTreeNode) * self->trees[ti]->numAllocatedNodes) ; self->trees[ti]->depth = 0 ; vl_kdtree_build_recursively (self, self->trees[ti], vl_kdtree_node_new(self->trees[ti], 0), 0, self->numData, 0) ; maxNumNodes += self->trees[ti]->numUsedNodes ; } searchBounds = vl_malloc(sizeof(double) * 2 * self->dimension); for (ti = 0 ; ti < self->numTrees ; ++ ti) { double * iter = searchBounds ; double * end = iter + 2 * self->dimension ; while (iter < end) { *iter++ = - VL_INFINITY_F ; *iter++ = + VL_INFINITY_F ; } vl_kdtree_calc_bounds_recursively (self->trees[ti], 0, searchBounds) ; } vl_free(searchBounds); self -> maxNumNodes = maxNumNodes; } /** ------------------------------------------------------------------ ** @internal @brief **/ vl_uindex vl_kdforest_query_recursively (VlKDForestSearcher * searcher, VlKDTree * tree, vl_uindex nodeIndex, VlKDForestNeighbor * neighbors, vl_size numNeighbors, vl_size * numAddedNeighbors, double dist, void const * query) { VlKDTreeNode const * node = tree->nodes + nodeIndex ; vl_uindex i = node->splitDimension ; vl_index nextChild, saveChild ; double delta, saveDist ; double x ; double x1 = node->lowerBound ; double x2 = node->splitThreshold ; double x3 = node->upperBound ; VlKDForestSearchState * searchState ; searcher->searchNumRecursions ++ ; switch (searcher->forest->dataType) { case VL_TYPE_FLOAT : x = ((float const*) query)[i] ; break ; case VL_TYPE_DOUBLE : x = ((double const*) query)[i] ; break ; default : abort() ; } /* base case: this is a leaf node */ if (node->lowerChild < 0) { vl_index begin = - node->lowerChild - 1 ; vl_index end = - node->upperChild - 1 ; vl_index iter ; for (iter = begin ; iter < end && (searcher->forest->searchMaxNumComparisons == 0 || searcher->searchNumComparisons < searcher->forest->searchMaxNumComparisons) ; ++ iter) { vl_index di = tree->dataIndex [iter].index ; /* multiple KDTrees share the database points and we must avoid * adding the same point twice */ if (searcher->searchIdBook[di] == searcher->searchId) continue ; searcher->searchIdBook[di] = searcher->searchId ; /* compare the query to this point */ switch (searcher->forest->dataType) { case VL_TYPE_FLOAT: dist = ((VlFloatVectorComparisonFunction)searcher->forest->distanceFunction) (searcher->forest->dimension, ((float const *)query), ((float const*)searcher->forest->data) + di * searcher->forest->dimension) ; break ; case VL_TYPE_DOUBLE: dist = ((VlDoubleVectorComparisonFunction)searcher->forest->distanceFunction) (searcher->forest->dimension, ((double const *)query), ((double const*)searcher->forest->data) + di * searcher->forest->dimension) ; break ; default: abort() ; } searcher->searchNumComparisons += 1 ; /* see if it should be added to the result set */ if (*numAddedNeighbors < numNeighbors) { VlKDForestNeighbor * newNeighbor = neighbors + *numAddedNeighbors ; newNeighbor->index = di ; newNeighbor->distance = dist ; vl_kdforest_neighbor_heap_push (neighbors, numAddedNeighbors) ; } else { VlKDForestNeighbor * largestNeighbor = neighbors + 0 ; if (largestNeighbor->distance > dist) { largestNeighbor->index = di ; largestNeighbor->distance = dist ; vl_kdforest_neighbor_heap_update (neighbors, *numAddedNeighbors, 0) ; } } } /* next data point */ return nodeIndex ; } #if 0 assert (x1 <= x2 && x2 <= x3) ; assert (node->lowerChild >= 0) ; assert (node->upperChild >= 0) ; #endif /* * x1 x2 x3 * x (---|---] * (--x|---] * (---|x--] * (---|---] x */ delta = x - x2 ; saveDist = dist + delta*delta ; if (x <= x2) { nextChild = node->lowerChild ; saveChild = node->upperChild ; if (x <= x1) { delta = x - x1 ; saveDist -= delta*delta ; } } else { nextChild = node->upperChild ; saveChild = node->lowerChild ; if (x > x3) { delta = x - x3 ; saveDist -= delta*delta ; } } if (*numAddedNeighbors < numNeighbors || neighbors[0].distance > saveDist) { searchState = searcher->searchHeapArray + searcher->searchHeapNumNodes ; searchState->tree = tree ; searchState->nodeIndex = saveChild ; searchState->distanceLowerBound = saveDist ; vl_kdforest_search_heap_push (searcher->searchHeapArray , &searcher->searchHeapNumNodes) ; } return vl_kdforest_query_recursively (searcher, tree, nextChild, neighbors, numNeighbors, numAddedNeighbors, dist, query) ; } /** ------------------------------------------------------------------ ** @brief Query the forest ** @param self object. ** @param neighbors list of nearest neighbors found (output). ** @param numNeighbors number of nearest neighbors to find. ** @param query query point. ** @return number of tree leaves visited. ** ** A neighbor is represented by an instance of the structure ** ::VlKDForestNeighbor. Each entry contains the index of the ** neighbor (this is an index into the KDTree data) and its distance ** to the query point. Neighbors are sorted by increasing distance. **/ vl_size vl_kdforest_query (VlKDForest * self, VlKDForestNeighbor * neighbors, vl_size numNeighbors, void const * query) { VlKDForestSearcher * searcher = vl_kdforest_get_searcher(self, 0) ; if (searcher == NULL) { searcher = vl_kdforest_new_searcher(self) ; } return vl_kdforestsearcher_query(searcher, neighbors, numNeighbors, query) ; } /** ------------------------------------------------------------------ ** @brief Query the forest ** @param self object. ** @param neighbors list of nearest neighbors found (output). ** @param numNeighbors number of nearest neighbors to find. ** @param query query point. ** @return number of tree leaves visited. ** ** A neighbor is represented by an instance of the structure ** ::VlKDForestNeighbor. Each entry contains the index of the ** neighbor (this is an index into the KDTree data) and its distance ** to the query point. Neighbors are sorted by increasing distance. **/ vl_size vl_kdforestsearcher_query (VlKDForestSearcher * self, VlKDForestNeighbor * neighbors, vl_size numNeighbors, void const * query) { vl_uindex i, ti ; vl_bool exactSearch = self->forest->searchMaxNumComparisons == 0 ; VlKDForestSearchState * searchState ; vl_size numAddedNeighbors = 0 ; assert (neighbors) ; assert (numNeighbors > 0) ; assert (query) ; /* this number is used to differentiate a query from the next */ self -> searchId += 1 ; self -> searchNumRecursions = 0 ; self->searchNumComparisons = 0 ; self->searchNumSimplifications = 0 ; /* put the root node into the search heap */ self->searchHeapNumNodes = 0 ; for (ti = 0 ; ti < self->forest->numTrees ; ++ ti) { searchState = self->searchHeapArray + self->searchHeapNumNodes ; searchState -> tree = self->forest->trees[ti] ; searchState -> nodeIndex = 0 ; searchState -> distanceLowerBound = 0 ; vl_kdforest_search_heap_push (self->searchHeapArray, &self->searchHeapNumNodes) ; } /* branch and bound */ while (exactSearch || self->searchNumComparisons < self->forest->searchMaxNumComparisons) { /* pop the next optimal search node */ VlKDForestSearchState * searchState ; /* break if search space completed */ if (self->searchHeapNumNodes == 0) { break ; } searchState = self->searchHeapArray + vl_kdforest_search_heap_pop (self->searchHeapArray, &self->searchHeapNumNodes) ; /* break if no better solution may exist */ if (numAddedNeighbors == numNeighbors && neighbors[0].distance < searchState->distanceLowerBound) { self->searchNumSimplifications ++ ; break ; } vl_kdforest_query_recursively (self, searchState->tree, searchState->nodeIndex, neighbors, numNeighbors, &numAddedNeighbors, searchState->distanceLowerBound, query) ; } /* sort neighbors by increasing distance */ for (i = numAddedNeighbors ; i < numNeighbors ; ++ i) { neighbors[i].index = -1 ; neighbors[i].distance = VL_NAN_F ; } while (numAddedNeighbors) { vl_kdforest_neighbor_heap_pop (neighbors, &numAddedNeighbors) ; } return self->searchNumComparisons ; } /** ------------------------------------------------------------------ ** @brief Run multiple queries ** @param self object. ** @param indexes assignments of points. ** @param numNeighbors number of nearest neighbors to be found for each data point ** @param numQueries number of query points. ** @param distances distances of query points. ** @param queries lisf of vectors to use as queries. ** ** @a indexes and @a distances are @a numNeighbors by @a numQueries ** matrices containing the indexes and distances of the nearest neighbours ** for each of the @a numQueries queries @a queries. ** ** This function is similar to ::vl_kdforest_query. The main ** difference is that the function can use multiple cores to query ** large amounts of data. ** ** @sa ::vl_kdforest_query. **/ vl_size vl_kdforest_query_with_array (VlKDForest * self, vl_uint32 * indexes, vl_size numNeighbors, vl_size numQueries, void * distances, void const * queries) { vl_size numComparisons = 0; vl_type dataType = vl_kdforest_get_data_type(self) ; vl_size dimension = vl_kdforest_get_data_dimension(self) ; #ifdef _OPENMP #pragma omp parallel default(shared) num_threads(vl_get_max_threads()) #endif { vl_index qi ; vl_size thisNumComparisons = 0 ; VlKDForestSearcher * searcher ; VlKDForestNeighbor * neighbors ; #ifdef _OPENMP #pragma omp critical #endif { searcher = vl_kdforest_new_searcher(self) ; neighbors = vl_calloc (sizeof(VlKDForestNeighbor), numNeighbors) ; } #ifdef _OPENMP #pragma omp for #endif for(qi = 0 ; qi < (signed)numQueries; ++ qi) { switch (dataType) { case VL_TYPE_FLOAT: { vl_size ni; thisNumComparisons += vl_kdforestsearcher_query (searcher, neighbors, numNeighbors, (float const *) (queries) + qi * dimension) ; for (ni = 0 ; ni < numNeighbors ; ++ni) { indexes [qi*numNeighbors + ni] = (vl_uint32) neighbors[ni].index ; if (distances){ *((float*)distances + qi*numNeighbors + ni) = neighbors[ni].distance ; } } break ; } case VL_TYPE_DOUBLE: { vl_size ni; thisNumComparisons += vl_kdforestsearcher_query (searcher, neighbors, numNeighbors, (double const *) (queries) + qi * dimension) ; for (ni = 0 ; ni < numNeighbors ; ++ni) { indexes [qi*numNeighbors + ni] = (vl_uint32) neighbors[ni].index ; if (distances){ *((double*)distances + qi*numNeighbors + ni) = neighbors[ni].distance ; } } break ; } default: abort() ; } } #ifdef _OPENMP #pragma omp critical #endif { numComparisons += thisNumComparisons ; vl_kdforestsearcher_delete (searcher) ; vl_free (neighbors) ; } } return numComparisons ; } /** ------------------------------------------------------------------ ** @brief Get the number of nodes of a given tree ** @param self KDForest object. ** @param treeIndex index of the tree. ** @return number of trees. **/ vl_size vl_kdforest_get_num_nodes_of_tree (VlKDForest const * self, vl_uindex treeIndex) { assert (treeIndex < self->numTrees) ; return self->trees[treeIndex]->numUsedNodes ; } /** ------------------------------------------------------------------ ** @brief Get the detph of a given tree ** @param self KDForest object. ** @param treeIndex index of the tree. ** @return number of trees. **/ vl_size vl_kdforest_get_depth_of_tree (VlKDForest const * self, vl_uindex treeIndex) { assert (treeIndex < self->numTrees) ; return self->trees[treeIndex]->depth ; } /** ------------------------------------------------------------------ ** @brief Get the number of trees in the forest ** ** @param self KDForest object. ** @return number of trees. **/ vl_size vl_kdforest_get_num_trees (VlKDForest const * self) { return self->numTrees ; } /** ------------------------------------------------------------------ ** @brief Set the maximum number of comparisons for a search ** ** @param self KDForest object. ** @param n maximum number of leaves. ** ** This function sets the maximum number of comparisons for a ** nearest neighbor search. Setting it to 0 means unbounded comparisons. ** ** @sa ::vl_kdforest_query, ::vl_kdforest_get_max_num_comparisons. **/ void vl_kdforest_set_max_num_comparisons (VlKDForest * self, vl_size n) { self->searchMaxNumComparisons = n ; } /** ------------------------------------------------------------------ ** @brief Get the maximum number of comparisons for a search ** ** @param self KDForest object. ** @return maximum number of leaves. ** ** @sa ::vl_kdforest_set_max_num_comparisons. **/ vl_size vl_kdforest_get_max_num_comparisons (VlKDForest * self) { return self->searchMaxNumComparisons ; } /** ------------------------------------------------------------------ ** @brief Set the thresholding method ** @param self KDForest object. ** @param method one of ::VlKDTreeThresholdingMethod. ** ** @sa ::vl_kdforest_get_thresholding_method **/ void vl_kdforest_set_thresholding_method (VlKDForest * self, VlKDTreeThresholdingMethod method) { assert(method == VL_KDTREE_MEDIAN || method == VL_KDTREE_MEAN) ; self->thresholdingMethod = method ; } /** ------------------------------------------------------------------ ** @brief Get the thresholding method ** ** @param self KDForest object. ** @return thresholding method. ** ** @sa ::vl_kdforest_set_thresholding_method **/ VlKDTreeThresholdingMethod vl_kdforest_get_thresholding_method (VlKDForest const * self) { return self->thresholdingMethod ; } /** ------------------------------------------------------------------ ** @brief Get the dimension of the data ** @param self KDForest object. ** @return dimension of the data. **/ vl_size vl_kdforest_get_data_dimension (VlKDForest const * self) { return self->dimension ; } /** ------------------------------------------------------------------ ** @brief Get the data type ** @param self KDForest object. ** @return data type (one of ::VL_TYPE_FLOAT, ::VL_TYPE_DOUBLE). **/ vl_type vl_kdforest_get_data_type (VlKDForest const * self) { return self->dataType ; } /** ------------------------------------------------------------------ ** @brief Get the forest linked to the searcher ** @param self object. ** @return correspoinding KD-Forest. **/ VlKDForest * vl_kdforestsearcher_get_forest (VlKDForestSearcher const * self) { return self->forest; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright 2015 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. --> <org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:chrome="http://schemas.android.com/apk/res-auto" android:background="#c000" > <RelativeLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_gravity="center" android:background="#FFFF" > <LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_alignParentTop="true" android:orientation="vertical" > <ScrollView android:id="@+id/data_reduction_promo_scroll" android:layout_height="0dp" android:layout_width="match_parent" android:layout_weight="1" android:fillViewport="true" android:requiresFadingEdge="vertical" android:fadingEdgeLength="20dp" > <LinearLayout android:id="@+id/data_reduction_promo_content" android:layout_height="wrap_content" android:layout_width="match_parent" android:paddingEnd="24dp" android:paddingStart="24dp" android:paddingTop="64dp" > <ImageView android:id="@+id/data_reduction_illustration" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center" android:adjustViewBounds="true" android:contentDescription="@null" android:src="@drawable/data_reduction_illustration" /> <LinearLayout android:id="@+id/text_wrapper" android:layout_height="wrap_content" android:layout_width="wrap_content" android:orientation="vertical" > <TextView android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_marginBottom="8dp" android:text="@string/data_reduction_promo_title" android:textColor="@color/default_text_color" android:textSize="@dimen/data_reduction_promo_title_text_size" /> <TextView android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_marginBottom="30dp" android:lineSpacingMultiplier="1.3" android:text="@string/data_reduction_promo_summary" android:textColor="#646464" android:textSize="@dimen/data_reduction_promo_normal_text_size" /> </LinearLayout> </LinearLayout> </ScrollView> <LinearLayout android:id="@+id/data_reduction_promo_buttons" android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="horizontal" android:clipToPadding="false" android:padding="16dp" android:gravity="end" > <Button android:id="@+id/no_thanks_button" android:layout_height="match_parent" android:layout_width="wrap_content" android:layout_marginEnd="8dp" android:minHeight="40dp" android:text="@string/no_thanks" android:textColor="@color/light_normal_color" android:textSize="@dimen/data_reduction_promo_button_text_size" style="@style/ButtonCompatBorderless" /> <org.chromium.ui.widget.ButtonCompat android:id="@+id/enable_button" android:layout_height="match_parent" android:layout_width="wrap_content" android:elevation="0dp" android:minHeight="40dp" android:text="@string/data_reduction_enable_button" android:textColor="#FFFFFF" android:textSize="@dimen/data_reduction_promo_button_text_size" chrome:buttonColor="@color/light_active_color" /> </LinearLayout> </LinearLayout> <org.chromium.chrome.browser.widget.TintedImageButton android:id="@+id/close_button" android:layout_height="56dp" android:layout_width="56dp" android:layout_alignParentEnd="true" android:layout_alignParentTop="true" android:background="?android:attr/selectableItemBackground" android:contentDescription="@string/close" android:src="@drawable/btn_close" /> </RelativeLayout> </org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoView>
{ "pile_set_name": "Github" }
.change-list .filtered { background: inherit !important; } .white-inset-light { box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .6); } #changelist #sitemap { .grey-box-shadow; // overflow: auto; /* Custom styles */ .border-radius(@border-radius, @border-radius, 0, 0); ul.header { background: transparent; color: @text-color; margin: 0; padding: 0; .grey-gradient; .white-shadow; font-weight: bold; height: auto; .border-radius(@border-radius, @border-radius, 0, 0); /* Override jstree style.css */ li { margin: 0; display: block; .cont { display: block; border: 0; white-space: nowrap; height: auto; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .3); // border-bottom: 1px solid #ddd; // border-top: 1px solid #ddd; .white-shadow; } .col1, .col2 > div { padding: 7px 5px 7px; text-align: center; border-right: 1px solid #EDEDED; vertical-align: top; text-transform: capitalize; } .col1 { padding-left: 10px; border-right: 0; } } } li { .col1 { float: left; display: inline; padding: 6px 0 0 10px; } .col2 { // text-align: right; } .col2 > div, .col2 > span { padding: 5px 5px 7px; text-align: center; width: auto; height: auto; float: left; display: block; min-height: 18px; } .col2 > div.col-view-perms { width: 55px; text-align: center; } .col2 > div.col-actions, .col2 > div.col-draft { padding-left: 7px; padding-right: 7px; } } .tree { border-top: 1px solid #ddd; .tree-default { display: block; div.context { display: none !important; } li { display: block; line-height: 16px; &.last { background-color: inherit !important; } a.title { background: none; } a { text-decoration: none; &:hover { text-decoration: underline; } } .col1 { padding-left: 0; .changelink { display: none; } a.title { padding: 6px 0; background: transparent; &:active { cursor: grabbing; cursor: -moz-grabbing; cursor: -webkit-grabbing; } &:before { cursor: hand; cursor: grab; cursor: -moz-grab; cursor: -webkit-grab; content: ''; display: inline-block; background: url('../img/drag-handle.png') 8px center no-repeat; width: 26px; height: 18px; vertical-align: middle; opacity: .4; } &:hover:before { opacity: 1; } } } .col2 > div { display: block; border-left: 1px solid #eee; &.col-softroot, &.col-language { border-left: 0; } } .col-language { color: #ddd !important; text-transform: uppercase; padding-right: 10px; font-size: 11px; } .col-published, .col-navigation { label img { display: none; } } .col-draft { text-align: right; white-space: nowrap; min-width: 32px; a { display: inline-block; vertical-align: middle; } } .col-lastchange { white-space: nowrap; } .col-actions { a { .bs-icon; margin-left: 4px; &:first-child { margin-left: 0; } &.deletelink { background-position: -312px 0; } &.move { background-position: -120px -72px; } &.copy { background-position: -336px -96px; } } } .viewpage, .publish { .bs-icon; padding: 0; margin-left: 4px; &:first-child { margin-left: 0; } } .viewpage { background-position: -96px -120px; } .publish { background-position: -288px 0; } .col-draft { .viewpage { background-position: -96px -120px; } } .col-lastchange { .icon { .bs-icon; opacity: .3; background-position: 0 -72px; &:hover { opacity: .3; } &.add { background-position: -408px -96px; } &.pub { background-position: -96px -120px; } &.unp { background-position: -120px -120px; } &.mov { background-position: -168px -72px; } &.del { background-position: -312px 0; } &.app { background-position: -288px 0; } &.publish { opacity: .7; background-position: -72px -96px; &:hover { opacity: 1; } } } } &.selected { >.cont { border: 1px solid rgba(0, 0, 0, .2) !important; } >.cont:hover { border: 1px solid rgba(0, 0, 0, .3) !important; } } .cont { background: #fff; border-color: #e5e5e5; .white-inset; .white-shadow; &:hover { background-color: #f3f3f3; } &.publisher_draft { a, * { color: #999; } .white-inset-light; background-color: #f7f7f7; &:hover { background-color: darken(#f7f7f7, 3%); } } &.publisher_dirty { .col1 a { &:after { content: '*'; color: #aaa; display: inline-block; margin-left: 3px; } } .white-inset-light; background-color: darken(#FCF8E3, 2%); &:hover { background-color: darken(#FCF8E3, 5%); } } &.publisher_delete_requested { .col1 a { color: @red; font-weight: bold; } .white-inset-light; background-color: darken(#fcf0f0, 2%); &:hover { background-color: darken(#fcf0f0, 4%); } } } .messagelist li { color: #666; padding: 10px 0 8px 20px; .white-shadow; } .softroot-icon { .bs-icon; &:hover { opacity: .6; } background-position: 0 -24px; } } li.last.closed > .cont, &>li.last.leaf > .cont { border-bottom: 0; } label { display: inline-block; margin: 0; } input { margin-top: 0; } img { vertical-align: inherit; } .move-target-container { display: none; a { display: inline-block; text-transform: uppercase; font-size: 10px; .border-radius(3px); background: #fff; color: #333; text-align: center; text-decoration: none; margin-left: 1px; border: 1px solid #ddd; .grey-gradient; .white-inset-light; font-size: 14px; line-height: 10px; vertical-align: middle; width: 20px; height: 16px; padding-top: 3px; margin-top: -1px; &:hover { box-shadow: none; background: #fff; color: #000; // color: white !important; text-shadow: none; text-decoration: none; } } } } } } #changelist { width: auto; } #loader-message { display: none; position: absolute; padding: 6px 15px 6px 30px; .greyer-box-shadow; .border-radius(@border-radius); margin-top: -47px; font-weight: bold; right: 20px; background: #fff url("../img/ajax-loader.gif") 7px center no-repeat; }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_20) on Thu Jun 23 18:29:43 CST 2011 --> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <TITLE> Controller (Douyu 0.7.1 API) </TITLE> <META NAME="date" CONTENT="2011-06-23"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Controller (Douyu 0.7.1 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="跳过导航链接"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>类</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Controller.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../douyu/mvc/Context.html" title="douyu.mvc 中的接口"><B>上一个类</B></A>&nbsp; &nbsp;<A HREF="../../douyu/mvc/ControllerException.html" title="douyu.mvc 中的类"><B>下一个类</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?douyu/mvc/Controller.html" target="_top"><B>框架</B></A> &nbsp; &nbsp;<A HREF="Controller.html" target="_top"><B>无框架</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>所有类</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>所有类</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 摘要:&nbsp;必需&nbsp;|&nbsp;<A HREF="#annotation_type_optional_element_summary">可选</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 详细信息:&nbsp;<A HREF="#annotation_type_element_detail">元素</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> douyu.mvc</FONT> <BR> 注释类型 Controller</H2> <HR> <DL> <DT><PRE><FONT SIZE="-1">@Retention(value=RUNTIME) @Target(value=TYPE) </FONT>public @interface <B>Controller</B></DL> </PRE> <P> <HR> <P> <!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== --> <A NAME="annotation_type_optional_element_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>可选元素摘要</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../douyu/mvc/Controller.html#defaultAction()">defaultAction</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../douyu/http/HttpMethod.html" title="douyu.http 中的枚举">HttpMethod</A>[]</CODE></FONT></TD> <TD><CODE><B><A HREF="../../douyu/mvc/Controller.html#httpMethods()">httpMethods</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Controller所能接受的HTTT请求方法类型,会被Action中的值覆盖</TD> </TR> </TABLE> &nbsp; <P> <A NAME="defaultAction()"><!-- --></A><H3> defaultAction</H3> <PRE> public abstract java.lang.String <B>defaultAction</B></PRE> <DL> <DD><DL> </DL> </DD> <DD><DL> </DL> <DL> <DT><B>默认值:</B><DD>"index"</DD> </DL> </DL> <HR> <A NAME="httpMethods()"><!-- --></A><H3> httpMethods</H3> <PRE> public abstract <A HREF="../../douyu/http/HttpMethod.html" title="douyu.http 中的枚举">HttpMethod</A>[] <B>httpMethods</B></PRE> <DL> <DD>Controller所能接受的HTTT请求方法类型,会被Action中的值覆盖 <P> <DD><DL> </DL> </DD> <DD><DL> </DL> <DL> <DT><B>默认值:</B><DD>{douyu.http.HttpMethod.GET, douyu.http.HttpMethod.POST}</DD> </DL> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="跳过导航链接"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>类</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Controller.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../douyu/mvc/Context.html" title="douyu.mvc 中的接口"><B>上一个类</B></A>&nbsp; &nbsp;<A HREF="../../douyu/mvc/ControllerException.html" title="douyu.mvc 中的类"><B>下一个类</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?douyu/mvc/Controller.html" target="_top"><B>框架</B></A> &nbsp; &nbsp;<A HREF="Controller.html" target="_top"><B>无框架</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>所有类</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>所有类</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 摘要:&nbsp;必需&nbsp;|&nbsp;<A HREF="#annotation_type_optional_element_summary">可选</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 详细信息:&nbsp;<A HREF="#annotation_type_element_detail">元素</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
{ "pile_set_name": "Github" }
<Results> <Result> <Input> <Description><![CDATA[Where -> Select]]></Description> <Expression><![CDATA[query.Where(doc => (doc.StringField == "str")).Select(doc => doc.NumericField)]]></Expression> </Input> <Output> <SqlQuery><![CDATA[ SELECT VALUE root["NumericField"] FROM root WHERE (root["StringField"] = "str") ]]></SqlQuery> </Output> </Result> <Result> <Input> <Description><![CDATA[Select -> Where]]></Description> <Expression><![CDATA[query.Select(doc => doc.NumericField).Where(number => (number == 0))]]></Expression> </Input> <Output> <SqlQuery><![CDATA[ SELECT VALUE root["NumericField"] FROM root WHERE (root["NumericField"] = 0) ]]></SqlQuery> </Output> </Result> <Result> <Input> <Description><![CDATA[Select -> Multiple Where]]></Description> <Expression><![CDATA[query.Select(doc => doc.Point).Where(point => (point.Position.Latitude == 100)).Where(point => (point.Position.Longitude == 50)).Where(point => (point.Position.Altitude == Convert(Convert(20, Double), Nullable`1))).Where(point => (point.Position.Coordinates.get_Item(0) == 100)).Where(point => (point.Position.Coordinates.get_Item(1) == 50))]]></Expression> </Input> <Output> <SqlQuery><![CDATA[ SELECT VALUE root["Point"] FROM root WHERE (((((root["Point"]["coordinates"]["Latitude"] = 100) AND (root["Point"]["coordinates"]["Longitude"] = 50)) AND (root["Point"]["coordinates"]["Altitude"] = 20)) AND (root["Point"]["coordinates"]["Coordinates"][0] = 100)) AND (root["Point"]["coordinates"]["Coordinates"][1] = 50)) ]]></SqlQuery> </Output> </Result> <Result> <Input> <Description><![CDATA[Multiple Where -> Select]]></Description> <Expression><![CDATA[query.Where(doc => (doc.Point.Position.Latitude == 100)).Where(doc => (doc.Point.Position.Longitude == 50)).Where(doc => (doc.Point.Position.Altitude == Convert(Convert(20, Double), Nullable`1))).Where(doc => (doc.Point.Position.Coordinates.get_Item(0) == 100)).Where(doc => (doc.Point.Position.Coordinates.get_Item(1) == 50)).Select(doc => doc.Point)]]></Expression> </Input> <Output> <SqlQuery><![CDATA[ SELECT VALUE root["Point"] FROM root WHERE (((((root["Point"]["coordinates"]["Latitude"] = 100) AND (root["Point"]["coordinates"]["Longitude"] = 50)) AND (root["Point"]["coordinates"]["Altitude"] = 20)) AND (root["Point"]["coordinates"]["Coordinates"][0] = 100)) AND (root["Point"]["coordinates"]["Coordinates"][1] = 50)) ]]></SqlQuery> </Output> </Result> </Results>
{ "pile_set_name": "Github" }
<!-- Step 2: Instrument Visual & Collision Models setup --> <Node name="root" dt="0.05"> <RequiredPlugin name="SofaOpenglVisual"/> <BackgroundSetting color="0.5 0.5 0.5" /> <VisualStyle displayFlags="showVisualModels showCollisionModels" /> <Node name="Instrument"> <MechanicalObject name="instrumentState" template="Rigid3d" position="0.05 0.5 -7.65 0 0 0 1" /> <Node name="VisualModel"> <MeshObjLoader name="meshLoader_0" filename="data/mesh/dental_instrument.obj" handleSeams="1" /> <OglModel name="InstrumentVisualModel" src="@meshLoader_0" color="0.8 0.8 0.8 1.0" /> </Node> <Node name="CollisionModel"> <MeshObjLoader filename="data/mesh/dental_instrument_centerline.obj" name="loader" /> <MeshTopology src="@loader" name="InstrumentCollisionModel" /> <MechanicalObject src="@loader" name="instrumentCollisionState" translation="0 -2 0" /> <LineCollisionModel name="instrument" contactStiffness="10" /> <PointCollisionModel name="instrument" contactStiffness="10" /> </Node> </Node> </Node>
{ "pile_set_name": "Github" }
# RGAA 3.2017 - Rule 1.2.1 ## Summary No-check rule ## Business description ### Criterion [1.2](http://references.modernisation.gouv.fr/rgaa-accessibilite/criteres.html#crit-1-2) ### Test [1.2.1](http://references.modernisation.gouv.fr/rgaa-accessibilite/criteres.html#test-1-2-1) ### Description <div lang="fr">Chaque image (balise <code lang="en">img</code>) <a href="http://references.modernisation.gouv.fr/rgaa-accessibilite/glossaire.html#image-de-dcoration">de d&#xE9;coration</a>, sans <a href="http://references.modernisation.gouv.fr/rgaa-accessibilite/glossaire.html#lgende-dimage">l&#xE9;gende</a>, et ayant un attribut <code lang="en">alt</code>, v&#xE9;rifie-t-elle ces conditions&nbsp;? <ul><li>Le contenu de l'attribut <code lang="en">alt</code> est vide (<code lang="en">alt=""</code>).</li> <li>L'image de d&#xE9;coration ne poss&#xE8;de pas d'attribut <code lang="en">title</code>.</li> <li>La balise <code lang="en">img</code> est d&#xE9;pourvue de r&#xF4;le, propri&#xE9;t&#xE9; ou &#xE9;tat ARIA visant &#xE0; labelliser l'image (<code lang="en">aria-label</code>, <code lang="en">aria-describedby</code>, <code lang="en">aria-labelledby</code> par exemple).</li> </ul></div> ### Level **A** ## Technical description ### Scope **Page** ### Decision level @@@TODO ## Algorithm ### Selection None ### Process None ### Analysis #### No Tested In all cases ## TestCases [TestCases files for rule 1.2.1](https://github.com/Asqatasun/Asqatasun/tree/develop/rules/rules-rgaa3.2017/src/test/resources/testcases/rgaa32017/Rgaa32017Rule010201/)
{ "pile_set_name": "Github" }
using System.Runtime.InteropServices; namespace RoslynPad { [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public class ExecutionPlatform { internal string Name { get; } internal string TargetFrameworkMoniker { get; } internal string FrameworkVersion { get; } internal Architecture Architecture { get; } internal bool IsCore { get; } internal bool IsFramework => !IsCore; internal ExecutionPlatform(string name, string targetFrameworkMoniker, string frameworkVersion, Architecture architecture, bool isCore) { Name = name; TargetFrameworkMoniker = targetFrameworkMoniker; FrameworkVersion = frameworkVersion; Architecture = architecture; IsCore = isCore; } public override string ToString() => $"{Name} {FrameworkVersion}"; } }
{ "pile_set_name": "Github" }