text
stringlengths
26
99.8k
meta
dict
#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to <config-patches@gnu.org>. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include <features.h> #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include <sys/systemcfg.h> main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include <stdlib.h> #include <unistd.h> int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include <unistd.h> int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) if objdump -f /bin/sh | grep -q elf32-x86-64; then echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 else echo "$UNAME_MACHINE"-pc-linux-"$LIBC" fi exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL" elif /bin/uname -X 2>/dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <<EOF NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize the system type. Please install a C compiler and try again. EOF ;; esac cat >&2 <<EOF This script (version $timestamp), has failed to recognize the operating system you are using. If your script is old, overwrite *all* copies of config.guess and config.sub with the latest versions from: https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess and https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub If $0 has already been updated, send the following data and any information you think might be pertinent to config-patches@gnu.org to provide the necessary information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End:
{ "pile_set_name": "Github" }
{ "translations" :{ "en": { ".avTitle": "BST Search Proficiency Exercise", "av_Authors": "Kasper Hellström", ".instructLabel": "Instructions:", ".instructions": "Use the BST search algorithm to find the key given in the exercise. Starting with the root, click on an empty node to reveal its value and its children. Work your way down the tree as the search algorithm would.", "#about": "About" }, "fi": { ".avTitle": "Haku binäärisestä hakupuusta", "av_Authors": "Kasper Hellström", ".instructLabel": "Ohjeet:", ".instructions": "Etsi annettua avainta binäärisistä hakupuusta. Haku suoritetaan klikkaamalla jokaisella askeleella sitä piilotettua alipuuta, johon haku etenee.", "#about": "Lisätietoa" } }, "params": { "JXOP-feedback": "atend" }, "code": { "java": { "url": "../../SourceCode/Java/Binary/BST.java", "startAfter": "/* *** ODSATag: findhelp *** */", "endBefore": "/* *** ODSAendTag: findhelp *** */", "tags": {} } } }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_202) on Fri Jul 24 11:53:38 GMT 2020 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.eclipse.rdf4j.sail.nativerdf.model (Eclipse RDF4J 3.3.0 API)</title> <meta name="date" content="2020-07-24"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <h1 class="bar"><a href="../../../../../../org/eclipse/rdf4j/sail/nativerdf/model/package-summary.html" target="classFrame">org.eclipse.rdf4j.sail.nativerdf.model</a></h1> <div class="indexContainer"> <h2 title="Interfaces">Interfaces</h2> <ul title="Interfaces"> <li><a href="NativeResource.html" title="interface in org.eclipse.rdf4j.sail.nativerdf.model" target="classFrame"><span class="interfaceName">NativeResource</span></a></li> <li><a href="NativeValue.html" title="interface in org.eclipse.rdf4j.sail.nativerdf.model" target="classFrame"><span class="interfaceName">NativeValue</span></a></li> </ul> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="NativeBNode.html" title="class in org.eclipse.rdf4j.sail.nativerdf.model" target="classFrame">NativeBNode</a></li> <li><a href="NativeIRI.html" title="class in org.eclipse.rdf4j.sail.nativerdf.model" target="classFrame">NativeIRI</a></li> <li><a href="NativeLiteral.html" title="class in org.eclipse.rdf4j.sail.nativerdf.model" target="classFrame">NativeLiteral</a></li> </ul> </div> </body> </html>
{ "pile_set_name": "Github" }
# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_enable_builddir.html # =========================================================================== # # SYNOPSIS # # AX_ENABLE_BUILDDIR [(dirstring-or-command [,Makefile.mk [,-all]])] # # DESCRIPTION # # If the current configure was run within the srcdir then we move all # configure-files into a subdir and let the configure steps continue # there. We provide an option --disable-builddir to suppress the move into # a separate builddir. # # Defaults: # # $1 = $host (overridden with $HOST) # $2 = Makefile.mk # $3 = -all # # This macro must be called before AM_INIT_AUTOMAKE. It creates a default # toplevel srcdir Makefile from the information found in the created # toplevel builddir Makefile. It just copies the variables and # rule-targets, each extended with a default rule-execution that recurses # into the build directory of the current "HOST". You can override the # auto-dection through `config.guess` and build-time of course, as in # # make HOST=i386-mingw-cross # # which can of course set at configure time as well using # # configure --host=i386-mingw-cross # # After the default has been created, additional rules can be appended # that will not just recurse into the subdirectories and only ever exist # in the srcdir toplevel makefile - these parts are read from the $2 = # Makefile.mk file # # The automatic rules are usually scanning the toplevel Makefile for lines # like '#### $host |$builddir' to recognize the place where to recurse # into. Usually, the last one is the only one used. However, almost all # targets have an additional "*-all" rule which makes the script to # recurse into _all_ variants of the current HOST (!!) setting. The "-all" # suffix can be overriden for the macro as well. # # a special rule is only given for things like "dist" that will copy the # tarball from the builddir to the sourcedir (or $(PUB)) for reason of # convenience. # # LICENSE # # Copyright (c) 2009 Guido U. Draheim <guidod@gmx.de> # Copyright (c) 2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk> # # 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 (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, see <http://www.gnu.org/licenses/>. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 23 AC_DEFUN([AX_ENABLE_BUILDDIR],[ AC_REQUIRE([AC_CANONICAL_HOST])[]dnl AC_REQUIRE([AX_CONFIGURE_ARGS])[]dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])[]dnl AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl SUB="." AC_ARG_ENABLE([builddir], AS_HELP_STRING( [--disable-builddir],[disable automatic build in subdir of sources]) ,[SUB="$enableval"], [SUB="auto"]) if test ".$ac_srcdir_defaulted" != ".no" ; then if test ".$srcdir" = ".." ; then if test -f config.status ; then AC_MSG_NOTICE(toplevel srcdir already configured... skipping subdir build) else test ".$SUB" = "." && SUB="." test ".$SUB" = ".no" && SUB="." test ".$TARGET" = "." && TARGET="$target" test ".$SUB" = ".auto" && SUB="m4_ifval([$1], [$1],[$TARGET])" if test ".$SUB" != ".." ; then # we know where to go and AS_MKDIR_P([$SUB]) echo __.$SUB.__ > $SUB/conftest.tmp cd $SUB if grep __.$SUB.__ conftest.tmp >/dev/null 2>/dev/null ; then rm conftest.tmp AC_MSG_RESULT([continue configure in default builddir "./$SUB"]) else AC_MSG_ERROR([could not change to default builddir "./$SUB"]) fi srcdir=`echo "$SUB" | sed -e 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,[[/]]$,,;'` # going to restart from subdirectory location test -f $srcdir/config.log && mv $srcdir/config.log . test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h . test -f $srcdir/conftest.log && mv $srcdir/conftest.log . test -f $srcdir/$cache_file && mv $srcdir/$cache_file . AC_MSG_RESULT(....exec $SHELL $srcdir/[$]0 "--srcdir=$srcdir" "--enable-builddir=$SUB" ${1+"[$]@"}) case "[$]0" in # restart [/\\]*) eval $SHELL "'[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;; *) eval $SHELL "'$srcdir/[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;; esac ; exit $? fi fi fi fi test ".$SUB" = ".auto" && SUB="." dnl ac_path_prog uses "set dummy" to override $@ which would defeat the "exec" AC_PATH_PROG(SED,gsed sed, sed) AUX="$am_aux_dir" AS_VAR_POPDEF([SED])dnl AS_VAR_POPDEF([AUX])dnl AS_VAR_POPDEF([SUB])dnl AC_CONFIG_COMMANDS([buildir],[dnl .............. config.status .............. AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl AS_VAR_PUSHDEF([TOP],[top_srcdir])dnl AS_VAR_PUSHDEF([SRC],[ac_top_srcdir])dnl AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl pushdef([END],[Makefile.mk])dnl pushdef([_ALL],[ifelse([$3],,[-all],[$3])])dnl SRC="$ax_enable_builddir_srcdir" if test ".$SUB" = ".." ; then if test -f "$TOP/Makefile" ; then AC_MSG_NOTICE([skipping TOP/Makefile - left untouched]) else AC_MSG_NOTICE([skipping TOP/Makefile - not created]) fi else if test -f "$SRC/Makefile" ; then a=`grep "^VERSION " "$SRC/Makefile"` ; b=`grep "^VERSION " Makefile` test "$a" != "$b" && rm "$SRC/Makefile" fi if test -f "$SRC/Makefile" ; then echo "$SRC/Makefile : $SRC/Makefile.in" > $tmp/conftemp.mk echo " []@ echo 'REMOVED,,,' >\$[]@" >> $tmp/conftemp.mk eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null" if grep '^REMOVED,,,' "$SRC/Makefile" >/dev/null then rm $SRC/Makefile ; fi cp $tmp/conftemp.mk $SRC/makefiles.mk~ ## DEBUGGING fi if test ! -f "$SRC/Makefile" ; then AC_MSG_NOTICE([create TOP/Makefile guessed from local Makefile]) x='`' ; cat >$tmp/conftemp.sed <<_EOF /^\$/n x /^\$/bS x /\\\\\$/{H;d;} {H;s/.*//;x;} bM :S x /\\\\\$/{h;d;} {h;s/.*//;x;} :M s/\\(\\n\\) /\\1 /g /^ /d /^[[ ]]*[[\\#]]/d /^VPATH *=/d s/^srcdir *=.*/srcdir = ./ s/^top_srcdir *=.*/top_srcdir = ./ /[[:=]]/!d /^\\./d dnl Now handle rules (i.e. lines containing ":" but not " = "). / = /b / .= /b /:/!b s/:.*/:/ s/ / /g s/ \\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/ \\1 \\1[]_ALL\\2/g s/^\\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/\\1 \\1[]_ALL\\2/ s/ / /g /^all all[]_ALL[[ :]]/i\\ all-configured : all[]_ALL dnl dist-all exists... and would make for dist-all-all s/ [[a-zA-Z0-9-]]*[]_ALL [[a-zA-Z0-9-]]*[]_ALL[]_ALL//g /[]_ALL[]_ALL/d a\\ @ HOST="\$(HOST)\" \\\\\\ ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" -eq "0" ; then : \\\\\\ ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\ ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\ ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done dnl special rule add-on: "dist" copies the tarball to $(PUB). (source tree) /dist[]_ALL *:/a\\ @ HOST="\$(HOST)\" \\\\\\ ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\ ; if test "\$\$found" -eq "0" ; then : \\\\\\ ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\ ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done dnl special rule add-on: "dist-foo" copies all the archives to $(PUB). (source tree) /dist-[[a-zA-Z0-9]]*[]_ALL *:/a\\ @ HOST="\$(HOST)\" \\\\\\ ; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\ ; if test "\$\$found" -eq "0" ; then : \\\\\\ ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\ ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done dnl special rule add-on: "distclean" removes all local builddirs completely /distclean[]_ALL *:/a\\ @ HOST="\$(HOST)\" \\\\\\ ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\ ; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\ ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\ ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\ ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ ; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\ ; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\ ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile _EOF cp "$tmp/conftemp.sed" "$SRC/makefile.sed~" ## DEBUGGING $SED -f $tmp/conftemp.sed Makefile >$SRC/Makefile if test -f "$SRC/m4_ifval([$2],[$2],[END])" ; then AC_MSG_NOTICE([extend TOP/Makefile with TOP/m4_ifval([$2],[$2],[END])]) cat $SRC/END >>$SRC/Makefile fi ; xxxx="####" echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$SRC/Makefile # sanity check if grep '^; echo "MAKE ' $SRC/Makefile >/dev/null ; then AC_MSG_NOTICE([buggy sed found - it deletes tab in "a" text parts]) $SED -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $SRC/Makefile \ >$SRC/Makefile~ (test -s $SRC/Makefile~ && mv $SRC/Makefile~ $SRC/Makefile) 2>/dev/null fi else xxxx="\\#\\#\\#\\#" # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed echo "s!^$xxxx [[^|]]* | *$SUB *\$!$xxxx ...... $SUB!" >$tmp/conftemp.sed $SED -f "$tmp/conftemp.sed" "$SRC/Makefile" >$tmp/mkfile.tmp cp "$tmp/conftemp.sed" "$SRC/makefiles.sed~" ## DEBUGGING cp "$tmp/mkfile.tmp" "$SRC/makefiles.out~" ## DEBUGGING if cmp -s "$SRC/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then AC_MSG_NOTICE([keeping TOP/Makefile from earlier configure]) rm "$tmp/mkfile.tmp" else AC_MSG_NOTICE([reusing TOP/Makefile from earlier configure]) mv "$tmp/mkfile.tmp" "$SRC/Makefile" fi fi AC_MSG_NOTICE([build in $SUB (HOST=$ax_enable_builddir_host)]) xxxx="####" echo "$xxxx" "$ax_enable_builddir_host" "|$SUB" >>$SRC/Makefile fi popdef([END])dnl AS_VAR_POPDEF([SED])dnl AS_VAR_POPDEF([AUX])dnl AS_VAR_POPDEF([SRC])dnl AS_VAR_POPDEF([TOP])dnl AS_VAR_POPDEF([SUB])dnl ],[dnl ax_enable_builddir_srcdir="$srcdir" # $srcdir ax_enable_builddir_host="$HOST" # $HOST / $host ax_enable_builddir_version="$VERSION" # $VERSION ax_enable_builddir_package="$PACKAGE" # $PACKAGE ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED ax_enable_builddir="$ax_enable_builddir" # $SUB ])dnl ])
{ "pile_set_name": "Github" }
// Copyright 2011-2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef WINCESOCKET_HPP #define WINCESOCKET_HPP #include <windows.h> #include <Psapi.h> #include <winsock.h> #include "../SocketConnection.hpp" SOCKET Bind_To_Socket(unsigned int port); SOCKET Wait_For_Connection(SOCKET sock); /** * Connection policy class for WinCE sockets. */ class WinCESocket : public SocketConnection { private: /** * The server socket on which the debug client listens for a BinNavi * connection. */ SOCKET localSocket; /** * The remote socket that is used to communicate with a connected BinNavi. */ SOCKET remoteSocket; protected: NaviError bindSocket(); NaviError closeSocket(); NaviError send(const char* buffer, unsigned int size) const; NaviError read(char* buffer, unsigned int size) const; public: /** * Creates a new WinCESocket object at a given port. * * @param port The port on which the debug client listens for BinNavi * connections. */ WinCESocket(unsigned int port) : SocketConnection(port) { } /** * Converts a value from host to network byte order. * * @param val The value in host order. * * @return The same value in network order. */ int htonl(int val) const { return ::htonl(val); } /** * Converts a value from network to host byte order. * * @param val The value in network order. * * @return The same value in byte order. */ int ntohl(int val) const { return ::ntohl(val); } bool hasData() const; NaviError waitForConnection(); void printConnectionInfo(); }; #endif
{ "pile_set_name": "Github" }
# SPDX-License-Identifier: GPL-2.0-only config NET_VENDOR_ALACRITECH bool "Alacritech devices" default y ---help--- If you have a network (Ethernet) card belonging to this class, say Y. Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all the questions about Alacritech devices. If you say Y, you will be asked for your specific device in the following questions. if NET_VENDOR_ALACRITECH config SLICOSS tristate "Alacritech Slicoss support" depends on PCI select CRC32 ---help--- This driver supports Gigabit Ethernet adapters based on the Session Layer Interface (SLIC) technology by Alacritech. Supported are Mojave (1 port) and Oasis (1, 2 and 4 port) cards, both copper and fiber. To compile this driver as a module, choose M here: the module will be called slicoss. This is recommended. endif # NET_VENDOR_ALACRITECH
{ "pile_set_name": "Github" }
PatternBolt =========== Patternbolt is a fine selection of SVG pattern background, packed in a single or SCSS (or CSS ) file.<br> The pattern is added in a "after" element and your original element still be inalterate and ready for manipulations. As they are vectors they never pixelate, not even on 4k screens. The pattern selection still be under development, to see the showcase, visit the <a href="http://buseca.github.io/patternbolt/">demo page</a> ##Contributions Contributions and pull requests are always welcome.<br> If you are a **Designer** you can vote and submit new patterns joining the public <a href="https://trello.com/b/qlC1dtZa/patternbolt-new-patterns-proposals" target="_blank">Trello Board</a>. Contact me by twitter or email to request to be added as member of the board. ##SCSS version The Scss version is the main one, it's the more advanced one and its pattern library is always up-to-date.<br> To use it you can follow the instruction commented directly in the Scss file.<br> Basically you can call the whole Patternbolt Scss file in your project with an @import or just copy all its lines into your main Scss file. To insert a pattern use the related mixin, as in the examples below. ### Sass variables {String} $pattern - pattern name, it's also the name of the class {Number} $background-size [200px] - width/height of pattern {Color} $background-color [#000] - hex value of background color {Color} $foreground-color [#fff] - hex value of foreground color (the SVG) {Number} $opacity [1] - opacity, from 0 to 1 {String} $mask [none] - value 'mask' if the pattern has to be used as covering mask over an image ### Sass Mixin **basic scss mixin** @mixin pb($pattern){} **example** .item { @include pb('buseca-a'); } **the css output** .item { position: relative; z-index: 1; &::after { box-sizing: border-box; position: absolute; top: 0; left: 0; bottom: 0; right: 0; overflow: hidden; background-image: url("data:image/svg+xml,%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%09%20width%3D%2240px%22%20height%3D%2240px%22%20viewBox%3D%2255%2055%2040%2040%22%20enable-background%3D%22new%2055%2055%2040%2040%22%20xml%3Aspace%3D%22preserve%22%20fill%3D%22rgba(255,255,255,1)%22%3E%0A%3Cpath%20d%3D%22M55%2C55h40v40H55V55z%20M95%2C86.987v-3.99l-1.997%2C1.997L95%2C86.987z%20M63%2C63l6.003-6.006L67.006%2C55h-3.994%0A%09l1.991%2C1.994L63%2C59l-4-4h-3.997L63%2C63z%20M87.013%2C55L95%2C62.987V59l-4-4H87.013z%20M75%2C55L55%2C75v3.997L78.997%2C55H75z%20M57.003%2C64.994%0A%09L55%2C66.997V71l6.003-6.006L55%2C58.997v3.997L57.003%2C64.994z%20M78.997%2C95l2.006-2.006L75%2C87l-4%2C4l-2-2.003l0.003-0.003l4-4l-4-3.994%0A%09L71%2C79l16.006%2C16H91L71%2C75l-5.997%2C6l4%2C3.994l-2%2C2L65%2C84.997l0.003-0.003L63%2C83l-2%2C1.987l0.003%2C0.007l-2%2C2.003l-2-1.997l-1.753%2C1.75%0A%09L83.003%2C59l2%2C2.003l-4%2C3.997l3.991%2C4.003L83%2C71l-4-4l-1.997%2C1.994l-4%2C4L95%2C94.987v-3.99L77.003%2C72.994l2-1.997L83%2C75l3.994-3.994%0A%09L87%2C71.016l0.013-0.009l1.99%2C1.987L86.997%2C75l-1.994%2C1.994L87%2C79l0.003-0.003L91%2C83l4-4v-4l-4%2C4l-2.003-2l4.006-4.006l-3.99-3.987%0A%09L91%2C67.031l4%2C4.031v-4.056l-4-3.975L87%2C67l-1.997-2.006l4-4L83%2C55L55%2C82.997V87l1.997%2C2L59%2C91l4.003-4.003l1.997%2C2l-3.997%2C3.997%0A%09L63%2C95l0.003-0.003L63.006%2C95H67l-2.003-1.997l2-2.003L71%2C95l4-4l2.003%2C1.994L75%2C95H78.997z%20M55%2C91v4h4.006L55%2C91z%22/%3E%0A%3C/svg%3E"); background-size: 200px; background-color: rgba(0,0,0,1); content: ''; z-index: -1; transition: background-image 0.1s ease-in-out; } } **advanced scss mixin** @mixin pb($pattern, $background-size, $background-color, $foreground-color, $opacity, $mask){} **example** .item { @include pb('buseca-a', 25px, #f00, #0f0, 0.5, 'mask'); } **the css output** .item { position: relative; z-index: 1; &::after { box-sizing: border-box; position: absolute; top: 0; left: 0; bottom: 0; right: 0; overflow: hidden; background-image: url("data:image/svg+xml,%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%09%20width%3D%2240px%22%20height%3D%2240px%22%20viewBox%3D%2255%2055%2040%2040%22%20enable-background%3D%22new%2055%2055%2040%2040%22%20xml%3Aspace%3D%22preserve%22%20fill%3D%22rgba(0,255,0,0.5)%22%3E%0A%3Cpath%20d%3D%22M55%2C55h40v40H55V55z%20M95%2C86.987v-3.99l-1.997%2C1.997L95%2C86.987z%20M63%2C63l6.003-6.006L67.006%2C55h-3.994%0A%09l1.991%2C1.994L63%2C59l-4-4h-3.997L63%2C63z%20M87.013%2C55L95%2C62.987V59l-4-4H87.013z%20M75%2C55L55%2C75v3.997L78.997%2C55H75z%20M57.003%2C64.994%0A%09L55%2C66.997V71l6.003-6.006L55%2C58.997v3.997L57.003%2C64.994z%20M78.997%2C95l2.006-2.006L75%2C87l-4%2C4l-2-2.003l0.003-0.003l4-4l-4-3.994%0A%09L71%2C79l16.006%2C16H91L71%2C75l-5.997%2C6l4%2C3.994l-2%2C2L65%2C84.997l0.003-0.003L63%2C83l-2%2C1.987l0.003%2C0.007l-2%2C2.003l-2-1.997l-1.753%2C1.75%0A%09L83.003%2C59l2%2C2.003l-4%2C3.997l3.991%2C4.003L83%2C71l-4-4l-1.997%2C1.994l-4%2C4L95%2C94.987v-3.99L77.003%2C72.994l2-1.997L83%2C75l3.994-3.994%0A%09L87%2C71.016l0.013-0.009l1.99%2C1.987L86.997%2C75l-1.994%2C1.994L87%2C79l0.003-0.003L91%2C83l4-4v-4l-4%2C4l-2.003-2l4.006-4.006l-3.99-3.987%0A%09L91%2C67.031l4%2C4.031v-4.056l-4-3.975L87%2C67l-1.997-2.006l4-4L83%2C55L55%2C82.997V87l1.997%2C2L59%2C91l4.003-4.003l1.997%2C2l-3.997%2C3.997%0A%09L63%2C95l0.003-0.003L63.006%2C95H67l-2.003-1.997l2-2.003L71%2C95l4-4l2.003%2C1.994L75%2C95H78.997z%20M55%2C91v4h4.006L55%2C91z%22/%3E%0A%3C/svg%3E"); background-size: 25px; background-color: rgba(255,0,0,0.5); content: ''; opacity: 0.2; z-index: 0; transition: background-image 0.1s ease-in-out; } } ##CSS version Just include it in your project whith this: <link rel="stylesheet" href="css/patternbolt.css" /> and add the right pattern class to your elements in the DOM. You can also change pattern color and the pattern size changing the background css property, check the <a href="http://buseca.github.io/patternbolt/">demo page</a> to see how to do it.<br> Here come the list of CSS pattern classes in the library: .buseca-a .feather .lines-a .lines-b .lines-c .lines-45-a .lines-45-b .lines-45-c .cross-a .cross-b .cross-c .cross-thin-a .cross-thin-b .cross-thin-c .candy-a .candy-b ##More info You can check the demo page at http://buseca.github.io/patternbolt/<br> You can find me on twitter: **<a href="https://twitter.com/ruggeromotta">@ruggeromotta</a>**
{ "pile_set_name": "Github" }
<div style="margin: 15px;"> <form class="layui-form"> <div class="layui-form-item"> <label class="layui-form-label">商户ID</label> <div class="layui-input-block"> <input type="text" disabled="disabled" class="layui-input" value="${item.mchId?if_exists }"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">渠道ID</label> <div class="layui-input-block"> <input type="text" disabled="disabled" class="layui-input" value="${item.channelId?if_exists }"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">渠道名称</label> <div class="layui-input-block"> <input type="text" disabled="disabled" class="layui-input" value="${item.channelName?if_exists }"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">渠道商户ID</label> <div class="layui-input-block"> <input type="text" disabled="disabled" class="layui-input" value="${item.channelMchId?if_exists }"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">状态</label> <div class="layui-input-block"> <#if item.state = 1> <input type="text" style="color: green" disabled="disabled" class="layui-input" value="启用" }"> <#else> <input type="text" style="color: red" disabled="disabled" class="layui-input" value="停止" }"> </#if> </div> </div> <div class="layui-form-item layui-form-text"> <label class="layui-form-label">参数</label> <div class="layui-input-block"> <textarea disabled="disabled" class="layui-textarea">${item.param?if_exists }</textarea> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">备注</label> <div class="layui-input-block"> <input type="text" disabled="disabled" class="layui-input" value="${item.remark?if_exists }"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">创建时间</label> <div class="layui-input-block"> <input type="text" disabled="disabled" class="layui-input" value="${(item.createTime?string("yyyy-MM-dd HH:mm:ss"))!''} "> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">更新时间</label> <div class="layui-input-block"> <input type="text" disabled="disabled" class="layui-input" value="${(item.updateTime?string("yyyy-MM-dd HH:mm:ss"))!''} "> </div> </div> <button lay-filter="edit" lay-submit style="display: none;"></button> </form> </div>
{ "pile_set_name": "Github" }
/* * driver/usb/gadget/fsl_qe_udc.c * * Copyright (c) 2006-2008 Freescale Semiconductor, Inc. All rights reserved. * * Xie Xiaobo <X.Xie@freescale.com> * Li Yang <leoli@freescale.com> * Based on bareboard code from Shlomi Gridish. * * Description: * Freescle QE/CPM USB Pheripheral Controller Driver * The controller can be found on MPC8360, MPC8272, and etc. * MPC8360 Rev 1.1 may need QE mircocode update * * 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. */ #undef USB_TRACE #include <linux/module.h> #include <linux/kernel.h> #include <linux/ioport.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/err.h> #include <linux/slab.h> #include <linux/list.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/moduleparam.h> #include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/dma-mapping.h> #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> #include <linux/usb/otg.h> #include <asm/qe.h> #include <asm/cpm.h> #include <asm/dma.h> #include <asm/reg.h> #include "fsl_qe_udc.h" #define DRIVER_DESC "Freescale QE/CPM USB Device Controller driver" #define DRIVER_AUTHOR "Xie XiaoBo" #define DRIVER_VERSION "1.0" #define DMA_ADDR_INVALID (~(dma_addr_t)0) static const char driver_name[] = "fsl_qe_udc"; static const char driver_desc[] = DRIVER_DESC; /*ep name is important in gadget, it should obey the convention of ep_match()*/ static const char *const ep_name[] = { "ep0-control", /* everyone has ep0 */ /* 3 configurable endpoints */ "ep1", "ep2", "ep3", }; static struct usb_endpoint_descriptor qe_ep0_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, .bEndpointAddress = 0, .bmAttributes = USB_ENDPOINT_XFER_CONTROL, .wMaxPacketSize = USB_MAX_CTRL_PAYLOAD, }; /******************************************************************** * Internal Used Function Start ********************************************************************/ /*----------------------------------------------------------------- * done() - retire a request; caller blocked irqs *--------------------------------------------------------------*/ static void done(struct qe_ep *ep, struct qe_req *req, int status) { struct qe_udc *udc = ep->udc; unsigned char stopped = ep->stopped; /* the req->queue pointer is used by ep_queue() func, in which * the request will be added into a udc_ep->queue 'd tail * so here the req will be dropped from the ep->queue */ list_del_init(&req->queue); /* req.status should be set as -EINPROGRESS in ep_queue() */ if (req->req.status == -EINPROGRESS) req->req.status = status; else status = req->req.status; if (req->mapped) { dma_unmap_single(udc->gadget.dev.parent, req->req.dma, req->req.length, ep_is_in(ep) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); req->req.dma = DMA_ADDR_INVALID; req->mapped = 0; } else dma_sync_single_for_cpu(udc->gadget.dev.parent, req->req.dma, req->req.length, ep_is_in(ep) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); if (status && (status != -ESHUTDOWN)) dev_vdbg(udc->dev, "complete %s req %p stat %d len %u/%u\n", ep->ep.name, &req->req, status, req->req.actual, req->req.length); /* don't modify queue heads during completion callback */ ep->stopped = 1; spin_unlock(&udc->lock); usb_gadget_giveback_request(&ep->ep, &req->req); spin_lock(&udc->lock); ep->stopped = stopped; } /*----------------------------------------------------------------- * nuke(): delete all requests related to this ep *--------------------------------------------------------------*/ static void nuke(struct qe_ep *ep, int status) { /* Whether this eq has request linked */ while (!list_empty(&ep->queue)) { struct qe_req *req = NULL; req = list_entry(ep->queue.next, struct qe_req, queue); done(ep, req, status); } } /*---------------------------------------------------------------------------* * USB and Endpoint manipulate process, include parameter and register * *---------------------------------------------------------------------------*/ /* @value: 1--set stall 0--clean stall */ static int qe_eprx_stall_change(struct qe_ep *ep, int value) { u16 tem_usep; u8 epnum = ep->epnum; struct qe_udc *udc = ep->udc; tem_usep = in_be16(&udc->usb_regs->usb_usep[epnum]); tem_usep = tem_usep & ~USB_RHS_MASK; if (value == 1) tem_usep |= USB_RHS_STALL; else if (ep->dir == USB_DIR_IN) tem_usep |= USB_RHS_IGNORE_OUT; out_be16(&udc->usb_regs->usb_usep[epnum], tem_usep); return 0; } static int qe_eptx_stall_change(struct qe_ep *ep, int value) { u16 tem_usep; u8 epnum = ep->epnum; struct qe_udc *udc = ep->udc; tem_usep = in_be16(&udc->usb_regs->usb_usep[epnum]); tem_usep = tem_usep & ~USB_THS_MASK; if (value == 1) tem_usep |= USB_THS_STALL; else if (ep->dir == USB_DIR_OUT) tem_usep |= USB_THS_IGNORE_IN; out_be16(&udc->usb_regs->usb_usep[epnum], tem_usep); return 0; } static int qe_ep0_stall(struct qe_udc *udc) { qe_eptx_stall_change(&udc->eps[0], 1); qe_eprx_stall_change(&udc->eps[0], 1); udc->ep0_state = WAIT_FOR_SETUP; udc->ep0_dir = 0; return 0; } static int qe_eprx_nack(struct qe_ep *ep) { u8 epnum = ep->epnum; struct qe_udc *udc = ep->udc; if (ep->state == EP_STATE_IDLE) { /* Set the ep's nack */ clrsetbits_be16(&udc->usb_regs->usb_usep[epnum], USB_RHS_MASK, USB_RHS_NACK); /* Mask Rx and Busy interrupts */ clrbits16(&udc->usb_regs->usb_usbmr, (USB_E_RXB_MASK | USB_E_BSY_MASK)); ep->state = EP_STATE_NACK; } return 0; } static int qe_eprx_normal(struct qe_ep *ep) { struct qe_udc *udc = ep->udc; if (ep->state == EP_STATE_NACK) { clrsetbits_be16(&udc->usb_regs->usb_usep[ep->epnum], USB_RTHS_MASK, USB_THS_IGNORE_IN); /* Unmask RX interrupts */ out_be16(&udc->usb_regs->usb_usber, USB_E_BSY_MASK | USB_E_RXB_MASK); setbits16(&udc->usb_regs->usb_usbmr, (USB_E_RXB_MASK | USB_E_BSY_MASK)); ep->state = EP_STATE_IDLE; ep->has_data = 0; } return 0; } static int qe_ep_cmd_stoptx(struct qe_ep *ep) { if (ep->udc->soc_type == PORT_CPM) cpm_command(CPM_USB_STOP_TX | (ep->epnum << CPM_USB_EP_SHIFT), CPM_USB_STOP_TX_OPCODE); else qe_issue_cmd(QE_USB_STOP_TX, QE_CR_SUBBLOCK_USB, ep->epnum, 0); return 0; } static int qe_ep_cmd_restarttx(struct qe_ep *ep) { if (ep->udc->soc_type == PORT_CPM) cpm_command(CPM_USB_RESTART_TX | (ep->epnum << CPM_USB_EP_SHIFT), CPM_USB_RESTART_TX_OPCODE); else qe_issue_cmd(QE_USB_RESTART_TX, QE_CR_SUBBLOCK_USB, ep->epnum, 0); return 0; } static int qe_ep_flushtxfifo(struct qe_ep *ep) { struct qe_udc *udc = ep->udc; int i; i = (int)ep->epnum; qe_ep_cmd_stoptx(ep); out_8(&udc->usb_regs->usb_uscom, USB_CMD_FLUSH_FIFO | (USB_CMD_EP_MASK & (ep->epnum))); out_be16(&udc->ep_param[i]->tbptr, in_be16(&udc->ep_param[i]->tbase)); out_be32(&udc->ep_param[i]->tstate, 0); out_be16(&udc->ep_param[i]->tbcnt, 0); ep->c_txbd = ep->txbase; ep->n_txbd = ep->txbase; qe_ep_cmd_restarttx(ep); return 0; } static int qe_ep_filltxfifo(struct qe_ep *ep) { struct qe_udc *udc = ep->udc; out_8(&udc->usb_regs->usb_uscom, USB_CMD_STR_FIFO | (USB_CMD_EP_MASK & (ep->epnum))); return 0; } static int qe_epbds_reset(struct qe_udc *udc, int pipe_num) { struct qe_ep *ep; u32 bdring_len; struct qe_bd __iomem *bd; int i; ep = &udc->eps[pipe_num]; if (ep->dir == USB_DIR_OUT) bdring_len = USB_BDRING_LEN_RX; else bdring_len = USB_BDRING_LEN; bd = ep->rxbase; for (i = 0; i < (bdring_len - 1); i++) { out_be32((u32 __iomem *)bd, R_E | R_I); bd++; } out_be32((u32 __iomem *)bd, R_E | R_I | R_W); bd = ep->txbase; for (i = 0; i < USB_BDRING_LEN_TX - 1; i++) { out_be32(&bd->buf, 0); out_be32((u32 __iomem *)bd, 0); bd++; } out_be32((u32 __iomem *)bd, T_W); return 0; } static int qe_ep_reset(struct qe_udc *udc, int pipe_num) { struct qe_ep *ep; u16 tmpusep; ep = &udc->eps[pipe_num]; tmpusep = in_be16(&udc->usb_regs->usb_usep[pipe_num]); tmpusep &= ~USB_RTHS_MASK; switch (ep->dir) { case USB_DIR_BOTH: qe_ep_flushtxfifo(ep); break; case USB_DIR_OUT: tmpusep |= USB_THS_IGNORE_IN; break; case USB_DIR_IN: qe_ep_flushtxfifo(ep); tmpusep |= USB_RHS_IGNORE_OUT; break; default: break; } out_be16(&udc->usb_regs->usb_usep[pipe_num], tmpusep); qe_epbds_reset(udc, pipe_num); return 0; } static int qe_ep_toggledata01(struct qe_ep *ep) { ep->data01 ^= 0x1; return 0; } static int qe_ep_bd_init(struct qe_udc *udc, unsigned char pipe_num) { struct qe_ep *ep = &udc->eps[pipe_num]; unsigned long tmp_addr = 0; struct usb_ep_para __iomem *epparam; int i; struct qe_bd __iomem *bd; int bdring_len; if (ep->dir == USB_DIR_OUT) bdring_len = USB_BDRING_LEN_RX; else bdring_len = USB_BDRING_LEN; epparam = udc->ep_param[pipe_num]; /* alloc multi-ram for BD rings and set the ep parameters */ tmp_addr = cpm_muram_alloc(sizeof(struct qe_bd) * (bdring_len + USB_BDRING_LEN_TX), QE_ALIGNMENT_OF_BD); if (IS_ERR_VALUE(tmp_addr)) return -ENOMEM; out_be16(&epparam->rbase, (u16)tmp_addr); out_be16(&epparam->tbase, (u16)(tmp_addr + (sizeof(struct qe_bd) * bdring_len))); out_be16(&epparam->rbptr, in_be16(&epparam->rbase)); out_be16(&epparam->tbptr, in_be16(&epparam->tbase)); ep->rxbase = cpm_muram_addr(tmp_addr); ep->txbase = cpm_muram_addr(tmp_addr + (sizeof(struct qe_bd) * bdring_len)); ep->n_rxbd = ep->rxbase; ep->e_rxbd = ep->rxbase; ep->n_txbd = ep->txbase; ep->c_txbd = ep->txbase; ep->data01 = 0; /* data0 */ /* Init TX and RX bds */ bd = ep->rxbase; for (i = 0; i < bdring_len - 1; i++) { out_be32(&bd->buf, 0); out_be32((u32 __iomem *)bd, 0); bd++; } out_be32(&bd->buf, 0); out_be32((u32 __iomem *)bd, R_W); bd = ep->txbase; for (i = 0; i < USB_BDRING_LEN_TX - 1; i++) { out_be32(&bd->buf, 0); out_be32((u32 __iomem *)bd, 0); bd++; } out_be32(&bd->buf, 0); out_be32((u32 __iomem *)bd, T_W); return 0; } static int qe_ep_rxbd_update(struct qe_ep *ep) { unsigned int size; int i; unsigned int tmp; struct qe_bd __iomem *bd; unsigned int bdring_len; if (ep->rxbase == NULL) return -EINVAL; bd = ep->rxbase; ep->rxframe = kmalloc(sizeof(*ep->rxframe), GFP_ATOMIC); if (ep->rxframe == NULL) { dev_err(ep->udc->dev, "malloc rxframe failed\n"); return -ENOMEM; } qe_frame_init(ep->rxframe); if (ep->dir == USB_DIR_OUT) bdring_len = USB_BDRING_LEN_RX; else bdring_len = USB_BDRING_LEN; size = (ep->ep.maxpacket + USB_CRC_SIZE + 2) * (bdring_len + 1); ep->rxbuffer = kzalloc(size, GFP_ATOMIC); if (ep->rxbuffer == NULL) { dev_err(ep->udc->dev, "malloc rxbuffer failed,size=%d\n", size); kfree(ep->rxframe); return -ENOMEM; } ep->rxbuf_d = virt_to_phys((void *)ep->rxbuffer); if (ep->rxbuf_d == DMA_ADDR_INVALID) { ep->rxbuf_d = dma_map_single(ep->udc->gadget.dev.parent, ep->rxbuffer, size, DMA_FROM_DEVICE); ep->rxbufmap = 1; } else { dma_sync_single_for_device(ep->udc->gadget.dev.parent, ep->rxbuf_d, size, DMA_FROM_DEVICE); ep->rxbufmap = 0; } size = ep->ep.maxpacket + USB_CRC_SIZE + 2; tmp = ep->rxbuf_d; tmp = (u32)(((tmp >> 2) << 2) + 4); for (i = 0; i < bdring_len - 1; i++) { out_be32(&bd->buf, tmp); out_be32((u32 __iomem *)bd, (R_E | R_I)); tmp = tmp + size; bd++; } out_be32(&bd->buf, tmp); out_be32((u32 __iomem *)bd, (R_E | R_I | R_W)); return 0; } static int qe_ep_register_init(struct qe_udc *udc, unsigned char pipe_num) { struct qe_ep *ep = &udc->eps[pipe_num]; struct usb_ep_para __iomem *epparam; u16 usep, logepnum; u16 tmp; u8 rtfcr = 0; epparam = udc->ep_param[pipe_num]; usep = 0; logepnum = (ep->ep.desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); usep |= (logepnum << USB_EPNUM_SHIFT); switch (ep->ep.desc->bmAttributes & 0x03) { case USB_ENDPOINT_XFER_BULK: usep |= USB_TRANS_BULK; break; case USB_ENDPOINT_XFER_ISOC: usep |= USB_TRANS_ISO; break; case USB_ENDPOINT_XFER_INT: usep |= USB_TRANS_INT; break; default: usep |= USB_TRANS_CTR; break; } switch (ep->dir) { case USB_DIR_OUT: usep |= USB_THS_IGNORE_IN; break; case USB_DIR_IN: usep |= USB_RHS_IGNORE_OUT; break; default: break; } out_be16(&udc->usb_regs->usb_usep[pipe_num], usep); rtfcr = 0x30; out_8(&epparam->rbmr, rtfcr); out_8(&epparam->tbmr, rtfcr); tmp = (u16)(ep->ep.maxpacket + USB_CRC_SIZE); /* MRBLR must be divisble by 4 */ tmp = (u16)(((tmp >> 2) << 2) + 4); out_be16(&epparam->mrblr, tmp); return 0; } static int qe_ep_init(struct qe_udc *udc, unsigned char pipe_num, const struct usb_endpoint_descriptor *desc) { struct qe_ep *ep = &udc->eps[pipe_num]; unsigned long flags; int reval = 0; u16 max = 0; max = usb_endpoint_maxp(desc); /* check the max package size validate for this endpoint */ /* Refer to USB2.0 spec table 9-13, */ if (pipe_num != 0) { switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { case USB_ENDPOINT_XFER_BULK: if (strstr(ep->ep.name, "-iso") || strstr(ep->ep.name, "-int")) goto en_done; switch (udc->gadget.speed) { case USB_SPEED_HIGH: if ((max == 128) || (max == 256) || (max == 512)) break; default: switch (max) { case 4: case 8: case 16: case 32: case 64: break; default: case USB_SPEED_LOW: goto en_done; } } break; case USB_ENDPOINT_XFER_INT: if (strstr(ep->ep.name, "-iso")) /* bulk is ok */ goto en_done; switch (udc->gadget.speed) { case USB_SPEED_HIGH: if (max <= 1024) break; case USB_SPEED_FULL: if (max <= 64) break; default: if (max <= 8) break; goto en_done; } break; case USB_ENDPOINT_XFER_ISOC: if (strstr(ep->ep.name, "-bulk") || strstr(ep->ep.name, "-int")) goto en_done; switch (udc->gadget.speed) { case USB_SPEED_HIGH: if (max <= 1024) break; case USB_SPEED_FULL: if (max <= 1023) break; default: goto en_done; } break; case USB_ENDPOINT_XFER_CONTROL: if (strstr(ep->ep.name, "-iso") || strstr(ep->ep.name, "-int")) goto en_done; switch (udc->gadget.speed) { case USB_SPEED_HIGH: case USB_SPEED_FULL: switch (max) { case 1: case 2: case 4: case 8: case 16: case 32: case 64: break; default: goto en_done; } case USB_SPEED_LOW: switch (max) { case 1: case 2: case 4: case 8: break; default: goto en_done; } default: goto en_done; } break; default: goto en_done; } } /* if ep0*/ spin_lock_irqsave(&udc->lock, flags); /* initialize ep structure */ ep->ep.maxpacket = max; ep->tm = (u8)(desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK); ep->ep.desc = desc; ep->stopped = 0; ep->init = 1; if (pipe_num == 0) { ep->dir = USB_DIR_BOTH; udc->ep0_dir = USB_DIR_OUT; udc->ep0_state = WAIT_FOR_SETUP; } else { switch (desc->bEndpointAddress & USB_ENDPOINT_DIR_MASK) { case USB_DIR_OUT: ep->dir = USB_DIR_OUT; break; case USB_DIR_IN: ep->dir = USB_DIR_IN; default: break; } } /* hardware special operation */ qe_ep_bd_init(udc, pipe_num); if ((ep->tm == USBP_TM_CTL) || (ep->dir == USB_DIR_OUT)) { reval = qe_ep_rxbd_update(ep); if (reval) goto en_done1; } if ((ep->tm == USBP_TM_CTL) || (ep->dir == USB_DIR_IN)) { ep->txframe = kmalloc(sizeof(*ep->txframe), GFP_ATOMIC); if (ep->txframe == NULL) { dev_err(udc->dev, "malloc txframe failed\n"); goto en_done2; } qe_frame_init(ep->txframe); } qe_ep_register_init(udc, pipe_num); /* Now HW will be NAKing transfers to that EP, * until a buffer is queued to it. */ spin_unlock_irqrestore(&udc->lock, flags); return 0; en_done2: kfree(ep->rxbuffer); kfree(ep->rxframe); en_done1: spin_unlock_irqrestore(&udc->lock, flags); en_done: dev_err(udc->dev, "failed to initialize %s\n", ep->ep.name); return -ENODEV; } static inline void qe_usb_enable(struct qe_udc *udc) { setbits8(&udc->usb_regs->usb_usmod, USB_MODE_EN); } static inline void qe_usb_disable(struct qe_udc *udc) { clrbits8(&udc->usb_regs->usb_usmod, USB_MODE_EN); } /*----------------------------------------------------------------------------* * USB and EP basic manipulate function end * *----------------------------------------------------------------------------*/ /****************************************************************************** UDC transmit and receive process ******************************************************************************/ static void recycle_one_rxbd(struct qe_ep *ep) { u32 bdstatus; bdstatus = in_be32((u32 __iomem *)ep->e_rxbd); bdstatus = R_I | R_E | (bdstatus & R_W); out_be32((u32 __iomem *)ep->e_rxbd, bdstatus); if (bdstatus & R_W) ep->e_rxbd = ep->rxbase; else ep->e_rxbd++; } static void recycle_rxbds(struct qe_ep *ep, unsigned char stopatnext) { u32 bdstatus; struct qe_bd __iomem *bd, *nextbd; unsigned char stop = 0; nextbd = ep->n_rxbd; bd = ep->e_rxbd; bdstatus = in_be32((u32 __iomem *)bd); while (!(bdstatus & R_E) && !(bdstatus & BD_LENGTH_MASK) && !stop) { bdstatus = R_E | R_I | (bdstatus & R_W); out_be32((u32 __iomem *)bd, bdstatus); if (bdstatus & R_W) bd = ep->rxbase; else bd++; bdstatus = in_be32((u32 __iomem *)bd); if (stopatnext && (bd == nextbd)) stop = 1; } ep->e_rxbd = bd; } static void ep_recycle_rxbds(struct qe_ep *ep) { struct qe_bd __iomem *bd = ep->n_rxbd; u32 bdstatus; u8 epnum = ep->epnum; struct qe_udc *udc = ep->udc; bdstatus = in_be32((u32 __iomem *)bd); if (!(bdstatus & R_E) && !(bdstatus & BD_LENGTH_MASK)) { bd = ep->rxbase + ((in_be16(&udc->ep_param[epnum]->rbptr) - in_be16(&udc->ep_param[epnum]->rbase)) >> 3); bdstatus = in_be32((u32 __iomem *)bd); if (bdstatus & R_W) bd = ep->rxbase; else bd++; ep->e_rxbd = bd; recycle_rxbds(ep, 0); ep->e_rxbd = ep->n_rxbd; } else recycle_rxbds(ep, 1); if (in_be16(&udc->usb_regs->usb_usber) & USB_E_BSY_MASK) out_be16(&udc->usb_regs->usb_usber, USB_E_BSY_MASK); if (ep->has_data <= 0 && (!list_empty(&ep->queue))) qe_eprx_normal(ep); ep->localnack = 0; } static void setup_received_handle(struct qe_udc *udc, struct usb_ctrlrequest *setup); static int qe_ep_rxframe_handle(struct qe_ep *ep); static void ep0_req_complete(struct qe_udc *udc, struct qe_req *req); /* when BD PID is setup, handle the packet */ static int ep0_setup_handle(struct qe_udc *udc) { struct qe_ep *ep = &udc->eps[0]; struct qe_frame *pframe; unsigned int fsize; u8 *cp; pframe = ep->rxframe; if ((frame_get_info(pframe) & PID_SETUP) && (udc->ep0_state == WAIT_FOR_SETUP)) { fsize = frame_get_length(pframe); if (unlikely(fsize != 8)) return -EINVAL; cp = (u8 *)&udc->local_setup_buff; memcpy(cp, pframe->data, fsize); ep->data01 = 1; /* handle the usb command base on the usb_ctrlrequest */ setup_received_handle(udc, &udc->local_setup_buff); return 0; } return -EINVAL; } static int qe_ep0_rx(struct qe_udc *udc) { struct qe_ep *ep = &udc->eps[0]; struct qe_frame *pframe; struct qe_bd __iomem *bd; u32 bdstatus, length; u32 vaddr; pframe = ep->rxframe; if (ep->dir == USB_DIR_IN) { dev_err(udc->dev, "ep0 not a control endpoint\n"); return -EINVAL; } bd = ep->n_rxbd; bdstatus = in_be32((u32 __iomem *)bd); length = bdstatus & BD_LENGTH_MASK; while (!(bdstatus & R_E) && length) { if ((bdstatus & R_F) && (bdstatus & R_L) && !(bdstatus & R_ERROR)) { if (length == USB_CRC_SIZE) { udc->ep0_state = WAIT_FOR_SETUP; dev_vdbg(udc->dev, "receive a ZLP in status phase\n"); } else { qe_frame_clean(pframe); vaddr = (u32)phys_to_virt(in_be32(&bd->buf)); frame_set_data(pframe, (u8 *)vaddr); frame_set_length(pframe, (length - USB_CRC_SIZE)); frame_set_status(pframe, FRAME_OK); switch (bdstatus & R_PID) { case R_PID_SETUP: frame_set_info(pframe, PID_SETUP); break; case R_PID_DATA1: frame_set_info(pframe, PID_DATA1); break; default: frame_set_info(pframe, PID_DATA0); break; } if ((bdstatus & R_PID) == R_PID_SETUP) ep0_setup_handle(udc); else qe_ep_rxframe_handle(ep); } } else { dev_err(udc->dev, "The receive frame with error!\n"); } /* note: don't clear the rxbd's buffer address */ recycle_one_rxbd(ep); /* Get next BD */ if (bdstatus & R_W) bd = ep->rxbase; else bd++; bdstatus = in_be32((u32 __iomem *)bd); length = bdstatus & BD_LENGTH_MASK; } ep->n_rxbd = bd; return 0; } static int qe_ep_rxframe_handle(struct qe_ep *ep) { struct qe_frame *pframe; u8 framepid = 0; unsigned int fsize; u8 *cp; struct qe_req *req; pframe = ep->rxframe; if (frame_get_info(pframe) & PID_DATA1) framepid = 0x1; if (framepid != ep->data01) { dev_err(ep->udc->dev, "the data01 error!\n"); return -EIO; } fsize = frame_get_length(pframe); if (list_empty(&ep->queue)) { dev_err(ep->udc->dev, "the %s have no requeue!\n", ep->name); } else { req = list_entry(ep->queue.next, struct qe_req, queue); cp = (u8 *)(req->req.buf) + req->req.actual; if (cp) { memcpy(cp, pframe->data, fsize); req->req.actual += fsize; if ((fsize < ep->ep.maxpacket) || (req->req.actual >= req->req.length)) { if (ep->epnum == 0) ep0_req_complete(ep->udc, req); else done(ep, req, 0); if (list_empty(&ep->queue) && ep->epnum != 0) qe_eprx_nack(ep); } } } qe_ep_toggledata01(ep); return 0; } static void ep_rx_tasklet(unsigned long data) { struct qe_udc *udc = (struct qe_udc *)data; struct qe_ep *ep; struct qe_frame *pframe; struct qe_bd __iomem *bd; unsigned long flags; u32 bdstatus, length; u32 vaddr, i; spin_lock_irqsave(&udc->lock, flags); for (i = 1; i < USB_MAX_ENDPOINTS; i++) { ep = &udc->eps[i]; if (ep->dir == USB_DIR_IN || ep->enable_tasklet == 0) { dev_dbg(udc->dev, "This is a transmit ep or disable tasklet!\n"); continue; } pframe = ep->rxframe; bd = ep->n_rxbd; bdstatus = in_be32((u32 __iomem *)bd); length = bdstatus & BD_LENGTH_MASK; while (!(bdstatus & R_E) && length) { if (list_empty(&ep->queue)) { qe_eprx_nack(ep); dev_dbg(udc->dev, "The rxep have noreq %d\n", ep->has_data); break; } if ((bdstatus & R_F) && (bdstatus & R_L) && !(bdstatus & R_ERROR)) { qe_frame_clean(pframe); vaddr = (u32)phys_to_virt(in_be32(&bd->buf)); frame_set_data(pframe, (u8 *)vaddr); frame_set_length(pframe, (length - USB_CRC_SIZE)); frame_set_status(pframe, FRAME_OK); switch (bdstatus & R_PID) { case R_PID_DATA1: frame_set_info(pframe, PID_DATA1); break; case R_PID_SETUP: frame_set_info(pframe, PID_SETUP); break; default: frame_set_info(pframe, PID_DATA0); break; } /* handle the rx frame */ qe_ep_rxframe_handle(ep); } else { dev_err(udc->dev, "error in received frame\n"); } /* note: don't clear the rxbd's buffer address */ /*clear the length */ out_be32((u32 __iomem *)bd, bdstatus & BD_STATUS_MASK); ep->has_data--; if (!(ep->localnack)) recycle_one_rxbd(ep); /* Get next BD */ if (bdstatus & R_W) bd = ep->rxbase; else bd++; bdstatus = in_be32((u32 __iomem *)bd); length = bdstatus & BD_LENGTH_MASK; } ep->n_rxbd = bd; if (ep->localnack) ep_recycle_rxbds(ep); ep->enable_tasklet = 0; } /* for i=1 */ spin_unlock_irqrestore(&udc->lock, flags); } static int qe_ep_rx(struct qe_ep *ep) { struct qe_udc *udc; struct qe_frame *pframe; struct qe_bd __iomem *bd; u16 swoffs, ucoffs, emptybds; udc = ep->udc; pframe = ep->rxframe; if (ep->dir == USB_DIR_IN) { dev_err(udc->dev, "transmit ep in rx function\n"); return -EINVAL; } bd = ep->n_rxbd; swoffs = (u16)(bd - ep->rxbase); ucoffs = (u16)((in_be16(&udc->ep_param[ep->epnum]->rbptr) - in_be16(&udc->ep_param[ep->epnum]->rbase)) >> 3); if (swoffs < ucoffs) emptybds = USB_BDRING_LEN_RX - ucoffs + swoffs; else emptybds = swoffs - ucoffs; if (emptybds < MIN_EMPTY_BDS) { qe_eprx_nack(ep); ep->localnack = 1; dev_vdbg(udc->dev, "%d empty bds, send NACK\n", emptybds); } ep->has_data = USB_BDRING_LEN_RX - emptybds; if (list_empty(&ep->queue)) { qe_eprx_nack(ep); dev_vdbg(udc->dev, "The rxep have no req queued with %d BDs\n", ep->has_data); return 0; } tasklet_schedule(&udc->rx_tasklet); ep->enable_tasklet = 1; return 0; } /* send data from a frame, no matter what tx_req */ static int qe_ep_tx(struct qe_ep *ep, struct qe_frame *frame) { struct qe_udc *udc = ep->udc; struct qe_bd __iomem *bd; u16 saveusbmr; u32 bdstatus, pidmask; u32 paddr; if (ep->dir == USB_DIR_OUT) { dev_err(udc->dev, "receive ep passed to tx function\n"); return -EINVAL; } /* Disable the Tx interrupt */ saveusbmr = in_be16(&udc->usb_regs->usb_usbmr); out_be16(&udc->usb_regs->usb_usbmr, saveusbmr & ~(USB_E_TXB_MASK | USB_E_TXE_MASK)); bd = ep->n_txbd; bdstatus = in_be32((u32 __iomem *)bd); if (!(bdstatus & (T_R | BD_LENGTH_MASK))) { if (frame_get_length(frame) == 0) { frame_set_data(frame, udc->nullbuf); frame_set_length(frame, 2); frame->info |= (ZLP | NO_CRC); dev_vdbg(udc->dev, "the frame size = 0\n"); } paddr = virt_to_phys((void *)frame->data); out_be32(&bd->buf, paddr); bdstatus = (bdstatus&T_W); if (!(frame_get_info(frame) & NO_CRC)) bdstatus |= T_R | T_I | T_L | T_TC | frame_get_length(frame); else bdstatus |= T_R | T_I | T_L | frame_get_length(frame); /* if the packet is a ZLP in status phase */ if ((ep->epnum == 0) && (udc->ep0_state == DATA_STATE_NEED_ZLP)) ep->data01 = 0x1; if (ep->data01) { pidmask = T_PID_DATA1; frame->info |= PID_DATA1; } else { pidmask = T_PID_DATA0; frame->info |= PID_DATA0; } bdstatus |= T_CNF; bdstatus |= pidmask; out_be32((u32 __iomem *)bd, bdstatus); qe_ep_filltxfifo(ep); /* enable the TX interrupt */ out_be16(&udc->usb_regs->usb_usbmr, saveusbmr); qe_ep_toggledata01(ep); if (bdstatus & T_W) ep->n_txbd = ep->txbase; else ep->n_txbd++; return 0; } else { out_be16(&udc->usb_regs->usb_usbmr, saveusbmr); dev_vdbg(udc->dev, "The tx bd is not ready!\n"); return -EBUSY; } } /* when a bd was transmitted, the function can * handle the tx_req, not include ep0 */ static int txcomplete(struct qe_ep *ep, unsigned char restart) { if (ep->tx_req != NULL) { struct qe_req *req = ep->tx_req; unsigned zlp = 0, last_len = 0; last_len = min_t(unsigned, req->req.length - ep->sent, ep->ep.maxpacket); if (!restart) { int asent = ep->last; ep->sent += asent; ep->last -= asent; } else { ep->last = 0; } /* zlp needed when req->re.zero is set */ if (req->req.zero) { if (last_len == 0 || (req->req.length % ep->ep.maxpacket) != 0) zlp = 0; else zlp = 1; } else zlp = 0; /* a request already were transmitted completely */ if (((ep->tx_req->req.length - ep->sent) <= 0) && !zlp) { done(ep, ep->tx_req, 0); ep->tx_req = NULL; ep->last = 0; ep->sent = 0; } } /* we should gain a new tx_req fot this endpoint */ if (ep->tx_req == NULL) { if (!list_empty(&ep->queue)) { ep->tx_req = list_entry(ep->queue.next, struct qe_req, queue); ep->last = 0; ep->sent = 0; } } return 0; } /* give a frame and a tx_req, send some data */ static int qe_usb_senddata(struct qe_ep *ep, struct qe_frame *frame) { unsigned int size; u8 *buf; qe_frame_clean(frame); size = min_t(u32, (ep->tx_req->req.length - ep->sent), ep->ep.maxpacket); buf = (u8 *)ep->tx_req->req.buf + ep->sent; if (buf && size) { ep->last = size; ep->tx_req->req.actual += size; frame_set_data(frame, buf); frame_set_length(frame, size); frame_set_status(frame, FRAME_OK); frame_set_info(frame, 0); return qe_ep_tx(ep, frame); } return -EIO; } /* give a frame struct,send a ZLP */ static int sendnulldata(struct qe_ep *ep, struct qe_frame *frame, uint infor) { struct qe_udc *udc = ep->udc; if (frame == NULL) return -ENODEV; qe_frame_clean(frame); frame_set_data(frame, (u8 *)udc->nullbuf); frame_set_length(frame, 2); frame_set_status(frame, FRAME_OK); frame_set_info(frame, (ZLP | NO_CRC | infor)); return qe_ep_tx(ep, frame); } static int frame_create_tx(struct qe_ep *ep, struct qe_frame *frame) { struct qe_req *req = ep->tx_req; int reval; if (req == NULL) return -ENODEV; if ((req->req.length - ep->sent) > 0) reval = qe_usb_senddata(ep, frame); else reval = sendnulldata(ep, frame, 0); return reval; } /* if direction is DIR_IN, the status is Device->Host * if direction is DIR_OUT, the status transaction is Device<-Host * in status phase, udc create a request and gain status */ static int ep0_prime_status(struct qe_udc *udc, int direction) { struct qe_ep *ep = &udc->eps[0]; if (direction == USB_DIR_IN) { udc->ep0_state = DATA_STATE_NEED_ZLP; udc->ep0_dir = USB_DIR_IN; sendnulldata(ep, ep->txframe, SETUP_STATUS | NO_REQ); } else { udc->ep0_dir = USB_DIR_OUT; udc->ep0_state = WAIT_FOR_OUT_STATUS; } return 0; } /* a request complete in ep0, whether gadget request or udc request */ static void ep0_req_complete(struct qe_udc *udc, struct qe_req *req) { struct qe_ep *ep = &udc->eps[0]; /* because usb and ep's status already been set in ch9setaddress() */ switch (udc->ep0_state) { case DATA_STATE_XMIT: done(ep, req, 0); /* receive status phase */ if (ep0_prime_status(udc, USB_DIR_OUT)) qe_ep0_stall(udc); break; case DATA_STATE_NEED_ZLP: done(ep, req, 0); udc->ep0_state = WAIT_FOR_SETUP; break; case DATA_STATE_RECV: done(ep, req, 0); /* send status phase */ if (ep0_prime_status(udc, USB_DIR_IN)) qe_ep0_stall(udc); break; case WAIT_FOR_OUT_STATUS: done(ep, req, 0); udc->ep0_state = WAIT_FOR_SETUP; break; case WAIT_FOR_SETUP: dev_vdbg(udc->dev, "Unexpected interrupt\n"); break; default: qe_ep0_stall(udc); break; } } static int ep0_txcomplete(struct qe_ep *ep, unsigned char restart) { struct qe_req *tx_req = NULL; struct qe_frame *frame = ep->txframe; if ((frame_get_info(frame) & (ZLP | NO_REQ)) == (ZLP | NO_REQ)) { if (!restart) ep->udc->ep0_state = WAIT_FOR_SETUP; else sendnulldata(ep, ep->txframe, SETUP_STATUS | NO_REQ); return 0; } tx_req = ep->tx_req; if (tx_req != NULL) { if (!restart) { int asent = ep->last; ep->sent += asent; ep->last -= asent; } else { ep->last = 0; } /* a request already were transmitted completely */ if ((ep->tx_req->req.length - ep->sent) <= 0) { ep->tx_req->req.actual = (unsigned int)ep->sent; ep0_req_complete(ep->udc, ep->tx_req); ep->tx_req = NULL; ep->last = 0; ep->sent = 0; } } else { dev_vdbg(ep->udc->dev, "the ep0_controller have no req\n"); } return 0; } static int ep0_txframe_handle(struct qe_ep *ep) { /* if have error, transmit again */ if (frame_get_status(ep->txframe) & FRAME_ERROR) { qe_ep_flushtxfifo(ep); dev_vdbg(ep->udc->dev, "The EP0 transmit data have error!\n"); if (frame_get_info(ep->txframe) & PID_DATA0) ep->data01 = 0; else ep->data01 = 1; ep0_txcomplete(ep, 1); } else ep0_txcomplete(ep, 0); frame_create_tx(ep, ep->txframe); return 0; } static int qe_ep0_txconf(struct qe_ep *ep) { struct qe_bd __iomem *bd; struct qe_frame *pframe; u32 bdstatus; bd = ep->c_txbd; bdstatus = in_be32((u32 __iomem *)bd); while (!(bdstatus & T_R) && (bdstatus & ~T_W)) { pframe = ep->txframe; /* clear and recycle the BD */ out_be32((u32 __iomem *)bd, bdstatus & T_W); out_be32(&bd->buf, 0); if (bdstatus & T_W) ep->c_txbd = ep->txbase; else ep->c_txbd++; if (ep->c_txbd == ep->n_txbd) { if (bdstatus & DEVICE_T_ERROR) { frame_set_status(pframe, FRAME_ERROR); if (bdstatus & T_TO) pframe->status |= TX_ER_TIMEOUT; if (bdstatus & T_UN) pframe->status |= TX_ER_UNDERUN; } ep0_txframe_handle(ep); } bd = ep->c_txbd; bdstatus = in_be32((u32 __iomem *)bd); } return 0; } static int ep_txframe_handle(struct qe_ep *ep) { if (frame_get_status(ep->txframe) & FRAME_ERROR) { qe_ep_flushtxfifo(ep); dev_vdbg(ep->udc->dev, "The EP0 transmit data have error!\n"); if (frame_get_info(ep->txframe) & PID_DATA0) ep->data01 = 0; else ep->data01 = 1; txcomplete(ep, 1); } else txcomplete(ep, 0); frame_create_tx(ep, ep->txframe); /* send the data */ return 0; } /* confirm the already trainsmited bd */ static int qe_ep_txconf(struct qe_ep *ep) { struct qe_bd __iomem *bd; struct qe_frame *pframe = NULL; u32 bdstatus; unsigned char breakonrxinterrupt = 0; bd = ep->c_txbd; bdstatus = in_be32((u32 __iomem *)bd); while (!(bdstatus & T_R) && (bdstatus & ~T_W)) { pframe = ep->txframe; if (bdstatus & DEVICE_T_ERROR) { frame_set_status(pframe, FRAME_ERROR); if (bdstatus & T_TO) pframe->status |= TX_ER_TIMEOUT; if (bdstatus & T_UN) pframe->status |= TX_ER_UNDERUN; } /* clear and recycle the BD */ out_be32((u32 __iomem *)bd, bdstatus & T_W); out_be32(&bd->buf, 0); if (bdstatus & T_W) ep->c_txbd = ep->txbase; else ep->c_txbd++; /* handle the tx frame */ ep_txframe_handle(ep); bd = ep->c_txbd; bdstatus = in_be32((u32 __iomem *)bd); } if (breakonrxinterrupt) return -EIO; else return 0; } /* Add a request in queue, and try to transmit a packet */ static int ep_req_send(struct qe_ep *ep, struct qe_req *req) { int reval = 0; if (ep->tx_req == NULL) { ep->sent = 0; ep->last = 0; txcomplete(ep, 0); /* can gain a new tx_req */ reval = frame_create_tx(ep, ep->txframe); } return reval; } /* Maybe this is a good ideal */ static int ep_req_rx(struct qe_ep *ep, struct qe_req *req) { struct qe_udc *udc = ep->udc; struct qe_frame *pframe = NULL; struct qe_bd __iomem *bd; u32 bdstatus, length; u32 vaddr, fsize; u8 *cp; u8 finish_req = 0; u8 framepid; if (list_empty(&ep->queue)) { dev_vdbg(udc->dev, "the req already finish!\n"); return 0; } pframe = ep->rxframe; bd = ep->n_rxbd; bdstatus = in_be32((u32 __iomem *)bd); length = bdstatus & BD_LENGTH_MASK; while (!(bdstatus & R_E) && length) { if (finish_req) break; if ((bdstatus & R_F) && (bdstatus & R_L) && !(bdstatus & R_ERROR)) { qe_frame_clean(pframe); vaddr = (u32)phys_to_virt(in_be32(&bd->buf)); frame_set_data(pframe, (u8 *)vaddr); frame_set_length(pframe, (length - USB_CRC_SIZE)); frame_set_status(pframe, FRAME_OK); switch (bdstatus & R_PID) { case R_PID_DATA1: frame_set_info(pframe, PID_DATA1); break; default: frame_set_info(pframe, PID_DATA0); break; } /* handle the rx frame */ if (frame_get_info(pframe) & PID_DATA1) framepid = 0x1; else framepid = 0; if (framepid != ep->data01) { dev_vdbg(udc->dev, "the data01 error!\n"); } else { fsize = frame_get_length(pframe); cp = (u8 *)(req->req.buf) + req->req.actual; if (cp) { memcpy(cp, pframe->data, fsize); req->req.actual += fsize; if ((fsize < ep->ep.maxpacket) || (req->req.actual >= req->req.length)) { finish_req = 1; done(ep, req, 0); if (list_empty(&ep->queue)) qe_eprx_nack(ep); } } qe_ep_toggledata01(ep); } } else { dev_err(udc->dev, "The receive frame with error!\n"); } /* note: don't clear the rxbd's buffer address * * only Clear the length */ out_be32((u32 __iomem *)bd, (bdstatus & BD_STATUS_MASK)); ep->has_data--; /* Get next BD */ if (bdstatus & R_W) bd = ep->rxbase; else bd++; bdstatus = in_be32((u32 __iomem *)bd); length = bdstatus & BD_LENGTH_MASK; } ep->n_rxbd = bd; ep_recycle_rxbds(ep); return 0; } /* only add the request in queue */ static int ep_req_receive(struct qe_ep *ep, struct qe_req *req) { if (ep->state == EP_STATE_NACK) { if (ep->has_data <= 0) { /* Enable rx and unmask rx interrupt */ qe_eprx_normal(ep); } else { /* Copy the exist BD data */ ep_req_rx(ep, req); } } return 0; } /******************************************************************** Internal Used Function End ********************************************************************/ /*----------------------------------------------------------------------- Endpoint Management Functions For Gadget -----------------------------------------------------------------------*/ static int qe_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) { struct qe_udc *udc; struct qe_ep *ep; int retval = 0; unsigned char epnum; ep = container_of(_ep, struct qe_ep, ep); /* catch various bogus parameters */ if (!_ep || !desc || _ep->name == ep_name[0] || (desc->bDescriptorType != USB_DT_ENDPOINT)) return -EINVAL; udc = ep->udc; if (!udc->driver || (udc->gadget.speed == USB_SPEED_UNKNOWN)) return -ESHUTDOWN; epnum = (u8)desc->bEndpointAddress & 0xF; retval = qe_ep_init(udc, epnum, desc); if (retval != 0) { cpm_muram_free(cpm_muram_offset(ep->rxbase)); dev_dbg(udc->dev, "enable ep%d failed\n", ep->epnum); return -EINVAL; } dev_dbg(udc->dev, "enable ep%d successful\n", ep->epnum); return 0; } static int qe_ep_disable(struct usb_ep *_ep) { struct qe_udc *udc; struct qe_ep *ep; unsigned long flags; unsigned int size; ep = container_of(_ep, struct qe_ep, ep); udc = ep->udc; if (!_ep || !ep->ep.desc) { dev_dbg(udc->dev, "%s not enabled\n", _ep ? ep->ep.name : NULL); return -EINVAL; } spin_lock_irqsave(&udc->lock, flags); /* Nuke all pending requests (does flush) */ nuke(ep, -ESHUTDOWN); ep->ep.desc = NULL; ep->stopped = 1; ep->tx_req = NULL; qe_ep_reset(udc, ep->epnum); spin_unlock_irqrestore(&udc->lock, flags); cpm_muram_free(cpm_muram_offset(ep->rxbase)); if (ep->dir == USB_DIR_OUT) size = (ep->ep.maxpacket + USB_CRC_SIZE + 2) * (USB_BDRING_LEN_RX + 1); else size = (ep->ep.maxpacket + USB_CRC_SIZE + 2) * (USB_BDRING_LEN + 1); if (ep->dir != USB_DIR_IN) { kfree(ep->rxframe); if (ep->rxbufmap) { dma_unmap_single(udc->gadget.dev.parent, ep->rxbuf_d, size, DMA_FROM_DEVICE); ep->rxbuf_d = DMA_ADDR_INVALID; } else { dma_sync_single_for_cpu( udc->gadget.dev.parent, ep->rxbuf_d, size, DMA_FROM_DEVICE); } kfree(ep->rxbuffer); } if (ep->dir != USB_DIR_OUT) kfree(ep->txframe); dev_dbg(udc->dev, "disabled %s OK\n", _ep->name); return 0; } static struct usb_request *qe_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags) { struct qe_req *req; req = kzalloc(sizeof(*req), gfp_flags); if (!req) return NULL; req->req.dma = DMA_ADDR_INVALID; INIT_LIST_HEAD(&req->queue); return &req->req; } static void qe_free_request(struct usb_ep *_ep, struct usb_request *_req) { struct qe_req *req; req = container_of(_req, struct qe_req, req); if (_req) kfree(req); } static int __qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req) { struct qe_ep *ep = container_of(_ep, struct qe_ep, ep); struct qe_req *req = container_of(_req, struct qe_req, req); struct qe_udc *udc; int reval; udc = ep->udc; /* catch various bogus parameters */ if (!_req || !req->req.complete || !req->req.buf || !list_empty(&req->queue)) { dev_dbg(udc->dev, "bad params\n"); return -EINVAL; } if (!_ep || (!ep->ep.desc && ep_index(ep))) { dev_dbg(udc->dev, "bad ep\n"); return -EINVAL; } if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN) return -ESHUTDOWN; req->ep = ep; /* map virtual address to hardware */ if (req->req.dma == DMA_ADDR_INVALID) { req->req.dma = dma_map_single(ep->udc->gadget.dev.parent, req->req.buf, req->req.length, ep_is_in(ep) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); req->mapped = 1; } else { dma_sync_single_for_device(ep->udc->gadget.dev.parent, req->req.dma, req->req.length, ep_is_in(ep) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); req->mapped = 0; } req->req.status = -EINPROGRESS; req->req.actual = 0; list_add_tail(&req->queue, &ep->queue); dev_vdbg(udc->dev, "gadget have request in %s! %d\n", ep->name, req->req.length); /* push the request to device */ if (ep_is_in(ep)) reval = ep_req_send(ep, req); /* EP0 */ if (ep_index(ep) == 0 && req->req.length > 0) { if (ep_is_in(ep)) udc->ep0_state = DATA_STATE_XMIT; else udc->ep0_state = DATA_STATE_RECV; } if (ep->dir == USB_DIR_OUT) reval = ep_req_receive(ep, req); return 0; } /* queues (submits) an I/O request to an endpoint */ static int qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) { struct qe_ep *ep = container_of(_ep, struct qe_ep, ep); struct qe_udc *udc = ep->udc; unsigned long flags; int ret; spin_lock_irqsave(&udc->lock, flags); ret = __qe_ep_queue(_ep, _req); spin_unlock_irqrestore(&udc->lock, flags); return ret; } /* dequeues (cancels, unlinks) an I/O request from an endpoint */ static int qe_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) { struct qe_ep *ep = container_of(_ep, struct qe_ep, ep); struct qe_req *req; unsigned long flags; if (!_ep || !_req) return -EINVAL; spin_lock_irqsave(&ep->udc->lock, flags); /* make sure it's actually queued on this endpoint */ list_for_each_entry(req, &ep->queue, queue) { if (&req->req == _req) break; } if (&req->req != _req) { spin_unlock_irqrestore(&ep->udc->lock, flags); return -EINVAL; } done(ep, req, -ECONNRESET); spin_unlock_irqrestore(&ep->udc->lock, flags); return 0; } /*----------------------------------------------------------------- * modify the endpoint halt feature * @ep: the non-isochronous endpoint being stalled * @value: 1--set halt 0--clear halt * Returns zero, or a negative error code. *----------------------------------------------------------------*/ static int qe_ep_set_halt(struct usb_ep *_ep, int value) { struct qe_ep *ep; unsigned long flags; int status = -EOPNOTSUPP; struct qe_udc *udc; ep = container_of(_ep, struct qe_ep, ep); if (!_ep || !ep->ep.desc) { status = -EINVAL; goto out; } udc = ep->udc; /* Attempt to halt IN ep will fail if any transfer requests * are still queue */ if (value && ep_is_in(ep) && !list_empty(&ep->queue)) { status = -EAGAIN; goto out; } status = 0; spin_lock_irqsave(&ep->udc->lock, flags); qe_eptx_stall_change(ep, value); qe_eprx_stall_change(ep, value); spin_unlock_irqrestore(&ep->udc->lock, flags); if (ep->epnum == 0) { udc->ep0_state = WAIT_FOR_SETUP; udc->ep0_dir = 0; } /* set data toggle to DATA0 on clear halt */ if (value == 0) ep->data01 = 0; out: dev_vdbg(udc->dev, "%s %s halt stat %d\n", ep->ep.name, value ? "set" : "clear", status); return status; } static struct usb_ep_ops qe_ep_ops = { .enable = qe_ep_enable, .disable = qe_ep_disable, .alloc_request = qe_alloc_request, .free_request = qe_free_request, .queue = qe_ep_queue, .dequeue = qe_ep_dequeue, .set_halt = qe_ep_set_halt, }; /*------------------------------------------------------------------------ Gadget Driver Layer Operations ------------------------------------------------------------------------*/ /* Get the current frame number */ static int qe_get_frame(struct usb_gadget *gadget) { struct qe_udc *udc = container_of(gadget, struct qe_udc, gadget); u16 tmp; tmp = in_be16(&udc->usb_param->frame_n); if (tmp & 0x8000) tmp = tmp & 0x07ff; else tmp = -EINVAL; return (int)tmp; } static int fsl_qe_start(struct usb_gadget *gadget, struct usb_gadget_driver *driver); static int fsl_qe_stop(struct usb_gadget *gadget); /* defined in usb_gadget.h */ static const struct usb_gadget_ops qe_gadget_ops = { .get_frame = qe_get_frame, .udc_start = fsl_qe_start, .udc_stop = fsl_qe_stop, }; /*------------------------------------------------------------------------- USB ep0 Setup process in BUS Enumeration -------------------------------------------------------------------------*/ static int udc_reset_ep_queue(struct qe_udc *udc, u8 pipe) { struct qe_ep *ep = &udc->eps[pipe]; nuke(ep, -ECONNRESET); ep->tx_req = NULL; return 0; } static int reset_queues(struct qe_udc *udc) { u8 pipe; for (pipe = 0; pipe < USB_MAX_ENDPOINTS; pipe++) udc_reset_ep_queue(udc, pipe); /* report disconnect; the driver is already quiesced */ spin_unlock(&udc->lock); usb_gadget_udc_reset(&udc->gadget, udc->driver); spin_lock(&udc->lock); return 0; } static void ch9setaddress(struct qe_udc *udc, u16 value, u16 index, u16 length) { /* Save the new address to device struct */ udc->device_address = (u8) value; /* Update usb state */ udc->usb_state = USB_STATE_ADDRESS; /* Status phase , send a ZLP */ if (ep0_prime_status(udc, USB_DIR_IN)) qe_ep0_stall(udc); } static void ownercomplete(struct usb_ep *_ep, struct usb_request *_req) { struct qe_req *req = container_of(_req, struct qe_req, req); req->req.buf = NULL; kfree(req); } static void ch9getstatus(struct qe_udc *udc, u8 request_type, u16 value, u16 index, u16 length) { u16 usb_status = 0; struct qe_req *req; struct qe_ep *ep; int status = 0; ep = &udc->eps[0]; if ((request_type & USB_RECIP_MASK) == USB_RECIP_DEVICE) { /* Get device status */ usb_status = 1 << USB_DEVICE_SELF_POWERED; } else if ((request_type & USB_RECIP_MASK) == USB_RECIP_INTERFACE) { /* Get interface status */ /* We don't have interface information in udc driver */ usb_status = 0; } else if ((request_type & USB_RECIP_MASK) == USB_RECIP_ENDPOINT) { /* Get endpoint status */ int pipe = index & USB_ENDPOINT_NUMBER_MASK; struct qe_ep *target_ep = &udc->eps[pipe]; u16 usep; /* stall if endpoint doesn't exist */ if (!target_ep->ep.desc) goto stall; usep = in_be16(&udc->usb_regs->usb_usep[pipe]); if (index & USB_DIR_IN) { if (target_ep->dir != USB_DIR_IN) goto stall; if ((usep & USB_THS_MASK) == USB_THS_STALL) usb_status = 1 << USB_ENDPOINT_HALT; } else { if (target_ep->dir != USB_DIR_OUT) goto stall; if ((usep & USB_RHS_MASK) == USB_RHS_STALL) usb_status = 1 << USB_ENDPOINT_HALT; } } req = container_of(qe_alloc_request(&ep->ep, GFP_KERNEL), struct qe_req, req); req->req.length = 2; req->req.buf = udc->statusbuf; *(u16 *)req->req.buf = cpu_to_le16(usb_status); req->req.status = -EINPROGRESS; req->req.actual = 0; req->req.complete = ownercomplete; udc->ep0_dir = USB_DIR_IN; /* data phase */ status = __qe_ep_queue(&ep->ep, &req->req); if (status == 0) return; stall: dev_err(udc->dev, "Can't respond to getstatus request \n"); qe_ep0_stall(udc); } /* only handle the setup request, suppose the device in normal status */ static void setup_received_handle(struct qe_udc *udc, struct usb_ctrlrequest *setup) { /* Fix Endian (udc->local_setup_buff is cpu Endian now)*/ u16 wValue = le16_to_cpu(setup->wValue); u16 wIndex = le16_to_cpu(setup->wIndex); u16 wLength = le16_to_cpu(setup->wLength); /* clear the previous request in the ep0 */ udc_reset_ep_queue(udc, 0); if (setup->bRequestType & USB_DIR_IN) udc->ep0_dir = USB_DIR_IN; else udc->ep0_dir = USB_DIR_OUT; switch (setup->bRequest) { case USB_REQ_GET_STATUS: /* Data+Status phase form udc */ if ((setup->bRequestType & (USB_DIR_IN | USB_TYPE_MASK)) != (USB_DIR_IN | USB_TYPE_STANDARD)) break; ch9getstatus(udc, setup->bRequestType, wValue, wIndex, wLength); return; case USB_REQ_SET_ADDRESS: /* Status phase from udc */ if (setup->bRequestType != (USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE)) break; ch9setaddress(udc, wValue, wIndex, wLength); return; case USB_REQ_CLEAR_FEATURE: case USB_REQ_SET_FEATURE: /* Requests with no data phase, status phase from udc */ if ((setup->bRequestType & USB_TYPE_MASK) != USB_TYPE_STANDARD) break; if ((setup->bRequestType & USB_RECIP_MASK) == USB_RECIP_ENDPOINT) { int pipe = wIndex & USB_ENDPOINT_NUMBER_MASK; struct qe_ep *ep; if (wValue != 0 || wLength != 0 || pipe > USB_MAX_ENDPOINTS) break; ep = &udc->eps[pipe]; spin_unlock(&udc->lock); qe_ep_set_halt(&ep->ep, (setup->bRequest == USB_REQ_SET_FEATURE) ? 1 : 0); spin_lock(&udc->lock); } ep0_prime_status(udc, USB_DIR_IN); return; default: break; } if (wLength) { /* Data phase from gadget, status phase from udc */ if (setup->bRequestType & USB_DIR_IN) { udc->ep0_state = DATA_STATE_XMIT; udc->ep0_dir = USB_DIR_IN; } else { udc->ep0_state = DATA_STATE_RECV; udc->ep0_dir = USB_DIR_OUT; } spin_unlock(&udc->lock); if (udc->driver->setup(&udc->gadget, &udc->local_setup_buff) < 0) qe_ep0_stall(udc); spin_lock(&udc->lock); } else { /* No data phase, IN status from gadget */ udc->ep0_dir = USB_DIR_IN; spin_unlock(&udc->lock); if (udc->driver->setup(&udc->gadget, &udc->local_setup_buff) < 0) qe_ep0_stall(udc); spin_lock(&udc->lock); udc->ep0_state = DATA_STATE_NEED_ZLP; } } /*------------------------------------------------------------------------- USB Interrupt handlers -------------------------------------------------------------------------*/ static void suspend_irq(struct qe_udc *udc) { udc->resume_state = udc->usb_state; udc->usb_state = USB_STATE_SUSPENDED; /* report suspend to the driver ,serial.c not support this*/ if (udc->driver->suspend) udc->driver->suspend(&udc->gadget); } static void resume_irq(struct qe_udc *udc) { udc->usb_state = udc->resume_state; udc->resume_state = 0; /* report resume to the driver , serial.c not support this*/ if (udc->driver->resume) udc->driver->resume(&udc->gadget); } static void idle_irq(struct qe_udc *udc) { u8 usbs; usbs = in_8(&udc->usb_regs->usb_usbs); if (usbs & USB_IDLE_STATUS_MASK) { if ((udc->usb_state) != USB_STATE_SUSPENDED) suspend_irq(udc); } else { if (udc->usb_state == USB_STATE_SUSPENDED) resume_irq(udc); } } static int reset_irq(struct qe_udc *udc) { unsigned char i; if (udc->usb_state == USB_STATE_DEFAULT) return 0; qe_usb_disable(udc); out_8(&udc->usb_regs->usb_usadr, 0); for (i = 0; i < USB_MAX_ENDPOINTS; i++) { if (udc->eps[i].init) qe_ep_reset(udc, i); } reset_queues(udc); udc->usb_state = USB_STATE_DEFAULT; udc->ep0_state = WAIT_FOR_SETUP; udc->ep0_dir = USB_DIR_OUT; qe_usb_enable(udc); return 0; } static int bsy_irq(struct qe_udc *udc) { return 0; } static int txe_irq(struct qe_udc *udc) { return 0; } /* ep0 tx interrupt also in here */ static int tx_irq(struct qe_udc *udc) { struct qe_ep *ep; struct qe_bd __iomem *bd; int i, res = 0; if ((udc->usb_state == USB_STATE_ADDRESS) && (in_8(&udc->usb_regs->usb_usadr) == 0)) out_8(&udc->usb_regs->usb_usadr, udc->device_address); for (i = (USB_MAX_ENDPOINTS-1); ((i >= 0) && (res == 0)); i--) { ep = &udc->eps[i]; if (ep && ep->init && (ep->dir != USB_DIR_OUT)) { bd = ep->c_txbd; if (!(in_be32((u32 __iomem *)bd) & T_R) && (in_be32(&bd->buf))) { /* confirm the transmitted bd */ if (ep->epnum == 0) res = qe_ep0_txconf(ep); else res = qe_ep_txconf(ep); } } } return res; } /* setup packect's rx is handle in the function too */ static void rx_irq(struct qe_udc *udc) { struct qe_ep *ep; struct qe_bd __iomem *bd; int i; for (i = 0; i < USB_MAX_ENDPOINTS; i++) { ep = &udc->eps[i]; if (ep && ep->init && (ep->dir != USB_DIR_IN)) { bd = ep->n_rxbd; if (!(in_be32((u32 __iomem *)bd) & R_E) && (in_be32(&bd->buf))) { if (ep->epnum == 0) { qe_ep0_rx(udc); } else { /*non-setup package receive*/ qe_ep_rx(ep); } } } } } static irqreturn_t qe_udc_irq(int irq, void *_udc) { struct qe_udc *udc = (struct qe_udc *)_udc; u16 irq_src; irqreturn_t status = IRQ_NONE; unsigned long flags; spin_lock_irqsave(&udc->lock, flags); irq_src = in_be16(&udc->usb_regs->usb_usber) & in_be16(&udc->usb_regs->usb_usbmr); /* Clear notification bits */ out_be16(&udc->usb_regs->usb_usber, irq_src); /* USB Interrupt */ if (irq_src & USB_E_IDLE_MASK) { idle_irq(udc); irq_src &= ~USB_E_IDLE_MASK; status = IRQ_HANDLED; } if (irq_src & USB_E_TXB_MASK) { tx_irq(udc); irq_src &= ~USB_E_TXB_MASK; status = IRQ_HANDLED; } if (irq_src & USB_E_RXB_MASK) { rx_irq(udc); irq_src &= ~USB_E_RXB_MASK; status = IRQ_HANDLED; } if (irq_src & USB_E_RESET_MASK) { reset_irq(udc); irq_src &= ~USB_E_RESET_MASK; status = IRQ_HANDLED; } if (irq_src & USB_E_BSY_MASK) { bsy_irq(udc); irq_src &= ~USB_E_BSY_MASK; status = IRQ_HANDLED; } if (irq_src & USB_E_TXE_MASK) { txe_irq(udc); irq_src &= ~USB_E_TXE_MASK; status = IRQ_HANDLED; } spin_unlock_irqrestore(&udc->lock, flags); return status; } /*------------------------------------------------------------------------- Gadget driver probe and unregister. --------------------------------------------------------------------------*/ static int fsl_qe_start(struct usb_gadget *gadget, struct usb_gadget_driver *driver) { struct qe_udc *udc; unsigned long flags; udc = container_of(gadget, struct qe_udc, gadget); /* lock is needed but whether should use this lock or another */ spin_lock_irqsave(&udc->lock, flags); driver->driver.bus = NULL; /* hook up the driver */ udc->driver = driver; udc->gadget.speed = driver->max_speed; /* Enable IRQ reg and Set usbcmd reg EN bit */ qe_usb_enable(udc); out_be16(&udc->usb_regs->usb_usber, 0xffff); out_be16(&udc->usb_regs->usb_usbmr, USB_E_DEFAULT_DEVICE); udc->usb_state = USB_STATE_ATTACHED; udc->ep0_state = WAIT_FOR_SETUP; udc->ep0_dir = USB_DIR_OUT; spin_unlock_irqrestore(&udc->lock, flags); return 0; } static int fsl_qe_stop(struct usb_gadget *gadget) { struct qe_udc *udc; struct qe_ep *loop_ep; unsigned long flags; udc = container_of(gadget, struct qe_udc, gadget); /* stop usb controller, disable intr */ qe_usb_disable(udc); /* in fact, no needed */ udc->usb_state = USB_STATE_ATTACHED; udc->ep0_state = WAIT_FOR_SETUP; udc->ep0_dir = 0; /* stand operation */ spin_lock_irqsave(&udc->lock, flags); udc->gadget.speed = USB_SPEED_UNKNOWN; nuke(&udc->eps[0], -ESHUTDOWN); list_for_each_entry(loop_ep, &udc->gadget.ep_list, ep.ep_list) nuke(loop_ep, -ESHUTDOWN); spin_unlock_irqrestore(&udc->lock, flags); udc->driver = NULL; return 0; } /* udc structure's alloc and setup, include ep-param alloc */ static struct qe_udc *qe_udc_config(struct platform_device *ofdev) { struct qe_udc *udc; struct device_node *np = ofdev->dev.of_node; unsigned int tmp_addr = 0; struct usb_device_para __iomem *usbpram; unsigned int i; u64 size; u32 offset; udc = kzalloc(sizeof(*udc), GFP_KERNEL); if (udc == NULL) { dev_err(&ofdev->dev, "malloc udc failed\n"); goto cleanup; } udc->dev = &ofdev->dev; /* get default address of usb parameter in MURAM from device tree */ offset = *of_get_address(np, 1, &size, NULL); udc->usb_param = cpm_muram_addr(offset); memset_io(udc->usb_param, 0, size); usbpram = udc->usb_param; out_be16(&usbpram->frame_n, 0); out_be32(&usbpram->rstate, 0); tmp_addr = cpm_muram_alloc((USB_MAX_ENDPOINTS * sizeof(struct usb_ep_para)), USB_EP_PARA_ALIGNMENT); if (IS_ERR_VALUE(tmp_addr)) goto cleanup; for (i = 0; i < USB_MAX_ENDPOINTS; i++) { out_be16(&usbpram->epptr[i], (u16)tmp_addr); udc->ep_param[i] = cpm_muram_addr(tmp_addr); tmp_addr += 32; } memset_io(udc->ep_param[0], 0, USB_MAX_ENDPOINTS * sizeof(struct usb_ep_para)); udc->resume_state = USB_STATE_NOTATTACHED; udc->usb_state = USB_STATE_POWERED; udc->ep0_dir = 0; spin_lock_init(&udc->lock); return udc; cleanup: kfree(udc); return NULL; } /* USB Controller register init */ static int qe_udc_reg_init(struct qe_udc *udc) { struct usb_ctlr __iomem *qe_usbregs; qe_usbregs = udc->usb_regs; /* Spec says that we must enable the USB controller to change mode. */ out_8(&qe_usbregs->usb_usmod, 0x01); /* Mode changed, now disable it, since muram isn't initialized yet. */ out_8(&qe_usbregs->usb_usmod, 0x00); /* Initialize the rest. */ out_be16(&qe_usbregs->usb_usbmr, 0); out_8(&qe_usbregs->usb_uscom, 0); out_be16(&qe_usbregs->usb_usber, USBER_ALL_CLEAR); return 0; } static int qe_ep_config(struct qe_udc *udc, unsigned char pipe_num) { struct qe_ep *ep = &udc->eps[pipe_num]; ep->udc = udc; strcpy(ep->name, ep_name[pipe_num]); ep->ep.name = ep_name[pipe_num]; if (pipe_num == 0) { ep->ep.caps.type_control = true; } else { ep->ep.caps.type_iso = true; ep->ep.caps.type_bulk = true; ep->ep.caps.type_int = true; } ep->ep.caps.dir_in = true; ep->ep.caps.dir_out = true; ep->ep.ops = &qe_ep_ops; ep->stopped = 1; usb_ep_set_maxpacket_limit(&ep->ep, (unsigned short) ~0); ep->ep.desc = NULL; ep->dir = 0xff; ep->epnum = (u8)pipe_num; ep->sent = 0; ep->last = 0; ep->init = 0; ep->rxframe = NULL; ep->txframe = NULL; ep->tx_req = NULL; ep->state = EP_STATE_IDLE; ep->has_data = 0; /* the queue lists any req for this ep */ INIT_LIST_HEAD(&ep->queue); /* gagdet.ep_list used for ep_autoconfig so no ep0*/ if (pipe_num != 0) list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); ep->gadget = &udc->gadget; return 0; } /*----------------------------------------------------------------------- * UDC device Driver operation functions * *----------------------------------------------------------------------*/ static void qe_udc_release(struct device *dev) { struct qe_udc *udc = container_of(dev, struct qe_udc, gadget.dev); int i; complete(udc->done); cpm_muram_free(cpm_muram_offset(udc->ep_param[0])); for (i = 0; i < USB_MAX_ENDPOINTS; i++) udc->ep_param[i] = NULL; kfree(udc); } /* Driver probe functions */ static const struct of_device_id qe_udc_match[]; static int qe_udc_probe(struct platform_device *ofdev) { struct qe_udc *udc; const struct of_device_id *match; struct device_node *np = ofdev->dev.of_node; struct qe_ep *ep; unsigned int ret = 0; unsigned int i; const void *prop; match = of_match_device(qe_udc_match, &ofdev->dev); if (!match) return -EINVAL; prop = of_get_property(np, "mode", NULL); if (!prop || strcmp(prop, "peripheral")) return -ENODEV; /* Initialize the udc structure including QH member and other member */ udc = qe_udc_config(ofdev); if (!udc) { dev_err(&ofdev->dev, "failed to initialize\n"); return -ENOMEM; } udc->soc_type = (unsigned long)match->data; udc->usb_regs = of_iomap(np, 0); if (!udc->usb_regs) { ret = -ENOMEM; goto err1; } /* initialize usb hw reg except for regs for EP, * leave usbintr reg untouched*/ qe_udc_reg_init(udc); /* here comes the stand operations for probe * set the qe_udc->gadget.xxx */ udc->gadget.ops = &qe_gadget_ops; /* gadget.ep0 is a pointer */ udc->gadget.ep0 = &udc->eps[0].ep; INIT_LIST_HEAD(&udc->gadget.ep_list); /* modify in register gadget process */ udc->gadget.speed = USB_SPEED_UNKNOWN; /* name: Identifies the controller hardware type. */ udc->gadget.name = driver_name; udc->gadget.dev.parent = &ofdev->dev; /* initialize qe_ep struct */ for (i = 0; i < USB_MAX_ENDPOINTS ; i++) { /* because the ep type isn't decide here so * qe_ep_init() should be called in ep_enable() */ /* setup the qe_ep struct and link ep.ep.list * into gadget.ep_list */ qe_ep_config(udc, (unsigned char)i); } /* ep0 initialization in here */ ret = qe_ep_init(udc, 0, &qe_ep0_desc); if (ret) goto err2; /* create a buf for ZLP send, need to remain zeroed */ udc->nullbuf = devm_kzalloc(&ofdev->dev, 256, GFP_KERNEL); if (udc->nullbuf == NULL) { ret = -ENOMEM; goto err3; } /* buffer for data of get_status request */ udc->statusbuf = devm_kzalloc(&ofdev->dev, 2, GFP_KERNEL); if (udc->statusbuf == NULL) { ret = -ENOMEM; goto err3; } udc->nullp = virt_to_phys((void *)udc->nullbuf); if (udc->nullp == DMA_ADDR_INVALID) { udc->nullp = dma_map_single( udc->gadget.dev.parent, udc->nullbuf, 256, DMA_TO_DEVICE); udc->nullmap = 1; } else { dma_sync_single_for_device(udc->gadget.dev.parent, udc->nullp, 256, DMA_TO_DEVICE); } tasklet_init(&udc->rx_tasklet, ep_rx_tasklet, (unsigned long)udc); /* request irq and disable DR */ udc->usb_irq = irq_of_parse_and_map(np, 0); if (!udc->usb_irq) { ret = -EINVAL; goto err_noirq; } ret = request_irq(udc->usb_irq, qe_udc_irq, 0, driver_name, udc); if (ret) { dev_err(udc->dev, "cannot request irq %d err %d\n", udc->usb_irq, ret); goto err4; } ret = usb_add_gadget_udc_release(&ofdev->dev, &udc->gadget, qe_udc_release); if (ret) goto err5; platform_set_drvdata(ofdev, udc); dev_info(udc->dev, "%s USB controller initialized as device\n", (udc->soc_type == PORT_QE) ? "QE" : "CPM"); return 0; err5: free_irq(udc->usb_irq, udc); err4: irq_dispose_mapping(udc->usb_irq); err_noirq: if (udc->nullmap) { dma_unmap_single(udc->gadget.dev.parent, udc->nullp, 256, DMA_TO_DEVICE); udc->nullp = DMA_ADDR_INVALID; } else { dma_sync_single_for_cpu(udc->gadget.dev.parent, udc->nullp, 256, DMA_TO_DEVICE); } err3: ep = &udc->eps[0]; cpm_muram_free(cpm_muram_offset(ep->rxbase)); kfree(ep->rxframe); kfree(ep->rxbuffer); kfree(ep->txframe); err2: iounmap(udc->usb_regs); err1: kfree(udc); return ret; } #ifdef CONFIG_PM static int qe_udc_suspend(struct platform_device *dev, pm_message_t state) { return -ENOTSUPP; } static int qe_udc_resume(struct platform_device *dev) { return -ENOTSUPP; } #endif static int qe_udc_remove(struct platform_device *ofdev) { struct qe_udc *udc = platform_get_drvdata(ofdev); struct qe_ep *ep; unsigned int size; DECLARE_COMPLETION_ONSTACK(done); usb_del_gadget_udc(&udc->gadget); udc->done = &done; tasklet_disable(&udc->rx_tasklet); if (udc->nullmap) { dma_unmap_single(udc->gadget.dev.parent, udc->nullp, 256, DMA_TO_DEVICE); udc->nullp = DMA_ADDR_INVALID; } else { dma_sync_single_for_cpu(udc->gadget.dev.parent, udc->nullp, 256, DMA_TO_DEVICE); } ep = &udc->eps[0]; cpm_muram_free(cpm_muram_offset(ep->rxbase)); size = (ep->ep.maxpacket + USB_CRC_SIZE + 2) * (USB_BDRING_LEN + 1); kfree(ep->rxframe); if (ep->rxbufmap) { dma_unmap_single(udc->gadget.dev.parent, ep->rxbuf_d, size, DMA_FROM_DEVICE); ep->rxbuf_d = DMA_ADDR_INVALID; } else { dma_sync_single_for_cpu(udc->gadget.dev.parent, ep->rxbuf_d, size, DMA_FROM_DEVICE); } kfree(ep->rxbuffer); kfree(ep->txframe); free_irq(udc->usb_irq, udc); irq_dispose_mapping(udc->usb_irq); tasklet_kill(&udc->rx_tasklet); iounmap(udc->usb_regs); /* wait for release() of gadget.dev to free udc */ wait_for_completion(&done); return 0; } /*-------------------------------------------------------------------------*/ static const struct of_device_id qe_udc_match[] = { { .compatible = "fsl,mpc8323-qe-usb", .data = (void *)PORT_QE, }, { .compatible = "fsl,mpc8360-qe-usb", .data = (void *)PORT_QE, }, { .compatible = "fsl,mpc8272-cpm-usb", .data = (void *)PORT_CPM, }, {}, }; MODULE_DEVICE_TABLE(of, qe_udc_match); static struct platform_driver udc_driver = { .driver = { .name = driver_name, .of_match_table = qe_udc_match, }, .probe = qe_udc_probe, .remove = qe_udc_remove, #ifdef CONFIG_PM .suspend = qe_udc_suspend, .resume = qe_udc_resume, #endif }; module_platform_driver(udc_driver); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_LICENSE("GPL");
{ "pile_set_name": "Github" }
// // MPTTheoryViewController.m // MobileProject // // Created by wujunyang on 2017/3/1. // Copyright © 2017年 wujunyang. All rights reserved. // #import "MPTTheoryViewController.h" @interface MPTTheoryViewController ()<UITableViewDataSource, UITableViewDelegate> @property (nonatomic,strong) NSArray *dataArray; @property (nonatomic,strong) UITableView *myTableView; @end @implementation MPTTheoryViewController //常见的五个宏 //1: //RAC(TARGET, [KEYPATH, [NIL_VALUE]]):用于给某个对象的某个属性绑定 // 只要文本框文字改变,就会修改label的文字 //RAC(self.labelView,text) = _textField.rac_textSignal; //2: //RACObserve(self, name):监听某个对象的某个属性,返回的是信号。 //[RACObserve(self.view, center) subscribeNext:^(id x) { // NSLog(@"%@",x); //}]; //当RACObserve放在block里面使用时一定要加上weakify,不管里面有没有使用到self;否则会内存泄漏,因为RACObserve宏里面就有一个self //@weakify(self); //RACSignal *signal3 = [anotherSignal flattenMap:^(NSArrayController *arrayController) { // Avoids a retain cycle because of RACObserve implicitly referencing self // @strongify(self); // return RACObserve(arrayController, items); //}]; //3: //@weakify(Obj)和@strongify(Obj),一般两个都是配套使用,在主头文件(ReactiveCocoa.h)中并没有导入,需要自己手动导入,RACEXTScope.h才可以使用。但是每次导入都非常麻烦,只需要在主头文件自己导入就好了 //4: //RACTuplePack:把数据包装成RACTuple(元组类) // 把参数中的数据包装成元组 //RACTuple *tuple = RACTuplePack(@10,@20); //5: //RACTupleUnpack:把RACTuple(元组类)解包成对应的数据 //// 把参数中的数据包装成元组 //RACTuple *tuple = RACTuplePack(@"xmg",@20); // //// 解包元组,会把元组的值,按顺序给参数里面的变量赋值 //// name = @"xmg" age = @20 //RACTupleUnpack(NSString *name,NSNumber *age) = tuple; - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor=[UIColor whiteColor]; self.navigationItem.title=@"基础知识点"; if (!self.dataArray) { self.dataArray=@[@"RACSigner基础知识点",@"RACSubject基础知识点",@"RACSequence基础知识点",@"RACCommand基础知识点",@"RACMulticastConnection基础知识点",@"RAC结合UI一般事件",@"高阶操作知识内容",@"RAC并发编程知识点",@"冷信号跟热信号知识点",@"RACDisposable知识点",@"RACChannel知识点",@"RAC倒计时小实例"]; } //初始化表格 if (!_myTableView) { _myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0.5, Main_Screen_Width, Main_Screen_Height) style:UITableViewStylePlain]; _myTableView.showsVerticalScrollIndicator = NO; _myTableView.showsHorizontalScrollIndicator = NO; _myTableView.dataSource = self; _myTableView.delegate = self; [_myTableView registerClass:[UITableViewCell class] forCellReuseIdentifier:NSStringFromClass([UITableViewCell class])]; [self.view addSubview:_myTableView]; [_myTableView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(UIEdgeInsetsMake(0, 0, 0, 0)); }]; } } #pragma mark UITableViewDataSource, UITableViewDelegate相关内容 -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return self.dataArray.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([UITableViewCell class]) forIndexPath:indexPath]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.textLabel.text = self.dataArray[indexPath.row]; return cell; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 44; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ [tableView deselectRowAtIndexPath:indexPath animated:YES]; switch (indexPath.row) { case 0: { MPTRACSignerViewController *vc=[[MPTRACSignerViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 1: { MPTRACSubjectViewController *vc=[[MPTRACSubjectViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 2: { MPTRACSequenceViewController *vc=[[MPTRACSequenceViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 3: { MPTRACCommandViewController *vc=[[MPTRACCommandViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 4: { MPTRACMulticastConnectionViewController *vc=[[MPTRACMulticastConnectionViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 5: { MPTRACUIKitViewController *vc=[[MPTRACUIKitViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 6: { MPTRACHightSignalViewController *vc=[[MPTRACHightSignalViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 7: { MPTRACSchedulerViewController *vc=[[MPTRACSchedulerViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 8: { MPTHotAndColdSignalViewController *vc=[[MPTHotAndColdSignalViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 9: { MPTRACDisposableViewController *vc=[[MPTRACDisposableViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 10: { RACChannelViewController *vc=[[RACChannelViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } case 11: { MPTCountDownViewController *vc=[[MPTCountDownViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; break; } default: break; } } @end
{ "pile_set_name": "Github" }
/* * ni6510 (am7990 'lance' chip) driver for Linux-net-3 * BETAcode v0.71 (96/09/29) for 2.0.0 (or later) * copyrights (c) 1994,1995,1996 by M.Hipp * * This driver can handle the old ni6510 board and the newer ni6510 * EtherBlaster. (probably it also works with every full NE2100 * compatible card) * * driver probes: io: 0x360,0x300,0x320,0x340 / dma: 3,5,6,7 * * This is an extension to the Linux operating system, and is covered by the * same GNU General Public License that covers the Linux-kernel. * * comments/bugs/suggestions can be sent to: * Michael Hipp * email: hippm@informatik.uni-tuebingen.de * * sources: * some things are from the 'ni6510-packet-driver for dos by Russ Nelson' * and from the original drivers by D.Becker * * known problems: * - on some PCI boards (including my own) the card/board/ISA-bridge has * problems with bus master DMA. This results in lotsa overruns. * It may help to '#define RCV_PARANOIA_CHECK' or try to #undef * the XMT and RCV_VIA_SKB option .. this reduces driver performance. * Or just play with your BIOS options to optimize ISA-DMA access. * Maybe you also wanna play with the LOW_PERFORAMCE and MID_PERFORMANCE * defines -> please report me your experience then * - Harald reported for ASUS SP3G mainboards, that you should use * the 'optimal settings' from the user's manual on page 3-12! * * credits: * thanx to Jason Sullivan for sending me a ni6510 card! * lot of debug runs with ASUS SP3G Boards (Intel Saturn) by Harald Koenig * * simple performance test: (486DX-33/Ni6510-EB receives from 486DX4-100/Ni6510-EB) * average: FTP -> 8384421 bytes received in 8.5 seconds * (no RCV_VIA_SKB,no XMT_VIA_SKB,PARANOIA_CHECK,4 XMIT BUFS, 8 RCV_BUFFS) * peak: FTP -> 8384421 bytes received in 7.5 seconds * (RCV_VIA_SKB,XMT_VIA_SKB,no PARANOIA_CHECK,1(!) XMIT BUF, 16 RCV BUFFS) */ /* * 99.Jun.8: added support for /proc/net/dev byte count for xosview (HK) * 96.Sept.29: virt_to_bus stuff added for new memory modell * 96.April.29: Added Harald Koenig's Patches (MH) * 96.April.13: enhanced error handling .. more tests (MH) * 96.April.5/6: a lot of performance tests. Got it stable now (hopefully) (MH) * 96.April.1: (no joke ;) .. added EtherBlaster and Module support (MH) * 96.Feb.19: fixed a few bugs .. cleanups .. tested for 1.3.66 (MH) * hopefully no more 16MB limit * * 95.Nov.18: multicast tweaked (AC). * * 94.Aug.22: changes in xmit_intr (ack more than one xmitted-packet), ni65_send_packet (p->lock) (MH) * * 94.July.16: fixed bugs in recv_skb and skb-alloc stuff (MH) */ #include <linux/kernel.h> #include <linux/string.h> #include <linux/errno.h> #include <linux/ioport.h> #include <linux/slab.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/skbuff.h> #include <linux/module.h> #include <linux/bitops.h> #include <asm/io.h> #include <asm/dma.h> #include "ni65.h" /* * the current setting allows an acceptable performance * for 'RCV_PARANOIA_CHECK' read the 'known problems' part in * the header of this file * 'invert' the defines for max. performance. This may cause DMA problems * on some boards (e.g on my ASUS SP3G) */ #undef XMT_VIA_SKB #undef RCV_VIA_SKB #define RCV_PARANOIA_CHECK #define MID_PERFORMANCE #if defined( LOW_PERFORMANCE ) static int isa0=7,isa1=7,csr80=0x0c10; #elif defined( MID_PERFORMANCE ) static int isa0=5,isa1=5,csr80=0x2810; #else /* high performance */ static int isa0=4,isa1=4,csr80=0x0017; #endif /* * a few card/vendor specific defines */ #define NI65_ID0 0x00 #define NI65_ID1 0x55 #define NI65_EB_ID0 0x52 #define NI65_EB_ID1 0x44 #define NE2100_ID0 0x57 #define NE2100_ID1 0x57 #define PORT p->cmdr_addr /* * buffer configuration */ #if 1 #define RMDNUM 16 #define RMDNUMMASK 0x80000000 #else #define RMDNUM 8 #define RMDNUMMASK 0x60000000 /* log2(RMDNUM)<<29 */ #endif #if 0 #define TMDNUM 1 #define TMDNUMMASK 0x00000000 #else #define TMDNUM 4 #define TMDNUMMASK 0x40000000 /* log2(TMDNUM)<<29 */ #endif /* slightly oversized */ #define R_BUF_SIZE 1544 #define T_BUF_SIZE 1544 /* * lance register defines */ #define L_DATAREG 0x00 #define L_ADDRREG 0x02 #define L_RESET 0x04 #define L_CONFIG 0x05 #define L_BUSIF 0x06 /* * to access the lance/am7990-regs, you have to write * reg-number into L_ADDRREG, then you can access it using L_DATAREG */ #define CSR0 0x00 #define CSR1 0x01 #define CSR2 0x02 #define CSR3 0x03 #define INIT_RING_BEFORE_START 0x1 #define FULL_RESET_ON_ERROR 0x2 #if 0 #define writereg(val,reg) {outw(reg,PORT+L_ADDRREG);inw(PORT+L_ADDRREG); \ outw(val,PORT+L_DATAREG);inw(PORT+L_DATAREG);} #define readreg(reg) (outw(reg,PORT+L_ADDRREG),inw(PORT+L_ADDRREG),\ inw(PORT+L_DATAREG)) #if 0 #define writedatareg(val) {outw(val,PORT+L_DATAREG);inw(PORT+L_DATAREG);} #else #define writedatareg(val) { writereg(val,CSR0); } #endif #else #define writereg(val,reg) {outw(reg,PORT+L_ADDRREG);outw(val,PORT+L_DATAREG);} #define readreg(reg) (outw(reg,PORT+L_ADDRREG),inw(PORT+L_DATAREG)) #define writedatareg(val) { writereg(val,CSR0); } #endif static unsigned char ni_vendor[] = { 0x02,0x07,0x01 }; static struct card { unsigned char id0,id1; short id_offset; short total_size; short cmd_offset; short addr_offset; unsigned char *vendor_id; char *cardname; unsigned long config; } cards[] = { { .id0 = NI65_ID0, .id1 = NI65_ID1, .id_offset = 0x0e, .total_size = 0x10, .cmd_offset = 0x0, .addr_offset = 0x8, .vendor_id = ni_vendor, .cardname = "ni6510", .config = 0x1, }, { .id0 = NI65_EB_ID0, .id1 = NI65_EB_ID1, .id_offset = 0x0e, .total_size = 0x18, .cmd_offset = 0x10, .addr_offset = 0x0, .vendor_id = ni_vendor, .cardname = "ni6510 EtherBlaster", .config = 0x2, }, { .id0 = NE2100_ID0, .id1 = NE2100_ID1, .id_offset = 0x0e, .total_size = 0x18, .cmd_offset = 0x10, .addr_offset = 0x0, .vendor_id = NULL, .cardname = "generic NE2100", .config = 0x0, }, }; #define NUM_CARDS 3 struct priv { struct rmd rmdhead[RMDNUM]; struct tmd tmdhead[TMDNUM]; struct init_block ib; int rmdnum; int tmdnum,tmdlast; #ifdef RCV_VIA_SKB struct sk_buff *recv_skb[RMDNUM]; #else void *recvbounce[RMDNUM]; #endif #ifdef XMT_VIA_SKB struct sk_buff *tmd_skb[TMDNUM]; #endif void *tmdbounce[TMDNUM]; int tmdbouncenum; int lock,xmit_queued; void *self; int cmdr_addr; int cardno; int features; spinlock_t ring_lock; }; static int ni65_probe1(struct net_device *dev,int); static irqreturn_t ni65_interrupt(int irq, void * dev_id); static void ni65_recv_intr(struct net_device *dev,int); static void ni65_xmit_intr(struct net_device *dev,int); static int ni65_open(struct net_device *dev); static int ni65_lance_reinit(struct net_device *dev); static void ni65_init_lance(struct priv *p,unsigned char*,int,int); static netdev_tx_t ni65_send_packet(struct sk_buff *skb, struct net_device *dev); static void ni65_timeout(struct net_device *dev); static int ni65_close(struct net_device *dev); static int ni65_alloc_buffer(struct net_device *dev); static void ni65_free_buffer(struct priv *p); static void set_multicast_list(struct net_device *dev); static int irqtab[] __initdata = { 9,12,15,5 }; /* irq config-translate */ static int dmatab[] __initdata = { 0,3,5,6,7 }; /* dma config-translate and autodetect */ static int debuglevel = 1; /* * set 'performance' registers .. we must STOP lance for that */ static void ni65_set_performance(struct priv *p) { writereg(CSR0_STOP | CSR0_CLRALL,CSR0); /* STOP */ if( !(cards[p->cardno].config & 0x02) ) return; outw(80,PORT+L_ADDRREG); if(inw(PORT+L_ADDRREG) != 80) return; writereg( (csr80 & 0x3fff) ,80); /* FIFO watermarks */ outw(0,PORT+L_ADDRREG); outw((short)isa0,PORT+L_BUSIF); /* write ISA 0: DMA_R : isa0 * 50ns */ outw(1,PORT+L_ADDRREG); outw((short)isa1,PORT+L_BUSIF); /* write ISA 1: DMA_W : isa1 * 50ns */ outw(CSR0,PORT+L_ADDRREG); /* switch back to CSR0 */ } /* * open interface (up) */ static int ni65_open(struct net_device *dev) { struct priv *p = dev->ml_priv; int irqval = request_irq(dev->irq, ni65_interrupt,0, cards[p->cardno].cardname,dev); if (irqval) { printk(KERN_ERR "%s: unable to get IRQ %d (irqval=%d).\n", dev->name,dev->irq, irqval); return -EAGAIN; } if(ni65_lance_reinit(dev)) { netif_start_queue(dev); return 0; } else { free_irq(dev->irq,dev); return -EAGAIN; } } /* * close interface (down) */ static int ni65_close(struct net_device *dev) { struct priv *p = dev->ml_priv; netif_stop_queue(dev); outw(inw(PORT+L_RESET),PORT+L_RESET); /* that's the hard way */ #ifdef XMT_VIA_SKB { int i; for(i=0;i<TMDNUM;i++) { if(p->tmd_skb[i]) { dev_kfree_skb(p->tmd_skb[i]); p->tmd_skb[i] = NULL; } } } #endif free_irq(dev->irq,dev); return 0; } static void cleanup_card(struct net_device *dev) { struct priv *p = dev->ml_priv; disable_dma(dev->dma); free_dma(dev->dma); release_region(dev->base_addr, cards[p->cardno].total_size); ni65_free_buffer(p); } /* set: io,irq,dma or set it when calling insmod */ static int irq; static int io; static int dma; /* * Probe The Card (not the lance-chip) */ struct net_device * __init ni65_probe(int unit) { struct net_device *dev = alloc_etherdev(0); static const int ports[] = { 0x360, 0x300, 0x320, 0x340, 0 }; const int *port; int err = 0; if (!dev) return ERR_PTR(-ENOMEM); if (unit >= 0) { sprintf(dev->name, "eth%d", unit); netdev_boot_setup_check(dev); irq = dev->irq; dma = dev->dma; } else { dev->base_addr = io; } if (dev->base_addr > 0x1ff) { /* Check a single specified location. */ err = ni65_probe1(dev, dev->base_addr); } else if (dev->base_addr > 0) { /* Don't probe at all. */ err = -ENXIO; } else { for (port = ports; *port && ni65_probe1(dev, *port); port++) ; if (!*port) err = -ENODEV; } if (err) goto out; err = register_netdev(dev); if (err) goto out1; return dev; out1: cleanup_card(dev); out: free_netdev(dev); return ERR_PTR(err); } static const struct net_device_ops ni65_netdev_ops = { .ndo_open = ni65_open, .ndo_stop = ni65_close, .ndo_start_xmit = ni65_send_packet, .ndo_tx_timeout = ni65_timeout, .ndo_set_rx_mode = set_multicast_list, .ndo_change_mtu = eth_change_mtu, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, }; /* * this is the real card probe .. */ static int __init ni65_probe1(struct net_device *dev,int ioaddr) { int i,j; struct priv *p; unsigned long flags; dev->irq = irq; dev->dma = dma; for(i=0;i<NUM_CARDS;i++) { if(!request_region(ioaddr, cards[i].total_size, cards[i].cardname)) continue; if(cards[i].id_offset >= 0) { if(inb(ioaddr+cards[i].id_offset+0) != cards[i].id0 || inb(ioaddr+cards[i].id_offset+1) != cards[i].id1) { release_region(ioaddr, cards[i].total_size); continue; } } if(cards[i].vendor_id) { for(j=0;j<3;j++) if(inb(ioaddr+cards[i].addr_offset+j) != cards[i].vendor_id[j]) { release_region(ioaddr, cards[i].total_size); continue; } } break; } if(i == NUM_CARDS) return -ENODEV; for(j=0;j<6;j++) dev->dev_addr[j] = inb(ioaddr+cards[i].addr_offset+j); if( (j=ni65_alloc_buffer(dev)) < 0) { release_region(ioaddr, cards[i].total_size); return j; } p = dev->ml_priv; p->cmdr_addr = ioaddr + cards[i].cmd_offset; p->cardno = i; spin_lock_init(&p->ring_lock); printk(KERN_INFO "%s: %s found at %#3x, ", dev->name, cards[p->cardno].cardname , ioaddr); outw(inw(PORT+L_RESET),PORT+L_RESET); /* first: reset the card */ if( (j=readreg(CSR0)) != 0x4) { printk("failed.\n"); printk(KERN_ERR "%s: Can't RESET card: %04x\n", dev->name, j); ni65_free_buffer(p); release_region(ioaddr, cards[p->cardno].total_size); return -EAGAIN; } outw(88,PORT+L_ADDRREG); if(inw(PORT+L_ADDRREG) == 88) { unsigned long v; v = inw(PORT+L_DATAREG); v <<= 16; outw(89,PORT+L_ADDRREG); v |= inw(PORT+L_DATAREG); printk("Version %#08lx, ",v); p->features = INIT_RING_BEFORE_START; } else { printk("ancient LANCE, "); p->features = 0x0; } if(test_bit(0,&cards[i].config)) { dev->irq = irqtab[(inw(ioaddr+L_CONFIG)>>2)&3]; dev->dma = dmatab[inw(ioaddr+L_CONFIG)&3]; printk("IRQ %d (from card), DMA %d (from card).\n",dev->irq,dev->dma); } else { if(dev->dma == 0) { /* 'stuck test' from lance.c */ unsigned long dma_channels = ((inb(DMA1_STAT_REG) >> 4) & 0x0f) | (inb(DMA2_STAT_REG) & 0xf0); for(i=1;i<5;i++) { int dma = dmatab[i]; if(test_bit(dma,&dma_channels) || request_dma(dma,"ni6510")) continue; flags=claim_dma_lock(); disable_dma(dma); set_dma_mode(dma,DMA_MODE_CASCADE); enable_dma(dma); release_dma_lock(flags); ni65_init_lance(p,dev->dev_addr,0,0); /* trigger memory access */ flags=claim_dma_lock(); disable_dma(dma); free_dma(dma); release_dma_lock(flags); if(readreg(CSR0) & CSR0_IDON) break; } if(i == 5) { printk("failed.\n"); printk(KERN_ERR "%s: Can't detect DMA channel!\n", dev->name); ni65_free_buffer(p); release_region(ioaddr, cards[p->cardno].total_size); return -EAGAIN; } dev->dma = dmatab[i]; printk("DMA %d (autodetected), ",dev->dma); } else printk("DMA %d (assigned), ",dev->dma); if(dev->irq < 2) { unsigned long irq_mask; ni65_init_lance(p,dev->dev_addr,0,0); irq_mask = probe_irq_on(); writereg(CSR0_INIT|CSR0_INEA,CSR0); /* trigger interrupt */ msleep(20); dev->irq = probe_irq_off(irq_mask); if(!dev->irq) { printk("Failed to detect IRQ line!\n"); ni65_free_buffer(p); release_region(ioaddr, cards[p->cardno].total_size); return -EAGAIN; } printk("IRQ %d (autodetected).\n",dev->irq); } else printk("IRQ %d (assigned).\n",dev->irq); } if(request_dma(dev->dma, cards[p->cardno].cardname ) != 0) { printk(KERN_ERR "%s: Can't request dma-channel %d\n",dev->name,(int) dev->dma); ni65_free_buffer(p); release_region(ioaddr, cards[p->cardno].total_size); return -EAGAIN; } dev->base_addr = ioaddr; dev->netdev_ops = &ni65_netdev_ops; dev->watchdog_timeo = HZ/2; return 0; /* everything is OK */ } /* * set lance register and trigger init */ static void ni65_init_lance(struct priv *p,unsigned char *daddr,int filter,int mode) { int i; u32 pib; writereg(CSR0_CLRALL|CSR0_STOP,CSR0); for(i=0;i<6;i++) p->ib.eaddr[i] = daddr[i]; for(i=0;i<8;i++) p->ib.filter[i] = filter; p->ib.mode = mode; p->ib.trp = (u32) isa_virt_to_bus(p->tmdhead) | TMDNUMMASK; p->ib.rrp = (u32) isa_virt_to_bus(p->rmdhead) | RMDNUMMASK; writereg(0,CSR3); /* busmaster/no word-swap */ pib = (u32) isa_virt_to_bus(&p->ib); writereg(pib & 0xffff,CSR1); writereg(pib >> 16,CSR2); writereg(CSR0_INIT,CSR0); /* this changes L_ADDRREG to CSR0 */ for(i=0;i<32;i++) { mdelay(4); if(inw(PORT+L_DATAREG) & (CSR0_IDON | CSR0_MERR) ) break; /* init ok ? */ } } /* * allocate memory area and check the 16MB border */ static void *ni65_alloc_mem(struct net_device *dev,char *what,int size,int type) { struct sk_buff *skb=NULL; unsigned char *ptr; void *ret; if(type) { ret = skb = alloc_skb(2+16+size,GFP_KERNEL|GFP_DMA); if(!skb) { printk(KERN_WARNING "%s: unable to allocate %s memory.\n",dev->name,what); return NULL; } skb_reserve(skb,2+16); skb_put(skb,R_BUF_SIZE); /* grab the whole space .. (not necessary) */ ptr = skb->data; } else { ret = ptr = kmalloc(T_BUF_SIZE,GFP_KERNEL | GFP_DMA); if(!ret) return NULL; } if( (u32) virt_to_phys(ptr+size) > 0x1000000) { printk(KERN_WARNING "%s: unable to allocate %s memory in lower 16MB!\n",dev->name,what); if(type) kfree_skb(skb); else kfree(ptr); return NULL; } return ret; } /* * allocate all memory structures .. send/recv buffers etc ... */ static int ni65_alloc_buffer(struct net_device *dev) { unsigned char *ptr; struct priv *p; int i; /* * we need 8-aligned memory .. */ ptr = ni65_alloc_mem(dev,"BUFFER",sizeof(struct priv)+8,0); if(!ptr) return -ENOMEM; p = dev->ml_priv = (struct priv *) (((unsigned long) ptr + 7) & ~0x7); memset((char *)p, 0, sizeof(struct priv)); p->self = ptr; for(i=0;i<TMDNUM;i++) { #ifdef XMT_VIA_SKB p->tmd_skb[i] = NULL; #endif p->tmdbounce[i] = ni65_alloc_mem(dev,"XMIT",T_BUF_SIZE,0); if(!p->tmdbounce[i]) { ni65_free_buffer(p); return -ENOMEM; } } for(i=0;i<RMDNUM;i++) { #ifdef RCV_VIA_SKB p->recv_skb[i] = ni65_alloc_mem(dev,"RECV",R_BUF_SIZE,1); if(!p->recv_skb[i]) { ni65_free_buffer(p); return -ENOMEM; } #else p->recvbounce[i] = ni65_alloc_mem(dev,"RECV",R_BUF_SIZE,0); if(!p->recvbounce[i]) { ni65_free_buffer(p); return -ENOMEM; } #endif } return 0; /* everything is OK */ } /* * free buffers and private struct */ static void ni65_free_buffer(struct priv *p) { int i; if(!p) return; for(i=0;i<TMDNUM;i++) { kfree(p->tmdbounce[i]); #ifdef XMT_VIA_SKB if(p->tmd_skb[i]) dev_kfree_skb(p->tmd_skb[i]); #endif } for(i=0;i<RMDNUM;i++) { #ifdef RCV_VIA_SKB if(p->recv_skb[i]) dev_kfree_skb(p->recv_skb[i]); #else kfree(p->recvbounce[i]); #endif } kfree(p->self); } /* * stop and (re)start lance .. e.g after an error */ static void ni65_stop_start(struct net_device *dev,struct priv *p) { int csr0 = CSR0_INEA; writedatareg(CSR0_STOP); if(debuglevel > 1) printk(KERN_DEBUG "ni65_stop_start\n"); if(p->features & INIT_RING_BEFORE_START) { int i; #ifdef XMT_VIA_SKB struct sk_buff *skb_save[TMDNUM]; #endif unsigned long buffer[TMDNUM]; short blen[TMDNUM]; if(p->xmit_queued) { while(1) { if((p->tmdhead[p->tmdlast].u.s.status & XMIT_OWN)) break; p->tmdlast = (p->tmdlast + 1) & (TMDNUM-1); if(p->tmdlast == p->tmdnum) break; } } for(i=0;i<TMDNUM;i++) { struct tmd *tmdp = p->tmdhead + i; #ifdef XMT_VIA_SKB skb_save[i] = p->tmd_skb[i]; #endif buffer[i] = (u32) isa_bus_to_virt(tmdp->u.buffer); blen[i] = tmdp->blen; tmdp->u.s.status = 0x0; } for(i=0;i<RMDNUM;i++) { struct rmd *rmdp = p->rmdhead + i; rmdp->u.s.status = RCV_OWN; } p->tmdnum = p->xmit_queued = 0; writedatareg(CSR0_STRT | csr0); for(i=0;i<TMDNUM;i++) { int num = (i + p->tmdlast) & (TMDNUM-1); p->tmdhead[i].u.buffer = (u32) isa_virt_to_bus((char *)buffer[num]); /* status is part of buffer field */ p->tmdhead[i].blen = blen[num]; if(p->tmdhead[i].u.s.status & XMIT_OWN) { p->tmdnum = (p->tmdnum + 1) & (TMDNUM-1); p->xmit_queued = 1; writedatareg(CSR0_TDMD | CSR0_INEA | csr0); } #ifdef XMT_VIA_SKB p->tmd_skb[i] = skb_save[num]; #endif } p->rmdnum = p->tmdlast = 0; if(!p->lock) if (p->tmdnum || !p->xmit_queued) netif_wake_queue(dev); dev->trans_start = jiffies; /* prevent tx timeout */ } else writedatareg(CSR0_STRT | csr0); } /* * init lance (write init-values .. init-buffers) (open-helper) */ static int ni65_lance_reinit(struct net_device *dev) { int i; struct priv *p = dev->ml_priv; unsigned long flags; p->lock = 0; p->xmit_queued = 0; flags=claim_dma_lock(); disable_dma(dev->dma); /* I've never worked with dma, but we do it like the packetdriver */ set_dma_mode(dev->dma,DMA_MODE_CASCADE); enable_dma(dev->dma); release_dma_lock(flags); outw(inw(PORT+L_RESET),PORT+L_RESET); /* first: reset the card */ if( (i=readreg(CSR0) ) != 0x4) { printk(KERN_ERR "%s: can't RESET %s card: %04x\n",dev->name, cards[p->cardno].cardname,(int) i); flags=claim_dma_lock(); disable_dma(dev->dma); release_dma_lock(flags); return 0; } p->rmdnum = p->tmdnum = p->tmdlast = p->tmdbouncenum = 0; for(i=0;i<TMDNUM;i++) { struct tmd *tmdp = p->tmdhead + i; #ifdef XMT_VIA_SKB if(p->tmd_skb[i]) { dev_kfree_skb(p->tmd_skb[i]); p->tmd_skb[i] = NULL; } #endif tmdp->u.buffer = 0x0; tmdp->u.s.status = XMIT_START | XMIT_END; tmdp->blen = tmdp->status2 = 0; } for(i=0;i<RMDNUM;i++) { struct rmd *rmdp = p->rmdhead + i; #ifdef RCV_VIA_SKB rmdp->u.buffer = (u32) isa_virt_to_bus(p->recv_skb[i]->data); #else rmdp->u.buffer = (u32) isa_virt_to_bus(p->recvbounce[i]); #endif rmdp->blen = -(R_BUF_SIZE-8); rmdp->mlen = 0; rmdp->u.s.status = RCV_OWN; } if(dev->flags & IFF_PROMISC) ni65_init_lance(p,dev->dev_addr,0x00,M_PROM); else if (netdev_mc_count(dev) || dev->flags & IFF_ALLMULTI) ni65_init_lance(p,dev->dev_addr,0xff,0x0); else ni65_init_lance(p,dev->dev_addr,0x00,0x00); /* * ni65_set_lance_mem() sets L_ADDRREG to CSR0 * NOW, WE WILL NEVER CHANGE THE L_ADDRREG, CSR0 IS ALWAYS SELECTED */ if(inw(PORT+L_DATAREG) & CSR0_IDON) { ni65_set_performance(p); /* init OK: start lance , enable interrupts */ writedatareg(CSR0_CLRALL | CSR0_INEA | CSR0_STRT); return 1; /* ->OK */ } printk(KERN_ERR "%s: can't init lance, status: %04x\n",dev->name,(int) inw(PORT+L_DATAREG)); flags=claim_dma_lock(); disable_dma(dev->dma); release_dma_lock(flags); return 0; /* ->Error */ } /* * interrupt handler */ static irqreturn_t ni65_interrupt(int irq, void * dev_id) { int csr0 = 0; struct net_device *dev = dev_id; struct priv *p; int bcnt = 32; p = dev->ml_priv; spin_lock(&p->ring_lock); while(--bcnt) { csr0 = inw(PORT+L_DATAREG); #if 0 writedatareg( (csr0 & CSR0_CLRALL) ); /* ack interrupts, disable int. */ #else writedatareg( (csr0 & CSR0_CLRALL) | CSR0_INEA ); /* ack interrupts, interrupts enabled */ #endif if(!(csr0 & (CSR0_ERR | CSR0_RINT | CSR0_TINT))) break; if(csr0 & CSR0_RINT) /* RECV-int? */ ni65_recv_intr(dev,csr0); if(csr0 & CSR0_TINT) /* XMIT-int? */ ni65_xmit_intr(dev,csr0); if(csr0 & CSR0_ERR) { if(debuglevel > 1) printk(KERN_ERR "%s: general error: %04x.\n",dev->name,csr0); if(csr0 & CSR0_BABL) dev->stats.tx_errors++; if(csr0 & CSR0_MISS) { int i; for(i=0;i<RMDNUM;i++) printk("%02x ",p->rmdhead[i].u.s.status); printk("\n"); dev->stats.rx_errors++; } if(csr0 & CSR0_MERR) { if(debuglevel > 1) printk(KERN_ERR "%s: Ooops .. memory error: %04x.\n",dev->name,csr0); ni65_stop_start(dev,p); } } } #ifdef RCV_PARANOIA_CHECK { int j; for(j=0;j<RMDNUM;j++) { int i, num2; for(i=RMDNUM-1;i>0;i--) { num2 = (p->rmdnum + i) & (RMDNUM-1); if(!(p->rmdhead[num2].u.s.status & RCV_OWN)) break; } if(i) { int k, num1; for(k=0;k<RMDNUM;k++) { num1 = (p->rmdnum + k) & (RMDNUM-1); if(!(p->rmdhead[num1].u.s.status & RCV_OWN)) break; } if(!k) break; if(debuglevel > 0) { char buf[256],*buf1; buf1 = buf; for(k=0;k<RMDNUM;k++) { sprintf(buf1,"%02x ",(p->rmdhead[k].u.s.status)); /* & RCV_OWN) ); */ buf1 += 3; } *buf1 = 0; printk(KERN_ERR "%s: Ooops, receive ring corrupted %2d %2d | %s\n",dev->name,p->rmdnum,i,buf); } p->rmdnum = num1; ni65_recv_intr(dev,csr0); if((p->rmdhead[num2].u.s.status & RCV_OWN)) break; /* ok, we are 'in sync' again */ } else break; } } #endif if( (csr0 & (CSR0_RXON | CSR0_TXON)) != (CSR0_RXON | CSR0_TXON) ) { printk(KERN_DEBUG "%s: RX or TX was offline -> restart\n",dev->name); ni65_stop_start(dev,p); } else writedatareg(CSR0_INEA); spin_unlock(&p->ring_lock); return IRQ_HANDLED; } /* * We have received an Xmit-Interrupt .. * send a new packet if necessary */ static void ni65_xmit_intr(struct net_device *dev,int csr0) { struct priv *p = dev->ml_priv; while(p->xmit_queued) { struct tmd *tmdp = p->tmdhead + p->tmdlast; int tmdstat = tmdp->u.s.status; if(tmdstat & XMIT_OWN) break; if(tmdstat & XMIT_ERR) { #if 0 if(tmdp->status2 & XMIT_TDRMASK && debuglevel > 3) printk(KERN_ERR "%s: tdr-problems (e.g. no resistor)\n",dev->name); #endif /* checking some errors */ if(tmdp->status2 & XMIT_RTRY) dev->stats.tx_aborted_errors++; if(tmdp->status2 & XMIT_LCAR) dev->stats.tx_carrier_errors++; if(tmdp->status2 & (XMIT_BUFF | XMIT_UFLO )) { /* this stops the xmitter */ dev->stats.tx_fifo_errors++; if(debuglevel > 0) printk(KERN_ERR "%s: Xmit FIFO/BUFF error\n",dev->name); if(p->features & INIT_RING_BEFORE_START) { tmdp->u.s.status = XMIT_OWN | XMIT_START | XMIT_END; /* test: resend this frame */ ni65_stop_start(dev,p); break; /* no more Xmit processing .. */ } else ni65_stop_start(dev,p); } if(debuglevel > 2) printk(KERN_ERR "%s: xmit-error: %04x %02x-%04x\n",dev->name,csr0,(int) tmdstat,(int) tmdp->status2); if(!(csr0 & CSR0_BABL)) /* don't count errors twice */ dev->stats.tx_errors++; tmdp->status2 = 0; } else { dev->stats.tx_bytes -= (short)(tmdp->blen); dev->stats.tx_packets++; } #ifdef XMT_VIA_SKB if(p->tmd_skb[p->tmdlast]) { dev_kfree_skb_irq(p->tmd_skb[p->tmdlast]); p->tmd_skb[p->tmdlast] = NULL; } #endif p->tmdlast = (p->tmdlast + 1) & (TMDNUM-1); if(p->tmdlast == p->tmdnum) p->xmit_queued = 0; } netif_wake_queue(dev); } /* * We have received a packet */ static void ni65_recv_intr(struct net_device *dev,int csr0) { struct rmd *rmdp; int rmdstat,len; int cnt=0; struct priv *p = dev->ml_priv; rmdp = p->rmdhead + p->rmdnum; while(!( (rmdstat = rmdp->u.s.status) & RCV_OWN)) { cnt++; if( (rmdstat & (RCV_START | RCV_END | RCV_ERR)) != (RCV_START | RCV_END) ) /* error or oversized? */ { if(!(rmdstat & RCV_ERR)) { if(rmdstat & RCV_START) { dev->stats.rx_length_errors++; printk(KERN_ERR "%s: recv, packet too long: %d\n",dev->name,rmdp->mlen & 0x0fff); } } else { if(debuglevel > 2) printk(KERN_ERR "%s: receive-error: %04x, lance-status: %04x/%04x\n", dev->name,(int) rmdstat,csr0,(int) inw(PORT+L_DATAREG) ); if(rmdstat & RCV_FRAM) dev->stats.rx_frame_errors++; if(rmdstat & RCV_OFLO) dev->stats.rx_over_errors++; if(rmdstat & RCV_CRC) dev->stats.rx_crc_errors++; if(rmdstat & RCV_BUF_ERR) dev->stats.rx_fifo_errors++; } if(!(csr0 & CSR0_MISS)) /* don't count errors twice */ dev->stats.rx_errors++; } else if( (len = (rmdp->mlen & 0x0fff) - 4) >= 60) { #ifdef RCV_VIA_SKB struct sk_buff *skb = alloc_skb(R_BUF_SIZE+2+16,GFP_ATOMIC); if (skb) skb_reserve(skb,16); #else struct sk_buff *skb = netdev_alloc_skb(dev, len + 2); #endif if(skb) { skb_reserve(skb,2); #ifdef RCV_VIA_SKB if( (unsigned long) (skb->data + R_BUF_SIZE) > 0x1000000) { skb_put(skb,len); skb_copy_to_linear_data(skb, (unsigned char *)(p->recv_skb[p->rmdnum]->data),len); } else { struct sk_buff *skb1 = p->recv_skb[p->rmdnum]; skb_put(skb,R_BUF_SIZE); p->recv_skb[p->rmdnum] = skb; rmdp->u.buffer = (u32) isa_virt_to_bus(skb->data); skb = skb1; skb_trim(skb,len); } #else skb_put(skb,len); skb_copy_to_linear_data(skb, (unsigned char *) p->recvbounce[p->rmdnum],len); #endif dev->stats.rx_packets++; dev->stats.rx_bytes += len; skb->protocol=eth_type_trans(skb,dev); netif_rx(skb); } else { printk(KERN_ERR "%s: can't alloc new sk_buff\n",dev->name); dev->stats.rx_dropped++; } } else { printk(KERN_INFO "%s: received runt packet\n",dev->name); dev->stats.rx_errors++; } rmdp->blen = -(R_BUF_SIZE-8); rmdp->mlen = 0; rmdp->u.s.status = RCV_OWN; /* change owner */ p->rmdnum = (p->rmdnum + 1) & (RMDNUM-1); rmdp = p->rmdhead + p->rmdnum; } } /* * kick xmitter .. */ static void ni65_timeout(struct net_device *dev) { int i; struct priv *p = dev->ml_priv; printk(KERN_ERR "%s: xmitter timed out, try to restart!\n",dev->name); for(i=0;i<TMDNUM;i++) printk("%02x ",p->tmdhead[i].u.s.status); printk("\n"); ni65_lance_reinit(dev); dev->trans_start = jiffies; /* prevent tx timeout */ netif_wake_queue(dev); } /* * Send a packet */ static netdev_tx_t ni65_send_packet(struct sk_buff *skb, struct net_device *dev) { struct priv *p = dev->ml_priv; netif_stop_queue(dev); if (test_and_set_bit(0, (void*)&p->lock)) { printk(KERN_ERR "%s: Queue was locked.\n", dev->name); return NETDEV_TX_BUSY; } { short len = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; struct tmd *tmdp; unsigned long flags; #ifdef XMT_VIA_SKB if( (unsigned long) (skb->data + skb->len) > 0x1000000) { #endif skb_copy_from_linear_data(skb, p->tmdbounce[p->tmdbouncenum], skb->len > T_BUF_SIZE ? T_BUF_SIZE : skb->len); if (len > skb->len) memset((char *)p->tmdbounce[p->tmdbouncenum]+skb->len, 0, len-skb->len); dev_kfree_skb (skb); spin_lock_irqsave(&p->ring_lock, flags); tmdp = p->tmdhead + p->tmdnum; tmdp->u.buffer = (u32) isa_virt_to_bus(p->tmdbounce[p->tmdbouncenum]); p->tmdbouncenum = (p->tmdbouncenum + 1) & (TMDNUM - 1); #ifdef XMT_VIA_SKB } else { spin_lock_irqsave(&p->ring_lock, flags); tmdp = p->tmdhead + p->tmdnum; tmdp->u.buffer = (u32) isa_virt_to_bus(skb->data); p->tmd_skb[p->tmdnum] = skb; } #endif tmdp->blen = -len; tmdp->u.s.status = XMIT_OWN | XMIT_START | XMIT_END; writedatareg(CSR0_TDMD | CSR0_INEA); /* enable xmit & interrupt */ p->xmit_queued = 1; p->tmdnum = (p->tmdnum + 1) & (TMDNUM-1); if(p->tmdnum != p->tmdlast) netif_wake_queue(dev); p->lock = 0; spin_unlock_irqrestore(&p->ring_lock, flags); } return NETDEV_TX_OK; } static void set_multicast_list(struct net_device *dev) { if(!ni65_lance_reinit(dev)) printk(KERN_ERR "%s: Can't switch card into MC mode!\n",dev->name); netif_wake_queue(dev); } #ifdef MODULE static struct net_device *dev_ni65; module_param(irq, int, 0); module_param(io, int, 0); module_param(dma, int, 0); MODULE_PARM_DESC(irq, "ni6510 IRQ number (ignored for some cards)"); MODULE_PARM_DESC(io, "ni6510 I/O base address"); MODULE_PARM_DESC(dma, "ni6510 ISA DMA channel (ignored for some cards)"); int __init init_module(void) { dev_ni65 = ni65_probe(-1); return PTR_ERR_OR_ZERO(dev_ni65); } void __exit cleanup_module(void) { unregister_netdev(dev_ni65); cleanup_card(dev_ni65); free_netdev(dev_ni65); } #endif /* MODULE */ MODULE_LICENSE("GPL");
{ "pile_set_name": "Github" }
// DIE's signature file init("packer","nPack"); function detect(bShowType,bShowVersion,bShowOptions) { if(PE.compareEP("833D..........7505E901000000C3E841000000B8........2B05........A3........E85E000000E8")) { switch(PE.getEPSignature(42,7)) { case "E0010000E8EC06": sVersion="1.1.150.2006.Beta"; break; case "EC010000E8F806": sVersion="1.1.200.2006.Beta"; break; default: sVersion="1.1.xxx"; } bDetected=1; } else if(PE.compareEP("833D..........7505E901000000C3E846000000E873000000B8........2B05........A3........E89C000000E8")) { switch(PE.readDword(PE.nEP+47)) { case 0x204: sVersion="1.1.250.2006.Beta"; break; case 0x22D: sVersion="1.1.300.2006.Beta"; break; case 0x248: sVersion="1.1.800.2008.Beta"; break; default: sVersion="1.1.xxx"; } bDetected=1; } return result(bShowType,bShowVersion,bShowOptions); }
{ "pile_set_name": "Github" }
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "fm", "em" ], "DAY": [ "s\u00f6ndag", "m\u00e5ndag", "tisdag", "onsdag", "torsdag", "fredag", "l\u00f6rdag" ], "ERANAMES": [ "f\u00f6re Kristus", "efter Kristus" ], "ERAS": [ "f.Kr.", "e.Kr." ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december" ], "SHORTDAY": [ "s\u00f6n", "m\u00e5n", "tis", "ons", "tors", "fre", "l\u00f6r" ], "SHORTMONTH": [ "jan.", "feb.", "mars", "apr.", "maj", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec." ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y HH:mm:ss", "mediumDate": "d MMM y", "mediumTime": "HH:mm:ss", "short": "y-MM-dd HH:mm", "shortDate": "y-MM-dd", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "kr", "DECIMAL_SEP": ",", "GROUP_SEP": "\u00a0", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-", "negSuf": "\u00a0\u00a4", "posPre": "", "posSuf": "\u00a0\u00a4" } ] }, "id": "sv-se", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
{ "pile_set_name": "Github" }
// Copyright (c) 2008, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // --- // Author: Ken Ashcraft <opensource@google.com> #include "config.h" #include "thread_cache.h" #include <errno.h> #include <string.h> // for memcpy #include <algorithm> // for max, min #include "base/commandlineflags.h" // for SpinLockHolder #include "base/spinlock.h" // for Spin LockHolder #include "central_freelist.h" // for CentralFreeListPadded #include "maybe_threads.h" using std::min; using std::max; namespace TCMALLOC_NAMESPACE { DEFINE_int64(tcmalloc_max_total_thread_cache_bytes, EnvToInt64("TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES", kDefaultOverallThreadCacheSize), "Bound on the total amount of bytes allocated to " "thread caches. This bound is not strict, so it is possible " "for the cache to go over this bound in certain circumstances. " "Maximum value of this flag is capped to 1 GB."); } namespace TCMALLOC_NAMESPACE { static bool phinited = false; volatile size_t ThreadCache::per_thread_cache_size_ = kMaxThreadCacheSize; size_t ThreadCache::overall_thread_cache_size_ = kDefaultOverallThreadCacheSize; ssize_t ThreadCache::unclaimed_cache_space_ = kDefaultOverallThreadCacheSize; PageHeapAllocator<ThreadCache> threadcache_allocator; ThreadCache* ThreadCache::thread_heaps_ = NULL; int ThreadCache::thread_heap_count_ = 0; ThreadCache* ThreadCache::next_memory_steal_ = NULL; #ifdef HAVE_TLS __thread ThreadCache::ThreadLocalData ThreadCache::threadlocal_data_ ATTR_INITIAL_EXEC = {0, 0}; #endif bool ThreadCache::tsd_inited_ = false; pthread_key_t ThreadCache::heap_key_; #if defined(HAVE_TLS) bool kernel_supports_tls = false; // be conservative # if defined(_WIN32) // windows has supported TLS since winnt, I think. void CheckIfKernelSupportsTLS() { kernel_supports_tls = true; } # elif !HAVE_DECL_UNAME // if too old for uname, probably too old for TLS void CheckIfKernelSupportsTLS() { kernel_supports_tls = false; } # else # include <sys/utsname.h> // DECL_UNAME checked for <sys/utsname.h> too void CheckIfKernelSupportsTLS() { struct utsname buf; if (uname(&buf) < 0) { // should be impossible Log(kLog, __FILE__, __LINE__, "uname failed assuming no TLS support (errno)", errno); kernel_supports_tls = false; } else if (strcasecmp(buf.sysname, "linux") == 0) { // The linux case: the first kernel to support TLS was 2.6.0 if (buf.release[0] < '2' && buf.release[1] == '.') // 0.x or 1.x kernel_supports_tls = false; else if (buf.release[0] == '2' && buf.release[1] == '.' && buf.release[2] >= '0' && buf.release[2] < '6' && buf.release[3] == '.') // 2.0 - 2.5 kernel_supports_tls = false; else kernel_supports_tls = true; } else if (strcasecmp(buf.sysname, "CYGWIN_NT-6.1-WOW64") == 0) { // In my testing, this version of cygwin, at least, would hang // when using TLS. kernel_supports_tls = false; } else { // some other kernel, we'll be optimisitic kernel_supports_tls = true; } // TODO(csilvers): VLOG(1) the tls status once we support RAW_VLOG } # endif // HAVE_DECL_UNAME #endif // HAVE_TLS void ThreadCache::Init(pthread_t tid) { size_ = 0; requested_bytes_ = 0; max_size_ = 0; IncreaseCacheLimitLocked(); if (max_size_ == 0) { // There isn't enough memory to go around. Just give the minimum to // this thread. max_size_ = kMinThreadCacheSize; // Take unclaimed_cache_space_ negative. unclaimed_cache_space_ -= kMinThreadCacheSize; ASSERT(unclaimed_cache_space_ < 0); } next_ = NULL; prev_ = NULL; tid_ = tid; in_setspecific_ = false; for (size_t cl = 0; cl < kNumClasses; ++cl) { list_[cl].Init(); } uint32_t sampler_seed; memcpy(&sampler_seed, &tid, sizeof(sampler_seed)); sampler_.Init(sampler_seed); } void ThreadCache::Cleanup() { // Put unused memory back into central cache for (int cl = 0; cl < kNumClasses; ++cl) { if (list_[cl].length() > 0) { ReleaseToCentralCache(&list_[cl], cl, list_[cl].length()); } } } // Remove some objects of class "cl" from central cache and add to thread heap. // On success, return the first object for immediate use; otherwise return NULL. void* ThreadCache::FetchFromCentralCache(size_t cl, size_t byte_size) { FreeList* list = &list_[cl]; ASSERT(list->empty()); const int batch_size = Static::sizemap()->num_objects_to_move(cl); const int num_to_move = min<int>(list->max_length(), batch_size); void *start, *end; int fetch_count = Static::central_cache()[cl].RemoveRange( &start, &end, num_to_move); ASSERT((start == NULL) == (fetch_count == 0)); if (--fetch_count >= 0) { size_ += byte_size * fetch_count; list->PushRange(fetch_count, SLL_Next(start), end); } // Increase max length slowly up to batch_size. After that, // increase by batch_size in one shot so that the length is a // multiple of batch_size. if (list->max_length() < batch_size) { list->set_max_length(list->max_length() + 1); } else { // Don't let the list get too long. In 32 bit builds, the length // is represented by a 16 bit int, so we need to watch out for // integer overflow. int new_length = min<int>(list->max_length() + batch_size, kMaxDynamicFreeListLength); // The list's max_length must always be a multiple of batch_size, // and kMaxDynamicFreeListLength is not necessarily a multiple // of batch_size. new_length -= new_length % batch_size; ASSERT(new_length % batch_size == 0); list->set_max_length(new_length); } return start; } void ThreadCache::ListTooLong(FreeList* list, size_t cl) { const int batch_size = Static::sizemap()->num_objects_to_move(cl); ReleaseToCentralCache(list, cl, batch_size); // If the list is too long, we need to transfer some number of // objects to the central cache. Ideally, we would transfer // num_objects_to_move, so the code below tries to make max_length // converge on num_objects_to_move. if (list->max_length() < batch_size) { // Slow start the max_length so we don't overreserve. list->set_max_length(list->max_length() + 1); } else if (list->max_length() > batch_size) { // If we consistently go over max_length, shrink max_length. If we don't // shrink it, some amount of memory will always stay in this freelist. list->set_length_overages(list->length_overages() + 1); if (list->length_overages() > kMaxOverages) { ASSERT(list->max_length() > batch_size); list->set_max_length(list->max_length() - batch_size); list->set_length_overages(0); } } } // Remove some objects of class "cl" from thread heap and add to central cache void ThreadCache::ReleaseToCentralCache(FreeList* src, size_t cl, int N) { ASSERT(src == &list_[cl]); if (N > src->length()) N = src->length(); size_t delta_bytes = N * Static::sizemap()->ByteSizeForClass(cl); // We return prepackaged chains of the correct size to the central cache. // TODO: Use the same format internally in the thread caches? int batch_size = Static::sizemap()->num_objects_to_move(cl); while (N > batch_size) { void *tail, *head; src->PopRange(batch_size, &head, &tail); Static::central_cache()[cl].InsertRange(head, tail, batch_size); N -= batch_size; } void *tail, *head; src->PopRange(N, &head, &tail); Static::central_cache()[cl].InsertRange(head, tail, N); size_ -= delta_bytes; } // Release idle memory to the central cache void ThreadCache::Scavenge() { // If the low-water mark for the free list is L, it means we would // not have had to allocate anything from the central cache even if // we had reduced the free list size by L. We aim to get closer to // that situation by dropping L/2 nodes from the free list. This // may not release much memory, but if so we will call scavenge again // pretty soon and the low-water marks will be high on that call. //int64 start = CycleClock::Now(); for (int cl = 0; cl < kNumClasses; cl++) { FreeList* list = &list_[cl]; const int lowmark = list->lowwatermark(); if (lowmark > 0) { const int drop = (lowmark > 1) ? lowmark/2 : 1; ReleaseToCentralCache(list, cl, drop); // Shrink the max length if it isn't used. Only shrink down to // batch_size -- if the thread was active enough to get the max_length // above batch_size, it will likely be that active again. If // max_length shinks below batch_size, the thread will have to // go through the slow-start behavior again. The slow-start is useful // mainly for threads that stay relatively idle for their entire // lifetime. const int batch_size = Static::sizemap()->num_objects_to_move(cl); if (list->max_length() > batch_size) { list->set_max_length( max<int>(list->max_length() - batch_size, batch_size)); } } list->clear_lowwatermark(); } IncreaseCacheLimit(); } int ThreadCache::FreeList::gListCount = 0; void ThreadCache::ForceScavenge() { //BCF- this is added for releasing of the GC free list into the central heap. // We don't want the GC free list to be hoarding memory since it never // allocates anything -- only the mutators do int frees = 0; for (int cl = 0; cl < kNumClasses; cl++) { FreeList* list = &list_[cl]; frees += list->length(); ReleaseToCentralCache(list, cl, list->length()); } printf("Frees: %d Lists: %d\n", frees, ThreadCache::FreeList::gListCount); } void ThreadCache::IncreaseCacheLimit() { SpinLockHolder h(Static::pageheap_lock()); IncreaseCacheLimitLocked(); } void ThreadCache::IncreaseCacheLimitLocked() { if (unclaimed_cache_space_ > 0) { // Possibly make unclaimed_cache_space_ negative. unclaimed_cache_space_ -= kStealAmount; max_size_ += kStealAmount; return; } // Don't hold pageheap_lock too long. Try to steal from 10 other // threads before giving up. The i < 10 condition also prevents an // infinite loop in case none of the existing thread heaps are // suitable places to steal from. for (int i = 0; i < 10; ++i, next_memory_steal_ = next_memory_steal_->next_) { // Reached the end of the linked list. Start at the beginning. if (next_memory_steal_ == NULL) { ASSERT(thread_heaps_ != NULL); next_memory_steal_ = thread_heaps_; } if (next_memory_steal_ == this || next_memory_steal_->max_size_ <= kMinThreadCacheSize) { continue; } next_memory_steal_->max_size_ -= kStealAmount; max_size_ += kStealAmount; next_memory_steal_ = next_memory_steal_->next_; return; } } int ThreadCache::GetSamplePeriod() { return sampler_.GetSamplePeriod(); } void ThreadCache::InitModule() { SpinLockHolder h(Static::pageheap_lock()); if (!phinited) { Static::InitStaticVars(); threadcache_allocator.Init(); phinited = 1; } } void ThreadCache::InitTSD() { ASSERT(!tsd_inited_); perftools_pthread_key_create(&heap_key_, DestroyThreadCache); tsd_inited_ = true; #ifdef PTHREADS_CRASHES_IF_RUN_TOO_EARLY // We may have used a fake pthread_t for the main thread. Fix it. pthread_t zero; memset(&zero, 0, sizeof(zero)); SpinLockHolder h(Static::pageheap_lock()); for (ThreadCache* h = thread_heaps_; h != NULL; h = h->next_) { if (h->tid_ == zero) { h->tid_ = pthread_self(); } } #endif } ThreadCache* ThreadCache::CreateCacheIfNecessary() { // Initialize per-thread data if necessary ThreadCache* heap = NULL; { SpinLockHolder h(Static::pageheap_lock()); // On some old glibc's, and on freebsd's libc (as of freebsd 8.1), // calling pthread routines (even pthread_self) too early could // cause a segfault. Since we can call pthreads quite early, we // have to protect against that in such situations by making a // 'fake' pthread. This is not ideal since it doesn't work well // when linking tcmalloc statically with apps that create threads // before main, so we only do it if we have to. #ifdef PTHREADS_CRASHES_IF_RUN_TOO_EARLY pthread_t me; if (!tsd_inited_) { memset(&me, 0, sizeof(me)); } else { me = pthread_self(); } #else const pthread_t me = perftools_pthread_self(); #endif // This may be a recursive malloc call from pthread_setspecific() // In that case, the heap for this thread has already been created // and added to the linked list. So we search for that first. for (ThreadCache* h = thread_heaps_; h != NULL; h = h->next_) { if (h->tid_ == me) { heap = h; break; } } if (heap == NULL) heap = NewHeap(me); } // We call pthread_setspecific() outside the lock because it may // call malloc() recursively. We check for the recursive call using // the "in_setspecific_" flag so that we can avoid calling // pthread_setspecific() if we are already inside pthread_setspecific(). if (!heap->in_setspecific_ && tsd_inited_) { heap->in_setspecific_ = true; perftools_pthread_setspecific(heap_key_, heap); #ifdef HAVE_TLS // Also keep a copy in __thread for faster retrieval threadlocal_data_.heap = heap; SetMinSizeForSlowPath(kMaxSize + 1); #endif heap->in_setspecific_ = false; } return heap; } ThreadCache* ThreadCache::NewHeap(pthread_t tid) { // Create the heap and add it to the linked list ThreadCache *heap = threadcache_allocator.New(); heap->Init(tid); heap->next_ = thread_heaps_; heap->prev_ = NULL; if (thread_heaps_ != NULL) { thread_heaps_->prev_ = heap; } else { // This is the only thread heap at the momment. ASSERT(next_memory_steal_ == NULL); next_memory_steal_ = heap; } thread_heaps_ = heap; thread_heap_count_++; return heap; } void ThreadCache::BecomeIdle() { if (!tsd_inited_) return; // No caches yet ThreadCache* heap = GetThreadHeap(); if (heap == NULL) return; // No thread cache to remove if (heap->in_setspecific_) return; // Do not disturb the active caller heap->in_setspecific_ = true; perftools_pthread_setspecific(heap_key_, NULL); #ifdef HAVE_TLS // Also update the copy in __thread threadlocal_data_.heap = NULL; SetMinSizeForSlowPath(0); #endif heap->in_setspecific_ = false; if (GetThreadHeap() == heap) { // Somehow heap got reinstated by a recursive call to malloc // from pthread_setspecific. We give up in this case. return; } // We can now get rid of the heap DeleteCache(heap); } void ThreadCache::DestroyThreadCache(void* ptr) { // Note that "ptr" cannot be NULL since pthread promises not // to invoke the destructor on NULL values, but for safety, // we check anyway. if (ptr == NULL) return; #ifdef HAVE_TLS // Prevent fast path of GetThreadHeap() from returning heap. threadlocal_data_.heap = NULL; SetMinSizeForSlowPath(0); #endif DeleteCache(reinterpret_cast<ThreadCache*>(ptr)); } void ThreadCache::DeleteCache(ThreadCache* heap) { // Remove all memory from heap heap->Cleanup(); // Remove from linked list SpinLockHolder h(Static::pageheap_lock()); if (heap->next_ != NULL) heap->next_->prev_ = heap->prev_; if (heap->prev_ != NULL) heap->prev_->next_ = heap->next_; if (thread_heaps_ == heap) thread_heaps_ = heap->next_; thread_heap_count_--; if (next_memory_steal_ == heap) next_memory_steal_ = heap->next_; if (next_memory_steal_ == NULL) next_memory_steal_ = thread_heaps_; unclaimed_cache_space_ += heap->max_size_; threadcache_allocator.Delete(heap); } void ThreadCache::RecomputePerThreadCacheSize() { // Divide available space across threads int n = thread_heap_count_ > 0 ? thread_heap_count_ : 1; size_t space = overall_thread_cache_size_ / n; // Limit to allowed range if (space < kMinThreadCacheSize) space = kMinThreadCacheSize; if (space > kMaxThreadCacheSize) space = kMaxThreadCacheSize; double ratio = space / max<double>(1, per_thread_cache_size_); size_t claimed = 0; for (ThreadCache* h = thread_heaps_; h != NULL; h = h->next_) { // Increasing the total cache size should not circumvent the // slow-start growth of max_size_. if (ratio < 1.0) { h->max_size_ = static_cast<size_t>(h->max_size_ * ratio); } claimed += h->max_size_; } unclaimed_cache_space_ = overall_thread_cache_size_ - claimed; per_thread_cache_size_ = space; } void ThreadCache::GetThreadStats(uint64_t* total_bytes, uint64_t* class_count) { for (ThreadCache* h = thread_heaps_; h != NULL; h = h->next_) { *total_bytes += h->Size(); if (class_count) { for (int cl = 0; cl < kNumClasses; ++cl) { class_count[cl] += h->freelist_length(cl); } } } } void ThreadCache::set_overall_thread_cache_size(size_t new_size) { // Clip the value to a reasonable range if (new_size < kMinThreadCacheSize) new_size = kMinThreadCacheSize; if (new_size > (1<<30)) new_size = (1<<30); // Limit to 1GB overall_thread_cache_size_ = new_size; RecomputePerThreadCacheSize(); } } // namespace TCMALLOC_NAMESPACE
{ "pile_set_name": "Github" }
# USER ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **INTEGER_64** | | [optional] [default to null] **username** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] **first_name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] **last_name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] **email** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] **password** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] **phone** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] **user_status** | **INTEGER_32** | User Status | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
{ "pile_set_name": "Github" }
/* * This file is part of the SDWebImage package. * (c) Olivier Poitrey <rs@dailymotion.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #import <UIKit/UIKit.h> #import "SDWebImageCompat.h" #import "SDWebImageManager.h" /** * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. */ @interface UIImageView (HighlightedWebCache) /** * Set the imageView `highlightedImage` with an `url`. * * The download is asynchronous and cached. * * @param url The url for the image. */ - (void)sd_setHighlightedImageWithURL:(NSURL *)url; /** * Set the imageView `highlightedImage` with an `url` and custom options. * * The download is asynchronous and cached. * * @param url The url for the image. * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. */ - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options; /** * Set the imageView `highlightedImage` with an `url`. * * The download is asynchronous and cached. * * @param url The url for the image. * @param completedBlock A block called when operation has been completed. This block has no return value * and takes the requested UIImage as first parameter. In case of error the image parameter * is nil and the second parameter may contain an NSError. The third parameter is a Boolean * indicating if the image was retrieved from the local cache or from the network. * The fourth parameter is the original image url. */ - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; /** * Set the imageView `highlightedImage` with an `url` and custom options. * * The download is asynchronous and cached. * * @param url The url for the image. * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. * @param completedBlock A block called when operation has been completed. This block has no return value * and takes the requested UIImage as first parameter. In case of error the image parameter * is nil and the second parameter may contain an NSError. The third parameter is a Boolean * indicating if the image was retrieved from the local cache or from the network. * The fourth parameter is the original image url. */ - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; /** * Set the imageView `highlightedImage` with an `url` and custom options. * * The download is asynchronous and cached. * * @param url The url for the image. * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. * @param progressBlock A block called while image is downloading * @param completedBlock A block called when operation has been completed. This block has no return value * and takes the requested UIImage as first parameter. In case of error the image parameter * is nil and the second parameter may contain an NSError. The third parameter is a Boolean * indicating if the image was retrieved from the local cache or from the network. * The fourth parameter is the original image url. */ - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; /** * Cancel the current download */ - (void)sd_cancelCurrentHighlightedImageLoad; @end @interface UIImageView (HighlightedWebCacheDeprecated) - (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`"); - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`"); - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`"); - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`"); - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`"); - (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`"); @end
{ "pile_set_name": "Github" }
// // NSObject+GICEvent.m // GICXMLLayout // // Created by gonghaiwei on 2018/7/8. // #import "NSObject+GICEvent.h" @implementation NSObject (GICEvent) -(GICEvent *)gic_event_addEvent:(GICEvent *)event{ if(event.onlyExistOne){ for(GICBehavior *b in self.gic_Behaviors.behaviors){ if(b.class == event.class){ return (GICEvent *)b; } } } [self gic_addBehavior:event]; return event; } -(GICEvent *)gic_event_findFirstWithEventClass:(Class)eventType{ GICBehavior *b = [self.gic_Behaviors findFirstWithBehaviorClass:eventType]; if([b isKindOfClass:[GICEvent class]]){ return (GICEvent *)b; } return nil; } -(GICEvent *)gic_event_findFirstWithEventClassOrCreate:(Class)eventType{ GICEvent *e = [self gic_event_findFirstWithEventClass:eventType]; if(e==nil){ e = [[eventType alloc] initWithExpresion:nil withEventName:nil]; [self gic_event_addEvent:e]; if(e.target==nil){ GICPerformBlockOnElementQueue(^{ [e attachTo:self]; }); } } return e; } -(GICEvent *)gic_event_findWithEventName:(NSString *)eventName{ GICBehavior *b = [self.gic_Behaviors findWithBehaviorName:eventName]; if([b isKindOfClass:[GICEvent class]]){ return (GICEvent *)b; } return nil; } -(GICEvent *)gic_event_findFirstWithEventNameOrCreate:(NSString *)eventName{ GICEvent *e = [self gic_event_findWithEventName:eventName]; if(e==nil){ GICAttributeValueConverter *p = [GICElementsCache classAttributs:[self class]][eventName]; if(p){ p.propertySetter(self, nil); e = [self gic_event_findWithEventName:eventName]; [self gic_event_addEvent:e]; if(e.target==nil){ GICPerformBlockOnElementQueue(^{ [e attachTo:self]; }); } } } return e; } @end
{ "pile_set_name": "Github" }
#!/bin/bash VIM_ROOT=$HOME/.vim RANDOM_NR=`shuf -i 1000-90000 -n 1` INSTALL_ROOT=`pwd` if [ -d $VIM_ROOT -o -L $VIM_ROOT ]; then mv $VIM_ROOT $HOME/.vim_$RANDOM_NR fi cd #checking whether install from vim-ide dir or dotfiles BASE_INSTALL_DIR=`basename $INSTALL_ROOT` if [ $BASE_INSTALL_DIR == "vim-ide" ]; then mv $INSTALL_ROOT $VIM_ROOT else ln -s $INSTALL_ROOT $VIM_ROOT fi if [ -f $HOME/.vimrc -o -L $HOME/.vimrc ]; then mv $HOME/.vimrc $HOME/.vimrc_$RANDOM_NR fi ln -s $VIM_ROOT/vimrc $HOME/.vimrc echo -e "Installing vim (Vi Improved) package from repository" #installinv vim-gnome allows copy/pasting beween vim and system clipboard sudo apt-get --yes install vim vim-gnome echo -e "Installing ctags" sudo apt-get --yes install ctags echo -e "Installing cscope" sudo apt-get --yes install cscope echo -e "Installing pip for python-based dpeendencies" sudo apt-get --yes install pip echo -e "Installing python dependencies" sudo pip install pdb pylint echo -e "Initializing and checking out plugins submodules: " cd $VIM_ROOT git submodule init git submodule update #git submodule foreach git checkout master #git submodule foreach git pull origin master #restore all submodules to the commit which is approved by last master commit #git submodule update --recursive echo -e "Installing vi_overlay" while true; do yn=y #automatically answer 'yes' when 'y' is passed as first parameter if [ "$1" != "y" ]; then read -p "Do you wish to install vi_overlay (sudo priviledges are required)? [y/n]: " yn fi case $yn in [Yy]* ) echo -e "Yes selected"; if [ -f /usr/bin/vi.default ]; then sudo rm /usr/bin/vi.default fi if [ -f /usr/bin/vim.default ]; then sudo rm /usr/bin/vim.default fi sudo ln -s /etc/alternatives/vi /usr/bin/vi.default sudo ln -s /etc/alternatives/vim /usr/bin/vim.default if [ -f /usr/bin/vi ]; then sudo rm /usr/bin/vi fi if [ -f /usr/bin/vim ]; then sudo rm /usr/bin/vim fi if [ -f $HOME/.vim/vimscripts/vi_overlay ]; then sudo ln -s $VIM_ROOT/vimscripts/vi_overlay /usr/bin/vi sudo ln -s $VIM_ROOT/vimscripts/vi_overlay /usr/bin/vim sudo chmod +x $VIM_ROOT/vimscripts/vi_overlay else echo -e "WARNING!!! $HOME/.vim/vimscripts/vi_overlay does not exist..." fi echo -e "vi_overlay installed."; break;; [Nn]* ) echo -e "No selected"; break;; * ) echo -e "Please select yes or no";; esac done
{ "pile_set_name": "Github" }
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- // -- BEGIN LICENSE BLOCK ---------------------------------------------- // Copyright 2019 FZI Forschungszentrum Informatik // // 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. // -- END LICENSE BLOCK ------------------------------------------------ //---------------------------------------------------------------------- /*!\file * * \author Felix Exner exner@fzi.de * \date 2019-04-17 * */ //---------------------------------------------------------------------- #include "ur_controllers/speed_scaling_state_controller.h" #include <pluginlib/class_list_macros.hpp> namespace ur_controllers { bool SpeedScalingStateController::init(SpeedScalingInterface* hw, ros::NodeHandle& root_nh, ros::NodeHandle& controller_nh) { // get all joint states from the hardware interface const std::vector<std::string>& sensor_names = hw->getNames(); for (unsigned i = 0; i < sensor_names.size(); i++) ROS_DEBUG("Got sensor %s", sensor_names[i].c_str()); // get publishing period if (!controller_nh.getParam("publish_rate", publish_rate_)) { ROS_ERROR("Parameter 'publish_rate' not set"); return false; } for (unsigned i = 0; i < sensor_names.size(); i++) { // sensor handle sensors_.push_back(hw->getHandle(sensor_names[i])); // realtime publisher RtPublisherPtr rt_pub(new realtime_tools::RealtimePublisher<std_msgs::Float64>(root_nh, sensor_names[i], 4)); realtime_pubs_.push_back(rt_pub); } // Last published times last_publish_times_.resize(sensor_names.size()); return true; } void SpeedScalingStateController::starting(const ros::Time& time) { // initialize time for (unsigned i = 0; i < last_publish_times_.size(); i++) { last_publish_times_[i] = time; } } void SpeedScalingStateController::update(const ros::Time& time, const ros::Duration& /*period*/) { // limit rate of publishing for (unsigned i = 0; i < realtime_pubs_.size(); i++) { if (publish_rate_ > 0.0 && last_publish_times_[i] + ros::Duration(1.0 / publish_rate_) < time) { // try to publish if (realtime_pubs_[i]->trylock()) { // we're actually publishing, so increment time last_publish_times_[i] = last_publish_times_[i] + ros::Duration(1.0 / publish_rate_); // populate message // realtime_pubs_[i]->msg_.header.stamp = time; realtime_pubs_[i]->msg_.data = *sensors_[i].getScalingFactor(); realtime_pubs_[i]->unlockAndPublish(); } } } } void SpeedScalingStateController::stopping(const ros::Time& /*time*/) { } } // namespace ur_controllers PLUGINLIB_EXPORT_CLASS(ur_controllers::SpeedScalingStateController, controller_interface::ControllerBase)
{ "pile_set_name": "Github" }
# OpinionzAlertView [![CI Status](http://img.shields.io/travis/Opinionz/OpinionzAlertView.svg?style=flat)](https://travis-ci.org/Opinionz/OpinionzAlertView) [![Version](https://img.shields.io/cocoapods/v/OpinionzAlertView.svg?style=flat)](http://cocoapods.org/pods/OpinionzAlertView) [![License](https://img.shields.io/cocoapods/l/OpinionzAlertView.svg?style=flat)](http://cocoapods.org/pods/OpinionzAlertView) [![Platform](https://img.shields.io/cocoapods/p/OpinionzAlertView.svg?style=flat)](http://cocoapods.org/pods/OpinionzAlertView) Introduction -------------- Beautiful customizable alert view with blocks. Choose from predefined icons for info, warning, success and error alerts. Customize color or set your desired image. Preview -------------- ![Preview](https://raw.githubusercontent.com/Opinionz/OpinionzAlertView/assets/screenshots/animated.gif) Installation -------------- ###Cocoapods OpinionzAlertView is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby pod 'OpinionzAlertView' ``` ###Manual 1. Add the OpinionzAlertView code into your project. Usage -------------- NOTE: prompt it after your view did appeared ###Example To run the example project, clone the repo, and run `pod install` from the Example directory first. ```objective-c // // ViewController.m // Demo // // Created by Opinionz.io on 18/08/15. // Copyright (c) 2015 Opinionz.io. All rights reserved. // #import "ViewController.h" #import <OpinionzAlertView/OpinionzAlertView.h> - (IBAction)buttonHandlerAlert:(id)sender { OpinionzAlertView *alertView = [[OpinionzAlertView alloc] initWithTitle:@"Title" message:@"message" cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; // alertView = [[OpinionzAlertView alloc] initWithTitle:@"Title" // message:@"message" // cancelButtonTitle:@"Cancel" // otherButtonTitles:nil // usingBlockWhenTapButton:^(OpinionzAlertView *alertView, NSInteger buttonIndex) { // // NSLog(@"Tapped button at index : %li", (long)buttonIndex); // NSLog(@"buttonTitle: %@", [alertView buttonTitleAtIndex:buttonIndex]); // }]; [alertView show]; } ``` Configuration ------------- Set `title`, `message`, `cancelButtonTitle` and `otherButtonTitles`. Properties -------------- The OpinionzAlertView has the following properties: ```objective-c @property (nonatomic, strong) UIColor *color; ``` Color of header backgound ```objective-c @property (nonatomic, strong) UIImage *icon; ``` Icon on header ```objective-c @property (nonatomic, assign) OpinionzAlertIcon iconType; ``` Or you can choose icon type ```objective-c typedef enum : NSUInteger { OpinionzAlertIconInfo = 1, OpinionzAlertIconWarning, OpinionzAlertIconSuccess, OpinionzAlertIconQuestion, OpinionzAlertIconStar, OpinionzAlertIconHeart } OpinionzAlertIcon; ``` ```objective-c @property (nonatomic, assign) id<OpinionzAlertViewDelegate> delegate; ``` Alert view delegate ```objective-c @property (nonatomic, copy) OpinionzPopupViewTapButtonBlock buttonDidTappedBlock; ``` Alert view tap block Methods -------------- The OpinionzAlertView class has following methods: ```objective-c - (instancetype)initWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles; - (instancetype)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id /*<OpinionzAlertViewDelegate>*/)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles; - (instancetype)initWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles usingBlockWhenTapButton:(OpinionzPopupViewTapButtonBlock)tapButtonBlock; - (void)show; - (void)dismiss; - (NSString *)buttonTitleAtIndex:(NSInteger)buttonIndex; ``` Supported OS & SDK Versions ----------------------------- * Supported build target - iOS 7.0 (Xcode 6.2) ARC Compatibility ------------------ OpinionzAlertView requires ARC. ## Author Opinionz.io, support@opinionz.io ## License OpinionzAlertView is available under the MIT license. See the LICENSE file for more info.
{ "pile_set_name": "Github" }
# Changelog ### 3.3.x * Simplify ILogger dependencies - thanks to Thomas Ibel - https://github.com/tibel * Add strong name - thanks to Thomas Ibel - https://github.com/tibel * Add ExtendedDnControl - thanks to Miroslav Adamec - https://github.com/mirecad ### 3.2.0 * Deprecate LibLog. Add back Microsoft.Logging with different versions for the three .net standard version: 1.3, 2.0, 2.1 * Fix GetAttribute documentation ### 3.1.0 * Build nuget package for .net standard 2.1 too. Tests are now running on net core 3.1. * The build is running on Ubuntu Xenial ### 3.0.3 * Fix FetchSchema ### 3.0.2 * Fix not using timeout when connecting via SSL - thanks to Konrad Kruczyński - https://github.com/konrad-kruczynski ### 3.0.0 * change ILdapConnection interface to improve testability & mockability * changes to the public api of the library to improve usability and make it more .net style * IPv6 support * SASL support - thanks to Michael Stum - https://github.com/mstum * Support for ReferralFollowing - thanks to Joseph Petersen - https://github.com/casz * Add LocalCertificateSelectionCallback - thanks to bmoore - https://github.com/barry-r-moore * Fix issue in message timeout - thanks to martindrlik https://github.com/martindrlik * Remove dependency of Microsoft.Extensions.Logging - use LibLog * Prevents dns lookup if IP is passed to Connect - thanks to mjrist - https://github.com/mjrist ### 2.3.8 * Added connect timeout ### 2.3.7 * Disconnect method added to ILdapConnection ### 2.3.6 * The build matrix is running the stress tests in three ways: with no transport security, with SSL and with TLS. * Improve TLS support - it used to throw exception in some rare conditions. * Added new tests for connect with/without SSL/TLS * Added new tests for search * Some smaller cleanups ### 2.3.5 * Added stress tests which are running the functional tests on multiple threads - running in Travis CI using OpenLDAP in a build matrix with different number of threads * Added functional tests which are running in CI using OpenLDAP as ldap server * Fixed reader thread hanging when disposing ldap connection after an unsuccesful bind (not sure if was happening in the original library as I didnt check it but very likely it did) * Code cleanup: delete useless/incorrect finalizers and some general cleanup * Free the write semaphore in finally ### 2.3.3 Fix two issues happening also in the original library * Fix crashing of reader thread when stopping the thread because of unhandled exception (the reader thread was expecting IOException but not ObjectDisposedException) * Fix race condition causing null reference on dispose of LdapConnection ### 2.3.1 * Built against the lowest possible version of .NET Standard: 1.3 * ILdapConnection introduced ### 2.3.0 Initial version built against the release version of .NET Core 1.0. The main changes for porting were around: * Thread usage: the library was extensively using Abort, Interrupt, ThreadInterruptedException, ... - which is not recommended and also not supported in .NET Core. * Serialization support for a limited number of types was deleted; not supported on .net core * Ssl support: the library was using Mono.Security for this. Now is implemented using SslStream from NetStandard * Implement IDisposable for LdapConnection to allow usage of "using" construct ## Original changelog before .NET Standard conversion ### 2009-07-14 Palaniappan N <npalaniappan@novell.com> * The fix for the crash while disconnecting has been checked in. The fix is to implement iDisposambe interface and use 'Dispose' method to shut down the connection. ### 2009-07-07 Palaniappan N <npalaniappan@novell.com> * New LDAP extension (specific to eDirectory) GetEffectivePrivilegesList has been added. eDirectory supports this from version 8.8 SP5. GetEffectivePrivilegesListRequest.cs processes the extended request. And GetEffectivePrivilegesListResponse.cs processes the extended response. GetEffectivePrivilegesList.cs is the sample that explains the extension. ### 2009-07-06 Palaniappan N <npalaniappan@novell.com> * Changed version from 2.1.10 to 2.2.1 in Connection.cs * Changed version from 2.1.10 to 2.2.1 in AssemblyInfo.cs ### 2008-03-14 Palaniappan N <npalaniappan@novell.com> * Changed version from 2.1.9 to 2.1.10 in Connection.cs * Changed version from 2.1.9 to 2.1.10 in AssemblyInfo.cs ### 2007-12-19 Palaniappan N <npalaniappan@novell.com> * Fix for the issue of getting occasional -5875 error on the server when disconnecting the client. ### 2007-12-19 Palaniappan N <npalaniappan@novell.com> * InteractiveSSL.cs has been made to check the certificate store, if the certificate is present and valid before adding the new certificate to the Trust store. ### 2007-12-19 Palaniappan N <npalaniappan@novell.com> * In the searchResultEventArgs.ToString(), the function classification was hard coded earlier. This has been fixed. ### 2007-12-05 Palaniappan N <npalaniappan@novell.com> * Exception messages have been thrown in case of connection failure ### 2007-10-18 Palaniappan N <npalaniappan@novell.com> * Changed version from 2.1.8 to 2.1.9 in Connection.cs * Changed version from 2.1.8 to 2.1.9 in AssemblyInfo.cs ### 2007-09-24 Palaniappan N <npalaniappan@novell.com> * conn.Disconnect() has been added in the samples InteractiveSSL.cs and SecureBind.cs to disconnect the connections properly even in case of the exceptions. The same will be done in all the samples in the upcoming release. ### 2007-09-19 Palaniappan N <npalaniappan@novell.com> * Added a try/finally section in the file connection.cs to release the semId semaphore in case the connection fails. ### 2007-09-10 Palaniappan N <npalaniappan@novell.com> * Exception has been thrown in case of supply of negative sleep interval.Change done in the file LdapEventSource.cs ### 2007-08-28 Palaniappan N <npalaniappan@novell.com> * Assembly loader to load Mono.Security has been modified to pick up the proper one. Change done in the Connection.cs file ### 2007-03-07 Palaniappan N <npalaniappan@novell.com> * Changed version from 2.1.7 to 2.1.8 in Connection.cs * Changed version from 2.1.7 to 2.1.8 in AssemblyInfo.cs ### 2006-12-11 Palaniappan N <npalaniappan@novell.com> * A fix for the bug which deals about the exceptions caused while using events with lots of create/modify events * A new property BinaryData has been implemented in the ValueEventData.cs class to enable applications retrieve the binary data as such from the ASN1OctetString with out converting it in to a String ### 2006-11-22 Palaniappan N <npalaniappan@novell.com> * Done a fix in DN.cs by correcting the misplaced decrement operator which caused malfunctioning of isDescendantOf() method ### 2006-10-12 Palaniappan N <npalaniappan@novell.com> * Added a new sample ListGroups.cs * Added a new sample SetPassword.cs * Added a new sample AsynchronousSortControl.cs in Controls * Added a new sample SimplePassword.cs in Controls ### 2006-09-05 Palaniappan N <npalaniappan@novell.com> * Added a new sample ModifyACL.cs * Added a new catch block in Connection.cs to catch the socket exceptions. * Checked the condition, whether the sockets created by BOTH SSL and cleartext connections are open / null in Connection.cs * Changes made in LdapResponse.cs so to monitor the events which caused problems with eDirectory 8.8 SP1 release, because of the LdapResponse structure. * Modification done in RfcFilter.cs to parse the special charectes too. * The usage of the command line arguments have been corrected in the samples AddEntry.cs, Bind.cs, CompareAttrs.cs, DelEntry.cs, GetAttributeSchema.cs, InteractiveSSL.cs, ModifyEntry.cs, ModifyPass.cs, RenameEntry.cs, Search.cs, SecureBind.cs, StartTLS.cs, PSearchCallback.cs, SearchPersist.cs, SortSearch.cs, VLVControl.cs * Changed version from 2.1.6 to 2.1.7 in Connection.cs * Changed version from 2.1.6 to 2.1.7 in AssemblyInfo.cs ### 2006-06-21 Palaniappan N <npalaniappan@novell.com> * Added support for Backup-Restore of LDAP Objects * Added new sample GetLdapBackupRestore.cs in the extensions to support Backup-Restore Feature * Added new sample ClientSideSort.cs to support client side sorting of the entries * Added new sample CompareAttrs.cs to compare the attributes * Added new sample DynamicGroup.cs to support Dynamic Grouping of entries * Added new sample List.cs to get all the entries of a specific container * Changed version from 2.1.5 to 2.1.6 in Connection.cs * Changed version from 2.1.5 to 2.1.6 in AssemblyInfo.cs ### 2006-03-27 Palaniappan N <npalaniappan@novell.com> * Removed the assembly reference to Mono.Security.dll which caused the mismatch and added the appropriate reference ### 2006-03-03 Palaniappan N <npalaniappan@novell.com> * Added new sample EdirEventSample.cs in the extensions to support event handling * Modified the sample SearchPersist.cs to monitor the changes properly and unwanted namespaces are removed * Changed version from 2.1.4 to 2.1.5 in Connection.cs. * Changed version from 2.1.4 to 2.1.5 in AssemblyInfo.cs ### 2005-11-09 Palaniappan N <npalaniappan@novell.com> * Connection.cs is changed so as to load the Mono.Security.dll even from a non-default location (path) ### 2005-09-23 Palaniappan N <npalaniappan@novell.com> * Changes done in the samples PartitionEntryCount.cs, VLVControl.cs, SearchPersist.cs and AddUserToGroup.cs to catch the uncaught exceptions as the fixes for the bugs #1291,#1292 and #1293 (from forge site) ### 2005-09-21 Palaniappan N <npalaniappan@novell.com> * Changed version from 2.1.3 to 2.1.4 in Connection.cs * Changed version from 2.1.3 to 2.1.4 in AssemblyInfo.cs ### 2005-09-14 Palaniappan N <npalaniappan@novell.com> * The sample InteractiveSSL.cs is updated so as to give the client , the provision of seeing the server details to which it is trying to connect and to decide whether to proceed the SSL handshake or not. If it is to be proceeded, the server's certificate will be imported automatically to the client's Trust Store ### 2005-09-13 Palaniappan N <npalaniappan@novell.com> * Fix for bugs #1174, #1175 (from forge site) made - Connection.cs class is modified by synchronizing the stream threads so as to avoid the memory consumption and handle consumption ### 2005-07-19 Anil Bhatia <banil@novell.com> * Implementation and sample for Interactive SSL Support - provision for application to decide whether to proceed with SSL Handshake ### 2005-07-19 Anil Bhatia <banil@novell.com> * fix for bug [#1022] from forge site. The fix seems to work for the time being ### 2005-07-11 Anil Bhatia <banil@novell.com> * Support for Error Messages * Removed hard coded dependency on Mono Security * Fix for a race condition in Connection.cs #### 2005-01-19 Anil Bhatia <banil@novell.com> * Added support for subordinate subtree scope. Classes changed for this are LdapConnection and LdapUrl. Ref: http://www.ietf.org/internet-drafts/draft-sermersheim-ldap-subordinate-scope-01.txt ### 2005-01-14 Anil Bhatia <banil@novell.com> * Changed version from 2.1.1 to 2.1.2 in Connection.cs. * Changed version from 1.0.0. to 2.1.2 in AssemblyInfo.cs ### 2005-01-05 Anil Bhatia <banil@novell.com> * Added support for error code 113 SSL_HANDSHAKE_FAILED ### 2004-09-16 Anil Bhatia <banil@novell.com> * Added Support for LDAP and eDir events. * Changes in Connection.cs regarding appropriate handling in method ServerCertificateValidation. This is required for proper execution of SecureBind sample ### 2004-04-14 Sunil Kumar <sunilk@novell.com> * Added Support for SSL/TLS ### 2004-03-31 Sunil Kumar <sunilk@novell.com> * Added support for LDAP Extension registrations ### 2003-14-12 Sunil Kumar <sunilk@novell.com> * Added Support for XML documentation ### 2003-10-12 Sunil Kumar <sunilk@novell.com> * Added Support for Schema Related Operations ### 2003-21-11 Sunil Kumar <sunilk@novell.com> * Changed the linux build script to replace corlib.dll with mscorlib.dll ### 2003-16-11 Sunil Kumar <sunilk@novell.com> * Added LDAP controls in Novell.Directory.Ldap.Controls * Added Samples for LDAP controls ### 2003-15-11 Sunil Kumar <sunilk@novell.com> * Changed the LdapConnection public Method name as per MS naming convention * Added the Authors description ### 2003-14-11 Sunil Kumar <sunilk@novell.com> * Changed the Directory structure and Class file names as per the Microsoft Standards * Changed the build scripts accordingly
{ "pile_set_name": "Github" }
package org.fxmisc.richtext.demo; import java.time.Duration; import java.util.Collection; import java.util.Collections; import java.util.function.Consumer; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import javafx.application.Application; import javafx.application.Platform; import javafx.scene.Scene; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.layout.StackPane; import javafx.stage.Stage; import org.fxmisc.flowless.VirtualizedScrollPane; import org.fxmisc.richtext.CodeArea; import org.fxmisc.richtext.GenericStyledArea; import org.fxmisc.richtext.LineNumberFactory; import org.fxmisc.richtext.model.StyleSpans; import org.fxmisc.richtext.model.StyleSpansBuilder; import org.reactfx.collection.ListModification; import org.reactfx.Subscription; public class JavaKeywordsDemo extends Application { private static final String[] KEYWORDS = new String[] { "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "default", "do", "double", "else", "enum", "extends", "final", "finally", "float", "for", "goto", "if", "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "package", "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "void", "volatile", "while" }; private static final String KEYWORD_PATTERN = "\\b(" + String.join("|", KEYWORDS) + ")\\b"; private static final String PAREN_PATTERN = "\\(|\\)"; private static final String BRACE_PATTERN = "\\{|\\}"; private static final String BRACKET_PATTERN = "\\[|\\]"; private static final String SEMICOLON_PATTERN = "\\;"; private static final String STRING_PATTERN = "\"([^\"\\\\]|\\\\.)*\""; private static final String COMMENT_PATTERN = "//[^\n]*" + "|" + "/\\*(.|\\R)*?\\*/"; private static final Pattern PATTERN = Pattern.compile( "(?<KEYWORD>" + KEYWORD_PATTERN + ")" + "|(?<PAREN>" + PAREN_PATTERN + ")" + "|(?<BRACE>" + BRACE_PATTERN + ")" + "|(?<BRACKET>" + BRACKET_PATTERN + ")" + "|(?<SEMICOLON>" + SEMICOLON_PATTERN + ")" + "|(?<STRING>" + STRING_PATTERN + ")" + "|(?<COMMENT>" + COMMENT_PATTERN + ")" ); private static final String sampleCode = String.join("\n", new String[] { "package com.example;", "", "import java.util.*;", "", "public class Foo extends Bar implements Baz {", "", " /*", " * multi-line comment", " */", " public static void main(String[] args) {", " // single-line comment", " for(String arg: args) {", " if(arg.length() != 0)", " System.out.println(arg);", " else", " System.err.println(\"Warning: empty string as argument\");", " }", " }", "", "}" }); public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { CodeArea codeArea = new CodeArea(); // add line numbers to the left of area codeArea.setParagraphGraphicFactory(LineNumberFactory.get(codeArea)); /* // recompute the syntax highlighting for all text, 500 ms after user stops editing area Subscription cleanupWhenNoLongerNeedIt = codeArea // plain changes = ignore style changes that are emitted when syntax highlighting is reapplied // multi plain changes = save computation by not rerunning the code multiple times // when making multiple changes (e.g. renaming a method at multiple parts in file) .multiPlainChanges() // do not emit an event until 500 ms have passed since the last emission of previous stream .successionEnds(Duration.ofMillis(500)) // run the following code block when previous stream emits an event .subscribe(ignore -> codeArea.setStyleSpans(0, computeHighlighting(codeArea.getText()))); // when no longer need syntax highlighting and wish to clean up memory leaks // run: `cleanupWhenNoLongerNeedIt.unsubscribe();` */ // recompute syntax highlighting only for visible paragraph changes codeArea.getVisibleParagraphs().addModificationObserver ( new VisibleParagraphStyler<>( codeArea, this::computeHighlighting ) ); // auto-indent: insert previous line's indents on enter final Pattern whiteSpace = Pattern.compile( "^\\s+" ); codeArea.addEventHandler( KeyEvent.KEY_PRESSED, KE -> { if ( KE.getCode() == KeyCode.ENTER ) { int caretPosition = codeArea.getCaretPosition(); int currentParagraph = codeArea.getCurrentParagraph(); Matcher m0 = whiteSpace.matcher( codeArea.getParagraph( currentParagraph-1 ).getSegments().get( 0 ) ); if ( m0.find() ) Platform.runLater( () -> codeArea.insertText( caretPosition, m0.group() ) ); } }); codeArea.replaceText(0, 0, sampleCode); Scene scene = new Scene(new StackPane(new VirtualizedScrollPane<>(codeArea)), 600, 400); scene.getStylesheets().add(JavaKeywordsAsyncDemo.class.getResource("java-keywords.css").toExternalForm()); primaryStage.setScene(scene); primaryStage.setTitle("Java Keywords Demo"); primaryStage.show(); } private StyleSpans<Collection<String>> computeHighlighting(String text) { Matcher matcher = PATTERN.matcher(text); int lastKwEnd = 0; StyleSpansBuilder<Collection<String>> spansBuilder = new StyleSpansBuilder<>(); while(matcher.find()) { String styleClass = matcher.group("KEYWORD") != null ? "keyword" : matcher.group("PAREN") != null ? "paren" : matcher.group("BRACE") != null ? "brace" : matcher.group("BRACKET") != null ? "bracket" : matcher.group("SEMICOLON") != null ? "semicolon" : matcher.group("STRING") != null ? "string" : matcher.group("COMMENT") != null ? "comment" : null; /* never happens */ assert styleClass != null; spansBuilder.add(Collections.emptyList(), matcher.start() - lastKwEnd); spansBuilder.add(Collections.singleton(styleClass), matcher.end() - matcher.start()); lastKwEnd = matcher.end(); } spansBuilder.add(Collections.emptyList(), text.length() - lastKwEnd); return spansBuilder.create(); } private class VisibleParagraphStyler<PS, SEG, S> implements Consumer<ListModification> { private final GenericStyledArea<PS, SEG, S> area; private final Function<String,StyleSpans<S>> computeStyles; private int prevParagraph, prevTextLength; public VisibleParagraphStyler( GenericStyledArea<PS, SEG, S> area, Function<String,StyleSpans<S>> computeStyles ) { this.computeStyles = computeStyles; this.area = area; } @Override public void accept( ListModification lm ) { if ( lm.getAddedSize() > 0 ) { int paragraph = Math.min( area.firstVisibleParToAllParIndex() + lm.getFrom(), area.getParagraphs().size()-1 ); String text = area.getText( paragraph, 0, paragraph, area.getParagraphLength( paragraph ) ); if ( paragraph != prevParagraph || text.length() != prevTextLength ) { int startPos = area.getAbsolutePosition( paragraph, 0 ); Platform.runLater( () -> area.setStyleSpans( startPos, computeStyles.apply( text ) ) ); prevTextLength = text.length(); prevParagraph = paragraph; } } } } }
{ "pile_set_name": "Github" }
53 2503 11 1 2 13 0 1 3 13 0 1 1 2 13 40 1 2 13 50 1 3 13 28 29 1 2 13 14 1 2 49 50 1 3 49 28 29 1 2 49 21 1 3 49 40 41 1 4 49 28 29 30 1 1 20 1 2 20 29 1 4 27 28 29 30 1 4 27 28 29 3 1 4 27 28 2 3 1 4 27 1 2 3 1 4 27 40 41 42 1 4 27 28 29 42 1 4 27 28 41 42 1 2 14 3 1 1 50 1 3 1 2 22 1 2 40 22 1 3 40 41 16 1 1 51 1 1 15 1 2 15 43 1 2 15 5 1 3 42 43 17 1 3 31 32 17 1 2 16 17 1 3 32 17 18 1 2 23 24 1 2 44 24 1 2 33 24 1 2 6 24 1 1 52 1 3 17 36 37 1 3 17 18 37 1 3 34 35 25 1 3 7 8 25 1 5 7 8 9 10 11 1 2 24 10 1 2 24 25 1 3 24 25 26 1 2 46 19 1 3 46 25 26 1 2 35 19 1 3 35 25 26 1 2 8 19 1 3 8 25 26 1 2 18 19 1 2 37 26 1 2 10 26 1 1 48 1 1 39 1 1 38 1 4 13 0 2 3 1 4 13 1 2 3 1 3 13 0 15 1 4 13 0 2 42 1 4 13 0 41 42 1 4 13 1 41 42 1 3 13 14 42 1 4 13 0 2 31 1 4 13 0 30 31 1 4 13 0 41 31 1 3 13 14 31 1 4 13 0 2 4 1 5 13 0 2 3 4 1 4 13 0 30 4 1 4 13 0 41 4 1 4 13 1 3 4 1 3 13 14 4 1 4 13 50 3 4 1 3 13 14 22 1 3 13 21 22 1 3 13 50 22 1 4 13 0 30 43 1 4 13 0 41 43 1 4 13 14 42 43 1 4 13 50 3 43 1 4 13 50 42 43 1 4 13 0 30 32 1 4 13 21 31 32 1 4 13 14 31 32 1 4 13 14 42 32 1 4 13 50 3 32 1 4 13 50 31 32 1 4 13 50 42 32 1 4 13 14 4 5 1 4 13 14 31 5 1 4 13 14 42 5 1 4 13 50 3 5 1 5 13 50 3 4 5 1 4 13 50 31 5 1 4 13 50 42 5 1 5 13 0 1 2 16 1 3 13 14 16 1 3 13 50 16 1 4 13 15 43 44 1 4 13 14 31 44 1 4 13 14 42 44 1 4 13 50 31 44 1 4 13 50 42 44 1 5 13 50 42 43 44 1 3 13 0 51 1 2 13 51 1 5 13 0 1 22 33 1 4 13 14 31 33 1 4 13 21 43 33 1 4 13 50 22 33 1 4 13 50 31 33 1 5 13 50 31 32 33 1 5 13 50 42 43 33 1 7 13 0 2 3 4 5 6 1 7 13 0 1 2 4 5 6 1 5 13 0 1 22 6 1 5 13 14 4 5 6 1 4 13 15 5 6 1 4 13 21 4 6 1 4 13 21 32 6 1 4 13 21 43 6 1 4 13 40 22 6 1 5 13 50 3 4 6 1 4 13 50 22 6 1 5 13 50 31 32 6 1 5 13 50 42 43 6 1 6 13 0 2 3 4 23 1 4 13 0 15 23 1 5 13 0 30 31 23 1 5 13 0 41 42 23 1 4 13 2 22 23 1 4 13 14 22 23 1 4 13 21 4 23 1 5 13 28 30 31 23 1 4 13 40 4 23 1 4 13 40 31 23 1 4 13 40 42 23 1 4 13 50 22 23 1 7 13 0 2 3 4 5 45 1 6 13 0 1 2 16 45 1 5 13 0 1 22 45 1 7 13 0 41 42 43 44 45 1 5 13 14 4 44 45 1 6 13 14 42 43 44 45 1 4 13 21 32 45 1 4 13 21 43 45 1 4 13 40 16 45 1 4 13 40 22 45 1 4 13 50 16 45 1 4 13 50 22 45 1 5 13 50 31 32 45 1 5 13 50 42 43 45 1 7 13 0 2 3 4 5 34 1 6 13 0 1 2 16 34 1 6 13 0 1 22 33 34 1 7 13 0 30 31 32 33 34 1 7 13 0 41 42 43 44 34 1 5 13 14 4 33 34 1 5 13 14 22 33 34 1 6 13 14 31 32 33 34 1 6 13 14 42 43 44 34 1 6 13 14 42 32 33 34 1 5 13 14 43 33 34 1 4 13 21 32 34 1 7 13 28 30 31 32 33 34 1 4 13 50 16 34 1 5 13 50 31 32 34 1 7 13 0 1 3 4 5 7 1 8 13 0 1 3 4 5 6 7 1 6 13 0 1 2 16 7 1 6 13 0 1 22 6 7 1 7 13 0 1 31 32 33 7 1 7 13 0 1 42 43 44 7 1 5 13 14 4 6 7 1 6 13 14 4 5 6 7 1 5 13 14 22 6 7 1 6 13 14 31 32 6 7 1 6 13 14 42 43 44 7 1 6 13 14 42 5 6 7 1 7 13 28 3 4 5 6 7 1 7 13 28 29 31 32 33 7 1 4 13 40 16 7 1 4 13 50 16 7 1 5 13 50 22 6 7 1 6 13 50 42 43 44 7 1 6 13 0 1 3 4 17 1 5 13 0 1 22 17 1 6 13 0 1 31 32 17 1 6 13 0 1 42 43 17 1 4 13 14 16 17 1 4 13 14 22 17 1 5 13 14 42 43 17 1 6 13 28 29 31 32 17 1 4 13 40 4 17 1 4 13 50 16 17 1 4 13 50 22 17 1 5 13 50 31 32 17 1 5 13 50 42 43 17 1 6 13 0 1 22 45 46 1 7 13 0 1 31 32 33 46 1 7 13 0 1 42 43 44 46 1 7 13 0 1 2 44 45 46 1 6 13 14 4 5 45 46 1 5 13 14 22 45 46 1 6 13 14 31 32 45 46 1 6 13 14 42 43 45 46 1 7 13 14 42 43 44 45 46 1 4 13 14 44 46 1 7 13 28 3 4 5 6 46 1 6 13 28 29 16 45 46 1 7 13 28 29 31 32 33 46 1 5 13 50 16 45 46 1 5 13 50 22 45 46 1 8 13 0 1 3 4 5 6 35 1 7 13 0 1 31 32 33 35 1 6 13 14 4 5 6 35 1 6 13 14 4 33 34 35 1 5 13 14 5 34 35 1 5 13 14 22 23 35 1 6 13 14 22 33 34 35 1 6 13 14 31 32 33 35 1 6 13 14 31 33 34 35 1 7 13 14 31 32 33 34 35 1 5 13 14 32 34 35 1 7 13 14 42 43 44 45 35 1 7 13 14 42 43 44 34 35 1 7 13 14 42 43 33 34 35 1 7 13 14 42 32 33 34 35 1 4 13 21 23 35 1 7 13 28 3 4 5 6 35 1 6 13 28 29 16 34 35 1 7 13 28 29 31 32 33 35 1 7 13 28 42 43 44 45 35 1 5 13 40 22 23 35 1 5 13 50 16 34 35 1 3 49 50 3 1 4 49 1 2 3 1 2 49 15 1 4 49 1 2 42 1 3 49 50 42 1 4 49 1 2 31 1 3 49 50 31 1 4 49 50 3 4 1 4 49 1 3 4 1 5 49 1 2 3 4 1 4 49 40 3 4 1 4 49 1 2 22 1 3 49 50 22 1 4 49 1 3 43 1 4 49 40 42 43 1 5 49 1 2 3 43 1 5 49 1 41 42 43 1 4 49 50 42 43 1 5 49 40 41 42 43 1 4 49 1 3 32 1 4 49 1 42 32 1 5 49 1 2 3 32 1 5 49 1 30 31 32 1 4 49 50 31 32 1 4 49 50 42 32 1 5 49 40 41 31 32 1 4 49 1 3 5 1 4 49 50 3 5 1 4 49 1 31 5 1 4 49 1 42 5 1 4 49 40 4 5 1 4 49 40 42 5 1 5 49 50 3 4 5 1 5 49 1 3 4 5 1 4 49 50 31 5 1 4 49 50 42 5 1 5 49 40 41 4 5 1 4 49 1 2 16 1 3 49 50 16 1 5 49 1 3 4 44 1 4 49 1 31 44 1 4 49 1 42 44 1 4 49 40 4 44 1 4 49 40 31 44 1 4 49 40 42 44 1 5 49 50 3 4 44 1 6 49 1 2 3 4 44 1 5 49 50 42 43 44 1 5 49 40 41 43 44 1 6 49 40 41 42 43 44 1 2 49 51 1 5 49 1 3 4 33 1 4 49 1 22 33 1 4 49 1 31 33 1 5 49 1 42 43 33 1 4 49 40 4 33 1 4 49 40 31 33 1 5 49 50 3 32 33 1 4 49 15 32 33 1 5 49 50 31 32 33 1 5 49 50 42 32 33 1 6 49 40 41 42 43 33 1 6 49 40 41 31 32 33 1 5 49 1 3 4 6 1 4 49 1 22 6 1 5 49 1 31 32 6 1 5 49 1 42 43 6 1 4 49 40 4 6 1 5 49 40 31 32 6 1 5 49 50 3 5 6 1 4 49 15 5 6 1 5 49 50 31 32 6 1 5 49 50 42 5 6 1 4 49 1 31 23 1 4 49 1 42 23 1 4 49 50 4 23 1 4 49 50 22 23 1 5 49 50 3 5 45 1 4 49 1 22 45 1 5 49 1 31 32 45 1 5 49 1 42 43 45 1 4 49 15 5 45 1 5 49 40 31 32 45 1 5 49 3 43 44 45 1 5 49 15 43 44 45 1 4 49 50 22 45 1 5 49 50 31 44 45 1 5 49 50 42 44 45 1 5 49 50 3 5 34 1 5 49 1 31 32 34 1 5 49 50 3 44 34 1 4 49 15 5 34 1 4 49 15 44 34 1 5 49 40 22 33 34 1 6 49 40 42 43 44 34 1 4 49 50 16 34 1 5 49 15 32 33 34 1 5 49 50 31 33 34 1 6 49 50 31 32 33 34 1 6 49 50 42 43 44 34 1 6 49 50 42 32 33 34 1 5 49 50 43 33 34 1 6 49 1 3 4 5 7 1 5 49 50 3 5 7 1 5 49 1 2 5 7 1 5 49 50 3 33 7 1 5 49 50 3 44 7 1 4 49 15 5 7 1 5 49 15 5 6 7 1 4 49 15 33 7 1 4 49 15 44 7 1 6 49 40 4 5 6 7 1 6 49 40 31 32 33 7 1 6 49 40 42 43 44 7 1 5 49 50 22 6 7 1 5 49 50 32 33 7 1 5 49 31 32 33 7 1 5 49 31 5 6 7 1 5 49 50 43 44 7 1 5 49 42 5 6 7 1 5 49 1 3 4 17 1 5 49 1 31 32 17 1 5 49 1 42 43 17 1 4 49 21 4 17 1 5 49 40 31 32 17 1 5 49 40 42 43 17 1 4 49 50 16 17 1 4 49 50 22 17 1 5 49 50 42 43 17 1 5 49 50 3 33 46 1 5 49 50 3 44 46 1 4 49 1 44 46 1 5 49 15 5 6 46 1 4 49 15 33 46 1 4 49 15 44 46 1 5 49 15 44 45 46 1 5 49 21 16 45 46 1 6 49 28 29 16 45 46 1 7 49 28 29 31 32 33 46 1 7 49 28 29 43 44 45 46 1 6 49 40 4 5 6 46 1 6 49 40 31 32 33 46 1 6 49 40 42 43 44 46 1 7 49 40 41 43 44 45 46 1 5 49 50 22 45 46 1 5 49 50 3 23 35 1 5 49 50 3 33 35 1 5 49 1 2 33 35 1 5 49 1 33 34 35 1 5 49 15 5 6 35 1 4 49 15 33 35 1 5 49 15 33 34 35 1 5 49 15 44 45 35 1 5 49 21 16 34 35 1 6 49 28 29 16 34 35 1 6 49 40 4 5 6 35 1 5 49 40 16 34 35 1 5 49 40 22 23 35 1 6 49 40 31 32 33 35 1 6 49 40 41 32 33 35 1 7 49 40 41 32 33 34 35 1 7 49 40 42 43 44 45 35 1 5 49 50 22 23 35 1 5 49 50 32 34 35 1 5 49 50 3 23 8 1 5 49 15 5 6 8 1 6 49 15 5 6 7 8 1 5 49 15 33 34 8 1 5 49 15 44 45 8 1 7 49 28 29 30 5 6 8 1 7 49 28 29 30 6 7 8 1 6 49 28 29 16 7 8 1 8 49 28 29 30 32 33 34 8 1 7 49 28 29 43 44 45 8 1 6 49 40 4 5 6 8 1 6 49 40 41 5 6 8 1 5 49 40 6 7 8 1 7 49 40 41 32 33 34 8 1 7 49 40 41 43 44 45 8 1 5 49 50 5 6 8 1 6 49 50 32 33 34 8 1 5 49 50 33 7 8 1 5 49 50 44 7 8 1 2 20 15 1 4 20 2 3 4 1 3 20 21 4 1 2 20 22 1 4 20 2 3 43 1 4 20 2 3 32 1 3 20 15 32 1 4 20 30 31 32 1 4 20 2 3 5 1 4 20 30 31 5 1 3 20 21 16 1 5 20 2 3 43 44 1 4 20 30 43 44 1 2 20 51 1 4 20 2 43 33 1 4 20 2 4 6 1 4 20 2 32 6 1 4 20 2 43 6 1 4 20 3 5 6 1 4 20 31 32 6 1 3 20 22 23 1 3 20 21 23 1 4 20 29 4 23 1 4 20 29 30 23 1 4 20 29 31 23 1 4 20 41 42 23 1 4 20 2 16 45 1 4 20 2 32 45 1 4 20 2 43 45 1 5 20 21 43 44 45 1 4 20 29 16 45 1 4 20 41 5 45 1 4 20 41 32 45 1 4 20 2 32 34 1 6 20 2 3 4 5 34 1 6 20 2 3 4 33 34 1 6 20 2 31 32 33 34 1 5 20 30 32 33 34 1 5 20 21 32 33 34 1 5 20 21 43 33 34 1 4 20 29 16 34 1 6 20 29 31 32 33 34 1 5 20 21 31 33 34 1 4 20 41 5 34 1 5 20 41 43 44 34 1 5 20 2 43 44 7 1 6 20 21 4 5 6 7 1 5 20 3 5 6 7 1 6 20 3 4 5 6 7 1 5 20 21 32 33 7 1 5 20 21 43 44 7 1 5 20 21 31 6 7 1 4 20 29 16 7 1 3 20 15 17 1 5 20 2 32 33 46 1 5 20 2 43 44 46 1 6 20 21 4 5 6 46 1 6 20 21 4 44 45 46 1 5 20 21 5 45 46 1 5 20 21 32 33 46 1 5 20 31 32 33 46 1 5 20 21 43 44 46 1 6 20 21 43 44 45 46 1 5 20 21 31 45 46 1 5 20 2 32 33 35 1 6 20 21 4 5 6 35 1 6 20 21 4 33 34 35 1 6 20 3 4 5 6 35 1 6 20 3 4 5 34 35 1 6 20 3 4 33 34 35 1 6 20 3 32 33 34 35 1 5 20 21 5 34 35 1 5 20 21 32 33 35 1 6 20 21 32 33 34 35 1 6 20 31 32 33 34 35 1 6 20 21 43 44 45 35 1 6 20 21 43 44 34 35 1 6 20 21 43 33 34 35 1 6 20 42 43 44 34 35 1 6 20 42 43 33 34 35 1 6 20 42 32 33 34 35 1 6 20 29 4 5 6 35 1 6 20 29 31 32 33 35 1 7 20 29 31 32 33 34 35 1 6 20 21 31 33 34 35 1 7 20 29 30 31 33 34 35 1 5 20 41 42 33 35 1 5 20 41 33 34 35 1 5 20 2 3 6 8 1 6 20 2 32 33 34 8 1 6 20 15 5 6 7 8 1 6 20 21 4 5 6 8 1 6 20 21 4 6 7 8 1 5 20 21 5 7 8 1 6 20 21 32 33 34 8 1 6 20 21 32 6 7 8 1 5 20 21 33 7 8 1 6 20 21 43 44 45 8 1 6 20 21 43 6 7 8 1 5 20 21 44 7 8 1 6 20 29 4 5 6 8 1 7 20 29 4 5 6 7 8 1 6 20 21 31 6 7 8 1 7 20 29 30 32 33 34 8 1 6 20 2 4 5 6 24 1 5 20 2 32 33 24 1 5 20 2 43 44 24 1 5 20 15 5 6 24 1 6 20 21 4 5 6 24 1 5 20 21 4 23 24 1 6 20 29 4 5 6 24 1 4 20 29 16 24 1 5 20 41 32 33 24 1 5 20 41 43 44 24 1 6 20 2 4 5 6 18 1 4 20 2 16 18 1 5 20 2 3 23 18 1 6 20 2 32 33 34 18 1 6 20 2 43 44 45 18 1 4 20 15 17 18 1 5 20 15 33 34 18 1 5 20 21 16 17 18 1 5 20 43 44 45 18 1 6 20 29 4 5 6 18 1 4 20 29 16 18 1 5 20 29 30 23 18 1 6 20 29 43 44 45 18 1 5 20 41 5 6 18 1 5 20 41 42 17 18 1 5 20 41 42 23 18 1 6 20 41 32 33 34 18 1 6 20 41 43 44 45 18 1 7 20 2 4 5 6 7 36 1 6 20 2 3 23 35 36 1 7 20 2 43 44 45 46 36 1 6 20 15 5 6 7 36 1 4 20 15 17 36 1 5 20 15 23 35 36 1 6 20 15 33 34 35 36 1 6 20 15 44 45 46 36 1 7 20 21 4 5 6 7 36 1 7 20 21 4 5 6 35 36 1 7 20 21 4 5 34 35 36 1 5 20 21 16 17 36 1 6 20 21 32 33 35 36 1 7 20 21 32 33 34 35 36 1 5 20 32 33 34 36 1 5 20 32 34 35 36 1 7 20 21 43 44 45 46 36 1 7 20 21 43 44 45 35 36 1 7 20 21 43 44 34 35 36 1 7 20 21 43 33 34 35 36 1 7 20 29 4 5 6 7 36 1 7 20 29 30 32 33 34 36 1 7 20 29 30 31 33 34 36 1 7 20 21 31 33 34 35 36 1 5 20 21 31 34 36 1 7 20 29 43 44 45 46 36 1 7 20 41 43 44 45 46 36 1 5 27 28 30 31 32 1 5 27 28 29 4 5 1 5 27 28 30 4 5 1 4 27 28 15 44 1 5 27 28 30 43 44 1 5 27 28 29 43 44 1 4 27 40 4 44 1 5 27 28 41 43 44 1 5 27 28 41 42 44 1 5 27 1 2 3 33 1 5 27 28 30 32 33 1 5 27 29 30 32 33 1 5 27 28 30 31 33 1 6 27 28 29 31 32 33 1 4 27 40 4 33 1 5 27 28 41 32 33 1 5 27 28 41 43 33 1 6 27 28 29 3 5 6 1 5 27 28 2 3 6 1 4 27 21 32 6 1 4 27 21 43 6 1 6 27 28 30 31 5 6 1 4 27 40 4 6 1 5 27 28 41 5 6 1 5 27 28 41 32 6 1 5 27 28 41 43 6 1 5 27 28 2 3 23 1 4 27 21 4 23 1 4 27 40 4 23 1 5 27 28 2 16 45 1 5 27 1 31 32 45 1 5 27 28 15 5 45 1 5 27 21 4 5 45 1 4 27 21 16 45 1 4 27 21 32 45 1 4 27 21 43 45 1 6 27 28 29 4 5 45 1 6 27 28 30 31 44 45 1 5 27 29 30 44 45 1 5 27 28 41 5 45 1 5 27 28 41 32 45 1 5 27 28 41 43 45 1 6 27 28 29 42 44 45 1 5 27 28 2 16 34 1 5 27 1 2 33 34 1 5 27 28 15 5 34 1 5 27 28 15 44 34 1 5 27 21 4 5 34 1 4 27 21 16 34 1 4 27 21 32 34 1 5 27 21 43 44 34 1 6 27 28 30 31 32 34 1 6 27 28 29 31 33 34 1 7 27 28 30 31 32 33 34 1 7 27 28 29 31 32 33 34 1 5 27 29 30 44 34 1 6 27 28 29 43 33 34 1 5 27 28 41 5 34 1 5 27 28 41 32 34 1 6 27 28 29 42 33 34 1 5 27 28 41 33 34 1 5 27 28 41 42 34 1 7 27 28 29 3 5 6 7 1 5 27 28 2 16 7 1 5 27 28 15 5 7 1 5 27 28 15 33 7 1 5 27 28 15 44 7 1 5 27 21 4 5 7 1 4 27 21 16 7 1 5 27 21 32 33 7 1 5 27 21 43 44 7 1 6 27 29 30 5 6 7 1 6 27 28 30 31 6 7 1 7 27 28 29 4 5 6 7 1 7 27 28 29 31 32 6 7 1 5 27 28 30 33 7 1 5 27 28 41 5 7 1 6 27 28 29 42 6 7 1 5 27 1 2 16 17 1 4 27 21 4 17 1 4 27 21 32 17 1 4 27 21 43 17 1 6 27 28 29 30 31 17 1 6 27 28 2 16 45 46 1 7 27 1 42 43 44 45 46 1 7 27 28 2 43 44 45 46 1 7 27 1 2 43 44 45 46 1 7 27 28 2 3 44 45 46 1 6 27 1 2 3 45 46 1 5 27 28 15 33 46 1 5 27 28 15 44 46 1 5 27 21 32 33 46 1 5 27 21 43 44 46 1 7 27 28 3 43 44 45 46 1 5 27 29 16 45 46 1 7 27 28 42 43 44 45 46 1 6 27 28 41 5 6 46 1 6 27 28 41 32 33 46 1 6 27 28 41 43 44 46 1 7 27 28 41 43 44 45 46 1 7 27 28 41 42 44 45 46 1 6 27 28 2 16 34 35 1 7 27 28 29 3 33 34 35 1 5 27 28 2 3 35 1 5 27 28 15 33 35 1 4 27 21 23 35 1 5 27 21 32 33 35 1 6 27 21 43 44 45 35 1 7 27 28 29 4 5 34 35 1 5 27 29 16 34 35 1 7 27 28 29 31 32 33 35 1 7 27 28 29 31 33 34 35 1 7 27 29 30 32 33 34 35 1 7 27 28 30 31 33 34 35 1 7 27 28 29 43 44 34 35 1 6 27 28 41 5 6 35 1 7 27 28 29 42 33 34 35 1 7 27 28 41 43 44 45 35 1 6 27 28 2 16 7 8 1 7 27 28 2 43 44 45 8 1 4 27 21 23 8 1 6 27 21 32 33 34 8 1 6 27 21 43 44 45 8 1 6 27 29 30 5 6 8 1 7 27 28 29 4 5 7 8 1 7 27 29 30 5 6 7 8 1 7 27 28 30 31 6 7 8 1 6 27 28 29 5 6 8 1 6 27 29 30 31 7 8 1 5 27 29 16 7 8 1 7 27 28 30 32 33 34 8 1 6 27 28 30 31 34 8 1 6 27 29 30 31 34 8 1 7 27 28 29 32 33 7 8 1 7 27 28 29 43 44 45 8 1 7 27 28 29 43 6 7 8 1 5 27 29 30 45 8 1 7 27 28 29 42 6 7 8 1 7 27 28 41 32 33 34 8 1 7 27 28 41 43 44 45 8 1 5 27 28 2 16 24 1 6 27 29 4 5 6 24 1 5 27 28 2 16 18 1 6 27 28 2 16 17 18 1 6 27 1 2 16 17 18 1 6 27 28 29 3 23 18 1 6 27 28 29 16 17 18 1 7 27 28 29 30 31 17 18 1 7 27 28 29 30 32 17 18 1 6 27 28 29 42 23 18 1 7 27 28 29 3 23 35 36 1 6 27 1 2 3 33 36 1 7 27 28 2 32 33 34 36 1 7 27 28 2 33 34 35 36 1 6 27 28 2 3 35 36 1 5 27 21 16 17 36 1 6 27 29 30 31 17 36 1 7 27 28 30 32 33 34 36 1 9 27 28 29 30 32 33 34 35 36 1 9 27 28 29 30 31 33 34 35 36 1 7 27 29 43 44 45 46 36 1 6 27 28 29 42 17 36 1 7 27 28 29 42 23 35 36 1 7 27 28 41 32 33 34 36 1 7 27 28 41 32 33 35 36 1 7 27 28 41 42 33 34 36 1 2 14 16 1 4 14 31 32 33 1 4 14 4 5 6 1 4 14 31 32 6 1 3 14 4 23 1 3 14 22 23 1 3 14 42 23 1 4 14 4 5 45 1 4 14 31 44 45 1 5 14 42 43 44 45 1 4 14 3 5 34 1 4 14 3 44 34 1 4 14 4 33 34 1 4 14 22 33 34 1 4 14 31 33 34 1 4 14 43 44 34 1 4 14 42 44 34 1 4 14 3 5 7 1 4 14 3 33 7 1 4 14 3 44 7 1 4 14 4 6 7 1 5 14 31 32 6 7 1 5 14 42 43 44 7 1 4 14 22 6 7 1 3 14 4 17 1 3 14 16 17 1 4 14 42 43 17 1 3 14 22 17 1 5 14 3 5 6 46 1 4 14 16 45 46 1 4 14 22 6 46 1 4 14 22 45 46 1 4 14 3 23 35 1 4 14 22 23 35 1 5 14 22 33 34 35 1 4 14 32 34 35 1 4 14 22 6 35 1 4 14 22 45 35 1 4 14 31 33 35 1 4 14 42 23 35 1 4 14 3 23 8 1 3 14 23 8 1 4 14 33 34 8 1 4 14 22 6 8 1 5 14 22 6 7 8 1 4 14 22 34 8 1 4 14 22 45 8 1 4 14 42 23 8 1 5 14 3 5 6 24 1 4 14 3 33 24 1 4 14 3 44 24 1 5 14 4 5 6 24 1 4 14 4 23 24 1 3 14 23 24 1 4 14 43 44 24 1 4 14 22 6 24 1 3 14 22 24 1 4 14 31 6 24 1 4 14 31 33 24 1 4 14 42 6 24 1 4 14 42 23 24 1 4 14 42 33 24 1 4 14 42 44 24 1 5 14 3 5 6 18 1 4 14 3 23 18 1 4 14 4 17 18 1 3 14 16 18 1 4 14 16 17 18 1 4 14 22 6 18 1 4 14 22 17 18 1 4 14 22 34 18 1 4 14 22 45 18 1 4 14 42 17 18 1 4 14 42 23 18 1 5 14 3 4 17 36 1 5 14 3 23 35 36 1 6 14 3 44 45 46 36 1 4 14 16 17 36 1 4 14 23 35 36 1 5 14 32 33 35 36 1 5 14 22 6 7 36 1 4 14 22 17 36 1 4 14 22 34 36 1 5 14 22 34 35 36 1 5 14 22 45 46 36 1 5 14 31 6 7 36 1 4 14 31 17 36 1 5 14 31 45 46 36 1 5 14 42 6 7 36 1 4 14 42 17 36 1 5 14 42 23 35 36 1 6 14 42 44 45 46 36 1 5 14 3 4 17 9 1 5 14 3 23 8 9 1 4 14 23 8 9 1 5 14 44 45 8 9 1 5 14 22 6 7 9 1 6 14 22 6 7 8 9 1 4 14 22 17 9 1 5 14 22 34 35 9 1 5 14 22 45 46 9 1 5 14 31 6 7 9 1 5 14 31 7 8 9 1 4 14 31 17 9 1 5 14 31 45 46 9 1 5 14 42 6 7 9 1 4 14 42 17 9 1 5 14 42 23 8 9 1 3 50 22 6 1 3 50 22 45 1 5 50 3 5 6 46 1 4 50 3 33 46 1 4 50 3 44 46 1 4 50 31 6 46 1 4 50 31 33 46 1 4 50 42 6 46 1 4 50 42 44 46 1 5 50 31 32 45 46 1 5 50 42 43 44 46 1 5 50 42 44 45 46 1 5 50 3 5 6 35 1 5 50 3 44 45 35 1 4 50 31 6 35 1 4 50 31 45 35 1 6 50 3 4 33 34 35 1 4 50 22 23 35 1 6 50 42 43 33 34 35 1 5 50 3 5 6 8 1 5 50 3 44 45 8 1 4 50 31 45 8 1 4 50 42 23 24 1 4 50 4 23 24 1 4 50 22 6 18 1 4 50 22 17 18 1 4 50 22 34 18 1 4 50 22 45 18 1 4 50 31 6 18 1 4 50 31 45 18 1 4 50 42 6 18 1 4 50 16 17 18 1 5 50 3 23 35 36 1 5 50 3 33 34 36 1 5 50 31 33 34 36 1 5 50 42 23 35 36 1 5 50 42 33 34 36 1 5 50 32 33 35 36 1 5 50 3 4 7 9 1 6 50 22 6 7 8 9 1 5 50 42 6 7 9 1 5 50 42 23 8 9 1 5 50 33 34 35 9 1 5 50 33 7 8 9 1 4 50 45 8 9 1 6 50 3 5 6 7 47 1 5 50 3 4 17 47 1 4 50 3 23 47 1 5 50 3 45 46 47 1 5 50 22 6 7 47 1 4 50 22 17 47 1 4 50 22 34 47 1 4 50 22 45 47 1 5 50 22 45 46 47 1 5 50 31 6 7 47 1 4 50 31 17 47 1 4 50 42 17 47 1 4 50 42 23 47 1 5 50 42 44 45 47 1 6 50 42 44 45 46 47 1 6 50 42 43 45 46 47 1 5 50 5 6 46 47 1 5 50 44 45 46 47 1 3 50 22 52 1 3 50 42 52 1 2 50 52 1 5 0 1 3 4 5 1 5 0 1 2 4 5 1 5 0 1 2 3 5 1 3 0 2 16 1 4 0 1 2 16 1 3 0 29 16 1 5 0 1 3 43 44 1 5 0 1 42 43 44 1 5 0 1 41 42 44 1 5 0 1 3 32 33 1 5 0 1 42 32 33 1 4 0 21 43 33 1 5 0 1 30 32 33 1 5 0 1 3 4 6 1 4 0 21 32 6 1 4 0 21 43 6 1 4 0 21 4 23 1 5 0 2 4 5 45 1 4 0 2 16 45 1 5 0 2 3 44 45 1 4 0 15 5 45 1 5 0 21 4 5 45 1 4 0 21 16 45 1 4 0 21 32 45 1 4 0 21 43 45 1 4 0 21 22 45 1 5 0 29 4 5 45 1 4 0 29 16 45 1 5 0 2 3 44 34 1 5 0 1 43 44 34 1 4 0 15 5 34 1 4 0 15 44 34 1 5 0 21 4 5 34 1 4 0 21 16 34 1 4 0 21 32 34 1 4 0 21 22 34 1 5 0 21 43 44 34 1 5 0 29 4 5 34 1 4 0 29 16 34 1 7 0 1 2 3 4 6 7 1 4 0 2 16 7 1 5 0 2 32 33 7 1 5 0 2 43 44 7 1 4 0 15 5 7 1 4 0 15 33 7 1 4 0 15 44 7 1 5 0 21 4 5 7 1 4 0 21 22 7 1 4 0 21 16 7 1 5 0 21 32 33 7 1 5 0 21 43 44 7 1 5 0 29 4 5 7 1 4 0 29 16 7 1 4 0 2 4 17 1 4 0 2 32 17 1 4 0 2 43 17 1 4 0 21 4 17 1 4 0 21 32 17 1 4 0 21 43 17 1 5 0 2 32 33 46 1 5 0 2 43 44 46 1 5 0 2 3 4 46 1 4 0 15 33 46 1 4 0 15 44 46 1 5 0 21 32 33 46 1 5 0 21 43 44 46 1 4 0 21 22 46 1 5 0 2 32 33 35 1 4 0 15 33 35 1 4 0 21 23 35 1 5 0 21 32 33 35 1 6 0 21 43 44 45 35 1 6 0 2 4 5 6 8 1 7 0 1 2 4 6 7 8 1 8 0 1 2 4 5 6 7 8 1 8 0 1 2 3 5 6 7 8 1 8 0 1 2 3 4 6 7 8 1 7 0 1 2 3 4 45 8 1 4 0 21 23 8 1 6 0 21 43 44 45 8 1 5 0 2 3 23 24 1 5 0 29 30 23 24 1 5 0 1 3 6 18 1 4 0 2 16 18 1 4 0 15 23 18 1 5 0 1 30 31 18 1 8 0 1 2 4 5 6 7 36 1 8 0 1 2 4 5 34 35 36 1 8 0 1 2 4 33 34 35 36 1 5 0 2 3 4 36 1 8 0 1 2 3 4 6 8 9 1 8 0 1 2 3 33 34 8 9 1 8 0 1 2 3 4 34 35 9 1 7 0 21 22 6 7 8 9 1 8 0 1 2 42 43 7 8 9 1 8 0 1 2 42 33 34 35 9 1 7 0 1 2 3 4 17 47 1 8 0 1 2 3 44 45 46 47 1 7 0 1 2 22 6 7 47 1 6 0 1 2 22 17 47 1 4 0 21 23 47 1 7 0 1 2 22 45 46 47 1 6 0 21 22 45 46 47 1 8 0 1 2 42 44 45 46 47 1 8 0 1 41 42 44 45 46 47 1 8 0 1 2 3 43 45 46 47 1 8 0 1 2 42 43 45 46 47 1 8 0 1 41 42 43 45 46 47 1 5 0 1 2 4 52 1 5 0 2 3 4 52 1 6 0 1 2 3 4 52 1 3 0 15 52 1 5 0 1 2 22 52 1 4 0 21 22 52 1 5 0 1 2 31 52 1 5 0 29 30 31 52 1 5 0 1 41 42 52 1 5 0 1 3 8 37 1 8 0 1 2 3 4 17 36 37 1 8 0 1 2 3 4 17 18 37 1 7 0 1 2 3 23 24 37 1 5 0 1 2 4 37 1 7 0 1 2 22 17 18 37 1 7 0 21 22 34 35 36 37 1 7 0 1 2 31 17 18 37 1 7 0 1 2 42 23 24 37 1 4 28 2 3 23 1 4 28 41 42 23 1 4 28 30 23 35 1 4 28 30 23 8 1 5 28 29 30 23 24 1 5 28 15 5 6 18 1 5 28 15 33 34 18 1 5 28 15 44 45 18 1 5 28 29 22 17 18 1 5 28 29 16 17 18 1 6 28 29 30 31 17 18 1 6 28 29 30 32 17 18 1 6 28 15 5 6 7 36 1 6 28 15 44 45 46 36 1 6 28 15 5 6 7 9 1 6 28 15 33 34 35 9 1 6 28 15 44 45 46 9 1 6 28 29 30 4 46 47 1 4 28 15 23 47 1 6 28 29 30 31 34 47 1 6 28 29 30 44 45 47 1 6 28 29 30 32 46 47 1 5 28 29 30 4 52 1 5 28 2 3 4 52 1 4 28 29 22 52 1 4 28 30 31 52 1 5 28 29 30 31 52 1 4 28 29 42 52 1 3 28 41 52 1 7 28 29 30 4 17 18 37 1 5 28 15 17 18 37 1 7 28 15 44 45 46 36 37 1 7 28 29 22 6 7 8 37 1 6 28 29 22 17 18 37 1 7 28 29 22 45 46 36 37 1 7 28 29 30 31 17 18 37 1 5 28 30 23 24 37 1 5 1 2 31 17 9 1 5 1 2 4 17 47 1 5 1 3 33 34 47 1 5 1 3 44 45 47 1 5 1 2 4 45 47 1 5 1 2 31 17 47 1 6 1 2 31 45 46 47 1 6 1 2 3 32 46 47 1 6 1 41 5 6 7 47 1 5 1 2 42 17 47 1 6 1 41 42 43 45 47 1 4 1 3 4 52 1 5 1 2 3 4 52 1 4 1 2 22 52 1 4 1 30 31 52 1 4 1 2 42 52 1 3 1 41 52 1 7 1 2 3 4 17 18 37 1 6 1 2 3 5 24 37 1 5 1 2 16 18 37 1 5 1 2 16 35 37 1 7 1 2 22 6 7 8 37 1 6 1 2 22 17 18 37 1 7 1 2 22 34 35 36 37 1 7 1 2 22 45 46 36 37 1 5 1 2 16 18 10 1 7 1 2 22 6 7 8 10 1 7 1 2 22 34 35 36 10 1 7 1 2 22 45 46 9 10 1 6 1 2 31 17 18 10 1 6 1 2 42 17 18 10 1 6 1 2 3 4 17 25 1 6 1 2 4 5 24 25 1 5 1 3 4 24 25 1 5 1 3 4 5 25 1 6 1 2 31 45 46 25 1 5 1 2 42 17 25 1 5 1 2 4 5 12 1 7 1 2 3 4 17 18 12 1 6 1 2 16 7 8 12 1 5 1 2 16 46 12 1 7 1 2 22 6 7 8 12 1 6 1 2 22 17 18 12 1 7 1 2 22 34 35 36 12 1 6 1 2 3 4 33 12 1 6 1 2 3 4 44 12 1 4 21 22 7 9 1 5 21 5 45 46 47 1 4 21 22 17 47 1 4 21 22 34 47 1 5 21 44 45 46 47 1 4 21 31 17 47 1 4 21 22 33 47 1 3 21 4 52 1 3 21 22 52 1 4 21 16 35 37 1 5 21 6 7 8 37 1 5 21 22 17 36 37 1 5 21 22 17 18 37 1 5 21 31 32 35 37 1 5 21 43 7 8 37 1 5 21 16 7 8 10 1 5 21 16 35 36 10 1 5 21 16 46 9 10 1 7 21 22 6 7 8 9 10 1 5 21 6 8 9 10 1 5 21 22 17 18 10 1 5 21 22 35 9 10 1 5 21 45 8 9 10 1 6 21 31 45 46 9 10 1 5 21 43 7 8 10 1 5 21 43 44 9 10 1 5 21 43 44 18 10 1 5 21 4 34 35 25 1 5 21 4 45 46 25 1 5 21 31 45 46 25 1 5 21 43 7 8 25 1 5 21 43 34 35 25 1 5 21 43 45 46 25 1 5 21 4 5 24 12 1 5 21 4 45 46 12 1 5 21 16 7 8 12 1 3 21 16 12 1 5 21 16 35 36 12 1 4 21 16 46 12 1 5 21 22 17 18 12 1 4 21 22 33 12 1 5 21 31 32 33 12 1 5 21 31 32 24 12 1 5 21 31 45 46 12 1 5 21 43 7 8 12 1 5 21 43 44 18 12 1 5 21 43 44 24 12 1 5 21 43 45 46 12 1 6 21 4 5 7 8 19 1 5 21 4 5 18 19 1 5 21 4 34 18 19 1 5 21 4 45 18 19 1 5 21 16 7 8 19 1 4 21 16 18 19 1 5 21 22 7 8 19 1 4 21 22 18 19 1 5 21 22 34 35 19 1 5 21 22 45 46 19 1 6 21 31 32 7 8 19 1 6 21 31 32 33 18 19 1 6 21 31 32 34 18 19 1 5 21 31 45 18 19 1 5 21 43 7 8 19 1 5 21 43 34 18 19 1 5 21 43 45 18 19 1 5 40 22 6 7 9 1 5 40 22 34 35 9 1 7 40 30 5 6 7 8 9 1 7 40 30 31 6 7 8 9 1 7 40 30 31 32 33 8 9 1 7 40 41 31 33 34 35 9 1 7 40 41 5 6 7 8 9 1 7 40 41 42 6 7 8 9 1 7 40 41 42 44 45 8 9 1 7 40 41 42 43 45 46 9 1 7 40 41 42 43 44 46 9 1 4 40 3 23 47 1 5 40 3 33 34 47 1 5 40 3 44 45 47 1 5 40 41 16 7 47 1 5 40 22 6 7 47 1 4 40 22 34 47 1 4 40 22 45 47 1 4 40 30 23 47 1 5 40 42 6 7 47 1 4 40 42 17 47 1 4 40 42 23 47 1 5 40 42 33 34 47 1 7 40 41 42 44 45 46 47 1 7 40 41 42 43 45 46 47 1 7 40 41 42 43 44 46 47 1 5 40 42 43 44 47 1 4 40 3 4 52 1 4 40 41 31 52 1 3 40 30 52 1 4 40 41 42 52 1 5 40 41 16 18 37 1 5 40 41 16 35 37 1 4 40 22 24 37 1 8 40 3 4 6 7 8 9 10 1 8 40 41 4 5 7 8 9 10 1 5 40 41 16 18 10 1 5 40 41 16 24 10 1 6 40 41 16 35 36 10 1 6 40 41 16 46 9 10 1 8 40 41 42 43 33 8 9 10 1 8 40 41 42 32 34 35 36 10 1 8 40 41 42 43 7 8 9 10 1 8 40 41 42 43 44 8 9 10 1 8 40 41 42 43 34 35 9 10 1 8 40 41 42 43 44 35 9 10 1 8 40 41 42 43 45 8 9 10 1 7 40 41 4 6 7 8 25 1 5 40 41 4 17 25 1 6 40 41 4 5 24 25 1 5 40 3 4 24 25 1 6 40 41 4 45 46 25 1 5 40 22 34 35 25 1 7 40 41 31 6 7 8 25 1 7 40 41 42 32 34 35 25 1 6 40 41 31 45 46 25 1 7 40 41 42 6 7 8 25 1 7 40 41 42 43 7 8 25 1 4 40 42 17 25 1 6 40 42 43 44 24 25 1 6 40 41 43 34 35 25 1 6 40 41 43 45 46 25 1 7 40 41 42 43 45 46 25 1 7 40 41 4 6 7 8 12 1 6 40 41 42 5 24 12 1 7 40 41 4 34 35 36 12 1 6 40 41 4 45 46 12 1 6 40 41 16 7 8 12 1 5 40 41 16 24 12 1 6 40 41 16 35 36 12 1 5 40 41 16 46 12 1 6 40 22 6 7 8 12 1 4 40 22 24 12 1 6 40 22 34 35 36 12 1 5 40 22 45 46 12 1 7 40 41 31 6 7 8 12 1 6 40 41 42 32 33 12 1 6 40 30 31 32 33 12 1 5 40 41 31 32 12 1 6 40 41 42 32 24 12 1 6 40 41 31 45 46 12 1 6 40 42 6 7 8 12 1 7 40 41 42 43 44 8 12 1 6 40 41 42 43 44 12 1 5 40 42 17 18 12 1 6 40 41 42 44 24 12 1 7 40 41 43 34 35 36 12 1 7 40 42 43 34 35 36 12 1 7 40 41 43 44 35 36 12 1 7 40 41 42 34 35 36 12 1 6 40 41 43 45 46 12 1 6 40 41 42 32 33 19 1 6 40 30 31 32 33 19 1 6 40 41 43 7 8 19 1 7 40 41 4 34 35 36 48 1 7 40 41 42 5 46 47 48 1 7 40 41 16 7 8 9 48 1 5 40 41 16 18 48 1 4 40 22 18 48 1 7 40 41 42 32 46 47 48 1 7 40 30 31 32 46 47 48 1 7 40 42 43 44 35 36 48 1 7 40 41 42 43 44 46 48 1 7 40 41 43 44 46 47 48 1 8 40 41 42 43 44 46 47 48 1 5 29 3 33 34 47 1 5 29 3 44 45 47 1 5 29 30 4 5 47 1 5 29 31 6 7 47 1 4 29 31 17 47 1 5 29 31 33 34 47 1 5 29 31 32 33 47 1 5 29 42 6 7 47 1 4 29 42 17 47 1 5 29 42 44 45 47 1 4 29 30 4 52 1 3 29 22 52 1 4 29 30 31 52 1 5 29 42 23 24 37 1 7 29 30 4 6 7 8 25 1 5 29 30 4 17 25 1 6 29 30 4 5 24 25 1 6 29 22 6 7 8 25 1 5 29 22 34 35 25 1 7 29 30 31 6 7 8 25 1 7 29 30 31 32 7 8 25 1 7 29 30 31 32 33 8 25 1 4 29 31 17 25 1 5 29 31 32 24 25 1 6 29 30 31 45 46 25 1 4 29 42 17 25 1 6 29 30 43 45 46 25 1 6 29 30 31 5 24 12 1 6 29 30 16 7 8 12 1 6 29 30 16 35 36 12 1 5 29 30 16 46 12 1 6 29 22 6 7 8 12 1 6 29 22 34 35 36 12 1 5 29 22 45 46 12 1 6 29 31 32 33 18 12 1 5 29 30 32 24 12 1 6 29 30 31 44 24 12 1 6 29 30 43 45 46 12 1 7 29 30 31 5 7 8 19 1 6 29 30 4 5 18 19 1 6 29 30 4 34 18 19 1 6 29 30 4 45 18 19 1 6 29 30 16 7 8 19 1 5 29 22 34 18 19 1 5 29 22 45 18 19 1 7 29 30 31 32 7 8 19 1 6 29 30 31 33 18 19 1 6 29 31 32 33 18 19 1 6 29 30 32 34 18 19 1 7 29 30 31 32 34 35 19 1 6 29 30 31 45 18 19 1 6 29 30 43 44 18 19 1 6 29 30 43 34 18 19 1 6 29 30 43 45 18 19 1 8 29 30 31 5 7 8 9 48 1 7 29 3 4 5 46 47 48 1 5 29 30 16 46 48 1 4 29 22 18 48 1 4 29 22 24 48 1 6 29 22 34 35 36 48 1 4 29 22 46 48 1 8 29 30 31 32 7 8 9 48 1 8 29 30 31 32 33 8 9 48 1 5 29 30 32 24 48 1 7 29 30 31 32 34 47 48 1 8 29 30 31 32 34 35 36 48 1 8 29 30 31 32 33 35 36 48 1 6 29 31 32 46 47 48 1 6 29 30 32 33 47 48 1 7 29 30 31 32 33 47 48 1 4 2 31 17 9 1 4 2 42 17 9 1 4 2 4 17 47 1 4 2 31 17 47 1 4 2 42 17 47 1 3 2 4 52 1 4 2 3 4 52 1 3 2 31 52 1 6 2 3 4 17 36 37 1 5 2 3 23 24 37 1 5 2 42 23 24 37 1 6 2 4 6 7 8 25 1 6 2 3 4 6 24 25 1 4 2 4 17 25 1 5 2 4 5 24 25 1 6 2 3 4 5 24 25 1 5 2 3 5 6 25 1 6 2 3 4 5 6 25 1 5 2 4 45 46 25 1 6 2 31 6 7 8 25 1 4 2 31 17 25 1 5 2 31 32 24 25 1 6 2 3 4 5 34 25 1 6 2 31 32 33 34 25 1 5 2 3 32 33 25 1 6 2 3 32 34 35 25 1 6 2 42 6 7 8 25 1 4 2 42 17 25 1 6 2 3 43 44 24 25 1 6 2 3 4 5 45 25 1 6 2 3 4 44 45 25 1 6 2 3 43 44 45 25 1 6 2 3 43 34 35 25 1 6 2 3 5 6 8 12 1 5 2 4 5 18 12 1 5 2 3 5 24 12 1 6 2 4 34 35 36 12 1 5 2 16 7 8 12 1 5 2 16 35 36 12 1 4 2 16 46 12 1 5 2 3 4 23 12 1 4 2 22 23 12 1 6 2 22 34 35 36 12 1 5 2 22 45 46 12 1 6 2 31 6 7 8 12 1 5 2 3 32 24 12 1 6 2 42 6 7 8 12 1 6 2 3 43 44 45 12 1 6 2 3 43 45 46 12 1 6 2 3 5 7 8 19 1 6 2 3 5 6 18 19 1 7 2 3 4 5 6 18 19 1 5 2 4 5 18 19 1 5 2 4 34 18 19 1 6 2 3 4 34 35 19 1 6 2 3 4 5 35 19 1 6 2 3 4 34 18 19 1 5 2 4 45 18 19 1 6 2 3 4 45 46 19 1 6 2 3 4 45 18 19 1 6 2 3 4 23 8 19 1 6 2 3 4 23 18 19 1 5 2 22 23 18 19 1 5 2 22 34 18 19 1 5 2 22 45 18 19 1 6 2 3 32 7 8 19 1 6 2 3 32 33 18 19 1 6 2 3 4 5 34 19 1 6 2 3 4 33 34 19 1 6 2 3 32 33 34 19 1 5 2 31 32 18 19 1 6 2 3 32 34 18 19 1 5 2 31 45 18 19 1 6 2 3 43 7 8 19 1 6 2 3 43 44 18 19 1 6 2 3 4 5 45 19 1 6 2 3 4 44 45 19 1 6 2 3 43 44 45 19 1 5 2 42 43 18 19 1 6 2 3 43 34 18 19 1 6 2 3 43 45 18 19 1 8 2 3 4 5 7 8 9 48 1 5 2 3 5 24 48 1 7 2 3 4 5 46 47 48 1 7 2 3 4 5 6 47 48 1 4 2 4 46 48 1 4 2 16 18 48 1 4 2 16 24 48 1 5 2 16 35 36 48 1 4 2 16 46 48 1 7 2 3 4 23 8 9 48 1 4 2 22 24 48 1 4 2 22 46 48 1 6 2 3 4 33 18 48 1 5 2 3 32 24 48 1 6 2 3 4 5 34 48 1 6 2 3 4 44 18 48 1 7 2 3 4 44 46 47 48 1 7 2 42 43 44 46 47 48 1 7 2 3 4 5 45 47 48 1 7 2 3 4 44 45 47 48 1 7 2 3 43 44 45 47 48 1 7 2 42 43 44 45 47 48 1 6 2 3 5 24 10 11 1 8 2 3 4 5 35 36 37 11 1 7 2 3 5 46 9 10 11 1 5 2 16 24 10 11 1 5 2 22 24 10 11 1 6 2 3 32 24 10 11 1 8 2 3 4 33 35 36 37 11 1 7 2 3 32 46 9 10 11 1 7 2 3 43 7 8 9 11 1 8 2 3 4 44 35 36 37 11 1 6 2 4 5 24 25 26 1 6 2 3 4 6 25 26 1 6 2 4 5 6 25 26 1 4 2 16 18 26 1 6 2 3 4 23 25 26 1 6 2 31 32 24 25 26 1 7 2 3 32 33 34 25 26 1 7 2 31 32 33 34 25 26 1 6 2 3 4 44 24 26 1 7 2 3 43 44 45 25 26 1 7 2 3 4 44 46 25 26 1 6 2 3 4 6 18 39 1 6 2 3 4 6 37 39 1 6 2 3 5 46 47 39 1 6 2 16 7 8 9 39 1 4 2 16 24 39 1 6 2 16 35 36 37 39 1 6 2 3 4 23 18 39 1 4 2 22 24 39 1 4 2 22 23 39 1 6 2 3 4 33 18 39 1 6 2 3 4 33 34 39 1 6 2 3 32 46 47 39 1 6 2 3 4 44 18 39 1 6 2 3 4 44 24 39 1 6 2 3 43 44 45 39 1 4 51 7 8 9 1 3 51 46 9 1 3 51 46 47 1 4 51 7 36 37 1 3 51 24 37 1 4 51 35 36 37 1 4 51 7 8 10 1 5 51 7 8 9 10 1 3 51 18 10 1 4 51 35 36 10 1 4 51 46 9 10 1 3 51 24 25 1 3 51 46 25 1 2 51 12 1 3 51 24 12 1 3 51 46 12 1 3 51 18 19 1 3 51 46 19 1 5 51 7 8 9 48 1 3 51 18 48 1 4 51 35 36 48 1 4 51 46 47 48 1 5 51 7 8 10 11 1 6 51 7 8 9 10 11 1 4 51 18 10 11 1 5 51 35 36 10 11 1 5 51 35 36 37 11 1 5 51 46 9 10 11 1 6 51 7 8 9 10 26 1 5 51 7 8 25 26 1 3 51 24 26 1 4 51 24 25 26 1 5 51 35 36 37 26 1 4 51 46 25 26 1 3 51 18 39 1 5 51 35 36 37 39 1 6 15 5 6 7 8 9 1 5 15 16 7 8 9 1 4 15 23 8 9 1 2 15 52 1 5 15 5 7 8 37 1 5 15 5 6 18 37 1 4 15 5 24 37 1 5 15 5 46 36 37 1 5 15 16 7 36 37 1 5 15 6 7 36 37 1 4 15 16 18 37 1 4 15 16 35 37 1 6 15 33 34 35 36 37 1 5 15 16 35 36 37 1 6 15 44 45 46 36 37 1 6 15 44 45 35 36 37 1 6 15 44 34 35 36 37 1 4 15 23 8 37 1 5 15 32 7 8 37 1 5 15 32 33 18 37 1 4 15 32 24 37 1 6 15 32 34 35 36 37 1 6 15 32 33 34 36 37 1 4 15 16 34 37 1 5 15 32 46 36 37 1 5 15 43 7 8 37 1 5 15 43 44 18 37 1 5 15 43 44 24 37 1 5 15 16 45 36 37 1 5 15 43 44 45 37 1 6 15 43 45 46 36 37 1 5 15 5 6 18 10 1 6 15 6 7 8 9 10 1 5 15 16 35 9 10 1 4 15 23 8 10 1 6 15 32 7 8 9 10 1 6 15 32 33 34 9 10 1 5 15 32 33 18 10 1 6 15 32 34 35 36 10 1 5 15 43 44 18 10 1 6 15 43 34 35 36 10 1 6 15 43 45 46 9 10 1 5 15 5 7 8 25 1 4 15 5 35 25 1 4 15 6 24 25 1 4 15 16 24 25 1 4 15 16 46 25 1 4 15 23 8 25 1 5 15 32 34 35 25 1 5 15 43 7 8 25 1 4 15 16 45 25 1 5 15 43 34 35 25 1 4 15 5 46 12 1 3 15 16 12 1 5 15 16 35 36 12 1 6 15 32 34 35 36 12 1 4 15 32 46 12 1 5 15 43 44 24 12 1 6 15 43 34 35 36 12 1 4 15 5 35 19 1 4 15 5 46 19 1 4 15 34 18 19 1 3 15 35 19 1 4 15 45 18 19 1 3 15 46 19 1 4 15 23 8 19 1 5 15 32 7 8 19 1 4 15 32 46 19 1 4 15 5 46 48 1 3 15 46 48 1 4 15 32 46 48 1 7 15 16 7 8 9 10 11 1 5 15 7 9 10 11 1 5 15 35 36 10 11 1 5 15 35 36 37 11 1 3 15 47 11 1 7 15 32 33 35 36 37 11 1 5 15 5 6 18 26 1 6 15 5 35 36 37 26 1 6 15 16 7 8 25 26 1 4 15 16 24 26 1 5 15 16 24 25 26 1 5 15 16 46 25 26 1 4 15 23 18 26 1 4 15 23 47 26 1 5 15 32 33 18 26 1 5 15 16 34 25 26 1 5 15 43 44 18 26 1 5 15 16 45 25 26 1 6 15 43 44 46 25 26 1 6 15 5 7 8 9 39 1 4 15 5 24 39 1 6 15 5 35 36 37 39 1 6 15 32 7 8 9 39 1 5 15 32 33 18 39 1 4 15 32 24 39 1 6 15 43 7 8 9 39 1 5 15 43 44 45 39 1 4 41 4 17 9 1 4 41 31 17 9 1 4 41 4 17 47 1 4 41 31 17 47 1 3 41 31 52 1 3 41 42 52 1 5 41 42 23 24 37 1 4 41 4 17 25 1 5 41 4 5 24 25 1 5 41 4 34 35 25 1 4 41 31 17 25 1 5 41 31 32 24 25 1 5 41 42 6 24 25 1 4 41 42 17 25 1 5 41 43 44 24 25 1 6 41 42 43 44 24 25 1 6 41 4 6 7 8 12 1 5 41 42 5 24 12 1 6 41 4 34 35 36 12 1 5 41 16 7 8 12 1 5 41 16 35 36 12 1 4 41 16 46 12 1 5 41 42 23 8 12 1 5 41 42 23 36 12 1 5 41 42 32 24 12 1 5 41 42 44 18 12 1 4 41 43 18 12 1 5 41 42 44 24 12 1 6 41 42 5 7 8 19 1 6 41 42 5 6 18 19 1 5 41 4 34 18 19 1 5 41 4 45 18 19 1 5 41 42 23 18 19 1 6 41 42 32 7 8 19 1 6 41 42 32 33 18 19 1 6 41 42 43 44 34 19 1 6 41 42 43 33 34 19 1 6 41 42 32 33 34 19 1 6 41 31 32 33 34 19 1 6 41 42 32 34 18 19 1 5 41 31 45 18 19 1 5 41 43 44 18 19 1 6 41 42 43 44 18 19 1 6 41 42 43 44 45 19 1 5 41 43 34 18 19 1 6 41 42 43 34 35 19 1 6 41 42 43 34 18 19 1 5 41 43 45 18 19 1 6 41 42 43 45 46 19 1 6 41 42 43 45 18 19 1 6 41 16 7 8 9 48 1 4 41 16 18 48 1 4 41 16 24 48 1 5 41 16 35 36 48 1 4 41 16 46 48 1 6 41 31 32 33 34 48 1 6 41 43 7 8 9 48 1 6 41 42 43 45 9 48 1 5 41 42 44 18 48 1 6 41 43 34 35 36 48 1 6 41 43 44 35 36 48 1 7 41 42 43 44 46 47 48 1 7 41 42 43 44 45 47 48 1 7 41 42 43 6 9 10 11 1 7 41 42 43 6 18 10 11 1 6 41 42 5 24 10 11 1 7 41 42 5 35 36 37 11 1 7 41 42 5 46 9 10 11 1 5 41 16 24 10 11 1 6 41 42 23 18 10 11 1 6 41 42 23 36 37 11 1 7 41 42 43 33 34 9 11 1 8 41 42 43 44 34 9 10 11 1 8 41 42 43 33 34 9 10 11 1 8 41 42 32 33 34 9 10 11 1 7 41 42 43 33 18 10 11 1 6 41 42 32 24 10 11 1 7 41 42 32 46 9 10 11 1 7 41 42 43 7 9 10 11 1 7 41 43 44 8 9 10 11 1 7 41 43 44 45 9 10 11 1 5 41 42 43 45 11 1 6 41 42 44 24 10 11 1 7 41 42 44 45 36 37 11 1 8 41 42 43 44 45 36 37 11 1 4 41 43 37 11 1 7 41 42 44 46 9 10 11 1 7 41 42 43 44 45 47 11 1 6 41 4 5 24 25 26 1 4 41 16 18 26 1 4 41 16 24 26 1 6 41 31 32 24 25 26 1 7 41 42 43 44 34 25 26 1 7 41 42 43 33 34 25 26 1 7 41 42 32 33 34 25 26 1 7 41 31 32 33 34 25 26 1 7 41 42 43 7 8 25 26 1 7 41 42 43 44 8 25 26 1 6 41 42 44 9 10 26 1 6 41 43 44 24 25 26 1 7 41 42 43 44 45 25 26 1 6 41 42 44 45 37 26 1 7 41 42 43 44 46 25 26 1 7 41 42 5 7 8 9 39 1 6 41 42 43 6 18 39 1 5 41 42 5 24 39 1 7 41 42 5 35 36 37 39 1 6 41 16 7 8 9 39 1 4 41 16 18 39 1 4 41 16 24 39 1 6 41 16 35 36 37 39 1 6 41 42 23 8 9 39 1 6 41 42 23 36 37 39 1 7 41 42 32 7 8 9 39 1 6 41 42 43 33 18 39 1 5 41 42 32 24 39 1 6 41 42 44 8 9 39 1 5 41 42 44 24 39 1 7 41 42 44 35 36 37 39 1 7 41 42 43 45 36 37 39 1 6 41 43 44 45 37 39 1 4 30 4 17 9 1 4 30 4 17 47 1 4 30 31 17 47 1 3 30 4 52 1 3 30 31 52 1 4 30 4 17 25 1 5 30 4 5 24 25 1 5 30 4 5 6 25 1 5 30 4 34 35 25 1 5 30 32 7 8 25 1 5 30 31 6 24 25 1 4 30 31 17 25 1 5 30 31 32 34 25 1 5 30 32 33 34 25 1 5 30 31 32 24 25 1 5 30 32 34 35 25 1 5 30 43 7 8 25 1 5 30 43 44 24 25 1 5 30 43 34 35 25 1 6 30 4 6 7 8 12 1 5 30 31 5 24 12 1 6 30 4 34 35 36 12 1 5 30 16 7 8 12 1 5 30 16 35 36 12 1 4 30 16 46 12 1 5 30 31 23 8 12 1 5 30 31 23 36 12 1 6 30 31 32 33 34 12 1 5 30 31 33 18 12 1 4 30 32 18 12 1 4 30 32 24 12 1 5 30 31 44 18 12 1 5 30 31 44 24 12 1 6 30 31 5 7 8 19 1 6 30 31 5 6 18 19 1 5 30 4 34 18 19 1 5 30 4 45 18 19 1 5 30 31 23 8 19 1 5 30 31 23 18 19 1 5 30 32 33 18 19 1 6 30 31 32 33 18 19 1 6 30 31 32 33 34 19 1 5 30 32 34 18 19 1 6 30 31 32 34 35 19 1 6 30 31 32 34 18 19 1 5 30 31 45 18 19 1 5 30 43 44 18 19 1 5 30 43 34 18 19 1 5 30 43 45 18 19 1 6 30 16 7 8 9 48 1 4 30 16 18 48 1 4 30 16 24 48 1 5 30 16 35 36 48 1 4 30 16 46 48 1 6 30 31 23 8 9 48 1 5 30 31 33 18 48 1 4 30 32 24 48 1 6 30 32 34 35 36 48 1 6 30 31 32 46 47 48 1 5 30 31 44 18 48 1 6 30 43 34 35 36 48 1 7 30 31 32 6 18 10 11 1 6 30 31 5 24 10 11 1 7 30 31 5 46 9 10 11 1 5 30 16 24 10 11 1 6 30 31 23 18 10 11 1 6 30 31 23 36 37 11 1 5 30 31 23 47 11 1 6 30 32 33 8 9 11 1 7 30 31 32 7 9 10 11 1 7 30 31 33 34 9 10 11 1 7 30 32 33 34 36 10 11 1 7 30 31 44 8 9 10 11 1 7 30 31 32 45 9 10 11 1 7 30 43 44 45 9 10 11 1 6 30 31 44 24 10 11 1 7 30 31 44 46 9 10 11 1 6 30 4 5 24 25 26 1 4 30 16 18 26 1 4 30 16 24 26 1 7 30 31 32 7 8 25 26 1 7 30 31 32 33 8 25 26 1 6 30 32 33 34 10 26 1 6 30 31 32 24 25 26 1 7 30 31 32 33 34 25 26 1 7 30 31 32 33 35 25 26 1 6 30 31 32 34 37 26 1 5 30 31 46 47 26 1 6 30 43 44 24 25 26 1 7 30 31 5 7 8 9 39 1 6 30 31 32 6 18 39 1 5 30 31 5 24 39 1 7 30 31 5 35 36 37 39 1 5 30 31 5 6 39 1 6 30 16 7 8 9 39 1 4 30 16 18 39 1 4 30 16 24 39 1 6 30 31 23 8 9 39 1 6 30 32 7 8 9 39 1 6 30 31 33 8 9 39 1 6 30 31 33 34 9 39 1 4 30 32 24 39 1 6 30 31 33 34 37 39 1 6 30 31 32 33 34 39 1 6 30 43 7 8 9 39 1 5 30 31 44 24 39 1 5 30 31 44 45 39 1 6 30 31 44 46 47 39 1 4 3 4 17 47 1 3 3 4 52 1 5 3 5 7 8 25 1 5 3 5 6 8 25 1 6 3 4 6 7 8 25 1 5 3 4 6 24 25 1 5 3 4 5 24 25 1 6 3 4 5 6 7 25 1 5 3 43 44 24 25 1 6 3 4 5 6 46 25 1 6 3 4 5 45 46 25 1 5 3 43 45 46 25 1 5 3 5 7 8 12 1 5 3 4 5 8 12 1 5 3 4 6 7 12 1 5 3 4 6 18 12 1 4 3 5 18 12 1 5 3 4 23 18 12 1 5 3 4 23 36 12 1 5 3 32 7 8 12 1 5 3 4 33 18 12 1 6 3 32 34 35 36 12 1 5 3 43 7 8 12 1 6 3 4 5 6 46 12 1 6 3 4 5 45 46 12 1 6 3 4 44 45 46 12 1 5 3 4 44 18 12 1 5 3 4 44 24 12 1 6 3 43 34 35 36 12 1 5 3 5 6 18 19 1 6 3 4 5 6 18 19 1 6 3 4 5 6 7 19 1 5 3 4 45 18 19 1 5 3 4 23 8 19 1 5 3 4 23 18 19 1 5 3 4 33 34 19 1 5 3 32 34 18 19 1 6 3 4 5 6 46 19 1 6 3 4 5 45 46 19 1 6 3 4 44 45 46 19 1 6 3 43 44 45 46 19 1 5 3 43 34 18 19 1 5 3 43 45 18 19 1 5 3 4 6 18 48 1 5 3 4 17 9 48 1 5 3 4 33 18 48 1 6 3 4 5 6 35 48 1 5 3 4 44 18 48 1 5 3 4 44 24 48 1 6 3 4 5 6 46 48 1 6 3 4 23 18 10 11 1 6 3 4 23 36 37 11 1 6 3 4 44 24 10 11 1 7 3 5 7 8 9 10 26 1 7 3 4 5 7 9 10 26 1 6 3 4 5 24 25 26 1 6 3 5 35 36 37 26 1 6 3 4 6 36 37 26 1 7 3 4 5 6 36 37 26 1 5 3 5 46 25 26 1 5 3 4 46 47 26 1 6 3 4 23 36 37 26 1 7 3 32 7 8 9 10 26 1 7 3 4 33 35 36 37 26 1 5 3 32 46 25 26 1 7 3 43 7 8 9 10 26 1 6 3 43 44 24 25 26 1 7 3 4 5 45 46 25 26 1 7 3 43 44 45 46 25 26 1 6 3 4 44 46 25 26 1 6 3 5 7 8 9 39 1 6 3 5 35 36 37 39 1 6 3 4 5 7 37 39 1 6 3 4 5 6 37 39 1 6 3 4 23 8 9 39 1 6 3 4 23 36 37 39 1 6 3 32 7 8 9 39 1 6 3 4 5 6 35 39 1 6 3 4 5 34 35 39 1 6 3 4 33 34 35 39 1 6 3 32 33 34 35 39 1 6 3 43 7 8 9 39 1 6 3 43 44 45 46 39 1 6 3 4 44 46 47 39 1 3 22 17 47 1 2 22 52 1 3 22 17 25 1 4 22 33 8 25 1 4 22 33 35 25 1 4 22 6 18 12 1 4 22 6 36 12 1 5 22 34 35 36 12 1 4 22 23 35 12 1 5 22 33 34 35 12 1 4 22 33 18 12 1 5 22 33 35 36 12 1 4 22 45 36 12 1 3 22 17 19 1 4 22 23 18 19 1 4 22 34 18 19 1 4 22 45 18 19 1 4 22 6 18 48 1 4 22 6 36 48 1 4 22 17 9 48 1 3 22 17 48 1 4 22 7 47 48 1 4 22 34 47 48 1 4 22 46 47 48 1 4 22 33 18 48 1 5 22 33 34 35 48 1 4 22 45 9 48 1 4 22 45 36 48 1 5 22 6 8 9 11 1 5 22 17 9 10 11 1 4 22 17 37 11 1 5 22 23 35 10 11 1 4 22 6 47 26 1 5 22 23 8 25 26 1 4 22 33 47 26 1 4 22 45 47 26 1 3 22 17 39 1 6 22 33 35 36 37 39 1 4 22 23 35 39 1 4 42 43 17 9 1 2 42 52 1 4 42 23 36 10 1 5 42 5 6 7 25 1 4 42 32 24 25 1 5 42 6 7 8 25 1 3 42 17 25 1 4 42 44 24 25 1 5 42 43 44 24 25 1 5 42 5 7 8 12 1 5 42 43 6 7 12 1 5 42 43 6 18 12 1 5 42 32 7 8 12 1 5 42 43 33 18 12 1 6 42 32 34 35 36 12 1 6 42 43 44 45 46 12 1 4 42 44 18 12 1 5 42 5 6 18 19 1 5 42 32 33 34 19 1 4 42 44 8 19 1 6 42 43 44 45 46 19 1 5 42 43 44 18 19 1 4 42 44 35 19 1 5 42 43 45 18 19 1 5 42 43 6 18 48 1 5 42 43 33 18 48 1 4 42 32 46 48 1 4 42 7 47 48 1 5 42 23 8 9 11 1 5 42 44 8 9 11 1 5 42 43 44 46 11 1 7 42 5 7 8 9 10 26 1 6 42 43 6 7 25 26 1 6 42 5 35 36 37 26 1 5 42 5 46 25 26 1 6 42 23 8 9 10 26 1 4 42 23 18 26 1 4 42 23 47 26 1 7 42 32 7 8 9 10 26 1 5 42 32 46 25 26 1 7 42 43 7 8 9 10 26 1 6 42 43 7 8 25 26 1 7 42 43 44 45 9 10 26 1 6 42 43 44 24 25 26 1 7 42 43 44 45 46 25 26 1 6 42 44 35 36 37 26 1 5 42 44 46 25 26 1 5 42 43 46 47 26 1 6 42 5 7 8 9 39 1 6 42 5 35 36 37 39 1 6 42 32 7 8 9 39 1 6 42 43 44 34 35 39 1 6 42 43 33 34 35 39 1 6 42 32 33 34 35 39 1 4 42 44 18 39 1 6 42 44 35 36 37 39 1 4 31 32 17 9 1 2 31 52 1 4 31 23 36 10 1 5 31 5 7 8 25 1 4 31 32 17 25 1 5 31 6 7 8 25 1 5 31 32 33 46 25 1 5 31 5 7 8 12 1 5 31 32 6 7 12 1 5 31 32 6 18 12 1 4 31 5 24 12 1 4 31 23 8 12 1 5 31 32 34 35 12 1 4 31 33 18 12 1 4 31 44 18 12 1 5 31 5 6 18 19 1 4 31 33 8 19 1 4 31 33 35 19 1 4 31 44 8 19 1 5 31 32 6 18 48 1 4 31 5 6 48 1 4 31 33 34 48 1 5 31 23 8 9 11 1 5 31 33 8 9 11 1 6 31 32 34 35 10 11 1 5 31 33 34 35 11 1 5 31 44 8 9 11 1 5 31 44 45 9 11 1 6 31 32 33 46 10 11 1 5 31 32 45 46 11 1 7 31 5 7 8 9 10 26 1 6 31 32 33 7 25 26 1 6 31 5 35 36 37 26 1 5 31 5 46 25 26 1 4 31 23 18 26 1 4 31 23 47 26 1 6 31 33 8 9 10 26 1 7 31 32 7 8 9 10 26 1 6 31 32 33 8 25 26 1 7 31 32 33 34 9 10 26 1 7 31 32 33 34 35 10 26 1 6 31 33 35 36 37 26 1 4 31 33 47 26 1 4 31 46 47 26 1 6 31 44 8 9 10 26 1 6 31 44 35 36 37 26 1 5 31 44 46 25 26 1 6 31 5 7 8 9 39 1 6 31 5 35 36 37 39 1 4 31 33 18 39 1 6 31 33 35 36 37 39 1 6 31 32 33 34 35 39 1 5 31 44 8 9 39 1 4 31 44 18 39 1 6 31 44 35 36 37 39 1 2 4 52 1 4 4 23 18 10 1 4 4 6 24 25 1 3 4 17 25 1 4 4 5 24 25 1 5 4 44 45 46 25 1 5 4 5 7 8 12 1 4 4 6 18 12 1 5 4 5 6 24 12 1 4 4 23 24 12 1 4 4 23 36 12 1 5 4 5 34 35 12 1 5 4 33 35 36 12 1 5 4 5 45 46 12 1 4 4 44 18 12 1 5 4 44 35 36 12 1 4 4 6 8 19 1 5 4 5 6 18 19 1 4 4 6 7 19 1 4 4 44 8 19 1 4 4 44 45 19 1 4 4 44 35 19 1 4 4 44 46 19 1 6 4 5 7 8 9 48 1 6 4 5 6 7 9 48 1 4 4 6 36 48 1 5 4 5 46 47 48 1 4 4 17 18 48 1 5 4 5 6 24 48 1 4 4 23 24 48 1 4 4 44 46 48 1 4 4 44 45 48 1 5 4 6 8 9 11 1 5 4 5 7 9 11 1 5 4 6 7 9 11 1 5 4 7 8 9 11 1 5 4 23 8 9 11 1 6 4 5 6 24 10 11 1 5 4 23 24 10 11 1 5 4 33 8 9 11 1 5 4 33 34 10 11 1 5 4 5 34 35 11 1 4 4 33 47 11 1 5 4 44 8 9 11 1 6 4 44 45 46 10 11 1 5 4 5 45 46 11 1 7 4 5 7 8 9 10 26 1 7 4 5 6 7 9 10 26 1 5 4 6 36 37 26 1 6 4 5 35 36 37 26 1 6 4 5 6 36 37 26 1 4 4 6 47 26 1 5 4 5 6 47 26 1 4 4 23 18 26 1 4 4 23 47 26 1 6 4 33 35 36 37 26 1 4 4 33 47 26 1 4 4 44 24 26 1 6 4 5 6 46 25 26 1 6 4 44 35 36 37 26 1 6 4 5 6 7 9 39 1 4 4 6 18 39 1 6 4 5 35 36 37 39 1 5 4 5 7 8 39 1 4 4 17 9 39 1 4 4 17 37 39 1 4 4 17 18 39 1 4 4 23 24 39 1 4 4 33 18 39 1 6 4 33 35 36 37 39 1 4 4 44 18 39 1 6 4 44 35 36 37 39 1 3 16 17 25 1 3 16 24 12 1 4 16 34 36 12 1 4 16 45 36 12 1 3 16 17 19 1 3 16 18 19 1 4 16 7 9 48 1 4 16 7 47 48 1 4 16 35 36 48 1 4 16 46 47 48 1 4 16 34 36 48 1 4 16 45 9 48 1 4 16 45 36 48 1 5 16 17 9 10 11 1 4 16 17 18 11 1 4 16 7 37 26 1 6 16 7 8 9 10 26 1 4 16 46 47 26 1 4 16 24 10 26 1 4 16 45 47 26 1 4 16 7 37 39 1 3 16 24 39 1 4 43 44 24 25 1 5 43 44 7 8 12 1 4 43 6 18 12 1 5 43 44 34 35 12 1 4 43 33 18 12 1 4 43 44 7 19 1 3 43 17 19 1 4 43 33 8 19 1 4 43 33 35 19 1 4 43 34 35 19 1 4 43 17 18 48 1 4 43 45 9 48 1 4 43 44 9 48 1 4 43 45 36 48 1 4 43 45 46 48 1 5 43 6 8 9 11 1 5 43 44 45 8 11 1 5 43 6 7 8 11 1 5 43 33 8 9 11 1 6 43 44 45 35 10 11 1 6 43 44 45 46 36 11 1 5 43 44 8 9 11 1 5 43 44 45 9 11 1 6 43 6 8 9 10 26 1 5 43 6 7 25 26 1 5 43 6 36 37 26 1 4 43 6 47 26 1 6 43 33 35 36 37 26 1 4 43 33 47 26 1 6 43 7 8 9 10 26 1 4 43 44 24 26 1 5 43 45 46 25 26 1 5 43 45 36 37 26 1 6 43 44 35 36 37 26 1 6 43 44 45 36 37 26 1 4 43 45 47 26 1 5 43 44 45 47 26 1 5 43 6 8 9 39 1 4 43 6 18 39 1 4 43 17 37 39 1 4 43 17 18 39 1 4 43 33 18 39 1 6 43 33 35 36 37 39 1 6 43 44 45 35 36 39 1 4 43 44 18 39 1 6 43 44 35 36 37 39 1 3 32 17 25 1 5 32 33 7 8 12 1 4 32 6 18 12 1 5 32 33 34 35 12 1 4 32 33 18 12 1 4 32 6 8 19 1 4 32 7 8 19 1 4 32 34 35 19 1 4 32 17 18 48 1 4 32 34 9 48 1 4 32 34 47 48 1 4 32 34 35 48 1 4 32 46 47 48 1 4 32 33 47 48 1 4 32 45 9 48 1 4 32 45 36 48 1 5 32 6 8 9 11 1 5 32 6 7 9 11 1 5 32 33 8 9 11 1 5 32 33 34 9 11 1 6 32 33 34 9 10 11 1 6 32 33 34 36 10 11 1 6 32 6 8 9 10 26 1 5 32 6 7 25 26 1 5 32 6 36 37 26 1 4 32 6 47 26 1 6 32 7 8 9 10 26 1 5 32 7 8 25 26 1 6 32 33 35 36 37 26 1 6 32 33 34 36 37 26 1 6 32 33 34 35 37 26 1 5 32 45 46 25 26 1 5 32 45 36 37 26 1 4 32 45 47 26 1 5 32 6 8 9 39 1 4 32 6 18 39 1 5 32 33 7 8 39 1 4 32 17 37 39 1 4 32 17 18 39 1 4 32 33 18 39 1 6 32 33 35 36 37 39 1 5 5 6 7 8 12 1 4 5 6 24 12 1 4 5 7 9 48 1 4 5 7 8 48 1 4 5 6 47 48 1 4 5 46 47 48 1 4 5 34 9 48 1 4 5 34 35 48 1 4 5 45 9 48 1 5 5 6 8 9 11 1 5 5 6 7 9 11 1 5 5 7 8 9 11 1 4 5 7 37 11 1 5 5 6 7 36 11 1 6 5 6 8 9 10 26 1 6 5 6 7 9 10 26 1 6 5 7 8 9 10 26 1 5 5 6 7 25 26 1 5 5 6 36 37 26 1 5 5 35 36 37 26 1 5 5 34 36 37 26 1 5 5 45 46 25 26 1 5 5 6 46 47 26 1 5 5 45 36 37 26 1 4 5 45 47 26 1 4 5 6 18 39 1 5 5 6 7 9 39 1 5 5 7 8 9 39 1 6 5 6 7 8 9 39 1 5 5 6 35 36 39 1 4 23 8 9 10 1 3 23 18 12 1 3 23 36 12 1 3 23 8 19 1 3 23 18 19 1 4 23 8 10 11 1 4 23 8 9 11 1 4 23 36 10 11 1 4 23 35 37 11 1 4 23 8 10 26 1 4 23 24 10 26 1 4 23 35 10 26 1 3 23 47 39 1 4 44 45 18 12 1 3 44 18 19 1 4 44 7 9 48 1 4 44 7 8 48 1 4 44 34 9 48 1 4 44 34 35 48 1 4 44 45 47 48 1 4 44 46 47 48 1 4 44 45 46 48 1 5 44 7 8 9 11 1 4 44 24 10 11 1 4 44 18 10 11 1 4 44 46 37 11 1 4 44 24 10 26 1 5 44 45 46 25 26 1 4 44 46 47 26 1 5 44 45 46 47 26 1 5 44 45 46 9 39 1 5 44 7 8 9 39 1 3 44 24 39 1 5 44 45 35 36 39 1 4 33 7 9 48 1 4 33 7 8 48 1 4 33 8 9 48 1 4 33 34 35 48 1 3 33 47 48 1 5 33 34 8 10 11 1 5 33 34 35 9 11 1 4 33 24 10 11 1 5 33 34 35 36 11 1 5 33 35 36 37 11 1 4 33 46 37 11 1 4 33 24 10 26 1 5 33 35 36 37 26 1 4 33 34 47 26 1 4 33 34 18 39 1 3 6 18 19 1 4 6 8 9 48 1 4 6 7 8 48 1 5 6 7 8 9 11 1 4 6 24 10 11 1 4 6 35 37 11 1 4 6 46 37 11 1 4 6 24 10 26 1 4 6 7 47 26 1 5 6 7 8 9 39 1 3 6 24 39 1 4 6 35 36 39 1 2 52 11 1 2 52 26 1 2 52 39 1 3 17 9 39 1 3 17 37 39 1 3 17 18 39 1 3 17 47 39 1 4 45 35 37 11 1 4 45 36 37 11 1 4 45 46 47 26 1 4 45 8 9 39 1 4 45 35 36 39 1 4 34 36 37 11 1 5 34 8 10 11 38 1 4 34 8 12 38 1 5 34 35 9 26 38 1 5 34 35 9 10 38 1 4 34 8 9 38 1 5 34 35 9 39 38 1 4 34 8 48 38 1 4 34 18 11 38 1 4 34 18 12 38 1 4 34 18 26 38 1 4 34 35 19 38 1 4 34 18 19 38 1 4 34 18 39 38 1 4 34 18 48 38 1 4 34 36 11 38 1 5 34 35 10 11 38 1 4 34 35 12 38 1 4 34 36 26 38 1 5 34 35 36 26 38 1 4 34 36 37 38 1 5 34 35 36 37 38 1 4 34 36 39 38 1 5 34 35 36 39 38 1 4 34 47 26 38 1 4 34 47 48 38 1 5 34 35 36 48 38 1 4 34 47 39 38 1 4 7 9 11 38 1 4 7 8 12 38 1 4 7 9 26 38 1 5 7 8 10 11 38 1 6 7 8 9 10 11 38 1 4 7 9 10 38 1 4 7 9 39 38 1 5 7 8 9 39 38 1 4 7 8 19 38 1 6 7 8 9 10 26 38 1 5 7 8 25 26 38 1 4 7 36 11 38 1 4 7 36 26 38 1 4 7 36 37 38 1 4 7 36 39 38 1 4 7 47 26 38 1 5 7 8 9 48 38 1 4 7 47 39 38 1 4 24 10 11 38 1 3 24 12 38 1 3 24 26 38 1 4 24 25 26 38 1 3 24 48 38 1 3 24 39 38 1 4 46 9 11 38 1 4 46 9 26 38 1 5 46 9 10 11 38 1 4 46 9 39 38 1 3 46 19 38 1 4 46 25 26 38 1 4 46 36 11 38 1 4 46 36 26 38 1 4 46 36 39 38 1 3 46 12 38 1 4 46 47 26 38 1 4 46 47 48 38 1 4 46 47 39 38 1 3 46 48 38 1 4 35 9 11 38 1 4 35 9 26 38 1 5 35 9 10 11 38 1 4 35 36 10 38 1 4 35 9 39 38 1 3 35 19 38 1 5 35 36 37 26 38 1 3 35 12 38 1 4 35 36 37 38 1 3 35 48 38 1 5 35 36 37 39 38 1 3 8 12 38 1 4 8 9 26 38 1 4 8 10 11 38 1 5 8 9 10 11 38 1 3 8 48 38 1 3 8 19 38 1 4 8 25 26 38 1 4 8 9 39 38 1 4 18 10 11 38 1 3 18 12 38 1 3 18 26 38 1 3 18 19 38 1 3 18 39 38 1 3 18 37 38 1 3 18 48 38 1 3 47 26 38 1 3 47 48 38 1 3 47 39 38 1 4 36 37 11 38 1 4 36 37 26 38 1 3 36 37 38 1 4 36 37 39 38 1 3 9 11 38 1 3 9 26 38 1 4 9 10 11 38 1 3 9 39 38 1 3 25 26 38 1 2 19 38 1 3 37 26 38 1 2 37 38 1 3 37 39 38 1 3 10 11 38 1 2 12 38 1 2 48 38 1 2 11 38 1 2 26 38 1 2 39 38
{ "pile_set_name": "Github" }
#!/usr/bin/env python # # euclid graphics maths module # # Copyright (c) 2006 Alex Holkner # Alex.Holkner@mail.google.com # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version 2.1 of the License, or (at your # option) any later version. # # This library is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License # for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this library; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA '''euclid graphics maths module Documentation and tests are included in the file "euclid.txt", or online at http://code.google.com/p/pyeuclid ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' __revision__ = '$Revision$' import math import operator import types try: import itertools.imap as map # XXX Python3 has changed map behavior except ImportError: pass # Some magic here. If _use_slots is True, the classes will derive from # object and will define a __slots__ class variable. If _use_slots is # False, classes will be old-style and will not define __slots__. # # _use_slots = True: Memory efficient, probably faster in future versions # of Python, "better". # _use_slots = False: Ordinary classes, much faster than slots in current # versions of Python (2.4 and 2.5). _use_slots = True # If True, allows components of Vector2 and Vector3 to be set via swizzling; # e.g. v.xyz = (1, 2, 3). This is much, much slower than the more verbose # v.x = 1; v.y = 2; v.z = 3, and slows down ordinary element setting as # well. Recommended setting is False. _enable_swizzle_set = False # Requires class to derive from object. if _enable_swizzle_set: _use_slots = True # Implement _use_slots magic. class _EuclidMetaclass(type): def __new__(cls, name, bases, dct): if '__slots__' in dct: dct['__getstate__'] = cls._create_getstate(dct['__slots__']) dct['__setstate__'] = cls._create_setstate(dct['__slots__']) if _use_slots: return type.__new__(cls, name, bases + (object,), dct) else: if '__slots__' in dct: del dct['__slots__'] return types.ClassType.__new__(type, name, bases, dct) @classmethod def _create_getstate(cls, slots): def __getstate__(self): d = {} for slot in slots: d[slot] = getattr(self, slot) return d return __getstate__ @classmethod def _create_setstate(cls, slots): def __setstate__(self, state): for name, value in list(state.items()): setattr(self, name, value) return __setstate__ __metaclass__ = _EuclidMetaclass class Vector2: __slots__ = ['x', 'y'] def __init__(self, x, y): self.x = x self.y = y def __copy__(self): return self.__class__(self.x, self.y) copy = __copy__ def __repr__(self): return 'Vector2(%.2f, %.2f)' % (self.x, self.y) def __eq__(self, other): if isinstance(other, Vector2): return self.x == other.x and \ self.y == other.y else: assert hasattr(other, '__len__') and len(other) == 2 return self.x == other[0] and \ self.y == other[1] def __ne__(self, other): return not self.__eq__(other) def __bool__(self): return self.x != 0 or self.y != 0 def __len__(self): return 2 def __getitem__(self, key): return (self.x, self.y)[key] def __setitem__(self, key, value): l = [self.x, self.y] l[key] = value self.x, self.y = l def __iter__(self): return iter((self.x, self.y)) def __getattr__(self, name): try: return tuple([(self.x, self.y)['xy'.index(c)] \ for c in name]) except ValueError: raise AttributeError(name) if _enable_swizzle_set: # This has detrimental performance on ordinary setattr as well # if enabled def __setattr__(self, name, value): if len(name) == 1: object.__setattr__(self, name, value) else: try: l = [self.x, self.y] for c, v in map(None, name, value): l['xy'.index(c)] = v self.x, self.y = l except ValueError: raise AttributeError(name) def __add__(self, other): if isinstance(other, Vector2): return Vector2(self.x + other.x, self.y + other.y) else: assert hasattr(other, '__len__') and len(other) == 2 return Vector2(self.x + other[0], self.y + other[1]) __radd__ = __add__ def __iadd__(self, other): if isinstance(other, Vector2): self.x += other.x self.y += other.y else: self.x += other[0] self.y += other[1] return self def __sub__(self, other): if isinstance(other, Vector2): return Vector2(self.x - other.x, self.y - other.y) else: assert hasattr(other, '__len__') and len(other) == 2 return Vector2(self.x - other[0], self.y - other[1]) def __rsub__(self, other): if isinstance(other, Vector2): return Vector2(other.x - self.x, other.y - self.y) else: assert hasattr(other, '__len__') and len(other) == 2 return Vector2(other.x - self[0], other.y - self[1]) def __mul__(self, other): assert type(other) in (int, int, float) return Vector2(self.x * other, self.y * other) __rmul__ = __mul__ def __imul__(self, other): assert type(other) in (int, int, float) self.x *= other self.y *= other return self def __div__(self, other): assert type(other) in (int, int, float) return Vector2(operator.div(self.x, other), operator.div(self.y, other)) def __rdiv__(self, other): assert type(other) in (int, int, float) return Vector2(operator.div(other, self.x), operator.div(other, self.y)) def __floordiv__(self, other): assert type(other) in (int, int, float) return Vector2(operator.floordiv(self.x, other), operator.floordiv(self.y, other)) def __rfloordiv__(self, other): assert type(other) in (int, int, float) return Vector2(operator.floordiv(other, self.x), operator.floordiv(other, self.y)) def __truediv__(self, other): assert type(other) in (int, int, float) return Vector2(operator.truediv(self.x, other), operator.truediv(self.y, other)) def __rtruediv__(self, other): assert type(other) in (int, int, float) return Vector2(operator.truediv(other, self.x), operator.truediv(other, self.y)) def __neg__(self): return Vector2(-self.x, -self.y) __pos__ = __copy__ def __abs__(self): return math.sqrt(self.x ** 2 + \ self.y ** 2) magnitude = __abs__ def magnitude_squared(self): return self.x ** 2 + \ self.y ** 2 def normalize(self): d = self.magnitude() if d: self.x /= d self.y /= d return self def normalized(self): d = self.magnitude() if d: return Vector2(self.x / d, self.y / d) return self.copy() def dot(self, other): assert isinstance(other, Vector2) return self.x * other.x + \ self.y * other.y def cross(self): return Vector2(self.y, -self.x) def reflect(self, normal): # assume normal is normalized assert isinstance(normal, Vector2) d = 2 * (self.x * normal.x + self.y * normal.y) return Vector2(self.x - d * normal.x, self.y - d * normal.y) class Vector3: __slots__ = ['x', 'y', 'z'] def __init__(self, x, y, z): self.x = x self.y = y self.z = z def __copy__(self): return self.__class__(self.x, self.y, self.z) copy = __copy__ def __repr__(self): return 'Vector3(%.2f, %.2f, %.2f)' % (self.x, self.y, self.z) def __eq__(self, other): if isinstance(other, Vector3): return self.x == other.x and \ self.y == other.y and \ self.z == other.z else: assert hasattr(other, '__len__') and len(other) == 3 return self.x == other[0] and \ self.y == other[1] and \ self.z == other[2] def __ne__(self, other): return not self.__eq__(other) def __bool__(self): return self.x != 0 or self.y != 0 or self.z != 0 def __len__(self): return 3 def __getitem__(self, key): return (self.x, self.y, self.z)[key] def __setitem__(self, key, value): l = [self.x, self.y, self.z] l[key] = value self.x, self.y, self.z = l def __iter__(self): return iter((self.x, self.y, self.z)) def __getattr__(self, name): try: return tuple([(self.x, self.y, self.z)['xyz'.index(c)] \ for c in name]) except ValueError: raise AttributeError(name) if _enable_swizzle_set: # This has detrimental performance on ordinary setattr as well # if enabled def __setattr__(self, name, value): if len(name) == 1: object.__setattr__(self, name, value) else: try: l = [self.x, self.y, self.z] for c, v in map(None, name, value): l['xyz'.index(c)] = v self.x, self.y, self.z = l except ValueError: raise AttributeError(name) def __add__(self, other): if isinstance(other, Vector3): # Vector + Vector -> Vector # Vector + Point -> Point # Point + Point -> Vector if self.__class__ is other.__class__: _class = Vector3 else: _class = Point3 return _class(self.x + other.x, self.y + other.y, self.z + other.z) else: assert hasattr(other, '__len__') and len(other) == 3 return Vector3(self.x + other[0], self.y + other[1], self.z + other[2]) __radd__ = __add__ def __iadd__(self, other): if isinstance(other, Vector3): self.x += other.x self.y += other.y self.z += other.z else: self.x += other[0] self.y += other[1] self.z += other[2] return self def __sub__(self, other): if isinstance(other, Vector3): # Vector - Vector -> Vector # Vector - Point -> Point # Point - Point -> Vector if self.__class__ is other.__class__: _class = Vector3 else: _class = Point3 return Vector3(self.x - other.x, self.y - other.y, self.z - other.z) else: assert hasattr(other, '__len__') and len(other) == 3 return Vector3(self.x - other[0], self.y - other[1], self.z - other[2]) def __rsub__(self, other): if isinstance(other, Vector3): return Vector3(other.x - self.x, other.y - self.y, other.z - self.z) else: assert hasattr(other, '__len__') and len(other) == 3 return Vector3(other.x - self[0], other.y - self[1], other.z - self[2]) def __mul__(self, other): if isinstance(other, Vector3): # TODO component-wise mul/div in-place and on Vector2; docs. if self.__class__ is Point3 or other.__class__ is Point3: _class = Point3 else: _class = Vector3 return _class(self.x * other.x, self.y * other.y, self.z * other.z) else: assert type(other) in (int, int, float) return Vector3(self.x * other, self.y * other, self.z * other) __rmul__ = __mul__ def __imul__(self, other): assert type(other) in (int, int, float) self.x *= other self.y *= other self.z *= other return self def __div__(self, other): assert type(other) in (int, int, float) return Vector3(operator.div(self.x, other), operator.div(self.y, other), operator.div(self.z, other)) def __rdiv__(self, other): assert type(other) in (int, int, float) return Vector3(operator.div(other, self.x), operator.div(other, self.y), operator.div(other, self.z)) def __floordiv__(self, other): assert type(other) in (int, int, float) return Vector3(operator.floordiv(self.x, other), operator.floordiv(self.y, other), operator.floordiv(self.z, other)) def __rfloordiv__(self, other): assert type(other) in (int, int, float) return Vector3(operator.floordiv(other, self.x), operator.floordiv(other, self.y), operator.floordiv(other, self.z)) def __truediv__(self, other): assert type(other) in (int, int, float) return Vector3(operator.truediv(self.x, other), operator.truediv(self.y, other), operator.truediv(self.z, other)) def __rtruediv__(self, other): assert type(other) in (int, int, float) return Vector3(operator.truediv(other, self.x), operator.truediv(other, self.y), operator.truediv(other, self.z)) def __neg__(self): return Vector3(-self.x, -self.y, -self.z) __pos__ = __copy__ def __abs__(self): return math.sqrt(self.x ** 2 + \ self.y ** 2 + \ self.z ** 2) magnitude = __abs__ def magnitude_squared(self): return self.x ** 2 + \ self.y ** 2 + \ self.z ** 2 def normalize(self): d = self.magnitude() if d: self.x /= d self.y /= d self.z /= d return self def normalized(self): d = self.magnitude() if d: return Vector3(self.x / d, self.y / d, self.z / d) return self.copy() def dot(self, other): assert isinstance(other, Vector3) return self.x * other.x + \ self.y * other.y + \ self.z * other.z def cross(self, other): assert isinstance(other, Vector3) return Vector3(self.y * other.z - self.z * other.y, -self.x * other.z + self.z * other.x, self.x * other.y - self.y * other.x) def reflect(self, normal): # assume normal is normalized assert isinstance(normal, Vector3) d = 2 * (self.x * normal.x + self.y * normal.y + self.z * normal.z) return Vector3(self.x - d * normal.x, self.y - d * normal.y, self.z - d * normal.z) class AffineVector3(Vector3): w = 1 def __repr__(self): return 'Vector3(%.2f, %.2f, %.2f, 1.00)' % (self.x, self.y, self.z) def __len__(self): return 4 def __getitem__(self, key): return (self.x, self.y, self.z, 1)[key] def __iter__(self): return iter((self.x, self.y, self.z, 1)) # a b c # e f g # i j k class Matrix3: __slots__ = list('abcefgijk') def __init__(self): self.identity() def __copy__(self): M = Matrix3() M.a = self.a M.b = self.b M.c = self.c M.e = self.e M.f = self.f M.g = self.g M.i = self.i M.j = self.j M.k = self.k return M copy = __copy__ def __repr__(self): return ('Matrix3([% 8.2f % 8.2f % 8.2f\n' \ ' % 8.2f % 8.2f % 8.2f\n' \ ' % 8.2f % 8.2f % 8.2f])') \ % (self.a, self.b, self.c, self.e, self.f, self.g, self.i, self.j, self.k) def __getitem__(self, key): return [self.a, self.e, self.i, self.b, self.f, self.j, self.c, self.g, self.k][key] def __setitem__(self, key, value): L = self[:] L[key] = value (self.a, self.e, self.i, self.b, self.f, self.j, self.c, self.g, self.k) = L def __mul__(self, other): if isinstance(other, Matrix3): # Caching repeatedly accessed attributes in local variables # apparently increases performance by 20%. Attrib: Will McGugan. Aa = self.a Ab = self.b Ac = self.c Ae = self.e Af = self.f Ag = self.g Ai = self.i Aj = self.j Ak = self.k Ba = other.a Bb = other.b Bc = other.c Be = other.e Bf = other.f Bg = other.g Bi = other.i Bj = other.j Bk = other.k C = Matrix3() C.a = Aa * Ba + Ab * Be + Ac * Bi C.b = Aa * Bb + Ab * Bf + Ac * Bj C.c = Aa * Bc + Ab * Bg + Ac * Bk C.e = Ae * Ba + Af * Be + Ag * Bi C.f = Ae * Bb + Af * Bf + Ag * Bj C.g = Ae * Bc + Af * Bg + Ag * Bk C.i = Ai * Ba + Aj * Be + Ak * Bi C.j = Ai * Bb + Aj * Bf + Ak * Bj C.k = Ai * Bc + Aj * Bg + Ak * Bk return C elif isinstance(other, Point2): A = self B = other P = Point2(0, 0) P.x = A.a * B.x + A.b * B.y + A.c P.y = A.e * B.x + A.f * B.y + A.g return P elif isinstance(other, Vector2): A = self B = other V = Vector2(0, 0) V.x = A.a * B.x + A.b * B.y V.y = A.e * B.x + A.f * B.y return V else: other = other.copy() other._apply_transform(self) return other def __imul__(self, other): assert isinstance(other, Matrix3) # Cache attributes in local vars (see Matrix3.__mul__). Aa = self.a Ab = self.b Ac = self.c Ae = self.e Af = self.f Ag = self.g Ai = self.i Aj = self.j Ak = self.k Ba = other.a Bb = other.b Bc = other.c Be = other.e Bf = other.f Bg = other.g Bi = other.i Bj = other.j Bk = other.k self.a = Aa * Ba + Ab * Be + Ac * Bi self.b = Aa * Bb + Ab * Bf + Ac * Bj self.c = Aa * Bc + Ab * Bg + Ac * Bk self.e = Ae * Ba + Af * Be + Ag * Bi self.f = Ae * Bb + Af * Bf + Ag * Bj self.g = Ae * Bc + Af * Bg + Ag * Bk self.i = Ai * Ba + Aj * Be + Ak * Bi self.j = Ai * Bb + Aj * Bf + Ak * Bj self.k = Ai * Bc + Aj * Bg + Ak * Bk return self def identity(self): self.a = self.f = self.k = 1. self.b = self.c = self.e = self.g = self.i = self.j = 0 return self def scale(self, x, y): self *= Matrix3.new_scale(x, y) return self def translate(self, x, y): self *= Matrix3.new_translate(x, y) return self def rotate(self, angle): self *= Matrix3.new_rotate(angle) return self # Static constructors def new_identity(cls): self = cls() return self new_identity = classmethod(new_identity) def new_scale(cls, x, y): self = cls() self.a = x self.f = y return self new_scale = classmethod(new_scale) def new_translate(cls, x, y): self = cls() self.c = x self.g = y return self new_translate = classmethod(new_translate) def new_rotate(cls, angle): self = cls() s = math.sin(angle) c = math.cos(angle) self.a = self.f = c self.b = -s self.e = s return self new_rotate = classmethod(new_rotate) # a b c d # e f g h # i j k l # m n o p class Matrix4: __slots__ = list('abcdefghijklmnop') def __init__(self): self.identity() def __copy__(self): M = Matrix4() M.a = self.a M.b = self.b M.c = self.c M.d = self.d M.e = self.e M.f = self.f M.g = self.g M.h = self.h M.i = self.i M.j = self.j M.k = self.k M.l = self.l M.m = self.m M.n = self.n M.o = self.o M.p = self.p return M copy = __copy__ def __repr__(self): return ('Matrix4([% 8.2f % 8.2f % 8.2f % 8.2f\n' \ ' % 8.2f % 8.2f % 8.2f % 8.2f\n' \ ' % 8.2f % 8.2f % 8.2f % 8.2f\n' \ ' % 8.2f % 8.2f % 8.2f % 8.2f])') \ % (self.a, self.b, self.c, self.d, self.e, self.f, self.g, self.h, self.i, self.j, self.k, self.l, self.m, self.n, self.o, self.p) def __getitem__(self, key): return [self.a, self.e, self.i, self.m, self.b, self.f, self.j, self.n, self.c, self.g, self.k, self.o, self.d, self.h, self.l, self.p][key] def __setitem__(self, key, value): assert not isinstance(key, slice) or \ key.stop - key.start == len(value), 'key length != value length' L = self[:] L[key] = value (self.a, self.e, self.i, self.m, self.b, self.f, self.j, self.n, self.c, self.g, self.k, self.o, self.d, self.h, self.l, self.p) = L def __mul__(self, other): if isinstance(other, Matrix4): # Cache attributes in local vars (see Matrix3.__mul__). Aa = self.a Ab = self.b Ac = self.c Ad = self.d Ae = self.e Af = self.f Ag = self.g Ah = self.h Ai = self.i Aj = self.j Ak = self.k Al = self.l Am = self.m An = self.n Ao = self.o Ap = self.p Ba = other.a Bb = other.b Bc = other.c Bd = other.d Be = other.e Bf = other.f Bg = other.g Bh = other.h Bi = other.i Bj = other.j Bk = other.k Bl = other.l Bm = other.m Bn = other.n Bo = other.o Bp = other.p C = Matrix4() C.a = Aa * Ba + Ab * Be + Ac * Bi + Ad * Bm C.b = Aa * Bb + Ab * Bf + Ac * Bj + Ad * Bn C.c = Aa * Bc + Ab * Bg + Ac * Bk + Ad * Bo C.d = Aa * Bd + Ab * Bh + Ac * Bl + Ad * Bp C.e = Ae * Ba + Af * Be + Ag * Bi + Ah * Bm C.f = Ae * Bb + Af * Bf + Ag * Bj + Ah * Bn C.g = Ae * Bc + Af * Bg + Ag * Bk + Ah * Bo C.h = Ae * Bd + Af * Bh + Ag * Bl + Ah * Bp C.i = Ai * Ba + Aj * Be + Ak * Bi + Al * Bm C.j = Ai * Bb + Aj * Bf + Ak * Bj + Al * Bn C.k = Ai * Bc + Aj * Bg + Ak * Bk + Al * Bo C.l = Ai * Bd + Aj * Bh + Ak * Bl + Al * Bp C.m = Am * Ba + An * Be + Ao * Bi + Ap * Bm C.n = Am * Bb + An * Bf + Ao * Bj + Ap * Bn C.o = Am * Bc + An * Bg + Ao * Bk + Ap * Bo C.p = Am * Bd + An * Bh + Ao * Bl + Ap * Bp return C elif isinstance(other, Point3): A = self B = other P = Point3(0, 0, 0) P.x = A.a * B.x + A.b * B.y + A.c * B.z + A.d P.y = A.e * B.x + A.f * B.y + A.g * B.z + A.h P.z = A.i * B.x + A.j * B.y + A.k * B.z + A.l return P elif isinstance(other, AffineVector3): A = self B = other V = AffineVector3(0, 0, 0) V.x = A.a * B.x + A.b * B.y + A.c * B.z + A.d * B.w V.y = A.e * B.x + A.f * B.y + A.g * B.z + A.h * B.w V.z = A.i * B.x + A.j * B.y + A.k * B.z + A.l * B.w return V elif isinstance(other, Vector3): A = self B = other V = Vector3(0, 0, 0) V.x = A.a * B.x + A.b * B.y + A.c * B.z V.y = A.e * B.x + A.f * B.y + A.g * B.z V.z = A.i * B.x + A.j * B.y + A.k * B.z return V else: other = other.copy() other._apply_transform(self) return other def __imul__(self, other): assert isinstance(other, Matrix4) # Cache attributes in local vars (see Matrix3.__mul__). Aa = self.a Ab = self.b Ac = self.c Ad = self.d Ae = self.e Af = self.f Ag = self.g Ah = self.h Ai = self.i Aj = self.j Ak = self.k Al = self.l Am = self.m An = self.n Ao = self.o Ap = self.p Ba = other.a Bb = other.b Bc = other.c Bd = other.d Be = other.e Bf = other.f Bg = other.g Bh = other.h Bi = other.i Bj = other.j Bk = other.k Bl = other.l Bm = other.m Bn = other.n Bo = other.o Bp = other.p self.a = Aa * Ba + Ab * Be + Ac * Bi + Ad * Bm self.b = Aa * Bb + Ab * Bf + Ac * Bj + Ad * Bn self.c = Aa * Bc + Ab * Bg + Ac * Bk + Ad * Bo self.d = Aa * Bd + Ab * Bh + Ac * Bl + Ad * Bp self.e = Ae * Ba + Af * Be + Ag * Bi + Ah * Bm self.f = Ae * Bb + Af * Bf + Ag * Bj + Ah * Bn self.g = Ae * Bc + Af * Bg + Ag * Bk + Ah * Bo self.h = Ae * Bd + Af * Bh + Ag * Bl + Ah * Bp self.i = Ai * Ba + Aj * Be + Ak * Bi + Al * Bm self.j = Ai * Bb + Aj * Bf + Ak * Bj + Al * Bn self.k = Ai * Bc + Aj * Bg + Ak * Bk + Al * Bo self.l = Ai * Bd + Aj * Bh + Ak * Bl + Al * Bp self.m = Am * Ba + An * Be + Ao * Bi + Ap * Bm self.n = Am * Bb + An * Bf + Ao * Bj + Ap * Bn self.o = Am * Bc + An * Bg + Ao * Bk + Ap * Bo self.p = Am * Bd + An * Bh + Ao * Bl + Ap * Bp return self def identity(self): self.a = self.f = self.k = self.p = 1. self.b = self.c = self.d = self.e = self.g = self.h = \ self.i = self.j = self.l = self.m = self.n = self.o = 0 return self def scale(self, x, y, z): self *= Matrix4.new_scale(x, y, z) return self def translate(self, x, y, z): self *= Matrix4.new_translate(x, y, z) return self def rotatex(self, angle): self *= Matrix4.new_rotatex(angle) return self def rotatey(self, angle): self *= Matrix4.new_rotatey(angle) return self def rotatez(self, angle): self *= Matrix4.new_rotatez(angle) return self def rotate_axis(self, angle, axis): self *= Matrix4.new_rotate_axis(angle, axis) return self def rotate_euler(self, heading, attitude, bank): self *= Matrix4.new_rotate_euler(heading, attitude, bank) return self # Static constructors def new_identity(cls): self = cls() return self new_identity = classmethod(new_identity) def new_scale(cls, x, y, z): self = cls() self.a = x self.f = y self.k = z return self new_scale = classmethod(new_scale) def new_translate(cls, x, y, z): self = cls() self.d = x self.h = y self.l = z return self new_translate = classmethod(new_translate) def new_rotatex(cls, angle): self = cls() s = math.sin(angle) c = math.cos(angle) self.f = self.k = c self.g = -s self.j = s return self new_rotatex = classmethod(new_rotatex) def new_rotatey(cls, angle): self = cls() s = math.sin(angle) c = math.cos(angle) self.a = self.k = c self.c = s self.i = -s return self new_rotatey = classmethod(new_rotatey) def new_rotatez(cls, angle): self = cls() s = math.sin(angle) c = math.cos(angle) self.a = self.f = c self.b = -s self.e = s return self new_rotatez = classmethod(new_rotatez) def new_rotate_axis(cls, angle, axis): assert (isinstance(axis, Vector3)) vector = axis.normalized() x = vector.x y = vector.y z = vector.z self = cls() s = math.sin(angle) c = math.cos(angle) c1 = 1. - c # from the glRotate man page self.a = x * x * c1 + c self.b = x * y * c1 - z * s self.c = x * z * c1 + y * s self.e = y * x * c1 + z * s self.f = y * y * c1 + c self.g = y * z * c1 - x * s self.i = x * z * c1 - y * s self.j = y * z * c1 + x * s self.k = z * z * c1 + c return self new_rotate_axis = classmethod(new_rotate_axis) def new_rotate_euler(cls, heading, attitude, bank): # from http://www.euclideanspace.com/ ch = math.cos(heading) sh = math.sin(heading) ca = math.cos(attitude) sa = math.sin(attitude) cb = math.cos(bank) sb = math.sin(bank) self = cls() self.a = ch * ca self.b = sh * sb - ch * sa * cb self.c = ch * sa * sb + sh * cb self.e = sa self.f = ca * cb self.g = -ca * sb self.i = -sh * ca self.j = sh * sa * cb + ch * sb self.k = -sh * sa * sb + ch * cb return self new_rotate_euler = classmethod(new_rotate_euler) def new_perspective(cls, fov_y, aspect, near, far): # from the gluPerspective man page f = 1 / math.tan(fov_y / 2) self = cls() assert near != 0.0 and near != far self.a = f / aspect self.f = f self.k = (far + near) / (near - far) self.l = 2 * far * near / (near - far) self.o = -1 self.p = 0 return self new_perspective = classmethod(new_perspective) class Quaternion: # All methods and naming conventions based off # http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions # w is the real part, (x, y, z) are the imaginary parts __slots__ = ['w', 'x', 'y', 'z'] def __init__(self): self.identity() def __copy__(self): Q = Quaternion() Q.w = self.w Q.x = self.x Q.y = self.y Q.z = self.z copy = __copy__ def __repr__(self): return 'Quaternion(real=%.2f, imag=<%.2f, %.2f, %.2f>)' % \ (self.w, self.x, self.y, self.z) def __mul__(self, other): if isinstance(other, Quaternion): Ax = self.x Ay = self.y Az = self.z Aw = self.w Bx = other.x By = other.y Bz = other.z Bw = other.w Q = Quaternion() Q.x = Ax * Bw + Ay * Bz - Az * By + Aw * Bx Q.y = -Ax * Bz + Ay * Bw + Az * Bx + Aw * By Q.z = Ax * By - Ay * Bx + Az * Bw + Aw * Bz Q.w = -Ax * Bx - Ay * By - Az * Bz + Aw * Bw return Q elif isinstance(other, Vector3): w = self.w x = self.x y = self.y z = self.z Vx = other.x Vy = other.y Vz = other.z return other.__class__( \ w * w * Vx + 2 * y * w * Vz - 2 * z * w * Vy + \ x * x * Vx + 2 * y * x * Vy + 2 * z * x * Vz - \ z * z * Vx - y * y * Vx, 2 * x * y * Vx + y * y * Vy + 2 * z * y * Vz + \ 2 * w * z * Vx - z * z * Vy + w * w * Vy - \ 2 * x * w * Vz - x * x * Vy, 2 * x * z * Vx + 2 * y * z * Vy + \ z * z * Vz - 2 * w * y * Vx - y * y * Vz + \ 2 * w * x * Vy - x * x * Vz + w * w * Vz) else: other = other.copy() other._apply_transform(self) return other def __imul__(self, other): assert isinstance(other, Quaternion) Ax = self.x Ay = self.y Az = self.z Aw = self.w Bx = other.x By = other.y Bz = other.z Bw = other.w self.x = Ax * Bw + Ay * Bz - Az * By + Aw * Bx self.y = -Ax * Bz + Ay * Bw + Az * Bx + Aw * By self.z = Ax * By - Ay * Bx + Az * Bw + Aw * Bz self.w = -Ax * Bx - Ay * By - Az * Bz + Aw * Bw return self def __abs__(self): return math.sqrt(self.w ** 2 + \ self.x ** 2 + \ self.y ** 2 + \ self.z ** 2) magnitude = __abs__ def magnitude_squared(self): return self.w ** 2 + \ self.x ** 2 + \ self.y ** 2 + \ self.z ** 2 def identity(self): self.w = 1 self.x = 0 self.y = 0 self.z = 0 return self def rotate_axis(self, angle, axis): self *= Quaternion.new_rotate_axis(angle, axis) return self def rotate_euler(self, heading, attitude, bank): self *= Quaternion.new_rotate_euler(heading, attitude, bank) return self def conjugated(self): Q = Quaternion() Q.w = self.w Q.x = -self.x Q.y = -self.y Q.z = -self.z return Q def normalize(self): d = self.magnitude() if d != 0: self.w /= d self.x /= d self.y /= d self.z /= d return self def normalized(self): d = self.magnitude() if d != 0: Q = Quaternion() Q.w /= d Q.x /= d Q.y /= d Q.z /= d return Q else: return self.copy() def get_angle_axis(self): if self.w > 1: self = self.normalized() angle = 2 * math.acos(self.w) s = math.sqrt(1 - self.w ** 2) if s < 0.001: return angle, Vector3(1, 0, 0) else: return angle, Vector3(self.x / s, self.y / s, self.z / s) def get_euler(self): t = self.x * self.y + self.z * self.w if t > 0.4999: heading = 2 * math.atan2(self.x, self.w) attitude = math.pi / 2 bank = 0 elif t < -0.4999: heading = -2 * math.atan2(self.x, self.w) attitude = -math.pi / 2 bank = 0 else: sqx = self.x ** 2 sqy = self.y ** 2 sqz = self.z ** 2 heading = math.atan2(2 * self.y * self.w - 2 * self.x * self.z, 1 - 2 * sqy - 2 * sqz) attitude = math.asin(2 * t) bank = math.atan2(2 * self.x * self.w - 2 * self.y * self.z, 1 - 2 * sqx - 2 * sqz) return heading, attitude, bank def get_matrix(self): xx = self.x ** 2 xy = self.x * self.y xz = self.x * self.z xw = self.x * self.w yy = self.y ** 2 yz = self.y * self.z yw = self.y * self.w zz = self.z ** 2 zw = self.z * self.w M = Matrix4() M.a = 1 - 2 * (yy + zz) M.b = 2 * (xy - zw) M.c = 2 * (xz + yw) M.e = 2 * (xy + zw) M.f = 1 - 2 * (xx + zz) M.g = 2 * (yz - xw) M.i = 2 * (xz - yw) M.j = 2 * (yz + xw) M.k = 1 - 2 * (xx + yy) return M # Static constructors def new_identity(cls): return cls() new_identity = classmethod(new_identity) def new_rotate_axis(cls, angle, axis): assert (isinstance(axis, Vector3)) axis = axis.normalized() s = math.sin(angle / 2) Q = cls() Q.w = math.cos(angle / 2) Q.x = axis.x * s Q.y = axis.y * s Q.z = axis.z * s return Q new_rotate_axis = classmethod(new_rotate_axis) def new_rotate_euler(cls, heading, attitude, bank): Q = cls() c1 = math.cos(heading / 2) s1 = math.sin(heading / 2) c2 = math.cos(attitude / 2) s2 = math.sin(attitude / 2) c3 = math.cos(bank / 2) s3 = math.sin(bank / 2) Q.w = c1 * c2 * c3 - s1 * s2 * s3 Q.x = s1 * s2 * c3 + c1 * c2 * s3 Q.y = s1 * c2 * c3 + c1 * s2 * s3 Q.z = c1 * s2 * c3 - s1 * c2 * s3 return Q new_rotate_euler = classmethod(new_rotate_euler) def new_interpolate(cls, q1, q2, t): assert isinstance(q1, Quaternion) and isinstance(q2, Quaternion) Q = cls() costheta = q1.w * q2.w + q1.x * q2.x + q1.y * q2.y + q1.z * q2.z theta = math.acos(costheta) if abs(theta) < 0.01: Q.w = q2.w Q.x = q2.x Q.y = q2.y Q.z = q2.z return Q sintheta = math.sqrt(1.0 - costheta * costheta) if abs(sintheta) < 0.01: Q.w = (q1.w + q2.w) * 0.5 Q.x = (q1.x + q2.x) * 0.5 Q.y = (q1.y + q2.y) * 0.5 Q.z = (q1.z + q2.z) * 0.5 return Q ratio1 = math.sin((1 - t) * theta) / sintheta ratio2 = math.sin(t * theta) / sintheta Q.w = q1.w * ratio1 + q2.w * ratio2 Q.x = q1.x * ratio1 + q2.x * ratio2 Q.y = q1.y * ratio1 + q2.y * ratio2 Q.z = q1.z * ratio1 + q2.z * ratio2 return Q new_interpolate = classmethod(new_interpolate) # Geometry # Much maths thanks to Paul Bourke, http://astronomy.swin.edu.au/~pbourke # --------------------------------------------------------------------------- class Geometry: def _connect_unimplemented(self, other): raise AttributeError('Cannot connect %s to %s' % \ (self.__class__, other.__class__)) def _intersect_unimplemented(self, other): raise AttributeError('Cannot intersect %s and %s' % \ (self.__class__, other.__class__)) _intersect_point2 = _intersect_unimplemented _intersect_line2 = _intersect_unimplemented _intersect_circle = _intersect_unimplemented _connect_point2 = _connect_unimplemented _connect_line2 = _connect_unimplemented _connect_circle = _connect_unimplemented _intersect_point3 = _intersect_unimplemented _intersect_line3 = _intersect_unimplemented _intersect_sphere = _intersect_unimplemented _intersect_plane = _intersect_unimplemented _connect_point3 = _connect_unimplemented _connect_line3 = _connect_unimplemented _connect_sphere = _connect_unimplemented _connect_plane = _connect_unimplemented def intersect(self, other): raise NotImplementedError def connect(self, other): raise NotImplementedError def distance(self, other): c = self.connect(other) if c: return c.length return 0.0 def _intersect_point2_circle(P, C): return abs(P - C.c) <= C.r def _intersect_line2_line2(A, B): d = B.v.y * A.v.x - B.v.x * A.v.y if d == 0: return None dy = A.p.y - B.p.y dx = A.p.x - B.p.x ua = (B.v.x * dy - B.v.y * dx) / d if not A._u_in(ua): return None ub = (A.v.x * dy - A.v.y * dx) / d if not B._u_in(ub): return None return Point2(A.p.x + ua * A.v.x, A.p.y + ua * A.v.y) def _intersect_line2_circle(L, C): a = L.v.magnitude_squared() b = 2 * (L.v.x * (L.p.x - C.c.x) + \ L.v.y * (L.p.y - C.c.y)) c = C.c.magnitude_squared() + \ L.p.magnitude_squared() - \ 2 * C.c.dot(L.p) - \ C.r ** 2 det = b ** 2 - 4 * a * c if det < 0: return None sq = math.sqrt(det) u1 = (-b + sq) / (2 * a) u2 = (-b - sq) / (2 * a) if not L._u_in(u1): u1 = max(min(u1, 1.0), 0.0) if not L._u_in(u2): u2 = max(min(u2, 1.0), 0.0) return LineSegment2(Point2(L.p.x + u1 * L.v.x, L.p.y + u1 * L.v.y), Point2(L.p.x + u2 * L.v.x, L.p.y + u2 * L.v.y)) def _connect_point2_line2(P, L): d = L.v.magnitude_squared() assert d != 0 u = ((P.x - L.p.x) * L.v.x + \ (P.y - L.p.y) * L.v.y) / d if not L._u_in(u): u = max(min(u, 1.0), 0.0) return LineSegment2(P, Point2(L.p.x + u * L.v.x, L.p.y + u * L.v.y)) def _connect_point2_circle(P, C): v = P - C.c v.normalize() v *= C.r return LineSegment2(P, Point2(C.c.x + v.x, C.c.y + v.y)) def _connect_line2_line2(A, B): d = B.v.y * A.v.x - B.v.x * A.v.y if d == 0: # Parallel, connect an endpoint with a line if isinstance(B, Ray2) or isinstance(B, LineSegment2): p1, p2 = _connect_point2_line2(B.p, A) return p2, p1 # No endpoint (or endpoint is on A), possibly choose arbitrary point # on line. return _connect_point2_line2(A.p, B) dy = A.p.y - B.p.y dx = A.p.x - B.p.x ua = (B.v.x * dy - B.v.y * dx) / d if not A._u_in(ua): ua = max(min(ua, 1.0), 0.0) ub = (A.v.x * dy - A.v.y * dx) / d if not B._u_in(ub): ub = max(min(ub, 1.0), 0.0) return LineSegment2(Point2(A.p.x + ua * A.v.x, A.p.y + ua * A.v.y), Point2(B.p.x + ub * B.v.x, B.p.y + ub * B.v.y)) def _connect_circle_line2(C, L): d = L.v.magnitude_squared() assert d != 0 u = ((C.c.x - L.p.x) * L.v.x + (C.c.y - L.p.y) * L.v.y) / d if not L._u_in(u): u = max(min(u, 1.0), 0.0) point = Point2(L.p.x + u * L.v.x, L.p.y + u * L.v.y) v = (point - C.c) v.normalize() v *= C.r return LineSegment2(Point2(C.c.x + v.x, C.c.y + v.y), point) def _connect_circle_circle(A, B): v = B.c - A.c v.normalize() return LineSegment2(Point2(A.c.x + v.x * A.r, A.c.y + v.y * A.r), Point2(B.c.x - v.x * B.r, B.c.y - v.y * B.r)) class Point2(Vector2, Geometry): def __repr__(self): return 'Point2(%.2f, %.2f)' % (self.x, self.y) def intersect(self, other): return other._intersect_point2(self) def _intersect_circle(self, other): return _intersect_point2_circle(self, other) def connect(self, other): return other._connect_point2(self) def _connect_point2(self, other): return LineSegment2(other, self) def _connect_line2(self, other): c = _connect_point2_line2(self, other) if c: return c._swap() def _connect_circle(self, other): c = _connect_point2_circle(self, other) if c: return c._swap() class Line2(Geometry): __slots__ = ['p', 'v'] def __init__(self, *args): if len(args) == 3: assert isinstance(args[0], Point2) and \ isinstance(args[1], Vector2) and \ type(args[2]) == float self.p = args[0].copy() self.v = args[1] * args[2] / abs(args[1]) elif len(args) == 2: if isinstance(args[0], Point2) and isinstance(args[1], Point2): self.p = args[0].copy() self.v = args[1] - args[0] elif isinstance(args[0], Point2) and isinstance(args[1], Vector2): self.p = args[0].copy() self.v = args[1].copy() else: raise AttributeError('%r' % (args,)) elif len(args) == 1: if isinstance(args[0], Line2): self.p = args[0].p.copy() self.v = args[0].v.copy() else: raise AttributeError('%r' % (args,)) else: raise AttributeError('%r' % (args,)) if not self.v: raise AttributeError('Line has zero-length vector') def __copy__(self): return self.__class__(self.p, self.v) copy = __copy__ def __repr__(self): return 'Line2(<%.2f, %.2f> + u<%.2f, %.2f>)' % \ (self.p.x, self.p.y, self.v.x, self.v.y) p1 = property(lambda self: self.p) p2 = property(lambda self: Point2(self.p.x + self.v.x, self.p.y + self.v.y)) def _apply_transform(self, t): self.p = t * self.p self.v = t * self.v def _u_in(self, u): return True def intersect(self, other): return other._intersect_line2(self) def _intersect_line2(self, other): return _intersect_line2_line2(self, other) def _intersect_circle(self, other): return _intersect_line2_circle(self, other) def connect(self, other): return other._connect_line2(self) def _connect_point2(self, other): return _connect_point2_line2(other, self) def _connect_line2(self, other): return _connect_line2_line2(other, self) def _connect_circle(self, other): return _connect_circle_line2(other, self) class Ray2(Line2): def __repr__(self): return 'Ray2(<%.2f, %.2f> + u<%.2f, %.2f>)' % \ (self.p.x, self.p.y, self.v.x, self.v.y) def _u_in(self, u): return u >= 0.0 class LineSegment2(Line2): def __repr__(self): return 'LineSegment2(<%.2f, %.2f> to <%.2f, %.2f>)' % \ (self.p.x, self.p.y, self.p.x + self.v.x, self.p.y + self.v.y) def _u_in(self, u): return u >= 0.0 and u <= 1.0 def __abs__(self): return abs(self.v) def magnitude_squared(self): return self.v.magnitude_squared() def _swap(self): # used by connect methods to switch order of points self.p = self.p2 self.v *= -1 return self length = property(lambda self: abs(self.v)) class Circle(Geometry): __slots__ = ['c', 'r'] def __init__(self, center, radius): assert isinstance(center, Vector2) and type(radius) == float self.c = center.copy() self.r = radius def __copy__(self): return self.__class__(self.c, self.r) copy = __copy__ def __repr__(self): return 'Circle(<%.2f, %.2f>, radius=%.2f)' % \ (self.c.x, self.c.y, self.r) def _apply_transform(self, t): self.c = t * self.c def intersect(self, other): return other._intersect_circle(self) def _intersect_point2(self, other): return _intersect_point2_circle(other, self) def _intersect_line2(self, other): return _intersect_line2_circle(other, self) def connect(self, other): return other._connect_circle(self) def _connect_point2(self, other): return _connect_point2_circle(other, self) def _connect_line2(self, other): c = _connect_circle_line2(self, other) if c: return c._swap() def _connect_circle(self, other): return _connect_circle_circle(other, self) # 3D Geometry # ------------------------------------------------------------------------- def _connect_point3_line3(P, L): d = L.v.magnitude_squared() assert d != 0 u = ((P.x - L.p.x) * L.v.x + \ (P.y - L.p.y) * L.v.y + \ (P.z - L.p.z) * L.v.z) / d if not L._u_in(u): u = max(min(u, 1.0), 0.0) return LineSegment3(P, Point3(L.p.x + u * L.v.x, L.p.y + u * L.v.y, L.p.z + u * L.v.z)) def _connect_point3_sphere(P, S): v = P - S.c v.normalize() v *= S.r return LineSegment3(P, Point3(S.c.x + v.x, S.c.y + v.y, S.c.z + v.z)) def _connect_point3_plane(p, plane): n = plane.n.normalized() d = p.dot(plane.n) - plane.k return LineSegment3(p, Point3(p.x - n.x * d, p.y - n.y * d, p.z - n.z * d)) def _connect_line3_line3(A, B): assert A.v and B.v p13 = A.p - B.p d1343 = p13.dot(B.v) d4321 = B.v.dot(A.v) d1321 = p13.dot(A.v) d4343 = B.v.magnitude_squared() denom = A.v.magnitude_squared() * d4343 - d4321 ** 2 if denom == 0: # Parallel, connect an endpoint with a line if isinstance(B, Ray3) or isinstance(B, LineSegment3): return _connect_point3_line3(B.p, A)._swap() # No endpoint (or endpoint is on A), possibly choose arbitrary # point on line. return _connect_point3_line3(A.p, B) ua = (d1343 * d4321 - d1321 * d4343) / denom if not A._u_in(ua): ua = max(min(ua, 1.0), 0.0) ub = (d1343 + d4321 * ua) / d4343 if not B._u_in(ub): ub = max(min(ub, 1.0), 0.0) return LineSegment3(Point3(A.p.x + ua * A.v.x, A.p.y + ua * A.v.y, A.p.z + ua * A.v.z), Point3(B.p.x + ub * B.v.x, B.p.y + ub * B.v.y, B.p.z + ub * B.v.z)) def _connect_line3_plane(L, P): d = P.n.dot(L.v) if not d: # Parallel, choose an endpoint return _connect_point3_plane(L.p, P) u = (P.k - P.n.dot(L.p)) / d if not L._u_in(u): # intersects out of range, choose nearest endpoint u = max(min(u, 1.0), 0.0) return _connect_point3_plane(Point3(L.p.x + u * L.v.x, L.p.y + u * L.v.y, L.p.z + u * L.v.z), P) # Intersection return None def _connect_sphere_line3(S, L): d = L.v.magnitude_squared() assert d != 0 u = ((S.c.x - L.p.x) * L.v.x + \ (S.c.y - L.p.y) * L.v.y + \ (S.c.z - L.p.z) * L.v.z) / d if not L._u_in(u): u = max(min(u, 1.0), 0.0) point = Point3(L.p.x + u * L.v.x, L.p.y + u * L.v.y, L.p.z + u * L.v.z) v = (point - S.c) v.normalize() v *= S.r return LineSegment3(Point3(S.c.x + v.x, S.c.y + v.y, S.c.z + v.z), point) def _connect_sphere_sphere(A, B): v = B.c - A.c v.normalize() return LineSegment3(Point3(A.c.x + v.x * A.r, A.c.y + v.y * A.r, A.c.x + v.z * A.r), Point3(B.c.x + v.x * B.r, B.c.y + v.y * B.r, B.c.x + v.z * B.r)) def _connect_sphere_plane(S, P): c = _connect_point3_plane(S.c, P) if not c: return None p2 = c.p2 v = p2 - S.c v.normalize() v *= S.r return LineSegment3(Point3(S.c.x + v.x, S.c.y + v.y, S.c.z + v.z), p2) def _connect_plane_plane(A, B): if A.n.cross(B.n): # Planes intersect return None else: # Planes are parallel, connect to arbitrary point return _connect_point3_plane(A._get_point(), B) def _intersect_point3_sphere(P, S): return abs(P - S.c) <= S.r def _intersect_line3_sphere(L, S): a = L.v.magnitude_squared() b = 2 * (L.v.x * (L.p.x - S.c.x) + \ L.v.y * (L.p.y - S.c.y) + \ L.v.z * (L.p.z - S.c.z)) c = S.c.magnitude_squared() + \ L.p.magnitude_squared() - \ 2 * S.c.dot(L.p) - \ S.r ** 2 det = b ** 2 - 4 * a * c if det < 0: return None sq = math.sqrt(det) u1 = (-b + sq) / (2 * a) u2 = (-b - sq) / (2 * a) if not L._u_in(u1): u1 = max(min(u1, 1.0), 0.0) if not L._u_in(u2): u2 = max(min(u2, 1.0), 0.0) return LineSegment3(Point3(L.p.x + u1 * L.v.x, L.p.y + u1 * L.v.y, L.p.z + u1 * L.v.z), Point3(L.p.x + u2 * L.v.x, L.p.y + u2 * L.v.y, L.p.z + u2 * L.v.z)) def _intersect_line3_plane(L, P): d = P.n.dot(L.v) if not d: # Parallel return None u = (P.k - P.n.dot(L.p)) / d if not L._u_in(u): return None return Point3(L.p.x + u * L.v.x, L.p.y + u * L.v.y, L.p.z + u * L.v.z) def _intersect_plane_plane(A, B): n1_m = A.n.magnitude_squared() n2_m = B.n.magnitude_squared() n1d2 = A.n.dot(B.n) det = n1_m * n2_m - n1d2 ** 2 if det == 0: # Parallel return None c1 = (A.k * n2_m - B.k * n1d2) / det c2 = (B.k * n1_m - A.k * n1d2) / det return Line3(Point3(c1 * A.n.x + c2 * B.n.x, c1 * A.n.y + c2 * B.n.y, c1 * A.n.z + c2 * B.n.z), A.n.cross(B.n)) class Point3(Vector3, Geometry): def __repr__(self): return 'Point3(%.2f, %.2f, %.2f)' % (self.x, self.y, self.z) def intersect(self, other): return other._intersect_point3(self) def _intersect_sphere(self, other): return _intersect_point3_sphere(self, other) def connect(self, other): return other._connect_point3(self) def _connect_point3(self, other): if self != other: return LineSegment3(other, self) return None def _connect_line3(self, other): c = _connect_point3_line3(self, other) if c: return c._swap() def _connect_sphere(self, other): c = _connect_point3_sphere(self, other) if c: return c._swap() def _connect_plane(self, other): c = _connect_point3_plane(self, other) if c: return c._swap() class Line3: __slots__ = ['p', 'v'] def __init__(self, *args): if len(args) == 3: assert isinstance(args[0], Point3) and \ isinstance(args[1], Vector3) and \ type(args[2]) == float self.p = args[0].copy() self.v = args[1] * args[2] / abs(args[1]) elif len(args) == 2: if isinstance(args[0], Point3) and isinstance(args[1], Point3): self.p = args[0].copy() self.v = args[1] - args[0] elif isinstance(args[0], Point3) and isinstance(args[1], Vector3): self.p = args[0].copy() self.v = args[1].copy() else: raise AttributeError('%r' % (args,)) elif len(args) == 1: if isinstance(args[0], Line3): self.p = args[0].p.copy() self.v = args[0].v.copy() else: raise AttributeError('%r' % (args,)) else: raise AttributeError('%r' % (args,)) # XXX This is annoying. # if not self.v: # raise AttributeError, 'Line has zero-length vector' def __copy__(self): return self.__class__(self.p, self.v) copy = __copy__ def __repr__(self): return 'Line3(<%.2f, %.2f, %.2f> + u<%.2f, %.2f, %.2f>)' % \ (self.p.x, self.p.y, self.p.z, self.v.x, self.v.y, self.v.z) p1 = property(lambda self: self.p) p2 = property(lambda self: Point3(self.p.x + self.v.x, self.p.y + self.v.y, self.p.z + self.v.z)) def _apply_transform(self, t): self.p = t * self.p self.v = t * self.v def _u_in(self, u): return True def intersect(self, other): return other._intersect_line3(self) def _intersect_sphere(self, other): return _intersect_line3_sphere(self, other) def _intersect_plane(self, other): return _intersect_line3_plane(self, other) def connect(self, other): return other._connect_line3(self) def _connect_point3(self, other): return _connect_point3_line3(other, self) def _connect_line3(self, other): return _connect_line3_line3(other, self) def _connect_sphere(self, other): return _connect_sphere_line3(other, self) def _connect_plane(self, other): c = _connect_line3_plane(self, other) if c: return c class Ray3(Line3): def __repr__(self): return 'Ray3(<%.2f, %.2f, %.2f> + u<%.2f, %.2f, %.2f>)' % \ (self.p.x, self.p.y, self.p.z, self.v.x, self.v.y, self.v.z) def _u_in(self, u): return u >= 0.0 class LineSegment3(Line3): def __repr__(self): return 'LineSegment3(<%.2f, %.2f, %.2f> to <%.2f, %.2f, %.2f>)' % \ (self.p.x, self.p.y, self.p.z, self.p.x + self.v.x, self.p.y + self.v.y, self.p.z + self.v.z) def _u_in(self, u): return u >= 0.0 and u <= 1.0 def __abs__(self): return abs(self.v) def magnitude_squared(self): return self.v.magnitude_squared() def _swap(self): # used by connect methods to switch order of points self.p = self.p2 self.v *= -1 return self length = property(lambda self: abs(self.v)) class Sphere: __slots__ = ['c', 'r'] def __init__(self, center, radius): assert isinstance(center, Vector3) and type(radius) == float self.c = center.copy() self.r = radius def __copy__(self): return self.__class__(self.c, self.r) copy = __copy__ def __repr__(self): return 'Sphere(<%.2f, %.2f, %.2f>, radius=%.2f)' % \ (self.c.x, self.c.y, self.c.z, self.r) def _apply_transform(self, t): self.c = t * self.c def intersect(self, other): return other._intersect_sphere(self) def _intersect_point3(self, other): return _intersect_point3_sphere(other, self) def _intersect_line3(self, other): return _intersect_line3_sphere(other, self) def connect(self, other): return other._connect_sphere(self) def _connect_point3(self, other): return _connect_point3_sphere(other, self) def _connect_line3(self, other): c = _connect_sphere_line3(self, other) if c: return c._swap() def _connect_sphere(self, other): return _connect_sphere_sphere(other, self) def _connect_plane(self, other): c = _connect_sphere_plane(self, other) if c: return c class Plane: # n.p = k, where n is normal, p is point on plane, k is constant scalar __slots__ = ['n', 'k'] def __init__(self, *args): if len(args) == 3: assert isinstance(args[0], Point3) and \ isinstance(args[1], Point3) and \ isinstance(args[2], Point3) self.n = (args[1] - args[0]).cross(args[2] - args[0]) self.n.normalize() self.k = self.n.dot(args[0]) elif len(args) == 2: if isinstance(args[0], Point3) and isinstance(args[1], Vector3): self.n = args[1].normalized() self.k = self.n.dot(args[0]) elif isinstance(args[0], Vector3) and type(args[1]) == float: self.n = args[0].normalized() self.k = args[1] else: raise AttributeError('%r' % (args,)) else: raise AttributeError('%r' % (args,)) if not self.n: raise AttributeError('Points on plane are colinear') def __copy__(self): return self.__class__(self.n, self.k) copy = __copy__ def __repr__(self): return 'Plane(<%.2f, %.2f, %.2f>.p = %.2f)' % \ (self.n.x, self.n.y, self.n.z, self.k) def _get_point(self): # Return an arbitrary point on the plane if self.n.z: return Point3(0., 0., self.k / self.n.z) elif self.n.y: return Point3(0., self.k / self.n.y, 0.) else: return Point3(self.k / self.n.x, 0., 0.) def _apply_transform(self, t): p = t * self._get_point() self.n = t * self.n self.k = self.n.dot(p) def intersect(self, other): return other._intersect_plane(self) def _intersect_line3(self, other): return _intersect_line3_plane(other, self) def _intersect_plane(self, other): return _intersect_plane_plane(self, other) def connect(self, other): return other._connect_plane(self) def _connect_point3(self, other): return _connect_point3_plane(other, self) def _connect_line3(self, other): return _connect_line3_plane(other, self) def _connect_sphere(self, other): return _connect_sphere_plane(other, self) def _connect_plane(self, other): return _connect_plane_plane(other, self)
{ "pile_set_name": "Github" }
{ "TypeName": "Shoes", "MoneyValue": 100.0, "Description": "Nice leather shoes.", "Category": "Clothing", "Tags": [ "Clothing" ], "FoodContent": 0.0, "DisplayName": "Boots", "PlantToGenerate": "", "Tint": [ 255, 255, 255, 255 ], "AleName": "", "Tool_Breakable": false, "Tool_Durability": 4, "Tool_Wear": 0, "Tool_Effectiveness": 1.0, "Tool_AttackAnimation": "Attacking", "Tool_AttackTriggerFrame": 2, "Tool_AttackDamage": 1, "Tool_AttackHitEffect": "Effects\\hit", "Equipable": true, "Equipment_LayerType": "Feet", "Equipment_LayerName": "boots", "Equipment_Slot": "Feet", "Equipment_Palette": "Leather Equipment", "Gui_Graphic": { "AssetPath": "Entities/Dwarf/ToolIcons/equipment", "Palette": "Leather Equipment", "FrameSize": "32, 32", "Frame": "2, 5" }, "Craft_Craftable": true, "Craft_Ingredients": [ { "Tag": "Cotton", "Count": 2 } ], "Craft_ResultsCount": 1, "Craft_BaseCraftTime": 32.0, "Craft_Location": "Craft Table", "Craft_TaskCategory": "CraftItem", "Craft_Noise": "Craft", "Craft_MetaResourceFactory": "Normal" }
{ "pile_set_name": "Github" }
// Modified by Princeton University on June 9th, 2015 /* * ========== Copyright Header Begin ========================================== * * OpenSPARC T1 Processor File: fmuls_msb_near.s * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. * * The above named program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License version 2 as published by the Free Software Foundation. * * The above named 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 work; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * ========== Copyright Header End ============================================ */ /*********************************************************************** * Name: fmuls_msb_near.s * Date: 11/6/02 * * **********************************************************************/ #define ENABLE_T0_Fp_disabled_0x20 #include "boot.s" .global sam_fast_immu_miss .global sam_fast_dmmu_miss .text .global main ! Testing fmuls with rounding mode near !// fmuls_msb_near !// !// Test FMULS on corner cases of carry into MSB out of multiplier !// in round to nearest mode !// Inputs are all combinations of positive and negative and: !// - fraction is 0 !// - maximum fraction main: ! Common code wr %g0, 0x4, %fprs ! make sure fef is 1 setx source1, %l0, %l1 setx source2, %l0, %l2 setx result, %l0, %l3 setx fcc_result, %l0, %l4 setx cexc_flag, %l0, %l5 setx fsr_rounding_mode, %l0, %l6 setx scratch, %l0, %l7 set 256, %g1 ! Set loop count set 0x0, %g2 ! Set loop iterator fmuls_loop: ldx [%l6+0x0], %fsr ! instruction specific code sll %g2, 0x2, %g3 ldx [%l6], %fsr ! Load fsr with rounding mode ld [%l1+%g3], %f0 ! Load source 1 ld [%l2+%g3], %f2 ! Load source 2 fmuls %f0, %f2, %f4 ! Perform the operation st %f4, [%l7+0x0] ! Store the result for comparison stx %fsr, [%l7+0x8] ! Store the fsr for comparison ld [%l7+0x0], %g4 ! Load result from memory for comparison ldx [%l7+0x8], %g5 ! Load fsr from memory for comparison sll %g2, 0x3, %g3 ldx [%l5+%g3], %g6 ! Load fsr with expected cexc mode mov 0x0f, %g3 ! Mask for nv and %g3, %g6, %g7 ! Mask off nv srl %g7, 0x3, %g7 ! Shift to get of or %g7, %g6, %g6 ! Generate correct nx with of mov 0x01, %g3 ! Mask to get nx and %g3, %g6, %g7 ! Mask off all but nx sll %g7, 0x2, %g7 ! Shift to align nx and uf or %g7, 0x1b, %g7 ! Mask for all cexc bits and %g7, %g6, %g6 ! Generate correct uf for denorm sll %g6, 0x5, %g7 ! Generate aexc or %g6, %g7, %g7 ! Generate expected fsr ldx [%l6], %g6 ! Load fsr with rounding mode or %g6, %g7, %g7 ! Generate expected fsr sll %g2, 0x2, %g3 ld [%l3+%g3], %g6 ! Load expected result subcc %g4, %g6, %g0 ! Compare bne,a test_fail ! If not equal, test failed nop subcc %g5, %g7, %g0 ! Compare bne,a test_fail ! If not equal, test failed nop add %g2, 0x1, %g2 ! Increment loop iterator subcc %g2, %g1, %g0 ! Compare bne,a fmuls_loop ! Loop nop /******************************************************* * Exit code *******************************************************/ test_pass: ta T_GOOD_TRAP test_fail: ta T_BAD_TRAP /******************************************************* * Data section *******************************************************/ .data fsr_rounding_mode: .xword 0x0000000000000000 source1: .word 0x5f000000 .word 0x5f000000 .word 0x5f000001 .word 0x5f7fffff .word 0x5f800000 .word 0x5f800000 .word 0x5f800001 .word 0x5fffffff .word 0x3f800000 .word 0x3f800000 .word 0x3f800001 .word 0x3fffffff .word 0x40000000 .word 0x40000000 .word 0x40000001 .word 0x407fffff .word 0x1f800000 .word 0x1f800000 .word 0x1f800001 .word 0x1fffffff .word 0x1f800000 .word 0x1f800000 .word 0x1f800001 .word 0x1fffffff .word 0x3f800000 .word 0x3f800000 .word 0x3f800001 .word 0x3fffffff .word 0x3f000000 .word 0x3f000000 .word 0x3f000001 .word 0x3f7fffff .word 0x5f800000 .word 0x5fffffff .word 0x5fffffff .word 0x5fffffff .word 0x5f800000 .word 0x5fffffff .word 0x5fffffff .word 0x5fffffff .word 0x3f800000 .word 0x3fffffff .word 0x3fffffff .word 0x3fffffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x20000000 .word 0x207fffff .word 0x207fffff .word 0x207fffff .word 0x1f800000 .word 0x1fffffff .word 0x1fffffff .word 0x1fffffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x5f000000 .word 0x5f000000 .word 0x5f000001 .word 0x5f7fffff .word 0x5f800000 .word 0x5f800000 .word 0x5f800001 .word 0x5fffffff .word 0x3f800000 .word 0x3f800000 .word 0x3f800001 .word 0x3fffffff .word 0x40000000 .word 0x40000000 .word 0x40000001 .word 0x407fffff .word 0x1f800000 .word 0x1f800000 .word 0x1f800001 .word 0x1fffffff .word 0x1f800000 .word 0x1f800000 .word 0x1f800001 .word 0x1fffffff .word 0x3f800000 .word 0x3f800000 .word 0x3f800001 .word 0x3fffffff .word 0x3f000000 .word 0x3f000000 .word 0x3f000001 .word 0x3f7fffff .word 0x5f800000 .word 0x5fffffff .word 0x5fffffff .word 0x5fffffff .word 0x5f800000 .word 0x5fffffff .word 0x5fffffff .word 0x5fffffff .word 0x3f800000 .word 0x3fffffff .word 0x3fffffff .word 0x3fffffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x20000000 .word 0x207fffff .word 0x207fffff .word 0x207fffff .word 0x1f800000 .word 0x1fffffff .word 0x1fffffff .word 0x1fffffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0xdf000000 .word 0xdf000000 .word 0xdf000001 .word 0xdf7fffff .word 0xdf800000 .word 0xdf800000 .word 0xdf800001 .word 0xdfffffff .word 0xbf800000 .word 0xbf800000 .word 0xbf800001 .word 0xbfffffff .word 0xc0000000 .word 0xc0000000 .word 0xc0000001 .word 0xc07fffff .word 0x9f800000 .word 0x9f800000 .word 0x9f800001 .word 0x9fffffff .word 0x9f800000 .word 0x9f800000 .word 0x9f800001 .word 0x9fffffff .word 0xbf800000 .word 0xbf800000 .word 0xbf800001 .word 0xbfffffff .word 0xbf000000 .word 0xbf000000 .word 0xbf000001 .word 0xbf7fffff .word 0xdf800000 .word 0xdfffffff .word 0xdfffffff .word 0xdfffffff .word 0xdf800000 .word 0xdfffffff .word 0xdfffffff .word 0xdfffffff .word 0xbf800000 .word 0xbfffffff .word 0xbfffffff .word 0xbfffffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0xa0000000 .word 0xa07fffff .word 0xa07fffff .word 0xa07fffff .word 0x9f800000 .word 0x9fffffff .word 0x9fffffff .word 0x9fffffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0xdf000000 .word 0xdf000000 .word 0xdf000001 .word 0xdf7fffff .word 0xdf800000 .word 0xdf800000 .word 0xdf800001 .word 0xdfffffff .word 0xbf800000 .word 0xbf800000 .word 0xbf800001 .word 0xbfffffff .word 0xc0000000 .word 0xc0000000 .word 0xc0000001 .word 0xc07fffff .word 0x9f800000 .word 0x9f800000 .word 0x9f800001 .word 0x9fffffff .word 0x9f800000 .word 0x9f800000 .word 0x9f800001 .word 0x9fffffff .word 0xbf800000 .word 0xbf800000 .word 0xbf800001 .word 0xbfffffff .word 0xbf000000 .word 0xbf000000 .word 0xbf000001 .word 0xbf7fffff .word 0xdf800000 .word 0xdfffffff .word 0xdfffffff .word 0xdfffffff .word 0xdf800000 .word 0xdfffffff .word 0xdfffffff .word 0xdfffffff .word 0xbf800000 .word 0xbfffffff .word 0xbfffffff .word 0xbfffffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0xa0000000 .word 0xa07fffff .word 0xa07fffff .word 0xa07fffff .word 0x9f800000 .word 0x9fffffff .word 0x9fffffff .word 0x9fffffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .align 8 source2: .word 0x5f800000 .word 0x5fffffff .word 0x5fffffff .word 0x5fffffff .word 0x5f800000 .word 0x5fffffff .word 0x5fffffff .word 0x5fffffff .word 0x3f800000 .word 0x3fffffff .word 0x3fffffff .word 0x3fffffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x20000000 .word 0x207fffff .word 0x207fffff .word 0x207fffff .word 0x1f800000 .word 0x1fffffff .word 0x1fffffff .word 0x1fffffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x5f000000 .word 0x5f000000 .word 0x5f000001 .word 0x5f7fffff .word 0x5f800000 .word 0x5f800000 .word 0x5f800001 .word 0x5fffffff .word 0x3f800000 .word 0x3f800000 .word 0x3f800001 .word 0x3fffffff .word 0x40000000 .word 0x40000000 .word 0x40000001 .word 0x407fffff .word 0x1f800000 .word 0x1f800000 .word 0x1f800001 .word 0x1fffffff .word 0x1f800000 .word 0x1f800000 .word 0x1f800001 .word 0x1fffffff .word 0x3f800000 .word 0x3f800000 .word 0x3f800001 .word 0x3fffffff .word 0x3f000000 .word 0x3f000000 .word 0x3f000001 .word 0x3f7fffff .word 0xdf800000 .word 0xdfffffff .word 0xdfffffff .word 0xdfffffff .word 0xdf800000 .word 0xdfffffff .word 0xdfffffff .word 0xdfffffff .word 0xbf800000 .word 0xbfffffff .word 0xbfffffff .word 0xbfffffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0xa0000000 .word 0xa07fffff .word 0xa07fffff .word 0xa07fffff .word 0x9f800000 .word 0x9fffffff .word 0x9fffffff .word 0x9fffffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0xdf000000 .word 0xdf000000 .word 0xdf000001 .word 0xdf7fffff .word 0xdf800000 .word 0xdf800000 .word 0xdf800001 .word 0xdfffffff .word 0xbf800000 .word 0xbf800000 .word 0xbf800001 .word 0xbfffffff .word 0xc0000000 .word 0xc0000000 .word 0xc0000001 .word 0xc07fffff .word 0x9f800000 .word 0x9f800000 .word 0x9f800001 .word 0x9fffffff .word 0x9f800000 .word 0x9f800000 .word 0x9f800001 .word 0x9fffffff .word 0xbf800000 .word 0xbf800000 .word 0xbf800001 .word 0xbfffffff .word 0xbf000000 .word 0xbf000000 .word 0xbf000001 .word 0xbf7fffff .word 0x5f800000 .word 0x5fffffff .word 0x5fffffff .word 0x5fffffff .word 0x5f800000 .word 0x5fffffff .word 0x5fffffff .word 0x5fffffff .word 0x3f800000 .word 0x3fffffff .word 0x3fffffff .word 0x3fffffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x20000000 .word 0x207fffff .word 0x207fffff .word 0x207fffff .word 0x1f800000 .word 0x1fffffff .word 0x1fffffff .word 0x1fffffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x00000001 .word 0x007fffff .word 0x007fffff .word 0x007fffff .word 0x5f000000 .word 0x5f000000 .word 0x5f000001 .word 0x5f7fffff .word 0x5f800000 .word 0x5f800000 .word 0x5f800001 .word 0x5fffffff .word 0x3f800000 .word 0x3f800000 .word 0x3f800001 .word 0x3fffffff .word 0x40000000 .word 0x40000000 .word 0x40000001 .word 0x407fffff .word 0x1f800000 .word 0x1f800000 .word 0x1f800001 .word 0x1fffffff .word 0x1f800000 .word 0x1f800000 .word 0x1f800001 .word 0x1fffffff .word 0x3f800000 .word 0x3f800000 .word 0x3f800001 .word 0x3fffffff .word 0x3f000000 .word 0x3f000000 .word 0x3f000001 .word 0x3f7fffff .word 0xdf800000 .word 0xdfffffff .word 0xdfffffff .word 0xdfffffff .word 0xdf800000 .word 0xdfffffff .word 0xdfffffff .word 0xdfffffff .word 0xbf800000 .word 0xbfffffff .word 0xbfffffff .word 0xbfffffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0xa0000000 .word 0xa07fffff .word 0xa07fffff .word 0xa07fffff .word 0x9f800000 .word 0x9fffffff .word 0x9fffffff .word 0x9fffffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0x80000001 .word 0x807fffff .word 0x807fffff .word 0x807fffff .word 0xdf000000 .word 0xdf000000 .word 0xdf000001 .word 0xdf7fffff .word 0xdf800000 .word 0xdf800000 .word 0xdf800001 .word 0xdfffffff .word 0xbf800000 .word 0xbf800000 .word 0xbf800001 .word 0xbfffffff .word 0xc0000000 .word 0xc0000000 .word 0xc0000001 .word 0xc07fffff .word 0x9f800000 .word 0x9f800000 .word 0x9f800001 .word 0x9fffffff .word 0x9f800000 .word 0x9f800000 .word 0x9f800001 .word 0x9fffffff .word 0xbf800000 .word 0xbf800000 .word 0xbf800001 .word 0xbfffffff .word 0xbf000000 .word 0xbf000000 .word 0xbf000001 .word 0xbf7fffff .align 8 result: .word 0x7f000000 .word 0x7f7fffff .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x3f800000 .word 0x3fffffff .word 0x40000000 .word 0x407ffffe .word 0x00000002 .word 0x00fffffe .word 0x01000000 .word 0x017ffffd .word 0x00400000 .word 0x00800000 .word 0x00800000 .word 0x00fffffe .word 0x00200000 .word 0x00400000 .word 0x00400000 .word 0x007fffff .word 0x00000001 .word 0x007fffff .word 0x00800000 .word 0x00fffffd .word 0x00000000 .word 0x00400000 .word 0x00400000 .word 0x007fffff .word 0x7f000000 .word 0x7f7fffff .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x3f800000 .word 0x3fffffff .word 0x40000000 .word 0x407ffffe .word 0x00000002 .word 0x00fffffe .word 0x01000000 .word 0x017ffffd .word 0x00400000 .word 0x00800000 .word 0x00800000 .word 0x00fffffe .word 0x00200000 .word 0x00400000 .word 0x00400000 .word 0x007fffff .word 0x00000001 .word 0x007fffff .word 0x00800000 .word 0x00fffffd .word 0x00000000 .word 0x00400000 .word 0x00400000 .word 0x007fffff .word 0xff000000 .word 0xff7fffff .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xbf800000 .word 0xbfffffff .word 0xc0000000 .word 0xc07ffffe .word 0x80000002 .word 0x80fffffe .word 0x81000000 .word 0x817ffffd .word 0x80400000 .word 0x80800000 .word 0x80800000 .word 0x80fffffe .word 0x80200000 .word 0x80400000 .word 0x80400000 .word 0x807fffff .word 0x80000001 .word 0x807fffff .word 0x80800000 .word 0x80fffffd .word 0x80000000 .word 0x80400000 .word 0x80400000 .word 0x807fffff .word 0xff000000 .word 0xff7fffff .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xbf800000 .word 0xbfffffff .word 0xc0000000 .word 0xc07ffffe .word 0x80000002 .word 0x80fffffe .word 0x81000000 .word 0x817ffffd .word 0x80400000 .word 0x80800000 .word 0x80800000 .word 0x80fffffe .word 0x80200000 .word 0x80400000 .word 0x80400000 .word 0x807fffff .word 0x80000001 .word 0x807fffff .word 0x80800000 .word 0x80fffffd .word 0x80000000 .word 0x80400000 .word 0x80400000 .word 0x807fffff .word 0xff000000 .word 0xff7fffff .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xbf800000 .word 0xbfffffff .word 0xc0000000 .word 0xc07ffffe .word 0x80000002 .word 0x80fffffe .word 0x81000000 .word 0x817ffffd .word 0x80400000 .word 0x80800000 .word 0x80800000 .word 0x80fffffe .word 0x80200000 .word 0x80400000 .word 0x80400000 .word 0x807fffff .word 0x80000001 .word 0x807fffff .word 0x80800000 .word 0x80fffffd .word 0x80000000 .word 0x80400000 .word 0x80400000 .word 0x807fffff .word 0xff000000 .word 0xff7fffff .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xff800000 .word 0xbf800000 .word 0xbfffffff .word 0xc0000000 .word 0xc07ffffe .word 0x80000002 .word 0x80fffffe .word 0x81000000 .word 0x817ffffd .word 0x80400000 .word 0x80800000 .word 0x80800000 .word 0x80fffffe .word 0x80200000 .word 0x80400000 .word 0x80400000 .word 0x807fffff .word 0x80000001 .word 0x807fffff .word 0x80800000 .word 0x80fffffd .word 0x80000000 .word 0x80400000 .word 0x80400000 .word 0x807fffff .word 0x7f000000 .word 0x7f7fffff .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x3f800000 .word 0x3fffffff .word 0x40000000 .word 0x407ffffe .word 0x00000002 .word 0x00fffffe .word 0x01000000 .word 0x017ffffd .word 0x00400000 .word 0x00800000 .word 0x00800000 .word 0x00fffffe .word 0x00200000 .word 0x00400000 .word 0x00400000 .word 0x007fffff .word 0x00000001 .word 0x007fffff .word 0x00800000 .word 0x00fffffd .word 0x00000000 .word 0x00400000 .word 0x00400000 .word 0x007fffff .word 0x7f000000 .word 0x7f7fffff .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x7f800000 .word 0x3f800000 .word 0x3fffffff .word 0x40000000 .word 0x407ffffe .word 0x00000002 .word 0x00fffffe .word 0x01000000 .word 0x017ffffd .word 0x00400000 .word 0x00800000 .word 0x00800000 .word 0x00fffffe .word 0x00200000 .word 0x00400000 .word 0x00400000 .word 0x007fffff .word 0x00000001 .word 0x007fffff .word 0x00800000 .word 0x00fffffd .word 0x00000000 .word 0x00400000 .word 0x00400000 .word 0x007fffff .align 8 fcc_result: cexc_flag: .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000008 .xword 0x0000000000000008 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000004 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000008 .xword 0x0000000000000008 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000004 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000008 .xword 0x0000000000000008 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000004 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000008 .xword 0x0000000000000008 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000004 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000008 .xword 0x0000000000000008 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000004 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000008 .xword 0x0000000000000008 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000004 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000008 .xword 0x0000000000000008 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000004 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000008 .xword 0x0000000000000008 .xword 0x0000000000000009 .xword 0x0000000000000009 .xword 0x0000000000000000 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000000 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000001 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000004 .xword 0x0000000000000004 .xword 0x0000000000000005 .xword 0x0000000000000001 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .xword 0x0000000000000005 .align 8 scratch: .xword 0x0000000000000000 .xword 0x0000000000000000
{ "pile_set_name": "Github" }
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS-IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """A thread pool for running a set of functions synchronously in parallel. This is mainly intended for use where the functions have a barrier and none will return until all have been called. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools from concurrent import futures class RunParallel(object): """Run all funcs in parallel.""" def __init__(self, timeout=None): self._timeout = timeout self._executor = None self._workers = 0 def run(self, funcs): """Run a set of functions in parallel, returning their results. Make sure any function you pass exits with a reasonable timeout. If it doesn't return within the timeout or the result is ignored due an exception in a separate thread it will continue to stick around until it finishes, including blocking process exit. Args: funcs: An iterable of functions or iterable of args to functools.partial. Returns: A list of return values with the values matching the order in funcs. Raises: Propagates the first exception encountered in one of the functions. """ funcs = [f if callable(f) else functools.partial(*f) for f in funcs] if len(funcs) == 1: # Ignore threads if it's not needed. return [funcs[0]()] if len(funcs) > self._workers: # Lazy init and grow as needed. self.shutdown() self._workers = len(funcs) self._executor = futures.ThreadPoolExecutor(self._workers) futs = [self._executor.submit(f) for f in funcs] done, not_done = futures.wait(futs, self._timeout, futures.FIRST_EXCEPTION) # Make sure to propagate any exceptions. for f in done: if not f.cancelled() and f.exception() is not None: if not_done: # If there are some calls that haven't finished, cancel and recreate # the thread pool. Otherwise we may have a thread running forever # blocking parallel calls. for nd in not_done: nd.cancel() self.shutdown(False) # Don't wait, they may be deadlocked. raise f.exception() # Either done or timed out, so don't wait again. return [f.result(timeout=0) for f in futs] def shutdown(self, wait=True): if self._executor: self._executor.shutdown(wait) self._executor = None self._workers = 0 def __del__(self): self.shutdown()
{ "pile_set_name": "Github" }
// This is a forked copy of the ISO8601DateFormatter /*ISO8601DateFormatter.m * *Created by Peter Hosey on 2009-04-11. *Copyright 2009 Peter Hosey. All rights reserved. */ #import <Foundation/Foundation.h> #import "RKISO8601DateFormatter.h" // Set Logging Component #undef RKLogComponent #define RKLogComponent RKlcl_cRestKitSupport unichar RKISO8601DefaultTimeSeparatorCharacter = ':'; // Unicode date formats. #define RK_ISOCALENDAR_DATE_FORMAT @"yyyy-MM-dd" #define RK_ISOORDINAL_DATE_FORMAT @"yyyy-DDD" #define RK_ISOTIME_FORMAT @"HH:mm:ss" #define RK_ISOTIME_WITH_TIMEZONE_FORMAT RK_ISOTIME_FORMAT @"Z" // printf formats. #define RK_ISOTIMEZONE_UTC_FORMAT @"Z" #define RK_ISOTIMEZONE_OFFSET_FORMAT @"%+.2ld%.2ld" // Parsing Helpers static NSUInteger read_segment(const unsigned char *str, const unsigned char **next, NSUInteger *out_num_digits); static NSUInteger read_segment_4digits(const unsigned char *str, const unsigned char **next, NSUInteger *out_num_digits); static NSUInteger read_segment_2digits(const unsigned char *str, const unsigned char **next); static double read_double(const unsigned char *str, const unsigned char **next); static BOOL is_leap_year(NSUInteger year); @interface RKISO8601DateFormatter(UnparsingPrivate) - (NSString *)replaceColonsInString:(NSString *)timeFormat withTimeSeparator:(unichar)timeSep; - (NSString *)stringFromDate:(NSDate *)date formatString:(NSString *)dateFormat timeZone:(NSTimeZone *)timeZone; - (NSString *)weekDateStringForDate:(NSDate *)date timeZone:(NSTimeZone *)timeZone; @end static NSMutableDictionary *timeZonesByOffset; @interface RKISO8601DateFormatter () @property (nonatomic, strong) NSCalendar *parsingCalendar; @property (nonatomic, strong) NSCalendar *unparsingCalendar; @property (nonatomic, strong) NSDateFormatter *unparsingFormatter; @property (nonatomic, copy) NSString *lastUsedFormatString; @end @implementation RKISO8601DateFormatter + (void)initialize { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ timeZonesByOffset = [[NSMutableDictionary alloc] init]; }); } - (id)init { self = [super init]; if (self) { self.timeZone = [NSTimeZone defaultTimeZone]; self.locale = [NSLocale currentLocale]; self.parsingCalendar = [self newCalendar]; self.unparsingCalendar = [self newCalendar]; self.format = RKISO8601DateFormatCalendar; self.timeSeparator = RKISO8601DefaultTimeSeparatorCharacter; self.includeTime = NO; self.parsesStrictly = NO; } return self; } - (NSCalendar *)newCalendar { NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; calendar.firstWeekday = 2; //Monday calendar.timeZone = self.timeZone; calendar.locale = self.locale; return calendar; } - (void)setTimeZone:(NSTimeZone *)timeZone { if (_timeZone != timeZone) { _timeZone = timeZone; _unparsingCalendar.timeZone = timeZone; _unparsingFormatter.timeZone = timeZone; } } - (void)setLocale:(NSLocale *)locale { if (_locale != locale) { _locale = locale; _unparsingCalendar.locale = locale; _unparsingFormatter.locale = locale; } } #pragma mark Parsing /*Valid ISO 8601 date formats: * *YYYYMMDD *YYYY-MM-DD *YYYY-MM *YYYY *YY //century * //Implied century: YY is 00-99 * YYMMDD * YY-MM-DD * -YYMM * -YY-MM * -YY * //Implied year * --MMDD * --MM-DD * --MM * //Implied year and month * ---DD * //Ordinal dates: DDD is the number of the day in the year (1-366) *YYYYDDD *YYYY-DDD * YYDDD * YY-DDD * -DDD * //Week-based dates: ww is the number of the week, and d is the number (1-7) of the day in the week *yyyyWwwd *yyyy-Www-d *yyyyWww *yyyy-Www *yyWwwd *yy-Www-d *yyWww *yy-Www * //Year of the implied decade *-yWwwd *-y-Www-d *-yWww *-y-Www * //Week and day of implied year * -Wwwd * -Www-d * //Week only of implied year * -Www * //Day only of implied week * -W-d */ - (NSDateComponents *) dateComponentsFromString:(NSString *)string { return [self dateComponentsFromString:string timeZone:NULL]; } - (NSDateComponents *) dateComponentsFromString:(NSString *)string timeZone:(out NSTimeZone **)outTimeZone { return [self dateComponentsFromString:string timeZone:outTimeZone range:NULL]; } - (NSDateComponents *) dateComponentsFromString:(NSString *)string timeZone:(out NSTimeZone **)outTimeZone range:(out NSRange *)outRange { // We don't support ISO-8601 intervals so bail if the string contains a slash delimiter if ([string rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]].location != NSNotFound) return nil; NSDate *now = [NSDate date]; NSDateComponents *components = [[NSDateComponents alloc] init]; NSDateComponents *nowComponents = [self.parsingCalendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate:now]; NSUInteger //Date year, month_or_week = 0U, day = 0U, //Time hour = 0U; NSTimeInterval minute = 0.0, second = 0.0; //Time zone NSInteger tz_hour = 0; NSInteger tz_minute = 0; enum { monthAndDate, week, dateOnly } dateSpecification = monthAndDate; BOOL strict = self.parsesStrictly; unichar timeSep = self.timeSeparator; if (strict) timeSep = RKISO8601DefaultTimeSeparatorCharacter; NSAssert(timeSep != '\0', @"Time separator must not be NUL."); BOOL isValidDate = ([string length] > 0U); NSTimeZone *timeZone = nil; const unsigned char *ch = (const unsigned char *)[string UTF8String]; NSRange range = { 0U, 0U }; const unsigned char *start_of_date = NULL; if (strict && isspace(*ch)) { range.location = NSNotFound; isValidDate = NO; } else { //Skip leading whitespace. NSUInteger i = 0U; for(NSUInteger len = strlen((const char *)ch); i < len; ++i) { if (!isspace(ch[i])) break; } range.location = i; ch += i; start_of_date = ch; NSUInteger segment; NSUInteger num_leading_hyphens = 0U, num_digits = 0U; if (*ch == 'T') { //There is no date here, only a time. Set the date to now; then we'll parse the time. isValidDate = isdigit(*++ch); year = nowComponents.year; month_or_week = nowComponents.month; day = nowComponents.day; } else { while(*ch == '-') { ++num_leading_hyphens; ++ch; } segment = read_segment(ch, &ch, &num_digits); switch(num_digits) { case 0: if (*ch == 'W') { if ((ch[1] == '-') && isdigit(ch[2]) && ((num_leading_hyphens == 1U) || ((num_leading_hyphens == 2U) && !strict))) { year = nowComponents.year; month_or_week = 1U; ch += 2; goto parseDayAfterWeek; } else if (num_leading_hyphens == 1U) { year = nowComponents.year; goto parseWeekAndDay; } else isValidDate = NO; } else isValidDate = NO; break; case 8: //YYYY MM DD if (num_leading_hyphens > 0U) isValidDate = NO; else { day = segment % 100U; segment /= 100U; month_or_week = segment % 100U; year = segment / 100U; } break; case 6: //YYMMDD (implicit century) if (num_leading_hyphens > 0U) isValidDate = NO; else { day = segment % 100U; segment /= 100U; month_or_week = segment % 100U; year = nowComponents.year; year -= (year % 100U); year += segment / 100U; } break; case 4: switch(num_leading_hyphens) { case 0: //YYYY year = segment; if (*ch == '-') ++ch; if (!isdigit(*ch)) { if (*ch == 'W') goto parseWeekAndDay; else month_or_week = day = 1U; } else { segment = read_segment(ch, &ch, &num_digits); switch(num_digits) { case 4: //MMDD day = segment % 100U; month_or_week = segment / 100U; break; case 2: //MM month_or_week = segment; if (*ch == '-') ++ch; if (!isdigit(*ch)) day = 1U; else day = read_segment(ch, &ch, NULL); break; case 3: //DDD day = segment % 1000U; dateSpecification = dateOnly; if (strict && (day > (365U + is_leap_year(year)))) isValidDate = NO; break; default: isValidDate = NO; } } break; case 1: //YYMM month_or_week = segment % 100U; year = segment / 100U; if (*ch == '-') ++ch; if (!isdigit(*ch)) day = 1U; else day = read_segment(ch, &ch, NULL); break; case 2: //MMDD day = segment % 100U; month_or_week = segment / 100U; year = nowComponents.year; break; default: isValidDate = NO; } //switch(num_leading_hyphens) (4 digits) break; case 1: if (strict) { //Two digits only - never just one. if (num_leading_hyphens == 1U) { if (*ch == '-') ++ch; if (*++ch == 'W') { year = nowComponents.year; year -= (year % 10U); year += segment; goto parseWeekAndDay; } else isValidDate = NO; } else isValidDate = NO; break; } case 2: switch(num_leading_hyphens) { case 0: if (*ch == '-') { //Implicit century year = nowComponents.year; year -= (year % 100U); year += segment; if (*++ch == 'W') goto parseWeekAndDay; else if (!isdigit(*ch)) { goto centuryOnly; } else { //Get month and/or date. segment = read_segment_4digits(ch, &ch, &num_digits); switch(num_digits) { case 4: //YY-MMDD day = segment % 100U; month_or_week = segment / 100U; break; case 1: //YY-M; YY-M-DD (extension) if (strict) { isValidDate = NO; break; } case 2: //YY-MM; YY-MM-DD month_or_week = segment; if (*ch == '-') { if (isdigit(*++ch)) day = read_segment_2digits(ch, &ch); else day = 1U; } else day = 1U; break; case 3: //Ordinal date. day = segment; dateSpecification = dateOnly; break; } } } else if (*ch == 'W') { year = nowComponents.year; year -= (year % 100U); year += segment; parseWeekAndDay: //*ch should be 'W' here. if (!isdigit(*++ch)) { //Not really a week-based date; just a year followed by '-W'. if (strict) isValidDate = NO; else month_or_week = day = 1U; } else { month_or_week = read_segment_2digits(ch, &ch); if (*ch == '-') ++ch; parseDayAfterWeek: day = isdigit(*ch) ? read_segment_2digits(ch, &ch) : 1U; dateSpecification = week; } } else { //Century only. Assume current year. centuryOnly: year = segment * 100U + nowComponents.year % 100U; month_or_week = day = 1U; } break; case 1:; //-YY; -YY-MM (implicit century) NSUInteger current_year = nowComponents.year; NSUInteger current_century = (current_year % 100U); year = segment + (current_year - current_century); if (num_digits == 1U) //implied decade year += current_century - (current_year % 10U); if (*ch == '-') { ++ch; month_or_week = read_segment_2digits(ch, &ch); } day = 1U; break; case 2: //--MM; --MM-DD year = nowComponents.year; month_or_week = segment; if (*ch == '-') { ++ch; day = read_segment_2digits(ch, &ch); } break; case 3: //---DD year = nowComponents.year; month_or_week = nowComponents.month; day = segment; break; default: isValidDate = NO; } //switch(num_leading_hyphens) (2 digits) break; case 7: //YYYY DDD (ordinal date) if (num_leading_hyphens > 0U) isValidDate = NO; else { day = segment % 1000U; year = segment / 1000U; dateSpecification = dateOnly; if (strict && (day > (365U + is_leap_year(year)))) isValidDate = NO; } break; case 3: //--DDD (ordinal date, implicit year) //Technically, the standard only allows one hyphen. But it says that two hyphens is the logical implementation, and one was dropped for brevity. So I have chosen to allow the missing hyphen. if ((num_leading_hyphens < 1U) || ((num_leading_hyphens > 2U) && !strict)) isValidDate = NO; else { day = segment; year = nowComponents.year; dateSpecification = dateOnly; if (strict && (day > (365U + is_leap_year(year)))) isValidDate = NO; } break; default: isValidDate = NO; } } if (isValidDate) { if (isspace(*ch) || (*ch == 'T')) ++ch; if (isdigit(*ch)) { hour = read_segment_2digits(ch, &ch); if (*ch == timeSep) { ++ch; if ((timeSep == ',') || (timeSep == '.')) { //We can't do fractional minutes when '.' is the segment separator. //Only allow whole minutes and whole seconds. minute = read_segment_2digits(ch, &ch); if (*ch == timeSep) { ++ch; second = read_segment_2digits(ch, &ch); } } else { //Allow a fractional minute. //If we don't get a fraction, look for a seconds segment. //Otherwise, the fraction of a minute is the seconds. minute = read_double(ch, &ch); second = modf(minute, &minute); if (second > DBL_EPSILON) second *= 60.0; //Convert fraction (e.g. .5) into seconds (e.g. 30). else if (*ch == timeSep) { ++ch; second = read_double(ch, &ch); } } } if (!strict) { if (isspace(*ch)) ++ch; } switch(*ch) { case 'Z': timeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC"]; break; case '+': case '-':; BOOL negative = (*ch == '-'); if (isdigit(*++ch)) { //Read hour offset. segment = *ch - '0'; if (isdigit(*++ch)) { segment *= 10U; segment += *(ch++) - '0'; } tz_hour = (NSInteger)segment; if (negative) tz_hour = -tz_hour; //Optional separator. if (*ch == timeSep) ++ch; if (isdigit(*ch)) { //Read minute offset. segment = *ch - '0'; if (isdigit(*++ch)) { segment *= 10U; segment += *ch - '0'; } tz_minute = segment; if (negative) tz_minute = -tz_minute; } NSTimeInterval timeZoneOffset = (tz_hour * 3600) + (tz_minute * 60); NSNumber *offsetNum = [NSNumber numberWithDouble:timeZoneOffset]; timeZone = [timeZonesByOffset objectForKey:offsetNum]; if (!timeZone) { timeZone = [NSTimeZone timeZoneForSecondsFromGMT:timeZoneOffset]; if (timeZone) [timeZonesByOffset setObject:timeZone forKey:offsetNum]; } } } } } if (isValidDate) { components.year = year; components.day = day; components.hour = hour; components.minute = (NSInteger)minute; components.second = (NSInteger)second; switch(dateSpecification) { case monthAndDate: components.month = month_or_week; break; case week:; //Adapted from <http://personal.ecu.edu/mccartyr/ISOwdALG.txt>. //This works by converting the week date into an ordinal date, then letting the next case handle it. NSUInteger prevYear = year - 1U; NSUInteger YY = prevYear % 100U; NSUInteger C = prevYear - YY; NSUInteger G = YY + YY / 4U; NSUInteger isLeapYear = (((C / 100U) % 4U) * 5U); NSUInteger Jan1Weekday = (isLeapYear + G) % 7U; enum { monday, tuesday, wednesday, thursday/*, friday, saturday, sunday*/ }; components.day = ((8U - Jan1Weekday) + (7U * (Jan1Weekday > thursday))) + (day - 1U) + (7U * (month_or_week - 2)); case dateOnly: //An "ordinal date". break; } } } //if (!(strict && isdigit(ch[0]))) if (outRange) { if (isValidDate) range.length = ch - start_of_date; else range.location = NSNotFound; *outRange = range; } if (outTimeZone) { *outTimeZone = timeZone; } return isValidDate ? components : nil; } - (NSDate *)dateFromString:(NSString *)string { return [self dateFromString:string timeZone:NULL]; } - (NSDate *)dateFromString:(NSString *)string timeZone:(out NSTimeZone **)outTimeZone { return [self dateFromString:string timeZone:outTimeZone range:NULL]; } - (NSDate *)dateFromString:(NSString *)string timeZone:(out NSTimeZone **)outTimeZone range:(out NSRange *)outRange { NSTimeZone *timeZone = nil; NSDateComponents *components = [self dateComponentsFromString:string timeZone:&timeZone range:outRange]; if (! components) return nil; if (outTimeZone) *outTimeZone = timeZone; self.parsingCalendar.timeZone = timeZone ?: self.timeZone; return [self.parsingCalendar dateFromComponents:components]; } - (BOOL)getObjectValue:(id *)outValue forString:(NSString *)string errorDescription:(NSString **)error { NSDate *date = [self dateFromString:string]; if (outValue) *outValue = date; return (date != nil); } #pragma mark Unparsing - (NSString *) replaceColonsInString:(NSString *)timeFormat withTimeSeparator:(unichar)timeSep { if (timeSep != ':') { NSMutableString *timeFormatMutable = [timeFormat mutableCopy]; [timeFormatMutable replaceOccurrencesOfString:@":" withString:[NSString stringWithCharacters:&timeSep length:1U] options:NSBackwardsSearch | NSLiteralSearch range:(NSRange){ 0UL, [timeFormat length] }]; timeFormat = timeFormatMutable; } return timeFormat; } - (NSString *)stringFromDate:(NSDate *)date { switch (self.format) { case RKISO8601DateFormatCalendar: return [self stringFromDate:date formatString:RK_ISOCALENDAR_DATE_FORMAT]; case RKISO8601DateFormatWeek: return [self weekDateStringForDate:date timeZone:self.timeZone]; case RKISO8601DateFormatOrdinal: return [self stringFromDate:date formatString:RK_ISOORDINAL_DATE_FORMAT]; default: [NSException raise:NSInternalInconsistencyException format:@"self.format was %ld, not calendar (%d), week (%d), or ordinal (%d)", (unsigned long) self.format, RKISO8601DateFormatCalendar, RKISO8601DateFormatWeek, RKISO8601DateFormatOrdinal]; return nil; } } - (NSString *)stringFromDate:(NSDate *)date formatString:(NSString *)dateFormat { if (self.includeTime) dateFormat = [dateFormat stringByAppendingFormat:@"'T'%@", [self replaceColonsInString:RK_ISOTIME_FORMAT withTimeSeparator:self.timeSeparator]]; if (! [dateFormat isEqualToString:self.lastUsedFormatString]) { self.unparsingFormatter = nil; self.lastUsedFormatString = dateFormat; } if (!self.unparsingFormatter) { self.unparsingFormatter = [[NSDateFormatter alloc] init]; self.unparsingFormatter.formatterBehavior = NSDateFormatterBehavior10_4; self.unparsingFormatter.dateFormat = dateFormat; self.unparsingFormatter.calendar = self.unparsingCalendar; self.unparsingFormatter.timeZone = self.timeZone; self.unparsingFormatter.locale = self.locale; } NSString *str = [self.unparsingFormatter stringForObjectValue:date]; if (self.includeTime) { NSInteger offset = [self.timeZone secondsFromGMT]; offset /= 60; //bring down to minutes if (offset == 0) str = [str stringByAppendingString:RK_ISOTIMEZONE_UTC_FORMAT]; else str = [str stringByAppendingFormat:RK_ISOTIMEZONE_OFFSET_FORMAT, (long) (offset / 60), (long) (offset % 60)]; } return str; } - (NSString *)stringForObjectValue:(id)value { NSParameterAssert([value isKindOfClass:[NSDate class]]); return [self stringFromDate:(NSDate *)value]; } /*Adapted from: * Algorithm for Converting Gregorian Dates to ISO 8601 Week Date * Rick McCarty, 1999 * http://personal.ecu.edu/mccartyr/ISOwdALG.txt */ - (NSString *)weekDateStringForDate:(NSDate *)date { self.unparsingCalendar.timeZone = self.timeZone; self.unparsingCalendar.locale = self.locale; NSDateComponents *components = [self.unparsingCalendar components:NSYearCalendarUnit | NSWeekdayCalendarUnit | NSDayCalendarUnit fromDate:date]; //Determine the ordinal date. NSDateComponents *startOfYearComponents = [self.unparsingCalendar components:NSYearCalendarUnit fromDate:date]; startOfYearComponents.month = 1; startOfYearComponents.day = 1; NSDateComponents *ordinalComponents = [self.unparsingCalendar components:NSDayCalendarUnit fromDate:[self.unparsingCalendar dateFromComponents:startOfYearComponents] toDate:date options:0]; ordinalComponents.day += 1; enum { monday, tuesday, wednesday, thursday, friday, saturday, sunday }; enum { january = 1, february, march, april, may, june, july, august, september, october, november, december }; NSInteger year = components.year; NSInteger week = 0; //The old unparser added 6 to [calendarDate dayOfWeek], which was zero-based; components.weekday is one-based, so we now add only 5. NSInteger dayOfWeek = (components.weekday + 5) % 7; NSInteger dayOfYear = ordinalComponents.day; NSInteger prevYear = year - 1; BOOL yearIsLeapYear = is_leap_year(year); BOOL prevYearIsLeapYear = is_leap_year(prevYear); NSInteger YY = prevYear % 100; NSInteger C = prevYear - YY; NSInteger G = YY + YY / 4; NSInteger Jan1Weekday = (((((C / 100) % 4) * 5) + G) % 7); NSInteger weekday = ((dayOfYear + Jan1Weekday) - 1) % 7; if ((dayOfYear <= (7 - Jan1Weekday)) && (Jan1Weekday > thursday)) { week = 52 + ((Jan1Weekday == friday) || ((Jan1Weekday == saturday) && prevYearIsLeapYear)); --year; } else { NSInteger lengthOfYear = 365 + yearIsLeapYear; if ((lengthOfYear - dayOfYear) < (thursday - weekday)) { ++year; week = 1; } else { NSInteger J = dayOfYear + (sunday - weekday) + Jan1Weekday; week = J / 7 - (Jan1Weekday > thursday); } } NSString *timeString; if (self.includeTime) { NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; unichar timeSep = self.timeSeparator; if (!timeSep) timeSep = RKISO8601DefaultTimeSeparatorCharacter; formatter.dateFormat = [self replaceColonsInString:RK_ISOTIME_WITH_TIMEZONE_FORMAT withTimeSeparator:timeSep]; timeString = [formatter stringForObjectValue:date]; } else timeString = @""; return [NSString stringWithFormat:@"%lu-W%02lu-%02lu%@", (unsigned long)year, (unsigned long)week, ((unsigned long)dayOfWeek) + 1U, timeString]; } @end static NSUInteger read_segment(const unsigned char *str, const unsigned char **next, NSUInteger *out_num_digits) { NSUInteger num_digits = 0U; NSUInteger value = 0U; while(isdigit(*str)) { value *= 10U; value += *str - '0'; ++num_digits; ++str; } if (next) *next = str; if (out_num_digits) *out_num_digits = num_digits; return value; } static NSUInteger read_segment_4digits(const unsigned char *str, const unsigned char **next, NSUInteger *out_num_digits) { NSUInteger num_digits = 0U; NSUInteger value = 0U; if (isdigit(*str)) { value += *(str++) - '0'; ++num_digits; } if (isdigit(*str)) { value *= 10U; value += *(str++) - '0'; ++num_digits; } if (isdigit(*str)) { value *= 10U; value += *(str++) - '0'; ++num_digits; } if (isdigit(*str)) { value *= 10U; value += *(str++) - '0'; ++num_digits; } if (next) *next = str; if (out_num_digits) *out_num_digits = num_digits; return value; } static NSUInteger read_segment_2digits(const unsigned char *str, const unsigned char **next) { NSUInteger value = 0U; if (isdigit(*str)) value += *str - '0'; if (isdigit(*++str)) { value *= 10U; value += *(str++) - '0'; } if (next) *next = str; return value; } //strtod doesn't support ',' as a separator. This does. static double read_double(const unsigned char *str, const unsigned char **next) { double value = 0.0; if (str) { NSUInteger int_value = 0; while(isdigit(*str)) { int_value *= 10U; int_value += (*(str++) - '0'); } value = int_value; if (((*str == ',') || (*str == '.'))) { ++str; register double multiplier, multiplier_multiplier; multiplier = multiplier_multiplier = 0.1; while(isdigit(*str)) { value += (*(str++) - '0') * multiplier; multiplier *= multiplier_multiplier; } } } if (next) *next = str; return value; } static BOOL is_leap_year(NSUInteger year) { return \ ((year % 4U) == 0U) && (((year % 100U) != 0U) || ((year % 400U) == 0U)); }
{ "pile_set_name": "Github" }
.p-0 padding: 0; .p-1 padding: 0.25rem; .p-2 padding: 0.5rem; .p-3 padding: 0.75rem; .p-4 padding: 1rem; .p-5 padding: 1.25rem; .p-6 padding: 1.5rem; .p-8 padding: 2rem; .p-10 padding: 2.5rem; .p-12 padding: 3rem; .p-16 padding: 4rem; .p-20 padding: 5rem; .p-24 padding: 6rem; .p-32 padding: 8rem; .p-40 padding: 10rem; .p-48 padding: 12rem; .p-56 padding: 14rem; .p-64 padding: 16rem; .p-px padding: 1px; .py-0 padding-top: 0; padding-bottom: 0; .py-1 padding-top: 0.25rem; padding-bottom: 0.25rem; .py-2 padding-top: 0.5rem; padding-bottom: 0.5rem; .py-3 padding-top: 0.75rem; padding-bottom: 0.75rem; .py-4 padding-top: 1rem; padding-bottom: 1rem; .py-5 padding-top: 1.25rem; padding-bottom: 1.25rem; .py-6 padding-top: 1.5rem; padding-bottom: 1.5rem; .py-8 padding-top: 2rem; padding-bottom: 2rem; .py-10 padding-top: 2.5rem; padding-bottom: 2.5rem; .py-12 padding-top: 3rem; padding-bottom: 3rem; .py-16 padding-top: 4rem; padding-bottom: 4rem; .py-20 padding-top: 5rem; padding-bottom: 5rem; .py-24 padding-top: 6rem; padding-bottom: 6rem; .py-32 padding-top: 8rem; padding-bottom: 8rem; .py-40 padding-top: 10rem; padding-bottom: 10rem; .py-48 padding-top: 12rem; padding-bottom: 12rem; .py-56 padding-top: 14rem; padding-bottom: 14rem; .py-64 padding-top: 16rem; padding-bottom: 16rem; .py-px padding-top: 1px; padding-bottom: 1px; .px-0 padding-right: 0; padding-left: 0; .px-1 padding-right: 0.25rem; padding-left: 0.25rem; .px-2 padding-right: 0.5rem; padding-left: 0.5rem; .px-3 padding-right: 0.75rem; padding-left: 0.75rem; .px-4 padding-right: 1rem; padding-left: 1rem; .px-5 padding-right: 1.25rem; padding-left: 1.25rem; .px-6 padding-right: 1.5rem; padding-left: 1.5rem; .px-8 padding-right: 2rem; padding-left: 2rem; .px-10 padding-right: 2.5rem; padding-left: 2.5rem; .px-12 padding-right: 3rem; padding-left: 3rem; .px-16 padding-right: 4rem; padding-left: 4rem; .px-20 padding-right: 5rem; padding-left: 5rem; .px-24 padding-right: 6rem; padding-left: 6rem; .px-32 padding-right: 8rem; padding-left: 8rem; .px-40 padding-right: 10rem; padding-left: 10rem; .px-48 padding-right: 12rem; padding-left: 12rem; .px-56 padding-right: 14rem; padding-left: 14rem; .px-64 padding-right: 16rem; padding-left: 16rem; .px-px padding-right: 1px; padding-left: 1px; .pt-0 padding-top: 0; .pt-1 padding-top: 0.25rem; .pt-2 padding-top: 0.5rem; .pt-3 padding-top: 0.75rem; .pt-4 padding-top: 1rem; .pt-5 padding-top: 1.25rem; .pt-6 padding-top: 1.5rem; .pt-8 padding-top: 2rem; .pt-10 padding-top: 2.5rem; .pt-12 padding-top: 3rem; .pt-16 padding-top: 4rem; .pt-20 padding-top: 5rem; .pt-24 padding-top: 6rem; .pt-32 padding-top: 8rem; .pt-40 padding-top: 10rem; .pt-48 padding-top: 12rem; .pt-56 padding-top: 14rem; .pt-64 padding-top: 16rem; .pt-px padding-top: 1px; .pr-0 padding-right: 0; .pr-1 padding-right: 0.25rem; .pr-2 padding-right: 0.5rem; .pr-3 padding-right: 0.75rem; .pr-4 padding-right: 1rem; .pr-5 padding-right: 1.25rem; .pr-6 padding-right: 1.5rem; .pr-8 padding-right: 2rem; .pr-10 padding-right: 2.5rem; .pr-12 padding-right: 3rem; .pr-16 padding-right: 4rem; .pr-20 padding-right: 5rem; .pr-24 padding-right: 6rem; .pr-32 padding-right: 8rem; .pr-40 padding-right: 10rem; .pr-48 padding-right: 12rem; .pr-56 padding-right: 14rem; .pr-64 padding-right: 16rem; .pr-px padding-right: 1px; .pb-0 padding-bottom: 0; .pb-1 padding-bottom: 0.25rem; .pb-2 padding-bottom: 0.5rem; .pb-3 padding-bottom: 0.75rem; .pb-4 padding-bottom: 1rem; .pb-5 padding-bottom: 1.25rem; .pb-6 padding-bottom: 1.5rem; .pb-8 padding-bottom: 2rem; .pb-10 padding-bottom: 2.5rem; .pb-12 padding-bottom: 3rem; .pb-16 padding-bottom: 4rem; .pb-20 padding-bottom: 5rem; .pb-24 padding-bottom: 6rem; .pb-32 padding-bottom: 8rem; .pb-40 padding-bottom: 10rem; .pb-48 padding-bottom: 12rem; .pb-56 padding-bottom: 14rem; .pb-64 padding-bottom: 16rem; .pb-px padding-bottom: 1px; .pl-0 padding-left: 0; .pl-1 padding-left: 0.25rem; .pl-2 padding-left: 0.5rem; .pl-3 padding-left: 0.75rem; .pl-4 padding-left: 1rem; .pl-5 padding-left: 1.25rem; .pl-6 padding-left: 1.5rem; .pl-8 padding-left: 2rem; .pl-10 padding-left: 2.5rem; .pl-12 padding-left: 3rem; .pl-16 padding-left: 4rem; .pl-20 padding-left: 5rem; .pl-24 padding-left: 6rem; .pl-32 padding-left: 8rem; .pl-40 padding-left: 10rem; .pl-48 padding-left: 12rem; .pl-56 padding-left: 14rem; .pl-64 padding-left: 16rem; .pl-px padding-left: 1px;
{ "pile_set_name": "Github" }
// // impl/execution_context.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef ASIO_IMPL_EXECUTION_CONTEXT_HPP #define ASIO_IMPL_EXECUTION_CONTEXT_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/handler_type_requirements.hpp" #include "asio/detail/scoped_ptr.hpp" #include "asio/detail/service_registry.hpp" #include "asio/detail/push_options.hpp" namespace asio { template <typename Service> inline Service& use_service(execution_context& e) { // Check that Service meets the necessary type requirements. (void)static_cast<execution_context::service*>(static_cast<Service*>(0)); return e.service_registry_->template use_service<Service>(); } #if !defined(GENERATING_DOCUMENTATION) # if defined(ASIO_HAS_VARIADIC_TEMPLATES) template <typename Service, typename... Args> Service& make_service(execution_context& e, ASIO_MOVE_ARG(Args)... args) { detail::scoped_ptr<Service> svc( new Service(e, ASIO_MOVE_CAST(Args)(args)...)); e.service_registry_->template add_service<Service>(svc.get()); Service& result = *svc; svc.release(); return result; } # else // defined(ASIO_HAS_VARIADIC_TEMPLATES) template <typename Service> Service& make_service(execution_context& e) { detail::scoped_ptr<Service> svc(new Service(e)); e.service_registry_->template add_service<Service>(svc.get()); Service& result = *svc; svc.release(); return result; } #define ASIO_PRIVATE_MAKE_SERVICE_DEF(n) \ template <typename Service, ASIO_VARIADIC_TPARAMS(n)> \ Service& make_service(execution_context& e, \ ASIO_VARIADIC_MOVE_PARAMS(n)) \ { \ detail::scoped_ptr<Service> svc( \ new Service(e, ASIO_VARIADIC_MOVE_ARGS(n))); \ e.service_registry_->template add_service<Service>(svc.get()); \ Service& result = *svc; \ svc.release(); \ return result; \ } \ /**/ ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_MAKE_SERVICE_DEF) #undef ASIO_PRIVATE_MAKE_SERVICE_DEF # endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) #endif // !defined(GENERATING_DOCUMENTATION) template <typename Service> inline void add_service(execution_context& e, Service* svc) { // Check that Service meets the necessary type requirements. (void)static_cast<execution_context::service*>(static_cast<Service*>(0)); e.service_registry_->template add_service<Service>(svc); } template <typename Service> inline bool has_service(execution_context& e) { // Check that Service meets the necessary type requirements. (void)static_cast<execution_context::service*>(static_cast<Service*>(0)); return e.service_registry_->template has_service<Service>(); } inline execution_context& execution_context::service::context() { return owner_; } } // namespace asio #include "asio/detail/pop_options.hpp" #endif // ASIO_IMPL_EXECUTION_CONTEXT_HPP
{ "pile_set_name": "Github" }
# In-Memory Columnar Storage Spark SQL可以将数据缓存到内存中,我们可以见到的通过调用cache table tableName即可将一张表缓存到内存中,来极大的提高查询效率。这就涉及到内存中的数据的存储形式,我们知道基于关系型的数据可以存储为基于行存储结构或者基于列存储结构,或者基于行和列的混合存储,即Row Based Storage、Column Based Storage、 PAX Storage。 Spark SQL 将数据加载到内存是以列的存储结构。称为In-Memory Columnar Storage。若直接存储Java Object会产生很大的内存开销,并且这样是基于Row的存储结构。查询某些列速度略慢,虽然数据以及载入内存,查询效率还是低于面向列的存储结构。 Spark SQL的In-Memory Columnar Storage是位于spark列下面org.apache.spark.sql.columnar包内。核心的类有 ColumnBuilder, InMemoryColumnarTableScan, ColumnAccessor, ColumnType。如果列有压缩的情况:compression包下面有具体的build列和access列的类。 当我们调用```sql("cache table src") ```时,会产生一个catalyst.plans.logical.CacheTableCommand,是一个LogicalPlan。 ``` case class CacheTableCommand(tableName: String, plan: Option[LogicalPlan], isLazy: Boolean) extends Command abstract class Command extends LeafNode { self: Product => def output: Seq[Attribute] = Seq.empty } abstract class LeafNode extends LogicalPlan with trees.LeafNode[LogicalPlan] { self: Product => } ``` 在生成物理计划的时候,会转换成execution.CacheTableComman的Physical Plan。 ``` case logical.CacheTableCommand(tableName, optPlan, isLazy) => Seq(execution.CacheTableCommand(tableName, optPlan, isLazy)) ``` ``` case class CacheTableCommand( tableName: String, plan: Option[LogicalPlan], isLazy: Boolean) extends LeafNode with Command { override protected lazy val sideEffectResult = { import sqlContext._ plan.foreach(_.registerTempTable(tableName)) cacheTable(tableName) if (!isLazy) { // Performs eager caching table(tableName).count() } Seq.empty[Row] } override def output: Seq[Attribute] = Seq.empty } ``` 接着调用CacheManager的cacheTable函数,然后调cacheQuery函数。在cacheQuery里面生成了InMemoryRelation对象,就是列式存储的数据结构。 ``` private[sql] trait CacheManager { ... def cacheTable(tableName: String): Unit = cacheQuery(table(tableName), Some(tableName)) ... private[sql] def cacheQuery( query: SchemaRDD, tableName: Option[String] = None, storageLevel: StorageLevel = MEMORY_AND_DISK): Unit = writeLock { val planToCache = query.queryExecution.analyzed if (lookupCachedData(planToCache).nonEmpty) { logWarning("Asked to cache already cached data.") } else { cachedData += CachedData( planToCache, InMemoryRelation( useCompression, columnBatchSize, storageLevel, query.queryExecution.executedPlan, tableName)) } } ... } ``` ### 用法 SparkSQL中有三种方法触发cache: 1. sqlContext.sql("cache table tableName") 2. sqlContext.cacheTable("tableName") 3. schemaRDD.cache() 以上三种用法都会使用到列存储的方式对rdd进行缓存。如果调用了普通rdd的cache方法,是不会触发列式存储的cache。 在Spark1.2.0中,cache table的执行时eager模式的,如果想触发lazy模式,可以主动添加lazy关键字,例如```cache lazy table tabelName```。 而在Spark1.2.0之前,cache table的默认语义是lazy的,所以需要主动触发action才会真正执行cache操作。 ### InMemoryRelation InMemoryRelation继承自LogicalPlan。_cachedColumnBuffers这个类型为RDD[CachedBatch]的私有字段。CachedBatch是Array[Array[Byte]]的封装。 ``` case class CachedBatch(buffers: Array[Array[Byte]], stats: Row) ``` ![](/images/column-store3.png) 构造一个InMemoryRelation需要该Relation 1. output Attribute 2. 是否需要useCoompression来压缩,默认为false 3. 一次处理的多少行数据batchSize 4. storageLevel 缓存到什么地方 5. child 即SparkPlan 6. table名 7. _cachedColumnBuffers最终将table放入内存的存储句柄,是一个RDD[CachedBatch] 8. _statistics是统计信息 ``` private[sql] case class InMemoryRelation( output: Seq[Attribute], useCompression: Boolean, batchSize: Int, storageLevel: StorageLevel, child: SparkPlan, tableName: Option[String])( private var _cachedColumnBuffers: RDD[CachedBatch] = null, private var _statistics: Statistics = null) extends LogicalPlan with MultiInstanceRelation ``` 可以通过设置: spark.sql.inMemoryColumnarStorage.compressed为true来设置内存中的列存储是否需要压缩。 spark.sql.inMemoryColumnarStorage.batchSize来设置一次处理多少row spark.sql.defaultSizeInBytes来设置初始化的column的bufferbytes的默认大小,这里只是其中一个参数。 缓存主流程: 1. 判断_cachedColumnBuffers是否为null,如果不是null,则已经Cache了当前table,重复cache不会触发cache操作,如果是null,则调用buildBuffers。 2. child是物理执行计划SparkPlan 3. 执行mapPartitions操作,对当前RDD的每个分区的数据进行操作。 4. 对于每一个分区,迭代里面的数据生成新的Iterator。每个Iterator里面是CachedBatch 5. 对于child.output的每一列,都会生成一个ColumnBuilder,最后组合为一个columnBuilders是一个数组。 6. 数组内每个CommandBuilder持有一个ByteBuffer 7. 遍历原始分区的记录,将对于的行转为列,并将数据存到ByteBuffer内。 8. 最后将此RDD调用persist方法,将RDD缓存。 9. 将cached赋给_cachedColumnBuffers。 ``` if (_cachedColumnBuffers == null) { buildBuffers() } private def buildBuffers(): Unit = { val output = child.output val cached = child.execute().mapPartitions { rowIterator => new Iterator[CachedBatch] { def next() = { val columnBuilders = output.map { attribute => val columnType = ColumnType(attribute.dataType) val initialBufferSize = columnType.defaultSize * batchSize ColumnBuilder(columnType.typeId, initialBufferSize, attribute.name, useCompression) }.toArray var rowCount = 0 while (rowIterator.hasNext && rowCount < batchSize) { val row = rowIterator.next() var i = 0 while (i < row.length) { columnBuilders(i).appendFrom(row, i) i += 1 } rowCount += 1 } val stats = Row.fromSeq( columnBuilders.map(_.columnStats.collectedStatistics).foldLeft(Seq.empty[Any])(_ ++ _)) batchStats += stats CachedBatch(columnBuilders.map(_.build().array()), stats) } def hasNext = rowIterator.hasNext } }.persist(storageLevel) cached.setName(tableName.map(n => s"In-memory table $n").getOrElse(child.toString)) _cachedColumnBuffers = cached } ``` ### ColumnBuilder columnBuilders是一个存储ColumnBuilder的数组。 ``` val columnBuilders = output.map { attribute => val columnType = ColumnType(attribute.dataType) val initialBufferSize = columnType.defaultSize * batchSize ColumnBuilder(columnType.typeId, initialBufferSize, attribute.name, useCompression) }.toArray ``` 初始化ColumnBuilder的时候会传入的参数: 1. columnType.typeId 表示列的数据类型 2. initialBufferSize ByteBuffer的初始化大小,列类型默认长度 \* batchSize ,默认batchSize是1000。拿Int类型举例,initialBufferSize of IntegerType = 4 \* 1000 3. attribute.name 即字段名age,name,etc 4. useCompression 是否开启压缩 ColumnType封装了该类型的typeId和该类型的defaultSize。并且提供了extract、append、getField方法,来向buffer里追加和获取数据。 ``` private[sql] sealed abstract class ColumnType[T <: DataType, JvmType]( val typeId: Int, val defaultSize: Int) { def extract(buffer: ByteBuffer): JvmType def append(v: JvmType, buffer: ByteBuffer): Unit def actualSize(row: Row, ordinal: Int): Int = defaultSize ... } ``` ColumnBuilder的主要职责是:管理ByteBuffer,包括初始化buffer,添加数据到buffer内,检查剩余空间,和申请新的空间这几项主要职责。 initialize负责初始化buffer。 ``` override def initialize( initialSize: Int, columnName: String = "", useCompression: Boolean = false) = { val size = if (initialSize == 0) DEFAULT_INITIAL_BUFFER_SIZE else initialSize this.columnName = columnName // Reserves 4 bytes for column type ID buffer = ByteBuffer.allocate(4 + size * columnType.defaultSize) buffer.order(ByteOrder.nativeOrder()).putInt(columnType.typeId) } ``` appendFrom是负责添加数据。 ``` override def appendFrom(row: Row, ordinal: Int): Unit = { buffer = ensureFreeSpace(buffer, columnType.actualSize(row, ordinal)) columnType.append(row, ordinal, buffer) } ``` ensureFreeSpace主要是操作buffer,如果要追加的数据大于剩余空间,就扩大buffer。 ``` private[columnar] def ensureFreeSpace(orig: ByteBuffer, size: Int) = { if (orig.remaining >= size) { orig } else { // grow in steps of initial size val capacity = orig.capacity() val newSize = capacity + size.max(capacity / 8 + 1) val pos = orig.position() ByteBuffer .allocate(newSize) .order(ByteOrder.nativeOrder()) .put(orig.array(), 0, pos) } } ```
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -verify %s // RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -verify %s -DCLASS #ifdef CLASS struct Outer { #endif template<typename> struct A {}; // Valid forms. A(int(&)[1]) -> A<int>; explicit A(int(&)[2]) -> A<int>; // Declarator pieces are not OK. *A(int(&)[3]) -> A<int>; // expected-error {{cannot specify any part of a return type in the declaration of a deduction guide}} &A(int(&)[4]) -> A<int>; // expected-error {{cannot specify any part of a return type in the declaration of a deduction guide}} A(int(&)[5])[3] -> A<int>; #ifdef CLASS // FIXME: These diagnostics are both pretty bad. // expected-error@-2 {{function cannot return array type}} expected-error@-2 {{';'}} #else // expected-error@-4 {{expected function body after function declarator}} #endif (A[3])(int(&)[5][1]) -> A<int>; // expected-error {{'<deduction guide for A>' cannot be the name of a variable}} #ifndef CLASS // expected-error@-2 {{declared as array of functions}} #endif (*A)(int(&)[5][2]) -> A<int>; // expected-error {{'<deduction guide for A>' cannot be the name of a variable}} (&A)(int(&)[5][3]) -> A<int>; // expected-error {{'<deduction guide for A>' cannot be the name of a variable}} (*A(int))(int(&)[5][4]) -> A<int>; // expected-error {{cannot specify any part of a return type in the declaration of a deduction guide}} // (Pending DR) attributes and parens around the declarator-id are OK. [[deprecated]] A(int(&)[6]) [[]] -> A<int> [[]]; A [[]] (int(&)[7]) -> A<int>; (A)(int(&)[8]) -> A<int>; // ... but the trailing-return-type is part of the function-declarator as normal (A(int(&)[9])) -> A<int>; #ifdef CLASS // FIXME: These diagnostics are both pretty bad. // expected-error@-2 {{deduction guide declaration without trailing return type}} expected-error@-2 {{';'}} #else // expected-error@-4 {{expected function body after function declarator}} #endif (A(int(&)[10]) -> A<int>); // expected-error {{trailing return type may not be nested within parentheses}} // A trailing-return-type is mandatory. A(int(&)[11]); // expected-error {{deduction guide declaration without trailing return type}} // No type specifier is permitted; we don't even parse such cases as a deduction-guide. int A(int) -> A<int>; // expected-error {{function with trailing return type must specify return type 'auto', not 'int'}} template<typename T> struct B {}; // expected-note {{here}} auto B(int) -> B<int>; // expected-error {{redefinition of 'B' as different kind of symbol}} // No storage class specifier, function specifier, ... friend A(int(&)[20]) -> A<int>; #ifdef CLASS // expected-error@-2 {{cannot declare a deduction guide as a friend}} #else // expected-error@-4 {{'friend' used outside of class}} #endif typedef A(int(&)[21]) -> A<int>; // expected-error {{deduction guide cannot be declared 'typedef'}} constexpr A(int(&)[22]) -> A<int>; // expected-error {{deduction guide cannot be declared 'constexpr'}} inline A(int(&)[23]) -> A<int>; // expected-error {{deduction guide cannot be declared 'inline'}} static A(int(&)[24]) -> A<int>; // expected-error {{deduction guide cannot be declared 'static'}} thread_local A(int(&)[25]) -> A<int>; // expected-error {{'thread_local' is only allowed on variable declarations}} extern A(int(&)[26]) -> A<int>; #ifdef CLASS // expected-error@-2 {{storage class specified for a member}} #else // expected-error@-4 {{deduction guide cannot be declared 'extern'}} #endif mutable A(int(&)[27]) -> A<int>; // expected-error-re {{{{'mutable' cannot be applied to|illegal storage class on}} function}} virtual A(int(&)[28]) -> A<int>; // expected-error {{'virtual' can only appear on non-static member functions}} const A(int(&)[31]) -> A<int>; // expected-error {{deduction guide cannot be declared 'const'}} const volatile static constexpr inline A(int(&)[29]) -> A<int>; // expected-error {{deduction guide cannot be declared 'static inline constexpr const volatile'}} A(int(&)[30]) const -> A<int>; // expected-error {{deduction guide cannot have 'const' qualifier}} // No definition is allowed. A(int(&)[40]) -> A<int> {} // expected-error {{deduction guide cannot have a function definition}} A(int(&)[41]) -> A<int> = default; // expected-error {{deduction guide cannot have a function definition}} expected-error {{only special member functions may be defaulted}} A(int(&)[42]) -> A<int> = delete; // expected-error {{deduction guide cannot have a function definition}} A(int(&)[43]) -> A<int> try {} catch (...) {} // expected-error {{deduction guide cannot have a function definition}} #ifdef CLASS }; #endif namespace ExplicitInst { // Explicit instantiation / specialization is not permitted. template<typename T> struct B {}; template<typename T> B(T) -> B<T>; template<> B(int) -> B<int>; // expected-error {{deduction guide cannot be explicitly specialized}} extern template B(float) -> B<float>; // expected-error {{deduction guide cannot be explicitly instantiated}} template B(char) -> B<char>; // expected-error {{deduction guide cannot be explicitly instantiated}} // An attempt at partial specialization doesn't even parse as a deduction-guide. template<typename T> B<T*>(T*) -> B<T*>; // expected-error 1+{{}} expected-note 0+{{}} struct X { template<typename T> struct C {}; template<typename T> C(T) -> C<T>; template<> C(int) -> C<int>; // expected-error {{deduction guide cannot be explicitly specialized}} extern template C(float) -> C<float>; // expected-error {{expected member name or ';'}} template C(char) -> C<char>; // expected-error {{expected '<' after 'template'}} }; }
{ "pile_set_name": "Github" }
#!/usr/bin/env python # coding: utf-8 # # Author: Kazuto Nakashima # URL: https://kazuto1011.github.io # Date: 09 January 2019 import numpy as np import pydensecrf.densecrf as dcrf import pydensecrf.utils as utils class DenseCRF(object): def __init__(self, iter_max, pos_w, pos_xy_std, bi_w, bi_xy_std, bi_rgb_std): self.iter_max = iter_max self.pos_w = pos_w self.pos_xy_std = pos_xy_std self.bi_w = bi_w self.bi_xy_std = bi_xy_std self.bi_rgb_std = bi_rgb_std def __call__(self, image, probmap): C, H, W = probmap.shape U = utils.unary_from_softmax(probmap) U = np.ascontiguousarray(U) image = np.ascontiguousarray(image) d = dcrf.DenseCRF2D(W, H, C) d.setUnaryEnergy(U) d.addPairwiseGaussian(sxy=self.pos_xy_std, compat=self.pos_w) d.addPairwiseBilateral( sxy=self.bi_xy_std, srgb=self.bi_rgb_std, rgbim=image, compat=self.bi_w ) Q = d.inference(self.iter_max) Q = np.array(Q).reshape((C, H, W)) return Q
{ "pile_set_name": "Github" }
using Microsoft.EntityFrameworkCore.Migrations; namespace cloudscribe.SimpleContent.Storage.EFCore.SQLite.Migrations { public partial class simplecontent20180908 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { //migrationBuilder.AlterColumn<byte>( // name: "TeaserTruncationMode", // table: "cs_ContentProject", // nullable: false, // defaultValue: (byte)0, // oldClrType: typeof(byte), // oldDefaultValue: (byte)0) // .OldAnnotation("Sqlite:Autoincrement", true); //migrationBuilder.AlterColumn<byte>( // name: "TeaserMode", // table: "cs_ContentProject", // nullable: false, // defaultValue: (byte)0, // oldClrType: typeof(byte), // oldDefaultValue: (byte)0) // .OldAnnotation("Sqlite:Autoincrement", true); //migrationBuilder.AlterColumn<int>( // name: "MaxFeedItems", // table: "cs_ContentProject", // nullable: false, // defaultValue: 1000, // oldClrType: typeof(int)) // .Annotation("Sqlite:Autoincrement", true); //migrationBuilder.AlterColumn<int>( // name: "DefaultFeedItems", // table: "cs_ContentProject", // nullable: false, // defaultValue: 20, // oldClrType: typeof(int)) // .Annotation("Sqlite:Autoincrement", true); } protected override void Down(MigrationBuilder migrationBuilder) { //migrationBuilder.AlterColumn<byte>( // name: "TeaserTruncationMode", // table: "cs_ContentProject", // nullable: false, // defaultValue: (byte)0, // oldClrType: typeof(byte), // oldDefaultValue: (byte)0) // .Annotation("Sqlite:Autoincrement", true); //migrationBuilder.AlterColumn<byte>( // name: "TeaserMode", // table: "cs_ContentProject", // nullable: false, // defaultValue: (byte)0, // oldClrType: typeof(byte), // oldDefaultValue: (byte)0) // .Annotation("Sqlite:Autoincrement", true); //migrationBuilder.AlterColumn<int>( // name: "MaxFeedItems", // table: "cs_ContentProject", // nullable: false, // oldClrType: typeof(int), // oldDefaultValue: 1000) // .OldAnnotation("Sqlite:Autoincrement", true); //migrationBuilder.AlterColumn<int>( // name: "DefaultFeedItems", // table: "cs_ContentProject", // nullable: false, // oldClrType: typeof(int), // oldDefaultValue: 20) // .OldAnnotation("Sqlite:Autoincrement", true); } } }
{ "pile_set_name": "Github" }
// // Seaglass, a native macOS Matrix client // Copyright © 2018, Neil Alexander // // 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 // (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, see <https://www.gnu.org/licenses/>. // import Cocoa import SwiftMatrixSDK class MainViewSendErrorController: NSViewController { @IBOutlet var ApplyAllCheckbox: NSButton! @IBOutlet var ErrorDescription: NSTextField! public var roomId: String? public var eventId: String? required init?(coder: NSCoder) { super.init(coder: coder) } override func viewDidLoad() { super.viewDidLoad() } @IBAction func ignoreButtonClicked(_ sender: NSButton) { self.dismiss(sender) } @IBAction func deleteButtonClicked(_ sender: NSButton) { if let room = MatrixServices.inst.session.room(withRoomId: roomId) { // TODO: FIX THIS /* if ApplyAllCheckbox.state == .off { if let index = (self.mainController?.channelDelegate?.roomCache.content as! [MXEvent]).index(where: { $0.eventId == eventId }) { self.mainController?.channelDelegate?.roomCache.remove(atArrangedObjectIndex: index) } } else { for (index, event) in MatrixServices.inst.eventCache[roomId!]!.enumerated() { if event.sentState == MXEventSentStateFailed { let event = MatrixServices.inst.eventCache[roomId!]![index] MatrixServices.inst.mainController?.channelDelegate?.matrixDidRoomMessage(event: event.prune(), direction: .forwards, roomState: room.state, replaces: eventId, removeOnReplace: true) MatrixServices.inst.eventCache[roomId!]![index] = event.prune() } } } */ } self.dismiss(sender) } @IBAction func sendAgainButtonClicked(_ sender: NSButton) { self.dismiss(sender) } }
{ "pile_set_name": "Github" }
// Copyright 2019 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 proto import ( "google.golang.org/protobuf/reflect/protoreflect" ) // DiscardUnknown recursively discards all unknown fields from this message // and all embedded messages. // // When unmarshaling a message with unrecognized fields, the tags and values // of such fields are preserved in the Message. This allows a later call to // marshal to be able to produce a message that continues to have those // unrecognized fields. To avoid this, DiscardUnknown is used to // explicitly clear the unknown fields after unmarshaling. func DiscardUnknown(m Message) { if m != nil { discardUnknown(MessageReflect(m)) } } func discardUnknown(m protoreflect.Message) { m.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool { switch { // Handle singular message. case fd.Cardinality() != protoreflect.Repeated: if fd.Message() != nil { discardUnknown(m.Get(fd).Message()) } // Handle list of messages. case fd.IsList(): if fd.Message() != nil { ls := m.Get(fd).List() for i := 0; i < ls.Len(); i++ { discardUnknown(ls.Get(i).Message()) } } // Handle map of messages. case fd.IsMap(): if fd.MapValue().Message() != nil { ms := m.Get(fd).Map() ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool { discardUnknown(v.Message()) return true }) } } return true }) // Discard unknown fields. if len(m.GetUnknown()) > 0 { m.SetUnknown(nil) } }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- import vim MODE_ALL = u'a' MODE_NORMAL = u'n' MODE_VISUAL = u'v' MODE_INSERT = u'i' MODE_OPERATOR = u'o' OPTION_BUFFER_ONLY = u'<buffer>' OPTION_SLIENT = u'<silent>' from orgmode.py3compat.encode_compatibility import * def _register(f, name): def r(*args, **kwargs): p = f(*args, **kwargs) if hasattr(p, name) and isinstance(getattr(p, name), list): for i in getattr(p, name): i.create() return p return r def register_keybindings(f): return _register(f, u'keybindings') def register_commands(f): return _register(f, u'commands') class Command(object): u""" A vim command """ def __init__(self, name, command, arguments=u'0', complete=None, overwrite_exisiting=False): u""" :name: The name of command, first character must be uppercase :command: The actual command that is executed :arguments: See :h :command-nargs, only the arguments need to be specified :complete: See :h :command-completion, only the completion arguments need to be specified """ object.__init__(self) self._name = name self._command = command self._arguments = arguments self._complete = complete self._overwrite_exisiting = overwrite_exisiting def __unicode__(self): return u':%s<CR>' % self.name def __str__(self): return u_encode(self.__unicode__()) @property def name(self): return self._name @property def command(self): return self._command @property def arguments(self): return self._arguments @property def complete(self): return self._complete @property def overwrite_exisiting(self): return self._overwrite_exisiting def create(self): u""" Register/create the command """ vim.command(u_encode(':command%(overwrite)s -nargs=%(arguments)s %(complete)s %(name)s %(command)s' % {u'overwrite': '!' if self.overwrite_exisiting else '', u'arguments': u_encode(self.arguments), u'complete': '-complete=%s' % u_encode(self.complete) if self.complete else '', u'name': self.name, u'command': self.command} )) class Plug(object): u""" Represents a <Plug> to an abitrary command """ def __init__(self, name, command, mode=MODE_NORMAL): u""" :name: the name of the <Plug> should be ScriptnameCommandname :command: the actual command """ object.__init__(self) if mode not in (MODE_ALL, MODE_NORMAL, MODE_VISUAL, MODE_INSERT, MODE_OPERATOR): raise ValueError(u'Parameter mode not in MODE_ALL, MODE_NORMAL, MODE_VISUAL, MODE_INSERT, MODE_OPERATOR') self._mode = mode self.name = name self.command = command self.created = False def __unicode__(self): return u'<Plug>%s' % self.name def __str__(self): return u_encode(self.__unicode__()) def create(self): if not self.created: self.created = True cmd = self._mode if cmd == MODE_ALL: cmd = u'' vim.command(u_encode(u':%snoremap %s %s' % (cmd, str(self), self.command))) @property def mode(self): return self._mode class Keybinding(object): u""" Representation of a single key binding """ def __init__(self, key, action, mode=None, options=None, remap=True, buffer_only=True, silent=True): u""" :key: the key(s) action is bound to :action: the action triggered by key(s) :mode: definition in which vim modes the key binding is valid. Should be one of MODE_* :option: list of other options like <silent>, <buffer> ... :repmap: allow or disallow nested mapping :buffer_only: define the key binding only for the current buffer """ object.__init__(self) self._key = key self._action = action # grab mode from plug if not set otherwise if isinstance(self._action, Plug) and not mode: mode = self._action.mode if mode not in (MODE_ALL, MODE_NORMAL, MODE_VISUAL, MODE_INSERT, MODE_OPERATOR): raise ValueError(u'Parameter mode not in MODE_ALL, MODE_NORMAL, MODE_VISUAL, MODE_INSERT, MODE_OPERATOR') self._mode = mode self._options = options if self._options is None: self._options = [] self._remap = remap self._buffer_only = buffer_only self._silent = silent if self._buffer_only and OPTION_BUFFER_ONLY not in self._options: self._options.append(OPTION_BUFFER_ONLY) if self._silent and OPTION_SLIENT not in self._options: self._options.append(OPTION_SLIENT) @property def key(self): return self._key @property def action(self): return str(self._action) @property def mode(self): return self._mode @property def options(self): return self._options[:] @property def remap(self): return self._remap @property def buffer_only(self): return self._buffer_only @property def silent(self): return self._silent def create(self): from orgmode._vim import ORGMODE, echom cmd = self._mode if cmd == MODE_ALL: cmd = u'' if not self._remap: cmd += u'nore' try: create_mapping = True if isinstance(self._action, Plug): # create plug self._action.create() if int(vim.eval(u_encode(u'hasmapto("%s")' % (self._action, )))): create_mapping = False if isinstance(self._action, Command): # create command self._action.create() if create_mapping: vim.command(u_encode(u':%smap %s %s %s' % (cmd, u' '.join(self._options), self._key, self._action))) except BaseException as e: if ORGMODE.debug: echom(u'Failed to register key binding %s %s' % (self._key, self._action)) # vim: set noexpandtab:
{ "pile_set_name": "Github" }
// name: Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation // teardown_command: rm -f Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation_*.mat // keywords: simulation MSL Examples // status: correct // cflags: +simCodeTarget=Cpp // // Simulation Results // Modelica Standard Library // runScript("ModelTestingDefaults.mos");getErrorString(); modelTestingType := OpenModelicaModelTesting.Kind.Compilation; modelName := $TypeName(Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation); compareVars := { "HEX.pipe_1.mediums[1].T", "HEX.pipe_1.mediums[2].T", "HEX.pipe_1.mediums[3].T", "HEX.pipe_1.mediums[4].T", "HEX.pipe_1.mediums[5].T", "HEX.pipe_1.mediums[6].T", "HEX.pipe_1.mediums[7].T", "HEX.pipe_1.mediums[8].T", "HEX.pipe_1.mediums[9].T", "HEX.pipe_1.mediums[10].T", "HEX.pipe_1.mediums[11].T", "HEX.pipe_1.mediums[12].T", "HEX.pipe_1.mediums[13].T", "HEX.pipe_1.mediums[14].T", "HEX.pipe_1.mediums[15].T", "HEX.pipe_1.mediums[16].T", "HEX.pipe_1.mediums[17].T", "HEX.pipe_1.mediums[18].T", "HEX.pipe_1.mediums[19].T", "HEX.pipe_1.mediums[20].T", "HEX.pipe_2.mediums[1].T", "HEX.pipe_2.mediums[2].T", "HEX.pipe_2.mediums[3].T", "HEX.pipe_2.mediums[4].T", "HEX.pipe_2.mediums[5].T", "HEX.pipe_2.mediums[6].T", "HEX.pipe_2.mediums[7].T", "HEX.pipe_2.mediums[8].T", "HEX.pipe_2.mediums[9].T", "HEX.pipe_2.mediums[10].T", "HEX.pipe_2.mediums[11].T", "HEX.pipe_2.mediums[12].T", "HEX.pipe_2.mediums[13].T", "HEX.pipe_2.mediums[14].T", "HEX.pipe_2.mediums[15].T", "HEX.pipe_2.mediums[16].T", "HEX.pipe_2.mediums[17].T", "HEX.pipe_2.mediums[18].T", "HEX.pipe_2.mediums[19].T", "HEX.pipe_2.mediums[20].T", "HEX.wall.T[1]", "HEX.wall.T[2]", "HEX.wall.T[3]", "HEX.wall.T[4]", "HEX.wall.T[5]", "HEX.wall.T[6]", "HEX.wall.T[7]", "HEX.wall.T[8]", "HEX.wall.T[9]", "HEX.wall.T[10]", "HEX.wall.T[11]", "HEX.wall.T[12]", "HEX.wall.T[13]", "HEX.wall.T[14]", "HEX.wall.T[15]", "HEX.wall.T[16]", "HEX.wall.T[17]", "HEX.wall.T[18]", "HEX.wall.T[19]", "HEX.wall.T[20]" }; runScript(modelTesting);getErrorString(); // Result: // "true // true // true // " // "" // OpenModelicaModelTesting.Kind.Compilation // Modelica.Fluid.Examples.HeatExchanger.HeatExchangerSimulation // {"HEX.pipe_1.mediums[1].T","HEX.pipe_1.mediums[2].T","HEX.pipe_1.mediums[3].T","HEX.pipe_1.mediums[4].T","HEX.pipe_1.mediums[5].T","HEX.pipe_1.mediums[6].T","HEX.pipe_1.mediums[7].T","HEX.pipe_1.mediums[8].T","HEX.pipe_1.mediums[9].T","HEX.pipe_1.mediums[10].T","HEX.pipe_1.mediums[11].T","HEX.pipe_1.mediums[12].T","HEX.pipe_1.mediums[13].T","HEX.pipe_1.mediums[14].T","HEX.pipe_1.mediums[15].T","HEX.pipe_1.mediums[16].T","HEX.pipe_1.mediums[17].T","HEX.pipe_1.mediums[18].T","HEX.pipe_1.mediums[19].T","HEX.pipe_1.mediums[20].T","HEX.pipe_2.mediums[1].T","HEX.pipe_2.mediums[2].T","HEX.pipe_2.mediums[3].T","HEX.pipe_2.mediums[4].T","HEX.pipe_2.mediums[5].T","HEX.pipe_2.mediums[6].T","HEX.pipe_2.mediums[7].T","HEX.pipe_2.mediums[8].T","HEX.pipe_2.mediums[9].T","HEX.pipe_2.mediums[10].T","HEX.pipe_2.mediums[11].T","HEX.pipe_2.mediums[12].T","HEX.pipe_2.mediums[13].T","HEX.pipe_2.mediums[14].T","HEX.pipe_2.mediums[15].T","HEX.pipe_2.mediums[16].T","HEX.pipe_2.mediums[17].T","HEX.pipe_2.mediums[18].T","HEX.pipe_2.mediums[19].T","HEX.pipe_2.mediums[20].T","HEX.wall.T[1]","HEX.wall.T[2]","HEX.wall.T[3]","HEX.wall.T[4]","HEX.wall.T[5]","HEX.wall.T[6]","HEX.wall.T[7]","HEX.wall.T[8]","HEX.wall.T[9]","HEX.wall.T[10]","HEX.wall.T[11]","HEX.wall.T[12]","HEX.wall.T[13]","HEX.wall.T[14]","HEX.wall.T[15]","HEX.wall.T[16]","HEX.wall.T[17]","HEX.wall.T[18]","HEX.wall.T[19]","HEX.wall.T[20]"} // Compilation succeeded // "true // " // "" // endResult
{ "pile_set_name": "Github" }
/* * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU General Public License version 2. */ #ifndef __ACL_DOT_H__ #define __ACL_DOT_H__ #include "incore.h" #define GFS2_POSIX_ACL_ACCESS "posix_acl_access" #define GFS2_POSIX_ACL_ACCESS_LEN 16 #define GFS2_POSIX_ACL_DEFAULT "posix_acl_default" #define GFS2_POSIX_ACL_DEFAULT_LEN 17 #define GFS2_ACL_IS_ACCESS(name, len) \ ((len) == GFS2_POSIX_ACL_ACCESS_LEN && \ !memcmp(GFS2_POSIX_ACL_ACCESS, (name), (len))) #define GFS2_ACL_IS_DEFAULT(name, len) \ ((len) == GFS2_POSIX_ACL_DEFAULT_LEN && \ !memcmp(GFS2_POSIX_ACL_DEFAULT, (name), (len))) struct gfs2_ea_request; int gfs2_acl_validate_set(struct gfs2_inode *ip, int access, struct gfs2_ea_request *er, int *remove, mode_t *mode); int gfs2_acl_validate_remove(struct gfs2_inode *ip, int access); int gfs2_check_acl(struct inode *inode, int mask); int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip); int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr); #endif /* __ACL_DOT_H__ */
{ "pile_set_name": "Github" }
#!/bin/sh set -e -x CONFIG_FILE="/tmp/configs/copy_all_test_config.json" COMMON_CONFIG="/tmp/configs/common_config.json" TMP_CONFIG="/tmp/configs/tmp_config.json" cat ${CONFIG_FILE} > ${TMP_CONFIG} echo "," >> ${TMP_CONFIG} cat ${COMMON_CONFIG} >> ${TMP_CONFIG} /tmp/scripts/wrap_config_file.sh ${TMP_CONFIG} mkdir /tmp/copy_all_test_storage TO_CONFIG_FILE="/tmp/configs/copy_all_to_test_config.json" TO_TMP_CONFIG="/tmp/configs/to_tmp_config.json" cat ${TO_CONFIG_FILE} > ${TO_TMP_CONFIG} echo "," >> ${TO_TMP_CONFIG} /tmp/scripts/wrap_config_file.sh ${TO_TMP_CONFIG} /usr/lib/postgresql/10/bin/initdb ${PGDATA} echo "archive_mode = on" >> /var/lib/postgresql/10/main/postgresql.conf echo "archive_command = '/usr/bin/timeout 600 /usr/bin/wal-g --config=${TMP_CONFIG} wal-push %p'" >> /var/lib/postgresql/10/main/postgresql.conf echo "archive_timeout = 600" >> /var/lib/postgresql/10/main/postgresql.conf /usr/lib/postgresql/10/bin/pg_ctl -D ${PGDATA} -w start /tmp/scripts/wait_while_pg_not_ready.sh sleep 1 echo $WALG_DELTA_MAX_STEPS # push a backup pgbench -i -s 1 postgres & sleep 1 wal-g --config=${TMP_CONFIG} backup-push ${PGDATA} wal-g --config=${TMP_CONFIG} backup-list backup_name=`wal-g --config=${TMP_CONFIG} backup-list | tail -n 1 | cut -f 1 -d " "` # copy all wal-g copy --from=${TMP_CONFIG} --to=${TO_TMP_CONFIG} copied_backup_name=`wal-g --config=${TO_TMP_CONFIG} backup-list | tail -n 1 | cut -f 1 -d " "` if [ $backup_name != $copied_backup_name ]; then echo "Copying all backups (when there are only 1 backup) failed" exit 2 fi # push a few more backups for i in 2 3 do pgbench -i -s 1 postgres & sleep 1 wal-g --config=${TMP_CONFIG} backup-push ${PGDATA} done wal-g --config=${TMP_CONFIG} backup-list # copy all again wal-g copy --from=${TMP_CONFIG} --to=${TO_TMP_CONFIG} # save backup names to temp files wal-g --config=${TMP_CONFIG} backup-list | cut -f 1 -d " " | sort > /tmp/actual_backup_list wal-g --config=${TO_TMP_CONFIG} backup-list | cut -f 1 -d " " | sort > /tmp/copied_backup_list # and count lines in diff lines_count=`diff /tmp/actual_backup_list /tmp/copied_backup_list | wc -l` if [ lines_count > 0 ]; then echo "Copying all backups failed" exit 2 fi /tmp/scripts/drop_pg.sh echo "Copy all backups test success!!!!!!"
{ "pile_set_name": "Github" }
{-# Language RankNTypes, ViewPatterns, PatternSynonyms, TypeOperators, ScopedTypeVariables, KindSignatures, PolyKinds, DataKinds, TypeFamilies, GADTs #-} module T14552 where import Data.Kind import Data.Proxy data family Sing a type a --> b = (a, b) -> Type type family F (f::a --> b) (x::a) :: b newtype Limit :: (k --> Type) -> Type where Limit :: (forall xx. Proxy xx -> F f xx) -> Limit f data Exp :: [Type] -> Type -> Type where TLam :: (forall aa. Proxy aa -> Exp xs (F w aa)) -> Exp xs (Limit w) pattern FOO f <- TLam (($ Proxy) -> f) {- TLam :: forall (xs::[Type]) (b::Type). -- Universal forall k (w :: k --> Type). -- Existential (b ~ Limit w) => => (forall (aa :: k). Proxy aa -> Exp xs (F w aa)) -> Exp xs b -} {- mfoo :: Exp xs b -> (forall k (w :: k --> Type). (b ~ Limit w) => Exp xs (F w aa) -> r) -> r mfoo scrut k = case srcut of TLam g -> k (g Proxy) -}
{ "pile_set_name": "Github" }
' [NVDI.BAS] ' This source document is apart of the ENhanCed Hisoft ApplicatioN toolkiT (ENCHANT) ' Developed by Matthew Bacon & Paul Jones, ½ 1997-1999 Matthew Bacon & Paul Jones DIM SHARED NVDIInstalled=-1 FUNCTION cookie_NVDI STATIC dummy,NVDI& dummy=GETCOOKIE ("NVDI",NVDI&) IF dummy<>0 THEN cookie_NVDI=-1 ELSE cookie_NVDI=0 END IF END FUNCTION ' Drivers & Management SUB v_opnwk (work_in(),handle,work_out()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,1 POKEW CONTRL+2,0 POKEW CONTRL+6,11 POKEW CONTRL+12,0 FOR dummy=0 TO 10 POKEW INTIN+(dummy*2),work_in(dummy) NEXT dummy VDISYS(0) handle=PEEKW(CONTRL+12) FOR dummy=0 TO 56 work_out(dummy)=PEEKW(INTOUT+(dummy*2)) NEXT dummy FOR dummy=0 TO 11 work_out(dummy+45)=PEEKW(PTSOUT+(dummy*2)) NEXT dummy END IF END SUB SUB v_clswk (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,2 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_opnvwk (work_in(),handle,work_out()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,100 POKEW CONTRL+2,0 POKEW CONTRL+6,11 POKEW CONTRL+12,handle FOR dummy=0 TO 10 POKEW INTIN+(dummy*2),work_in(dummy) NEXT dummy VDISYS(0) handle=PEEKW(CONTRL+12) FOR dummy=0 TO 56 work_out(dummy)=PEEKW(INTOUT+(dummy*2)) NEXT dummy FOR dummy=0 TO 11 work_out(dummy+45)=PEEKW(PTSOUT+(dummy*2)) NEXT dummy END IF END SUB SUB v_clsvwk (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,101 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_clrwk (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,3 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_clear_disp_list (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,22 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_updwk (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,4 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_opnbm (work_in(),bitmap&(),handle,work_out()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,100 POKEW CONTRL+2,0 POKEW CONTRL+6,20 POKEW CONTRL+10,1 POKEW CONTRL+12,handle POKEL CONTRL+14,VARPTR(bitmap&(0)) FOR dummy=0 TO 19 POKEW INTIN+(dummy*2),work_in(dummy) NEXT dummy VDISYS(0) handle=PEEKW(CONTRL+12) FOR dummy=0 TO 56 work_out(dummy)=PEEKW(INTOUT+(dummy*2)) NEXT dummy FOR dummy=0 TO 11 work_out(dummy+45)=PEEKW(PTSOUT+(dummy*2)) NEXT dummy END IF END SUB SUB v_clsbm (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,101 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,1 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB vq_extnd (BYVAL handle,BYVAL flag,work_out()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,102 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,flag VDISYS(0) FOR dummy=0 TO 48 work_out(dummy)=PEEKW(INTOUT+(dummy*2)) NEXT dummy FOR dummy=0 TO 11 work_out(dummy+45)=PEEKW(PTSOUT+(dummy*2)) NEXT dummy END IF END SUB SUB vq_scrninfo (BYVAL handle,work_out()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,102 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+10,1 POKEW CONTRL+12,handle POKEW INTIN,2 VDISYS(0) FOR dummy=0 TO 271 work_out(dummy)=PEEKW(INTOUT+(dummy*2)) NEXT dummy END IF END SUB SUB vq_devinfo (BYVAL handle,BYVAL device,dev_open,file_name$,device_name$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,248 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,device VDISYS(0) dev_open=PEEKW(PTSOUT) device_name$="" FOR dummy=1 TO (PEEKW(CONTRL+4)*2)-2 device_name$=device_name$+MKI$(PEEKW(PTSOUT+dummy)) INCR dummy NEXT dummy file_name$="" FOR dummy=0 TO ((PEEKW(CONTRL+8))*2)-1 file_name$=file_name$+CHR$(PEEKW(INTOUT+dummy)) INCR dummy NEXT dummy END IF END SUB FUNCTION vq_ext_devinfo (BYVAL handle,BYVAL device,dev_exists,file_path$,file_name$,device_name$) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vq_ext_devinfo=-1 : EXIT FUNCTION ELSE file_path$=SPACE$(100) file_name$=SPACE$(100) device_name$=SPACE$(100) POKEW CONTRL,248 POKEW CONTRL+2,0 POKEW CONTRL+6,7 POKEW CONTRL+10,4242 POKEW CONTRL+12,handle POKEW INTIN,device POKEL INTIN+2,SADD(file_path$) POKEL INTIN+6,SADD(file_name$) POKEL INTIN+10,SADD(device_name$) VDISYS(0) dev_exists=PEEKW(INTOUT) vq_ext_devinfo=PEEKW(INTOUT+2) file_path$=RTRIM$(file_path$) file_name$=RTRIM$(file_name$) device_name$=RTRIM$(device_name$) END IF END FUNCTION ' Colour Settings SUB vs_color (BYVAL handle,BYVAL index,rgb()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,14 POKEW CONTRL+2,0 POKEW CONTRL+6,4 POKEW CONTRL+12,handle POKEW INTIN,index POKEW INTIN+2,rgb(0) POKEW INTIN+4,rgb(1) POKEW INTIN+6,rgb(2) VDISYS(0) END IF END SUB FUNCTION vq_color (BYVAL handle,BYVAL color_index,BYVAL set_flag,rgb()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vq_color=-1 : EXIT FUNCTION ELSE POKEW CONTRL,26 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEW INTIN,color_index POKEW INTIN+2,set_flag VDISYS(0) vq_color=PEEKW(INTOUT) rgb(0)=PEEKW(INTOUT+2) rgb(1)=PEEKW(INTOUT+4) rgb(2)=PEEKW(INTOUT+6) END IF END FUNCTION FUNCTION vs_calibrate (BYVAL handle,BYVAL flag,table()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vs_calibrate=-1 : EXIT FUNCTION ELSE REDIM PRESERVE table(1001) POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,3 POKEW CONTRL+10,76 POKEW CONTRL+12,handle POKEW INTIN,VARPTR(table(0)) POKEW INTIN+4,flag VDISYS(0) vs_calibrate=PEEKW(INTOUT) END IF END FUNCTION FUNCTION vq_calibrate (BYVAL handle,flag) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vq_calibrate=-1 : EXIT FUNCTION ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,77 POKEW CONTRL+12,handle VDISYS(0) vq_calibrate=PEEKW(CONTRL+8) flag=PEEKW(INTOUT) END IF END FUNCTION ' Writing Modes & Clipping FUNCTION vswr_mode (BYVAL handle,BYVAL mode) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vswr_mode=-1 : EXIT FUNCTION ELSE POKEW CONTRL,32 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,mode VDISYS(0) vswr_mode=PEEKW(INTOUT) END IF END FUNCTION SUB vs_clip (BYVAL handle,BYVAL clip_flag,xyarr()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,129 POKEW CONTRL+2,2 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,clip_flag POKEW PTSIN,xyarr(0) POKEW PTSIN+2,xyarr(1) POKEW PTSIN+4,xyarr(2) POKEW PTSIN+6,xyarr(3) VDISYS(0) END IF END SUB ' Lines & unfilled Graphic Primitives SUB v_pline (BYVAL handle,BYVAL count,xyarr()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,6 POKEW CONTRL+2,count POKEW CONTRL+6,0 POKEW CONTRL+12,handle FOR dummy=0 TO (count-1) POKEW PTSIN+(dummy*2),xyarr(dummy) NEXT dummy VDISYS(0) END IF END SUB SUB v_bez (BYVAL handle,BYVAL count,xyarr(),bezarr(),extent(),totpts,totmoves) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,6 POKEW CONTRL+2,count POKEW CONTRL+6,(count+1)/2 POKEW CONTRL+10,13 POKEW CONTRL+12,handle FOR dummy=0 TO (count-1) POKEW PTSIN+(dummy*2),xyarr(dummy) NEXT dummy FOR dummy=0 TO ((count+1)/2)-1 POKEW INTIN+(dummy*2),bezarr(dummy) NEXT dummy VDISYS(0) totpts=PEEKW(INTOUT) totmoves=PEEKW(INTOUT+2) extent(0)=PEEKW(PTSOUT) extent(1)=PEEKW(PTSOUT+2) extent(2)=PEEKW(PTSOUT+4) extent(3)=PEEKW(PTSOUT+6) END IF END SUB SUB v_arc (BYVAL handle,BYVAL x,BYVAL y,BYVAL radius,BYVAL begang,BYVAL endang) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,11 POKEW CONTRL+2,4 POKEW CONTRL+6,2 POKEW CONTRL+10,2 POKEW CONTRL+12,handle POKEW INTIN,begang POKEW INTIN+2,endang POKEW PTSIN,x POKEW PTSIN+2,y POKEW PTSIN+12,radius VDISYS(0) END IF END SUB SUB v_ellarc (BYVAL handle,BYVAL x,BYVAL y,BYVAL x_radius,BYVAL y_radius,BYVAL begang,BYVAL endang) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,11 POKEW CONTRL+2,2 POKEW CONTRL+6,2 POKEW CONTRL+10,6 POKEW CONTRL+12,handle POKEW INTIN,begang POKEW INTIN+2,endang POKEW PTSIN,x POKEW PTSIN+2,y POKEW PTSIN+4,x_radius POKEW PTSIN+6,y_radius VDISYS(0) END IF END SUB SUB v_rbox (BYVAL handle,rect()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,11 POKEW CONTRL+2,2 POKEW CONTRL+6,0 POKEW CONTRL+10,8 POKEW CONTRL+12,handle POKEW PTSIN,rect(0) POKEW PTSIN+2,rect(1) POKEW PTSIN+4,rect(2) POKEW PTSIN+6,rect(3) VDISYS(0) END IF END SUB FUNCTION v_bez_on (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") v_bez_on=-1 : EXIT FUNCTION ELSE POKEW CONTRL,11 POKEW CONTRL+2,1 POKEW CONTRL+6,0 POKEW CONTRL+10,13 POKEW CONTRL+12,handle VDISYS(0) v_bez_on=PEEKW(INTOUT) END IF END FUNCTION SUB v_bez_off (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,11 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,13 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_bez_qual (BYVAL handle,BYVAL qual,set_qual) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,3 POKEW CONTRL+10,99 POKEW CONTRL+12,handle POKEW INTIN,32 POKEW INTIN+2,1 POKEW INTIN+4,qual VDISYS(0) set_qual=PEEKW(INTOUT) END IF END SUB FUNCTION vsl_type (BYVAL handle,BYVAL type) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsl_type=-1 : EXIT FUNCTION ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,3 POKEW CONTRL+10,99 POKEW CONTRL+12,handle POKEW INTIN,32 POKEW INTIN+2,1 POKEW INTIN+4,type VDISYS(0) vsl_type=PEEKW(INTOUT) END IF END FUNCTION FUNCTION vsl_width (BYVAL handle,BYVAL l_width) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsl_width=-1 : EXIT FUNCTION ELSE POKEW CONTRL,16 POKEW CONTRL+2,1 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEW PTSIN,l_width VDISYS(0) vsl_width=PEEKW(PTSOUT) END IF END FUNCTION FUNCTION vsl_color (BYVAL handle,BYVAL color_index) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsl_color=-1 : EXIT FUNCTION ELSE POKEW CONTRL,17 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,color_index VDISYS(0) vsl_color=PEEKW(INTOUT) END IF END FUNCTION SUB vql_attributes (BYVAL handle,attrib()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,35 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) attrib(0)=PEEKW(INTOUT) ' Line type attrib(1)=PEEKW(INTOUT+2) ' Line colour attrib(2)=PEEKW(INTOUT+4) ' Writing mode attrib(3)=PEEKW(PTSOUT) ' Line width attrib(4)=PEEKW(INTOUT+6) ' End style of first point attrib(5)=PEEKW(INTOUT+8) ' End style of last point END IF END SUB SUB vsl_ends (BYVAL handle,BYVAL beg_style,BYVAL end_style) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,108 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEW INTIN,beg_style POKEW INTIN+2,end_style VDISYS(0) END IF END SUB SUB vsl_udsty (BYVAL handle,BYVAL pattern) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,113 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,pattern VDISYS(0) END IF END SUB SUB v_fillarea (BYVAL handle,BYVAL count,xyarr()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,9 POKEW CONTRL+2,count POKEW CONTRL+6,0 POKEW CONTRL+12,handle FOR dummy=0 TO (2*count)-1 POKEW PTSIN+(dummy*2),xyarr(dummy) NEXT dummy VDISYS(0) END IF END SUB SUB v_bez_fill (BYVAL handle,BYVAL count,xyarr(),bezarr(),extent(),totpts,totmoves) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,9 POKEW CONTRL+2,count POKEW CONTRL+6,(count+1)/2 POKEW CONTRL+10,13 POKEW CONTRL+12,handle FOR dummy=0 TO (2*count)-1 POKEW PTSIN+(dummy*2),xyarr(dummy) NEXT dummy FOR dummy=0 TO (count+1/2)-1 POKEW INTIN+(dummy*2),bezarr(dummy) NEXT dummy VDISYS(0) totpts=PEEKW(INTOUT) totmoves=PEEKW(INTOUT+2) extent(0)=PEEKW(PTSOUT) extent(1)=PEEKW(PTSOUT+2) extent(2)=PEEKW(PTSOUT+4) extent(3)=PEEKW(PTSOUT+6) END IF END SUB SUB v_bar (BYVAL handle,rect()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,11 POKEW CONTRL+2,2 POKEW CONTRL+6,0 POKEW CONTRL+10,1 POKEW CONTRL+12,handle POKEW PTSIN,rect(0) POKEW PTSIN+2,rect(1) POKEW PTSIN+4,rect(2) POKEW PTSIN+6,rect(3) VDISYS(0) END IF END SUB SUB v_pieslice (BYVAL handle,BYVAL x,BYVAL y,BYVAL radius,BYVAL begang,BYVAL endang) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,11 POKEW CONTRL+2,4 POKEW CONTRL+6,2 POKEW CONTRL+10,3 POKEW CONTRL+12,handle POKEW INTIN,begang POKEW INTIN+2,endang POKEW PTSIN,x POKEW PTSIN+2,y POKEW PTSIN+12,radius VDISYS(0) END IF END SUB SUB v_circle (BYVAL handle,BYVAL x,BYVAL y,BYVAL radius) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,11 POKEW CONTRL+2,3 POKEW CONTRL+6,0 POKEW CONTRL+10,4 POKEW CONTRL+12,handle POKEW PTSIN,x POKEW PTSIN+2,y POKEW PTSIN+8,radius VDISYS(0) END IF END SUB SUB v_ellipse (BYVAL handle,BYVAL x,BYVAL y,BYVAL x_radius,BYVAL y_radius) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,11 POKEW CONTRL+2,2 POKEW CONTRL+6,0 POKEW CONTRL+10,5 POKEW CONTRL+12,handle POKEW PTSIN,x POKEW PTSIN+2,y POKEW PTSIN+4,x_radius POKEW PTSIN+6,y_radius VDISYS(0) END IF END SUB SUB v_ellpie (BYVAL handle,BYVAL x,BYVAL y,BYVAL x_radius,BYVAL y_radius,BYVAL begang,BYVAL endang) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,11 POKEW CONTRL+2,2 POKEW CONTRL+6,0 POKEW CONTRL+10,5 POKEW CONTRL+12,handle POKEW INTIN,begang POKEW INTIN+2,endang POKEW PTSIN,x POKEW PTSIN+2,y POKEW PTSIN+4,x_radius POKEW PTSIN+6,y_radius VDISYS(0) END IF END SUB SUB v_rfbox (BYVAL handle,rect()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,11 POKEW CONTRL+2,2 POKEW CONTRL+6,0 POKEW CONTRL+10,9 POKEW CONTRL+12,handle POKEW PTSIN,rect(0) POKEW PTSIN+2,rect(1) POKEW PTSIN+4,rect(2) POKEW PTSIN+6,rect(3) VDISYS(0) END IF END SUB FUNCTION vsf_interior (BYVAL handle,BYVAL interior) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsf_interior=-1 : EXIT FUNCTION ELSE POKEW CONTRL,23 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,interior VDISYS(0) vsf_interior=PEEKW(INTOUT) END IF END FUNCTION FUNCTION vsf_style (BYVAL handle,BYVAL style_index) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsf_style=-1 : EXIT FUNCTION ELSE POKEW CONTRL,24 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,style_index VDISYS(0) vsf_style=PEEKW(INTOUT) END IF END FUNCTION FUNCTION vsf_color (BYVAL handle,BYVAL color_index) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsf_color=-1 : EXIT FUNCTION ELSE POKEW CONTRL,25 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,color_index VDISYS(0) vsf_color=PEEKW(INTOUT) END IF END FUNCTION SUB vqf_attributes (BYVAL handle,attrib()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,37 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) attrib(0)=PEEKW(INTOUT) ' Fill type attrib(1)=PEEKW(INTOUT+2) ' Fill colour attrib(2)=PEEKW(INTOUT+4) ' Fill style index attrib(3)=PEEKW(INTOUT+6) ' Writing mode attrib(4)=PEEKW(INTOUT+8) ' Perimeter flag END IF END SUB SUB v_contourfill (BYVAL handle,BYVAL x,BYVAL y,BYVAL color_index) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,103 POKEW CONTRL+2,1 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,color_index POKEW PTSIN,x POKEW PTSIN+2,y VDISYS(0) END IF END SUB FUNCTION vsf_perimeter (BYVAL handle,BYVAL flag) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsf_perimeter=-1 : EXIT FUNCTION ELSE POKEW CONTRL,104 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,flag VDISYS(0) vsf_perimeter=PEEKW(INTOUT) END IF END FUNCTION SUB vsf_udpat (BYVAL handle,pattern(),BYVAL planes) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,112 POKEW CONTRL+2,0 POKEW CONTRL+6,(planes*16) POKEW CONTRL+12,handle FOR dummy=0 TO (planes*16)-1 POKEW INTIN+(dummy*2),pattern(dummy) NEXT dummy VDISYS(0) END IF END SUB SUB vr_recfl (BYVAL handle,rect()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,114 POKEW CONTRL+2,2 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEW PTSIN,rect(0) POKEW PTSIN+2,rect(1) POKEW PTSIN+4,rect(2) POKEW PTSIN+6,rect(3) VDISYS(0) END IF END SUB ' Marker SUB v_pmarker (BYVAL handle,BYVAL count,xyarr()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,7 POKEW CONTRL+2,count POKEW CONTRL+6,0 POKEW CONTRL+12,handle FOR dummy=0 TO (count-1) POKEW PTSIN+(dummy*2),xyarr(dummy) NEXT dummy VDISYS(0) END IF END SUB FUNCTION vsm_type (BYVAL handle,BYVAL type) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsm_type=-1 : EXIT FUNCTION ELSE POKEW CONTRL,18 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,type VDISYS(0) vsm_type=PEEKW(INTOUT) END IF END FUNCTION FUNCTION vsm_height (BYVAL handle,BYVAL height) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsm_height=-1 : EXIT FUNCTION ELSE POKEW CONTRL,19 POKEW CONTRL+2,1 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEW PTSIN,height VDISYS(0) vsm_height=PEEKW(INTOUT) END IF END FUNCTION FUNCTION vsm_color (BYVAL handle,BYVAL color_index) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsm_color=-1 : EXIT FUNCTION ELSE POKEW CONTRL,20 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,color_index VDISYS(0) vsm_color=PEEKW(INTOUT) END IF END FUNCTION SUB vqm_attributes (BYVAL handle,attrib()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,36 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) attrib(0)=PEEKW(INTOUT) ' Marker type attrib(1)=PEEKW(INTOUT+2) ' Marker colour attrib(2)=PEEKW(INTOUT+4) ' Writing mode attrib(3)=PEEKW(PTSOUT+2) ' Marker height attrib(4)=PEEKW(PTSOUT) ' Marker width END IF END SUB ' Text Output with Bitmap Vectors SUB v_gtext (BYVAL handle,BYVAL x,BYVAL y,BYVAL text$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,8 POKEW CONTRL+2,1 POKEW CONTRL+6,LEN(text$) POKEW CONTRL+12,handle FOR dummy=0 TO LEN(text$)-1 POKEW INTIN+(dummy*2),ASC(MID$(text$,dummy+1,1)) NEXT dummy POKEW PTSIN,x POKEW PTSIN+2,y VDISYS(0) END IF END SUB SUB v_justified (BYVAL handle,BYVAL x,BYVAL y,BYVAL text$,BYVAL length,BYVAL word_space,BYVAL char_space) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE IF word_space=0 THEN word_space=1 IF char_space=0 THEN char_space=1 POKEW CONTRL,11 POKEW CONTRL+2,2 POKEW CONTRL+6,LEN(text$)+2 POKEW CONTRL+10,10 POKEW CONTRL+12,handle POKEW INTIN,word_space POKEW INTIN+2,char_space FOR dummy=2 TO LEN(text$) POKEW INTIN+(dummy*2),ASC(MID$(text$,dummy-1,1)) NEXT dummy POKEW PTSIN,x POKEW PTSIN+2,y POKEW PTSIN+4,length VDISYS(0) END IF END SUB SUB vst_height (BYVAL handle,BYVAL height,char_width,char_height,cell_width,cell_height) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,12 POKEW CONTRL+2,1 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEW PTSIN,height VDISYS(0) char_width=PEEKW(PTSOUT) char_height=PEEKW(PTSOUT+2) cell_width=PEEKW(PTSOUT+4) cell_height=PEEKW(PTSOUT+6) END IF END SUB FUNCTION vst_rotation (BYVAL handle,BYVAL angle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_rotation=-1 : EXIT FUNCTION ELSE POKEW CONTRL,13 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,angle VDISYS(0) vst_rotation=PEEKW(INTOUT) END IF END FUNCTION FUNCTION vst_font (BYVAL handle,BYVAL font) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_font=-1 : EXIT FUNCTION ELSE POKEW CONTRL,21 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,font VDISYS(0) vst_font=PEEKW(INTOUT) END IF END FUNCTION FUNCTION vst_color (BYVAL handle,BYVAL color_index) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_color=-1 : EXIT FUNCTION ELSE POKEW CONTRL,22 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,color_index VDISYS(0) vst_color=PEEKW(INTOUT) END IF END FUNCTION SUB vqt_attributes (BYVAL handle,attrib()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,38 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) attrib(0)=PEEKW(INTOUT) ' Font id attrib(1)=PEEKW(INTOUT+2) ' Text colour index attrib(2)=PEEKW(INTOUT+4) ' Text rotation in 1/10 degrees attrib(3)=PEEKW(INTOUT+6) ' Horizontal alignment attrib(4)=PEEKW(INTOUT+8) ' Vertical alignment attrib(5)=PEEKW(INTOUT+10) ' Writing mode attrib(6)=PEEKW(PTSOUT) ' Character width attrib(7)=PEEKW(PTSOUT+2) ' Character height attrib(8)=PEEKW(PTSOUT+4) ' Character cell width attrib(9)=PEEKW(PTSOUT+6) ' Character cell height END IF END SUB SUB vst_alignment (BYVAL handle,BYVAL hor_in,BYVAL vert_in,hor_out,vert_out) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,39 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEW INTIN,hor_in POKEW INTIN+2,vert_in VDISYS(0) hor_out=PEEKW(INTOUT) vert_out=PEEKW(INTOUT+2) END IF END SUB FUNCTION vst_effects (BYVAL handle,BYVAL effect) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_effects=-1 : EXIT FUNCTION ELSE POKEW CONTRL,106 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,effect VDISYS(0) vst_effects=PEEKW(INTOUT) END IF END FUNCTION FUNCTION vst_point (BYVAL handle,BYVAL point_size,char_width,char_height,cell_width,cell_height) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_point=-1 : EXIT FUNCTION ELSE POKEW CONTRL,107 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,point_size VDISYS(0) vst_point=PEEKW(INTOUT) char_width=PEEKW(PTSOUT) char_height=PEEKW(PTSOUT+2) cell_width=PEEKW(PTSOUT+4) cell_height=PEEKW(PTSOUT+6) END IF END FUNCTION SUB vqt_extent (BYVAL handle,BYVAL text$,extent()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,116 POKEW CONTRL+2,0 POKEW CONTRL+6,LEN(text$) POKEW CONTRL+12,handle FOR dummy=0 TO LEN(text$)-1 POKEW INTIN+(dummy*2),ASC(MID$(text$,dummy+1,1)) NEXT dummy VDISYS(0) FOR dummy=0 TO 7 extent(dummy)=PEEKW(PTSOUT+(dummy*2)) NEXT dummy END IF END SUB FUNCTION vqt_width (BYVAL handle,BYVAL index,cell_width,left_delta,right_delta) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vqt_width=-1 : EXIT FUNCTION ELSE POKEW CONTRL,117 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,index VDISYS(0) vqt_width=PEEKW(INTOUT) cell_width=PEEKW(PTSOUT) left_delta=PEEKW(PTSOUT+2) right_delta=PEEKW(PTSOUT+4) END IF END FUNCTION FUNCTION vst_load_fonts (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_load_fonts=-1 : EXIT FUNCTION ELSE POKEW CONTRL,119 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,0 VDISYS(0) vst_load_fonts=PEEKW(INTOUT) END IF END FUNCTION SUB vst_unload_fonts (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,120 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,0 VDISYS(0) END IF END SUB FUNCTION vqt_name (BYVAL handle,BYVAL index,name$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vqt_name=-1 : EXIT FUNCTION ELSE POKEW CONTRL,130 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+10,1 POKEW CONTRL+12,handle POKEW INTIN,index POKEW INTIN+2,0 VDISYS(0) vqt_name=PEEKW(INTOUT) name$="" FOR dummy=1 TO 32 name$=name$+RIGHT$(MKI$(PEEKW(INTOUT+(dummy*2))),1) NEXT dummy name$=RTRIM$(name$) END IF END FUNCTION FUNCTION vqt_ext_name (BYVAL handle,BYVAL index,name$,font_format,flags) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vqt_ext_name=-1 : EXIT FUNCTION ELSE POKEW CONTRL,130 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+10,1 POKEW CONTRL+12,handle POKEW INTIN,index POKEW INTIN+2,0 VDISYS(0) vqt_ext_name=PEEKW(INTOUT) name$="" FOR dummy=1 TO 32 name$=name$+RIGHT$(MKI$(PEEKW(INTOUT+(dummy*2))),1) NEXT dummy name$=RTRIM$(name$) font_format=PEEKW(INTOUT+68) flags=PEEKB(INTOUT+68) END IF END FUNCTION SUB vqt_fontinfo (BYVAL handle,minADE,maxADE,distances(),max_width,effects()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,131 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) minADE=PEEKW(INTOUT) maxADE=PEEKW(INTOUT+2) max_width=PEEKW(PTSOUT) distances(0)=PEEKW(PTSOUT+2) effects(0)=PEEKW(PTSOUT+4) distances(1)=PEEKW(PTSOUT+6) effects(1)=PEEKW(PTSOUT+8) distances(2)=PEEKW(PTSOUT+10) effects(2)=PEEKW(PTSOUT+12) distances(3)=PEEKW(PTSOUT+14) distances(4)=PEEKW(PTSOUT+18) END IF END SUB FUNCTION vqt_xfntinfo (BYVAL handle,BYVAL flags,BYVAL id,index,info&) STATIC font_format IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vqt_xfntinfo=-1 : EXIT FUNCTION ELSE IF flags>32 THEN flags=32 POKEW CONTRL,229 POKEW CONTRL+2,0 POKEW CONTRL+6,5 POKEW CONTRL+10,0 POKEW CONTRL+12,handle POKEW INTIN,flags POKEW INTIN+2,id POKEW INTIN+4,index POKEL INTIN+6,info& VDISYS(0) font_format=PEEKW(INTOUT) vqt_xfntinfo=PEEKW(INTOUT+2) index=PEEKW(INTOUT+4) END IF END FUNCTION FUNCTION vst_name (BYVAL handle,BYVAL font_format,BYVAL font_name$,ret_name$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_name=-1 : EXIT FUNCTION ELSE POKEW CONTRL,230 POKEW CONTRL+2,0 POKEW CONTRL+6,LEN(font_name$)+1 POKEW CONTRL+10,0 POKEW CONTRL+12,handle POKEW INTIN,font_format FOR dummy=1 TO LEN(font_name$) POKEW INTIN+(dummy*2),ASC(MID$(font_name$,dummy,1)) NEXT dummy VDISYS(0) vst_name=PEEKW(INTOUT) ret_name$="" FOR dummy=1 TO PEEKW(CONTRL+8) ret_name$=ret_name$+RIGHT$(MKI$(PEEKW(INTOUT+(dummy*2))),1) NEXT dummy ret_name$=RTRIM$(ret_name$) END IF END FUNCTION FUNCTION vqt_char_index (BYVAL handle,BYVAL src_index,BYVAL src_mode,BYVAL dst_mode) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vqt_char_index=-1 : EXIT FUNCTION ELSE POKEW CONTRL,190 POKEW CONTRL+2,0 POKEW CONTRL+6,3 POKEW CONTRL+10,0 POKEW CONTRL+12,handle POKEW INTIN,src_index POKEW INTIN+2,src_mode POKEW INTIN+4,dst_mode VDISYS(0) vqt_char_index=PEEKW(INTOUT) END IF END FUNCTION FUNCTION vqt_name_and_id (BYVAL handle,BYVAL font_format,BYVAL font_name$,ret_name$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vqt_name_and_id=-1 : EXIT FUNCTION ELSE POKEW CONTRL,230 POKEW CONTRL+2,0 POKEW CONTRL+6,LEN(font_name$) POKEW CONTRL+10,100 POKEW CONTRL+12,handle POKEW INTIN,font_format FOR dummy=1 TO LEN(font_name$) POKEW INTIN+(dummy*2),ASC(MID$(font_name$,dummy,1)) NEXT dummy VDISYS(0) vqt_name_and_id=PEEKW(INTOUT) IF PEEKW(INTOUT)<>0 THEN ret_name$="" FOR dummy=1 TO PEEKW(CONTRL+8) ret_name$=ret_name$+RIGHT$(MKI$(PEEKW(INTOUT+(dummy*2))),1) NEXT dummy ret_name$=RTRIM$(ret_name$) ELSE ret_name$="" END IF END IF END FUNCTION SUB vst_width (BYVAL handle,BYVAL total_width,char_width,char_height,cell_width,cell_height) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,231 POKEW CONTRL+2,1 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEW PTSIN,total_width VDISYS(0) char_width=PEEKW(PTSOUT) char_height=PEEKW(PTSOUT+2) cell_width=PEEKW(PTSOUT+4) cell_height=PEEKW(PTSOUT+6) END IF END SUB SUB vqt_fontheader (BYVAL handle,buffer&,tdf_name$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,232 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEL PTSIN,buffer& VDISYS(0) tdf_name$="" FOR dummy=1 TO PEEKW(CONTRL+8) tdf_name$=tdf_name$+MKI$(PEEKW(INTOUT+(dummy*2))) NEXT dummy tdf_name$=RTRIM$(tdf_name$) END IF END SUB SUB vqt_trackkern (BYVAL handle,x_offset&,y_offset&) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,234 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) x_offset&=PEEKL(INTOUT) y_offset&=PEEKL(INTOUT+4) END IF END SUB SUB vqt_pairkern (BYVAL handle,BYVAL index1,BYVAL index2,x_offset&,y_offset&) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,235 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEW INTIN,index1 POKEW INTIN+2,index2 VDISYS(0) x_offset&=PEEKL(INTOUT) y_offset&=PEEKL(INTOUT+4) END IF END SUB SUB vst_charmap (BYVAL handle,BYVAL mode) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,236 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,mode VDISYS(0) END IF END SUB FUNCTION vst_map_mode (BYVAL handle,BYVAL mode) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_map_mode=-1 : EXIT FUNCTION ELSE POKEW CONTRL,236 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEW INTIN,mode POKEW INTIN+2,1 VDISYS(0) vst_map_mode=PEEKW(INTOUT) END IF END FUNCTION SUB vst_kern (BYVAL handle,BYVAL track_mode,BYVAL pair_mode,track,pairs) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,237 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEW INTIN,track_mode POKEW INTIN+2,pair_mode VDISYS(0) track=PEEKW(INTOUT) pairs=PEEKW(INTOUT+2) END IF END SUB SUB vst_track_offset (BYVAL handle,BYVAL offset&,BYVAL pair_mode,track,pairs) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,237 POKEW CONTRL+2,0 POKEW CONTRL+6,4 POKEW CONTRL+12,handle POKEW INTIN,255 POKEW INTIN+2,pair_mode POKEL INTIN+4,offset& VDISYS(0) track=PEEKW(INTOUT) pairs=PEEKW(INTOUT+2) END IF END SUB SUB v_getbitmap_info (BYVAL handle,BYVAL index,x_advance&,y_advance&,x_offset&,y_offset&,bit_width,bit_height,bitmap&) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,239 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,index VDISYS(0) bit_width=PEEKW(INTOUT) bit_height=PEEKW(INTOUT+2) x_advance&=PEEKL(INTOUT+4) y_advance&=PEEKL(INTOUT+8) x_offset&=PEEKL(INTOUT+12) y_offset&=PEEKL(INTOUT+16) bitmap&=PEEKL(INTOUT+20) END IF END SUB SUB vqt_f_extent (BYVAL handle,BYVAL text$,extent()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,240 POKEW CONTRL+2,0 POKEW CONTRL+6,LEN(text$) POKEW CONTRL+12,handle FOR dummy=0 TO LEN(text$)-1 POKEW INTIN+(dummy*2),ASC(MID$(text$,dummy+1,1)) NEXT dummy VDISYS(0) FOR dummy=0 TO 7 extent(dummy)=PEEKW(PTSOUT+(dummy*2)) NEXT dummy END IF END SUB SUB vqt_real_extent (BYVAL handle,BYVAL x,BYVAL y,BYVAL text$,extent()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,240 POKEW CONTRL+2,1 POKEW CONTRL+6,LEN(text$) POKEW CONTRL+10,4200 POKEW CONTRL+12,handle FOR dummy=0 TO LEN(text$)-1 POKEW INTIN+(dummy*2),ASC(MID$(text$,dummy+1,1)) NEXT dummy POKEW PTSIN,x POKEW PTSIN+2,y VDISYS(0) FOR dummy=0 TO 7 extent(dummy)=PEEKW(PTSOUT+(dummy*2)) NEXT dummy END IF END SUB SUB v_ftext (BYVAL handle,BYVAL x,BYVAL y,BYVAL text$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,241 POKEW CONTRL+2,1 POKEW CONTRL+6,LEN(text$) POKEW CONTRL+12,handle FOR dummy=0 TO LEN(text$)-1 POKEW INTIN+(dummy*2),ASC(MID$(text$,dummy+1,1)) NEXT dummy POKEW PTSIN,x POKEW PTSIN+2,y VDISYS(0) END IF END SUB SUB v_getoutline (BYVAL handle,BYVAL index,xyarr(),bezarr(),BYVAL max_pts,count) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,243 POKEW CONTRL+2,0 POKEW CONTRL+6,6 POKEW CONTRL+12,handle POKEW INTIN,index POKEW INTIN+2,max_pts POKEL INTIN+4,VARPTR(xyarr(0)) POKEL INTIN+8,VARPTR(bezarr(0)) VDISYS(0) count=PEEKW(INTOUT) END IF END SUB FUNCTION vst_arbpt32 (BYVAL handle,BYVAL height&,char_width,char_height,cell_width,cell_height) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_arbpt32=-1 : EXIT FUNCTION ELSE POKEW CONTRL,246 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEL INTIN,height& VDISYS(0) vst_arbpt32=PEEKW(INTOUT) char_width=PEEKW(PTSOUT) char_height=PEEKW(PTSOUT+2) cell_width=PEEKW(PTSOUT+4) cell_height=PEEKW(PTSOUT+6) END IF END FUNCTION SUB vqt_advance32 (BYVAL handle,BYVAL index,x_advance&,y_advance&) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,247 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,index VDISYS(0) x_advance&=PEEKL(PTSOUT+8) y_advance&=PEEKL(PTSOUT+12) END IF END SUB FUNCTION vst_setsize32 (BYVAL handle,BYVAL total_width&,char_width,char_height,cell_width,cell_height) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_setsize32=-1 : EXIT FUNCTION ELSE POKEW CONTRL,252 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEL INTIN,total_width& VDISYS(0) vst_setsize32=PEEKW(INTOUT) char_width=PEEKW(PTSOUT) char_height=PEEKW(PTSOUT+2) cell_width=PEEKW(PTSOUT+4) cell_height=PEEKW(PTSOUT+6) END IF END FUNCTION FUNCTION vst_skew (BYVAL handle,BYVAL skew) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vst_skew=-1 : EXIT FUNCTION ELSE POKEW CONTRL,253 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,skew VDISYS(0) vst_skew=PEEKW(INTOUT) END IF END FUNCTION ' Raster Operations SUB vro_cpyfm (BYVAL handle,BYVAL wr_mode,xyarr(),src_MFDB&(),des_MFDB&()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,109 POKEW CONTRL+2,4 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEL CONTRL+14,VARPTR(src_MFDB&(0)) POKEL CONTRL+18,VARPTR(des_MFDB&(0)) POKEW INTIN,wr_mode FOR dummy=0 TO 7 POKEW PTSIN+(dummy*2),xyarr(dummy) NEXT dummy VDISYS(0) END IF END SUB SUB vrt_cpyfm (BYVAL handle,BYVAL wr_mode,xyarr(),src_MFDB&(),des_MFDB&(),color_index()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,109 POKEW CONTRL+2,4 POKEW CONTRL+6,3 POKEW CONTRL+12,handle POKEL CONTRL+14,VARPTR(src_MFDB&(0)) POKEL CONTRL+18,VARPTR(des_MFDB&(0)) POKEW INTIN,wr_mode POKEW INTIN+2,color_index(0) POKEW INTIN+4,color_index(1) FOR dummy=0 TO 7 POKEW PTSIN+(dummy*2),xyarr(dummy) NEXT dummy VDISYS(0) END IF END SUB SUB vr_trnfm (BYVAL handle,src_MFDB&(),des_MFDB&()) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,110 POKEW CONTRL+2,0 POKEW CONTRL+4,0 POKEW CONTRL+6,0 POKEW CONTRL+8,0 POKEW CONTRL+12,handle POKEL CONTRL+14,VARPTR(src_MFDB&(0)) POKEL CONTRL+18,VARPTR(des_MFDB&(0)) VDISYS(0) END IF END SUB SUB v_get_pixel (BYVAL handle,BYVAL x,BYVAL y,pel,index) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,105 POKEW CONTRL+2,1 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEW PTSIN,x POKEW PTSIN+2,y VDISYS(0) pel=PEEKW(INTOUT) index=PEEKW(INTOUT+2) END IF END SUB ' Input Functions SUB vsin_mode (BYVAL handle,BYVAL dev_type,mode) SHARED set_mode IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,33 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEW INTIN,dev_type POKEW INTIN+2,mode VDISYS(0) set_mode=PEEKW(INTOUT) END IF END SUB SUB vrq_locator (BYVAL handle,BYVAL x,BYVAL y,xout,yout,term) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,28 POKEW CONTRL+2,1 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEW PTSIN,x POKEW PTSIN+2,y VDISYS(0) term=PEEKW(INTOUT) xout=PEEKW(PTSOUT) yout=PEEKW(PTSOUT+2) END IF END SUB SUB vsm_locator (BYVAL handle,BYVAL x,BYVAL y,xout,yout,term) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,28 POKEW CONTRL+2,1 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEW PTSIN,x POKEW PTSIN+2,y VDISYS(0) term=PEEKW(INTOUT) xout=PEEKW(PTSOUT) yout=PEEKW(PTSOUT+2) END IF END SUB SUB vrq_choice (BYVAL handle,BYVAL ch_in,ch_out) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,30 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,ch_in VDISYS(0) ch_out=PEEKW(INTOUT) END IF END SUB FUNCTION vsm_choice (BYVAL handle,choice) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsm_choice=-1 : EXIT FUNCTION ELSE POKEW CONTRL,30 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) choice=PEEKW(INTOUT) END IF END FUNCTION SUB vrq_string (BYVAL handle,BYVAL max_length,BYVAL echo_mode,echo_xy(),text$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,31 POKEW CONTRL+2,1 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEW INTIN,max_length POKEW INTIN+2,echo_mode POKEW PTSIN,echo_xy(0) POKEW PTSIN+2,echo_xy(1) VDISYS(0) text$="" FOR dummy=0 TO PEEKW(CONTRL+8) text$=text$+CHR$(PEEKW(INTOUT+dummy)) INCR dummy NEXT dummy text$=RTRIM$(text$) END IF END SUB FUNCTION vsm_string (BYVAL handle,BYVAL max_length,BYVAL echo_mode,echo_xy(),text$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") vsm_string=-1 : EXIT FUNCTION ELSE POKEW CONTRL,31 POKEW CONTRL+2,1 POKEW CONTRL+6,2 POKEW CONTRL+12,handle POKEW INTIN,max_length POKEW INTIN+2,echo_mode POKEW PTSIN,echo_xy(0) POKEW PTSIN+2,echo_xy(1) VDISYS(0) IF PEEKW(CONTRL+8)>0 THEN text$="" FOR dummy=0 TO PEEKW(CONTRL+8) text$=text$+MKI$(PEEKW(INTOUT+dummy)) INCR dummy NEXT dummy text$=RTRIM$(text$) : vsm_string=LEN(text$) ELSE text$="" : vsm_string=0 END IF END IF END FUNCTION SUB vsc_form (BYVAL handle,cursor()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,111 POKEW CONTRL+2,0 POKEW CONTRL+6,37 POKEW CONTRL+12,handle FOR dummy=0 TO 36 POKEW INTIN+(dummy*2),cursor(dummy) NEXT dummy VDISYS(0) END IF END SUB SUB vsc_getform (BYVAL handle,cursor()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,111 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) FOR dummy=0 TO 36 cursor(dummy)=PEEKW(INTOUT+(dummy*2)) NEXT dummy END IF END SUB SUB vqin_mode (BYVAL handle,BYVAL dev_type,input_mode) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,115 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,dev_type VDISYS(0) input_mode=PEEKW(INTOUT+2) END IF END SUB SUB vex_timv (BYVAL handle,BYVAL tim_addr&,otim_addr&,tim_conv) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,118 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEL CONTRL+14,tim_addr& VDISYS(0) otim_addr&=PEEKL(CONTRL+18) tim_conv=PEEKW(INTOUT) END IF END SUB SUB v_show_c (BYVAL handle,BYVAL reset_cursor) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,122 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+12,handle POKEW INTIN,reset_cursor VDISYS(0) END IF END SUB SUB v_hide_c (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,123 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB vq_mouse (BYVAL handle,status,x,y) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,124 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) status=PEEKW(INTOUT) x=PEEKW(PTSOUT) y=PEEKW(PTSOUT+2) END IF END SUB SUB vex_butv (BYVAL handle,BYVAL pusrcode&,psavcode&) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,125 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEL CONTRL+14,pusrcode& VDISYS(0) psavcode&=PEEKL(CONTRL+18) END IF END SUB SUB vex_motv (BYVAL handle,BYVAL pusrcode&,psavcode&) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,126 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEL CONTRL+14,pusrcode& VDISYS(0) psavcode&=PEEKL(CONTRL+18) END IF END SUB SUB vex_curv (BYVAL handle,BYVAL pusrcode&,psavcode&) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,127 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle POKEL CONTRL+14,pusrcode& VDISYS(0) psavcode&=PEEKL(CONTRL+18) END IF END SUB SUB vq_key_s (BYVAL handle,status) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,128 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+12,handle VDISYS(0) status=PEEKW(INTOUT) END IF END SUB ' Text Mode and VT52 SUB vq_chcells (BYVAL handle,rows,columns) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,1 POKEW CONTRL+12,handle VDISYS(0) rows=PEEKW(INTOUT) columns=PEEKW(INTOUT+2) END IF END SUB SUB v_exit_cur (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,2 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_enter_cur (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,3 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_curup (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,4 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_curdown (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,5 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_curright (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,6 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_curleft (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,7 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_curhome (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,8 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_eeos (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,9 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_eeol (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,10 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_curaddress (BYVAL handle,BYVAL row,BYVAL column) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,11 POKEW CONTRL+12,handle POKEW INTIN,row POKEW INTIN+2,column VDISYS(0) END IF END SUB SUB v_curtext (BYVAL handle,BYVAL text$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,LEN(text$) POKEW CONTRL+10,12 POKEW CONTRL+12,handle FOR dummy=1 TO LEN(text$) POKEW INTIN+((dummy-1)*2),ASC(MID$(text$,dummy,1)) NEXT dummy VDISYS(0) END IF END SUB SUB v_rvon (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,13 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB v_rvoff (BYVAL handle) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,14 POKEW CONTRL+12,handle VDISYS(0) END IF END SUB SUB vq_curaddress (BYVAL handle,row,column) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,0 POKEW CONTRL+10,15 POKEW CONTRL+12,handle VDISYS(0) row=PEEKW(INTOUT) column=PEEKW(INTOUT+2) END IF END SUB ' Printer specific functions SUB v_bit_image (BYVAL handle,BYVAL file_name$,BYVAL aspect,BYVAL x_scale,BYVAL y_scale,BYVAL h_align,BYVAL v_align,xyarray()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,5+LEN(file_name$) POKEW CONTRL+10,23 POKEW CONTRL+12,handle POKEW INTIN,aspect POKEW INTIN+2,x_scale POKEW INTIN+4,y_scale POKEW INTIN+6,h_align POKEW INTIN+8,v_align FOR dummy=5 TO 5+LEN(file_name$) POKEW INTIN+(dummy*2),ASC(MID$(file_name$,dummy-4,1)) NEXT dummy POKEW PTSIN,xyarray(0) POKEW PTSIN+2,xyarray(1) POKEW PTSIN+4,xyarray(2) POKEW PTSIN+6,xyarray(3) VDISYS(0) END IF END SUB FUNCTION v_orient (BYVAL handle,BYVAL orient) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") v_orient=-1 : EXIT FUNCTION ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+10,27 POKEW CONTRL+12,handle POKEW INTIN,orient VDISYS(0) v_orient=PEEKW(INTOUT) END IF END FUNCTION FUNCTION v_copies (BYVAL handle,BYVAL copies) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") v_copies=-1 : EXIT FUNCTION ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+10,28 POKEW CONTRL+12,handle POKEW INTIN,copies VDISYS(0) v_copies=PEEKW(INTOUT) END IF END FUNCTION SUB v_trays (BYVAL handle,BYVAL p_intput,BYVAL p_output,set_input,set_output) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,2 POKEW CONTRL+10,29 POKEW CONTRL+12,handle POKEW INTIN,p_intput POKEW INTIN+2,p_output VDISYS(0) set_input=PEEKW(INTOUT) set_output=PEEKW(INTOUT+2) END IF END SUB SUB vq_tray_names (BYVAL handle,input_name$,output_name$,no_input,no_output) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,4 POKEW CONTRL+10,36 POKEW CONTRL+12,handle POKEL INTIN,SADD(input_name$) POKEL INTIN+4,SADD(output_name$) VDISYS(0) no_input=PEEKW(INTOUT) no_output=PEEKW(INTOUT+2) END IF END SUB FUNCTION v_page_size (BYVAL handle,BYVAL page_id) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") v_page_size=-1 : EXIT FUNCTION ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+10,37 POKEW CONTRL+12,handle POKEW INTIN,page_id VDISYS(0) v_page_size=PEEKW(INTOUT) END IF END FUNCTION FUNCTION v_page_name (BYVAL handle,BYVAL page_id,BYVAL page_name$,page_width&,page_height&) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") v_page_name=-1 : EXIT FUNCTION ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,3 POKEW CONTRL+10,38 POKEW CONTRL+12,handle POKEW INTIN,page_id POKEL INTIN+2,SADD(page_name$) VDISYS(0) v_page_name=PEEKW(INTOUT) page_width&=PEEKL(INTOUT+2) page_height&=PEEKL(INTOUT+6) END IF END FUNCTION SUB v_escape2000 (BYVAL handle,BYVAL times) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,1 POKEW CONTRL+10,2000 POKEW CONTRL+12,handle POKEW INTIN,times VDISYS(0) END IF END SUB ' Metafile specific functions SUB v_meta_extents (BYVAL handle,BYVAL x_min,BYVAL y_min,BYVAL x_max,BYVAL y_max) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,2 POKEW CONTRL+6,0 POKEW CONTRL+10,98 POKEW CONTRL+10,4200 POKEW PTSIN,x_min POKEW PTSIN+2,y_min POKEW PTSIN+4,x_max POKEW PTSIN+6,y_max VDISYS(0) END IF END SUB SUB v_write_meta (BYVAL handle,BYVAL num_intin,a_intin(),BYVAL num_ptsin,a_ptsin()) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,num_ptsin POKEW CONTRL+6,num_intin POKEW CONTRL+10,99 POKEW CONTRL+10,4200 POKEW INTIN,a_intin(0) FOR dummy=1 TO num_intin-1 POKEW INTIN+(dummy*2),a_intin(dummy-1) NEXT dummy FOR dummy=1 TO num_ptsin-1 POKEW PTSIN+(dummy*2),a_ptsin(dummy-1) NEXT dummy VDISYS(0) END IF END SUB SUB vm_pagesize (BYVAL handle,BYVAL pgwidth,BYVAL pgheight) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,3 POKEW CONTRL+10,99 POKEW CONTRL+12,handle POKEW INTIN,0 POKEW INTIN+2,pgwidth POKEW INTIN+4,pgheight VDISYS(0) END IF END SUB SUB vm_coords (BYVAL handle,BYVAL llx,BYVAL lly,BYVAL urx,BYVAL ury) IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,5 POKEW CONTRL+10,99 POKEW CONTRL+12,handle POKEW INTIN,1 POKEW INTIN+2,llx POKEW INTIN+4,lly POKEW INTIN+6,urx POKEW INTIN+8,ury VDISYS(0) END IF END SUB SUB vm_filename (BYVAL handle,BYVAL filename$) STATIC dummy IF handle=0 THEN handle=1 IF cookie_NVDI=0 THEN junk=form_alert (1,"[1][ "+MyProgram$+": | NVDI is not present! ][ OK ]") EXIT SUB ELSE POKEW CONTRL,5 POKEW CONTRL+2,0 POKEW CONTRL+6,LEN(filename$) POKEW CONTRL+10,100 POKEW CONTRL+12,handle FOR dummy=0 TO LEN(filename$)-1 POKEW INTIN+(dummy*2),ASC(MID$(filename$,dummy+1,1)) NEXT dummy VDISYS(0) END IF END SUB '[*END OF FILE*]
{ "pile_set_name": "Github" }
# MBE02_BLOCK_PARTIAL This example is a simple block made of two parts that don't occupy the whole 1x1x1m space: 1. a "rectangular base" with the lapis lazuli texture 1. a "pole" with a stone texture It will show you: 1. how to create a Block class for a block that isn't 1x1x1m, and register it 1. how to define and register the model for rendering the block when it has more than one part in the model 1. how to define the block's shapes (VoxelShapes) appropriately 1. how to define and register the item corresponding to the block (i.e. when the block is shown in the inventory, or in your hand) 1. how to make your block drop an item when you harvest it The pieces you need to understand are located in: * `StartupClientOnly` class and `StartupCommon` class * `BlockPartial` class * `resources\assets\minecraftbyexample\lang\en_US.lang` -- for the displayed name of the block * `resources\assets\minecraftbyexample\blockstates\mbe02_block_partial_registry_name` -- for the blockstate definition * `resources\assets\minecraftbyexample\models\block\mbe02_block_partial_model` -- for the model used to render the block * `resources\assets\minecraftbyexample\models\item\mbe02_block_partial_registry_name` -- the model for rendering the block as an item (i.e. in your hand, in the inventory, when thrown on the ground) * `resources\data\minecraftbyexample\loot_tables\blocks\mbe02_block_partial_registry_name` -- the loot table which makes the block drop an item when harvested The block will appear in the Blocks tab in the creative inventory. For background information on: * blocks: see [http://greyminecraftcoder.blogspot.com/2020/02/blocks-1144.html](http://greyminecraftcoder.blogspot.com/2020/02/blocks-1144.html) * rendering blocks: see [http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html](http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html) (the topics under the Block Rendering heading) * Block Shapes (VoxelShapes): see [https://greyminecraftcoder.blogspot.com/2020/02/block-shapes-voxelshapes-1144.html](https://greyminecraftcoder.blogspot.com/2020/02/block-shapes-voxelshapes-1144.html) * render types: see [http://greyminecraftcoder.blogspot.com/2014/12/block-rendering-18.html](http://greyminecraftcoder.blogspot.com/2014/12/block-rendering-18.html) - the method for specifying the render type is different, but the concepts of the different types (SOLID, CUTOUT etc are the same) * loot tables: see [https://minecraft.gamepedia.com/Loot_table](https://minecraft.gamepedia.com/Loot_table) - complicated! See vanilla examples for guidance. ## Common errors "Missing Model", "Missing texture", etc. These are caused when you have specified a filename or path which is not correct, typically: 1. you've misspelled it 1. the upper/lower case doesn't match 1. you've forgotten the resource domain, eg `blockmodel` instead of `minecraftbyexample:blockmodel` 1. the folder structure of your assets folders is incorrect The model has the wrong shape or is textured strangely: 1. your model file is wrong. Blocks or Items don't register (don't appear in the game at all): 1. You've registered your event handlers on the wrong bus (see MinecraftByExample class for more detail) 1. You're registering MyEventHandler.class on the event bus, but your event handler methods aren't static. 1. or... You're registering myEventHandler instance on the event bus, but your event handler methods are static. 1. You haven't specified a tab for the item, eg .group(ItemGroup.BUILDING_BLOCKS); // which inventory tab? My block doesn't drop an item when I harvest it 1. You have to harvest the block in survival mode (creative mode doesn't drop items when blocks are harvested) 1. You have to harvest the block using a suitable tool, depending on the Material you used to define your block and the harvestLevel and harvestTool Block Properties. (eg: you need a pickaxe to mine Material.ROCK)
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>Rgaa30 Test.1.7.3 NA 01</title> </head> <body> <div> <h1>Rgaa30 Test.1.7.3 NA 01</h1> <div class="test-detail" lang="fr"> Chaque image embarquée (balise <code>embed</code> avec l&apos;attribut <code>type=&quot;image/...&quot;</code>) ayant une <a href="http://references.modernisation.gouv.fr/referentiel-technique-0#mDescDetaillee">description détaillée</a> vérifie-t-elle une de ces conditions ? <ul class="ssTests"> <li> La <a href="http://references.modernisation.gouv.fr/referentiel-technique-0#mDescDetaillee">description détaillée</a> adjacente à l&apos;image embarquée est pertinente</li> <li> La <a href="http://references.modernisation.gouv.fr/referentiel-technique-0#mDescDetaillee">description détaillée</a> via un <a href="http://references.modernisation.gouv.fr/referentiel-technique-0#mLienAdj">lien adjacent</a> est pertinente</li> </ul> </div> <div class="testcase"> </div> <div class="test-explanation"> NA : The html element implied by the test is not present on the page </div> </div> </body> </html>
{ "pile_set_name": "Github" }
// Copyright 2020 The Google Research 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. #include "lossy_count.h" #include <algorithm> #include <iterator> #include <limits> #include <utility> #include <vector> #include "sketch.h" #include "utils.h" namespace sketch { namespace { std::vector<IntFloatPair> MergeConsecutiveEqualItems( const std::vector<IntFloatPair>& entries) { std::vector<IntFloatPair> result; for (const auto& entry : entries) { if (!result.empty() && entry.first == result.back().first) { result.back().second += entry.second; } else { result.push_back(entry); } } return result; } } // namespace LossyCount::LossyCount(uint window_size) : window_size_(window_size) { window_.reserve(window_size); current_.reserve(window_size); } LossyCount::LossyCount(const LossyCount& lc) : window_size_(lc.window_size_) { window_.reserve(window_size_); current_.reserve(window_size_); Merge(lc); } void LossyCount::Reset() { window_.clear(); current_.clear(); ResetMissing(); } void LossyCount::Add(uint item, float delta) { window_.emplace_back(item, std::max(delta, 1.0f)); if (window_.size() >= window_size_) { MergeCounters(epochs_ + 1); ++epochs_; } } void LossyCount::ReadyToEstimate() { MergeCounters(epochs_); } float LossyCount::Estimate(uint item) const { const auto& pos = lower_bound(current_.begin(), current_.end(), std::make_pair(item, 0), cmpByItem); if (pos != current_.end() && pos->first == item) return pos->second; return EstimateMissing(item); } std::vector<uint> LossyCount::HeavyHitters(float threshold) const { return FilterOutAboveThreshold(current_, threshold); } unsigned int LossyCount::Size() const { return sizeof(LossyCount) + (window_.capacity() + current_.capacity()) * sizeof(IntFloatPair); } bool LossyCount::Compatible(const Sketch& other_sketch) const { const LossyCount* other = dynamic_cast<const LossyCount*>(&other_sketch); if (other == nullptr) return false; if (!CompatibleMissing(*other)) return false; if (window_size_ != other->window_size_) return false; return true; } void LossyCount::Merge(const Sketch& other_sketch) { if (!Compatible(other_sketch)) return; const LossyCount& other = static_cast<const LossyCount&>(other_sketch); std::vector<IntFloatPair> next_current; next_current.reserve(current_.capacity()); int i = 0; int j = 0; while (i < current_.size() && j < other.current_.size()) { const uint this_item = current_[i].first; const uint other_item = other.current_[j].first; IntFloatPair min_pair; if (this_item < other_item) { min_pair = std::move(current_[i++]); min_pair.second += other.EstimateMissing(min_pair.first); } else if (this_item > other_item) { min_pair = other.current_[j++]; min_pair.second += Estimate(min_pair.first); } else { // this_item == other_item min_pair = {this_item, current_[i++].second + other.current_[j++].second}; } next_current.push_back(std::move(min_pair)); } while (i < current_.size()) { next_current.emplace_back( current_[i].first, current_[i].second + other.EstimateMissing(current_[i].first)); ++i; } while (j < other.current_.size()) { next_current.emplace_back( other.current_[j].first, other.current_[j].second + EstimateMissing(other.current_[j].first)); ++j; } current_ = std::move(next_current); MergeMissing(other); for (const auto &[item, freq] : other.window_) { Add(item, freq); } } void LossyCount::Forget(const std::vector<IntFloatPair>& forget) {} float LossyCount::EstimateMissing(uint k) const { return epochs_; } bool LossyCount::CompatibleMissing(const LossyCount& other) const { return true; } void LossyCount::MergeMissing(const LossyCount& other) { epochs_ += other.epochs_; } void LossyCount::ResetMissing() { epochs_ = 0; } void LossyCount::MergeCounters(float threshold) { // Early return if window_ is empty as we don't want to clear current_. if (window_.empty()) { return; } sort(window_.begin(), window_.end(), cmpByItem); std::vector<IntFloatPair> merged_window = MergeConsecutiveEqualItems(window_); std::vector<IntFloatPair> next_current; next_current.reserve(current_.capacity()); std::vector<IntFloatPair> forget_pairs; for (int i = 0, j = 0; i < current_.size() || j < merged_window.size(); ) { const uint current_item = i < current_.size() ? current_[i].first : std::numeric_limits<uint>::max(); const uint window_item = j < merged_window.size() ? merged_window[j].first : std::numeric_limits<uint>::max(); IntFloatPair min_pair; if (current_item < window_item) { min_pair = current_[i++]; } else if (current_item > window_item) { min_pair = {window_item, EstimateMissing(window_item) + merged_window[j].second}; ++j; } else { // current_item == window_item min_pair = {current_item, current_[i++].second + merged_window[j++].second}; } if (min_pair.second > threshold) { next_current.push_back(std::move(min_pair)); } else { forget_pairs.push_back(std::move(min_pair)); } } Forget(forget_pairs); window_.clear(); current_ = std::move(next_current); } LossyCountFallback::LossyCountFallback(uint window_size, uint hash_count, uint hash_size) : LossyCount(window_size), cm_(CountMinCU(hash_count, hash_size)) {} float LossyCountFallback::EstimateMissing(uint k) const { return cm_.Estimate(k); } void LossyCountFallback::MergeMissing(const LossyCount& other) { LossyCount::MergeMissing(other); const LossyCountFallback& other_cast = dynamic_cast<const LossyCountFallback&>(other); cm_.Merge(other_cast.cm_); } bool LossyCountFallback::CompatibleMissing(const LossyCount& other) const { if (!LossyCount::CompatibleMissing(other)) return false; const LossyCountFallback& other_cast = dynamic_cast<const LossyCountFallback&>(other); return cm_.Compatible(other_cast.cm_); } void LossyCountFallback::ResetMissing() { LossyCount::ResetMissing(); cm_.Reset(); } void LossyCountFallback::Forget(const std::vector<IntFloatPair>& forget_pairs) { for (const auto& [item, freq] : forget_pairs) { cm_.Update(item, freq); } } unsigned int LossyCountFallback::Size() const { return LossyCount::Size() + cm_.Size(); } } // namespace sketch
{ "pile_set_name": "Github" }
//---------------------------------------------------------- -*- Mode: C++ -*- // $Id$ // // Created 2012/06/14 // Author: Mike Ovsiannikov // // Copyright 2012,2016 Quantcast Corporation. All rights reserved. // // This file is part of Kosmos File System (KFS). // // 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. // // \brief chown. // //---------------------------------------------------------------------------- #include "kfsshell.h" #include "libclient/KfsClient.h" #include <iostream> #include <vector> #include <string> namespace KFS { namespace tools { using std::cout; using std::vector; using std::string; int handleChown(KfsClient* kfsClient, const vector<string>& args) { bool recursFlag = false; if (args.size() < 2 || args[0] == "--help" || ((recursFlag = args[0] == "-R") && args.size() < 3)) { cout << "Usage: chown [-R] <owner> <path>" << "\n"; return 0; } size_t i = recursFlag ? 1 : 0; const string& ug = args[i]; const size_t pos = ug.find(':'); const string uname(ug.substr(0, pos)); const string gname(pos != string::npos ? ug.substr(pos + 1) : string()); for (++i ; i < args.size(); i++) { const char* const name = args[i].c_str(); const int res = recursFlag ? kfsClient->ChownR(name, uname.c_str(), gname.c_str()) : kfsClient->Chown(name, uname.c_str(), gname.c_str()); if (res != 0) { cout << name << ": " << ErrorCodeToStr(res) << "\n"; return res; } } return 0; } } }
{ "pile_set_name": "Github" }
######################## # Jack's Sidearm ######################## //created by Kazy ____________________ Replaces the Logan's Gun _____________________ - Near-perfect Accuracy for a Hyperion - Increased Critical Hit Damage - Small Magazine (~6) - Fast Reload Speed (~1.5) ##### Name ##### set GD_Weap_Pistol.Name.Title_Hyperion.Title_Legendary_LogansGun PartName Jack's Sidearm set GD_Weap_Pistol.Name.Title_Hyperion.Title_Legendary_LogansGun:AttributePresentationDefinition_8 NoConstraintText 'Sup? ##### Rarity ##### set GD_Weap_Pistol.Barrel.Pistol_Barrel_Hyperion_LogansGun rarity (BaseValueConstant=-1.000000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.000000) ##### Firing ##### set GD_Weap_Pistol.Barrel.Pistol_Barrel_Hyperion_LogansGun CustomFiringModeDefinition none set GD_Weap_Pistol.Barrel.Pistol_Barrel_Hyperion_LogansGun WeaponCardAttributes none set GD_Weap_Pistol.Barrel.Pistol_Barrel_Hyperion_LogansGun WeaponAttributeEffects ((AttributeToModify=AttributeDefinition'D_Attributes.Weapon.WeaponDamage',ModifierType=MT_Scale,BaseModifierValue=(BaseValueConstant=0.300000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.000000)),(AttributeToModify=AttributeDefinition'D_Attributes.Weapon.WeaponFireInterval',ModifierType=MT_PostAdd,BaseModifierValue=(BaseValueConstant=-0.000100,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.00000)),(AttributeToModify=AttributeDefinition'D_Attributes.Weapon.WeaponPerShotAccuracyImpulse',ModifierType=MT_PreAdd,BaseModifierValue=(BaseValueConstant=0.000000,BaseValueAttribute=AttributeDefinition'D_Attributes.WeaponManufacturer.Weapon_Is_Hyperion',InitializationDefinition=None,BaseValueScaleConstant=-0.200000)),(AttributeToModify=AttributeDefinition'D_Attributes.Weapon.WeaponSpread',ModifierType=MT_PreAdd,BaseModifierValue=(BaseValueConstant=0.300000,BaseValueAttribute=AttributeDefinition'D_Attributes.WeaponManufacturer.Weapon_Is_Hyperion',InitializationDefinition=None,BaseValueScaleConstant=0.150000)),(AttributeToModify=AttributeDefinition'D_Attributes.Weapon.WeaponClipSize',ModifierType=MT_PreAdd,BaseModifierValue=(BaseValueConstant=-13.500000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.000000)),(AttributeToModify=AttributeDefinition'D_Attributes.GameplayAttributes.PlayerCriticalHitBonus',ModifierType=MT_PostAdd,BaseModifierValue=(BaseValueConstant=15.000000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.000000))) set GD_Weap_Pistol.Barrel.Pistol_Barrel_Hyperion_LogansGun ExternalAttributeEffects ((AttributeToModify=ResourcePoolAttributeDefinition'D_Attributes.AccuracyResourcePool.AccuracyMinValue',ModifierType=MT_PreAdd,BaseModifierValue=(BaseValueConstant=-1.000000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=2.000000)),(AttributeToModify=ResourcePoolAttributeDefinition'D_Attributes.AccuracyResourcePool.AccuracyMaxValue',ModifierType=MT_Scale,BaseModifierValue=(BaseValueConstant=-1.000000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=10.000000))) set GD_Weap_Pistol.Barrel.Pistol_Barrel_Hyperion_LogansGun AttributeSlotUpgrades () ##### Killed Jack ##### set GD_Episode17.M_Ep17_KillJack Reward (ExperienceRewardPercentage=(BaseValueConstant=0.100000,BaseValueAttribute=AttributeDefinition'GD_MissionRewardBalance.XP.XPReward_05_Largest',InitializationDefinition=None,BaseValueScaleConstant=1.500000),CurrencyRewardType=CURRENCY_Eridium,CreditRewardMultiplier=(BaseValueConstant=0.000000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.000000),OtherCurrencyReward=(BaseValueConstant=4.000000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.000000),RewardItems=(WeaponBalanceDefinition'GD_Weap_Pistol.A_Weapons_Legendary.Pistol_Hyperion_5_LogansGun'),RewardItemPools=) ##### Appearance ##### set Common_GunMaterials.Materials.Pistol.Mati_HyperionLegendaryPistol_Logan ScalarParameterValues ((ParameterName="p_HighlightsIntensity",ParameterValue=1.000000,ExpressionGUID=(A=-1257568432,B=1277066486,C=-723473993,D=-1144384173)),(ParameterName="p_ShadowsIntensity",ParameterValue=2.000000,ExpressionGUID=(A=437293753,B=1205147708,C=-775723903,D=1480014964)),(ParameterName="p_UseFullColorDecal",ParameterValue=0.600000,ExpressionGUID=(A=-1064329812,B=1077705328,C=339664807,D=1869745420)),(ParameterName="p_ReplaceDecal",ParameterValue=1.000000,ExpressionGUID=(A=85863466,B=1257609701,C=-728575820,D=1337098176))) set Common_GunMaterials.Materials.Pistol.Mati_HyperionLegendaryPistol_Logan TextureParameterValues ((ParameterName="p_Masks",ParameterValue=Texture2D'Weap_Pistol.Tex.Weap_Pistols_Comp',ExpressionGUID=(A=-330624041,B=1167251458,C=-335191907,D=-166684394)),(ParameterName="p_Diffuse",ParameterValue=Texture2D'Common_GunMaterials.CompTextures.Weap_LauncherShotgunPistol_Comp',ExpressionGUID=(A=1757607260,B=1326539502,C=-317215581,D=-565807463)),(ParameterName="p_NormalScopesEmissive",ParameterValue=Texture2D'Weap_Pistol.Tex.Weap_Pistols_Nrm',ExpressionGUID=(A=-1743872746,B=1126171774,C=119496871,D=-1952271718)),(ParameterName="P_SimpleReflect",ParameterValue=Texture2D'Common_GunMaterials.Env.Chrome',ExpressionGUID=(A=-858148940,B=1327945772,C=148462268,D=1899047224)),(ParameterName="p_Pattern",ParameterValue=Texture2D'Common_GunMaterials.Patterns.Pattern_HyperionStripeUncommon',ExpressionGUID=(A=-923052711,B=1309861752,C=584229786,D=-1229888527))) set Common_GunMaterials.Materials.Pistol.Mati_HyperionLegendaryPistol_Logan VectorParameterValues ((ParameterName="p_AColorHilight",ParameterValue=(R=0.900000,G=0.747455,B=0.412985,A=1.000000),ExpressionGUID=(A=384292798,B=1221323751,C=-2145405772,D=1872194118)),(ParameterName="p_AColorMidtone",ParameterValue=(R=0.835294,G=0.473452,B=0.357079,A=1.000000),ExpressionGUID=(A=1102826245,B=1256298978,C=-1429881438,D=-507521102)),(ParameterName="p_AColorShadow",ParameterValue=(R=0.089498,G=0.949166,B=0.042756,A=1.000000),ExpressionGUID=(A=1481234158,B=1129012376,C=-688827739,D=-2119135160)),(ParameterName="p_BColorHilight",ParameterValue=(R=1.007092,G=1.178774,B=1.182999,A=1.000000),ExpressionGUID=(A=170714760,B=1132476783,C=-275668290,D=655702143)),(ParameterName="p_BColorMidtone",ParameterValue=(R=1.114824,G=1.127499,B=1.340724,A=1.000000),ExpressionGUID=(A=473594356,B=1338758895,C=824823946,D=864253813)),(ParameterName="p_BColorShadow",ParameterValue=(R=0.428599,G=0.501228,B=0.592843,A=1.000000),ExpressionGUID=(A=-429590341,B=1156435294,C=-1015192901,D=687313413)),(ParameterName="p_CColorHilight",ParameterValue=(R=2.000000,G=2.599000,B=0.707503,A=1.000000),ExpressionGUID=(A=759765673,B=1280874949,C=257367956,D=-932702788)),(ParameterName="p_CColorMidtone",ParameterValue=(R=1.080870,G=1.000000,B=0.000000,A=1.000000),ExpressionGUID=(A=110180441,B=1232792373,C=-1232281417,D=-1030626065)),(ParameterName="p_CColorShadow",ParameterValue=(R=0.026701,G=0.020000,B=0.000000,A=1.000000),ExpressionGUID=(A=716329441,B=1214803259,C=-238071112,D=-1004122047)),(ParameterName="p_ReflectColor",ParameterValue=(R=1.602685,G=1.892820,B=1.479317,A=1.000000),ExpressionGUID=(A=295058103,B=1318551573,C=-2045449573,D=-547597976)),(ParameterName="p_ReflectionChannelScale",ParameterValue=(R=1.000000,G=1.000000,B=1.000000,A=1.000000),ExpressionGUID=(A=1869386622,B=1303200947,C=-1616405849,D=714558284)),(ParameterName="p_PatternScalePosition",ParameterValue=(R=24.298660,G=31.746038,B=0.535500,A=0.508300),ExpressionGUID=(A=395540170,B=1243133493,C=-1264190552,D=123075385)),(ParameterName="p_PatternColor",ParameterValue=(R=0.667735,G=0.300000,B=0.100000,A=1.000000),ExpressionGUID=(A=1691998600,B=1239094551,C=2074257317,D=1844701893)),(ParameterName="p_DecalColor",ParameterValue=(R=0.167735,G=0.100000,B=0.100000,A=1.000000),ExpressionGUID=(A=1691998600,B=1239094551,C=2074257317,D=1844701893)),(ParameterName="p_DColor",ParameterValue=(R=6.077345,G=6.077345,B=6.077345,A=1.000000),ExpressionGUID=(A=696455109,B=1155878830,C=-1741888361,D=802120528)),(ParameterName="p_DecalChannel",ParameterValue=(R=0.000000,G=0.000000,B=0.000000,A=0.000000),ExpressionGUID=(A=1757499073,B=1097055033,C=-1266029657,D=1038353636)))
{ "pile_set_name": "Github" }
# frozen_string_literal: false # # httpauth/basicauth.rb -- HTTP basic access authentication # # Author: IPR -- Internet Programming with Ruby -- writers # Copyright (c) 2003 Internet Programming with Ruby writers. All rights # reserved. # # $IPR: basicauth.rb,v 1.5 2003/02/20 07:15:47 gotoyuzo Exp $ require 'webrick/config' require 'webrick/httpstatus' require 'webrick/httpauth/authenticator' module WEBrick module HTTPAuth ## # Basic Authentication for WEBrick # # Use this class to add basic authentication to a WEBrick servlet. # # Here is an example of how to set up a BasicAuth: # # config = { :Realm => 'BasicAuth example realm' } # # htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file' # htpasswd.set_passwd config[:Realm], 'username', 'password' # htpasswd.flush # # config[:UserDB] = htpasswd # # basic_auth = WEBrick::HTTPAuth::BasicAuth.new config class BasicAuth include Authenticator AuthScheme = "Basic" # :nodoc: ## # Used by UserDB to create a basic password entry def self.make_passwd(realm, user, pass) pass ||= "" pass.crypt(Utils::random_string(2)) end attr_reader :realm, :userdb, :logger ## # Creates a new BasicAuth instance. # # See WEBrick::Config::BasicAuth for default configuration entries # # You must supply the following configuration entries: # # :Realm:: The name of the realm being protected. # :UserDB:: A database of usernames and passwords. # A WEBrick::HTTPAuth::Htpasswd instance should be used. def initialize(config, default=Config::BasicAuth) check_init(config) @config = default.dup.update(config) end ## # Authenticates a +req+ and returns a 401 Unauthorized using +res+ if # the authentication was not correct. def authenticate(req, res) unless basic_credentials = check_scheme(req) challenge(req, res) end userid, password = basic_credentials.unpack("m*")[0].split(":", 2) password ||= "" if userid.empty? error("user id was not given.") challenge(req, res) end unless encpass = @userdb.get_passwd(@realm, userid, @reload_db) error("%s: the user is not allowed.", userid) challenge(req, res) end if password.crypt(encpass) != encpass error("%s: password unmatch.", userid) challenge(req, res) end info("%s: authentication succeeded.", userid) req.user = userid end ## # Returns a challenge response which asks for authentication information def challenge(req, res) res[@response_field] = "#{@auth_scheme} realm=\"#{@realm}\"" raise @auth_exception end end ## # Basic authentication for proxy servers. See BasicAuth for details. class ProxyBasicAuth < BasicAuth include ProxyAuthenticator end end end
{ "pile_set_name": "Github" }
<?php /** * This file implements the UI view for the user picture crop form. * * This file is part of the evoCore framework - {@link http://evocore.net/} * See also {@link https://github.com/b2evolution/b2evolution}. * * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license} * * @copyright (c)2003-2020 by Francois Planque - {@link http://fplanque.com/} * * @package admin */ if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); global $display_mode, $Settings; /** * @var instance of User class */ global $edited_User; /** * @var current action */ global $action; /** * @var user permission, if user is only allowed to edit his profile */ global $user_profile_only; /** * @var the action destination of the form (NULL for pagenow) */ global $form_action; /** * @var instance of User class */ global $current_User; /** * @var File that should be cropped */ global $cropped_File; global $aspect_ratio, $content_width, $content_height; $aspect_ratio = param( 'aspect_ratio', 'double' ); $content_width = param( 'content_width', 'integer' ); $content_height = param( 'content_height', 'integer' ); $original_image_size = explode( 'x', $cropped_File->get_image_size() ); $image_height = $original_image_size[1]; $image_width = $original_image_size[0];; $min_avatar_size = $Settings->get( 'min_picture_size' ); $can_crop = ( $image_height >= $min_avatar_size && $image_width >= $min_avatar_size && ! ( $image_height == $min_avatar_size && $image_width == $min_avatar_size ) ); if( $display_mode != 'js' ) { // ------------------- PREV/NEXT USER LINKS ------------------- user_prevnext_links( array( 'user_tab' => 'avatar' ) ); // ------------- END OF PREV/NEXT USER LINKS ------------------- } $Form = new Form( $form_action, 'user_checkchanges' ); if( is_admin_page() ) { $ctrl_param = '?ctrl=user&amp;user_tab=avatar&amp;user_ID='.$edited_User->ID; $form_title = ''; $form_class = 'fform'; } else { global $Collection, $Blog; $form_title = ''; $form_class = 'bComment'; $ctrl_param = url_add_param( $Blog->gen_blogurl(), 'disp='.$disp ); } if( $display_mode != 'js' && is_admin_page() ) { if( !$user_profile_only ) { echo_user_actions( $Form, $edited_User, $action ); } $form_text_title = TB_( 'Crop profile picture' ); // used for js confirmation message on leave the changed form $form_title = get_usertab_header( $edited_User, '', $form_text_title ); } $cropped_image_tag = $cropped_File->get_tag( '', '', '', '', 'original', '', '', '', '', '', '', '', '', '', 'none' ); // Display this error when JS is not enabled echo '<noscript>' .'<p class="error text-danger">'.TB_('Please activate Javascript in your browser in order to use this feature.').'</p>' .'<style type="text/css">form#user_checkchanges { display:none }</style>' .'</noscript>'; $Form->begin_form( $form_class, $form_title, array( 'title' => ( isset( $form_text_title ) ? $form_text_title : $form_title ) ) ); if( is_admin_page() ) { $Form->hidden_ctrl(); } else { $Form->hidden( 'disp', $disp ); $Form->hidden( 'action', $action ); } $Form->add_crumb( 'user' ); $Form->hidden( 'user_tab', param( 'user_tab_from', 'string', 'avatar' ) ); $Form->hidden( 'user_ID', isset( $edited_User ) ? $edited_User->ID : $current_User->ID ); $Form->hidden( 'file_ID', $cropped_File->ID ); $Form->hidden( 'image_crop_data', '' ); if( isset( $Blog ) ) { $Form->hidden( 'blog', $Blog->ID ); } $close_icon = ''; if( $display_mode == 'js' ) { // Display a close link for popup window $close_icon = action_icon( TB_('Close this window'), 'close', '', '', 0, 0, array( 'id' => 'close_button', 'class' => 'floatright' ) ); } // Start displaying content if( ! $can_crop ) { echo '<div style="height: '.$content_height.'px; width: '. $content_width.'px; position=relative; text-align: center;">'; echo '<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">'.sprintf( TB_('Only images larger than %dx%d pixels can be cropped.'), $min_avatar_size, $min_avatar_size ).'</div>'; echo '</div>'; } else { echo '<div id="user_crop_content" style="height: '.$content_height.'px; width: '. $content_width.'px;">'; echo '</div>'; $Form->button( array( 'type' => 'submit', 'name'=>'actionArray[crop]', 'value'=> TB_('Apply'), 'class' => 'SaveButton btn-primary' ) ); } $Form->end_form(); if( $can_crop ) { ?> <style> #user_crop_workarea img { object-fit: contain; width: <?php echo $content_width;?>; height: <?php echo $content_height;?>; visibility: hidden; } div.jcrop-holder { margin: 0 auto; position: relative; top: 50%; transform: translateY(-50%); } </style> <script> var jcrop_api; var image_url = '<?php echo format_to_js( $cropped_File->get_url() ); ?>'; var gutter = 10; var padding = 0; var content_height = <?php echo $content_height;?>; var content_width = <?php echo $content_width;?>; var show_large_preview = true; var show_small_preview = true; var large_preview_size = 128; var small_preview_size = 64; var preview_size; var preview_margin = 10; var preview_orientation = 'portrait'; var aspect_ratio = <?php echo $aspect_ratio;?>; var render_mode = 'landscape'; var workarea_height; var workarea_width; var workarea_aspect_ratio; var original_image_height = <?php echo $image_height;?>; var original_image_width = <?php echo $image_width;?>; var original_image_aspect_ratio = original_image_height / original_image_width; var size_ratio = 1; var working_image_height = null; var working_image_width = null; var working_image_aspect_ratio = null; var initial_crop_selection = []; //console.debug( 'Content: ', content_width, content_height ); //console.debug( 'Original Image: ', original_image_width, original_image_height ); function get_working_image_dimensions( w_height, w_width, image_aspect_ratio ) { // We'll use this function to determine which mode will provide the larger working image var w_aspect_ratio = w_height / w_width; if( w_aspect_ratio > image_aspect_ratio ) { // width is limiting dimension i_width = w_width; i_height = w_width * original_image_aspect_ratio; } else { // height is limiting dimension i_height = w_height; i_width = w_height / original_image_aspect_ratio; } i_area = i_width * i_height; return { height: i_height, width: i_width, area: i_area }; } function init_layout() { var lw_width, lw_height, lw_area, lw_aspect_ratio; var pw_width, pw_height, pw_area, pw_aspect_ratio; var i_width, i_height, i_area; if( aspect_ratio < 1 && ( large_preview_size > ( content_width / 3 ) ) || aspect_ratio > 1 && ( large_preview_size > ( content_height / 3 ) ) ) { preview_size = small_preview_size; } else { preview_size = large_preview_size; } // Try landscape mode first lw_width = content_width - preview_size - gutter - ( padding * 2 ); lw_height = content_height - ( padding * 2 ); lw_area = lw_width * lw_height; lw_aspect_ratio = lw_height / lw_width; var l_view = get_working_image_dimensions( lw_height, lw_width, original_image_aspect_ratio ); // Now let's try portrait mode pw_height = content_height - preview_size - gutter - ( padding * 2 ); pw_width = content_width - ( padding * 2 ); pw_area = pw_width * pw_height; pw_aspect_ratio = pw_height / pw_width; var p_view = get_working_image_dimensions( pw_height, pw_width, original_image_aspect_ratio ); // See what mode provides the largest working image if ( l_view.area > p_view.area ) { render_mode = 'landscape'; } else { render_mode = 'portrait'; } // Determine if we can show all the preview images if( render_mode == 'portrait' ) { if( ( content_width < original_image_width ? content_width : original_image_width ) > ( ( ( large_preview_size + preview_margin ) * 2 ) + ( ( small_preview_size + preview_margin ) * 2 ) ) ) { show_large_preview = true; show_small_preview = true; preview_size = large_preview_size; } else if( ( ( content_width < original_image_width ? content_width : original_image_width ) > ( ( large_preview_size + preview_margin ) * 2 ) ) && ( ( 0.25 * content_height ) >= large_preview_size ) ) { show_large_preview = true; show_small_preview = false; preview_size = large_preview_size; } else if( ( ( content_width < original_image_width ? content_width : original_image_width ) > ( ( small_preview_size + preview_margin ) * 2 ) ) && ( ( 0.25 * ( render_mode == 'landscape' ? content_width : content_height ) ) >= small_preview_size ) ) { show_large_preview = false; show_small_preview = true; preview_size = small_preview_size; } else { show_large_preview = false; show_small_preview = false; preview_size = 0; } } else { if( ( content_height < original_image_height ? content_height : original_image_height ) > ( ( ( large_preview_size + preview_margin ) * 2 ) + ( ( small_preview_size + preview_margin ) * 2 ) ) ) { show_large_preview = true; show_small_preview = true; preview_size = large_preview_size; } else if( ( ( content_height < original_image_height ? content_height : original_image_height ) > ( ( large_preview_size + preview_margin ) * 2 ) ) && ( ( 0.25 * ( content_width < content_height ? content_width : content_height ) ) >= large_preview_size ) ) { show_large_preview = true; show_small_preview = false; preview_size = large_preview_size; } else if( ( ( content_height < original_image_height ? content_height : original_image_height ) > ( ( small_preview_size + preview_margin ) * 2 ) ) && ( ( 0.25 * ( content_width < content_height ? content_width : content_height ) ) >= small_preview_size ) ) { show_large_preview = false; show_small_preview = true; preview_size = small_preview_size; } else if( ( content_height < original_image_height ? content_height : original_image_height ) > ( ( small_preview_size ) ) && ( ( content_width ) > ( lw_width + ( small_preview_size * 2 ) ) ) ) { // This is a special case when there is not enough room for a vertical preview but a horizontal preview can be accomodated show_large_preview = false; show_small_preview = true; preview_size = small_preview_size; preview_orientation = 'landscape'; } else { show_large_preview = false; show_small_preview = false; preview_size = 0; } } //console.debug( 'Render mode: ', render_mode ); //console.debug( 'Show large preview: ', show_large_preview ); //console.debug( 'Show small preview: ', show_small_preview ); //console.debug( 'Preview Size: ', preview_size ); } function init_workarea() { if( render_mode == 'portrait' ) { workarea_height = content_height - preview_size - gutter - ( padding * 2 ); workarea_width = content_width - ( padding * 2 ); } else { workarea_height = ( content_height - ( padding * 2 ) ); workarea_width = content_width - preview_size - gutter - ( padding * 2 ); } workarea_aspect_ratio = ( workarea_height / workarea_width ); //console.debug( 'Workarea: ', workarea_width, workarea_height ); } function init_working_image() { if( workarea_aspect_ratio == original_image_aspect_ratio ) { working_image_height = workarea_height; working_image_width = workarea_width; size_ratio = original_image_height / working_image_width; //console.debug( 'Limiting dimension: ', 'both' ); } else if( workarea_aspect_ratio > original_image_aspect_ratio ) { working_image_width = workarea_width; working_image_height = workarea_width * original_image_aspect_ratio; size_ratio = original_image_width / working_image_width; //console.debug( 'Limiting dimension: ', 'width' ); } else { working_image_height = workarea_height; working_image_width = workarea_height / original_image_aspect_ratio; size_ratio = original_image_height / working_image_height; //console.debug( 'Limiting dimension: ', 'height' ); } // Should be always equal to original image aspect ratio working_image_aspect_ratio = working_image_height / working_image_width; //console.debug( 'Image: ', working_image_width, working_image_height ); } function init_crop_selection() { var crop_size; initial_crop_selection = []; if( original_image_aspect_ratio > 1 ) { crop_size = original_image_width; } else { crop_size = original_image_height; } if( original_image_aspect_ratio > 1 ) { initial_crop_selection.push( 0 ); initial_crop_selection.push( 0 ); initial_crop_selection.push( crop_size ); initial_crop_selection.push( crop_size ); } else { initial_crop_selection.push( ( original_image_width / 2 ) - ( crop_size / 2 ) ); initial_crop_selection.push( ( original_image_height / 2 ) - ( crop_size / 2 ) ); initial_crop_selection.push( ( original_image_width / 2 ) + ( crop_size / 2 ) ); initial_crop_selection.push( ( original_image_height / 2 ) + ( crop_size / 2 ) ); } //console.debug( 'Initial selection: ', initial_crop_selection ); } function render_content() { var content = jQuery( 'div#user_crop_content' ); var working_image = jQuery( '<img />', { src: image_url }); var workarea = jQuery( '<div />', { id: 'user_crop_workarea', style: { 'background-color': '#f2f2f2', height: workarea_height + 'px', width: workarea_width + 'px' } }); var previews = jQuery( '<div />', { id: 'user_crop_preview', style: { 'background-color': 'white', height: preview_size + 'px', 'text-align': 'center', 'margin-top': gutter + 'px' } }); // Large square preview var preview_lg_sq = jQuery( '<div />', { class: 'preview_cropped_image' }).css({ width: '128px', height: '128px', }).append( working_image.clone() ); // Small square preview var preview_sm_sq = jQuery( '<div />', { class: 'preview_cropped_image' }).css({ width: '64px', height: '64px', }).append( working_image.clone() ); // Large circle preview var preview_lg_c = jQuery( '<div />', { class: 'preview_cropped_image circle' }).css({ width: '128px', height: '128px', }).append( working_image.clone() ); // Small circle preview var preview_sm_c = jQuery( '<div />', { class: 'preview_cropped_image circle' }).css({ width: '64px', height: '64px', }).append( working_image.clone() ); if( render_mode == 'portrait' ) { // Portrait workarea.css({ 'background-color': '#f2f2f2', height: workarea_height + 'px', width: workarea_width + 'px' }); previews.css({ 'background-color': '#ffffff', height: preview_size + 'px', width: content_width + 'px', 'text-align': 'center', 'margin-top': gutter + 'px' }); if( show_large_preview ) { previews.append( preview_lg_sq ); } if( show_small_preview ) { previews.append( preview_sm_sq ); } if( show_large_preview ) { previews.append( preview_lg_c ); } if( show_small_preview ) { previews.append( preview_sm_c ); } workarea.prepend( working_image ); content.append( workarea ); content.append( previews ); preview_images = jQuery( 'div#user_crop_preview div.preview_cropped_image:not(:last-child)' ); preview_images.css( 'margin-bottom', 0 ); preview_images.css( 'margin-right', preview_margin + 'px' ); } else { // Landscape workarea.css({ 'background-color': '#f2f2f2', float: 'left', width: workarea_width + 'px', height: workarea_height + 'px' }); previews.css({ 'background-color': '#ffffff', float: 'left', width: ( preview_orientation == 'portrait' ? preview_size : ( ( preview_size + preview_margin ) * 2 ) ) + 'px', height: content_height + 'px', 'text-align': 'center', 'margin-left': gutter + 'px' }); workarea.prepend( working_image ); var preview_wrapper = jQuery( '<div />' ); if( show_large_preview ) { preview_wrapper.append( preview_lg_sq ); } if( show_small_preview ) { preview_wrapper.append( preview_sm_sq ); } if( show_large_preview ) { preview_wrapper.append( preview_lg_c ); } if( show_small_preview ) { preview_wrapper.append( preview_sm_c ); } previews.append( preview_wrapper ); content.append( workarea ); content.append( previews ); content.append( jQuery( '<div />', { style: { clear: 'both' } } ) ); preview_images = jQuery( 'div#user_crop_preview div.preview_cropped_image:not(:last-child)' ); if( preview_orientation == 'portrait' ) { preview_images.css( 'margin-bottom', preview_margin + 'px' ); preview_images.css( 'margin-right', 0 ); } else { preview_images.css( 'margin-bottom', 0 ); preview_images.css( 'margin-right', preview_margin + 'px' ); } } // Adjust modal dimensions and content to minimize workarea margin var wah_margin = workarea_height - ( original_image_height < working_image_height ? original_image_height : working_image_height ); var waw_margin = workarea_width - ( original_image_width < working_image_width ? original_image_width : working_image_width ); var modal_dialog = jQuery( 'div.modal-dialog' ).length ? jQuery( 'div.modal-dialog' ) : jQuery( '#overlay_wrap' ); var modal_body = jQuery( 'div.modal-body' ).length ? jQuery( 'div.modal-body' ) : jQuery( '#overlay_page' ); var content = jQuery( 'div#user_crop_content' ); //console.debug( 'Margin: ', wah_margin, waw_margin ); //console.debug( 'Workarea: ', workarea_height, workarea_width ); //console.debug( 'Working Image: ', working_image_height, working_image_width ); workarea.css( 'height', ( workarea_height - wah_margin ) + 'px' ); workarea.css( 'width', ( workarea_width - waw_margin ) + 'px' ); content.css( 'height', ( content_height - wah_margin ) + 'px' ); content.css( 'width', ( content_width - waw_margin + ( preview_orientation == 'landscape' ? preview_size + preview_margin + gutter : 0 ) ) + 'px' ); modal_body.css( 'height', ( parseInt( modal_body.css( 'height' ) ) - wah_margin ) + 'px' ); modal_body.css( 'min-height', ( parseInt( modal_body.css( 'min-height' ) ) - wah_margin ) + 'px' ); modal_body.css( 'width', ( parseInt( modal_body.css( 'width' ) ) - waw_margin + ( preview_orientation == 'landscape' ? preview_size + preview_margin + gutter : 0 ) ) + 'px' ); modal_dialog.css( 'height', ( parseInt( modal_dialog.css( 'height' ) ) - wah_margin ) + 'px' ); modal_dialog.css( 'width', ( parseInt( modal_dialog.css( 'width' ) ) - waw_margin + ( preview_orientation == 'landscape' ? preview_size + preview_margin + gutter : 0 ) ) + 'px' ); if( render_mode == 'portrait' ) { previews.css( 'width', ( parseInt( previews.css( 'width' ) ) - waw_margin ) + 'px' ); } else { previews.css( 'height', ( parseInt( previews.css( 'height' ) ) - wah_margin ) + 'px' ); } } function update_preview( coords ) { var target_cropped_image_width = original_image_width; var target_cropped_image_height = original_image_height; var percent_width = Math.ceil( coords.w / target_cropped_image_width * 10000 ) / 100; var percent_height = Math.ceil( coords.h / target_cropped_image_height * 10000 ) / 100; var percent_top = Math.ceil( coords.x / target_cropped_image_width * 10000 ) / 100; var percent_left = Math.ceil( coords.y / target_cropped_image_height * 10000 ) / 100; jQuery( 'input[name=image_crop_data]' ).val( percent_top + ':' + percent_left + ':' + percent_width + ':' + percent_height ); var top = coords.y; var left = coords.x; if( coords.w > coords.h ) { // Center a cropping area of horizontal image left += ( coords.w / 2 ) - ( coords.h / 2 ); } else { var top_shift = ( coords.h - coords.w ) * 0.15; if( top + top_shift + coords.w < top + coords.h ) { // top - 15% top += top_shift; } } jQuery( '.preview_cropped_image img' ).each( function() { var ratio = jQuery( this ).parent().width() / ( coords.w < coords.h ? coords.w : coords.h ); jQuery( this ).css({ width: Math.round( ratio * target_cropped_image_width ) + 'px', height: Math.round( ratio * target_cropped_image_height ) + 'px', marginLeft: '-' + Math.round( ratio * left ) + 'px', marginTop: '-' + Math.round( ratio * top ) + 'px' }); }); } function selection_release() { // Reset to initial selection if selection is released jcrop_api.setSelect( initial_crop_selection ); } function init_jcrop_tool( image ) { var min_avatar_size = <?php echo $min_avatar_size;?>; options = { boxWidth: working_image_width, boxHeight: working_image_height, aspectRatio: 1, minSize: [ min_avatar_size, min_avatar_size ], onChange: update_preview, onSelect: update_preview, onRelease: selection_release }; image.Jcrop( options, function() { jcrop_api = this; jcrop_api.setSelect( initial_crop_selection ); image.css({ visibility: 'visible' }); }); } // Initialize content, workarea and working image init_layout(); init_workarea(); init_working_image(); init_crop_selection(); // Render everything render_content(); // Initialize jcrop tool only after the image is fully loaded jQuery( '#user_crop_workarea img' ).on( 'load', function() { init_jcrop_tool( jQuery( this ) ); }); </script> <?php } ?>
{ "pile_set_name": "Github" }
# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_append_flag.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) # # DESCRIPTION # # FLAG is appended to the FLAGS-VARIABLE shell variable, with a space # added in between. # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly # FLAG. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> # # 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 (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, see <http://www.gnu.org/licenses/>. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 6 AC_DEFUN([AX_APPEND_FLAG], [dnl AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) AS_VAR_SET_IF(FLAGS,[ AS_CASE([" AS_VAR_GET(FLAGS) "], [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], [ AS_VAR_APPEND(FLAGS,[" $1"]) AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) ], [ AS_VAR_SET(FLAGS,[$1]) AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) AS_VAR_POPDEF([FLAGS])dnl ])dnl AX_APPEND_FLAG
{ "pile_set_name": "Github" }
/* * arch/ubicom32/kernel/timer_broadcast.c * Implements a dummy clock event for each cpu. * * Copyright (C) 2008 Paul Mundt * (C) Copyright 2009, Ubicom, Inc. * * This file is part of the Ubicom32 Linux Kernel Port. * * The Ubicom32 Linux Kernel Port 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. * * The Ubicom32 Linux Kernel Port 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 the Ubicom32 Linux Kernel Port. If not, * see <http://www.gnu.org/licenses/>. * * Ubicom32 implementation derived from (with many thanks): * arch/m68knommu * arch/blackfin * arch/parisc * arch/arm * arch/sh */ #include <linux/init.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/device.h> #include <linux/smp.h> #include <linux/jiffies.h> #include <linux/percpu.h> #include <linux/clockchips.h> #include <linux/irq.h> static DEFINE_PER_CPU(struct clock_event_device, local_clockevent); /* * The broadcast trick only works when the timer will be used in a periodic mode. * If the user has configured either NO_HZ or HIGH_RES_TIMERS they must have * a per cpu timer. */ #if defined(CONFIG_NO_HZ) || defined(CONFIG_HIGH_RES_TIMERS) #error "Tickless and High Resolution Timers require per-CPU local timers: CONFIG_LOCAL_TIMERS" #endif /* * local_timer_interrupt() * Used on SMP for local timer interrupt sent via an IPI. */ void local_timer_interrupt(void) { struct clock_event_device *dev = &__get_cpu_var(local_clockevent); dev->event_handler(dev); } /* * dummy_timer_set_next_event() * Cause the timer to go off "cycles" from now. */ static int dummy_timer_set_next_event(unsigned long cycles, struct clock_event_device *dev) { return 0; } /* * dummy_timer_set_mode() * Do Nothing. */ static void dummy_timer_set_mode(enum clock_event_mode mode, struct clock_event_device *clk) { } /* * local_timer_setup() * Adds a clock event for the specified cpu. */ int __cpuinit local_timer_setup(unsigned int cpu) { struct clock_event_device *dev = &per_cpu(local_clockevent, cpu); dev->name = "timer-dummy"; dev->features = CLOCK_EVT_FEAT_DUMMY; dev->rating = 200; dev->mult = 1; dev->set_mode = dummy_timer_set_mode; dev->set_next_event = dummy_timer_set_next_event; dev->broadcast = smp_timer_broadcast; dev->cpumask = cpumask_of_cpu(cpu); dev->irq = -1; printk(KERN_NOTICE "timer[%d]: %s - created\n", dev->irq, dev->name); clockevents_register_device(dev); return 0; }
{ "pile_set_name": "Github" }
<?php declare(strict_types=1); namespace Shopware\Core\Framework\Demodata\Generator; use Shopware\Core\Checkout\Cart\Rule\GoodsPriceRule; use Shopware\Core\Checkout\Customer\Rule\CustomerGroupRule; use Shopware\Core\Checkout\Customer\Rule\IsNewCustomerRule; use Shopware\Core\Content\Rule\RuleDefinition; use Shopware\Core\Defaults; use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface; use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsAnyFilter; use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\NotFilter; use Shopware\Core\Framework\DataAbstractionLayer\Write\EntityWriterInterface; use Shopware\Core\Framework\DataAbstractionLayer\Write\WriteContext; use Shopware\Core\Framework\Demodata\DemodataContext; use Shopware\Core\Framework\Demodata\DemodataGeneratorInterface; use Shopware\Core\Framework\Rule\Container\AndRule; use Shopware\Core\Framework\Rule\Container\Container; use Shopware\Core\Framework\Rule\Container\FilterRule; use Shopware\Core\Framework\Rule\Container\OrRule; use Shopware\Core\Framework\Rule\DateRangeRule; use Shopware\Core\Framework\Rule\Rule; use Shopware\Core\Framework\Uuid\Uuid; use Shopware\Core\System\Currency\Rule\CurrencyRule; class RuleGenerator implements DemodataGeneratorInterface { /** * @var EntityRepositoryInterface */ private $ruleRepository; /** * @var EntityWriterInterface */ private $writer; /** * @var EntityRepositoryInterface */ private $paymentMethodRepository; /** * @var EntityRepositoryInterface */ private $shippingMethodRepository; /** * @var RuleDefinition */ private $ruleDefinition; public function __construct( EntityRepositoryInterface $ruleRepository, EntityWriterInterface $writer, EntityRepositoryInterface $paymentMethodRepository, EntityRepositoryInterface $shippingMethodRepository, RuleDefinition $ruleDefinition ) { $this->ruleRepository = $ruleRepository; $this->writer = $writer; $this->paymentMethodRepository = $paymentMethodRepository; $this->shippingMethodRepository = $shippingMethodRepository; $this->ruleDefinition = $ruleDefinition; } public function getDefinition(): string { return RuleDefinition::class; } public function generate(int $numberOfItems, DemodataContext $context, array $options = []): void { $paymentMethodIds = $this->paymentMethodRepository->searchIds(new Criteria(), $context->getContext()); $shippingMethodIds = $this->shippingMethodRepository->searchIds(new Criteria(), $context->getContext()); $criteria = (new Criteria())->addFilter( new NotFilter( NotFilter::CONNECTION_AND, [ new EqualsAnyFilter('rule.shippingMethods.id', $shippingMethodIds->getIds()), new EqualsAnyFilter('rule.paymentMethods.id', $paymentMethodIds->getIds()), ] ) ); $ids = $this->ruleRepository->searchIds($criteria, $context->getContext()); if (!empty($ids->getIds())) { return; } $pool = [ [ 'rule' => new IsNewCustomerRule(), 'name' => 'New customer', ], [ 'rule' => (new DateRangeRule())->assign(['fromDate' => new \DateTime(), 'toDate' => (new \DateTime())->modify('+2 day')]), 'name' => 'Next two days', ], [ 'rule' => (new GoodsPriceRule())->assign(['amount' => 5000, 'operator' => GoodsPriceRule::OPERATOR_GTE]), 'name' => 'Cart >= 5000', ], [ 'rule' => (new CustomerGroupRule())->assign(['customerGroupIds' => [Defaults::FALLBACK_CUSTOMER_GROUP]]), 'name' => 'Default group', ], [ 'rule' => (new CurrencyRule())->assign(['currencyIds' => [Defaults::CURRENCY]]), 'name' => 'Default currency', ], ]; $payload = []; for ($i = 0; $i < 20; ++$i) { $rules = \array_slice($pool, random_int(0, \count($pool) - 2), random_int(1, 2)); $classes = array_column($rules, 'rule'); $names = array_column($rules, 'name'); $ruleData = [ 'id' => Uuid::randomHex(), 'priority' => $i, 'name' => implode(' + ', $names), 'description' => $context->getFaker()->text(), ]; $ruleData['conditions'][] = $this->buildChildRule(null, (new OrRule())->assign(['rules' => $classes])); $payload[] = $ruleData; } // nested condition $nestedRule = new OrRule(); $nestedRuleData = [ 'id' => Uuid::randomHex(), 'priority' => 20, 'name' => 'nested rule', 'description' => $context->getFaker()->text(), ]; $this->buildNestedRule($nestedRule, $pool, 0, 6); $nestedRuleData['conditions'][] = $this->buildChildRule(null, $nestedRule); $payload[] = $nestedRuleData; $writeContext = WriteContext::createFromContext($context->getContext()); $this->writer->insert($this->ruleDefinition, $payload, $writeContext); } private function buildNestedRule(Rule $rule, array $pool, int $currentDepth, int $depth): Rule { if ($currentDepth === $depth) { return $rule; } $rules = \array_slice($pool, random_int(0, \count($pool) - 2), random_int(1, 2)); $classes = array_column($rules, 'rule'); if ($currentDepth % 2 === 1) { $classes[] = $this->buildNestedRule(new OrRule(), $pool, $currentDepth + 1, $depth); } else { $classes[] = $this->buildNestedRule(new AndRule(), $pool, $currentDepth + 1, $depth); } $rule->assign(['rules' => $classes]); return $rule; } private function buildChildRule(?string $parentId, Rule $rule): array { $data = []; $data['value'] = $rule->jsonSerialize(); unset($data['value']['_class'], $data['value']['rules'], $data['value']['extensions']); if ($rule instanceof FilterRule) { unset($data['value']['filter']); } if (!$data['value']) { unset($data['value']); } $data['id'] = Uuid::randomHex(); $data['parentId'] = $parentId; $data['type'] = $rule->getName(); if ($rule instanceof Container) { $data['children'] = []; foreach ($rule->getRules() as $index => $childRule) { $child = $this->buildChildRule($data['id'], $childRule); $child['position'] = $index; $data['children'][] = $child; } } return $data; } }
{ "pile_set_name": "Github" }
## # This file is part of WhatWeb and may be subject to # redistribution and commercial restrictions. Please see the WhatWeb # web site for more information on licensing and terms of use. # http://www.morningstarsecurity.com/research/whatweb ## Plugin.define "NCR-iTRAN-3000t-Imaging-Transport" do author "Brendan Coles <bcoles@gmail.com>" # 2012-11-16 version "0.1" description "A full function, image-based table top check imaging and payment processing device" website "http://www.ncr.com/products-and-services/payment-and-imaging/check-and-document-imaging/low-to-mid-volume-item-processing/ncr-itran-3000t-imaging-transport" # More Info # http://www.ncr.com/documents/itran_3000t_ds.pdf # Matches # matches [ # Version Detection { :version=>/<html><title>Infinity Site Configuration<\/title>\s+<body bgcolor=white link=blue text=black vlink=maroon>\s+<center>\s+<p align=right>Version: ([^\s^<]+)<\/p>/ }, { :version=>/<html>\s+<title>Main Menu<\/title>\s+<body bgcolor=white link=blue text=black vlink=maroon>\s+<p align=right>Version: ([^\s^<]+)<\/p>/ }, # Site Name Detection { :string=>/<h1><i><font color=red>Infinity<\/font><\/i> Main Menu<\/h1>\s+<b>([^<]+)<\/b>/ }, # /setup.php # Password Detection { :url=>"/setup.php", :account=>/<input type=hidden name=setupItem\[\] value="\$cpassword"><input type=hidden name=setupTitle\[\] value="iSite Controller Password"><input name=setupValue\[\] value="([^\"^>]+)" size=40><\/td><\/tr>/ }, ] end
{ "pile_set_name": "Github" }
//////////////////////////////////////////////////////////////////////////// // // Copyright 2014 Realm Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////// import Realm extension Realm { /** Struct that describes the error codes within the Realm error domain. The values can be used to catch a variety of _recoverable_ errors, especially those happening when initializing a Realm instance. ```swift let realm: Realm? do { realm = try Realm() } catch Realm.Error.incompatibleLockFile { print("Realm Browser app may be attached to Realm on device?") } ``` */ public struct Error { public typealias Code = RLMError.Code /// Error thrown by Realm if no other specific error is returned when a realm is opened. public static let fail: Code = .fail /// Error thrown by Realm for any I/O related exception scenarios when a realm is opened. public static let fileAccess: Code = .fileAccess /// Error thrown by Realm if the user does not have permission to open or create /// the specified file in the specified access mode when the realm is opened. public static let filePermissionDenied: Code = .filePermissionDenied /// Error thrown by Realm if the file already exists when a copy should be written. public static let fileExists: Code = .fileExists /// Error thrown by Realm if no file was found when a realm was opened as /// read-only or if the directory part of the specified path was not found /// when a copy should be written. public static let fileNotFound: Code = .fileNotFound /// Error thrown by Realm if the database file is currently open in another process which /// cannot share with the current process due to an architecture mismatch. public static let incompatibleLockFile: Code = .incompatibleLockFile /// Error thrown by Realm if a file format upgrade is required to open the file, /// but upgrades were explicitly disabled. public static let fileFormatUpgradeRequired: Code = .fileFormatUpgradeRequired /// Error thrown by Realm if there is insufficient available address space. public static let addressSpaceExhausted: Code = .addressSpaceExhausted /// Error thrown by Realm if there is a schema version mismatch, so that a migration is required. public static let schemaMismatch: Code = .schemaMismatch /// Error thrown by Realm when attempting to open an incompatible synchronized Realm file. /// /// This error occurs when the Realm file was created with an older version of Realm and an automatic /// migration to the current version is not possible. When such an error occurs, the original file is moved /// to a backup location, and future attempts to open the synchronized Realm will result in a new file being /// created. If you wish to migrate any data from the backup Realm, you can open it using the provided /// Realm configuration. public static let incompatibleSyncedFile: Code = .incompatibleSyncedFile /// :nodoc: public var code: Code { return (_nsError as! RLMError).code } /// :nodoc: public let _nsError: NSError /// :nodoc: public init(_nsError error: NSError) { _nsError = error } /// Realm configuration that can be used to open the backup copy of a Realm file /// //// Only applicable to `incompatibleSyncedFile`. Will be `nil` for all other errors. public var backupConfiguration: Realm.Configuration? { let configuration = userInfo[RLMBackupRealmConfigurationErrorKey] as! RLMRealmConfiguration? return configuration.map(Realm.Configuration.fromRLMRealmConfiguration) } } } /// :nodoc: // Provide bridging from errors with domain RLMErrorDomain to Error. extension Realm.Error: _BridgedStoredNSError { /// :nodoc: public static let _nsErrorDomain = RLMErrorDomain /// :nodoc: public static let errorDomain = RLMErrorDomain } // MARK: Equatable extension Realm.Error: Equatable {} /// Returns a Boolean indicating whether the errors are identical. public func == (lhs: Error, rhs: Error) -> Bool { return lhs._code == rhs._code && lhs._domain == rhs._domain } // MARK: Pattern Matching /** Pattern matching matching for `Realm.Error`, so that the instances can be used with Swift's `do { ... } catch { ... }` syntax. */ public func ~= (lhs: Realm.Error, rhs: Error) -> Bool { return lhs == rhs }
{ "pile_set_name": "Github" }
/** * \file ecp.h * * \brief This file provides an API for Elliptic Curves over GF(P) (ECP). * * The use of ECP in cryptography and TLS is defined in * <em>Standards for Efficient Cryptography Group (SECG): SEC1 * Elliptic Curve Cryptography</em> and * <em>RFC-4492: Elliptic Curve Cryptography (ECC) Cipher Suites * for Transport Layer Security (TLS)</em>. * * <em>RFC-2409: The Internet Key Exchange (IKE)</em> defines ECP * group types. * */ /* * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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. * * This file is part of Mbed TLS (https://tls.mbed.org) */ #ifndef MBEDTLS_ECP_H #define MBEDTLS_ECP_H #include "bignum.h" /* * ECP error codes */ #define MBEDTLS_ERR_ECP_BAD_INPUT_DATA -0x4F80 /**< Bad input parameters to function. */ #define MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL -0x4F00 /**< The buffer is too small to write to. */ #define MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE -0x4E80 /**< The requested feature is not available, for example, the requested curve is not supported. */ #define MBEDTLS_ERR_ECP_VERIFY_FAILED -0x4E00 /**< The signature is not valid. */ #define MBEDTLS_ERR_ECP_ALLOC_FAILED -0x4D80 /**< Memory allocation failed. */ #define MBEDTLS_ERR_ECP_RANDOM_FAILED -0x4D00 /**< Generation of random value, such as ephemeral key, failed. */ #define MBEDTLS_ERR_ECP_INVALID_KEY -0x4C80 /**< Invalid private or public key. */ #define MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH -0x4C00 /**< The buffer contains a valid signature followed by more data. */ #define MBEDTLS_ERR_ECP_HW_ACCEL_FAILED -0x4B80 /**< The ECP hardware accelerator failed. */ #ifdef __cplusplus extern "C" { #endif /** * Domain-parameter identifiers: curve, subgroup, and generator. * * \note Only curves over prime fields are supported. * * \warning This library does not support validation of arbitrary domain * parameters. Therefore, only standardized domain parameters from trusted * sources should be used. See mbedtls_ecp_group_load(). */ typedef enum { MBEDTLS_ECP_DP_NONE = 0, /*!< Curve not defined. */ MBEDTLS_ECP_DP_SECP192R1, /*!< Domain parameters for the 192-bit curve defined by FIPS 186-4 and SEC1. */ MBEDTLS_ECP_DP_SECP224R1, /*!< Domain parameters for the 224-bit curve defined by FIPS 186-4 and SEC1. */ MBEDTLS_ECP_DP_SECP256R1, /*!< Domain parameters for the 256-bit curve defined by FIPS 186-4 and SEC1. */ MBEDTLS_ECP_DP_SECP384R1, /*!< Domain parameters for the 384-bit curve defined by FIPS 186-4 and SEC1. */ MBEDTLS_ECP_DP_SECP521R1, /*!< Domain parameters for the 521-bit curve defined by FIPS 186-4 and SEC1. */ MBEDTLS_ECP_DP_BP256R1, /*!< Domain parameters for 256-bit Brainpool curve. */ MBEDTLS_ECP_DP_BP384R1, /*!< Domain parameters for 384-bit Brainpool curve. */ MBEDTLS_ECP_DP_BP512R1, /*!< Domain parameters for 512-bit Brainpool curve. */ MBEDTLS_ECP_DP_CURVE25519, /*!< Domain parameters for Curve25519. */ MBEDTLS_ECP_DP_SECP192K1, /*!< Domain parameters for 192-bit "Koblitz" curve. */ MBEDTLS_ECP_DP_SECP224K1, /*!< Domain parameters for 224-bit "Koblitz" curve. */ MBEDTLS_ECP_DP_SECP256K1, /*!< Domain parameters for 256-bit "Koblitz" curve. */ MBEDTLS_ECP_DP_CURVE448, /*!< Domain parameters for Curve448. */ } mbedtls_ecp_group_id; /** * The number of supported curves, plus one for #MBEDTLS_ECP_DP_NONE. * * \note Montgomery curves are currently excluded. */ #define MBEDTLS_ECP_DP_MAX 12 /** * Curve information, for use by other modules. */ typedef struct mbedtls_ecp_curve_info { mbedtls_ecp_group_id grp_id; /*!< An internal identifier. */ uint16_t tls_id; /*!< The TLS NamedCurve identifier. */ uint16_t bit_size; /*!< The curve size in bits. */ const char *name; /*!< A human-friendly name. */ } mbedtls_ecp_curve_info; /** * \brief The ECP point structure, in Jacobian coordinates. * * \note All functions expect and return points satisfying * the following condition: <code>Z == 0</code> or * <code>Z == 1</code>. Other values of \p Z are * used only by internal functions. * The point is zero, or "at infinity", if <code>Z == 0</code>. * Otherwise, \p X and \p Y are its standard (affine) * coordinates. */ typedef struct mbedtls_ecp_point { mbedtls_mpi X; /*!< The X coordinate of the ECP point. */ mbedtls_mpi Y; /*!< The Y coordinate of the ECP point. */ mbedtls_mpi Z; /*!< The Z coordinate of the ECP point. */ } mbedtls_ecp_point; #if !defined(MBEDTLS_ECP_ALT) /* * default mbed TLS elliptic curve arithmetic implementation * * (in case MBEDTLS_ECP_ALT is defined then the developer has to provide an * alternative implementation for the whole module and it will replace this * one.) */ /** * \brief The ECP group structure. * * We consider two types of curve equations: * <ul><li>Short Weierstrass: <code>y^2 = x^3 + A x + B mod P</code> * (SEC1 + RFC-4492)</li> * <li>Montgomery: <code>y^2 = x^3 + A x^2 + x mod P</code> (Curve25519, * Curve448)</li></ul> * In both cases, the generator (\p G) for a prime-order subgroup is fixed. * * For Short Weierstrass, this subgroup is the whole curve, and its * cardinality is denoted by \p N. Our code requires that \p N is an * odd prime as mbedtls_ecp_mul() requires an odd number, and * mbedtls_ecdsa_sign() requires that it is prime for blinding purposes. * * For Montgomery curves, we do not store \p A, but <code>(A + 2) / 4</code>, * which is the quantity used in the formulas. Additionally, \p nbits is * not the size of \p N but the required size for private keys. * * If \p modp is NULL, reduction modulo \p P is done using a generic algorithm. * Otherwise, \p modp must point to a function that takes an \p mbedtls_mpi in the * range of <code>0..2^(2*pbits)-1</code>, and transforms it in-place to an integer * which is congruent mod \p P to the given MPI, and is close enough to \p pbits * in size, so that it may be efficiently brought in the 0..P-1 range by a few * additions or subtractions. Therefore, it is only an approximative modular * reduction. It must return 0 on success and non-zero on failure. * */ typedef struct mbedtls_ecp_group { mbedtls_ecp_group_id id; /*!< An internal group identifier. */ mbedtls_mpi P; /*!< The prime modulus of the base field. */ mbedtls_mpi A; /*!< For Short Weierstrass: \p A in the equation. For Montgomery curves: <code>(A + 2) / 4</code>. */ mbedtls_mpi B; /*!< For Short Weierstrass: \p B in the equation. For Montgomery curves: unused. */ mbedtls_ecp_point G; /*!< The generator of the subgroup used. */ mbedtls_mpi N; /*!< The order of \p G. */ size_t pbits; /*!< The number of bits in \p P.*/ size_t nbits; /*!< For Short Weierstrass: The number of bits in \p P. For Montgomery curves: the number of bits in the private keys. */ unsigned int h; /*!< \internal 1 if the constants are static. */ int (*modp)(mbedtls_mpi *); /*!< The function for fast pseudo-reduction mod \p P (see above).*/ int (*t_pre)(mbedtls_ecp_point *, void *); /*!< Unused. */ int (*t_post)(mbedtls_ecp_point *, void *); /*!< Unused. */ void *t_data; /*!< Unused. */ mbedtls_ecp_point *T; /*!< Pre-computed points for ecp_mul_comb(). */ size_t T_size; /*!< The number of pre-computed points. */ } mbedtls_ecp_group; /** * \name SECTION: Module settings * * The configuration options you can set for this module are in this section. * Either change them in config.h, or define them using the compiler command line. * \{ */ #if !defined(MBEDTLS_ECP_MAX_BITS) /** * The maximum size of the groups, that is, of \c N and \c P. */ #define MBEDTLS_ECP_MAX_BITS 521 /**< The maximum size of groups, in bits. */ #endif #define MBEDTLS_ECP_MAX_BYTES ( ( MBEDTLS_ECP_MAX_BITS + 7 ) / 8 ) #define MBEDTLS_ECP_MAX_PT_LEN ( 2 * MBEDTLS_ECP_MAX_BYTES + 1 ) #if !defined(MBEDTLS_ECP_WINDOW_SIZE) /* * Maximum "window" size used for point multiplication. * Default: 6. * Minimum value: 2. Maximum value: 7. * * Result is an array of at most ( 1 << ( MBEDTLS_ECP_WINDOW_SIZE - 1 ) ) * points used for point multiplication. This value is directly tied to EC * peak memory usage, so decreasing it by one should roughly cut memory usage * by two (if large curves are in use). * * Reduction in size may reduce speed, but larger curves are impacted first. * Sample performances (in ECDHE handshakes/s, with FIXED_POINT_OPTIM = 1): * w-size: 6 5 4 3 2 * 521 145 141 135 120 97 * 384 214 209 198 177 146 * 256 320 320 303 262 226 * 224 475 475 453 398 342 * 192 640 640 633 587 476 */ #define MBEDTLS_ECP_WINDOW_SIZE 6 /**< The maximum window size used. */ #endif /* MBEDTLS_ECP_WINDOW_SIZE */ #if !defined(MBEDTLS_ECP_FIXED_POINT_OPTIM) /* * Trade memory for speed on fixed-point multiplication. * * This speeds up repeated multiplication of the generator (that is, the * multiplication in ECDSA signatures, and half of the multiplications in * ECDSA verification and ECDHE) by a factor roughly 3 to 4. * * The cost is increasing EC peak memory usage by a factor roughly 2. * * Change this value to 0 to reduce peak memory usage. */ #define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up. */ #endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ /* \} name SECTION: Module settings */ #else /* MBEDTLS_ECP_ALT */ #include "ecp_alt.h" #endif /* MBEDTLS_ECP_ALT */ /** * \brief The ECP key-pair structure. * * A generic key-pair that may be used for ECDSA and fixed ECDH, for example. * * \note Members are deliberately in the same order as in the * ::mbedtls_ecdsa_context structure. */ typedef struct mbedtls_ecp_keypair { mbedtls_ecp_group grp; /*!< Elliptic curve and base point */ mbedtls_mpi d; /*!< our secret value */ mbedtls_ecp_point Q; /*!< our public value */ } mbedtls_ecp_keypair; /* * Point formats, from RFC 4492's enum ECPointFormat */ #define MBEDTLS_ECP_PF_UNCOMPRESSED 0 /**< Uncompressed point format. */ #define MBEDTLS_ECP_PF_COMPRESSED 1 /**< Compressed point format. */ /* * Some other constants from RFC 4492 */ #define MBEDTLS_ECP_TLS_NAMED_CURVE 3 /**< The named_curve of ECCurveType. */ /** * \brief This function retrieves the information defined in * mbedtls_ecp_curve_info() for all supported curves in order * of preference. * * \return A statically allocated array. The last entry is 0. */ const mbedtls_ecp_curve_info *mbedtls_ecp_curve_list( void ); /** * \brief This function retrieves the list of internal group * identifiers of all supported curves in the order of * preference. * * \return A statically allocated array, * terminated with MBEDTLS_ECP_DP_NONE. */ const mbedtls_ecp_group_id *mbedtls_ecp_grp_id_list( void ); /** * \brief This function retrieves curve information from an internal * group identifier. * * \param grp_id An \c MBEDTLS_ECP_DP_XXX value. * * \return The associated curve information on success. * \return NULL on failure. */ const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_grp_id( mbedtls_ecp_group_id grp_id ); /** * \brief This function retrieves curve information from a TLS * NamedCurve value. * * \param tls_id An \c MBEDTLS_ECP_DP_XXX value. * * \return The associated curve information on success. * \return NULL on failure. */ const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_tls_id( uint16_t tls_id ); /** * \brief This function retrieves curve information from a * human-readable name. * * \param name The human-readable name. * * \return The associated curve information on success. * \return NULL on failure. */ const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_name( const char *name ); /** * \brief This function initializes a point as zero. * * \param pt The point to initialize. */ void mbedtls_ecp_point_init( mbedtls_ecp_point *pt ); /** * \brief This function initializes an ECP group context * without loading any domain parameters. * * \note After this function is called, domain parameters * for various ECP groups can be loaded through the * mbedtls_ecp_load() or mbedtls_ecp_tls_read_group() * functions. */ void mbedtls_ecp_group_init( mbedtls_ecp_group *grp ); /** * \brief This function initializes a key pair as an invalid one. * * \param key The key pair to initialize. */ void mbedtls_ecp_keypair_init( mbedtls_ecp_keypair *key ); /** * \brief This function frees the components of a point. * * \param pt The point to free. */ void mbedtls_ecp_point_free( mbedtls_ecp_point *pt ); /** * \brief This function frees the components of an ECP group. * \param grp The group to free. */ void mbedtls_ecp_group_free( mbedtls_ecp_group *grp ); /** * \brief This function frees the components of a key pair. * \param key The key pair to free. */ void mbedtls_ecp_keypair_free( mbedtls_ecp_keypair *key ); /** * \brief This function copies the contents of point \p Q into * point \p P. * * \param P The destination point. * \param Q The source point. * * \return \c 0 on success. * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. */ int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q ); /** * \brief This function copies the contents of group \p src into * group \p dst. * * \param dst The destination group. * \param src The source group. * * \return \c 0 on success. * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. */ int mbedtls_ecp_group_copy( mbedtls_ecp_group *dst, const mbedtls_ecp_group *src ); /** * \brief This function sets a point to zero. * * \param pt The point to set. * * \return \c 0 on success. * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. */ int mbedtls_ecp_set_zero( mbedtls_ecp_point *pt ); /** * \brief This function checks if a point is zero. * * \param pt The point to test. * * \return \c 1 if the point is zero. * \return \c 0 if the point is non-zero. */ int mbedtls_ecp_is_zero( mbedtls_ecp_point *pt ); /** * \brief This function compares two points. * * \note This assumes that the points are normalized. Otherwise, * they may compare as "not equal" even if they are. * * \param P The first point to compare. * \param Q The second point to compare. * * \return \c 0 if the points are equal. * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the points are not equal. */ int mbedtls_ecp_point_cmp( const mbedtls_ecp_point *P, const mbedtls_ecp_point *Q ); /** * \brief This function imports a non-zero point from two ASCII * strings. * * \param P The destination point. * \param radix The numeric base of the input. * \param x The first affine coordinate, as a null-terminated string. * \param y The second affine coordinate, as a null-terminated string. * * \return \c 0 on success. * \return An \c MBEDTLS_ERR_MPI_XXX error code on failure. */ int mbedtls_ecp_point_read_string( mbedtls_ecp_point *P, int radix, const char *x, const char *y ); /** * \brief This function exports a point into unsigned binary data. * * \param grp The group to which the point should belong. * \param P The point to export. * \param format The point format. Should be an \c MBEDTLS_ECP_PF_XXX macro. * \param olen The length of the output. * \param buf The output buffer. * \param buflen The length of the output buffer. * * \return \c 0 on success. * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA * or #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL on failure. */ int mbedtls_ecp_point_write_binary( const mbedtls_ecp_group *grp, const mbedtls_ecp_point *P, int format, size_t *olen, unsigned char *buf, size_t buflen ); /** * \brief This function imports a point from unsigned binary data. * * \note This function does not check that the point actually * belongs to the given group, see mbedtls_ecp_check_pubkey() * for that. * * \param grp The group to which the point should belong. * \param P The point to import. * \param buf The input buffer. * \param ilen The length of the input. * * \return \c 0 on success. * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid. * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. * \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the point format * is not implemented. * */ int mbedtls_ecp_point_read_binary( const mbedtls_ecp_group *grp, mbedtls_ecp_point *P, const unsigned char *buf, size_t ilen ); /** * \brief This function imports a point from a TLS ECPoint record. * * \note On function return, \p buf is updated to point to immediately * after the ECPoint record. * * \param grp The ECP group used. * \param pt The destination point. * \param buf The address of the pointer to the start of the input buffer. * \param len The length of the buffer. * * \return \c 0 on success. * \return An \c MBEDTLS_ERR_MPI_XXX error code on initialization failure. * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid. */ int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt, const unsigned char **buf, size_t len ); /** * \brief This function exports a point as a TLS ECPoint record. * * \param grp The ECP group used. * \param pt The point format to export to. The point format is an * \c MBEDTLS_ECP_PF_XXX constant. * \param format The export format. * \param olen The length of the data written. * \param buf The buffer to write to. * \param blen The length of the buffer. * * \return \c 0 on success. * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA or * #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL on failure. */ int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp, const mbedtls_ecp_point *pt, int format, size_t *olen, unsigned char *buf, size_t blen ); /** * \brief This function sets a group using standardized domain parameters. * * \note The index should be a value of the NamedCurve enum, * as defined in <em>RFC-4492: Elliptic Curve Cryptography * (ECC) Cipher Suites for Transport Layer Security (TLS)</em>, * usually in the form of an \c MBEDTLS_ECP_DP_XXX macro. * * \param grp The destination group. * \param id The identifier of the domain parameter set to load. * * \return \c 0 on success, * \return An \c MBEDTLS_ERR_MPI_XXX error code on initialization failure. * \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE for unkownn groups. */ int mbedtls_ecp_group_load( mbedtls_ecp_group *grp, mbedtls_ecp_group_id id ); /** * \brief This function sets a group from a TLS ECParameters record. * * \note \p buf is updated to point right after the ECParameters record * on exit. * * \param grp The destination group. * \param buf The address of the pointer to the start of the input buffer. * \param len The length of the buffer. * * \return \c 0 on success. * \return An \c MBEDTLS_ERR_MPI_XXX error code on initialization failure. * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid. */ int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp, const unsigned char **buf, size_t len ); /** * \brief This function writes the TLS ECParameters record for a group. * * \param grp The ECP group used. * \param olen The number of Bytes written. * \param buf The buffer to write to. * \param blen The length of the buffer. * * \return \c 0 on success. * \return #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL on failure. */ int mbedtls_ecp_tls_write_group( const mbedtls_ecp_group *grp, size_t *olen, unsigned char *buf, size_t blen ); /** * \brief This function performs multiplication of a point by * an integer: \p R = \p m * \p P. * * It is not thread-safe to use same group in multiple threads. * * \note To prevent timing attacks, this function * executes the exact same sequence of base-field * operations for any valid \p m. It avoids any if-branch or * array index depending on the value of \p m. * * \note If \p f_rng is not NULL, it is used to randomize * intermediate results to prevent potential timing attacks * targeting these results. We recommend always providing * a non-NULL \p f_rng. The overhead is negligible. * * \param grp The ECP group. * \param R The destination point. * \param m The integer by which to multiply. * \param P The point to multiply. * \param f_rng The RNG function. * \param p_rng The RNG context. * * \return \c 0 on success. * \return #MBEDTLS_ERR_ECP_INVALID_KEY if \p m is not a valid private * key, or \p P is not a valid public key. * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. */ int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, const mbedtls_mpi *m, const mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); /** * \brief This function performs multiplication and addition of two * points by integers: \p R = \p m * \p P + \p n * \p Q * * It is not thread-safe to use same group in multiple threads. * * \note In contrast to mbedtls_ecp_mul(), this function does not * guarantee a constant execution flow and timing. * * \param grp The ECP group. * \param R The destination point. * \param m The integer by which to multiply \p P. * \param P The point to multiply by \p m. * \param n The integer by which to multiply \p Q. * \param Q The point to be multiplied by \p n. * * \return \c 0 on success. * \return #MBEDTLS_ERR_ECP_INVALID_KEY if \p m or \p n are not * valid private keys, or \p P or \p Q are not valid public * keys. * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. */ int mbedtls_ecp_muladd( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, const mbedtls_mpi *m, const mbedtls_ecp_point *P, const mbedtls_mpi *n, const mbedtls_ecp_point *Q ); /** * \brief This function checks that a point is a valid public key * on this curve. * * It only checks that the point is non-zero, has * valid coordinates and lies on the curve. It does not verify * that it is indeed a multiple of \p G. This additional * check is computationally more expensive, is not required * by standards, and should not be necessary if the group * used has a small cofactor. In particular, it is useless for * the NIST groups which all have a cofactor of 1. * * \note This function uses bare components rather than an * ::mbedtls_ecp_keypair structure, to ease use with other * structures, such as ::mbedtls_ecdh_context or * ::mbedtls_ecdsa_context. * * \param grp The curve the point should lie on. * \param pt The point to check. * * \return \c 0 if the point is a valid public key. * \return #MBEDTLS_ERR_ECP_INVALID_KEY on failure. */ int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp, const mbedtls_ecp_point *pt ); /** * \brief This function checks that an \p mbedtls_mpi is a valid private * key for this curve. * * \note This function uses bare components rather than an * ::mbedtls_ecp_keypair structure to ease use with other * structures, such as ::mbedtls_ecdh_context or * ::mbedtls_ecdsa_context. * * \param grp The group used. * \param d The integer to check. * * \return \c 0 if the point is a valid private key. * \return #MBEDTLS_ERR_ECP_INVALID_KEY on failure. */ int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp, const mbedtls_mpi *d ); /** * \brief This function generates a keypair with a configurable base * point. * * \note This function uses bare components rather than an * ::mbedtls_ecp_keypair structure to ease use with other * structures, such as ::mbedtls_ecdh_context or * ::mbedtls_ecdsa_context. * * \param grp The ECP group. * \param G The chosen base point. * \param d The destination MPI (secret part). * \param Q The destination point (public part). * \param f_rng The RNG function. * \param p_rng The RNG context. * * \return \c 0 on success. * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code * on failure. */ int mbedtls_ecp_gen_keypair_base( mbedtls_ecp_group *grp, const mbedtls_ecp_point *G, mbedtls_mpi *d, mbedtls_ecp_point *Q, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); /** * \brief This function generates an ECP keypair. * * \note This function uses bare components rather than an * ::mbedtls_ecp_keypair structure to ease use with other * structures, such as ::mbedtls_ecdh_context or * ::mbedtls_ecdsa_context. * * \param grp The ECP group. * \param d The destination MPI (secret part). * \param Q The destination point (public part). * \param f_rng The RNG function. * \param p_rng The RNG context. * * \return \c 0 on success. * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code * on failure. */ int mbedtls_ecp_gen_keypair( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); /** * \brief This function generates an ECP key. * * \param grp_id The ECP group identifier. * \param key The destination key. * \param f_rng The RNG function. * \param p_rng The RNG context. * * \return \c 0 on success. * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code * on failure. */ int mbedtls_ecp_gen_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); /** * \brief This function checks that the keypair objects * \p pub and \p prv have the same group and the * same public point, and that the private key in * \p prv is consistent with the public key. * * \param pub The keypair structure holding the public key. * If it contains a private key, that part is ignored. * \param prv The keypair structure holding the full keypair. * * \return \c 0 on success, meaning that the keys are valid and match. * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the keys are invalid or do not match. * \return An \c MBEDTLS_ERR_ECP_XXX or an \c MBEDTLS_ERR_MPI_XXX * error code on calculation failure. */ int mbedtls_ecp_check_pub_priv( const mbedtls_ecp_keypair *pub, const mbedtls_ecp_keypair *prv ); #if defined(MBEDTLS_SELF_TEST) /** * \brief The ECP checkup routine. * * \return \c 0 on success. * \return \c 1 on failure. */ int mbedtls_ecp_self_test( int verbose ); #endif /* MBEDTLS_SELF_TEST */ #ifdef __cplusplus } #endif #endif /* ecp.h */
{ "pile_set_name": "Github" }
VLCSource="VLC-відео" Playlist="Список відтворення" LoopPlaylist="Повтор списку відтворення" Shuffle="Перемішати список відтворення" PlaybackBehavior="Видимість та відтворення" PlaybackBehavior.StopRestart="Зупинити, коли не видимий. Грати з початку, коли видимий" PlaybackBehavior.PauseUnpause="Призупинити, коли не видимий. Грати далі, коли видимий" PlaybackBehavior.AlwaysPlay="Завжди грати навіть тоді, коли не видимий" NetworkCaching="Кешування мережевого контенту (мс)" PlayPause="Відтворення / Пауза" Restart="Грати з початку" Stop="Зупинити" PlaylistNext="Наступний" PlaylistPrev="Попередній" AudioTrack="Аудіо доріжка" SubtitleTrack="Доріжка субтитрів" SubtitleEnable="Увімкнути субтитри"
{ "pile_set_name": "Github" }
COMMONMODULES = unixatomic.o uadeipc.o amifilemagic.o \ eagleplayer.o unixwalkdir.o effects.o \ uadecontrol.o uadeconf.o uadestate.o uadeutils.o md5.o \ ossupport.o rmc.o songdb.o songinfo.o vparray.o support.o fifo.o PLAYERHEADERS = ../include/uade/eagleplayer.h ../include/uade/uadeconf.h ../include/uade/uadeconfstructure.h ../include/uade/uadestate.h ../common/support.h ../include/uade/options.h ../include/uade/uadeutils.h ../include/uade/unixatomic.h ../include/uade/ossupport.h ../include/uade/unixsupport.h ../include/uade/uadeipc.h amifilemagic.o: ../common/amifilemagic.c ../include/uade/amifilemagic.h $(PLAYERHEADERS) $(CC) $(CFLAGS) -c $< eagleplayer.o: ../common/eagleplayer.c ../include/uade/amifilemagic.h ../include/uade/songdb.h $(PLAYERHEADERS) $(CC) $(CFLAGS) -c $< effects.o: ../common/effects.c ../include/uade/effects.h $(CC) $(CFLAGS) -c $< md5.o: ../common/md5.c ../common/md5.h $(CC) $(CFLAGS) -c $< ossupport.o: ../common/ossupport.c ../include/uade/ossupport.h ../include/uade/unixsupport.h ../include/uade/uadeipc.h $(CC) $(CFLAGS) -c $< rmc.o: ../common/rmc.c ../include/uade/rmc.h $(CC) $(CFLAGS) -c $< songdb.o: ../common/songdb.c ../include/uade/songdb.h ../common/md5.h $(PLAYERHEADERS) $(CC) $(CFLAGS) -c $< songinfo.o: ../common/songinfo.c ../include/uade/amifilemagic.h $(PLAYERHEADERS) $(CC) $(CFLAGS) -c $< uadeconf.o: ../common/uadeconf.c $(PLAYERHEADERS) $(CC) $(CFLAGS) -c $< uadecontrol.o: ../common/uadecontrol.c ../include/uade/uadecontrol.h $(PLAYERHEADERS) $(CC) $(CFLAGS) -c $< uadestate.o: ../common/uadestate.c $(PLAYERHEADERS) $(CC) $(CFLAGS) -c $< uadeipc.o: ../common/uadeipc.c ../include/uade/uadeipc.h ../include/uade/uadeutils.h $(CC) $(CFLAGS) -c $< uadeutils.o: ../common/uadeutils.c ../include/uade/uadeutils.h $(CC) $(CFLAGS) -c $< unixatomic.o: ../common/unixatomic.c ../include/uade/unixatomic.h $(CC) $(CFLAGS) -c $< unixwalkdir.o: ../common/unixwalkdir.c ../common/unixwalkdir.h $(CC) $(CFLAGS) -c $< vparray.o: ../common/vparray.c ../include/uade/vparray.h $(CC) $(CFLAGS) -c $< support.o: ../common/support.c ../common/support.h ../include/uade/ossupport.h ../include/uade/unixsupport.h $(CC) $(CFLAGS) -c $< fifo.o: ../common/fifo.c ../common/fifo.h $(CC) $(CFLAGS) -c $<
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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. # PS3 Remote and Controller Keymaps keymap_remote = { "16": 'power' ,#EJECT "64": None ,#AUDIO "65": None ,#ANGLE "63": 'subtitle' ,#SUBTITLE "0f": None ,#CLEAR "28": None ,#TIME "00": 'one' ,#1 "01": 'two' ,#2 "02": 'three' ,#3 "03": 'four' ,#4 "04": 'five' ,#5 "05": 'six' ,#6 "06": 'seven' ,#7 "07": 'eight' ,#8 "08": 'nine' ,#9 "09": 'zero' ,#0 "81": 'mytv' ,#RED "82": 'mymusic' ,#GREEN "80": 'mypictures' ,#BLUE "83": 'myvideo' ,#YELLOW "70": 'display' ,#DISPLAY "1a": None ,#TOP MENU "40": 'menu' ,#POP UP/MENU "0e": None ,#RETURN "5c": 'menu' ,#OPTIONS/TRIANGLE "5d": 'back' ,#BACK/CIRCLE "5e": 'info' ,#X "5f": 'title' ,#VIEW/SQUARE "54": 'up' ,#UP "55": 'right' ,#RIGHT "56": 'down' ,#DOWN "57": 'left' ,#LEFT "0b": 'select' ,#ENTER "5a": 'volumeplus' ,#L1 "58": 'volumeminus' ,#L2 "51": 'Mute' ,#L3 "5b": 'pageplus' ,#R1 "59": 'pageminus' ,#R2 "52": None ,#R3 "43": None ,#PLAYSTATION "50": None ,#SELECT "53": None ,#START "33": 'reverse' ,#<-SCAN "34": 'forward' ,# SCAN-> "30": 'skipminus' ,#PREV "31": 'skipplus' ,#NEXT "60": None ,#<-SLOW/STEP "61": None ,# SLOW/STEP-> "32": 'play' ,#PLAY "38": 'stop' ,#STOP "39": 'pause' ,#PAUSE }
{ "pile_set_name": "Github" }
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee180e88926"> <name type="corporate"> <namePart>United States Government Printing Office</namePart> <role> <roleTerm type="text" authority="marcrelator">printer</roleTerm> <roleTerm type="code" authority="marcrelator">prt</roleTerm> </role> <role> <roleTerm type="text" authority="marcrelator">distributor</roleTerm> <roleTerm type="code" authority="marcrelator">dst</roleTerm> </role> </name> <name type="corporate"> <namePart>United States</namePart> <namePart>United States Court of Appeals for the Eighth Circuit</namePart> <role> <roleTerm type="text" authority="marcrelator">author</roleTerm> <roleTerm type="code" authority="marcrelator">aut</roleTerm> </role> <description>Government Organization</description> </name> <typeOfResource>text</typeOfResource> <genre authority="marcgt">government publication</genre> <language> <languageTerm authority="iso639-2b" type="code">eng</languageTerm> </language> <extension> <collectionCode>USCOURTS</collectionCode> <category>Judicial Publications</category> <branch>judicial</branch> <dateIngested>2011-10-14</dateIngested> </extension> <originInfo> <publisher>Administrative Office of the United States Courts</publisher> <dateIssued encoding="w3cdtf">2010-01-14</dateIssued> <issuance>monographic</issuance> </originInfo> <physicalDescription> <note type="source content type">deposited</note> <digitalOrigin>born digital</digitalOrigin> </physicalDescription> <classification authority="sudocs">JU 2.11</classification> <identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca8-08-02389</identifier> <identifier type="local">P0b002ee180e88926</identifier> <recordInfo> <recordContentSource authority="marcorg">DGPO</recordContentSource> <recordCreationDate encoding="w3cdtf">2011-10-14</recordCreationDate> <recordChangeDate encoding="w3cdtf">2011-10-14</recordChangeDate> <recordIdentifier source="DGPO">USCOURTS-ca8-08-02389</recordIdentifier> <recordOrigin>machine generated</recordOrigin> <languageOfCataloging> <languageTerm authority="iso639-2b" type="code">eng</languageTerm> </languageOfCataloging> </recordInfo> <accessCondition type="GPO scope determination">fdlp</accessCondition> <extension> <docClass>USCOURTS</docClass> <accessId>USCOURTS-ca8-08-02389</accessId> <courtType>Appellate</courtType> <courtCode>ca8</courtCode> <courtCircuit>8th</courtCircuit> <courtSortOrder>1080</courtSortOrder> <caseNumber>08-02389</caseNumber> <party firstName="Juan" fullName="Juan C. Polanco" lastName="Polanco" middleName="C." role="Appellant"></party> <party fullName="United States of America" lastName="United States of America" role="Appellee"></party> </extension> <titleInfo> <title>United States v. Juan Polanco</title> <partNumber>08-02389</partNumber> </titleInfo> <location> <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca8-08-02389/content-detail.html</url> </location> <classification authority="sudocs">JU 2.11</classification> <identifier type="preferred citation">08-02389;08-2389</identifier> <name type="corporate"> <namePart>United States Court of Appeals for the Eighth Circuit</namePart> <namePart>8th Circuit</namePart> <namePart></namePart> <affiliation>U.S. Courts</affiliation> <role> <roleTerm authority="marcrelator" type="text">author</roleTerm> <roleTerm authority="marcrelator" type="code">aut</roleTerm> </role> </name> <name type="personal"> <displayForm>Juan C. Polanco</displayForm> <namePart type="family">Polanco</namePart> <namePart type="given">Juan</namePart> <namePart type="termsOfAddress"></namePart> <description>Appellant</description> </name> <name type="personal"> <displayForm>United States of America</displayForm> <namePart type="family">United States of America</namePart> <namePart type="given"></namePart> <namePart type="termsOfAddress"></namePart> <description>Appellee</description> </name> <extension> <docClass>USCOURTS</docClass> <accessId>USCOURTS-ca8-08-02389</accessId> <courtType>Appellate</courtType> <courtCode>ca8</courtCode> <courtCircuit>8th</courtCircuit> <courtSortOrder>1080</courtSortOrder> <caseNumber>08-02389</caseNumber> <party firstName="Juan" fullName="Juan C. Polanco" lastName="Polanco" middleName="C." role="Appellant"></party> <party fullName="United States of America" lastName="United States of America" role="Appellee"></party> </extension> <relatedItem type="constituent" ID="id-USCOURTS-ca8-08-02389-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ca8-08-02389/USCOURTS-ca8-08-02389-0/mods.xml"> <titleInfo> <title>United States v. Juan Polanco</title> <subTitle>PER CURIAM OPINION FILED - THE COURT: DIANA E. MURPHY, STEVEN M. COLLOTON and BOBBY E. SHEPHERD (UNPUBLISHED) [3624321] [08-2389]</subTitle> <partNumber>0</partNumber> </titleInfo> <originInfo> <dateIssued>2010-01-14</dateIssued> </originInfo> <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ca8-08-02389-0.pdf" type="otherFormat"> <identifier type="FDsys Unique ID">D09002ee180e96df2</identifier> </relatedItem> <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ca8-08-02389/USCOURTS-ca8-08-02389-0</identifier> <identifier type="former granule identifier">ca8-08-02389_0.pdf</identifier> <location> <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ca8-08-02389/USCOURTS-ca8-08-02389-0/content-detail.html</url> <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ca8-08-02389/pdf/USCOURTS-ca8-08-02389-0.pdf</url> </location> <extension> <searchTitle>USCOURTS 08-02389; United States v. Juan Polanco; </searchTitle> <courtName>United States Court of Appeals for the Eighth Circuit</courtName> <accessId>USCOURTS-ca8-08-02389-0</accessId> <sequenceNumber>0</sequenceNumber> <dateIssued>2010-01-14</dateIssued> <docketText>PER CURIAM OPINION FILED - THE COURT: DIANA E. MURPHY, STEVEN M. COLLOTON and BOBBY E. SHEPHERD (UNPUBLISHED) [3624321] [08-2389]</docketText> </extension> </relatedItem> </mods>
{ "pile_set_name": "Github" }
## kn version Show the version of this client ### Synopsis Show the version of this client ``` kn version ``` ### Options ``` -h, --help help for version -o, --output string Output format. One of: json|yaml. ``` ### Options inherited from parent commands ``` --config string kn configuration file (default: ~/.config/kn/config.yaml) --kubeconfig string kubectl configuration file (default: ~/.kube/config) --log-http log http traffic ``` ### SEE ALSO * [kn](kn.md) - kn manages Knative Serving and Eventing resources
{ "pile_set_name": "Github" }
[android-components](../../index.md) / [mozilla.components.feature.session](../index.md) / [SessionFeature](index.md) / [start](./start.md) # start `fun start(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/feature/session/src/main/java/mozilla/components/feature/session/SessionFeature.kt#L28) Overrides [LifecycleAwareFeature.start](../../mozilla.components.support.base.feature/-lifecycle-aware-feature/start.md) Start feature: App is in the foreground.
{ "pile_set_name": "Github" }
//===- unittests/Analysis/CloneDetectionTest.cpp - Clone detection tests --===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "clang/AST/RecursiveASTVisitor.h" #include "clang/Analysis/CloneDetection.h" #include "clang/Tooling/Tooling.h" #include "gtest/gtest.h" namespace clang { namespace analysis { namespace { class CloneDetectionVisitor : public RecursiveASTVisitor<CloneDetectionVisitor> { CloneDetector &Detector; public: explicit CloneDetectionVisitor(CloneDetector &D) : Detector(D) {} bool VisitFunctionDecl(FunctionDecl *D) { Detector.analyzeCodeBody(D); return true; } }; /// Example constraint for testing purposes. /// Filters out all statements that are in a function which name starts with /// "bar". class NoBarFunctionConstraint { public: void constrain(std::vector<CloneDetector::CloneGroup> &CloneGroups) { CloneConstraint::splitCloneGroups( CloneGroups, [](const StmtSequence &A, const StmtSequence &B) { // Check if one of the sequences is in a function which name starts // with "bar". for (const StmtSequence &Arg : {A, B}) { if (const auto *D = dyn_cast<const FunctionDecl>(Arg.getContainingDecl())) { if (D->getNameAsString().find("bar") == 0) return false; } } return true; }); } }; TEST(CloneDetector, FilterFunctionsByName) { auto ASTUnit = clang::tooling::buildASTFromCode("void foo1(int &a1) { a1++; }\n" "void foo2(int &a2) { a2++; }\n" "void bar1(int &a3) { a3++; }\n" "void bar2(int &a4) { a4++; }\n"); auto TU = ASTUnit->getASTContext().getTranslationUnitDecl(); CloneDetector Detector; // Push all the function bodies into the detector. CloneDetectionVisitor Visitor(Detector); Visitor.TraverseTranslationUnitDecl(TU); // Find clones with the usual settings, but but we want to filter out // all statements from functions which names start with "bar". std::vector<CloneDetector::CloneGroup> CloneGroups; Detector.findClones(CloneGroups, NoBarFunctionConstraint(), RecursiveCloneTypeIIHashConstraint(), MinComplexityConstraint(2), MinGroupSizeConstraint(2), RecursiveCloneTypeIIVerifyConstraint(), OnlyLargestCloneConstraint()); ASSERT_EQ(CloneGroups.size(), 1u); ASSERT_EQ(CloneGroups.front().size(), 2u); for (auto &Clone : CloneGroups.front()) { const auto ND = dyn_cast<const FunctionDecl>(Clone.getContainingDecl()); ASSERT_TRUE(ND != nullptr); // Check that no function name starting with "bar" is in the results... ASSERT_TRUE(ND->getNameAsString().find("bar") != 0); } // Retry above's example without the filter... CloneGroups.clear(); Detector.findClones(CloneGroups, RecursiveCloneTypeIIHashConstraint(), MinComplexityConstraint(2), MinGroupSizeConstraint(2), RecursiveCloneTypeIIVerifyConstraint(), OnlyLargestCloneConstraint()); ASSERT_EQ(CloneGroups.size(), 1u); ASSERT_EQ(CloneGroups.front().size(), 4u); // Count how many functions with the bar prefix we have in the results. int FoundFunctionsWithBarPrefix = 0; for (auto &Clone : CloneGroups.front()) { const auto ND = dyn_cast<const FunctionDecl>(Clone.getContainingDecl()); ASSERT_TRUE(ND != nullptr); // This time check that we picked up the bar functions from above if (ND->getNameAsString().find("bar") == 0) { FoundFunctionsWithBarPrefix++; } } // We should have found the two functions bar1 and bar2. ASSERT_EQ(FoundFunctionsWithBarPrefix, 2); } } // namespace } // namespace analysis } // namespace clang
{ "pile_set_name": "Github" }
echo:[]string{} echo:[]string{"-n"} echo:[]string{"foo"} echo:[]string{"foo", "bar"} echo:[]string{"-n", "foo"} echo:[]string{"-e", "foo\\nbar"} echo:[]string{"-n", "-e", "foo\\nbar"} echo:[]string{"foo", "-n"} echo:[]string{"foo", "-n", "-e"} echo:[]string{"-------"} echo:[]string{"*"} echo:[]string{"*"}
{ "pile_set_name": "Github" }
/* Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved * written by Walter Bright * http://www.digitalmars.com * Distributed under the Boost Software License, Version 1.0. * http://www.boost.org/LICENSE_1_0.txt * https://github.com/dlang/dmd/blob/master/src/dmd/root/filename.h */ #pragma once #include "array.h" #include "dcompat.h" typedef Array<const char *> Strings; struct FileName { private: DString str; public: static bool equals(const char *name1, const char *name2); static bool absolute(const char *name); static const char *toAbsolute(const char *name, const char *base = NULL); static const char *ext(const char *); const char *ext(); static const char *removeExt(const char *str); static const char *name(const char *); const char *name(); static const char *path(const char *); static const char *combine(const char *path, const char *name); static Strings *splitPath(const char *path); static const char *defaultExt(const char *name, const char *ext); static const char *forceExt(const char *name, const char *ext); static bool equalsExt(const char *name, const char *ext); bool equalsExt(const char *ext); static const char *searchPath(Strings *path, const char *name, bool cwd); static const char *safeSearchPath(Strings *path, const char *name); static int exists(const char *name); static bool ensurePathExists(const char *path); static const char *canonicalName(const char *name); static void free(const char *str); const char *toChars() const; #if IN_LLVM void reset(const char *str); #endif };
{ "pile_set_name": "Github" }
{{- if .Values.kubecostProductConfigs }} {{- if .Values.kubecostProductConfigs.productKey }} {{- if .Values.kubecostProductConfigs.productKey.enabled }} apiVersion: v1 kind: ConfigMap metadata: name: product-configs labels: {{ include "cost-analyzer.commonLabels" . | nindent 4 }} data: {{- if .Values.kubecostProductConfigs.productKey.key }} key: {{ .Values.kubecostProductConfigs.productKey.key | quote }} {{- end -}} {{- end -}} {{- end -}} {{- end -}}
{ "pile_set_name": "Github" }
#include "common.h" #include "iostructs\v_detail.h" uniform float4 consts; // {1/quant,1/quant,diffusescale,ambient} uniform float4 wave; // cx,cy,cz,tm uniform float4 dir2D; //uniform float4 array [200] : register(c12); //tbuffer DetailsData //{ uniform float4 array[61*4]; //} v2p_flat _main (v_detail v) { v2p_flat O; // index int i = int(v.misc.w); float4 m0 = array[i+0]; float4 m1 = array[i+1]; float4 m2 = array[i+2]; float4 c0 = array[i+3]; // Transform pos to world coords float4 pos; pos.x = dot (m0, v.pos); pos.y = dot (m1, v.pos); pos.z = dot (m2, v.pos); pos.w = 1; // float base = m1.w; float dp = calc_cyclic (dot(pos,wave)); float H = pos.y - base; // height of vertex (scaled) float frac = v.misc.z*consts.x; // fractional float inten = H * dp; float2 result = calc_xz_wave (dir2D.xz*inten,frac); pos = float4(pos.x+result.x, pos.y, pos.z+result.y, 1); // Normal in world coords float3 norm; // = float3(0,1,0); norm.x = pos.x - m0.w ; norm.y = pos.y - m1.w + 0.75; // avoid zero norm.z = pos.z - m2.w ; // Final out float4 Pp = mul (m_WVP, pos ); O.hpos = Pp; O.N = mul (m_WV, normalize(norm) ); float3 Pe = mul (m_WV, pos ); // O.tcdh = float4 ((v.misc * consts).xy ); #if defined(USE_R2_STATIC_SUN) && !defined(USE_LM_HEMI) O.tcdh = float4 ((v.misc * consts).xyyy ); #else O.tcdh = float2 ((v.misc * consts).xyyy ); #endif # if defined(USE_R2_STATIC_SUN) O.tcdh.w = c0.x; // (,,,dir-occlusion) # endif O.position = float4 (Pe, c0.w ); return O; }
{ "pile_set_name": "Github" }
Intel Branch Trace Store ======================== Overview ======== Intel BTS could be regarded as a predecessor to Intel PT and has some similarities because it can also identify every branch a program takes. A notable difference is that Intel BTS has no timing information and as a consequence the present implementation is limited to per-thread recording. While decoding Intel BTS does not require walking the object code, the object code is still needed to pair up calls and returns correctly, consequently much of the Intel PT documentation applies also to Intel BTS. Refer to the Intel PT documentation and consider that the PMU 'intel_bts' can usually be used in place of 'intel_pt' in the examples provided, with the proviso that per-thread recording must also be stipulated i.e. the --per-thread option for 'perf record'. perf record =========== new event --------- The Intel BTS kernel driver creates a new PMU for Intel BTS. The perf record option is: -e intel_bts// Currently Intel BTS is limited to per-thread tracing so the --per-thread option is also needed. snapshot option --------------- The snapshot option is the same as Intel PT (refer Intel PT documentation). auxtrace mmap size option ----------------------- The mmap size option is the same as Intel PT (refer Intel PT documentation). perf script =========== By default, perf script will decode trace data found in the perf.data file. This can be further controlled by option --itrace. The --itrace option is the same as Intel PT (refer Intel PT documentation) except that neither "instructions" events nor "transactions" events (and consequently call chains) are supported. To disable trace decoding entirely, use the option --no-itrace. dump option ----------- perf script has an option (-D) to "dump" the events i.e. display the binary data. When -D is used, Intel BTS packets are displayed. To disable the display of Intel BTS packets, combine the -D option with --no-itrace. perf report =========== By default, perf report will decode trace data found in the perf.data file. This can be further controlled by new option --itrace exactly the same as perf script. perf inject =========== perf inject also accepts the --itrace option in which case tracing data is removed and replaced with the synthesized events. e.g. perf inject --itrace -i perf.data -o perf.data.new
{ "pile_set_name": "Github" }
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2017 Alibaba Group Holding Ltd. # # 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 inspect from .expressions import CollectionExpr, SequenceExpr, Scalar, ReprWrapper from .utils import get_attrs from ..types import DynamicSchema from .. import types from ..utils import is_source_collection def _need_to_dynamic(res): if isinstance(res, CollectionExpr) and \ not is_source_collection(res) and \ (isinstance(res._schema, DynamicSchema) or any(isinstance(t, types.Unknown) for t in res.schema.types)): return True if isinstance(res, SequenceExpr) and \ (isinstance(res.dtype, types.Unknown) or isinstance(res._source_data_type, types.Unknown)): return True if isinstance(res, Scalar) and res._value is not None and \ (isinstance(res.dtype, types.Unknown) or isinstance(res._source_value_type, types.Unknown)): return True return False def _get_base_type(res): if isinstance(res, CollectionExpr): return DynamicCollectionExpr if isinstance(res, SequenceExpr): return DynamicSequenceExpr if isinstance(res, Scalar): return DynamicScalar raise TypeError('Expr should be provided') def to_dynamic(func): def inner(*args, **kwargs): res = func(*args, **kwargs) if res is None: return if isinstance(res, DynamicMixin): return res tp = type(res) new_tp = None if _need_to_dynamic(res): base_tp = _get_base_type(res) new_tp = type(tp.__name__, (base_tp, tp), dict()) if new_tp is not None: attr_vals = dict((attr, getattr(res, attr)) for attr in get_attrs(res)) if isinstance(res, SequenceExpr) and isinstance(res.dtype, types.Unknown) and \ res.dtype.type is not None: attr_vals['_data_type'] = res.dtype.type elif isinstance(res, Scalar) and isinstance(res.dtype, types.Unknown) and \ res.dtype.type is not None: attr_vals['_value_type'] = res.dtype.type new_res = new_tp(**attr_vals) if hasattr(new_res, '_schema'): for i, col in enumerate(new_res._schema._columns): if isinstance(col.type, types.Unknown) and col.type.type is not None: new_res._schema._columns[i] = type(col)(col.name, col.type.type) return new_res return res inner.__name__ = func.__name__ inner.__doc__ = func.__doc__ return inner class DynamicMixin(object): __slots__ = () def __getattribute__(self, item): res = super(DynamicMixin, self).__getattribute__(item) if inspect.ismethod(res) or isinstance(res, ReprWrapper): # method may be wrapped as ReprWrapper return to_dynamic(res) return res def _copy_type(self): # the type which is not inherited from DynamicMixin tp = type(self) return [t for t in inspect.getmro(tp) if t.__name__ == tp.__name__ and not issubclass(t, DynamicMixin)][0] def copy(self): attr_dict = self._attr_dict() static_tp = self._copy_type() return static_tp(**attr_dict) def to_static(self): return self.rebuild() class DynamicCollectionExpr(DynamicMixin, CollectionExpr): def __init__(self, *args, **kwargs): DynamicMixin.__init__(self) CollectionExpr.__init__(self, *args, **kwargs) def _project(self, fields): # when the collection is dynamic, and select all the field, # the projected collection should be dynamic is_dynamic = False for field in fields: field = self._get_field(field) if isinstance(field, CollectionExpr) and isinstance(field, DynamicMixin): is_dynamic = True break if is_dynamic: _, raw_fields = self._get_fields(fields, ret_raw_fields=True) def func(fs): default_type = self._schema.default_type \ if isinstance(self._schema, DynamicSchema) else None expr = super(DynamicCollectionExpr, self)._project(fs) expr._raw_fields = raw_fields if not isinstance(expr._schema, DynamicSchema): expr._schema = DynamicSchema.from_schema(expr._schema, default_type=default_type) return expr res = to_dynamic(func)(fields) return res return super(DynamicCollectionExpr, self)._project(fields) class DynamicSequenceExpr(DynamicMixin, SequenceExpr): def __init__(self, *args, **kwargs): DynamicMixin.__init__(self) SequenceExpr.__init__(self, *args, **kwargs) class DynamicScalar(DynamicMixin, Scalar): def __init__(self, *args, **kwargs): DynamicMixin.__init__(self) Scalar.__init__(self, *args, **kwargs)
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <cobra document="https://github.com/wufeifei/cobra"> <name value="get_headers导致的SSRF"/> <language value="php"/> <match mode="function-param-controllable"><![CDATA[get_headers]]></match> <level value="7"/> <test> <case assert="true"><![CDATA[ $url = $_GET['url']; echo get_headers($url); ]]></case> <case assert="false"><![CDATA[ $url = 'http://www.example.com'; echo get_headers($url); ]]></case> </test> <solution> ## 安全风险 SSRF漏洞(Server-Side Request Forgery) ### 形成原理 SSRF形成的原因大都是由于服务端提供了从其他服务器应用获取数据的功能且没有对目标地址做过滤与限制。 ### 风险 1、攻击者可以对外网、服务器所在内网、本地进行端口扫描,获取服务的banner信息。 2、攻击运行在内网或本地的应用程序。 3、对内网web应用进行指纹识别。 4、攻击内外网的web应用。 5、利用file协议读取本地文件等。 ## 修复方案 1. 限制协议为HTTP、HTTPS 2. 限制请求域名白名单 3. 禁止30x跳转 ## 举例 ```php $url = $_GET['url']; echo get_headers($url);//对用户可控的参数没有进行过滤,攻击者恶意构造输入就可能导致SSRF ``` </solution> <status value="on"/> <author name="Lightless" email="root@lightless.me"/> </cobra>
{ "pile_set_name": "Github" }
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Class representing message/* MIME documents.""" __all__ = ['MIMEMessage'] from email import message from email.mime.nonmultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class representing message/* MIME documents.""" def __init__(self, _msg, _subtype='rfc822'): """Create a message/* type MIME document. _msg is a message object and must be an instance of Message, or a derived class of Message, otherwise a TypeError is raised. Optional _subtype defines the subtype of the contained message. The default is "rfc822" (this is defined by the MIME standard, even though the term "rfc822" is technically outdated by RFC 2822). """ MIMENonMultipart.__init__(self, 'message', _subtype) if not isinstance(_msg, message.Message): raise TypeError('Argument is not an instance of Message') # It's convenient to use this base class method. We need to do it # this way or we'll get an exception message.Message.attach(self, _msg) # And be sure our default type is set correctly self.set_default_type('message/rfc822')
{ "pile_set_name": "Github" }
<div itemscope itemtype="http://developers.google.com/ReferenceObject"> <meta itemprop="name" content="tfc.NonnegativeParameterizer" /> <meta itemprop="path" content="Stable" /> <meta itemprop="property" content="__call__"/> <meta itemprop="property" content="__init__"/> </div> # tfc.NonnegativeParameterizer <table class="tfo-notebook-buttons tfo-api" align="left"> <td> <a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameterizers.py"> <img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub </a> </td></table> ## Class `NonnegativeParameterizer` Object encapsulating nonnegative parameterization as needed for GDN. Inherits From: [`Parameterizer`](../tfc/Parameterizer.md) ### Aliases: * Class `tfc.python.layers.parameterizers.NonnegativeParameterizer` <!-- Placeholder for "Used in" --> The variable is subjected to an invertible transformation that slows down the learning rate for small values. <h2 id="__init__"><code>__init__</code></h2> <a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameterizers.py">View source</a> ``` python __init__( minimum=0, reparam_offset=(2 ** -18) ) ``` Initializer. #### Arguments: * <b>`minimum`</b>: Float. Lower bound for parameters (defaults to zero). * <b>`reparam_offset`</b>: Float. Offset added to the reparameterization of beta and gamma. The parameterization of beta and gamma as their square roots lets the training slow down when their values are close to zero, which is desirable as small values in the denominator can lead to a situation where gradient noise on beta/gamma leads to extreme amounts of noise in the GDN activations. However, without the offset, we would get zero gradients if any elements of beta or gamma were exactly zero, and thus the training could get stuck. To prevent this, we add this small constant. The default value was empirically determined as a good starting point. Making it bigger potentially leads to more gradient noise on the activations, making it too small may lead to numerical precision issues. ## Methods <h3 id="__call__"><code>__call__</code></h3> <a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameterizers.py">View source</a> ``` python __call__( getter, name, shape, dtype, initializer, regularizer=None ) ``` Call self as a function.
{ "pile_set_name": "Github" }
# Dockerfile FROM ubuntu:trusty # Local caches - only set those you actually have such caches #ENV apt_proxy http://10.42.44.100:3142/ #ENV http_proxy http://10.42.44.100:3128/ #ENV https_proxy http://10.42.44.100:3128/ # Arch to output ENV ARCH 64 ENV PKG_ARCH amd64 ENV PKG_VERSION 1.6.5 ENV PKG_REL 1 ENV PKG_NAME peerio-client_$PKG_VERSION-${PKG_REL}_$PKG_ARCH ENV NODE_BIN_DIR=/usr/bin ENV DEBIAN_FRONTEND=noninteractive RUN test "$apt_proxy" && echo 'Acquire::http { Proxy "$apt_proxy"; };' >/etc/apt/apt.conf.d/01proxy RUN apt-get update && apt-get install -y \ build-essential curl devscripts gcc-multilib git lsb-release make nodejs npm python-pip rsync sudo libxss1 RUN test -x $NODE_BIN_DIR/nodejs -a ! -x $NODE_BIN_DIR/node && ln -sf $NODE_BIN_DIR/nodejs $NODE_BIN_DIR/node || true RUN pip install transifex-client RUN npm install -g nw RUN git clone https://github.com/PeerioTechnologies/peerio-client /usr/src/peerio-client WORKDIR /usr/src/peerio-client RUN npm install RUN patch -p0 <debian/patch/00-build.patch RUN ./node_modules/.bin/gulp build RUN mkdir ../$PKG_NAME WORKDIR /usr/src/$PKG_NAME RUN mkdir -p DEBIAN usr/share/man/man1 usr/share/doc/peerio-client usr/bin usr/share/applications usr/share/icons/hicolor/16x16/apps usr/share/icons/hicolor/32x32/apps usr/share/icons/hicolor/48x48/apps usr/share/icons/hicolor/64x64/apps usr/share/icons/hicolor/128x128/apps RUN rsync -avWxzP /usr/src/peerio-client/build/Peerio/linux$ARCH/ usr/share/peerio-client/ ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/LICENSE.md usr/share/doc/peerio-client/LICENSE.md ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/application/img/icon16.png usr/share/icons/hicolor/16x16/apps/peerio-client.png ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/application/img/icon32.png usr/share/icons/hicolor/32x32/apps/peerio-client.png ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/application/img/icon48.png usr/share/icons/hicolor/48x48/apps/peerio-client.png ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/application/img/icon64.png usr/share/icons/hicolor/64x64/apps/peerio-client.png ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/application/img/icon128.png usr/share/icons/hicolor/128x128/apps/peerio-client.png ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/pkg/control DEBIAN/control ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/pkg/copyright usr/share/doc/peerio-client/copyright ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/pkg/peerio-client usr/bin/peerio-client ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/pkg/desktop usr/share/applications/peerio-client.desktop ADD https://raw.githubusercontent.com/PeerioTechnologies/peerio-client/master/pkg/man.1 usr/share/man/man1/peerio-client.1 RUN sed -i -e "s|/ARCH/|$PKG_ARCH|" -e "s|/VERSION/|$PKG_VERSION|" -e "s|/PKGREL/|$PKG_REL|" DEBIAN/control RUN cd usr/share/man/man1 && gzip -9 -f peerio-client.1 RUN find . -type f -exec chmod 0644 {} \; RUN find . -type d -exec chmod 0755 {} \; RUN chmod 0755 usr/share/peerio-client/Peerio usr/bin/peerio-client WORKDIR /usr/src RUN dpkg-deb --build $PKG_NAME
{ "pile_set_name": "Github" }
//* This file is part of the MOOSE framework //* https://www.mooseframework.org //* //* All rights reserved, see COPYRIGHT for full restrictions //* https://github.com/idaholab/moose/blob/master/COPYRIGHT //* //* Licensed under LGPL 2.1, please see LICENSE for details //* https://www.gnu.org/licenses/lgpl-2.1.html #pragma once #include "Kernel.h" #include "PorousFlowDictator.h" /** * PorousFlowEffectiveStressCoupling computes * -coefficient*effective_porepressure*grad_component(test) * where component is the spatial component (not * a fluid component!) */ class PorousFlowEffectiveStressCoupling : public Kernel { public: static InputParameters validParams(); PorousFlowEffectiveStressCoupling(const InputParameters & parameters); protected: virtual Real computeQpResidual() override; virtual Real computeQpJacobian() override; virtual Real computeQpOffDiagJacobian(unsigned int jvar) override; /// The PorousFlow dictator that holds global info about the simulation const PorousFlowDictator & _dictator; /// Biot coefficient const Real _coefficient; /// The spatial component const unsigned int _component; /// Effective porepressure const MaterialProperty<Real> & _pf; /// d(effective porepressure)/(d porflow variable) const MaterialProperty<std::vector<Real>> & _dpf_dvar; /// Whether an RZ coordinate system is being used const bool _rz; };
{ "pile_set_name": "Github" }
<% /** JFolder V0.9 windows platform @Filename: JFolder.jsp @Description: 一个简单的系统文件目录显示程序,类似于资源管理器,提供基本的文件操作,不过功能弱多了。 @Author: Steven Cee @Email : cqq1978@Gmail.com @Bugs : 下载时,中文文件名无法正常显示 */ %> <%@ page contentType="text/html;charset=gb2312"%> <%@page import="java.io.*,java.util.*,java.net.*" %> <%! private final static int languageNo=0; //语言版本,0 : 中文; 1:英文 String strThisFile="JFolder.jsp"; String[] authorInfo={" <font color=red> 写的不好,将就着用吧 - - by 慈勤强 http://www.topronet.com </font>"," <font color=red> Thanks for your support - - by Steven Cee http://www.topronet.com </font>"}; String[] strFileManage = {"文 件 管 理","File Management"}; String[] strCommand = {"CMD 命 令","Command Window"}; String[] strSysProperty = {"系 统 属 性","System Property"}; String[] strHelp = {"帮 助","Help"}; String[] strParentFolder = {"上级目录","Parent Folder"}; String[] strCurrentFolder= {"当前目录","Current Folder"}; String[] strDrivers = {"驱动器","Drivers"}; String[] strFileName = {"文件名称","File Name"}; String[] strFileSize = {"文件大小","File Size"}; String[] strLastModified = {"最后修改","Last Modified"}; String[] strFileOperation= {"文件操作","Operations"}; String[] strFileEdit = {"修改","Edit"}; String[] strFileDown = {"下载","Download"}; String[] strFileCopy = {"复制","Move"}; String[] strFileDel = {"删除","Delete"}; String[] strExecute = {"执行","Execute"}; String[] strBack = {"返回","Back"}; String[] strFileSave = {"保存","Save"}; public class FileHandler { private String strAction=""; private String strFile=""; void FileHandler(String action,String f) { } } public static class UploadMonitor { static Hashtable uploadTable = new Hashtable(); static void set(String fName, UplInfo info) { uploadTable.put(fName, info); } static void remove(String fName) { uploadTable.remove(fName); } static UplInfo getInfo(String fName) { UplInfo info = (UplInfo) uploadTable.get(fName); return info; } } public class UplInfo { public long totalSize; public long currSize; public long starttime; public boolean aborted; public UplInfo() { totalSize = 0l; currSize = 0l; starttime = System.currentTimeMillis(); aborted = false; } public UplInfo(int size) { totalSize = size; currSize = 0; starttime = System.currentTimeMillis(); aborted = false; } public String getUprate() { long time = System.currentTimeMillis() - starttime; if (time != 0) { long uprate = currSize * 1000 / time; return convertFileSize(uprate) + "/s"; } else return "n/a"; } public int getPercent() { if (totalSize == 0) return 0; else return (int) (currSize * 100 / totalSize); } public String getTimeElapsed() { long time = (System.currentTimeMillis() - starttime) / 1000l; if (time - 60l >= 0){ if (time % 60 >=10) return time / 60 + ":" + (time % 60) + "m"; else return time / 60 + ":0" + (time % 60) + "m"; } else return time<10 ? "0" + time + "s": time + "s"; } public String getTimeEstimated() { if (currSize == 0) return "n/a"; long time = System.currentTimeMillis() - starttime; time = totalSize * time / currSize; time /= 1000l; if (time - 60l >= 0){ if (time % 60 >=10) return time / 60 + ":" + (time % 60) + "m"; else return time / 60 + ":0" + (time % 60) + "m"; } else return time<10 ? "0" + time + "s": time + "s"; } } public class FileInfo { public String name = null, clientFileName = null, fileContentType = null; private byte[] fileContents = null; public File file = null; public StringBuffer sb = new StringBuffer(100); public void setFileContents(byte[] aByteArray) { fileContents = new byte[aByteArray.length]; System.arraycopy(aByteArray, 0, fileContents, 0, aByteArray.length); } } // A Class with methods used to process a ServletInputStream public class HttpMultiPartParser { private final String lineSeparator = System.getProperty("line.separator", "\n"); private final int ONE_MB = 1024 * 1; public Hashtable processData(ServletInputStream is, String boundary, String saveInDir, int clength) throws IllegalArgumentException, IOException { if (is == null) throw new IllegalArgumentException("InputStream"); if (boundary == null || boundary.trim().length() < 1) throw new IllegalArgumentException( "\"" + boundary + "\" is an illegal boundary indicator"); boundary = "--" + boundary; StringTokenizer stLine = null, stFields = null; FileInfo fileInfo = null; Hashtable dataTable = new Hashtable(5); String line = null, field = null, paramName = null; boolean saveFiles = (saveInDir != null && saveInDir.trim().length() > 0); boolean isFile = false; if (saveFiles) { // Create the required directory (including parent dirs) File f = new File(saveInDir); f.mkdirs(); } line = getLine(is); if (line == null || !line.startsWith(boundary)) throw new IOException( "Boundary not found; boundary = " + boundary + ", line = " + line); while (line != null) { if (line == null || !line.startsWith(boundary)) return dataTable; line = getLine(is); if (line == null) return dataTable; stLine = new StringTokenizer(line, ";\r\n"); if (stLine.countTokens() < 2) throw new IllegalArgumentException( "Bad data in second line"); line = stLine.nextToken().toLowerCase(); if (line.indexOf("form-data") < 0) throw new IllegalArgumentException( "Bad data in second line"); stFields = new StringTokenizer(stLine.nextToken(), "=\""); if (stFields.countTokens() < 2) throw new IllegalArgumentException( "Bad data in second line"); fileInfo = new FileInfo(); stFields.nextToken(); paramName = stFields.nextToken(); isFile = false; if (stLine.hasMoreTokens()) { field = stLine.nextToken(); stFields = new StringTokenizer(field, "=\""); if (stFields.countTokens() > 1) { if (stFields.nextToken().trim().equalsIgnoreCase("filename")) { fileInfo.name = paramName; String value = stFields.nextToken(); if (value != null && value.trim().length() > 0) { fileInfo.clientFileName = value; isFile = true; } else { line = getLine(is); // Skip "Content-Type:" line line = getLine(is); // Skip blank line line = getLine(is); // Skip blank line line = getLine(is); // Position to boundary line continue; } } } else if (field.toLowerCase().indexOf("filename") >= 0) { line = getLine(is); // Skip "Content-Type:" line line = getLine(is); // Skip blank line line = getLine(is); // Skip blank line line = getLine(is); // Position to boundary line continue; } } boolean skipBlankLine = true; if (isFile) { line = getLine(is); if (line == null) return dataTable; if (line.trim().length() < 1) skipBlankLine = false; else { stLine = new StringTokenizer(line, ": "); if (stLine.countTokens() < 2) throw new IllegalArgumentException( "Bad data in third line"); stLine.nextToken(); // Content-Type fileInfo.fileContentType = stLine.nextToken(); } } if (skipBlankLine) { line = getLine(is); if (line == null) return dataTable; } if (!isFile) { line = getLine(is); if (line == null) return dataTable; dataTable.put(paramName, line); // If parameter is dir, change saveInDir to dir if (paramName.equals("dir")) saveInDir = line; line = getLine(is); continue; } try { UplInfo uplInfo = new UplInfo(clength); UploadMonitor.set(fileInfo.clientFileName, uplInfo); OutputStream os = null; String path = null; if (saveFiles) os = new FileOutputStream(path = getFileName(saveInDir, fileInfo.clientFileName)); else os = new ByteArrayOutputStream(ONE_MB); boolean readingContent = true; byte previousLine[] = new byte[2 * ONE_MB]; byte temp[] = null; byte currentLine[] = new byte[2 * ONE_MB]; int read, read3; if ((read = is.readLine(previousLine, 0, previousLine.length)) == -1) { line = null; break; } while (readingContent) { if ((read3 = is.readLine(currentLine, 0, currentLine.length)) == -1) { line = null; uplInfo.aborted = true; break; } if (compareBoundary(boundary, currentLine)) { os.write(previousLine, 0, read - 2); line = new String(currentLine, 0, read3); break; } else { os.write(previousLine, 0, read); uplInfo.currSize += read; temp = currentLine; currentLine = previousLine; previousLine = temp; read = read3; }//end else }//end while os.flush(); os.close(); if (!saveFiles) { ByteArrayOutputStream baos = (ByteArrayOutputStream) os; fileInfo.setFileContents(baos.toByteArray()); } else fileInfo.file = new File(path); dataTable.put(paramName, fileInfo); uplInfo.currSize = uplInfo.totalSize; }//end try catch (IOException e) { throw e; } } return dataTable; } /** * Compares boundary string to byte array */ private boolean compareBoundary(String boundary, byte ba[]) { byte b; if (boundary == null || ba == null) return false; for (int i = 0; i < boundary.length(); i++) if ((byte) boundary.charAt(i) != ba[i]) return false; return true; } /** Convenience method to read HTTP header lines */ private synchronized String getLine(ServletInputStream sis) throws IOException { byte b[] = new byte[1024]; int read = sis.readLine(b, 0, b.length), index; String line = null; if (read != -1) { line = new String(b, 0, read); if ((index = line.indexOf('\n')) >= 0) line = line.substring(0, index - 1); } return line; } public String getFileName(String dir, String fileName) throws IllegalArgumentException { String path = null; if (dir == null || fileName == null) throw new IllegalArgumentException( "dir or fileName is null"); int index = fileName.lastIndexOf('/'); String name = null; if (index >= 0) name = fileName.substring(index + 1); else name = fileName; index = name.lastIndexOf('\\'); if (index >= 0) fileName = name.substring(index + 1); path = dir + File.separator + fileName; if (File.separatorChar == '/') return path.replace('\\', File.separatorChar); else return path.replace('/', File.separatorChar); } } //End of class HttpMultiPartParser String formatPath(String p) { StringBuffer sb=new StringBuffer(); for (int i = 0; i < p.length(); i++) { if(p.charAt(i)=='\\') { sb.append("\\\\"); } else { sb.append(p.charAt(i)); } } return sb.toString(); } /** * Converts some important chars (int) to the corresponding html string */ static String conv2Html(int i) { if (i == '&') return "&amp;"; else if (i == '<') return "&lt;"; else if (i == '>') return "&gt;"; else if (i == '"') return "&quot;"; else return "" + (char) i; } /** * Converts a normal string to a html conform string */ static String htmlEncode(String st) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < st.length(); i++) { buf.append(conv2Html(st.charAt(i))); } return buf.toString(); } String getDrivers() /** Windows系统上取得可用的所有逻辑盘 */ { StringBuffer sb=new StringBuffer(strDrivers[languageNo] + " : "); File roots[]=File.listRoots(); for(int i=0;i<roots.length;i++) { sb.append(" <a href=\"javascript:doForm('','"+roots[i]+"\\','','','1','');\">"); sb.append(roots[i]+"</a>&nbsp;"); } return sb.toString(); } static String convertFileSize(long filesize) { //bug 5.09M 显示5.9M String strUnit="Bytes"; String strAfterComma=""; int intDivisor=1; if(filesize>=1024*1024) { strUnit = "MB"; intDivisor=1024*1024; } else if(filesize>=1024) { strUnit = "KB"; intDivisor=1024; } if(intDivisor==1) return filesize + " " + strUnit; strAfterComma = "" + 100 * (filesize % intDivisor) / intDivisor ; if(strAfterComma=="") strAfterComma=".0"; return filesize / intDivisor + "." + strAfterComma + " " + strUnit; } %> <% request.setCharacterEncoding("gb2312"); String tabID = request.getParameter("tabID"); String strDir = request.getParameter("path"); String strAction = request.getParameter("action"); String strFile = request.getParameter("file"); String strPath = strDir + "\\" + strFile; String strCmd = request.getParameter("cmd"); StringBuffer sbEdit=new StringBuffer(""); StringBuffer sbDown=new StringBuffer(""); StringBuffer sbCopy=new StringBuffer(""); StringBuffer sbSaveCopy=new StringBuffer(""); StringBuffer sbNewFile=new StringBuffer(""); if((tabID==null) || tabID.equals("")) { tabID = "1"; } if(strDir==null||strDir.length()<1) { strDir = request.getRealPath("/"); } if(strAction!=null && strAction.equals("down")) { File f=new File(strPath); if(f.length()==0) { sbDown.append("文件大小为 0 字节,就不用下了吧"); } else { response.setHeader("content-type","text/html; charset=ISO-8859-1"); response.setContentType("APPLICATION/OCTET-STREAM"); response.setHeader("Content-Disposition","attachment; filename=\""+f.getName()+"\""); FileInputStream fileInputStream =new FileInputStream(f.getAbsolutePath()); out.clearBuffer(); int i; while ((i=fileInputStream.read()) != -1) { out.write(i); } fileInputStream.close(); out.close(); } } if(strAction!=null && strAction.equals("del")) { File f=new File(strPath); f.delete(); } if(strAction!=null && strAction.equals("edit")) { File f=new File(strPath); BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream(f))); sbEdit.append("<form name='frmEdit' action='' method='POST'>\r\n"); sbEdit.append("<input type=hidden name=action value=save >\r\n"); sbEdit.append("<input type=hidden name=path value='"+strDir+"' >\r\n"); sbEdit.append("<input type=hidden name=file value='"+strFile+"' >\r\n"); sbEdit.append("<input type=submit name=save value=' "+strFileSave[languageNo]+" '> "); sbEdit.append("<input type=button name=goback value=' "+strBack[languageNo]+" ' onclick='history.back(-1);'> &nbsp;"+strPath+"\r\n"); sbEdit.append("<br><textarea rows=30 cols=90 name=content>"); String line=""; while((line=br.readLine())!=null) { sbEdit.append(htmlEncode(line)+"\r\n"); } sbEdit.append("</textarea>"); sbEdit.append("<input type=hidden name=path value="+strDir+">"); sbEdit.append("</form>"); } if(strAction!=null && strAction.equals("save")) { File f=new File(strPath); BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f))); String strContent=request.getParameter("content"); bw.write(strContent); bw.close(); } if(strAction!=null && strAction.equals("copy")) { File f=new File(strPath); sbCopy.append("<br><form name='frmCopy' action='' method='POST'>\r\n"); sbCopy.append("<input type=hidden name=action value=savecopy >\r\n"); sbCopy.append("<input type=hidden name=path value='"+strDir+"' >\r\n"); sbCopy.append("<input type=hidden name=file value='"+strFile+"' >\r\n"); sbCopy.append("原始文件: "+strPath+"<p>"); sbCopy.append("目标文件: <input type=text name=file2 size=40 value='"+strDir+"'><p>"); sbCopy.append("<input type=submit name=save value=' "+strFileCopy[languageNo]+" '> "); sbCopy.append("<input type=button name=goback value=' "+strBack[languageNo]+" ' onclick='history.back(-1);'> <p>&nbsp;\r\n"); sbCopy.append("</form>"); } if(strAction!=null && strAction.equals("savecopy")) { File f=new File(strPath); String strDesFile=request.getParameter("file2"); if(strDesFile==null || strDesFile.equals("")) { sbSaveCopy.append("<p><font color=red>目标文件错误。</font>"); } else { File f_des=new File(strDesFile); if(f_des.isFile()) { sbSaveCopy.append("<p><font color=red>目标文件已存在,不能复制。</font>"); } else { String strTmpFile=strDesFile; if(f_des.isDirectory()) { if(!strDesFile.endsWith("\\")) { strDesFile=strDesFile+"\\"; } strTmpFile=strDesFile+"cqq_"+strFile; } File f_des_copy=new File(strTmpFile); FileInputStream in1=new FileInputStream(f); FileOutputStream out1=new FileOutputStream(f_des_copy); byte[] buffer=new byte[1024]; int c; while((c=in1.read(buffer))!=-1) { out1.write(buffer,0,c); } in1.close(); out1.close(); sbSaveCopy.append("原始文件 :"+strPath+"<p>"); sbSaveCopy.append("目标文件 :"+strTmpFile+"<p>"); sbSaveCopy.append("<font color=red>复制成功!</font>"); } } sbSaveCopy.append("<p><input type=button name=saveCopyBack onclick='history.back(-2);' value=返回>"); } if(strAction!=null && strAction.equals("newFile")) { String strF=request.getParameter("fileName"); String strType1=request.getParameter("btnNewFile"); String strType2=request.getParameter("btnNewDir"); String strType=""; if(strType1==null) { strType="Dir"; } else if(strType2==null) { strType="File"; } if(!strType.equals("") && !(strF==null || strF.equals(""))) { File f_new=new File(strF); if(strType.equals("File") && !f_new.createNewFile()) sbNewFile.append(strF+" 文件创建失败"); if(strType.equals("Dir") && !f_new.mkdirs()) sbNewFile.append(strF+" 目录创建失败"); } else { sbNewFile.append("<p><font color=red>建立文件或目录出错。</font>"); } } if((request.getContentType()!= null) && (request.getContentType().toLowerCase().startsWith("multipart"))) { String tempdir="."; boolean error=false; response.setContentType("text/html"); sbNewFile.append("<p><font color=red>建立文件或目录出错。</font>"); HttpMultiPartParser parser = new HttpMultiPartParser(); int bstart = request.getContentType().lastIndexOf("oundary="); String bound = request.getContentType().substring(bstart + 8); int clength = request.getContentLength(); Hashtable ht = parser.processData(request.getInputStream(), bound, tempdir, clength); if (ht.get("cqqUploadFile") != null) { FileInfo fi = (FileInfo) ht.get("cqqUploadFile"); File f1 = fi.file; UplInfo info = UploadMonitor.getInfo(fi.clientFileName); if (info != null && info.aborted) { f1.delete(); request.setAttribute("error", "Upload aborted"); } else { String path = (String) ht.get("path"); if(path!=null && !path.endsWith("\\")) path = path + "\\"; if (!f1.renameTo(new File(path + f1.getName()))) { request.setAttribute("error", "Cannot upload file."); error = true; f1.delete(); } } } } %> <html> <head> <style type="text/css"> td,select,input,body{font-size:9pt;} A { TEXT-DECORATION: none } #tablist{ padding: 5px 0; margin-left: 0; margin-bottom: 0; margin-top: 0.1em; font:9pt; } #tablist li{ list-style: none; display: inline; margin: 0; } #tablist li a{ padding: 3px 0.5em; margin-left: 3px; border: 1px solid ; background: F6F6F6; } #tablist li a:link, #tablist li a:visited{ color: navy; } #tablist li a.current{ background: #EAEAFF; } #tabcontentcontainer{ width: 100%; padding: 5px; border: 1px solid black; } .tabcontent{ display:none; } </style> <script type="text/javascript"> var initialtab=[<%=tabID%>, "menu<%=tabID%>"] ////////Stop editting//////////////// function cascadedstyle(el, cssproperty, csspropertyNS){ if (el.currentStyle) return el.currentStyle[cssproperty] else if (window.getComputedStyle){ var elstyle=window.getComputedStyle(el, "") return elstyle.getPropertyValue(csspropertyNS) } } var previoustab="" function expandcontent(cid, aobject){ if (document.getElementById){ highlighttab(aobject) if (previoustab!="") document.getElementById(previoustab).style.display="none" document.getElementById(cid).style.display="block" previoustab=cid if (aobject.blur) aobject.blur() return false } else return true } function highlighttab(aobject){ if (typeof tabobjlinks=="undefined") collecttablinks() for (i=0; i<tabobjlinks.length; i++) tabobjlinks[i].style.backgroundColor=initTabcolor var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor } function collecttablinks(){ var tabobj=document.getElementById("tablist") tabobjlinks=tabobj.getElementsByTagName("A") } function do_onload(){ collecttablinks() initTabcolor=cascadedstyle(tabobjlinks[1], "backgroundColor", "background-color") initTabpostcolor=cascadedstyle(tabobjlinks[0], "backgroundColor", "background-color") expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1]) } if (window.addEventListener) window.addEventListener("load", do_onload, false) else if (window.attachEvent) window.attachEvent("onload", do_onload) else if (document.getElementById) window.onload=do_onload </script> <script language="javascript"> function doForm(action,path,file,cmd,tab,content) { document.frmCqq.action.value=action; document.frmCqq.path.value=path; document.frmCqq.file.value=file; document.frmCqq.cmd.value=cmd; document.frmCqq.tabID.value=tab; document.frmCqq.content.value=content; if(action=="del") { if(confirm("确定要删除文件 "+file+" 吗?")) document.frmCqq.submit(); } else { document.frmCqq.submit(); } } </script> <title>JFoler 0.9 ---A jsp based web folder management tool by Steven Cee</title> <head> <body> <form name="frmCqq" method="post" action=""> <input type="hidden" name="action" value=""> <input type="hidden" name="path" value=""> <input type="hidden" name="file" value=""> <input type="hidden" name="cmd" value=""> <input type="hidden" name="tabID" value="2"> <input type="hidden" name="content" value=""> </form> <!--Top Menu Started--> <ul id="tablist"> <li><a href="http://www.smallrain.net" class="current" onClick="return expandcontent('menu1', this)"> <%=strFileManage[languageNo]%> </a></li> <li><a href="new.htm" onClick="return expandcontent('menu2', this)" theme="#EAEAFF"> <%=strCommand[languageNo]%> </a></li> <li><a href="hot.htm" onClick="return expandcontent('menu3', this)" theme="#EAEAFF"> <%=strSysProperty[languageNo]%> </a></li> <li><a href="search.htm" onClick="return expandcontent('menu4', this)" theme="#EAEAFF"> <%=strHelp[languageNo]%> </a></li> &nbsp; <%=authorInfo[languageNo]%> </ul> <!--Top Menu End--> <% StringBuffer sbFolder=new StringBuffer(""); StringBuffer sbFile=new StringBuffer(""); try { File objFile = new File(strDir); File list[] = objFile.listFiles(); if(objFile.getAbsolutePath().length()>3) { sbFolder.append("<tr><td >&nbsp;</td><td><a href=\"javascript:doForm('','"+formatPath(objFile.getParentFile().getAbsolutePath())+"','','"+strCmd+"','1','');\">"); sbFolder.append(strParentFolder[languageNo]+"</a><br>- - - - - - - - - - - </td></tr>\r\n "); } for(int i=0;i<list.length;i++) { if(list[i].isDirectory()) { sbFolder.append("<tr><td >&nbsp;</td><td>"); sbFolder.append(" <a href=\"javascript:doForm('','"+formatPath(list[i].getAbsolutePath())+"','','"+strCmd+"','1','');\">"); sbFolder.append(list[i].getName()+"</a><br></td></tr> "); } else { String strLen=""; String strDT=""; long lFile=0; lFile=list[i].length(); strLen = convertFileSize(lFile); Date dt=new Date(list[i].lastModified()); strDT=dt.toLocaleString(); sbFile.append("<tr onmouseover=\"this.style.backgroundColor='#FBFFC6'\" onmouseout=\"this.style.backgroundColor='white'\"><td>"); sbFile.append(""+list[i].getName()); sbFile.append("</td><td>"); sbFile.append(""+strLen); sbFile.append("</td><td>"); sbFile.append(""+strDT); sbFile.append("</td><td>"); sbFile.append(" &nbsp;<a href=\"javascript:doForm('edit','"+formatPath(strDir)+"','"+list[i].getName()+"','"+strCmd+"','"+tabID+"','');\">"); sbFile.append(strFileEdit[languageNo]+"</a> "); sbFile.append(" &nbsp;<a href=\"javascript:doForm('del','"+formatPath(strDir)+"','"+list[i].getName()+"','"+strCmd+"','"+tabID+"','');\">"); sbFile.append(strFileDel[languageNo]+"</a> "); sbFile.append(" &nbsp;<a href=\"javascript:doForm('down','"+formatPath(strDir)+"','"+list[i].getName()+"','"+strCmd+"','"+tabID+"','');\">"); sbFile.append(strFileDown[languageNo]+"</a> "); sbFile.append(" &nbsp;<a href=\"javascript:doForm('copy','"+formatPath(strDir)+"','"+list[i].getName()+"','"+strCmd+"','"+tabID+"','');\">"); sbFile.append(strFileCopy[languageNo]+"</a> "); } } } catch(Exception e) { out.println("<font color=red>操作失败: "+e.toString()+"</font>"); } %> <DIV id="tabcontentcontainer"> <div id="menu3" class="tabcontent"> <br> <br> &nbsp;&nbsp; 未完成 <br> <br>&nbsp; </div> <div id="menu4" class="tabcontent"> <br> <p>一、功能说明</p> <p>&nbsp;&nbsp;&nbsp; jsp 版本的文件管理器,通过该程序可以远程管理服务器上的文件系统,您可以新建、修改、</p> <p>删除、下载文件和目录。对于windows系统,还提供了命令行窗口的功能,可以运行一些程序,类似</p> <p>与windows的cmd。</p> <p>&nbsp;</p> <p>二、测试</p> <p>&nbsp;&nbsp;&nbsp;<b>请大家在使用过程中,有任何问题,意见或者建议都可以给我留言,以便使这个程序更加完善和稳定,<p> 留言地址为:<a href="http://blog.csdn.net/cqq/archive/2004/11/14/181728.aspx" target="_blank">http://blog.csdn.net/cqq/archive/2004/11/14/181728.aspx</a></b> <p>&nbsp;</p> <p>三、更新记录</p> <p>&nbsp;&nbsp;&nbsp; 2004.11.15&nbsp; V0.9测试版发布,增加了一些基本的功能,文件编辑、复制、删除、下载、上传以及新建文件目录功能</p> <p>&nbsp;&nbsp;&nbsp; 2004.10.27&nbsp; 暂时定为0.6版吧, 提供了目录文件浏览功能 和 cmd功能</p> <p>&nbsp;&nbsp;&nbsp; 2004.09.20&nbsp; 第一个jsp&nbsp;程序就是这个简单的显示目录文件的小程序</p> <p>&nbsp;</p> <p>&nbsp;</p> </div> <div id="menu1" class="tabcontent"> <% out.println("<table border='1' width='100%' bgcolor='#FBFFC6' cellspacing=0 cellpadding=5 bordercolorlight=#000000 bordercolordark=#FFFFFF><tr><td width='30%'>"+strCurrentFolder[languageNo]+": <b>"+strDir+"</b></td><td>" + getDrivers() + "</td></tr></table><br>\r\n"); %> <table width="100%" border="1" cellspacing="0" cellpadding="5" bordercolorlight="#000000" bordercolordark="#FFFFFF"> <tr> <td width="25%" align="center" valign="top"> <table width="98%" border="0" cellspacing="0" cellpadding="3"> <%=sbFolder%> </tr> </table> </td> <td width="81%" align="left" valign="top"> <% if(strAction!=null && strAction.equals("edit")) { out.println(sbEdit.toString()); } else if(strAction!=null && strAction.equals("copy")) { out.println(sbCopy.toString()); } else if(strAction!=null && strAction.equals("down")) { out.println(sbDown.toString()); } else if(strAction!=null && strAction.equals("savecopy")) { out.println(sbSaveCopy.toString()); } else if(strAction!=null && strAction.equals("newFile") && !sbNewFile.toString().equals("")) { out.println(sbNewFile.toString()); } else { %> <span id="EditBox"><table width="98%" border="1" cellspacing="1" cellpadding="4" bordercolorlight="#cccccc" bordercolordark="#FFFFFF" bgcolor="white" > <tr bgcolor="#E7e7e6"> <td width="26%"><%=strFileName[languageNo]%></td> <td width="19%"><%=strFileSize[languageNo]%></td> <td width="29%"><%=strLastModified[languageNo]%></td> <td width="26%"><%=strFileOperation[languageNo]%></td> </tr> <%=sbFile%> <!-- <tr align="center"> <td colspan="4"><br> 总计文件个数:<font color="#FF0000">30</font> ,大小:<font color="#FF0000">664.9</font> KB </td> </tr> --> </table> </span> <% } %> </td> </tr> <form name="frmMake" action="" method="post"> <tr><td colspan=2 bgcolor=#FBFFC6> <input type="hidden" name="action" value="newFile"> <input type="hidden" name="path" value="<%=strDir%>"> <input type="hidden" name="file" value="<%=strFile%>"> <input type="hidden" name="cmd" value="<%=strCmd%>"> <input type="hidden" name="tabID" value="1"> <input type="hidden" name="content" value=""> <% if(!strDir.endsWith("\\")) strDir = strDir + "\\"; %> <input type="text" name="fileName" size=36 value="<%=strDir%>"> <input type="submit" name="btnNewFile" value="新建文件" onclick="frmMake.submit()" > <input type="submit" name="btnNewDir" value="新建目录" onclick="frmMake.submit()" > </form> <form name="frmUpload" enctype="multipart/form-data" action="" method="post"> <input type="hidden" name="action" value="upload"> <input type="hidden" name="path" value="<%=strDir%>"> <input type="hidden" name="file" value="<%=strFile%>"> <input type="hidden" name="cmd" value="<%=strCmd%>"> <input type="hidden" name="tabID" value="1"> <input type="hidden" name="content" value=""> <input type="file" name="cqqUploadFile" size="36"> <input type="submit" name="submit" value="上传"> </td></tr></form> </table> </div> <div id="menu2" class="tabcontent"> <% String line=""; StringBuffer sbCmd=new StringBuffer(""); if(strCmd!=null) { try { //out.println(strCmd); Process p=Runtime.getRuntime().exec("cmd /c "+strCmd); BufferedReader br=new BufferedReader(new InputStreamReader(p.getInputStream())); while((line=br.readLine())!=null) { sbCmd.append(line+"\r\n"); } } catch(Exception e) { System.out.println(e.toString()); } } else { strCmd = "set"; } %> <form name="cmd" action="" method="post"> &nbsp; <input type="text" name="cmd" value="<%=strCmd%>" size=50> <input type="hidden" name="tabID" value="2"> <input type=submit name=submit value="<%=strExecute[languageNo]%>"> </form> <% if(sbCmd!=null && sbCmd.toString().trim().equals("")==false) { %> &nbsp;<TEXTAREA NAME="cqq" ROWS="20" COLS="100%"><%=sbCmd.toString()%></TEXTAREA> <br>&nbsp; <% } %> </DIV> </div> <br><br> <center><a href="http://www.topronet.com" target="_blank">www.topronet.com</a> ,All Rights Reserved. <br>Any question, please email me cqq1978@Gmail.com
{ "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. # #CMVCPATHNAME com.ibm.ws.apache.el-3.0/resources/org/apache/el/Messages.nlsprops #ISMESSAGEFILE TRUE #NLS_ENCODING=UNICODE #NLS_MESSAGEFORMAT_VAR # General Errors error.convert=\uc720\ud615 {1}\uc758 {0}\uc744(\ub97c) {2}(\uc73c)\ub85c \ubcc0\ud658\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. error.compare={0}\uc744(\ub97c) {1}\uacfc(\uc640) \ube44\uad50\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. error.function=''{0}'' \ud568\uc218\ub97c \ud638\ucd9c\ud558\ub294 \uc911\uc5d0 \ubb38\uc81c\uc810\uc774 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4. error.unreachable.base=\ub300\uc0c1\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. ID ''{0}''\uc774(\uac00) \ub110\ub85c \ubd84\uc11d\ub418\uc5c8\uc2b5\ub2c8\ub2e4. error.unreachable.property=\ub300\uc0c1\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. ''{0}''\uc774(\uac00) \ub110\uc744 \ub9ac\ud134\ud588\uc2b5\ub2c8\ub2e4. error.resolver.unhandled=ELResolver\uac00 \ud2b9\uc131\uc774 ''{1}''\uc778 \uc720\ud615 {0}\uc744(\ub97c) \ucc98\ub9ac\ud558\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4. error.resolver.unhandled.null=ELResolver\uac00 ID\uac00 ''{0}''\uc778 \ub110 \uae30\ubc18 \uc624\ube0c\uc81d\ud2b8\ub97c \ucc98\ub9ac\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. # ValueExpressionLiteral error.value.literal.write=ValueExpression\uc740 \ub9ac\ud130\ub7f4\uc774\uba70 \uc4f0\uae30 \uac00\ub2a5\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. {0} # ExpressionFactoryImpl error.null=\ud45c\ud604\uc2dd\uc740 \ub110\uc77c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. error.mixed=\ud45c\ud604\uc2dd\uc740 ''#''{..}''\uc640 ''$''{..}''\ub97c \ub458 \ub2e4 \ud3ec\ud568\ud560 \uc218\ub294 \uc5c6\uc2b5\ub2c8\ub2e4. {0} error.method=\uc720\ud6a8\ud55c MethodExpression\uc774 \uc544\ub2d9\ub2c8\ub2e4. {0} error.method.nullParms=\ub9e4\uac1c\ubcc0\uc218 \uc720\ud615\uc740 \ub110\uc77c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. error.value.expectedType=\uc608\uc0c1\ub41c \uc720\ud615\uc740 \ub110\uc77c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. # ExpressionBuilder error.parseFail=\ud45c\ud604\uc2dd [{0}]\uc744(\ub97c) \uad6c\ubb38 \ubd84\uc11d\ud558\ub294 \ub370 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. # ValueSetVisitor error.syntax.set=\uc124\uc815 \uc870\uc791\uc5d0 \ub300\ud55c \uad6c\ubb38\uc774 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. # ReflectionUtil error.method.notfound=\uba54\uc18c\ub4dc\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc74c: {0}.{1}({2}) error.method.ambiguous=\uba85\ud655\ud55c \uba54\uc18c\ub4dc\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc74c: {0}.{1}({2}) # ValidatingVisitor error.fnMapper.null=\ud45c\ud604\uc2dd\uc740 \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\ub294\ub370 FunctionMapper\uac00 \uc81c\uacf5\ub418\uc5c8\uc2b5\ub2c8\ub2e4. error.fnMapper.method=''{0}'' \ud568\uc218\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. error.fnMapper.paramcount=''{0}'' \ud568\uc218\uac00 {1} \ub9e4\uac1c\ubcc0\uc218\ub97c \uc9c0\uc815\ud558\ub294\ub370 {2}\uc774(\uac00) \uc120\uc5b8\ub418\uc5c8\uc2b5\ub2c8\ub2e4. # ExpressionImpl error.context.null=ELContext\uac00 \ub110\uc785\ub2c8\ub2e4. # Parser error.funciton.tooManyMethodParameterSets=\ud568\uc218 [{0}]\uc5d0 \ub300\ud574 \uc9c0\uc815\ub41c \ub2e4\uc911 \ub9e4\uac1c\ubcc0\uc218 \uc138\ud2b8\uac00 \uc788\uc2b5\ub2c8\ub2e4. error.identifier.notjava=EL \uc2a4\ud399\uc758 \uc139\uc158 1.19\uc5d0\uc11c \ud544\uc694\ub85c \ud558\ubbc0\ub85c ID [{0}]\uc774(\uac00) \uc720\ud6a8\ud55c Java ID\uac00 \uc544\ub2d9\ub2c8\ub2e4(ID ::= Java \uc5b8\uc5b4 ID). \uc2dc\uc2a4\ud15c \ud2b9\uc131 org.apache.el.parser.SKIP_IDENTIFIER_CHECK\ub97c true\ub85c \uc124\uc815\ud558\uba74 \uc774 \uac80\uc0ac\ub97c \uc0ac\uc6a9 \uc548\ud568\uc73c\ub85c \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. error.lambda.tooManyMethodParameterSets=\uc911\ucca9 lambda \ud45c\ud604\uc2dd\ubcf4\ub2e4 \ub354 \ub9ce\uc740 \uc218\uc758 \uba54\uc18c\ub4dc \ub9e4\uac1c\ubcc0\uc218 \uc138\ud2b8\uac00 \uc9c0\uc815\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. # Stream stream.compare.notComparable=\uc2a4\ud2b8\ub9bc \uc694\uc18c\ub294 Comparable\uc744 \uad6c\ud604\ud574\uc57c \ud569\ub2c8\ub2e4. stream.optional.empty=\ube48 \uc870\uc791\uc5d0\uc11c\ub294 get()\uc744 \ud638\ucd9c\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. stream.optional.paramNotLambda=\uba54\uc18c\ub4dc [{0}]\uc5d0 \ub300\ud55c \ub9e4\uac1c\ubcc0\uc218\ub294 lambda \ud45c\ud604\uc2dd\uc774\uc5b4\uc57c \ud569\ub2c8\ub2e4.
{ "pile_set_name": "Github" }
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package tls import "strconv" type alert uint8 const ( // alert level alertLevelWarning = 1 alertLevelError = 2 ) const ( alertCloseNotify alert = 0 alertUnexpectedMessage alert = 10 alertBadRecordMAC alert = 20 alertDecryptionFailed alert = 21 alertRecordOverflow alert = 22 alertDecompressionFailure alert = 30 alertHandshakeFailure alert = 40 alertBadCertificate alert = 42 alertUnsupportedCertificate alert = 43 alertCertificateRevoked alert = 44 alertCertificateExpired alert = 45 alertCertificateUnknown alert = 46 alertIllegalParameter alert = 47 alertUnknownCA alert = 48 alertAccessDenied alert = 49 alertDecodeError alert = 50 alertDecryptError alert = 51 alertProtocolVersion alert = 70 alertInsufficientSecurity alert = 71 alertInternalError alert = 80 alertUserCanceled alert = 90 alertNoRenegotiation alert = 100 ) var alertText = map[alert]string{ alertCloseNotify: "close notify", alertUnexpectedMessage: "unexpected message", alertBadRecordMAC: "bad record MAC", alertDecryptionFailed: "decryption failed", alertRecordOverflow: "record overflow", alertDecompressionFailure: "decompression failure", alertHandshakeFailure: "handshake failure", alertBadCertificate: "bad certificate", alertUnsupportedCertificate: "unsupported certificate", alertCertificateRevoked: "revoked certificate", alertCertificateExpired: "expired certificate", alertCertificateUnknown: "unknown certificate", alertIllegalParameter: "illegal parameter", alertUnknownCA: "unknown certificate authority", alertAccessDenied: "access denied", alertDecodeError: "error decoding message", alertDecryptError: "error decrypting message", alertProtocolVersion: "protocol version not supported", alertInsufficientSecurity: "insufficient security level", alertInternalError: "internal error", alertUserCanceled: "user canceled", alertNoRenegotiation: "no renegotiation", } func (e alert) String() string { s, ok := alertText[e] if ok { return s } return "alert(" + strconv.Itoa(int(e)) + ")" } func (e alert) Error() string { return e.String() }
{ "pile_set_name": "Github" }
// Koch Curve // Daniel Shiffman <http://www.shiffman.net> // Nature of Code, Chapter 8 // Renders a simple fractal, the Koch snowflake // Each recursive level drawn in sequence KochFractal k; void setup() { size(800,250); background(255); //frameRate(1); // Animate slowly k = new KochFractal(); smooth(); } void draw() { background(255); // Draws the snowflake! k.render(); // Iterate k.nextLevel(); // Let's not do it more than 5 times. . . if (k.getCount() > 5) { k.restart(); } println(frameCount); } // Koch Curve // Daniel Shiffman <http://www.shiffman.net> // Nature of Code, Chapter 8 // A class to manage the list of line segments in the snowflake pattern class KochFractal { PVector start; // A PVector for the start PVector end; // A PVector for the end ArrayList<KochLine> lines; // A list to keep track of all the lines int count; public KochFractal() { start = new PVector(0,height-20); end = new PVector(width,height-20); lines = new ArrayList<KochLine>(); restart(); } void nextLevel() { // For every line that is in the arraylist // create 4 more lines in a new arraylist lines = iterate(lines); count++; } void restart() { count = 0; // Reset count lines.clear(); // Empty the array list lines.add(new KochLine(start,end)); // Add the initial line (from one end PVector to the other) } int getCount() { return count; } // This is easy, just draw all the lines void render() { for(KochLine l : lines) { l.display(); } } // This is where the **MAGIC** happens // Step 1: Create an empty arraylist // Step 2: For every line currently in the arraylist // - calculate 4 line segments based on Koch algorithm // - add all 4 line segments into the new arraylist // Step 3: Return the new arraylist and it becomes the list of line segments for the structure // As we do this over and over again, each line gets broken into 4 lines, which gets broken into 4 lines, and so on. . . ArrayList iterate(ArrayList<KochLine> before) { ArrayList now = new ArrayList<KochLine>(); // Create emtpy list for(KochLine l : before) { // Calculate 5 koch PVectors (done for us by the line object) PVector a = l.start(); PVector b = l.kochleft(); PVector c = l.kochmiddle(); PVector d = l.kochright(); PVector e = l.end(); // Make line segments between all the PVectors and add them now.add(new KochLine(a,b)); now.add(new KochLine(b,c)); now.add(new KochLine(c,d)); now.add(new KochLine(d,e)); } return now; } } // Koch Curve // Daniel Shiffman <http://www.shiffman.net> // Nature of Code, Chapter 8 // A class to describe one line segment in the fractal // Includes methods to calculate midPVectors along the line according to the Koch algorithm class KochLine { // Two PVectors, // a is the "left" PVector and // b is the "right PVector PVector a; PVector b; KochLine(PVector start, PVector end) { a = start.get(); b = end.get(); } void display() { stroke(0); line(a.x, a.y, b.x, b.y); } PVector start() { return a.get(); } PVector end() { return b.get(); } // This is easy, just 1/3 of the way PVector kochleft() { PVector v = PVector.sub(b, a); v.div(3); v.add(a); return v; } // More complicated, have to use a little trig to figure out where this PVector is! PVector kochmiddle() { PVector v = PVector.sub(b, a); v.div(3); PVector p = a.get(); p.add(v); rotate(v,-radians(60)); p.add(v); return p; } // Easy, just 2/3 of the way PVector kochright() { PVector v = PVector.sub(a, b); v.div(3); v.add(b); return v; } } public void rotate(PVector v, float theta) { float xTemp = v.x; // Might need to check for rounding errors like with angleBetween function? v.x = v.x*cos(theta) - v.y*sin(theta); v.y = xTemp*sin(theta) + v.y*cos(theta); }
{ "pile_set_name": "Github" }
//! A CRDT that stores a collection of distinct elements. use Error; use dot::{Dot, SiteId, Counter, Summary}; use map_tuple_vec; use serde::ser::Serialize; use serde::de::DeserializeOwned; use std::borrow::Cow; use std::collections::{HashMap, HashSet}; use std::hash::Hash; pub trait SetElement: Clone + Eq + Hash + Serialize + DeserializeOwned {} impl<T: Clone + Eq + Hash + Serialize + DeserializeOwned> SetElement for T {} /// A Set is a `HashSet`-like collection of distinct elements. /// As with `HashSet`, `Set` requires that the elements implement /// the `Eq` and `Hash` traits. To allow for CRDT replication, they /// must also implement the `Clone`, `Serialize`, and `Deserialize` /// traits. /// /// Internally, Set is a variant of OR-Set. It allows op-based replication /// via [`execute_op`](#method.execute_op) and state-based replication /// via [`merge`](#method.merge). State-based replication allows /// out-of-order delivery but op-based replication does not. /// /// `Set` has a spatial complexity of *O(N + S)*, where /// *N* is the number of values concurrently held in the `Set` and /// *S* is the number of sites that have inserted values into the `Set`. /// It has the following performance characteristics: /// /// * [`insert`](#method.insert): *O(1)* /// * [`remove`](#method.remove): *O(1)* /// * [`contains`](#method.contains): *O(1)* /// * [`execute_op`](#method.execute_op): *O(1)* /// * [`merge`](#method.merge): *O(N1 + N2 + S1 + S2)*, where *N1* and /// *N2* are the number of values in the sets being merged, /// and *S1* and *S2* are the number of sites that have edited sets /// being merged. /// #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(bound(deserialize = ""))] pub struct Set<T: SetElement> { inner: Inner<T>, summary: Summary, site_id: SiteId, cached_ops: Vec<Op<T>>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(bound(deserialize = ""))] pub struct SetState<'a, T: SetElement + 'a>{ inner: Cow<'a, Inner<T>>, summary: Cow<'a, Summary>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub(crate) struct Inner<T: SetElement>(#[serde(with = "map_tuple_vec")] pub HashMap<T, Vec<Dot>>); #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Op<T> { value: T, inserted_dot: Option<Dot>, removed_dots: Vec<Dot>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub enum LocalOp<T> { Insert(T), Remove(T), } impl<T: SetElement> Set<T> { /// Constructs and returns a new set CRDT. /// The set has site 1 and counter 0. pub fn new() -> Self { let inner = Inner::new(); let summary = Summary::default(); let site_id = 1; Set{inner, summary, site_id, cached_ops: vec![]} } /// Returns true iff the set contains the value. pub fn contains(&self, value: &T) -> bool { self.inner.contains(value) } /// Inserts a value into the set and returns a remote op /// that can be sent to remote sites for replication. /// If the set does not have a site allocated, it caches /// the op and returns an `AwaitingSite` error. pub fn insert(&mut self, value: T) -> Result<Op<T>, Error> { let counter = self.summary.increment(self.site_id); let op = self.inner.insert(value, self.site_id, counter); self.after_op(op) } /// Removes a value from the set and returns a remote op /// that can be sent to remote sites for replication. /// If the set does not have a site allocated, it caches /// the op and returns an `AwaitingSite` error. pub fn remove(&mut self, value: &T) -> Option<Result<Op<T>, Error>> { let op = self.inner.remove(value)?; Some(self.after_op(op)) } crdt_impl2! { Set, SetState<T>, SetState<'static, T>, SetState, Inner<T>, Op<T>, Option<LocalOp<T>>, HashSet<T>, } } impl<T: SetElement> Inner<T> { fn new() -> Self { Inner(HashMap::new()) } fn contains(&self, value: &T) -> bool { self.0.contains_key(value) } fn insert(&mut self, value: T, site_id: SiteId, counter: Counter) -> Op<T> { let inserted_dot = Dot{site_id, counter}; let removed_dots = self.0.insert(value.clone(), vec![inserted_dot]).unwrap_or(vec![]); Op{value, inserted_dot: Some(inserted_dot), removed_dots} } fn remove(&mut self, value: &T) -> Option<Op<T>> { let removed_dots = self.0.remove(value)?; Some(Op{value: value.clone(), inserted_dot: None, removed_dots}) } fn execute_op(&mut self, op: Op<T>) -> Option<LocalOp<T>> { let mut dots = self.0.remove(&op.value).unwrap_or_else(|| vec![]); let exists_before = !dots.is_empty(); dots.retain(|r| !op.removed_dots.contains(r)); if let Some(new_dot) = op.inserted_dot { if let Err(idx) = dots.binary_search_by(|r| r.cmp(&new_dot)) { dots.insert(idx, new_dot); } } let exists_after = !dots.is_empty(); if exists_before && exists_after { self.0.insert(op.value, dots); None } else if exists_after { self.0.insert(op.value.clone(), dots); Some(LocalOp::Insert(op.value)) } else if exists_before { Some(LocalOp::Remove(op.value)) } else { None } } fn merge(&mut self, other: Inner<T>, summary: &Summary, other_summary: &Summary) { let mut other_elements = other.0; // retain an element in self iff: // - the element is in in both self and other, OR // - the element has not been inserted into other self.0.retain(|value, dots| { let mut other_dots = other_elements.remove(value).unwrap_or_else(|| vec![]); dots.retain(|r| other_dots.contains(r) || !other_summary.contains(r)); other_dots.retain(|r| !dots.contains(r) && !summary.contains(r)); dots.append(&mut other_dots); dots.sort(); !dots.is_empty() }); // insert any element that is in other but not yet inserted into self for (value, mut dots) in other_elements.to_owned() { dots.retain(|r| !summary.contains(r)); if !dots.is_empty() { self.0.insert(value, dots); } } } fn add_site_id(&mut self, site_id: SiteId) { for dots in self.0.values_mut() { for dot in dots { if dot.site_id == 0 { dot.site_id = site_id }; } } } fn validate_no_unassigned_sites(&self) -> Result<(), Error> { for dots in self.0.values() { for dot in dots { if dot.site_id == 0 { return Err(Error::InvalidSiteId); } } } Ok(()) } fn local_value(&self) -> HashSet<T> { self.0.keys().cloned().collect() } } impl<T: SetElement> Op<T> { /// Returns the `Op`'s value. pub fn value(&self) -> &T { &self.value } /// Returns a reference to the `Op`'s inserted dot. pub fn inserted_dot(&self) -> Option<Dot> { self.inserted_dot } /// Returns a reference to the `Op`'s removed dots. pub fn removed_dots(&self) -> &[Dot] { &self.removed_dots } /// Assigns a site id to any unassigned inserts and removes pub fn add_site_id(&mut self, site_id: SiteId) { if let Some(ref mut r) = self.inserted_dot { if r.site_id == 0 { r.site_id = site_id }; } for r in &mut self.removed_dots { if r.site_id == 0 { r.site_id = site_id }; } } /// Validates that the `Op`'s site id is equal to the given site id. pub fn validate(&self, site_id: SiteId) -> Result<(), Error> { if let Some(ref r) = self.inserted_dot { if r.site_id != site_id { return Err(Error::InvalidOp) }; } Ok(()) } pub(crate) fn inserted_dots(&self) -> Vec<Dot> { if let Some(dot) = self.inserted_dot { vec![dot] } else { vec![] } } }
{ "pile_set_name": "Github" }
/* * This set (target) cpu specific macros: * - Possible values: * NPY_CPU_X86 * NPY_CPU_AMD64 * NPY_CPU_PPC * NPY_CPU_PPC64 * NPY_CPU_PPC64LE * NPY_CPU_SPARC * NPY_CPU_S390 * NPY_CPU_IA64 * NPY_CPU_HPPA * NPY_CPU_ALPHA * NPY_CPU_ARMEL * NPY_CPU_ARMEB * NPY_CPU_SH_LE * NPY_CPU_SH_BE */ #ifndef _NPY_CPUARCH_H_ #define _NPY_CPUARCH_H_ #include "numpyconfig.h" #include <string.h> /* for memcpy */ #if defined( __i386__ ) || defined(i386) || defined(_M_IX86) /* * __i386__ is defined by gcc and Intel compiler on Linux, * _M_IX86 by VS compiler, * i386 by Sun compilers on opensolaris at least */ #define NPY_CPU_X86 #elif defined(__x86_64__) || defined(__amd64__) || defined(__x86_64) || defined(_M_AMD64) /* * both __x86_64__ and __amd64__ are defined by gcc * __x86_64 defined by sun compiler on opensolaris at least * _M_AMD64 defined by MS compiler */ #define NPY_CPU_AMD64 #elif defined(__ppc__) || defined(__powerpc__) || defined(_ARCH_PPC) /* * __ppc__ is defined by gcc, I remember having seen __powerpc__ once, * but can't find it ATM * _ARCH_PPC is used by at least gcc on AIX */ #define NPY_CPU_PPC #elif defined(__ppc64le__) #define NPY_CPU_PPC64LE #elif defined(__ppc64__) #define NPY_CPU_PPC64 #elif defined(__sparc__) || defined(__sparc) /* __sparc__ is defined by gcc and Forte (e.g. Sun) compilers */ #define NPY_CPU_SPARC #elif defined(__s390__) #define NPY_CPU_S390 #elif defined(__ia64) #define NPY_CPU_IA64 #elif defined(__hppa) #define NPY_CPU_HPPA #elif defined(__alpha__) #define NPY_CPU_ALPHA #elif defined(__arm__) && defined(__ARMEL__) #define NPY_CPU_ARMEL #elif defined(__arm__) && defined(__ARMEB__) #define NPY_CPU_ARMEB #elif defined(__sh__) && defined(__LITTLE_ENDIAN__) #define NPY_CPU_SH_LE #elif defined(__sh__) && defined(__BIG_ENDIAN__) #define NPY_CPU_SH_BE #elif defined(__MIPSEL__) #define NPY_CPU_MIPSEL #elif defined(__MIPSEB__) #define NPY_CPU_MIPSEB #elif defined(__or1k__) #define NPY_CPU_OR1K #elif defined(__aarch64__) #define NPY_CPU_AARCH64 #elif defined(__mc68000__) #define NPY_CPU_M68K #else #error Unknown CPU, please report this to numpy maintainers with \ information about your platform (OS, CPU and compiler) #endif #define NPY_COPY_PYOBJECT_PTR(dst, src) memcpy(dst, src, sizeof(PyObject *)) #if (defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64)) #define NPY_CPU_HAVE_UNALIGNED_ACCESS 1 #else #define NPY_CPU_HAVE_UNALIGNED_ACCESS 0 #endif #endif
{ "pile_set_name": "Github" }
# # Copyright 2020 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # 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 network::juniper::common::screenos::snmp::mode::vpnusage; use base qw(centreon::plugins::templates::counter); use strict; use warnings; use Digest::MD5 qw(md5_hex); sub prefix_vpn_output { my ($self, %options) = @_; return "VPN '" . $options{instance_value}->{display} . "' "; } sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ { name => 'vpn', type => 1, cb_prefix_output => 'prefix_vpn_output', message_multiple => 'All VPN are ok' } ]; $self->{maps_counters}->{vpn} = [ { label => 'traffic-in', set => { key_values => [ { name => 'traffic_in', per_second => 1 }, { name => 'display' } ], output_template => 'Traffic In: %s %s/s', output_change_bytes => 2, perfdatas => [ { label => 'traffic_in', template => '%s', min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }, ], } }, { label => 'traffic-out', set => { key_values => [ { name => 'traffic_out', per_second => 1 }, { name => 'display' } ], output_template => 'Traffic Out: %s %s/s', output_change_bytes => 2, perfdatas => [ { label => 'traffic_out', template => '%s', min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }, ], } } ]; } sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); bless $self, $class; $options{options}->add_options(arguments => { 'filter-name:s' => { name => 'filter_name' } }); return $self; } sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); } my $mapping = { nsVpnMonVpnName => { oid => '.1.3.6.1.4.1.3224.4.1.1.1.4' }, nsVpnMonBytesIn => { oid => '.1.3.6.1.4.1.3224.4.1.1.1.35' }, nsVpnMonBytesOut => { oid => '.1.3.6.1.4.1.3224.4.1.1.1.36' }, }; sub manage_selection { my ($self, %options) = @_; $self->{vpn} = {}; my $snmp_result = $options{snmp}->get_multiple_table(oids => [ { oid => $mapping->{nsVpnMonVpnName}->{oid} }, { oid => $mapping->{nsVpnMonBytesIn}->{oid} }, { oid => $mapping->{nsVpnMonBytesOut}->{oid} }, ], nothing_quit => 1, return_type => 1); foreach my $oid (keys %{$snmp_result}) { next if ($oid !~ /^$mapping->{nsVpnMonVpnName}->{oid}\.(.*)$/); my $instance = $1; my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $result->{nsVpnMonVpnName} !~ /$self->{option_results}->{filter_name}/) { $self->{output}->output_add(long_msg => "skipping '" . $result->{nsVpnMonVpnName} . "': no matching filter.", debug => 1); next; } $self->{vpn}->{$instance} = { display => $result->{nsVpnMonVpnName}, traffic_in => $result->{nsVpnMonBytesIn}, traffic_out => $result->{nsVpnMonBytesOut} }; } if (scalar(keys %{$self->{vpn}}) <= 0) { $self->{output}->add_option_msg(short_msg => "No vpn found."); $self->{output}->option_exit(); } $self->{cache_name} = "juniper_ssg_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . (defined($self->{option_results}->{filter_name}) ? md5_hex($self->{option_results}->{filter_name}) : md5_hex('all')); } 1; __END__ =head1 MODE Check Juniper VPN usage (NETSCREEN-VPN-MON-MIB). =over 8 =item B<--filter-name> Filter VPN name (can be a regexp). =item B<--warning-*> Threshold warning. Can be: 'traffic-in', 'traffic-out'. =item B<--critical-*> Threshold critical. Can be: 'traffic-in', 'traffic-out'. =back =cut
{ "pile_set_name": "Github" }
#if USE_HOT #define READ_ONLY // // Author: // Jb Evain (jbevain@gmail.com) // // Copyright (c) 2008 - 2015 Jb Evain // Copyright (c) 2008 - 2011 Novell, Inc. // // Licensed under the MIT/X11 license. // using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; using ILRuntime.Mono.Collections.Generic; namespace ILRuntime.Mono.Cecil { public delegate AssemblyDefinition AssemblyResolveEventHandler (object sender, AssemblyNameReference reference); public sealed class AssemblyResolveEventArgs : EventArgs { readonly AssemblyNameReference reference; public AssemblyNameReference AssemblyReference { get { return reference; } } public AssemblyResolveEventArgs (AssemblyNameReference reference) { this.reference = reference; } } #if !NET_CORE [Serializable] #endif public sealed class AssemblyResolutionException : FileNotFoundException { readonly AssemblyNameReference reference; public AssemblyNameReference AssemblyReference { get { return reference; } } public AssemblyResolutionException (AssemblyNameReference reference) : this (reference, null) { } public AssemblyResolutionException (AssemblyNameReference reference, Exception innerException) : base (string.Format ("Failed to resolve assembly: '{0}'", reference), innerException) { this.reference = reference; } #if !NET_CORE AssemblyResolutionException ( System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base (info, context) { } #endif } public abstract class BaseAssemblyResolver : IAssemblyResolver { static readonly bool on_mono = Type.GetType ("Mono.Runtime") != null; readonly Collection<string> directories; #if NET_CORE // Maps file names of available trusted platform assemblies to their full paths. // Internal for testing. internal static readonly Lazy<Dictionary<string, string>> TrustedPlatformAssemblies = new Lazy<Dictionary<string, string>> (CreateTrustedPlatformAssemblyMap); #else Collection<string> gac_paths; #endif public void AddSearchDirectory (string directory) { directories.Add (directory); } public void RemoveSearchDirectory (string directory) { directories.Remove (directory); } public string [] GetSearchDirectories () { var directories = new string [this.directories.size]; Array.Copy (this.directories.items, directories, directories.Length); return directories; } public event AssemblyResolveEventHandler ResolveFailure; protected BaseAssemblyResolver () { directories = new Collection<string> (2) { ".", "bin" }; } AssemblyDefinition GetAssembly (string file, ReaderParameters parameters) { if (parameters.AssemblyResolver == null) parameters.AssemblyResolver = this; return ModuleDefinition.ReadModule (file, parameters).Assembly; } public virtual AssemblyDefinition Resolve (AssemblyNameReference name) { return Resolve (name, new ReaderParameters ()); } public virtual AssemblyDefinition Resolve (AssemblyNameReference name, ReaderParameters parameters) { Mixin.CheckName (name); Mixin.CheckParameters (parameters); var assembly = SearchDirectory (name, directories, parameters); if (assembly != null) return assembly; if (name.IsRetargetable) { // if the reference is retargetable, zero it name = new AssemblyNameReference (name.Name, Mixin.ZeroVersion) { PublicKeyToken = Empty<byte>.Array, }; } #if NET_CORE assembly = SearchTrustedPlatformAssemblies (name, parameters); if (assembly != null) return assembly; #else var framework_dir = Path.GetDirectoryName (typeof (object).Module.FullyQualifiedName); var framework_dirs = on_mono ? new [] { framework_dir, Path.Combine (framework_dir, "Facades") } : new [] { framework_dir }; if (IsZero (name.Version)) { assembly = SearchDirectory (name, framework_dirs, parameters); if (assembly != null) return assembly; } if (name.Name == "mscorlib") { assembly = GetCorlib (name, parameters); if (assembly != null) return assembly; } assembly = GetAssemblyInGac (name, parameters); if (assembly != null) return assembly; assembly = SearchDirectory (name, framework_dirs, parameters); if (assembly != null) return assembly; #endif if (ResolveFailure != null) { assembly = ResolveFailure (this, name); if (assembly != null) return assembly; } throw new AssemblyResolutionException (name); } #if NET_CORE AssemblyDefinition SearchTrustedPlatformAssemblies (AssemblyNameReference name, ReaderParameters parameters) { if (name.IsWindowsRuntime) return null; if (TrustedPlatformAssemblies.Value.TryGetValue (name.Name, out string path)) return GetAssembly (path, parameters); return null; } static Dictionary<string, string> CreateTrustedPlatformAssemblyMap () { var result = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase); string paths; try { // AppContext is only available on platforms that implement .NET Standard 1.6 var appContextType = Type.GetType ("System.AppContext, System.AppContext, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError: false); var getData = appContextType?.GetTypeInfo ().GetDeclaredMethod ("GetData"); paths = (string) getData?.Invoke (null, new [] { "TRUSTED_PLATFORM_ASSEMBLIES" }); } catch { paths = null; } if (paths == null) return result; foreach (var path in paths.Split (Path.PathSeparator)) if (string.Equals (Path.GetExtension (path), ".dll", StringComparison.OrdinalIgnoreCase)) result [Path.GetFileNameWithoutExtension (path)] = path; return result; } #endif protected virtual AssemblyDefinition SearchDirectory (AssemblyNameReference name, IEnumerable<string> directories, ReaderParameters parameters) { var extensions = name.IsWindowsRuntime ? new [] { ".winmd", ".dll" } : new [] { ".exe", ".dll" }; foreach (var directory in directories) { foreach (var extension in extensions) { string file = Path.Combine (directory, name.Name + extension); if (!File.Exists (file)) continue; try { return GetAssembly (file, parameters); } catch (System.BadImageFormatException) { continue; } } } return null; } static bool IsZero (Version version) { return version.Major == 0 && version.Minor == 0 && version.Build == 0 && version.Revision == 0; } #if !NET_CORE AssemblyDefinition GetCorlib (AssemblyNameReference reference, ReaderParameters parameters) { var version = reference.Version; var corlib = typeof (object).Assembly.GetName (); if (corlib.Version == version || IsZero (version)) return GetAssembly (typeof (object).Module.FullyQualifiedName, parameters); var path = Directory.GetParent ( Directory.GetParent ( typeof (object).Module.FullyQualifiedName).FullName ).FullName; if (on_mono) { if (version.Major == 1) path = Path.Combine (path, "1.0"); else if (version.Major == 2) { if (version.MajorRevision == 5) path = Path.Combine (path, "2.1"); else path = Path.Combine (path, "2.0"); } else if (version.Major == 4) path = Path.Combine (path, "4.0"); else throw new NotSupportedException ("Version not supported: " + version); } else { switch (version.Major) { case 1: if (version.MajorRevision == 3300) path = Path.Combine (path, "v1.0.3705"); else path = Path.Combine (path, "v1.0.5000.0"); break; case 2: path = Path.Combine (path, "v2.0.50727"); break; case 4: path = Path.Combine (path, "v4.0.30319"); break; default: throw new NotSupportedException ("Version not supported: " + version); } } var file = Path.Combine (path, "mscorlib.dll"); if (File.Exists (file)) return GetAssembly (file, parameters); if (on_mono && Directory.Exists (path + "-api")) { file = Path.Combine (path + "-api", "mscorlib.dll"); if (File.Exists (file)) return GetAssembly (file, parameters); } return null; } static Collection<string> GetGacPaths () { if (on_mono) return GetDefaultMonoGacPaths (); var paths = new Collection<string> (2); var windir = Environment.GetEnvironmentVariable ("WINDIR"); if (windir == null) return paths; paths.Add (Path.Combine (windir, "assembly")); paths.Add (Path.Combine (windir, Path.Combine ("Microsoft.NET", "assembly"))); return paths; } static Collection<string> GetDefaultMonoGacPaths () { var paths = new Collection<string> (1); var gac = GetCurrentMonoGac (); if (gac != null) paths.Add (gac); var gac_paths_env = Environment.GetEnvironmentVariable ("MONO_GAC_PREFIX"); if (string.IsNullOrEmpty (gac_paths_env)) return paths; var prefixes = gac_paths_env.Split (Path.PathSeparator); foreach (var prefix in prefixes) { if (string.IsNullOrEmpty (prefix)) continue; var gac_path = Path.Combine (Path.Combine (Path.Combine (prefix, "lib"), "mono"), "gac"); if (Directory.Exists (gac_path) && !paths.Contains (gac)) paths.Add (gac_path); } return paths; } static string GetCurrentMonoGac () { return Path.Combine ( Directory.GetParent ( Path.GetDirectoryName (typeof (object).Module.FullyQualifiedName)).FullName, "gac"); } AssemblyDefinition GetAssemblyInGac (AssemblyNameReference reference, ReaderParameters parameters) { if (reference.PublicKeyToken == null || reference.PublicKeyToken.Length == 0) return null; if (gac_paths == null) gac_paths = GetGacPaths (); if (on_mono) return GetAssemblyInMonoGac (reference, parameters); return GetAssemblyInNetGac (reference, parameters); } AssemblyDefinition GetAssemblyInMonoGac (AssemblyNameReference reference, ReaderParameters parameters) { for (int i = 0; i < gac_paths.Count; i++) { var gac_path = gac_paths [i]; var file = GetAssemblyFile (reference, string.Empty, gac_path); if (File.Exists (file)) return GetAssembly (file, parameters); } return null; } AssemblyDefinition GetAssemblyInNetGac (AssemblyNameReference reference, ReaderParameters parameters) { var gacs = new [] { "GAC_MSIL", "GAC_32", "GAC_64", "GAC" }; var prefixes = new [] { string.Empty, "v4.0_" }; for (int i = 0; i < 2; i++) { for (int j = 0; j < gacs.Length; j++) { var gac = Path.Combine (gac_paths [i], gacs [j]); var file = GetAssemblyFile (reference, prefixes [i], gac); if (Directory.Exists (gac) && File.Exists (file)) return GetAssembly (file, parameters); } } return null; } #endif static string GetAssemblyFile (AssemblyNameReference reference, string prefix, string gac) { var gac_folder = new StringBuilder () .Append (prefix) .Append (reference.Version) .Append ("__"); for (int i = 0; i < reference.PublicKeyToken.Length; i++) gac_folder.Append (reference.PublicKeyToken [i].ToString ("x2")); return Path.Combine ( Path.Combine ( Path.Combine (gac, reference.Name), gac_folder.ToString ()), reference.Name + ".dll"); } public void Dispose () { Dispose (true); GC.SuppressFinalize (this); } protected virtual void Dispose (bool disposing) { } } } #endif
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <meta charset="UTF-8"> <head> <title>Topic 07 -- Abstracts with Biological Entities (English) - 75 Topics / Sub-Topic Model 08 - 15 Topics</title> <style> table { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; border-collapse: collapse; width: 100%; } td, th { border: 1px solid #ddd; padding: 8px; } tr:nth-child(even){background-color: #f2f2f2;} tr:hover {background-color: #ddd;} th { padding-top: 12px; padding-bottom: 12px; text-align: left; background-color: #0099FF; color: white; } </style> </head> <body> <h2>Topic 07 -- Abstracts with Biological Entities (English) - 75 Topics / Sub-Topic Model 08 - 15 Topics</h2> <table border="1" class="dataframe"> <thead> <tr style="text-align: right;"> <th></th> <th>cite ad</th> <th>title</th> <th>authors</th> <th>publish year</th> <th>publish time</th> <th>dataset</th> <th>abstract mentions covid</th> <th>pmcid</th> <th>pubmed id</th> <th>doi</th> <th>cord uid</th> <th>topic weight</th> <th>Similarity scispacy</th> <th>Similarity specter</th> </tr> </thead> <tbody> <tr> <th id="a2m46j0z";>1</th> <td>Tian_2016</td> <td>The similarity analysis of financial stocks based on information clustering</td> <td>Tian, Qiang; Shang, Pengjian; Feng, Guochen</td> <td>2016</td> <td>2016-05-26</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7088863" target="_blank">PMC7088863</a></td> <td></td> <td><a href="https://doi.org/10.1007/s11071-016-2851-9" target="_blank">10.1007/s11071-016-2851-9</a></td> <td>a2m46j0z</td> <td>0.886806</td> <td></td> <td><a href="Topic_07.html#tjnt01ld">Argyroudis_2019</a></td> </tr> <tr> <th id="b25mi0sp";>2</th> <td>Zhao_2013</td> <td>Estimation with Right-Censored Observations Under A Semi-Markov Model</td> <td>Zhao, Lihui; Hu, X. Joan</td> <td>2013</td> <td>2013-03-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3713855" target="_blank">PMC3713855</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/23874060.0" target="_blank">23874060.0</a></td> <td><a href="https://doi.org/10.1002/cjs.11176" target="_blank">10.1002/cjs.11176</a></td> <td>b25mi0sp</td> <td>0.885701</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a></td> <td><a href="Topic_07.html#cok7vbmg">Soubeyrand_2007</a>, <a href="Topic_04.html#ecxcw96m">Black_2013</a>, <a href="Topic_04.html#88xk1e6h">Hirose_2007</a>, <a href="Topic_02.html#dqg8fkca">Roques_2020</a></td> </tr> <tr> <th id="8k22red9";>3</th> <td>So_M_2008</td> <td>A multivariate threshold stochastic volatility model</td> <td>So, Mike K.P.; Choi, C.Y.</td> <td>2008</td> <td>2008-12-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7127604" target="_blank">PMC7127604</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.matcom.2007.12.003" target="_blank">10.1016/j.matcom.2007.12.003</a></td> <td>8k22red9</td> <td>0.843205</td> <td><a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_07.html#b25mi0sp">Zhao_2013</a></td> <td><a href="Topic_07.html#eszlg47q">Liao_2013</a></td> </tr> <tr> <th id="hoa39sx2";>4</th> <td>Wan_W_2011</td> <td>Bayesian analysis of robust Poisson geometric process model using heavy-tailed distributions</td> <td>Wan, Wai-Yin; Chan, Jennifer So-Kuen</td> <td>2011</td> <td>2011-01-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7114253" target="_blank">PMC7114253</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.csda.2010.06.011" target="_blank">10.1016/j.csda.2010.06.011</a></td> <td>hoa39sx2</td> <td>0.811831</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a>, <a href="Topic_07.html#b25mi0sp">Zhao_2013</a></td> <td><a href="Topic_07.html#b25mi0sp">Zhao_2013</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a></td> </tr> <tr> <th id="8moz4g71";>5</th> <td>Zou_X_2014</td> <td>Optimal harvesting for a stochastic regime-switching logistic diffusion system with jumps</td> <td>Zou, Xiaoling; Wang, Ke</td> <td>2014</td> <td>2014-08-31</td> <td>PMC</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1016/j.nahs.2014.01.001" target="_blank">10.1016/j.nahs.2014.01.001</a></td> <td>8moz4g71</td> <td>0.765850</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a></td> <td><a href="Topic_06.html#04p0c4jt">Guo_W_2018</a>, <a href="Topic_06.html#774ywcj0">Chen_2018</a>, <a href="Topic_01.html#hp2d68su">Cazelles_2018</a>, <a href="Topic_06.html#yjodgy2v">Lan_G_2019</a></td> </tr> <tr> <th id="hi5afmbw";>6</th> <td>Pan_J_2008</td> <td>Estimation and tests for power-transformed and threshold GARCH models</td> <td>Pan, Jiazhu; Wang, Hui; Tong, Howell</td> <td>2008</td> <td>2008-01-31</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7116990" target="_blank">PMC7116990</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.jeconom.2007.06.004" target="_blank">10.1016/j.jeconom.2007.06.004</a></td> <td>hi5afmbw</td> <td>0.751901</td> <td><a href="Topic_07.html#63wqn2fg">Höhle_2007</a>, <a href="Topic_07.html#b25mi0sp">Zhao_2013</a>, <a href="Topic_06.html#9nhauvss">Pekalp_2019</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a></td> <td><a href="Topic_07.html#b25mi0sp">Zhao_2013</a>, <a href="Topic_04.html#88xk1e6h">Hirose_2007</a>, <a href="Topic_07.html#cok7vbmg">Soubeyrand_2007</a></td> </tr> <tr> <th id="geiq55mq";>7</th> <td>Xiong_2016</td> <td>Weighted multifractal cross-correlation analysis based on Shannon entropy</td> <td>Xiong, Hui; Shang, Pengjian</td> <td>2016</td> <td>2016-01-31</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7128505" target="_blank">PMC7128505</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.cnsns.2015.06.029" target="_blank">10.1016/j.cnsns.2015.06.029</a></td> <td>geiq55mq</td> <td>0.742341</td> <td><a href="Topic_07.html#b25mi0sp">Zhao_2013</a></td> <td><a href="Topic_07.html#a2m46j0z">Tian_2016</a>, <a href="Topic_07.html#tjnt01ld">Argyroudis_2019</a>, <a href="Topic_04.html#7umn0vkv">Tao_Y_2020</a>, <a href="Topic_07.html#hi5afmbw">Pan_J_2008</a></td> </tr> <tr> <th id="cok7vbmg";>8</th> <td>Soubeyrand_2007</td> <td>Model-based estimation of the link between the daily survival probability and a time-varying covariate, application to mosquitofish survival data</td> <td>Soubeyrand, Samuel; Beaudouin, Rémy; Desassis, Nicolas; Monod, Gilles</td> <td>2007</td> <td>2007-12-31</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7125893" target="_blank">PMC7125893</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/17706252.0" target="_blank">17706252.0</a></td> <td><a href="https://doi.org/10.1016/j.mbs.2007.06.005" target="_blank">10.1016/j.mbs.2007.06.005</a></td> <td>cok7vbmg</td> <td>0.721478</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_07.html#b25mi0sp">Zhao_2013</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a></td> <td><a href="Topic_03.html#ge871ypq">Safi_2011</a>, <a href="Topic_04.html#ecxcw96m">Black_2013</a>, <a href="Topic_03.html#rqqke40c">Heffernan_2006</a>, <a href="Topic_02.html#dqg8fkca">Roques_2020</a></td> </tr> <tr> <th id="6riyqn4k";>9</th> <td>Getz_2017</td> <td>Modeling Epidemics: A Primer and Numerus Software Implementation</td> <td>Wayne M. Getz; Richard Salter; Oliver Muellerklein; Hyun S. Yoon; Krti Tallam</td> <td>2017</td> <td>2017-09-22</td> <td>BioRxiv</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/191601" target="_blank">10.1101/191601</a></td> <td>6riyqn4k</td> <td>0.687620</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_08.html#vt6nh3vs">Kenah_2007</a>, <a href="Topic_07.html#7c4jsvlz">Simon_2010</a></td> <td><a href="Topic_01.html#fmc5fwf3">Vincenot_2011</a>, <a href="Topic_03.html#1xz19ai8">Feng_2018</a>, <a href="Topic_03.html#gmpsniqt">Clancy_2015</a>, <a href="Topic_08.html#ygdau2px">Roy_M_2006</a></td> </tr> <tr> <th id="63wqn2fg";>10</th> <td>Höhle_2007</td> <td>RLadyBug—An R package for stochastic epidemic models</td> <td>Höhle, Michael; Feldmann, Ulrike</td> <td>2007</td> <td>2007-10-15</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7114252" target="_blank">PMC7114252</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.csda.2006.11.016" target="_blank">10.1016/j.csda.2006.11.016</a></td> <td>63wqn2fg</td> <td>0.651087</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a></td> <td><a href="Topic_13.html#aqyqofe7">Zimmer_2017</a>, <a href="Topic_04.html#ecxcw96m">Black_2013</a></td> </tr> <tr> <th id="wljou004";>11</th> <td>White_2007</td> <td>Modeling epidemics using cellular automata</td> <td>White, S. Hoya; del Rey, A. Martín; Sánchez, G. Rodríguez</td> <td>2007</td> <td>2007-03-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7127728" target="_blank">PMC7127728</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.amc.2006.06.126" target="_blank">10.1016/j.amc.2006.06.126</a></td> <td>wljou004</td> <td>0.630193</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_08.html#h1i29kcq">Li_C_2018</a></td> <td><a href="Topic_06.html#04p0c4jt">Guo_W_2018</a>, <a href="Topic_06.html#ru2mv7wv">Fan_K_2020</a>, <a href="Topic_03.html#fsqbgyaw">Sherborne_2015</a>, <a href="Topic_01.html#3x2qf3yu">Bin_S_2019</a></td> </tr> <tr> <th id="lhv83zac";>12</th> <td>Bliznashki_2020</td> <td>A Bayesian Logistic Growth Model for the Spread of COVID-19 in New York</td> <td>Svetoslav Bliznashki</td> <td>2020</td> <td>2020-04-07</td> <td>BioRxiv</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.05.20054577" target="_blank">10.1101/2020.04.05.20054577</a></td> <td>lhv83zac</td> <td>0.622302</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_07.html#b25mi0sp">Zhao_2013</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a></td> <td><a href="Topic_10.html#o3hytzwu">Chong_2020</a>, <a href="Topic_02.html#nc5rtwtd">Smeets_2020</a>, <a href="Topic_04.html#ecxcw96m">Black_2013</a>, <a href="Topic_03.html#ge871ypq">Safi_2011</a></td> </tr> <tr> <th id="tjnt01ld";>13</th> <td>Argyroudis_2019</td> <td>Spillover effects of Great Recession on Hong-Kong’s Real Estate Market: An analysis based on Causality Plane and Tsallis Curves of Complexity–Entropy</td> <td>Argyroudis, George S.; Siokis, Fotios M.</td> <td>2019</td> <td>2019-06-15</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7126015" target="_blank">PMC7126015</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.physa.2019.04.052" target="_blank">10.1016/j.physa.2019.04.052</a></td> <td>tjnt01ld</td> <td>0.578203</td> <td><a href="Topic_08.html#h1i29kcq">Li_C_2018</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a></td> <td></td> </tr> <tr> <th id="w4g8mzuy";>14</th> <td>Groendyke_2012</td> <td>A Network-based Analysis of the 1861 Hagelloch Measles Data</td> <td>Groendyke, Chris; Welch, David; Hunter, David R.</td> <td>2012</td> <td>2012-02-24</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4553425" target="_blank">PMC4553425</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/22364540.0" target="_blank">22364540.0</a></td> <td><a href="https://doi.org/10.1111/j.1541-0420.2012.01748.x" target="_blank">10.1111/j.1541-0420.2012.01748.x</a></td> <td>w4g8mzuy</td> <td>0.568272</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_07.html#63wqn2fg">Höhle_2007</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a></td> <td><a href="Topic_03.html#ge871ypq">Safi_2011</a>, <a href="Topic_10.html#3gj754dq">Giardina_2017</a>, <a href="Topic_04.html#a95hh4yk">Small_2005</a></td> </tr> <tr> <th id="v4nhkt4p";>15</th> <td>Getz_2017</td> <td>Discrete Stochastic Analogs of Erlang Epidemic Models</td> <td>Getz, Wayne M.; Dougherty, Eric R.</td> <td>2017</td> <td>2017-11-20</td> <td>None</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6120589" target="_blank">PMC6120589</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/29157162.0" target="_blank">29157162.0</a></td> <td><a href="https://doi.org/10.1080/17513758.2017.1401677" target="_blank">10.1080/17513758.2017.1401677</a></td> <td>v4nhkt4p</td> <td>0.552647</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_07.html#63wqn2fg">Höhle_2007</a>, <a href="Topic_08.html#vt6nh3vs">Kenah_2007</a>, <a href="Topic_07.html#b25mi0sp">Zhao_2013</a></td> <td><a href="Topic_08.html#ygdau2px">Roy_M_2006</a>, <a href="Topic_03.html#6ev4ed6z">Chen_2019</a>, <a href="Topic_13.html#aqyqofe7">Zimmer_2017</a></td> </tr> <tr> <th id="7c4jsvlz";>16</th> <td>Simon_2010</td> <td>Exact epidemic models on graphs using graph-automorphism driven lumping</td> <td>Simon, Péter L.; Taylor, Michael; Kiss, Istvan Z.</td> <td>2010</td> <td>2010-04-28</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7079990" target="_blank">PMC7079990</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/20425114.0" target="_blank">20425114.0</a></td> <td><a href="https://doi.org/10.1007/s00285-010-0344-x" target="_blank">10.1007/s00285-010-0344-x</a></td> <td>7c4jsvlz</td> <td>0.530060</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a></td> <td><a href="Topic_08.html#vt6nh3vs">Kenah_2007</a>, <a href="Topic_08.html#n5i4xez4">Rolls_2015</a>, <a href="Topic_03.html#fsqbgyaw">Sherborne_2015</a>, <a href="Topic_08.html#ygdau2px">Roy_M_2006</a></td> </tr> <tr> <th id="pkac2i3b";>17</th> <td>Kosmidis_2020</td> <td>A Fractal kinetics SI model can explain the dynamics of COVID-19 epidemics</td> <td>Kosmas Kosmidis; Panos Macheras</td> <td>2020</td> <td>2020-04-17</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.11.20061366" target="_blank">10.1101/2020.04.11.20061366</a></td> <td>pkac2i3b</td> <td>0.518695</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_08.html#ogliq8nj">Li_K_2011</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_08.html#h1i29kcq">Li_C_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a></td> <td></td> </tr> <tr> <th id="lwyeqqvy";>18</th> <td>Hu_J_2016</td> <td>Optimal Data Transmission Strategy for Healthcare-Based Wireless Sensor Networks: A Stochastic Differential Game Approach</td> <td>Hu, Jiahui; Qian, Qing; Fang, An; Wu, Sizhu; Xie, Yi</td> <td>2016</td> <td>2016-05-13</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7088864" target="_blank">PMC7088864</a></td> <td></td> <td><a href="https://doi.org/10.1007/s11277-016-3316-7" target="_blank">10.1007/s11277-016-3316-7</a></td> <td>lwyeqqvy</td> <td>0.502758</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#mh30ocvo">Duan_2015</a></td> <td><a href="Topic_07.html#u48mhxbc">Liu_T_2010</a></td> </tr> <tr> <th id="r01erhp3";>19</th> <td>Jo_H_2020</td> <td>Analysis of COVID-19 spread in South Korea using the SIR model with time-dependent parameters and deep learning</td> <td>Hyeontae Jo; Hwijae Son; Se Young Jung; Hyung Ju Hwang</td> <td>2020</td> <td>2020-04-17</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.13.20063412" target="_blank">10.1101/2020.04.13.20063412</a></td> <td>r01erhp3</td> <td>0.502271</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_07.html#63wqn2fg">Höhle_2007</a></td> <td></td> </tr> <tr> <th id="eszlg47q";>20</th> <td>Liao_2013</td> <td>The benefit of modeling jumps in realized volatility for risk prediction: Evidence from Chinese mainland stocks</td> <td>Liao, Yin</td> <td>2013</td> <td>2013-06-30</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7147854" target="_blank">PMC7147854</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.pacfin.2013.01.002" target="_blank">10.1016/j.pacfin.2013.01.002</a></td> <td>eszlg47q</td> <td>0.495585</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_07.html#8k22red9">So_M_2008</a>, <a href="Topic_01.html#mh30ocvo">Duan_2015</a></td> <td></td> </tr> <tr> <th id="wofyftrs";>21</th> <td>Hao_T_2020</td> <td>Prediction of Coronavirus Disease (covid-19) Evolution in USA with the Model Based on the Eyring Rate Process Theory and Free Volume Concept</td> <td>Tian Hao</td> <td>2020</td> <td>2020-04-22</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.16.20068692" target="_blank">10.1101/2020.04.16.20068692</a></td> <td>wofyftrs</td> <td>0.482588</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#5ge7ozpd">Zheng_2020</a>, <a href="Topic_01.html#cx3ex9ru">Leach_2010</a></td> <td></td> </tr> <tr> <th id="l9wrrapv";>22</th> <td>Duchêne_2015</td> <td>Evaluating the Adequacy of Molecular Clock Models Using Posterior Predictive Simulations</td> <td>Duchêne, David A.; Duchêne, Sebastian; Holmes, Edward C.; Ho, Simon Y.W.</td> <td>2015</td> <td>2015-07-10</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7107558" target="_blank">PMC7107558</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/26163668.0" target="_blank">26163668.0</a></td> <td><a href="https://doi.org/10.1093/molbev/msv154" target="_blank">10.1093/molbev/msv154</a></td> <td>l9wrrapv</td> <td>0.476117</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a></td> <td><a href="Topic_10.html#zw5kt090">Hilton_2018</a></td> </tr> <tr> <th id="jf36as70";>23</th> <td>Kim_S_2020</td> <td>AAEDM: Theoretical Dynamic Epidemic Diffusion Model and Covid-19 Korea Pandemic Cases</td> <td>Song-Kyoo Kim</td> <td>2020</td> <td>2020-03-20</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.03.17.20037838" target="_blank">10.1101/2020.03.17.20037838</a></td> <td>jf36as70</td> <td>0.475249</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_01.html#iwwgfh9y">Grassly_2008</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a></td> <td><a href="Topic_02.html#azpz6e7q">Distante_2020</a>, <a href="Topic_02.html#m87tapjp">Peng_2020</a>, <a href="Topic_02.html#tc8eru1w">Zhan_2020</a></td> </tr> <tr> <th id="bph4nuch";>24</th> <td>Fujie_2007</td> <td>Effects of superspreaders in spread of epidemic</td> <td>Fujie, Ryo; Odagaki, Takashi</td> <td>2007</td> <td>2007-02-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7127014" target="_blank">PMC7127014</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.physa.2006.08.050" target="_blank">10.1016/j.physa.2006.08.050</a></td> <td>bph4nuch</td> <td>0.464528</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_08.html#vt6nh3vs">Kenah_2007</a>, <a href="Topic_08.html#ogliq8nj">Li_K_2011</a>, <a href="Topic_08.html#h1i29kcq">Li_C_2018</a></td> <td><a href="Topic_08.html#qzgxe24c">Shang_2013</a>, <a href="Topic_03.html#1tkevj8v">Edholm_2018</a>, <a href="Topic_03.html#qfo5sw0t">James_2006</a>, <a href="Topic_03.html#dqkjofw2">Small_2006</a></td> </tr> <tr> <th id="b39fo4a8";>25</th> <td>Wu_Z_2015</td> <td>Partially latent class models for case–control studies of childhood pneumonia aetiology</td> <td>Wu, Zhenke; Deloria‐Knoll, Maria; Hammitt, Laura L.; Zeger, Scott L.</td> <td>2015</td> <td>2015-03-26</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7169268" target="_blank">PMC7169268</a></td> <td></td> <td><a href="https://doi.org/10.1111/rssc.12101" target="_blank">10.1111/rssc.12101</a></td> <td>b39fo4a8</td> <td>0.456252</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a>, <a href="Topic_08.html#h1i29kcq">Li_C_2018</a>, <a href="Topic_01.html#5ge7ozpd">Zheng_2020</a></td> <td></td> </tr> <tr> <th id="lfm6erzy";>26</th> <td>Ross_2016</td> <td>How domain growth is implemented determines the long term behaviour of a cell population through its effect on spatial correlations</td> <td>Robert J. H. Ross; R. E. Baker; C. A. Yates</td> <td>2016</td> <td>2016-02-26</td> <td>BioRxiv</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/041509" target="_blank">10.1101/041509</a></td> <td>lfm6erzy</td> <td>0.446933</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_10.html#i7navmbn">O'Dea_2010</a></td> <td></td> </tr> <tr> <th id="3y89lumh";>27</th> <td>Menendez_2020</td> <td>Elementary time-delay dynamics of COVID-19 disease</td> <td>Jose Menendez</td> <td>2020</td> <td>2020-03-30</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.03.27.20045328" target="_blank">10.1101/2020.03.27.20045328</a></td> <td>3y89lumh</td> <td>0.446293</td> <td><a href="Topic_08.html#h1i29kcq">Li_C_2018</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a>, <a href="Topic_02.html#a9bnafr7">Renna_2020</a>, <a href="Topic_03.html#tlluxd11">Welch_2011</a></td> <td><a href="Topic_02.html#c800ynvc">Shi_P_2020</a>, <a href="Topic_04.html#5po7q64l">Yong_2016</a>, <a href="Topic_02.html#nc5rtwtd">Smeets_2020</a></td> </tr> <tr> <th id="a47l7m47";>28</th> <td>Souza_2020</td> <td>Using curvature to infer COVID-19 fractal epidemic network fragility and systemic risk</td> <td>Danillo Barros de Souza; Fernando A N Santos; Everlon Figueiroa; Jailson B Correia; Hernande P da Silva; Jose Luiz de Lima Filho; Jones Albuquerque</td> <td>2020</td> <td>2020-04-06</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.01.20047225" target="_blank">10.1101/2020.04.01.20047225</a></td> <td>a47l7m47</td> <td>0.416443</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_08.html#ogliq8nj">Li_K_2011</a>, <a href="Topic_08.html#h1i29kcq">Li_C_2018</a></td> <td><a href="Topic_06.html#vqagpbiu">Denphedtnong_2013</a>, <a href="Topic_14.html#umiql1te">Loberg_2020</a>, <a href="Topic_03.html#a9fds45e">Bombardt_2006</a></td> </tr> <tr> <th id="zriuh5q5";>29</th> <td>Hao_T_2020</td> <td>Infection Dynamics of Coronavirus Disease 2019 (Covid-19) Modeled with the Integration of the Eyring Rate Process Theory and Free Volume Concept</td> <td>Tian Hao</td> <td>2020</td> <td>2020-02-29</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.02.26.20028571" target="_blank">10.1101/2020.02.26.20028571</a></td> <td>zriuh5q5</td> <td>0.415687</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_03.html#tlluxd11">Welch_2011</a>, <a href="Topic_08.html#h1i29kcq">Li_C_2018</a></td> <td></td> </tr> <tr> <th id="qnn4v0k2";>30</th> <td>Maeno_2010</td> <td>Discovering network behind infectious disease outbreak</td> <td>Maeno, Yoshiharu</td> <td>2010</td> <td>2010-11-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7125928" target="_blank">PMC7125928</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.physa.2010.07.014" target="_blank">10.1016/j.physa.2010.07.014</a></td> <td>qnn4v0k2</td> <td>0.408967</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_08.html#vt6nh3vs">Kenah_2007</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_07.html#63wqn2fg">Höhle_2007</a></td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_03.html#1xz19ai8">Feng_2018</a>, <a href="Topic_03.html#fsqbgyaw">Sherborne_2015</a>, <a href="Topic_01.html#tp3qt9pb">Colizza_2007</a></td> </tr> <tr> <th id="q8539o41";>31</th> <td>Grant_2020</td> <td>Dynamics of COVID‐19 epidemics: SEIR models underestimate peak infection rates and overestimate epidemic duration</td> <td>Alastair Grant</td> <td>2020</td> <td>2020-04-06</td> <td>BioRxiv</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.02.20050674" target="_blank">10.1101/2020.04.02.20050674</a></td> <td>q8539o41</td> <td>0.406579</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_08.html#vt6nh3vs">Kenah_2007</a>, <a href="Topic_03.html#tlluxd11">Welch_2011</a>, <a href="Topic_08.html#h1i29kcq">Li_C_2018</a></td> <td><a href="Topic_03.html#kgkcgpmq">Kretzschmar_2020</a>, <a href="Topic_13.html#aqyqofe7">Zimmer_2017</a>, <a href="Topic_03.html#fsqbgyaw">Sherborne_2015</a></td> </tr> <tr> <th id="ewooc2am";>32</th> <td>Brett_2017</td> <td>Anticipating the emergence of infectious diseases</td> <td>Brett, Tobias S.; Drake, John M.; Rohani, Pejman</td> <td>2017</td> <td>2017-07-05</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5550966" target="_blank">PMC5550966</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/28679666.0" target="_blank">28679666.0</a></td> <td><a href="https://doi.org/10.1098/rsif.2017.0115" target="_blank">10.1098/rsif.2017.0115</a></td> <td>ewooc2am</td> <td>0.402905</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#qlypp5z6">Bauer_2009</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a></td> <td><a href="Topic_01.html#q2o71o4d">Dimitrov_2008</a>, <a href="Topic_03.html#6ev4ed6z">Chen_2019</a></td> </tr> <tr> <th id="itviia7v";>33</th> <td>Chandra_2020</td> <td>Stochastic Compartmental Modelling of SARS-CoV-2 with Approximate Bayesian Computation</td> <td>Vedant Chandra</td> <td>2020</td> <td>2020-04-01</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.03.29.20046862" target="_blank">10.1101/2020.03.29.20046862</a></td> <td>itviia7v</td> <td>0.400462</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_02.html#a9bnafr7">Renna_2020</a></td> <td><a href="Topic_02.html#nc5rtwtd">Smeets_2020</a>, <a href="Topic_03.html#ge871ypq">Safi_2011</a>, <a href="Topic_07.html#z19umr4q">Chernyshev_2020</a></td> </tr> <tr> <th id="u48mhxbc";>34</th> <td>Liu_T_2010</td> <td>Integration of small world networks with multi-agent systems for simulating epidemic spatiotemporal transmission</td> <td>Liu, Tao; Li, Xia; Liu, XiaoPing</td> <td>2010</td> <td>2010-05-06</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7089090" target="_blank">PMC7089090</a></td> <td></td> <td><a href="https://doi.org/10.1007/s11434-009-0623-3" target="_blank">10.1007/s11434-009-0623-3</a></td> <td>u48mhxbc</td> <td>0.389794</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_08.html#ogliq8nj">Li_K_2011</a></td> <td><a href="Topic_08.html#xdlk8557">Han_X_2014</a>, <a href="Topic_08.html#auy0h9wc">Song_2015</a>, <a href="Topic_08.html#xbdrf8h9">Kan_J_2017</a>, <a href="Topic_06.html#vqagpbiu">Denphedtnong_2013</a></td> </tr> <tr> <th id="n5i4xez4";>35</th> <td>Rolls_2015</td> <td>A Simulation Study Comparing Epidemic Dynamics on Exponential Random Graph and Edge-Triangle Configuration Type Contact Network Models</td> <td>Rolls, David A.; Wang, Peng; McBryde, Emma; Pattison, Philippa; Robins, Garry</td> <td>2015</td> <td>2015-11-10</td> <td>None</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4640514" target="_blank">PMC4640514</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/26555701.0" target="_blank">26555701.0</a></td> <td><a href="https://doi.org/10.1371/journal.pone.0142181" target="_blank">10.1371/journal.pone.0142181</a></td> <td>n5i4xez4</td> <td>0.388437</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_08.html#vt6nh3vs">Kenah_2007</a></td> <td><a href="Topic_08.html#xdlk8557">Han_X_2014</a>, <a href="Topic_08.html#vt6nh3vs">Kenah_2007</a>, <a href="Topic_07.html#w4g8mzuy">Groendyke_2012</a></td> </tr> <tr> <th id="nexylnv4";>36</th> <td>Abdulrahman_2020</td> <td>SimCOVID: An Open-Source Simulink-Based Program for Simulating the COVID-19 Epidemic</td> <td>Ismael Khorshed Abdulrahman</td> <td>2020</td> <td>2020-04-17</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.13.20063354" target="_blank">10.1101/2020.04.13.20063354</a></td> <td>nexylnv4</td> <td>0.385376</td> <td><a href="Topic_07.html#63wqn2fg">Höhle_2007</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_02.html#a9bnafr7">Renna_2020</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a></td> <td></td> </tr> <tr> <th id="isqqhki4";>37</th> <td>Mummert_2019</td> <td>Parameter identification for a stochastic SEIRS epidemic model: case study influenza</td> <td>Mummert, Anna; Otunuga, Olusegun M.</td> <td>2019</td> <td>2019-05-06</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7080032" target="_blank">PMC7080032</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/31062075.0" target="_blank">31062075.0</a></td> <td><a href="https://doi.org/10.1007/s00285-019-01374-z" target="_blank">10.1007/s00285-019-01374-z</a></td> <td>isqqhki4</td> <td>0.385271</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_04.html#lwwzacy2">Kenah_2012</a>, <a href="Topic_07.html#63wqn2fg">Höhle_2007</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a>, <a href="Topic_03.html#tlluxd11">Welch_2011</a></td> <td><a href="Topic_03.html#ge871ypq">Safi_2011</a>, <a href="Topic_02.html#c800ynvc">Shi_P_2020</a>, <a href="Topic_05.html#ccmd0dw8">Park_2016</a>, <a href="Topic_06.html#vqagpbiu">Denphedtnong_2013</a></td> </tr> <tr> <th id="ueglfhux";>38</th> <td>Dube_2008</td> <td>Mathematical Analysis of Copy Number Variation in a DNA Sample Using Digital PCR on a Nanofluidic Device</td> <td>Dube, Simant; Qin, Jian; Ramakrishnan, Ramesh</td> <td>2008</td> <td>2008-08-06</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2483940" target="_blank">PMC2483940</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/18682853.0" target="_blank">18682853.0</a></td> <td><a href="https://doi.org/10.1371/journal.pone.0002876" target="_blank">10.1371/journal.pone.0002876</a></td> <td>ueglfhux</td> <td>0.384306</td> <td></td> <td></td> </tr> <tr> <th id="oglwveln";>39</th> <td>Walker_2010</td> <td>Parameter inference in small world network disease models with approximate Bayesian Computational methods</td> <td>Walker, David M.; Allingham, David; Lee, Heung Wing Joseph; Small, Michael</td> <td>2010</td> <td>2010-02-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7126433" target="_blank">PMC7126433</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.physa.2009.09.053" target="_blank">10.1016/j.physa.2009.09.053</a></td> <td>oglwveln</td> <td>0.370786</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_07.html#63wqn2fg">Höhle_2007</a></td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a></td> </tr> <tr> <th id="cf2bbn3p";>40</th> <td>Bettencourt_2007</td> <td>Towards Real Time Epidemiology: Data Assimilation, Modeling and Anomaly Detection of Health Surveillance Data Streams</td> <td>Bettencourt, Luís M. A.; Ribeiro, Ruy M.; Chowell, Gerardo; Lant, Timothy; Castillo-Chavez, Carlos</td> <td>2007</td> <td>2007-01-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7122958" target="_blank">PMC7122958</a></td> <td></td> <td><a href="https://doi.org/10.1007/978-3-540-72608-1_8" target="_blank">10.1007/978-3-540-72608-1_8</a></td> <td>cf2bbn3p</td> <td>0.369036</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a></td> <td><a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_01.html#dp4qv77q">Southall_2020</a>, <a href="Topic_01.html#6vty0pmk">Lega_2016</a>, <a href="Topic_01.html#zdft23q8">Cauchemez_2012</a></td> </tr> <tr> <th id="a4d7eqa0";>41</th> <td>Hsu_C_2015</td> <td>Analysis of household data on influenza epidemic with Bayesian hierarchical model</td> <td>Hsu, C.Y.; Yen, A.M.F.; Chen, L.S.; Chen, H.H.</td> <td>2015</td> <td>2015-03-31</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7094348" target="_blank">PMC7094348</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/25484132.0" target="_blank">25484132.0</a></td> <td><a href="https://doi.org/10.1016/j.mbs.2014.11.006" target="_blank">10.1016/j.mbs.2014.11.006</a></td> <td>a4d7eqa0</td> <td>0.366303</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_07.html#63wqn2fg">Höhle_2007</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a></td> <td><a href="Topic_01.html#fiz00uj3">Park_2017</a>, <a href="Topic_03.html#ge871ypq">Safi_2011</a>, <a href="Topic_07.html#w4g8mzuy">Groendyke_2012</a></td> </tr> <tr> <th id="0auqfxur";>42</th> <td>Thomas_2017</td> <td>Extended models for nosocomial infection: parameter estimation and model selection</td> <td>Thomas, Alun; Khader, Karim; Redd, Andrew; Leecaster, Molly; Zhang, Yue; Jones, Makoto; Greene, Tom; Samore, Matthew</td> <td>2017</td> <td>2017-10-12</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6145396" target="_blank">PMC6145396</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/29040678.0" target="_blank">29040678.0</a></td> <td><a href="https://doi.org/10.1093/imammb/dqx010" target="_blank">10.1093/imammb/dqx010</a></td> <td>0auqfxur</td> <td>0.366303</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a></td> <td><a href="Topic_09.html#lm4rfabw">López‐García_2019</a>, <a href="Topic_03.html#ge871ypq">Safi_2011</a></td> </tr> <tr> <th id="msgan1mk";>43</th> <td>Maeno_2011</td> <td>Discovery of a missing disease spreader</td> <td>Maeno, Yoshiharu</td> <td>2011</td> <td>2011-10-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7126838" target="_blank">PMC7126838</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.physa.2011.05.005" target="_blank">10.1016/j.physa.2011.05.005</a></td> <td>msgan1mk</td> <td>0.345857</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_08.html#h1i29kcq">Li_C_2018</a></td> <td><a href="Topic_03.html#6ev4ed6z">Chen_2019</a>, <a href="Topic_03.html#ge871ypq">Safi_2011</a></td> </tr> <tr> <th id="69wk591l";>44</th> <td>Baerwolff_2020</td> <td>A Contribution to the Mathematical Modeling of the Corona/COVID-19 Pandemic</td> <td>Guenter K.F. Baerwolff</td> <td>2020</td> <td>2020-04-06</td> <td>BioRxiv</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.01.20050229" target="_blank">10.1101/2020.04.01.20050229</a></td> <td>69wk591l</td> <td>0.345857</td> <td><a href="Topic_01.html#5ge7ozpd">Zheng_2020</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a></td> <td><a href="Topic_04.html#5po7q64l">Yong_2016</a>, <a href="Topic_04.html#u5qt9es8">Kim_Y_2016</a>, <a href="Topic_03.html#5ab0hag6">Nadeau_2014</a></td> </tr> <tr> <th id="z19umr4q";>45</th> <td>Chernyshev_2020</td> <td>Autocatalytic Model for Covid-19 Progression in a Country</td> <td>Anatoly Chernyshev</td> <td>2020</td> <td>2020-04-07</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.03.20052985" target="_blank">10.1101/2020.04.03.20052985</a></td> <td>z19umr4q</td> <td>0.345341</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a></td> <td><a href="Topic_02.html#nc5rtwtd">Smeets_2020</a>, <a href="Topic_04.html#5po7q64l">Yong_2016</a>, <a href="Topic_02.html#c800ynvc">Shi_P_2020</a></td> </tr> <tr> <th id="04l3474h";>46</th> <td>Buonomo_2012</td> <td>Global stability for an HIV-1 infection model including an eclipse stage of infected cells</td> <td>Buonomo, Bruno; Vargas-De-León, Cruz</td> <td>2012</td> <td>2012-01-15</td> <td>PMC</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1016/j.jmaa.2011.07.006" target="_blank">10.1016/j.jmaa.2011.07.006</a></td> <td>04l3474h</td> <td>0.345341</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_07.html#7c4jsvlz">Simon_2010</a></td> <td><a href="Topic_06.html#cycc3fvl">Fudolig_2020</a>, <a href="Topic_06.html#rmtyrbg0">Saad_2018</a>, <a href="Topic_12.html#5igf77tk">Zhang_2018</a>, <a href="Topic_06.html#bss41lae">Gao_D_2018</a></td> </tr> <tr> <th id="kckzvlcw";>47</th> <td>Shi_Y_2003</td> <td>Stochastic dynamic model of SARS spreading</td> <td>Shi, Yaolin</td> <td>2003</td> <td>2003-01-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7089366" target="_blank">PMC7089366</a></td> <td></td> <td><a href="https://doi.org/10.1007/bf03184164" target="_blank">10.1007/bf03184164</a></td> <td>kckzvlcw</td> <td>0.344891</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_08.html#5w90r6wu">Wu_Q_2014</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a>, <a href="Topic_08.html#h1i29kcq">Li_C_2018</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a></td> <td><a href="Topic_04.html#5q4leivx">Zhou_2004</a>, <a href="Topic_05.html#t0oqk88n">Naheed_2014</a>, <a href="Topic_02.html#c800ynvc">Shi_P_2020</a>, <a href="Topic_04.html#0qaoam29">Ng_T_2003</a></td> </tr> <tr> <th id="98i0dwat";>48</th> <td>Sedov_2020</td> <td>Modeling quarantine during epidemics by mass-testing with drones</td> <td>Leonid Sedov; Alexander Krasnochub; valentin polishchuk</td> <td>2020</td> <td>2020-04-20</td> <td>BioRxiv</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.15.20067025" target="_blank">10.1101/2020.04.15.20067025</a></td> <td>98i0dwat</td> <td>0.343029</td> <td></td> <td></td> </tr> <tr> <th id="qqcb85uk";>49</th> <td>Lekone_2008</td> <td>Bayesian Analysis of Severe Acute Respiratory Syndrome: The 2003 Hong Kong Epidemic</td> <td>Lekone, Phenyo E.</td> <td>2008</td> <td>2008-07-09</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7161832" target="_blank">PMC7161832</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/18615412.0" target="_blank">18615412.0</a></td> <td><a href="https://doi.org/10.1002/bimj.200710431" target="_blank">10.1002/bimj.200710431</a></td> <td>qqcb85uk</td> <td>0.332185</td> <td><a href="Topic_07.html#63wqn2fg">Höhle_2007</a>, <a href="Topic_02.html#z5pg8nij">Griette_2020</a>, <a href="Topic_02.html#a9bnafr7">Renna_2020</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a></td> <td></td> </tr> <tr> <th id="04p0c4jt";>50</th> <td>Guo_W_2018</td> <td>Stochastic persistence and stationary distribution in an SIS epidemic model with media coverage</td> <td>Guo, Wenjuan; Cai, Yongli; Zhang, Qimin; Wang, Weiming</td> <td>2018</td> <td>2018-02-15</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7125861" target="_blank">PMC7125861</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.physa.2017.11.137" target="_blank">10.1016/j.physa.2017.11.137</a></td> <td>04p0c4jt</td> <td>0.331278</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_08.html#vt6nh3vs">Kenah_2007</a>, <a href="Topic_02.html#a9bnafr7">Renna_2020</a></td> <td><a href="Topic_06.html#ru2mv7wv">Fan_K_2020</a>, <a href="Topic_06.html#qgxsd1sr">Zhao_2018</a>, <a href="Topic_06.html#774ywcj0">Chen_2018</a>, <a href="Topic_06.html#396rgxno">Yuan_2018</a></td> </tr> <tr> <th id="p8fqvmy8";>51</th> <td>Wang_2013</td> <td>Modelling the spreading rate of controlled communicable epidemics through an entropy-based thermodynamic model</td> <td>Wang, WenBin; Wu, ZiNiu; Wang, ChunFeng; Hu, RuiFeng</td> <td>2013</td> <td>2013-10-03</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7111546" target="_blank">PMC7111546</a></td> <td></td> <td><a href="https://doi.org/10.1007/s11433-013-5321-0" target="_blank">10.1007/s11433-013-5321-0</a></td> <td>p8fqvmy8</td> <td>0.327593</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a>, <a href="Topic_07.html#63wqn2fg">Höhle_2007</a>, <a href="Topic_08.html#vt6nh3vs">Kenah_2007</a>, <a href="Topic_07.html#7c4jsvlz">Simon_2010</a></td> <td><a href="Topic_03.html#ge871ypq">Safi_2011</a>, <a href="Topic_03.html#6ev4ed6z">Chen_2019</a>, <a href="Topic_06.html#69nnyq8p">Imran_2018</a>, <a href="Topic_02.html#c800ynvc">Shi_P_2020</a></td> </tr> <tr> <th id="yjodgy2v";>52</th> <td>Lan_G_2019</td> <td>A stochastic SIRS epidemic model with non-monotone incidence rate under regime-switching</td> <td>Lan, Guijie; Lin, Ziyan; Wei, Chunjin; Zhang, Shuwen</td> <td>2019</td> <td>2019-11-30</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7127215" target="_blank">PMC7127215</a></td> <td></td> <td><a href="https://doi.org/10.1016/j.jfranklin.2019.09.009" target="_blank">10.1016/j.jfranklin.2019.09.009</a></td> <td>yjodgy2v</td> <td>0.321836</td> <td><a href="Topic_06.html#9nhauvss">Pekalp_2019</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a></td> <td><a href="Topic_06.html#ru2mv7wv">Fan_K_2020</a>, <a href="Topic_06.html#2pw54nmn">Sirijampa_2018</a>, <a href="Topic_06.html#vpatxjd4">Li_F_2018</a>, <a href="Topic_06.html#774ywcj0">Chen_2018</a></td> </tr> <tr> <th id="kgrdul35";>53</th> <td>Shao_2020</td> <td>Dynamic models for Coronavirus Disease 2019 and data analysis</td> <td>Shao, Nian; Zhong, Min; Yan, Yue; Pan, HanShuang; Cheng, Jin; Chen, Wenbin</td> <td>2020</td> <td>2020-03-24</td> <td>PMC</td> <td>Y</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7168448" target="_blank">PMC7168448</a></td> <td></td> <td><a href="https://doi.org/10.1002/mma.6345" target="_blank">10.1002/mma.6345</a></td> <td>kgrdul35</td> <td>0.316921</td> <td></td> <td></td> </tr> <tr> <th id="hp2d68su";>54</th> <td>Cazelles_2018</td> <td>Accounting for non-stationarity in epidemiology by embedding time-varying parameters in stochastic models</td> <td>Cazelles, Bernard; Champagne, Clara; Dureau, Joseph</td> <td>2018</td> <td>2018-08-15</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6110518" target="_blank">PMC6110518</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/30110322.0" target="_blank">30110322.0</a></td> <td><a href="https://doi.org/10.1371/journal.pcbi.1006211" target="_blank">10.1371/journal.pcbi.1006211</a></td> <td>hp2d68su</td> <td>0.316177</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_08.html#ogliq8nj">Li_K_2011</a></td> <td><a href="Topic_03.html#ge871ypq">Safi_2011</a>, <a href="Topic_01.html#h0ivbolt">Angulo_2013</a></td> </tr> <tr> <th id="7axgotby";>55</th> <td>Labadin_2020</td> <td>Transmission Dynamics of 2019-nCoV in Malaysia</td> <td>Jane Labadin; Boon Hao Hong</td> <td>2020</td> <td>2020-02-11</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.02.07.20021188" target="_blank">10.1101/2020.02.07.20021188</a></td> <td>7axgotby</td> <td>0.313889</td> <td><a href="Topic_09.html#evpj67t1">Bifolchi_2013</a>, <a href="Topic_07.html#7c4jsvlz">Simon_2010</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_02.html#a9bnafr7">Renna_2020</a></td> <td><a href="Topic_02.html#c800ynvc">Shi_P_2020</a>, <a href="Topic_04.html#5po7q64l">Yong_2016</a>, <a href="Topic_14.html#y3l6k0qu">Biswas_2020</a></td> </tr> <tr> <th id="qejmwvst";>56</th> <td>Yang_2020</td> <td>Rational evaluation of various epidemic models based on the COVID-19 data of China</td> <td>Wuyue Yang; Dongyan Zhang; Liangrong Peng; Changjing Zhuge; Liu Hong</td> <td>2020</td> <td>2020-03-16</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.03.12.20034595" target="_blank">10.1101/2020.03.12.20034595</a></td> <td>qejmwvst</td> <td>0.304996</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_04.html#kry1sejo">Lloyd_2009</a>, <a href="Topic_09.html#evpj67t1">Bifolchi_2013</a></td> <td><a href="Topic_02.html#m87tapjp">Peng_2020</a>, <a href="Topic_02.html#sflu2was">Ghaffarzadegan_2020</a>, <a href="Topic_02.html#azpz6e7q">Distante_2020</a>, <a href="Topic_02.html#9032hh5c">Caccavo_2020</a></td> </tr> <tr> <th id="osez25uj";>57</th> <td>Hackl_2020</td> <td>Modeling the COVID-19 pandemic - parameter identification and reliability of predictions</td> <td>Klaus Hackl</td> <td>2020</td> <td>2020-04-11</td> <td>BioRxiv</td> <td>Y</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/2020.04.07.20056937" target="_blank">10.1101/2020.04.07.20056937</a></td> <td>osez25uj</td> <td>0.304831</td> <td><a href="Topic_01.html#5ge7ozpd">Zheng_2020</a>, <a href="Topic_01.html#zjnlibu4">Bocharov_2018</a></td> <td><a href="Topic_02.html#nc5rtwtd">Smeets_2020</a>, <a href="Topic_02.html#p42cgpf0">Zareie_2020</a>, <a href="Topic_02.html#m87tapjp">Peng_2020</a>, <a href="Topic_02.html#sflu2was">Ghaffarzadegan_2020</a></td> </tr> <tr> <th id="63hcyb9e";>58</th> <td>Liu_C_2020</td> <td>D(2)EA: Depict the Epidemic Picture of COVID-19</td> <td>Liu, Chenzhengyi; Zhao, Jingwei; Liu, Guohang; Gao, Yuanning; Gao, Xiaofeng</td> <td>2020</td> <td>2020-04-07</td> <td>PMC</td> <td>Y</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7137902" target="_blank">PMC7137902</a></td> <td></td> <td><a href="https://doi.org/10.1007/s12204-020-2170-7" target="_blank">10.1007/s12204-020-2170-7</a></td> <td>63hcyb9e</td> <td>0.300035</td> <td><a href="Topic_01.html#zjnlibu4">Bocharov_2018</a>, <a href="Topic_01.html#3aa8wgr0">Chowell_2017</a>, <a href="Topic_02.html#a9bnafr7">Renna_2020</a></td> <td><a href="Topic_02.html#m87tapjp">Peng_2020</a>, <a href="Topic_02.html#a1sk6mka">Li_S_2020</a></td> </tr> </tbody> </table> </body> </html>
{ "pile_set_name": "Github" }
#region License and Terms // MoreLINQ - Extensions to LINQ to Objects // Copyright (c) 2016 Leandro F. Vieira (leandromoh). 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. #endregion namespace MoreLinq.Test { using NUnit.Framework; [TestFixture] public class AtMostTest { [Test] public void AtMostWithNegativeCount() { AssertThrowsArgument.OutOfRangeException("count", () => new[] { 1 }.AtMost(-1)); } [Test] public void AtMostWithEmptySequenceHasAtMostZeroElements() { foreach (var xs in Enumerable.Empty<int>().ArrangeCollectionTestCases()) Assert.IsTrue(xs.AtMost(0)); } [Test] public void AtMostWithEmptySequenceHasAtMostOneElement() { foreach (var xs in Enumerable.Empty<int>().ArrangeCollectionTestCases()) Assert.IsTrue(xs.AtMost(1)); } [Test] public void AtMostWithSingleElementHasAtMostZeroElements() { foreach (var xs in new[] { 1 }.ArrangeCollectionTestCases()) Assert.IsFalse(xs.AtMost(0)); } [Test] public void AtMostWithSingleElementHasAtMostOneElement() { foreach (var xs in new[] { 1 }.ArrangeCollectionTestCases()) Assert.IsTrue(xs.AtMost(1)); } [Test] public void AtMostWithSingleElementHasAtMostManyElements() { foreach (var xs in new[] { 1 }.ArrangeCollectionTestCases()) Assert.IsTrue(xs.AtMost(2)); } [Test] public void AtMostWithManyElementsHasAtMostOneElements() { foreach (var xs in new[] { 1, 2, 3 }.ArrangeCollectionTestCases()) Assert.IsFalse(xs.AtMost(1)); } [Test] public void AtMostDoesNotIterateUnnecessaryElements() { var source = MoreEnumerable.From(() => 1, () => 2, () => 3, () => throw new TestException()); Assert.IsFalse(source.AtMost(2)); } } }
{ "pile_set_name": "Github" }
## 2.4.0 * Add the ability to bypass CORS preflight requests. ## 2.3.0 * Revert [PR #287](https://github.com/grpc/grpc-dart/pull/287), which allowed using gRPC-web in native environments but also broke streaming. ## 2.2.0+1 * Relax `crypto` version dependency constraint from `^2.1.5` to `^2.1.4`. ## 2.2.0 * Added `applicationDefaultCredentialsAuthenticator` function for creating an authenticator using [Application Default Credentials](https://cloud.google.com/docs/authentication/production). * Less latency by using the `tcpNoDelay` option for sockets. * Support grpc-web in a non-web setting. ## 2.1.3 * Fix bug in grpc-web when receiving an empty trailer. * Fix a state bug in the server. ## 2.1.2 * Fix bug introduced in 2.1.1 where the port would be added to the default authority when making a secure connection. ## 2.1.1 * Fix bug introduced in 2.1.0 where an explicit `authority` would not be used when making a secure connection. ## 2.1.0 * Do a health check of the http2-connection before making request. * Introduce `ChannelOptions.connectionLimit` the longest time a single connection is used for new requests. * Use Tcp.nodelay to improve client call speed. * Use SecureSocket supportedProtocols to save a round trip when establishing a secure connection. * Allow passing http2 `ServerSettings` to `Server.serve`. ## 2.0.3 * GrpcError now implements Exception to indicate it can be reasonably handled. ## 2.0.2 * Fix computation of the audience given to metadata providers to include the scheme. ## 2.0.1 * Fix computation of authority. This should fix authorization. ## 2.0.0+1 * Fix imports to ensure `grpc_web.dart` has no accidental transitive dependencies on dart:io. ## 2.0.0 * Add initial support for grpc-web. See `example/grpc-web` for an example of this working. * **Breaking**: `grpc.dart` no longer exposes `ClientConnection`. It was supposed to be an internal abstraction. * **Breaking**: `grpc.dart` no longer exposes the deprecated `ServerHandler`. It was supposed to be an internal abstraction. * `service_api.dart` no longer exports Server - it has never been used by the generated code. ## 1.0.3 * Allow custom user agent with a `userAgent` argument for `ChannelOptions()`. * Allow specifying `authority` for `ChannelCredentials.insecure()`. * Add `userAgent` as an optional named argument for `clientConnection.createCallHeaders()`. ## 1.0.2 * Fix bug where the server would crash if the client would break the connection. ## 1.0.1 * Add `service_api.dart` that only contains the minimal imports needed by the code generated by protoc_plugin. ## 1.0.0+1 * Support package:http2 1.0.0. ## 1.0.0 * Graduate package to 1.0. ## 0.6.8+1 * Removes stray files that where published by accident in version 0.6.8. ## 0.6.8 * Calling `terminate()` or `shutdown()` on a channel doesn't throw error if the channel is not yet open. ## 0.6.7 * Support package:test 1.5. ## 0.6.6 * Support `package:http` `>=0.11.3+17 <0.13.0`. * Update `package:googleapis_auth` to `^0.2.5+3`. ## 0.6.5 * Interceptors are now async. ## 0.6.4 * Update dependencies to be compatible with Dart 2. ## 0.6.3 * Make fields of `StatusCode` const rather than final. ## 0.6.2 * Allow for non-ascii header values. ## 0.6.1 * More fixes to update to Dart 2 core library APIs. ## 0.6.0+1 * Updated implementation to use new Dart 2 APIs using [dart2_fix](https://github.com/dart-lang/dart2_fix). ## 0.6.0 * Dart SDK upper constraint raised to declare compatability with Dart 2.0 stable. ## 0.5.0 * Breaking change: The package now exclusively supports Dart 2. * Fixed tests to pass in Dart 2. * Added support for Interceptors ([issue #79](https://github.com/grpc/grpc-dart/issues/79)); thanks to [@mogol](https://github.com/mogol) for contributing! ## 0.4.1 * Fixes for supporting Dart 2. ## 0.4.0 * Moved TLS credentials for server into a separate class. * Added support for specifying the address for the server, and support for serving on an ephemeral port. ## 0.3.1 * Split out TLS credentials to a separate class. ## 0.3.0 * Added authentication metadata providers, optimized for use with Google Cloud. * Added service URI to metadata provider API, needed for Json Web Token generation. * Added authenticated cloud-to-prod interoperability tests. * Refactored connection logic to throw initial connection errors early. ## 0.2.1 * Updated generated code in examples using latest protoc compiler plugin. * Dart 2.0 fixes. * Changed license to Apache 2.0. ## 0.2.0 * Implemented support for per-RPC metadata providers. This can be used for authentication providers which may need to obtain or refresh a token before the RPC is sent. ## 0.1.0 * Core gRPC functionality is implemented and passes [gRPC compliance tests](https://github.com/grpc/grpc/blob/master/doc/interop-test-descriptions.md). The API is shaping up, but may still change as more advanced features are implemented. ## 0.0.1 * Initial version. This package is in a very early and experimental state. We do not recommend using it for anything but experiments.
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: services/IcalFeed.js</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow-night.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> <!-- webfonts --> <link href='http://fonts.googleapis.com/css?family=Lato:400,400italic' rel='stylesheet' type='text/css'> </head> <body> <h1 class="page-title">Source: services/IcalFeed.js</h1> <div id="main"> <section> <article> <pre class="prettyprint source"><code>'use strict'; /** * Provides access for fetching the user's ical feed url * @module services/Products * @extends module:services/ServiceGetOnly * @requires module:services/ServiceGetOnly */ var ServiceGetOnly = require('./ServiceGetOnly'); module.exports = ServiceGetOnly.extend({ 'baseUrl': '/ical/feed', 'type': 'ical_feed', 'getURL': function (requestID) { var self = this; return self.get(self.baseUrl, undefined, requestID).promise(); } }); </code></pre> </article> </section> </div> <nav class="index-nav"> <h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-config_default.html">config/default</a></li><li><a href="module-helpers_HealthCheck.html">helpers/HealthCheck</a></li><li><a href="module-helpers_Logger.html">helpers/Logger</a></li><li><a href="module-helpers_PlatformHeaders.html">helpers/PlatformHeaders</a></li><li><a href="module-helpers_URL.html">helpers/URL</a></li><li><a href="module-io_IO.html">io/IO</a></li><li><a href="module-io_io_AjaxTransport.html">io/io/AjaxTransport</a></li><li><a href="module-io_io_NativeWebSocket.html">io/io/NativeWebSocket</a></li><li><a href="module-io_io_NativeXMLHttpRequest.html">io/io/NativeXMLHttpRequest</a></li><li><a href="module-io_io_WebSocket.html">io/io/WebSocket</a></li><li><a href="module-io_mixins_RequestQueueMixin.html">io/mixins/RequestQueueMixin</a></li><li><a href="module-io_RestSocket.html">io/RestSocket</a></li><li><a href="module-services_Activities.html">services/Activities</a></li><li><a href="module-services_AuthenticatedService.html">services/AuthenticatedService</a></li><li><a href="module-services_Conversations.html">services/Conversations</a></li><li><a href="module-services_Export.html">services/Export</a></li><li><a href="module-services_Features.html">services/Features</a></li><li><a href="module-services_Files.html">services/Files</a></li><li><a href="module-services_Import.html">services/Import</a></li><li><a href="module-services_ListPositions.html">services/ListPositions</a></li><li><a href="module-services_Lists.html">services/Lists</a></li><li><a href="module-services_Memberships.html">services/Memberships</a></li><li><a href="module-services_Mixin_ServiceCreate.html">services/Mixin/ServiceCreate</a></li><li><a href="module-services_Mixin_ServiceDelete.html">services/Mixin/ServiceDelete</a></li><li><a href="module-services_Mixin_ServiceGet.html">services/Mixin/ServiceGet</a></li><li><a href="module-services_Mixin_ServiceUpdate.html">services/Mixin/ServiceUpdate</a></li><li><a href="module-services_Mixins_BaseServiceMixin.html">services/Mixins/BaseServiceMixin</a></li><li><a href="module-services_Notes.html">services/Notes</a></li><li><a href="module-services_Previews.html">services/Previews</a></li><li><a href="module-services_Products.html">services/Products</a></li><li><a href="module-services_Reminders.html">services/Reminders</a></li><li><a href="module-services_Root.html">services/Root</a></li><li><a href="module-services_Service.html">services/Service</a></li><li><a href="module-services_ServiceGetOnly.html">services/ServiceGetOnly</a></li><li><a href="module-services_Services.html">services/Services</a></li><li><a href="module-services_Settings.html">services/Settings</a></li><li><a href="module-services_SubtaskPositions.html">services/SubtaskPositions</a></li><li><a href="module-services_Subtasks.html">services/Subtasks</a></li><li><a href="module-services_TaskComments.html">services/TaskComments</a></li><li><a href="module-services_TaskCommentsStates.html">services/TaskCommentsStates</a></li><li><a href="module-services_TaskPositions.html">services/TaskPositions</a></li><li><a href="module-services_Tasks.html">services/Tasks</a></li><li><a href="module-services_TasksCount.html">services/TasksCount</a></li><li><a href="module-services_UnreadCounts.html">services/UnreadCounts</a></li><li><a href="module-services_Uploads.html">services/Uploads</a></li><li><a href="module-services_User.html">services/User</a></li><li><a href="module-services_Users.html">services/Users</a></li><li><a href="module-validators_SchemaValidator.html">validators/SchemaValidator</a></li><li><a href="module-wunderbits_lib_SafeParse.html">wunderbits/lib/SafeParse</a></li><li><a href="module-wunderlist_Wunderlist.html">wunderlist/Wunderlist</a></li></ul><h3>Events</h3><ul><li><a href="module-io_IO.html#event:unauthorized">unauthorized</a></li><li><a href="module-io_io_WebSocket.html#event:close">close</a></li><li><a href="module-io_io_WebSocket.html#event:error">error</a></li><li><a href="module-io_io_WebSocket.html#event:message">message</a></li><li><a href="module-io_io_WebSocket.html#event:open">open</a></li><li><a href="module-io_io_WebSocket.html#event:timeout">timeout</a></li><li><a href="module-io_RestSocket.html#event:desktopNotification">desktopNotification</a></li><li><a href="module-io_RestSocket.html#event:event">event</a></li><li><a href="module-io_RestSocket.html#event:someCRUDOperation">someCRUDOperation</a></li><li><a href="module-io_RestSocket.html#event:unauthorized">unauthorized</a></li><li><a href="module-wunderlist_Wunderlist.html#event:desktopNotification">desktopNotification</a></li><li><a href="module-wunderlist_Wunderlist.html#event:event">event</a></li></ul> </nav> <br clear="both"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-beta1</a> on Mon Mar 02 2015 14:06:12 GMT+0100 (CET) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # # Copyright 2014-2020 BigML # # 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. """Centroid structure for the BigML local Cluster This module defines an auxiliary Centroid predicate structure that is used in the cluster. """ import math import sys INDENT = " " * 4 STATISTIC_MEASURES = [ 'Minimum', 'Mean', 'Median', 'Maximum', 'Standard deviation', 'Sum', 'Sum squares', 'Variance'] def cosine_distance2(terms, centroid_terms, scale): """Returns the distance defined by cosine similarity """ # Centroid values for the field can be an empty list. # Then the distance for an empty input is 1 # (before applying the scale factor). if not terms and not centroid_terms: return 0 if not terms or not centroid_terms: return scale ** 2 input_count = 0 for term in centroid_terms: if term in terms: input_count += 1 cosine_similarity = input_count / math.sqrt( len(terms) * len(centroid_terms)) similarity_distance = scale * (1 - cosine_similarity) return similarity_distance ** 2 class Centroid(): """A Centroid. """ def __init__(self, centroid_info): self.center = centroid_info.get('center', {}) self.count = centroid_info.get('count', 0) self.centroid_id = centroid_info.get( 'id', centroid_info.get("centroid_id", None)) self.name = centroid_info.get('name', None) self.distance = centroid_info.get('distance', {}) def distance2(self, input_data, term_sets, scales, stop_distance2=None): """Squared Distance from the given input data to the centroid """ distance2 = 0.0 for field_id, value in list(self.center.items()): if isinstance(value, list): # text field terms = ([] if field_id not in term_sets else term_sets[field_id]) distance2 += cosine_distance2(terms, value, scales[field_id]) elif isinstance(value, str): if field_id not in input_data or input_data[field_id] != value: distance2 += 1 * scales[field_id] ** 2 else: distance2 += ((input_data[field_id] - value) * scales[field_id]) ** 2 if stop_distance2 is not None and distance2 >= stop_distance2: return None return distance2 def print_statistics(self, out=sys.stdout): """Print the statistics for the training data clustered around the centroid """ out.write("%s%s:\n" % (INDENT, self.name)) literal = "%s%s: %s\n" for measure_title in STATISTIC_MEASURES: measure = measure_title.lower().replace(" ", "_") out.write(literal % (INDENT * 2, measure_title, self.distance[measure])) out.write("\n")
{ "pile_set_name": "Github" }
{ "type": "bundle", "id": "bundle--7b067d45-5cf4-4e46-8d0b-0ef162724acf", "spec_version": "2.0", "objects": [ { "created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5", "object_marking_refs": [ "marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168" ], "source_ref": "attack-pattern--0c2d00da-7742-49e7-9928-4514e5075d32", "target_ref": "attack-pattern--aedfca76-3b30-4866-b2aa-0f1d7fd1e4b6", "relationship_type": "subtechnique-of", "id": "relationship--6c99a74d-8a17-453b-9100-ebb3cca33faa", "type": "relationship", "modified": "2020-03-13T14:10:43.600Z", "created": "2020-03-13T14:10:43.600Z" } ] }
{ "pile_set_name": "Github" }
#include <unittest/runtime_static_assert.h> #include <unittest/unittest.h> #include <thrust/generate.h> template<typename T> struct dependent_false { enum { value = false }; }; template<typename T> struct static_assertion { __host__ __device__ int operator()() const { THRUST_STATIC_ASSERT(dependent_false<T>::value); return 0; } }; template<typename V> void TestStaticAssertAssert() { #if THRUST_DEVICE_SYSTEM != THRUST_DEVICE_SYSTEM_OMP && THRUST_HOST_SYSTEM != THRUST_HOST_SYSTEM_OMP V test(10); ASSERT_STATIC_ASSERT(thrust::generate(test.begin(), test.end(), static_assertion<int>())); #endif } DECLARE_VECTOR_UNITTEST(TestStaticAssertAssert);
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <seqTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/seq_template.xsd" identifier="pretestpost"> <metadata> <version> 1.0</version> <thumbnail>pretestpost.png</thumbnail> <title>PreTest-PostTest</title> <description>Stellt ein Vorabtest/Nachtest Szenario zur Verfügung </description> <replacenode>true</replacenode> </metadata> <item type="lesson"> <title>Vorabtest/Nachtest</title> <sequencing> <controlMode flow="false" choice="false"/> </sequencing> <item type="sco" nocopy="true" nodelete="true"> <title>Vorabtest</title> <sequencing> <controlMode choiceExit="false"/> <objectives> <primaryObjective satisfiedByMeasure="false" objectiveID="primary_obj"/> <objective satisfiedByMeasure="false" objectiveID="Vorabtest Lernziel 1"> <mapInfo targetObjectiveID="gobj1" readSatisfiedStatus="false" readNormalizedMeasure="false" writeSatisfiedStatus="true" writeNormalizedMeasure="true"/> </objective> <objective satisfiedByMeasure="false" objectiveID="Vorabtest Lernziel 2"> <mapInfo targetObjectiveID="gobj2" readSatisfiedStatus="false" readNormalizedMeasure="false" writeSatisfiedStatus="true" writeNormalizedMeasure="true"/> </objective> <objective satisfiedByMeasure="false" objectiveID="Vorabtest Lernziel 3"> <mapInfo targetObjectiveID="gobj2" readSatisfiedStatus="false" readNormalizedMeasure="false" writeSatisfiedStatus="true" writeNormalizedMeasure="true"/> </objective> </objectives> </sequencing> </item> <item type="sco"> <title>SCO 1</title> <sequencing> <sequencingRules> <preConditionRule> <ruleConditions conditionCombination="all"> <ruleCondition operator="noOp" referencedObjective="SCO 1 Objective" condition="satisfied"/> </ruleConditions> <ruleAction action="skip"/> </preConditionRule> </sequencingRules> <objectives> <primaryObjective objectiveID="SCO 1 Objective"> <mapInfo targetObjectiveID="gobj1" readSatisfiedStatus="true" readNormalizedMeasure="true" writeSatisfiedStatus="false" writeNormalizedMeasure="false"/> </primaryObjective> </objectives> </sequencing> </item> <item type="sco"> <title>SCO 2</title> <sequencing> <sequencingRules> <preConditionRule> <ruleConditions conditionCombination="all"> <ruleCondition operator="noOp" referencedObjective="SCO 2 Objective" condition="satisfied"/> </ruleConditions> <ruleAction action="skip"/> </preConditionRule> </sequencingRules> <objectives> <primaryObjective objectiveID="SCO 2 Objective"> <mapInfo targetObjectiveID="gobj2" readSatisfiedStatus="true" readNormalizedMeasure="true" writeSatisfiedStatus="false" writeNormalizedMeasure="false"/> </primaryObjective> </objectives> </sequencing> </item> <item type="sco"> <title>SCO 3</title> <sequencing> <sequencingRules> <preConditionRule> <ruleConditions conditionCombination="all"> <ruleCondition operator="noOp" referencedObjective="SCO 3 Objective" condition="satisfied"/> </ruleConditions> <ruleAction action="skip"/> </preConditionRule> </sequencingRules> <objectives> <primaryObjective objectiveID="SCO 3 Objective"> <mapInfo targetObjectiveID="gobj3" readSatisfiedStatus="true" readNormalizedMeasure="true" writeSatisfiedStatus="false" writeNormalizedMeasure="false"/> </primaryObjective> </objectives> </sequencing> </item> <item type="sco"> <title>Nachtest</title> <sequencing> <controlMode choiceExit="false"/> </sequencing> </item> </item> </seqTemplate>
{ "pile_set_name": "Github" }
// Type definitions for connect v3.4.0 // Project: https://github.com/senchalabs/connect // Definitions by: Maxime LUCE <https://github.com/SomaticIT> // Evan Hahn <https://github.com/EvanHahn> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// <reference types="node" /> import * as http from "http"; /** * Create a new connect server. * @public */ declare function createServer(): createServer.Server; declare namespace createServer { export type ServerHandle = HandleFunction | http.Server; export class IncomingMessage extends http.IncomingMessage { originalUrl?: http.IncomingMessage["url"]; } type NextFunction = (err?: any) => void; export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void; export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void; export type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void; export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction; export interface ServerStackItem { route: string; handle: ServerHandle; } export interface Server extends NodeJS.EventEmitter { (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void; route: string; stack: ServerStackItem[]; /** * Utilize the given middleware `handle` to the given `route`, * defaulting to _/_. This "route" is the mount-point for the * middleware, when given a value other than _/_ the middleware * is only effective when that segment is present in the request's * pathname. * * For example if we were to mount a function at _/admin_, it would * be invoked on _/admin_, and _/admin/settings_, however it would * not be invoked for _/_, or _/posts_. * * @public */ use(fn: HandleFunction): Server; use(route: string, fn: HandleFunction): Server; /** * Handle server requests, punting them down * the middleware stack. * * @private */ handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void; /** * Listen for connections. * * This method takes the same arguments * as node's `http.Server#listen()`. * * HTTP and HTTPS: * * If you run your application both as HTTP * and HTTPS you may wrap them individually, * since your Connect "server" is really just * a JavaScript `Function`. * * var connect = require('connect') * , http = require('http') * , https = require('https'); * * var app = connect(); * * http.createServer(app).listen(80); * https.createServer(options, app).listen(443); * * @api public */ listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server; listen(port: number, hostname?: string, callback?: Function): http.Server; listen(path: string, callback?: Function): http.Server; listen(handle: any, listeningListener?: Function): http.Server; } } export = createServer;
{ "pile_set_name": "Github" }
--TEST-- Test krsort() function : usage variations - sort octal values --FILE-- <?php /* Prototype : bool krsort ( array &$array [, int $sort_flags] ) * Description: Sort an array by key in reverse order, maintaining key to data correlation. * Source code: ext/standard/array.c */ /* * testing krsort() by providing array of octal values for $array argument * with following flag values: * 1.flag value as defualt * 2.SORT_REGULAR - compare items normally * 3.SORT_NUMERIC - compare items numerically */ echo "*** Testing krsort() : usage variations ***\n"; // an array containing unsorted octal values $unsorted_oct_array = array ( 01235 => 01, 0321 => 02, 0345 => 03, 066 => 04, 0772 => 05, 077 => 06, -066 => -01, -0345 => -02, 0 => 0 ); echo "\n-- Testing krsort() by supplying octal value array, 'flag' value is defualt --\n"; $temp_array = $unsorted_oct_array; var_dump( krsort($temp_array) ); // expecting : bool(true) var_dump($temp_array); echo "\n-- Testing krsort() by supplying octal value array, 'flag' value is SORT_REGULAR --\n"; $temp_array = $unsorted_oct_array; var_dump( krsort($temp_array, SORT_REGULAR) ); // expecting : bool(true) var_dump($temp_array); echo "\n-- Testing krsort() by supplying octal value array, 'flag' value is SORT_NUMERIC --\n"; $temp_array = $unsorted_oct_array; var_dump( krsort($temp_array, SORT_NUMERIC) ); // expecting : bool(true) var_dump($temp_array); echo "Done\n"; ?> --EXPECTF-- *** Testing krsort() : usage variations *** -- Testing krsort() by supplying octal value array, 'flag' value is defualt -- bool(true) array(9) { [669]=> int(1) [506]=> int(5) [229]=> int(3) [209]=> int(2) [63]=> int(6) [54]=> int(4) [0]=> int(0) [-54]=> int(-1) [-229]=> int(-2) } -- Testing krsort() by supplying octal value array, 'flag' value is SORT_REGULAR -- bool(true) array(9) { [669]=> int(1) [506]=> int(5) [229]=> int(3) [209]=> int(2) [63]=> int(6) [54]=> int(4) [0]=> int(0) [-54]=> int(-1) [-229]=> int(-2) } -- Testing krsort() by supplying octal value array, 'flag' value is SORT_NUMERIC -- bool(true) array(9) { [669]=> int(1) [506]=> int(5) [229]=> int(3) [209]=> int(2) [63]=> int(6) [54]=> int(4) [0]=> int(0) [-54]=> int(-1) [-229]=> int(-2) } Done
{ "pile_set_name": "Github" }
# BSE Version v0.8.4+29.gb6d6a1b # Data downloaded at 2019-06-24T14:04 # cc-pvqz(fi/sf/lc) version number 0 # Description: VQZ3P Relativistic Valence Quadruple Zeta + Polarization # Role: orbital # # ******************************************************************************** # If you downloaded data from the basis set # exchange or used the basis set exchange python library, please cite: # ******************************************************************************** # Pritchard, Benjamin P., Altarawy, Doaa, Windus, Theresa L. # A New Basis Set Exchange: An Open, Up-to-date Resource for the # Molecular Sciences Community # Manuscript in preparation # # Feller, David # The role of databases in support of computational chemistry # calculations # J. Comput. Chem., 17, 1571-1586 (1996) # 10.1002/(SICI)1096-987X(199610)17:13<1571::AID-JCC9>3.0.CO;2-P # # Schuchardt, Karen L., Didier, Brett T., Elsethagen, Todd, Sun, Lisong, # Gurumoorthi, Vidhya, Chase, Jared, Li, Jun, Windus, Theresa L. # Basis Set Exchange: A Community Database for Computational Sciences # J. Chem. Inf. Model., 47, 1045-1052 (2007) # 10.1021/ci600510j # # ******************************************************************************** # References for the basis set # ******************************************************************************** # H,B-Ne # ## VQZ3P Relativistic Valence Quadruple Zeta + Polarization # Dunning, Thom H. # Gaussian basis sets for use in correlated molecular calculations. I. # The atoms boron through neon and hydrogen # J. Chem. Phys., 90, 1007-1023 (1989) # 10.1063/1.456153 # # Dyall, K. G. # unpublished # As referenced in the original BSE # # He # ## VQZ3P Relativistic Valence Quadruple Zeta + Polarization # Woon, David E., Dunning, Thom H. # Gaussian basis sets for use in correlated molecular calculations. IV. # Calculation of static electrical response properties # J. Chem. Phys., 100, 2975-2988 (1994) # 10.1063/1.466439 # # Dyall, K. G. # unpublished # As referenced in the original BSE # # Al-Ar # ## VQZ3P Relativistic Valence Quadruple Zeta + Polarization # Woon, David E., Dunning, Thom H. # Gaussian basis sets for use in correlated molecular calculations. III. # The atoms aluminum through argon # J. Chem. Phys., 98, 1358-1371 (1993) # 10.1063/1.464303 # # Dyall, K. G. # unpublished # As referenced in the original BSE # # Ga-Kr # ## VQZ3P Relativistic Valence Quadruple Zeta + Polarization # Wilson, Angela K., Woon, David E., Peterson, Kirk A., Dunning, Thom H. # Gaussian basis sets for use in correlated molecular calculations. IX. # The atoms gallium through krypton # J. Chem. Phys., 110, 7667-7676 (1999) # 10.1063/1.478678 # # Dyall, K. G. # unpublished # As referenced in the original BSE # # # basis "H_cc-pvqz(fi/sf/lc)" #basis SET: (6s,3p,2d,1f) -> [4s,3p,2d,1f] H S 8.2640000E+01 2.00729302215E-03 1.2410000E+01 1.53462366860E-02 2.8240000E+00 7.55857416019E-02 H S 7.9770000E-01 9.99943624293E-01 H S 2.5810000E-01 9.99984071916E-01 H S 8.9890000E-02 9.99994846080E-01 H P 2.2920000E+00 9.99990282146E-01 H P 8.3800000E-01 9.99923749413E-01 H P 2.9200000E-01 9.99972113877E-01 H D 2.0620000E+00 9.99969159381E-01 H D 6.6200000E-01 9.99903971971E-01 H F 1.3970000E+00 9.99916347331E-01 end basis "He_cc-pvqz(fi/sf/lc)" #basis SET: (7s,3p,2d,1f) -> [4s,3p,2d,1f] He S 5.2850000E+02 9.42026267648E-04 7.9310000E+01 7.22022660716E-03 1.8050000E+01 3.59895515901E-02 5.0850000E+00 1.27800075971E-01 He S 1.6090000E+00 9.99898512984E-01 He S 5.3630000E-01 9.99967875136E-01 He S 1.8330000E-01 9.99989291116E-01 He P 5.9940000E+00 9.99981363934E-01 He P 1.7450000E+00 9.99800725698E-01 He P 5.6000000E-01 9.99941941278E-01 He D 4.2990000E+00 9.99943032240E-01 He D 1.2230000E+00 9.99799908755E-01 He F 2.6800000E+00 9.99839588776E-01 end basis "B_cc-pvqz(fi/sf/lc)" #basis SET: (21s,6p,3d,2f,1g) -> [5s,4p,3d,2f,1g] B S 2.3870000E+04 9.20038404807E-05 3.5750000E+03 6.97396983354E-04 8.1280000E+02 3.62775323451E-03 2.2970000E+02 1.50095525864E-02 7.4690000E+01 5.15416581891E-02 2.6810000E+01 1.43427069670E-01 1.0320000E+01 3.00973140612E-01 4.1780000E+00 4.03352478013E-01 1.7270000E+00 2.25128152429E-01 B S 2.3870000E+04 -1.85523371176E-05 3.5750000E+03 -1.41458646731E-04 8.1280000E+02 -7.31421701431E-04 2.2970000E+02 -3.07778165717E-03 7.4690000E+01 -1.06096990649E-02 2.6810000E+01 -3.14129518664E-02 1.0320000E+01 -7.10495904497E-02 4.1780000E+00 -1.32136660946E-01 1.7270000E+00 -1.22845445968E-01 B S 4.7040000E-01 9.99965519627E-01 B S 1.8960000E-01 9.99990606945E-01 B S 7.3940000E-02 9.99996213907E-01 B P 2.2260000E+01 5.10668508160E-03 5.0580000E+00 3.32153227966E-02 1.4870000E+00 1.32304641737E-01 B P 5.0710000E-01 9.99950522982E-01 B P 1.8120000E-01 9.99983124213E-01 B P 6.4630000E-02 9.99993969483E-01 B D 1.1100000E+00 9.99993243984E-01 B D 4.0200000E-01 9.99948294322E-01 B D 1.4500000E-01 9.99981270763E-01 B F 8.8200000E-01 9.99981370589E-01 B F 3.1100000E-01 9.99947176687E-01 B G 6.7300000E-01 9.99950735872E-01 end basis "C_cc-pvqz(fi/sf/lc)" #basis SET: (21s,6p,3d,2f,1g) -> [5s,4p,3d,2f,1g] C S 3.3980000E+04 9.59379458711E-05 5.0890000E+03 7.19386474522E-04 1.1570000E+03 3.73428341757E-03 3.2660000E+02 1.54503868962E-02 1.0610000E+02 5.30893887981E-02 3.8110000E+01 1.47235488099E-01 1.4750000E+01 3.05692152833E-01 6.0350000E+00 3.99135357763E-01 2.5300000E+00 2.16708571026E-01 C S 3.3980000E+04 -2.04714320586E-05 5.0890000E+03 -1.54419422227E-04 1.1570000E+03 -7.96826546060E-04 3.2660000E+02 -3.35482830167E-03 1.0610000E+02 -1.15861745078E-02 3.8110000E+01 -3.43243601477E-02 1.4750000E+01 -7.74388576531E-02 6.0350000E+00 -1.41959574593E-01 2.5300000E+00 -1.18004016630E-01 C S 7.3550000E-01 9.99949491805E-01 C S 2.9050000E-01 9.99985313795E-01 C S 1.1110000E-01 9.99994199115E-01 C P 3.4510000E+01 5.35421475763E-03 7.9150000E+00 3.59322237232E-02 2.3680000E+00 1.41660184394E-01 C P 8.1320000E-01 9.99921222130E-01 C P 2.8900000E-01 9.99972939023E-01 C P 1.0070000E-01 9.99990381982E-01 C D 1.8480000E+00 9.99989376974E-01 C D 6.4900000E-01 9.99913933305E-01 C D 2.2800000E-01 9.99969764911E-01 C F 1.4190000E+00 9.99970949368E-01 C F 4.8500000E-01 9.99915030582E-01 C G 1.0110000E+00 9.99926004076E-01 end basis "N_cc-pvqz(fi/sf/lc)" #basis SET: (21s,6p,3d,2f,1g) -> [5s,4p,3d,2f,1g] N S 4.5840000E+04 9.96119785410E-05 6.8680000E+03 7.38059802198E-04 1.5630000E+03 3.80552587537E-03 4.4240000E+02 1.56564639615E-02 1.4430000E+02 5.33685438240E-02 5.2180000E+01 1.47058757514E-01 2.0340000E+01 3.04756856984E-01 8.3810000E+00 3.97430822095E-01 3.5290000E+00 2.17141413613E-01 N S 4.5840000E+04 -2.20452872918E-05 6.8680000E+03 -1.64329445704E-04 1.5630000E+03 -8.42245030764E-04 4.4240000E+02 -3.52800001405E-03 1.4430000E+02 -1.20909820523E-02 5.2180000E+01 -3.56793671737E-02 2.0340000E+01 -8.05904703241E-02 8.3810000E+00 -1.47649191712E-01 3.5290000E+00 -1.16498802046E-01 N S 1.0540000E+00 9.99929555781E-01 N S 4.1180000E-01 9.99978954835E-01 N S 1.5520000E-01 9.99991777030E-01 N P 4.9330000E+01 5.50036819239E-03 1.1370000E+01 3.77153837221E-02 3.4350000E+00 1.47897531685E-01 N P 1.1820000E+00 9.99885747816E-01 N P 4.1730000E-01 9.99960669066E-01 N P 1.4280000E-01 9.99986112440E-01 N D 2.8370000E+00 9.99984392034E-01 N D 9.6800000E-01 9.99867906179E-01 N D 3.3500000E-01 9.99954907282E-01 N F 2.0270000E+00 9.99958972429E-01 N F 6.8500000E-01 9.99878647967E-01 N G 1.4270000E+00 9.99895574177E-01 end basis "O_cc-pvqz(fi/sf/lc)" #basis SET: (21s,6p,3d,2f,1g) -> [5s,4p,3d,2f,1g] O S 6.1420000E+04 9.93282124731E-05 9.1990000E+03 7.26105699197E-04 2.0910000E+03 3.73679568518E-03 5.9090000E+02 1.53787554725E-02 1.9230000E+02 5.27108072573E-02 6.9320000E+01 1.46268259336E-01 2.6970000E+01 3.05362547939E-01 1.1100000E+01 3.98051483260E-01 4.6820000E+00 2.16410845540E-01 O S 6.1420000E+04 -2.25609037684E-05 9.1990000E+03 -1.65918620543E-04 2.0910000E+03 -8.48810139420E-04 5.9090000E+02 -3.55671826622E-03 1.9230000E+02 -1.22603080765E-02 6.9320000E+01 -3.64626280209E-02 2.6970000E+01 -8.32412617540E-02 1.1100000E+01 -1.52379965162E-01 4.6820000E+00 -1.14781142768E-01 O S 1.4280000E+00 9.99906551971E-01 O S 5.5470000E-01 9.99971488367E-01 O S 2.0670000E-01 9.99988923726E-01 O P 6.3420000E+01 6.07711655765E-03 1.4660000E+01 4.18181725025E-02 4.4590000E+00 1.60967222146E-01 O P 1.5310000E+00 9.99851716130E-01 O P 5.3020000E-01 9.99949059379E-01 O P 1.7500000E-01 9.99982355542E-01 O D 3.7750000E+00 9.99979314200E-01 O D 1.3000000E+00 9.99824274074E-01 O D 4.4400000E-01 9.99939446748E-01 O F 2.6660000E+00 9.99948553776E-01 O F 8.5900000E-01 9.99840426010E-01 O G 1.8460000E+00 9.99864935128E-01 end basis "F_cc-pvqz(fi/sf/lc)" #basis SET: (21s,6p,3d,2f,1g) -> [5s,4p,3d,2f,1g] F S 7.4530000E+04 1.07517528937E-04 1.1170000E+04 7.74508950965E-04 2.5430000E+03 3.95440637481E-03 7.2100000E+02 1.61343512258E-02 2.3590000E+02 5.46592384340E-02 8.5600000E+01 1.49950602831E-01 3.3550000E+01 3.08362054754E-01 1.3930000E+01 3.94223044307E-01 5.9150000E+00 2.10345904761E-01 F S 7.4530000E+04 -2.49013496437E-05 1.1170000E+04 -1.80450992154E-04 2.5430000E+03 -9.16075976114E-04 7.2100000E+02 -3.80698307269E-03 2.3590000E+02 -1.29828053255E-02 8.5600000E+01 -3.82722586473E-02 3.3550000E+01 -8.64324490043E-02 1.3930000E+01 -1.55951467585E-01 5.9150000E+00 -1.09975382396E-01 F S 1.8430000E+00 9.99881958501E-01 F S 7.1240000E-01 9.99963204100E-01 F S 2.6370000E-01 9.99985775012E-01 F P 8.0390000E+01 6.40945832124E-03 1.8630000E+01 4.43103313144E-02 5.6940000E+00 1.68614350960E-01 F P 1.9530000E+00 9.99810689005E-01 F P 6.7020000E-01 9.99935023284E-01 F P 2.1660000E-01 9.99977697072E-01 F D 5.0140000E+00 9.99972699464E-01 F D 1.7250000E+00 9.99766672722E-01 F D 5.8600000E-01 9.99919659240E-01 F F 3.5620000E+00 9.99931251869E-01 F F 1.1480000E+00 9.99786858593E-01 F G 2.3760000E+00 9.99826194084E-01 end basis "Ne_cc-pvqz(fi/sf/lc)" #basis SET: (21s,6p,3d,2f,1g) -> [5s,4p,3d,2f,1g] Ne S 9.9920000E+04 1.00590511845E-04 1.4960000E+04 7.11660130025E-04 3.3990000E+03 3.62998236217E-03 9.5890000E+02 1.49143256300E-02 3.1120000E+02 5.14121777930E-02 1.1170000E+02 1.44297884709E-01 4.3320000E+01 3.04732530484E-01 1.7800000E+01 3.99336405413E-01 7.5030000E+00 2.17770207340E-01 Ne S 9.9920000E+04 -2.36527289247E-05 1.4960000E+04 -1.68359181530E-04 3.3990000E+03 -8.53578893651E-04 9.5890000E+02 -3.57137869209E-03 3.1120000E+02 -1.23809654722E-02 1.1170000E+02 -3.72823642587E-02 4.3320000E+01 -8.63701074897E-02 1.7800000E+01 -1.58499494124E-01 7.5030000E+00 -1.13110151113E-01 Ne S 2.3370000E+00 9.99850293989E-01 Ne S 9.0010000E-01 9.99953343813E-01 Ne S 3.3010000E-01 9.99982027445E-01 Ne P 9.9680000E+01 6.64834501988E-03 2.3150000E+01 4.61236139750E-02 7.1080000E+00 1.73558741110E-01 Ne P 2.4410000E+00 9.99763738176E-01 Ne P 8.3390000E-01 9.99918794674E-01 Ne P 2.6620000E-01 9.99972250292E-01 Ne D 6.4710000E+00 9.99965200240E-01 Ne D 2.2130000E+00 9.99698983203E-01 Ne D 7.4700000E-01 9.99896943836E-01 Ne F 4.6570000E+00 9.99908746359E-01 Ne F 1.5240000E+00 9.99721436807E-01 Ne G 2.9830000E+00 9.99781844907E-01 end basis "Al_cc-pvqz(fi/sf/lc)" #basis SET: (42s,19p,3d,2f,1g) -> [6s,5p,3d,2f,1g] Al S 4.1960000E+05 4.01849004695E-05 6.2830000E+04 2.52243149988E-04 1.4290000E+04 1.23313428188E-03 4.0380000E+03 5.01385396906E-03 1.3120000E+03 1.76828659304E-02 4.7050000E+02 5.45569850928E-02 1.8180000E+02 1.42222551221E-01 7.4460000E+01 2.89552568505E-01 3.1900000E+01 3.83614073203E-01 1.3960000E+01 2.31325240750E-01 5.1800000E+00 2.90572914402E-02 2.2650000E+00 -2.97059682132E-03 9.6640000E-01 1.64943012901E-03 Al S 4.1960000E+05 -1.05058170417E-05 6.2830000E+04 -6.58659186653E-05 1.4290000E+04 -3.23259432020E-04 4.0380000E+03 -1.31318919170E-03 1.3120000E+03 -4.69519615677E-03 4.7050000E+02 -1.47201196956E-02 1.8180000E+02 -4.08229594507E-02 7.4460000E+01 -9.27503596977E-02 3.1900000E+01 -1.64614619515E-01 1.3960000E+01 -1.39395277255E-01 5.1800000E+00 1.98458713090E-01 2.2650000E+00 5.72395503895E-01 9.6640000E-01 3.71159996086E-01 Al S 4.1960000E+05 2.42677329007E-06 6.2830000E+04 1.52043444773E-05 1.4290000E+04 7.47111861635E-05 4.0380000E+03 3.03098776225E-04 1.3120000E+03 1.08658294337E-03 4.7050000E+02 3.40380288877E-03 1.8180000E+02 9.50826921398E-03 7.4460000E+01 2.17151930759E-02 3.1900000E+01 3.96454055357E-02 1.3960000E+01 3.43752192474E-02 5.1800000E+00 -5.36284366714E-02 2.2650000E+00 -1.92717376312E-01 9.6640000E-01 -2.52253651086E-01 Al S 2.4470000E-01 9.99980703755E-01 Al S 1.1840000E-01 9.99995113653E-01 Al S 5.0210000E-02 9.99997635670E-01 Al P 8.9130000E+02 5.33679514194E-04 2.1130000E+02 4.25560715893E-03 6.8280000E+01 2.14733724519E-02 2.5700000E+01 7.67259038486E-02 1.0630000E+01 1.94528188205E-01 4.6020000E+00 3.34349680916E-01 2.0150000E+00 3.74677209227E-01 8.7060000E-01 2.03830066672E-01 Al P 8.9130000E+02 -9.63487596209E-05 2.1130000E+02 -7.62813396156E-04 6.8280000E+01 -3.90735168069E-03 2.5700000E+01 -1.39829832439E-02 1.0630000E+01 -3.66992023667E-02 4.6020000E+00 -6.26952744626E-02 2.0150000E+00 -7.88138211048E-02 8.7060000E-01 -2.86811819340E-02 Al P 2.9720000E-01 9.99971029219E-01 Al P 1.1000000E-01 9.99990109098E-01 Al P 3.9890000E-02 9.99996339043E-01 Al D 4.9400000E-01 9.99996253844E-01 Al D 1.9900000E-01 9.99976985012E-01 Al D 8.0400000E-02 9.99990728079E-01 Al F 4.0100000E-01 9.99990774670E-01 Al F 1.5400000E-01 9.99975980153E-01 Al G 3.5700000E-01 9.99973863995E-01 end basis "Si_cc-pvqz(fi/sf/lc)" #basis SET: (42s,19p,3d,2f,1g) -> [6s,5p,3d,2f,1g] Si S 5.1300000E+05 3.99317299111E-05 7.6820000E+04 2.43075635081E-04 1.7470000E+04 1.17404628593E-03 4.9350000E+03 4.74958342607E-03 1.6020000E+03 1.67354422036E-02 5.7410000E+02 5.17450214770E-02 2.2150000E+02 1.36204865309E-01 9.0540000E+01 2.81693451152E-01 3.8740000E+01 3.84006669136E-01 1.6950000E+01 2.43819786583E-01 6.4520000E+00 3.39423865132E-02 2.8740000E+00 -3.30420074285E-03 1.2500000E+00 1.85327767331E-03 Si S 5.1300000E+05 -1.06962296749E-05 7.6820000E+04 -6.50668356559E-05 1.7470000E+04 -3.15299245303E-04 4.9350000E+03 -1.27542299214E-03 1.6020000E+03 -4.54938691988E-03 5.7410000E+02 -1.43028505057E-02 2.2150000E+02 -3.99098988567E-02 9.0540000E+01 -9.20300712510E-02 3.8740000E+01 -1.65767689282E-01 1.6950000E+01 -1.50363491601E-01 6.4520000E+00 1.72231326419E-01 2.8740000E+00 5.69454214943E-01 1.2500000E+00 3.94611612489E-01 Si S 5.1300000E+05 2.74647800778E-06 7.6820000E+04 1.66926600859E-05 1.7470000E+04 8.10164274481E-05 4.9350000E+03 3.27127308382E-04 1.6020000E+03 1.17073544261E-03 5.7410000E+02 3.67500146451E-03 2.2150000E+02 1.03412863476E-02 9.0540000E+01 2.39513757713E-02 3.8740000E+01 4.45051224727E-02 1.6950000E+01 4.13192199498E-02 6.4520000E+00 -5.14691473962E-02 2.8740000E+00 -2.18068675596E-01 1.2500000E+00 -2.84936499149E-01 Si S 3.5990000E-01 9.99975041850E-01 Si S 1.6990000E-01 9.99992813347E-01 Si S 7.0660000E-02 9.99996607286E-01 Si P 1.1220000E+03 4.95766476511E-04 2.6600000E+02 3.92752446839E-03 8.5920000E+01 2.00684845919E-02 3.2330000E+01 7.30945450777E-02 1.3370000E+01 1.90181450636E-01 5.8000000E+00 3.35617759693E-01 2.5590000E+00 3.78908484305E-01 1.1240000E+00 2.00863442663E-01 Si P 1.1220000E+03 -1.06021711683E-04 2.6600000E+02 -8.30070602072E-04 8.5920000E+01 -4.33007832545E-03 3.2330000E+01 -1.57261949466E-02 1.3370000E+01 -4.27660729197E-02 5.8000000E+00 -7.46428841368E-02 2.5590000E+00 -9.67108890268E-02 1.1240000E+00 -2.08581954943E-02 Si P 3.9880000E-01 9.99962598613E-01 Si P 1.5330000E-01 9.99986728067E-01 Si P 5.7280000E-02 9.99994897997E-01 Si D 7.6000000E-01 9.99994408779E-01 Si D 3.0200000E-01 9.99964594740E-01 Si D 1.2000000E-01 9.99985929417E-01 Si F 5.4100000E-01 9.99987300437E-01 Si F 2.1200000E-01 9.99967595666E-01 Si G 4.6100000E-01 9.99966251558E-01 end basis "P_cc-pvqz(fi/sf/lc)" #basis SET: (42s,19p,3d,2f,1g) -> [6s,5p,3d,2f,1g] P S 6.1520000E+05 4.01848359877E-05 9.2120000E+04 2.37254497427E-04 2.0950000E+04 1.13112665862E-03 5.9200000E+03 4.54406867857E-03 1.9220000E+03 1.59746426487E-02 6.8800000E+02 4.95623664356E-02 2.6500000E+02 1.31272644316E-01 1.0820000E+02 2.75040500023E-01 4.6220000E+01 3.83951873055E-01 2.0230000E+01 2.53778160269E-01 7.8590000E+00 3.86400534318E-02 3.5470000E+00 -3.62610179018E-03 1.5640000E+00 2.05300805217E-03 P S 6.1520000E+05 -1.09890966906E-05 9.2120000E+04 -6.48651048150E-05 2.0950000E+04 -3.10116144822E-04 5.9200000E+03 -1.24647647026E-03 1.9220000E+03 -4.43101702004E-03 6.8800000E+02 -1.39849210818E-02 2.6500000E+02 -3.91584786787E-02 1.0820000E+02 -9.13904363023E-02 4.6220000E+01 -1.66809186356E-01 2.0230000E+01 -1.59056154300E-01 7.8590000E+00 1.51165800637E-01 3.5470000E+00 5.67146696703E-01 1.5640000E+00 4.12384475755E-01 P S 6.1520000E+05 3.03112842845E-06 9.2120000E+04 1.78753111441E-05 2.0950000E+04 8.56061811701E-05 5.9200000E+03 3.43404455891E-04 1.9220000E+03 1.22511794564E-03 6.8800000E+02 3.85981229241E-03 2.6500000E+02 1.09044903181E-02 1.0820000E+02 2.55600439460E-02 4.6220000E+01 4.81935544769E-02 2.0230000E+01 4.71012793666E-02 7.8590000E+00 -4.83218341262E-02 3.5470000E+00 -2.37184750120E-01 1.5640000E+00 -3.10281243514E-01 P S 4.8880000E-01 9.99968773440E-01 P S 2.2660000E-01 9.99990239549E-01 P S 9.3310000E-02 9.99995475078E-01 P P 1.3670000E+03 4.75163237382E-04 3.2400000E+02 3.73664837525E-03 1.0460000E+02 1.92209125178E-02 3.9370000E+01 7.10224768316E-02 1.6260000E+01 1.88581408644E-01 7.0560000E+00 3.38644831848E-01 3.1300000E+00 3.81311756497E-01 1.3940000E+00 1.94797950703E-01 P P 1.3670000E+03 -1.13073797359E-04 3.2400000E+02 -8.78827796731E-04 1.0460000E+02 -4.61749911675E-03 3.9370000E+01 -1.70305274145E-02 1.6260000E+01 -4.73590489276E-02 7.0560000E+00 -8.45558482115E-02 3.1300000E+00 -1.09404023898E-01 1.3940000E+00 -1.23952756688E-02 P P 5.1790000E-01 9.99953616586E-01 P P 2.0320000E-01 9.99982764834E-01 P P 7.6980000E-02 9.99993237329E-01 P D 1.0360000E+00 9.99992312160E-01 P D 4.1300000E-01 9.99951740453E-01 P D 1.6500000E-01 9.99980758326E-01 P F 7.0300000E-01 9.99983227368E-01 P F 2.8000000E-01 9.99957894582E-01 P G 5.9700000E-01 9.99956297795E-01 end basis "S_cc-pvqz(fi/sf/lc)" #basis SET: (42s,19p,3d,2f,1g) -> [6s,5p,3d,2f,1g] S S 7.2780000E+05 4.07394010250E-05 1.0900000E+05 2.33140449801E-04 2.4800000E+04 1.09616575862E-03 7.0140000E+03 4.36576949050E-03 2.2780000E+03 1.53174695993E-02 8.1470000E+02 4.75885989999E-02 3.1340000E+02 1.26894223588E-01 1.2770000E+02 2.69097336533E-01 5.4480000E+01 3.83236533397E-01 2.3850000E+01 2.62870426386E-01 9.4280000E+00 4.31266052302E-02 4.2900000E+00 -3.72506348141E-03 1.9090000E+00 2.14590456848E-03 S S 7.2780000E+05 -1.13411674765E-05 1.0900000E+05 -6.49117785027E-05 2.4800000E+04 -3.05948096625E-04 7.0140000E+03 -1.21974403535E-03 2.2780000E+03 -4.32348083459E-03 8.1470000E+02 -1.36679652960E-02 3.1340000E+02 -3.84373513640E-02 1.2770000E+02 -9.07059276615E-02 5.4480000E+01 -1.67378625831E-01 2.3850000E+01 -1.66687387914E-01 9.4280000E+00 1.32853998712E-01 4.2900000E+00 5.65570113936E-01 1.9090000E+00 4.27111247973E-01 S S 7.2780000E+05 3.29733972344E-06 1.0900000E+05 1.88533718148E-05 2.4800000E+04 8.90310373395E-05 7.0140000E+03 3.54144152531E-04 2.2780000E+03 1.26029097312E-03 8.1470000E+02 3.97542882288E-03 3.1340000E+02 1.12876071370E-02 1.2770000E+02 2.67407416515E-02 5.4480000E+01 5.10539276705E-02 2.3850000E+01 5.21152555132E-02 9.4280000E+00 -4.43597723056E-02 4.2900000E+00 -2.52838914580E-01 1.9090000E+00 -3.30159171124E-01 S S 6.2700000E-01 9.99961886672E-01 S S 2.8730000E-01 9.99987480136E-01 S S 1.1720000E-01 9.99994263012E-01 S P 1.5460000E+03 5.05576352674E-04 3.6640000E+02 3.92727365160E-03 1.1840000E+02 2.01969621692E-02 4.4530000E+01 7.47758079725E-02 1.8380000E+01 1.97847008432E-01 7.9650000E+00 3.51775262721E-01 3.5410000E+00 3.77958177181E-01 1.5910000E+00 1.70431621275E-01 S P 1.5460000E+03 -1.29526760781E-04 3.6640000E+02 -9.97191402159E-04 1.1840000E+02 -5.22767770500E-03 4.4530000E+01 -1.94083451823E-02 1.8380000E+01 -5.37145221056E-02 7.9650000E+00 -9.59118200663E-02 3.5410000E+00 -1.17940129612E-01 1.5910000E+00 1.06147782741E-02 S P 6.2050000E-01 9.99947063593E-01 S P 2.4200000E-01 9.99979350802E-01 S P 9.0140000E-02 9.99991946088E-01 S D 1.2500000E+00 9.99990541719E-01 S D 5.0400000E-01 9.99941774974E-01 S D 2.0300000E-01 9.99976519182E-01 S F 8.6900000E-01 9.99979933108E-01 S F 3.3500000E-01 9.99947955039E-01 S G 6.8300000E-01 9.99950004066E-01 end basis "Cl_cc-pvqz(fi/sf/lc)" #basis SET: (42s,19p,3d,2f,1g) -> [6s,5p,3d,2f,1g] Cl S 8.3490000E+05 4.23745430557E-05 1.2500000E+05 2.35797851539E-04 2.8430000E+04 1.09556610920E-03 8.0330000E+03 4.33830051874E-03 2.6080000E+03 1.51581583891E-02 9.3390000E+02 4.68703817798E-02 3.6000000E+02 1.24813085448E-01 1.4700000E+02 2.65155100322E-01 6.2880000E+01 3.81271598741E-01 2.7600000E+01 2.68080872375E-01 1.1080000E+01 4.64082433810E-02 5.0750000E+00 -3.64759544128E-03 2.2780000E+00 2.15134604140E-03 Cl S 8.3490000E+05 -1.19811435070E-05 1.2500000E+05 -6.67018279444E-05 2.8430000E+04 -3.10604713032E-04 8.0330000E+03 -1.23171395020E-03 2.6080000E+03 -4.34559768282E-03 9.3390000E+02 -1.36793133733E-02 3.6000000E+02 -3.83728179440E-02 1.4700000E+02 -9.07056259031E-02 6.2880000E+01 -1.68005568378E-01 2.7600000E+01 -1.71790733830E-01 1.1080000E+01 1.20658331608E-01 5.0750000E+00 5.64589084221E-01 2.2780000E+00 4.36279863627E-01 Cl S 8.3490000E+05 3.62777745209E-06 1.2500000E+05 2.01755182681E-05 2.8430000E+04 9.41397953211E-05 8.0330000E+03 3.72415761581E-04 2.6080000E+03 1.31948932443E-03 9.3390000E+02 4.14338051669E-03 3.6000000E+02 1.17415775123E-02 1.4700000E+02 2.78566868550E-02 6.2880000E+01 5.34574920370E-02 2.7600000E+01 5.60351763106E-02 1.1080000E+01 -4.16321118554E-02 5.0750000E+00 -2.66508492591E-01 2.2780000E+00 -3.45147888859E-01 Cl S 7.7750000E-01 9.99954521402E-01 Cl S 3.5270000E-01 9.99984475225E-01 Cl S 1.4310000E-01 9.99992957115E-01 Cl P 1.7030000E+03 5.50891586254E-04 4.0360000E+02 4.24633390384E-03 1.3030000E+02 2.17723130325E-02 4.9050000E+01 8.01509033308E-02 2.0260000E+01 2.09554028999E-01 8.7870000E+00 3.64851750443E-01 3.9190000E+00 3.70870626386E-01 1.7650000E+00 1.45746638178E-01 Cl P 1.7030000E+03 -1.49022847240E-04 4.0360000E+02 -1.14318897388E-03 1.3030000E+02 -5.95478254495E-03 4.9050000E+01 -2.21209109774E-02 2.0260000E+01 -6.03004844330E-02 8.7870000E+00 -1.06841064133E-01 3.9190000E+00 -1.21999945482E-01 1.7650000E+00 3.90633070865E-02 Cl P 7.2070000E-01 9.99941276063E-01 Cl P 2.8390000E-01 9.99976016754E-01 Cl P 1.0600000E-01 9.99990551702E-01 Cl D 1.5510000E+00 9.99988165655E-01 Cl D 6.2800000E-01 9.99927759958E-01 Cl D 2.5400000E-01 9.99970743085E-01 Cl F 1.0890000E+00 9.99974662539E-01 Cl F 4.2300000E-01 9.99934783825E-01 Cl G 8.2700000E-01 9.99939466704E-01 end basis "Ar_cc-pvqz(fi/sf/lc)" #basis SET: (42s,19p,3d,2f,1g) -> [6s,5p,3d,2f,1g] Ar S 9.5060000E+05 4.41358976364E-05 1.4230000E+05 2.38884671834E-04 3.2360000E+04 1.09568442702E-03 9.1450000E+03 4.30312755279E-03 2.9700000E+03 1.49797972145E-02 1.0640000E+03 4.61612875948E-02 4.1080000E+02 1.22756089963E-01 1.6800000E+02 2.61499474691E-01 7.1990000E+01 3.79500368790E-01 3.1670000E+01 2.72832123010E-01 1.2890000E+01 4.96426671914E-02 5.9290000E+00 -3.52264299272E-03 2.6780000E+00 2.14226560888E-03 Ar S 9.5060000E+05 -1.26509708779E-05 1.4230000E+05 -6.85265404858E-05 3.2360000E+04 -3.14960551515E-04 9.1450000E+03 -1.23918645056E-03 2.9700000E+03 -4.35377472602E-03 1.0640000E+03 -1.36636874097E-02 4.1080000E+02 -3.82323680610E-02 1.6800000E+02 -9.05984652815E-02 7.1990000E+01 -1.68455869931E-01 3.1670000E+01 -1.76318509026E-01 1.2890000E+01 1.09488843633E-01 5.9290000E+00 5.63934608225E-01 2.6780000E+00 4.44298033128E-01 Ar S 9.5060000E+05 3.95709501210E-06 1.4230000E+05 2.14119816327E-05 3.2360000E+04 9.86185141203E-05 9.1450000E+03 3.87043189101E-04 2.9700000E+03 1.36581932376E-03 1.0640000E+03 4.27535743239E-03 4.1080000E+02 1.20894275603E-02 1.6800000E+02 2.87512049699E-02 7.1990000E+01 5.54391683965E-02 3.1670000E+01 5.95101164127E-02 1.2890000E+01 -3.87102982768E-02 5.9290000E+00 -2.77983383416E-01 2.6780000E+00 -3.57981761274E-01 Ar S 9.4160000E-01 9.99946538044E-01 Ar S 4.2390000E-01 9.99981198888E-01 Ar S 1.7140000E-01 9.99991535424E-01 Ar P 1.8900000E+03 5.85341076710E-04 4.4780000E+02 4.46504846923E-03 1.4460000E+02 2.28415743284E-02 5.4460000E+01 8.38999926875E-02 2.2510000E+01 2.17840984791E-01 9.7740000E+00 3.74369932106E-01 4.3680000E+00 3.65399254356E-01 1.9590000E+00 1.28641837561E-01 Ar P 1.8900000E+03 -1.63971097074E-04 4.4780000E+02 -1.24915074746E-03 1.4460000E+02 -6.47335726986E-03 5.4460000E+01 -2.41231889277E-02 2.2510000E+01 -6.51250664253E-02 9.7740000E+00 -1.15340274690E-01 4.3680000E+00 -1.23033516512E-01 1.9590000E+00 6.57688097702E-02 Ar P 8.2600000E-01 9.99934823735E-01 Ar P 3.2970000E-01 9.99972513140E-01 Ar P 1.2420000E-01 9.99989027553E-01 Ar D 1.8730000E+00 9.99985510128E-01 Ar D 7.6300000E-01 9.99912769542E-01 Ar D 3.1100000E-01 9.99964455010E-01 Ar F 1.3250000E+00 9.99967475893E-01 Ar F 5.4300000E-01 9.99920656826E-01 Ar G 1.0070000E+00 9.99926296720E-01 end basis "Ga_cc-pvqz(fi/sf/lc)" #basis SET: (75s,42p,12d,2f,1g) -> [7s,6p,4d,2f,1g] Ga S 1.1274496E+07 2.75217073254E-05 1.6880534E+06 1.00797260103E-04 3.8414083E+05 3.45279577303E-04 1.0880703E+05 1.10812780379E-03 3.5497691E+04 3.41086666968E-03 1.2815104E+04 9.93434040015E-03 4.9981087E+03 2.71290284816E-02 2.0728848E+03 6.80090804076E-02 9.0374582E+02 1.50354546804E-01 4.1044307E+02 2.71348820509E-01 1.9260636E+02 3.42698680695E-01 9.2049678E+01 2.28719189582E-01 4.2047811E+01 4.55621077201E-02 2.1069217E+01 -2.15995223069E-03 1.0447915E+01 1.67343046314E-03 4.7776580E+00 -7.75205592957E-04 2.2825660E+00 3.29459658419E-04 1.0353030E+00 -1.31539030381E-04 Ga S 1.1274496E+07 -8.73703150781E-06 1.6880534E+06 -3.20826591395E-05 3.8414083E+05 -1.10239916783E-04 1.0880703E+05 -3.54654301282E-04 3.5497691E+04 -1.09638903437E-03 1.2815104E+04 -3.21014507553E-03 4.9981087E+03 -8.89617272868E-03 2.0728848E+03 -2.29272810876E-02 9.0374582E+02 -5.40937283888E-02 4.1044307E+02 -1.10741285047E-01 1.9260636E+02 -1.80594690263E-01 9.2049678E+01 -1.61981675965E-01 4.2047811E+01 1.32108590833E-01 2.1069217E+01 5.45421194170E-01 1.0447915E+01 4.28785422348E-01 4.7776580E+00 6.85678122426E-02 2.2825660E+00 -4.98058791511E-04 1.0353030E+00 1.47839463077E-03 Ga S 1.1274496E+07 3.34510825257E-06 1.6880534E+06 1.22843689615E-05 3.8414083E+05 4.22456651593E-05 1.0880703E+05 1.35851045843E-04 3.5497691E+04 4.20644296171E-04 1.2815104E+04 1.23066852547E-03 4.9981087E+03 3.42310715938E-03 2.0728848E+03 8.83238415164E-03 9.0374582E+02 2.10739450283E-02 4.1044307E+02 4.36914583495E-02 1.9260636E+02 7.42149333906E-02 9.2049678E+01 6.95259076728E-02 4.2047811E+01 -6.54550324402E-02 2.1069217E+01 -3.67029166945E-01 1.0447915E+01 -4.08426436542E-01 4.7776580E+00 2.31621963284E-01 2.2825660E+00 7.14032270083E-01 1.0353030E+00 3.46232986312E-01 Ga S 1.1274496E+07 -7.84674212943E-07 1.6880534E+06 -2.88042996760E-06 3.8414083E+05 -9.91449108453E-06 1.0880703E+05 -3.18407195377E-05 3.5497691E+04 -9.87912243106E-05 1.2815104E+04 -2.88289693154E-04 4.9981087E+03 -8.04824948542E-04 2.0728848E+03 -2.06863579673E-03 9.0374582E+02 -4.96815581525E-03 4.1044307E+02 -1.02494562109E-02 1.9260636E+02 -1.76717720866E-02 9.2049678E+01 -1.63276262944E-02 4.2047811E+01 1.52593963706E-02 2.1069217E+01 9.45687897235E-02 1.0447915E+01 1.05577817797E-01 4.7776580E+00 -6.84865333233E-02 2.2825660E+00 -2.68676513268E-01 1.0353030E+00 -2.42934829531E-01 Ga S 2.5767400E-01 9.99979328115E-01 Ga S 1.1917900E-01 9.99994854586E-01 Ga S 5.1294000E-02 9.99997620115E-01 Ga P 2.2059771E+04 1.54834387674E-04 5.2223129E+03 7.00889296770E-04 1.6960601E+03 3.37206897825E-03 6.4876573E+02 1.34198454899E-02 2.7510267E+02 4.49870053169E-02 1.2534634E+02 1.21704664925E-01 6.0054334E+01 2.50782707959E-01 2.9723768E+01 3.59025419438E-01 1.5039781E+01 2.90904730409E-01 7.5722730E+00 9.61086287691E-02 3.7386760E+00 8.49978691651E-03 1.7967880E+00 1.35467057614E-03 8.2991000E-01 7.99966709851E-05 Ga P 2.2059771E+04 -5.89109150849E-05 5.2223129E+03 -2.67474091586E-04 1.6960601E+03 -1.28996813350E-03 6.4876573E+02 -5.17956885063E-03 2.7510267E+02 -1.76255063176E-02 1.2534634E+02 -4.92675257102E-02 6.0054334E+01 -1.05805231679E-01 2.9723768E+01 -1.60951388502E-01 1.5039781E+01 -1.10306139367E-01 7.5722730E+00 1.51597047975E-01 3.7386760E+00 4.29485837142E-01 1.7967880E+00 4.20076923667E-01 8.2991000E-01 1.55788104935E-01 Ga P 2.2059771E+04 9.63084461061E-06 5.2223129E+03 4.34471472032E-05 1.6960601E+03 2.11568948884E-04 6.4876573E+02 8.41375504284E-04 2.7510267E+02 2.90028360735E-03 1.2534634E+02 8.03157407094E-03 6.0054334E+01 1.75960683566E-02 2.9723768E+01 2.63344955534E-02 1.5039781E+01 1.86577674127E-02 7.5722730E+00 -3.24088916038E-02 3.7386760E+00 -8.03166027514E-02 1.7967880E+00 -9.96454452746E-02 8.2991000E-01 -6.98666631836E-03 Ga P 2.7287400E-01 9.99972383047E-01 Ga P 1.0154000E-01 9.99990918634E-01 Ga P 3.7658000E-02 9.99996620598E-01 Ga D 7.6643696E+02 1.94138940190E-04 2.3100425E+02 1.71738579125E-03 8.9781238E+01 9.39414818443E-03 3.9546681E+01 3.48426555615E-02 1.8607583E+01 9.58440907089E-02 9.1512870E+00 1.94427360295E-01 4.5650050E+00 2.82184529304E-01 2.2530660E+00 3.07803651827E-01 1.0867230E+00 2.52677232548E-01 Ga D 5.0330400E-01 9.99949378303E-01 Ga D 2.1228300E-01 9.99976551604E-01 Ga D 8.2800000E-02 9.99990109224E-01 Ga F 4.7100000E-01 9.99989157338E-01 Ga F 1.8100000E-01 9.99971787813E-01 Ga G 4.0320000E-01 9.99970482238E-01 end basis "Ge_cc-pvqz(fi/sf/lc)" #basis SET: (75s,42p,12d,2f,1g) -> [7s,6p,4d,2f,1g] Ge S 1.2360507E+07 2.84556798351E-05 1.8506978E+06 1.03263157286E-04 4.2113142E+05 3.48355246949E-04 1.1927826E+05 1.10376994200E-03 3.8912277E+04 3.36460807454E-03 1.4048682E+04 9.73204240900E-03 5.4806992E+03 2.64554386357E-02 2.2742055E+03 6.61647260312E-02 9.9224129E+02 1.46432303009E-01 4.5099966E+02 2.66021132360E-01 2.1182024E+02 3.41751074593E-01 1.0141102E+02 2.35985382799E-01 4.6914090E+01 5.06109879625E-02 2.3508950E+01 -1.72505814730E-03 1.1681311E+01 1.68052207029E-03 5.4345260E+00 -7.90587253534E-04 2.6088080E+00 3.39314201283E-04 1.1984420E+00 -1.43068150572E-04 Ge S 1.2360507E+07 -9.07782677129E-06 1.8506978E+06 -3.30329182132E-05 4.2113142E+05 -1.11786273864E-04 1.1927826E+05 -3.55171347809E-04 3.8912277E+04 -1.08724334663E-03 1.4048682E+04 -3.16240657290E-03 5.4806992E+03 -8.71816416343E-03 2.2742055E+03 -2.24108538914E-02 9.9224129E+02 -5.28056124091E-02 4.5099966E+02 -1.08526208327E-01 2.1182024E+02 -1.78498194416E-01 1.0141102E+02 -1.67174907540E-01 4.6914090E+01 1.09898430347E-01 2.3508950E+01 5.32782010137E-01 1.1681311E+01 4.48997611326E-01 5.4345260E+00 8.01512376663E-02 2.6088080E+00 -2.81846003580E-06 1.1984420E+00 1.58689790287E-03 Ge S 1.2360507E+07 3.51182175864E-06 1.8506978E+06 1.27810607531E-05 4.2113142E+05 4.32839158857E-05 1.1927826E+05 1.37494035743E-04 3.8912277E+04 4.21459269650E-04 1.4048682E+04 1.22538381118E-03 5.4806992E+03 3.38903142588E-03 2.2742055E+03 8.72650055658E-03 9.9224129E+02 2.07762136809E-02 4.5099966E+02 4.32686188037E-02 2.1182024E+02 7.39771632426E-02 1.0141102E+02 7.25476783963E-02 4.6914090E+01 -5.50557758252E-02 2.3508950E+01 -3.55769212727E-01 1.1681311E+01 -4.29424373103E-01 5.4345260E+00 1.84337498094E-01 2.6088080E+00 7.19330404084E-01 1.1984420E+00 3.78704325214E-01 Ge S 1.2360507E+07 -9.07536572181E-07 1.8506978E+06 -3.30167311088E-06 4.2113142E+05 -1.11908556224E-05 1.1927826E+05 -3.55040479097E-05 3.8912277E+04 -1.09045277991E-04 1.4048682E+04 -3.16258491989E-04 5.4806992E+03 -8.77825489944E-04 2.2742055E+03 -2.25184553924E-03 9.9224129E+02 -5.39611361124E-03 4.5099966E+02 -1.11843738905E-02 2.1182024E+02 -1.94085150663E-02 1.0141102E+02 -1.87913963668E-02 4.6914090E+01 1.40470321163E-02 2.3508950E+01 1.01094996426E-01 1.1681311E+01 1.22950549189E-01 5.4345260E+00 -5.96768648379E-02 2.6088080E+00 -2.99534563368E-01 1.1984420E+00 -2.87491987406E-01 Ge S 3.2980800E-01 9.99976071149E-01 Ge S 1.5543300E-01 9.99993414217E-01 Ge S 6.6913000E-02 9.99996896171E-01 Ge P 2.4017466E+04 1.58991541408E-04 5.6857175E+03 6.98317187380E-04 1.8464859E+03 3.32343879164E-03 7.0624981E+02 1.31629592062E-02 2.9945610E+02 4.41439978529E-02 1.3643904E+02 1.19801051793E-01 6.5390155E+01 2.48261871650E-01 3.2393735E+01 3.57989163656E-01 1.6415616E+01 2.93374730700E-01 8.2877870E+00 9.91433970424E-02 4.1126340E+00 9.09709150407E-03 1.9988540E+00 1.38934540196E-03 9.4429100E-01 4.02302377395E-05 Ge P 2.4017466E+04 -6.14144279360E-05 5.6857175E+03 -2.70581352770E-04 1.8464859E+03 -1.29086072770E-03 7.0624981E+02 -5.15853142695E-03 2.9945610E+02 -1.75586556936E-02 1.3643904E+02 -4.92355648904E-02 6.5390155E+01 -1.06363311179E-01 3.2393735E+01 -1.62994645709E-01 1.6415616E+01 -1.13725100539E-01 8.2877870E+00 1.48222030008E-01 4.1126340E+00 4.29814515821E-01 1.9988540E+00 4.21233605559E-01 9.4429100E-01 1.53943551175E-01 Ge P 2.4017466E+04 1.20333832970E-05 5.6857175E+03 5.27406928336E-05 1.8464859E+03 2.53672031476E-04 7.0624981E+02 1.00572567572E-03 2.9945610E+02 3.46208375199E-03 1.3643904E+02 9.63870973877E-03 6.5390155E+01 2.11985378274E-02 3.2393735E+01 3.20978950229E-02 1.6415616E+01 2.28985886311E-02 8.2877870E+00 -3.83968713196E-02 4.1126340E+00 -9.83061525647E-02 1.9988540E+00 -1.22495834975E-01 9.4429100E-01 -4.59115556919E-03 Ge P 3.4121100E-01 9.99968577443E-01 Ge P 1.3435000E-01 9.99988644490E-01 Ge P 5.1735000E-02 9.99995528660E-01 Ge D 8.6467411E+02 1.85480350291E-04 2.6103763E+02 1.63059600823E-03 1.0177030E+02 8.92183606021E-03 4.5116641E+01 3.31922335655E-02 2.1430686E+01 9.15421138769E-02 1.0659861E+01 1.88152592432E-01 5.3922870E+00 2.79184895528E-01 2.7044970E+00 3.11231077912E-01 1.3285440E+00 2.56145016191E-01 Ge D 6.2645200E-01 9.99938117638E-01 Ge D 2.6601300E-01 9.99970815191E-01 Ge D 1.0630000E-01 9.99987605985E-01 Ge F 5.4920000E-01 9.99986881142E-01 Ge F 2.1900000E-01 9.99967104599E-01 Ge G 4.6810000E-01 9.99965731886E-01 end basis "As_cc-pvqz(fi/sf/lc)" #basis SET: (75s,42p,12d,2f,1g) -> [7s,6p,4d,2f,1g] As S 1.3600341E+07 2.92968015069E-05 2.0365073E+06 1.05287192962E-04 4.6343278E+05 3.49761534622E-04 1.3125994E+05 1.09368892459E-03 4.2819192E+04 3.30058343221E-03 1.5457019E+04 9.48273178880E-03 6.0284583E+03 2.56823655856E-02 2.5005599E+03 6.41714368170E-02 1.0906149E+03 1.42379678973E-01 4.9562154E+02 2.60626209753E-01 2.3281669E+02 3.40640701161E-01 1.1163118E+02 2.43266395484E-01 5.2269950E+01 5.61789349613E-02 2.6149878E+01 -1.11431745853E-03 1.3018757E+01 1.65001256257E-03 6.1554320E+00 -7.85465596653E-04 2.9591270E+00 3.36839485093E-04 1.3738740E+00 -1.49710250709E-04 As S 1.3600341E+07 -9.39038681440E-06 2.0365073E+06 -3.38435430312E-05 4.6343278E+05 -1.12786188180E-04 1.3125994E+05 -3.53761650937E-04 4.2819192E+04 -1.07200414827E-03 1.5457019E+04 -3.09801233434E-03 6.0284583E+03 -8.50326913648E-03 2.5005599E+03 -2.18313038134E-02 1.0906149E+03 -5.14440575778E-02 4.9562154E+02 -1.06233724583E-01 2.3281669E+02 -1.76265685577E-01 1.1163118E+02 -1.71962748771E-01 5.2269950E+01 8.85419730853E-02 2.6149878E+01 5.18939120363E-01 1.3018757E+01 4.67549273188E-01 6.1554320E+00 9.27356560174E-02 2.9591270E+00 7.94216865169E-04 1.3738740E+00 1.64040987846E-03 As S 1.3600341E+07 3.67080171535E-06 2.0365073E+06 1.32328229614E-05 4.6343278E+05 4.41278494576E-05 1.3125994E+05 1.38408196323E-04 4.2819192E+04 4.19884411021E-04 1.5457019E+04 1.21336310630E-03 6.0284583E+03 3.33958548085E-03 2.5005599E+03 8.59261489992E-03 1.0906149E+03 2.04417971383E-02 4.9562154E+02 4.27996903381E-02 2.3281669E+02 7.36723427029E-02 1.1163118E+02 7.54253783023E-02 5.2269950E+01 -4.49789421198E-02 2.6149878E+01 -3.44232049018E-01 1.3018757E+01 -4.48183790564E-01 6.1554320E+00 1.39632722826E-01 2.9591270E+00 7.22926896899E-01 1.3738740E+00 4.08153710547E-01 As S 1.3600341E+07 -1.01922879658E-06 2.0365073E+06 -3.67289914818E-06 4.6343278E+05 -1.22581264518E-05 1.3125994E+05 -3.84023297777E-05 4.2819192E+04 -1.16722243671E-04 1.5457019E+04 -3.36490452978E-04 6.0284583E+03 -9.29387223174E-04 2.5005599E+03 -2.38259101795E-03 1.0906149E+03 -5.70437153727E-03 4.9562154E+02 -1.18890019395E-02 2.3281669E+02 -2.07677823013E-02 1.1163118E+02 -2.10144522717E-02 5.2269950E+01 1.22186121146E-02 2.6149878E+01 1.05172262125E-01 1.3018757E+01 1.38502709294E-01 6.1554320E+00 -4.80633713953E-02 2.9591270E+00 -3.24829087138E-01 1.3738740E+00 -3.27598622444E-01 As S 4.0885000E-01 9.99972568891E-01 As S 1.9451100E-01 9.99991835934E-01 As S 8.3641000E-02 9.99996115842E-01 As P 2.5570418E+04 1.67067421871E-04 6.0529237E+03 7.17297857131E-04 1.9657002E+03 3.38226462139E-03 7.5177229E+02 1.33290094465E-02 3.1868140E+02 4.46406111867E-02 1.4514749E+02 1.21049574398E-01 6.9541162E+01 2.50481043153E-01 3.4451376E+01 3.59230453911E-01 1.7460610E+01 2.90812971017E-01 8.8086090E+00 9.64387022554E-02 4.3786460E+00 8.47305355668E-03 2.1444050E+00 1.39755510001E-03 1.0293500E+00 -3.68567074116E-05 As P 2.5570418E+04 -6.55032046783E-05 6.0529237E+03 -2.82172184508E-04 1.9657002E+03 -1.33362802122E-03 7.5177229E+02 -5.30456180847E-03 3.1868140E+02 -1.80317629311E-02 1.4514749E+02 -5.05535498871E-02 6.9541162E+01 -1.09093255234E-01 3.4451376E+01 -1.66409800708E-01 1.7460610E+01 -1.11990564377E-01 8.8086090E+00 1.58169742749E-01 4.3786460E+00 4.39339826878E-01 2.1444050E+00 4.14582160120E-01 1.0293500E+00 1.39612539357E-01 As P 2.5570418E+04 1.44781306012E-05 6.0529237E+03 6.21361906064E-05 1.9657002E+03 2.95494258078E-04 7.5177229E+02 1.16875428661E-03 3.1868140E+02 4.00888053288E-03 1.4514749E+02 1.11919649485E-02 6.9541162E+01 2.45180423681E-02 3.4451376E+01 3.71558670130E-02 1.7460610E+01 2.51032996226E-02 8.8086090E+00 -4.60711180120E-02 4.3786460E+00 -1.16185877811E-01 2.1444050E+00 -1.39524722640E-01 1.0293500E+00 8.46561846455E-03 As P 4.0463600E-01 9.99965747523E-01 As P 1.6562200E-01 9.99986533861E-01 As P 6.5610000E-02 9.99994487919E-01 As D 9.9697960E+02 1.67648552252E-04 3.0098518E+02 1.47185382753E-03 1.1723473E+02 8.16605270234E-03 5.1956904E+01 3.10705287927E-02 2.4689440E+01 8.75285669507E-02 1.2295171E+01 1.84257831323E-01 6.2446520E+00 2.79431207437E-01 3.1554600E+00 3.15742131908E-01 1.5680490E+00 2.57882425801E-01 As D 7.4864700E-01 9.99926966195E-01 As D 3.1912500E-01 9.99965123528E-01 As D 1.3000000E-01 9.99985131605E-01 As F 6.4400000E-01 9.99984185721E-01 As F 2.6400000E-01 9.99961427573E-01 As G 5.4650000E-01 9.99959993734E-01 end basis "Se_cc-pvqz(fi/sf/lc)" #basis SET: (75s,42p,12d,2f,1g) -> [7s,6p,4d,2f,1g] Se S 1.5011000E+07 2.99424418676E-05 2.2475000E+06 1.06956328214E-04 5.1145000E+05 3.49793718990E-04 1.4487000E+05 1.07935432890E-03 4.7261000E+04 3.22273057694E-03 1.7062000E+04 9.19037787194E-03 6.6545000E+03 2.47835790538E-02 2.7598000E+03 6.18680115507E-02 1.2032000E+03 1.37725240007E-01 5.4653000E+02 2.54447610987E-01 2.5663000E+02 3.39307882417E-01 1.2314000E+02 2.51479136025E-01 5.8263000E+01 6.27589319428E-02 2.9023000E+01 -3.22617379373E-04 1.4465000E+01 1.59580400826E-03 6.9348000E+00 -7.68025761426E-04 3.3299000E+00 3.27518399048E-04 1.5600000E+00 -1.53015351852E-04 Se S 1.5011000E+07 -9.64135082742E-06 2.2475000E+06 -3.45410937845E-05 5.1145000E+05 -1.13329456903E-04 1.4487000E+05 -3.50885448311E-04 4.7261000E+04 -1.05189427324E-03 1.7062000E+04 -3.01817403696E-03 6.6545000E+03 -8.24254037993E-03 2.7598000E+03 -2.11332219565E-02 1.2032000E+03 -4.98292932664E-02 5.4653000E+02 -1.03514736505E-01 2.5663000E+02 -1.73644966837E-01 1.2314000E+02 -1.76849643761E-01 5.8263000E+01 6.71586542030E-02 2.9023000E+01 5.04266183833E-01 1.4465000E+01 4.84847009434E-01 6.9348000E+00 1.06113638983E-01 3.3299000E+00 1.85583312368E-03 1.5600000E+00 1.63862064595E-03 Se S 1.5011000E+07 3.80767370492E-06 2.2475000E+06 1.36452895937E-05 5.1145000E+05 4.47958960859E-05 1.4487000E+05 1.38717402178E-04 4.7261000E+04 4.16230193887E-04 1.7062000E+04 1.19456612109E-03 6.6545000E+03 3.27000420767E-03 2.7598000E+03 8.40552102629E-03 1.2032000E+03 1.99926703216E-02 5.4653000E+02 4.21258811934E-02 2.5663000E+02 7.31645149681E-02 1.2314000E+02 7.83318374874E-02 5.8263000E+01 -3.47438577797E-02 2.9023000E+01 -3.32458873973E-01 1.4465000E+01 -4.64961282968E-01 6.9348000E+00 9.80221711628E-02 3.3299000E+00 7.24979921358E-01 1.5600000E+00 4.34268858974E-01 Se S 1.5011000E+07 -1.11842847881E-06 2.2475000E+06 -4.00662718620E-06 5.1145000E+05 -1.31640549465E-05 1.4487000E+05 -4.07163881531E-05 4.7261000E+04 -1.22407368886E-04 1.7062000E+04 -3.50453737694E-04 6.6545000E+03 -9.62755564963E-04 2.7598000E+03 -2.46559236389E-03 1.2032000E+03 -5.90252800094E-03 5.4653000E+02 -1.23790672927E-02 2.5663000E+02 -2.18221071427E-02 1.2314000E+02 -2.30989735723E-02 5.8263000E+01 9.80958492388E-03 2.9023000E+01 1.07560499293E-01 1.4465000E+01 1.52446944506E-01 6.9348000E+00 -3.47635261244E-02 3.3299000E+00 -3.46637002383E-01 1.5600000E+00 -3.63186335171E-01 Se S 4.9291000E-01 9.99968853290E-01 Se S 2.3525000E-01 9.99990157485E-01 Se S 1.0037000E-01 9.99995302353E-01 Se P 2.5217000E+04 1.90816556165E-04 5.9699000E+03 8.21537082422E-04 1.9389000E+03 3.86405841993E-03 7.4166000E+02 1.51358367768E-02 3.1450000E+02 5.01775203664E-02 1.4331000E+02 1.33544794638E-01 6.8650000E+01 2.68262666332E-01 3.3995000E+01 3.65343777765E-01 1.7185000E+01 2.69550033966E-01 8.5740000E+00 7.66613282258E-02 4.2206000E+00 4.93599573978E-03 2.0521000E+00 1.28437747832E-03 9.6156000E-01 -1.90622616816E-04 Se P 2.5217000E+04 -7.59022548580E-05 5.9699000E+03 -3.28026100420E-04 1.9389000E+03 -1.54636495777E-03 7.4166000E+02 -6.12050475684E-03 3.1450000E+02 -2.06146486950E-02 1.4331000E+02 -5.68733240526E-02 6.8650000E+01 -1.19308181770E-01 3.3995000E+01 -1.73000036686E-01 1.7185000E+01 -8.95247749297E-02 8.5740000E+00 2.13088957036E-01 4.2206000E+00 4.74406825016E-01 2.0521000E+00 3.76717386404E-01 9.6156000E-01 8.89732062001E-02 Se P 2.5217000E+04 1.83139108612E-05 5.9699000E+03 7.90848901923E-05 1.9389000E+03 3.73589633668E-04 7.4166000E+02 1.47753393489E-03 3.1450000E+02 4.99732898035E-03 1.4331000E+02 1.38137302465E-02 6.8650000E+01 2.92314887384E-02 3.3995000E+01 4.25798998372E-02 1.7185000E+01 2.05666513360E-02 8.5740000E+00 -6.54482723651E-02 4.2206000E+00 -1.44009918693E-01 2.0521000E+00 -1.41539885213E-01 9.6156000E-01 6.93336020873E-02 Se P 4.2151000E-01 9.99968002895E-01 Se P 1.7626000E-01 9.99985972344E-01 Se P 7.0663000E-02 9.99994133886E-01 Se D 1.1434000E+03 1.51891983726E-04 3.4533000E+02 1.32808480488E-03 1.3446000E+02 7.45074331987E-03 5.9567000E+01 2.89814533510E-02 2.8283000E+01 8.36551084966E-02 1.4061000E+01 1.81061273803E-01 7.1390000E+00 2.81165590161E-01 3.6148000E+00 3.21389004821E-01 1.8072000E+00 2.58902907996E-01 Se D 8.6944000E-01 9.99915832600E-01 Se D 3.7036000E-01 9.99959497518E-01 Se D 1.5300000E-01 9.99982744735E-01 Se F 7.0970000E-01 9.99982987782E-01 Se F 2.8400000E-01 9.99957493386E-01 Se G 5.7300000E-01 9.99958054262E-01 end basis "Br_cc-pvqz(fi/sf/lc)" #basis SET: (75s,42p,12d,2f,1g) -> [7s,6p,4d,2f,1g] Br S 1.6475000E+07 3.07639011115E-05 2.4666000E+06 1.09051363097E-04 5.6131000E+05 3.51499875292E-04 1.5899000E+05 1.07063262857E-03 5.1869000E+04 3.16343182755E-03 1.8726000E+04 8.95369224219E-03 7.3036000E+03 2.40352262313E-02 3.0291000E+03 5.98773044370E-02 1.3208000E+03 1.33532176215E-01 6.0003000E+02 2.48501298230E-01 2.8190000E+02 3.37087689510E-01 1.3554000E+02 2.58625236645E-01 6.4870000E+01 6.97903038983E-02 3.2129000E+01 7.94860527777E-04 1.6037000E+01 1.44928440675E-03 7.7849000E+00 -7.00826832120E-04 3.7247000E+00 2.91980359692E-04 1.7583000E+00 -1.44818747862E-04 Br S 1.6475000E+07 -9.95010967573E-06 2.4666000E+06 -3.53782940817E-05 5.6131000E+05 -1.14405874958E-04 1.5899000E+05 -3.49761379445E-04 5.1869000E+04 -1.03753091028E-03 1.8726000E+04 -2.95557411654E-03 7.3036000E+03 -8.02943121632E-03 3.0291000E+03 -2.05389034829E-02 1.3208000E+03 -4.83928346468E-02 6.0003000E+02 -1.00970077464E-01 2.8190000E+02 -1.70774419727E-01 1.3554000E+02 -1.80673954018E-01 6.4870000E+01 4.68741808208E-02 3.2129000E+01 4.87905953231E-01 1.6037000E+01 5.00562049509E-01 7.7849000E+00 1.20689988670E-01 3.7247000E+00 3.19761067024E-03 1.7583000E+00 1.59283214982E-03 Br S 1.6475000E+07 3.96873051000E-06 2.4666000E+06 1.41159571985E-05 5.6131000E+05 4.56709571327E-05 1.5899000E+05 1.39671809883E-04 5.1869000E+04 4.14618827931E-04 1.8726000E+04 1.18175286353E-03 7.3036000E+03 3.21672813456E-03 3.0291000E+03 8.25278382578E-03 1.3208000E+03 1.95995553761E-02 6.0003000E+02 4.14958797665E-02 2.8190000E+02 7.25218154442E-02 1.3554000E+02 8.07763044785E-02 6.4870000E+01 -2.49725892011E-02 3.2129000E+01 -3.19841567858E-01 1.6037000E+01 -4.79457533301E-01 7.7849000E+00 5.77167470327E-02 3.7247000E+00 7.25490534625E-01 1.7583000E+00 4.58391541653E-01 Br S 1.6475000E+07 -1.22013238561E-06 2.4666000E+06 -4.33828810161E-06 5.6131000E+05 -1.40474672347E-05 1.5899000E+05 -4.29107443965E-05 5.1869000E+04 -1.27624626173E-04 1.8726000E+04 -3.62884285209E-04 7.3036000E+03 -9.91292469105E-04 3.0291000E+03 -2.53382715533E-03 1.3208000E+03 -6.05680655328E-03 6.0003000E+02 -1.27634705436E-02 2.8190000E+02 -2.26418454938E-02 1.3554000E+02 -2.49444393719E-02 6.4870000E+01 7.16794405252E-03 3.2129000E+01 1.08364693972E-01 1.6037000E+01 1.64964250801E-01 7.7849000E+00 -2.02366850072E-02 3.7247000E+00 -3.64737417299E-01 1.7583000E+00 -3.96345613617E-01 Br S 5.8331000E-01 9.99964894828E-01 Br S 2.7856000E-01 9.99988352477E-01 Br S 1.1829000E-01 9.99994437533E-01 Br P 2.6607000E+04 2.01291380050E-04 6.2982000E+03 8.49902425067E-04 2.0452000E+03 3.96456276597E-03 7.8216000E+02 1.54523664026E-02 3.3163000E+02 5.10983150864E-02 1.5111000E+02 1.35601007261E-01 7.2392000E+01 2.71253355334E-01 3.5862000E+01 3.66087502936E-01 1.8134000E+01 2.65531406607E-01 9.0430000E+00 7.36160593387E-02 4.4500000E+00 4.47936854573E-03 2.1661000E+00 1.20830249094E-03 9.9628000E-01 -2.21367951588E-04 Br P 2.6607000E+04 -8.11838918723E-05 6.2982000E+03 -3.44093027694E-04 2.0452000E+03 -1.60909184949E-03 7.8216000E+02 -6.33763491608E-03 3.3163000E+02 -2.13018318950E-02 1.5111000E+02 -5.86208872506E-02 7.2392000E+01 -1.22574871283E-01 3.5862000E+01 -1.76015221732E-01 1.8134000E+01 -8.54307434257E-02 9.0430000E+00 2.26434741975E-01 4.4500000E+00 4.85921792273E-01 2.1661000E+00 3.65015796316E-01 9.9628000E-01 7.48145653459E-02 Br P 2.6607000E+04 2.09716404066E-05 6.2982000E+03 8.89396200433E-05 2.0452000E+03 4.15978551067E-04 7.8216000E+02 1.64087558567E-03 3.3163000E+02 5.52573760201E-03 1.5111000E+02 1.52815677991E-02 7.2392000E+01 3.21349666596E-02 3.5862000E+01 4.66289141524E-02 1.8134000E+01 2.02941984451E-02 9.0430000E+00 -7.41923208032E-02 4.4500000E+00 -1.63052951599E-01 2.1661000E+00 -1.45416462288E-01 9.9628000E-01 1.11809716916E-01 Br P 4.5443000E-01 9.99966847754E-01 Br P 1.9404000E-01 9.99984876873E-01 Br P 7.8997000E-02 9.99993542170E-01 Br D 1.2896000E+03 1.41362271302E-04 3.8975000E+02 1.22895059505E-03 1.5176000E+02 6.94299224064E-03 6.7223000E+01 2.74663436413E-02 3.1913000E+01 8.07611967162E-02 1.5857000E+01 1.78542435565E-01 8.0545000E+00 2.82543850547E-01 4.0887000E+00 3.25953926990E-01 2.0556000E+00 2.59222507132E-01 Br D 9.9509000E-01 9.99904269864E-01 Br D 4.2313000E-01 9.99953645660E-01 Br D 1.7790000E-01 9.99980286420E-01 Br F 8.2570000E-01 9.99979591710E-01 Br F 3.4070000E-01 9.99950547598E-01 Br G 6.4910000E-01 9.99952484914E-01 end basis "Kr_cc-pvqz(fi/sf/lc)" #basis SET: (75s,42p,12d,2f,1g) -> [7s,6p,4d,2f,1g] Kr S 1.8226108E+07 3.11986752407E-05 2.7288025E+06 1.10306532459E-04 6.2099771E+05 3.50152832741E-04 1.7589958E+05 1.05254947137E-03 5.7387497E+04 3.07543026856E-03 2.0717181E+04 8.63745819517E-03 8.0788899E+03 2.30797698320E-02 3.3495170E+03 5.74372861158E-02 1.4597812E+03 1.28503816676E-01 6.6289391E+02 2.41402381759E-01 3.1139215E+02 3.34347844501E-01 1.4993751E+02 2.66941397543E-01 7.2498249E+01 7.86075240675E-02 3.5569354E+01 2.28200744875E-03 1.7766633E+01 1.24458365837E-03 8.7123830E+00 -6.06238126453E-04 4.1449710E+00 2.44090822269E-04 1.9696490E+00 -1.30515995004E-04 Kr S 1.8226108E+07 -1.01345858439E-05 2.7288025E+06 -3.59440086295E-05 6.2099771E+05 -1.14474327909E-04 1.7589958E+05 -3.45495609919E-04 5.7387497E+04 -1.01336664799E-03 2.0717181E+04 -2.86542430440E-03 8.0788899E+03 -7.74249952372E-03 3.3495170E+03 -1.97769696948E-02 1.4597812E+03 -4.66090434356E-02 6.6289391E+02 -9.78308619788E-02 3.1139215E+02 -1.67248255207E-01 1.4993751E+02 -1.84593362583E-01 7.2498249E+01 2.54032122249E-02 3.5569354E+01 4.69631153082E-01 1.7766633E+01 5.15856681647E-01 8.7123830E+00 1.36818235290E-01 4.1449710E+00 4.80128894596E-03 1.9696490E+00 1.51357617722E-03 Kr S 1.8226108E+07 4.08093259724E-06 2.7288025E+06 1.44792756640E-05 6.2099771E+05 4.61342953213E-05 1.7589958E+05 1.39306490405E-04 5.7387497E+04 4.08813958034E-04 2.0717181E+04 1.15694768537E-03 8.0788899E+03 3.13090726426E-03 3.3495170E+03 8.02441411955E-03 1.4597812E+03 1.90456532568E-02 6.6289391E+02 4.05780102770E-02 3.1139215E+02 7.15266120682E-02 1.4993751E+02 8.32103370313E-02 7.2498249E+01 -1.45000815561E-02 3.5569354E+01 -3.05846984470E-01 1.7766633E+01 -4.92436101287E-01 8.7123830E+00 1.78189983801E-02 4.1449710E+00 7.24317930525E-01 1.9696490E+00 4.81124518534E-01 Kr S 1.8226108E+07 -1.30323237815E-06 2.7288025E+06 -4.62181205638E-06 6.2099771E+05 -1.47387652462E-05 1.7589958E+05 -4.44543620894E-05 5.7387497E+04 -1.30702758989E-04 2.0717181E+04 -3.69018938759E-04 8.0788899E+03 -1.00215048757E-03 3.3495170E+03 -2.55908746708E-03 1.4597812E+03 -6.11311481959E-03 6.6289391E+02 -1.29644102066E-02 3.1139215E+02 -2.31918693754E-02 1.4993751E+02 -2.67073318331E-02 7.2498249E+01 4.01610542538E-03 3.5569354E+01 1.07611433915E-01 1.7766633E+01 1.76389930429E-01 8.7123830E+00 -4.61441673803E-03 4.1449710E+00 -3.79468163412E-01 1.9696490E+00 -4.27659503102E-01 Kr S 6.7995200E-01 9.99960676072E-01 Kr S 3.2450200E-01 9.99986422875E-01 Kr S 1.3744100E-01 9.99993520166E-01 Kr P 2.8600831E+04 2.07469786582E-04 6.7709912E+03 8.53293172425E-04 2.1990489E+03 3.93715043856E-03 8.4117957E+02 1.52561187564E-02 3.5676633E+02 5.03888256312E-02 1.6263620E+02 1.33915260646E-01 7.7966035E+01 2.69024159296E-01 3.8661489E+01 3.65490400504E-01 1.9576791E+01 2.68052748183E-01 9.7917610E+00 7.58534762495E-02 4.8353830E+00 4.75905155361E-03 2.3681250E+00 1.17634795324E-03 1.0899960E+00 -2.29214817900E-04 Kr P 2.8600831E+04 -8.48141157511E-05 6.7709912E+03 -3.50155555893E-04 2.1990489E+03 -1.62001154520E-03 8.4117957E+02 -6.34234676613E-03 3.5676633E+02 -2.12949466577E-02 1.6263620E+02 -5.86719752847E-02 7.7966035E+01 -1.23271071087E-01 3.8661489E+01 -1.78116803648E-01 1.9576791E+01 -8.90025781315E-02 9.7917610E+00 2.24638402325E-01 4.8353830E+00 4.90380373222E-01 2.3681250E+00 3.64886189636E-01 1.0899960E+00 7.20582676752E-02 Kr P 2.8600831E+04 2.30088993021E-05 6.7709912E+03 9.51050542915E-05 2.1990489E+03 4.39726229449E-04 8.4117957E+02 1.72590144679E-03 3.5676633E+02 5.80029925147E-03 1.6263620E+02 1.60828461337E-02 7.7966035E+01 3.39422455407E-02 3.8661489E+01 4.97026907716E-02 1.9576791E+01 2.20748400521E-02 9.7917610E+00 -7.77897303912E-02 4.8353830E+00 -1.76517466209E-01 2.3681250E+00 -1.52002585125E-01 1.0899960E+00 1.36201551922E-01 Kr P 5.0458800E-01 9.99963729879E-01 Kr P 2.1845500E-01 9.99983207802E-01 Kr P 8.9959000E-02 9.99992729649E-01 Kr D 1.4377792E+03 1.33988808526E-04 4.3426846E+02 1.16032910390E-03 1.6892699E+02 6.60098021117E-03 7.4777535E+01 2.64485126413E-02 3.5516024E+01 7.87276310409E-02 1.7671051E+01 1.76272345304E-01 9.0046110E+00 2.82490511099E-01 4.5947730E+00 3.28680652562E-01 2.3264860E+00 2.59600759721E-01 Kr D 1.1332470E+00 9.99891662108E-01 Kr D 4.8130700E-01 9.99947211752E-01 Kr D 2.0530000E-01 9.99977576294E-01 Kr F 9.5570000E-01 9.99975261452E-01 Kr F 4.1300000E-01 9.99942764155E-01 Kr G 7.3950000E-01 9.99945869469E-01 end
{ "pile_set_name": "Github" }
// // 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 NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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. // // Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PHYSICS_COMMON_PX_TYPEINFO #define PX_PHYSICS_COMMON_PX_TYPEINFO /** \addtogroup common @{ */ #include "common/PxPhysXCommonConfig.h" #if !PX_DOXYGEN namespace physx { #endif /** \brief an enumeration of concrete classes inheriting from PxBase Enumeration space is reserved for future PhysX core types, PhysXExtensions, PhysXVehicle and Custom application types. @see PxBase, PxTypeInfo */ struct PxConcreteType { enum Enum { eUNDEFINED, eHEIGHTFIELD, eCONVEX_MESH, eTRIANGLE_MESH_BVH33, eTRIANGLE_MESH_BVH34, eRIGID_DYNAMIC, eRIGID_STATIC, eSHAPE, eMATERIAL, eCONSTRAINT, eAGGREGATE, eARTICULATION, eARTICULATION_REDUCED_COORDINATE, eARTICULATION_LINK, eARTICULATION_JOINT, eARTICULATION_JOINT_REDUCED_COORDINATE, ePRUNING_STRUCTURE, eBVH_STRUCTURE, ePHYSX_CORE_COUNT, eFIRST_PHYSX_EXTENSION = 256, eFIRST_VEHICLE_EXTENSION = 512, eFIRST_USER_EXTENSION = 1024 }; }; /** \brief a structure containing per-type information for types inheriting from PxBase @see PxBase, PxConcreteType */ template<typename T> struct PxTypeInfo {}; #define PX_DEFINE_TYPEINFO(_name, _fastType) \ class _name; \ template <> struct PxTypeInfo<_name> { static const char* name() { return #_name; } enum { eFastTypeId = _fastType }; }; /* the semantics of the fastType are as follows: an object A can be cast to a type B if B's fastType is defined, and A has the same fastType. * This implies that B has no concrete subclasses or superclasses. */ PX_DEFINE_TYPEINFO(PxBase, PxConcreteType::eUNDEFINED) PX_DEFINE_TYPEINFO(PxMaterial, PxConcreteType::eMATERIAL) PX_DEFINE_TYPEINFO(PxConvexMesh, PxConcreteType::eCONVEX_MESH) PX_DEFINE_TYPEINFO(PxTriangleMesh, PxConcreteType::eUNDEFINED) PX_DEFINE_TYPEINFO(PxBVH33TriangleMesh, PxConcreteType::eTRIANGLE_MESH_BVH33) PX_DEFINE_TYPEINFO(PxBVH34TriangleMesh, PxConcreteType::eTRIANGLE_MESH_BVH34) PX_DEFINE_TYPEINFO(PxHeightField, PxConcreteType::eHEIGHTFIELD) PX_DEFINE_TYPEINFO(PxActor, PxConcreteType::eUNDEFINED) PX_DEFINE_TYPEINFO(PxRigidActor, PxConcreteType::eUNDEFINED) PX_DEFINE_TYPEINFO(PxRigidBody, PxConcreteType::eUNDEFINED) PX_DEFINE_TYPEINFO(PxRigidDynamic, PxConcreteType::eRIGID_DYNAMIC) PX_DEFINE_TYPEINFO(PxRigidStatic, PxConcreteType::eRIGID_STATIC) PX_DEFINE_TYPEINFO(PxArticulationLink, PxConcreteType::eARTICULATION_LINK) PX_DEFINE_TYPEINFO(PxArticulationJoint, PxConcreteType::eARTICULATION_JOINT) PX_DEFINE_TYPEINFO(PxArticulationJointReducedCoordinate, PxConcreteType::eARTICULATION_JOINT_REDUCED_COORDINATE) PX_DEFINE_TYPEINFO(PxArticulation, PxConcreteType::eARTICULATION) PX_DEFINE_TYPEINFO(PxArticulationReducedCoordinate, PxConcreteType::eARTICULATION_REDUCED_COORDINATE) PX_DEFINE_TYPEINFO(PxAggregate, PxConcreteType::eAGGREGATE) PX_DEFINE_TYPEINFO(PxConstraint, PxConcreteType::eCONSTRAINT) PX_DEFINE_TYPEINFO(PxShape, PxConcreteType::eSHAPE) PX_DEFINE_TYPEINFO(PxPruningStructure, PxConcreteType::ePRUNING_STRUCTURE) #if !PX_DOXYGEN } // namespace physx #endif /** @} */ #endif
{ "pile_set_name": "Github" }
{ "name": "@themer/alfred", "version": "1.1.2", "description": "An Alfred.app theme generator for themer.", "main": "lib/index.js", "engines": { "node": ">=6.11" }, "scripts": { "prepublishOnly": "cp ../../../LICENSE.md ./" }, "author": "mjswensen", "license": "MIT", "files": [ "/lib/index.js" ], "devDependencies": {}, "dependencies": {}, "peerDependencies": { "themer": "^1.0.2||^2||^3" }, "repository": { "type": "git", "url": "git+https://github.com/mjswensen/themer.git" }, "keywords": [ "themer", "alfred", "theme" ], "bugs": { "url": "https://github.com/mjswensen/themer/issues" }, "homepage": "https://github.com/mjswensen/themer/tree/master/cli/packages/alfred#readme" }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectGuid>{EE919791-32BE-472B-A111-4A171BC65FA0}</ProjectGuid> <OutputType>Library</OutputType> <RootNamespace>FormsNativeVideoPlayer</RootNamespace> <AssemblyName>FormsNativeVideoPlayer</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkProfile>Profile78</TargetFrameworkProfile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug</OutputPath> <DefineConstants>DEBUG;</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <ConsolePause>false</ConsolePause> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>full</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release</OutputPath> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <ConsolePause>false</ConsolePause> </PropertyGroup> <ItemGroup> <Compile Include="FormsNativeVideoPlayer.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="LandingPage.cs" /> </ItemGroup> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> <Import Project="..\packages\Xamarin.Forms.1.4.2.6359\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.1.4.2.6359\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" /> <ItemGroup> <Reference Include="Xamarin.Forms.Core"> <HintPath>..\packages\Xamarin.Forms.1.4.2.6359\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath> </Reference> <Reference Include="Xamarin.Forms.Xaml"> <HintPath>..\packages\Xamarin.Forms.1.4.2.6359\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath> </Reference> <Reference Include="Xamarin.Forms.Platform"> <HintPath>..\packages\Xamarin.Forms.1.4.2.6359\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> <None Include="packages.config" /> </ItemGroup> </Project>
{ "pile_set_name": "Github" }
{ "compilerOptions": { "target": "es5", "module": "commonjs", "declaration": false, "noImplicitAny": false, "sourceMap": true, "suppressImplicitAnyIndexErrors": true, "lib": [ "dom", "es5", "scripthost", "es2015" ], "experimentalDecorators": true, "types": [ "webpack-env" ] }, "compileOnSave": false, "exclude": [ "node_modules" ] }
{ "pile_set_name": "Github" }
$env:PATH +=";$env:SystemDrive\ProgramData\Chocolatey\bin;$env:SystemDrive\Documents and Settings\All Users\Application Data\chocolatey\bin" write-host "This should be run from the root of your puppet code base" choco install ruby -version 2.1.5 $env:PATH += ";$env:SystemDrive\tools\ruby215\bin" #choco install ruby.devkit choco install ruby2.devkit # NOTE: You may need to go to c:\tools\DevKit2: # - update the config.yml to include c:/tools/ruby215 # - run 'ruby dk.rb install' # https://gist.github.com/luislavena/f064211759ee0f806c88 $rubygems = &gem which rubygems $ssl_cert_location = $rubygems.Replace(".rb","/ssl_certs/AddTrustExternalCARoot-2048.pem") $ssl_cert_url = 'https://raw.githubusercontent.com/rubygems/rubygems/master/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem' &curl.exe -o "$ssl_cert_location" "$ssl_cert_url" #(New-Object Net.WebClient).DownloadFile("$ssl_cert_url","$ssl_cert_location") &gem install --no-ri --no-rdoc bundler &bundler config --global jobs 4 &gem install --no-ri --no-rdoc debug_inspector -v '0.0.2' #&gem install debugger-ruby_core_source -v '1.2.3' &gem install --no-ri --no-rdoc debugger #&gem install --no-ri --no-rdoc debugger -v '1.6.2' &bundle install # ensure the directory New-Item -Path "$env:ProgramData\PuppetLabs\puppet" -ItemType directory | Out-Null &bundle exec puppet apply -e "user {'Administrator': ensure=>present, groups=>['Administrators'],}"
{ "pile_set_name": "Github" }
/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package jsonpath import ( "testing" ) type parserTest struct { name string text string nodes []Node shouldError bool } var parserTests = []parserTest{ {"plain", `hello jsonpath`, []Node{newText("hello jsonpath")}, false}, {"variable", `hello {.jsonpath}`, []Node{newText("hello "), newList(), newField("jsonpath")}, false}, {"arrayfiled", `hello {['jsonpath']}`, []Node{newText("hello "), newList(), newField("jsonpath")}, false}, {"quote", `{"{"}`, []Node{newList(), newText("{")}, false}, {"array", `{[1:3]}`, []Node{newList(), newArray([3]ParamsEntry{{1, true, false}, {3, true, false}, {0, false, false}})}, false}, {"allarray", `{.book[*].author}`, []Node{newList(), newField("book"), newArray([3]ParamsEntry{{0, false, false}, {0, false, false}, {0, false, false}}), newField("author")}, false}, {"wildcard", `{.bicycle.*}`, []Node{newList(), newField("bicycle"), newWildcard()}, false}, {"filter", `{[?(@.price<3)]}`, []Node{newList(), newFilter(newList(), newList(), "<"), newList(), newField("price"), newList(), newInt(3)}, false}, {"recursive", `{..}`, []Node{newList(), newRecursive()}, false}, {"recurField", `{..price}`, []Node{newList(), newRecursive(), newField("price")}, false}, {"arraydict", `{['book.price']}`, []Node{newList(), newField("book"), newField("price"), }, false}, {"union", `{['bicycle.price', 3, 'book.price']}`, []Node{newList(), newUnion([]*ListNode{}), newList(), newField("bicycle"), newField("price"), newList(), newArray([3]ParamsEntry{{3, true, false}, {4, true, true}, {0, false, false}}), newList(), newField("book"), newField("price"), }, false}, {"range", `{range .items}{.name},{end}`, []Node{ newList(), newIdentifier("range"), newField("items"), newList(), newField("name"), newText(","), newList(), newIdentifier("end"), }, false}, {"malformat input", `{\\\}`, []Node{}, true}, {"paired parentheses in quotes", `{[?(@.status.nodeInfo.osImage == "()")]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("()")}, false}, {"paired parentheses in double quotes and with double quotes escape", `{[?(@.status.nodeInfo.osImage == "(\"\")")]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("(\"\")")}, false}, {"unregular parentheses in double quotes", `{[?(@.test == "())(")]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("test"), newList(), newText("())(")}, false}, {"plain text in single quotes", `{[?(@.status.nodeInfo.osImage == 'Linux')]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("Linux")}, false}, {"test filter suffix", `{[?(@.status.nodeInfo.osImage == "{[()]}")]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("{[()]}")}, false}, {"double inside single", `{[?(@.status.nodeInfo.osImage == "''")]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("''")}, false}, {"single inside double", `{[?(@.status.nodeInfo.osImage == '""')]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("\"\"")}, false}, {"single containing escaped single", `{[?(@.status.nodeInfo.osImage == '\\\'')]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("\\'")}, false}, {"negative index slice, equals a[len-5] to a[len-1]", `{[-5:]}`, []Node{newList(), newArray([3]ParamsEntry{{-5, true, false}, {0, false, false}, {0, false, false}})}, false}, {"negative index slice, equals a[len-1]", `{[-1]}`, []Node{newList(), newArray([3]ParamsEntry{{-1, true, false}, {0, true, true}, {0, false, false}})}, false}, {"negative index slice, equals a[1] to a[len-1]", `{[1:-1]}`, []Node{newList(), newArray([3]ParamsEntry{{1, true, false}, {-1, true, false}, {0, false, false}})}, false}, } func collectNode(nodes []Node, cur Node) []Node { nodes = append(nodes, cur) switch cur.Type() { case NodeList: for _, node := range cur.(*ListNode).Nodes { nodes = collectNode(nodes, node) } case NodeFilter: nodes = collectNode(nodes, cur.(*FilterNode).Left) nodes = collectNode(nodes, cur.(*FilterNode).Right) case NodeUnion: for _, node := range cur.(*UnionNode).Nodes { nodes = collectNode(nodes, node) } } return nodes } func TestParser(t *testing.T) { for _, test := range parserTests { parser, err := Parse(test.name, test.text) if test.shouldError { if err == nil { t.Errorf("unexpected non-error when parsing %s", test.name) } continue } if err != nil { t.Errorf("parse %s error %v", test.name, err) } result := collectNode([]Node{}, parser.Root)[1:] if len(result) != len(test.nodes) { t.Errorf("in %s, expect to get %d nodes, got %d nodes", test.name, len(test.nodes), len(result)) t.Error(result) } for i, expect := range test.nodes { if result[i].String() != expect.String() { t.Errorf("in %s, %dth node, expect %v, got %v", test.name, i, expect, result[i]) } } } } type failParserTest struct { name string text string err string } func TestFailParser(t *testing.T) { failParserTests := []failParserTest{ {"unclosed action", "{.hello", "unclosed action"}, {"unrecognized character", "{*}", "unrecognized character in action: U+002A '*'"}, {"invalid number", "{+12.3.0}", "cannot parse number +12.3.0"}, {"unterminated array", "{[1}", "unterminated array"}, {"unterminated filter", "{[?(.price]}", "unterminated filter"}, {"invalid multiple recursive descent", "{........}", "invalid multiple recursive descent"}, } for _, test := range failParserTests { _, err := Parse(test.name, test.text) var out string if err == nil { out = "nil" } else { out = err.Error() } if out != test.err { t.Errorf("in %s, expect to get error %v, got %v", test.name, test.err, out) } } }
{ "pile_set_name": "Github" }
# Try to find the GNU Multiple Precision Arithmetic Library (GMP) # See http://gmplib.org/ if (GMP_INCLUDES AND GMP_LIBRARIES) set(GMP_FIND_QUIETLY TRUE) endif (GMP_INCLUDES AND GMP_LIBRARIES) find_path(GMP_INCLUDES NAMES gmp.h PATHS $ENV{GMPDIR} ${INCLUDE_INSTALL_DIR} ) find_library(GMP_LIBRARIES gmp PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GMP DEFAULT_MSG GMP_INCLUDES GMP_LIBRARIES) mark_as_advanced(GMP_INCLUDES GMP_LIBRARIES)
{ "pile_set_name": "Github" }
#pragma once #ifdef _MSC_VER #include <intrin.h> #include <stdexcept> #define __builtin_popcount(t) __popcnt(t) #endif #include <queue> #include <string.h> #if defined(__GNUC__) #define PORTABLE_ALIGN32 __attribute__((aligned(32))) #else #define PORTABLE_ALIGN32 __declspec(align(32)) #endif namespace hnswlib { typedef size_t labeltype; template<typename T> static void writeBinaryPOD(std::ostream &out, const T &podRef) { out.write((char *) &podRef, sizeof(T)); } template<typename T> static void readBinaryPOD(std::istream &in, T &podRef) { in.read((char *) &podRef, sizeof(T)); } template<typename MTYPE> using DISTFUNC = MTYPE(*)(const void *, const void *, const void *); template<typename MTYPE> class SpaceInterface { public: //virtual void search(void *); virtual size_t get_data_size() = 0; virtual DISTFUNC<MTYPE> get_dist_func() = 0; virtual void *get_dist_func_param() = 0; }; template<typename dist_t> class AlgorithmInterface { public: virtual void addPoint(void *datapoint, labeltype label)=0; virtual std::priority_queue<std::pair<dist_t, labeltype >> searchKnn(void *, size_t) = 0; virtual void saveIndex(const std::string &location)=0; }; } #include "space_l2.h" #include "space_ip.h" #include "brutoforce.h" #include "hnswalg.h"
{ "pile_set_name": "Github" }