text stringlengths 2 99k | meta dict |
|---|---|
# Makefile for zlib under OS/2 using GCC (PGCC)
# For conditions of distribution and use, see copyright notice in zlib.h
# To compile and test, type:
# cp Makefile.os2 ..
# cd ..
# make -f Makefile.os2 test
# This makefile will build a static library z.lib, a shared library
# z.dll and a import library zdll.lib. You can use either z.lib or
# zdll.lib by specifying either -lz or -lzdll on gcc's command line
CC=gcc -Zomf -s
CFLAGS=-O6 -Wall
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS=-g -DDEBUG
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
# -Wstrict-prototypes -Wmissing-prototypes
#################### BUG WARNING: #####################
## infcodes.c hits a bug in pgcc-1.0, so you have to use either
## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem)
## This bug is reportedly fixed in pgcc >1.0, but this was not tested
CFLAGS+=-fno-force-mem
LDFLAGS=-s -L. -lzdll -Zcrtdll
LDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll
VER=1.1.0
ZLIB=z.lib
SHAREDLIB=z.dll
SHAREDLIBIMP=zdll.lib
LIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP)
AR=emxomfar cr
IMPLIB=emximp
RANLIB=echo
TAR=tar
SHELL=bash
prefix=/usr/local
exec_prefix = $(prefix)
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
TEST_OBJS = example.o minigzip.o
DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
nt/Makefile.nt nt/zlib.dnt contrib/README.contrib contrib/*.txt \
contrib/asm386/*.asm contrib/asm386/*.c \
contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32
all: example.exe minigzip.exe
test: all
@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
echo hello world | ./minigzip | ./minigzip -d || \
echo ' *** minigzip test FAILED ***' ; \
if ./example; then \
echo ' *** zlib test OK ***'; \
else \
echo ' *** zlib test FAILED ***'; \
fi
$(ZLIB): $(OBJS)
$(AR) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
$(SHAREDLIB): $(OBJS) os2/z.def
$(LDSHARED) -o $@ $^
$(SHAREDLIBIMP): os2/z.def
$(IMPLIB) -o $@ $^
example.exe: example.o $(LIBS)
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
minigzip.exe: minigzip.o $(LIBS)
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
clean:
rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
distclean: clean
zip:
mv Makefile Makefile~; cp -p Makefile.in Makefile
rm -f test.c ztest*.c
v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
zip -ul9 zlib$$v $(DISTFILES)
mv Makefile~ Makefile
dist:
mv Makefile Makefile~; cp -p Makefile.in Makefile
rm -f test.c ztest*.c
d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
rm -f $$d.tar.gz; \
if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
files=""; \
for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
cd ..; \
GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
if test ! -d $$d; then rm -f $$d; fi
mv Makefile~ Makefile
tags:
etags *.[ch]
depend:
makedepend -- $(CFLAGS) -- *.[ch]
# DO NOT DELETE THIS LINE -- make depend depends on it.
adler32.o: zlib.h zconf.h
compress.o: zlib.h zconf.h
crc32.o: zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
example.o: zlib.h zconf.h
gzio.o: zutil.h zlib.h zconf.h
infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
infcodes.o: zutil.h zlib.h zconf.h
infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h
inffast.o: infblock.h infcodes.h infutil.h inffast.h
inflate.o: zutil.h zlib.h zconf.h infblock.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h
| {
"pile_set_name": "Github"
} |
<resources>
<!-- inside of a 'tech-list', values will be ANDed, so all must match! -->
<!-- tech-lists will be ORed with one another -->
<tech-list>
<tech>android.nfc.tech.NfcA</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcB</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcF</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcV</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.IsoDep</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.MifareClassic</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.MifareUltralight</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NdefFormatable</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.Ndef</tech>
</tech-list>
<!--
<tech>android.nfc.tech.IsoDep</tech>
<tech>android.nfc.tech.NfcA</tech>
<tech>android.nfc.tech.NfcB</tech>
<tech>android.nfc.tech.NfcF</tech>
<tech>android.nfc.tech.NfcV</tech>
<tech>android.nfc.tech.Ndef</tech>
<tech>android.nfc.tech.NdefFormatable</tech>
<tech>android.nfc.tech.MifareClassic</tech>
<tech>android.nfc.tech.MifareUltralight</tech> -->
<!--
<tech>android.nfc.tech.IsoDep</tech>
<tech>android.nfc.tech.NfcA</tech> -->
</resources> | {
"pile_set_name": "Github"
} |
/*!
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@mixin columns($arg: auto) {
// <column-count> || <column-width>
@include prefixer(columns, $arg, webkit moz spec);
}
@mixin column-count($int: auto) {
// auto || integer
@include prefixer(column-count, $int, webkit moz spec);
}
@mixin column-gap($length: normal) {
// normal || length
@include prefixer(column-gap, $length, webkit moz spec);
}
@mixin column-fill($arg: auto) {
// auto || length
@include prefixer(column-fill, $arg, webkit moz spec);
}
@mixin column-rule($arg) {
// <border-width> || <border-style> || <color>
@include prefixer(column-rule, $arg, webkit moz spec);
}
@mixin column-rule-color($color) {
@include prefixer(column-rule-color, $color, webkit moz spec);
}
@mixin column-rule-style($style: none) {
// none | hidden | dashed | dotted | double | groove | inset | inset | outset | ridge | solid
@include prefixer(column-rule-style, $style, webkit moz spec);
}
@mixin column-rule-width ($width: none) {
@include prefixer(column-rule-width, $width, webkit moz spec);
}
@mixin column-span($arg: none) {
// none || all
@include prefixer(column-span, $arg, webkit moz spec);
}
@mixin column-width($length: auto) {
// auto || length
@include prefixer(column-width, $length, webkit moz spec);
}
| {
"pile_set_name": "Github"
} |
-- (c) 2009-2011 John MacFarlane. Released under MIT license.
-- See the file LICENSE in the source for details.
--- HTML 5 writer for lunamark.
-- Extends [lunamark.writer.html], but uses `<section>` tags for sections
-- if `options.containers` is true.
local M = {}
local html = require("lunamark.writer.html")
--- Returns a new HTML 5 writer.
-- `options` is as in `lunamark.writer.html`.
-- For a list of fields, see [lunamark.writer.generic].
function M.new(options)
options = options or {}
local Html5 = html.new(options)
Html5.container = "section"
Html5.template = [[
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>$title</title>
</head>
<body>
$body
</body>
</html>
]]
return Html5
end
return M
| {
"pile_set_name": "Github"
} |
package de.techdev.trackr.domain.company;
import org.springframework.data.repository.CrudRepository;
/**
* @author Moritz Schulze
*/
public interface ContactPersonRepository extends CrudRepository<ContactPerson, Long> {
}
| {
"pile_set_name": "Github"
} |
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build ppc64le,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
package unix
import "syscall"
const (
B1000000 = 0x17
B115200 = 0x11
B1152000 = 0x18
B1500000 = 0x19
B2000000 = 0x1a
B230400 = 0x12
B2500000 = 0x1b
B3000000 = 0x1c
B3500000 = 0x1d
B4000000 = 0x1e
B460800 = 0x13
B500000 = 0x14
B57600 = 0x10
B576000 = 0x15
B921600 = 0x16
BLKBSZGET = 0x40081270
BLKBSZSET = 0x80081271
BLKFLSBUF = 0x20001261
BLKFRAGET = 0x20001265
BLKFRASET = 0x20001264
BLKGETSIZE = 0x20001260
BLKGETSIZE64 = 0x40081272
BLKPBSZGET = 0x2000127b
BLKRAGET = 0x20001263
BLKRASET = 0x20001262
BLKROGET = 0x2000125e
BLKROSET = 0x2000125d
BLKRRPART = 0x2000125f
BLKSECTGET = 0x20001267
BLKSECTSET = 0x20001266
BLKSSZGET = 0x20001268
BOTHER = 0x1f
BS1 = 0x8000
BSDLY = 0x8000
CBAUD = 0xff
CBAUDEX = 0x0
CIBAUD = 0xff0000
CLOCAL = 0x8000
CR1 = 0x1000
CR2 = 0x2000
CR3 = 0x3000
CRDLY = 0x3000
CREAD = 0x800
CS6 = 0x100
CS7 = 0x200
CS8 = 0x300
CSIZE = 0x300
CSTOPB = 0x400
ECHOCTL = 0x40
ECHOE = 0x2
ECHOK = 0x4
ECHOKE = 0x1
ECHONL = 0x10
ECHOPRT = 0x20
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000000
FF1 = 0x4000
FFDLY = 0x4000
FLUSHO = 0x800000
FS_IOC_ENABLE_VERITY = 0x80806685
FS_IOC_GETFLAGS = 0x40086601
FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615
FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614
FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613
F_GETLK = 0x5
F_GETLK64 = 0xc
F_GETOWN = 0x9
F_RDLCK = 0x0
F_SETLK = 0x6
F_SETLK64 = 0xd
F_SETLKW = 0x7
F_SETLKW64 = 0xe
F_SETOWN = 0x8
F_UNLCK = 0x2
F_WRLCK = 0x1
HUPCL = 0x4000
ICANON = 0x100
IEXTEN = 0x400
IN_CLOEXEC = 0x80000
IN_NONBLOCK = 0x800
IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9
ISIG = 0x80
IUCLC = 0x1000
IXOFF = 0x400
IXON = 0x200
MAP_ANON = 0x20
MAP_ANONYMOUS = 0x20
MAP_DENYWRITE = 0x800
MAP_EXECUTABLE = 0x1000
MAP_GROWSDOWN = 0x100
MAP_HUGETLB = 0x40000
MAP_LOCKED = 0x80
MAP_NONBLOCK = 0x10000
MAP_NORESERVE = 0x40
MAP_POPULATE = 0x8000
MAP_STACK = 0x20000
MAP_SYNC = 0x80000
MCL_CURRENT = 0x2000
MCL_FUTURE = 0x4000
MCL_ONFAULT = 0x8000
NFDBITS = 0x40
NL2 = 0x200
NL3 = 0x300
NLDLY = 0x300
NOFLSH = 0x80000000
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
NS_GET_PARENT = 0x2000b702
NS_GET_USERNS = 0x2000b701
OLCUC = 0x4
ONLCR = 0x2
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
O_CREAT = 0x40
O_DIRECT = 0x20000
O_DIRECTORY = 0x4000
O_DSYNC = 0x1000
O_EXCL = 0x80
O_FSYNC = 0x101000
O_LARGEFILE = 0x0
O_NDELAY = 0x800
O_NOATIME = 0x40000
O_NOCTTY = 0x100
O_NOFOLLOW = 0x8000
O_NONBLOCK = 0x800
O_PATH = 0x200000
O_RSYNC = 0x101000
O_SYNC = 0x101000
O_TMPFILE = 0x404000
O_TRUNC = 0x200
PARENB = 0x1000
PARODD = 0x2000
PENDIN = 0x20000000
PERF_EVENT_IOC_DISABLE = 0x20002401
PERF_EVENT_IOC_ENABLE = 0x20002400
PERF_EVENT_IOC_ID = 0x40082407
PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8008240b
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409
PERF_EVENT_IOC_PERIOD = 0x80082404
PERF_EVENT_IOC_QUERY_BPF = 0xc008240a
PERF_EVENT_IOC_REFRESH = 0x20002402
PERF_EVENT_IOC_RESET = 0x20002403
PERF_EVENT_IOC_SET_BPF = 0x80042408
PERF_EVENT_IOC_SET_FILTER = 0x80082406
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
PPPIOCATTACH = 0x8004743d
PPPIOCATTCHAN = 0x80047438
PPPIOCCONNECT = 0x8004743a
PPPIOCDETACH = 0x8004743c
PPPIOCDISCONN = 0x20007439
PPPIOCGASYNCMAP = 0x40047458
PPPIOCGCHAN = 0x40047437
PPPIOCGDEBUG = 0x40047441
PPPIOCGFLAGS = 0x4004745a
PPPIOCGIDLE = 0x4010743f
PPPIOCGIDLE32 = 0x4008743f
PPPIOCGIDLE64 = 0x4010743f
PPPIOCGL2TPSTATS = 0x40487436
PPPIOCGMRU = 0x40047453
PPPIOCGRASYNCMAP = 0x40047455
PPPIOCGUNIT = 0x40047456
PPPIOCGXASYNCMAP = 0x40207450
PPPIOCSACTIVE = 0x80107446
PPPIOCSASYNCMAP = 0x80047457
PPPIOCSCOMPRESS = 0x8010744d
PPPIOCSDEBUG = 0x80047440
PPPIOCSFLAGS = 0x80047459
PPPIOCSMAXCID = 0x80047451
PPPIOCSMRRU = 0x8004743b
PPPIOCSMRU = 0x80047452
PPPIOCSNPMODE = 0x8008744b
PPPIOCSPASS = 0x80107447
PPPIOCSRASYNCMAP = 0x80047454
PPPIOCSXASYNCMAP = 0x8020744f
PPPIOCXFERUNIT = 0x2000744e
PROT_SAO = 0x10
PR_SET_PTRACER_ANY = 0xffffffffffffffff
PTRACE_GETEVRREGS = 0x14
PTRACE_GETFPREGS = 0xe
PTRACE_GETREGS64 = 0x16
PTRACE_GETVRREGS = 0x12
PTRACE_GETVSRREGS = 0x1b
PTRACE_GET_DEBUGREG = 0x19
PTRACE_SETEVRREGS = 0x15
PTRACE_SETFPREGS = 0xf
PTRACE_SETREGS64 = 0x17
PTRACE_SETVRREGS = 0x13
PTRACE_SETVSRREGS = 0x1c
PTRACE_SET_DEBUGREG = 0x1a
PTRACE_SINGLEBLOCK = 0x100
PTRACE_SYSEMU = 0x1d
PTRACE_SYSEMU_SINGLESTEP = 0x1e
PT_CCR = 0x26
PT_CTR = 0x23
PT_DAR = 0x29
PT_DSCR = 0x2c
PT_DSISR = 0x2a
PT_FPR0 = 0x30
PT_FPSCR = 0x50
PT_LNK = 0x24
PT_MSR = 0x21
PT_NIP = 0x20
PT_ORIG_R3 = 0x22
PT_R0 = 0x0
PT_R1 = 0x1
PT_R10 = 0xa
PT_R11 = 0xb
PT_R12 = 0xc
PT_R13 = 0xd
PT_R14 = 0xe
PT_R15 = 0xf
PT_R16 = 0x10
PT_R17 = 0x11
PT_R18 = 0x12
PT_R19 = 0x13
PT_R2 = 0x2
PT_R20 = 0x14
PT_R21 = 0x15
PT_R22 = 0x16
PT_R23 = 0x17
PT_R24 = 0x18
PT_R25 = 0x19
PT_R26 = 0x1a
PT_R27 = 0x1b
PT_R28 = 0x1c
PT_R29 = 0x1d
PT_R3 = 0x3
PT_R30 = 0x1e
PT_R31 = 0x1f
PT_R4 = 0x4
PT_R5 = 0x5
PT_R6 = 0x6
PT_R7 = 0x7
PT_R8 = 0x8
PT_R9 = 0x9
PT_REGS_COUNT = 0x2c
PT_RESULT = 0x2b
PT_SOFTE = 0x27
PT_TRAP = 0x28
PT_VR0 = 0x52
PT_VRSAVE = 0x94
PT_VSCR = 0x93
PT_VSR0 = 0x96
PT_VSR31 = 0xd4
PT_XER = 0x25
RLIMIT_AS = 0x9
RLIMIT_MEMLOCK = 0x8
RLIMIT_NOFILE = 0x7
RLIMIT_NPROC = 0x6
RLIMIT_RSS = 0x5
RNDADDENTROPY = 0x80085203
RNDADDTOENTCNT = 0x80045201
RNDCLEARPOOL = 0x20005206
RNDGETENTCNT = 0x40045200
RNDGETPOOL = 0x40085202
RNDRESEEDCRNG = 0x20005207
RNDZAPENTCNT = 0x20005204
RTC_AIE_OFF = 0x20007002
RTC_AIE_ON = 0x20007001
RTC_ALM_READ = 0x40247008
RTC_ALM_SET = 0x80247007
RTC_EPOCH_READ = 0x4008700d
RTC_EPOCH_SET = 0x8008700e
RTC_IRQP_READ = 0x4008700b
RTC_IRQP_SET = 0x8008700c
RTC_PIE_OFF = 0x20007006
RTC_PIE_ON = 0x20007005
RTC_PLL_GET = 0x40207011
RTC_PLL_SET = 0x80207012
RTC_RD_TIME = 0x40247009
RTC_SET_TIME = 0x8024700a
RTC_UIE_OFF = 0x20007004
RTC_UIE_ON = 0x20007003
RTC_VL_CLR = 0x20007014
RTC_VL_READ = 0x40047013
RTC_WIE_OFF = 0x20007010
RTC_WIE_ON = 0x2000700f
RTC_WKALM_RD = 0x40287010
RTC_WKALM_SET = 0x8028700f
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
SCM_TIMESTAMPNS = 0x23
SCM_TXTIME = 0x3d
SCM_WIFI_STATUS = 0x29
SFD_CLOEXEC = 0x80000
SFD_NONBLOCK = 0x800
SIOCATMARK = 0x8905
SIOCGPGRP = 0x8904
SIOCGSTAMPNS_NEW = 0x40108907
SIOCGSTAMP_NEW = 0x40108906
SIOCINQ = 0x4004667f
SIOCOUTQ = 0x40047473
SIOCSPGRP = 0x8902
SOCK_CLOEXEC = 0x80000
SOCK_DGRAM = 0x2
SOCK_NONBLOCK = 0x800
SOCK_STREAM = 0x1
SOL_SOCKET = 0x1
SO_ACCEPTCONN = 0x1e
SO_ATTACH_BPF = 0x32
SO_ATTACH_REUSEPORT_CBPF = 0x33
SO_ATTACH_REUSEPORT_EBPF = 0x34
SO_BINDTODEVICE = 0x19
SO_BINDTOIFINDEX = 0x3e
SO_BPF_EXTENSIONS = 0x30
SO_BROADCAST = 0x6
SO_BSDCOMPAT = 0xe
SO_BUSY_POLL = 0x2e
SO_CNX_ADVICE = 0x35
SO_COOKIE = 0x39
SO_DETACH_REUSEPORT_BPF = 0x44
SO_DOMAIN = 0x27
SO_DONTROUTE = 0x5
SO_ERROR = 0x4
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
SO_NOFCS = 0x2b
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x14
SO_PASSSEC = 0x22
SO_PEEK_OFF = 0x2a
SO_PEERCRED = 0x15
SO_PEERGROUPS = 0x3b
SO_PEERSEC = 0x1f
SO_PROTOCOL = 0x26
SO_RCVBUF = 0x8
SO_RCVBUFFORCE = 0x21
SO_RCVLOWAT = 0x10
SO_RCVTIMEO = 0x12
SO_RCVTIMEO_NEW = 0x42
SO_RCVTIMEO_OLD = 0x12
SO_REUSEADDR = 0x2
SO_REUSEPORT = 0xf
SO_RXQ_OVFL = 0x28
SO_SECURITY_AUTHENTICATION = 0x16
SO_SECURITY_ENCRYPTION_NETWORK = 0x18
SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17
SO_SELECT_ERR_QUEUE = 0x2d
SO_SNDBUF = 0x7
SO_SNDBUFFORCE = 0x20
SO_SNDLOWAT = 0x11
SO_SNDTIMEO = 0x13
SO_SNDTIMEO_NEW = 0x43
SO_SNDTIMEO_OLD = 0x13
SO_TIMESTAMPING = 0x25
SO_TIMESTAMPING_NEW = 0x41
SO_TIMESTAMPING_OLD = 0x25
SO_TIMESTAMPNS = 0x23
SO_TIMESTAMPNS_NEW = 0x40
SO_TIMESTAMPNS_OLD = 0x23
SO_TIMESTAMP_NEW = 0x3f
SO_TXTIME = 0x3d
SO_TYPE = 0x3
SO_WIFI_STATUS = 0x29
SO_ZEROCOPY = 0x3c
TAB1 = 0x400
TAB2 = 0x800
TAB3 = 0xc00
TABDLY = 0xc00
TCFLSH = 0x2000741f
TCGETA = 0x40147417
TCGETS = 0x402c7413
TCSAFLUSH = 0x2
TCSBRK = 0x2000741d
TCSBRKP = 0x5425
TCSETA = 0x80147418
TCSETAF = 0x8014741c
TCSETAW = 0x80147419
TCSETS = 0x802c7414
TCSETSF = 0x802c7416
TCSETSW = 0x802c7415
TCXONC = 0x2000741e
TIOCCBRK = 0x5428
TIOCCONS = 0x541d
TIOCEXCL = 0x540c
TIOCGDEV = 0x40045432
TIOCGETC = 0x40067412
TIOCGETD = 0x5424
TIOCGETP = 0x40067408
TIOCGEXCL = 0x40045440
TIOCGICOUNT = 0x545d
TIOCGISO7816 = 0x40285442
TIOCGLCKTRMIOS = 0x5456
TIOCGLTC = 0x40067474
TIOCGPGRP = 0x40047477
TIOCGPKT = 0x40045438
TIOCGPTLCK = 0x40045439
TIOCGPTN = 0x40045430
TIOCGPTPEER = 0x20005441
TIOCGRS485 = 0x542e
TIOCGSERIAL = 0x541e
TIOCGSID = 0x5429
TIOCGSOFTCAR = 0x5419
TIOCGWINSZ = 0x40087468
TIOCINQ = 0x4004667f
TIOCLINUX = 0x541c
TIOCMBIC = 0x5417
TIOCMBIS = 0x5416
TIOCMGET = 0x5415
TIOCMIWAIT = 0x545c
TIOCMSET = 0x5418
TIOCM_CAR = 0x40
TIOCM_CD = 0x40
TIOCM_CTS = 0x20
TIOCM_DSR = 0x100
TIOCM_LOOP = 0x8000
TIOCM_OUT1 = 0x2000
TIOCM_OUT2 = 0x4000
TIOCM_RI = 0x80
TIOCM_RNG = 0x80
TIOCM_SR = 0x10
TIOCM_ST = 0x8
TIOCNOTTY = 0x5422
TIOCNXCL = 0x540d
TIOCOUTQ = 0x40047473
TIOCPKT = 0x5420
TIOCSBRK = 0x5427
TIOCSCTTY = 0x540e
TIOCSERCONFIG = 0x5453
TIOCSERGETLSR = 0x5459
TIOCSERGETMULTI = 0x545a
TIOCSERGSTRUCT = 0x5458
TIOCSERGWILD = 0x5454
TIOCSERSETMULTI = 0x545b
TIOCSERSWILD = 0x5455
TIOCSER_TEMT = 0x1
TIOCSETC = 0x80067411
TIOCSETD = 0x5423
TIOCSETN = 0x8006740a
TIOCSETP = 0x80067409
TIOCSIG = 0x80045436
TIOCSISO7816 = 0xc0285443
TIOCSLCKTRMIOS = 0x5457
TIOCSLTC = 0x80067475
TIOCSPGRP = 0x80047476
TIOCSPTLCK = 0x80045431
TIOCSRS485 = 0x542f
TIOCSSERIAL = 0x541f
TIOCSSOFTCAR = 0x541a
TIOCSTART = 0x2000746e
TIOCSTI = 0x5412
TIOCSTOP = 0x2000746f
TIOCSWINSZ = 0x80087467
TIOCVHANGUP = 0x5437
TOSTOP = 0x400000
TUNATTACHFILTER = 0x801054d5
TUNDETACHFILTER = 0x801054d6
TUNGETDEVNETNS = 0x200054e3
TUNGETFEATURES = 0x400454cf
TUNGETFILTER = 0x401054db
TUNGETIFF = 0x400454d2
TUNGETSNDBUF = 0x400454d3
TUNGETVNETBE = 0x400454df
TUNGETVNETHDRSZ = 0x400454d7
TUNGETVNETLE = 0x400454dd
TUNSETCARRIER = 0x800454e2
TUNSETDEBUG = 0x800454c9
TUNSETFILTEREBPF = 0x400454e1
TUNSETGROUP = 0x800454ce
TUNSETIFF = 0x800454ca
TUNSETIFINDEX = 0x800454da
TUNSETLINK = 0x800454cd
TUNSETNOCSUM = 0x800454c8
TUNSETOFFLOAD = 0x800454d0
TUNSETOWNER = 0x800454cc
TUNSETPERSIST = 0x800454cb
TUNSETQUEUE = 0x800454d9
TUNSETSNDBUF = 0x800454d4
TUNSETSTEERINGEBPF = 0x400454e0
TUNSETTXFILTER = 0x800454d1
TUNSETVNETBE = 0x800454de
TUNSETVNETHDRSZ = 0x800454d8
TUNSETVNETLE = 0x800454dc
UBI_IOCATT = 0x80186f40
UBI_IOCDET = 0x80046f41
UBI_IOCEBCH = 0x80044f02
UBI_IOCEBER = 0x80044f01
UBI_IOCEBISMAP = 0x40044f05
UBI_IOCEBMAP = 0x80084f03
UBI_IOCEBUNMAP = 0x80044f04
UBI_IOCMKVOL = 0x80986f00
UBI_IOCRMVOL = 0x80046f01
UBI_IOCRNVOL = 0x91106f03
UBI_IOCRPEB = 0x80046f04
UBI_IOCRSVOL = 0x800c6f02
UBI_IOCSETVOLPROP = 0x80104f06
UBI_IOCSPEB = 0x80046f05
UBI_IOCVOLCRBLK = 0x80804f07
UBI_IOCVOLRMBLK = 0x20004f08
UBI_IOCVOLUP = 0x80084f00
VDISCARD = 0x10
VEOF = 0x4
VEOL = 0x6
VEOL2 = 0x8
VMIN = 0x5
VREPRINT = 0xb
VSTART = 0xd
VSTOP = 0xe
VSUSP = 0xc
VSWTC = 0x9
VT1 = 0x10000
VTDLY = 0x10000
VTIME = 0x7
VWERASE = 0xa
WDIOC_GETBOOTSTATUS = 0x40045702
WDIOC_GETPRETIMEOUT = 0x40045709
WDIOC_GETSTATUS = 0x40045701
WDIOC_GETSUPPORT = 0x40285700
WDIOC_GETTEMP = 0x40045703
WDIOC_GETTIMELEFT = 0x4004570a
WDIOC_GETTIMEOUT = 0x40045707
WDIOC_KEEPALIVE = 0x40045705
WDIOC_SETOPTIONS = 0x40045704
WORDSIZE = 0x40
XCASE = 0x4000
XTABS = 0xc00
)
// Errors
const (
EADDRINUSE = syscall.Errno(0x62)
EADDRNOTAVAIL = syscall.Errno(0x63)
EADV = syscall.Errno(0x44)
EAFNOSUPPORT = syscall.Errno(0x61)
EALREADY = syscall.Errno(0x72)
EBADE = syscall.Errno(0x34)
EBADFD = syscall.Errno(0x4d)
EBADMSG = syscall.Errno(0x4a)
EBADR = syscall.Errno(0x35)
EBADRQC = syscall.Errno(0x38)
EBADSLT = syscall.Errno(0x39)
EBFONT = syscall.Errno(0x3b)
ECANCELED = syscall.Errno(0x7d)
ECHRNG = syscall.Errno(0x2c)
ECOMM = syscall.Errno(0x46)
ECONNABORTED = syscall.Errno(0x67)
ECONNREFUSED = syscall.Errno(0x6f)
ECONNRESET = syscall.Errno(0x68)
EDEADLK = syscall.Errno(0x23)
EDEADLOCK = syscall.Errno(0x3a)
EDESTADDRREQ = syscall.Errno(0x59)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
EIDRM = syscall.Errno(0x2b)
EILSEQ = syscall.Errno(0x54)
EINPROGRESS = syscall.Errno(0x73)
EISCONN = syscall.Errno(0x6a)
EISNAM = syscall.Errno(0x78)
EKEYEXPIRED = syscall.Errno(0x7f)
EKEYREJECTED = syscall.Errno(0x81)
EKEYREVOKED = syscall.Errno(0x80)
EL2HLT = syscall.Errno(0x33)
EL2NSYNC = syscall.Errno(0x2d)
EL3HLT = syscall.Errno(0x2e)
EL3RST = syscall.Errno(0x2f)
ELIBACC = syscall.Errno(0x4f)
ELIBBAD = syscall.Errno(0x50)
ELIBEXEC = syscall.Errno(0x53)
ELIBMAX = syscall.Errno(0x52)
ELIBSCN = syscall.Errno(0x51)
ELNRNG = syscall.Errno(0x30)
ELOOP = syscall.Errno(0x28)
EMEDIUMTYPE = syscall.Errno(0x7c)
EMSGSIZE = syscall.Errno(0x5a)
EMULTIHOP = syscall.Errno(0x48)
ENAMETOOLONG = syscall.Errno(0x24)
ENAVAIL = syscall.Errno(0x77)
ENETDOWN = syscall.Errno(0x64)
ENETRESET = syscall.Errno(0x66)
ENETUNREACH = syscall.Errno(0x65)
ENOANO = syscall.Errno(0x37)
ENOBUFS = syscall.Errno(0x69)
ENOCSI = syscall.Errno(0x32)
ENODATA = syscall.Errno(0x3d)
ENOKEY = syscall.Errno(0x7e)
ENOLCK = syscall.Errno(0x25)
ENOLINK = syscall.Errno(0x43)
ENOMEDIUM = syscall.Errno(0x7b)
ENOMSG = syscall.Errno(0x2a)
ENONET = syscall.Errno(0x40)
ENOPKG = syscall.Errno(0x41)
ENOPROTOOPT = syscall.Errno(0x5c)
ENOSR = syscall.Errno(0x3f)
ENOSTR = syscall.Errno(0x3c)
ENOSYS = syscall.Errno(0x26)
ENOTCONN = syscall.Errno(0x6b)
ENOTEMPTY = syscall.Errno(0x27)
ENOTNAM = syscall.Errno(0x76)
ENOTRECOVERABLE = syscall.Errno(0x83)
ENOTSOCK = syscall.Errno(0x58)
ENOTSUP = syscall.Errno(0x5f)
ENOTUNIQ = syscall.Errno(0x4c)
EOPNOTSUPP = syscall.Errno(0x5f)
EOVERFLOW = syscall.Errno(0x4b)
EOWNERDEAD = syscall.Errno(0x82)
EPFNOSUPPORT = syscall.Errno(0x60)
EPROTO = syscall.Errno(0x47)
EPROTONOSUPPORT = syscall.Errno(0x5d)
EPROTOTYPE = syscall.Errno(0x5b)
EREMCHG = syscall.Errno(0x4e)
EREMOTE = syscall.Errno(0x42)
EREMOTEIO = syscall.Errno(0x79)
ERESTART = syscall.Errno(0x55)
ERFKILL = syscall.Errno(0x84)
ESHUTDOWN = syscall.Errno(0x6c)
ESOCKTNOSUPPORT = syscall.Errno(0x5e)
ESRMNT = syscall.Errno(0x45)
ESTALE = syscall.Errno(0x74)
ESTRPIPE = syscall.Errno(0x56)
ETIME = syscall.Errno(0x3e)
ETIMEDOUT = syscall.Errno(0x6e)
ETOOMANYREFS = syscall.Errno(0x6d)
EUCLEAN = syscall.Errno(0x75)
EUNATCH = syscall.Errno(0x31)
EUSERS = syscall.Errno(0x57)
EXFULL = syscall.Errno(0x36)
)
// Signals
const (
SIGBUS = syscall.Signal(0x7)
SIGCHLD = syscall.Signal(0x11)
SIGCLD = syscall.Signal(0x11)
SIGCONT = syscall.Signal(0x12)
SIGIO = syscall.Signal(0x1d)
SIGPOLL = syscall.Signal(0x1d)
SIGPROF = syscall.Signal(0x1b)
SIGPWR = syscall.Signal(0x1e)
SIGSTKFLT = syscall.Signal(0x10)
SIGSTOP = syscall.Signal(0x13)
SIGSYS = syscall.Signal(0x1f)
SIGTSTP = syscall.Signal(0x14)
SIGTTIN = syscall.Signal(0x15)
SIGTTOU = syscall.Signal(0x16)
SIGURG = syscall.Signal(0x17)
SIGUSR1 = syscall.Signal(0xa)
SIGUSR2 = syscall.Signal(0xc)
SIGVTALRM = syscall.Signal(0x1a)
SIGWINCH = syscall.Signal(0x1c)
SIGXCPU = syscall.Signal(0x18)
SIGXFSZ = syscall.Signal(0x19)
)
// Error table
var errorList = [...]struct {
num syscall.Errno
name string
desc string
}{
{1, "EPERM", "operation not permitted"},
{2, "ENOENT", "no such file or directory"},
{3, "ESRCH", "no such process"},
{4, "EINTR", "interrupted system call"},
{5, "EIO", "input/output error"},
{6, "ENXIO", "no such device or address"},
{7, "E2BIG", "argument list too long"},
{8, "ENOEXEC", "exec format error"},
{9, "EBADF", "bad file descriptor"},
{10, "ECHILD", "no child processes"},
{11, "EAGAIN", "resource temporarily unavailable"},
{12, "ENOMEM", "cannot allocate memory"},
{13, "EACCES", "permission denied"},
{14, "EFAULT", "bad address"},
{15, "ENOTBLK", "block device required"},
{16, "EBUSY", "device or resource busy"},
{17, "EEXIST", "file exists"},
{18, "EXDEV", "invalid cross-device link"},
{19, "ENODEV", "no such device"},
{20, "ENOTDIR", "not a directory"},
{21, "EISDIR", "is a directory"},
{22, "EINVAL", "invalid argument"},
{23, "ENFILE", "too many open files in system"},
{24, "EMFILE", "too many open files"},
{25, "ENOTTY", "inappropriate ioctl for device"},
{26, "ETXTBSY", "text file busy"},
{27, "EFBIG", "file too large"},
{28, "ENOSPC", "no space left on device"},
{29, "ESPIPE", "illegal seek"},
{30, "EROFS", "read-only file system"},
{31, "EMLINK", "too many links"},
{32, "EPIPE", "broken pipe"},
{33, "EDOM", "numerical argument out of domain"},
{34, "ERANGE", "numerical result out of range"},
{35, "EDEADLK", "resource deadlock avoided"},
{36, "ENAMETOOLONG", "file name too long"},
{37, "ENOLCK", "no locks available"},
{38, "ENOSYS", "function not implemented"},
{39, "ENOTEMPTY", "directory not empty"},
{40, "ELOOP", "too many levels of symbolic links"},
{42, "ENOMSG", "no message of desired type"},
{43, "EIDRM", "identifier removed"},
{44, "ECHRNG", "channel number out of range"},
{45, "EL2NSYNC", "level 2 not synchronized"},
{46, "EL3HLT", "level 3 halted"},
{47, "EL3RST", "level 3 reset"},
{48, "ELNRNG", "link number out of range"},
{49, "EUNATCH", "protocol driver not attached"},
{50, "ENOCSI", "no CSI structure available"},
{51, "EL2HLT", "level 2 halted"},
{52, "EBADE", "invalid exchange"},
{53, "EBADR", "invalid request descriptor"},
{54, "EXFULL", "exchange full"},
{55, "ENOANO", "no anode"},
{56, "EBADRQC", "invalid request code"},
{57, "EBADSLT", "invalid slot"},
{58, "EDEADLOCK", "file locking deadlock error"},
{59, "EBFONT", "bad font file format"},
{60, "ENOSTR", "device not a stream"},
{61, "ENODATA", "no data available"},
{62, "ETIME", "timer expired"},
{63, "ENOSR", "out of streams resources"},
{64, "ENONET", "machine is not on the network"},
{65, "ENOPKG", "package not installed"},
{66, "EREMOTE", "object is remote"},
{67, "ENOLINK", "link has been severed"},
{68, "EADV", "advertise error"},
{69, "ESRMNT", "srmount error"},
{70, "ECOMM", "communication error on send"},
{71, "EPROTO", "protocol error"},
{72, "EMULTIHOP", "multihop attempted"},
{73, "EDOTDOT", "RFS specific error"},
{74, "EBADMSG", "bad message"},
{75, "EOVERFLOW", "value too large for defined data type"},
{76, "ENOTUNIQ", "name not unique on network"},
{77, "EBADFD", "file descriptor in bad state"},
{78, "EREMCHG", "remote address changed"},
{79, "ELIBACC", "can not access a needed shared library"},
{80, "ELIBBAD", "accessing a corrupted shared library"},
{81, "ELIBSCN", ".lib section in a.out corrupted"},
{82, "ELIBMAX", "attempting to link in too many shared libraries"},
{83, "ELIBEXEC", "cannot exec a shared library directly"},
{84, "EILSEQ", "invalid or incomplete multibyte or wide character"},
{85, "ERESTART", "interrupted system call should be restarted"},
{86, "ESTRPIPE", "streams pipe error"},
{87, "EUSERS", "too many users"},
{88, "ENOTSOCK", "socket operation on non-socket"},
{89, "EDESTADDRREQ", "destination address required"},
{90, "EMSGSIZE", "message too long"},
{91, "EPROTOTYPE", "protocol wrong type for socket"},
{92, "ENOPROTOOPT", "protocol not available"},
{93, "EPROTONOSUPPORT", "protocol not supported"},
{94, "ESOCKTNOSUPPORT", "socket type not supported"},
{95, "ENOTSUP", "operation not supported"},
{96, "EPFNOSUPPORT", "protocol family not supported"},
{97, "EAFNOSUPPORT", "address family not supported by protocol"},
{98, "EADDRINUSE", "address already in use"},
{99, "EADDRNOTAVAIL", "cannot assign requested address"},
{100, "ENETDOWN", "network is down"},
{101, "ENETUNREACH", "network is unreachable"},
{102, "ENETRESET", "network dropped connection on reset"},
{103, "ECONNABORTED", "software caused connection abort"},
{104, "ECONNRESET", "connection reset by peer"},
{105, "ENOBUFS", "no buffer space available"},
{106, "EISCONN", "transport endpoint is already connected"},
{107, "ENOTCONN", "transport endpoint is not connected"},
{108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
{109, "ETOOMANYREFS", "too many references: cannot splice"},
{110, "ETIMEDOUT", "connection timed out"},
{111, "ECONNREFUSED", "connection refused"},
{112, "EHOSTDOWN", "host is down"},
{113, "EHOSTUNREACH", "no route to host"},
{114, "EALREADY", "operation already in progress"},
{115, "EINPROGRESS", "operation now in progress"},
{116, "ESTALE", "stale file handle"},
{117, "EUCLEAN", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
{121, "EREMOTEIO", "remote I/O error"},
{122, "EDQUOT", "disk quota exceeded"},
{123, "ENOMEDIUM", "no medium found"},
{124, "EMEDIUMTYPE", "wrong medium type"},
{125, "ECANCELED", "operation canceled"},
{126, "ENOKEY", "required key not available"},
{127, "EKEYEXPIRED", "key has expired"},
{128, "EKEYREVOKED", "key has been revoked"},
{129, "EKEYREJECTED", "key was rejected by service"},
{130, "EOWNERDEAD", "owner died"},
{131, "ENOTRECOVERABLE", "state not recoverable"},
{132, "ERFKILL", "operation not possible due to RF-kill"},
{133, "EHWPOISON", "memory page has hardware error"},
}
// Signal table
var signalList = [...]struct {
num syscall.Signal
name string
desc string
}{
{1, "SIGHUP", "hangup"},
{2, "SIGINT", "interrupt"},
{3, "SIGQUIT", "quit"},
{4, "SIGILL", "illegal instruction"},
{5, "SIGTRAP", "trace/breakpoint trap"},
{6, "SIGABRT", "aborted"},
{7, "SIGBUS", "bus error"},
{8, "SIGFPE", "floating point exception"},
{9, "SIGKILL", "killed"},
{10, "SIGUSR1", "user defined signal 1"},
{11, "SIGSEGV", "segmentation fault"},
{12, "SIGUSR2", "user defined signal 2"},
{13, "SIGPIPE", "broken pipe"},
{14, "SIGALRM", "alarm clock"},
{15, "SIGTERM", "terminated"},
{16, "SIGSTKFLT", "stack fault"},
{17, "SIGCHLD", "child exited"},
{18, "SIGCONT", "continued"},
{19, "SIGSTOP", "stopped (signal)"},
{20, "SIGTSTP", "stopped"},
{21, "SIGTTIN", "stopped (tty input)"},
{22, "SIGTTOU", "stopped (tty output)"},
{23, "SIGURG", "urgent I/O condition"},
{24, "SIGXCPU", "CPU time limit exceeded"},
{25, "SIGXFSZ", "file size limit exceeded"},
{26, "SIGVTALRM", "virtual timer expired"},
{27, "SIGPROF", "profiling timer expired"},
{28, "SIGWINCH", "window changed"},
{29, "SIGIO", "I/O possible"},
{30, "SIGPWR", "power failure"},
{31, "SIGSYS", "bad system call"},
}
| {
"pile_set_name": "Github"
} |
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Protobuf
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Protobuf" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/BoringSSL" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseAuth" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseDatabase" "${PODS_ROOT}/Headers/Public/FirebaseFirestore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/GTMSessionFetcher" "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" "${PODS_ROOT}/Headers/Public/Protobuf" "${PODS_ROOT}/Headers/Public/gRPC" "${PODS_ROOT}/Headers/Public/gRPC-Core" "${PODS_ROOT}/Headers/Public/gRPC-ProtoRPC" "${PODS_ROOT}/Headers/Public/gRPC-RxLibrary" "${PODS_ROOT}/Headers/Public/leveldb-library" "${PODS_ROOT}/Headers/Public/nanopb"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/Protobuf
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
| {
"pile_set_name": "Github"
} |
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include <mutex>
#include <vector>
#include "common/ceph_context.h"
#include "common/debug.h"
#include "common/errno.h"
#include "mon/MonClient.h"
#include "ClusterWatcher.h"
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_cephfs_mirror
#undef dout_prefix
#define dout_prefix *_dout << "cephfs::mirror::ClusterWatcher " << __func__
namespace cephfs {
namespace mirror {
ClusterWatcher::ClusterWatcher(CephContext *cct, MonClient *monc, Listener &listener)
: Dispatcher(cct),
m_monc(monc),
m_listener(listener) {
}
ClusterWatcher::~ClusterWatcher() {
}
bool ClusterWatcher::ms_can_fast_dispatch2(const cref_t<Message> &m) const {
return m->get_type() == CEPH_MSG_FS_MAP;
}
void ClusterWatcher::ms_fast_dispatch2(const ref_t<Message> &m) {
bool handled = ms_dispatch2(m);
ceph_assert(handled);
}
bool ClusterWatcher::ms_dispatch2(const ref_t<Message> &m) {
if (m->get_type() == CEPH_MSG_FS_MAP) {
if (m->get_connection()->get_peer_type() == CEPH_ENTITY_TYPE_MON) {
handle_fsmap(ref_cast<MFSMap>(m));
}
return true;
}
return false;
}
int ClusterWatcher::init() {
dout(20) << dendl;
bool sub = m_monc->sub_want("fsmap", 0, 0);
if (!sub) {
derr << ": failed subscribing to FSMap" << dendl;
return -1;
}
m_monc->renew_subs();
dout(10) << ": subscribed to FSMap" << dendl;
return 0;
}
void ClusterWatcher::shutdown() {
dout(20) << dendl;
std::scoped_lock locker(m_lock);
m_monc->sub_unwant("fsmap");
}
void ClusterWatcher::handle_fsmap(const cref_t<MFSMap> &m) {
dout(20) << dendl;
auto fsmap = m->get_fsmap();
auto filesystems = fsmap.get_filesystems();
std::vector<std::string> mirroring_enabled;
std::vector<std::string> mirroring_disabled;
std::map<std::string, Peers> peers_added;
std::map<std::string, Peers> peers_removed;
std::map<std::string, uint64_t> fs_metadata_pools;
{
std::scoped_lock locker(m_lock);
for (auto &filesystem : filesystems) {
auto fs_name = filesystem->mds_map.get_fs_name();
auto pool_id = filesystem->mds_map.get_metadata_pool();
auto &mirror_info = filesystem->mirror_info;
if (!mirror_info.is_mirrored()) {
auto it = m_filesystem_peers.find(fs_name);
if (it != m_filesystem_peers.end()) {
mirroring_disabled.emplace_back(fs_name);
m_filesystem_peers.erase(it);
}
} else {
auto [fspeersit, enabled] = m_filesystem_peers.emplace(fs_name, Peers{});
auto &peers = fspeersit->second;
if (enabled) {
mirroring_enabled.emplace_back(fs_name);
fs_metadata_pools.emplace(fs_name, pool_id);
}
// peers added
Peers added;
std::set_difference(mirror_info.peers.begin(), mirror_info.peers.end(),
peers.begin(), peers.end(), std::inserter(added, added.end()));
// peers removed
Peers removed;
std::set_difference(peers.begin(), peers.end(),
mirror_info.peers.begin(), mirror_info.peers.end(),
std::inserter(removed, removed.end()));
// update set
if (!added.empty()) {
peers_added.emplace(fs_name, added);
peers.insert(added.begin(), added.end());
}
if (!removed.empty()) {
peers_removed.emplace(fs_name, removed);
for (auto &p : removed) {
peers.erase(p);
}
}
}
}
}
dout(5) << ": mirroring enabled=" << mirroring_enabled << ", mirroring_disabled="
<< mirroring_disabled << dendl;
for (auto &fs_name : mirroring_enabled) {
m_listener.handle_mirroring_enabled(FilesystemSpec(fs_name, fs_metadata_pools.at(fs_name)));
}
for (auto &fs_name : mirroring_disabled) {
m_listener.handle_mirroring_disabled(fs_name);
}
dout(5) << ": peers added=" << peers_added << ", peers removed=" << peers_removed << dendl;
for (auto &[fs_name, peers] : peers_added) {
for (auto &peer : peers) {
m_listener.handle_peers_added(fs_name, peer);
}
}
for (auto &[fs_name, peers] : peers_removed) {
for (auto &peer : peers) {
m_listener.handle_peers_removed(fs_name, peer);
}
}
m_monc->sub_got("fsmap", fsmap.get_epoch());
}
} // namespace mirror
} // namespace cephfs
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env ruby
require 'linguistics/en' unless defined?( Linguistics )
# Plural inflection methods for the English-language Linguistics module.
#
# It provides conversion of plural forms of all nouns, most verbs,
# and some adjectives. It also provides "classical" variants (for
# example: "brother" -> "brethren", "dogma" -> "dogmata", etc.) where
# appropriate.
module Linguistics::EN::Pluralization
# Register this module to the list of modules to include
Linguistics::EN.register_extension( self )
### Utility function for creating Regexp unions
def self::matchgroup( *parts )
return Regexp.union( *(parts.flatten) )
end
private_class_method :matchgroup
#
# Plurals
#
PL_sb_irregular_s = {
"ephemeris" => "ephemerides",
"iris" => "irises|irides",
"clitoris" => "clitorises|clitorides",
"corpus" => "corpuses|corpora",
"opus" => "opuses|opera",
"genus" => "genera",
"mythos" => "mythoi",
"penis" => "penises|penes",
"testis" => "testes",
}
PL_sb_irregular_h = {
"child" => "children",
"brother" => "brothers|brethren",
"loaf" => "loaves",
"hoof" => "hoofs|hooves",
"beef" => "beefs|beeves",
"money" => "monies",
"mongoose" => "mongooses",
"ox" => "oxen",
"cow" => "cows|kine",
"soliloquy" => "soliloquies",
"graffito" => "graffiti",
"prima donna" => "prima donnas|prime donne",
"octopus" => "octopuses|octopodes",
"genie" => "genies|genii",
"ganglion" => "ganglions|ganglia",
"trilby" => "trilbys",
"turf" => "turfs|turves",
}.update( PL_sb_irregular_s )
PL_sb_irregular = matchgroup PL_sb_irregular_h.keys
# Classical "..a" -> "..ata"
PL_sb_C_a_ata = matchgroup %w[
anathema bema carcinoma charisma diploma
dogma drama edema enema enigma lemma
lymphoma magma melisma miasma oedema
sarcoma schema soma stigma stoma trauma
gumma pragma
].collect {|word| word[0...-1]}
# Unconditional "..a" -> "..ae"
PL_sb_U_a_ae = matchgroup %w[
alumna alga vertebra persona
]
# Classical "..a" -> "..ae"
PL_sb_C_a_ae = matchgroup [/.*umbra/ ] + %w[
amoeba antenna formula hyperbola
medusa nebula parabola abscissa
hydra nova lacuna aurora
flora fauna
]
# Classical "..en" -> "..ina"
PL_sb_C_en_ina = matchgroup %w[
stamen foramen lumen
].collect {|word| word[0...-2] }
# Unconditional "..um" -> "..a"
PL_sb_U_um_a = matchgroup %w[
bacterium agendum desideratum erratum
stratum datum ovum extremum candelabrum
].collect {|word| word[0...-2] }
# Classical "..um" -> "..a"
PL_sb_C_um_a = matchgroup %w[
maximum minimum momentum optimum
quantum cranium curriculum dictum
phylum aquarium compendium emporium
enconium gymnasium honorarium interregnum
lustrum memorandum millenium rostrum
spectrum speculum stadium trapezium
ultimatum medium vacuum velum
consortium
].collect {|word| word[0...-2]}
# Unconditional "..us" -> "i"
PL_sb_U_us_i = matchgroup %w[
alumnus alveolus bacillus bronchus
locus nucleus stimulus meniscus
].collect {|word| word[0...-2]}
# Classical "..us" -> "..i"
PL_sb_C_us_i = matchgroup %w[
focus radius genius
incubus succubus nimbus
fungus nucleolus stylus
torus umbilicus uterus
hippopotamus
].collect {|word| word[0...-2]}
# Classical "..us" -> "..us" (assimilated 4th declension latin nouns)
PL_sb_C_us_us = matchgroup %w[
status apparatus prospectus sinus
hiatus impetus plexus
]
# Unconditional "..on" -> "a"
PL_sb_U_on_a = matchgroup %w[
criterion perihelion aphelion
phenomenon prolegomenon noumenon
organon asyndeton hyperbaton
].collect {|word| word[0...-2]}
# Classical "..on" -> "..a"
PL_sb_C_on_a = matchgroup %w[
oxymoron
].collect {|word| word[0...-2]}
# Classical "..o" -> "..i" (but normally -> "..os")
PL_sb_C_o_i_a = %w[
solo soprano basso alto
contralto tempo piano
]
PL_sb_C_o_i = matchgroup PL_sb_C_o_i_a.collect{|word| word[0...-1]}
# Always "..o" -> "..os"
PL_sb_U_o_os = matchgroup( %w[
albino archipelago armadillo
commando crescendo fiasco
ditto dynamo embryo
ghetto guano inferno
jumbo lumbago magneto
manifesto medico octavo
photo pro quarto
canto lingo generalissimo
stylo rhino
] | PL_sb_C_o_i_a )
# Unconditional "..[ei]x" -> "..ices"
PL_sb_U_ex_ices = matchgroup %w[
codex murex silex
].collect {|word| word[0...-2]}
PL_sb_U_ix_ices = matchgroup %w[
radix helix
].collect {|word| word[0...-2]}
# Classical "..[ei]x" -> "..ices"
PL_sb_C_ex_ices = matchgroup %w[
vortex vertex cortex latex
pontifex apex index simplex
].collect {|word| word[0...-2]}
PL_sb_C_ix_ices = matchgroup %w[
appendix
].collect {|word| word[0...-2]}
# Arabic: ".." -> "..i"
PL_sb_C_i = matchgroup %w[
afrit afreet efreet
]
# Hebrew: ".." -> "..im"
PL_sb_C_im = matchgroup %w[
goy seraph cherub
]
# Unconditional "..man" -> "..mans"
PL_sb_U_man_mans = matchgroup %w[
human
Alabaman Bahaman Burman German
Hiroshiman Liman Nakayaman Oklahoman
Panaman Selman Sonaman Tacoman Yakiman
Yokohaman Yuman
]
PL_sb_uninflected_s = [
# Pairs or groups subsumed to a singular...
"breeches", "britches", "clippers", "gallows", "hijinks",
"headquarters", "pliers", "scissors", "testes", "herpes",
"pincers", "shears", "proceedings", "trousers",
# Unassimilated Latin 4th declension
"cantus", "coitus", "nexus",
# Recent imports...
"contretemps", "corps", "debris",
/.*ois/,
# Diseases
/.*measles/, "mumps",
# Miscellaneous others...
"diabetes", "jackanapes", "series", "species", "rabies",
"chassis", "innings", "news", "mews",
]
# Don't inflect in classical mode, otherwise normal inflection
PL_sb_uninflected_herd = matchgroup %w[
wildebeest swine eland bison buffalo
elk moose rhinoceros
]
PL_sb_uninflected = matchgroup(
# Some fish and herd animals
/.*fish/, "tuna", "salmon", "mackerel", "trout",
"bream", /sea[- ]bass/, "carp", "cod", "flounder", "whiting",
/.*deer/, /.*sheep/,
# All nationals ending in -ese
"Portuguese", "Amoyese", "Borghese", "Congoese", "Faroese",
"Foochowese", "Genevese", "Genoese", "Gilbertese", "Hottentotese",
"Kiplingese", "Kongoese", "Lucchese", "Maltese", "Nankingese",
"Niasese", "Pekingese", "Piedmontese", "Pistoiese", "Sarawakese",
"Shavese", "Vermontese", "Wenchowese", "Yengeese",
/.*[nrlm]ese/,
# Some words ending in ...s (often pairs taken as a whole)
PL_sb_uninflected_s,
# Diseases
/.*pox/,
# Other oddities
"graffiti", "djinn"
)
# Singular words ending in ...s (all inflect with ...es)
PL_sb_singular_s = matchgroup [ /.*ss/, /.*us/ ] +
%w[
acropolis aegis alias arthritis asbestos atlas
bathos bias bronchitis bursitis caddis cannabis
canvas chaos cosmos dais digitalis encephalitis
epidermis ethos eyas gas glottis hepatitis
hubris ibis lens mantis marquis metropolis
neuritis pathos pelvis polis rhinoceros
sassafras tonsillitis trellis
]
PL_v_special_s = matchgroup [
PL_sb_singular_s,
PL_sb_uninflected_s,
PL_sb_irregular_s.keys,
/(.*[csx])is/,
/(.*)ceps/,
/[A-Z].*s/,
]
PL_sb_postfix_adj = '(' + {
'general' => '(?!major|lieutenant|brigadier|adjutant)\S+',
'martial' => "court",
}.collect {|key,val|
"(?:#{val})(?=(?:-|\\s+)#{key})"
}.join("|") + ")(.*)"
PL_sb_military = %r'major|lieutenant|brigadier|adjutant|quartermaster'
PL_sb_general = %r'((?!#{PL_sb_military.source}).*?)((-|\s+)general)'
PL_prep = matchgroup %w[
about above across after among around at athwart before behind
below beneath beside besides between betwixt beyond but by
during except for from in into near of off on onto out over
since till to under until unto upon with
]
PL_sb_prep_dual_compound = %r'(.*?)((?:-|\s+)(?:#{PL_prep}|d[eu])(?:-|\s+))a(?:-|\s+)(.*)'
PL_sb_prep_compound = %r'(.*?)((-|\s+)(#{PL_prep}|d[eu])((-|\s+)(.*))?)'
PL_pron_nom_h = {
# Nominative Reflexive
"i" => "we", "myself" => "ourselves",
"you" => "you", "yourself" => "yourselves",
"she" => "they", "herself" => "themselves",
"he" => "they", "himself" => "themselves",
"it" => "they", "itself" => "themselves",
"they" => "they", "themself" => "themselves",
# Possessive
"mine" => "ours",
"yours" => "yours",
"hers" => "theirs",
"his" => "theirs",
"its" => "theirs",
"theirs" => "theirs",
}
PL_pron_nom = Regexp.new( PL_pron_nom_h.keys.join('|'), Regexp::IGNORECASE )
PL_pron_acc_h = {
# Accusative Reflexive
"me" => "us", "myself" => "ourselves",
"you" => "you", "yourself" => "yourselves",
"her" => "them", "herself" => "themselves",
"him" => "them", "himself" => "themselves",
"it" => "them", "itself" => "themselves",
"them" => "them", "themself" => "themselves",
}
PL_pron_acc = matchgroup PL_pron_acc_h.keys
PL_v_irregular_pres_h = {
# 1St pers. sing. 2nd pers. sing. 3rd pers. singular
# 3rd pers. (indet.)
"am" => "are", "are" => "are", "is" => "are",
"was" => "were", "were" => "were",
"have" => "have", "has" => "have",
}
PL_v_irregular_pres = matchgroup PL_v_irregular_pres_h.keys
PL_v_ambiguous_pres_h = {
# 1st pers. sing. 2nd pers. sing. 3rd pers. singular
# 3rd pers. (indet.)
"act" => "act", "acts" => "act",
"blame" => "blame", "blames" => "blame",
"can" => "can",
"must" => "must",
"fly" => "fly", "flies" => "fly",
"copy" => "copy", "copies" => "copy",
"drink" => "drink", "drinks" => "drink",
"fight" => "fight", "fights" => "fight",
"fire" => "fire", "fires" => "fire",
"like" => "like", "likes" => "like",
"look" => "look", "looks" => "look",
"make" => "make", "makes" => "make",
"reach" => "reach", "reaches" => "reach",
"run" => "run", "runs" => "run",
"sink" => "sink", "sinks" => "sink",
"sleep" => "sleep", "sleeps" => "sleep",
"view" => "view", "views" => "view",
}
PL_v_ambiguous_pres = matchgroup PL_v_ambiguous_pres_h.keys
PL_v_irregular_non_pres = matchgroup %w[
did had ate made put
spent fought sank gave sought
shall could ought should
]
PL_v_ambiguous_non_pres = matchgroup %w[
thought saw bent will might cut
]
PL_count_zero = matchgroup %w[
0 no zero nil
]
PL_count_one = matchgroup %w[
1 a an one each every this that
]
PL_adj_special_h = {
"a" => "some", "an" => "some",
"this" => "these", "that" => "those",
}
PL_adj_special = matchgroup PL_adj_special_h.keys
PL_adj_poss_h = {
"my" => "our",
"your" => "your",
"its" => "their",
"her" => "their",
"his" => "their",
"their" => "their",
}
PL_adj_poss = matchgroup PL_adj_poss_h.keys
#################################################################
### P U B L I C F U N C T I O N S
#################################################################
### Return the plural of the given +phrase+ if +count+ indicates it should
### be plural.
def plural( count=2 )
phrase = if self.respond_to?( :to_int )
self.numwords
else
self.to_s
end
self.log.debug "Pluralizing %p" % [ phrase ]
pre = text = post = nil
# If the string has whitespace, only pluralize the middle bit, but
# preserve the whitespace to add back to the result.
if md = /\A(\s*)(.+?)(\s*)\Z/.match( phrase.to_s )
pre, text, post = md.captures
else
return phrase
end
plural = postprocess( text,
pluralize_special_adjective(text, count) ||
pluralize_special_verb(text, count) ||
pluralize_noun(text, count) )
return pre + plural + post
end
Linguistics::EN.register_lprintf_formatter :PL, :plural
### Return the plural of the given noun +phrase+ if +count+ indicates it
### should be plural.
def plural_noun( count=2 )
phrase = self.to_s
md = /\A(\s*)(.+?)(\s*)\Z/.match( phrase )
pre, word, post = md.captures
return phrase if word.nil? or word.empty?
plural = postprocess( word, pluralize_noun(word, count) )
return pre + plural + post
end
### Return the plural of the given verb +phrase+ if +count+ indicates it
### should be plural.
def plural_verb( count=2 )
phrase = self.to_s
md = /\A(\s*)(.+?)(\s*)\Z/.match( phrase )
pre, word, post = md.captures
return phrase if word.nil? or word.empty?
plural = postprocess( word,
pluralize_special_verb(word, count) ||
pluralize_general_verb(word, count) )
return pre + plural + post
end
### Return the plural of the given adjectival +phrase+ if +count+ indicates
### it should be plural.
def plural_adjective( count=2 )
phrase = self.to_s
md = /\A(\s*)(.+?)(\s*)\Z/.match( phrase )
pre, word, post = md.captures
return phrase if word.nil? or word.empty?
plural = postprocess( word, pluralize_special_adjective(word, count) || word )
return pre + plural + post
end
alias_method :plural_adj, :plural_adjective
#################################################################
### P R I V A T E F U N C T I O N S
#################################################################
#######
private
#######
### Do normal/classical switching and match capitalization in +inflected+ by
### examining the +original+ input.
def postprocess( original, inflected )
# If there's a classical variant, use it instead of the modern one if
# classical mode is on.
inflected.sub!( /([^|]+)\|(.+)/ ) do
Linguistics::EN.classical? ? $2 : $1
end
# Try to duplicate the case of the original string
case original
when "I"
return inflected
when /^[A-Z]+$/
return inflected.upcase
when /^[A-Z]/
# Can't use #capitalize, as it will downcase the rest of the string,
# too.
inflected[0,1] = inflected[0,1].upcase
return inflected
else
return inflected
end
end
### Normalize a count to either 1 or 2 (singular or plural)
def normalize_count( count, default=2 )
return default if count.nil? # Default to plural
if /^(#{PL_count_one})$/i =~ count.to_s ||
( Linguistics::EN.classical? && /^(#{PL_count_zero})$/ =~ count.to_s )
return 1
else
return default
end
end
### Pluralize nouns
def pluralize_noun( word, count=2 )
self.log.debug "Trying to pluralize %p as a noun" % [ word ]
value = nil
count = normalize_count( count )
return word if count == 1
# Handle user-defined nouns
#if value = ud_match( word, PL_sb_user_defined )
# return value
#end
# Handle empty word, singular count and uninflected plurals
case word
when ''
self.log.debug " empty string"
return word
when /^(#{PL_sb_uninflected})$/i
self.log.debug " uninflected plural"
return word
else
if Linguistics::EN.classical? && /^(#{PL_sb_uninflected_herd})$/i =~ word
self.log.debug " uninflected classical herd word"
return word
end
end
# Handle compounds ("Governor General", "mother-in-law", "aide-de-camp", etc.)
case word
when /^(?:#{PL_sb_postfix_adj})$/i
value = $2
noun = $1
self.log.debug " postfixed adjectival compound noun phrase (#{value} -> #{noun})"
return pluralize_noun( noun, 2 ) + value
when /^(?:#{PL_sb_prep_dual_compound})$/i
noun = $1
value = [ $2, $3 ]
self.log.debug " prepositional dual compound noun phrase (%s -> %s %s)" %
[ noun, *value ]
return pluralize_noun( noun, 2 ) + value[0] + pluralize_noun( value[1] )
when /^(?:#{PL_sb_prep_compound})$/i
noun = $1
value = $2
self.log.debug " prepositional singular compound noun phrase (%s -> %s)" %
[ noun, value ]
return pluralize_noun( noun, 2 ) + value
# Handle pronouns
when /^((?:#{PL_prep})\s+)(#{PL_pron_acc})$/i
prep, pron = $1, $2
self.log.debug " prepositional pronoun phrase (%p + %p)" % [ prep, pron ]
return prep + PL_pron_acc_h[ pron.downcase ]
when /^(#{PL_pron_nom})$/i
pron = $1
self.log.debug " nominative pronoun; using PL_pron_nom table"
return PL_pron_nom_h[ word.downcase ]
when /^(#{PL_pron_acc})$/i
self.log.debug " accusative pronoun; using PL_pron_acc table"
return PL_pron_acc_h[ word.downcase ]
# Handle isolated irregular plurals
when /(.*)\b(#{PL_sb_irregular})$/i
prefix, word = $1, $2
self.log.debug " isolated irregular; using PL_sb_irregular_h table"
return prefix + PL_sb_irregular_h[ word.downcase ]
# Unconditional ...man -> ...mans
when /(#{PL_sb_U_man_mans})$/i
word = $1
self.log.debug " unconditional man -> mans (%p)" % [ word ]
return "#{word}s"
# Handle families of irregular plurals
when /(.*)man$/i then return "#{$1}men"
when /(.*[ml])ouse$/i then return "#{$1}ice"
when /(.*)goose$/i then return "#{$1}geese"
when /(.*)tooth$/i then return "#{$1}teeth"
when /(.*)foot$/i then return "#{$1}feet"
# Handle unassimilated imports
when /(.*)ceps$/i then return word
when /(.*)zoon$/i then return "#{$1}zoa"
when /(.*[csx])is$/i then return "#{$1}es"
when /(#{PL_sb_U_ex_ices})ex$/i then return "#{$1}ices"
when /(#{PL_sb_U_ix_ices})ix$/i then return "#{$1}ices"
when /(#{PL_sb_U_um_a})um$/i then return "#{$1}a"
when /(#{PL_sb_U_us_i})us$/i then return "#{$1}i"
when /(#{PL_sb_U_on_a})on$/i then return "#{$1}a"
when /(#{PL_sb_U_a_ae})$/i then return "#{$1}e"
end
# Handle incompletely assimilated imports in classical mode
if Linguistics::EN.classical?
self.log.debug " checking for classical incompletely assimilated imports"
case word
when /(.*)trix$/i then return "#{$1}trices"
when /(.*)eau$/i then return "#{$1}eaux"
when /(.*)ieu$/i then return "#{$1}ieux"
when /(.{2,}[yia])nx$/i then return "#{$1}nges"
when /(#{PL_sb_C_en_ina})en$/i then return "#{$1}ina"
when /(#{PL_sb_C_ex_ices})ex$/i then return "#{$1}ices"
when /(#{PL_sb_C_ix_ices})ix$/i then return "#{$1}ices"
when /(#{PL_sb_C_um_a})um$/i then return "#{$1}a"
when /(#{PL_sb_C_us_i})us$/i then return "#{$1}i"
when /(#{PL_sb_C_us_us})$/i then return "#{$1}"
when /(#{PL_sb_C_a_ae})$/i then return "#{$1}e"
when /(#{PL_sb_C_a_ata})a$/i then return "#{$1}ata"
when /(#{PL_sb_C_o_i})o$/i then return "#{$1}i"
when /(#{PL_sb_C_on_a})on$/i then return "#{$1}a"
when /#{PL_sb_C_im}$/i then return "#{word}im"
when /#{PL_sb_C_i}$/i then return "#{word}i"
end
end
# Handle singular nouns ending in ...s or other silibants
case word
when /^(#{PL_sb_singular_s})$/i then return "#{$1}es"
when /^([A-Z].*s)$/ then return "#{$1}es"
when /(.*)([cs]h|[zx])$/i then return "#{$1}#{$2}es"
# when /(.*)(us)$/i then return "#{$1}#{$2}es"
# Handle ...f -> ...ves
when /(.*[eao])lf$/i then return "#{$1}lves"
when /(.*[^d])eaf$/i then return "#{$1}eaves"
when /(.*[nlw])ife$/i then return "#{$1}ives"
when /(.*)arf$/i then return "#{$1}arves"
# Handle ...y
when /(.*[aeiou])y$/i then return "#{$1}ys"
when /(.*)Secretary$/ then return "#{$1}Secretaries"
when /([A-Z].*y)$/ then return "#{$1}s"
when /(.*)y$/i then return "#{$1}ies"
# Handle ...o
when /#{PL_sb_U_o_os}$/i then return "#{word}s"
when /[aeiou]o$/i then return "#{word}s"
when /o$/i then return "#{word}es"
# Otherwise just add ...s
else
self.log.debug " appears to be regular; adding +s"
return "#{word}s"
end
end # def pluralize_noun
### Pluralize special verbs
def pluralize_special_verb( word, count )
self.log.debug "Trying to pluralize %p as a special verb..." % [ word ]
count ||= 1
count = normalize_count( count )
if /^(#{PL_count_one})$/i =~ count.to_s
self.log.debug " it's a single-count word, returning it unchanged."
return word # :FIXME: should this return nil instead?
# return nil
end
# Handle user-defined verbs
#if value = ud_match( word, PL_v_user_defined )
# return value
#end
case word
# Handle irregular present tense (simple and compound)
when /^(#{PL_v_irregular_pres})((\s.*)?)$/i
key = $1.downcase
self.log.debug " yep, it's an irregular present tense verb (%p)" % [ key ]
return PL_v_irregular_pres_h[ $1.downcase ] + $2
# Handle irregular future, preterite and perfect tenses
when /^(#{PL_v_irregular_non_pres})((\s.*)?)$/i
self.log.debug " yep, it's an irregular non-present tense verb (%p)" % [ key ]
return word
# Handle special cases
when /^(#{PL_v_special_s})$/
self.log.debug " it's a not special-case verb; aborting."
return nil
# Handle standard 3rd person (chop the ...(e)s off single words)
when /^(.*)([cs]h|[x]|zz|ss)es$/i
base, suffix = $1, $2
self.log.debug " it's a standard third-person verb (%p + %p)" % [ base, suffix ]
return base + suffix
when /^(..+)ies$/i
verb = $1
self.log.debug " it's a standard third-person verb (%p + ies -> +y)" % [ verb ]
return "#{verb}y"
when /^(.+)oes$/i
verb = $1
self.log.debug " it's a standard third-person verb (%p + oes -> +o)" % [ verb ]
return "#{verb}o"
when /^(.*[^s])s$/i
verb = $1
self.log.debug " it's a standard third-person verb (%p + (^s)s -> -s)" % [ verb ]
return verb
# Otherwise, a regular verb (handle elsewhere)
else
self.log.debug " nope. Either a regular verb or not a verb."
return nil
end
end
### Pluralize regular verbs
def pluralize_general_verb( word, count )
count = normalize_count( count )
return word if /^(#{PL_count_one})$/i =~ count.to_s
case word
# Handle ambiguous present tenses (simple and compound)
when /^(#{PL_v_ambiguous_pres})((\s.*)?)$/i
return PL_v_ambiguous_pres_h[ $1.downcase ] + $2
# Handle ambiguous preterite and perfect tenses
when /^(#{PL_v_ambiguous_non_pres})((\s.*)?)$/i
return word
# Otherwise, 1st or 2nd person is uninflected
else
return word
end
end
### Handle special adjectives
def pluralize_special_adjective( word, count )
self.log.debug "Trying to pluralize %p as a special adjective..." % [ word ]
count ||= 1
count = normalize_count( count )
if /^(#{PL_count_one})$/i =~ count.to_s
self.log.debug " it's a single-count word; aborting"
return nil
end
# Handle user-defined verbs
#if value = ud_match( word, PL_adj_user_defined )
# return value
#end
case word
# Handle known cases
when /^(#{PL_adj_special})$/i
key = $1.downcase
self.log.debug " yep, it's a special plural adjective (%p)" % [ key ]
return PL_adj_special_h[ key ]
# Handle possessives
when /^(#{PL_adj_poss})$/i
key = $1.downcase
self.log.debug " it's a special possessive adjective (%p)" % [ key ]
return PL_adj_poss_h[ $1.downcase ]
when /^(.*)'s?$/
pl = $1.en.plural_noun( count )
self.log.debug " it has an apostrophe (%p); using generic possessive rules" % [ pl ]
if /s$/ =~ pl
return "#{pl}'"
else
return "#{pl}'s"
end
# Otherwise, no idea
else
self.log.debug " nope."
return nil
end
end
end # module Linguistics::EN::Pluralization
| {
"pile_set_name": "Github"
} |
REM Excerpted from "Programming Clojure",
REM published by The Pragmatic Bookshelf.
REM Copyrights apply to this code. It may not be used to create training material,
REM courses, books, articles, and the like. Contact us if you are in doubt.
REM We make no guarantees that this code is fit for any purpose.
REM Visit http://www.pragmaticprogrammer.com/titles/shcloj for more book information.
java -cp .;lib/commons-io-1.4.jar;lib/commons-fileupload-1.2.1.jar;lib/commons-codec-1.3.jar;lib/jline-0.9.94.jar;lib/clojure.jar;lib/clojure-contrib.jar;lib/compojure.jar;lib/hsqldb.jar;lib/jetty-6.1.14.jar;lib/jetty-util-6.1.14.jar;lib/servlet-api-2.5-6.1.14.jar jline.ConsoleRunner clojure.lang.Repl examples/server/complete.clj | {
"pile_set_name": "Github"
} |
<?php
namespace DeepCopy\Matcher;
/**
* Match a property by its name
*/
class PropertyNameMatcher implements Matcher
{
/**
* @var string
*/
private $property;
/**
* @param string $property Property name
*/
public function __construct($property)
{
$this->property = $property;
}
/**
* {@inheritdoc}
*/
public function matches($object, $property)
{
return $property == $this->property;
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
<oracle.dataaccess.client>
<settings>
<add name="bool" value="edmmapping number(1,0)" />
</settings>
</oracle.dataaccess.client>
</configuration> | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true">
<testsuites>
<testsuite>
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<directory suffix=".php">src/V[!a-zA-Z]*</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
| {
"pile_set_name": "Github"
} |
define([
'jquery',
'./options',
'./utils',
'./keys'
], function ($, Options, Utils, KEYS) {
var Select2 = function ($element, options) {
if ($element.data('select2') != null) {
$element.data('select2').destroy();
}
this.$element = $element;
this.id = this._generateId($element);
options = options || {};
this.options = new Options(options, $element);
Select2.__super__.constructor.call(this);
// Set up the tabindex
var tabindex = $element.attr('tabindex') || 0;
$element.data('old-tabindex', tabindex);
$element.attr('tabindex', '-1');
// Set up containers and adapters
var DataAdapter = this.options.get('dataAdapter');
this.dataAdapter = new DataAdapter($element, this.options);
var $container = this.render();
this._placeContainer($container);
var SelectionAdapter = this.options.get('selectionAdapter');
this.selection = new SelectionAdapter($element, this.options);
this.$selection = this.selection.render();
this.selection.position(this.$selection, $container);
var DropdownAdapter = this.options.get('dropdownAdapter');
this.dropdown = new DropdownAdapter($element, this.options);
this.$dropdown = this.dropdown.render();
this.dropdown.position(this.$dropdown, $container);
var ResultsAdapter = this.options.get('resultsAdapter');
this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
this.$results = this.results.render();
this.results.position(this.$results, this.$dropdown);
// Bind events
var self = this;
// Bind the container to all of the adapters
this._bindAdapters();
// Register any DOM event handlers
this._registerDomEvents();
// Register any internal event handlers
this._registerDataEvents();
this._registerSelectionEvents();
this._registerDropdownEvents();
this._registerResultsEvents();
this._registerEvents();
// Set the initial state
this.dataAdapter.current(function (initialData) {
self.trigger('selection:update', {
data: initialData
});
});
// Hide the original select
$element.addClass('select2-hidden-accessible');
$element.attr('aria-hidden', 'true');
// Synchronize any monitored attributes
this._syncAttributes();
$element.data('select2', this);
};
Utils.Extend(Select2, Utils.Observable);
Select2.prototype._generateId = function ($element) {
var id = '';
if ($element.attr('id') != null) {
id = $element.attr('id');
} else if ($element.attr('name') != null) {
id = $element.attr('name') + '-' + Utils.generateChars(2);
} else {
id = Utils.generateChars(4);
}
id = id.replace(/(:|\.|\[|\]|,)/g, '');
id = 'select2-' + id;
return id;
};
Select2.prototype._placeContainer = function ($container) {
$container.insertAfter(this.$element);
var width = this._resolveWidth(this.$element, this.options.get('width'));
if (width != null) {
$container.css('width', width);
}
};
Select2.prototype._resolveWidth = function ($element, method) {
var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
if (method == 'resolve') {
var styleWidth = this._resolveWidth($element, 'style');
if (styleWidth != null) {
return styleWidth;
}
return this._resolveWidth($element, 'element');
}
if (method == 'element') {
var elementWidth = $element.outerWidth(false);
if (elementWidth <= 0) {
return 'auto';
}
return elementWidth + 'px';
}
if (method == 'style') {
var style = $element.attr('style');
if (typeof(style) !== 'string') {
return null;
}
var attrs = style.split(';');
for (var i = 0, l = attrs.length; i < l; i = i + 1) {
var attr = attrs[i].replace(/\s/g, '');
var matches = attr.match(WIDTH);
if (matches !== null && matches.length >= 1) {
return matches[1];
}
}
return null;
}
return method;
};
Select2.prototype._bindAdapters = function () {
this.dataAdapter.bind(this, this.$container);
this.selection.bind(this, this.$container);
this.dropdown.bind(this, this.$container);
this.results.bind(this, this.$container);
};
Select2.prototype._registerDomEvents = function () {
var self = this;
this.$element.on('change.select2', function () {
self.dataAdapter.current(function (data) {
self.trigger('selection:update', {
data: data
});
});
});
this._sync = Utils.bind(this._syncAttributes, this);
if (this.$element[0].attachEvent) {
this.$element[0].attachEvent('onpropertychange', this._sync);
}
var observer = window.MutationObserver ||
window.WebKitMutationObserver ||
window.MozMutationObserver
;
if (observer != null) {
this._observer = new observer(function (mutations) {
$.each(mutations, self._sync);
});
this._observer.observe(this.$element[0], {
attributes: true,
subtree: false
});
} else if (this.$element[0].addEventListener) {
this.$element[0].addEventListener('DOMAttrModified', self._sync, false);
}
};
Select2.prototype._registerDataEvents = function () {
var self = this;
this.dataAdapter.on('*', function (name, params) {
self.trigger(name, params);
});
};
Select2.prototype._registerSelectionEvents = function () {
var self = this;
var nonRelayEvents = ['toggle', 'focus'];
this.selection.on('toggle', function () {
self.toggleDropdown();
});
this.selection.on('focus', function (params) {
self.focus(params);
});
this.selection.on('*', function (name, params) {
if ($.inArray(name, nonRelayEvents) !== -1) {
return;
}
self.trigger(name, params);
});
};
Select2.prototype._registerDropdownEvents = function () {
var self = this;
this.dropdown.on('*', function (name, params) {
self.trigger(name, params);
});
};
Select2.prototype._registerResultsEvents = function () {
var self = this;
this.results.on('*', function (name, params) {
self.trigger(name, params);
});
};
Select2.prototype._registerEvents = function () {
var self = this;
this.on('open', function () {
self.$container.addClass('select2-container--open');
});
this.on('close', function () {
self.$container.removeClass('select2-container--open');
});
this.on('enable', function () {
self.$container.removeClass('select2-container--disabled');
});
this.on('disable', function () {
self.$container.addClass('select2-container--disabled');
});
this.on('blur', function () {
self.$container.removeClass('select2-container--focus');
});
this.on('query', function (params) {
if (!self.isOpen()) {
self.trigger('open', {});
}
this.dataAdapter.query(params, function (data) {
self.trigger('results:all', {
data: data,
query: params
});
});
});
this.on('query:append', function (params) {
this.dataAdapter.query(params, function (data) {
self.trigger('results:append', {
data: data,
query: params
});
});
});
this.on('keypress', function (evt) {
var key = evt.which;
if (self.isOpen()) {
if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) {
self.close();
evt.preventDefault();
} else if (key === KEYS.ENTER) {
self.trigger('results:select', {});
evt.preventDefault();
} else if ((key === KEYS.SPACE && evt.ctrlKey)) {
self.trigger('results:toggle', {});
evt.preventDefault();
} else if (key === KEYS.UP) {
self.trigger('results:previous', {});
evt.preventDefault();
} else if (key === KEYS.DOWN) {
self.trigger('results:next', {});
evt.preventDefault();
}
} else {
if (key === KEYS.ENTER || key === KEYS.SPACE ||
(key === KEYS.DOWN && evt.altKey)) {
self.open();
evt.preventDefault();
}
}
});
};
Select2.prototype._syncAttributes = function () {
this.options.set('disabled', this.$element.prop('disabled'));
if (this.options.get('disabled')) {
if (this.isOpen()) {
this.close();
}
this.trigger('disable', {});
} else {
this.trigger('enable', {});
}
};
/**
* Override the trigger method to automatically trigger pre-events when
* there are events that can be prevented.
*/
Select2.prototype.trigger = function (name, args) {
var actualTrigger = Select2.__super__.trigger;
var preTriggerMap = {
'open': 'opening',
'close': 'closing',
'select': 'selecting',
'unselect': 'unselecting'
};
if (args === undefined) {
args = {};
}
if (name in preTriggerMap) {
var preTriggerName = preTriggerMap[name];
var preTriggerArgs = {
prevented: false,
name: name,
args: args
};
actualTrigger.call(this, preTriggerName, preTriggerArgs);
if (preTriggerArgs.prevented) {
args.prevented = true;
return;
}
}
actualTrigger.call(this, name, args);
};
Select2.prototype.toggleDropdown = function () {
if (this.options.get('disabled')) {
return;
}
if (this.isOpen()) {
this.close();
} else {
this.open();
}
};
Select2.prototype.open = function () {
if (this.isOpen()) {
return;
}
this.trigger('query', {});
};
Select2.prototype.close = function () {
if (!this.isOpen()) {
return;
}
this.trigger('close', {});
};
Select2.prototype.isOpen = function () {
return this.$container.hasClass('select2-container--open');
};
Select2.prototype.hasFocus = function () {
return this.$container.hasClass('select2-container--focus');
};
Select2.prototype.focus = function (data) {
// No need to re-trigger focus events if we are already focused
if (this.hasFocus()) {
return;
}
this.$container.addClass('select2-container--focus');
this.trigger('focus', {});
};
Select2.prototype.enable = function (args) {
if (this.options.get('debug') && window.console && console.warn) {
console.warn(
'Select2: The `select2("enable")` method has been deprecated and will' +
' be removed in later Select2 versions. Use $element.prop("disabled")' +
' instead.'
);
}
if (args == null || args.length === 0) {
args = [true];
}
var disabled = !args[0];
this.$element.prop('disabled', disabled);
};
Select2.prototype.data = function () {
if (this.options.get('debug') &&
arguments.length > 0 && window.console && console.warn) {
console.warn(
'Select2: Data can no longer be set using `select2("data")`. You ' +
'should consider setting the value instead using `$element.val()`.'
);
}
var data = [];
this.dataAdapter.current(function (currentData) {
data = currentData;
});
return data;
};
Select2.prototype.val = function (args) {
if (this.options.get('debug') && window.console && console.warn) {
console.warn(
'Select2: The `select2("val")` method has been deprecated and will be' +
' removed in later Select2 versions. Use $element.val() instead.'
);
}
if (args == null || args.length === 0) {
return this.$element.val();
}
var newVal = args[0];
if ($.isArray(newVal)) {
newVal = $.map(newVal, function (obj) {
return obj.toString();
});
}
this.$element.val(newVal).trigger('change');
};
Select2.prototype.destroy = function () {
this.$container.remove();
if (this.$element[0].detachEvent) {
this.$element[0].detachEvent('onpropertychange', this._sync);
}
if (this._observer != null) {
this._observer.disconnect();
this._observer = null;
} else if (this.$element[0].removeEventListener) {
this.$element[0]
.removeEventListener('DOMAttrModified', this._sync, false);
}
this._sync = null;
this.$element.off('.select2');
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
this.$element.removeClass('select2-hidden-accessible');
this.$element.attr('aria-hidden', 'false');
this.$element.removeData('select2');
this.dataAdapter.destroy();
this.selection.destroy();
this.dropdown.destroy();
this.results.destroy();
this.dataAdapter = null;
this.selection = null;
this.dropdown = null;
this.results = null;
};
Select2.prototype.render = function () {
var $container = $(
'<span class="select2 select2-container">' +
'<span class="selection"></span>' +
'<span class="dropdown-wrapper" aria-hidden="true"></span>' +
'</span>'
);
$container.attr('dir', this.options.get('dir'));
this.$container = $container;
this.$container.addClass('select2-container--' + this.options.get('theme'));
$container.data('element', this.$element);
return $container;
};
return Select2;
});
| {
"pile_set_name": "Github"
} |
hashing. O(n).
| {
"pile_set_name": "Github"
} |
hlsl.memberFunCall.frag
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
0:1 Function Definition: method3(f1; ( temp float)
0:1 Function Parameters:
0:1 'a' ( in float)
0:? Sequence
0:1 Branch: Return with expression
0:1 Constant:
0:1 1.000000
0:4 Function Definition: myContext::method1( ( temp float)
0:4 Function Parameters:
0:4 '@this' ( temp structure{ temp float f})
0:? Sequence
0:4 Branch: Return with expression
0:4 Function Call: myContext::method2( ( temp float)
0:? '@this' ( temp structure{ temp float f})
0:5 Function Definition: myContext::method2( ( temp float)
0:5 Function Parameters:
0:5 '@this' ( temp structure{ temp float f})
0:? Sequence
0:5 Branch: Return with expression
0:5 Function Call: myContext::method3(f1; ( temp float)
0:? '@this' ( temp structure{ temp float f})
0:5 Constant:
0:5 1.000000
0:6 Function Definition: myContext::method3(f1; ( temp float)
0:6 Function Parameters:
0:6 '@this' ( temp structure{ temp float f})
0:6 'a' ( in float)
0:? Sequence
0:6 Branch: Return with expression
0:6 Function Call: myContext::method4(f1;f1; ( temp float)
0:? '@this' ( temp structure{ temp float f})
0:6 'a' ( in float)
0:6 'a' ( in float)
0:7 Function Definition: myContext::method4(f1;f1; ( temp float)
0:7 Function Parameters:
0:7 '@this' ( temp structure{ temp float f})
0:7 'a' ( in float)
0:7 'b' ( in float)
0:? Sequence
0:7 Branch: Return with expression
0:7 add ( temp float)
0:7 add ( temp float)
0:7 'a' ( in float)
0:7 'b' ( in float)
0:7 f: direct index for structure ( temp float)
0:7 '@this' ( temp structure{ temp float f})
0:7 Constant:
0:7 0 (const uint)
0:12 Function Definition: @main( ( temp 4-component vector of float)
0:12 Function Parameters:
0:? Sequence
0:14 move second child to first child ( temp float)
0:14 f: direct index for structure ( temp float)
0:14 'context' ( temp structure{ temp float f})
0:14 Constant:
0:14 0 (const int)
0:14 Constant:
0:14 3.000000
0:15 Branch: Return with expression
0:15 Construct vec4 ( temp 4-component vector of float)
0:15 Function Call: myContext::method1( ( temp float)
0:15 'context' ( temp structure{ temp float f})
0:12 Function Definition: main( ( temp void)
0:12 Function Parameters:
0:? Sequence
0:12 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:12 Function Call: @main( ( temp 4-component vector of float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
0:1 Function Definition: method3(f1; ( temp float)
0:1 Function Parameters:
0:1 'a' ( in float)
0:? Sequence
0:1 Branch: Return with expression
0:1 Constant:
0:1 1.000000
0:4 Function Definition: myContext::method1( ( temp float)
0:4 Function Parameters:
0:4 '@this' ( temp structure{ temp float f})
0:? Sequence
0:4 Branch: Return with expression
0:4 Function Call: myContext::method2( ( temp float)
0:? '@this' ( temp structure{ temp float f})
0:5 Function Definition: myContext::method2( ( temp float)
0:5 Function Parameters:
0:5 '@this' ( temp structure{ temp float f})
0:? Sequence
0:5 Branch: Return with expression
0:5 Function Call: myContext::method3(f1; ( temp float)
0:? '@this' ( temp structure{ temp float f})
0:5 Constant:
0:5 1.000000
0:6 Function Definition: myContext::method3(f1; ( temp float)
0:6 Function Parameters:
0:6 '@this' ( temp structure{ temp float f})
0:6 'a' ( in float)
0:? Sequence
0:6 Branch: Return with expression
0:6 Function Call: myContext::method4(f1;f1; ( temp float)
0:? '@this' ( temp structure{ temp float f})
0:6 'a' ( in float)
0:6 'a' ( in float)
0:7 Function Definition: myContext::method4(f1;f1; ( temp float)
0:7 Function Parameters:
0:7 '@this' ( temp structure{ temp float f})
0:7 'a' ( in float)
0:7 'b' ( in float)
0:? Sequence
0:7 Branch: Return with expression
0:7 add ( temp float)
0:7 add ( temp float)
0:7 'a' ( in float)
0:7 'b' ( in float)
0:7 f: direct index for structure ( temp float)
0:7 '@this' ( temp structure{ temp float f})
0:7 Constant:
0:7 0 (const uint)
0:12 Function Definition: @main( ( temp 4-component vector of float)
0:12 Function Parameters:
0:? Sequence
0:14 move second child to first child ( temp float)
0:14 f: direct index for structure ( temp float)
0:14 'context' ( temp structure{ temp float f})
0:14 Constant:
0:14 0 (const int)
0:14 Constant:
0:14 3.000000
0:15 Branch: Return with expression
0:15 Construct vec4 ( temp 4-component vector of float)
0:15 Function Call: myContext::method1( ( temp float)
0:15 'context' ( temp structure{ temp float f})
0:12 Function Definition: main( ( temp void)
0:12 Function Parameters:
0:? Sequence
0:12 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:12 Function Call: @main( ( temp 4-component vector of float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 73
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 71
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 10 "method3(f1;"
Name 9 "a"
Name 12 "myContext"
MemberName 12(myContext) 0 "f"
Name 16 "myContext::method1("
Name 15 "@this"
Name 19 "myContext::method2("
Name 18 "@this"
Name 24 "myContext::method3(f1;"
Name 22 "@this"
Name 23 "a"
Name 30 "myContext::method4(f1;f1;"
Name 27 "@this"
Name 28 "a"
Name 29 "b"
Name 34 "@main("
Name 42 "param"
Name 46 "param"
Name 48 "param"
Name 63 "context"
Name 71 "@entryPointOutput"
Decorate 71(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Function 6(float)
8: TypeFunction 6(float) 7(ptr)
12(myContext): TypeStruct 6(float)
13: TypePointer Function 12(myContext)
14: TypeFunction 6(float) 13(ptr)
21: TypeFunction 6(float) 13(ptr) 7(ptr)
26: TypeFunction 6(float) 13(ptr) 7(ptr) 7(ptr)
32: TypeVector 6(float) 4
33: TypeFunction 32(fvec4)
36: 6(float) Constant 1065353216
56: TypeInt 32 1
57: 56(int) Constant 0
64: 6(float) Constant 1077936128
70: TypePointer Output 32(fvec4)
71(@entryPointOutput): 70(ptr) Variable Output
4(main): 2 Function None 3
5: Label
72: 32(fvec4) FunctionCall 34(@main()
Store 71(@entryPointOutput) 72
Return
FunctionEnd
10(method3(f1;): 6(float) Function None 8
9(a): 7(ptr) FunctionParameter
11: Label
ReturnValue 36
FunctionEnd
16(myContext::method1(): 6(float) Function None 14
15(@this): 13(ptr) FunctionParameter
17: Label
39: 6(float) FunctionCall 19(myContext::method2() 15(@this)
ReturnValue 39
FunctionEnd
19(myContext::method2(): 6(float) Function None 14
18(@this): 13(ptr) FunctionParameter
20: Label
42(param): 7(ptr) Variable Function
Store 42(param) 36
43: 6(float) FunctionCall 24(myContext::method3(f1;) 18(@this) 42(param)
ReturnValue 43
FunctionEnd
24(myContext::method3(f1;): 6(float) Function None 21
22(@this): 13(ptr) FunctionParameter
23(a): 7(ptr) FunctionParameter
25: Label
46(param): 7(ptr) Variable Function
48(param): 7(ptr) Variable Function
47: 6(float) Load 23(a)
Store 46(param) 47
49: 6(float) Load 23(a)
Store 48(param) 49
50: 6(float) FunctionCall 30(myContext::method4(f1;f1;) 22(@this) 46(param) 48(param)
ReturnValue 50
FunctionEnd
30(myContext::method4(f1;f1;): 6(float) Function None 26
27(@this): 13(ptr) FunctionParameter
28(a): 7(ptr) FunctionParameter
29(b): 7(ptr) FunctionParameter
31: Label
53: 6(float) Load 28(a)
54: 6(float) Load 29(b)
55: 6(float) FAdd 53 54
58: 7(ptr) AccessChain 27(@this) 57
59: 6(float) Load 58
60: 6(float) FAdd 55 59
ReturnValue 60
FunctionEnd
34(@main(): 32(fvec4) Function None 33
35: Label
63(context): 13(ptr) Variable Function
65: 7(ptr) AccessChain 63(context) 57
Store 65 64
66: 6(float) FunctionCall 16(myContext::method1() 63(context)
67: 32(fvec4) CompositeConstruct 66 66 66 66
ReturnValue 67
FunctionEnd
| {
"pile_set_name": "Github"
} |
---
title: 'Managing the security policy of an Exchange service'
slug: manage-security-policy-password
excerpt: 'Find out how to manage the security policy of your Exchange service'
section: 'Getting started with Exchange'
order: 6
---
**Last updated 25th January 2019**
## Objective
With the Exchange service, you can set up professional email addresses, and use them with a range of features for collaborative work. In order to maintain this environment, you can manage the global security settings of your Exchange accounts.
**Find out how to manage the security policy of your Exchange service.**
## Requirements
- an [Exchange](https://www.ovh.co.uk/emails/){.external} service
- access to the [OVH Control Panel](https://ca.ovh.com/auth/?action=gotomanager)
## Instructions
The security policy management of your Exchange service has four aspects:
- enhancing Exchange account security when users try to log in
- adding complexity to the security of your Exchange service account passwords
- strengthening the verification of incoming messages on our servers and to your Exchange addresses
- defining how the so-called "unwanted" messages will be displayed in your Exchange addresses
To access the security policy of your Exchange service, log in to the [OVH Control Panel](https://ca.ovh.com/auth/?action=gotomanager) and make sure you are in the "Web" section. Click `Microsoft`{.action} in the services bar on the left-hand side, then `Exchange`{.action}, and finally, select the Exchange service concerned.
On the page that appears, click on the `More +`{.action} tab, and then on `Manage Security Policy`{.action}.
{.external}
Continue to the aspect(s) you want to modify.
|Aspect|Description|
|---|---|
|[Enhance connection security](./#enhance-connection-security){.external}|Define whether accounts should lock after a number of unsuccessful log-in attempts.|
|[Add complexity to the security of passwords](./#add-complexity-to-the-security-of-passwords){.external}|Define a complexity requirement, as well as rules for changing passwords.|
|[Strengthen the verification of incoming messages](./#strengthen-the-verification-of-incoming-messages){.external}|Specify whether our servers should check if the messages received come from a legitimate source (i.e. DKIM and/or SPF checks).|
|[Define the display of unwanted messages](./#define-the-display-of-unwanted-messages){.external}|Specify whether unwanted messages should have a tag to identify them, or be automatically moved to the trash.|
### Enhance connection security
This allows you to define whether Exchange accounts should lock after a number of unsuccessful log-in attempts.
To make this change, on the page that appears, enter the information set out in the table below:
|Information|Description|
|---|---|
|Lockout threshold|Set the number of unsuccessful log-in attempts before the account locks. Enter "0" to not apply a lockout threshold.|
|Lockout counter reset time|This field will only appear if a lockout threshold has been set. Specify the time it takes for the failed connection attempt counter to reset.|
|Account lockout duration|This field will only appear if a lockout threshold has been set. Specify the time period during which the Exchange account will remain locked if the lockout threshold has been reached.|
Once this information has been entered, you can immediately validate these changes by clicking on `Next`{.action}, then `Confirm`{.action}. You can then continue to the next part.
### Add complexity to the security of passwords
This allows you to define a complexity requirement, as well as rules for changing passwords.
To make this change, on the page that appears, enter the information set out in the table below:
|Information|Description|
|---|---|
|Complexity requirements|Allows user to set rules regarding the complexity of passwords:<br> \- not contain all or part of the user’s account name<br> \- be at least 6 characters long<br> \- contain uppercase and lowercase letters, non-alphabetic characters (! or $ for example), and numbers|
|Prevent password change|Allows to enforce a minimum lifetime for your Exchange accounts’ passwords. This means that users will have to wait a certain number of days before they can change their passwords.|
|Maximum password duration|Allows to enforce a maximum lifetime for your Exchange accounts’ passwords. This means that users will be forced to change their passwords once this time limit is reached.|
|Keep password history|This field will only appear if a maximum lifetime has been set. Specify whether previous passwords can be reused again, and if so, for how long.|
|Minimum password length|Allows to set a minimum size for password length when a user wants to change it.|
Once this information has been entered, you can immediately validate these changes by clicking on `Next`{.action}, then `Confirm`{.action}. You can then continue to the next part.
### Strengthen the verification of incoming messages
This allows you to specify whether our servers should check if the messages received in your Exchange accounts come from a legitimate source (DKIM and/or SPF checks).
To make this change, on the page that appears, enter the information set out in the table below:
|Information|Description|
|---|---|
|Activate DKIM signature verification|Define whether our servers should check the DKIM signature of the messages you receive on your Exchange accounts. This action guarantees the authenticity of the sending domain and the integrity of the message, making it possible to identify non-legitimate mailings, which will then be marked as spam.|
|Activate SPF protection verification|Define whether our servers must verify that the source of the messages you receive is present in the SPF record of the sender domain. This verification can identify illegitimate mailings, which will then be marked as spam.|
Once this information has been entered, you can immediately validate these changes by clicking on `Next`{.action}, then `Confirm`{.action}. You can then continue to the next part.
### Define the display of unwanted messages
This allows you to define whether unwanted messages you receive on your Exchange accounts should be tagged to identify them, or automatically moved to the trash.
To make this change, on the page that appears, enter the information set out in the table below:
|Information|Description|
|---|---|
|Identify SPAM email|Specify whether our servers should add a tag to identify received messages that are considered "unwanted" as spam.|
|Move SPAM to junk|Specify whether our servers should automatically move any "unwanted" messages to the trash.|
Once this information has been entered, you can immediately validate these changes by clicking on `Next`{.action}, then `Confirm`{.action}.
## Go further
Join our community of users on <https://community.ovh.com/en/>. | {
"pile_set_name": "Github"
} |
<html>
<body bgcolor="#ffffff">
A lightweight TLS API.
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* 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/>
*/
package com.watabou.pixeldungeon.effects;
import com.watabou.noosa.Game;
import com.watabou.noosa.Visual;
import com.watabou.pixeldungeon.actors.Actor;
import com.watabou.pixeldungeon.actors.Char;
import com.watabou.pixeldungeon.sprites.CharSprite;
import com.watabou.utils.PointF;
public class Pushing extends Actor {
private CharSprite sprite;
private int from;
private int to;
private Effect effect;
public Pushing( Char ch, int from, int to ) {
sprite = ch.sprite;
this.from = from;
this.to = to;
}
@Override
protected boolean act() {
if (sprite != null) {
if (effect == null) {
new Effect();
}
return false;
} else {
Actor.remove( Pushing.this );
return true;
}
}
public class Effect extends Visual {
private static final float DELAY = 0.15f;
private PointF end;
private float delay;
public Effect() {
super( 0, 0, 0, 0 );
point( sprite.worldToCamera( from ) );
end = sprite.worldToCamera( to );
speed.set( 2 * (end.x - x) / DELAY, 2 * (end.y - y) / DELAY );
acc.set( -speed.x / DELAY, -speed.y / DELAY );
delay = 0;
sprite.parent.add( this );
}
@Override
public void update() {
super.update();
if ((delay += Game.elapsed) < DELAY) {
sprite.x = x;
sprite.y = y;
} else {
sprite.point( end );
killAndErase();
Actor.remove( Pushing.this );
next();
}
}
}
}
| {
"pile_set_name": "Github"
} |
I have read and understand GitHub's Guide to Filing a DMCA Notice.
**Are you the copyright owner or authorized to act on the copyright owner's behalf?**
Yes.
**Please provide a detailed description of the original copyrighted work that has allegedly been infringed. If possible, include a URL to where it is posted online.**
https://github.com/RestingCoder/discord-widget
**What files should be taken down? Please provide URLs for each file, or if the entire repository, the repository's URL:**
https://github.com/CikerDeveloper/Discord-Widget
**Have you searched for any forks of the allegedly infringing files or repositories? Each fork is a distinct repository and must be identified separately if you believe it is infringing and wish to have it taken down.**
They did not fork my repo.
**Is the work licensed under an open source license? If so, which open source license? Are the allegedly infringing files being used under the open source license, or are they in violation of the license?**
There is currently no license associated with my code.
**What would be the best solution for the alleged infringement? Are there specific changes the other person can make other than removal?**
Removal is the only option.
**Do you have the alleged infringer's contact information? If so, please provide it:**
CikerDeveloper on Github.
**Type (or copy and paste) the following statement: "I have a good faith belief that use of the copyrighted materials described above on the infringing web pages is not authorized by the copyright owner, or its agent, or the law. I have taken fair use into consideration."**
I have a good faith belief that use of the copyrighted materials described above on the infringing web pages is not authorized by the copyright owner, or its agent, or the law. I have taken fair use into consideration.
**Type (or copy and paste) the following statement: "I swear, under penalty of perjury, that the information in this notification is accurate and that I am the copyright owner, or am authorized to act on behalf of the owner, of an exclusive right that is allegedly infringed."**
I swear, under penalty of perjury, that the information in this notification is accurate and that I am the copyright owner, or am authorized to act on behalf of the owner, of an exclusive right that is allegedly infringed.
**Please confirm that you have you have read our Guide to Submitting a DMCA Takedown Notice: https://help.github.com/articles/guide-to-submitting-a-dmca-takedown-notice/**
As stated at the beginning of this notice, I have.
**So that we can get back to you, please provide either your telephone number or physical address:**
[Private]
**Please type your full legal name below to sign this request:**
[Private]
| {
"pile_set_name": "Github"
} |
<?php
namespace app\components;
/*
* @link http://www.diemeisterei.de/
*
* @copyright Copyright (c) 2015 diemeisterei GmbH, Stuttgart
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use dektrium\user\models\User as UserModel;
use yii\base\Component;
use yii\helpers\Html;
class Helper extends Component
{
public static function checkApplication()
{
if (\Yii::$app->user->can('Admin')) {
self::checkPassword(getenv('APP_ADMIN_PASSWORD'));
self::checkUserSetup();
self::checkPagesSetup();
}
}
private static function checkUserSetup()
{
if (UserModel::find()->where('id != 1')->count() == 0) {
$link = Html::a('user module', ['/user/admin/create']);
\Yii::$app->session->addFlash(
'warning',
"There is no additional user registered, visit {$link} to create an editor."
);
}
}
private static function checkPagesSetup()
{
if (!\Yii::$app->getModule('pages')->getLocalizedRootNode()) {
$link = Html::a('pages module', ['/pages']);
\Yii::$app->session->addFlash(
'warning',
"There is no navigation root node, visit {$link} to create a root node."
);
}
}
/**
* Password check
* Based upon http://stackoverflow.com/a/10753064.
*
* @param $pwd
*/
private static function checkPassword($pwd)
{
$errors = [];
if (strlen($pwd) < 8) {
$errors[] = 'Password too short!';
}
if (!preg_match('#[0-9]+#', $pwd)) {
$errors[] = 'Password must include at least one number!';
}
if (!preg_match('#[a-zA-Z]+#', $pwd)) {
$errors[] = 'Password must include at least one letter!';
}
if (count($errors) > 0) {
$msg = implode('<br/>', $errors);
\Yii::$app->session->addFlash(
'danger',
"Application admin password from environment setting is not strong enough.<br/><i>{$msg}</i>"
);
}
}
}
| {
"pile_set_name": "Github"
} |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cxf.systest.jaxrs.reactive;
import java.util.Collections;
import java.util.List;
import javax.ws.rs.core.GenericType;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class JAXRSRxJavaObservableTest extends AbstractBusClientServerTestBase {
public static final String PORT = RxJavaObservableServer.PORT;
@BeforeClass
public static void startServers() throws Exception {
AbstractResourceInfo.clearAllMaps();
assertTrue("server did not launch correctly",
launchServer(RxJavaObservableServer.class, true));
createStaticBus();
}
@Test
public void testGetHelloWorldText() throws Exception {
String address = "http://localhost:" + PORT + "/rx/text";
WebClient wc = WebClient.create(address);
String text = wc.accept("text/plain").get(String.class);
assertEquals("Hello, world!", text);
}
@Test
public void testGetHelloWorldJson() throws Exception {
String address = "http://localhost:" + PORT + "/rx/textJson";
WebClient wc = WebClient.create(address,
Collections.singletonList(new JacksonJsonProvider()));
HelloWorldBean bean = wc.accept("application/json").get(HelloWorldBean.class);
assertEquals("Hello", bean.getGreeting());
assertEquals("World", bean.getAudience());
}
@Test
public void testGetHelloWorldJsonList() throws Exception {
String address = "http://localhost:" + PORT + "/rx/textJsonList";
doTestGetHelloWorldJsonList(address);
}
private void doTestGetHelloWorldJsonList(String address) throws Exception {
WebClient wc = WebClient.create(address,
Collections.singletonList(new JacksonJsonProvider()));
WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
GenericType<List<HelloWorldBean>> genericResponseType = new GenericType<List<HelloWorldBean>>() {
};
List<HelloWorldBean> beans = wc.accept("application/json").get(genericResponseType);
assertEquals(2, beans.size());
assertEquals("Hello", beans.get(0).getGreeting());
assertEquals("World", beans.get(0).getAudience());
assertEquals("Ciao", beans.get(1).getGreeting());
assertEquals("World", beans.get(1).getAudience());
}
}
| {
"pile_set_name": "Github"
} |
<?php
use Microweber\View;
only_admin_access();
$shipping_to_country = mw('shop\shipping\gateways\country\shipping_to_country');
$data = $data_orig = $shipping_to_country->get();
if ($data == false) {
$data = array();
}
$countries_used = array();
//$data[] = array();
$countries = mw()->forms_manager->countries_list();
if (is_array($countries)) {
asort($countries);
}
if (!is_array($countries)) {
$countries = mw()->forms_manager->countries_list(1);
} else {
array_unshift($countries, "Worldwide");
}
$data_active = array();
$data_disabled = array();
foreach ($data as $item) {
if (!$item['is_active']) {
$data_disabled[] = $item;
} else {
$data_active[] = $item;
}
if (isset($item['shipping_country'])) {
$countries_used[] = ($item['shipping_country']);
}
}
$has_data = false;
if(!empty($data_active) OR !empty($data_disabled)){
$has_data = true;
}
| {
"pile_set_name": "Github"
} |
#ifndef ALEXCPT_H
#define ALEXCPT_H
#include <exception>
#include <string>
#include "AL/alc.h"
#ifdef __GNUC__
#define ALEXCPT_FORMAT(x, y, z) __attribute__((format(x, (y), (z))))
#else
#define ALEXCPT_FORMAT(x, y, z)
#endif
namespace al {
class backend_exception final : public std::exception {
std::string mMessage;
ALCenum mErrorCode;
public:
backend_exception(ALCenum code, const char *msg, ...) ALEXCPT_FORMAT(printf, 3,4);
const char *what() const noexcept override { return mMessage.c_str(); }
ALCenum errorCode() const noexcept { return mErrorCode; }
};
} // namespace al
#define START_API_FUNC try
#define END_API_FUNC catch(...) { std::terminate(); }
#endif /* ALEXCPT_H */
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math.analysis.function;
import org.apache.commons.math.analysis.UnivariateRealFunction;
import org.apache.commons.math.exception.DimensionMismatchException;
import org.apache.commons.math.exception.NonMonotonousSequenceException;
import org.apache.commons.math.exception.NullArgumentException;
import org.apache.commons.math.exception.NoDataException;
import org.junit.Assert;
import org.junit.Test;
/**
* Test for class {@link StepFunction}.
*/
public class StepFunctionTest {
private final double EPS = Math.ulp(1d);
@Test(expected=NullArgumentException.class)
public void testPreconditions1() {
new StepFunction(null, new double[] {0, -1, -2});
}
@Test(expected=NullArgumentException.class)
public void testPreconditions2() {
new StepFunction(new double[] {0, 1}, null);
}
@Test(expected=NoDataException.class)
public void testPreconditions3() {
new StepFunction(new double[] {0}, new double[] {});
}
@Test(expected=NoDataException.class)
public void testPreconditions4() {
new StepFunction(new double[] {}, new double[] {0});
}
@Test(expected=DimensionMismatchException.class)
public void testPreconditions5() {
new StepFunction(new double[] {0, 1}, new double[] {0, -1, -2});
}
@Test(expected=NonMonotonousSequenceException.class)
public void testPreconditions6() {
new StepFunction(new double[] {1, 0, 1}, new double[] {0, -1, -2});
}
@Test
public void testSomeValues() {
final double[] x = { -2, -0.5, 0, 1.9, 7.4, 21.3 };
final double[] y = { 4, -1, -5.5, 0.4, 5.8, 51.2 };
final UnivariateRealFunction f = new StepFunction(x, y);
Assert.assertEquals(4, f.value(Double.NEGATIVE_INFINITY), EPS);
Assert.assertEquals(4, f.value(-10), EPS);
Assert.assertEquals(-1, f.value(-0.4), EPS);
Assert.assertEquals(-5.5, f.value(0), EPS);
Assert.assertEquals(0.4, f.value(2), EPS);
Assert.assertEquals(5.8, f.value(10), EPS);
Assert.assertEquals(51.2, f.value(30), EPS);
Assert.assertEquals(51.2, f.value(Double.POSITIVE_INFINITY), EPS);
}
@Test
public void testHeaviside() {
final UnivariateRealFunction h = new StepFunction(new double[] {-1, 0},
new double[] {0, 1});
Assert.assertEquals(0, h.value(Double.NEGATIVE_INFINITY), 0);
Assert.assertEquals(0, h.value(-Double.MAX_VALUE), 0);
Assert.assertEquals(0, h.value(-2), 0);
Assert.assertEquals(0, h.value(-Double.MIN_VALUE), 0);
Assert.assertEquals(1, h.value(0), 0);
Assert.assertEquals(1, h.value(2), 0);
Assert.assertEquals(1, h.value(Double.POSITIVE_INFINITY), 0);
}
}
| {
"pile_set_name": "Github"
} |
const PACKAGE = require('../../../../../webpack.common.js');
module.exports = PACKAGE(
'input/tex/extensions/tagformat', // the package to build
'../../../../../../js', // location of the MathJax js library
[ // packages to link to
'components/src/input/tex-base/lib',
'components/src/core/lib'
],
__dirname // our directory
);
| {
"pile_set_name": "Github"
} |
G04 (created by PCBNEW (2013-07-07 BZR 4022)-stable) date 11/9/2013 7:35:54 PM*
%MOIN*%
G04 Gerber Fmt 3.4, Leading zero omitted, Abs format*
%FSLAX34Y34*%
G01*
G70*
G90*
G04 APERTURE LIST*
%ADD10C,0.006*%
%ADD11C,0.104425*%
%ADD12C,0.021*%
%ADD13C,0.147732*%
%ADD14R,0.0729291X0.0729291*%
%ADD15C,0.0729291*%
%ADD16C,0.131*%
G04 APERTURE END LIST*
G54D10*
G54D11*
X40250Y6750D03*
X31750Y6750D03*
X40250Y35250D03*
X31750Y35250D03*
G54D12*
X30500Y21200D03*
X30500Y20800D03*
G54D13*
X6250Y29750D03*
X23750Y12250D03*
X6250Y12250D03*
X23750Y29750D03*
G54D14*
X9500Y17000D03*
G54D15*
X10500Y17000D03*
X9500Y16000D03*
X10500Y16000D03*
X9500Y15000D03*
X10500Y15000D03*
G54D12*
X14750Y5500D03*
X15250Y5500D03*
X31250Y5500D03*
X31750Y5500D03*
X40250Y5500D03*
X40750Y5500D03*
X40750Y36500D03*
X40250Y36500D03*
X31250Y36500D03*
X31750Y36500D03*
X14750Y36500D03*
X15250Y36500D03*
G54D16*
X2500Y39500D03*
X38500Y39500D03*
X38500Y2500D03*
X2500Y2500D03*
M02*
| {
"pile_set_name": "Github"
} |
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "info@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
"""Policies
Note that Dispatchers are now implemented in "dispatcher.py", but
are still documented here.
Policies
A policy is an object which manages the interaction between a public
Python object, and COM . In simple terms, the policy object is the
object which is actually called by COM, and it invokes the requested
method, fetches/sets the requested property, etc. See the
@win32com.server.policy.CreateInstance@ method for a description of
how a policy is specified or created.
Exactly how a policy determines which underlying object method/property
is obtained is up to the policy. A few policies are provided, but you
can build your own. See each policy class for a description of how it
implements its policy.
There is a policy that allows the object to specify exactly which
methods and properties will be exposed. There is also a policy that
will dynamically expose all Python methods and properties - even those
added after the object has been instantiated.
Dispatchers
A Dispatcher is a level in front of a Policy. A dispatcher is the
thing which actually receives the COM calls, and passes them to the
policy object (which in turn somehow does something with the wrapped
object).
It is important to note that a policy does not need to have a dispatcher.
A dispatcher has the same interface as a policy, and simply steps in its
place, delegating to the real policy. The primary use for a Dispatcher
is to support debugging when necessary, but without imposing overheads
when not (ie, by not using a dispatcher at all).
There are a few dispatchers provided - "tracing" dispatchers which simply
prints calls and args (including a variation which uses
win32api.OutputDebugString), and a "debugger" dispatcher, which can
invoke the debugger when necessary.
Error Handling
It is important to realise that the caller of these interfaces may
not be Python. Therefore, general Python exceptions and tracebacks aren't
much use.
In general, there is an Exception class that should be raised, to allow
the framework to extract rich COM type error information.
The general rule is that the **only** exception returned from Python COM
Server code should be an Exception instance. Any other Python exception
should be considered an implementation bug in the server (if not, it
should be handled, and an appropriate Exception instance raised). Any
other exception is considered "unexpected", and a dispatcher may take
special action (see Dispatchers above)
Occasionally, the implementation will raise the policy.error error.
This usually means there is a problem in the implementation that the
Python programmer should fix.
For example, if policy is asked to wrap an object which it can not
support (because, eg, it does not provide _public_methods_ or _dynamic_)
then policy.error will be raised, indicating it is a Python programmers
problem, rather than a COM error.
"""
__author__ = "Greg Stein and Mark Hammond"
import win32api
import winerror
import sys
import types
import pywintypes
import win32con, pythoncom
#Import a few important constants to speed lookups.
from pythoncom import \
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, \
DISPID_UNKNOWN, DISPID_VALUE, DISPID_PROPERTYPUT, DISPID_NEWENUM, \
DISPID_EVALUATE, DISPID_CONSTRUCTOR, DISPID_DESTRUCTOR, DISPID_COLLECT,DISPID_STARTENUM
S_OK = 0
# Few more globals to speed things.
IDispatchType = pythoncom.TypeIIDs[pythoncom.IID_IDispatch]
IUnknownType = pythoncom.TypeIIDs[pythoncom.IID_IUnknown]
from .exception import COMException
error = __name__ + " error"
regSpec = 'CLSID\\%s\\PythonCOM'
regPolicy = 'CLSID\\%s\\PythonCOMPolicy'
regDispatcher = 'CLSID\\%s\\PythonCOMDispatcher'
regAddnPath = 'CLSID\\%s\\PythonCOMPath'
def CreateInstance(clsid, reqIID):
"""Create a new instance of the specified IID
The COM framework **always** calls this function to create a new
instance for the specified CLSID. This function looks up the
registry for the name of a policy, creates the policy, and asks the
policy to create the specified object by calling the _CreateInstance_ method.
Exactly how the policy creates the instance is up to the policy. See the
specific policy documentation for more details.
"""
# First see is sys.path should have something on it.
try:
addnPaths = win32api.RegQueryValue(win32con.HKEY_CLASSES_ROOT,
regAddnPath % clsid).split(';')
for newPath in addnPaths:
if newPath not in sys.path:
sys.path.insert(0, newPath)
except win32api.error:
pass
try:
policy = win32api.RegQueryValue(win32con.HKEY_CLASSES_ROOT,
regPolicy % clsid)
policy = resolve_func(policy)
except win32api.error:
policy = DefaultPolicy
try:
dispatcher = win32api.RegQueryValue(win32con.HKEY_CLASSES_ROOT,
regDispatcher % clsid)
if dispatcher: dispatcher = resolve_func(dispatcher)
except win32api.error:
dispatcher = None
if dispatcher:
retObj = dispatcher(policy, None)
else:
retObj = policy(None)
return retObj._CreateInstance_(clsid, reqIID)
class BasicWrapPolicy:
"""The base class of policies.
Normally not used directly (use a child class, instead)
This policy assumes we are wrapping another object
as the COM server. This supports the delegation of the core COM entry points
to either the wrapped object, or to a child class.
This policy supports the following special attributes on the wrapped object
_query_interface_ -- A handler which can respond to the COM 'QueryInterface' call.
_com_interfaces_ -- An optional list of IIDs which the interface will assume are
valid for the object.
_invoke_ -- A handler which can respond to the COM 'Invoke' call. If this attribute
is not provided, then the default policy implementation is used. If this attribute
does exist, it is responsible for providing all required functionality - ie, the
policy _invoke_ method is not invoked at all (and nor are you able to call it!)
_getidsofnames_ -- A handler which can respond to the COM 'GetIDsOfNames' call. If this attribute
is not provided, then the default policy implementation is used. If this attribute
does exist, it is responsible for providing all required functionality - ie, the
policy _getidsofnames_ method is not invoked at all (and nor are you able to call it!)
IDispatchEx functionality:
_invokeex_ -- Very similar to _invoke_, except slightly different arguments are used.
And the result is just the _real_ result (rather than the (hresult, argErr, realResult)
tuple that _invoke_ uses.
This is the new, prefered handler (the default _invoke_ handler simply called _invokeex_)
_getdispid_ -- Very similar to _getidsofnames_, except slightly different arguments are used,
and only 1 property at a time can be fetched (which is all we support in getidsofnames anyway!)
This is the new, prefered handler (the default _invoke_ handler simply called _invokeex_)
_getnextdispid_- uses self._name_to_dispid_ to enumerate the DISPIDs
"""
def __init__(self, object):
"""Initialise the policy object
Params:
object -- The object to wrap. May be None *iff* @BasicWrapPolicy._CreateInstance_@ will be
called immediately after this to setup a brand new object
"""
if object is not None:
self._wrap_(object)
def _CreateInstance_(self, clsid, reqIID):
"""Creates a new instance of a **wrapped** object
This method looks up a "@win32com.server.policy.regSpec@" % clsid entry
in the registry (using @DefaultPolicy@)
"""
try:
classSpec = win32api.RegQueryValue(win32con.HKEY_CLASSES_ROOT,
regSpec % clsid)
except win32api.error:
raise error("The object is not correctly registered - %s key can not be read" % (regSpec % clsid))
myob = call_func(classSpec)
self._wrap_(myob)
try:
return pythoncom.WrapObject(self, reqIID)
except pythoncom.com_error as xxx_todo_changeme:
(hr, desc, exc, arg) = xxx_todo_changeme.args
from win32com.util import IIDToInterfaceName
desc = "The object '%r' was created, but does not support the " \
"interface '%s'(%s): %s" \
% (myob, IIDToInterfaceName(reqIID), reqIID, desc)
raise pythoncom.com_error(hr, desc, exc, arg)
def _wrap_(self, object):
"""Wraps up the specified object.
This function keeps a reference to the passed
object, and may interogate it to determine how to respond to COM requests, etc.
"""
# We "clobber" certain of our own methods with ones
# provided by the wrapped object, iff they exist.
self._name_to_dispid_ = { }
ob = self._obj_ = object
if hasattr(ob, '_query_interface_'):
self._query_interface_ = ob._query_interface_
if hasattr(ob, '_invoke_'):
self._invoke_ = ob._invoke_
if hasattr(ob, '_invokeex_'):
self._invokeex_ = ob._invokeex_
if hasattr(ob, '_getidsofnames_'):
self._getidsofnames_ = ob._getidsofnames_
if hasattr(ob, '_getdispid_'):
self._getdispid_ = ob._getdispid_
# Allow for override of certain special attributes.
if hasattr(ob, '_com_interfaces_'):
self._com_interfaces_ = []
# Allow interfaces to be specified by name.
for i in ob._com_interfaces_:
if type(i) != pywintypes.IIDType:
# Prolly a string!
if i[0] != "{":
i = pythoncom.InterfaceNames[i]
else:
i = pythoncom.MakeIID(i)
self._com_interfaces_.append(i)
else:
self._com_interfaces_ = [ ]
# "QueryInterface" handling.
def _QueryInterface_(self, iid):
"""The main COM entry-point for QueryInterface.
This checks the _com_interfaces_ attribute and if the interface is not specified
there, it calls the derived helper _query_interface_
"""
if iid in self._com_interfaces_:
return 1
return self._query_interface_(iid)
def _query_interface_(self, iid):
"""Called if the object does not provide the requested interface in _com_interfaces_,
and does not provide a _query_interface_ handler.
Returns a result to the COM framework indicating the interface is not supported.
"""
return 0
# "Invoke" handling.
def _Invoke_(self, dispid, lcid, wFlags, args):
"""The main COM entry-point for Invoke.
This calls the _invoke_ helper.
"""
#Translate a possible string dispid to real dispid.
if type(dispid) == type(""):
try:
dispid = self._name_to_dispid_[dispid.lower()]
except KeyError:
raise COMException(scode = winerror.DISP_E_MEMBERNOTFOUND, desc="Member not found")
return self._invoke_(dispid, lcid, wFlags, args)
def _invoke_(self, dispid, lcid, wFlags, args):
# Delegates to the _invokeex_ implementation. This allows
# a custom policy to define _invokeex_, and automatically get _invoke_ too.
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None)
# "GetIDsOfNames" handling.
def _GetIDsOfNames_(self, names, lcid):
"""The main COM entry-point for GetIDsOfNames.
This checks the validity of the arguments, and calls the _getidsofnames_ helper.
"""
if len(names) > 1:
raise COMException(scode = winerror.DISP_E_INVALID, desc="Cannot support member argument names")
return self._getidsofnames_(names, lcid)
def _getidsofnames_(self, names, lcid):
### note: lcid is being ignored...
return (self._getdispid_(names[0], 0), )
# IDispatchEx support for policies. Most of the IDispathEx functionality
# by default will raise E_NOTIMPL. Thus it is not necessary for derived
# policies to explicitely implement all this functionality just to not implement it!
def _GetDispID_(self, name, fdex):
return self._getdispid_(name, fdex)
def _getdispid_(self, name, fdex):
try:
### TODO - look at the fdex flags!!!
return self._name_to_dispid_[name.lower()]
except KeyError:
raise COMException(scode = winerror.DISP_E_UNKNOWNNAME)
# "InvokeEx" handling.
def _InvokeEx_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider):
"""The main COM entry-point for InvokeEx.
This calls the _invokeex_ helper.
"""
#Translate a possible string dispid to real dispid.
if type(dispid) == type(""):
try:
dispid = self._name_to_dispid_[dispid.lower()]
except KeyError:
raise COMException(scode = winerror.DISP_E_MEMBERNOTFOUND, desc="Member not found")
return self._invokeex_(dispid, lcid, wFlags, args, kwargs, serviceProvider)
def _invokeex_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider):
"""A stub for _invokeex_ - should never be called.
Simply raises an exception.
"""
# Base classes should override this method (and not call the base)
raise error("This class does not provide _invokeex_ semantics")
def _DeleteMemberByName_(self, name, fdex):
return self._deletememberbyname_(name, fdex)
def _deletememberbyname_(self, name, fdex):
raise COMException(scode = winerror.E_NOTIMPL)
def _DeleteMemberByDispID_(self, id):
return self._deletememberbydispid(id)
def _deletememberbydispid_(self, id):
raise COMException(scode = winerror.E_NOTIMPL)
def _GetMemberProperties_(self, id, fdex):
return self._getmemberproperties_(id, fdex)
def _getmemberproperties_(self, id, fdex):
raise COMException(scode = winerror.E_NOTIMPL)
def _GetMemberName_(self, dispid):
return self._getmembername_(dispid)
def _getmembername_(self, dispid):
raise COMException(scode = winerror.E_NOTIMPL)
def _GetNextDispID_(self, fdex, dispid):
return self._getnextdispid_(fdex, dispid)
def _getnextdispid_(self, fdex, dispid):
ids = list(self._name_to_dispid_.values())
ids.sort()
if DISPID_STARTENUM in ids: ids.remove(DISPID_STARTENUM)
if dispid==DISPID_STARTENUM:
return ids[0]
else:
try:
return ids[ids.index(dispid)+1]
except ValueError: # dispid not in list?
raise COMException(scode = winerror.E_UNEXPECTED)
except IndexError: # No more items
raise COMException(scode = winerror.S_FALSE)
def _GetNameSpaceParent_(self):
return self._getnamespaceparent()
def _getnamespaceparent_(self):
raise COMException(scode = winerror.E_NOTIMPL)
class MappedWrapPolicy(BasicWrapPolicy):
"""Wraps an object using maps to do its magic
This policy wraps up a Python object, using a number of maps
which translate from a Dispatch ID and flags, into an object to call/getattr, etc.
It is the responsibility of derived classes to determine exactly how the
maps are filled (ie, the derived classes determine the map filling policy.
This policy supports the following special attributes on the wrapped object
_dispid_to_func_/_dispid_to_get_/_dispid_to_put_ -- These are dictionaries
(keyed by integer dispid, values are string attribute names) which the COM
implementation uses when it is processing COM requests. Note that the implementation
uses this dictionary for its own purposes - not a copy - which means the contents of
these dictionaries will change as the object is used.
"""
def _wrap_(self, object):
BasicWrapPolicy._wrap_(self, object)
ob = self._obj_
if hasattr(ob, '_dispid_to_func_'):
self._dispid_to_func_ = ob._dispid_to_func_
else:
self._dispid_to_func_ = { }
if hasattr(ob, '_dispid_to_get_'):
self._dispid_to_get_ = ob._dispid_to_get_
else:
self._dispid_to_get_ = { }
if hasattr(ob, '_dispid_to_put_'):
self._dispid_to_put_ = ob._dispid_to_put_
else:
self._dispid_to_put_ = { }
def _getmembername_(self, dispid):
if dispid in self._dispid_to_func_:
return self._dispid_to_func_[dispid]
elif dispid in self._dispid_to_get_:
return self._dispid_to_get_[dispid]
elif dispid in self._dispid_to_put_:
return self._dispid_to_put_[dispid]
else:
raise COMException(scode = winerror.DISP_E_MEMBERNOTFOUND)
class DesignatedWrapPolicy(MappedWrapPolicy):
"""A policy which uses a mapping to link functions and dispid
A MappedWrappedPolicy which allows the wrapped object to specify, via certain
special named attributes, exactly which methods and properties are exposed.
All a wrapped object need do is provide the special attributes, and the policy
will handle everything else.
Attributes:
_public_methods_ -- Required, unless a typelib GUID is given -- A list
of strings, which must be the names of methods the object
provides. These methods will be exposed and callable
from other COM hosts.
_public_attrs_ A list of strings, which must be the names of attributes on the object.
These attributes will be exposed and readable and possibly writeable from other COM hosts.
_readonly_attrs_ -- A list of strings, which must also appear in _public_attrs. These
attributes will be readable, but not writable, by other COM hosts.
_value_ -- A method that will be called if the COM host requests the "default" method
(ie, calls Invoke with dispid==DISPID_VALUE)
_NewEnum -- A method that will be called if the COM host requests an enumerator on the
object (ie, calls Invoke with dispid==DISPID_NEWENUM.)
It is the responsibility of the method to ensure the returned
object conforms to the required Enum interface.
_typelib_guid_ -- The GUID of the typelibrary with interface definitions we use.
_typelib_version_ -- A tuple of (major, minor) with a default of 1,1
_typelib_lcid_ -- The LCID of the typelib, default = LOCALE_USER_DEFAULT
_Evaluate -- Dunno what this means, except the host has called Invoke with dispid==DISPID_EVALUATE!
See the COM documentation for details.
"""
def _wrap_(self, ob):
# If we have nominated universal interfaces to support, load them now
tlb_guid = getattr(ob, '_typelib_guid_', None)
if tlb_guid is not None:
tlb_major, tlb_minor = getattr(ob, '_typelib_version_', (1,0))
tlb_lcid = getattr(ob, '_typelib_lcid_', 0)
from win32com import universal
# XXX - what if the user wants to implement interfaces from multiple
# typelibs?
# Filter out all 'normal' IIDs (ie, IID objects and strings starting with {
interfaces = [i for i in getattr(ob, '_com_interfaces_', [])
if type(i) != pywintypes.IIDType and not i.startswith("{")]
universal_data = universal.RegisterInterfaces(tlb_guid, tlb_lcid,
tlb_major, tlb_minor, interfaces)
else:
universal_data = []
MappedWrapPolicy._wrap_(self, ob)
if not hasattr(ob, '_public_methods_') and not hasattr(ob, "_typelib_guid_"):
raise error("Object does not support DesignatedWrapPolicy, as it does not have either _public_methods_ or _typelib_guid_ attributes.")
# Copy existing _dispid_to_func_ entries to _name_to_dispid_
for dispid, name in self._dispid_to_func_.items():
self._name_to_dispid_[name.lower()]=dispid
for dispid, name in self._dispid_to_get_.items():
self._name_to_dispid_[name.lower()]=dispid
for dispid, name in self._dispid_to_put_.items():
self._name_to_dispid_[name.lower()]=dispid
# Patch up the universal stuff.
for dispid, invkind, name in universal_data:
self._name_to_dispid_[name.lower()]=dispid
if invkind == DISPATCH_METHOD:
self._dispid_to_func_[dispid] = name
elif invkind in (DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF):
self._dispid_to_put_[dispid] = name
elif invkind == DISPATCH_PROPERTYGET:
self._dispid_to_get_[dispid] = name
else:
raise ValueError("unexpected invkind: %d (%s)" % (invkind,name))
# look for reserved methods
if hasattr(ob, '_value_'):
self._dispid_to_get_[DISPID_VALUE] = '_value_'
self._dispid_to_put_[DISPID_PROPERTYPUT] = '_value_'
if hasattr(ob, '_NewEnum'):
self._name_to_dispid_['_newenum'] = DISPID_NEWENUM
self._dispid_to_func_[DISPID_NEWENUM] = '_NewEnum'
if hasattr(ob, '_Evaluate'):
self._name_to_dispid_['_evaluate'] = DISPID_EVALUATE
self._dispid_to_func_[DISPID_EVALUATE] = '_Evaluate'
next_dispid = self._allocnextdispid(999)
# note: funcs have precedence over attrs (install attrs first)
if hasattr(ob, '_public_attrs_'):
if hasattr(ob, '_readonly_attrs_'):
readonly = ob._readonly_attrs_
else:
readonly = [ ]
for name in ob._public_attrs_:
dispid = self._name_to_dispid_.get(name.lower())
if dispid is None:
dispid = next_dispid
self._name_to_dispid_[name.lower()] = dispid
next_dispid = self._allocnextdispid(next_dispid)
self._dispid_to_get_[dispid] = name
if name not in readonly:
self._dispid_to_put_[dispid] = name
for name in getattr(ob, "_public_methods_", []):
dispid = self._name_to_dispid_.get(name.lower())
if dispid is None:
dispid = next_dispid
self._name_to_dispid_[name.lower()] = dispid
next_dispid = self._allocnextdispid(next_dispid)
self._dispid_to_func_[dispid] = name
self._typeinfos_ = None # load these on demand.
def _build_typeinfos_(self):
# Can only ever be one for now.
tlb_guid = getattr(self._obj_, '_typelib_guid_', None)
if tlb_guid is None:
return []
tlb_major, tlb_minor = getattr(self._obj_, '_typelib_version_', (1,0))
tlb = pythoncom.LoadRegTypeLib(tlb_guid, tlb_major, tlb_minor)
typecomp = tlb.GetTypeComp()
# Not 100% sure what semantics we should use for the default interface.
# Look for the first name in _com_interfaces_ that exists in the typelib.
for iname in self._obj_._com_interfaces_:
try:
type_info, type_comp = typecomp.BindType(iname)
if type_info is not None:
return [type_info]
except pythoncom.com_error:
pass
return []
def _GetTypeInfoCount_(self):
if self._typeinfos_ is None:
self._typeinfos_ = self._build_typeinfos_()
return len(self._typeinfos_)
def _GetTypeInfo_(self, index, lcid):
if self._typeinfos_ is None:
self._typeinfos_ = self._build_typeinfos_()
if index < 0 or index >= len(self._typeinfos_):
raise COMException(scode=winerror.DISP_E_BADINDEX)
return 0, self._typeinfos_[index]
def _allocnextdispid(self, last_dispid):
while 1:
last_dispid = last_dispid + 1
if last_dispid not in self._dispid_to_func_ and \
last_dispid not in self._dispid_to_get_ and \
last_dispid not in self._dispid_to_put_:
return last_dispid
def _invokeex_(self, dispid, lcid, wFlags, args, kwArgs, serviceProvider):
### note: lcid is being ignored...
if wFlags & DISPATCH_METHOD:
try:
funcname = self._dispid_to_func_[dispid]
except KeyError:
if not wFlags & DISPATCH_PROPERTYGET:
raise COMException(scode=winerror.DISP_E_MEMBERNOTFOUND) # not found
else:
try:
func = getattr(self._obj_, funcname)
except AttributeError:
# May have a dispid, but that doesnt mean we have the function!
raise COMException(scode=winerror.DISP_E_MEMBERNOTFOUND)
# Should check callable here
try:
return func(*args)
except TypeError as v:
# Particularly nasty is "wrong number of args" type error
# This helps you see what 'func' and 'args' actually is
if str(v).find("arguments")>=0:
print("** TypeError %s calling function %r(%r)" % (v, func, args))
raise
if wFlags & DISPATCH_PROPERTYGET:
try:
name = self._dispid_to_get_[dispid]
except KeyError:
raise COMException(scode=winerror.DISP_E_MEMBERNOTFOUND) # not found
retob = getattr(self._obj_, name)
if type(retob)==types.MethodType: # a method as a property - call it.
retob = retob(*args)
return retob
if wFlags & (DISPATCH_PROPERTYPUT | DISPATCH_PROPERTYPUTREF): ### correct?
try:
name = self._dispid_to_put_[dispid]
except KeyError:
raise COMException(scode=winerror.DISP_E_MEMBERNOTFOUND) # read-only
# If we have a method of that name (ie, a property get function), and
# we have an equiv. property set function, use that instead.
if type(getattr(self._obj_, name, None)) == types.MethodType and \
type(getattr(self._obj_, "Set" + name, None)) == types.MethodType:
fn = getattr(self._obj_, "Set" + name)
fn( *args )
else:
# just set the attribute
setattr(self._obj_, name, args[0])
return
raise COMException(scode=winerror.E_INVALIDARG, desc="invalid wFlags")
class EventHandlerPolicy(DesignatedWrapPolicy):
"""The default policy used by event handlers in the win32com.client package.
In addition to the base policy, this provides argument conversion semantics for
params
* dispatch params are converted to dispatch objects.
* Unicode objects are converted to strings (1.5.2 and earlier)
NOTE: Later, we may allow the object to override this process??
"""
def _transform_args_(self, args, kwArgs, dispid, lcid, wFlags, serviceProvider):
ret = []
for arg in args:
arg_type = type(arg)
if arg_type == IDispatchType:
import win32com.client
arg = win32com.client.Dispatch(arg)
elif arg_type == IUnknownType:
try:
import win32com.client
arg = win32com.client.Dispatch(arg.QueryInterface(pythoncom.IID_IDispatch))
except pythoncom.error:
pass # Keep it as IUnknown
ret.append(arg)
return tuple(ret), kwArgs
def _invokeex_(self, dispid, lcid, wFlags, args, kwArgs, serviceProvider):
# transform the args.
args, kwArgs = self._transform_args_(args, kwArgs, dispid, lcid, wFlags, serviceProvider)
return DesignatedWrapPolicy._invokeex_( self, dispid, lcid, wFlags, args, kwArgs, serviceProvider)
class DynamicPolicy(BasicWrapPolicy):
"""A policy which dynamically (ie, at run-time) determines public interfaces.
A dynamic policy is used to dynamically dispatch methods and properties to the
wrapped object. The list of objects and properties does not need to be known in
advance, and methods or properties added to the wrapped object after construction
are also handled.
The wrapped object must provide the following attributes:
_dynamic_ -- A method that will be called whenever an invoke on the object
is called. The method is called with the name of the underlying method/property
(ie, the mapping of dispid to/from name has been resolved.) This name property
may also be '_value_' to indicate the default, and '_NewEnum' to indicate a new
enumerator is requested.
"""
def _wrap_(self, object):
BasicWrapPolicy._wrap_(self, object)
if not hasattr(self._obj_, '_dynamic_'):
raise error("Object does not support Dynamic COM Policy")
self._next_dynamic_ = self._min_dynamic_ = 1000
self._dyn_dispid_to_name_ = {DISPID_VALUE:'_value_', DISPID_NEWENUM:'_NewEnum' }
def _getdispid_(self, name, fdex):
# TODO - Look at fdex flags.
lname = name.lower()
try:
return self._name_to_dispid_[lname]
except KeyError:
dispid = self._next_dynamic_ = self._next_dynamic_ + 1
self._name_to_dispid_[lname] = dispid
self._dyn_dispid_to_name_[dispid] = name # Keep case in this map...
return dispid
def _invoke_(self, dispid, lcid, wFlags, args):
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None)
def _invokeex_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider):
### note: lcid is being ignored...
### note: kwargs is being ignored...
### note: serviceProvider is being ignored...
### there might be assigned DISPID values to properties, too...
try:
name = self._dyn_dispid_to_name_[dispid]
except KeyError:
raise COMException(scode = winerror.DISP_E_MEMBERNOTFOUND, desc="Member not found")
return self._obj_._dynamic_(name, lcid, wFlags, args)
DefaultPolicy = DesignatedWrapPolicy
def resolve_func(spec):
"""Resolve a function by name
Given a function specified by 'module.function', return a callable object
(ie, the function itself)
"""
try:
idx = spec.rindex(".")
mname = spec[:idx]
fname = spec[idx+1:]
# Dont attempt to optimize by looking in sys.modules,
# as another thread may also be performing the import - this
# way we take advantage of the built-in import lock.
module = _import_module(mname)
return getattr(module, fname)
except ValueError: # No "." in name - assume in this module
return globals()[spec]
def call_func(spec, *args):
"""Call a function specified by name.
Call a function specified by 'module.function' and return the result.
"""
return resolve_func(spec)(*args)
def _import_module(mname):
"""Import a module just like the 'import' statement.
Having this function is much nicer for importing arbitrary modules than
using the 'exec' keyword. It is more efficient and obvious to the reader.
"""
__import__(mname)
# Eeek - result of _import_ is "win32com" - not "win32com.a.b.c"
# Get the full module from sys.modules
return sys.modules[mname]
#######
#
# Temporary hacks until all old code moves.
#
# These have been moved to a new source file, but some code may
# still reference them here. These will end up being removed.
try:
from .dispatcher import DispatcherTrace, DispatcherWin32trace
except ImportError: # Quite likely a frozen executable that doesnt need dispatchers
pass
| {
"pile_set_name": "Github"
} |
import { useState } from "@wordpress/element";
import { SvgIcon } from "@yoast/components";
import PropTypes from "prop-types";
/**
* Sidebar Collapsible component with default padding and separator
*
* @param {Object} props The properties for the component.
*
* @returns {wp.Element} The Collapsible component.
*/
const SidebarCollapsible = ( props ) => {
const [ isOpen, toggleOpen ] = useState( false );
const {
prefixIcon,
} = props;
/**
* Toggles the SidebarCollapsible open and closed state.
*
* @returns {void}
*/
function handleClick() {
toggleOpen( ! isOpen );
}
return <div className={ `yoast components-panel__body ${ isOpen ? "is-opened" : "" }` }>
<h2 className="components-panel__body-title">
<button
onClick={ handleClick }
className="components-button components-panel__body-toggle"
>
<span
className="yoast-icon-span"
style={ { fill: `${ prefixIcon && prefixIcon.color || "" }` } }
>
{
prefixIcon && <SvgIcon
icon={ prefixIcon.icon }
color={ prefixIcon.color }
size={ prefixIcon.size }
/>
}
</span>
<span className="yoast-title-container">
<div className="yoast-title">{ props.title }</div>
<div className="yoast-subtitle">{ props.subTitle }</div>
</span>
<span className="yoast-chevron" aria-hidden="true" />
</button>
</h2>
{ isOpen && props.children }
</div>;
};
export default SidebarCollapsible;
SidebarCollapsible.propTypes = {
title: PropTypes.string.isRequired,
children: PropTypes.oneOfType( [
PropTypes.node,
PropTypes.arrayOf( PropTypes.node ),
] ).isRequired,
prefixIcon: PropTypes.object,
subTitle: PropTypes.string,
};
SidebarCollapsible.defaultProps = {
prefixIcon: null,
subTitle: "",
};
| {
"pile_set_name": "Github"
} |
// @flow
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { withTranslation } from 'react-i18next';
import compose from 'lodash/fp/compose';
import { Grid, Header, Icon, Message, Segment } from 'semantic-ui-react';
class PromptStageError extends Component<Props> {
render() {
const {
error,
t,
} = this.props;
return (
<Grid centered>
<Grid.Column width={14}>
<Segment basic textAlign="center">
<Header icon size="large">
<Icon name="warning sign" />
<Header.Content style={{ marginTop: '1em' }}>
{t('handler_containers_stage_error_header')}
<Header.Subheader>
{t('handler_containers_stage_error_subheader')}
</Header.Subheader>
</Header.Content>
</Header>
{(error)
? (
<Message
header={t('handler_containers_stage_error_message')}
content={error}
error
/>
)
: false
}
</Segment>
</Grid.Column>
</Grid>
);
}
}
function mapStateToProps(state) {
return {
prompt: state.prompt,
};
}
export default compose(
withTranslation('handler'),
connect(mapStateToProps)
)(PromptStageError);
| {
"pile_set_name": "Github"
} |
load("@rules_jvm_external//:defs.bzl", "artifact")
alias(
name = "jimfs",
actual = artifact("com.google.jimfs:jimfs:1.1"),
visibility = ["//visibility:public"],
)
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "//www.w3.org/TR/html4/strict.dtd">
<HTML style="overflow:auto;">
<HEAD>
<meta name="generator" content="JDiff v1.1.0">
<!-- Generated by the JDiff Javadoc doclet -->
<!-- (http://www.jdiff.org) -->
<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
android.graphics.Paint
</TITLE>
<link href="../../../../assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../stylesheet-jdiff.css" rel="stylesheet" type="text/css" />
<noscript>
<style type="text/css">
body{overflow:auto;}
#body-content{position:relative; top:0;}
#doc-content{overflow:visible;border-left:3px solid #666;}
#side-nav{padding:0;}
#side-nav .toggle-list ul {display:block;}
#resize-packages-nav{border-bottom:3px solid #666;}
</style>
</noscript>
<style type="text/css">
</style>
</HEAD>
<BODY>
<!-- Start of nav bar -->
<a name="top"></a>
<div id="header" style="margin-bottom:0;padding-bottom:0;">
<div id="headerLeft">
<a href="../../../../index.html" tabindex="-1" target="_top"><img src="../../../../assets/images/bg_logo.png" alt="Android Developers" /></a>
</div>
<div id="headerRight">
<div id="headerLinks">
<!-- <img src="/assets/images/icon_world.jpg" alt="" /> -->
<span class="text">
<!-- <a href="#">English</a> | -->
<nobr><a href="//developer.android.com" target="_top">Android Developers</a> | <a href="//www.android.com" target="_top">Android.com</a></nobr>
</span>
</div>
<div class="and-diff-id" style="margin-top:6px;margin-right:8px;">
<table class="diffspectable">
<tr>
<td colspan="2" class="diffspechead">API Diff Specification</td>
</tr>
<tr>
<td class="diffspec" style="padding-top:.25em">To Level:</td>
<td class="diffvaluenew" style="padding-top:.25em">24</td>
</tr>
<tr>
<td class="diffspec">From Level:</td>
<td class="diffvalueold">n-preview-3</td>
</tr>
<tr>
<td class="diffspec">Generated</td>
<td class="diffvalue">2016.06.13 13:32</td>
</tr>
</table>
</div><!-- End and-diff-id -->
<div class="and-diff-id" style="margin-right:8px;">
<table class="diffspectable">
<tr>
<td class="diffspec" colspan="2"><a href="jdiff_statistics.html">Statistics</a>
</tr>
</table>
</div> <!-- End and-diff-id -->
</div> <!-- End headerRight -->
</div> <!-- End header -->
<div id="body-content" xstyle="padding:12px;padding-right:18px;">
<div id="doc-content" style="position:relative;">
<div id="mainBodyFluid">
<H2>
Class android.graphics.<A HREF="../../../../reference/android/graphics/Paint.html" target="_top"><font size="+2"><code>Paint</code></font></A>
</H2>
<a NAME="constructors"></a>
<a NAME="methods"></a>
<p>
<a NAME="Changed"></a>
<TABLE summary="Changed Methods" WIDTH="100%">
<TR>
<TH VALIGN="TOP" COLSPAN=3>Changed Methods</FONT></TD>
</TH>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.graphics.Paint.getTextLocales_changed()"></A>
<nobr><code>LocaleList</code> <A HREF="../../../../reference/android/graphics/Paint.html#getTextLocales()" target="_top"><code>getTextLocales</code></A>() </nobr>
</TD>
<TD VALIGN="TOP" WIDTH="30%">
Change in return type from <code>android.util.LocaleList</code> to <code>android.os.LocaleList</code>.<br>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.graphics.Paint.setTextLocales_changed(android.os.LocaleList)"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/graphics/Paint.html#setTextLocales(android.os.LocaleList)" target="_top"><code>setTextLocales</code></A>(<code>LocaleList</code>) </nobr>
</TD>
<TD VALIGN="TOP" WIDTH="30%">
Change in signature from <code>android.util.LocaleList</code> to <code>android.os.LocaleList</code>.<br>
</TD>
<TD> </TD>
</TR>
</TABLE>
<a NAME="fields"></a>
</div>
<div id="footer">
<div id="copyright">
Except as noted, this content is licensed under
<a href="//creativecommons.org/licenses/by/2.5/"> Creative Commons Attribution 2.5</a>.
For details and restrictions, see the <a href="/license.html">Content License</a>.
</div>
<div id="footerlinks">
<p>
<a href="//www.android.com/terms.html">Site Terms of Service</a> -
<a href="//www.android.com/privacy.html">Privacy Policy</a> -
<a href="//www.android.com/branding.html">Brand Guidelines</a>
</p>
</div>
</div> <!-- end footer -->
</div><!-- end doc-content -->
</div> <!-- end body-content -->
<script src="//www.google-analytics.com/ga.js" type="text/javascript">
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-5831155-1");
pageTracker._setAllowAnchor(true);
pageTracker._initData();
pageTracker._trackPageview();
} catch(e) {}
</script>
</BODY>
</HTML>
| {
"pile_set_name": "Github"
} |
// Copyright Aleksey Gurtovoy 2000-2004
//
// 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)
//
// Preprocessed version of "boost/mpl/plus.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename Tag1
, typename Tag2
>
struct plus_impl
: if_c<
( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
> BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
)
, aux::cast2nd_impl< plus_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< plus_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct plus_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename Tag > struct plus_impl< na,Tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename Tag > struct plus_impl< Tag,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename T > struct plus_tag
{
typedef typename T::tag type;
};
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
, typename N3 = na, typename N4 = na, typename N5 = na
>
struct plus
: plus< plus< plus< plus< N1,N2 >, N3>, N4>, N5>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(
5
, plus
, ( N1, N2, N3, N4, N5 )
)
};
template<
typename N1, typename N2, typename N3, typename N4
>
struct plus< N1,N2,N3,N4,na >
: plus< plus< plus< N1,N2 >, N3>, N4>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
5
, plus
, ( N1, N2, N3, N4, na )
)
};
template<
typename N1, typename N2, typename N3
>
struct plus< N1,N2,N3,na,na >
: plus< plus< N1,N2 >, N3>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
5
, plus
, ( N1, N2, N3, na, na )
)
};
template<
typename N1, typename N2
>
struct plus< N1,N2,na,na,na >
: plus_impl<
typename plus_tag<N1>::type
, typename plus_tag<N2>::type
>::template apply< N1,N2 >::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
5
, plus
, ( N1, N2, na, na, na )
)
};
BOOST_MPL_AUX_NA_SPEC2(2, 5, plus)
}}
namespace boost { namespace mpl {
template<>
struct plus_impl< integral_c_tag,integral_c_tag >
{
template< typename N1, typename N2 > struct apply
: integral_c<
typename aux::largest_int<
typename N1::value_type
, typename N2::value_type
>::type
, ( BOOST_MPL_AUX_VALUE_WKND(N1)::value
+ BOOST_MPL_AUX_VALUE_WKND(N2)::value
)
>
{
};
};
}}
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
* (c) 2009 Armin Ronacher
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Represents a block node.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_Node_Block extends Twig_Node
{
public function __construct($name, Twig_NodeInterface $body, $lineno, $tag = null)
{
parent::__construct(array('body' => $body), array('name' => $name), $lineno, $tag);
}
/**
* Compiles the node to PHP.
*
* @param Twig_Compiler $compiler A Twig_Compiler instance
*/
public function compile(Twig_Compiler $compiler)
{
$compiler
->addDebugInfo($this)
->write(sprintf("public function block_%s(\$context, array \$blocks = array())\n", $this->getAttribute('name')), "{\n")
->indent()
;
$compiler
->subcompile($this->getNode('body'))
->outdent()
->write("}\n\n")
;
}
}
| {
"pile_set_name": "Github"
} |
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
echo Found %WRAPPER_JAR%
) else (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
echo Finished downloading %WRAPPER_JAR%
)
@REM End of extension
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
| {
"pile_set_name": "Github"
} |
//===-- examples/clang-interpreter/main.cpp - Clang C Interpreter Example -===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/CodeGen/CodeGenAction.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/Tool.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Mangler.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
using namespace clang;
using namespace clang::driver;
// This function isn't referenced outside its translation unit, but it
// can't use the "static" keyword because its address is used for
// GetMainExecutable (since some platforms don't support taking the
// address of main, and some platforms can't implement GetMainExecutable
// without being given the address of a function in the main executable).
std::string GetExecutablePath(const char *Argv0, void *MainAddr) {
return llvm::sys::fs::getMainExecutable(Argv0, MainAddr);
}
namespace llvm {
namespace orc {
class SimpleJIT {
private:
ExecutionSession ES;
std::unique_ptr<TargetMachine> TM;
const DataLayout DL;
MangleAndInterner Mangle{ES, DL};
JITDylib &MainJD{ES.createJITDylib("<main>")};
RTDyldObjectLinkingLayer ObjectLayer{ES, createMemMgr};
IRCompileLayer CompileLayer{ES, ObjectLayer,
std::make_unique<SimpleCompiler>(*TM)};
static std::unique_ptr<SectionMemoryManager> createMemMgr() {
return std::make_unique<SectionMemoryManager>();
}
SimpleJIT(
std::unique_ptr<TargetMachine> TM, DataLayout DL,
std::unique_ptr<DynamicLibrarySearchGenerator> ProcessSymbolsGenerator)
: TM(std::move(TM)), DL(std::move(DL)) {
llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr);
MainJD.addGenerator(std::move(ProcessSymbolsGenerator));
}
public:
static Expected<std::unique_ptr<SimpleJIT>> Create() {
auto JTMB = JITTargetMachineBuilder::detectHost();
if (!JTMB)
return JTMB.takeError();
auto TM = JTMB->createTargetMachine();
if (!TM)
return TM.takeError();
auto DL = (*TM)->createDataLayout();
auto ProcessSymbolsGenerator =
DynamicLibrarySearchGenerator::GetForCurrentProcess(
DL.getGlobalPrefix());
if (!ProcessSymbolsGenerator)
return ProcessSymbolsGenerator.takeError();
return std::unique_ptr<SimpleJIT>(new SimpleJIT(
std::move(*TM), std::move(DL), std::move(*ProcessSymbolsGenerator)));
}
const TargetMachine &getTargetMachine() const { return *TM; }
Error addModule(ThreadSafeModule M) {
return CompileLayer.add(MainJD, std::move(M));
}
Expected<JITEvaluatedSymbol> findSymbol(const StringRef &Name) {
return ES.lookup({&MainJD}, Mangle(Name));
}
Expected<JITTargetAddress> getSymbolAddress(const StringRef &Name) {
auto Sym = findSymbol(Name);
if (!Sym)
return Sym.takeError();
return Sym->getAddress();
}
};
} // end namespace orc
} // end namespace llvm
llvm::ExitOnError ExitOnErr;
int main(int argc, const char **argv) {
// This just needs to be some symbol in the binary; C++ doesn't
// allow taking the address of ::main however.
void *MainAddr = (void*) (intptr_t) GetExecutablePath;
std::string Path = GetExecutablePath(argv[0], MainAddr);
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
TextDiagnosticPrinter *DiagClient =
new TextDiagnosticPrinter(llvm::errs(), &*DiagOpts);
IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagClient);
const std::string TripleStr = llvm::sys::getProcessTriple();
llvm::Triple T(TripleStr);
// Use ELF on Windows-32 and MingW for now.
#ifndef CLANG_INTERPRETER_COFF_FORMAT
if (T.isOSBinFormatCOFF())
T.setObjectFormat(llvm::Triple::ELF);
#endif
ExitOnErr.setBanner("clang interpreter");
Driver TheDriver(Path, T.str(), Diags);
TheDriver.setTitle("clang interpreter");
TheDriver.setCheckInputsExist(false);
// FIXME: This is a hack to try to force the driver to do something we can
// recognize. We need to extend the driver library to support this use model
// (basically, exactly one input, and the operation mode is hard wired).
SmallVector<const char *, 16> Args(argv, argv + argc);
Args.push_back("-fsyntax-only");
std::unique_ptr<Compilation> C(TheDriver.BuildCompilation(Args));
if (!C)
return 0;
// FIXME: This is copied from ASTUnit.cpp; simplify and eliminate.
// We expect to get back exactly one command job, if we didn't something
// failed. Extract that job from the compilation.
const driver::JobList &Jobs = C->getJobs();
if (Jobs.size() != 1 || !isa<driver::Command>(*Jobs.begin())) {
SmallString<256> Msg;
llvm::raw_svector_ostream OS(Msg);
Jobs.Print(OS, "; ", true);
Diags.Report(diag::err_fe_expected_compiler_job) << OS.str();
return 1;
}
const driver::Command &Cmd = cast<driver::Command>(*Jobs.begin());
if (llvm::StringRef(Cmd.getCreator().getName()) != "clang") {
Diags.Report(diag::err_fe_expected_clang_command);
return 1;
}
// Initialize a compiler invocation object from the clang (-cc1) arguments.
const llvm::opt::ArgStringList &CCArgs = Cmd.getArguments();
std::unique_ptr<CompilerInvocation> CI(new CompilerInvocation);
CompilerInvocation::CreateFromArgs(*CI, CCArgs, Diags);
// Show the invocation, with -v.
if (CI->getHeaderSearchOpts().Verbose) {
llvm::errs() << "clang invocation:\n";
Jobs.Print(llvm::errs(), "\n", true);
llvm::errs() << "\n";
}
// FIXME: This is copied from cc1_main.cpp; simplify and eliminate.
// Create a compiler instance to handle the actual work.
CompilerInstance Clang;
Clang.setInvocation(std::move(CI));
// Create the compilers actual diagnostics engine.
Clang.createDiagnostics();
if (!Clang.hasDiagnostics())
return 1;
// Infer the builtin include path if unspecified.
if (Clang.getHeaderSearchOpts().UseBuiltinIncludes &&
Clang.getHeaderSearchOpts().ResourceDir.empty())
Clang.getHeaderSearchOpts().ResourceDir =
CompilerInvocation::GetResourcesPath(argv[0], MainAddr);
// Create and execute the frontend to generate an LLVM bitcode module.
std::unique_ptr<CodeGenAction> Act(new EmitLLVMOnlyAction());
if (!Clang.ExecuteAction(*Act))
return 1;
llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter();
int Res = 255;
std::unique_ptr<llvm::LLVMContext> Ctx(Act->takeLLVMContext());
std::unique_ptr<llvm::Module> Module = Act->takeModule();
if (Module) {
auto J = ExitOnErr(llvm::orc::SimpleJIT::Create());
ExitOnErr(J->addModule(
llvm::orc::ThreadSafeModule(std::move(Module), std::move(Ctx))));
auto Main = (int (*)(...))ExitOnErr(J->getSymbolAddress("main"));
Res = Main();
}
// Shutdown.
llvm::llvm_shutdown();
return Res;
}
| {
"pile_set_name": "Github"
} |
var convert = require('./convert'),
func = convert('map', require('../map'));
func.placeholder = require('./placeholder');
module.exports = func;
| {
"pile_set_name": "Github"
} |
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDWMHOiUF+ORmZjAxI8MWE9dblb7gQSJ36WCXlPFiFx6ynF+S1E
kXAYpIip5X0pzDUaIbLukxJUAAnOtMEO0PCgxJQUrEtRWh8wiJdbdQJF0Zs/9R+u
SUgb61f+mdTQvhqefBGx+xrpfAcgtcWiZuSA9Q3fvpDj5WOWSPWXBUuxywIDAQAB
AoGBAJPxRX2gjFAGWmQbU/YVmXfNH6navh8X/nx9sLeqrpE0AFeJI/ZPiqDKzMal
B43eSfNxwVi+ZxN0L1ICUbL9KKZvHs/QBxWLA1fGVAXrz7sRplEVvakPpTfHoEnv
sKaMWVKaK/S5WGbDhElb6zb/Lwo19DsIAPjGYqFvzFJBmobJAkEA9iSeTGkR9X26
GywZoYrIMlRh34htOIRx1UUq88rFzdrCF21kQ4lhBIkX5OZMMy652i2gyak4OZTe
YewIv8jw9QJBAN7EQNHG8jPwXfVp91/fqxVQEfumuP2i6uiWWYQgZCmla2+0xcLZ
pMQ6sQEe10hhTrVnzHgAUVp50Ntn2jwBX78CQF09veGAI9d1Cxzj9cmmAvRd1r2Q
tp8kPOLnUsALXib+6WtqewLCdcf8DtsdClyRJMIraq85tRzK8fryKNZNzkkCQEgA
yS7FDj5JgCU15hZgFk1iPx3HCt44jZM2HaL+UUHAzRQjKxTLAl3G1rWVAWLMyQML
lORoveLvotl4HOruSsMCQQCAx9dV9JUSFoyc1CWILp/FgUH/se4cjQCThGO0DoQQ
vGTYmntY7j9WRJ9esQrjdD6Clw8zM/45GIBNwnXzqo7Z
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIICszCCAhwCCQD4jSkztmlO1TANBgkqhkiG9w0BAQsFADCBnTELMAkGA1UEBhMC
VVMxCzAJBgNVBAgTAklMMRIwEAYDVQQHEwlDaGFtcGFpZ24xDjAMBgNVBAoTBVlh
aG9vMQ0wCwYDVQQLEwRFZGdlMSgwJgYDVQQDEx9qdWljZXByb2R1Y2UuY29ycC5u
ZTEueWFob28uY29tMSQwIgYJKoZIhvcNAQkBFhVwZXJzaWEuYXppekB5YWhvby5j
b20wHhcNMTcwODI4MDM0NDQ1WhcNMjcwODI2MDM0NDQ1WjCBnTELMAkGA1UEBhMC
VVMxCzAJBgNVBAgTAklMMRIwEAYDVQQHEwlDaGFtcGFpZ24xDjAMBgNVBAoTBVlh
aG9vMQ0wCwYDVQQLEwRFZGdlMSgwJgYDVQQDEx9qdWljZXByb2R1Y2UuY29ycC5u
ZTEueWFob28uY29tMSQwIgYJKoZIhvcNAQkBFhVwZXJzaWEuYXppekB5YWhvby5j
b20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANYwc6JQX45GZmMDEjwxYT11
uVvuBBInfpYJeU8WIXHrKcX5LUSRcBikiKnlfSnMNRohsu6TElQACc60wQ7Q8KDE
lBSsS1FaHzCIl1t1AkXRmz/1H65JSBvrV/6Z1NC+Gp58EbH7Gul8ByC1xaJm5ID1
Dd++kOPlY5ZI9ZcFS7HLAgMBAAEwDQYJKoZIhvcNAQELBQADgYEATX7975NdhIbJ
glda+sXI9a86GgOpiuKO+vKubRJQZA+UlPf2vHEONjC2+7Y1aZvZYaKYL74vxGky
zkgp6ANSPl45lqD632x0e1Z7vzW5TkqK1JB2/xH2WgDcQZmP0FuQHzVNs4GjghDr
HCp1+sQDhfPB4aLmLFeyN0TkhdH1N3M=
-----END CERTIFICATE-----
| {
"pile_set_name": "Github"
} |
function Queue () {
this.head = new Item('head', null)
}
module.exports = Queue
Queue.prototype.append = function append (kind, value) {
var item = new Item(kind, value)
this.head.prepend(item)
return item
}
Queue.prototype.isEmpty = function isEmpty () {
return this.head.prev === this.head
}
Queue.prototype.first = function first () {
return this.head.next
}
function Item (kind, value) {
this.prev = this
this.next = this
this.kind = kind
this.value = value
}
Item.prototype.prepend = function prepend (other) {
other.prev = this.prev
other.next = this
other.prev.next = other
other.next.prev = other
}
Item.prototype.dequeue = function dequeue () {
var prev = this.prev
var next = this.next
prev.next = next
next.prev = prev
this.prev = this
this.next = this
return this.value
}
Item.prototype.isEmpty = function isEmpty () {
return this.prev === this
}
| {
"pile_set_name": "Github"
} |
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt)
ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
| {
"pile_set_name": "Github"
} |
<div>
If the remote API support is enabled in this Jira, you can set
a valid account information. This would allow projects to update
their issues whenever builds integrate those changes, by using
this configured account. Each project can choose whether to
actually update Jira via a selection in the publish section.
<br>
</div>
| {
"pile_set_name": "Github"
} |
from ray.rllib.utils.framework import try_import_torch
torch, nn = try_import_torch()
class SkipConnection(nn.Module):
"""Skip connection layer.
Adds the original input to the output (regular residual layer) OR uses
input as hidden state input to a given fan_in_layer.
"""
def __init__(self, layer, fan_in_layer=None, add_memory=False, **kwargs):
"""Initializes a SkipConnection nn Module object.
Args:
layer (nn.Module): Any layer processing inputs.
fan_in_layer (Optional[nn.Module]): An optional
layer taking two inputs: The original input and the output
of `layer`.
"""
super().__init__(**kwargs)
self._layer = layer
self._fan_in_layer = fan_in_layer
def forward(self, inputs, **kwargs):
# del kwargs
outputs = self._layer(inputs, **kwargs)
# Residual case, just add inputs to outputs.
if self._fan_in_layer is None:
outputs = outputs + inputs
# Fan-in e.g. RNN: Call fan-in with `inputs` and `outputs`.
else:
# NOTE: In the GRU case, `inputs` is the state input.
outputs = self._fan_in_layer((inputs, outputs))
return outputs
| {
"pile_set_name": "Github"
} |
# 前端开发规范手册
##### Github: [仓库地址](https://github.com/Aaaaaashu/Front-End-Style-Guide)
##### 知笔墨:[手册地址](http://zhibimo.com/read/Ashu/front-end-style-guide/)
此手册主要实现的目标:**代码一致性**和**最佳实践**。通过代码风格的一致性,降低维护代码的成本以及改善多人协作的效率。同时遵守最佳实践,确保页面性能得到最佳优化和高效的代码。
此手册是在开发中积累下来的经验和参考其它规范/指南制定的,它只是起指导作用,除个别条目强制之外,大多数为非强制约束,开发者可根据自己的实际情况自行决定是否要遵守
该指南只是保证大方向一致性和最佳实践的阶段性总结,不是最后结论,它会随着时间而变化。
## 目录
* [Introduction](http://zhibimo.com/read/Ashu/front-end-style-guide/)
* [基本原则](http://zhibimo.com/read/Ashu/front-end-style-guide/basic/index.html)
* HTML
* [通用约定](http://zhibimo.com/read/Ashu/front-end-style-guide/html/general.html)
* [语义化](http://zhibimo.com/read/Ashu/front-end-style-guide/html/semantic.html)
* [HEAD](http://zhibimo.com/read/Ashu/front-end-style-guide/html/head.html)
* CSS
* [通用约定](http://zhibimo.com/read/Ashu/front-end-style-guide/css/general.html)
* [字体排印](http://zhibimo.com/read/Ashu/front-end-style-guide/css/typography.html)
* [模块组织](http://zhibimo.com/read/Ashu/front-end-style-guide/css/structure.html)
* [Less 规范](http://zhibimo.com/read/Ashu/front-end-style-guide/css/less.html)
* [性能优化](http://zhibimo.com/read/Ashu/front-end-style-guide/css/performance.html)
* JavaScript
* [通用约定](http://zhibimo.com/read/Ashu/front-end-style-guide/javascript/general.html)
* [jQuery 规范](http://zhibimo.com/read/Ashu/front-end-style-guide/javascript/jquery.html)
* [性能优化](http://zhibimo.com/read/Ashu/front-end-style-guide/javascript/performance.html)
* [移动端优化](http://zhibimo.com/read/Ashu/front-end-style-guide/mobile-optimize/index.html)
* [工具箱](http://zhibimo.com/read/Ashu/front-end-style-guide/tool/index.html)
* [参考](http://zhibimo.com/read/Ashu/front-end-style-guide/reference/index.html)

| {
"pile_set_name": "Github"
} |
/*
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef RENDERER_OPTION_MODERN_OPENGL
#include "quakedef.h"
#include "gl_model.h"
#include "gl_local.h"
#include "gl_framebuffer.h"
#include "tr_types.h"
#include "glsl/constants.glsl"
#include "r_lighting.h"
#include "r_matrix.h"
#include "r_buffers.h"
#include "glm_local.h"
#include "r_renderer.h"
#include "gl_texture.h"
static uniform_block_frame_constants_t frameConstants;
static qbool frameConstantsUploaded = false;
void GLM_UploadFrameConstants(void);
#define PASS_COLOR_AS_4F(target, cvar) \
{ \
target[0] = (cvar.color[0] * 1.0f / 255); \
target[1] = (cvar.color[1] * 1.0f / 255); \
target[2] = (cvar.color[2] * 1.0f / 255); \
target[3] = 1.0f; \
}
// TODO: !? Called as first step in 2D. Include in frame-buffer at end of 3D scene rendering?
void GLM_PolyBlend(float v_blend[4])
{
color_t v_blend_color = RGBA_TO_COLOR(
bound(0, v_blend[0], 1) * 255,
bound(0, v_blend[1], 1) * 255,
bound(0, v_blend[2], 1) * 255,
bound(0, v_blend[3], 1) * 255
);
GLM_StateBeginPolyBlend();
Draw_AlphaRectangleRGB(r_refdef.vrect.x, r_refdef.vrect.y, r_refdef.vrect.width, r_refdef.vrect.height, 0.0f, true, v_blend_color);
}
void GLM_PreRenderView(void)
{
extern cvar_t gl_alphafont, gl_max_size;
extern cvar_t r_telecolor, r_lavacolor, r_slimecolor, r_watercolor, r_fastturb, r_skycolor;
extern cvar_t gl_textureless, gl_hwblend;
int i, active_lights = 0;
float blend_alpha;
// General constants
frameConstants.time = cl.time;
frameConstants.gamma = bound(0.3, v_gamma.value, 3);
frameConstants.contrast = bound(1, v_contrast.value, 3);
frameConstants.r_alphatestfont = gl_alphafont.integer ? 0 : 1;
blend_alpha = (!vid_hwgamma_enabled || !gl_hwblend.value || cl.teamfortress) ? 0 : v_blend[3];
frameConstants.v_blend[0] = v_blend[0] * blend_alpha;
frameConstants.v_blend[1] = v_blend[1] * blend_alpha;
frameConstants.v_blend[2] = v_blend[2] * blend_alpha;
frameConstants.v_blend[3] = 1 - blend_alpha;
// Lights
for (i = 0; i < MAX_DLIGHTS; ++i) {
if (cl_dlight_active[i / 32] & (1 << (i % 32))) {
extern cvar_t gl_colorlights;
dlight_t* light = &cl_dlights[i];
float* lightColor = frameConstants.lightColor[active_lights];
float* lightPosition = frameConstants.lightPosition[active_lights];
VectorCopy(light->origin, lightPosition);
lightPosition[3] = light->radius;
if (gl_colorlights.integer) {
if (light->type == lt_custom) {
lightColor[0] = light->color[0] / 255.0;
lightColor[1] = light->color[1] / 255.0;
lightColor[2] = light->color[2] / 255.0;
}
else {
lightColor[0] = dlightcolor[light->type][0] / 255.0;
lightColor[1] = dlightcolor[light->type][1] / 255.0;
lightColor[2] = dlightcolor[light->type][2] / 255.0;
}
}
else {
lightColor[0] = lightColor[1] = lightColor[2] = 0.5;
}
lightColor[3] = light->minlight;
++active_lights;
}
}
frameConstants.lightsActive = active_lights;
frameConstants.lightScale = ((lightmode == 2 ? 1.5 : 2) * bound(0.5, gl_modulate.value, 3));
// Draw-world constants
frameConstants.r_textureless = gl_textureless.integer || gl_max_size.integer == 1;
frameConstants.skySpeedscale = r_refdef2.time * 8;
frameConstants.skySpeedscale -= (int)frameConstants.skySpeedscale & ~127;
frameConstants.skySpeedscale /= 128.0f;
frameConstants.skySpeedscale2 = r_refdef2.time * 16;
frameConstants.skySpeedscale2 -= (int)frameConstants.skySpeedscale2 & ~127;
frameConstants.skySpeedscale2 /= 128.0f;
frameConstants.waterAlpha = R_WaterAlpha();
frameConstants.r_drawflat = r_drawflat.integer;
PASS_COLOR_AS_4F(frameConstants.r_wallcolor, r_wallcolor);
PASS_COLOR_AS_4F(frameConstants.r_floorcolor, r_floorcolor);
frameConstants.r_fastturb = r_fastturb.integer;
PASS_COLOR_AS_4F(frameConstants.r_telecolor, r_telecolor);
PASS_COLOR_AS_4F(frameConstants.r_lavacolor, r_lavacolor);
PASS_COLOR_AS_4F(frameConstants.r_slimecolor, r_slimecolor);
PASS_COLOR_AS_4F(frameConstants.r_watercolor, r_watercolor);
PASS_COLOR_AS_4F(frameConstants.r_skycolor, r_skycolor);
// Alias models
{
extern cvar_t gl_powerupshells_base1level, gl_powerupshells_base2level;
extern cvar_t gl_powerupshells_effect1level, gl_powerupshells_effect2level;
frameConstants.shellSize = 0.5f;
frameConstants.shell_base_level1 = gl_powerupshells_base1level.value;
frameConstants.shell_base_level2 = gl_powerupshells_base2level.value;
frameConstants.shell_effect_level1 = gl_powerupshells_effect1level.value;
frameConstants.shell_effect_level2 = gl_powerupshells_effect2level.value;
frameConstants.shell_alpha = bound(0, gl_powerupshells.value, 1);
}
// Window constants
frameConstants.r_width = glConfig.vidWidth;
frameConstants.r_height = glConfig.vidHeight;
frameConstants.r_zFar = R_FarPlaneZ();
frameConstants.r_zNear = R_NearPlaneZ();
frameConstantsUploaded = false;
}
void GLM_SetupGL(void)
{
memcpy(frameConstants.modelViewMatrix, R_ModelviewMatrix(), sizeof(frameConstants.modelViewMatrix));
memcpy(frameConstants.projectionMatrix, R_ProjectionMatrix(), sizeof(frameConstants.projectionMatrix));
VectorCopy(r_refdef.vieworg, frameConstants.position);
frameConstantsUploaded = false;
}
void GLM_UploadFrameConstants(void)
{
if (!frameConstantsUploaded) {
if (!R_BufferReferenceIsValid(r_buffer_frame_constants)) {
buffers.Create(r_buffer_frame_constants, buffertype_uniform, "frameConstants", sizeof(frameConstants), &frameConstants, bufferusage_once_per_frame);
}
buffers.BindRange(r_buffer_frame_constants, EZQ_GL_BINDINGPOINT_FRAMECONSTANTS, buffers.BufferOffset(r_buffer_frame_constants), sizeof(frameConstants));
buffers.Update(r_buffer_frame_constants, sizeof(frameConstants), &frameConstants);
frameConstantsUploaded = true;
}
}
void GLM_ScreenDrawStart(void)
{
GL_FramebufferScreenDrawStart();
}
void GLM_PostProcessScreen(void)
{
GL_FramebufferPostProcessScreen();
}
void GLM_Shutdown(qbool restarting)
{
renderer.ProgramsShutdown(restarting);
GL_DeleteSamplers();
}
#endif
| {
"pile_set_name": "Github"
} |
package com.tencent.mm.d.a;
import android.content.Context;
public final class h$a
{
public int actionCode;
public String asf;
public boolean asg;
public boolean ash;
public Context context;
}
/* Location:
* Qualified Name: com.tencent.mm.d.a.h.a
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | {
"pile_set_name": "Github"
} |
digraph txn_coordinator{
node[shape=box;];
newrank=true;
rankdir=LR;
subgraph cluster_zkClient {
graph[label="zkClient";fontsize=20;style=rounded];
zk_getDataAndVersion -> ProducerIdBlockZNode;
conditionalUpdatePath;
};
subgraph cluster_PorudcerIdManager {
graph[label="PorudcerIdManager";fontsize=20;style=rounded];
producerIdManager_shutdown[
shape="record";
label="{{
shutdown|
打印nextProducerId\l
}}";
];
generateProducerId[shape="record";
label="{{
generateProducerId|
生成唯一producerId\l
}}";
];
getNewProducerIdBlock[shape="record";
label="{{
getNewProducerIdBlock|
从zk中获取新的一段\lproducerId范围\l
}}";
];
generateProducerId ->{
currentProducerIdBlock;
getNewProducerIdBlock;
}
getNewProducerIdBlock -> {
zk_getDataAndVersion;
parseProducerIdBlockData;
generateProducerIdBlockJson;
conditionalUpdatePath;
}
};
subgraph cluster_TranscationMetaData {
graph[label="TranscationMetaData";fontsize=20;style=rounded];
TranscationMetaData;
prepareIncrementProducerEpoch;
prepareAddPartitions -> { prepareTransitionTo; };
pendingState[
fillcolor="#95e1d3"
style=filled;
shape=box3d;
label="pendingState"
];
prepareTransitionTo -> {
validPreviousStates;
pendingState;
}
};
subgraph cluster_ReplicaManager {
graph[label="ReplicaManager";fontsize=20;];
appendRecords[shape="record";
label="{{
appendRecords|
向topic中写入日志\l
}}";
];
}
subgraph cluster_TranscationStateManager {
graph[label="TranscationStateManager";fontsize=20;style=rounded];
getTransactionState;
appendTransactionToLog[shape="record";
label="{{
appendTransactionToLog|
将日志写入TRANSCATION_\lSTATE_TOPIC_NAME topic中\l
}}";
];
partitionFor[shape="record";
label="{{
partitionFor|
根据transitionId\l
获取相应的partition\l
}}";
];
transactionMetadataCache[shape="record";
fillcolor="#95e1d3"
style=filled;
label="{{
transactionMetadataCache|
field \l
}}";
];
putTransactionStateIfNotExists -> getAndMaybeAddTransactionState;
getTransactionState -> getAndMaybeAddTransactionState;
getAndMaybeAddTransactionState -> {
cacheEntry;
loadingPartitions;
leavingPartitions;
transactionMetadataCache;
}
appendTransactionToLog -> {
partitionFor
keyToBytes;
valueToBytes;
getTransactionState;
appendRecords;
}
prepareIncrementProducerEpoch -> {
}
};
subgraph cluster_TranscationCoordinator {
graph[label="TranscationCoordinator";fontsize=20;style=rounded];
handleInitProducerId -> {
generateProducerId;
getTransactionState;
putTransactionStateIfNotExists;
TranscationMetaData;
handleEndTransaction;
appendTransactionToLog;
prepareInitProducerIdTransit;
}
handleAddPartitionsToTransaction -> {
getTransactionState;
prepareAddPartitions;
appendTransactionToLog;
}
handleTxnEmigration -> {
removeMarkersForTxnTopicPartition;
removeTransactionsForTxnTopicPartition;
}
handleTxnImmigration -> {
removeMarkersForTxnTopicPartition;
loadTransactionsForTxnTopicPartition;
}
handleEndTransaction -> {
logInvalidStateTransitionAndReturnError;
addTxnMarkersToSend;
appendTransactionToLog;
}
startup -> schedule -> abortTimedOutTransactions;
startup -> {
txnMarkerChannelManager_start
}
shutdown -> {
scheduler_shutdown;
producerIdManager_shutdown;
txnManager_shutdown;
txnMarkerChannelManager_shutdown;
}
prepareInitProducerIdTransit -> {
prepareIncrementProducerEpoch;
prepareProducerIdRotation;
isProducerEpochExhausted;
}
}
subgraph cluster_KafkaApi {
graph[label="KafkaApi";fontsize=20;];
handle -> {
handleInitProducerId;
handleEndTxnRequest;
handleTxnOffsetCommitRequest;
handleAddPartitionToTxnRequest;
}
handleEndTxnRequest -> handleEndTransaction;
handleAddPartitionToTxnRequest -> handleAddPartitionsToTransaction;
}
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/ruby
require 'FileUtils'
require 'settings.rb'
require 'skipped.rb'
require '../../rules/util.rb'
BUILD_DIR = 'build'
MOSYNCDIR = ENV['MOSYNCDIR']
GCC_FLAGS = " -I. -I#{MOSYNCDIR}/include -DNO_TRAMPOLINES"
PIPE_FLAGS = " -datasize=#{2*1024*1024} -stacksize=#{512*1024} -heapsize=#{1024*1024}"
PIPE_LIBS = " #{MOSYNCDIR}/lib/pipe_debug/mastd.lib"
# SETTINGS[:source_path] - directory in which source files are stored.
# use Work to build the tests?
# build them directly with command-line gcc & pipe-tool. no dependency or flags handling this way, but it would be faster.
# compile all tests
FileUtils.mkdir_p(BUILD_DIR)
sh "#{MOSYNCDIR}/bin/xgcc -g -S helpers/helpers.c -o build/helpers.s#{GCC_FLAGS}"
pattern = SETTINGS[:source_path] + '/*.c'
pattern.gsub!("\\", '/')
puts pattern
files = Dir.glob(pattern)
puts "#{files.count} files to test:"
def delete_if_empty(filename)
if(!File.size?(filename))
if(File.exists?(filename))
FileUtils.rm(filename)
end
end
end
def link_and_test(ofn, dead_code, force_rebuild)
suffix = dead_code ? 'e' : ''
pfn = ofn.ext('.moo' + suffix)
winFile = ofn.ext('.win' + suffix)
failFile = ofn.ext('.fail' + suffix)
logFile = ofn.ext('.log' + suffix)
mdsFile = ofn.ext('.md.s')
esFile = ofn.ext('.e.s')
sldFile = ofn.ext('.sld' + suffix)
stabsFile = ofn.ext('.stabs' + suffix)
delete_if_empty(pfn)
# link
if(!File.exists?(pfn) || force_rebuild)
if(dead_code)
sh "pipe-tool#{PIPE_FLAGS} -elim -master-dump -B #{pfn} #{ofn} build/helpers.s#{PIPE_LIBS}"
sh "pipe-tool#{PIPE_FLAGS} -sld=#{sldFile} -B #{pfn} rebuild.s"
else
sh "pipe-tool -master-dump -sld=#{sldFile} -stabs=#{stabsFile}#{PIPE_FLAGS} -B #{pfn} #{ofn} build/helpers.s#{PIPE_LIBS}"
end
force_rebuild = true
end
delete_if_empty(pfn)
if(!File.exists?(pfn))
error"Unknown link failure."
end
# execute it, if not win already, or we rebuilt something.
if((File.exists?(winFile) || !SETTINGS[:retry_failed]) && !force_rebuild)
return force_rebuild
end
cmd = "#{MOSYNCDIR}/bin/more -noscreen -program #{pfn} -sld #{sldFile}"
$stderr.puts cmd
res = system(cmd)
puts res
if(res == true) # success
FileUtils.touch(winFile)
FileUtils.rm_f(failFile)
FileUtils.rm_f(logFile)
FileUtils.rm_f(mdsFile)
FileUtils.rm_f(esFile)
FileUtils.rm_f(sldFile)
FileUtils.rm_f(stabsFile)
else # failure
FileUtils.touch(failFile)
FileUtils.rm_f(winFile)
FileUtils.mv('log.txt', logFile) if(File.exists?('log.txt'))
FileUtils.mv('_masterdump.s', mdsFile) if(File.exists?('_masterdump.s'))
FileUtils.mv('rebuild.s', esFile) if(File.exists?('rebuild.s'))
if(SETTINGS[:stop_on_fail])
error "Stop on fail"
end
end
return force_rebuild
end
files.each do |filename|
bn = File.basename(filename)
if(SKIPPED.include?(bn))
puts "Skipped #{bn}"
next
end
puts bn
ofn = BUILD_DIR + '/' + bn.ext('.s')
force_rebuild |= SETTINGS[:rebuild_failed] && (File.exists?(ofn.ext('.fail')) || File.exists?(ofn.ext('.faile')))
# compile
if(!File.exists?(ofn) || force_rebuild)
if(bn == 'conversion.c')
# avoid testing long longs, as they are not yet properly supported by MoSync.
extra_flags = ' -U __GNUC__'
end
sh "#{MOSYNCDIR}/bin/xgcc -g -S \"#{filename}\" -o #{ofn}#{GCC_FLAGS}#{extra_flags}"
force_rebuild = true
end
force_rebuild = link_and_test(ofn, false, force_rebuild)
link_and_test(ofn, true, force_rebuild) if(SETTINGS[:test_dce])
end
| {
"pile_set_name": "Github"
} |
export { default } from './DataTableSearch';
export * from './DataTableSearch'; | {
"pile_set_name": "Github"
} |
/**
* Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/>
* Build: `lodash modularize underscore exports="node" -o ./underscore/`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <http://lodash.com/license>
*/
/** Used to escape characters for inclusion in compiled string literals */
var stringEscapes = {
'\\': '\\',
"'": "'",
'\n': 'n',
'\r': 'r',
'\t': 't',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
/**
* Used by `template` to escape characters for inclusion in compiled
* string literals.
*
* @private
* @param {string} match The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeStringChar(match) {
return '\\' + stringEscapes[match];
}
module.exports = escapeStringChar;
| {
"pile_set_name": "Github"
} |
## @file
# Component description file for EFI Shell module.
#
# This is a binary module containing multiple binary shell applications.
# All .efi file tagged with "ToolCode="DUMMY"" in following file list are raw EFI application
# file, and they are can be run in shell environment.
# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = Shell_Full
FILE_GUID = c57ad6b8-0515-40a8-9d21-551652854e37
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.1
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64
#
[Binaries.Ia32]
PE32|Shell32.efi|*
[Binaries.X64]
PE32|Shell64U.efi|*
| {
"pile_set_name": "Github"
} |
WARNING.*shadow.*
| {
"pile_set_name": "Github"
} |
/*
* Driver for C-Media's CMI8330 and CMI8329 soundcards.
* Copyright (c) by George Talusan <gstalusan@uwaterloo.ca>
* http://www.undergrad.math.uwaterloo.ca/~gstalusa
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/*
* NOTES
*
* The extended registers contain mixer settings which are largely
* untapped for the time being.
*
* MPU401 and SPDIF are not supported yet. I don't have the hardware
* to aid in coding and testing, so I won't bother.
*
* To quickly load the module,
*
* modprobe -a snd-cmi8330 sbport=0x220 sbirq=5 sbdma8=1
* sbdma16=5 wssport=0x530 wssirq=11 wssdma=0 fmport=0x388
*
* This card has two mixers and two PCM devices. I've cheesed it such
* that recording and playback can be done through the same device.
* The driver "magically" routes the capturing to the AD1848 codec,
* and playback to the SB16 codec. This allows for full-duplex mode
* to some extent.
* The utilities in alsa-utils are aware of both devices, so passing
* the appropriate parameters to amixer and alsactl will give you
* full control over both mixers.
*/
#include <linux/init.h>
#include <linux/err.h>
#include <linux/isa.h>
#include <linux/pnp.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/wss.h>
#include <sound/opl3.h>
#include <sound/mpu401.h>
#include <sound/sb.h>
#include <sound/initval.h>
/*
*/
/* #define ENABLE_SB_MIXER */
#define PLAYBACK_ON_SB
/*
*/
MODULE_AUTHOR("George Talusan <gstalusan@uwaterloo.ca>");
MODULE_DESCRIPTION("C-Media CMI8330/CMI8329");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8330,isapnp:{CMI0001,@@@0001,@X@0001}}}");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;
#ifdef CONFIG_PNP
static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
#endif
static long sbport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
static int sbirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
static int sbdma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
static int sbdma16[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
static long wssport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
static int wssirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
static int wssdma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
static long fmport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
static long mpuport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
static int mpuirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for CMI8330/CMI8329 soundcard.");
module_param_array(id, charp, NULL, 0444);
MODULE_PARM_DESC(id, "ID string for CMI8330/CMI8329 soundcard.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable CMI8330/CMI8329 soundcard.");
#ifdef CONFIG_PNP
module_param_array(isapnp, bool, NULL, 0444);
MODULE_PARM_DESC(isapnp, "PnP detection for specified soundcard.");
#endif
module_param_array(sbport, long, NULL, 0444);
MODULE_PARM_DESC(sbport, "Port # for CMI8330/CMI8329 SB driver.");
module_param_array(sbirq, int, NULL, 0444);
MODULE_PARM_DESC(sbirq, "IRQ # for CMI8330/CMI8329 SB driver.");
module_param_array(sbdma8, int, NULL, 0444);
MODULE_PARM_DESC(sbdma8, "DMA8 for CMI8330/CMI8329 SB driver.");
module_param_array(sbdma16, int, NULL, 0444);
MODULE_PARM_DESC(sbdma16, "DMA16 for CMI8330/CMI8329 SB driver.");
module_param_array(wssport, long, NULL, 0444);
MODULE_PARM_DESC(wssport, "Port # for CMI8330/CMI8329 WSS driver.");
module_param_array(wssirq, int, NULL, 0444);
MODULE_PARM_DESC(wssirq, "IRQ # for CMI8330/CMI8329 WSS driver.");
module_param_array(wssdma, int, NULL, 0444);
MODULE_PARM_DESC(wssdma, "DMA for CMI8330/CMI8329 WSS driver.");
module_param_array(fmport, long, NULL, 0444);
MODULE_PARM_DESC(fmport, "FM port # for CMI8330/CMI8329 driver.");
module_param_array(mpuport, long, NULL, 0444);
MODULE_PARM_DESC(mpuport, "MPU-401 port # for CMI8330/CMI8329 driver.");
module_param_array(mpuirq, int, NULL, 0444);
MODULE_PARM_DESC(mpuirq, "IRQ # for CMI8330/CMI8329 MPU-401 port.");
#ifdef CONFIG_PNP
static int isa_registered;
static int pnp_registered;
#endif
#define CMI8330_RMUX3D 16
#define CMI8330_MUTEMUX 17
#define CMI8330_OUTPUTVOL 18
#define CMI8330_MASTVOL 19
#define CMI8330_LINVOL 20
#define CMI8330_CDINVOL 21
#define CMI8330_WAVVOL 22
#define CMI8330_RECMUX 23
#define CMI8330_WAVGAIN 24
#define CMI8330_LINGAIN 25
#define CMI8330_CDINGAIN 26
static unsigned char snd_cmi8330_image[((CMI8330_CDINGAIN)-16) + 1] =
{
0x40, /* 16 - recording mux (SB-mixer-enabled) */
#ifdef ENABLE_SB_MIXER
0x40, /* 17 - mute mux (Mode2) */
#else
0x0, /* 17 - mute mux */
#endif
0x0, /* 18 - vol */
0x0, /* 19 - master volume */
0x0, /* 20 - line-in volume */
0x0, /* 21 - cd-in volume */
0x0, /* 22 - wave volume */
0x0, /* 23 - mute/rec mux */
0x0, /* 24 - wave rec gain */
0x0, /* 25 - line-in rec gain */
0x0 /* 26 - cd-in rec gain */
};
typedef int (*snd_pcm_open_callback_t)(struct snd_pcm_substream *);
enum card_type {
CMI8330,
CMI8329
};
struct snd_cmi8330 {
#ifdef CONFIG_PNP
struct pnp_dev *cap;
struct pnp_dev *play;
struct pnp_dev *mpu;
#endif
struct snd_card *card;
struct snd_wss *wss;
struct snd_sb *sb;
struct snd_pcm *pcm;
struct snd_cmi8330_stream {
struct snd_pcm_ops ops;
snd_pcm_open_callback_t open;
void *private_data; /* sb or wss */
} streams[2];
enum card_type type;
};
#ifdef CONFIG_PNP
static struct pnp_card_device_id snd_cmi8330_pnpids[] = {
{ .id = "CMI0001", .devs = { { "@X@0001" }, { "@@@0001" }, { "@H@0001" }, { "A@@0001" } } },
{ .id = "CMI0001", .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } } },
{ .id = "" }
};
MODULE_DEVICE_TABLE(pnp_card, snd_cmi8330_pnpids);
#endif
static struct snd_kcontrol_new snd_cmi8330_controls[] = {
WSS_DOUBLE("Master Playback Volume", 0,
CMI8330_MASTVOL, CMI8330_MASTVOL, 4, 0, 15, 0),
WSS_SINGLE("Loud Playback Switch", 0,
CMI8330_MUTEMUX, 6, 1, 1),
WSS_DOUBLE("PCM Playback Switch", 0,
CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1),
WSS_DOUBLE("PCM Playback Volume", 0,
CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1),
WSS_DOUBLE("Line Playback Switch", 0,
CMI8330_MUTEMUX, CMI8330_MUTEMUX, 4, 3, 1, 0),
WSS_DOUBLE("Line Playback Volume", 0,
CMI8330_LINVOL, CMI8330_LINVOL, 4, 0, 15, 0),
WSS_DOUBLE("Line Capture Switch", 0,
CMI8330_RMUX3D, CMI8330_RMUX3D, 2, 1, 1, 0),
WSS_DOUBLE("Line Capture Volume", 0,
CMI8330_LINGAIN, CMI8330_LINGAIN, 4, 0, 15, 0),
WSS_DOUBLE("CD Playback Switch", 0,
CMI8330_MUTEMUX, CMI8330_MUTEMUX, 2, 1, 1, 0),
WSS_DOUBLE("CD Capture Switch", 0,
CMI8330_RMUX3D, CMI8330_RMUX3D, 4, 3, 1, 0),
WSS_DOUBLE("CD Playback Volume", 0,
CMI8330_CDINVOL, CMI8330_CDINVOL, 4, 0, 15, 0),
WSS_DOUBLE("CD Capture Volume", 0,
CMI8330_CDINGAIN, CMI8330_CDINGAIN, 4, 0, 15, 0),
WSS_SINGLE("Mic Playback Switch", 0,
CMI8330_MUTEMUX, 0, 1, 0),
WSS_SINGLE("Mic Playback Volume", 0,
CMI8330_OUTPUTVOL, 0, 7, 0),
WSS_SINGLE("Mic Capture Switch", 0,
CMI8330_RMUX3D, 0, 1, 0),
WSS_SINGLE("Mic Capture Volume", 0,
CMI8330_OUTPUTVOL, 5, 7, 0),
WSS_DOUBLE("Wavetable Playback Switch", 0,
CMI8330_RECMUX, CMI8330_RECMUX, 1, 0, 1, 0),
WSS_DOUBLE("Wavetable Playback Volume", 0,
CMI8330_WAVVOL, CMI8330_WAVVOL, 4, 0, 15, 0),
WSS_DOUBLE("Wavetable Capture Switch", 0,
CMI8330_RECMUX, CMI8330_RECMUX, 5, 4, 1, 0),
WSS_DOUBLE("Wavetable Capture Volume", 0,
CMI8330_WAVGAIN, CMI8330_WAVGAIN, 4, 0, 15, 0),
WSS_SINGLE("3D Control - Switch", 0,
CMI8330_RMUX3D, 5, 1, 1),
WSS_SINGLE("Beep Playback Volume", 0,
CMI8330_OUTPUTVOL, 3, 3, 0),
WSS_DOUBLE("FM Playback Switch", 0,
CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1),
WSS_DOUBLE("FM Playback Volume", 0,
CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1),
WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", CAPTURE, SWITCH), 0,
CMI8330_RMUX3D, 7, 1, 1),
WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", PLAYBACK, SWITCH), 0,
CMI8330_MUTEMUX, 7, 1, 1),
};
#ifdef ENABLE_SB_MIXER
static struct sbmix_elem cmi8330_sb_mixers[] = {
SB_DOUBLE("SB Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31),
SB_DOUBLE("Tone Control - Bass", SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15),
SB_DOUBLE("Tone Control - Treble", SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15),
SB_DOUBLE("SB PCM Playback Volume", SB_DSP4_PCM_DEV, (SB_DSP4_PCM_DEV + 1), 3, 3, 31),
SB_DOUBLE("SB Synth Playback Volume", SB_DSP4_SYNTH_DEV, (SB_DSP4_SYNTH_DEV + 1), 3, 3, 31),
SB_DOUBLE("SB CD Playback Switch", SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 2, 1, 1),
SB_DOUBLE("SB CD Playback Volume", SB_DSP4_CD_DEV, (SB_DSP4_CD_DEV + 1), 3, 3, 31),
SB_DOUBLE("SB Line Playback Switch", SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 4, 3, 1),
SB_DOUBLE("SB Line Playback Volume", SB_DSP4_LINE_DEV, (SB_DSP4_LINE_DEV + 1), 3, 3, 31),
SB_SINGLE("SB Mic Playback Switch", SB_DSP4_OUTPUT_SW, 0, 1),
SB_SINGLE("SB Mic Playback Volume", SB_DSP4_MIC_DEV, 3, 31),
SB_SINGLE("SB Beep Volume", SB_DSP4_SPEAKER_DEV, 6, 3),
SB_DOUBLE("SB Capture Volume", SB_DSP4_IGAIN_DEV, (SB_DSP4_IGAIN_DEV + 1), 6, 6, 3),
SB_DOUBLE("SB Playback Volume", SB_DSP4_OGAIN_DEV, (SB_DSP4_OGAIN_DEV + 1), 6, 6, 3),
SB_SINGLE("SB Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1),
};
static unsigned char cmi8330_sb_init_values[][2] = {
{ SB_DSP4_MASTER_DEV + 0, 0 },
{ SB_DSP4_MASTER_DEV + 1, 0 },
{ SB_DSP4_PCM_DEV + 0, 0 },
{ SB_DSP4_PCM_DEV + 1, 0 },
{ SB_DSP4_SYNTH_DEV + 0, 0 },
{ SB_DSP4_SYNTH_DEV + 1, 0 },
{ SB_DSP4_INPUT_LEFT, 0 },
{ SB_DSP4_INPUT_RIGHT, 0 },
{ SB_DSP4_OUTPUT_SW, 0 },
{ SB_DSP4_SPEAKER_DEV, 0 },
};
static int cmi8330_add_sb_mixers(struct snd_sb *chip)
{
int idx, err;
unsigned long flags;
spin_lock_irqsave(&chip->mixer_lock, flags);
snd_sbmixer_write(chip, 0x00, 0x00); /* mixer reset */
spin_unlock_irqrestore(&chip->mixer_lock, flags);
/* mute and zero volume channels */
for (idx = 0; idx < ARRAY_SIZE(cmi8330_sb_init_values); idx++) {
spin_lock_irqsave(&chip->mixer_lock, flags);
snd_sbmixer_write(chip, cmi8330_sb_init_values[idx][0],
cmi8330_sb_init_values[idx][1]);
spin_unlock_irqrestore(&chip->mixer_lock, flags);
}
for (idx = 0; idx < ARRAY_SIZE(cmi8330_sb_mixers); idx++) {
if ((err = snd_sbmixer_add_ctl_elem(chip, &cmi8330_sb_mixers[idx])) < 0)
return err;
}
return 0;
}
#endif
static int snd_cmi8330_mixer(struct snd_card *card, struct snd_cmi8330 *acard)
{
unsigned int idx;
int err;
strcpy(card->mixername, (acard->type == CMI8329) ? "CMI8329" : "CMI8330/C3D");
for (idx = 0; idx < ARRAY_SIZE(snd_cmi8330_controls); idx++) {
err = snd_ctl_add(card,
snd_ctl_new1(&snd_cmi8330_controls[idx],
acard->wss));
if (err < 0)
return err;
}
#ifdef ENABLE_SB_MIXER
if ((err = cmi8330_add_sb_mixers(acard->sb)) < 0)
return err;
#endif
return 0;
}
#ifdef CONFIG_PNP
static int snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard,
struct pnp_card_link *card,
const struct pnp_card_device_id *id)
{
struct pnp_dev *pdev;
int err;
/* CMI8329 has a device with ID A@@0001, CMI8330 does not */
acard->type = (id->devs[3].id[0]) ? CMI8329 : CMI8330;
acard->cap = pnp_request_card_device(card, id->devs[0].id, NULL);
if (acard->cap == NULL)
return -EBUSY;
acard->play = pnp_request_card_device(card, id->devs[1].id, NULL);
if (acard->play == NULL)
return -EBUSY;
acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL);
if (acard->mpu == NULL)
return -EBUSY;
pdev = acard->cap;
err = pnp_activate_dev(pdev);
if (err < 0) {
snd_printk(KERN_ERR "AD1848 PnP configure failure\n");
return -EBUSY;
}
wssport[dev] = pnp_port_start(pdev, 0);
wssdma[dev] = pnp_dma(pdev, 0);
wssirq[dev] = pnp_irq(pdev, 0);
if (pnp_port_start(pdev, 1))
fmport[dev] = pnp_port_start(pdev, 1);
/* allocate SB16 resources */
pdev = acard->play;
err = pnp_activate_dev(pdev);
if (err < 0) {
snd_printk(KERN_ERR "SB16 PnP configure failure\n");
return -EBUSY;
}
sbport[dev] = pnp_port_start(pdev, 0);
sbdma8[dev] = pnp_dma(pdev, 0);
sbdma16[dev] = pnp_dma(pdev, 1);
sbirq[dev] = pnp_irq(pdev, 0);
/* On CMI8239, the OPL3 port might be present in SB16 PnP resources */
if (fmport[dev] == SNDRV_AUTO_PORT) {
if (pnp_port_start(pdev, 1))
fmport[dev] = pnp_port_start(pdev, 1);
else
fmport[dev] = 0x388; /* Or hardwired */
}
/* allocate MPU-401 resources */
pdev = acard->mpu;
err = pnp_activate_dev(pdev);
if (err < 0)
snd_printk(KERN_ERR "MPU-401 PnP configure failure: will be disabled\n");
else {
mpuport[dev] = pnp_port_start(pdev, 0);
mpuirq[dev] = pnp_irq(pdev, 0);
}
return 0;
}
#endif
/*
* PCM interface
*
* since we call the different chip interfaces for playback and capture
* directions, we need a trick.
*
* - copy the ops for each direction into a local record.
* - replace the open callback with the new one, which replaces the
* substream->private_data with the corresponding chip instance
* and calls again the original open callback of the chip.
*
*/
#ifdef PLAYBACK_ON_SB
#define CMI_SB_STREAM SNDRV_PCM_STREAM_PLAYBACK
#define CMI_AD_STREAM SNDRV_PCM_STREAM_CAPTURE
#else
#define CMI_SB_STREAM SNDRV_PCM_STREAM_CAPTURE
#define CMI_AD_STREAM SNDRV_PCM_STREAM_PLAYBACK
#endif
static int snd_cmi8330_playback_open(struct snd_pcm_substream *substream)
{
struct snd_cmi8330 *chip = snd_pcm_substream_chip(substream);
/* replace the private_data and call the original open callback */
substream->private_data = chip->streams[SNDRV_PCM_STREAM_PLAYBACK].private_data;
return chip->streams[SNDRV_PCM_STREAM_PLAYBACK].open(substream);
}
static int snd_cmi8330_capture_open(struct snd_pcm_substream *substream)
{
struct snd_cmi8330 *chip = snd_pcm_substream_chip(substream);
/* replace the private_data and call the original open callback */
substream->private_data = chip->streams[SNDRV_PCM_STREAM_CAPTURE].private_data;
return chip->streams[SNDRV_PCM_STREAM_CAPTURE].open(substream);
}
static int snd_cmi8330_pcm(struct snd_card *card, struct snd_cmi8330 *chip)
{
struct snd_pcm *pcm;
const struct snd_pcm_ops *ops;
int err;
static snd_pcm_open_callback_t cmi_open_callbacks[2] = {
snd_cmi8330_playback_open,
snd_cmi8330_capture_open
};
if ((err = snd_pcm_new(card, (chip->type == CMI8329) ? "CMI8329" : "CMI8330", 0, 1, 1, &pcm)) < 0)
return err;
strcpy(pcm->name, (chip->type == CMI8329) ? "CMI8329" : "CMI8330");
pcm->private_data = chip;
/* SB16 */
ops = snd_sb16dsp_get_pcm_ops(CMI_SB_STREAM);
chip->streams[CMI_SB_STREAM].ops = *ops;
chip->streams[CMI_SB_STREAM].open = ops->open;
chip->streams[CMI_SB_STREAM].ops.open = cmi_open_callbacks[CMI_SB_STREAM];
chip->streams[CMI_SB_STREAM].private_data = chip->sb;
/* AD1848 */
ops = snd_wss_get_pcm_ops(CMI_AD_STREAM);
chip->streams[CMI_AD_STREAM].ops = *ops;
chip->streams[CMI_AD_STREAM].open = ops->open;
chip->streams[CMI_AD_STREAM].ops.open = cmi_open_callbacks[CMI_AD_STREAM];
chip->streams[CMI_AD_STREAM].private_data = chip->wss;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &chip->streams[SNDRV_PCM_STREAM_PLAYBACK].ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &chip->streams[SNDRV_PCM_STREAM_CAPTURE].ops);
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
snd_dma_isa_data(),
64*1024, 128*1024);
chip->pcm = pcm;
return 0;
}
#ifdef CONFIG_PM
static int snd_cmi8330_suspend(struct snd_card *card)
{
struct snd_cmi8330 *acard = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(acard->pcm);
acard->wss->suspend(acard->wss);
snd_sbmixer_suspend(acard->sb);
return 0;
}
static int snd_cmi8330_resume(struct snd_card *card)
{
struct snd_cmi8330 *acard = card->private_data;
snd_sbdsp_reset(acard->sb);
snd_sbmixer_suspend(acard->sb);
acard->wss->resume(acard->wss);
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif
/*
*/
#ifdef CONFIG_PNP
#define is_isapnp_selected(dev) isapnp[dev]
#else
#define is_isapnp_selected(dev) 0
#endif
#define PFX "cmi8330: "
static int snd_cmi8330_card_new(struct device *pdev, int dev,
struct snd_card **cardp)
{
struct snd_card *card;
struct snd_cmi8330 *acard;
int err;
err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_cmi8330), &card);
if (err < 0) {
snd_printk(KERN_ERR PFX "could not get a new card\n");
return err;
}
acard = card->private_data;
acard->card = card;
*cardp = card;
return 0;
}
static int snd_cmi8330_probe(struct snd_card *card, int dev)
{
struct snd_cmi8330 *acard;
int i, err;
struct snd_opl3 *opl3;
acard = card->private_data;
err = snd_wss_create(card, wssport[dev] + 4, -1,
wssirq[dev],
wssdma[dev], -1,
WSS_HW_DETECT, 0, &acard->wss);
if (err < 0) {
snd_printk(KERN_ERR PFX "AD1848 device busy??\n");
return err;
}
if (acard->wss->hardware != WSS_HW_CMI8330) {
snd_printk(KERN_ERR PFX "AD1848 not found during probe\n");
return -ENODEV;
}
if ((err = snd_sbdsp_create(card, sbport[dev],
sbirq[dev],
snd_sb16dsp_interrupt,
sbdma8[dev],
sbdma16[dev],
SB_HW_AUTO, &acard->sb)) < 0) {
snd_printk(KERN_ERR PFX "SB16 device busy??\n");
return err;
}
if (acard->sb->hardware != SB_HW_16) {
snd_printk(KERN_ERR PFX "SB16 not found during probe\n");
return err;
}
snd_wss_out(acard->wss, CS4231_MISC_INFO, 0x40); /* switch on MODE2 */
for (i = CMI8330_RMUX3D; i <= CMI8330_CDINGAIN; i++)
snd_wss_out(acard->wss, i,
snd_cmi8330_image[i - CMI8330_RMUX3D]);
if ((err = snd_cmi8330_mixer(card, acard)) < 0) {
snd_printk(KERN_ERR PFX "failed to create mixers\n");
return err;
}
if ((err = snd_cmi8330_pcm(card, acard)) < 0) {
snd_printk(KERN_ERR PFX "failed to create pcms\n");
return err;
}
if (fmport[dev] != SNDRV_AUTO_PORT) {
if (snd_opl3_create(card,
fmport[dev], fmport[dev] + 2,
OPL3_HW_AUTO, 0, &opl3) < 0) {
snd_printk(KERN_ERR PFX
"no OPL device at 0x%lx-0x%lx ?\n",
fmport[dev], fmport[dev] + 2);
} else {
err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
if (err < 0)
return err;
}
}
if (mpuport[dev] != SNDRV_AUTO_PORT) {
if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
mpuport[dev], 0, mpuirq[dev],
NULL) < 0)
printk(KERN_ERR PFX "no MPU-401 device at 0x%lx.\n",
mpuport[dev]);
}
strcpy(card->driver, (acard->type == CMI8329) ? "CMI8329" : "CMI8330/C3D");
strcpy(card->shortname, (acard->type == CMI8329) ? "C-Media CMI8329" : "C-Media CMI8330/C3D");
sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
card->shortname,
acard->wss->port,
wssirq[dev],
wssdma[dev]);
return snd_card_register(card);
}
static int snd_cmi8330_isa_match(struct device *pdev,
unsigned int dev)
{
if (!enable[dev] || is_isapnp_selected(dev))
return 0;
if (wssport[dev] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR PFX "specify wssport\n");
return 0;
}
if (sbport[dev] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR PFX "specify sbport\n");
return 0;
}
return 1;
}
static int snd_cmi8330_isa_probe(struct device *pdev,
unsigned int dev)
{
struct snd_card *card;
int err;
err = snd_cmi8330_card_new(pdev, dev, &card);
if (err < 0)
return err;
if ((err = snd_cmi8330_probe(card, dev)) < 0) {
snd_card_free(card);
return err;
}
dev_set_drvdata(pdev, card);
return 0;
}
static int snd_cmi8330_isa_remove(struct device *devptr,
unsigned int dev)
{
snd_card_free(dev_get_drvdata(devptr));
return 0;
}
#ifdef CONFIG_PM
static int snd_cmi8330_isa_suspend(struct device *dev, unsigned int n,
pm_message_t state)
{
return snd_cmi8330_suspend(dev_get_drvdata(dev));
}
static int snd_cmi8330_isa_resume(struct device *dev, unsigned int n)
{
return snd_cmi8330_resume(dev_get_drvdata(dev));
}
#endif
#define DEV_NAME "cmi8330"
static struct isa_driver snd_cmi8330_driver = {
.match = snd_cmi8330_isa_match,
.probe = snd_cmi8330_isa_probe,
.remove = snd_cmi8330_isa_remove,
#ifdef CONFIG_PM
.suspend = snd_cmi8330_isa_suspend,
.resume = snd_cmi8330_isa_resume,
#endif
.driver = {
.name = DEV_NAME
},
};
#ifdef CONFIG_PNP
static int snd_cmi8330_pnp_detect(struct pnp_card_link *pcard,
const struct pnp_card_device_id *pid)
{
static int dev;
struct snd_card *card;
int res;
for ( ; dev < SNDRV_CARDS; dev++) {
if (enable[dev] && isapnp[dev])
break;
}
if (dev >= SNDRV_CARDS)
return -ENODEV;
res = snd_cmi8330_card_new(&pcard->card->dev, dev, &card);
if (res < 0)
return res;
if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) {
snd_printk(KERN_ERR PFX "PnP detection failed\n");
snd_card_free(card);
return res;
}
if ((res = snd_cmi8330_probe(card, dev)) < 0) {
snd_card_free(card);
return res;
}
pnp_set_card_drvdata(pcard, card);
dev++;
return 0;
}
static void snd_cmi8330_pnp_remove(struct pnp_card_link *pcard)
{
snd_card_free(pnp_get_card_drvdata(pcard));
pnp_set_card_drvdata(pcard, NULL);
}
#ifdef CONFIG_PM
static int snd_cmi8330_pnp_suspend(struct pnp_card_link *pcard, pm_message_t state)
{
return snd_cmi8330_suspend(pnp_get_card_drvdata(pcard));
}
static int snd_cmi8330_pnp_resume(struct pnp_card_link *pcard)
{
return snd_cmi8330_resume(pnp_get_card_drvdata(pcard));
}
#endif
static struct pnp_card_driver cmi8330_pnpc_driver = {
.flags = PNP_DRIVER_RES_DISABLE,
.name = "cmi8330",
.id_table = snd_cmi8330_pnpids,
.probe = snd_cmi8330_pnp_detect,
.remove = snd_cmi8330_pnp_remove,
#ifdef CONFIG_PM
.suspend = snd_cmi8330_pnp_suspend,
.resume = snd_cmi8330_pnp_resume,
#endif
};
#endif /* CONFIG_PNP */
static int __init alsa_card_cmi8330_init(void)
{
int err;
err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS);
#ifdef CONFIG_PNP
if (!err)
isa_registered = 1;
err = pnp_register_card_driver(&cmi8330_pnpc_driver);
if (!err)
pnp_registered = 1;
if (isa_registered)
err = 0;
#endif
return err;
}
static void __exit alsa_card_cmi8330_exit(void)
{
#ifdef CONFIG_PNP
if (pnp_registered)
pnp_unregister_card_driver(&cmi8330_pnpc_driver);
if (isa_registered)
#endif
isa_unregister_driver(&snd_cmi8330_driver);
}
module_init(alsa_card_cmi8330_init)
module_exit(alsa_card_cmi8330_exit)
| {
"pile_set_name": "Github"
} |
require "net/smtp"
require "timeout"
class Heartbeat < Sinatra::Base
get "" do
content_type :json
{ services: services,
version: Lagotto::VERSION,
status: human_status(services_up?) }.to_json
end
def services
{ mysql: human_status(mysql_up?),
memcached: human_status(memcached_up?),
redis: human_status(redis_up?),
sidekiq: human_status(sidekiq_up?) }
end
def human_status(service)
service ? "OK" : "failed"
end
def services_up?
[mysql_up?, memcached_up?, redis_up?, sidekiq_up?].all?
end
def mysql_up?
Mysql2::Client.new(
host: ENV["DB_HOST"],
port: ENV["DB_PORT"],
username: ENV["DB_USERNAME"],
password: ENV["DB_PASSWORD"]
)
true
rescue
false
end
def memcached_up?
host = ENV["MEMCACHE_SERVERS"] || ENV["HOSTNAME"]
memcached_client = Dalli::Client.new("#{host}:11211")
memcached_client.alive!
true
rescue
false
end
def redis_up?
redis_client = Redis.new
redis_client.ping == "PONG"
rescue
false
end
def sidekiq_up?
sidekiq_client = Sidekiq::ProcessSet.new
sidekiq_client.size > 0
rescue
false
end
end
| {
"pile_set_name": "Github"
} |
import React from "react";
import qs from "query-string";
import ReactPlayer from "react-player";
import InstagramEmbed from "react-instagram-embed";
import { Markdown } from "/utils";
export const Expando = ({
expanded,
url,
is_self,
selftext: body,
selftext_html: html,
image,
iframe,
EmbedComponent,
isEditing,
editedBody,
onChangeEditedBody,
onToggleEditing,
onSubmitEdit
}) => (
<div className="expando">
{expanded ? (
is_self && (body || isEditing) ? (
<form className="usertext warn-on-unload" onSubmit={onSubmitEdit}>
{isEditing ? (
<div className="usertext-edit md-container">
<div className="md">
<textarea
rows="1"
cols="1"
name="text"
value={editedBody}
onChange={onChangeEditedBody}
/>
</div>
<div className="bottom-area">
<div className="usertext-buttons">
<button type="submit" className="save">
save
</button>
<button type="butotn" onClick={onToggleEditing}>
cancel
</button>
</div>
</div>
</div>
) : (
<Markdown
body={body}
html={html}
className="usertext-body may-blank-within md-container"
/>
)}
</form>
) : EmbedComponent ? (
<EmbedComponent.Component {...EmbedComponent.props} key={url} />
) : image ? (
<img src={image} alt="userimage" rel="noreferrer" />
) : iframe ? (
<iframe
src={iframe}
title="uservideo"
height="360"
width="640px"
allowFullScreen
scrolling="no"
frameborder="0"
/>
) : null
) : null}
</div>
);
const matchesExt = (exts, url) =>
!!exts.find(ext => url.toLowerCase().indexOf("." + ext) !== -1);
const imgExts = ["jpg", "jpeg", "png", "gif"];
export const getExpando = (item, rawDomain, urlInfo) => {
const domain = rawDomain ? rawDomain.toLowerCase() : rawDomain;
const query = qs.parse(urlInfo.query);
let iframe;
let EmbedComponent;
let reactPlayer;
if (ReactPlayer.canPlay(item.url)) {
reactPlayer = item.url;
} else if (domain === "hooktube.com") {
reactPlayer = item.url.replace("hooktube", "youtube");
} else if (domain === "invidio.us") {
// reactPlayer = item.url.replace("invidio.us", "youtube.com");
}
if (reactPlayer) {
EmbedComponent = {
Component: ReactPlayer,
props: {
url: reactPlayer,
controls: true
}
};
}
if (domain === "instagr.am" || domain === "instagram.com") {
EmbedComponent = {
Component: InstagramEmbed,
props: {
url: item.url
}
};
}
if (
(domain === "imgur.com" || domain === "i.imgur.com") &&
matchesExt(["gifv"], item.url)
) {
iframe = item.url.replace(".gifv", "/embed");
} else {
iframe = findIframe(item, domain, query);
}
const image =
iframe || EmbedComponent
? null
: item.url && matchesExt(imgExts, item.url)
? item.url
: null;
const expandoType = item.body
? "selftext"
: image || EmbedComponent || iframe
? "video"
: null;
return { expandoType, image, iframe, reactPlayer, EmbedComponent };
};
const findIframe = (item, domain, query) => {
if (domain === "bitchute.com" && item.url.indexOf("/video/") !== -1) {
return (
"https://www.bitchute.com/embed/" +
item.url.substring(item.url.indexOf("/video/") + 7, item.url.length)
);
}
if (domain === "d.tube")
return item.url.replace("d.tube/#!/v", "emb.d.tube/#!");
if (domain === "invidio.us") return "https://invidio.us/embed/" + query.v;
if (domain === "dailymotion.com" && item.url.indexOf("/video/") !== -1) {
return (
"https://www.dailymotion.com/embed/video/" +
item.url.substring(item.url.indexOf("/video/") + 7, item.url.length)
);
}
if (domain === "vevo.com" && item.url.indexOf("/watch/") !== -1) {
return (
"https://embed.vevo.com?isrc=" +
item.url.substring(item.url.lastIndexOf("/") + 1, item.url.length)
);
}
if (domain === "gfycat.com" && item.url.indexOf("/detail/") !== -1) {
return (
"https://gfycat.com/ifr/" +
item.url.substring(item.url.indexOf("/detail/") + 8, item.url.length)
);
}
if (domain === "gfycat.com" && item.url.indexOf(".com/") !== -1) {
return (
"https://gfycat.com/ifr/" +
item.url.substring(item.url.indexOf(".com/") + 5, item.url.length)
);
}
if (domain === "giphy.com" && item.url.indexOf("/html5") !== -1) {
return (
"https://giphy.com/embed/" +
item.url
.substring(item.url.lastIndexOf("/gifs/") + 6, item.url.length)
.replace("/html5", "")
);
}
if (domain === "giphy.com" && item.url.indexOf("/gifs/") !== -1) {
return (
"https://giphy.com/embed/" +
item.url.substring(item.url.lastIndexOf("-") + 1, item.url.length)
);
}
if (domain === "pornhub.com" && query.viewkey) {
return `https://www.pornhub.com/embed/${query.viewkey}`;
}
if (domain === "liveleak.com") {
return item.url.replace("/view", "/ll_embed");
}
if (domain === "youporn.com") {
return item.url.replace("/watch", "/embed");
}
if (domain === "rutube.ru" && item.url.indexOf("/video/") !== -1) {
return (
"https://rutube.ru/play/embed/" +
item.url.substring(item.url.indexOf("/video/") + 7, item.url.length)
);
}
return null;
};
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="toolCount">5</integer>
<integer name="featherfilterPacksCount">5</integer>
<integer name="featherStickerPacksCount">4</integer>
</resources> | {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.modules.visual.basic;
import org.netbeans.modules.visual.framework.VisualTestCase;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Rectangle;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.netbeans.api.visual.anchor.AnchorFactory;
import org.netbeans.api.visual.border.BorderFactory;
import org.netbeans.api.visual.widget.ConnectionWidget;
import org.netbeans.api.visual.widget.LayerWidget;
import org.netbeans.api.visual.widget.Scene;
import org.netbeans.api.visual.widget.Widget;
import org.netbeans.modules.visual.laf.DefaultLookFeel;
/**
* @author David Kaspar
*/
public class BasicTest extends VisualTestCase {
public static Test suite() {
return GraphicsEnvironment.isHeadless() ? new TestSuite() : new TestSuite(BasicTest.class);
}
public BasicTest(String testName) {
super(testName);
}
protected void setUp() throws Exception {
super.setUp();
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testShow () {
Scene scene = new Scene ();
LayerWidget mainLayer = new LayerWidget (scene);
scene.addChild(mainLayer);
Widget w1 = new Widget (scene);
w1.setBorder (BorderFactory.createLineBorder ());
w1.setPreferredLocation (new Point (100, 100));
w1.setPreferredSize (new Dimension (40, 20));
mainLayer.addChild(w1);
Widget w2 = new Widget (scene);
w2.setBorder (BorderFactory.createLineBorder ());
w2.setPreferredLocation (new Point (200, 100));
w2.setPreferredSize (new Dimension (40, 20));
mainLayer.addChild(w2);
LayerWidget connLayer = new LayerWidget (scene);
scene.addChild(connLayer);
ConnectionWidget conn = new ConnectionWidget(scene);
conn.setSourceAnchor(AnchorFactory.createRectangularAnchor(w1));
conn.setTargetAnchor(AnchorFactory.createRectangularAnchor(w2));
connLayer.addChild(conn);
Color color = (Color) (new DefaultLookFeel()).getBackground();
assertScene (scene, color,
new Rectangle (99, 99, 42, 22),
new Rectangle (199, 99, 42, 22),
new Rectangle (138, 108, 64, 4)
);
}
}
| {
"pile_set_name": "Github"
} |
require 'puppet/indirector/terminus'
# Manage a memory-cached list of instances.
class Puppet::Indirector::Memory < Puppet::Indirector::Terminus
def initialize
@instances = {}
end
def destroy(request)
raise ArgumentError.new("Could not find #{request.key} to destroy") unless @instances.include?(request.key)
@instances.delete(request.key)
end
def find(request)
@instances[request.key]
end
def save(request)
@instances[request.key] = request.instance
end
end
| {
"pile_set_name": "Github"
} |
/**************************************************************************
*
* Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef VMWGFX_KMS_H_
#define VMWGFX_KMS_H_
#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
#include "vmwgfx_drv.h"
/**
* struct vmw_kms_dirty - closure structure for the vmw_kms_helper_dirty
* function.
*
* @fifo_commit: Callback that is called once for each display unit after
* all clip rects. This function must commit the fifo space reserved by the
* helper. Set up by the caller.
* @clip: Callback that is called for each cliprect on each display unit.
* Set up by the caller.
* @fifo_reserve_size: Fifo size that the helper should try to allocat for
* each display unit. Set up by the caller.
* @dev_priv: Pointer to the device private. Set up by the helper.
* @unit: The current display unit. Set up by the helper before a call to @clip.
* @cmd: The allocated fifo space. Set up by the helper before the first @clip
* call.
* @num_hits: Number of clip rect commands for this display unit.
* Cleared by the helper before the first @clip call. Updated by the @clip
* callback.
* @fb_x: Clip rect left side in framebuffer coordinates.
* @fb_y: Clip rect right side in framebuffer coordinates.
* @unit_x1: Clip rect left side in crtc coordinates.
* @unit_y1: Clip rect top side in crtc coordinates.
* @unit_x2: Clip rect right side in crtc coordinates.
* @unit_y2: Clip rect bottom side in crtc coordinates.
*
* The clip rect coordinates are updated by the helper for each @clip call.
* Note that this may be derived from if more info needs to be passed between
* helper caller and helper callbacks.
*/
struct vmw_kms_dirty {
void (*fifo_commit)(struct vmw_kms_dirty *);
void (*clip)(struct vmw_kms_dirty *);
size_t fifo_reserve_size;
struct vmw_private *dev_priv;
struct vmw_display_unit *unit;
void *cmd;
u32 num_hits;
s32 fb_x;
s32 fb_y;
s32 unit_x1;
s32 unit_y1;
s32 unit_x2;
s32 unit_y2;
};
#define VMWGFX_NUM_DISPLAY_UNITS 8
#define vmw_framebuffer_to_vfb(x) \
container_of(x, struct vmw_framebuffer, base)
#define vmw_framebuffer_to_vfbs(x) \
container_of(x, struct vmw_framebuffer_surface, base.base)
#define vmw_framebuffer_to_vfbd(x) \
container_of(x, struct vmw_framebuffer_dmabuf, base.base)
/**
* Base class for framebuffers
*
* @pin is called the when ever a crtc uses this framebuffer
* @unpin is called
*/
struct vmw_framebuffer {
struct drm_framebuffer base;
int (*pin)(struct vmw_framebuffer *fb);
int (*unpin)(struct vmw_framebuffer *fb);
bool dmabuf;
struct ttm_base_object *user_obj;
uint32_t user_handle;
};
/*
* Clip rectangle
*/
struct vmw_clip_rect {
int x1, x2, y1, y2;
};
struct vmw_framebuffer_surface {
struct vmw_framebuffer base;
struct vmw_surface *surface;
struct vmw_dma_buffer *buffer;
struct list_head head;
bool is_dmabuf_proxy; /* true if this is proxy surface for DMA buf */
};
struct vmw_framebuffer_dmabuf {
struct vmw_framebuffer base;
struct vmw_dma_buffer *buffer;
};
/*
* Basic cursor manipulation
*/
int vmw_cursor_update_image(struct vmw_private *dev_priv,
u32 *image, u32 width, u32 height,
u32 hotspotX, u32 hotspotY);
int vmw_cursor_update_dmabuf(struct vmw_private *dev_priv,
struct vmw_dma_buffer *dmabuf,
u32 width, u32 height,
u32 hotspotX, u32 hotspotY);
void vmw_cursor_update_position(struct vmw_private *dev_priv,
bool show, int x, int y);
/**
* Base class display unit.
*
* Since the SVGA hw doesn't have a concept of a crtc, encoder or connector
* so the display unit is all of them at the same time. This is true for both
* legacy multimon and screen objects.
*/
struct vmw_display_unit {
struct drm_crtc crtc;
struct drm_encoder encoder;
struct drm_connector connector;
struct vmw_surface *cursor_surface;
struct vmw_dma_buffer *cursor_dmabuf;
size_t cursor_age;
int cursor_x;
int cursor_y;
int hotspot_x;
int hotspot_y;
s32 core_hotspot_x;
s32 core_hotspot_y;
unsigned unit;
/*
* Prefered mode tracking.
*/
unsigned pref_width;
unsigned pref_height;
bool pref_active;
struct drm_display_mode *pref_mode;
/*
* Gui positioning
*/
int gui_x;
int gui_y;
bool is_implicit;
bool active_implicit;
int set_gui_x;
int set_gui_y;
};
#define vmw_crtc_to_du(x) \
container_of(x, struct vmw_display_unit, crtc)
#define vmw_connector_to_du(x) \
container_of(x, struct vmw_display_unit, connector)
/*
* Shared display unit functions - vmwgfx_kms.c
*/
void vmw_du_cleanup(struct vmw_display_unit *du);
void vmw_du_crtc_save(struct drm_crtc *crtc);
void vmw_du_crtc_restore(struct drm_crtc *crtc);
int vmw_du_crtc_gamma_set(struct drm_crtc *crtc,
u16 *r, u16 *g, u16 *b,
uint32_t size);
int vmw_du_crtc_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv,
uint32_t handle, uint32_t width, uint32_t height,
int32_t hot_x, int32_t hot_y);
int vmw_du_crtc_cursor_move(struct drm_crtc *crtc, int x, int y);
int vmw_du_connector_dpms(struct drm_connector *connector, int mode);
void vmw_du_connector_save(struct drm_connector *connector);
void vmw_du_connector_restore(struct drm_connector *connector);
enum drm_connector_status
vmw_du_connector_detect(struct drm_connector *connector, bool force);
int vmw_du_connector_fill_modes(struct drm_connector *connector,
uint32_t max_width, uint32_t max_height);
int vmw_du_connector_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t val);
int vmw_kms_helper_dirty(struct vmw_private *dev_priv,
struct vmw_framebuffer *framebuffer,
const struct drm_clip_rect *clips,
const struct drm_vmw_rect *vclips,
s32 dest_x, s32 dest_y,
int num_clips,
int increment,
struct vmw_kms_dirty *dirty);
int vmw_kms_helper_buffer_prepare(struct vmw_private *dev_priv,
struct vmw_dma_buffer *buf,
bool interruptible,
bool validate_as_mob);
void vmw_kms_helper_buffer_revert(struct vmw_dma_buffer *buf);
void vmw_kms_helper_buffer_finish(struct vmw_private *dev_priv,
struct drm_file *file_priv,
struct vmw_dma_buffer *buf,
struct vmw_fence_obj **out_fence,
struct drm_vmw_fence_rep __user *
user_fence_rep);
int vmw_kms_helper_resource_prepare(struct vmw_resource *res,
bool interruptible);
void vmw_kms_helper_resource_revert(struct vmw_resource *res);
void vmw_kms_helper_resource_finish(struct vmw_resource *res,
struct vmw_fence_obj **out_fence);
int vmw_kms_readback(struct vmw_private *dev_priv,
struct drm_file *file_priv,
struct vmw_framebuffer *vfb,
struct drm_vmw_fence_rep __user *user_fence_rep,
struct drm_vmw_rect *vclips,
uint32_t num_clips);
struct vmw_framebuffer *
vmw_kms_new_framebuffer(struct vmw_private *dev_priv,
struct vmw_dma_buffer *dmabuf,
struct vmw_surface *surface,
bool only_2d,
const struct drm_mode_fb_cmd *mode_cmd);
int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv,
unsigned unit,
u32 max_width,
u32 max_height,
struct drm_connector **p_con,
struct drm_crtc **p_crtc,
struct drm_display_mode **p_mode);
void vmw_guess_mode_timing(struct drm_display_mode *mode);
void vmw_kms_del_active(struct vmw_private *dev_priv,
struct vmw_display_unit *du);
void vmw_kms_add_active(struct vmw_private *dev_priv,
struct vmw_display_unit *du,
struct vmw_framebuffer *vfb);
bool vmw_kms_crtc_flippable(struct vmw_private *dev_priv,
struct drm_crtc *crtc);
void vmw_kms_update_implicit_fb(struct vmw_private *dev_priv,
struct drm_crtc *crtc);
void vmw_kms_create_implicit_placement_property(struct vmw_private *dev_priv,
bool immutable);
/*
* Legacy display unit functions - vmwgfx_ldu.c
*/
int vmw_kms_ldu_init_display(struct vmw_private *dev_priv);
int vmw_kms_ldu_close_display(struct vmw_private *dev_priv);
int vmw_kms_ldu_do_dmabuf_dirty(struct vmw_private *dev_priv,
struct vmw_framebuffer *framebuffer,
unsigned flags, unsigned color,
struct drm_clip_rect *clips,
unsigned num_clips, int increment);
int vmw_kms_update_proxy(struct vmw_resource *res,
const struct drm_clip_rect *clips,
unsigned num_clips,
int increment);
/*
* Screen Objects display functions - vmwgfx_scrn.c
*/
int vmw_kms_sou_init_display(struct vmw_private *dev_priv);
int vmw_kms_sou_close_display(struct vmw_private *dev_priv);
int vmw_kms_sou_do_surface_dirty(struct vmw_private *dev_priv,
struct vmw_framebuffer *framebuffer,
struct drm_clip_rect *clips,
struct drm_vmw_rect *vclips,
struct vmw_resource *srf,
s32 dest_x,
s32 dest_y,
unsigned num_clips, int inc,
struct vmw_fence_obj **out_fence);
int vmw_kms_sou_do_dmabuf_dirty(struct vmw_private *dev_priv,
struct vmw_framebuffer *framebuffer,
struct drm_clip_rect *clips,
struct drm_vmw_rect *vclips,
unsigned num_clips, int increment,
bool interruptible,
struct vmw_fence_obj **out_fence);
int vmw_kms_sou_readback(struct vmw_private *dev_priv,
struct drm_file *file_priv,
struct vmw_framebuffer *vfb,
struct drm_vmw_fence_rep __user *user_fence_rep,
struct drm_vmw_rect *vclips,
uint32_t num_clips);
/*
* Screen Target Display Unit functions - vmwgfx_stdu.c
*/
int vmw_kms_stdu_init_display(struct vmw_private *dev_priv);
int vmw_kms_stdu_close_display(struct vmw_private *dev_priv);
int vmw_kms_stdu_surface_dirty(struct vmw_private *dev_priv,
struct vmw_framebuffer *framebuffer,
struct drm_clip_rect *clips,
struct drm_vmw_rect *vclips,
struct vmw_resource *srf,
s32 dest_x,
s32 dest_y,
unsigned num_clips, int inc,
struct vmw_fence_obj **out_fence);
int vmw_kms_stdu_dma(struct vmw_private *dev_priv,
struct drm_file *file_priv,
struct vmw_framebuffer *vfb,
struct drm_vmw_fence_rep __user *user_fence_rep,
struct drm_clip_rect *clips,
struct drm_vmw_rect *vclips,
uint32_t num_clips,
int increment,
bool to_surface,
bool interruptible);
#endif
| {
"pile_set_name": "Github"
} |
/** @addtogroup loader loader
* @ingroup srvs
* @brief Loads and runs programs from VFS
*/
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0-only
/// Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element
///
//# This makes an effort to find cases where ARRAY_SIZE can be used such as
//# where there is a division of sizeof the array by the sizeof its first
//# element or by any indexed element or the element type. It replaces the
//# division of the two sizeofs by ARRAY_SIZE.
//
// Confidence: High
// Copyright: (C) 2014 Himangi Saraogi.
// Comments:
// Options: --no-includes --include-headers
virtual patch
virtual context
virtual org
virtual report
@i@
@@
#include <linux/kernel.h>
//----------------------------------------------------------
// For context mode
//----------------------------------------------------------
@depends on i&&context@
type T;
T[] E;
@@
(
* (sizeof(E)/sizeof(*E))
|
* (sizeof(E)/sizeof(E[...]))
|
* (sizeof(E)/sizeof(T))
)
//----------------------------------------------------------
// For patch mode
//----------------------------------------------------------
@depends on i&&patch@
type T;
T[] E;
@@
(
- (sizeof(E)/sizeof(*E))
+ ARRAY_SIZE(E)
|
- (sizeof(E)/sizeof(E[...]))
+ ARRAY_SIZE(E)
|
- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)
)
//----------------------------------------------------------
// For org and report mode
//----------------------------------------------------------
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
@script:python depends on org@
p << r.p;
@@
coccilib.org.print_todo(p[0], "WARNING should use ARRAY_SIZE")
@script:python depends on report@
p << r.p;
@@
msg="WARNING: Use ARRAY_SIZE"
coccilib.report.print_report(p[0], msg)
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2017-2019 Dremio Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.dremio.exec.pop;
import java.io.IOException;
import com.dremio.common.util.FileUtils;
import com.dremio.exec.ExecTest;
import com.dremio.exec.exception.FragmentSetupException;
import com.dremio.exec.physical.PhysicalPlan;
import com.dremio.exec.physical.base.PhysicalOperator;
import com.dremio.exec.planner.PhysicalPlanReader;
import com.dremio.exec.planner.fragment.Fragment;
import com.dremio.exec.planner.fragment.Fragment.ExchangeFragmentPair;
import com.dremio.exec.planner.fragment.MakeFragmentsVisitor;
import com.dremio.exec.work.foreman.ForemanSetupException;
import com.google.common.base.Charsets;
import com.google.common.io.Files;
public abstract class PopUnitTestBase extends ExecTest {
// static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PopUnitTestBase.class);
public static int getFragmentCount(Fragment b) {
int i = 1;
for (ExchangeFragmentPair p : b) {
i += getFragmentCount(p.getNode());
}
return i;
}
public static Fragment getRootFragment(PhysicalPlanReader reader, String file) throws FragmentSetupException,
IOException, ForemanSetupException {
return getRootFragmentFromPlanString(reader, Files.toString(FileUtils.getResourceAsFile(file), Charsets.UTF_8));
}
public static Fragment getRootFragmentFromPlanString(PhysicalPlanReader reader, String planString)
throws FragmentSetupException, IOException, ForemanSetupException {
PhysicalPlan plan = reader.readPhysicalPlan(planString);
PhysicalOperator o = plan.getSortedOperators(false).iterator().next();
return o.accept(MakeFragmentsVisitor.INSTANCE, null);
}
}
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.network.v2019_07_01.implementation;
import java.util.List;
import com.microsoft.azure.management.network.v2019_07_01.PrivateLinkServiceIpConfiguration;
import com.microsoft.azure.management.network.v2019_07_01.ProvisioningState;
import com.microsoft.azure.management.network.v2019_07_01.PrivateLinkServicePropertiesVisibility;
import com.microsoft.azure.management.network.v2019_07_01.PrivateLinkServicePropertiesAutoApproval;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.rest.SkipParentValidation;
import com.microsoft.azure.Resource;
/**
* Private link service resource.
*/
@JsonFlatten
@SkipParentValidation
public class PrivateLinkServiceInner extends Resource {
/**
* An array of references to the load balancer IP configurations.
*/
@JsonProperty(value = "properties.loadBalancerFrontendIpConfigurations")
private List<FrontendIPConfigurationInner> loadBalancerFrontendIpConfigurations;
/**
* An array of private link service IP configurations.
*/
@JsonProperty(value = "properties.ipConfigurations")
private List<PrivateLinkServiceIpConfiguration> ipConfigurations;
/**
* An array of references to the network interfaces created for this
* private link service.
*/
@JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY)
private List<NetworkInterfaceInner> networkInterfaces;
/**
* The provisioning state of the private link service resource. Possible
* values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'.
*/
@JsonProperty(value = "properties.provisioningState")
private ProvisioningState provisioningState;
/**
* An array of list about connections to the private endpoint.
*/
@JsonProperty(value = "properties.privateEndpointConnections")
private List<PrivateEndpointConnectionInner> privateEndpointConnections;
/**
* The visibility list of the private link service.
*/
@JsonProperty(value = "properties.visibility")
private PrivateLinkServicePropertiesVisibility visibility;
/**
* The auto-approval list of the private link service.
*/
@JsonProperty(value = "properties.autoApproval")
private PrivateLinkServicePropertiesAutoApproval autoApproval;
/**
* The list of Fqdn.
*/
@JsonProperty(value = "properties.fqdns")
private List<String> fqdns;
/**
* The alias of the private link service.
*/
@JsonProperty(value = "properties.alias", access = JsonProperty.Access.WRITE_ONLY)
private String alias;
/**
* A unique read-only string that changes whenever the resource is updated.
*/
@JsonProperty(value = "etag")
private String etag;
/**
* Resource ID.
*/
@JsonProperty(value = "id")
private String id;
/**
* Get an array of references to the load balancer IP configurations.
*
* @return the loadBalancerFrontendIpConfigurations value
*/
public List<FrontendIPConfigurationInner> loadBalancerFrontendIpConfigurations() {
return this.loadBalancerFrontendIpConfigurations;
}
/**
* Set an array of references to the load balancer IP configurations.
*
* @param loadBalancerFrontendIpConfigurations the loadBalancerFrontendIpConfigurations value to set
* @return the PrivateLinkServiceInner object itself.
*/
public PrivateLinkServiceInner withLoadBalancerFrontendIpConfigurations(List<FrontendIPConfigurationInner> loadBalancerFrontendIpConfigurations) {
this.loadBalancerFrontendIpConfigurations = loadBalancerFrontendIpConfigurations;
return this;
}
/**
* Get an array of private link service IP configurations.
*
* @return the ipConfigurations value
*/
public List<PrivateLinkServiceIpConfiguration> ipConfigurations() {
return this.ipConfigurations;
}
/**
* Set an array of private link service IP configurations.
*
* @param ipConfigurations the ipConfigurations value to set
* @return the PrivateLinkServiceInner object itself.
*/
public PrivateLinkServiceInner withIpConfigurations(List<PrivateLinkServiceIpConfiguration> ipConfigurations) {
this.ipConfigurations = ipConfigurations;
return this;
}
/**
* Get an array of references to the network interfaces created for this private link service.
*
* @return the networkInterfaces value
*/
public List<NetworkInterfaceInner> networkInterfaces() {
return this.networkInterfaces;
}
/**
* Get the provisioning state of the private link service resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'.
*
* @return the provisioningState value
*/
public ProvisioningState provisioningState() {
return this.provisioningState;
}
/**
* Set the provisioning state of the private link service resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'.
*
* @param provisioningState the provisioningState value to set
* @return the PrivateLinkServiceInner object itself.
*/
public PrivateLinkServiceInner withProvisioningState(ProvisioningState provisioningState) {
this.provisioningState = provisioningState;
return this;
}
/**
* Get an array of list about connections to the private endpoint.
*
* @return the privateEndpointConnections value
*/
public List<PrivateEndpointConnectionInner> privateEndpointConnections() {
return this.privateEndpointConnections;
}
/**
* Set an array of list about connections to the private endpoint.
*
* @param privateEndpointConnections the privateEndpointConnections value to set
* @return the PrivateLinkServiceInner object itself.
*/
public PrivateLinkServiceInner withPrivateEndpointConnections(List<PrivateEndpointConnectionInner> privateEndpointConnections) {
this.privateEndpointConnections = privateEndpointConnections;
return this;
}
/**
* Get the visibility list of the private link service.
*
* @return the visibility value
*/
public PrivateLinkServicePropertiesVisibility visibility() {
return this.visibility;
}
/**
* Set the visibility list of the private link service.
*
* @param visibility the visibility value to set
* @return the PrivateLinkServiceInner object itself.
*/
public PrivateLinkServiceInner withVisibility(PrivateLinkServicePropertiesVisibility visibility) {
this.visibility = visibility;
return this;
}
/**
* Get the auto-approval list of the private link service.
*
* @return the autoApproval value
*/
public PrivateLinkServicePropertiesAutoApproval autoApproval() {
return this.autoApproval;
}
/**
* Set the auto-approval list of the private link service.
*
* @param autoApproval the autoApproval value to set
* @return the PrivateLinkServiceInner object itself.
*/
public PrivateLinkServiceInner withAutoApproval(PrivateLinkServicePropertiesAutoApproval autoApproval) {
this.autoApproval = autoApproval;
return this;
}
/**
* Get the list of Fqdn.
*
* @return the fqdns value
*/
public List<String> fqdns() {
return this.fqdns;
}
/**
* Set the list of Fqdn.
*
* @param fqdns the fqdns value to set
* @return the PrivateLinkServiceInner object itself.
*/
public PrivateLinkServiceInner withFqdns(List<String> fqdns) {
this.fqdns = fqdns;
return this;
}
/**
* Get the alias of the private link service.
*
* @return the alias value
*/
public String alias() {
return this.alias;
}
/**
* Get a unique read-only string that changes whenever the resource is updated.
*
* @return the etag value
*/
public String etag() {
return this.etag;
}
/**
* Set a unique read-only string that changes whenever the resource is updated.
*
* @param etag the etag value to set
* @return the PrivateLinkServiceInner object itself.
*/
public PrivateLinkServiceInner withEtag(String etag) {
this.etag = etag;
return this;
}
/**
* Get resource ID.
*
* @return the id value
*/
public String id() {
return this.id;
}
/**
* Set resource ID.
*
* @param id the id value to set
* @return the PrivateLinkServiceInner object itself.
*/
public PrivateLinkServiceInner withId(String id) {
this.id = id;
return this;
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2013 Apple 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "GraphicsLayerCARemote.h"
#include "PlatformCAAnimationRemote.h"
#include "PlatformCALayerRemote.h"
using namespace WebCore;
namespace WebKit {
GraphicsLayerCARemote::~GraphicsLayerCARemote()
{
}
bool GraphicsLayerCARemote::filtersCanBeComposited(const FilterOperations& filters)
{
return PlatformCALayerRemote::filtersCanBeComposited(filters);
}
PassRefPtr<PlatformCALayer> GraphicsLayerCARemote::createPlatformCALayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* owner)
{
return PlatformCALayerRemote::create(layerType, owner, m_context);
}
PassRefPtr<PlatformCALayer> GraphicsLayerCARemote::createPlatformCALayer(PlatformLayer* platformLayer, PlatformCALayerClient* owner)
{
return PlatformCALayerRemote::create(platformLayer, owner, m_context);
}
PassRefPtr<PlatformCAAnimation> GraphicsLayerCARemote::createPlatformCAAnimation(PlatformCAAnimation::AnimationType type, const String& keyPath)
{
return PlatformCAAnimationRemote::create(type, keyPath);
}
} // namespace WebKit
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>0.9.7: normal.hpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">0.9.7
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_275089585c7fc1b5fd5d7d42c69cb1da.html">D:</a></li><li class="navelem"><a class="el" href="dir_7b98f88bffbed4b390b5f8f520d9c08e.html">Source</a></li><li class="navelem"><a class="el" href="dir_1f76e953200861345293ade84ac7fb6c.html">G-Truc</a></li><li class="navelem"><a class="el" href="dir_e29b03b892e0e25920d021a614d4db9b.html">glm</a></li><li class="navelem"><a class="el" href="dir_5ce58d942b2d0776e17a9a58abc01e04.html">glm</a></li><li class="navelem"><a class="el" href="dir_8d176b5b7dd0ae42ea6876078f2bde49.html">gtx</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">normal.hpp File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a href="a00082_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga7842850bcda582f1756883e3ed950e14"><td class="memTemplParams" colspan="2">template<typename T , precision P> </td></tr>
<tr class="memitem:ga7842850bcda582f1756883e3ed950e14"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL tvec3< T, P > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00216.html#ga7842850bcda582f1756883e3ed950e14">triangleNormal</a> (tvec3< T, P > const &p1, tvec3< T, P > const &p2, tvec3< T, P > const &p3)</td></tr>
<tr class="separator:ga7842850bcda582f1756883e3ed950e14"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>OpenGL Mathematics (glm.g-truc.net) </p>
<p>Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>Restrictions: By making use of the Software for military purposes, you choose to make a Bunny unhappy.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<p><a class="el" href="a00216.html">GLM_GTX_normal</a></p>
<dl class="section date"><dt>Date</dt><dd>2005-12-21 / 2011-06-07 </dd></dl>
<dl class="section author"><dt>Author</dt><dd>Christophe Riccio</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="a00162.html" title="The core of GLM, which implements exactly and only the GLSL specification to the degree possible...">GLM Core</a> (dependence) </dd>
<dd>
<a class="el" href="a00196.html" title="Min and max functions for 3 to 4 parameters. ">GLM_GTX_extented_min_max</a> (dependence) </dd></dl>
<p>Definition in file <a class="el" href="a00082_source.html">normal.hpp</a>.</p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
| {
"pile_set_name": "Github"
} |
{
"name": "graceful-readlink",
"version": "1.0.1",
"description": "graceful fs.readlink",
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/zhiyelee/graceful-readlink.git"
},
"homepage": "https://github.com/zhiyelee/graceful-readlink",
"bugs": {
"url": "https://github.com/zhiyelee/graceful-readlink/issues"
},
"keywords": [
"fs.readlink",
"readlink"
],
"author": {
"name": "zhiyelee"
},
"license": "MIT",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"gitHead": "f6655275bebef706fb63fd01b5f062a7052419a5",
"_id": "graceful-readlink@1.0.1",
"_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725",
"_from": "graceful-readlink@>=1.0.0",
"_npmVersion": "2.1.17",
"_nodeVersion": "0.11.14",
"_npmUser": {
"name": "zhiyelee",
"email": "zhiyelee@gmail.com"
},
"maintainers": [
{
"name": "zhiyelee",
"email": "zhiyelee@gmail.com"
}
],
"dist": {
"shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725",
"size": 1531,
"noattachment": false,
"key": "graceful-readlink/-/graceful-readlink-1.0.1.tgz",
"tarball": "http://registry.npm.alibaba-inc.com/graceful-readlink/download/graceful-readlink-1.0.1.tgz"
},
"directories": {},
"publish_time": 1423714736538,
"_cnpm_publish_time": 1423714736538,
"_resolved": "http://registry.npm.alibaba-inc.com/graceful-readlink/download/graceful-readlink-1.0.1.tgz",
"readme": "ERROR: No README data found!"
}
| {
"pile_set_name": "Github"
} |
;;; init-indent-guide.el --- Init for indent-guide.el
;; Filename: init-indent-guide.el
;; Description: Init for indent-guide.el
;; Author: Andy Stewart <lazycat.manatee@gmail.com>
;; Maintainer: Andy Stewart <lazycat.manatee@gmail.com>
;; Copyright (C) 2014, Andy Stewart, all rights reserved.
;; Created: 2014-10-06 16:33:48
;; Version: 0.1
;; Last-Updated: 2014-10-06 16:33:48
;; By: Andy Stewart
;; URL: http://www.emacswiki.org/emacs/download/init-indent-guide.el
;; Keywords:
;; Compatibility: GNU Emacs 24.4.50.1
;;
;; Features that might be required by this library:
;;
;;
;;
;;; This file is NOT part of GNU Emacs
;;; License
;;
;; 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, 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; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
;; Floor, Boston, MA 02110-1301, USA.
;;; Commentary:
;;
;; Init for indent-guide.el
;;
;;; Installation:
;;
;; Put init-indent-guide.el to your load-path.
;; The load-path is usually ~/elisp/.
;; It's set in your ~/.emacs like this:
;; (add-to-list 'load-path (expand-file-name "~/elisp"))
;;
;; And the following to your ~/.emacs startup file.
;;
;; (require 'init-indent-guide)
;;
;; No need more.
;;; Customize:
;;
;;
;;
;; All of the above can customize by:
;; M-x customize-group RET init-indent-guide RET
;;
;;; Change log:
;;
;; 2014/10/06
;; * First released.
;;
;;; Acknowledgements:
;;
;;
;;
;;; TODO
;;
;;
;;
;;; Require
(require 'indent-guide)
;;; Code:
(indent-guide-global-mode)
(setq indent-guide-char "⦙")
(provide 'init-indent-guide)
;;; init-indent-guide.el ends here
| {
"pile_set_name": "Github"
} |
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>
| {
"pile_set_name": "Github"
} |
/////////////////////////////////////////////////////////////////////////
// $Id: keymap.h 10209 2011-02-24 22:05:47Z sshwarts $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2009 The Bochs Project
//
// 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 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 St, Fifth Floor, Boston, MA 02110-1301 USA
//
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
// Methods of bx_keymap_c :
//
// - loadKeymap(Bit32u convertStringToSymbol(const char*));
// loads the configuration specified keymap file if keymapping is enabled
// using convertStringToSymbol to convert strings to client constants
//
// - loadKeymap(Bit32u convertStringToSymbol(const char*), const char* filename);
// loads the specified keymap file
// using convertStringToSymbol to convert strings to client constants
//
// - isKeymapLoaded () returns true if the keymap contains any valid key
// entries.
//
// - convertStringToBXKey
// convert a null-terminate string to a BX_KEY code
//
// - findHostKey(Bit32u key)
// - findAsciiChar(Bit8u ch)
// Each of these methods returns a pointer to a BXKeyEntry structure
// corresponding to a key. findHostKey() finds an entry whose hostKey
// value matches the target value, and findAsciiChar() finds an entry
// whose ASCII code matches the search value.
// In case of unknown symbol
#define BX_KEYMAP_UNKNOWN 0xFFFFFFFF
// Structure of an element of the keymap table
typedef struct BOCHSAPI {
Bit32u baseKey; // base key
Bit32u modKey; // modifier key that must be held down
Bit32s ascii; // ascii equivalent, if any
Bit32u hostKey; // value that the host's OS or library recognizes
} BXKeyEntry;
class BOCHSAPI bx_keymap_c : public logfunctions {
public:
bx_keymap_c(void);
~bx_keymap_c(void);
void loadKeymap(Bit32u(*)(const char*));
void loadKeymap(Bit32u(*)(const char*),const char *filename);
bx_bool isKeymapLoaded();
BXKeyEntry *findHostKey(Bit32u hostkeynum);
BXKeyEntry *findAsciiChar(Bit8u ascii);
const char *getBXKeyName(Bit32u key);
private:
Bit32u convertStringToBXKey(const char *);
BXKeyEntry *keymapTable;
Bit16u keymapCount;
};
BOCHSAPI extern bx_keymap_c bx_keymap;
| {
"pile_set_name": "Github"
} |
import CreateActions from '../../utils/ActionsConstructor';
export default CreateActions(
{
fetch: {},
setAdmins: {},
fetchAdmins: {
asyncResult: true,
loading: true,
children: ['completed', 'failure'],
method: 'Syncano.Actions.Admins.list'
},
updateAdmin: {
asyncResult: true,
asyncForm: true,
children: ['completed', 'failure'],
method: 'Syncano.Actions.Admins.update'
},
removeAdmins: {
loading: true,
asyncResult: true,
children: ['completed', 'failure'],
method: 'Syncano.Actions.Admins.remove'
}
},
{
withCheck: true,
withDialog: true
}
);
| {
"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.
// +build amd64,dragonfly
package unix
import (
"syscall"
"unsafe"
)
func Getpagesize() int { return 4096 }
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
func NsecToTimespec(nsec int64) (ts Timespec) {
ts.Sec = nsec / 1e9
ts.Nsec = nsec % 1e9
return
}
func NsecToTimeval(nsec int64) (tv Timeval) {
nsec += 999 // round up to microsecond
tv.Usec = nsec % 1e9 / 1e3
tv.Sec = int64(nsec / 1e9)
return
}
func SetKevent(k *Kevent_t, fd, mode, flags int) {
k.Ident = uint64(fd)
k.Filter = int16(mode)
k.Flags = uint16(flags)
}
func (iov *Iovec) SetLen(length int) {
iov.Len = uint64(length)
}
func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
var writtenOut uint64 = 0
_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
written = int(writtenOut)
if e1 != 0 {
err = e1
}
return
}
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
| {
"pile_set_name": "Github"
} |
[
{
"type": "NodeCom",
"secondType": "10",
"Node": [
]
},
{
"type": "ShopCom",
"viewSize": "{1024,80}",
"cellSize": "{185,80}",
"position": "{17,0}",
"anchorPoint": "{0,1}",
"data": [
{
"name": "超级火箭",
"filename": "images/unit3.png",
"bullet_image": "images/gun1.png",
"bullet_hp": 50,
"bullet_rate": 2,
"bullet_speed": 500,
"price": 500,
"hp": 400,
"coin": 20,
"coin_rate": 5
},
{
"name": "普通火箭",
"filename": "images/unit2.png",
"bullet_image": "images/gun2.png",
"bullet_hp": 50,
"bullet_rate": 2,
"bullet_speed": 400,
"price": 400,
"hp": 300,
"coin": 20,
"coin_rate": 5
},
{
"name": "转头",
"filename": "images/unit1.png",
"price": 300,
"hp": 200,
"coin": 20,
"coin_rate": 5
},
{
"name": "普通转头",
"filename": "images/unit4.png",
"price": 100,
"hp": 100,
"coin": 20,
"coin_rate": 5
},
{
"name": "超级火箭",
"filename": "images/unit5.png",
"bullet_image": "images/gun1.png",
"bullet_hp": 50,
"bullet_speed": 300,
"bullet_rate": 2,
"price": 500,
"hp": 400,
"coin": 20,
"coin_rate": 5
}
]
}
] | {
"pile_set_name": "Github"
} |
//
// System.Windows.Forms.Design.StringCollectionEditor
//
// Author:
// Ivan N. Zlatev <contact@i-nz.net>
//
// (C) 2007 Ivan N. Zlatev
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing.Design;
using System.Windows.Forms;
namespace System.Windows.Forms.Design
{
internal class StringCollectionEditor : CollectionEditor
{
private class StringCollectionEditForm : CollectionEditor.CollectionForm
{
private System.Windows.Forms.TextBox txtItems;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button butOk;
private System.Windows.Forms.Button butCancel;
public StringCollectionEditForm (CollectionEditor editor) : base (editor)
{
InitializeComponent ();
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
this.txtItems = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.butOk = new System.Windows.Forms.Button();
this.butCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// txtItems
//
this.txtItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtItems.Location = new System.Drawing.Point(12, 25);
this.txtItems.Multiline = true;
this.txtItems.AcceptsTab = true;
this.txtItems.Name = "txtItems";
this.txtItems.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.txtItems.Size = new System.Drawing.Size(378, 168);
this.txtItems.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(227, 13);
this.label1.TabIndex = 0;
this.label1.Text = "&Enter the strings in the collection (one per line):";
//
// butOk
//
this.butOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.butOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.butOk.Location = new System.Drawing.Point(234, 199);
this.butOk.Name = "butOk";
this.butOk.Size = new System.Drawing.Size(75, 23);
this.butOk.TabIndex = 3;
this.butOk.Text = "OK";
this.butOk.Click += new System.EventHandler(this.butOk_Click);
//
// butCancel
//
this.butCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.butCancel.Location = new System.Drawing.Point(315, 199);
this.butCancel.Name = "butCancel";
this.butCancel.Size = new System.Drawing.Size(75, 23);
this.butCancel.TabIndex = 4;
this.butCancel.Text = "Cancel";
this.butCancel.Click += new System.EventHandler(this.butCancel_Click);
//
// StringEditorForm
//
this.ClientSize = new System.Drawing.Size(402, 228);
this.Controls.Add(this.butCancel);
this.Controls.Add(this.butOk);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtItems);
this.CancelButton = butCancel;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "StringEditorForm";
this.Text = "String Collection Editor";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
protected override void OnEditValueChanged ()
{
object[] items = base.Items;
string text = String.Empty;
for (int i=0; i < items.Length; i++) {
if (items[i] is string) {
text += ((string) items[i]);
if (i != items.Length - 1) // no new line after the last one
text += Environment.NewLine;
}
}
txtItems.Text = text;
}
private void butOk_Click (object sender, EventArgs e)
{
if (this.txtItems.Text == String.Empty) {
base.Items = new string[0];
} else {
string[] items = txtItems.Lines;
bool lastLineEmpty = items[items.Length-1].Trim ().Length == 0;
object[] objects = new object[lastLineEmpty ? items.Length-1 : items.Length];
for (int i=0; i < objects.Length; i++)
objects[i] = (object)items[i];
base.Items = objects;
}
}
private void butCancel_Click (object sender, EventArgs e)
{
this.Close ();
}
}
public StringCollectionEditor (Type type) : base (type)
{
}
protected override CollectionEditor.CollectionForm CreateCollectionForm ()
{
return new StringCollectionEditForm (this);
}
}
}
| {
"pile_set_name": "Github"
} |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""FileObjectAdapter class.
Used in conjunction with PythonOutputStream/PythonInputStream to allow a C++
OutputStream/InputStream to interact with a Python file-like object.
"""
from __future__ import absolute_import
from __future__ import division
# Placeholder for import for type annotations
from __future__ import print_function
import io
from typing import BinaryIO
from tink.cc.pybind import tink_bindings
class FileObjectAdapter(tink_bindings.PythonFileObjectAdapter):
"""Adapts a Python file object for use in C++."""
def __init__(self, file_object: BinaryIO):
# Required to fix CLIF "Value invalidated due to capture by std::unique_ptr"
super(FileObjectAdapter, self).__init__()
self._file_object = file_object
def write(self, data: bytes) -> int:
"""Writes to underlying file object and returns number of bytes written."""
try:
written = self._file_object.write(data)
return 0 if written is None else written
except io.BlockingIOError as e:
return e.characters_written
def close(self) -> None:
self._file_object.close()
def read(self, size: int) -> bytes:
"""Reads at most 'size' bytes from the underlying file object.
Args:
size: A non-negative integer, maximum number of bytes to read.
Returns:
Bytes that were read. An empty bytes object is returned if no bytes are
available at the moment.
Raises:
EOFError if the file object is already at EOF.
"""
if size < 0:
raise ValueError('size must be non-negative')
try:
data = self._file_object.read(size)
if data is None:
return b''
elif not data and size > 0:
raise EOFError('EOF')
return data
except io.BlockingIOError:
return b''
| {
"pile_set_name": "Github"
} |
/*
* Load firmware files from Analog Devices SigmaStudio
*
* Copyright 2009-2011 Analog Devices Inc.
*
* Licensed under the GPL-2 or later.
*/
#ifndef __SIGMA_FIRMWARE_H__
#define __SIGMA_FIRMWARE_H__
#include <linux/device.h>
#include <linux/regmap.h>
#include <linux/list.h>
#include <sound/pcm.h>
struct sigmadsp;
struct snd_soc_component;
struct snd_pcm_substream;
struct sigmadsp_ops {
int (*safeload)(struct sigmadsp *sigmadsp, unsigned int addr,
const uint8_t *data, size_t len);
};
struct sigmadsp {
const struct sigmadsp_ops *ops;
struct list_head ctrl_list;
struct list_head data_list;
struct snd_pcm_hw_constraint_list rate_constraints;
unsigned int current_samplerate;
struct snd_soc_component *component;
struct device *dev;
struct mutex lock;
void *control_data;
int (*write)(void *, unsigned int, const uint8_t *, size_t);
int (*read)(void *, unsigned int, uint8_t *, size_t);
};
struct sigmadsp *devm_sigmadsp_init(struct device *dev,
const struct sigmadsp_ops *ops, const char *firmware_name);
void sigmadsp_reset(struct sigmadsp *sigmadsp);
int sigmadsp_restrict_params(struct sigmadsp *sigmadsp,
struct snd_pcm_substream *substream);
struct i2c_client;
struct sigmadsp *devm_sigmadsp_init_regmap(struct device *dev,
struct regmap *regmap, const struct sigmadsp_ops *ops,
const char *firmware_name);
struct sigmadsp *devm_sigmadsp_init_i2c(struct i2c_client *client,
const struct sigmadsp_ops *ops, const char *firmware_name);
int sigmadsp_attach(struct sigmadsp *sigmadsp,
struct snd_soc_component *component);
int sigmadsp_setup(struct sigmadsp *sigmadsp, unsigned int rate);
void sigmadsp_reset(struct sigmadsp *sigmadsp);
#endif
| {
"pile_set_name": "Github"
} |
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CircleOcticon renders consistently 1`] = `
.c0 {
overflow: hidden;
width: 32px;
height: 32px;
border-width: 0;
border-radius: 50%;
border-style: solid;
border-color: #e1e4e8;
}
.c1 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
width: 32px;
height: 32px;
}
<div
className="c0"
overflow="hidden"
size={32}
>
<div
className="c1"
display="flex"
size={32}
>
<svg
aria-hidden="true"
className="octicon"
dangerouslySetInnerHTML={
Object {
"__html": "<path fill-rule=\\"evenodd\\" d=\\"M21.03 5.72a.75.75 0 010 1.06l-11.5 11.5a.75.75 0 01-1.072-.012l-5.5-5.75a.75.75 0 111.084-1.036l4.97 5.195L19.97 5.72a.75.75 0 011.06 0z\\"></path>",
}
}
fill="currentColor"
height={32}
role="img"
style={
Object {
"display": "inline-block",
"userSelect": "none",
"verticalAlign": "text-bottom",
}
}
viewBox="0 0 24 24"
width={32}
/>
</div>
</div>
`;
| {
"pile_set_name": "Github"
} |
{
"images" : [
{
"idiom" : "universal",
"filename" : "tz.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "tz@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "tz@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.
package core
import (
"github.com/oracle/oci-go-sdk/v25/common"
"net/http"
)
// GetCpeRequest wrapper for the GetCpe operation
type GetCpeRequest struct {
// The OCID of the CPE.
CpeId *string `mandatory:"true" contributesTo:"path" name:"cpeId"`
// Unique Oracle-assigned identifier for the request.
// If you need to contact Oracle about a particular request, please provide the request ID.
OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`
// Metadata about the request. This information will not be transmitted to the service, but
// represents information that the SDK will consume to drive retry behavior.
RequestMetadata common.RequestMetadata
}
func (request GetCpeRequest) String() string {
return common.PointerString(request)
}
// HTTPRequest implements the OCIRequest interface
func (request GetCpeRequest) HTTPRequest(method, path string) (http.Request, error) {
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
}
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (request GetCpeRequest) RetryPolicy() *common.RetryPolicy {
return request.RequestMetadata.RetryPolicy
}
// GetCpeResponse wrapper for the GetCpe operation
type GetCpeResponse struct {
// The underlying http response
RawResponse *http.Response
// The Cpe instance
Cpe `presentIn:"body"`
// For optimistic concurrency control. See `if-match`.
Etag *string `presentIn:"header" name:"etag"`
// Unique Oracle-assigned identifier for the request. If you need to contact
// Oracle about a particular request, please provide the request ID.
OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
}
func (response GetCpeResponse) String() string {
return common.PointerString(response)
}
// HTTPResponse implements the OCIResponse interface
func (response GetCpeResponse) HTTPResponse() *http.Response {
return response.RawResponse
}
| {
"pile_set_name": "Github"
} |
/*
*
* Copyright (c) 2013,2019 AT&T Knowledge Ventures
* SPDX-License-Identifier: MIT
*/
package com.att.research.xacmlatt.pdp.test.conformance;
import java.io.File;
import java.io.IOException;
import java.nio.file.FileVisitResult;
import java.nio.file.FileVisitor;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* ConformanceTestSet represents a collection of <code>ConformanceTest</code>s ordered by the test name. It has methods for
* scanning a directory to generate an ordered set.
*
* @author car
* @version $Revision: 1.1 $
*/
public class ConformanceTestSet {
private static final Log logger = LogFactory.getLog(ConformanceTestSet.class);
private List<ConformanceTest> listConformanceTests = new ArrayList<ConformanceTest>();
protected List<ConformanceTest> getListConformanceTests() {
return this.listConformanceTests;
}
protected ConformanceTestSet() {
}
private static String getTestName(String fileName, int itemPos) {
return (itemPos == 0 ? "NULL" : fileName.substring(0, itemPos));
}
private static String getTestName(File file) {
String fileName = file.getName();
int itemPos = fileName.indexOf("Policy");
if (itemPos >= 0) {
return getTestName(fileName, itemPos);
} else if ((itemPos = fileName.indexOf("Request")) >= 0) {
return getTestName(fileName, itemPos);
} else if ((itemPos = fileName.indexOf("Response")) >= 0) {
return getTestName(fileName, itemPos);
} else if ((itemPos = fileName.indexOf("Repository")) >= 0) {
return getTestName(fileName, itemPos);
} else {
return null;
}
}
public static ConformanceTestSet loadDirectory(File fileDir) throws IOException {
final Map<String,ConformanceTest> mapConformanceTests = new HashMap<String,ConformanceTest>();
Files.walkFileTree(fileDir.toPath(), new FileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
logger.info("Scanning directory " + dir.getFileName());
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
File fileVisited = file.toFile();
String fileName = fileVisited.getName();
if (fileName.endsWith(".xml") || fileName.endsWith(".properties")) {
String testName = getTestName(fileVisited);
if (testName != null) {
ConformanceTest conformanceTest = mapConformanceTests.get(testName);
if (conformanceTest == null) {
logger.info("Added test " + testName);
conformanceTest = new ConformanceTest(testName);
mapConformanceTests.put(testName, conformanceTest);
}
if (fileName.endsWith("Policy.xml")) {
conformanceTest.getRepository().addRootPolicy(fileVisited);
} else if (fileName.endsWith("Repository.properties")) {
conformanceTest.getRepository().load(fileVisited);
} else if (fileName.endsWith("Request.xml")) {
conformanceTest.setRequest(fileVisited);
} else if (fileName.endsWith("Response.xml")) {
conformanceTest.setResponse(fileVisited);
}
}
}
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
logger.warn("Skipped " + file.getFileName());
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
return FileVisitResult.CONTINUE;
}
});
/*
* Sort the keyset and pull out the tests that have the required components
*/
List<String> listTestNames = new ArrayList<String>();
listTestNames.addAll(mapConformanceTests.keySet());
Collections.sort(listTestNames);
ConformanceTestSet conformanceTestSet = new ConformanceTestSet();
Iterator<String> iterTestNames = listTestNames.iterator();
while (iterTestNames.hasNext()) {
ConformanceTest conformanceTest = mapConformanceTests.get(iterTestNames.next());
if (conformanceTest.isComplete()) {
conformanceTestSet.addConformanceTest(conformanceTest);
logger.debug("Added conformance test " + conformanceTest.getTestName());
} else {
logger.warn("Incomplete conformance test " + conformanceTest.getTestName());
}
}
return conformanceTestSet;
}
public Iterator<ConformanceTest> getConformanceTests() {
return this.listConformanceTests.iterator();
}
public void addConformanceTest(ConformanceTest conformanceTest) {
this.listConformanceTests.add(conformanceTest);
}
public void addConformanceTestSet(ConformanceTestSet conformanceTestSet) {
this.listConformanceTests.addAll(conformanceTestSet.getListConformanceTests());
}
public static void main(String[] args) {
for (String dir : args) {
try {
ConformanceTestSet conformanceTestSet = ConformanceTestSet.loadDirectory(new File(dir));
Iterator<ConformanceTest> iterConformanceTests = conformanceTestSet.getConformanceTests();
if (iterConformanceTests == null) {
System.out.println("No tests found in " + dir);
} else {
System.out.println("Tests found in " + dir);
while (iterConformanceTests.hasNext()) {
System.out.println(iterConformanceTests.next().toString());
}
}
} catch (Exception ex) {
ex.printStackTrace(System.err);
}
}
}
}
| {
"pile_set_name": "Github"
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Sample.Win32")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sample.Win32")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2f8db172-d945-4551-b470-1835ab951ea3")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] | {
"pile_set_name": "Github"
} |
{
"word": "Reflexive",
"definitions": [
"Denoting a pronoun that refers back to the subject of the clause in which it is used, e.g. myself, themselves.",
"(of a verb or clause) having a reflexive pronoun as its object (e.g. wash oneself).",
"(of a relation) always holding between a term and itself.",
"(of a method or theory in the social sciences) taking account of itself or of the effect of the personality or presence of the researcher on what is being investigated.",
"(of an action) performed as a reflex, without conscious thought."
],
"parts-of-speech": "Adjective"
} | {
"pile_set_name": "Github"
} |
// $Id: lists.java,v 1.1 2004-05-23 07:12:55 bfulgham Exp $
// http://www.bagley.org/~doug/shootout/
import java.io.*;
import java.util.*;
import java.text.*;
public class lists {
static int SIZE = 10000;
public static void main(String args[]) {
int n = Integer.parseInt(args[0]);
int result = 0;
for (int i = 0; i < n; i++) {
result = test_lists();
}
System.out.println(result);
}
public static int test_lists() {
int result = 0;
// create a list of integers (Li1) from 1 to SIZE
LinkedList Li1 = new LinkedList();
for (int i = 1; i < SIZE+1; i++) {
Li1.addLast(new Integer(i));
}
// copy the list to Li2 (not by individual items)
LinkedList Li2 = new LinkedList(Li1);
LinkedList Li3 = new LinkedList();
// remove each individual item from left side of Li2 and
// append to right side of Li3 (preserving order)
while (! Li2.isEmpty()) {
Li3.addLast(Li2.removeFirst());
}
// Li2 must now be empty
// remove each individual item from right side of Li3 and
// append to right side of Li2 (reversing list)
while (! Li3.isEmpty()) {
Li2.addLast(Li3.removeLast());
}
// Li3 must now be empty
// reverse Li1
LinkedList tmp = new LinkedList();
while (! Li1.isEmpty()) {
tmp.addFirst(Li1.removeFirst());
}
Li1 = tmp;
// check that first item is now SIZE
if (((Integer)Li1.getFirst()).intValue() != SIZE) {
System.err.println("first item of Li1 != SIZE");
return(0);
}
// compare Li1 and Li2 for equality
if (! Li1.equals(Li2)) {
System.err.println("Li1 and Li2 differ");
System.err.println("Li1:" + Li1);
System.err.println("Li2:" + Li2);
return(0);
}
// return the length of the list
return(Li1.size());
}
}
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: e4732e1210a3d39459db8b431f866659
timeCreated: 1492527856
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
<?php
namespace DeepCopy\f001;
class B extends A
{
private $bProp;
public function getBProp()
{
return $this->bProp;
}
public function setBProp($prop)
{
$this->bProp = $prop;
return $this;
}
}
| {
"pile_set_name": "Github"
} |
%MAPPINGS Info on the mapping class construction of PRTools
%
% This is not a command, just an information file.
%
% Mappings in PRTools are in the MATLAB language defined as objects of the
% class PRMAPPING. In the text below, the words 'object' and 'class' are used
% in the pattern recognition sense.
%
% In the Pattern Recognition Toolbox PRTools, there are many commands to
% define, train and use mappings between spaces of different (or equal)
% dimensionalities. Mappings operate mainly on datasets, i.e. variables of
% the type DATASET (see also DATASETS) and generate datasets and/or other
% mappings. For example:
%
% if A is a M x K dataset (M objects in a K-dimensional space)
% and W is a K x N mapping (a map from K to N dimensions)
% then A*W is a M x N dataset (M objects in a N-dimensional space)
%
% This is enabled by overloading the *-operator for the MAPPING variables.
% A*W is executed by PRMAP(A,W) and may also be called as such.
%
% Mappings can be linear (e.g. a rotation) as well as nonlinear (e.g. a
% neural network). Typically they are used to represent classifiers. In that
% case, a K x C mapping maps a K-feature data vector on the output space of
% a C-class classifier (an exception: some 2-class classifiers, like the
% discriminant functions may be implemented by a mapping onto a 1-dimensional
% space determined by the distance to the discriminant).
%
% Mappings are of the data-type MAPPING (CLASS(W) is a MAPPING), have a size
% of K x C if they map from K to C dimensions. Four types of mapping are
% defined:
%
% untrained, V = A*W.
%
% Trains the untrained mapping W, resulting in the trained mapping V. W
% has to be defined by W = PRMAPPING(MAPPING_FILE,{PAR1, PAR2}), in which
% MAPPING_FILE is the name of the routine that executes the training and
% PAR1, and PAR2 are two parameters that have to be included into the call
% to MAPPING_FILE. Consequently, A*W is executed by PRTools as
% MAPPING_FILE(A,PAR1,PAR2).
%
% Example: train the 3-NN classifier on the generated data.
%
% W = knnc([],3); % untrained classifier
% V = gendatd([50 50])*W; % trained classifier
%
% trained, D = B*V
%
% Maps the dataset B on the trained mapping or classifier V, e.g. as
% trained above. The resulting dataset D has as many objects (rows) as A,
% but its feature size is now C if V is a K x C mapping. Typically, C is
% the number of classes in the training set A or a reduced number of
% features determined by the the training of V. V is defined by
% V = PRMAPPING(MAPPING_FILE,'trained',DATA,LABELS,SIZE_IN,SIZE_OUT),
% in which the MAPPING_FILE is the name of the routine that executes the
% mapping, DATA is a field in which the parameters are stored (e.g.
% weights) for the mapping execution, LABELS are the feature labels to be
% assigned to the resulting dataset D = B*V (e.g. the class names) and
% SIZE_IN and SIZE_OUT are the dimensionalities of the input and output
% spaces. They are used for error checking only. D = B*V is executed by
% PRTools as MAPPING_FILE(B,W). Example:
%
% A = gendatd([50 50],10); % generate random 10D datasets
% B = gendatd([50 50],10);
% W = klm([],0.9); % untrained mapping, Karhunen-Loeve projection
% V = A*W; % trained mapping V
% D = B*V; % the result of the projection of B onto V
%
% fixed, D = A*W
%
% Maps the dataset A by the fixed mapping W, resulting into a transformed
% dataset D. Examples are scaling and normalization, e.g. W =
% PRMAPPING('SIGM','fixed',S) defines a fixed mapping by the sigmoid function
% SIGM a scaling parameter S. A*W is executed by PRTools as SIGM(A,S).
%
% Example: normalize the distances of all objects in A such that their
% city block distances to the origin are one.
%
% A = gendatb([50 50]);
% W = normm;
% D = A*W;
%
% combiner, U = V*W
%
% Combines two mappings. The mapping W is able to combine itself with V
% and produces a single mapping U. A combiner is defined by
% W = PRMAPPING(MAPPING_FILE,'combiner',{PAR1,PAR2})
% in which MAPPING_FILE is the name of the routine that executes the
% combining and PAR1, and PAR2 are the parameters that have to be included
% into the call to the MAPPING_FILE. Consequently, V*W is executed by
% PRTools as MAPPING_FILE(V,PAR1,PAR2). In a call as D = A*V*W, first B =
% A*V is resolved and may result in a dataset B. Consequently, W should be
% able to handle datasets, and MAPPING_FILE is now called by
% MAPPING_FILE(B,PAR1,PAR2) Remark: the combiner construction is not
% necessary, since PRTools stores U = V*W as a SEQUENTIAL mapping (see
% below) if W is not a combiner. The construction of combiners, however,
% may increase the transparency for the user and efficiency in
% computations. Example:
%
% A = gendatd([50 50],10); % generate random 10D datasets
% B = gendatd([50 50],10);
% V = klm([],0.9); % untrained Karhunen-Loeve (KL) projection
% W = ldc; % untrained linear classifier LDC
% U = V*W; % untrained combiner
% T = A*U; % trained combiner
% D = B*T; % apply the combiner (first KL projection,
% % then LDC) to B
%
% Differences between the four types of mappings are now summarized for
% a dataset A and a mapping W:
% A*W - untrained : results in a mapping
% - trained : results in a dataset, size checking
% - fixed : results in a dataset, no size checking
% - combiner : treated as fixed
%
% Suppose V is a fixed mapping, then for the various possibilities of
% the mapping W, the following holds:
% A*(V*W) - untrained : evaluated as V*(A*V*W), resulting in a mapping
% - trained : evaluated as A*V*W, resulting in a dataset
% - fixed : evaluated as A*V*W, resulting in a dataset
% - combiner : evaluated as A*(V*W), resulting in a dataset
%
% Suppose V is an untrained mapping, then for the various possibilities of
% the mapping W holds:
% A*(V*W) - untrained : evaluated as A*V*(A*(A*V)*W), resulting in a mapping
% - trained : evaluated as A*V*W, resulting in a mapping
% - fixed : evaluated as A*V*W, resulting in a mapping
% - combiner : evaluated as A*(V*W), resulting in a mapping
%
% Suppose V is a trained mapping, then for the various possibilities of
% the mapping W holds:
% A*(V*W) - untrained : evaluated as V*(A*V*W), resulting in a mapping
% - trained : evaluated as A*V*W, resulting in a dataset
% - fixed : evaluated as A*V*W, resulting in a dataset
% - combiner : evaluated as A*(V*W), resulting in a dataset
%
% The data fields stored in the MAPPING W = A*QDC can be found by
%
% STRUCT(W)
%
% which may display:
%
% MAPPING_FILE: 'normal_map'
% MAPPING_TYPE: 'trained'
% DATA: [1x1 struct]
% LABELS: [2x1 double]
% SIZE_IN: 2
% SIZE_OUT: 2
% SCALE: 1
% COST: []
% OUT_CONV: 0
% NAME: []
% USER: []
% VERSION: {1x2 cell }
%
% These fields have the following meaning:
% MAPPING_FILE: Name of the m-file that executes the mapping.
% MAPPING_TYPE: Type of mapping: 'untrained','trained','fixed' or 'combiner'.
% DATA: Parameters or data for handling or executing the mapping.
% LABELS: Label list used as FEATLAB for labeling the features of the
% output PRDATASET.
% SIZE_IN: Expected input dimensionality of the data to be mapped.
% If not set, it is neglected, otherwise it is used for the error
% checking and display of the mapping size on the command line.
% SIZE_OUT: Dimensionality of the output space. It should correspond to the
% size of LABLIST. SIZE_OUT may be size vector, e.g. describing
% the size of an image. See also the FEATSIZE field of PRDATASET.
% SCALE: Output multiplication factor. If SCALE is a scalar all
% multiplied by it. SCALE may also be a vector with size as
% defined by SIZE_OUT to set separate scalings for each output.
% COST: Classification costs in case the mapping defines a classifier.
% OUT_CONV: Defines for trained and fixed mappings the output conversion:
% - 0 : no conversion (to be used for mappings that output
% confidences or densities;
% - 1 : sigmoid (for discriminants that output distances);
% - 2 : normalisation (for converting densities and confidences
% into posterior probability estimates;
% - 3 : for performing sigmoid as well as normalisation.
% NAME: Name of the mapping, used for informing the user on the
% command line, as well as for annotating plots.
% USER: User field, not used by PRTools.
% VERSION: Some information related to the version of PRTools used for
% the mapping definition.
%
%
% The fields can be set by commands like SETMAPPING_FILE, SETDATA, SETLABELS,
% SETSIZE, and may be retrieved by commands like GETMAPPING_FILE, GETDATA,
% GETLABELS and SETSIZE. Information stored in a mapping can be found
% as follows:
% - By DOUBLE(W) and by +W the content of the W.DATA is returned.
% - DISPLAY(W) writes the size of the mapping, the number of classes and the
% label type on the terminal screen.
% - SIZE(W) returns dimensionalities of input space and output space.
% - SCATTERD(A) makes a scatter-plot of a dataset.
% - SHOW(W) may be used to display images that are stored in mappings with
% the MAPPING_FILE 'affine'.
% - Using the dot extension as for structures, e.g. NAME = W.NAME;
% - The routines ISAFFINE, ISCLASSIFIER, ISCOMBINER, ISEMPTY, ISFIXED,
% ISTRAINED and ISUNTRAINED test on some mapping types and states.
%
% Some standard MATLAB operations have been overloaded for variables of the
% type PRMAPPING. They are defined as follows:
% W' Defined for affine mappings only. It returns a transposed mapping.
% [W,V] Builds a combined classifier (see STACKED) operating in the same
% feature space. A * [W V] = [A*W A*V].
% [W;V] Builds a combined classifier (see PARALLEL) operating in different
% feature spaces: [A B] * [W;V] = [A*W B*V]. W and V should be
% mappings that correspond to the feature sizes of A and B.
% A*W Maps a DATASET A by the MAPPING W. This is executed by PRMAP(A,W).
% V*W Combines the mappings V and W sequentially. This is executed by
% SEQUENTIAL(V,W).
% W+CON Adding a constant is defined for affine mappings only.
% W(:,K) Output selection. If W is a trained mapping, just the features
% listed in K are returned.
%
%
% SEE ALSO (<a href="http://37steps.com/prtools">PRTools Guide</a>)
% PRMAPPING, CLASSC, CNORMC, LABELD,
%
% - Classifiers
% NMC, KNNC, UDC, LDC, QDC, MOGC, QUADRC, FISHERC, PARZENC, PARZENDC,
% TREEC, LOGLC, NAIVEBC, SVC, RBSVC, NUSVC, LIBSVC, TREEC, PERLC, BPXNC,
% RBNC, LMNC, WEAKC, STUMPC, SUBSC, ADABOOSTC, BAGGINGC, FDSC, VPC, DRBMC
%
% - Classifier Combiners
% STACKED, PARALLEL, SEQUENTIAL, MEANC, AVERAGEC, PRODC, MEDIANC, MINC,
% MAXC, VOTEC, WVOTEC, MODSELC, DCSC, RSSCC, MLRC, NAIVEBCC, TRAINCC
%
% - Density Estimation
% GAUSSM, PARZENM, KNNM,
%
% - Dimension Reduction
% FEATSEL, FEATSELB, FEATSELF, FEATSELI, FEATSELLR, FEATSELM, FEATSELO,
% FEATSELP, FEATSELV, BHATM, FISHERM, CHERNOFFM, KLM, KLMS, NLFISHERM,
% PCAM, REDUCM
%
% - Scaling
% SCALEM, CMAPM, SIGM, INVSIGM, NORMM
%
% - Set commands
% SETBATCH, SETCOST, SETDATA, SETLABELS, SETMAPPING_FILE,SETMAPPING_TYPE,
% SETNAME, SETOUT_CONV, SETPOSTPROC, SETSCALE, SETSIZE, SETSIZE_IN,
% SETSIZE_OUT, SETUSER
%
% - Get commands
% GETBATCH, GETCOST, GETDATA, GETLABELS, GETMAPPING_FILE,, GETMAPPING_TYPE,
% GETNAME, GETOUT_CONV, GETSCALE, GETSIZE, GETSIZE_IN, GETSIZE_OUT, GETUSER
%
% - Tests
% ISAFFINE, ISCLASSIFIER, ISEMPTY, ISPARALLEL, ISSTACKED, ISSEQUENTIAL,
% ISTRAINED, ISUNTRAINED, ISFIXED, ISCOMBINER,
% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
% Faculty EWI, Delft University of Technology
% P.O. Box 5031, 2600 GA Delft, The Netherlands
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of Mustache.php.
*
* (c) 2010-2017 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Mustache Cache filesystem implementation.
*
* A FilesystemCache instance caches Mustache Template classes from the filesystem by name:
*
* $cache = new Mustache_Cache_FilesystemCache(dirname(__FILE__).'/cache');
* $cache->cache($className, $compiledSource);
*
* The FilesystemCache benefits from any opcode caching that may be setup in your environment. So do that, k?
*/
class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
{
private $baseDir;
private $fileMode;
/**
* Filesystem cache constructor.
*
* @param string $baseDir Directory for compiled templates
* @param int $fileMode Override default permissions for cache files. Defaults to using the system-defined umask
*/
public function __construct($baseDir, $fileMode = null)
{
$this->baseDir = $baseDir;
$this->fileMode = $fileMode;
}
/**
* Load the class from cache using `require_once`.
*
* @param string $key
*
* @return bool
*/
public function load($key)
{
$fileName = $this->getCacheFilename($key);
if (!is_file($fileName)) {
return false;
}
require_once $fileName;
return true;
}
/**
* Cache and load the compiled class.
*
* @param string $key
* @param string $value
*/
public function cache($key, $value)
{
$fileName = $this->getCacheFilename($key);
$this->log(
Mustache_Logger::DEBUG,
'Writing to template cache: "{fileName}"',
array('fileName' => $fileName)
);
$this->writeFile($fileName, $value);
$this->load($key);
}
/**
* Build the cache filename.
* Subclasses should override for custom cache directory structures.
*
* @param string $name
*
* @return string
*/
protected function getCacheFilename($name)
{
return sprintf('%s/%s.php', $this->baseDir, $name);
}
/**
* Create cache directory.
*
* @throws Mustache_Exception_RuntimeException If unable to create directory
*
* @param string $fileName
*
* @return string
*/
private function buildDirectoryForFilename($fileName)
{
$dirName = dirname($fileName);
if (!is_dir($dirName)) {
$this->log(
Mustache_Logger::INFO,
'Creating Mustache template cache directory: "{dirName}"',
array('dirName' => $dirName)
);
@mkdir($dirName, 0777, true);
// @codeCoverageIgnoreStart
if (!is_dir($dirName)) {
throw new Mustache_Exception_RuntimeException(sprintf('Failed to create cache directory "%s".', $dirName));
}
// @codeCoverageIgnoreEnd
}
return $dirName;
}
/**
* Write cache file.
*
* @throws Mustache_Exception_RuntimeException If unable to write file
*
* @param string $fileName
* @param string $value
*/
private function writeFile($fileName, $value)
{
$dirName = $this->buildDirectoryForFilename($fileName);
$this->log(
Mustache_Logger::DEBUG,
'Caching compiled template to "{fileName}"',
array('fileName' => $fileName)
);
$tempFile = tempnam($dirName, basename($fileName));
if (false !== @file_put_contents($tempFile, $value)) {
if (@rename($tempFile, $fileName)) {
$mode = isset($this->fileMode) ? $this->fileMode : (0666 & ~umask());
@chmod($fileName, $mode);
return;
}
// @codeCoverageIgnoreStart
$this->log(
Mustache_Logger::ERROR,
'Unable to rename Mustache temp cache file: "{tempName}" -> "{fileName}"',
array('tempName' => $tempFile, 'fileName' => $fileName)
);
// @codeCoverageIgnoreEnd
}
// @codeCoverageIgnoreStart
throw new Mustache_Exception_RuntimeException(sprintf('Failed to write cache file "%s".', $fileName));
// @codeCoverageIgnoreEnd
}
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link rel="icon" href="%REACT_APP_AVATAR_URL%?type=normal"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="theme-color" content="%REACT_APP_THEME_COLOR%"/>
<meta name="description" content="%REACT_APP_DESCRIPTION%"/>
<meta name="author" content="%REACT_APP_FULL_NAME%"/>
<meta property="og:title" content="%REACT_APP_FULL_NAME%"/>
<meta property="og:image" content="%PUBLIC_URL%/screenshot.png"/>
<meta property="og:description" content="%REACT_APP_DESCRIPTION%"/>
<link rel="apple-touch-icon" href="%REACT_APP_AVATAR_URL%?type=normal"/>
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"/>
<title>%REACT_APP_FULL_NAME%</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments);
};
i[r].l = 1 * new Date();
a = s.createElement(o);
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-74575204-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
package client
const (
ResourceFieldSelectorType = "resourceFieldSelector"
ResourceFieldSelectorFieldContainerName = "containerName"
ResourceFieldSelectorFieldDivisor = "divisor"
ResourceFieldSelectorFieldResource = "resource"
)
type ResourceFieldSelector struct {
ContainerName string `json:"containerName,omitempty" yaml:"containerName,omitempty"`
Divisor string `json:"divisor,omitempty" yaml:"divisor,omitempty"`
Resource string `json:"resource,omitempty" yaml:"resource,omitempty"`
}
| {
"pile_set_name": "Github"
} |
/* DASHBOARD */
.dashboard .module table th {
width: 100%;
}
.dashboard .module table td {
white-space: nowrap;
}
.dashboard .module table td a {
display: block;
padding-right: .6em;
}
/* RECENT ACTIONS MODULE */
.module ul.actionlist {
margin-left: 0;
}
ul.actionlist li {
list-style-type: none;
}
ul.actionlist li.changelink {
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
} | {
"pile_set_name": "Github"
} |
.mui-text-field {
$disabled-text-color: rgba($body-text-color, 0.3);
$error-color: $red-500;
transform: scale(1) translate3d(0, 0, 0);
font-size: 16px;
line-height: 24px;
width: 64px * 4;
height: 48px;
display: inline-block;
position: relative;
@include ease-out($duration: 200ms, $property: height);
//Normal Text Field Styles
//------------------------
.mui-text-field-hint,
.mui-text-field-floating-label {
position: absolute;
line-height: 48px;
color: $disabled-text-color;
opacity: 1;
@include ease-out();
}
.mui-text-field-error {
position: absolute;
bottom: -10px;
font-size: 12px;
line-height: 12px;
color: $error-color;
@include ease-out();
}
.mui-text-field-input,
.mui-text-field-textarea {
position: relative;
width: 100%;
height: 100%;
border: none;
outline: none;
background-color: $transparent;
color: $body-text-color;
}
.mui-text-field-textarea {
margin-top: 12px;
}
.mui-text-field-underline,
.mui-text-field-focus-underline {
position: absolute;
width: 100%;
bottom: 8px;
margin: 0;
}
.mui-text-field-focus-underline {
border-color: $primary-1-color;
border-bottom-width: 2px;
transform: scaleX(0);
@include ease-out();
}
&.mui-has-error {
.mui-text-field-focus-underline {
border-color: $error-color;
transform: scaleX(1);
}
}
&.mui-has-value {
.mui-text-field-hint {
opacity: 0;
}
}
&.mui-is-disabled {
.mui-text-field-input {
color: $disabled-text-color;
}
.mui-text-field-underline {
border: none;
height: 40px;
overflow: hidden;
//hack because border style dotted just doesn't look right
//border-bottom-style: dotted;
&:after {
content: '..............................................................................................................................................................................................................................................................................................................................................................';
position: absolute;
top: 23px;
color: $disabled-text-color;
}
}
}
&.mui-is-focused {
.mui-text-field-focus-underline {
transform: scaleX(1);
}
}
//Floating Label Text Field Styles
//--------------------------------
&.mui-has-floating-labels {
height: 72px;
.mui-text-field-floating-label {
top: 24px;
transform: scale(1) translate3d(0, 0, 0);
transform-origin: left top;
}
.mui-text-field-hint {
top: 24px;
opacity: 0;
}
.mui-text-field-input {
padding-top: 24px;
}
&.mui-has-value,
&.mui-is-focused {
.mui-text-field-floating-label {
transform: scale(0.75) translate3d(0, -18px, 0);
}
}
&.mui-has-value {
.mui-text-field-floating-label {
color: rgba($body-text-color, 0.5);
}
}
&.mui-is-disabled {
.mui-text-field-hint {
color: $disabled-text-color;
}
}
&.mui-is-focused {
.mui-text-field-hint {
opacity: 1;
}
.mui-text-field-floating-label {
transform: scale(0.75) translate3d(0, -18px, 0);
color: $primary-1-color;
}
&.mui-has-error {
.mui-text-field-floating-label {
color: $error-color;
}
}
&.mui-has-value {
.mui-text-field-hint {
opacity: 0;
}
}
}
}
} | {
"pile_set_name": "Github"
} |
/*
* Copyright © 2012-2016 VMware, 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.
*/
namespace VMCertStoreSnapIn
{
// Should subclass AppKit.NSView
[Foundation.Register ("ServerInfoPopOver")]
public partial class ServerInfoPopOver
{
}
}
| {
"pile_set_name": "Github"
} |
; Test 32-bit ORs in which the second operand is constant.
;
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
; Check the lowest useful OILL value.
define i32 @f1(i32 %a) {
; CHECK-LABEL: f1:
; CHECK: oill %r2, 1
; CHECK: br %r14
%or = or i32 %a, 1
ret i32 %or
}
; Check the high end of the OILL range.
define i32 @f2(i32 %a) {
; CHECK-LABEL: f2:
; CHECK: oill %r2, 65535
; CHECK: br %r14
%or = or i32 %a, 65535
ret i32 %or
}
; Check the lowest useful OILH range, which is the next value up.
define i32 @f3(i32 %a) {
; CHECK-LABEL: f3:
; CHECK: oilh %r2, 1
; CHECK: br %r14
%or = or i32 %a, 65536
ret i32 %or
}
; Check the lowest useful OILF value, which is the next value up again.
define i32 @f4(i32 %a) {
; CHECK-LABEL: f4:
; CHECK: oilf %r2, 65537
; CHECK: br %r14
%or = or i32 %a, 65537
ret i32 %or
}
; Check the high end of the OILH range.
define i32 @f5(i32 %a) {
; CHECK-LABEL: f5:
; CHECK: oilh %r2, 65535
; CHECK: br %r14
%or = or i32 %a, -65536
ret i32 %or
}
; Check the next value up, which must use OILF instead.
define i32 @f6(i32 %a) {
; CHECK-LABEL: f6:
; CHECK: oilf %r2, 4294901761
; CHECK: br %r14
%or = or i32 %a, -65535
ret i32 %or
}
; Check the highest useful OILF value.
define i32 @f7(i32 %a) {
; CHECK-LABEL: f7:
; CHECK: oilf %r2, 4294967294
; CHECK: br %r14
%or = or i32 %a, -2
ret i32 %or
}
| {
"pile_set_name": "Github"
} |
libavformat/mxf.o: libavformat/mxf.c libavutil/common.h \
libavutil/attributes.h libavutil/macros.h libavutil/version.h \
libavutil/avconfig.h config.h libavutil/intmath.h libavutil/common.h \
libavutil/mem.h libavutil/error.h libavutil/avutil.h \
libavutil/rational.h libavutil/mathematics.h libavutil/intfloat.h \
libavutil/log.h libavutil/pixfmt.h libavutil/internal.h \
libavutil/timer.h libavutil/cpu.h libavutil/dict.h libavutil/libm.h \
libavformat/mxf.h libavformat/avformat.h libavcodec/avcodec.h \
libavutil/samplefmt.h libavutil/attributes.h libavutil/avutil.h \
libavutil/buffer.h libavutil/cpu.h libavutil/channel_layout.h \
libavutil/dict.h libavutil/frame.h libavutil/buffer.h \
libavutil/samplefmt.h libavutil/log.h libavutil/pixfmt.h \
libavutil/rational.h libavcodec/version.h libavutil/version.h \
libavformat/avio.h libavformat/version.h
| {
"pile_set_name": "Github"
} |
/* Copyright (c) 2002-2012 Croteam Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as published by
the Free Software Foundation
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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. */
// Animation names
#define WATCHPLAYERS_ANIM_DEFAULT_ANIMATION 0
// Color names
// Patch names
// Names of collision boxes
#define WATCHPLAYERS_COLLISION_BOX_PART_NAME 0
// Attaching position names
// Sound names
| {
"pile_set_name": "Github"
} |
"""Compressed Sparse Row matrix format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['csr_matrix', 'isspmatrix_csr']
import numpy as np
from scipy._lib.six import xrange
from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
get_csr_submatrix, csr_sample_values
from .sputils import (upcast, isintlike, IndexMixin, issequence,
get_index_dtype, ismatrix)
from .compressed import _cs_matrix
class csr_matrix(_cs_matrix, IndexMixin):
"""
Compressed Sparse Row matrix
This can be instantiated in several ways:
csr_matrix(D)
with a dense matrix or rank-2 ndarray D
csr_matrix(S)
with another sparse matrix S (equivalent to S.tocsr())
csr_matrix((M, N), [dtype])
to construct an empty matrix with shape (M, N)
dtype is optional, defaulting to dtype='d'.
csr_matrix((data, (row_ind, col_ind)), [shape=(M, N)])
where ``data``, ``row_ind`` and ``col_ind`` satisfy the
relationship ``a[row_ind[k], col_ind[k]] = data[k]``.
csr_matrix((data, indices, indptr), [shape=(M, N)])
is the standard CSR representation where the column indices for
row i are stored in ``indices[indptr[i]:indptr[i+1]]`` and their
corresponding values are stored in ``data[indptr[i]:indptr[i+1]]``.
If the shape parameter is not supplied, the matrix dimensions
are inferred from the index arrays.
Attributes
----------
dtype : dtype
Data type of the matrix
shape : 2-tuple
Shape of the matrix
ndim : int
Number of dimensions (this is always 2)
nnz
Number of nonzero elements
data
CSR format data array of the matrix
indices
CSR format index array of the matrix
indptr
CSR format index pointer array of the matrix
has_sorted_indices
Whether indices are sorted
Notes
-----
Sparse matrices can be used in arithmetic operations: they support
addition, subtraction, multiplication, division, and matrix power.
Advantages of the CSR format
- efficient arithmetic operations CSR + CSR, CSR * CSR, etc.
- efficient row slicing
- fast matrix vector products
Disadvantages of the CSR format
- slow column slicing operations (consider CSC)
- changes to the sparsity structure are expensive (consider LIL or DOK)
Examples
--------
>>> import numpy as np
>>> from scipy.sparse import csr_matrix
>>> csr_matrix((3, 4), dtype=np.int8).toarray()
array([[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0]], dtype=int8)
>>> row = np.array([0, 0, 1, 2, 2, 2])
>>> col = np.array([0, 2, 2, 0, 1, 2])
>>> data = np.array([1, 2, 3, 4, 5, 6])
>>> csr_matrix((data, (row, col)), shape=(3, 3)).toarray()
array([[1, 0, 2],
[0, 0, 3],
[4, 5, 6]])
>>> indptr = np.array([0, 2, 3, 6])
>>> indices = np.array([0, 2, 2, 0, 1, 2])
>>> data = np.array([1, 2, 3, 4, 5, 6])
>>> csr_matrix((data, indices, indptr), shape=(3, 3)).toarray()
array([[1, 0, 2],
[0, 0, 3],
[4, 5, 6]])
As an example of how to construct a CSR matrix incrementally,
the following snippet builds a term-document matrix from texts:
>>> docs = [["hello", "world", "hello"], ["goodbye", "cruel", "world"]]
>>> indptr = [0]
>>> indices = []
>>> data = []
>>> vocabulary = {}
>>> for d in docs:
... for term in d:
... index = vocabulary.setdefault(term, len(vocabulary))
... indices.append(index)
... data.append(1)
... indptr.append(len(indices))
...
>>> csr_matrix((data, indices, indptr), dtype=int).toarray()
array([[2, 1, 0, 0],
[0, 1, 1, 1]])
"""
def transpose(self, copy=False):
from .csc import csc_matrix
M,N = self.shape
return csc_matrix((self.data,self.indices,self.indptr), shape=(N,M), copy=copy)
def tolil(self):
from .lil import lil_matrix
lil = lil_matrix(self.shape,dtype=self.dtype)
self.sort_indices() # lil_matrix needs sorted column indices
ptr,ind,dat = self.indptr,self.indices,self.data
rows, data = lil.rows, lil.data
for n in xrange(self.shape[0]):
start = ptr[n]
end = ptr[n+1]
rows[n] = ind[start:end].tolist()
data[n] = dat[start:end].tolist()
return lil
def tocsr(self, copy=False):
if copy:
return self.copy()
else:
return self
def tocsc(self):
idx_dtype = get_index_dtype((self.indptr, self.indices),
maxval=max(self.nnz, self.shape[0]))
indptr = np.empty(self.shape[1] + 1, dtype=idx_dtype)
indices = np.empty(self.nnz, dtype=idx_dtype)
data = np.empty(self.nnz, dtype=upcast(self.dtype))
csr_tocsc(self.shape[0], self.shape[1],
self.indptr.astype(idx_dtype),
self.indices.astype(idx_dtype),
self.data,
indptr,
indices,
data)
from .csc import csc_matrix
A = csc_matrix((data, indices, indptr), shape=self.shape)
A.has_sorted_indices = True
return A
def tobsr(self, blocksize=None, copy=True):
from .bsr import bsr_matrix
if blocksize is None:
from .spfuncs import estimate_blocksize
return self.tobsr(blocksize=estimate_blocksize(self))
elif blocksize == (1,1):
arg1 = (self.data.reshape(-1,1,1),self.indices,self.indptr)
return bsr_matrix(arg1, shape=self.shape, copy=copy)
else:
R,C = blocksize
M,N = self.shape
if R < 1 or C < 1 or M % R != 0 or N % C != 0:
raise ValueError('invalid blocksize %s' % blocksize)
blks = csr_count_blocks(M,N,R,C,self.indptr,self.indices)
idx_dtype = get_index_dtype((self.indptr, self.indices),
maxval=max(N//C, blks))
indptr = np.empty(M//R+1, dtype=idx_dtype)
indices = np.empty(blks, dtype=idx_dtype)
data = np.zeros((blks,R,C), dtype=self.dtype)
csr_tobsr(M, N, R, C,
self.indptr.astype(idx_dtype),
self.indices.astype(idx_dtype),
self.data,
indptr, indices, data.ravel())
return bsr_matrix((data,indices,indptr), shape=self.shape)
# these functions are used by the parent class (_cs_matrix)
# to remove redudancy between csc_matrix and csr_matrix
def _swap(self,x):
"""swap the members of x if this is a column-oriented matrix
"""
return (x[0],x[1])
def __getitem__(self, key):
def asindices(x):
try:
x = np.asarray(x)
# Check index contents, to avoid creating 64-bit arrays needlessly
idx_dtype = get_index_dtype((x,), check_contents=True)
if idx_dtype != x.dtype:
x = x.astype(idx_dtype)
except:
raise IndexError('invalid index')
else:
return x
def check_bounds(indices, N):
if indices.size == 0:
return (0, 0)
max_indx = indices.max()
if max_indx >= N:
raise IndexError('index (%d) out of range' % max_indx)
min_indx = indices.min()
if min_indx < -N:
raise IndexError('index (%d) out of range' % (N + min_indx))
return (min_indx,max_indx)
def extractor(indices,N):
"""Return a sparse matrix P so that P*self implements
slicing of the form self[[1,2,3],:]
"""
indices = asindices(indices)
(min_indx,max_indx) = check_bounds(indices,N)
if min_indx < 0:
indices = indices.copy()
indices[indices < 0] += N
indptr = np.arange(len(indices)+1, dtype=indices.dtype)
data = np.ones(len(indices), dtype=self.dtype)
shape = (len(indices),N)
return csr_matrix((data,indices,indptr), shape=shape)
row, col = self._unpack_index(key)
# First attempt to use original row optimized methods
# [1, ?]
if isintlike(row):
# [i, j]
if isintlike(col):
return self._get_single_element(row, col)
# [i, 1:2]
elif isinstance(col, slice):
return self._get_row_slice(row, col)
# [i, [1, 2]]
elif issequence(col):
P = extractor(col,self.shape[1]).T
return self[row, :] * P
elif isinstance(row, slice):
# [1:2,??]
if ((isintlike(col) and row.step in (1, None)) or
(isinstance(col, slice) and
col.step in (1, None) and
row.step in (1, None))):
# col is int or slice with step 1, row is slice with step 1.
return self._get_submatrix(row, col)
elif issequence(col):
# row is slice, col is sequence.
P = extractor(col,self.shape[1]).T # [1:2,[1,2]]
sliced = self
if row != slice(None, None, None):
sliced = sliced[row,:]
return sliced * P
elif issequence(row):
# [[1,2],??]
if isintlike(col) or isinstance(col,slice):
P = extractor(row, self.shape[0]) # [[1,2],j] or [[1,2],1:2]
extracted = P * self
if col == slice(None, None, None):
return extracted
else:
return extracted[:,col]
elif ismatrix(row) and issequence(col):
if len(row[0]) == 1 and isintlike(row[0][0]):
# [[[1],[2]], [1,2]], outer indexing
row = asindices(row)
P_row = extractor(row[:,0], self.shape[0])
P_col = extractor(col, self.shape[1]).T
return P_row * self * P_col
if not (issequence(col) and issequence(row)):
# Sample elementwise
row, col = self._index_to_arrays(row, col)
row = asindices(row)
col = asindices(col)
if row.shape != col.shape:
raise IndexError('number of row and column indices differ')
assert row.ndim <= 2
num_samples = np.size(row)
if num_samples == 0:
return csr_matrix(np.atleast_2d(row).shape, dtype=self.dtype)
check_bounds(row, self.shape[0])
check_bounds(col, self.shape[1])
val = np.empty(num_samples, dtype=self.dtype)
csr_sample_values(self.shape[0], self.shape[1],
self.indptr, self.indices, self.data,
num_samples, row.ravel(), col.ravel(), val)
if row.ndim == 1:
# row and col are 1d
return np.asmatrix(val)
return self.__class__(val.reshape(row.shape))
def getrow(self, i):
"""Returns a copy of row i of the matrix, as a (1 x n)
CSR matrix (row vector).
"""
return self._get_submatrix(i, slice(None))
def getcol(self, i):
"""Returns a copy of column i of the matrix, as a (m x 1)
CSR matrix (column vector).
"""
return self._get_submatrix(slice(None), i)
def _get_row_slice(self, i, cslice):
"""Returns a copy of row self[i, cslice]
"""
if i < 0:
i += self.shape[0]
if i < 0 or i >= self.shape[0]:
raise IndexError('index (%d) out of range' % i)
start, stop, stride = cslice.indices(self.shape[1])
if stride == 1:
# for stride == 1, _get_submatrix is ~30% faster than below
row_slice = self._get_submatrix(i, cslice)
else:
# other strides need new code
row_indices = self.indices[self.indptr[i]:self.indptr[i + 1]]
row_data = self.data[self.indptr[i]:self.indptr[i + 1]]
if stride > 0:
ind = (row_indices >= start) & (row_indices < stop)
elif stride < 0:
ind = (row_indices <= start) & (row_indices > stop)
if abs(stride) > 1:
ind = ind & ((row_indices - start) % stride == 0)
row_indices = (row_indices[ind] - start) // stride
row_data = row_data[ind]
row_indptr = np.array([0, len(row_indices)])
if stride < 0:
row_data = row_data[::-1]
row_indices = abs(row_indices[::-1])
shape = (1, int(np.ceil(float(stop - start) / stride)))
row_slice = csr_matrix((row_data, row_indices, row_indptr),
shape=shape)
return row_slice
def _get_submatrix(self, row_slice, col_slice):
"""Return a submatrix of this matrix (new matrix is created)."""
M,N = self.shape
def process_slice(sl, num):
if isinstance(sl, slice):
if sl.step not in (1, None):
raise ValueError('slicing with step != 1 not supported')
i0, i1 = sl.start, sl.stop
if i0 is None:
i0 = 0
elif i0 < 0:
i0 = num + i0
if i1 is None:
i1 = num
elif i1 < 0:
i1 = num + i1
return i0, i1
elif isintlike(sl):
if sl < 0:
sl += num
return sl, sl + 1
else:
raise TypeError('expected slice or scalar')
def check_bounds(i0, i1, num):
if not (0 <= i0 <= num) or not (0 <= i1 <= num) or not (i0 <= i1):
raise IndexError(
"index out of bounds: 0 <= %d <= %d, 0 <= %d <= %d,"
" %d <= %d" % (i0, num, i1, num, i0, i1))
i0, i1 = process_slice(row_slice, M)
j0, j1 = process_slice(col_slice, N)
check_bounds(i0, i1, M)
check_bounds(j0, j1, N)
indptr, indices, data = get_csr_submatrix(M, N,
self.indptr, self.indices, self.data,
int(i0), int(i1), int(j0), int(j1))
shape = (i1 - i0, j1 - j0)
return self.__class__((data,indices,indptr), shape=shape)
def isspmatrix_csr(x):
return isinstance(x, csr_matrix)
| {
"pile_set_name": "Github"
} |
public class Jensen2 {
interface IntToDoubleFunction {
double apply(int n);
}
static double sum(int lo, int hi, IntToDoubleFunction f) {
double res = 0;
for (int i = lo; i <= hi; i++)
res += f.apply(i);
return res;
}
public static void main(String args[]) {
System.out.println(
sum(1, 100,
new IntToDoubleFunction() {
public double apply(int i) { return 1.0/i;}
}));
}
}
| {
"pile_set_name": "Github"
} |
<?php declare(strict_types=1);
namespace Shopware\Core\Framework\Api\Converter\Exceptions;
use Shopware\Core\Framework\ShopwareHttpException;
use Symfony\Component\HttpFoundation\Response;
class WriteRemovedFieldException extends ShopwareHttpException
{
public function __construct(string $field, string $entityName, int $apiVersion)
{
parent::__construct(
'The field "{{ field }}" on entity "{{ entityName }}" was removed in v{{ apiVersion }} of the API and cannot be written',
[
'field' => $field,
'entityName' => $entityName,
'apiVersion' => $apiVersion,
]
);
}
public function getStatusCode(): int
{
return Response::HTTP_BAD_REQUEST;
}
public function getErrorCode(): string
{
return 'FRAMEWORK__WRITE_REMOVED_FIELD';
}
}
| {
"pile_set_name": "Github"
} |
/* eslint-disable */
/**
* @file 公共方法
* @author yangmingming
*/
// TEXTURE_NAME, 材质name
// 材质坐标转化成真实尺寸坐标
export default `
vec2 _2d_shape_TEXTURE_NAME = vec2(float(width_TEXTURE_NAME), float(height_TEXTURE_NAME));
vec2 moveTexture2PosToReal_TEXTURE_NAME(vec2 v) {
return v * _2d_shape_TEXTURE_NAME;
// vec2 v2;
// v2.x = v.x * float(width_TEXTURE_NAME);
// v2.y = v.y * float(height_TEXTURE_NAME);
// return v2;
}
`;
| {
"pile_set_name": "Github"
} |
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
// http://github.com/gogo/protobuf
//
// 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.
//
// 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.
/*
Package gogoproto provides extensions for protocol buffers to achieve:
- fast marshalling and unmarshalling.
- peace of mind by optionally generating test and benchmark code.
- more canonical Go structures.
- less typing by optionally generating extra helper code.
- goprotobuf compatibility
More Canonical Go Structures
A lot of time working with a goprotobuf struct will lead you to a place where you create another struct that is easier to work with and then have a function to copy the values between the two structs.
You might also find that basic structs that started their life as part of an API need to be sent over the wire. With gob, you could just send it. With goprotobuf, you need to make a parallel struct.
Gogoprotobuf tries to fix these problems with the nullable, embed, customtype and customname field extensions.
- nullable, if false, a field is generated without a pointer (see warning below).
- embed, if true, the field is generated as an embedded field.
- customtype, It works with the Marshal and Unmarshal methods, to allow you to have your own types in your struct, but marshal to bytes. For example, custom.Uuid or custom.Fixed128
- customname (beta), Changes the generated fieldname. This is especially useful when generated methods conflict with fieldnames.
- casttype (beta), Changes the generated fieldtype. All generated code assumes that this type is castable to the protocol buffer field type. It does not work for structs or enums.
- castkey (beta), Changes the generated fieldtype for a map key. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps.
- castvalue (beta), Changes the generated fieldtype for a map value. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps.
Warning about nullable: According to the Protocol Buffer specification, you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set. It can be seen as a layer on top of Protocol Buffers, where before and after marshalling all non-nullable fields are set and they cannot be unset.
Let us look at:
github.com/gogo/protobuf/test/example/example.proto
for a quicker overview.
The following message:
package test;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
message A {
optional string Description = 1 [(gogoproto.nullable) = false];
optional int64 Number = 2 [(gogoproto.nullable) = false];
optional bytes Id = 3 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uuid", (gogoproto.nullable) = false];
}
Will generate a go struct which looks a lot like this:
type A struct {
Description string
Number int64
Id github_com_gogo_protobuf_test_custom.Uuid
}
You will see there are no pointers, since all fields are non-nullable.
You will also see a custom type which marshals to a string.
Be warned it is your responsibility to test your custom types thoroughly.
You should think of every possible empty and nil case for your marshaling, unmarshaling and size methods.
Next we will embed the message A in message B.
message B {
optional A A = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true];
repeated bytes G = 2 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uint128", (gogoproto.nullable) = false];
}
See below that A is embedded in B.
type B struct {
A
G []github_com_gogo_protobuf_test_custom.Uint128
}
Also see the repeated custom type.
type Uint128 [2]uint64
Next we will create a custom name for one of our fields.
message C {
optional int64 size = 1 [(gogoproto.customname) = "MySize"];
}
See below that the field's name is MySize and not Size.
type C struct {
MySize *int64
}
The is useful when having a protocol buffer message with a field name which conflicts with a generated method.
As an example, having a field name size and using the sizer plugin to generate a Size method will cause a go compiler error.
Using customname you can fix this error without changing the field name.
This is typically useful when working with a protocol buffer that was designed before these methods and/or the go language were avialable.
Gogoprotobuf also has some more subtle changes, these could be changed back:
- the generated package name for imports do not have the extra /filename.pb,
but are actually the imports specified in the .proto file.
Gogoprotobuf also has lost some features which should be brought back with time:
- Marshalling and unmarshalling with reflect and without the unsafe package,
this requires work in pointer_reflect.go
Why does nullable break protocol buffer specifications:
The protocol buffer specification states, somewhere, that you should be able to tell whether a
field is set or unset. With the option nullable=false this feature is lost,
since your non-nullable fields will always be set. It can be seen as a layer on top of
protocol buffers, where before and after marshalling all non-nullable fields are set
and they cannot be unset.
Goprotobuf Compatibility:
Gogoprotobuf is compatible with Goprotobuf, because it is compatible with protocol buffers.
Gogoprotobuf generates the same code as goprotobuf if no extensions are used.
The enumprefix, getters and stringer extensions can be used to remove some of the unnecessary code generated by goprotobuf:
- gogoproto_import, if false, the generated code imports github.com/golang/protobuf/proto instead of github.com/gogo/protobuf/proto.
- goproto_enum_prefix, if false, generates the enum constant names without the messagetype prefix
- goproto_enum_stringer (experimental), if false, the enum is generated without the default string method, this is useful for rather using enum_stringer, or allowing you to write your own string method.
- goproto_getters, if false, the message is generated without get methods, this is useful when you would rather want to use face
- goproto_stringer, if false, the message is generated without the default string method, this is useful for rather using stringer, or allowing you to write your own string method.
- goproto_extensions_map (beta), if false, the extensions field is generated as type []byte instead of type map[int32]proto.Extension
- goproto_unrecognized (beta), if false, XXX_unrecognized field is not generated. This is useful in conjunction with gogoproto.nullable=false, to generate structures completely devoid of pointers and reduce GC pressure at the cost of losing information about unrecognized fields.
- goproto_registration (beta), if true, the generated files will register all messages and types against both gogo/protobuf and golang/protobuf. This is necessary when using third-party packages which read registrations from golang/protobuf (such as the grpc-gateway).
Less Typing and Peace of Mind is explained in their specific plugin folders godoc:
- github.com/gogo/protobuf/plugin/<extension_name>
If you do not use any of these extension the code that is generated
will be the same as if goprotobuf has generated it.
The most complete way to see examples is to look at
github.com/gogo/protobuf/test/thetest.proto
Gogoprototest is a seperate project,
because we want to keep gogoprotobuf independent of goprotobuf,
but we still want to test it thoroughly.
*/
package gogoproto
| {
"pile_set_name": "Github"
} |
CHIPSET(0x4C57, RADEON_LW, RV200)
CHIPSET(0x4C58, RADEON_LX, RV200)
CHIPSET(0x4C59, RADEON_LY, RV100)
CHIPSET(0x4C5A, RADEON_LZ, RV100)
CHIPSET(0x5144, RADEON_QD, R100)
CHIPSET(0x5145, RADEON_QE, R100)
CHIPSET(0x5146, RADEON_QF, R100)
CHIPSET(0x5147, RADEON_QG, R100)
CHIPSET(0x5159, RADEON_QY, RV100)
CHIPSET(0x515A, RADEON_QZ, RV100)
CHIPSET(0x5157, RV200_QW, RV200)
CHIPSET(0x5158, RV200_QX, RV200)
CHIPSET(0x515E, RN50_515E, UNKNOWN)
CHIPSET(0x5969, RN50_5969, UNKNOWN)
CHIPSET(0x4136, RS100_4136, RS100)
CHIPSET(0x4336, RS100_4336, RS100)
CHIPSET(0x4137, RS200_4137, RS200)
CHIPSET(0x4337, RS200_4337, RS200)
CHIPSET(0x4237, RS250_4237, RS200)
CHIPSET(0x4437, RS250_4437, RS200)
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.