text
stringlengths
2
99k
meta
dict
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This code was translated into a form compatible with 6a from the public // domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html // +build amd64,!gccgo,!appengine // func ladderstep(inout *[5][5]uint64) TEXT ·ladderstep(SB),0,$296-8 MOVQ inout+0(FP),DI MOVQ 40(DI),SI MOVQ 48(DI),DX MOVQ 56(DI),CX MOVQ 64(DI),R8 MOVQ 72(DI),R9 MOVQ SI,AX MOVQ DX,R10 MOVQ CX,R11 MOVQ R8,R12 MOVQ R9,R13 ADDQ ·_2P0(SB),AX ADDQ ·_2P1234(SB),R10 ADDQ ·_2P1234(SB),R11 ADDQ ·_2P1234(SB),R12 ADDQ ·_2P1234(SB),R13 ADDQ 80(DI),SI ADDQ 88(DI),DX ADDQ 96(DI),CX ADDQ 104(DI),R8 ADDQ 112(DI),R9 SUBQ 80(DI),AX SUBQ 88(DI),R10 SUBQ 96(DI),R11 SUBQ 104(DI),R12 SUBQ 112(DI),R13 MOVQ SI,0(SP) MOVQ DX,8(SP) MOVQ CX,16(SP) MOVQ R8,24(SP) MOVQ R9,32(SP) MOVQ AX,40(SP) MOVQ R10,48(SP) MOVQ R11,56(SP) MOVQ R12,64(SP) MOVQ R13,72(SP) MOVQ 40(SP),AX MULQ 40(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 40(SP),AX SHLQ $1,AX MULQ 48(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 40(SP),AX SHLQ $1,AX MULQ 56(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 40(SP),AX SHLQ $1,AX MULQ 64(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 40(SP),AX SHLQ $1,AX MULQ 72(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 48(SP),AX MULQ 48(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 48(SP),AX SHLQ $1,AX MULQ 56(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 48(SP),AX SHLQ $1,AX MULQ 64(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 48(SP),DX IMUL3Q $38,DX,AX MULQ 72(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 56(SP),AX MULQ 56(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 56(SP),DX IMUL3Q $38,DX,AX MULQ 64(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 56(SP),DX IMUL3Q $38,DX,AX MULQ 72(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 64(SP),DX IMUL3Q $19,DX,AX MULQ 64(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 64(SP),DX IMUL3Q $38,DX,AX MULQ 72(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 72(SP),DX IMUL3Q $19,DX,AX MULQ 72(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ ·REDMASK51(SB),DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX ANDQ DX,SI MOVQ CX,R8 SHRQ $51,CX ADDQ R10,CX ANDQ DX,R8 MOVQ CX,R9 SHRQ $51,CX ADDQ R12,CX ANDQ DX,R9 MOVQ CX,AX SHRQ $51,CX ADDQ R14,CX ANDQ DX,AX MOVQ CX,R10 SHRQ $51,CX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,80(SP) MOVQ R8,88(SP) MOVQ R9,96(SP) MOVQ AX,104(SP) MOVQ R10,112(SP) MOVQ 0(SP),AX MULQ 0(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 0(SP),AX SHLQ $1,AX MULQ 8(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 0(SP),AX SHLQ $1,AX MULQ 16(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 0(SP),AX SHLQ $1,AX MULQ 24(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 0(SP),AX SHLQ $1,AX MULQ 32(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 8(SP),AX MULQ 8(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 8(SP),AX SHLQ $1,AX MULQ 16(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 8(SP),AX SHLQ $1,AX MULQ 24(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 8(SP),DX IMUL3Q $38,DX,AX MULQ 32(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 16(SP),AX MULQ 16(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 16(SP),DX IMUL3Q $38,DX,AX MULQ 24(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 16(SP),DX IMUL3Q $38,DX,AX MULQ 32(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 24(SP),DX IMUL3Q $19,DX,AX MULQ 24(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 24(SP),DX IMUL3Q $38,DX,AX MULQ 32(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 32(SP),DX IMUL3Q $19,DX,AX MULQ 32(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ ·REDMASK51(SB),DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX ANDQ DX,SI MOVQ CX,R8 SHRQ $51,CX ADDQ R10,CX ANDQ DX,R8 MOVQ CX,R9 SHRQ $51,CX ADDQ R12,CX ANDQ DX,R9 MOVQ CX,AX SHRQ $51,CX ADDQ R14,CX ANDQ DX,AX MOVQ CX,R10 SHRQ $51,CX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,120(SP) MOVQ R8,128(SP) MOVQ R9,136(SP) MOVQ AX,144(SP) MOVQ R10,152(SP) MOVQ SI,SI MOVQ R8,DX MOVQ R9,CX MOVQ AX,R8 MOVQ R10,R9 ADDQ ·_2P0(SB),SI ADDQ ·_2P1234(SB),DX ADDQ ·_2P1234(SB),CX ADDQ ·_2P1234(SB),R8 ADDQ ·_2P1234(SB),R9 SUBQ 80(SP),SI SUBQ 88(SP),DX SUBQ 96(SP),CX SUBQ 104(SP),R8 SUBQ 112(SP),R9 MOVQ SI,160(SP) MOVQ DX,168(SP) MOVQ CX,176(SP) MOVQ R8,184(SP) MOVQ R9,192(SP) MOVQ 120(DI),SI MOVQ 128(DI),DX MOVQ 136(DI),CX MOVQ 144(DI),R8 MOVQ 152(DI),R9 MOVQ SI,AX MOVQ DX,R10 MOVQ CX,R11 MOVQ R8,R12 MOVQ R9,R13 ADDQ ·_2P0(SB),AX ADDQ ·_2P1234(SB),R10 ADDQ ·_2P1234(SB),R11 ADDQ ·_2P1234(SB),R12 ADDQ ·_2P1234(SB),R13 ADDQ 160(DI),SI ADDQ 168(DI),DX ADDQ 176(DI),CX ADDQ 184(DI),R8 ADDQ 192(DI),R9 SUBQ 160(DI),AX SUBQ 168(DI),R10 SUBQ 176(DI),R11 SUBQ 184(DI),R12 SUBQ 192(DI),R13 MOVQ SI,200(SP) MOVQ DX,208(SP) MOVQ CX,216(SP) MOVQ R8,224(SP) MOVQ R9,232(SP) MOVQ AX,240(SP) MOVQ R10,248(SP) MOVQ R11,256(SP) MOVQ R12,264(SP) MOVQ R13,272(SP) MOVQ 224(SP),SI IMUL3Q $19,SI,AX MOVQ AX,280(SP) MULQ 56(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 232(SP),DX IMUL3Q $19,DX,AX MOVQ AX,288(SP) MULQ 48(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 200(SP),AX MULQ 40(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 200(SP),AX MULQ 48(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 200(SP),AX MULQ 56(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 200(SP),AX MULQ 64(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 200(SP),AX MULQ 72(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 208(SP),AX MULQ 40(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 208(SP),AX MULQ 48(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 208(SP),AX MULQ 56(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 208(SP),AX MULQ 64(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 208(SP),DX IMUL3Q $19,DX,AX MULQ 72(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 216(SP),AX MULQ 40(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 216(SP),AX MULQ 48(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 216(SP),AX MULQ 56(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 216(SP),DX IMUL3Q $19,DX,AX MULQ 64(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 216(SP),DX IMUL3Q $19,DX,AX MULQ 72(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 224(SP),AX MULQ 40(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 224(SP),AX MULQ 48(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 280(SP),AX MULQ 64(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 280(SP),AX MULQ 72(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 232(SP),AX MULQ 40(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 288(SP),AX MULQ 56(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 288(SP),AX MULQ 64(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 288(SP),AX MULQ 72(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ ·REDMASK51(SB),DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX MOVQ CX,R8 SHRQ $51,CX ANDQ DX,SI ADDQ R10,CX MOVQ CX,R9 SHRQ $51,CX ANDQ DX,R8 ADDQ R12,CX MOVQ CX,AX SHRQ $51,CX ANDQ DX,R9 ADDQ R14,CX MOVQ CX,R10 SHRQ $51,CX ANDQ DX,AX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,40(SP) MOVQ R8,48(SP) MOVQ R9,56(SP) MOVQ AX,64(SP) MOVQ R10,72(SP) MOVQ 264(SP),SI IMUL3Q $19,SI,AX MOVQ AX,200(SP) MULQ 16(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 272(SP),DX IMUL3Q $19,DX,AX MOVQ AX,208(SP) MULQ 8(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 240(SP),AX MULQ 0(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 240(SP),AX MULQ 8(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 240(SP),AX MULQ 16(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 240(SP),AX MULQ 24(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 240(SP),AX MULQ 32(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 248(SP),AX MULQ 0(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 248(SP),AX MULQ 8(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 248(SP),AX MULQ 16(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 248(SP),AX MULQ 24(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 248(SP),DX IMUL3Q $19,DX,AX MULQ 32(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 256(SP),AX MULQ 0(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 256(SP),AX MULQ 8(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 256(SP),AX MULQ 16(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 256(SP),DX IMUL3Q $19,DX,AX MULQ 24(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 256(SP),DX IMUL3Q $19,DX,AX MULQ 32(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 264(SP),AX MULQ 0(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 264(SP),AX MULQ 8(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 200(SP),AX MULQ 24(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 200(SP),AX MULQ 32(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 272(SP),AX MULQ 0(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 208(SP),AX MULQ 16(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 208(SP),AX MULQ 24(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 208(SP),AX MULQ 32(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ ·REDMASK51(SB),DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX MOVQ CX,R8 SHRQ $51,CX ANDQ DX,SI ADDQ R10,CX MOVQ CX,R9 SHRQ $51,CX ANDQ DX,R8 ADDQ R12,CX MOVQ CX,AX SHRQ $51,CX ANDQ DX,R9 ADDQ R14,CX MOVQ CX,R10 SHRQ $51,CX ANDQ DX,AX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,DX MOVQ R8,CX MOVQ R9,R11 MOVQ AX,R12 MOVQ R10,R13 ADDQ ·_2P0(SB),DX ADDQ ·_2P1234(SB),CX ADDQ ·_2P1234(SB),R11 ADDQ ·_2P1234(SB),R12 ADDQ ·_2P1234(SB),R13 ADDQ 40(SP),SI ADDQ 48(SP),R8 ADDQ 56(SP),R9 ADDQ 64(SP),AX ADDQ 72(SP),R10 SUBQ 40(SP),DX SUBQ 48(SP),CX SUBQ 56(SP),R11 SUBQ 64(SP),R12 SUBQ 72(SP),R13 MOVQ SI,120(DI) MOVQ R8,128(DI) MOVQ R9,136(DI) MOVQ AX,144(DI) MOVQ R10,152(DI) MOVQ DX,160(DI) MOVQ CX,168(DI) MOVQ R11,176(DI) MOVQ R12,184(DI) MOVQ R13,192(DI) MOVQ 120(DI),AX MULQ 120(DI) MOVQ AX,SI MOVQ DX,CX MOVQ 120(DI),AX SHLQ $1,AX MULQ 128(DI) MOVQ AX,R8 MOVQ DX,R9 MOVQ 120(DI),AX SHLQ $1,AX MULQ 136(DI) MOVQ AX,R10 MOVQ DX,R11 MOVQ 120(DI),AX SHLQ $1,AX MULQ 144(DI) MOVQ AX,R12 MOVQ DX,R13 MOVQ 120(DI),AX SHLQ $1,AX MULQ 152(DI) MOVQ AX,R14 MOVQ DX,R15 MOVQ 128(DI),AX MULQ 128(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 128(DI),AX SHLQ $1,AX MULQ 136(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ 128(DI),AX SHLQ $1,AX MULQ 144(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 128(DI),DX IMUL3Q $38,DX,AX MULQ 152(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 136(DI),AX MULQ 136(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 136(DI),DX IMUL3Q $38,DX,AX MULQ 144(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 136(DI),DX IMUL3Q $38,DX,AX MULQ 152(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 144(DI),DX IMUL3Q $19,DX,AX MULQ 144(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 144(DI),DX IMUL3Q $38,DX,AX MULQ 152(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 152(DI),DX IMUL3Q $19,DX,AX MULQ 152(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ ·REDMASK51(SB),DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX ANDQ DX,SI MOVQ CX,R8 SHRQ $51,CX ADDQ R10,CX ANDQ DX,R8 MOVQ CX,R9 SHRQ $51,CX ADDQ R12,CX ANDQ DX,R9 MOVQ CX,AX SHRQ $51,CX ADDQ R14,CX ANDQ DX,AX MOVQ CX,R10 SHRQ $51,CX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,120(DI) MOVQ R8,128(DI) MOVQ R9,136(DI) MOVQ AX,144(DI) MOVQ R10,152(DI) MOVQ 160(DI),AX MULQ 160(DI) MOVQ AX,SI MOVQ DX,CX MOVQ 160(DI),AX SHLQ $1,AX MULQ 168(DI) MOVQ AX,R8 MOVQ DX,R9 MOVQ 160(DI),AX SHLQ $1,AX MULQ 176(DI) MOVQ AX,R10 MOVQ DX,R11 MOVQ 160(DI),AX SHLQ $1,AX MULQ 184(DI) MOVQ AX,R12 MOVQ DX,R13 MOVQ 160(DI),AX SHLQ $1,AX MULQ 192(DI) MOVQ AX,R14 MOVQ DX,R15 MOVQ 168(DI),AX MULQ 168(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 168(DI),AX SHLQ $1,AX MULQ 176(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ 168(DI),AX SHLQ $1,AX MULQ 184(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 168(DI),DX IMUL3Q $38,DX,AX MULQ 192(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 176(DI),AX MULQ 176(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 176(DI),DX IMUL3Q $38,DX,AX MULQ 184(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 176(DI),DX IMUL3Q $38,DX,AX MULQ 192(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 184(DI),DX IMUL3Q $19,DX,AX MULQ 184(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 184(DI),DX IMUL3Q $38,DX,AX MULQ 192(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 192(DI),DX IMUL3Q $19,DX,AX MULQ 192(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ ·REDMASK51(SB),DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX ANDQ DX,SI MOVQ CX,R8 SHRQ $51,CX ADDQ R10,CX ANDQ DX,R8 MOVQ CX,R9 SHRQ $51,CX ADDQ R12,CX ANDQ DX,R9 MOVQ CX,AX SHRQ $51,CX ADDQ R14,CX ANDQ DX,AX MOVQ CX,R10 SHRQ $51,CX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,160(DI) MOVQ R8,168(DI) MOVQ R9,176(DI) MOVQ AX,184(DI) MOVQ R10,192(DI) MOVQ 184(DI),SI IMUL3Q $19,SI,AX MOVQ AX,0(SP) MULQ 16(DI) MOVQ AX,SI MOVQ DX,CX MOVQ 192(DI),DX IMUL3Q $19,DX,AX MOVQ AX,8(SP) MULQ 8(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 160(DI),AX MULQ 0(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 160(DI),AX MULQ 8(DI) MOVQ AX,R8 MOVQ DX,R9 MOVQ 160(DI),AX MULQ 16(DI) MOVQ AX,R10 MOVQ DX,R11 MOVQ 160(DI),AX MULQ 24(DI) MOVQ AX,R12 MOVQ DX,R13 MOVQ 160(DI),AX MULQ 32(DI) MOVQ AX,R14 MOVQ DX,R15 MOVQ 168(DI),AX MULQ 0(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 168(DI),AX MULQ 8(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 168(DI),AX MULQ 16(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ 168(DI),AX MULQ 24(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 168(DI),DX IMUL3Q $19,DX,AX MULQ 32(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 176(DI),AX MULQ 0(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 176(DI),AX MULQ 8(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ 176(DI),AX MULQ 16(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 176(DI),DX IMUL3Q $19,DX,AX MULQ 24(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 176(DI),DX IMUL3Q $19,DX,AX MULQ 32(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 184(DI),AX MULQ 0(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ 184(DI),AX MULQ 8(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 0(SP),AX MULQ 24(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 0(SP),AX MULQ 32(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 192(DI),AX MULQ 0(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 8(SP),AX MULQ 16(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 8(SP),AX MULQ 24(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 8(SP),AX MULQ 32(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ ·REDMASK51(SB),DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX MOVQ CX,R8 SHRQ $51,CX ANDQ DX,SI ADDQ R10,CX MOVQ CX,R9 SHRQ $51,CX ANDQ DX,R8 ADDQ R12,CX MOVQ CX,AX SHRQ $51,CX ANDQ DX,R9 ADDQ R14,CX MOVQ CX,R10 SHRQ $51,CX ANDQ DX,AX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,160(DI) MOVQ R8,168(DI) MOVQ R9,176(DI) MOVQ AX,184(DI) MOVQ R10,192(DI) MOVQ 144(SP),SI IMUL3Q $19,SI,AX MOVQ AX,0(SP) MULQ 96(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 152(SP),DX IMUL3Q $19,DX,AX MOVQ AX,8(SP) MULQ 88(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 120(SP),AX MULQ 80(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 120(SP),AX MULQ 88(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 120(SP),AX MULQ 96(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 120(SP),AX MULQ 104(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 120(SP),AX MULQ 112(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 128(SP),AX MULQ 80(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 128(SP),AX MULQ 88(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 128(SP),AX MULQ 96(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 128(SP),AX MULQ 104(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 128(SP),DX IMUL3Q $19,DX,AX MULQ 112(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 136(SP),AX MULQ 80(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 136(SP),AX MULQ 88(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 136(SP),AX MULQ 96(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 136(SP),DX IMUL3Q $19,DX,AX MULQ 104(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 136(SP),DX IMUL3Q $19,DX,AX MULQ 112(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 144(SP),AX MULQ 80(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 144(SP),AX MULQ 88(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 0(SP),AX MULQ 104(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 0(SP),AX MULQ 112(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 152(SP),AX MULQ 80(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 8(SP),AX MULQ 96(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 8(SP),AX MULQ 104(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 8(SP),AX MULQ 112(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ ·REDMASK51(SB),DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX MOVQ CX,R8 SHRQ $51,CX ANDQ DX,SI ADDQ R10,CX MOVQ CX,R9 SHRQ $51,CX ANDQ DX,R8 ADDQ R12,CX MOVQ CX,AX SHRQ $51,CX ANDQ DX,R9 ADDQ R14,CX MOVQ CX,R10 SHRQ $51,CX ANDQ DX,AX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,40(DI) MOVQ R8,48(DI) MOVQ R9,56(DI) MOVQ AX,64(DI) MOVQ R10,72(DI) MOVQ 160(SP),AX MULQ ·_121666_213(SB) SHRQ $13,AX MOVQ AX,SI MOVQ DX,CX MOVQ 168(SP),AX MULQ ·_121666_213(SB) SHRQ $13,AX ADDQ AX,CX MOVQ DX,R8 MOVQ 176(SP),AX MULQ ·_121666_213(SB) SHRQ $13,AX ADDQ AX,R8 MOVQ DX,R9 MOVQ 184(SP),AX MULQ ·_121666_213(SB) SHRQ $13,AX ADDQ AX,R9 MOVQ DX,R10 MOVQ 192(SP),AX MULQ ·_121666_213(SB) SHRQ $13,AX ADDQ AX,R10 IMUL3Q $19,DX,DX ADDQ DX,SI ADDQ 80(SP),SI ADDQ 88(SP),CX ADDQ 96(SP),R8 ADDQ 104(SP),R9 ADDQ 112(SP),R10 MOVQ SI,80(DI) MOVQ CX,88(DI) MOVQ R8,96(DI) MOVQ R9,104(DI) MOVQ R10,112(DI) MOVQ 104(DI),SI IMUL3Q $19,SI,AX MOVQ AX,0(SP) MULQ 176(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 112(DI),DX IMUL3Q $19,DX,AX MOVQ AX,8(SP) MULQ 168(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 80(DI),AX MULQ 160(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 80(DI),AX MULQ 168(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 80(DI),AX MULQ 176(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 80(DI),AX MULQ 184(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 80(DI),AX MULQ 192(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 88(DI),AX MULQ 160(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 88(DI),AX MULQ 168(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 88(DI),AX MULQ 176(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 88(DI),AX MULQ 184(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 88(DI),DX IMUL3Q $19,DX,AX MULQ 192(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 96(DI),AX MULQ 160(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 96(DI),AX MULQ 168(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 96(DI),AX MULQ 176(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 96(DI),DX IMUL3Q $19,DX,AX MULQ 184(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 96(DI),DX IMUL3Q $19,DX,AX MULQ 192(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 104(DI),AX MULQ 160(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 104(DI),AX MULQ 168(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 0(SP),AX MULQ 184(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 0(SP),AX MULQ 192(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 112(DI),AX MULQ 160(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 8(SP),AX MULQ 176(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 8(SP),AX MULQ 184(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 8(SP),AX MULQ 192(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ ·REDMASK51(SB),DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX MOVQ CX,R8 SHRQ $51,CX ANDQ DX,SI ADDQ R10,CX MOVQ CX,R9 SHRQ $51,CX ANDQ DX,R8 ADDQ R12,CX MOVQ CX,AX SHRQ $51,CX ANDQ DX,R9 ADDQ R14,CX MOVQ CX,R10 SHRQ $51,CX ANDQ DX,AX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,80(DI) MOVQ R8,88(DI) MOVQ R9,96(DI) MOVQ AX,104(DI) MOVQ R10,112(DI) RET
{ "pile_set_name": "Github" }
/* * Copyright 2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef KHSRC_FUSION_FUSIONUI_VECTORASSET_H__ #define KHSRC_FUSION_FUSIONUI_VECTORASSET_H__ #include "AssetDerived.h" #include "AssetDisplayHelper.h" class VectorProductImportRequest; class VectorAssetWidget; class VectorAssetDefs { public: typedef VectorProductImportRequest Request; typedef VectorAssetWidget Widget; typedef bool (*SubmitFuncType)(const Request&, QString &, int); static const AssetDisplayHelper::AssetKey kAssetDisplayKey = AssetDisplayHelper::Key_VectorProduct; static SubmitFuncType kSubmitFunc; }; class VectorAsset : public AssetDerived<VectorAssetDefs, VectorAsset>, public VectorAssetDefs { public: VectorAsset(QWidget* parent); VectorAsset(QWidget* parent, const Request& req); ~VectorAsset(void); }; #endif // !KHSRC_FUSION_FUSIONUI_VECTORASSET_H__
{ "pile_set_name": "Github" }
Shader "Hidden/Holo/Glass Fallback (Two-sided Diffuse)" { Properties { [KeywordEnum(Off, Diffuse, GlassTint, GlassBlend)] _ColorMode ("Color Modifier Mode", Float) = 0 _Color (" Color", Color) = (1,1,1,1) [KeywordEnum(Off, Diffuse)] _VertexMode ("Vertex Color Mode", Float) = 1 _MainTex ("Base (RGBA)", 2D) = "white" { } [Toggle(_MIRROR_U_CLAMP_V)] _MirrorU (" Mirror U (only use if texture is clamped, but you want V wrapped)", Float) = 0 [Toggle(_MIRROR_V_CLAMP_U)] _MirrorV (" Mirror V (only use if texture is clamped, but you want U wrapped)", Float) = 0 [KeywordEnum(None, Unlit)] _BaseAlpha (" Alpha Mode", Float) = 0 _AlphaTestRef (" Alpha Cutoff", Range(0,1)) = 0.5 _Ramp ("Toon Ramp (RGBA)", 2D) = "gray" { } _Specularity ("Specularity", Range(0,2)) = 1 _Glossiness ("Specular Glossiness", Range(0.025,1)) = 0.95 [KeywordEnum(None, Specularity, Cubemap)] _Fresnel ("Fresnel Mode", Float) = 0 _FresnelBias (" Fresnel Bias", Range(0,1)) = 0.2 _FresnelPower (" Fresnel Power", Range(0,5)) = 2 } SubShader { LOD 1 Tags { "QUEUE"="Transparent" "RenderType"="TransparentCutout" } Pass { Name "SHADOWCASTER" Tags { "LIGHTMODE"="SHADOWCASTER" "QUEUE"="Transparent" "SHADOWSUPPORT"="true" "RenderType"="TransparentCutout" } Cull Off Blend One OneMinusSrcAlpha, One One GpuProgramID 36827 Program "vp" { SubProgram "gles " { GpuProgramIndex 0 } SubProgram "gles " { GpuProgramIndex 1 } } Program "fp" { SubProgram "gles " { GpuProgramIndex 2 } SubProgram "gles " { GpuProgramIndex 3 } } } } Fallback Off }
{ "pile_set_name": "Github" }
/** * @flow * @relayHash 7997e8956784138f048c25f7bb894552 */ /* eslint-disable */ 'use strict'; /*:: import type { ConcreteRequest } from 'relay-runtime'; export type ReactionContent = "CONFUSED" | "EYES" | "HEART" | "HOORAY" | "LAUGH" | "ROCKET" | "THUMBS_DOWN" | "THUMBS_UP" | "%future added value"; export type AddReactionInput = {| subjectId: string, content: ReactionContent, clientMutationId?: ?string, |}; export type addReactionMutationVariables = {| input: AddReactionInput |}; export type addReactionMutationResponse = {| +addReaction: ?{| +subject: ?{| +reactionGroups: ?$ReadOnlyArray<{| +content: ReactionContent, +viewerHasReacted: boolean, +users: {| +totalCount: number |}, |}> |} |} |}; export type addReactionMutation = {| variables: addReactionMutationVariables, response: addReactionMutationResponse, |}; */ /* mutation addReactionMutation( $input: AddReactionInput! ) { addReaction(input: $input) { subject { __typename reactionGroups { content viewerHasReacted users { totalCount } } id } } } */ const node/*: ConcreteRequest*/ = (function(){ var v0 = [ { "kind": "LocalArgument", "name": "input", "type": "AddReactionInput!", "defaultValue": null } ], v1 = [ { "kind": "Variable", "name": "input", "variableName": "input" } ], v2 = { "kind": "LinkedField", "alias": null, "name": "reactionGroups", "storageKey": null, "args": null, "concreteType": "ReactionGroup", "plural": true, "selections": [ { "kind": "ScalarField", "alias": null, "name": "content", "args": null, "storageKey": null }, { "kind": "ScalarField", "alias": null, "name": "viewerHasReacted", "args": null, "storageKey": null }, { "kind": "LinkedField", "alias": null, "name": "users", "storageKey": null, "args": null, "concreteType": "ReactingUserConnection", "plural": false, "selections": [ { "kind": "ScalarField", "alias": null, "name": "totalCount", "args": null, "storageKey": null } ] } ] }; return { "kind": "Request", "fragment": { "kind": "Fragment", "name": "addReactionMutation", "type": "Mutation", "metadata": null, "argumentDefinitions": (v0/*: any*/), "selections": [ { "kind": "LinkedField", "alias": null, "name": "addReaction", "storageKey": null, "args": (v1/*: any*/), "concreteType": "AddReactionPayload", "plural": false, "selections": [ { "kind": "LinkedField", "alias": null, "name": "subject", "storageKey": null, "args": null, "concreteType": null, "plural": false, "selections": [ (v2/*: any*/) ] } ] } ] }, "operation": { "kind": "Operation", "name": "addReactionMutation", "argumentDefinitions": (v0/*: any*/), "selections": [ { "kind": "LinkedField", "alias": null, "name": "addReaction", "storageKey": null, "args": (v1/*: any*/), "concreteType": "AddReactionPayload", "plural": false, "selections": [ { "kind": "LinkedField", "alias": null, "name": "subject", "storageKey": null, "args": null, "concreteType": null, "plural": false, "selections": [ { "kind": "ScalarField", "alias": null, "name": "__typename", "args": null, "storageKey": null }, (v2/*: any*/), { "kind": "ScalarField", "alias": null, "name": "id", "args": null, "storageKey": null } ] } ] } ] }, "params": { "operationKind": "mutation", "name": "addReactionMutation", "id": null, "text": "mutation addReactionMutation(\n $input: AddReactionInput!\n) {\n addReaction(input: $input) {\n subject {\n __typename\n reactionGroups {\n content\n viewerHasReacted\n users {\n totalCount\n }\n }\n id\n }\n }\n}\n", "metadata": {} } }; })(); // prettier-ignore (node/*: any*/).hash = 'fc238aed25f2d7e854162002cb00b57f'; module.exports = node;
{ "pile_set_name": "Github" }
import {Product} from "./product" import {ProductService} from "./product.service"; export class RealProductService extends ProductService{ getProduct(): Product { // Code making an HTTP request to get actual product details could go here return new Product('iPhone 7'); } }
{ "pile_set_name": "Github" }
/** * @param {number} m * @param {number} n * @return {number} */ var uniquePaths = function(m, n) { if(m === 0 || n === 0){ return 0; } var dp = [[1]]; for(var i = 1; i < n; i++){ dp[0][i] = 1; } for(var j = 1; j < m; j++){ dp.push([]); dp[j][0] = 1; } for(i = 1; i < m; i++){ for(j = 1; j < n; j++){ dp[i][j] = dp[i-1][j] + dp[i][j-1]; } } console.log(dp); return dp[m-1][n-1]; }
{ "pile_set_name": "Github" }
/***************************************************************************** Copyright (c) 2014, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************** * Contents: Native high-level C interface to LAPACK function dpteqr * Author: Intel Corporation * Generated November 2015 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_dpteqr( int matrix_layout, char compz, lapack_int n, double* d, double* e, double* z, lapack_int ldz ) { lapack_int info = 0; /* Additional scalars declarations for work arrays */ lapack_int lwork; double* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_dpteqr", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_d_nancheck( n, d, 1 ) ) { return -4; } if( LAPACKE_d_nancheck( n-1, e, 1 ) ) { return -5; } if( LAPACKE_lsame( compz, 'v' ) ) { if( LAPACKE_dge_nancheck( matrix_layout, n, n, z, ldz ) ) { return -6; } } } #endif /* Additional scalars initializations for work arrays */ if( LAPACKE_lsame( compz, 'n' ) ) { lwork = 1; } else { lwork = MAX(1,4*n-4); } /* Allocate memory for working array(s) */ work = (double*)LAPACKE_malloc( sizeof(double) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_dpteqr_work( matrix_layout, compz, n, d, e, z, ldz, work ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_dpteqr", info ); } return info; }
{ "pile_set_name": "Github" }
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magento.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magento.com for more information. * * @category Tests * @package Tests_Functional * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ namespace Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\AssociatedProducts; use Mage\Adminhtml\Test\Block\Widget\Grid as GridInterface; /** * Associated product grid. */ class Grid extends GridInterface { /** * Filters array mapping. * * @var array */ protected $filters = [ 'name' => [ 'selector' => '#super_product_grid_filter_name', ], 'id' => [ 'selector' => '#super_product_grid_filter_entity_id', ], 'sku' => [ 'selector' => '#super_product_grid_filter_sku', ], ]; }
{ "pile_set_name": "Github" }
; RUN: opt -loop-idiom < %s -S | FileCheck %s ; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop(loop-idiom)' < %s -S | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" %struct.bigBlock_t = type { [256 x <4 x float>] } ; CHECK-LABEL: @test( ; CHECK-NOT: llvm.memset define void @test(%struct.bigBlock_t* %p) { entry: %0 = getelementptr inbounds %struct.bigBlock_t, %struct.bigBlock_t* %p, i64 0, i32 0, i64 0, i64 0 br label %for.body for.body: ; preds = %entry, %for.body %index.02 = phi i32 [ 0, %entry ], [ %add, %for.body ] %dst.01 = phi float* [ %0, %entry ], [ %add.ptr2, %for.body ] %cast.i5 = bitcast float* %dst.01 to <4 x float>* store <4 x float> zeroinitializer, <4 x float>* %cast.i5, align 16, !nontemporal !0 %add.ptr1 = getelementptr inbounds float, float* %dst.01, i64 4 %cast.i = bitcast float* %add.ptr1 to <4 x float>* store <4 x float> zeroinitializer, <4 x float>* %cast.i, align 16, !nontemporal !0 %add.ptr2 = getelementptr inbounds float, float* %dst.01, i64 8 %add = add nuw nsw i32 %index.02, 32 %cmp = icmp ult i32 %add, 4096 br i1 %cmp, label %for.body, label %for.end for.end: ; preds = %for.body ret void } !0 = !{i32 1}
{ "pile_set_name": "Github" }
import Vue from 'vue' import { createApp } from './app' import pageComponents from '@internal/page-components' import layoutComponents from '@internal/layout-components' export default context => new Promise((resolve, reject) => { const { app, router } = createApp(true /* isServer */) const { url } = context const { fullPath } = router.resolve(url).route if (fullPath !== url) { return reject({ url: fullPath }) } router.push(url) // In SSR, if a component is not registered with the component option, // vue-server-renderer will not able to resolve it. // // Build also works after deleting this, but the content of all pages // will not appear to the output html, which is not conducive to SEO. const asyncComponentLoadingPromises = [ ...getComponentArr(pageComponents), ...getComponentArr(layoutComponents) ].map(({ name, loadFn }) => { return loadFn().then(comp => { Vue.component(name, comp.default) }) }) router.onReady(() => { Promise.all(asyncComponentLoadingPromises).then(() => resolve(app)) }) }) function getComponentArr (components) { return Object.keys(components).map(name => ({ name, loadFn: components[name] })) }
{ "pile_set_name": "Github" }
/* NPC Name: Kinu Description: Quest - Cygnus tutorial helper */ var status = -1; function start(mode, type, selection) { if(mode == -1 || mode == 0 && type > 0) { qm.dispose(); return; } if (mode == 1) { status++; } else { if (status == 2) { qm.sendNext("Regular Attacks are basic skills that are easy to use. It is important to remember that real hunting is done using your Skills. I suggest you reconsider."); qm.dispose(); return; } status--; } if (status == 0) { qm.sendNext("I've been waiting for you, #h0#. My name is #p1102006# and I'm the third brother you are going to meet. So, you've learned about using Regular Attacks, correct? Well, next you'll be learning about your #bSkills#k, which you will find very helpful in Maple World."); } else if (status == 1) { qm.sendNextPrev("You earn Skill Points every time you level up, which means you probably have a few saved up already. Press the #bK key#k to see your skills. Invest your Skill Points in the skill you wish to strengthen and don't forget to #bplace the skill in a Quick Slot for easy use#k."); } else if (status == 2) { qm.sendAcceptDecline("Time to practice before you forget. You will find a lot of #o100121#s in this area. Why don't you hunt #r3 #o100121#s#k using your #bThree Snails#b skill and bring me 1 #b#t4000483##k as proof? I'll wait for you here."); } else if (status == 3) { qm.forceStartQuest(); qm.guideHint(8); qm.dispose(); } } function end(mode, type, selection) { if(mode == -1 || mode == 0 && type > 0) { qm.dispose(); return; } if (mode == 1) { status++; } else { status--; } if (status == 0) { qm.sendNext("You've successfully defeated the #o100121#s and brought me a #t4000483#. That's very impressive! #bYou earn 3 Skill Points every time you level up, after you officially become a knight, that is. Keep following the arrow to the left, and you'll meet #b#p1102007##k, who will guide you through the next step.\r\n\r\n#fUI/UIWindow.img/QuestIcon/4/0# \r\n#fUI/UIWindow.img/QuestIcon/8/0# 40 exp"); } else if (status == 1) { qm.gainItem(4000483, -1); qm.forceCompleteQuest(); qm.gainExp(40); qm.dispose(); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project name="libPluginSocialTwitter" default="plugin-publish"> <!-- The local.properties file is created and updated by the 'android' tool. It contains the path to the SDK. It should *NOT* be checked into Version Control Systems. --> <property file="local.properties" /> <!-- The ant.properties file can be created by you. It is only edited by the 'android' tool to add properties to it. This is the place to change some Ant specific build properties. Here are some properties you may want to change/update: source.dir The name of the source directory. Default is 'src'. out.dir The name of the output directory. Default is 'bin'. For other overridable properties, look at the beginning of the rules files in the SDK, at tools/ant/build.xml Properties related to the SDK location or the project target should be updated using the 'android' tool with the 'update' action. This file is an integral part of the build system for your application and should be checked into Version Control Systems. --> <property file="ant.properties" /> <!-- if sdk.dir was not set from one of the property file, then get it from the ANDROID_HOME env var. This must be done before we load project.properties since the proguard config can use sdk.dir --> <property environment="env" /> <condition property="sdk.dir" value="${env.ANDROID_HOME}"> <isset property="env.ANDROID_HOME" /> </condition> <!-- The project.properties file is created and updated by the 'android' tool, as well as ADT. This contains project specific properties such as project target, and library dependencies. Lower level build properties are stored in ant.properties (or in .classpath for Eclipse projects). This file is an integral part of the build system for your application and should be checked into Version Control Systems. --> <loadproperties srcFile="project.properties" /> <!-- quick check on sdk.dir --> <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." unless="sdk.dir" /> <!-- Import per project custom build rules if present at the root of the project. This is the place to put custom intermediary targets such as: -pre-build -pre-compile -post-compile (This is typically used for code obfuscation. Compiled code location: ${out.classes.absolute.dir} If this is not done in place, override ${out.dex.input.absolute.dir}) -post-package -post-build -pre-clean --> <import file="custom_rules.xml" optional="true" /> <!-- Import the actual build file. To customize existing targets, there are two options: - Customize only one target: - copy/paste the target into this file, *before* the <import> task. - customize it to your needs. - Customize the whole content of build.xml - copy/paste the content of the rules files (minus the top node) into this file, replacing the <import> task. - customize to your needs. *********************** ****** IMPORTANT ****** *********************** In all cases you must update the value of version-tag below to read 'custom' instead of an integer, in order to avoid having your file be overridden by tools such as "android update project" --> <!-- version-tag: 1 --> <import file="${plugin.dir}/tools/android/build_common.xml" /> </project>
{ "pile_set_name": "Github" }
/* * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://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 smoketest.actuator; import java.util.Map; import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.web.server.LocalManagementPort; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import static org.assertj.core.api.Assertions.assertThat; /** * Integration tests for separate management and main service ports. * * @author Dave Syer */ @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = { "management.server.port=0", "management.endpoint.health.show-details=always" }) class ManagementPortSampleActuatorApplicationTests { @LocalServerPort private int port; @LocalManagementPort private int managementPort; @Test void testHome() { ResponseEntity<Map<String, Object>> entity = asMapEntity( new TestRestTemplate("user", "password").getForEntity("http://localhost:" + this.port, Map.class)); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(entity.getBody().get("message")).isEqualTo("Hello Phil"); } @Test void testMetrics() { testHome(); // makes sure some requests have been made ResponseEntity<Map<String, Object>> entity = asMapEntity(new TestRestTemplate() .getForEntity("http://localhost:" + this.managementPort + "/actuator/metrics", Map.class)); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED); } @Test void testHealth() { ResponseEntity<String> entity = new TestRestTemplate().withBasicAuth("user", "password") .getForEntity("http://localhost:" + this.managementPort + "/actuator/health", String.class); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(entity.getBody()).contains("\"status\":\"UP\""); assertThat(entity.getBody()).contains("\"example\""); assertThat(entity.getBody()).contains("\"counter\":42"); } @Test void testErrorPage() { ResponseEntity<Map<String, Object>> entity = asMapEntity(new TestRestTemplate("user", "password") .getForEntity("http://localhost:" + this.managementPort + "/error", Map.class)); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(entity.getBody().get("status")).isEqualTo(999); } @SuppressWarnings({ "unchecked", "rawtypes" }) static <K, V> ResponseEntity<Map<K, V>> asMapEntity(ResponseEntity<Map> entity) { return (ResponseEntity) entity; } }
{ "pile_set_name": "Github" }
GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Themosis framework, a framework for WordPress developers. Copyright (C) 2012 Julien Lambé This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
{ "pile_set_name": "Github" }
/* * APNG muxer * Copyright (c) 2015 Donny Yang * * first version by Donny Yang <work@kota.moe> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avformat.h" #include "internal.h" #include "libavutil/avassert.h" #include "libavutil/crc.h" #include "libavutil/intreadwrite.h" #include "libavutil/log.h" #include "libavutil/opt.h" #include "libavcodec/png.h" #include "libavcodec/apng.h" typedef struct APNGMuxContext { AVClass *class; uint32_t plays; AVRational last_delay; uint64_t acTL_offset; uint32_t frame_number; AVPacket *prev_packet; AVRational prev_delay; int framerate_warned; uint8_t *extra_data; int extra_data_size; } APNGMuxContext; static uint8_t *apng_find_chunk(uint32_t tag, uint8_t *buf, size_t length) { size_t b; for (b = 0; b < length; b += AV_RB32(buf + b) + 12) if (AV_RB32(&buf[b + 4]) == tag) return &buf[b]; return NULL; } static void apng_write_chunk(AVIOContext *io_context, uint32_t tag, uint8_t *buf, size_t length) { const AVCRC *crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE); uint32_t crc = ~0U; uint8_t tagbuf[4]; av_assert0(crc_table); avio_wb32(io_context, length); AV_WB32(tagbuf, tag); crc = av_crc(crc_table, crc, tagbuf, 4); avio_wb32(io_context, tag); if (length > 0) { crc = av_crc(crc_table, crc, buf, length); avio_write(io_context, buf, length); } avio_wb32(io_context, ~crc); } static int apng_write_header(AVFormatContext *format_context) { APNGMuxContext *apng = format_context->priv_data; AVCodecParameters *par = format_context->streams[0]->codecpar; if (format_context->nb_streams != 1 || format_context->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO || format_context->streams[0]->codecpar->codec_id != AV_CODEC_ID_APNG) { av_log(format_context, AV_LOG_ERROR, "APNG muxer supports only a single video APNG stream.\n"); return AVERROR(EINVAL); } if (apng->last_delay.num > USHRT_MAX || apng->last_delay.den > USHRT_MAX) { av_reduce(&apng->last_delay.num, &apng->last_delay.den, apng->last_delay.num, apng->last_delay.den, USHRT_MAX); av_log(format_context, AV_LOG_WARNING, "Last frame delay is too precise. Reducing to %d/%d (%f).\n", apng->last_delay.num, apng->last_delay.den, (double)apng->last_delay.num / apng->last_delay.den); } avio_wb64(format_context->pb, PNGSIG); // Remaining headers are written when they are copied from the encoder if (par->extradata_size) { apng->extra_data = av_mallocz(par->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!apng->extra_data) return AVERROR(ENOMEM); apng->extra_data_size = par->extradata_size; memcpy(apng->extra_data, par->extradata, par->extradata_size); } return 0; } static int flush_packet(AVFormatContext *format_context, AVPacket *packet) { APNGMuxContext *apng = format_context->priv_data; AVIOContext *io_context = format_context->pb; AVStream *codec_stream = format_context->streams[0]; uint8_t *side_data = NULL; int side_data_size = 0; av_assert0(apng->prev_packet); side_data = av_packet_get_side_data(apng->prev_packet, AV_PKT_DATA_NEW_EXTRADATA, &side_data_size); if (side_data_size) { av_freep(&apng->extra_data); apng->extra_data = av_mallocz(side_data_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!apng->extra_data) return AVERROR(ENOMEM); apng->extra_data_size = side_data_size; memcpy(apng->extra_data, side_data, apng->extra_data_size); } if (apng->frame_number == 0 && !packet) { uint8_t *existing_acTL_chunk; uint8_t *existing_fcTL_chunk; av_log(format_context, AV_LOG_INFO, "Only a single frame so saving as a normal PNG.\n"); // Write normal PNG headers without acTL chunk existing_acTL_chunk = apng_find_chunk(MKBETAG('a', 'c', 'T', 'L'), apng->extra_data, apng->extra_data_size); if (existing_acTL_chunk) { uint8_t *chunk_after_acTL = existing_acTL_chunk + AV_RB32(existing_acTL_chunk) + 12; avio_write(io_context, apng->extra_data, existing_acTL_chunk - apng->extra_data); avio_write(io_context, chunk_after_acTL, apng->extra_data + apng->extra_data_size - chunk_after_acTL); } else { avio_write(io_context, apng->extra_data, apng->extra_data_size); } // Write frame data without fcTL chunk existing_fcTL_chunk = apng_find_chunk(MKBETAG('f', 'c', 'T', 'L'), apng->prev_packet->data, apng->prev_packet->size); if (existing_fcTL_chunk) { uint8_t *chunk_after_fcTL = existing_fcTL_chunk + AV_RB32(existing_fcTL_chunk) + 12; avio_write(io_context, apng->prev_packet->data, existing_fcTL_chunk - apng->prev_packet->data); avio_write(io_context, chunk_after_fcTL, apng->prev_packet->data + apng->prev_packet->size - chunk_after_fcTL); } else { avio_write(io_context, apng->prev_packet->data, apng->prev_packet->size); } } else { uint8_t *existing_fcTL_chunk; if (apng->frame_number == 0) { uint8_t *existing_acTL_chunk; // Write normal PNG headers avio_write(io_context, apng->extra_data, apng->extra_data_size); existing_acTL_chunk = apng_find_chunk(MKBETAG('a', 'c', 'T', 'L'), apng->extra_data, apng->extra_data_size); if (!existing_acTL_chunk) { uint8_t buf[8]; // Write animation control header apng->acTL_offset = avio_tell(io_context); AV_WB32(buf, UINT_MAX); // number of frames (filled in later) AV_WB32(buf + 4, apng->plays); apng_write_chunk(io_context, MKBETAG('a', 'c', 'T', 'L'), buf, 8); } } existing_fcTL_chunk = apng_find_chunk(MKBETAG('f', 'c', 'T', 'L'), apng->prev_packet->data, apng->prev_packet->size); if (existing_fcTL_chunk) { AVRational delay; existing_fcTL_chunk += 8; delay.num = AV_RB16(existing_fcTL_chunk + 20); delay.den = AV_RB16(existing_fcTL_chunk + 22); if (delay.num == 0 && delay.den == 0) { if (packet) { int64_t delay_num_raw = (packet->dts - apng->prev_packet->dts) * codec_stream->time_base.num; int64_t delay_den_raw = codec_stream->time_base.den; if (!av_reduce(&delay.num, &delay.den, delay_num_raw, delay_den_raw, USHRT_MAX) && !apng->framerate_warned) { av_log(format_context, AV_LOG_WARNING, "Frame rate is too high or specified too precisely. Unable to copy losslessly.\n"); apng->framerate_warned = 1; } } else if (apng->last_delay.num > 0) { delay = apng->last_delay; } else { delay = apng->prev_delay; } // Update frame control header with new delay AV_WB16(existing_fcTL_chunk + 20, delay.num); AV_WB16(existing_fcTL_chunk + 22, delay.den); AV_WB32(existing_fcTL_chunk + 26, ~av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), ~0U, existing_fcTL_chunk - 4, 26 + 4)); } apng->prev_delay = delay; } // Write frame data avio_write(io_context, apng->prev_packet->data, apng->prev_packet->size); } ++apng->frame_number; av_packet_unref(apng->prev_packet); if (packet) av_copy_packet(apng->prev_packet, packet); return 0; } static int apng_write_packet(AVFormatContext *format_context, AVPacket *packet) { APNGMuxContext *apng = format_context->priv_data; int ret; if (!apng->prev_packet) { apng->prev_packet = av_malloc(sizeof(*apng->prev_packet)); if (!apng->prev_packet) return AVERROR(ENOMEM); av_copy_packet(apng->prev_packet, packet); } else { ret = flush_packet(format_context, packet); if (ret < 0) return ret; } return 0; } static int apng_write_trailer(AVFormatContext *format_context) { APNGMuxContext *apng = format_context->priv_data; AVIOContext *io_context = format_context->pb; uint8_t buf[8]; int ret; if (apng->prev_packet) { ret = flush_packet(format_context, NULL); av_freep(&apng->prev_packet); if (ret < 0) return ret; } apng_write_chunk(io_context, MKBETAG('I', 'E', 'N', 'D'), NULL, 0); if (apng->acTL_offset && io_context->seekable) { avio_seek(io_context, apng->acTL_offset, SEEK_SET); AV_WB32(buf, apng->frame_number); AV_WB32(buf + 4, apng->plays); apng_write_chunk(io_context, MKBETAG('a', 'c', 'T', 'L'), buf, 8); } av_freep(&apng->extra_data); apng->extra_data = 0; return 0; } #define OFFSET(x) offsetof(APNGMuxContext, x) #define ENC AV_OPT_FLAG_ENCODING_PARAM static const AVOption options[] = { { "plays", "Number of times to play the output: 0 - infinite loop, 1 - no loop", OFFSET(plays), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, UINT_MAX, ENC }, { "final_delay", "Force delay after the last frame", OFFSET(last_delay), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, USHRT_MAX, ENC }, { NULL }, }; static const AVClass apng_muxer_class = { .class_name = "APNG muxer", .item_name = av_default_item_name, .version = LIBAVUTIL_VERSION_INT, .option = options, }; AVOutputFormat ff_apng_muxer = { .name = "apng", .long_name = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"), .mime_type = "image/png", .extensions = "apng", .priv_data_size = sizeof(APNGMuxContext), .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_APNG, .write_header = apng_write_header, .write_packet = apng_write_packet, .write_trailer = apng_write_trailer, .priv_class = &apng_muxer_class, .flags = AVFMT_VARIABLE_FPS, };
{ "pile_set_name": "Github" }
# frozen_string_literal: true require 'spec_helper' RSpec.describe 'Math rendering', :js do let!(:project) { create(:project, :public) } it 'renders inline and display math correctly' do description = <<~MATH This math is inline $`a^2+b^2=c^2`$. This is on a separate line ```math a^2+b^2=c^2 ``` MATH issue = create(:issue, project: project, description: description) visit project_issue_path(project, issue) expect(page).to have_selector('.katex .mord.mathdefault', text: 'b') expect(page).to have_selector('.katex-display .mord.mathdefault', text: 'b') end it 'only renders non XSS links' do description = <<~MATH This link is valid $`\\href{javascript:alert('xss');}{xss}`$. This link is valid $`\\href{https://gitlab.com}{Gitlab}`$. MATH issue = create(:issue, project: project, description: description) visit project_issue_path(project, issue) page.within '.description > .md' do expect(page).to have_selector('.katex-error') expect(page).to have_selector('.katex-html a', text: 'Gitlab') end end end
{ "pile_set_name": "Github" }
package com.tencent.mm.plugin.emojicapture.model.c; import a.f.b.j; import a.l; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.sdk.platformtools.ab; import java.util.LinkedList; import org.xmlpull.v1.XmlPullParser; @l(dWo = {1, 1, 13}, dWp = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0018\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0014R\u0017\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007¨\u0006\u000e"}, dWq = {"Lcom/tencent/mm/plugin/emojicapture/model/xml/EmoticonLensConfig;", "Lcom/tencent/mm/plugin/emojicapture/model/xml/BaseXmlContent;", "()V", "itemList", "Ljava/util/LinkedList;", "Lcom/tencent/mm/plugin/emojicapture/model/xml/EmoticonLensItem;", "getItemList", "()Ljava/util/LinkedList;", "parseTag", "", "tag", "", "parser", "Lorg/xmlpull/v1/XmlPullParser;", "plugin-emojicapture_release"}) public final class b extends a { public final LinkedList<d> ewZ = new LinkedList(); public b() { AppMethodBeat.i(2720); AppMethodBeat.o(2720); } /* Access modifiers changed, original: protected|final */ public final void a(String str, XmlPullParser xmlPullParser) { AppMethodBeat.i(2719); j.p(str, "tag"); j.p(xmlPullParser, "parser"); switch (str.hashCode()) { case -424713737: if (str.equals("EmoticonLensItem")) { d dVar = new d(); dVar.f(xmlPullParser); this.ewZ.add(dVar); ab.i(c.TAG, String.valueOf(dVar)); AppMethodBeat.o(2719); return; } break; case -424634494: if (str.equals("EmoticonLensList")) { AppMethodBeat.o(2719); return; } break; case -304135898: if (str.equals("EmoticonLensConfig")) { AppMethodBeat.o(2719); return; } break; } a.a(xmlPullParser); AppMethodBeat.o(2719); } }
{ "pile_set_name": "Github" }
import {Spyglass} from "io_k8s_test_infra/prow/cmd/deck/static/spyglass/lens"; declare global { // The `spyglass` global is injected into the environment the lens runs in by spyglass. const spyglass: Spyglass; }
{ "pile_set_name": "Github" }
<?php namespace Faker\Provider\he_IL; class Address extends \Faker\Provider\Address { protected static $buildingNumber = array('#', '##', '###'); protected static $streetSuffix = array( 'רחוב', 'שדרות', 'סמטאת', ); protected static $postcode = array('#####', '#######'); /** * {@link} https://data.gov.il/dataset/322 **/ protected static $citySuffix = array( 'אבו תלול', 'אבטין', 'אבטליון', 'אביאל', 'אביבים', 'אביגדור', 'אביחיל', 'אביטל', 'אביעזר', 'אבירים', 'אבן יהודה', 'אבן מנחם', 'אבן ספיר', 'אבן שמואל', 'אבני איתן', 'אבני חפץ', 'אבנת', 'אבשלום', 'אדורה', 'אדירים', 'אדמית', 'אדרת', 'אודים', 'אודם', 'אוהד', 'אום אל-פחם', 'אום אל-קוטוף', 'אום בטין', 'אומן', 'אומץ', 'אופקים', 'אור הגנוז', 'אור הנר', 'אור יהודה', 'אור עקיבא', 'אורה', 'אורות', 'אורטל', 'אורים', 'אורנים', 'אורנית', 'אושה', 'אזור', 'אחווה', 'אחוזם', 'אחוזת ברק', 'אחיהוד', 'אחיטוב', 'אחיסמך', 'אחיעזר', 'איבים', 'אייל', 'איילת השחר', 'אילון', 'אילות', 'אילניה', 'אילת', 'אירוס', 'איתמר', 'איתן', 'איתנים', 'אכסאל', 'אל סייד', 'אלומה', 'אלומות', 'אלון הגליל', 'אלון מורה', 'אלון שבות', 'אלוני אבא', 'אלוני הבשן', 'אלוני יצחק', 'אלונים', 'אליאב', 'אליכין', 'אלי-עד', 'אליפז', 'אליפלט', 'אליקים', 'אלישיב', 'אלישמע', 'אלמגור', 'אלמוג', 'אלעד', 'אל-עזי', 'אלעזר', 'אל-עריאן', 'אלפי מנשה', 'אלקוש', 'אלקנה', 'אל-רום', 'אמונים', 'אמירים', 'אמנון', 'אמציה', 'אניעם', 'אספר', 'אעבלין', 'אפיק', 'אפיקים', 'אפק', 'אפרת', 'ארבל', 'ארגמן', 'ארז', 'אריאל', 'ארסוף', 'אשבול', 'אשבל', 'אשדוד', 'אשחר', 'אשכולות', 'אשל הנשיא', 'אשלים', 'אשקלון', 'אשרת', 'אשתאול', 'אתגר', 'באקה אל-גרביה', 'באר אורה', 'באר גנים', 'באר טוביה', 'באר יעקב', 'באר מילכה', 'באר שבע', 'בארות יצחק', 'בארותיים', 'בארי', 'בוסתן הגליל', 'בוקעאתא', 'בורגתה', 'בחן', 'בטחה', 'ביצרון', 'ביר אל-מכסור', 'ביריה', 'בית אורן', 'בית אל', 'בית אלעזרי', 'בית אלפא', 'בית אריה', 'בית ברל', 'בית גוברין', 'בית גמליאל', 'בית דגן', 'בית הגדי', 'בית הלוי', 'בית הלל', 'בית העמק', 'בית הערבה', 'בית השיטה', 'בית זיד', 'בית זית', 'בית זרע', 'בית חורון', 'בית חירות', 'בית חלקיה', 'בית חנן', 'בית חנניה', 'בית חשמונאי', 'בית יהושע', 'בית יוסף', 'בית ינאי', 'בית יצחק-שער חפר', 'בית לחם הגלילית', 'בית מאיר', 'בית נחמיה', 'בית ניר', 'בית נקופה', 'בית עובד', 'בית עוזיאל', 'בית עזרא', 'בית עריף', 'בית צבי', 'בית קמה', 'בית קשת', 'בית רבן', 'בית רימון', 'בית שאן', 'בית שמש', 'בית שערים', 'בית שקמה', 'ביתן אהרן', 'ביתר עילית', 'בלפוריה', 'בן זכאי', 'בן עמי', 'בני ברק', 'בני דקלים', 'בני דרום', 'בני דרור', 'בני יהודה', 'בני נצרים', 'בני עטרות', 'בני עי"ש', 'בני ציון', 'בני ראם', 'בניה', 'בנימינה-גבעת עדה', 'בסמ"ה', 'בסמת טבעון', 'בענה', 'בצרה', 'בצת', 'בקוע', 'בקעות', 'בר גיורא', 'בר יוחאי', 'ברוכין', 'ברור חיל', 'ברוש', 'ברכה', 'ברכיה', 'ברעם', 'ברק', 'ברקאי', 'ברקן', 'ברקת', 'בת הדר', 'בת חן', 'בת חפר', 'בת חצור', 'בת ים', 'בת עין', 'בת שלמה', 'גאולי תימן', 'גאולים', 'גאליה', 'גבולות', 'גבים', 'גבע', 'גבע בנימין', 'גבע כרמל', 'גבעולים', 'גבעון החדשה', 'גבעות בר', 'גבעת אבני', 'גבעת אלה', 'גבעת ברנר', 'גבעת השלושה', 'גבעת זאב', 'גבעת ח"ן', 'גבעת יואב', 'גבעת יערים', 'גבעת ישעיהו', 'גבעת כ"ח', 'גבעת ניל"י', 'גבעת עוז', 'גבעת שמואל', 'גבעת שמש', 'גבעת שפירא', 'גבעתי', 'גבעתיים', 'גברעם', 'גבת', 'גדות', 'גונן', 'גורן', 'גורנות הגליל', 'גזית', 'גזר', 'גיאה', 'גיבתון', 'גיזו', 'גילון', 'גילת', 'גינוסר', 'גיניגר', 'גינתון', 'גיתה', 'גיתית', 'גלאון', 'גלגל', 'גליל ים', 'גמזו', 'גן הדרום', 'גן השומרון', 'גן חיים', 'גן יאשיה', 'גן יבנה', 'גן נר', 'גן שורק', 'גן שלמה', 'גן שמואל', 'גנות', 'גנות הדר', 'גני הדר', 'גני טל', 'גני יוחנן', 'גני מודיעין', 'גני עם', 'גני תקווה', 'געש', 'געתון', 'גפן', 'גרופית', 'גשור', 'גשר', 'גשר הזיו', 'דאלית אל-כרמל', 'דבורה', 'דבוריה', 'דבירה', 'דברת', 'דגניה א', 'דולב', 'דור', 'דורות', 'דחי', 'דייר אל-אסד', 'דייר חנא', 'דייר ראפאת', 'דימונה', 'דישון', 'דליה', 'דלתון', 'דמיידה', 'דן', 'דפנה', 'דקל', 'האון', 'הבונים', 'הגושרים', 'הדר עם', 'הוד השרון', 'הודיה', 'הודיות', 'הושעיה', 'הזורע', 'הזורעים', 'החותרים', 'היוגב', 'הילה', 'המעפיל', 'הסוללים', 'העוגן', 'הר אדר', 'הר גילה', 'הר עמשא', 'הראל', 'הרדוף', 'הרצליה', 'הררית', 'ורד יריחו', 'ורדון', 'זבדיאל', 'זוהר', 'זיקים', 'זיתן', 'זכרון יעקב', 'זכריה', 'זמר', 'זמרת', 'זנוח', 'זרועה', 'זרזיר', 'זרחיה', 'חבצלת השרון', 'חבר', 'חברון', 'חגור', 'חגי', 'חגלה', 'חדיד', 'חד-נס', 'חדרה', 'חולדה', 'חולון', 'חולית', 'חולתה', 'חוסן', 'חוסנייה', 'חופית', 'חוקוק', 'חורה', 'חורפיש', 'חורשים', 'חזון', 'חיבת ציון', 'חיננית', 'חיפה', 'חירות', 'חלוץ', 'חלמיש', 'חלץ', 'חמאם', 'חמד', 'חמדיה', 'חמדת', 'חמרה', 'חניאל', 'חניתה', 'חנתון', 'חספין', 'חפץ חיים', 'חפצי-בה', 'חצב', 'חצבה', 'חצור הגלילית', 'חצור-אשדוד', 'חצר בארותיים', 'חצרות חולדה', 'חצרות יסף', 'חצרות כ"ח', 'חצרים', 'חרב לאת', 'חרוצים', 'חריש', 'חרמש', 'חרשים', 'חשמונאים', 'טבריה', 'טובא-זנגריה', 'טורעאן', 'טייבה', 'טירה', 'טירת יהודה', 'טירת כרמל', 'טירת צבי', 'טל שחר', 'טל-אל', 'טללים', 'טלמון', 'טמרה', 'טנא', 'טפחות', 'יבול', 'יבנאל', 'יבנה', 'יגור', 'יגל', 'יד בנימין', 'יד השמונה', 'יד חנה', 'יד מרדכי', 'יד נתן', 'יד רמב"ם', 'ידידה', 'יהוד-מונוסון', 'יהל', 'יובל', 'יובלים', 'יודפת', 'יונתן', 'יושיביה', 'יזרעאל', 'יחיעם', 'יטבתה', 'יכיני', 'ינוב', 'ינון', 'יסוד המעלה', 'יסודות', 'יסעור', 'יעד', 'יעל', 'יעף', 'יערה', 'יפיע', 'יפית', 'יפעת', 'יפתח', 'יצהר', 'יציץ', 'יקום', 'יקיר', 'יקנעם עילית', 'יראון', 'ירדנה', 'ירוחם', 'ירושלים', 'ירחיב', 'ירכא', 'ירקונה', 'ישע', 'ישעי', 'ישרש', 'יתד', 'יתיר', 'כאבול', 'כברי', 'כדורי', 'כדיתה', 'כוכב השחר', 'כוכב יאיר', 'כוכב יעקב', 'כוכב מיכאל', 'כורזים', 'כחל', 'כחלה', 'כיסופים', 'כישור', 'כליל', 'כלנית', 'כמאנה', 'כמהין', 'כמון', 'כנות', 'כנף', 'כסיפה', 'כסלון', 'כסרא-סמיע', 'כפר אדומים', 'כפר אוריה', 'כפר אחים', 'כפר ביאליק', 'כפר ביל"ו', 'כפר בלום', 'כפר בן נון', 'כפר ברא', 'כפר ברוך', 'כפר גדעון', 'כפר גלים', 'כפר גליקסון', 'כפר גלעדי', 'כפר דניאל', 'כפר האורנים', 'כפר החורש', 'כפר המכבי', 'כפר הנגיד', 'כפר הנוער הדתי', 'כפר הנשיא', 'כפר הס', 'כפר הרא"ה', 'כפר הרי"ף', 'כפר ויתקין', 'כפר ורבורג', 'כפר ורדים', 'כפר זוהרים', 'כפר זיתים', 'כפר חב"ד', 'כפר חושן', 'כפר חיטים', 'כפר חיים', 'כפר חנניה', 'כפר חרוב', 'כפר טרומן', 'כפר יאסיף', 'כפר ידידיה', 'כפר יהושע', 'כפר יונה', 'כפר יחזקאל', 'כפר יעבץ', 'כפר כמא', 'כפר כנא', 'כפר מונש', 'כפר מימון', 'כפר מל"ל', 'כפר מנדא', 'כפר מנחם', 'כפר מסריק', 'כפר מצר', 'כפר מרדכי', 'כפר נטר', 'כפר סאלד', 'כפר סבא', 'כפר סילבר', 'כפר סירקין', 'כפר עבודה', 'כפר עזה', 'כפר עציון', 'כפר פינס', 'כפר קאסם', 'כפר קיש', 'כפר קרע', 'כפר ראש הנקרה', 'כפר רופין', 'כפר רות', 'כפר שמאי', 'כפר שמואל', 'כפר שמריהו', 'כפר תבור', 'כפר תפוח', 'כרי דשא', 'כרכום', 'כרם בן זמרה', 'כרם בן שמן', 'כרם מהר"ל', 'כרם שלום', 'כרמי יוסף', 'כרמי צור', 'כרמיאל', 'כרמיה', 'כרמים', 'כרמל', 'לא רשום', 'לבון', 'לביא', 'לבנים', 'להב', 'להבות הבשן', 'להבות חביבה', 'להבים', 'לוד', 'לוזית', 'לוחמי הגיטאות', 'לוטם', 'לוטן', 'לימן', 'לכיש', 'לפיד', 'לפידות', 'לקיה', 'מאור', 'מאיר שפיה', 'מבוא ביתר', 'מבוא דותן', 'מבוא חורון', 'מבוא חמה', 'מבוא מודיעים', 'מבואות ים', 'מבועים', 'מבטחים', 'מבקיעים', 'מבשרת ציון', 'מגאר', 'מגדל העמק', 'מגדל עוז', 'מגדלים', 'מגידו', 'מגל', 'מגן', 'מגן שאול', 'מגשימים', 'מדרך עוז', 'מדרשת בן גוריון', 'מדרשת רופין', 'מודיעין עילית', 'מודיעין-מכבים-רעות', 'מולדה', 'מולדת', 'מוצא עילית', 'מוקייבלה', 'מורן', 'מורשת', 'מזור', 'מזכרת בתיה', 'מזרע', 'מזרעה', 'מחולה', 'מחנה הילה', 'מחנה טלי', 'מחנה יהודית', 'מחנה יוכבד', 'מחנה יפה', 'מחנה יתיר', 'מחנה מרים', 'מחנה עדי', 'מחנה תל נוף', 'מחניים', 'מחסיה', 'מטולה', 'מטע', 'מי עמי', 'מיטב', 'מייסר', 'מיצר', 'מירב', 'מירון', 'מישר', 'מיתר', 'מכורה', 'מכחול', 'מכמורת', 'מכמנים', 'מלאה', 'מלילות', 'מלכיה', 'מלכישוע', 'מנוחה', 'מנוף', 'מנות', 'מנחמיה', 'מנרה', 'מנשית זבדה', 'מסד', 'מסדה', 'מסילות', 'מסילת ציון', 'מסלול', 'מסעדה', 'מסעודין אל-עזאזמה', 'מעברות', 'מעגלים', 'מעגן', 'מעגן מיכאל', 'מעוז חיים', 'מעון', 'מעונה', 'מעיליא', 'מעין ברוך', 'מעין צבי', 'מעלה אדומים', 'מעלה אפרים', 'מעלה גלבוע', 'מעלה גמלא', 'מעלה החמישה', 'מעלה לבונה', 'מעלה מכמש', 'מעלה עירון', 'מעלה עמוס', 'מעלה שומרון', 'מעלות-תרשיחא', 'מענית', 'מעש', 'מפלסים', 'מצדות יהודה', 'מצובה', 'מצליח', 'מצפה', 'מצפה אבי"ב', 'מצפה אילן', 'מצפה יריחו', 'מצפה נטופה', 'מצפה רמון', 'מצפה שלם', 'מצר', 'מקווה ישראל', 'מרגליות', 'מרום גולן', 'מרחב עם', 'מרכז שפירא', 'משאבי שדה', 'משגב דב', 'משגב עם', 'משהד', 'משואה', 'משואות יצחק', 'משכיות', 'משמר איילון', 'משמר דוד', 'משמר הירדן', 'משמר הנגב', 'משמר העמק', 'משמר השבעה', 'משמר השרון', 'משמרות', 'משמרת', 'משען', 'מתן', 'מתת', 'מתתיהו', 'נאות גולן', 'נאות הכיכר', 'נאות מרדכי', 'נאות סמדר', 'נאעורה', 'נבטים', 'נגבה', 'נגוהות', 'נהורה', 'נהלל', 'נהריה', 'נוב', 'נוגה', 'נווה', 'נווה אבות', 'נווה אור', 'נווה אטי"ב', 'נווה אילן', 'נווה איתן', 'נווה דניאל', 'נווה זוהר', 'נווה זיו', 'נווה חריף', 'נווה ים', 'נווה ימין', 'נווה ירק', 'נווה מבטח', 'נווה מיכאל', 'נווה שלום', 'נועם', 'נוף איילון', 'נופים', 'נופית', 'נופך', 'נוקדים', 'נורדיה', 'נורית', 'נחושה', 'נחל עוז', 'נחלה', 'נחליאל', 'נחלים', 'נחם', 'נחף', 'נחשולים', 'נחשון', 'נחשונים', 'נטועה', 'נטור', 'נטע', 'נטעים', 'נטף', 'ניין', 'ניל"י', 'ניצן', 'ניצני סיני', 'ניצני עוז', 'ניצנים', 'ניר אליהו', 'ניר בנים', 'ניר גלים', 'ניר ח"ן', 'ניר יפה', 'ניר יצחק', 'ניר ישראל', 'ניר משה', 'ניר עוז', 'ניר עם', 'ניר עציון', 'ניר עקיבא', 'ניר צבי', 'נירים', 'נירית', 'נירן', 'נס הרים', 'נס עמים', 'נס ציונה', 'נעורים', 'נעלה', 'נעמ"ה', 'נען', 'נצר חזני', 'נצר סרני', 'נצרת', 'נצרת עילית', 'נשר', 'נתיב הגדוד', 'נתיב הל"ה', 'נתיב העשרה', 'נתיב השיירה', 'נתיבות', 'נתניה', 'סאסא', 'סביון', 'סגולה', 'סולם', 'סוסיה', 'סופה', 'סלמה', 'סלעית', 'סמר', 'סנסנה', 'סעד', 'סער', 'ספיר', 'סתריה', 'עבדון', 'עברון', 'עגור', 'עדי', 'עדנים', 'עוזה', 'עוזייר', 'עולש', 'עומר', 'עופר', 'עופרה', 'עוצם', 'עזוז', 'עזר', 'עזריאל', 'עזריה', 'עזריקם', 'עטרת', 'עידן', 'עיילבון', 'עיינות', 'עילוט', 'עין איילה', 'עין אל-אסד', 'עין גב', 'עין גדי', 'עין דור', 'עין הבשור', 'עין הוד', 'עין החורש', 'עין המפרץ', 'עין הנצי"ב', 'עין העמק', 'עין השופט', 'עין השלושה', 'עין ורד', 'עין זיוון', 'עין חוד', 'עין חצבה', 'עין יהב', 'עין יעקב', 'עין כרם-בי"ס חקלאי', 'עין כרמל', 'עין מאהל', 'עין נקובא', 'עין עירון', 'עין צורים', 'עין קנייא', 'עין ראפה', 'עין שמר', 'עין שריד', 'עין תמר', 'עינת', 'עיר אובות', 'עכו', 'עלומים', 'עלי', 'עלי זהב', 'עלמה', 'עלמון', 'עמוקה', 'עמינדב', 'עמיעד', 'עמיעוז', 'עמיקם', 'עמיר', 'עמנואל', 'עמקה', 'ענב', 'עספיא', 'עפולה', 'עץ אפרים', 'עצמון שגב', 'עראבה', 'עראמשה', 'ערב אל נעים', 'ערד', 'ערוגות', 'ערערה', 'ערערה-בנגב', 'עשרת', 'עתלית', 'עתניאל', 'פארן', 'פדואל', 'פדויים', 'פדיה', 'פוריה - כפר עבודה', 'פוריה - נווה עובד', 'פוריה עילית', 'פוריידיס', 'פורת', 'פטיש', 'פלך', 'פלמחים', 'פני חבר', 'פסגות', 'פסוטה', 'פעמי תש"ז', 'פצאל', 'פקיעין חדשה', 'פרדס חנה-כרכור', 'פרדסיה', 'פרוד', 'פרזון', 'פרי גן', 'פתח תקווה', 'פתחיה', 'צאלים', 'צביה', 'צבעון', 'צובה', 'צוחר', 'צופיה', 'צופים', 'צופית', 'צופר', 'צוקי ים', 'צוקים', 'צור הדסה', 'צור יצחק', 'צור משה', 'צור נתן', 'צוריאל', 'צורית', 'ציפורי', 'צלפון', 'צנדלה', 'צפריה', 'צפרירים', 'צפת', 'צרופה', 'צרעה', 'קבוצת יבנה', 'קדומים', 'קדימה-צורן', 'קדמה', 'קדמת צבי', 'קדר', 'קדרון', 'קדרים', 'קוממיות', 'קורנית', 'קטורה', 'קיסריה', 'קלחים', 'קליה', 'קלנסווה', 'קלע', 'קציר', 'קצר א-סר', 'קצרין', 'קרית אונו', 'קרית ארבע', 'קרית אתא', 'קרית ביאליק', 'קרית גת', 'קרית טבעון', 'קרית ים', 'קרית יערים', 'קרית מוצקין', 'קרית מלאכי', 'קרית נטפים', 'קרית ענבים', 'קרית עקרון', 'קרית שלמה', 'קרית שמונה', 'קרני שומרון', 'קשת', 'ראמה', 'ראס אל-עין', 'ראס עלי', 'ראש העין', 'ראש פינה', 'ראש צורים', 'ראשון לציון', 'רבבה', 'רבדים', 'רביבים', 'רביד', 'רגבה', 'רגבים', 'רהט', 'רווחה', 'רוויה', 'רוח מדבר', 'רוחמה', 'רומאנה', 'רומת הייב', 'רועי', 'רותם', 'רחוב', 'רחובות', 'רחלים', 'ריחאניה', 'ריחן', 'ריינה', 'רימונים', 'רינתיה', 'רכסים', 'רם-און', 'רמות', 'רמות השבים', 'רמות מאיר', 'רמות מנשה', 'רמות נפתלי', 'רמלה', 'רמת גן', 'רמת דוד', 'רמת הכובש', 'רמת השופט', 'רמת השרון', 'רמת יוחנן', 'רמת ישי', 'רמת מגשימים', 'רמת צבי', 'רמת רזיאל', 'רמת רחל', 'רנן', 'רעים', 'רעננה', 'רקפת', 'רשפון', 'רשפים', 'רתמים', 'שאר ישוב', 'שבי ציון', 'שבי שומרון', 'שבלי - אום אל-גנם', 'שגב-שלום', 'שדה אילן', 'שדה אליהו', 'שדה אליעזר', 'שדה בוקר', 'שדה דוד', 'שדה ורבורג', 'שדה יואב', 'שדה יעקב', 'שדה יצחק', 'שדה משה', 'שדה נחום', 'שדה נחמיה', 'שדה ניצן', 'שדה עוזיהו', 'שדה צבי', 'שדות ים', 'שדות מיכה', 'שדי אברהם', 'שדי חמד', 'שדי תרומות', 'שדמה', 'שדמות דבורה', 'שדמות מחולה', 'שדרות', 'שואבה', 'שובה', 'שובל', 'שוהם', 'שומרה', 'שומריה', 'שוקדה', 'שורש', 'שורשים', 'שושנת העמקים', 'שזור', 'שחר', 'שחרות', 'שיבולים', 'שיטים', 'שילה', 'שילת', 'שכניה', 'שלווה', 'שלווה במדבר', 'שלוחות', 'שלומי', 'שלומית', 'שמיר', 'שמעה', 'שמרת', 'שמשית', 'שני', 'שניר', 'שעב', 'שעורים', 'שעל', 'שעלבים', 'שער אפרים', 'שער הגולן', 'שער העמקים', 'שער מנשה', 'שערי תקווה', 'שפיים', 'שפיר', 'שפר', 'שפרעם', 'שקד', 'שקף', 'שרונה', 'שריד', 'שרשרת', 'שתולה', 'שתולים', 'תאשור', 'תדהר', 'תובל', 'תומר', 'תושיה', 'תימורים', 'תירוש', 'תל אביב - יפו', 'תל יוסף', 'תל יצחק', 'תל מונד', 'תל עדשים', 'תל קציר', 'תל שבע', 'תל תאומים', 'תלם', 'תלמי אליהו', 'תלמי אלעזר', 'תלמי ביל"ו', 'תלמי יוסף', 'תלמי יחיאל', 'תלמי יפה', 'תלמים', 'תמרת', 'תנובות', 'תעוז', 'תפרח', 'תקומה', 'תקוע', 'תרום', ); /** * {@link} https://he.wikipedia.org/wiki/%D7%A4%D7%95%D7%A8%D7%98%D7%9C:%D7%9E%D7%93%D7%99%D7%A0%D7%95%D7%AA_%D7%94%D7%A2%D7%95%D7%9C%D7%9D/%D7%9E%D7%93%D7%99%D7%A0%D7%95%D7%AA_%D7%91%D7%9E%D7%99%D7%95%D7%A0%D7%99%D7%9D_%D7%A9%D7%95%D7%A0%D7%99%D7%9D **/ protected static $country = array( 'אוגנדה', 'אוזבקיסטן', 'אוסטריה', 'אוסטרליה', 'אוקראינה', 'אורוגוואי', 'אזרבייג\'ן', 'איטליה', 'איי מרשל', 'סיישל', 'איי שלמה', 'אינדונזיה', 'איסלנד', 'איראן', 'אירלנד', 'אל סלוודור', 'אלבניה', 'אלג\'יריה', 'אנגולה', 'אנדורה', 'אנטיגואה וברבודה', 'אסטוניה', 'אפגניסטן', 'אקוודור', 'ארגנטינה', 'אריתריאה', 'ארמניה', 'ארצות הברית', 'אתיופיה', 'בהאמה', 'בהוטן', 'בוטסואנה', 'בולגריה', 'בוליביה', 'בוסניה והרצגובינה', 'בורונדי', 'בורקינה פאסו', 'בחריין', 'בלגיה', 'בליז', 'בלארוס', 'בנגלדש', 'בנין', 'ברבדוס', 'ברוניי', 'ברזיל', 'גאורגיה', 'גאנה', 'גבון', 'גואטמלה', 'גיאנה', 'ג\'יבוטי', 'גינאה', 'גינאה ביסאו', 'גיניאה המשוונית', 'גמביה', 'ג\'מייקה', 'גרמניה', 'גרנדה', 'דומיניקה', 'דנמרק', 'דרום אפריקה', 'דרום סודאן', 'האיטי', 'האמירויות הערביות המאוחדות', 'הודו', 'הולנד', 'הונגריה', 'הונדורס', 'הממלכה המאוחדת', 'וייטנאם', 'ונואטו', 'ונצואלה', 'זימבבואה', 'זמביה', 'חוף השנהב', 'טג\'יקיסטן', 'טובאלו', 'טוגו', 'טונגה', 'טורקיה', 'טורקמניסטן', 'טנזניה', 'טרינידד וטובגו', 'יוון', 'יפן', 'ירדן', 'ישראל', 'כווית', 'כף ורדה', 'לאוס', 'לבנון', 'לוב', 'לוקסמבורג', 'לטביה', 'ליבריה', 'ליטא', 'ליכטנשטיין', 'לסוטו', 'מאוריטניה', 'מאוריציוס', 'מאלי', 'מדגסקר', 'מוזמביק', 'מולדובה', 'מונגוליה', 'מונטנגרו', 'מונאקו', 'מזרח טימור', 'מיאנמר', 'מיקרונזיה', 'מלאווי', 'המלדיביים', 'מלזיה', 'מלטה', 'מצרים', 'מקדוניה', 'מקסיקו', 'מרוקו', 'נאורו', 'נורווגיה', 'ניגריה', 'ניו זילנד', 'ניז\'ר', 'ניקרגואה', 'נמיביה', 'נפאל', 'סאו טומה ופרינסיפה', 'סודאן', 'סווזילנד', 'סומליה', 'סוריה', 'סורינם', 'סיירה לאון', 'סין', 'סינגפור', 'סלובניה', 'סלובקיה', 'סמואה', 'סן מרינו', 'סנגל', 'סנט וינסנט והגרנדינים', 'סנט לוסיה', 'סנט קיטס ונוויס', 'ספרד', 'סרביה', 'סרי לנקה', 'עומאן', 'עיראק', 'ערב הסעודית', 'פולין', 'פורטוגל', 'פיג\'י', 'פיליפינים', 'פינלנד', 'פלאו', 'פנמה', 'פפואה גינאה החדשה', 'פקיסטן', 'פרגוואי', 'פרו', 'צ\'אד', 'צ\'ילה', 'צ\'כיה', 'צרפת', 'קובה', 'קולומביה', 'קומורו', 'קונגו', 'קוסטה ריקה', 'קוריאה הדרומית', 'קוריאה הצפונית', 'קזחסטן', 'קטאר', 'קירגיזסטן', 'קיריבטי', 'קמבודיה', 'קמרון', 'קנדה', 'קניה', 'קפריסין', 'קרואטיה', 'קריית הוותיקן', 'רואנדה', 'רומניה', 'רוסיה', 'הרפובליקה הדומיניקנית', 'הרפובליקה המרכז אפריקאית', 'הרפובליקה הסינית', 'שוודיה', 'שווייץ', 'תאילנד', 'תוניסיה', 'תימן', ); protected static $cityFormats = array( '{{citySuffix}}', ); protected static $streetNameFormats = array( '{{streetSuffix}} {{firstName}}', '{{streetSuffix}} {{lastName}}', ); protected static $streetAddressFormats = array( '{{streetName}} {{buildingNumber}} ', '{{streetName}} {{buildingNumber}} {{secondaryAddress}}', ); protected static $addressFormats = array( "{{streetAddress}}\n{{city}}, {{postcode}}", ); protected static $secondaryAddressFormats = array('דירה ##', 'קומה ##'); /** * @example 'Appt. 350' */ public static function secondaryAddress() { return static::numerify(static::randomElement(static::$secondaryAddressFormats)); } }
{ "pile_set_name": "Github" }
from mymodule import stats_word import traceback import logging logger = logging.getLogger(__name__) def test_traceback(): try: stats_word.stats_text(1) except Exception as e: print('test_traceback =>' , e) print(traceback.format_exc()) def test_logger(): try: stats_word.stats_text(1) except Exception as e: # print('test_logger =>' , e) logger.exception(e) if __name__ == "__main__": # stats_word.stats_text(1) test_traceback() test_logger() sample_text = ''' 愚公移山 太行、王屋二山,方七百里,高万仞。本在冀州之南,河阳之北。 北山愚公者,年且九十,面山而居。惩山北之塞,出入之迂也。 聚室而谋曰:“吾与汝毕力平险,指通豫南,达于汉阴,可乎?” 杂然相许。其妻献疑曰:“以君之力,曾不能损魁父之丘,如太行、王屋何?且焉置土石?” 杂曰:“投诸渤海之尾,隐土之北。” 遂率子孙荷担者三夫,叩石垦壤,箕畚运于渤海之尾。 邻人京城氏之孀妻有遗男,始龀,跳往助之。寒暑易节,始一反焉。 河曲智叟笑而止之曰:“甚矣,汝之不惠。以残年余力,曾不能毁山之一毛,其如土石何?” 北山愚公长息曰:“汝心之固,固不可彻,曾不若孀妻弱子。虽我之死,有子存焉;子又生孙,孙又生子;子又有子,子又有孙;子子孙孙无穷匮也,而山不加增,何苦而不平?” 河曲智叟亡以应。 操蛇之神闻之,惧其不已也,告之于帝。帝感其诚,命夸娥氏二子负二山,一厝朔东,一厝雍南。自此,冀之南,汉之阴,无陇断焉。 How The Foolish Old Man Moved Mountains Yugong was a ninety-year-old man who lived at the north of two high mountains, Mount Taixing and Mount Wangwu. Stretching over a wide expanse of land, the mountains blocked yugong’s way making it inconvenient for him and his family to get around. One day yugong gathered his family together and said,”Let’s do our best to level these two mountains. We shall open a road that leads to Yuzhou. What do you think?” All but his wife agreed with him. “You don’t have the strength to cut even a small mound,” muttered his wife. “How on earth do you suppose you can level Mount Taixin and Mount Wanwu? Moreover, where will all the earth and rubble go?” “Dump them into the Sea of Bohai!” said everyone. So Yugong, his sons, and his grandsons started to break up rocks and remove the earth. They transported the earth and rubble to the Sea of Bohai. Now Yugong’s neighbour was a widow who had an only child eight years old. Evening the young boy offered his help eagerly. Summer went by and winter came. It took Yugong and his crew a full year to travel back and forth once. On the bank of the Yellow River dwelled an old man much respected for his wisdom. When he saw their back-breaking labour, he ridiculed Yugong saying,”Aren’t you foolish, my friend? You are very old now, and with whatever remains of your waning strength, you won’t be able to remove even a corner of the mountain.” Yugong uttered a sigh and said,”A biased person like you will never understand. You can’t even compare with the widow’s little boy!” “Even if I were dead, there will still be my children, my grandchildren, my great grandchildren, my great great grandchildren. They descendants will go on forever. But these mountains will not grow any taler. We shall level them one day!” he declared with confidence. The wise old man was totally silenced. When the guardian gods of the mountains saw how determined Yugong and his crew were, they were struck with fear and reported the incident to the Emperor of Heavens. Filled with admiration for Yugong, the Emperor of Heavens ordered two mighty gods to carry the mountains away. ''' result = stats_word.stats_text(sample_text) print('统计结果 ==>', result)
{ "pile_set_name": "Github" }
body { padding: 50px; font: 15px/1.6 Helvetica, Arial, sans-serif; } img { max-height: 50vh; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; background: #ffffff; font-size: 18px; line-height: 1.8em; } code { font-family: 'Menlo', monospace; font-weight: bold; padding: 0.2rem 0.3rem; background-color: #ebebeb; line-height: 1.8em; font-size: 0.8em; } pre > code { background-color: transparent; font-weight: 300; } pre { background-color: #f7f9fa; display: inline-block; padding: 0.5em; min-width: 33vw; border-radius: 3px; } a { color: #fc2e1c; text-decoration: none; } .logo { background-image: url('favicon.ico'); background-position: center; background-size: cover; height: 24px; width: 24px; background-repeat: no-repeat; } .nav-inner { width: 95vw; margin: 0 auto; display: flex; flex-direction: row; align-items: center; justify-content: center; } .nav { display: flex; flex-direction: row; flex: 1; align-items: center; justify-content: center; padding: 0 10px; font-size: 14px; z-index: 3; position: fixed; top: 0; left: 0; right: 0; margin: 0; background: #ffffff; } .nav ul { list-style-type: none; display: flex; flex: 1; flex-direction: row; padding: 0; margin: 0; color: white; justify-content: flex-start; align-items: center; } .content { margin-top: 44px; max-width: 720px; min-width: 300px; } table { border-collapse: collapse; } th, td { border: 1px solid; padding: 5px 10px 5px 5px; } .content h1 { margin-bottom: 1.2em; line-height: 0; } .doc-nav { margin-right: 5rem; margin-top: 55px; position: sticky; top: 55px; } .doc-nav ul { list-style: none; font-size: 14px; margin: 0; padding: 0; } .doc-nav li { margin: 0; padding: 0; line-height: 1.75em; } .doc-container { display: flex; flex-direction: row; position: relative; } @media (max-width: 600px) { .github-buttons { display: none; } .Item { float: left; } .nav { padding: 0; } .nav-inner { width: 99vw; } .doc-container { flex-direction: column-reverse; min-width: 90vw; max-width: 90vw; margin: 0; } .content, pre { min-width: 90vw; max-width: 90vw; word-break: break-all; } code { word-break: break-all; } body { padding: 10px; } } .Item a { display: inline-block; padding: 10px; text-decoration: none; color: #fc2e1c; font-weight: 600; } .Item .github { font-weight: 600; color: #fc2e1c; } @media (max-width: 600px) { .Item { display: block; float: left; } .Item .github { margin-top: 0; } } table { border-collapse: collapse; font-size: 12px; font-family: monospace; border-color: #efefef; margin-top: 0.25rem; }
{ "pile_set_name": "Github" }
# Copyright 2016 Matt Wrock <matt@mattwrock.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. module WinRM module PSRP module MessageData # session capability message type class SessionCapability < Base def protocol_version clixml[:version].select { |v| v.attributes['N'] == 'protocolversion' }.first end def ps_version clixml[:version].select { |v| v.attributes['N'] == 'PSVersion' }.first end def serialization_version clixml[:version].select { |v| v.attributes['N'] == 'SerializationVersion' }.first end end end end end
{ "pile_set_name": "Github" }
/////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// /// 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: /// /// 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. /// /// @ref core /// @file glm/detail/intrinsic_common.inl /// @date 2009-05-08 / 2011-06-15 /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// namespace glm{ namespace detail{ #if(GLM_COMPILER & GLM_COMPILER_VC) #pragma warning(push) #pragma warning(disable : 4510 4512 4610) #endif union ieee754_QNAN { const float f; struct i { const unsigned int mantissa:23, exp:8, sign:1; }; ieee754_QNAN() : f(0.0)/*, mantissa(0x7FFFFF), exp(0xFF), sign(0x0)*/ {} }; #if(GLM_COMPILER & GLM_COMPILER_VC) #pragma warning(pop) #endif static const __m128 GLM_VAR_USED zero = _mm_setzero_ps(); static const __m128 GLM_VAR_USED one = _mm_set_ps1(1.0f); static const __m128 GLM_VAR_USED minus_one = _mm_set_ps1(-1.0f); static const __m128 GLM_VAR_USED two = _mm_set_ps1(2.0f); static const __m128 GLM_VAR_USED three = _mm_set_ps1(3.0f); static const __m128 GLM_VAR_USED pi = _mm_set_ps1(3.1415926535897932384626433832795f); static const __m128 GLM_VAR_USED hundred_eighty = _mm_set_ps1(180.f); static const __m128 GLM_VAR_USED pi_over_hundred_eighty = _mm_set_ps1(0.017453292519943295769236907684886f); static const __m128 GLM_VAR_USED hundred_eighty_over_pi = _mm_set_ps1(57.295779513082320876798154814105f); static const ieee754_QNAN absMask; static const __m128 GLM_VAR_USED abs4Mask = _mm_set_ps1(absMask.f); static const __m128 GLM_VAR_USED _epi32_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(static_cast<int>(0x80000000))); //static const __m128 GLM_VAR_USED _epi32_inv_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF)); //static const __m128 GLM_VAR_USED _epi32_mant_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000)); //static const __m128 GLM_VAR_USED _epi32_inv_mant_mask = _mm_castsi128_ps(_mm_set1_epi32(0x807FFFFF)); //static const __m128 GLM_VAR_USED _epi32_min_norm_pos = _mm_castsi128_ps(_mm_set1_epi32(0x00800000)); static const __m128 GLM_VAR_USED _epi32_0 = _mm_set_ps1(0); static const __m128 GLM_VAR_USED _epi32_1 = _mm_set_ps1(1); static const __m128 GLM_VAR_USED _epi32_2 = _mm_set_ps1(2); static const __m128 GLM_VAR_USED _epi32_3 = _mm_set_ps1(3); static const __m128 GLM_VAR_USED _epi32_4 = _mm_set_ps1(4); static const __m128 GLM_VAR_USED _epi32_5 = _mm_set_ps1(5); static const __m128 GLM_VAR_USED _epi32_6 = _mm_set_ps1(6); static const __m128 GLM_VAR_USED _epi32_7 = _mm_set_ps1(7); static const __m128 GLM_VAR_USED _epi32_8 = _mm_set_ps1(8); static const __m128 GLM_VAR_USED _epi32_9 = _mm_set_ps1(9); static const __m128 GLM_VAR_USED _epi32_127 = _mm_set_ps1(127); //static const __m128 GLM_VAR_USED _epi32_ninf = _mm_castsi128_ps(_mm_set1_epi32(0xFF800000)); //static const __m128 GLM_VAR_USED _epi32_pinf = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000)); static const __m128 GLM_VAR_USED _ps_1_3 = _mm_set_ps1(0.33333333333333333333333333333333f); static const __m128 GLM_VAR_USED _ps_0p5 = _mm_set_ps1(0.5f); static const __m128 GLM_VAR_USED _ps_1 = _mm_set_ps1(1.0f); static const __m128 GLM_VAR_USED _ps_m1 = _mm_set_ps1(-1.0f); static const __m128 GLM_VAR_USED _ps_2 = _mm_set_ps1(2.0f); static const __m128 GLM_VAR_USED _ps_3 = _mm_set_ps1(3.0f); static const __m128 GLM_VAR_USED _ps_127 = _mm_set_ps1(127.0f); static const __m128 GLM_VAR_USED _ps_255 = _mm_set_ps1(255.0f); static const __m128 GLM_VAR_USED _ps_2pow23 = _mm_set_ps1(8388608.0f); static const __m128 GLM_VAR_USED _ps_1_0_0_0 = _mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f); static const __m128 GLM_VAR_USED _ps_0_1_0_0 = _mm_set_ps(0.0f, 1.0f, 0.0f, 0.0f); static const __m128 GLM_VAR_USED _ps_0_0_1_0 = _mm_set_ps(0.0f, 0.0f, 1.0f, 0.0f); static const __m128 GLM_VAR_USED _ps_0_0_0_1 = _mm_set_ps(0.0f, 0.0f, 0.0f, 1.0f); static const __m128 GLM_VAR_USED _ps_pi = _mm_set_ps1(3.1415926535897932384626433832795f); static const __m128 GLM_VAR_USED _ps_pi2 = _mm_set_ps1(6.283185307179586476925286766560f); static const __m128 GLM_VAR_USED _ps_2_pi = _mm_set_ps1(0.63661977236758134307553505349006f); static const __m128 GLM_VAR_USED _ps_pi_2 = _mm_set_ps1(1.5707963267948966192313216916398f); static const __m128 GLM_VAR_USED _ps_4_pi = _mm_set_ps1(1.2732395447351626861510701069801f); static const __m128 GLM_VAR_USED _ps_pi_4 = _mm_set_ps1(0.78539816339744830961566084581988f); static const __m128 GLM_VAR_USED _ps_sincos_p0 = _mm_set_ps1(0.15707963267948963959e1f); static const __m128 GLM_VAR_USED _ps_sincos_p1 = _mm_set_ps1(-0.64596409750621907082e0f); static const __m128 GLM_VAR_USED _ps_sincos_p2 = _mm_set_ps1(0.7969262624561800806e-1f); static const __m128 GLM_VAR_USED _ps_sincos_p3 = _mm_set_ps1(-0.468175413106023168e-2f); static const __m128 GLM_VAR_USED _ps_tan_p0 = _mm_set_ps1(-1.79565251976484877988e7f); static const __m128 GLM_VAR_USED _ps_tan_p1 = _mm_set_ps1(1.15351664838587416140e6f); static const __m128 GLM_VAR_USED _ps_tan_p2 = _mm_set_ps1(-1.30936939181383777646e4f); static const __m128 GLM_VAR_USED _ps_tan_q0 = _mm_set_ps1(-5.38695755929454629881e7f); static const __m128 GLM_VAR_USED _ps_tan_q1 = _mm_set_ps1(2.50083801823357915839e7f); static const __m128 GLM_VAR_USED _ps_tan_q2 = _mm_set_ps1(-1.32089234440210967447e6f); static const __m128 GLM_VAR_USED _ps_tan_q3 = _mm_set_ps1(1.36812963470692954678e4f); static const __m128 GLM_VAR_USED _ps_tan_poleval = _mm_set_ps1(3.68935e19f); static const __m128 GLM_VAR_USED _ps_atan_t0 = _mm_set_ps1(-0.91646118527267623468e-1f); static const __m128 GLM_VAR_USED _ps_atan_t1 = _mm_set_ps1(-0.13956945682312098640e1f); static const __m128 GLM_VAR_USED _ps_atan_t2 = _mm_set_ps1(-0.94393926122725531747e2f); static const __m128 GLM_VAR_USED _ps_atan_t3 = _mm_set_ps1(0.12888383034157279340e2f); static const __m128 GLM_VAR_USED _ps_atan_s0 = _mm_set_ps1(0.12797564625607904396e1f); static const __m128 GLM_VAR_USED _ps_atan_s1 = _mm_set_ps1(0.21972168858277355914e1f); static const __m128 GLM_VAR_USED _ps_atan_s2 = _mm_set_ps1(0.68193064729268275701e1f); static const __m128 GLM_VAR_USED _ps_atan_s3 = _mm_set_ps1(0.28205206687035841409e2f); static const __m128 GLM_VAR_USED _ps_exp_hi = _mm_set_ps1(88.3762626647949f); static const __m128 GLM_VAR_USED _ps_exp_lo = _mm_set_ps1(-88.3762626647949f); static const __m128 GLM_VAR_USED _ps_exp_rln2 = _mm_set_ps1(1.4426950408889634073599f); static const __m128 GLM_VAR_USED _ps_exp_p0 = _mm_set_ps1(1.26177193074810590878e-4f); static const __m128 GLM_VAR_USED _ps_exp_p1 = _mm_set_ps1(3.02994407707441961300e-2f); static const __m128 GLM_VAR_USED _ps_exp_q0 = _mm_set_ps1(3.00198505138664455042e-6f); static const __m128 GLM_VAR_USED _ps_exp_q1 = _mm_set_ps1(2.52448340349684104192e-3f); static const __m128 GLM_VAR_USED _ps_exp_q2 = _mm_set_ps1(2.27265548208155028766e-1f); static const __m128 GLM_VAR_USED _ps_exp_q3 = _mm_set_ps1(2.00000000000000000009e0f); static const __m128 GLM_VAR_USED _ps_exp_c1 = _mm_set_ps1(6.93145751953125e-1f); static const __m128 GLM_VAR_USED _ps_exp_c2 = _mm_set_ps1(1.42860682030941723212e-6f); static const __m128 GLM_VAR_USED _ps_exp2_hi = _mm_set_ps1(127.4999961853f); static const __m128 GLM_VAR_USED _ps_exp2_lo = _mm_set_ps1(-127.4999961853f); static const __m128 GLM_VAR_USED _ps_exp2_p0 = _mm_set_ps1(2.30933477057345225087e-2f); static const __m128 GLM_VAR_USED _ps_exp2_p1 = _mm_set_ps1(2.02020656693165307700e1f); static const __m128 GLM_VAR_USED _ps_exp2_p2 = _mm_set_ps1(1.51390680115615096133e3f); static const __m128 GLM_VAR_USED _ps_exp2_q0 = _mm_set_ps1(2.33184211722314911771e2f); static const __m128 GLM_VAR_USED _ps_exp2_q1 = _mm_set_ps1(4.36821166879210612817e3f); static const __m128 GLM_VAR_USED _ps_log_p0 = _mm_set_ps1(-7.89580278884799154124e-1f); static const __m128 GLM_VAR_USED _ps_log_p1 = _mm_set_ps1(1.63866645699558079767e1f); static const __m128 GLM_VAR_USED _ps_log_p2 = _mm_set_ps1(-6.41409952958715622951e1f); static const __m128 GLM_VAR_USED _ps_log_q0 = _mm_set_ps1(-3.56722798256324312549e1f); static const __m128 GLM_VAR_USED _ps_log_q1 = _mm_set_ps1(3.12093766372244180303e2f); static const __m128 GLM_VAR_USED _ps_log_q2 = _mm_set_ps1(-7.69691943550460008604e2f); static const __m128 GLM_VAR_USED _ps_log_c0 = _mm_set_ps1(0.693147180559945f); static const __m128 GLM_VAR_USED _ps_log2_c0 = _mm_set_ps1(1.44269504088896340735992f); GLM_FUNC_QUALIFIER __m128 sse_abs_ps(__m128 x) { return _mm_and_ps(glm::detail::abs4Mask, x); } GLM_FUNC_QUALIFIER __m128 sse_sgn_ps(__m128 x) { __m128 Neg = _mm_set1_ps(-1.0f); __m128 Pos = _mm_set1_ps(1.0f); __m128 Cmp0 = _mm_cmplt_ps(x, zero); __m128 Cmp1 = _mm_cmpgt_ps(x, zero); __m128 And0 = _mm_and_ps(Cmp0, Neg); __m128 And1 = _mm_and_ps(Cmp1, Pos); return _mm_or_ps(And0, And1); } //floor GLM_FUNC_QUALIFIER __m128 sse_flr_ps(__m128 x) { __m128 rnd0 = sse_rnd_ps(x); __m128 cmp0 = _mm_cmplt_ps(x, rnd0); __m128 and0 = _mm_and_ps(cmp0, glm::detail::_ps_1); __m128 sub0 = _mm_sub_ps(rnd0, and0); return sub0; } //trunc /* GLM_FUNC_QUALIFIER __m128 _mm_trc_ps(__m128 v) { return __m128(); } */ //round GLM_FUNC_QUALIFIER __m128 sse_rnd_ps(__m128 x) { __m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x); __m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23); __m128 add0 = _mm_add_ps(x, or0); __m128 sub0 = _mm_sub_ps(add0, or0); return sub0; } //roundEven GLM_FUNC_QUALIFIER __m128 sse_rde_ps(__m128 x) { __m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x); __m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23); __m128 add0 = _mm_add_ps(x, or0); __m128 sub0 = _mm_sub_ps(add0, or0); return sub0; } GLM_FUNC_QUALIFIER __m128 sse_ceil_ps(__m128 x) { __m128 rnd0 = sse_rnd_ps(x); __m128 cmp0 = _mm_cmpgt_ps(x, rnd0); __m128 and0 = _mm_and_ps(cmp0, glm::detail::_ps_1); __m128 add0 = _mm_add_ps(rnd0, and0); return add0; } GLM_FUNC_QUALIFIER __m128 sse_frc_ps(__m128 x) { __m128 flr0 = sse_flr_ps(x); __m128 sub0 = _mm_sub_ps(x, flr0); return sub0; } GLM_FUNC_QUALIFIER __m128 sse_mod_ps(__m128 x, __m128 y) { __m128 div0 = _mm_div_ps(x, y); __m128 flr0 = sse_flr_ps(div0); __m128 mul0 = _mm_mul_ps(y, flr0); __m128 sub0 = _mm_sub_ps(x, mul0); return sub0; } /// TODO /* GLM_FUNC_QUALIFIER __m128 sse_modf_ps(__m128 x, __m128i & i) { __m128 empty; return empty; } */ //GLM_FUNC_QUALIFIER __m128 _mm_min_ps(__m128 x, __m128 y) //GLM_FUNC_QUALIFIER __m128 _mm_max_ps(__m128 x, __m128 y) GLM_FUNC_QUALIFIER __m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal) { __m128 min0 = _mm_min_ps(v, maxVal); __m128 max0 = _mm_max_ps(min0, minVal); return max0; } GLM_FUNC_QUALIFIER __m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a) { __m128 sub0 = _mm_sub_ps(glm::detail::one, a); __m128 mul0 = _mm_mul_ps(v1, sub0); __m128 mul1 = _mm_mul_ps(v2, a); __m128 add0 = _mm_add_ps(mul0, mul1); return add0; } GLM_FUNC_QUALIFIER __m128 sse_stp_ps(__m128 edge, __m128 x) { __m128 cmp = _mm_cmple_ps(x, edge); if(_mm_movemask_ps(cmp) == 0) return glm::detail::one; else return glm::detail::zero; } GLM_FUNC_QUALIFIER __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x) { __m128 sub0 = _mm_sub_ps(x, edge0); __m128 sub1 = _mm_sub_ps(edge1, edge0); __m128 div0 = _mm_sub_ps(sub0, sub1); __m128 clp0 = sse_clp_ps(div0, glm::detail::zero, glm::detail::one); __m128 mul0 = _mm_mul_ps(glm::detail::two, clp0); __m128 sub2 = _mm_sub_ps(glm::detail::three, mul0); __m128 mul1 = _mm_mul_ps(clp0, clp0); __m128 mul2 = _mm_mul_ps(mul1, sub2); return mul2; } /// \todo //GLM_FUNC_QUALIFIER __m128 sse_nan_ps(__m128 x) //{ // __m128 empty; // return empty; //} /// \todo //GLM_FUNC_QUALIFIER __m128 sse_inf_ps(__m128 x) //{ // __m128 empty; // return empty; //} // SSE scalar reciprocal sqrt using rsqrt op, plus one Newton-Rhaphson iteration // By Elan Ruskin, http://assemblyrequired.crashworks.org/ GLM_FUNC_QUALIFIER __m128 sse_sqrt_wip_ss(__m128 const & x) { __m128 const recip = _mm_rsqrt_ss(x); // "estimate" opcode __m128 const half = _mm_set_ps1(0.5f); __m128 const halfrecip = _mm_mul_ss(half, recip); __m128 const threeminus_xrr = _mm_sub_ss(three, _mm_mul_ss(x, _mm_mul_ss (recip, recip))); return _mm_mul_ss(halfrecip, threeminus_xrr); } }//namespace detail }//namespace glms
{ "pile_set_name": "Github" }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.ComponentModel.DataAnnotations; using osu.Game.Database; using osu.Game.IO; namespace osu.Game.Beatmaps { public class BeatmapSetFileInfo : INamedFileInfo, IHasPrimaryKey { public int ID { get; set; } public int BeatmapSetInfoID { get; set; } public int FileInfoID { get; set; } public FileInfo FileInfo { get; set; } [Required] public string Filename { get; set; } } }
{ "pile_set_name": "Github" }
# AUTOGENERATED FILE FROM balenalib/raspberry-pi2-fedora:26-run # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 RUN dnf install -y \ python3-pip \ python3-dbus \ && dnf clean all # install "virtualenv", since the vast majority of users of this image will want it RUN pip3 install -U --no-cache-dir --ignore-installed pip setuptools \ && pip3 install --no-cache-dir virtualenv RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'As of January 1st, 2020, Python 2 was end-of-life, we will change the latest tag for Balenalib Python base image to Python 3.x and drop support for Python 2 soon. So after 1st July, 2020, all the balenalib Python latest tag will point to the latest Python 3 version and no changes, or fixes will be made to balenalib Python 2 base image. If you are using Python 2 for your application, please upgrade to Python 3 before 1st July.' > /.balena/messages/python-deprecation-warnin CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Fedora 26 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.7.7, Pip v20.0.2, Setuptools v46.1.3 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "pile_set_name": "Github" }
/** * * Copyright 2015 Florian Schmaus * * 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. */ /** * TODO describe me. */ package org.jivesoftware.smackx.jingleold;
{ "pile_set_name": "Github" }
include(EigenTesting) include(CheckCXXSourceCompiles) # configure the "site" and "buildname" ei_set_sitename() # retrieve and store the build string ei_set_build_string() add_custom_target(buildtests) add_custom_target(check COMMAND "ctest") add_dependencies(check buildtests) # check whether /bin/bash exists find_file(EIGEN_BIN_BASH_EXISTS "/bin/bash" PATHS "/" NO_DEFAULT_PATH) # This call activates testing and generates the DartConfiguration.tcl include(CTest) set(EIGEN_TEST_BUILD_FLAGS "" CACHE STRING "Options passed to the build command of unit tests") # Overwrite default DartConfiguration.tcl such that ctest can build our unit tests. # Recall that our unit tests are not in the "all" target, so we have to explicitely ask ctest to build our custom 'buildtests' target. # At this stage, we can also add custom flags to the build tool through the user defined EIGEN_TEST_BUILD_FLAGS variable. file(READ "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" EIGEN_DART_CONFIG_FILE) # try to grab the default flags string(REGEX MATCH "MakeCommand:.*-- (.*)\nDefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE}) if(NOT CMAKE_MATCH_1) string(REGEX MATCH "MakeCommand:.*[^c]make (.*)\nDefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE}) endif() string(REGEX REPLACE "MakeCommand:.*DefaultCTestConfigurationType" "MakeCommand: ${CMAKE_COMMAND} --build . --target buildtests --config \"\${CTEST_CONFIGURATION_TYPE}\" -- ${CMAKE_MATCH_1} ${EIGEN_TEST_BUILD_FLAGS}\nDefaultCTestConfigurationType" EIGEN_DART_CONFIG_FILE2 ${EIGEN_DART_CONFIG_FILE}) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" ${EIGEN_DART_CONFIG_FILE2}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in ${CMAKE_BINARY_DIR}/CTestCustom.cmake) # some documentation of this function would be nice ei_init_testing() # configure Eigen related testing options option(EIGEN_NO_ASSERTION_CHECKING "Disable checking of assertions using exceptions" OFF) option(EIGEN_DEBUG_ASSERTS "Enable advanced debuging of assertions" OFF) if(CMAKE_COMPILER_IS_GNUCXX) option(EIGEN_COVERAGE_TESTING "Enable/disable gcov" OFF) if(EIGEN_COVERAGE_TESTING) set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage") set(CTEST_CUSTOM_COVERAGE_EXCLUDE "/test/") else(EIGEN_COVERAGE_TESTING) set(COVERAGE_FLAGS "") endif(EIGEN_COVERAGE_TESTING) if(EIGEN_TEST_C++0x) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") endif(EIGEN_TEST_C++0x) if(CMAKE_SYSTEM_NAME MATCHES Linux) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -g2") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COVERAGE_FLAGS} -O2 -g2") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${COVERAGE_FLAGS} -fno-inline-functions") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COVERAGE_FLAGS} -O0 -g3") endif(CMAKE_SYSTEM_NAME MATCHES Linux) elseif(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS") endif(CMAKE_COMPILER_IS_GNUCXX)
{ "pile_set_name": "Github" }
/* Ppmd.h -- PPMD codec common code 2010-03-12 : Igor Pavlov : Public domain This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ #ifndef __PPMD_H #define __PPMD_H #include "Types.h" #include "CpuArch.h" EXTERN_C_BEGIN #ifdef MY_CPU_32BIT #define PPMD_32BIT #endif #define PPMD_INT_BITS 7 #define PPMD_PERIOD_BITS 7 #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS)) #define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift)) #define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2) #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob)) #define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob)) #define PPMD_N1 4 #define PPMD_N2 4 #define PPMD_N3 4 #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4) #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4) #pragma pack(push,1) /* SEE-contexts for PPM-contexts with masked symbols */ typedef struct { UInt16 Summ; /* Freq */ Byte Shift; /* Speed of Freq change; low Shift is for fast change */ Byte Count; /* Count to next change of Shift */ } CPpmd_See; #define Ppmd_See_Update(p) if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \ { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); } typedef struct { Byte Symbol; Byte Freq; UInt16 SuccessorLow; UInt16 SuccessorHigh; } CPpmd_State; #pragma pack(pop) typedef #ifdef PPMD_32BIT CPpmd_State * #else UInt32 #endif CPpmd_State_Ref; typedef #ifdef PPMD_32BIT void * #else UInt32 #endif CPpmd_Void_Ref; typedef #ifdef PPMD_32BIT Byte * #else UInt32 #endif CPpmd_Byte_Ref; #define PPMD_SetAllBitsIn256Bytes(p) \ { unsigned i; for (i = 0; i < 256 / sizeof(p[0]); i += 8) { \ p[i+7] = p[i+6] = p[i+5] = p[i+4] = p[i+3] = p[i+2] = p[i+1] = p[i+0] = ~(size_t)0; }} EXTERN_C_END #endif
{ "pile_set_name": "Github" }
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/core/framework/common_shape_fns.h" #include "tensorflow/core/framework/op.h" namespace tensorflow { using shape_inference::InferenceContext; using shape_inference::ShapeHandle; REGISTER_OP("Variable") .Output("ref: Ref(dtype)") .Attr("shape: shape") .Attr("dtype: type") .Attr("container: string = ''") .Attr("shared_name: string = ''") .SetIsStateful() .SetShapeFn(shape_inference::UnknownShape) .Doc(R"doc( Holds state in the form of a tensor that persists across steps. Outputs a ref to the tensor state so it may be read or modified. TODO(zhifengc/mrry): Adds a pointer to a more detail document about sharing states in tensorflow. ref: A reference to the variable tensor. shape: The shape of the variable tensor. dtype: The type of elements in the variable tensor. container: If non-empty, this variable is placed in the given container. Otherwise, a default container is used. shared_name: If non-empty, this variable is named in the given bucket with this shared_name. Otherwise, the node name is used instead. )doc"); REGISTER_OP("IsVariableInitialized") .Input("ref: Ref(dtype)") .Output("is_initialized: bool") .Attr("dtype: type") .SetAllowsUninitializedInput() .SetShapeFn(shape_inference::ScalarShape) .Doc(R"doc( Checks whether a tensor has been initialized. Outputs boolean scalar indicating whether the tensor has been initialized. ref: Should be from a `Variable` node. May be uninitialized. dtype: The type of elements in the variable tensor. )doc"); REGISTER_OP("TemporaryVariable") .Output("ref: Ref(dtype)") .Attr("shape: shape") .Attr("dtype: type") .Attr("var_name: string = ''") .SetIsStateful() .SetShapeFn([](InferenceContext* c) { TensorShapeProto shape_proto; TF_RETURN_IF_ERROR(c->GetAttr("shape", &shape_proto)); ShapeHandle output; TF_RETURN_IF_ERROR(c->MakeShapeFromShapeProto(shape_proto, &output)); c->set_output(0, output); return Status::OK(); }) .Doc(R"doc( Returns a tensor that may be mutated, but only persists within a single step. This is an experimental op for internal use only and it is possible to use this op in unsafe ways. DO NOT USE unless you fully understand the risks. It is the caller's responsibility to ensure that 'ref' is eventually passed to a matching 'DestroyTemporaryVariable' op after all other uses have completed. Outputs a ref to the tensor state so it may be read or modified. E.g. var = state_ops._temporary_variable([1, 2], types.float_) var_name = var.op.name var = state_ops.assign(var, [[4.0, 5.0]]) var = state_ops.assign_add(var, [[6.0, 7.0]]) final = state_ops._destroy_temporary_variable(var, var_name=var_name) ref: A reference to the variable tensor. shape: The shape of the variable tensor. dtype: The type of elements in the variable tensor. var_name: Overrides the name used for the temporary variable resource. Default value is the name of the 'TemporaryVariable' op (which is guaranteed unique). )doc"); REGISTER_OP("DestroyTemporaryVariable") .Input("ref: Ref(T)") .Output("value: T") .Attr("T: type") .Attr("var_name: string") .SetShapeFn(shape_inference::UnchangedShape) .Doc(R"doc( Destroys the temporary variable and returns its final value. Sets output to the value of the Tensor pointed to by 'ref', then destroys the temporary variable called 'var_name'. All other uses of 'ref' *must* have executed before this op. This is typically achieved by chaining the ref through each assign op, or by using control dependencies. Outputs the final value of the tensor pointed to by 'ref'. ref: A reference to the temporary variable tensor. var_name: Name of the temporary variable, usually the name of the matching 'TemporaryVariable' op. )doc"); REGISTER_OP("Assign") .Input("ref: Ref(T)") .Input("value: T") .Output("output_ref: Ref(T)") .Attr("T: type") .Attr("validate_shape: bool = true") .Attr("use_locking: bool = true") .SetAllowsUninitializedInput() .SetShapeFn([](InferenceContext* c) { bool validate_shape; TF_RETURN_IF_ERROR(c->GetAttr("validate_shape", &validate_shape)); if (validate_shape) { return shape_inference::MergeBothInputsShapeFn(c); } c->set_output(0, c->input(1)); return Status::OK(); }) .Doc(R"doc( Update 'ref' by assigning 'value' to it. This operation outputs "ref" after the assignment is done. This makes it easier to chain operations that need to use the reset value. ref: Should be from a `Variable` node. May be uninitialized. value: The value to be assigned to the variable. validate_shape: If true, the operation will validate that the shape of 'value' matches the shape of the Tensor being assigned to. If false, 'ref' will take on the shape of 'value'. use_locking: If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. output_ref:= Same as "ref". Returned as a convenience for operations that want to use the new value after the variable has been reset. )doc"); REGISTER_OP("AssignAdd") .Input("ref: Ref(T)") .Input("value: T") .Output("output_ref: Ref(T)") .Attr("T: numbertype") .Attr("use_locking: bool = false") .SetShapeFn(shape_inference::MergeBothInputsShapeFn) .Doc(R"doc( Update 'ref' by adding 'value' to it. This operation outputs "ref" after the update is done. This makes it easier to chain operations that need to use the reset value. ref: Should be from a `Variable` node. value: The value to be added to the variable. use_locking: If True, the addition will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. output_ref:= Same as "ref". Returned as a convenience for operations that want to use the new value after the variable has been updated. )doc"); REGISTER_OP("AssignSub") .Input("ref: Ref(T)") .Input("value: T") .Output("output_ref: Ref(T)") .Attr("T: numbertype") .Attr("use_locking: bool = false") .SetShapeFn(shape_inference::MergeBothInputsShapeFn) .Doc(R"doc( Update 'ref' by subtracting 'value' from it. This operation outputs "ref" after the update is done. This makes it easier to chain operations that need to use the reset value. ref: Should be from a `Variable` node. value: The value to be subtracted to the variable. use_locking: If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. output_ref:= Same as "ref". Returned as a convenience for operations that want to use the new value after the variable has been updated. )doc"); namespace { Status ScatterUpdateShape(InferenceContext* c) { ShapeHandle var_shape = c->input(0); ShapeHandle indices_shape = c->input(1); ShapeHandle unused_updates_shape; ShapeHandle concat; ShapeHandle var_subshape; TF_RETURN_IF_ERROR(c->Subshape(var_shape, 1, &var_subshape)); TF_RETURN_IF_ERROR(c->Concatenate(indices_shape, var_subshape, &concat)); TF_RETURN_IF_ERROR(c->Merge(c->input(2), concat, &unused_updates_shape)); c->set_output(0, var_shape); return Status::OK(); } } // namespace REGISTER_OP("ScatterUpdate") .Input("ref: Ref(T)") .Input("indices: Tindices") .Input("updates: T") .Output("output_ref: Ref(T)") .Attr("T: type") .Attr("Tindices: {int32, int64}") .Attr("use_locking: bool = true") .SetShapeFn(ScatterUpdateShape) .Doc(R"doc( Applies sparse updates to a variable reference. This operation computes # Scalar indices ref[indices, ...] = updates[...] # Vector indices (for each i) ref[indices[i], ...] = updates[i, ...] # High rank indices (for each i, ..., j) ref[indices[i, ..., j], ...] = updates[i, ..., j, ...] This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value. If values in `ref` is to be updated more than once, because there are duplicate entires in `indices`, the order at which the updates happen for each value is undefined. Requires `updates.shape = indices.shape + ref.shape[1:]`. <div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;"> <img style="width:100%" src="../../images/ScatterUpdate.png" alt> </div> ref: Should be from a `Variable` node. indices: A tensor of indices into the first dimension of `ref`. updates: A tensor of updated values to store in `ref`. output_ref:= Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done. use_locking: If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. )doc"); REGISTER_OP("ScatterAdd") .Input("ref: Ref(T)") .Input("indices: Tindices") .Input("updates: T") .Output("output_ref: Ref(T)") .Attr("T: numbertype") .Attr("Tindices: {int32, int64}") .Attr("use_locking: bool = false") .SetShapeFn(ScatterUpdateShape) .Doc(R"doc( Adds sparse updates to a variable reference. This operation computes # Scalar indices ref[indices, ...] += updates[...] # Vector indices (for each i) ref[indices[i], ...] += updates[i, ...] # High rank indices (for each i, ..., j) ref[indices[i, ..., j], ...] += updates[i, ..., j, ...] This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value. Duplicate entries are handled correctly: if multiple `indices` reference the same location, their contributions add. Requires `updates.shape = indices.shape + ref.shape[1:]`. <div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;"> <img style="width:100%" src="../../images/ScatterAdd.png" alt> </div> ref: Should be from a `Variable` node. indices: A tensor of indices into the first dimension of `ref`. updates: A tensor of updated values to add to `ref`. output_ref:= Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done. use_locking: If True, the addition will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. )doc"); REGISTER_OP("ScatterSub") .Input("ref: Ref(T)") .Input("indices: Tindices") .Input("updates: T") .Output("output_ref: Ref(T)") .Attr("T: numbertype") .Attr("Tindices: {int32, int64}") .Attr("use_locking: bool = false") .SetShapeFn(ScatterUpdateShape) .Doc(R"doc( Subtracts sparse updates to a variable reference. # Scalar indices ref[indices, ...] -= updates[...] # Vector indices (for each i) ref[indices[i], ...] -= updates[i, ...] # High rank indices (for each i, ..., j) ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...] This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value. Duplicate entries are handled correctly: if multiple `indices` reference the same location, their (negated) contributions add. Requires `updates.shape = indices.shape + ref.shape[1:]`. <div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;"> <img style="width:100%" src="../../images/ScatterSub.png" alt> </div> ref: Should be from a `Variable` node. indices: A tensor of indices into the first dimension of `ref`. updates: A tensor of updated values to subtract from `ref`. output_ref:= Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done. use_locking: If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. )doc"); REGISTER_OP("ScatterMul") .Input("ref: Ref(T)") .Input("indices: Tindices") .Input("updates: T") .Output("output_ref: Ref(T)") .Attr("T: numbertype") .Attr("Tindices: {int32, int64}") .Attr("use_locking: bool = false") .SetShapeFn(ScatterUpdateShape) .Doc(R"doc( Multiplies sparse updates into a variable reference. This operation computes # Scalar indices ref[indices, ...] *= updates[...] # Vector indices (for each i) ref[indices[i], ...] *= updates[i, ...] # High rank indices (for each i, ..., j) ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...] This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value. Duplicate entries are handled correctly: if multiple `indices` reference the same location, their contributions multiply. Requires `updates.shape = indices.shape + ref.shape[1:]`. ref: Should be from a `Variable` node. indices: A tensor of indices into the first dimension of `ref`. updates: A tensor of updated values to multiply to `ref`. output_ref:= Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done. use_locking: If True, the operation will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. )doc"); REGISTER_OP("ScatterDiv") .Input("ref: Ref(T)") .Input("indices: Tindices") .Input("updates: T") .Output("output_ref: Ref(T)") .Attr("T: numbertype") .Attr("Tindices: {int32, int64}") .Attr("use_locking: bool = false") .SetShapeFn(ScatterUpdateShape) .Doc(R"doc( Divides a variable reference by sparse updates. This operation computes # Scalar indices ref[indices, ...] /= updates[...] # Vector indices (for each i) ref[indices[i], ...] /= updates[i, ...] # High rank indices (for each i, ..., j) ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...] This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value. Duplicate entries are handled correctly: if multiple `indices` reference the same location, their contributions divide. Requires `updates.shape = indices.shape + ref.shape[1:]`. ref: Should be from a `Variable` node. indices: A tensor of indices into the first dimension of `ref`. updates: A tensor of values that `ref` is divided by. output_ref:= Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done. use_locking: If True, the operation will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. )doc"); REGISTER_OP("CountUpTo") .Input("ref: Ref(T)") .Output("output: T") .Attr("limit: int") .Attr("T: {int32, int64}") .SetShapeFn([](InferenceContext* c) { ShapeHandle output; TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 0, &output)); c->set_output(0, output); return Status::OK(); }) .Doc(R"doc( Increments 'ref' until it reaches 'limit'. ref: Should be from a scalar `Variable` node. limit: If incrementing ref would bring it above limit, instead generates an 'OutOfRange' error. output: A copy of the input before increment. If nothing else modifies the input, the values produced will all be distinct. )doc"); } // namespace tensorflow
{ "pile_set_name": "Github" }
// // Expression.swift // ExpressionEngine // // Created by Laszlo Korte on 07.08.15. // Copyright © 2015 Laszlo Korte. All rights reserved. // public enum EvaluationError : Error { case unresolvedReference(message: String) case arithmeticError(message: String) case typeMismatch(message: String) case parameterCountMismatch(message: String) case duplicateDefinition(referenceId: ReferenceId) } public protocol UnaryOperator { init() func apply(_ value: Value) -> Result<Value, EvaluationError> } public protocol BinaryOperator { init() func apply(_ lhs: Value, rhs: Value) -> Result<Value, EvaluationError> } public enum FunctionArity { case fix(Int) case variadic func accept(_ count: Int) -> Bool { switch self { case .fix(count): return true case .variadic: return true default: return false } } } public protocol Function { static var arity : FunctionArity { get } init() func apply(_ params: [Value]) -> Result<Value, EvaluationError> } public func ==(left: ReferenceId, right: ReferenceId) -> Bool { return left.value == right.value } public enum Expression : Equatable { case constant(Value) case namedConstant(String, Value) case reference(id: ReferenceId) indirect case unary(UnaryOperator, Expression) indirect case binary(BinaryOperator, Expression, Expression) indirect case call(Function, [Expression]) } public func ==(lhs: Expression, rhs: Expression) -> Bool { switch (lhs, rhs) { case (.constant(let l), .constant(let r)): return l == r case (.namedConstant(let l), .namedConstant(let r)): return l.0 == r.0 && l.1 == r.1 case (.reference(let l), .reference(let r)): return l == r case (.unary(let opl,let l), .unary(let opr, let r)): return type(of: opl) == type(of: opr) && l == r case (.binary(let opl,let l1, let l2), .binary(let opr, let r1, let r2)): return type(of: opl) == type(of: opr) && l1 == r1 && l2 == r2 case (.call(let fl, let argl), .call(let fr, let argr)): return type(of: fl) == type(of: fr) && argl == argr default: return false } } extension Expression { public func eval(_ dataSet: DataSet) -> Result<Value, EvaluationError> { switch(self) { case .constant(let value): return .success(value) case .namedConstant(_, let value): return .success(value) case .reference(let id): if let value = dataSet.lookUp(id) { return .success(value) } else { return .fail(.unresolvedReference(message: "[?\(id.value)]")) } case .unary(let op, let expr): switch expr.eval(dataSet) { case .success(let val): return op.apply(val) case .fail(let error): return .fail(error) } case .binary(let op, let lhs, let rhs): switch lhs.eval(dataSet) { case .success(let leftValue): switch rhs.eval(dataSet) { case .success(let rightValue): return op.apply(leftValue, rhs: rightValue) case .fail(let rightError): return .fail(rightError) } case .fail(let leftError): return .fail(leftError) } case .call(let function, let params): guard type(of: function).arity.accept(params.count) else { return .fail(.parameterCountMismatch(message: "Amount of parameters does not match")) } var paramValues = [Value]() for p in params { switch p.eval(dataSet) { case .success(let value): paramValues.append(value) case .fail(let error): return .fail(error) } } return function.apply(paramValues) } } }
{ "pile_set_name": "Github" }
# Defaults for rtmpd initscript # sourced by /etc/init.d/rtmpd # Additional options that are passed to the Daemon. ENABLED=yes DAEMON_CONF=" /etc/crtmpserver/crtmpserver.lua " DAEMON_OPTS=" --daemon " DAEMON_USER=crtmpserver
{ "pile_set_name": "Github" }
import Foundation import Combine import Harvest import Quick import Nimble import Thresher /// Tests for `World` injection. class WorldSpec: QuickSpec { override func spec() { typealias Harvester = Harvest.Harvester<Input, State> typealias EffectMapping = Harvester.EffectMapping<World, BasicEffectQueue, EffectID> typealias EffectID = Never var inputs: PassthroughSubject<Input, Never>! var harvester: Harvester! var lastReply: Reply<Input, State>? var cancellables: Set<AnyCancellable>! var testScheduler: TestScheduler! beforeEach { inputs = PassthroughSubject() lastReply = nil cancellables = [] testScheduler = TestScheduler() } describe("World") { let mockedDate = Date(timeIntervalSince1970: 2019) beforeEach { let world = World(date: { mockedDate }) let mapping: EffectMapping = .makeInout { input, state in switch input { case .getDate: return Effect { world in Deferred { Just(world.date()) } .map(Input._didGetDate) .eraseToAnyPublisher() } case let ._didGetDate(date): state = date.timeIntervalSince1970 return .empty } } harvester = Harvester( state: .init(), inputs: inputs, mapping: mapping, world: world, scheduler: testScheduler ) harvester.replies .sink { reply in lastReply = reply } .store(in: &cancellables) } it("gets mocked date") { expect(harvester.state) == 0 expect(lastReply).to(beNil()) inputs.send(.getDate) testScheduler.advance() expect(harvester.state) == mockedDate.timeIntervalSince1970 expect(lastReply?.fromState) == 0 expect(lastReply?.toState) == mockedDate.timeIntervalSince1970 } } } } private struct World { let date: () -> Date } private enum Input { case getDate case _didGetDate(Date) } private typealias State = TimeInterval
{ "pile_set_name": "Github" }
cdist-type__cron(7) =================== NAME ---- cdist-type__cron - Installs and manages cron jobs DESCRIPTION ----------- This cdist type allows you to manage entries in a users crontab. REQUIRED PARAMETERS ------------------- user The user who's crontab is edited command The command to run. OPTIONAL PARAMETERS ------------------- **NOTE**: All time-related parameters (``--minute``, ``--hour``, ``--day_of_month`` ``--month`` and ``--day_of_week``) defaults to ``*``, which means to execute it **always**. If you set ``--hour 0`` to execute the cronjob only at midnight, it will execute **every** minute in the first hour of the morning all days. state Either present or absent. Defaults to present. minute See crontab(5). Defaults to * hour See crontab(5). Defaults to * day_of_month See crontab(5). Defaults to * month See crontab(5). Defaults to * day_of_week See crontab(5). Defaults to * raw Take whatever the user has given instead of time and date fields. If given, all other time and date fields are ignored. Can for example be used to specify cron EXTENSIONS like reboot, yearly etc. See crontab(5) for the extensions if any that your cron implementation implements. raw_command Take whatever the user has given in the command and ignore everything else. If given, the command will be added to crontab. Can for example be used to define variables like SHELL or MAILTO. EXAMPLES -------- .. code-block:: sh # run Monday to Saturday at 23:15 __cron some-id --user root --command "/path/to/script" \ --hour 23 --minute 15 --day_of_week 1-6 # run on reboot __cron some-id --user root --command "/path/to/script" \ --raw @reboot # remove cronjob __cron some-id --user root --command "/path/to/script" --state absent # define default shell __cron some-id --user root --raw_command --command "SHELL=/bin/bash" \ --state present SEE ALSO -------- :strong:`crontab`\ (5) AUTHORS ------- Steven Armstrong <steven-cdist--@--armstrong.cc> COPYING ------- Copyright \(C) 2011-2013 Steven Armstrong. 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.
{ "pile_set_name": "Github" }
<template> <div class="mint-spinner-double-bounce" :style="{ width: spinnerSize, height: spinnerSize }"> <div class="mint-spinner-double-bounce-bounce1" :style="{ backgroundColor: spinnerColor }"></div> <div class="mint-spinner-double-bounce-bounce2" :style="{ backgroundColor: spinnerColor }"></div> </div> </template> <script> import common from './common.vue'; export default { name: 'double-bounce', mixins: [common] }; </script> <style lang="css"> @component-namespace mint-spinner { @component double-bounce { position: relative; @descendent bounce1, bounce2 { width: 100%; height: 100%; border-radius: 50%; opacity: 0.6; position: absolute; top: 0; left: 0; animation: mint-spinner-double-bounce 2.0s infinite ease-in-out; } @descendent bounce2 { animation-delay: -1.0s; } } } @keyframes mint-spinner-double-bounce { 0%, 100% { transform: scale(0.0); } 50% { transform: scale(1.0); } } </style>
{ "pile_set_name": "Github" }
var Rar = (function (exports) { 'use strict'; function __awaiter(thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments)).next()); }); } class Reader { constructor() { this.size = 0; } readBlob(length, position, blobType) { return __awaiter(this, void 0, void 0, function* () { if (!blobType) { blobType = 'application/octet-stream'; } const data = this.read(length, position); return new Blob([data], { type: blobType }); }); } } class UriReader extends Reader { constructor(uri) { super(); this.uri = uri; } open() { return __awaiter(this, void 0, void 0, function* () { return fetch(this.uri, { method: 'HEAD' }).then((response) => { if (!response.ok) { throw new Error('Could not open URI'); } const length = response.headers.get('Content-Length'); if (length !== null) { this.size = parseInt(length, 10); } }); }); } close() { return Promise.resolve(); } reset() { return; } read(length, position) { return __awaiter(this, void 0, void 0, function* () { return fetch(this.uri, { method: 'GET', headers: { Range: `bytes=${position}-${position + length - 1}` } }).then((response) => { if (!response.ok) { throw new Error('Could not fetch URI'); } return response.arrayBuffer(); }); }); } } let fsImport; if (typeof require === 'function') { fsImport = require('fs'); } class LocalReader extends Reader { constructor(path) { super(); this.path = path; } open() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { fsImport.stat(this.path, (err, stat) => { if (err) { reject(new Error('Could not read file')); return; } this.size = stat.size; resolve(); }); }); }); } close() { return Promise.resolve(); } reset() { return; } read(length, position) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { fsImport.open(this.path, 'r', (err, fd) => { if (err) { reject(new Error('Could not open file')); return; } fsImport.read(fd, new Buffer(length), 0, length, position, (readErr, _bytesRead, buffer) => { if (readErr) { reject(new Error('Could not read file')); return; } const ab = new ArrayBuffer(buffer.length); const view = new Uint8Array(ab); for (let i = 0; i < buffer.length; i++) { view[i] = buffer[i]; } fsImport.close(fd, (closeErr) => { if (closeErr) { reject(new Error('Could not close file')); return; } resolve(ab); }); }); }); }); }); } } class NativeFileReader extends Reader { constructor(file) { super(); this.file = file; this.size = file.size; } open() { return Promise.resolve(); } close() { return Promise.resolve(); } reset() { return; } read(length, position) { const slice = this.file.slice(position, position + length); const fr = new FileReader(); return new Promise((resolve, reject) => { fr.addEventListener('load', () => { resolve(fr.result); }); fr.addEventListener('error', () => { reject(new Error('File read failed')); }); fr.readAsArrayBuffer(slice); }); } } class RarEntry { constructor() { this.name = null; this.path = null; this.size = 0; this.sizePacked = 0; this.crc = null; this.offset = 0; this.blockSize = 0; this.headerSize = 0; this.encrypted = false; this.version = null; this.time = null; this.method = null; this.os = null; this.partial = false; this.continuesFrom = false; this.continues = false; } } (function (RarMethod) { RarMethod[RarMethod["STORE"] = 48] = "STORE"; RarMethod[RarMethod["FASTEST"] = 49] = "FASTEST"; RarMethod[RarMethod["FAST"] = 50] = "FAST"; RarMethod[RarMethod["NORMAL"] = 51] = "NORMAL"; RarMethod[RarMethod["GOOD"] = 52] = "GOOD"; RarMethod[RarMethod["BEST"] = 53] = "BEST"; })(exports.RarMethod || (exports.RarMethod = {})); function getString(view, length, offset, raw) { offset = offset || 0; length = length || (view.byteLength - offset); if (length < 0) { length += view.byteLength; } let str = ''; if (typeof Buffer !== 'undefined') { const data = []; for (let i = offset; i < (offset + length); i++) { data.push(view.getUint8(i)); } return (new Buffer(data)).toString(); } else { for (let i = offset; i < (offset + length); i++) { str += String.fromCharCode(view.getUint8(i)); } if (raw) { return str; } // TODO: why does this work? return decodeURIComponent(window.escape(str)); } } /* * rar.js * Pure JavaScript implementation of the RAR format * 43081j * License: MIT, see LICENSE */ function fromFile(file) { return __awaiter(this, void 0, void 0, function* () { return fromReader(new NativeFileReader(file)); }); } function fromUri(uri) { return __awaiter(this, void 0, void 0, function* () { return fromReader(new UriReader(uri)); }); } function fromLocal(path) { return __awaiter(this, void 0, void 0, function* () { return fromReader(new LocalReader(path)); }); } function fromReader(reader) { return __awaiter(this, void 0, void 0, function* () { const result = new RarArchive(reader); yield result.load(); return result; }); } class RarArchive { constructor(reader) { this.entries = []; this._loaded = false; this._reader = reader; } get loaded() { return this._loaded; } load() { return __awaiter(this, void 0, void 0, function* () { if (this.loaded) { return; } yield this._reader.open(); const header = yield this._reader.read(14, 0); const headerView = new DataView(header); if (getString(headerView, 7, 0, true) !== '\x52\x61\x72\x21\x1a\x07\x00') { throw new Error('Invalid RAR archive'); } const headerType = headerView.getUint8(9); const headerFlags = headerView.getUint16(10, true); const headerSize = headerView.getUint16(12, true); if (headerType !== 0x73) { throw new Error('Invalid RAR archive'); } if ((headerFlags & 0x80) !== 0) { throw new Error('Encrypted archives are not yet supported'); } if (this._reader.size <= 14) { return; } const maxSize = this._reader.size; let offset = headerSize + 7; while (offset < maxSize) { const piece = yield this._reader.read(11, offset); const view = new DataView(piece); const type = view.getUint8(2); const flags = view.getUint16(3, true); let size = view.getUint16(5, true); if ((flags & 0x8000) !== 0) { size += view.getUint32(7, true); } switch (type) { case 0x74: const entry = yield this.parseEntry(size, offset); this.entries.push(entry); offset += entry.blockSize; break; default: offset += size; } } }); } get(entry) { return __awaiter(this, void 0, void 0, function* () { if (entry.method !== exports.RarMethod.STORE) { throw new Error('Compression is not yet supported'); } const blob = yield this._reader.readBlob(entry.blockSize - 1, entry.offset + entry.headerSize); return blob; }); } parseEntryTime(time) { if (time.length < 32) { time = (new Array(32 - time.length + 1)).join('0') + time; } const matches = time.match(/(\d{7})(\d{4})(\d{5})(\d{5})(\d{6})(\d{5})/); if (!matches) { return new Date(); } const vals = matches.slice(1).map((val) => { return parseInt(val, 2); }); return new Date(1980 + vals[0], vals[1] - 1, vals[2], vals[3], vals[4], vals[5]); } parseEntryOS(value) { if (value < 0 || value > 5) { return 'Unknown'; } return ['MS-DOS', 'OS/2', 'Windows', 'Unix', 'Mac', 'BeOS'][value]; } parseEntry(size, offset) { return __awaiter(this, void 0, void 0, function* () { const data = yield this._reader.read(size, offset); const view = new DataView(data); const flags = view.getUint16(3, true); const entry = new RarEntry(); entry.partial = ((flags & 0x01) !== 0 || (flags & 0x02) !== 0); entry.continuesFrom = ((flags & 0x01) !== 0); entry.continues = ((flags & 0x02) !== 0); entry.offset = offset; entry.sizePacked = view.getUint32(7, true); entry.size = view.getUint32(11, true); entry.crc = view.getUint32(16, true); entry.time = this.parseEntryTime(view.getUint32(20, true).toString(2)); entry.os = this.parseEntryOS(view.getUint8(15)); entry.version = view.getUint8(24); entry.method = view.getUint8(25); entry.encrypted = ((flags & 0x04) !== 0); const nameSize = view.getUint16(26, true); if ((flags & 0x100) !== 0) { entry.sizePacked += view.getUint32(32, true) * 0x100000000; entry.size += view.getUint32(36, true) * 0x100000000; entry.path = getString(view, nameSize, 40); } else { entry.path = getString(view, nameSize, 32); } if ((flags & 0x200) !== 0 && entry.path.indexOf('\x00') !== -1) { entry.path = entry.path.split('\x00')[1]; } entry.name = entry.path; if (entry.name.indexOf('\\') !== -1) { entry.name = entry.name.substr(entry.name.lastIndexOf('\\') + 1); } else { entry.name = entry.name.substr(entry.name.lastIndexOf('/') + 1); } entry.headerSize = size; entry.blockSize = entry.headerSize + entry.sizePacked; return entry; }); } } exports.Reader = Reader; exports.UriReader = UriReader; exports.LocalReader = LocalReader; exports.NativeFileReader = NativeFileReader; exports.fromFile = fromFile; exports.fromUri = fromUri; exports.fromLocal = fromLocal; exports.fromReader = fromReader; exports.RarArchive = RarArchive; return exports; }({}));
{ "pile_set_name": "Github" }
// Copyright (c) 2003,2004 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // 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. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0+ // // // Author(s) : Menelaos Karavelas <mkaravel@iacm.forth.gr> #ifndef CGAL_APOLLONIUS_GRAPH_2_PREDICATES_C2_H #define CGAL_APOLLONIUS_GRAPH_2_PREDICATES_C2_H #include <CGAL/license/Apollonius_graph_2.h> #include <CGAL/Apollonius_graph_2/Compare_x_2.h> #include <CGAL/Apollonius_graph_2/Compare_y_2.h> #include <CGAL/Apollonius_graph_2/Compare_weight_2.h> #include <CGAL/Apollonius_graph_2/Orientation_2.h> #include <CGAL/Apollonius_graph_2/Is_hidden_C2.h> #include <CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h> #include <CGAL/Apollonius_graph_2/Incircle_C2.h> #include <CGAL/Apollonius_graph_2/Finite_edge_test_C2.h> #include <CGAL/Apollonius_graph_2/Infinite_edge_test_C2.h> #include <CGAL/Apollonius_graph_2/Is_degenerate_edge_C2.h> #endif // CGAL_APOLLONIUS_GRAPH_2_PREDICATES_C2_H
{ "pile_set_name": "Github" }
import * as React from 'react'; import BoxNotes16 from './BoxNotes16'; export const boxNotes16 = () => <BoxNotes16 />; export default { title: 'Icon|Fill|BoxNotes16', component: BoxNotes16, parameters: { notes: "`import BoxNotes16 from 'box-ui-elements/es/icon/fill/BoxNotes16';`", }, };
{ "pile_set_name": "Github" }
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("ruby", function(config) { function wordObj(words) { var o = {}; for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; return o; } var keywords = wordObj([ "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc", "caller", "lambda", "proc", "public", "protected", "private", "require", "load", "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__" ]); var indentWords = wordObj(["def", "class", "case", "for", "while", "until", "module", "then", "catch", "loop", "proc", "begin"]); var dedentWords = wordObj(["end", "until"]); var opening = {"[": "]", "{": "}", "(": ")"}; var closing = {"]": "[", "}": "{", ")": "("}; var curPunc; function chain(newtok, stream, state) { state.tokenize.push(newtok); return newtok(stream, state); } function tokenBase(stream, state) { if (stream.sol() && stream.match("=begin") && stream.eol()) { state.tokenize.push(readBlockComment); return "comment"; } if (stream.eatSpace()) return null; var ch = stream.next(), m; if (ch == "`" || ch == "'" || ch == '"') { return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state); } else if (ch == "/") { if (regexpAhead(stream)) return chain(readQuoted(ch, "string-2", true), stream, state); else return "operator"; } else if (ch == "%") { var style = "string", embed = true; if (stream.eat("s")) style = "atom"; else if (stream.eat(/[WQ]/)) style = "string"; else if (stream.eat(/[r]/)) style = "string-2"; else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; } var delim = stream.eat(/[^\w\s=]/); if (!delim) return "operator"; if (opening.propertyIsEnumerable(delim)) delim = opening[delim]; return chain(readQuoted(delim, style, embed, true), stream, state); } else if (ch == "#") { stream.skipToEnd(); return "comment"; } else if (ch == "<" && (m = stream.match(/^<([-~])[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) { return chain(readHereDoc(m[2], m[1]), stream, state); } else if (ch == "0") { if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); else if (stream.eat("b")) stream.eatWhile(/[01]/); else stream.eatWhile(/[0-7]/); return "number"; } else if (/\d/.test(ch)) { stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/); return "number"; } else if (ch == "?") { while (stream.match(/^\\[CM]-/)) {} if (stream.eat("\\")) stream.eatWhile(/\w/); else stream.next(); return "string"; } else if (ch == ":") { if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state); if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state); // :> :>> :< :<< are valid symbols if (stream.eat(/[\<\>]/)) { stream.eat(/[\<\>]/); return "atom"; } // :+ :- :/ :* :| :& :! are valid symbols if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) { return "atom"; } // Symbols can't start by a digit if (stream.eat(/[a-zA-Z$@_\xa1-\uffff]/)) { stream.eatWhile(/[\w$\xa1-\uffff]/); // Only one ? ! = is allowed and only as the last character stream.eat(/[\?\!\=]/); return "atom"; } return "operator"; } else if (ch == "@" && stream.match(/^@?[a-zA-Z_\xa1-\uffff]/)) { stream.eat("@"); stream.eatWhile(/[\w\xa1-\uffff]/); return "variable-2"; } else if (ch == "$") { if (stream.eat(/[a-zA-Z_]/)) { stream.eatWhile(/[\w]/); } else if (stream.eat(/\d/)) { stream.eat(/\d/); } else { stream.next(); // Must be a special global like $: or $! } return "variable-3"; } else if (/[a-zA-Z_\xa1-\uffff]/.test(ch)) { stream.eatWhile(/[\w\xa1-\uffff]/); stream.eat(/[\?\!]/); if (stream.eat(":")) return "atom"; return "ident"; } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) { curPunc = "|"; return null; } else if (/[\(\)\[\]{}\\;]/.test(ch)) { curPunc = ch; return null; } else if (ch == "-" && stream.eat(">")) { return "arrow"; } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { var more = stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); if (ch == "." && !more) curPunc = "."; return "operator"; } else { return null; } } function regexpAhead(stream) { var start = stream.pos, depth = 0, next, found = false, escaped = false while ((next = stream.next()) != null) { if (!escaped) { if ("[{(".indexOf(next) > -1) { depth++ } else if ("]})".indexOf(next) > -1) { depth-- if (depth < 0) break } else if (next == "/" && depth == 0) { found = true break } escaped = next == "\\" } else { escaped = false } } stream.backUp(stream.pos - start) return found } function tokenBaseUntilBrace(depth) { if (!depth) depth = 1; return function(stream, state) { if (stream.peek() == "}") { if (depth == 1) { state.tokenize.pop(); return state.tokenize[state.tokenize.length-1](stream, state); } else { state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1); } } else if (stream.peek() == "{") { state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1); } return tokenBase(stream, state); }; } function tokenBaseOnce() { var alreadyCalled = false; return function(stream, state) { if (alreadyCalled) { state.tokenize.pop(); return state.tokenize[state.tokenize.length-1](stream, state); } alreadyCalled = true; return tokenBase(stream, state); }; } function readQuoted(quote, style, embed, unescaped) { return function(stream, state) { var escaped = false, ch; if (state.context.type === 'read-quoted-paused') { state.context = state.context.prev; stream.eat("}"); } while ((ch = stream.next()) != null) { if (ch == quote && (unescaped || !escaped)) { state.tokenize.pop(); break; } if (embed && ch == "#" && !escaped) { if (stream.eat("{")) { if (quote == "}") { state.context = {prev: state.context, type: 'read-quoted-paused'}; } state.tokenize.push(tokenBaseUntilBrace()); break; } else if (/[@\$]/.test(stream.peek())) { state.tokenize.push(tokenBaseOnce()); break; } } escaped = !escaped && ch == "\\"; } return style; }; } function readHereDoc(phrase, mayIndent) { return function(stream, state) { if (mayIndent) stream.eatSpace() if (stream.match(phrase)) state.tokenize.pop(); else stream.skipToEnd(); return "string"; }; } function readBlockComment(stream, state) { if (stream.sol() && stream.match("=end") && stream.eol()) state.tokenize.pop(); stream.skipToEnd(); return "comment"; } return { startState: function() { return {tokenize: [tokenBase], indented: 0, context: {type: "top", indented: -config.indentUnit}, continuedLine: false, lastTok: null, varList: false}; }, token: function(stream, state) { curPunc = null; if (stream.sol()) state.indented = stream.indentation(); var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; var thisTok = curPunc; if (style == "ident") { var word = stream.current(); style = state.lastTok == "." ? "property" : keywords.propertyIsEnumerable(stream.current()) ? "keyword" : /^[A-Z]/.test(word) ? "tag" : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" : "variable"; if (style == "keyword") { thisTok = word; if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) kwtype = "indent"; else if (word == "do" && state.context.indented < state.indented) kwtype = "indent"; } } if (curPunc || (style && style != "comment")) state.lastTok = thisTok; if (curPunc == "|") state.varList = !state.varList; if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) state.context = {prev: state.context, type: curPunc || style, indented: state.indented}; else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev) state.context = state.context.prev; if (stream.eol()) state.continuedLine = (curPunc == "\\" || style == "operator"); return style; }, indent: function(state, textAfter) { if (state.tokenize[state.tokenize.length-1] != tokenBase) return CodeMirror.Pass; var firstChar = textAfter && textAfter.charAt(0); var ct = state.context; var closed = ct.type == closing[firstChar] || ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter); return ct.indented + (closed ? 0 : config.indentUnit) + (state.continuedLine ? config.indentUnit : 0); }, electricInput: /^\s*(?:end|rescue|elsif|else|\})$/, lineComment: "#", fold: "indent" }; }); CodeMirror.defineMIME("text/x-ruby", "ruby"); });
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // @class NSData, NSError, NSURLResponse, WAKView; @protocol WebPluginManualLoader - (void)pluginViewFinishedLoading:(WAKView *)arg1; - (void)pluginView:(WAKView *)arg1 receivedError:(NSError *)arg2; - (void)pluginView:(WAKView *)arg1 receivedData:(NSData *)arg2; - (void)pluginView:(WAKView *)arg1 receivedResponse:(NSURLResponse *)arg2; @end
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:343528382fd120f42c3274e95963659198f37650aac4324bc3d311348ad6615b size 2712
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- """ requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import copy import time import calendar import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes: this fixes "redefinition of unused 'threading'" threading except ImportError: import dummy_threading as threading class MockRequest(object): """Wraps a `requests.Request` to mimic a `urllib2.Request`. The code in `cookielib.CookieJar` expects this interface in order to correctly manage cookie policies, i.e., determine whether a cookie can be set, given the domains of the request and the cookie. The original request object is read-only. The client is responsible for collecting the new headers via `get_new_headers()` and interpreting them appropriately. You probably want `get_cookie_header`, defined below. """ def __init__(self, request): self._r = request self._new_headers = {} self.type = urlparse(self._r.url).scheme def get_type(self): return self.type def get_host(self): return urlparse(self._r.url).netloc def get_origin_req_host(self): return self.get_host() def get_full_url(self): # Only return the response's URL if the user hadn't set the Host # header if not self._r.headers.get('Host'): return self._r.url # If they did set it, retrieve it and reconstruct the expected domain host = self._r.headers['Host'] parsed = urlparse(self._r.url) # Reconstruct the URL as we expect it return urlunparse([ parsed.scheme, host, parsed.path, parsed.params, parsed.query, parsed.fragment ]) def is_unverifiable(self): return True def has_header(self, name): return name in self._r.headers or name in self._new_headers def get_header(self, name, default=None): return self._r.headers.get(name, self._new_headers.get(name, default)) def add_header(self, key, val): """cookielib has no legitimate use for this method; add it back if you find one.""" raise NotImplementedError("Cookie headers should be added with add_unredirected_header()") def add_unredirected_header(self, name, value): self._new_headers[name] = value def get_new_headers(self): return self._new_headers @property def unverifiable(self): return self.is_unverifiable() @property def origin_req_host(self): return self.get_origin_req_host() @property def host(self): return self.get_host() class MockResponse(object): """Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`. ...what? Basically, expose the parsed HTTP headers from the server response the way `cookielib` expects to see them. """ def __init__(self, headers): """Make a MockResponse for `cookielib` to read. :param headers: a httplib.HTTPMessage or analogous carrying the headers """ self._headers = headers def info(self): return self._headers def getheaders(self, name): self._headers.getheaders(name) def extract_cookies_to_jar(jar, request, response): """Extract the cookies from the response into a CookieJar. :param jar: cookielib.CookieJar (not necessarily a RequestsCookieJar) :param request: our own requests.Request object :param response: urllib3.HTTPResponse object """ if not (hasattr(response, '_original_response') and response._original_response): return # the _original_response field is the wrapped httplib.HTTPResponse object, req = MockRequest(request) # pull out the HTTPMessage with the headers and put it in the mock: res = MockResponse(response._original_response.msg) jar.extract_cookies(res, req) def get_cookie_header(jar, request): """ Produce an appropriate Cookie header string to be sent with `request`, or None. :rtype: str """ r = MockRequest(request) jar.add_cookie_header(r) return r.get_new_headers().get('Cookie') def remove_cookie_by_name(cookiejar, name, domain=None, path=None): """Unsets a cookie by name, by default over all domains and paths. Wraps CookieJar.clear(), is O(n). """ clearables = [] for cookie in cookiejar: if cookie.name != name: continue if domain is not None and domain != cookie.domain: continue if path is not None and path != cookie.path: continue clearables.append((cookie.domain, cookie.path, cookie.name)) for domain, path, name in clearables: cookiejar.clear(domain, path, name) class CookieConflictError(RuntimeError): """There are two cookies that meet the criteria specified in the cookie jar. Use .get and .set and include domain and path args in order to be more specific. """ class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping): """Compatibility class; is a cookielib.CookieJar, but exposes a dict interface. This is the CookieJar we create by default for requests and sessions that don't specify one, since some clients may expect response.cookies and session.cookies to support dict operations. Requests does not use the dict interface internally; it's just for compatibility with external client code. All requests code should work out of the box with externally provided instances of ``CookieJar``, e.g. ``LWPCookieJar`` and ``FileCookieJar``. Unlike a regular CookieJar, this class is pickleable. .. warning:: dictionary operations that are normally O(1) may be O(n). """ def get(self, name, default=None, domain=None, path=None): """Dict-like get() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. .. warning:: operation is O(n), not O(1). """ try: return self._find_no_duplicates(name, domain, path) except KeyError: return default def set(self, name, value, **kwargs): """Dict-like set() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. """ # support client code that unsets cookies by assignment of a None value: if value is None: remove_cookie_by_name(self, name, domain=kwargs.get('domain'), path=kwargs.get('path')) return if isinstance(value, Morsel): c = morsel_to_cookie(value) else: c = create_cookie(name, value, **kwargs) self.set_cookie(c) return c def iterkeys(self): """Dict-like iterkeys() that returns an iterator of names of cookies from the jar. .. seealso:: itervalues() and iteritems(). """ for cookie in iter(self): yield cookie.name def keys(self): """Dict-like keys() that returns a list of names of cookies from the jar. .. seealso:: values() and items(). """ return list(self.iterkeys()) def itervalues(self): """Dict-like itervalues() that returns an iterator of values of cookies from the jar. .. seealso:: iterkeys() and iteritems(). """ for cookie in iter(self): yield cookie.value def values(self): """Dict-like values() that returns a list of values of cookies from the jar. .. seealso:: keys() and items(). """ return list(self.itervalues()) def iteritems(self): """Dict-like iteritems() that returns an iterator of name-value tuples from the jar. .. seealso:: iterkeys() and itervalues(). """ for cookie in iter(self): yield cookie.name, cookie.value def items(self): """Dict-like items() that returns a list of name-value tuples from the jar. Allows client-code to call ``dict(RequestsCookieJar)`` and get a vanilla python dict of key value pairs. .. seealso:: keys() and values(). """ return list(self.iteritems()) def list_domains(self): """Utility method to list all the domains in the jar.""" domains = [] for cookie in iter(self): if cookie.domain not in domains: domains.append(cookie.domain) return domains def list_paths(self): """Utility method to list all the paths in the jar.""" paths = [] for cookie in iter(self): if cookie.path not in paths: paths.append(cookie.path) return paths def multiple_domains(self): """Returns True if there are multiple domains in the jar. Returns False otherwise. :rtype: bool """ domains = [] for cookie in iter(self): if cookie.domain is not None and cookie.domain in domains: return True domains.append(cookie.domain) return False # there is only one domain in jar def get_dict(self, domain=None, path=None): """Takes as an argument an optional domain and path and returns a plain old Python dict of name-value pairs of cookies that meet the requirements. :rtype: dict """ dictionary = {} for cookie in iter(self): if (domain is None or cookie.domain == domain) and (path is None or cookie.path == path): dictionary[cookie.name] = cookie.value return dictionary def __contains__(self, name): try: return super(RequestsCookieJar, self).__contains__(name) except CookieConflictError: return True def __getitem__(self, name): """Dict-like __getitem__() for compatibility with client code. Throws exception if there are more than one cookie with name. In that case, use the more explicit get() method instead. .. warning:: operation is O(n), not O(1). """ return self._find_no_duplicates(name) def __setitem__(self, name, value): """Dict-like __setitem__ for compatibility with client code. Throws exception if there is already a cookie of that name in the jar. In that case, use the more explicit set() method instead. """ self.set(name, value) def __delitem__(self, name): """Deletes a cookie given a name. Wraps ``cookielib.CookieJar``'s ``remove_cookie_by_name()``. """ remove_cookie_by_name(self, name) def set_cookie(self, cookie, *args, **kwargs): if hasattr(cookie.value, 'startswith') and cookie.value.startswith('"') and cookie.value.endswith('"'): cookie.value = cookie.value.replace('\\"', '') return super(RequestsCookieJar, self).set_cookie(cookie, *args, **kwargs) def update(self, other): """Updates this jar with cookies from another CookieJar or dict-like""" if isinstance(other, cookielib.CookieJar): for cookie in other: self.set_cookie(copy.copy(cookie)) else: super(RequestsCookieJar, self).update(other) def _find(self, name, domain=None, path=None): """Requests uses this method internally to get cookie values. If there are conflicting cookies, _find arbitrarily chooses one. See _find_no_duplicates if you want an exception thrown if there are conflicting cookies. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :return: cookie.value """ for cookie in iter(self): if cookie.name == name: if domain is None or cookie.domain == domain: if path is None or cookie.path == path: return cookie.value raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path)) def _find_no_duplicates(self, name, domain=None, path=None): """Both ``__get_item__`` and ``get`` call this function: it's never used elsewhere in Requests. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :raises KeyError: if cookie is not found :raises CookieConflictError: if there are multiple cookies that match name and optionally domain and path :return: cookie.value """ toReturn = None for cookie in iter(self): if cookie.name == name: if domain is None or cookie.domain == domain: if path is None or cookie.path == path: if toReturn is not None: # if there are multiple cookies that meet passed in criteria raise CookieConflictError('There are multiple cookies with name, %r' % (name)) toReturn = cookie.value # we will eventually return this as long as no cookie conflict if toReturn: return toReturn raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path)) def __getstate__(self): """Unlike a normal CookieJar, this class is pickleable.""" state = self.__dict__.copy() # remove the unpickleable RLock object state.pop('_cookies_lock') return state def __setstate__(self, state): """Unlike a normal CookieJar, this class is pickleable.""" self.__dict__.update(state) if '_cookies_lock' not in self.__dict__: self._cookies_lock = threading.RLock() def copy(self): """Return a copy of this RequestsCookieJar.""" new_cj = RequestsCookieJar() new_cj.update(self) return new_cj def _copy_cookie_jar(jar): if jar is None: return None if hasattr(jar, 'copy'): # We're dealing with an instance of RequestsCookieJar return jar.copy() # We're dealing with a generic CookieJar instance new_jar = copy.copy(jar) new_jar.clear() for cookie in jar: new_jar.set_cookie(copy.copy(cookie)) return new_jar def create_cookie(name, value, **kwargs): """Make a cookie from underspecified parameters. By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie"). """ result = dict( version=0, name=name, value=value, port=None, domain='', path='/', secure=False, expires=None, discard=True, comment=None, comment_url=None, rest={'HttpOnly': None}, rfc2109=False,) badargs = set(kwargs) - set(result) if badargs: err = 'create_cookie() got unexpected keyword arguments: %s' raise TypeError(err % list(badargs)) result.update(kwargs) result['port_specified'] = bool(result['port']) result['domain_specified'] = bool(result['domain']) result['domain_initial_dot'] = result['domain'].startswith('.') result['path_specified'] = bool(result['path']) return cookielib.Cookie(**result) def morsel_to_cookie(morsel): """Convert a Morsel object into a Cookie containing the one k/v pair.""" expires = None if morsel['max-age']: try: expires = int(time.time() + int(morsel['max-age'])) except ValueError: raise TypeError('max-age: %s must be integer' % morsel['max-age']) elif morsel['expires']: time_template = '%a, %d-%b-%Y %H:%M:%S GMT' expires = calendar.timegm( time.strptime(morsel['expires'], time_template) ) return create_cookie( comment=morsel['comment'], comment_url=bool(morsel['comment']), discard=False, domain=morsel['domain'], expires=expires, name=morsel.key, path=morsel['path'], port=None, rest={'HttpOnly': morsel['httponly']}, rfc2109=False, secure=bool(morsel['secure']), value=morsel.value, version=morsel['version'] or 0, ) def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True): """Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. """ if cookiejar is None: cookiejar = RequestsCookieJar() if cookie_dict is not None: names_from_jar = [cookie.name for cookie in cookiejar] for name in cookie_dict: if overwrite or (name not in names_from_jar): cookiejar.set_cookie(create_cookie(name, cookie_dict[name])) return cookiejar def merge_cookies(cookiejar, cookies): """Add cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. """ if not isinstance(cookiejar, cookielib.CookieJar): raise ValueError('You can only merge into CookieJar') if isinstance(cookies, dict): cookiejar = cookiejar_from_dict( cookies, cookiejar=cookiejar, overwrite=False) elif isinstance(cookies, cookielib.CookieJar): try: cookiejar.update(cookies) except AttributeError: for cookie_in_jar in cookies: cookiejar.set_cookie(cookie_in_jar) return cookiejar
{ "pile_set_name": "Github" }
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Linq.Expressions; using System.Reflection; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Query.Internal; using Microsoft.EntityFrameworkCore.Query.SqlExpressions; using Microsoft.EntityFrameworkCore.TestUtilities; using Npgsql.EntityFrameworkCore.PostgreSQL.Query.ArrayTests; using Npgsql.EntityFrameworkCore.PostgreSQL.TestUtilities; using Npgsql.EntityFrameworkCore.PostgreSQL.Utilities; using Xunit; using Xunit.Abstractions; namespace Npgsql.EntityFrameworkCore.PostgreSQL.Query { public class ArrayQueryTest : IClassFixture<ArrayQueryTest.ArrayArrayQueryFixture> { ArrayArrayQueryFixture Fixture { get; } public ArrayQueryTest(ArrayArrayQueryFixture fixture, ITestOutputHelper testOutputHelper) { Fixture = fixture; Fixture.TestSqlLoggerFactory.Clear(); //Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper); } #region Roundtrip [Fact] public void Roundtrip() { using var ctx = CreateContext(); var x = ctx.SomeEntities.Single(e => e.Id == 1); Assert.Equal(new[] { 3, 4 }, x.IntArray); Assert.Equal(new List<int> { 3, 4 }, x.IntList); } #endregion #region Indexers [Fact] public void Array_index_with_constant() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => e.IntArray[0] == 3) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""IntArray""[1] = 3 LIMIT 2"); } [Fact] public void List_index_with_constant() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => e.IntList[0] == 3) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""IntList""[1] = 3 LIMIT 2"); } [Fact] public void Index_with_non_constant() { using var ctx = CreateContext(); // ReSharper disable once ConvertToConstant.Local var x = 0; var id = ctx.SomeEntities .Where(e => e.IntArray[x] == 3) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"@__x_0='0' SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""IntArray""[@__x_0 + 1] = 3 LIMIT 2"); } [Fact] public void List_index_with_non_constant() { using var ctx = CreateContext(); // ReSharper disable once ConvertToConstant.Local var x = 0; var id = ctx.SomeEntities .Where(e => e.IntList[x] == 3) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"@__x_0='0' SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""IntList""[@__x_0 + 1] = 3 LIMIT 2"); } #endregion #region SequenceEqual [Theory] [MemberData(nameof(IsListData))] public void SequenceEqual_with_parameter(bool list) { using var ctx = CreateContext(); var arr = new[] { 3, 4 }; var id = ctx.SomeEntities .Where(e => e.IntArray.SequenceEqual(arr)) .Select(e => e.Id) .OverArrayOrList(list) .Single(); Assert.Equal(1, id); AssertSql(list, @"@__arr_0='System.Int32[]' (DbType = Object) SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""IntArray"" = @__arr_0 LIMIT 2"); } [Theory] [MemberData(nameof(IsListData))] public void SequenceEqual_with_array_literal(bool list) { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => e.IntArray.SequenceEqual(new[] { 3, 4 })) .Select(e => e.Id) .OverArrayOrList(list) .Single(); Assert.Equal(1, id); AssertSql(list, @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""IntArray"" = ARRAY[3,4]::integer[] LIMIT 2"); } #endregion #region Containment // See also tests in NorthwindMiscellaneousQueryNpgsqlTest [Theory] [MemberData(nameof(IsListData))] public void Array_column_Contains_literal_item(bool list) { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => e.IntArray.Contains(3)) .Select(e => e.Id) .OverArrayOrList(list) .Single(); Assert.Equal(1, id); AssertSql(list, @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""IntArray"" @> ARRAY[3]::integer[] LIMIT 2"); } [Theory] [MemberData(nameof(IsListData))] public void Array_column_Contains_parameter_item(bool list) { using var ctx = CreateContext(); // ReSharper disable once ConvertToConstant.Local var p = 3; var id = ctx.SomeEntities .Where(e => e.IntArray.Contains(p)) .Select(e => e.Id) .OverArrayOrList(list) .Single(); Assert.Equal(1, id); AssertSql(list, @"@__p_0='3' SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""IntArray"" @> ARRAY[@__p_0]::integer[] LIMIT 2"); } [Theory] [MemberData(nameof(IsListData))] public void Array_column_Contains_column_item(bool list) { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => e.IntArray.Contains(e.Id + 2)) .Select(e => e.Id) .OverArrayOrList(list) .Single(); Assert.Equal(1, id); AssertSql(list, @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""IntArray"" @> ARRAY[s.""Id"" + 2]::integer[] LIMIT 2"); } [Theory] [MemberData(nameof(IsListData))] public void Array_column_Contains_null_constant(bool list) { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => e.StringArray.Contains(null)) .Select(e => e.Id) .OverArrayOrList(list) .Single(); Assert.Equal(2, id); AssertSql(list, @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE (array_position(s.""StringArray"", NULL) IS NOT NULL) LIMIT 2"); } [Theory] [MemberData(nameof(IsListData))] public void Array_column_Contains_null_parameter_does_not_work(bool list) { using var ctx = CreateContext(); string p = null; var results = ctx.SomeEntities .Where(e => e.StringArray.Contains(p)) .Select(e => e.Id) .OverArrayOrList(list) .ToList(); // We incorrectly miss arrays containing non-constant nulls, because detecting those // would prevent index use. Assert.Empty(results); AssertSql(list, @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""StringArray"" @> ARRAY[NULL]::text[]"); } [Fact] public void Array_constant_Contains() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => new[] { "foo", "xxx" }.Contains(e.NullableText)) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""NullableText"" IN ('foo', 'xxx') LIMIT 2"); } [Fact] public void Array_param_Contains_nullable_column() { using var ctx = CreateContext(); var array = new[] { "foo", "xxx" }; var id = ctx.SomeEntities .Where(e => array.Contains(e.NullableText)) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"@__array_0='System.String[]' (DbType = Object) SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""NullableText"" = ANY (@__array_0) OR ((s.""NullableText"" IS NULL) AND (array_position(@__array_0, NULL) IS NOT NULL)) LIMIT 2"); } [Fact] public void Array_param_Contains_non_nullable_column() { using var ctx = CreateContext(); var array = new[] { 1 }; var id = ctx.SomeEntities .Where(e => array.Contains(e.Id)) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"@__array_0='System.Int32[]' (DbType = Object) SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""Id"" = ANY (@__array_0) LIMIT 2"); } [Fact] public void Array_param_with_null_Contains_non_nullable_not_found() { using var ctx = CreateContext(); var array = new[] { "unknown1", "unknown2", null }; var count = ctx.SomeEntities.Count(e => array.Contains(e.NonNullableText)); Assert.Equal(0, count); AssertSql( @"@__array_0='System.String[]' (DbType = Object) SELECT COUNT(*)::INT FROM ""SomeEntities"" AS s WHERE s.""NonNullableText"" = ANY (@__array_0)"); } [Fact] public void Array_param_with_null_Contains_non_nullable_not_found_negated() { using var ctx = CreateContext(); var array = new[] { "unknown1", "unknown2", null }; var count = ctx.SomeEntities.Count(e => !array.Contains(e.NonNullableText)); Assert.Equal(2, count); AssertSql( @"@__array_0='System.String[]' (DbType = Object) SELECT COUNT(*)::INT FROM ""SomeEntities"" AS s WHERE NOT (s.""NonNullableText"" = ANY (@__array_0) AND (s.""NonNullableText"" = ANY (@__array_0) IS NOT NULL))"); } [Fact] public void Array_param_with_null_Contains_nullable_not_found() { using var ctx = CreateContext(); var array = new[] { "unknown1", "unknown2", null }; var count = ctx.SomeEntities.Count(e => array.Contains(e.NullableText)); Assert.Equal(0, count); AssertSql( @"@__array_0='System.String[]' (DbType = Object) SELECT COUNT(*)::INT FROM ""SomeEntities"" AS s WHERE s.""NullableText"" = ANY (@__array_0) OR ((s.""NullableText"" IS NULL) AND (array_position(@__array_0, NULL) IS NOT NULL))"); } [Fact] public void Array_param_with_null_Contains_nullable_not_found_negated() { using var ctx = CreateContext(); var array = new[] { "unknown1", "unknown2", null }; var count = ctx.SomeEntities.Count(e => !array.Contains(e.NullableText)); Assert.Equal(2, count); AssertSql( @"@__array_0='System.String[]' (DbType = Object) SELECT COUNT(*)::INT FROM ""SomeEntities"" AS s WHERE NOT (s.""NullableText"" = ANY (@__array_0) AND (s.""NullableText"" = ANY (@__array_0) IS NOT NULL)) AND ((s.""NullableText"" IS NOT NULL) OR (array_position(@__array_0, NULL) IS NULL))"); } [Fact] public void Byte_array_parameter_contains_column() { using var ctx = CreateContext(); var values = new byte[] { 20 }; var id = ctx.SomeEntities .Where(e => values.Contains(e.Byte)) .Select(e => e.Id) .Single(); Assert.Equal(2, id); // Note: EF Core prints the parameter as a bytea, but it's actually a smallint[] (otherwise ANY would fail) AssertSql( @"@__values_0='0x14' (DbType = Object) SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""Byte"" = ANY (@__values_0) LIMIT 2"); } #endregion #region Length/Count [Fact] public void ArrayLength() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => e.IntArray.Length == 2) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE cardinality(s.""IntArray"") = 2 LIMIT 2"); } [Fact] public void ListCount() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => e.IntList.Count == 2) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE cardinality(s.""IntList"") = 2 LIMIT 2"); } [Fact] public void Array_Length_on_EF_Property() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => EF.Property<int[]>(e, nameof(SomeArrayEntity.IntArray)).Length == 2) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE cardinality(s.""IntArray"") = 2 LIMIT 2"); } [Fact] public void Length_on_literal_not_translated() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => new[] { 1, 2 }.Length == e.Id) .Select(e => e.Id) .Single(); Assert.Equal(2, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE 2 = s.""Id"" LIMIT 2"); } #endregion #region Any/All [Theory] [MemberData(nameof(IsListData))] public void Any_no_predicate(bool list) { using var ctx = CreateContext(); var count = ctx.SomeEntities .Where(e => e.IntArray.Any()) .OverArrayOrList(list) .Count(); Assert.Equal(2, count); AssertSql(list, @"SELECT COUNT(*)::INT FROM ""SomeEntities"" AS s WHERE cardinality(s.""IntArray"") > 0"); } [Fact] public void Any_like() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => new[] { "a%", "b%", "c%" }.Any(p => EF.Functions.Like(e.NullableText, p))) .Select(e => e.Id) .Single(); Assert.Equal(2, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""NullableText"" LIKE ANY (ARRAY['a%','b%','c%']::text[]) LIMIT 2"); } [Fact] public void Any_ilike() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => new[] { "a%", "b%", "c%" }.Any(p => EF.Functions.ILike(e.NullableText, p))) .Select(e => e.Id) .Single(); Assert.Equal(2, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""NullableText"" ILIKE ANY (ARRAY['a%','b%','c%']::text[]) LIMIT 2"); } [Fact] public void Any_like_anonymous() { using var ctx = CreateContext(); var patterns = new[] { "a%", "b%", "c%" }; var _ = ctx.SomeEntities .Select( x => new { Array = x.IntArray, Text = x.NullableText }) .Where(x => patterns.Any(p => EF.Functions.Like(x.Text, p))) .ToList(); AssertSql( @"@__patterns_0='System.String[]' (DbType = Object) SELECT s.""IntArray"" AS ""Array"", s.""NullableText"" AS ""Text"" FROM ""SomeEntities"" AS s WHERE s.""NullableText"" LIKE ANY (@__patterns_0)"); } [Fact] public void All_like() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => new[] { "b%", "%r" }.All(p => EF.Functions.Like(e.NullableText, p))) .Select(e => e.Id) .Single(); Assert.Equal(2, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""NullableText"" LIKE ALL (ARRAY['b%','%r']::text[]) LIMIT 2"); } [Fact] public void All_ilike() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => new[] { "B%", "%r" }.All(p => EF.Functions.ILike(e.NullableText, p))) .Select(e => e.Id) .Single(); Assert.Equal(2, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE s.""NullableText"" ILIKE ALL (ARRAY['B%','%r']::text[]) LIMIT 2"); } [Theory] [MemberData(nameof(IsListData))] public void Any_Contains(bool list) { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => new[] { 2, 3 }.Any(p => e.IntArray.Contains(p))) .Select(e => e.Id) .OverArrayOrList(list) .Single(); Assert.Equal(1, id); var count = ctx.SomeEntities .Where(e => new[] { 1, 2 }.Any(p => e.IntArray.Contains(p))) .OverArrayOrList(list) .Count(); Assert.Equal(0, count); AssertSql(list, @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE ARRAY[2,3]::integer[] && s.""IntArray"" LIMIT 2", // @"SELECT COUNT(*)::INT FROM ""SomeEntities"" AS s WHERE ARRAY[1,2]::integer[] && s.""IntArray"""); } [Theory] [MemberData(nameof(IsListData))] public void All_Contains(bool list) { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => new[] { 5, 6 }.All(p => e.IntArray.Contains(p))) .Select(e => e.Id) .OverArrayOrList(list) .Single(); Assert.Equal(2, id); var count = ctx.SomeEntities .Where(e => new[] { 4, 5, 6 }.All(p => e.IntArray.Contains(p))) .OverArrayOrList(list) .Count(); Assert.Equal(0, count); AssertSql(list, @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE ARRAY[5,6]::integer[] <@ s.""IntArray"" LIMIT 2", // @"SELECT COUNT(*)::INT FROM ""SomeEntities"" AS s WHERE ARRAY[4,5,6]::integer[] <@ s.""IntArray"""); } #endregion #region bytea [Fact] public void Index_bytea_with_constant() { using var ctx = CreateContext(); var id = ctx.SomeEntities .Where(e => e.Bytea[0] == 3) .Select(e => e.Id) .Single(); Assert.Equal(1, id); AssertSql( @"SELECT s.""Id"" FROM ""SomeEntities"" AS s WHERE get_byte(s.""Bytea"", 0) = 3 LIMIT 2"); } public void Index_text_with_constant() { using var ctx = CreateContext(); var actual = ctx.SomeEntities.Where(e => e.NullableText[0] == 'f').ToList(); Assert.Single(actual); AssertSql( @"SELECT s.""Id"", s.""SomeArray"", s.""SomeBytea"", s.""SomeMatrix"", s.""SomeText"" FROM ""SomeEntities"" AS s WHERE (get_byte(s.""SomeBytea"", 0) = 3) AND get_byte(s.""SomeBytea"", 0) IS NOT NULL"); } #endregion #region Support protected ArrayArrayQueryContext CreateContext() => Fixture.CreateContext(); void AssertSql(bool list, params string[] expected) => AssertSql(list ? expected.Select(e => e .Replace(@"""IntArray""", @"""IntList""") .Replace(@"""StringArray""", @"""StringList""")).ToArray() : expected); void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); public static IEnumerable<object[]> IsListData = new[] { new object[] { false }, new object[] { true } }; public class ArrayArrayQueryContext : PoolableDbContext { public DbSet<SomeArrayEntity> SomeEntities { get; set; } public ArrayArrayQueryContext(DbContextOptions options) : base(options) {} public static void Seed(ArrayArrayQueryContext context) { context.SomeEntities.AddRange( new SomeArrayEntity { Id = 1, IntArray = new[] { 3, 4 }, IntList = new List<int> { 3, 4 }, Bytea = new byte[] { 3, 4 }, ByteArray = new byte[] { 3, 4 }, StringArray = new[] { "3", "4" }, StringList = new List<string> { "3", "4" }, IntMatrix = new[,] { { 5, 6 }, { 7, 8 } }, NullableText = "foo", NonNullableText = "foo", Byte = 10 }, new SomeArrayEntity { Id = 2, IntArray = new[] { 5, 6, 7 }, IntList = new List<int> { 5, 6, 7 }, Bytea = new byte[] { 5, 6, 7 }, ByteArray = new byte[] { 5, 6, 7 }, StringArray = new[] { "5", "6", "7", null }, StringList = new List<string> { "5", "6", "7", null }, IntMatrix = new[,] { { 10, 11 }, { 12, 13 } }, NullableText = "bar", NonNullableText = "bar", Byte = 20 }); context.SaveChanges(); } } public class SomeArrayEntity { public int Id { get; set; } public int[] IntArray { get; set; } public List<int> IntList { get; set; } public int[,] IntMatrix { get; set; } public byte[] Bytea { get; set; } public byte[] ByteArray { get; set; } public string[] StringArray { get; set; } public List<string> StringList { get; set; } public string NullableText { get; set; } [Required] public string NonNullableText { get; set; } public byte Byte { get; set; } } public class ArrayArrayQueryFixture : SharedStoreFixtureBase<ArrayArrayQueryContext> { protected override string StoreName => "ArrayArrayQueryTest"; protected override ITestStoreFactory TestStoreFactory => NpgsqlTestStoreFactory.Instance; public TestSqlLoggerFactory TestSqlLoggerFactory => (TestSqlLoggerFactory)ListLoggerFactory; protected override void Seed(ArrayArrayQueryContext context) => ArrayArrayQueryContext.Seed(context); } #endregion } } namespace Npgsql.EntityFrameworkCore.PostgreSQL.Query.ArrayTests { using SomeArrayEntity = ArrayQueryTest.SomeArrayEntity; static class QueryableExtensions { internal static IQueryable<T> OverArrayOrList<T>(this IQueryable<T> source, bool list) { Check.NotNull(source, nameof(source)); return source.Provider is EntityQueryProvider && list ? source.Provider.CreateQuery<T>( new ArrayToListReplacingExpressionVisitor().Visit(source.Expression)) : source; } } class ArrayToListReplacingExpressionVisitor : ExpressionVisitor { static readonly PropertyInfo IntArray = typeof(SomeArrayEntity).GetProperty(nameof(SomeArrayEntity.IntArray)); static readonly PropertyInfo IntList = typeof(SomeArrayEntity).GetProperty(nameof(SomeArrayEntity.IntList)); static readonly PropertyInfo StringArray = typeof(SomeArrayEntity).GetProperty(nameof(SomeArrayEntity.StringArray)); static readonly PropertyInfo StringList = typeof(SomeArrayEntity).GetProperty(nameof(SomeArrayEntity.StringList)); protected override Expression VisitMember(MemberExpression node) { if (node.Member == IntArray) return Expression.MakeMemberAccess(node.Expression, IntList); if (node.Member == StringArray) return Expression.MakeMemberAccess(node.Expression, StringList); return node; } } }
{ "pile_set_name": "Github" }
{ "edges": [ { "node1": { "hostname": "n1", "interfaceName": "swp5" }, "node2": { "hostname": "n2", "interfaceName": "swp5" } }, { "node1": { "hostname": "n2", "interfaceName": "swp6" }, "node2": { "hostname": "n1", "interfaceName": "swp6" } } ] }
{ "pile_set_name": "Github" }
/* * Copyright 2017 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef SDK_ANDROID_SRC_JNI_PC_MEDIASTREAMTRACK_H_ #define SDK_ANDROID_SRC_JNI_PC_MEDIASTREAMTRACK_H_ #include <jni.h> #include "api/mediatypes.h" #include "sdk/android/native_api/jni/scoped_java_ref.h" namespace webrtc { namespace jni { ScopedJavaLocalRef<jobject> NativeToJavaMediaType( JNIEnv* jni, cricket::MediaType media_type); cricket::MediaType JavaToNativeMediaType(JNIEnv* jni, const JavaRef<jobject>& j_media_type); } // namespace jni } // namespace webrtc #endif // SDK_ANDROID_SRC_JNI_PC_MEDIASTREAMTRACK_H_
{ "pile_set_name": "Github" }
#ifndef LAMMPS_INTERFACE_H #define LAMMPS_INTERFACE_H #include <iostream> #include <cstdlib> #include <map> #include <iostream> #include <string> #include <sstream> #include <fstream> #include <utility> #include "mpi.h" #include "../../src/lmptype.h" #include "../../src/lammps.h" #include "../../src/comm.h" #include "../../src/modify.h" #include "../../src/memory.h" #include "../../src/random_park.h" typedef LAMMPS_NS::RanPark* RNG_POINTER; #include "../../src/compute.h" typedef const LAMMPS_NS::Compute* COMPUTE_POINTER; #include "../../src/update.h" #include "../../src/min.h" #include "ATC_Error.h" #include "ATC_TypeDefs.h" #include "MatrixDef.h" #include "MPI_Wrappers.h" typedef LAMMPS_NS::Pair* POTENTIAL; // Forward class declarations for LAMMPS_NS namespace namespace LAMMPS_NS { class LAMMPS; class NeighList; class Compute; class ComputePEAtom; class ComputeStressAtom; class ComputeCentroAtom; class ComputeCNAAtom; class ComputeCoordAtom; class ComputeKEAtom; class Pair; class PairEAM; class Fix; class RanPark; } namespace ATC { static const std::string atomPeNameBase_ = "atcPE"; static const double big_ = 1.e20; /** * @class LammpsInterface * @brief Singleton class that handles all interfacing with the lammps code */ class LammpsInterface { public: // Enumeration of fundamental per-atom quantities, i.e. those defined directly by Lammps enum FundamentalAtomQuantity { ATOM_MASS = 0, ATOM_CHARGE, ATOM_POSITION, ATOM_VELOCITY, ATOM_FORCE, NUM_FUNDAMENTAL_ATOM_QUANTITIES }; // Enumeration for lattice type. this MUST match the enum in src/lattice.cpp enum LatticeType { NONE=0, SC, BCC, FCC, HCP, DIAMOND, SQ, SQ2, HEX, CUSTOM }; // Enumeration for units type. this is internal to ATC enum UnitsType { UNKNOWN=0, ATC, LJ, REAL, METAL, SI }; // Enumeration for atom data style enum AtomStyle { UNKNOWN_STYLE=0, ATOMIC_STYLE, CHARGE_STYLE, FULL_STYLE }; // Provides a struct for easily passing/recovering data about SparseMats struct SparseMatInfo { INDEX rows; INDEX cols; INDEX rowsCRS; INDEX size; }; /** Static instance of this class */ static LammpsInterface * instance(); /** Destroy */ static void Destroy(); /** Set lammps pointer */ void set_lammps(LAMMPS_NS::LAMMPS * lammps) { lammps_ = lammps; MPI_Comm_rank(lammps_->world, & commRank_); MPI_Comm_size(lammps_->world, & commSize_); } /** \name Methods that interface with lammps base class */ /*@{*/ // begin MPI -------------------------------------------------------------------- MPI_Comm world() const; void broadcast(double * buf, int count = 1) const { MPI_Wrappers::broadcast(lammps_->world, buf, count); } void int_broadcast(int * buf, int count = 1) const { MPI_Wrappers::int_broadcast(lammps_->world, buf, count); } // send_buf is frequently a void* so MPI_IN_PLACE can be passed in void allsum(void * send_buf, double * rec_buf, int count = 1) const { MPI_Wrappers::allsum(lammps_->world, send_buf, rec_buf, count); } void int_allsum(void * send_buf, int * rec_buf, int count = 1) const { MPI_Wrappers::int_allsum(lammps_->world, send_buf, rec_buf, count); } int int_allsum(int & i) const { int j = 0; MPI_Wrappers::int_allsum(lammps_->world, &i, &j, 1); return j; } int int_scansum(int & i) const { int j = 0; MPI_Wrappers::int_scansum(lammps_->world, &i, &j, 1); return j; } int int_allmax(int & i) const { int j = 0; MPI_Wrappers::int_allmax(lammps_->world, &i, &j, 1); return j; } int int_allmin(int & i) const { int j = 0; MPI_Wrappers::int_allmin(lammps_->world, &i, &j, 1); return j; } double allmin(double & i) const { double j = 0; MPI_Wrappers::allmin(lammps_->world, &i, &j, 1); return j; } void sparse_allsum(SparseMatrix<double> &toShare) const #ifdef ISOLATE_FE { MPI_Wrappers::sparse_allsum(lammps_->world, toShare); } #else ; #endif void allmax(double * send_buf, double * rec_buf, int count = 1) { MPI_Wrappers::allmax(lammps_->world, send_buf, rec_buf, count); } void int_allmax(int * send_buf, int * rec_buf, int count = 1) const { MPI_Wrappers::int_allmax(lammps_->world, send_buf, rec_buf, count); } void allmin(double * send_buf, double * rec_buf, int count = 1) const { MPI_Wrappers::allmin(lammps_->world, send_buf, rec_buf, count); } void int_allmin(int * send_buf, int * rec_buf, int count = 1) const { MPI_Wrappers::int_allmin(lammps_->world, send_buf, rec_buf, count); } int rank_min(double * send_buf, double * rec_buf, int count = 1) const { return MPI_Wrappers::rank_min(lammps_->world, send_buf, rec_buf, count); } void int_recv(int * recv_buf, int max_size, int iproc) const { MPI_Wrappers::int_recv(lammps_->world, recv_buf, max_size, iproc); } void recv(double * recv_buf, int max_size, int iproc) const { MPI_Wrappers::recv(lammps_->world, recv_buf, max_size, iproc); } void int_send(int * send_buf, int send_size) const { MPI_Wrappers::int_send(lammps_->world, send_buf, send_size); } void send(double * send_buf, int send_size) const { MPI_Wrappers::send(lammps_->world, send_buf, send_size); } void allgatherv(double * send_buf, int send_count, double * rec_buf, int * rec_counts, int * displacements) const { MPI_Wrappers::allgatherv(lammps_->world, send_buf, send_count, rec_buf, rec_counts, displacements); } void int_allgather(int send, int* recv) { MPI_Wrappers::int_allgather(lammps_->world,send,recv); } void int_scatter(int * send_buf, int * rec_buf, int count = 1) { MPI_Wrappers::int_scatter(lammps_->world, send_buf, rec_buf, count); } void logical_or(void * send_buf, int * rec_buf, int count = 1) const { MPI_Wrappers::logical_or(lammps_->world, send_buf, rec_buf, count); } void barrier(void) const { MPI_Wrappers::barrier(lammps_->world); } void stop(std::string msg="") const { MPI_Wrappers::stop(lammps_->world, msg); } std::string read_file(std::string filename) const; void write_file(std::string filename, std::string contents, std::ofstream::openmode mode = std::ofstream::out) const { if (! comm_rank()) { std::ofstream f(filename.c_str(),mode); f << contents; f.close(); } // ignore other ranks and assume they are consistent } // end MPI -------------------------------------------------------------------- void print_debug(std::string msg="") const { std::cout << "rank " << comm_rank() << " " << msg << "\n" << std::flush; barrier(); } int comm_rank(void) const { return commRank_;} int comm_size(void) const { return commSize_;} bool rank_zero(void) const { return (commRank_==0);} bool serial(void) const { int size = 1; MPI_Comm_size(lammps_->world,&size); return (size==1); } void print_msg(std::string msg) const { int me; MPI_Comm_rank(lammps_->world,&me); std::stringstream full_msg; if (serial()) { full_msg << " ATC: " << msg << "\n"; } else { full_msg << " ATC: P" << me << ", " << msg << "\n"; } std::string mesg = full_msg.str(); if (lammps_->screen) fprintf(lammps_->screen, "%s",mesg.c_str()); if (lammps_->logfile) fprintf(lammps_->logfile,"%s",mesg.c_str()); } void print_msg_once(std::string msg,bool prefix=true, bool endline=true) const { int me; MPI_Comm_rank(lammps_->world,&me); if (me==0) { std::stringstream full_msg; if (prefix) full_msg << " ATC: "; full_msg << msg; if (endline) full_msg << "\n"; std::string mesg = full_msg.str(); if (lammps_->screen) fprintf(lammps_->screen, "%s",mesg.c_str()); if (lammps_->logfile) fprintf(lammps_->logfile,"%s",mesg.c_str()); } } void all_print(double data, std::string tag ="") const { int me; MPI_Comm_rank(lammps_->world,&me); std::stringstream full_msg; if (serial()) { full_msg << " ATC: " << tag << data << "\n"; } else { int commSize = comm_size(); double *recv = new double[commSize]; MPI_Wrappers::gather(lammps_->world,data,recv); if (rank_zero()) { full_msg << " ATC:" << tag; for (int i = 0; i < commSize; i++) { full_msg << " P" << i << ": " << recv[i] ; } full_msg << "\n"; } delete[] recv; } if (rank_zero()) { std::string mesg = full_msg.str(); if (lammps_->screen) fprintf(lammps_->screen, "%s",mesg.c_str()); if (lammps_->logfile) fprintf(lammps_->logfile,"%s",mesg.c_str()); } } void stream_msg_once(std::string msg,bool prefix=true, bool endline=true) const { int me; MPI_Comm_rank(lammps_->world,&me); if (me==0) { if (prefix) std::cout << " ATC: "; std::cout << msg; if (endline) std::cout << "\n"; std::cout << std::flush; } } void forward_comm_fix() const; void comm_borders() const; /*@}*/ /** \name Methods that interface with Atom class */ /*@{*/ void set_fix_pointer(LAMMPS_NS::Fix * thisFix); std::string fix_id() const; bool atoms_sorted() const; LAMMPS_NS::bigint natoms() const; int nlocal() const; int nghost() const; int nmax() const; int ntypes() const; double ** xatom() const; double ** vatom() const; double ** fatom() const; const int * atom_mask() const; int * atom_mask(); int * atom_type() const; int * atom_tag() const; int * atom_to_molecule() const; int * num_bond() const; int ** bond_atom() const; int * image() const; int bond_per_atom() const; int newton_bond() const; int local_to_global_map(int global) const; int type_to_charge(int t) const; //* Returns a pointer to the atom masses (NOT SAFE). double * atom_mass() const; //* Indexes an atomic mass by atom type (NO BOUNDS CHECK). double atom_mass(int iType) const; double * atom_rmass() const; double * atom_charge() const; double * atom_scalar(FundamentalAtomQuantity quantityType) const; double ** atom_vector(FundamentalAtomQuantity quantityType) const; int atom_quantity_ndof(FundamentalAtomQuantity quantityType) const; double atom_quantity_conversion(FundamentalAtomQuantity quantityType) const; void unwrap_coordinates(int iatom, double* xatom) const; /*@}*/ /** \name Methods that interface with Domain class */ /*@{*/ int dimension() const; int nregion() const; void box_bounds(double & boxxlo, double & boxxhi, double & boxylo, double & boxyhi, double & boxzlo, double & boxzhi) const; bool in_box(double * x) const; bool in_my_processor_box(double * x) const; void sub_bounds(double & subxlo, double & subxhi, double & subylo, double & subyhi, double & subzlo, double & subzhi) const; int xperiodic() const; int yperiodic() const; int zperiodic() const; int nperiodic() const; void box_periodicity(int & xperiodic, int & yperiodic, int & zperiodic) const; void periodicity_correction(double * x) const; void set_reference_box(void) const; // const since called by perd_corr int region_id(const char * regionName) const; double domain_xprd() const; double domain_yprd() const; double domain_zprd() const; double domain_volume() const; double domain_xy() const; double domain_xz() const; double domain_yz() const; int domain_triclinic() const; bool region_bounds(const char * regionName, double &xmin, double &xmax, double &ymin, double & ymax, double &zmin, double &zmax, double &xscale, double &yscale, double &zscale) const; bool region_bounds(const char * regionName, double &xmin, double &xmax, double &ymin, double & ymax, double &zmin, double &zmax) const { double xs,ys,zs; bool ifBlock = region_bounds(regionName, xmin,xmax,ymin,ymax,zmin,zmax,xs,ys,zs); xmin *= xs; xmax *= xs; ymin *= ys; ymax *= ys; zmin *= zs; zmax *= zs; return ifBlock; } /*@}*/ void minimum_image(double & dx, double & dy, double & dz) const; void closest_image(const double * const xi, const double * const xj, double * const xjImage) const; /** \name Methods that interface with Update class */ UnitsType units_style() const; double convert_units(double value, UnitsType in, UnitsType out, int massExp, int lenExp, int timeExp, int engExp=0) const; //double minimize_energy() { return lammps_->update->minimize->ecurrent; } double minimize_energy() const { return lammps_->update->minimize->eprevious; } /*@}*/ /** \name Methods that interface with Lattice class */ /*@{*/ double xlattice() const; double ylattice() const; double zlattice() const; LatticeType lattice_style() const; int n_basis() const; void basis_vectors(double **basis) const; double max_lattice_constant(void) const; double near_neighbor_cutoff(void) const; void unit_cell(double *a1, double *a2, double *a3) const; /** these functions are more than just simple pass throughs */ int num_atoms_per_cell(void) const; double volume_per_atom(void) const; void lattice(Matrix<double> &N, Matrix<double> &B) const; /*@}*/ /** \name Methods that interface with Force class */ /*@{*/ double boltz() const; double mvv2e() const; double ftm2v() const; double nktv2p() const; double qqr2e() const; double qe2f() const; double dielectric() const; double qqrd2e() const; double qv2e() const; // converts charge * voltage --> mass length^2 / time^2 /*@}*/ /** \name Methods that interface with pair class */ /*@{*/ // interface to "single" double pair_force(int i, int j, double rsq, double& fmag_over_rmag) const; // pair class double pair_force(int n, double rsq, double& fmag_over_rmag) const; // bond class double pair_force(std::map< std::pair< int,int >,int >::const_iterator itr, double rsq, double& fmag_over_rmag, int nbonds = 0) const; double pair_force(std::pair< std::pair< int,int >,int > apair, double rsq, double& fmag_over_rmag, int nbonds = 0) const; double pair_cutoff() const; void pair_reinit() const; int single_enable() const; LAMMPS_NS::PairEAM * pair_eam(void) const; double bond_stiffness(int i, int j, double rsq) const; /*@}*/ /** \name Methods for addition/deletion of atoms*/ /*@{*/ int delete_atom(int id) const; int insert_atom(int type, int mask, double* x, double* v, double q = 0) const; double shortrange_energy(double *x, int type, int id = -1, double max = big_) const; int reset_ghosts(int dn) const; double shortrange_energy(int id, double max = big_) const; POTENTIAL potential(void) const; int type_to_groupbit(int itype) const; int change_type(int itype, int jtype) const; int count_type(int itype) const; bool epsilons(int type, POTENTIAL p, double * epsilons) const; bool set_epsilons(int type, POTENTIAL p, double * epsilons) const; int set_charge(int type, double charge) const; /*@}*/ /** \name interface to random number generator */ /*@{*/ RNG_POINTER random_number_generator() const; double random_uniform(RNG_POINTER p) const; double random_normal (RNG_POINTER p) const; int random_state (RNG_POINTER p) const; void set_random_state (RNG_POINTER p, int seed) const; void advance_random_generator (RNG_POINTER p, int n = 1) const; void advance_random_uniform (RNG_POINTER p, int n = 1) const; void advance_random_normal (RNG_POINTER p, int n = 1) const; /*@}*/ /** these functions are more than just simple pass throughs */ /*@{*/ /** Boltzmann's constant in M,L,T,t units */ double kBoltzmann(void) const; /** Planck's constant (energy-time units) */ double hbar(void) const; /** Dulong-Petit heat capacity per volume in M,L,T,t units */ double heat_capacity(void) const; /** mass per volume in reference configuraturation in M,L units */ double mass_density(int* numPerType=nullptr) const; /** permittivity of free space, converts from LAMMPS potential units implied by the electric field units to LAMMPS charge units/LAMMPS length units (e.g., V to elemental charge/A) */ double epsilon0(void) const; double coulomb_constant(void) const; double * special_coul() const; int newton_pair() const; double coulomb_factor(int & j) const { int n = nlocal() + nghost(); double * sc = special_coul(); double factor_coul = 1.; if (j >= n) { factor_coul = sc[j/n]; j %= n; } return factor_coul; } /*@}*/ /** \name Methods that interface with Group class */ /*@{*/ int ngroup() const; int group_bit(std::string name) const; int group_bit(int iGroup) const; int group_index(std::string name) const; int group_inverse_mask(int iGroup) const; char * group_name(int iGroup) const; void group_bounds(int iGroup, double * b) const; /*@}*/ /** \name Methods that interface with Memory class */ /*@{*/ double * create_1d_double_array(int length, const char *name) const; double * grow_1d_double_array(double *array, int length, const char *name) const; void destroy_1d_double_array(double * d) const; double ** create_2d_double_array(int n1, int n2, const char *name) const; void destroy_2d_double_array(double **d) const; double **grow_2d_double_array(double **array, int n1, int n2, const char *name) const; int * create_1d_int_array(int length, const char *name) const; int * grow_1d_int_array(int *array, int length, const char *name) const; void destroy_1d_int_array(int * d) const; int ** create_2d_int_array(int n1, int n2, const char *name) const; void destroy_2d_int_array(int **i) const; int ** grow_2d_int_array(int **array, int n1, int n2, const char *name) const; template <typename T> T * grow_array(T *&array, int n, const char *name) const {return lammps_->memory->grow(array,n,name);} template <typename T> void destroy_array(T * array) {lammps_->memory->destroy(array);} template <typename T> T ** grow_array(T **&array, int n1, int n2, const char *name) const {return lammps_->memory->grow(array,n1,n2,name);} template <typename T> void destroy_array(T ** array) const {lammps_->memory->destroy(array);} /*@}*/ /** \name Methods that interface with Update class */ /*@{*/ double dt() const; LAMMPS_NS::bigint ntimestep() const; int nsteps() const; bool now(LAMMPS_NS::bigint f) { return (ntimestep() % f == 0); } /*@}*/ /** \name Methods that interface with neighbor list */ /*@{*/ void neighbor_remap(int & j) const { j &= NEIGHMASK; } int sbmask(int j) const; void set_list(int id, LAMMPS_NS::NeighList *ptr) ; int neighbor_list_inum() const; int * neighbor_list_numneigh() const; int * neighbor_list_ilist() const; int ** neighbor_list_firstneigh() const; int neighbor_ago() const; int reneighbor_frequency() const; LAMMPS_NS::NeighList * neighbor_list(void) const { return list_;} /*@}*/ /** \name Methods that interface with bond list */ /*@{*/ int bond_list_length() const; int ** bond_list() const; // direct access int * bond_list(int n) const { return bond_list()[n];} int bond_list_i(int n) const { return bond_list(n)[0];} int bond_list_j(int n) const { return bond_list(n)[1];} int bond_list_type(int n) const { return bond_list(n)[2];} /*@}*/ /** \name Methods that interface with Region class */ /*@{*/ char * region_name(int iRegion) const; char * region_style(int iRegion) const; double region_xlo(int iRegion) const; double region_xhi(int iRegion) const; double region_ylo(int iRegion) const; double region_yhi(int iRegion) const; double region_zlo(int iRegion) const; double region_zhi(int iRegion) const; double region_xscale(int iRegion) const; double region_yscale(int iRegion) const; double region_zscale(int iRegion) const; int region_match(int iRegion, double x, double y, double z) const; /*@}*/ /** \name Methods that interface with compute class */ enum COMPUTE_INVOKED {INVOKED_SCALAR=1,INVOKED_VECTOR=2,INVOKED_ARRAY=4,INVOKED_PERATOM=8}; enum PER_ATOM_COMPUTE {PE_ATOM, STRESS_ATOM, CENTRO_ATOM, CNA_ATOM, COORD_ATOM, KE_ATOM, NUM_PER_ATOM_COMPUTES}; // computes owned by LAMMPS COMPUTE_POINTER compute_pointer(std::string tag) const; int compute_ncols_peratom(COMPUTE_POINTER computePointer) const; double* compute_vector_peratom(COMPUTE_POINTER computePointer) const; double** compute_array_peratom(COMPUTE_POINTER computePointer) const; void computes_addstep(int step) const; void compute_addstep(COMPUTE_POINTER computePointer, int step) const; int compute_matchstep(COMPUTE_POINTER computePointer, int step) const; void reset_invoked_flag(COMPUTE_POINTER computePointer) const; // computes owned by ATC int create_compute_pe_peratom(void) const; double * compute_pe_peratom(void) const; std::string compute_pe_name(void) const {return atomPeNameBase_;};// +fix_id();}; enables unique names, if desired void computes_clearstep(void) const {lammps_->modify->clearstep_compute();}; /*@}*/ /** Return lammps pointer -- only as a last resort! */ LAMMPS_NS::LAMMPS * lammps_pointer() const; protected: /** transfer a const compute pointer to a non-const computer pointer */ LAMMPS_NS::Compute * const_to_active(const LAMMPS_NS::Compute* computePointer) const; LAMMPS_NS::LAMMPS * lammps_; LAMMPS_NS::Fix * fixPointer_; /** access to neighbor list */ mutable LAMMPS_NS::NeighList *list_; /** constructor */ LammpsInterface(); /** comm rank */ int commRank_; /** number of processes */ int commSize_; /** compute pe/atom */ mutable LAMMPS_NS::Compute * atomPE_; /** box info */ mutable bool refBoxIsSet_; mutable double upper_[3],lower_[3],length_[3]; /** registry of computer pointers */ mutable std::set<LAMMPS_NS::Compute * > computePointers_; /** a random number generator from lammps */ mutable LAMMPS_NS::RanPark * random_; mutable LAMMPS_NS::RanPark * globalrandom_; private: static LammpsInterface * myInstance_; }; class HeartBeat { public: HeartBeat(std::string name, int freq) : name_(name), freq_(freq), counter_(0) {}; ~HeartBeat(){}; void start() const { ATC::LammpsInterface::instance()->stream_msg_once(name_,true,false);} void next() const { if (counter_++ % freq_ == 0 ) ATC::LammpsInterface::instance()->stream_msg_once(".",false,false);} void finish() const { ATC::LammpsInterface::instance()->stream_msg_once("done",false,true);} protected: std::string name_; int freq_; mutable int counter_; private: HeartBeat(); }; } // end namespace ATC #endif
{ "pile_set_name": "Github" }
Shader "Hidden/Noise Shader YUV" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _GrainTex ("Base (RGB)", 2D) = "gray" {} _ScratchTex ("Base (RGB)", 2D) = "gray" {} } SubShader { Pass { ZTest Always Cull Off ZWrite Off CGPROGRAM #pragma vertex vert #pragma fragment frag #include "UnityCG.cginc" struct v2f { float4 pos : SV_POSITION; float2 uv : TEXCOORD0; float2 uvg : TEXCOORD1; // grain float2 uvs : TEXCOORD2; // scratch }; uniform sampler2D _MainTex; uniform sampler2D _GrainTex; uniform sampler2D _ScratchTex; uniform float4 _GrainOffsetScale; uniform float4 _ScratchOffsetScale; uniform fixed4 _Intensity; // x=grain, y=scratch half4 _MainTex_ST; v2f vert (appdata_img v) { v2f o; o.pos = mul (UNITY_MATRIX_MVP, v.vertex); o.uv = UnityStereoScreenSpaceUVAdjust(MultiplyUV (UNITY_MATRIX_TEXTURE0, v.texcoord), _MainTex_ST); o.uvg = v.texcoord.xy * _GrainOffsetScale.zw + _GrainOffsetScale.xy; o.uvs = v.texcoord.xy * _ScratchOffsetScale.zw + _ScratchOffsetScale.xy; return o; } fixed4 frag (v2f i) : SV_Target { fixed4 col = tex2D(_MainTex, i.uv); // convert to YUV fixed3 yuv; yuv.x = dot( col.rgb, half3(0.299,0.587,0.114) ); yuv.y = (col.b-yuv.x)*0.492; yuv.z = (col.r-yuv.x)*0.877; // sample noise texture and do a signed add fixed3 grain = tex2D(_GrainTex, i.uvg).rgb * 2 - 1; yuv.rgb += grain * _Intensity.x; // convert back to rgb col.r = yuv.z * 1.140 + yuv.x; col.g = yuv.z * (-0.581) + yuv.y * (-0.395) + yuv.x; col.b = yuv.y * 2.032 + yuv.x; // sample scratch texture and add fixed3 scratch = tex2D(_ScratchTex, i.uvs).rgb * 2 - 1; col.rgb += scratch * _Intensity.y; return col; } ENDCG } } Fallback off }
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "filename" : "input_emoji_delete_44x44_@2x.png", "scale" : "2x" }, { "idiom" : "universal", "filename" : "input_emoji_delete_44x44_@3x.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
// // WMZPageConfig.h // WMZPageController // // Created by wmz on 2019/9/17. // Copyright © 2019 wmz. All rights reserved. // #ifndef WMZPageConfig_h #define WMZPageConfig_h #import <UIKit/UIKit.h> #import <objc/runtime.h> #import "WMZPageProtocol.h" #import "NSObject+SafeKVO.h" #import "UIView+PageRect.h" @class WMZPageNaviBtn; #define PageVCWidth [UIScreen mainScreen].bounds.size.width #define PageVCHeight [UIScreen mainScreen].bounds.size.height #define myHeight 100 #define PageDarkColor(light,dark) \ ({\ UIColor *wMenuIndicator = nil; \ if (@available(iOS 13.0, *)) { \ wMenuIndicator = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { \ if ([traitCollection userInterfaceStyle] == UIUserInterfaceStyleLight) { \ return light; \ }else { \ return dark; \ }}]; \ }else{ \ wMenuIndicator = light; \ } \ (wMenuIndicator); \ })\ #define PageColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] #define PageK1px (1 / UIScreen.mainScreen.scale) #define PageVCIS_iPhoneX (CGSizeEqualToSize(CGSizeMake(375.f, 812.f), [UIScreen mainScreen].bounds.size) || CGSizeEqualToSize(CGSizeMake(812.f, 375.f), [UIScreen mainScreen].bounds.size) || CGSizeEqualToSize(CGSizeMake(414.f, 896.f), [UIScreen mainScreen].bounds.size) || CGSizeEqualToSize(CGSizeMake(896.f, 414.f), [UIScreen mainScreen].bounds.size)) //状态栏高度 #define PageVCStatusBarHeight (PageVCIS_iPhoneX ? 44.f : 20.f) //导航栏高度 #define PageVCNavBarHeight (44.f+PageVCStatusBarHeight) //底部标签栏高度 #define PageVCTabBarHeight (PageVCIS_iPhoneX ? (49.f+34.f) : 49.f) #define PageWindow [UIApplication sharedApplication].keyWindow #define pageIsIphoneX ({\ BOOL isPhoneX = NO;\ if (@available(iOS 11.0, *)) {\ if ([[[UIApplication sharedApplication] delegate] window].safeAreaInsets.bottom > 0.0) {\ isPhoneX = YES;\ }\ }\ isPhoneX;\ }) #define WMZPagePropStatementAndPropSetFuncStatement(propertyModifier,className, propertyPointerType, propertyName) \ @property(nonatomic,propertyModifier)propertyPointerType propertyName; \ - (className * (^) (propertyPointerType propertyName)) propertyName##Set; #define WMZPagePropSetFuncImplementation(className, propertyPointerType, propertyName) \ - (className * (^) (propertyPointerType propertyName))propertyName##Set{ \ return ^(propertyPointerType propertyName) { \ _##propertyName = propertyName; \ return self; \ }; \ } typedef enum :NSInteger{ PageBtnPositionLeft = 0, //图片在左,文字在右,默认 PageBtnPositionRight = 1, //图片在右,文字在左 PageBtnPositionTop = 2, //图片在上,文字在下 PageBtnPositionBottom = 3, //图片在下,文字在上 }PageBtnPosition; typedef enum :NSInteger{ PageSpecialTypeOne = 1, //菜单栏可见底部子视图 }PageSpecialType; typedef enum :NSInteger{ PageTitleMenuNone = 0, //无样式 PageTitleMenuLine = 1, //带下划线 PageTitleMenuCircle = 2, //背景圆角框 PageTitleMenuAiQY = 3, //爱奇艺效果(指示器跟随移动) PageTitleMenuTouTiao = 4, //今日头条效果(变大加颜色渐变) PageTitleMenuYouKu = 5, //优酷效果(变大字体加粗 指示器圆点 指示器跟随移动) PageTitleMenuPDD = 6, //拼多多效果(底部线条) }PageTitleMenu; typedef enum :NSInteger{ PageMenuPositionLeft = 0, //上左 PageMenuPositionRight = 1, //上右 PageMenuPositionCenter = 2, //居中 PageMenuPositionNavi = 3, //导航栏 PageMenuPositionBottom = 4, //底部 }PageMenuPosition; //设置阴影 typedef enum :NSInteger{ PageShadowPathTop, PageShadowPathBottom, PageShadowPathLeft, PageShadowPathRight, PageShadowPathCommon, PageShadowPathAround }PageShadowPathType; //渐变色 typedef enum :NSInteger{ PageGradientChangeDirectionLevel, //水平方向渐变 PageGradientChangeDirectionVertical, //垂直方向渐变 PageGradientChangeDirectionUpwardDiagonalLine, //主对角线方向渐变 PageGradientChangeDirectionDownDiagonalLine, //副对角线方向渐变 }PageGradientChangeDirection; /* * 点击 */ typedef void (^PageClickBlock)(id anyID,NSInteger index); /* * 控制器切换 */ typedef void (^PageVCChangeBlock)(UIViewController* oldVC,UIViewController *newVC,NSInteger oldIndex,NSInteger newIndex); /* * 子控制器滚动 */ typedef void (^PageChildVCScroll)(UIViewController* pageVC,CGPoint oldPoint,CGPoint newPonit,UIScrollView *currentScrollView); /* * 头视图 */ typedef UIView* (^PageHeadViewBlock)(void); /* * 固定尾视图 */ typedef UIView* (^PageFootViewBlock)(void); /* * 头视图和菜单栏的背景层 */ typedef void (^PageHeadAndMenuBgView)(UIView *bgView); /* * 自定义红点 */ typedef void (^PageCustomRedText)(UILabel *redLa,NSDictionary *info); /* * 自定义菜单栏 */ typedef void (^PageCustomMenuTitle)(NSArray *titleArr); /* * 滚动 后改变标题 */ typedef void (^PageCustomMenuSelectTitle)(NSArray *titleArr); /* * 切换高度block */ typedef void (^PageMenuChangeHeight)(NSArray<WMZPageNaviBtn*>*titleArr,CGFloat offset); /* * 恢复原来高度block */ typedef void (^PageMenuNormalHeight)(NSArray<WMZPageNaviBtn*>*titleArr); /* * vc数组 */ typedef UIViewController* (^PageViewControllerIndex)(NSInteger index); /* * 自定义Y */ typedef CGFloat (^PageCustomFrameY)(CGFloat nowY); #endif /* WMZPageConfig_h */
{ "pile_set_name": "Github" }
<!doctype html> <html lang="{{ site.lang | default: "en-US" }}"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="chrome=1"> <title>{{ page.title }}</title> <link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}"> <meta name="viewport" content="width=device-width"> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div class="wrapper"> <header> <h1>{{ site.title | default: site.github.repository_name }}</h1> <p>{{ site.description | default: site.github.project_tagline }}</p> {% if site.github.is_project_page %} <p class="view"><a href="{{ site.github.repository_url }}">View the Project on GitHub <small>{{ github_name }}</small></a></p> {% endif %} {% if site.github.is_user_page %} <p class="view"><a href="{{ site.github.owner_url }}">View My GitHub Profile</a></p> {% endif %} {% if site.show_downloads %} <ul> <li><a href="{{ site.github.zip_url }}">Download <strong>ZIP File</strong></a></li> <li><a href="{{ site.github.tar_url }}">Download <strong>TAR Ball</strong></a></li> <li><a href="{{ site.github.repository_url }}">View On <strong>GitHub</strong></a></li> </ul> {% endif %} </header> <section> {{ content }} </section> <footer> {% if site.github.is_project_page %} <p>This project is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a></p> {% endif %} <p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p> </footer> </div> <script src="{{ '/assets/js/scale.fix.js' | relative_url }}"></script> {% if site.google_analytics %} <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', '{{ site.google_analytics }}', 'auto'); ga('send', 'pageview'); </script> {% endif %} </body> </html>
{ "pile_set_name": "Github" }
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: Xilinx // Engineer: Parimal Patel // Module Name: pulse_gen // Project Name: // Target Devices: // Tool Versions: // Description: This module takes multi-cycle pulse (generated by GPIO writes) and // outputs synchronized one clock wide pulse ////////////////////////////////////////////////////////////////////////////////// module pulse_gen( input async_in, input sync_clk, output reg pulsed_out ); reg edge_detect; always @(posedge async_in or posedge pulsed_out) if(pulsed_out) edge_detect <= 0; else edge_detect <= 1; always @(posedge sync_clk) pulsed_out <= edge_detect; endmodule
{ "pile_set_name": "Github" }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_VIEWS_CONTROLS_TABLE_TABLE_GROUPER_H_ #define UI_VIEWS_CONTROLS_TABLE_TABLE_GROUPER_H_ #include "ui/views/views_export.h" namespace views { struct VIEWS_EXPORT GroupRange { int start; int length; }; // TableGrouper is used by TableView to group a set of rows and treat them // as one. Rows that fall in the same group are selected together and sorted // together. class VIEWS_EXPORT TableGrouper { public: virtual void GetGroupRange(int model_index, GroupRange* range) = 0; protected: virtual ~TableGrouper() {} }; } #endif // UI_VIEWS_CONTROLS_TABLE_GROUP_TABLE_VIEW_H_
{ "pile_set_name": "Github" }
import React from 'react'; import PropTypes from 'prop-types'; import { StyleSheet, css } from 'aphrodite'; import pluralize from '../../utils/pluralize'; const getTitle = (logItem, initial) => { if (initial) { return 'Initial'; } if (logItem.patches) { return `${logItem.patches.length} ${pluralize(logItem.patches.length, 'patch', 'patches')}`; } return 'Change'; }; // const tsToDate = (timestamp) => { // const d = new Date(timestamp); // const hh = `0${d.getHours()}`.slice(0, 2); // const mm = `0${d.getMinutes()}`.slice(0, 2); // const ss = `0${d.getSeconds()}`.slice(0, 2); // return `${hh}:${mm}:${ss}`; // }; export default class MstLogItem extends React.PureComponent { static propTypes = { logItem: PropTypes.object.isRequired, active: PropTypes.bool, initial: PropTypes.bool, selected: PropTypes.bool, onSelect: PropTypes.func.isRequired, onActivate: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, onCommit: PropTypes.func.isRequired, style: PropTypes.object, }; handleSelect = () => this.props.onSelect(this.props.logItem.id); handleActivate = () => this.props.onActivate(this.props.logItem.id); handleCancel = () => this.props.onCancel(this.props.logItem.id); handleCommit = () => this.props.onCommit(this.props.logItem.id); render() { const { active, initial, selected, logItem, style } = this.props; return ( <div onClick={this.handleSelect} className={css(styles.logItem, selected && styles.logItemSelected)} style={style} > <div className={css(styles.title, selected && styles.titleSelected)}> {getTitle(logItem, initial)} </div> <div className={css(styles.rightButtons, selected && styles.rightButtonsSelected)}> {!initial && <div onClick={this.handleCommit} className={css(styles.button)} title="Commit" > <CommitIcon /> </div> } {!initial && <div onClick={this.handleCancel} className={css(styles.button)} title="Cancel" > <CancelIcon /> </div> } {!active && ( <div onClick={this.handleActivate} className={css(styles.button)} title="Time-travel here" > <TravelIcon /> </div> )} {active && ( <div className={css(styles.activeIndicator)} /> )} </div> {active && ( <div className={css(styles.activeIndicator)} /> )} </div> ); } } const TravelIcon = () => ( <svg baseProfile="basic" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" > <path fill="none" stroke="var(--log-item-buttons-color)" strokeWidth="1.2" d="M2.188 4.708a6 6 0 1 1 .115 5.792M7.5 7.5V3m0 4.5L10 10" /> <g fill="var(--log-item-buttons-color)"> <path d="M.553 3.626L1.5 7.5l2.882-2.757L.553 3.626z" /> <circle cx="7.5" cy="7.5" r=".75" /> </g> </svg> ); const CancelIcon = () => ( <svg baseProfile="basic" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" > <path fill="none" stroke="var(--log-item-buttons-color)" strokeWidth="1.4" strokeMiterlimit="10" d="M2 13L13 2M13 13L2 2" /> </svg> ); const CommitIcon = () => ( <svg baseProfile="basic" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" > <path fill="none" stroke="var(--log-item-buttons-color)" strokeMiterlimit="10" d="M7.5 3.143v7.838" /> <g fill="var(--log-item-buttons-color)"> <circle cx="7.5" cy="3.256" r="2.256" /> <path d="M4.708 10.164L7.5 15l2.792-4.836z" /> </g> </svg> ); const styles = StyleSheet.create({ logItem: { display: 'flex', alignItems: 'center', boxSizing: 'border-box', fontSize: 12, userSelect: 'none', cursor: 'default', '--log-item-buttons-pane-opacity': '0', '--log-item-buttons-color': '#000', '--log-item-primary-color': 'var(--primary-color)', '--log-item-date-color': 'inherit', ':hover': { '--log-item-date-color': 'transparent', '--log-item-buttons-pane-opacity': '0.95', }, ':not(:last-child)': { borderBottom: '1px solid #eee', }, }, logItemSelected: { backgroundColor: 'var(--primary-color)', '--log-item-primary-color': '#fff', color: '#fff', ':hover': { '--log-item-buttons-color': '#fff', }, }, title: { padding: 5, flex: '1 1 auto', overflow: 'hidden', whiteSpace: 'nowrap', direction: 'rtl', unicodeBidi: 'plaintext', textOverflow: 'ellipsis', }, titleSelected: { filter: 'contrast(0.1) brightness(2)', }, rightButtons: { opacity: 'var(--log-item-buttons-pane-opacity)', display: 'flex', position: 'absolute', right: 0, top: 0, bottom: 0, backgroundImage: 'linear-gradient(to right, transparent, #fff 10px)', }, rightButtonsSelected: { backgroundImage: 'linear-gradient(to right, transparent, var(--primary-color) 10px)', }, button: { flex: '0 0 auto', width: 35, height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center', opacity: 0.7, position: 'relative', zIndex: 1, // overflow date ':hover': { opacity: 1, }, }, activeIndicator: { flex: '0 0 auto', width: 35, height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center', ':after': { content: '""', width: 8, height: 8, backgroundColor: 'var(--log-item-primary-color)', borderRadius: '50%', }, }, });
{ "pile_set_name": "Github" }
<snippet> <prefix>animation-scaleX</prefix> <description><![CDATA[x 轴缩放]]></description> <body><![CDATA[ animation.scaleX(${1}); ]]></body> </snippet>
{ "pile_set_name": "Github" }
// Copyright 2008 Isis Innovation Limited #include "ptam/MiniPatch.h" using namespace CVD; using namespace std; // Scoring function inline int MiniPatch::SSDAtPoint(CVD::BasicImage<CVD::byte> &im, const CVD::ImageRef &ir) { if(!im.in_image_with_border(ir, mnHalfPatchSize)) return mnMaxSSD + 1; ImageRef irImgBase = ir - ImageRef(mnHalfPatchSize, mnHalfPatchSize); int nRows = mimOrigPatch.size().y; int nCols = mimOrigPatch.size().x; byte *imagepointer; byte *templatepointer; int nDiff; int nSumSqDiff = 0; for(int nRow = 0; nRow < nRows; nRow++) { imagepointer = &im[irImgBase + ImageRef(0,nRow)]; templatepointer = &mimOrigPatch[ImageRef(0,nRow)]; for(int nCol = 0; nCol < nCols; nCol++) { nDiff = imagepointer[nCol] - templatepointer[nCol]; nSumSqDiff += nDiff * nDiff; }; }; return nSumSqDiff; } // Find a patch by searching at FAST corners in an input image // If available, a row-corner LUT is used to speed up search through the // FAST corners bool MiniPatch::FindPatch(CVD::ImageRef &irPos, CVD::BasicImage<CVD::byte> &im, int nRange, vector<ImageRef> &vCorners, std::vector<int> *pvRowLUT) { ImageRef irCenter = irPos; ImageRef irBest; int nBestSSD = mnMaxSSD + 1; ImageRef irBBoxTL = irPos - ImageRef(nRange, nRange); ImageRef irBBoxBR = irPos + ImageRef(nRange, nRange); vector<ImageRef>::iterator i; if(!pvRowLUT) { for(i = vCorners.begin(); i!=vCorners.end(); i++) if(i->y >= irBBoxTL.y) break; } else { int nTopRow = irBBoxTL.y; if(nTopRow < 0) nTopRow = 0; if(nTopRow >= (int) pvRowLUT->size()) nTopRow = (int) pvRowLUT->size() - 1; i = vCorners.begin() + (*pvRowLUT)[nTopRow]; } for(; i!=vCorners.end(); i++) { if(i->x < irBBoxTL.x || i->x > irBBoxBR.x) continue; if(i->y > irBBoxBR.y) break; int nSSD = SSDAtPoint(im, *i); if(nSSD < nBestSSD) { irBest = *i; nBestSSD = nSSD; } } if(nBestSSD < mnMaxSSD) { irPos = irBest; return true; } else return false; } // Define the patch from an input image void MiniPatch::SampleFromImage(ImageRef irPos, BasicImage<byte> &im) { assert(im.in_image_with_border(irPos, mnHalfPatchSize)); CVD::ImageRef irPatchSize( 2 * mnHalfPatchSize + 1 , 2 * mnHalfPatchSize + 1); mimOrigPatch.resize(irPatchSize); copy(im, mimOrigPatch, mimOrigPatch.size(), irPos - mimOrigPatch.size() / 2); } // Static members int MiniPatch::mnHalfPatchSize = 4; int MiniPatch::mnRange = 10; int MiniPatch::mnMaxSSD = 9999;
{ "pile_set_name": "Github" }
#include "../hppa/event-modules"
{ "pile_set_name": "Github" }
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS: [{ "name": "mmcgrana/textmate-clojure", "version": "0.0.0", "license": "MIT", "repositoryURL": "https://github.com/mmcgrana/textmate-clojure" }]
{ "pile_set_name": "Github" }
# Copyright 2016 The Prometheus Authors # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Needs to be defined before including Makefile.common to auto-generate targets DOCKER_ARCHS ?= amd64 armv7 arm64 s390x include Makefile.common DOCKER_IMAGE_NAME ?= collectd-exporter
{ "pile_set_name": "Github" }
using JetBrains.Annotations; using JetBrains.UI.Icons; using JetBrains.UI.RichText; using JetBrains.Util; namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { public class ArgumentRoleTooltipContent : TooltipContent { [CanBeNull] public IconId Icon { get; set; } [CanBeNull] public RichText Description { get; set; } public ArgumentRoleTooltipContent([CanBeNull] RichText text, TextRange trackingRange) : base(text, trackingRange) { } } }
{ "pile_set_name": "Github" }
using System; namespace Stylet.Samples.TabNavigation { class Bootstrapper : Bootstrapper<ShellViewModel> { } }
{ "pile_set_name": "Github" }
// Copyright (c) 2016 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 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. // Package benchmarks contains only benchmarks comparing zap to other // structured logging libraries. package benchmarks
{ "pile_set_name": "Github" }
Installation ============ You have multiple ways to install Twig. Installing the Twig PHP package ------------------------------- Install `Composer`_ and run the following command: .. code-block:: bash composer require "twig/twig:^1.0" Installing the C extension -------------------------- .. versionadded:: 1.4 The C extension was added in Twig 1.4. Twig comes with an **optional** C extension that improves the performance of the Twig runtime engine. Note that this extension does not replace the PHP code but only provides an optimized version of the ``\Twig\Template::getAttribute()`` method; you must still install the regular PHP code The C extension is only compatible and useful for **PHP5**. Install it like any other PHP extensions: .. code-block:: bash cd ext/twig phpize ./configure make make install For Windows: 1. Setup the build environment following the `PHP documentation`_ 2. Put Twig's C extension source code into ``C:\php-sdk\phpdev\vcXX\x86\php-source-directory\ext\twig`` 3. Use the ``configure --disable-all --enable-cli --enable-twig=shared`` command instead of step 14 4. ``nmake`` 5. Copy the ``C:\php-sdk\phpdev\vcXX\x86\php-source-directory\Release_TS\php_twig.dll`` file to your PHP setup. .. tip:: For Windows ZendServer, ZTS is not enabled as mentioned in `Zend Server FAQ`_. You have to use ``configure --disable-all --disable-zts --enable-cli --enable-twig=shared`` to be able to build the twig C extension for ZendServer. The built DLL will be available in ``C:\\php-sdk\\phpdev\\vcXX\\x86\\php-source-directory\\Release`` Finally, enable the extension in your ``php.ini`` configuration file: .. code-block:: ini extension=twig.so # For Unix systems extension=php_twig.dll # For Windows systems And from now on, Twig will automatically compile your templates to take advantage of the C extension. .. _`download page`: https://github.com/twigphp/Twig/tags .. _`Composer`: https://getcomposer.org/download/ .. _`PHP documentation`: https://wiki.php.net/internals/windows/stepbystepbuild .. _`Zend Server FAQ`: https://www.zend.com/en/products/server/faq#faqD6
{ "pile_set_name": "Github" }
using System; namespace ServiceStack.DataAnnotations { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class | AttributeTargets.Struct)] public class IndexAttribute : AttributeBase { public IndexAttribute() { } public IndexAttribute(bool unique) { Unique = unique; } public string Name { get; set; } public bool Unique { get; set; } public bool Clustered { get; set; } public bool NonClustered { get; set; } } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="..\common.init.vcxproj" /> <PropertyGroup Label="Globals"> <ProjectGuid>{18430FEF-6B61-4C53-B396-718E02850F1B}</ProjectGuid> </PropertyGroup> <PropertyGroup Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> </PropertyGroup> <ItemGroup> <ClCompile Include="..\..\src\leveldb\db\builder.cc" /> <ClCompile Include="..\..\src\leveldb\db\c.cc" /> <ClCompile Include="..\..\src\leveldb\db\dbformat.cc" /> <ClCompile Include="..\..\src\leveldb\db\db_impl.cc" /> <ClCompile Include="..\..\src\leveldb\db\db_iter.cc" /> <ClCompile Include="..\..\src\leveldb\db\dumpfile.cc" /> <ClCompile Include="..\..\src\leveldb\db\filename.cc" /> <ClCompile Include="..\..\src\leveldb\db\log_reader.cc" /> <ClCompile Include="..\..\src\leveldb\db\log_writer.cc" /> <ClCompile Include="..\..\src\leveldb\db\memtable.cc" /> <ClCompile Include="..\..\src\leveldb\db\repair.cc" /> <ClCompile Include="..\..\src\leveldb\db\table_cache.cc" /> <ClCompile Include="..\..\src\leveldb\db\version_edit.cc" /> <ClCompile Include="..\..\src\leveldb\db\version_set.cc" /> <ClCompile Include="..\..\src\leveldb\db\write_batch.cc" /> <ClCompile Include="..\..\src\leveldb\helpers\memenv\memenv.cc" /> <ClCompile Include="..\..\src\leveldb\port\port_posix_sse.cc" /> <ClCompile Include="..\..\src\leveldb\port\port_win.cc" /> <ClCompile Include="..\..\src\leveldb\table\block.cc" /> <ClCompile Include="..\..\src\leveldb\table\block_builder.cc" /> <ClCompile Include="..\..\src\leveldb\table\filter_block.cc" /> <ClCompile Include="..\..\src\leveldb\table\format.cc" /> <ClCompile Include="..\..\src\leveldb\table\iterator.cc" /> <ClCompile Include="..\..\src\leveldb\table\merger.cc" /> <ClCompile Include="..\..\src\leveldb\table\table.cc" /> <ClCompile Include="..\..\src\leveldb\table\table_builder.cc" /> <ClCompile Include="..\..\src\leveldb\table\two_level_iterator.cc" /> <ClCompile Include="..\..\src\leveldb\util\arena.cc" /> <ClCompile Include="..\..\src\leveldb\util\bloom.cc" /> <ClCompile Include="..\..\src\leveldb\util\cache.cc" /> <ClCompile Include="..\..\src\leveldb\util\coding.cc" /> <ClCompile Include="..\..\src\leveldb\util\comparator.cc" /> <ClCompile Include="..\..\src\leveldb\util\crc32c.cc" /> <ClCompile Include="..\..\src\leveldb\util\env.cc" /> <ClCompile Include="..\..\src\leveldb\util\env_win.cc" /> <ClCompile Include="..\..\src\leveldb\util\filter_policy.cc" /> <ClCompile Include="..\..\src\leveldb\util\hash.cc" /> <ClCompile Include="..\..\src\leveldb\util\histogram.cc" /> <ClCompile Include="..\..\src\leveldb\util\logging.cc" /> <ClCompile Include="..\..\src\leveldb\util\options.cc" /> <ClCompile Include="..\..\src\leveldb\util\status.cc" /> </ItemGroup> <ItemDefinitionGroup> <ClCompile> <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;LEVELDB_PLATFORM_WINDOWS;LEVELDB_ATOMIC_PRESENT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <DisableSpecificWarnings>4244;4267;4312;</DisableSpecificWarnings> <AdditionalIncludeDirectories>..\..\src\leveldb;..\..\src\leveldb\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> </ItemDefinitionGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="..\common.vcxproj" /> </Project>
{ "pile_set_name": "Github" }
#ifndef CAFFE_MEMORY_DATA_LAYER_HPP_ #define CAFFE_MEMORY_DATA_LAYER_HPP_ #include <vector> #include "caffe/blob.hpp" #include "caffe/layer.hpp" #include "caffe/proto/caffe.pb.h" #include "caffe/layers/base_data_layer.hpp" namespace caffe { /** * @brief Provides data to the Net from memory. * * TODO(dox): thorough documentation for Forward and proto params. */ template <typename Dtype> class MemoryDataLayer : public BaseDataLayer<Dtype> { public: explicit MemoryDataLayer(const LayerParameter& param) : BaseDataLayer<Dtype>(param), has_new_data_(false) {} virtual void DataLayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top); virtual inline const char* type() const { return "MemoryData"; } virtual inline int ExactNumBottomBlobs() const { return 0; } virtual inline int ExactNumTopBlobs() const { return 2; } virtual void AddDatumVector(const vector<Datum>& datum_vector); #ifdef USE_OPENCV virtual void AddMatVector(const vector<cv::Mat>& mat_vector, const vector<int>& labels); #endif // USE_OPENCV // Reset should accept const pointers, but can't, because the memory // will be given to Blob, which is mutable void Reset(Dtype* data, Dtype* label, int n); void set_batch_size(int new_size); int batch_size() { return batch_size_; } int channels() { return channels_; } int height() { return height_; } int width() { return width_; } protected: virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top); int batch_size_, channels_, height_, width_, size_; Dtype* data_; Dtype* labels_; int n_; size_t pos_; Blob<Dtype> added_data_; Blob<Dtype> added_label_; bool has_new_data_; }; } // namespace caffe #endif // CAFFE_MEMORY_DATA_LAYER_HPP_
{ "pile_set_name": "Github" }
open Tyxml; let markup = <Layout title="login"> <div className="max-w-sm w-full lg:max-w-full lg:flex"> <div className="h-48 lg:h-auto lg:w-48 flex-none bg-cover rounded-t lg:rounded-t-none lg:rounded-l text-center overflow-hidden" style="background-image: url('https://placekitten.com/400/200')" title="Cute cat" /> <div className="border-r border-b border-l border-gray-400 lg:border-l-0 lg:border-t lg:border-gray-400 bg-white rounded-b lg:rounded-b-none lg:rounded-r p-4 flex flex-col justify-between leading-normal"> <div className="mb-8"> <p className="text-sm text-gray-600 flex items-center"> <svg className="fill-current text-gray-500 w-3 h-3 mr-2" viewBox="0 0 20 20"> <path d="M4 8V6a6 6 0 1 1 12 0v2h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h1zm5 6.73V17h2v-2.27a2 2 0 1 0-2 0zM7 6v2h6V6a3 3 0 0 0-6 0z" /> </svg> {Html.txt("Members only")} </p> <div className="text-gray-900 font-bold text-xl mb-2"> {Html.txt("Can coffee make you a better developer?")} </div> <p className="text-gray-700 text-base"> {Html.txt( "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.", )} </p> </div> </div> <p className="text-center text-gray-500 text-xs"> {Html.txt("&copy;2020 Acme Corp. All rights reserved.")} </p> </div> </Layout>; let handler = _request => { Render.respond_html(markup); };
{ "pile_set_name": "Github" }
// Version 2 import QtQuick 2.0 import QtQuick.Controls 1.0 import QtQuick.Layouts 1.0 import org.kde.kirigami 2.0 as Kirigami GridLayout { id: configDimension columnSpacing: 0 rowSpacing: 0 property int orientation: Qt.Horizontal property color lineColor: "#000" property int lineThickness: 2 * Kirigami.Units.devicePixelRatio property alias configKey: configSpinBox.configKey property alias configValue: configSpinBox.configValue property alias horizontalAlignment: configSpinBox.horizontalAlignment property alias maximumValue: configSpinBox.maximumValue property alias minimumValue: configSpinBox.minimumValue property alias prefix: configSpinBox.prefix property alias stepSize: configSpinBox.stepSize property alias suffix: configSpinBox.suffix property alias value: configSpinBox.value property alias before: configSpinBox.before property alias after: configSpinBox.after states: [ State { name: "horizontal" when: orientation == Qt.Horizontal PropertyChanges { target: configDimension rows: 1 } PropertyChanges { target: lineA implicitWidth: configDimension.lineThickness Layout.fillHeight: true } PropertyChanges { target: lineSpanA Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter implicitHeight: configDimension.lineThickness } PropertyChanges { target: configSpinBox Layout.alignment: Qt.AlignVCenter } PropertyChanges { target: lineSpanB Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter implicitHeight: configDimension.lineThickness } PropertyChanges { target: lineB implicitWidth: configDimension.lineThickness Layout.fillHeight: true } } , State { name: "vertical" when: orientation == Qt.Vertical PropertyChanges { target: configDimension columns: 1 } PropertyChanges { target: lineA Layout.alignment: Qt.AlignHCenter implicitHeight: configDimension.lineThickness implicitWidth: configSpinBox.implicitHeight } PropertyChanges { target: lineSpanA Layout.fillHeight: true Layout.alignment: Qt.AlignHCenter implicitWidth: configDimension.lineThickness } PropertyChanges { target: configSpinBox Layout.alignment: Qt.AlignHCenter } PropertyChanges { target: lineSpanB Layout.fillHeight: true Layout.alignment: Qt.AlignHCenter implicitWidth: configDimension.lineThickness } PropertyChanges { target: lineB Layout.alignment: Qt.AlignHCenter implicitHeight: configDimension.lineThickness implicitWidth: configSpinBox.implicitHeight } } ] Rectangle { id: lineA color: configDimension.lineColor } Rectangle { id: lineSpanA color: configDimension.lineColor } ConfigSpinBox { id: configSpinBox } Rectangle { id: lineSpanB color: configDimension.lineColor } Rectangle { id: lineB color: configDimension.lineColor } }
{ "pile_set_name": "Github" }
#ifndef _melder_str32_h_ #define _melder_str32_h_ /* melder_str32.h * * Copyright (C) 1992-2018 Paul Boersma * * This code 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 code is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this work. If not, see <http://www.gnu.org/licenses/>. */ inline static integer str16len (conststring16 string) noexcept { const char16 *p = & string [0]; while (*p != u'\0') ++ p; return p - string; } inline static mutablestring16 str16cpy (mutablestring16 target, conststring16 source) noexcept { char16 *p = & target [0]; while (* source != u'\0') * p ++ = * source ++; *p = u'\0'; return target; } inline static integer str32len (conststring32 string) noexcept { const char32 *p = & string [0]; while (*p != U'\0') ++ p; return p - string; } inline static mutablestring32 str32cpy (mutablestring32 target, conststring32 source) noexcept { char32 *p = & target [0]; while (* source != U'\0') * p ++ = * source ++; *p = U'\0'; return target; } inline static mutablestring32 str32cat (mutablestring32 target, conststring32 source) noexcept { char32 *p = & target [0]; while (*p != U'\0') ++ p; while (* source != U'\0') * p ++ = * source ++; *p = U'\0'; return target; } inline static char32 * stp32cpy (mutablestring32 target, conststring32 source) noexcept { char32 *p = & target [0]; while (* source != U'\0') * p ++ = * source ++; *p = U'\0'; return p; } inline static mutablestring32 str32ncpy (mutablestring32 target, conststring32 source, integer n) noexcept { char32 *p = & target [0]; for (; n > 0 && *source != U'\0'; -- n) * p ++ = * source ++; for (; n > 0; -- n) * p ++ = U'\0'; return target; } inline static int str32cmp (conststring32 string1, conststring32 string2) noexcept { for (;; ++ string1, ++ string2) { int32 diff = (int32) *string1 - (int32) *string2; if (diff) return (int) diff; if (*string1 == U'\0') return 0; } } inline static int str32cmp_caseInsensitive (conststring32 string1, conststring32 string2) noexcept { for (;; ++ string1, ++ string2) { int32 diff = (int32) Melder_toLowerCase (*string1) - (int32) Melder_toLowerCase (*string2); if (diff) return (int) diff; if (*string1 == U'\0') return 0; } } inline static int str32cmp_optionallyCaseSensitive (conststring32 string1, conststring32 string2, bool caseSensitive) noexcept { return caseSensitive ? str32cmp (string1, string2) : str32cmp_caseInsensitive (string1, string2); } inline static int str32ncmp (conststring32 string1, conststring32 string2, integer n) noexcept { for (; n > 0; -- n, ++ string1, ++ string2) { int32 diff = (int32) *string1 - (int32) *string2; if (diff) return (int) diff; if (*string1 == U'\0') return 0; } return 0; } inline static int str32ncmp_caseInsensitive (conststring32 string1, conststring32 string2, integer n) noexcept { for (; n > 0; -- n, ++ string1, ++ string2) { int32 diff = (int32) Melder_toLowerCase (*string1) - (int32) Melder_toLowerCase (*string2); if (diff) return (int) diff; if (*string1 == U'\0') return 0; } return 0; } inline static int str32ncmp_optionallyCaseSensitive (conststring32 string1, conststring32 string2, integer n, bool caseSensitive) noexcept { return caseSensitive ? str32ncmp (string1, string2, n) : str32ncmp_caseInsensitive (string1, string2, n); } int Melder_cmp (conststring32 string1, conststring32 string2); // regards null string as empty string int Melder_cmp_caseInsensitive (conststring32 string1, conststring32 string2); int Melder_ncmp (conststring32 string1, conststring32 string2, integer n); int Melder_ncmp_caseInsensitive (conststring32 string1, conststring32 string2, integer n); #define str32equ ! str32cmp #define str32nequ ! str32ncmp #define Melder_equ ! Melder_cmp #define str32equ_caseInsensitive ! str32cmp_caseInsensitive #define str32nequ_caseInsensitive ! str32ncmp_caseInsensitive #define Melder_equ_caseInsensitive ! Melder_cmp_caseInsensitive #define str32equ_optionallyCaseSensitive ! str32cmp_optionallyCaseSensitive #define str32nequ_optionallyCaseSensitive ! str32ncmp_optionallyCaseSensitive bool Melder_equ_firstCharacterCaseInsensitive (conststring32 string1, conststring32 string2); #define Melder_nequ ! Melder_ncmp #define Melder_nequ_caseInsensitive ! Melder_ncmp_caseInsensitive inline static char32 * str32chr (conststring32 string, char32 kar) noexcept { for (; *string != kar; ++ string) { if (*string == U'\0') return nullptr; } return (char32 *) string; } inline static char32 * str32chr_caseInsensitive (conststring32 string, char32 kar) noexcept { kar = Melder_toLowerCase (kar); for (; Melder_toLowerCase (*string) != kar; ++ string) { if (*string == U'\0') return nullptr; } return (char32 *) string; } inline static char32 * str32rchr (conststring32 string, char32 kar) noexcept { char32 *result = nullptr; for (; *string != U'\0'; ++ string) { if (*string == kar) result = (char32 *) string; } return result; } inline static char32 * str32rchr_caseInsensitive (conststring32 string, char32 kar) noexcept { kar = Melder_toLowerCase (kar); char32 *result = nullptr; for (; *string != U'\0'; ++ string) { if (Melder_toLowerCase (*string) == kar) result = (char32 *) string; } return result; } inline static char32 * str32str (conststring32 string, conststring32 find) noexcept { integer length = str32len (find); if (length == 0) return (char32 *) string; char32 firstCharacter = * find ++; // optimization do { char32 kar; do { kar = * string ++; if (kar == U'\0') return nullptr; } while (kar != firstCharacter); } while (str32ncmp (string, find, length - 1)); return (char32 *) (string - 1); } inline static char32 * str32str_caseInsensitive (conststring32 string, conststring32 find) noexcept { integer length = str32len (find); if (length == 0) return (char32 *) string; char32 firstCharacter = Melder_toLowerCase (* find ++); // optimization do { char32 kar; do { kar = Melder_toLowerCase (* string ++); if (kar == U'\0') return nullptr; } while (kar != firstCharacter); } while (str32ncmp_caseInsensitive (string, find, length - 1)); return (char32 *) (string - 1); } inline static char32 * str32str_optionallyCaseSensitive (conststring32 string, conststring32 find, bool caseSensitive) noexcept { return caseSensitive ? str32str (string, find) : str32str_caseInsensitive (string, find); } inline static integer str32spn (conststring32 string1, conststring32 string2) noexcept { const char32 *p = & string1 [0]; char32 kar1, kar2; cont: kar1 = * p ++; for (const char32 *q = & string2 [0]; (kar2 = * q ++) != U'\0';) if (kar2 == kar1) goto cont; return p - 1 - string1; } /* End of file melder_str32.h */ #endif
{ "pile_set_name": "Github" }
/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors * * 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. */ 'use strict'; function Console() { return this; } Console.prototype.log = Console.prototype.info = Console.prototype.warn = Console.prototype.error = function() { /* Do Nothing */ }; module.exports = new Console();
{ "pile_set_name": "Github" }
#!/bin/sh # ---------------------------------------------------------------------------- # 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. # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- # Maven2 Start Up Batch script # # Required ENV vars: # ------------------ # JAVA_HOME - location of a JDK home dir # # Optional ENV vars # ----------------- # M2_HOME - location of maven2's installed home dir # MAVEN_OPTS - parameters passed to the Java VM when running Maven # e.g. to debug Maven itself, use # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 # MAVEN_SKIP_RC - flag to disable loading of mavenrc files # ---------------------------------------------------------------------------- if [ -z "$MAVEN_SKIP_RC" ] ; then if [ -f /etc/mavenrc ] ; then . /etc/mavenrc fi if [ -f "$HOME/.mavenrc" ] ; then . "$HOME/.mavenrc" fi fi # OS specific support. $var _must_ be set to either true or false. cygwin=false; darwin=false; mingw=false case "`uname`" in CYGWIN*) cygwin=true ;; MINGW*) mingw=true;; Darwin*) darwin=true # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home # See https://developer.apple.com/library/mac/qa/qa1170/_index.html if [ -z "$JAVA_HOME" ]; then if [ -x "/usr/libexec/java_home" ]; then export JAVA_HOME="`/usr/libexec/java_home`" else export JAVA_HOME="/Library/Java/Home" fi fi ;; esac if [ -z "$JAVA_HOME" ] ; then if [ -r /etc/gentoo-release ] ; then JAVA_HOME=`java-config --jre-home` fi fi if [ -z "$M2_HOME" ] ; then ## resolve links - $0 may be a link to maven's home PRG="$0" # need this for relative symlinks while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG="`dirname "$PRG"`/$link" fi done saveddir=`pwd` M2_HOME=`dirname "$PRG"`/.. # make it fully qualified M2_HOME=`cd "$M2_HOME" && pwd` cd "$saveddir" # echo Using m2 at $M2_HOME fi # For Cygwin, ensure paths are in UNIX format before anything is touched if $cygwin ; then [ -n "$M2_HOME" ] && M2_HOME=`cygpath --unix "$M2_HOME"` [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` fi # For Migwn, ensure paths are in UNIX format before anything is touched if $mingw ; then [ -n "$M2_HOME" ] && M2_HOME="`(cd "$M2_HOME"; pwd)`" [ -n "$JAVA_HOME" ] && JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" # TODO classpath? fi if [ -z "$JAVA_HOME" ]; then javaExecutable="`which javac`" if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then # readlink(1) is not available as standard on Solaris 10. readLink=`which readlink` if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then if $darwin ; then javaHome="`dirname \"$javaExecutable\"`" javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" else javaExecutable="`readlink -f \"$javaExecutable\"`" fi javaHome="`dirname \"$javaExecutable\"`" javaHome=`expr "$javaHome" : '\(.*\)/bin'` JAVA_HOME="$javaHome" export JAVA_HOME fi fi fi if [ -z "$JAVACMD" ] ; then if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi else JAVACMD="`which java`" fi fi if [ ! -x "$JAVACMD" ] ; then echo "Error: JAVA_HOME is not defined correctly." >&2 echo " We cannot execute $JAVACMD" >&2 exit 1 fi if [ -z "$JAVA_HOME" ] ; then echo "Warning: JAVA_HOME environment variable is not set." fi CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher # traverses directory structure from process work directory to filesystem root # first directory with .mvn subdirectory is considered project base directory find_maven_basedir() { if [ -z "$1" ] then echo "Path not specified to find_maven_basedir" return 1 fi basedir="$1" wdir="$1" while [ "$wdir" != '/' ] ; do if [ -d "$wdir"/.mvn ] ; then basedir=$wdir break fi # workaround for JBEAP-8937 (on Solaris 10/Sparc) if [ -d "${wdir}" ]; then wdir=`cd "$wdir/.."; pwd` fi # end of workaround done echo "${basedir}" } # concatenates all lines of a file concat_lines() { if [ -f "$1" ]; then echo "$(tr -s '\n' ' ' < "$1")" fi } BASE_DIR=`find_maven_basedir "$(pwd)"` if [ -z "$BASE_DIR" ]; then exit 1; fi export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} echo $MAVEN_PROJECTBASEDIR MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" # For Cygwin, switch paths to Windows format before running java if $cygwin; then [ -n "$M2_HOME" ] && M2_HOME=`cygpath --path --windows "$M2_HOME"` [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"` [ -n "$MAVEN_PROJECTBASEDIR" ] && MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` fi WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain exec "$JAVACMD" \ $MAVEN_OPTS \ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
{ "pile_set_name": "Github" }
--- layout: default title: mudlib / export_uid --- ### NAME export_uid() - set the uid of another object ### SYNOPSIS int export_uid( object ob ); ### DESCRIPTION Set the uid of <ob> to the effective uid of this_object(). It is only possible when <ob> has an effective uid of 0. ### SEE ALSO this_object(3), seteuid(3), getuid(3), geteuid(3), previous_object(3), valid_seteuid(4)
{ "pile_set_name": "Github" }
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sts=4 et sw=4 tw=99: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef jit_arm_MoveEmitter_arm_h #define jit_arm_MoveEmitter_arm_h #include "jit/MacroAssembler.h" #include "jit/MoveResolver.h" namespace js { namespace jit { class CodeGenerator; class MoveEmitterARM { uint32_t inCycle_; MacroAssemblerARMCompat& masm; // Original stack push value. uint32_t pushedAtStart_; // These store stack offsets to spill locations, snapshotting // codegen->framePushed_ at the time they were allocated. They are -1 if no // stack space has been allocated for that particular spill. int32_t pushedAtCycle_; int32_t pushedAtSpill_; // These are registers that are available for temporary use. They may be // assigned InvalidReg. If no corresponding spill space has been assigned, // then these registers do not need to be spilled. Register spilledReg_; FloatRegister spilledFloatReg_; void assertDone(); Register tempReg(); FloatRegister tempFloatReg(); Operand cycleSlot(uint32_t slot, uint32_t subslot) const; Operand spillSlot() const; Operand toOperand(const MoveOperand& operand, bool isFloat) const; void emitMove(const MoveOperand& from, const MoveOperand& to); void emitFloat32Move(const MoveOperand& from, const MoveOperand& to); void emitDoubleMove(const MoveOperand& from, const MoveOperand& to); void breakCycle(const MoveOperand& from, const MoveOperand& to, MoveOp::Type type, uint32_t slot); void completeCycle(const MoveOperand& from, const MoveOperand& to, MoveOp::Type type, uint32_t slot); void emit(const MoveOp& move); public: MoveEmitterARM(MacroAssemblerARMCompat& masm); ~MoveEmitterARM(); void emit(const MoveResolver& moves); void finish(); void setScratchRegister(Register reg) {} }; typedef MoveEmitterARM MoveEmitter; } // namespace jit } // namespace js #endif /* jit_arm_MoveEmitter_arm_h */
{ "pile_set_name": "Github" }
// Boost.Range library // // Copyright Thorsten Ottosen 2003-2004. Use, modification and // distribution is subject to 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) // // For more information, see http://www.boost.org/libs/range/ // #ifndef BOOST_RANGE_EMPTY_HPP #define BOOST_RANGE_EMPTY_HPP #if defined(_MSC_VER) # pragma once #endif #include <boost/range/config.hpp> #include <boost/range/begin.hpp> #include <boost/range/end.hpp> namespace boost { template< class T > inline bool empty( const T& r ) { return boost::begin( r ) == boost::end( r ); } } // namespace 'boost' #endif
{ "pile_set_name": "Github" }
msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: \n" "POT-Creation-Date: \n" "PO-Revision-Date: \n" "Last-Translator: Maxim Ganetsky <maxkill@mail.ru>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" "Language: ru\n" "X-Generator: Poedit 1.7.7\n" #: tachartstrconsts.descolor msgid "Color" msgstr "Цвет" #: tachartstrconsts.desdatapointeditor msgid "DataPoints editor" msgstr "Редактор величин" #: tachartstrconsts.desdeleterow msgid "Delete row" msgstr "Удалить строку" #: tachartstrconsts.desinsertrow msgid "Insert row" msgstr "Вставить строку" #: tachartstrconsts.destext msgid "Text" msgstr "Текст" #: tachartstrconsts.rsadd msgid "Add" msgstr "Добавить" #: tachartstrconsts.rsareaseries msgid "Area series" msgstr "Диаграмма с областями" #: tachartstrconsts.rsautoscale msgid "Auto scale" msgstr "Автоматический масштаб" #: tachartstrconsts.rsbarseries msgid "Bar series" msgstr "Гистограмма" #: tachartstrconsts.rsbottom msgid "Bottom" msgstr "Нижняя" #: tachartstrconsts.rsboxandwhiskerseries msgid "Box-and-whiskers series" msgstr "Диаграмма размаха" #: tachartstrconsts.rsbsbdiagonal msgid "backward-diagonal hatch" msgstr "обратная диагональная штриховка" #: tachartstrconsts.rsbsclear msgctxt "tachartstrconsts.rsbsclear" msgid "no fill" msgstr "нет заливки" #: tachartstrconsts.rsbscross msgid "crossed" msgstr "перекрёстная штриховка" #: tachartstrconsts.rsbsdiagcross msgid "diagonally crossed" msgstr "диагональная перекрёстная штриховка" #: tachartstrconsts.rsbsfdiagonal msgid "forward-diagonal hatch" msgstr "прямая диагональная штриховка" #: tachartstrconsts.rsbshorizontal msgid "horizontally hatched" msgstr "горизонтальная штриховка" #: tachartstrconsts.rsbsimage msgid "image fill" msgstr "заливка изображением" #: tachartstrconsts.rsbspattern msgid "pattern fill" msgstr "заливка узором" #: tachartstrconsts.rsbsplineseries msgid "B-Spline series" msgstr "Диаграмма с B-сплайнами" #: tachartstrconsts.rsbssolid msgid "solid fill" msgstr "сплошная заливка" #: tachartstrconsts.rsbsvertical msgid "vertically hatched" msgstr "вертикальная штриховка" #: tachartstrconsts.rsbubbleseries msgid "Bubble series" msgstr "Пузырьковая диаграмма" #: tachartstrconsts.rscirclesymbol msgid "Circle" msgstr "Круг" #: tachartstrconsts.rscolormapseries msgid "Color map series" msgstr "Диаграмма с картой цветов" #: tachartstrconsts.rsconstantline msgid "Constant line" msgstr "Линия постоянной" #: tachartstrconsts.rscrosssymbol msgid "Plus" msgstr "Плюс" #: tachartstrconsts.rscubicsplineseries msgid "Cubic spline series" msgstr "Диаграмма с кубическими сплайнами" #: tachartstrconsts.rscumulativenormaldistribution msgid "Cumulative normal distribution" msgstr "Масштаб нормального распределения" #: tachartstrconsts.rsdatapointclick msgid "Data point click" msgstr "Щелчок по величине" #: tachartstrconsts.rsdatapointcrosshair msgid "Data point crosshair" msgstr "Перекрестие для величины" #: tachartstrconsts.rsdatapointdrag msgid "Data point drag" msgstr "Перетаскивание величины" #: tachartstrconsts.rsdatapointhint msgid "Data point hint" msgstr "Всплывающая подсказка для величины" #: tachartstrconsts.rsdelete msgid "Delete" msgstr "Удалить" #: tachartstrconsts.rsdiagcrosssymbol msgid "Cross" msgstr "Крест" #: tachartstrconsts.rsdiamondsymbol msgid "Diamond" msgstr "Ромб" #: tachartstrconsts.rsdistancemeasurement msgid "Distance measurement" msgstr "Измерение расстояния" #: tachartstrconsts.rsdowntrianglesymbol msgid "Down triangle" msgstr "Треугольник с вершиной снизу" #: tachartstrconsts.rsfieldseries msgid "Vector field series" msgstr "Диаграмма с векторным полем" #: tachartstrconsts.rsfullstarsymbol msgid "Star (full)" msgstr "Звезда (полная)" #: tachartstrconsts.rsfunctionseries msgid "Function series" msgstr "Диаграмма по функции" #: tachartstrconsts.rshexagonsymbol msgid "Hexagon" msgstr "Шестиугольник" #: tachartstrconsts.rshidden msgid "hidden" msgstr "скрытая" #: tachartstrconsts.rshighbracketsymbol msgid "High bracket" msgstr "Скобка сверху" #: tachartstrconsts.rshorbarsymbol msgid "Horizontal bar" msgstr "Горизонтальная черта" #: tachartstrconsts.rsinvalidlogbase msgid "Logarithm base must be > 0 and <> 1." msgstr "Основание логарифма должно быть больше нуля и не равно единице." #: tachartstrconsts.rsinverted msgid "inverted" msgstr "обратная" #: tachartstrconsts.rsleastsquaresfitseries msgid "Least-squares fit series" msgstr "Диаграмма по методу наименьших квадратов" #: tachartstrconsts.rsleft msgid "Left" msgstr "Левая" #: tachartstrconsts.rsleftbracketsymbol msgid "Left bracket" msgstr "Скобка слева" #: tachartstrconsts.rslefttrianglesymbol msgid "Left triangle" msgstr "Треугольник с вершиной слева" #: tachartstrconsts.rslinear msgid "Linear" msgstr "Линейный масштаб" #: tachartstrconsts.rslineseries msgid "Line series" msgstr "График" #: tachartstrconsts.rslogarithmic msgid "Logarithmic" msgstr "Логарифмический масштаб" #: tachartstrconsts.rslowbracketsymbol msgid "Low bracket" msgstr "Скобка снизу" #: tachartstrconsts.rsmanhattanplotseries msgid "Manhattan plot series" msgstr "Манхэттенская диаграмма" #: tachartstrconsts.rsmovedown msgid "Down" msgstr "Вниз" #: tachartstrconsts.rsmoveup msgid "Up" msgstr "Вверх" #: tachartstrconsts.rsnosymbol msgid "(none)" msgstr "(нет)" #: tachartstrconsts.rsopenhighlowcloseseries msgid "Open-high-low-close series" msgstr "Биржевая диаграмма" #: tachartstrconsts.rspanningbyclick msgid "Panning by click" msgstr "Панорамирование щелчком" #: tachartstrconsts.rspanningbydrag msgid "Panning by drag" msgstr "Панорамирование перетаскиванием" #: tachartstrconsts.rspanningbymousewheel msgid "Panning by mouse wheel" msgstr "Панорамирование колёсиком мыши" #: tachartstrconsts.rsparametriccurveseries msgid "Parametric curve series" msgstr "Диаграмма с параметрическими кривыми" #: tachartstrconsts.rspieseries msgid "Pie series" msgstr "Круговая диаграмма" #: tachartstrconsts.rspointsymbol msgid "Point" msgstr "Точка" #: tachartstrconsts.rspolarseries msgid "Polar series" msgstr "Лепестковая диаграмма" #: tachartstrconsts.rspsclear msgctxt "tachartstrconsts.rspsclear" msgid "no line" msgstr "нет линии" #: tachartstrconsts.rspsdash msgid "dashed line" msgstr "штриховая линия" #: tachartstrconsts.rspsdashdot msgid "dash-dot" msgstr "штрихпунктирная линия" #: tachartstrconsts.rspsdashdotdot msgid "dash-dot-dot" msgstr "штрихпунктирная линия с двумя точками" #: tachartstrconsts.rspsdot msgid "dotted line" msgstr "пунктирная линия" #: tachartstrconsts.rspsinsideframe msgid "solid (inside frame)" msgstr "сплошная линия (внутри рамки)" #: tachartstrconsts.rspspattern msgid "patterned line" msgstr "линия с узором" #: tachartstrconsts.rspssolid msgid "solid line" msgstr "сплошная линия" #: tachartstrconsts.rsrectanglesymbol msgid "Rectangle" msgstr "Прямоугольник" #: tachartstrconsts.rsright msgid "Right" msgstr "Правая" #: tachartstrconsts.rsrightbracketsymbol msgid "Right bracket" msgstr "Скобка справа" #: tachartstrconsts.rsrighttrianglesymbol msgid "Right triangle" msgstr "Треугольник с вершиной справа" #: tachartstrconsts.rsstarsymbol msgid "Star (lines)" msgstr "Звезда (из линий)" #: tachartstrconsts.rstop msgid "Top" msgstr "Верхняя" #: tachartstrconsts.rstrianglesymbol msgid "Triangle" msgstr "Треугольник" #: tachartstrconsts.rsuserdefined msgctxt "tachartstrconsts.rsuserdefined" msgid "User-defined" msgstr "Пользовательский масштаб" #: tachartstrconsts.rsuserdefinedtool msgctxt "tachartstrconsts.rsuserdefinedtool" msgid "User-defined" msgstr "Пользовательское средство" #: tachartstrconsts.rsuserdrawnseries msgid "User-drawn series" msgstr "Пользовательская диаграмма" #: tachartstrconsts.rsvertbarsymbol msgid "Vertical bar" msgstr "Вертикальная черта" #: tachartstrconsts.rszoombyclick msgid "Zoom by click" msgstr "Изменение масштаба щелчком" #: tachartstrconsts.rszoombydrag msgid "Zoom by drag" msgstr "Изменение масштаба перетаскиванием" #: tachartstrconsts.rszoombymousewheel msgid "Zoom by mouse-wheel" msgstr "Изменение масштаба колёсиком мыши" #: tachartstrconsts.sesserieseditortitle msgid "Edit series" msgstr "Редактор диаграмм" #: tachartstrconsts.tasaxistransformseditortitle msgid "Edit axis transformations" msgstr "Редактор масштабов осей" #: tachartstrconsts.tasfailedsubcomponentrename msgid "Failed to rename components: %s" msgstr "Невозможно переименовать компоненты: %s" #: tachartstrconsts.tastoolseditortitle msgid "Edit tools" msgstr "Редактор средств диаграмм"
{ "pile_set_name": "Github" }
// Copyright 2014 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. // IMPLEMENTATION NOTE: To avoid a package loop, this file is in three places: // ssh/, ssh/agent, and ssh/test/. It should be kept in sync across all three // instances. package agent import ( "crypto/rand" "fmt" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/testdata" ) var ( testPrivateKeys map[string]interface{} testSigners map[string]ssh.Signer testPublicKeys map[string]ssh.PublicKey ) func init() { var err error n := len(testdata.PEMBytes) testPrivateKeys = make(map[string]interface{}, n) testSigners = make(map[string]ssh.Signer, n) testPublicKeys = make(map[string]ssh.PublicKey, n) for t, k := range testdata.PEMBytes { testPrivateKeys[t], err = ssh.ParseRawPrivateKey(k) if err != nil { panic(fmt.Sprintf("Unable to parse test key %s: %v", t, err)) } testSigners[t], err = ssh.NewSignerFromKey(testPrivateKeys[t]) if err != nil { panic(fmt.Sprintf("Unable to create signer for test key %s: %v", t, err)) } testPublicKeys[t] = testSigners[t].PublicKey() } // Create a cert and sign it for use in tests. testCert := &ssh.Certificate{ Nonce: []byte{}, // To pass reflect.DeepEqual after marshal & parse, this must be non-nil ValidPrincipals: []string{"gopher1", "gopher2"}, // increases test coverage ValidAfter: 0, // unix epoch ValidBefore: ssh.CertTimeInfinity, // The end of currently representable time. Reserved: []byte{}, // To pass reflect.DeepEqual after marshal & parse, this must be non-nil Key: testPublicKeys["ecdsa"], SignatureKey: testPublicKeys["rsa"], Permissions: ssh.Permissions{ CriticalOptions: map[string]string{}, Extensions: map[string]string{}, }, } testCert.SignCert(rand.Reader, testSigners["rsa"]) testPrivateKeys["cert"] = testPrivateKeys["ecdsa"] testSigners["cert"], err = ssh.NewCertSigner(testCert, testSigners["ecdsa"]) if err != nil { panic(fmt.Sprintf("Unable to create certificate signer: %v", err)) } }
{ "pile_set_name": "Github" }
train_ratio = 0.9 use_dict = True use_scaler = False init_emb = False split_contins = True samp_size = 100000 # samp_size = 0 import math, keras, datetime, pandas as pd, numpy as np, keras.backend as K import matplotlib.pyplot as plt, xgboost, operator, random, pickle, os from sklearn_pandas import DataFrameMapper from sklearn.preprocessing import LabelEncoder, Imputer, StandardScaler from keras.models import Model from keras.layers import merge, Input from keras.layers.core import Dense, Activation, Reshape, Flatten, Dropout from keras.layers.embeddings import Embedding from keras.optimizers import Adam from keras.layers.normalization import BatchNormalization from keras.regularizers import l2 # from keras import initializations # Keras 2 does not use this module np.set_printoptions(4) cfg = K.tf.ConfigProto() cfg.gpu_options.allow_growth = True K.set_session(K.tf.Session(config=cfg)) os.chdir('data/rossman') cat_var_dict = {'Store': 50, 'DayOfWeek': 6, 'Year': 2, 'Month': 6, 'Day': 10, 'StateHoliday': 3, 'CompetitionMonthsOpen': 2, 'Promo2Weeks': 1, 'StoreType': 2, 'Assortment': 3, 'PromoInterval': 3, 'CompetitionOpenSinceYear': 4, 'Promo2SinceYear': 4, 'State': 6, 'Week': 2, 'Events': 4, 'Promo_fw': 1, 'Promo_bw': 1, 'StateHoliday_fw': 1, 'StateHoliday_bw': 1, 'SchoolHoliday_fw': 1, 'SchoolHoliday_bw': 1} cats, contins = [o for n, o in np.load('vars.npz').items()] y = np.load('deps.npz').items()[0][1] if samp_size != 0: np.random.seed(42) idxs = sorted(np.random.choice(len(y), samp_size, replace=False)) cats = cats[idxs] contins = contins[idxs] y = y[idxs] n = len(y) train_size = int(n * train_ratio) contins_trn_orig, contins_val_orig = contins[:train_size], contins[train_size:] cats_trn, cats_val = cats[:train_size], cats[train_size:] y_trn, y_val = y[:train_size], y[train_size:] contin_map_fit = pickle.load(open('contin_maps.pickle', 'rb')) cat_map_fit = pickle.load(open('cat_maps.pickle', 'rb')) def cat_map_info(feat): return feat[0], len(feat[1].classes_) co_enc = StandardScaler().fit(contins_trn_orig) tf_contins_trn = co_enc.transform(contins_trn_orig) tf_contins_val = co_enc.transform(contins_val_orig) """ def rmspe(y_pred, targ = y_valid_orig): return math.sqrt(np.square((targ - y_pred)/targ).mean()) def log_max_inv(preds, mx = max_log_y): return np.exp(preds * mx) def normalize_inv(preds): return preds * ystd + ymean """ def split_cols(arr): return np.hsplit(arr, arr.shape[1]) def emb_init(shape, name=None): # - In Keras 2 the "initializations" module is not available. # - To keep here the custom initializer the code from Keras 1 "uniform" initializer is exploited # return initializations.uniform(shape, scale=0.6/shape[1], name=name) return K.variable(np.random.uniform(low=-2 / (shape[1] + 1), high=2 / (shape[1] + 1), size=shape), name=name) def get_emb(feat): name, c = cat_map_info(feat) if use_dict: c2 = cat_var_dict[name] else: c2 = (c + 2) // 3 if c2 > 50: c2 = 50 inp = Input((1,), dtype='int64', name=name + '_in') if init_emb: u = Flatten(name=name + '_flt')(Embedding(c, c2, input_length=1)(inp)) else: u = Flatten(name=name + '_flt')(Embedding(c, c2, input_length=1, init=emb_init)(inp)) return inp, u def get_contin(feat): name = feat[0][0] inp = Input((1,), name=name + '_in') return inp, Dense(1, name=name + '_d')(inp) def split_data(): if split_contins: map_train = split_cols(cats_trn) + split_cols(contins_trn) map_valid = split_cols(cats_val) + split_cols(contins_val) else: map_train = split_cols(cats_trn) + [contins_trn] map_valid = split_cols(cats_val) + [contins_val] return (map_train, map_valid) def get_contin_one(): n_contin = contins_trn.shape[1] contin_inp = Input((n_contin,), name='contin') contin_out = BatchNormalization()(contin_inp) return contin_inp, contin_out def train(model, map_train, map_valid, bs=128, ne=10): return model.fit(map_train, y_trn, batch_size=bs, nb_epoch=ne, verbose=0, validation_data=(map_valid, y_val)) def get_model(): if split_contins: conts = [get_contin(feat) for feat in contin_map_fit.features] cont_out = [d for inp, d in conts] cont_inp = [inp for inp, d in conts] else: contin_inp, contin_out = get_contin_one() cont_out = [contin_out] cont_inp = [contin_inp] embs = [get_emb(feat) for feat in cat_map_fit.features] x = merge([emb for inp, emb in embs] + cont_out, mode='concat') x = Dropout(0.02)(x) x = Dense(1000, activation='relu', init='uniform')(x) x = Dense(500, activation='relu', init='uniform')(x) x = Dense(1, activation='sigmoid')(x) model = Model([inp for inp, emb in embs] + cont_inp, x) model.compile('adam', 'mean_absolute_error') # model.compile(Adam(), 'mse') return model for split_contins in [True, False]: for use_dict in [True, False]: for use_scaler in [True, False]: for init_emb in [True, False]: print({'split_contins': split_contins, 'use_dict': use_dict, 'use_scaler': use_scaler, 'init_emb': init_emb}) if use_scaler: contins_trn = tf_contins_trn contins_val = tf_contins_val else: contins_trn = contins_trn_orig contins_val = contins_val_orig map_train, map_valid = split_data() model = get_model() hist = np.array(train(model, map_train, map_valid, 128, 10) .history['val_loss']) print(hist) print(hist.min())
{ "pile_set_name": "Github" }
[ 0, -120.0, 40.0, -110.0, 50.0, 300, -125.0, 40.0, -110.0, 50.0, 600, -125.0, 30.0, -110.0, 45.0 ]
{ "pile_set_name": "Github" }
#include "f2c.h" #include "fio.h" #ifdef __cplusplus extern "C" { #endif uiolen f__reclen; int #ifdef KR_headers do_us(number,ptr,len) ftnint *number; char *ptr; ftnlen len; #else do_us(ftnint *number, char *ptr, ftnlen len) #endif { if(f__reading) { f__recpos += (int)(*number * len); if(f__recpos>f__reclen) err(f__elist->cierr, 110, "do_us"); if (fread(ptr,(int)len,(int)(*number),f__cf) != *number) err(f__elist->ciend, EOF, "do_us"); return(0); } else { f__reclen += *number * len; (void) fwrite(ptr,(int)len,(int)(*number),f__cf); return(0); } } #ifdef KR_headers integer do_ud(number,ptr,len) ftnint *number; char *ptr; ftnlen len; #else integer do_ud(ftnint *number, char *ptr, ftnlen len) #endif { f__recpos += (int)(*number * len); if(f__recpos > f__curunit->url && f__curunit->url!=1) err(f__elist->cierr,110,"do_ud"); if(f__reading) { #ifdef Pad_UDread #ifdef KR_headers int i; #else size_t i; #endif if (!(i = fread(ptr,(int)len,(int)(*number),f__cf)) && !(f__recpos - *number*len)) err(f__elist->cierr,EOF,"do_ud") if (i < *number) memset(ptr + i*len, 0, (*number - i)*len); return 0; #else if(fread(ptr,(int)len,(int)(*number),f__cf) != *number) err(f__elist->cierr,EOF,"do_ud") else return(0); #endif } (void) fwrite(ptr,(int)len,(int)(*number),f__cf); return(0); } #ifdef KR_headers integer do_uio(number,ptr,len) ftnint *number; char *ptr; ftnlen len; #else integer do_uio(ftnint *number, char *ptr, ftnlen len) #endif { if(f__sequential) return(do_us(number,ptr,len)); else return(do_ud(number,ptr,len)); } #ifdef __cplusplus } #endif
{ "pile_set_name": "Github" }
# parlai.core.metrics ```{eval-rst} .. automodule:: parlai.core.metrics :members: ```
{ "pile_set_name": "Github" }
%% Chapter 11 - Practical Session %% Try the following two programming exercises: %% 1. Sets can be thought of as lists that don’t contain any repeated %% elements. For example, [a,4,6] is a set, but [a,4,6,a] is not (as it contains %% two occurrences of a). Write a Prolog program subset/2 that is satisfied %% when the first argument is a subset of the second argument (that is, when %% every element of the first argument is a member of the second argument). For %% example: %% ?- subset([a,b],[a,b,c]) %% yes %% ?- subset([c,b],[a,b,c]) %% yes %% ?- subset([],[a,b,c]) %% yes %% Your program should be capable of generating all subsets of an input set by %% backtracking. For example, if you give it as input %% ?- subset(X,[a,b,c]) %% it should successively generate all eight subsets of [a,b,c]. %% Generates all subsets of the given set (once each) %% base case subset_gen([], []). %% inductive case subset_gen(Subset, [H | Set]) :- subset_gen(Subset, Set). subset_gen([H |Subset], [H | Set]) :- subset_gen(Subset, Set). %% Checks if the first argument is a subset of the second %% base case subset_check([], _). %% inductive case subset_check([H | Subset], Set) :- member(H, Set), subset_check(Subset, Set). %% main subset(Subset, Set) :- var(Subset), subset_gen(Subset, Set). subset(Subset, Set) :- nonvar(Subset), subset_check(Subset, Set). %% 2. Using the subset predicate you have just written, and findall/3 , write a %% predicate powerset/2 that takes a set as its first argument, and returns the %% powerset of this set as the second argument. (The powerset of a set is the %% set of all its subsets.) For example: %% ?- powerset([a,b,c],P) %% should return %% P = [[],[a],[b],[c],[a,b],[a,c],[b,c],[a,b,c]] %% It doesn’t matter if the sets are returned in some other order. For example, %% P = [[a],[b],[c],[a,b,c],[],[a,b],[a,c],[b,c]] %% is fine too %% main powerset(Set, Powerset) :- setof(Subset, subset(Subset, Set), Powerset).
{ "pile_set_name": "Github" }
import { Component } from 'react'; import { arrayOf, func, number, object, shape, string } from 'prop-types'; import LinePart from '../LinePart'; import { lineContent } from './index.module.css'; /* eslint-disable react/no-array-index-key */ /** * The container of all the individual pieces of content that * is on a single line. May contain one or more `LinePart`s * depending on ANSI parsing. */ export default class LineContent extends Component { static propTypes = { /** * The pieces of data to render in a line. Will typically * be multiple items in the array if ANSI parsed prior. */ data: arrayOf( shape({ text: string, }) ).isRequired, /** * The line number being rendered. */ number: number.isRequired, /** * Execute a function against each line part's * `text` property in `data` to process and * return a new value to render for the part. */ formatPart: func, style: object, }; static defaultProps = { formatPart: null, style: null, }; render() { const { data, formatPart, number, style } = this.props; if (data) { const last = data[data.length - 1]; if (last && typeof last.text === 'string' && !last.text.endsWith('\n')) { last.text += '\n'; } } return ( <span className={lineContent} style={style}> {data && data.map((part, n) => ( <LinePart part={part} format={formatPart} key={`line-${number}-${n}`} /> ))} </span> ); } }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" @interface VoicePrintQueueItem : NSObject { unsigned int voiceId; unsigned int offset; unsigned int length; unsigned int endflag; unsigned int trycount; } @property(nonatomic) unsigned int trycount; // @synthesize trycount; @property(nonatomic) unsigned int endflag; // @synthesize endflag; @property(nonatomic) unsigned int length; // @synthesize length; @property(nonatomic) unsigned int offset; // @synthesize offset; @property(nonatomic) unsigned int voiceId; // @synthesize voiceId; @end
{ "pile_set_name": "Github" }
<?php /** * This file is part of the Carbon package. * * (c) Brian Nesbitt <brian@nesbot.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Tsutomu Kuroda * - Punjab */ return [ 'year' => 'ਇੱਕ ਸਾਲ|:count ਸਾਲ', 'month' => 'ਇੱਕ ਮਹੀਨਾ|:count ਮਹੀਨੇ', 'week' => 'ਹਫਤਾ|:count ਹਫ਼ਤੇ', 'day' => 'ਇੱਕ ਦਿਨ|:count ਦਿਨ', 'hour' => 'ਇੱਕ ਘੰਟਾ|:count ਘੰਟੇ', 'minute' => 'ਇਕ ਮਿੰਟ|:count ਮਿੰਟ', 'second' => 'ਕੁਝ ਸਕਿੰਟ|:count ਸਕਿੰਟ', 'ago' => ':time ਪਹਿਲਾਂ', 'from_now' => ':time ਵਿੱਚ', 'before' => ':time ਤੋਂ ਪਹਿਲਾਂ', 'after' => ':time ਤੋਂ ਬਾਅਦ', 'diff_now' => 'ਹੁਣ', 'diff_today' => 'ਅਜ', 'diff_yesterday' => 'ਕਲ', 'diff_tomorrow' => 'ਕਲ', 'formats' => [ 'LT' => 'A h:mm ਵਜੇ', 'LTS' => 'A h:mm:ss ਵਜੇ', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, A h:mm ਵਜੇ', 'LLLL' => 'dddd, D MMMM YYYY, A h:mm ਵਜੇ', ], 'calendar' => [ 'sameDay' => '[ਅਜ] LT', 'nextDay' => '[ਕਲ] LT', 'nextWeek' => '[ਅਗਲਾ] dddd, LT', 'lastDay' => '[ਕਲ] LT', 'lastWeek' => '[ਪਿਛਲੇ] dddd, LT', 'sameElse' => 'L', ], 'meridiem' => function ($hour) { if ($hour < 4) { return 'ਰਾਤ'; } if ($hour < 10) { return 'ਸਵੇਰ'; } if ($hour < 17) { return 'ਦੁਪਹਿਰ'; } if ($hour < 20) { return 'ਸ਼ਾਮ'; } return 'ਰਾਤ'; }, 'months' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], 'months_short' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], 'weekdays' => ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨੀਚਰਵਾਰ'], 'weekdays_short' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'], 'weekdays_min' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' ਅਤੇ '], 'weekend' => [0, 0], 'alt_numbers' => ['੦', '੧', '੨', '੩', '੪', '੫', '੬', '੭', '੮', '੯'], ];
{ "pile_set_name": "Github" }
package matchers_test import ( "errors" "fmt" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/onsi/gomega/matchers" ) type CustomError struct { } func (c CustomError) Error() string { return "an error" } var _ = Describe("MatchErrorMatcher", func() { Context("When asserting against an error", func() { It("should succeed when matching with an error", func() { err := errors.New("an error") fmtErr := fmt.Errorf("an error") customErr := CustomError{} Ω(err).Should(MatchError(errors.New("an error"))) Ω(err).ShouldNot(MatchError(errors.New("another error"))) Ω(fmtErr).Should(MatchError(errors.New("an error"))) Ω(customErr).Should(MatchError(CustomError{})) }) It("should succeed when matching with a string", func() { err := errors.New("an error") fmtErr := fmt.Errorf("an error") customErr := CustomError{} Ω(err).Should(MatchError("an error")) Ω(err).ShouldNot(MatchError("another error")) Ω(fmtErr).Should(MatchError("an error")) Ω(customErr).Should(MatchError("an error")) }) Context("when passed a matcher", func() { It("should pass if the matcher passes against the error string", func() { err := errors.New("error 123 abc") Ω(err).Should(MatchError(MatchRegexp(`\d{3}`))) }) It("should fail if the matcher fails against the error string", func() { err := errors.New("no digits") Ω(err).ShouldNot(MatchError(MatchRegexp(`\d`))) }) }) It("should fail when passed anything else", func() { actualErr := errors.New("an error") _, err := (&MatchErrorMatcher{ Expected: []byte("an error"), }).Match(actualErr) Ω(err).Should(HaveOccurred()) _, err = (&MatchErrorMatcher{ Expected: 3, }).Match(actualErr) Ω(err).Should(HaveOccurred()) }) }) Context("when passed nil", func() { It("should fail", func() { _, err := (&MatchErrorMatcher{ Expected: "an error", }).Match(nil) Ω(err).Should(HaveOccurred()) }) }) Context("when passed a non-error", func() { It("should fail", func() { _, err := (&MatchErrorMatcher{ Expected: "an error", }).Match("an error") Ω(err).Should(HaveOccurred()) _, err = (&MatchErrorMatcher{ Expected: "an error", }).Match(3) Ω(err).Should(HaveOccurred()) }) }) Context("when passed an error that is also a string", func() { It("should use it as an error", func() { var e mockErr = "mockErr" // this fails if the matcher casts e to a string before comparison Ω(e).Should(MatchError(e)) }) }) }) type mockErr string func (m mockErr) Error() string { return string(m) }
{ "pile_set_name": "Github" }
Chris Double
{ "pile_set_name": "Github" }
// @flow import { CompositeDisposable } from 'atom' import { isValidEditor, wordAndOffset } from '../utils' import { buildGuruArchive } from '../guru-utils' import { TagsDialog } from './tags-dialog' import type { GoConfig } from './../config/service' type Mode = 'Add' | 'Remove' export type Tag = { tag: string, option?: string } export type GoModifyTagsOptions = { tags: Array<Tag>, transform: 'snakecase' | 'camelcase', // | 'lispcase', sortTags: boolean } class GoModifyTags { goconfig: GoConfig subscriptions: CompositeDisposable constructor(goconfig: GoConfig) { this.goconfig = goconfig this.subscriptions = new CompositeDisposable() this.subscriptions.add( atom.commands.add('atom-workspace', 'golang:add-tags', () => this.commandInvoked('Add') ) ) this.subscriptions.add( atom.commands.add('atom-workspace', 'golang:remove-tags', () => this.commandInvoked('Remove') ) ) } dispose() { this.subscriptions.dispose() } async commandInvoked(mode: Mode) { const editor = atom.workspace.getActiveTextEditor() if (!editor || !isValidEditor(editor)) { return } if (editor.hasMultipleCursors()) { atom.notifications.addWarning('go-plus', { dismissable: true, icon: 'tag', detail: 'Modifying tags only works with a single cursor' }) return } const cmd = await this.goconfig.locator.findTool('gomodifytags') if (cmd) { const dialog = new TagsDialog({ mode: mode }) const c: string = cmd dialog.onAccept = options => this.modifyTags(editor, options, mode, c) dialog.attach() } } buildArgs( editor: TextEditor, options: GoModifyTagsOptions, mode: Mode ): Array<string> { const { tags, transform, sortTags } = options // if there is a selection, use the -line flag, // otherwise just use the cursor offset (and apply modifications to entire struct) const args = ['-file', editor.getPath() || ''] const selection = editor.getSelectedBufferRange() if (selection && !selection.start.isEqual(selection.end)) { args.push('-line') if (selection.isSingleLine()) { args.push(`${selection.start.row + 1}`) } else { args.push(`${selection.start.row + 1},${selection.end.row + 1}`) } } else { args.push('-offset') args.push(wordAndOffset(editor).offset.toString()) } if (editor.isModified()) { args.push('-modified') } if (transform) { args.push('-transform') args.push(transform) } if (sortTags) { args.push('-sort') } if (mode === 'Add') { const tagNames = [] const opts = [] for (const t of tags) { tagNames.push(t.tag) if (t.option && t.option.length) { opts.push(`${t.tag}=${t.option}`) } } if (opts.length > 0) { args.push('-add-options') args.push(opts.join(',')) } if (tagNames.length === 0) { tagNames.push('json') } args.push('-add-tags', tagNames.join(',')) } else if (mode === 'Remove') { const tagNames = [] const opts = [] if (!tags || !tags.length) { args.push('-clear-tags') } else { for (const t of tags) { if (t.option && t.option.length) { opts.push(`${t.tag}=${t.option}`) } else { tagNames.push(t.tag) } } if (tagNames.length > 0) { args.push('-remove-tags') args.push(tagNames.join(',')) } if (opts.length > 0) { args.push('-remove-options') args.push(opts.join(',')) } } } return args } async modifyTags( editor: TextEditor, options: GoModifyTagsOptions, mode: Mode, cmd: string ) { const executorOptions = this.goconfig.executor.getOptions('file', editor) if (editor.isModified()) { executorOptions.input = buildGuruArchive(editor) } const args = this.buildArgs(editor, options, mode) const r = await this.goconfig.executor.exec(cmd, args, executorOptions) if (r.error) { if (r.error.code === 'ENOENT') { atom.notifications.addError('Missing Tool', { detail: 'Missing the `gomodifytags` tool.', dismissable: true }) } else { atom.notifications.addError('Error', { detail: r.error.message, dismissable: true }) } return { success: false, result: r } } else if (r.exitcode !== 0) { const stderr = r.stderr instanceof Buffer ? r.stderr.toString() : r.stderr atom.notifications.addError('Error', { detail: stderr.trim(), dismissable: true }) return { success: false, result: r } } editor.getBuffer().setTextViaDiff(r.stdout.toString()) return { success: true, result: r } } } export { GoModifyTags }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 5da648a54632ec64e9d42516f95a7fc4 timeCreated: 1547238593 licenseType: Store TextureImporter: fileIDToRecycleName: {} serializedVersion: 4 mipmaps: mipMapMode: 0 enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 borderMipMap: 0 mipMapsPreserveCoverage: 0 alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 seamlessCubemap: 0 textureFormat: 1 maxTextureSize: 2048 textureSettings: serializedVersion: 2 filterMode: -1 aniso: -1 mipBias: -1 wrapU: -1 wrapV: -1 wrapW: -1 nPOTScale: 1 lightmap: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: 0.5, y: 0.5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaUsage: 1 alphaIsTransparency: 0 spriteTessellationDetail: -1 textureType: 0 textureShape: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 platformSettings: - buildTarget: DefaultTexturePlatform maxTextureSize: 2048 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 spriteSheet: serializedVersion: 2 sprites: [] outline: [] physicsShape: [] spritePackingTag: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
SETUP_TYPE=armv7l.linux-dev BUILD_DIST=yes BUILD_EXAMPLES=yes KEEP_DIST=yes BUILD_DBT=no BUILD_RBT=no RUN_DBT=no RUN_RBT_SP=no RUN_RBT_SHM=no RUN_EXAMPLES_SHM=no RUN_EXAMPLES_SP=yes . configs/`hostname`/common
{ "pile_set_name": "Github" }
var LZMA = LZMA || {}; // browserify support if ( typeof module === 'object' ) { module.exports = LZMA; } LZMA.OutWindow = function() { this._windowSize = 0; }; LZMA.OutWindow.prototype.create = function(windowSize) { if ( (!this._buffer) || (this._windowSize !== windowSize) ) { this._buffer = []; } this._windowSize = windowSize; this._pos = 0; this._streamPos = 0; }; LZMA.OutWindow.prototype.flush = function() { var size = this._pos - this._streamPos; if (size !== 0) { while (size --) { this._stream.writeByte(this._buffer[this._streamPos ++]); } if (this._pos >= this._windowSize) { this._pos = 0; } this._streamPos = this._pos; } }; LZMA.OutWindow.prototype.releaseStream = function() { this.flush(); this._stream = null; }; LZMA.OutWindow.prototype.setStream = function(stream) { this.releaseStream(); this._stream = stream; }; LZMA.OutWindow.prototype.init = function(solid) { if (!solid) { this._streamPos = 0; this._pos = 0; } }; LZMA.OutWindow.prototype.copyBlock = function(distance, len) { var pos = this._pos - distance - 1; if (pos < 0) { pos += this._windowSize; } while (len --) { if (pos >= this._windowSize) { pos = 0; } this._buffer[this._pos ++] = this._buffer[pos ++]; if (this._pos >= this._windowSize) { this.flush(); } } }; LZMA.OutWindow.prototype.putByte = function(b) { this._buffer[this._pos ++] = b; if (this._pos >= this._windowSize) { this.flush(); } }; LZMA.OutWindow.prototype.getByte = function(distance) { var pos = this._pos - distance - 1; if (pos < 0) { pos += this._windowSize; } return this._buffer[pos]; }; LZMA.RangeDecoder = function() { }; LZMA.RangeDecoder.prototype.setStream = function(stream) { this._stream = stream; }; LZMA.RangeDecoder.prototype.releaseStream = function() { this._stream = null; }; LZMA.RangeDecoder.prototype.init = function() { var i = 5; this._code = 0; this._range = -1; while (i --) { this._code = (this._code << 8) | this._stream.readByte(); } }; LZMA.RangeDecoder.prototype.decodeDirectBits = function(numTotalBits) { var result = 0, i = numTotalBits, t; while (i --) { this._range >>>= 1; t = (this._code - this._range) >>> 31; this._code -= this._range & (t - 1); result = (result << 1) | (1 - t); if ( (this._range & 0xff000000) === 0) { this._code = (this._code << 8) | this._stream.readByte(); this._range <<= 8; } } return result; }; LZMA.RangeDecoder.prototype.decodeBit = function(probs, index) { var prob = probs[index], newBound = (this._range >>> 11) * prob; if ( (this._code ^ 0x80000000) < (newBound ^ 0x80000000) ) { this._range = newBound; probs[index] += (2048 - prob) >>> 5; if ( (this._range & 0xff000000) === 0) { this._code = (this._code << 8) | this._stream.readByte(); this._range <<= 8; } return 0; } this._range -= newBound; this._code -= newBound; probs[index] -= prob >>> 5; if ( (this._range & 0xff000000) === 0) { this._code = (this._code << 8) | this._stream.readByte(); this._range <<= 8; } return 1; }; LZMA.initBitModels = function(probs, len) { while (len --) { probs[len] = 1024; } }; LZMA.BitTreeDecoder = function(numBitLevels) { this._models = []; this._numBitLevels = numBitLevels; }; LZMA.BitTreeDecoder.prototype.init = function() { LZMA.initBitModels(this._models, 1 << this._numBitLevels); }; LZMA.BitTreeDecoder.prototype.decode = function(rangeDecoder) { var m = 1, i = this._numBitLevels; while (i --) { m = (m << 1) | rangeDecoder.decodeBit(this._models, m); } return m - (1 << this._numBitLevels); }; LZMA.BitTreeDecoder.prototype.reverseDecode = function(rangeDecoder) { var m = 1, symbol = 0, i = 0, bit; for (; i < this._numBitLevels; ++ i) { bit = rangeDecoder.decodeBit(this._models, m); m = (m << 1) | bit; symbol |= bit << i; } return symbol; }; LZMA.reverseDecode2 = function(models, startIndex, rangeDecoder, numBitLevels) { var m = 1, symbol = 0, i = 0, bit; for (; i < numBitLevels; ++ i) { bit = rangeDecoder.decodeBit(models, startIndex + m); m = (m << 1) | bit; symbol |= bit << i; } return symbol; }; LZMA.LenDecoder = function() { this._choice = []; this._lowCoder = []; this._midCoder = []; this._highCoder = new LZMA.BitTreeDecoder(8); this._numPosStates = 0; }; LZMA.LenDecoder.prototype.create = function(numPosStates) { for (; this._numPosStates < numPosStates; ++ this._numPosStates) { this._lowCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3); this._midCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3); } }; LZMA.LenDecoder.prototype.init = function() { var i = this._numPosStates; LZMA.initBitModels(this._choice, 2); while (i --) { this._lowCoder[i].init(); this._midCoder[i].init(); } this._highCoder.init(); }; LZMA.LenDecoder.prototype.decode = function(rangeDecoder, posState) { if (rangeDecoder.decodeBit(this._choice, 0) === 0) { return this._lowCoder[posState].decode(rangeDecoder); } if (rangeDecoder.decodeBit(this._choice, 1) === 0) { return 8 + this._midCoder[posState].decode(rangeDecoder); } return 16 + this._highCoder.decode(rangeDecoder); }; LZMA.Decoder2 = function() { this._decoders = []; }; LZMA.Decoder2.prototype.init = function() { LZMA.initBitModels(this._decoders, 0x300); }; LZMA.Decoder2.prototype.decodeNormal = function(rangeDecoder) { var symbol = 1; do { symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol); }while (symbol < 0x100); return symbol & 0xff; }; LZMA.Decoder2.prototype.decodeWithMatchByte = function(rangeDecoder, matchByte) { var symbol = 1, matchBit, bit; do { matchBit = (matchByte >> 7) & 1; matchByte <<= 1; bit = rangeDecoder.decodeBit(this._decoders, ( (1 + matchBit) << 8) + symbol); symbol = (symbol << 1) | bit; if (matchBit !== bit) { while (symbol < 0x100) { symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol); } break; } }while (symbol < 0x100); return symbol & 0xff; }; LZMA.LiteralDecoder = function() { }; LZMA.LiteralDecoder.prototype.create = function(numPosBits, numPrevBits) { var i; if (this._coders && (this._numPrevBits === numPrevBits) && (this._numPosBits === numPosBits) ) { return; } this._numPosBits = numPosBits; this._posMask = (1 << numPosBits) - 1; this._numPrevBits = numPrevBits; this._coders = []; i = 1 << (this._numPrevBits + this._numPosBits); while (i --) { this._coders[i] = new LZMA.Decoder2(); } }; LZMA.LiteralDecoder.prototype.init = function() { var i = 1 << (this._numPrevBits + this._numPosBits); while (i --) { this._coders[i].init(); } }; LZMA.LiteralDecoder.prototype.getDecoder = function(pos, prevByte) { return this._coders[( (pos & this._posMask) << this._numPrevBits) + ( (prevByte & 0xff) >>> (8 - this._numPrevBits) )]; }; LZMA.Decoder = function() { this._outWindow = new LZMA.OutWindow(); this._rangeDecoder = new LZMA.RangeDecoder(); this._isMatchDecoders = []; this._isRepDecoders = []; this._isRepG0Decoders = []; this._isRepG1Decoders = []; this._isRepG2Decoders = []; this._isRep0LongDecoders = []; this._posSlotDecoder = []; this._posDecoders = []; this._posAlignDecoder = new LZMA.BitTreeDecoder(4); this._lenDecoder = new LZMA.LenDecoder(); this._repLenDecoder = new LZMA.LenDecoder(); this._literalDecoder = new LZMA.LiteralDecoder(); this._dictionarySize = -1; this._dictionarySizeCheck = -1; this._posSlotDecoder[0] = new LZMA.BitTreeDecoder(6); this._posSlotDecoder[1] = new LZMA.BitTreeDecoder(6); this._posSlotDecoder[2] = new LZMA.BitTreeDecoder(6); this._posSlotDecoder[3] = new LZMA.BitTreeDecoder(6); }; LZMA.Decoder.prototype.setDictionarySize = function(dictionarySize) { if (dictionarySize < 0) { return false; } if (this._dictionarySize !== dictionarySize) { this._dictionarySize = dictionarySize; this._dictionarySizeCheck = Math.max(this._dictionarySize, 1); this._outWindow.create( Math.max(this._dictionarySizeCheck, 4096) ); } return true; }; LZMA.Decoder.prototype.setLcLpPb = function(lc, lp, pb) { var numPosStates = 1 << pb; if (lc > 8 || lp > 4 || pb > 4) { return false; } this._literalDecoder.create(lp, lc); this._lenDecoder.create(numPosStates); this._repLenDecoder.create(numPosStates); this._posStateMask = numPosStates - 1; return true; }; LZMA.Decoder.prototype.init = function() { var i = 4; this._outWindow.init(false); LZMA.initBitModels(this._isMatchDecoders, 192); LZMA.initBitModels(this._isRep0LongDecoders, 192); LZMA.initBitModels(this._isRepDecoders, 12); LZMA.initBitModels(this._isRepG0Decoders, 12); LZMA.initBitModels(this._isRepG1Decoders, 12); LZMA.initBitModels(this._isRepG2Decoders, 12); LZMA.initBitModels(this._posDecoders, 114); this._literalDecoder.init(); while (i --) { this._posSlotDecoder[i].init(); } this._lenDecoder.init(); this._repLenDecoder.init(); this._posAlignDecoder.init(); this._rangeDecoder.init(); }; LZMA.Decoder.prototype.decode = function(inStream, outStream, outSize) { var state = 0, rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0, nowPos64 = 0, prevByte = 0, posState, decoder2, len, distance, posSlot, numDirectBits; this._rangeDecoder.setStream(inStream); this._outWindow.setStream(outStream); this.init(); while (outSize < 0 || nowPos64 < outSize) { posState = nowPos64 & this._posStateMask; if (this._rangeDecoder.decodeBit(this._isMatchDecoders, (state << 4) + posState) === 0) { decoder2 = this._literalDecoder.getDecoder(nowPos64 ++, prevByte); if (state >= 7) { prevByte = decoder2.decodeWithMatchByte(this._rangeDecoder, this._outWindow.getByte(rep0) ); }else { prevByte = decoder2.decodeNormal(this._rangeDecoder); } this._outWindow.putByte(prevByte); state = state < 4 ? 0 : state - (state < 10 ? 3 : 6); }else { if (this._rangeDecoder.decodeBit(this._isRepDecoders, state) === 1) { len = 0; if (this._rangeDecoder.decodeBit(this._isRepG0Decoders, state) === 0) { if (this._rangeDecoder.decodeBit(this._isRep0LongDecoders, (state << 4) + posState) === 0) { state = state < 7 ? 9 : 11; len = 1; } }else { if (this._rangeDecoder.decodeBit(this._isRepG1Decoders, state) === 0) { distance = rep1; }else { if (this._rangeDecoder.decodeBit(this._isRepG2Decoders, state) === 0) { distance = rep2; }else { distance = rep3; rep3 = rep2; } rep2 = rep1; } rep1 = rep0; rep0 = distance; } if (len === 0) { len = 2 + this._repLenDecoder.decode(this._rangeDecoder, posState); state = state < 7 ? 8 : 11; } }else { rep3 = rep2; rep2 = rep1; rep1 = rep0; len = 2 + this._lenDecoder.decode(this._rangeDecoder, posState); state = state < 7 ? 7 : 10; posSlot = this._posSlotDecoder[len <= 5 ? len - 2 : 3].decode(this._rangeDecoder); if (posSlot >= 4) { numDirectBits = (posSlot >> 1) - 1; rep0 = (2 | (posSlot & 1) ) << numDirectBits; if (posSlot < 14) { rep0 += LZMA.reverseDecode2(this._posDecoders, rep0 - posSlot - 1, this._rangeDecoder, numDirectBits); }else { rep0 += this._rangeDecoder.decodeDirectBits(numDirectBits - 4) << 4; rep0 += this._posAlignDecoder.reverseDecode(this._rangeDecoder); if (rep0 < 0) { if (rep0 === -1) { break; } return false; } } }else { rep0 = posSlot; } } if (rep0 >= nowPos64 || rep0 >= this._dictionarySizeCheck) { return false; } this._outWindow.copyBlock(rep0, len); nowPos64 += len; prevByte = this._outWindow.getByte(0); } } this._outWindow.flush(); this._outWindow.releaseStream(); this._rangeDecoder.releaseStream(); return true; }; LZMA.Decoder.prototype.setDecoderProperties = function(properties) { var value, lc, lp, pb, dictionarySize; if (properties.size < 5) { return false; } value = properties.readByte(); lc = value % 9; value = ~~(value / 9); lp = value % 5; pb = ~~(value / 5); if ( !this.setLcLpPb(lc, lp, pb) ) { return false; } dictionarySize = properties.readByte(); dictionarySize |= properties.readByte() << 8; dictionarySize |= properties.readByte() << 16; dictionarySize += properties.readByte() * 16777216; return this.setDictionarySize(dictionarySize); }; LZMA.decompress = function(properties, inStream, outStream, outSize) { var decoder = new LZMA.Decoder(); if ( !decoder.setDecoderProperties(properties) ) { throw "Incorrect stream properties"; } if ( !decoder.decode(inStream, outStream, outSize) ) { throw "Error in data stream"; } return true; };
{ "pile_set_name": "Github" }
var mkdirp = require('../'); var path = require('path'); var fs = require('fs'); var test = require('tap').test; test('rel', function (t) { t.plan(2); var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); var cwd = process.cwd(); process.chdir('/tmp'); var file = [x,y,z].join('/'); mkdirp(file, 0755, function (err) { if (err) t.fail(err); else path.exists(file, function (ex) { if (!ex) t.fail('file not created') else fs.stat(file, function (err, stat) { if (err) t.fail(err) else { process.chdir(cwd); t.equal(stat.mode & 0777, 0755); t.ok(stat.isDirectory(), 'target not a directory'); t.end(); } }) }) }); });
{ "pile_set_name": "Github" }
# multibox.tcl - Multi-column listbox. # Copyright (C) 1997 Cygnus Solutions. # Written by Tom Tromey <tromey@cygnus.com>. # FIXME: # * Should support sashes so user can repartition widget sizes. # * Should support itemcget, itemconfigure. itcl_class Multibox { # The selection mode. public selectmode browse { _apply_all configure [list -selectmode $selectmode] } # The height. public height 10 { _apply_all configure [list -height $height] } # This is a list of all the listbox widgets we've created. Private # variable. protected _listboxen {} # Tricky: take the class bindings for the Listbox widget and turn # them into Multibox bindings that directly run our bindings. That # way any binding on any of our children will automatically work the # right way. # FIXME: this loses if any Listbox bindings are added later. # To really fix we need Uhler's change to support megawidgets. foreach seq [bind Listbox] { regsub -all -- %W [bind Listbox $seq] {[winfo parent %W]} sub bind Multibox $seq $sub } constructor {config} { # The standard widget-making trick. set class [$this info class] set hull [namespace tail $this] set old_name $this ::rename $this $this-tmp- ::frame $hull -class $class -relief flat -borderwidth 0 ::rename $hull $old_name-win- ::rename $this $old_name scrollbar [namespace tail $this].vs -orient vertical bind [namespace tail $this].vs <Destroy> [list $this delete] grid rowconfigure [namespace tail $this] 0 -weight 0 grid rowconfigure [namespace tail $this] 1 -weight 1 } destructor { destroy $this } # # Our interface. # # Add a new column. method add {args} { # The first array set sets up the default values, and the second # overwrites with what the user wants. array set opts {-width 20 -fix 0 -title Zardoz} array set opts $args set num [llength $_listboxen] listbox [namespace tail $this].box$num -exportselection 0 -height $height \ -selectmode $selectmode -width $opts(-width) if {$num == 0} then { [namespace tail $this].box$num configure -yscrollcommand [list [namespace tail $this].vs set] [namespace tail $this].vs configure -command [list $this yview] } label [namespace tail $this].label$num -text $opts(-title) -anchor w # No more class bindings. set tag_list [bindtags [namespace tail $this].box$num] set index [lsearch -exact $tag_list Listbox] bindtags [namespace tail $this].box$num [lreplace $tag_list $index $index Multibox] grid [namespace tail $this].label$num -row 0 -column $num -sticky new grid [namespace tail $this].box$num -row 1 -column $num -sticky news if {$opts(-fix)} then { grid columnconfigure [namespace tail $this] $num -weight 0 \ -minsize [winfo reqwidth [namespace tail $this].box$num] } else { grid columnconfigure [namespace tail $this] $num -weight 1 } lappend _listboxen [namespace tail $this].box$num # Move the scrollbar over. incr num grid [namespace tail $this].vs -row 1 -column $num -sticky nsw grid columnconfigure [namespace tail $this] $num -weight 0 } method configure {config} {} # FIXME: should handle automatically. method cget {option} { switch -- $option { -selectmode { return $selectmode } -height { return $height } default { error "option $option not supported" } } } # FIXME: this isn't ideal. But we want to support adding bindings # at least. A "bind" method might be better. method get_boxes {} { return $_listboxen } # # Methods that duplicate Listbox interface. # method activate index { _apply_all activate [list $index] } method bbox index { error "bbox method not supported" } method curselection {} { return [_apply_first curselection {}] } # FIXME: In itcl 1.5, can't have a method name "delete". Sigh. method delete_hack {args} { _apply_all delete $args } # Return some contents. We return each item as a list of the # columns. method get {first {last {}}} { if {$last == ""} then { set r {} foreach l $_listboxen { lappend r [$l get $first] } return $r } else { # We do things this way so that we don't have to specially # handle the index "end". foreach box $_listboxen { set seen(var-$box) [$box get $first $last] } # Tricky: we use the array indices as variable names and the # array values as values. This lets us "easily" construct the # result lists. set r {} eval foreach [array get seen] {{ set elt {} foreach box $_listboxen { lappend elt [set var-$box] } lappend r $elt }} return $r } } method index index { return [_apply_first index [list $index]] } # Insert some items. Each new item is a list of items for all # columns. method insert {index args} { if {[llength $args]} then { set seen(_) {} unset seen(_) foreach value $args { foreach columnvalue $value lname $_listboxen { lappend seen($lname) $columnvalue } } foreach box $_listboxen { eval $box insert $index $seen($box) } } } method nearest y { return [_apply_first nearest [list $y]] } method scan {option args} { _apply_all scan $option $args } method see index { _apply_all see [list $index] } method selection {option args} { if {$option == "includes"} then { return [_apply_first selection [concat $option $args]] } else { return [_apply_all selection [concat $option $args]] } } method size {} { return [_apply_first size {}] } method xview args { error "xview method not supported" } method yview args { if {! [llength $args]} then { return [_apply_first yview {}] } else { return [_apply_all yview $args] } } # # Private methods. # # This applies METHOD to every listbox. method _apply_all {method argList} { foreach l $_listboxen { eval $l $method $argList } } # This applies METHOD to the first listbox, and returns the result. method _apply_first {method argList} { set l [lindex $_listboxen 0] return [eval $l $method $argList] } }
{ "pile_set_name": "Github" }
/* * Copyright 2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.zonky.test.db.flyway; import com.google.common.collect.ObjectArrays; import io.zonky.test.db.logging.EmbeddedDatabaseReporter; import org.aopalliance.intercept.MethodInterceptor; import org.apache.commons.lang3.ArrayUtils; import org.flywaydb.core.Flyway; import org.flywaydb.core.api.FlywayException; import org.flywaydb.core.api.MigrationVersion; import org.flywaydb.core.api.resolver.MigrationResolver; import org.flywaydb.core.api.resolver.ResolvedMigration; import org.flywaydb.core.internal.util.scanner.Scanner; import org.flywaydb.test.annotation.FlywayTest; import org.flywaydb.test.junit.FlywayTestExecutionListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.aop.framework.ProxyFactory; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.core.Ordered; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.test.context.TestContext; import org.springframework.util.ClassUtils; import javax.sql.DataSource; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Method; import java.sql.SQLException; import java.util.Arrays; import java.util.Collection; import java.util.Map; import static io.zonky.test.db.util.ReflectionUtils.getField; import static io.zonky.test.db.util.ReflectionUtils.invokeConstructor; import static io.zonky.test.db.util.ReflectionUtils.invokeMethod; /** * Optimized implementation of the {@link org.flywaydb.test.junit.FlywayTestExecutionListener} * that takes advantage of the fact that the reloading of the database through the * <code>FlywayDataSourceContext#reload(org.flywaydb.core.Flyway)</code> method can be quick and cheap operation. * However, it is necessary to fulfill the condition that the same data has already been loaded. * In such cases the {@link FlywayDataSourceContext} utilizes a special template database * to effective copy data into multiple independent databases. * * @see <a href="https://www.postgresql.org/docs/9.6/static/manage-ag-templatedbs.html">Template Databases</a> */ public class OptimizedFlywayTestExecutionListener extends FlywayTestExecutionListener implements Ordered { private static final Logger logger = LoggerFactory.getLogger(OptimizedFlywayTestExecutionListener.class); private static final ClassLoader classLoader = OptimizedFlywayTestExecutionListener.class.getClassLoader(); private static final boolean flywayNameAttributePresent = FlywayClassUtils.isFlywayNameAttributePresent(); private static final boolean flywayBaselineAttributePresent = FlywayClassUtils.isFlywayBaselineAttributePresent(); private static final boolean repeatableAnnotationPresent = FlywayClassUtils.isRepeatableFlywayTestAnnotationPresent(); private static final int flywayVersion = FlywayClassUtils.getFlywayVersion(); /** * The order value must be less than {@link org.springframework.test.context.transaction.TransactionalTestExecutionListener}. * Otherwise, the flyway initialization can result in non-deterministic behavior related to transaction isolation. */ private int order = 3900; @Override public int getOrder() { return order; } @Override public void setOrder(int order) { this.order = order; } @Override public void beforeTestClass(TestContext testContext) throws Exception { Class<?> testClass = testContext.getTestClass(); FlywayTest[] annotations = findFlywayTestAnnotations(testClass); if (annotations.length > 1) { logger.warn("Optimized database loading is not supported when using multiple flyway test annotations"); } for (FlywayTest annotation : annotations) { optimizedDbReset(testContext, testClass, annotation); } } @Override public void beforeTestMethod(TestContext testContext) throws Exception { Method testMethod = testContext.getTestMethod(); FlywayTest[] annotations = findFlywayTestAnnotations(testMethod); if (annotations.length > 1) { logger.warn("Optimized database loading is not supported when using multiple flyway test annotations"); } for (FlywayTest annotation : annotations) { optimizedDbReset(testContext, testMethod, annotation); } } protected FlywayTest[] findFlywayTestAnnotations(AnnotatedElement element) { if (repeatableAnnotationPresent) { org.flywaydb.test.annotation.FlywayTests containerAnnotation = findAnnotation(element, org.flywaydb.test.annotation.FlywayTests.class); if (containerAnnotation != null) { return containerAnnotation.value(); } } FlywayTest annotation = findAnnotation(element, FlywayTest.class); if (annotation != null) { return new FlywayTest[] { annotation }; } return new FlywayTest[0]; } protected synchronized void optimizedDbReset(TestContext testContext, AnnotatedElement element, FlywayTest annotation) throws Exception { try { if (annotation != null && annotation.invokeCleanDB() && annotation.invokeMigrateDB() && (!flywayBaselineAttributePresent || !annotation.invokeBaselineDB())) { ApplicationContext applicationContext = testContext.getApplicationContext(); Flyway flywayBean = getFlywayBean(applicationContext, annotation); if (flywayBean != null) { FlywayDataSourceContext dataSourceContext = getDataSourceContext(applicationContext, flywayBean); if (dataSourceContext != null) { dataSourceContext.getTarget(); // wait for completion of running flyway migration DataSource dataSource = reloadDataSource(dataSourceContext, flywayBean, annotation); EmbeddedDatabaseReporter.reportDataSource(dataSource, element); FlywayTest adjustedAnnotation = copyAnnotation(annotation, false, false, true); originalDbReset(testContext, adjustedAnnotation); return; } } } originalDbReset(testContext, annotation); } catch (NoSuchMethodError e) { logger.error("\n\nHINT: Check that you are using compatible versions of org.flywaydb:flyway-core and org.flywaydb.flyway-test-extensions:flyway-spring-test dependencies!!!\n"); throw e; } } protected void originalDbReset(TestContext testContext, FlywayTest annotation) { try { String dbResetMethodName = repeatableAnnotationPresent ? "dbResetWithAnnotation" : "dbResetWithAnotation"; invokeMethod(this, dbResetMethodName, testContext, annotation); } catch (FlywayException e) { if (e.getCause() instanceof SQLException) { String errorCode = ((SQLException) e.getCause()).getSQLState(); if (errorCode != null && errorCode.matches("(42723|42P06|42P07|42712|42710)")) { logger.error("\n\nHINT: Check that you have correctly set org.flywaydb.core.Flyway#schemaNames property!!!\n"); } } throw e; } } protected static DataSource reloadDataSource(FlywayDataSourceContext dataSourceContext, Flyway flywayBean, FlywayTest annotation) throws Exception { if (isAppendable(flywayBean, annotation)) { return dataSourceContext.reload(flywayBean).get(); } else { String[] oldLocations = getFlywayLocations(flywayBean); try { if (annotation.overrideLocations()) { setFlywayLocations(flywayBean, annotation.locationsForMigrate()); } else { setFlywayLocations(flywayBean, ObjectArrays.concat(oldLocations, annotation.locationsForMigrate(), String.class)); } return dataSourceContext.reload(flywayBean).get(); } finally { setFlywayLocations(flywayBean, oldLocations); } } } /** * Checks if test migrations are appendable to core migrations. */ protected static boolean isAppendable(Flyway flyway, FlywayTest annotation) throws ClassNotFoundException { if (annotation.overrideLocations()) { return false; } if (ArrayUtils.isEmpty(annotation.locationsForMigrate())) { return true; } MigrationVersion testVersion = findFirstVersion(flyway, annotation.locationsForMigrate()); if (testVersion == MigrationVersion.EMPTY) { return true; } MigrationVersion coreVersion = findLastVersion(flyway, getFlywayLocations(flyway)); return coreVersion.compareTo(testVersion) < 0; } protected static MigrationVersion findFirstVersion(Flyway flyway, String... locations) throws ClassNotFoundException { Collection<ResolvedMigration> migrations = resolveMigrations(flyway, locations); return migrations.stream() .filter(migration -> migration.getVersion() != null) .findFirst() .map(ResolvedMigration::getVersion) .orElse(MigrationVersion.EMPTY); } protected static MigrationVersion findLastVersion(Flyway flyway, String... locations) throws ClassNotFoundException { Collection<ResolvedMigration> migrations = resolveMigrations(flyway, locations); return migrations.stream() .filter(migration -> migration.getVersion() != null) .reduce((first, second) -> second) // finds last item .map(ResolvedMigration::getVersion) .orElse(MigrationVersion.EMPTY); } protected static Collection<ResolvedMigration> resolveMigrations(Flyway flyway, String... locations) throws ClassNotFoundException { MigrationResolver resolver = createMigrationResolver(flyway, locations); if (flywayVersion >= 52) { Object configInstance = getField(flyway, "configuration"); Class<?> contextType = ClassUtils.forName("org.flywaydb.core.api.resolver.Context", classLoader); Object contextInstance = ProxyFactory.getProxy(contextType, (MethodInterceptor) invocation -> "getConfiguration".equals(invocation.getMethod().getName()) ? configInstance : invocation.proceed()); return invokeMethod(resolver, "resolveMigrations", contextInstance); } else { return resolver.resolveMigrations(); } } protected static MigrationResolver createMigrationResolver(Flyway flyway, String... locations) throws ClassNotFoundException { String[] oldLocations = getFlywayLocations(flyway); try { setFlywayLocations(flyway, locations); if (flywayVersion >= 63) { Object scanner = createScanner(flyway); Object sqlScriptFactory = createMock("org.flywaydb.core.internal.sqlscript.SqlScriptFactory"); Object sqlScriptExecutorFactory = createMock("org.flywaydb.core.internal.sqlscript.SqlScriptExecutorFactory"); Object parsingContext = invokeConstructor("org.flywaydb.core.internal.parser.ParsingContext"); return invokeMethod(flyway, "createMigrationResolver", scanner, scanner, sqlScriptExecutorFactory, sqlScriptFactory, parsingContext); } else if (flywayVersion >= 60) { Object scanner = createScanner(flyway); Object sqlScriptFactory = createMock("org.flywaydb.core.internal.sqlscript.SqlScriptFactory"); Object sqlScriptExecutorFactory = createMock("org.flywaydb.core.internal.sqlscript.SqlScriptExecutorFactory"); return invokeMethod(flyway, "createMigrationResolver", scanner, scanner, sqlScriptExecutorFactory, sqlScriptFactory); } else if (flywayVersion >= 52) { Object scanner = createScanner(flyway); Object placeholderReplacer = createMock("org.flywaydb.core.internal.placeholder.PlaceholderReplacer"); Object factory = invokeConstructor("org.flywaydb.core.internal.database.postgresql.PostgreSQLSqlStatementBuilderFactory", placeholderReplacer); return invokeMethod(flyway, "createMigrationResolver", null, scanner, scanner, factory); } else if (flywayVersion >= 51) { Object scanner = createScanner(flyway); Object placeholderReplacer = invokeMethod(flyway, "createPlaceholderReplacer"); return invokeMethod(flyway, "createMigrationResolver", null, scanner, placeholderReplacer); } else if (flywayVersion >= 40) { Scanner scanner = new Scanner(flyway.getClassLoader()); return invokeMethod(flyway, "createMigrationResolver", null, scanner); } else { return invokeMethod(flyway, "createMigrationResolver", (Object) null); } } finally { setFlywayLocations(flyway, oldLocations); } } protected static Object createScanner(Flyway flyway) throws ClassNotFoundException { Object configuration = getField(flyway, "configuration"); if (flywayVersion >= 63) { try { // this code is only for version 6.3.3 and above return invokeConstructor("org.flywaydb.core.internal.scanner.Scanner", ClassUtils.forName("org.flywaydb.core.api.migration.JavaMigration", classLoader), Arrays.asList((Object[]) invokeMethod(configuration, "getLocations")), invokeMethod(configuration, "getClassLoader"), invokeMethod(configuration, "getEncoding"), getField(flyway, "resourceNameCache"), getField(flyway, "locationScannerCache")); } catch (RuntimeException ex) { if (flywayVersion > 63) { throw ex; } // try next branch } } if (flywayVersion >= 61) { return invokeConstructor("org.flywaydb.core.internal.scanner.Scanner", ClassUtils.forName("org.flywaydb.core.api.migration.JavaMigration", classLoader), Arrays.asList((Object[]) invokeMethod(configuration, "getLocations")), invokeMethod(configuration, "getClassLoader"), invokeMethod(configuration, "getEncoding"), getField(flyway, "resourceNameCache")); } if (flywayVersion >= 60) { try { // this code is only for version 6.0.7 and above return invokeConstructor("org.flywaydb.core.internal.scanner.Scanner", ClassUtils.forName("org.flywaydb.core.api.migration.JavaMigration", classLoader), Arrays.asList((Object[]) invokeMethod(configuration, "getLocations")), invokeMethod(configuration, "getClassLoader"), invokeMethod(configuration, "getEncoding")); } catch (RuntimeException ex) { // try next branch } } if (flywayVersion >= 52) { return invokeConstructor("org.flywaydb.core.internal.scanner.Scanner", Arrays.asList((Object[]) invokeMethod(configuration, "getLocations")), invokeMethod(configuration, "getClassLoader"), invokeMethod(configuration, "getEncoding")); } if (flywayVersion >= 51) { return invokeConstructor(Scanner.class, configuration); } throw new IllegalStateException("Unsupported flyway version: " + flywayVersion); } protected static Object createMock(String className) throws ClassNotFoundException { Class<?> proxyInterface = ClassUtils.forName(className, classLoader); return ProxyFactory.getProxy(proxyInterface, (MethodInterceptor) invocation -> null); } protected Flyway getFlywayBean(ApplicationContext applicationContext, FlywayTest annotation) { if (flywayNameAttributePresent) { return invokeMethod(this, "getBean", applicationContext, Flyway.class, annotation.flywayName()); } else { return invokeMethod(this, "getBean", applicationContext, Flyway.class); } } protected static String[] getFlywayLocations(Flyway flyway) { if (flywayVersion >= 51) { Object configuration = getField(flyway, "configuration"); return Arrays.stream((Object[]) invokeMethod(configuration, "getLocations")) .map(location -> invokeMethod(location, "getDescriptor")) .toArray(String[]::new); } else { return flyway.getLocations(); } } protected static void setFlywayLocations(Flyway flyway, String[] locations) { if (flywayVersion >= 51) { Object configuration = getField(flyway, "configuration"); invokeMethod(configuration, "setLocationsAsStrings", (Object) locations); } else { flyway.setLocations(locations); } } protected static FlywayDataSourceContext getDataSourceContext(ApplicationContext context, Flyway flywayBean) { Map<String, Flyway> flywayBeans = context.getBeansOfType(Flyway.class); String flywayBeanName = flywayBeans.entrySet().stream() .filter(e -> e.getValue() == flywayBean) .map(Map.Entry::getKey) .findFirst().orElse("default"); try { return context.getBean(flywayBeanName + "DataSourceContext", FlywayDataSourceContext.class); } catch (BeansException e) {} try { return context.getBean(FlywayDataSourceContext.class); } catch (BeansException e) {} return null; } /** * Customized implementation because {@link AnnotationUtils#findAnnotation(AnnotatedElement, Class)} method * operates generically on annotated elements and not execute specialized search algorithms for classes and methods. * * @see AnnotationUtils#findAnnotation(AnnotatedElement, Class) */ protected static <A extends Annotation> A findAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType) { if (annotatedElement instanceof Class<?>) { return AnnotationUtils.findAnnotation((Class<?>) annotatedElement, annotationType); } else if (annotatedElement instanceof Method) { return AnnotationUtils.findAnnotation((Method) annotatedElement, annotationType); } else { return AnnotationUtils.findAnnotation(annotatedElement, annotationType); } } private static FlywayTest copyAnnotation(FlywayTest annotation, boolean invokeCleanDB, boolean invokeBaselineDB, boolean invokeMigrateDB) { Map<String, Object> attributes = AnnotationUtils.getAnnotationAttributes(annotation); attributes.put("invokeCleanDB", invokeCleanDB); attributes.put("invokeBaselineDB", invokeBaselineDB); attributes.put("invokeMigrateDB", invokeMigrateDB); return AnnotationUtils.synthesizeAnnotation(attributes, FlywayTest.class, null); } }
{ "pile_set_name": "Github" }
アシュリーホープ最新番号 【KPBB-001】本場金髪ワイルドフェラ デカマラを根元まで咥えこむ本場のブロンド美女たちの尺八映像集</a>2016-03-23映天$$$BEBEYピンク(映天)119分钟
{ "pile_set_name": "Github" }
#include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> #include <asm/sfp-machine.h> #include <math-emu/soft-fp.h> int mtfsf(unsigned int FM, u32 *frB) { u32 mask; u32 fpscr; if (FM == 0) return 0; if (FM == 0xff) mask = 0x9fffffff; else { mask = 0; if (FM & (1 << 0)) mask |= 0x90000000; if (FM & (1 << 1)) mask |= 0x0f000000; if (FM & (1 << 2)) mask |= 0x00f00000; if (FM & (1 << 3)) mask |= 0x000f0000; if (FM & (1 << 4)) mask |= 0x0000f000; if (FM & (1 << 5)) mask |= 0x00000f00; if (FM & (1 << 6)) mask |= 0x000000f0; if (FM & (1 << 7)) mask |= 0x0000000f; } __FPU_FPSCR &= ~(mask); __FPU_FPSCR |= (frB[1] & mask); __FPU_FPSCR &= ~(FPSCR_VX); if (__FPU_FPSCR & (FPSCR_VXSNAN | FPSCR_VXISI | FPSCR_VXIDI | FPSCR_VXZDZ | FPSCR_VXIMZ | FPSCR_VXVC | FPSCR_VXSOFT | FPSCR_VXSQRT | FPSCR_VXCVI)) __FPU_FPSCR |= FPSCR_VX; fpscr = __FPU_FPSCR; fpscr &= ~(FPSCR_FEX); if (((fpscr & FPSCR_VX) && (fpscr & FPSCR_VE)) || ((fpscr & FPSCR_OX) && (fpscr & FPSCR_OE)) || ((fpscr & FPSCR_UX) && (fpscr & FPSCR_UE)) || ((fpscr & FPSCR_ZX) && (fpscr & FPSCR_ZE)) || ((fpscr & FPSCR_XX) && (fpscr & FPSCR_XE))) fpscr |= FPSCR_FEX; __FPU_FPSCR = fpscr; #ifdef DEBUG printk("%s: %02x %p: %08lx\n", __func__, FM, frB, __FPU_FPSCR); #endif return 0; }
{ "pile_set_name": "Github" }
/* Special Initializers for certain USB Mass Storage devices * * Current development and maintenance by: * (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net) * * This driver is based on the 'USB Mass Storage Class' document. This * describes in detail the protocol used to communicate with such * devices. Clearly, the designers had SCSI and ATAPI commands in * mind when they created this document. The commands are all very * similar to commands in the SCSI-II and ATAPI specifications. * * It is important to note that in a number of cases this class * exhibits class-specific exemptions from the USB specification. * Notably the usage of NAK, STALL and ACK differs from the norm, in * that they are used to communicate wait, failed and OK on commands. * * Also, for certain devices, the interrupt endpoint is used to convey * status of a command. * * Please see http://www.one-eyed-alien.net/~mdharm/linux-usb for more * information about this driver. * * 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, 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., * 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <linux/errno.h> #include "usb.h" #include "initializers.h" #include "debug.h" #include "transport.h" /* This places the Shuttle/SCM USB<->SCSI bridge devices in multi-target * mode */ int usb_stor_euscsi_init(struct us_data *us) { int result; usb_stor_dbg(us, "Attempting to init eUSCSI bridge...\n"); result = usb_stor_control_msg(us, us->send_ctrl_pipe, 0x0C, USB_RECIP_INTERFACE | USB_TYPE_VENDOR, 0x01, 0x0, NULL, 0x0, 5 * HZ); usb_stor_dbg(us, "-- result is %d\n", result); return 0; } /* This function is required to activate all four slots on the UCR-61S2B * flash reader */ int usb_stor_ucr61s2b_init(struct us_data *us) { struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap*) us->iobuf; struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap*) us->iobuf; int res; unsigned int partial; static char init_string[] = "\xec\x0a\x06\x00$PCCHIPS"; usb_stor_dbg(us, "Sending UCR-61S2B initialization packet...\n"); bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN); bcb->Tag = 0; bcb->DataTransferLength = cpu_to_le32(0); bcb->Flags = bcb->Lun = 0; bcb->Length = sizeof(init_string) - 1; memset(bcb->CDB, 0, sizeof(bcb->CDB)); memcpy(bcb->CDB, init_string, sizeof(init_string) - 1); res = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb, US_BULK_CB_WRAP_LEN, &partial); if (res) return -EIO; usb_stor_dbg(us, "Getting status packet...\n"); res = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, US_BULK_CS_WRAP_LEN, &partial); if (res) return -EIO; return 0; } /* This places the HUAWEI E220 devices in multi-port mode */ int usb_stor_huawei_e220_init(struct us_data *us) { int result; result = usb_stor_control_msg(us, us->send_ctrl_pipe, USB_REQ_SET_FEATURE, USB_TYPE_STANDARD | USB_RECIP_DEVICE, 0x01, 0x0, NULL, 0x0, 1 * HZ); usb_stor_dbg(us, "Huawei mode set result is %d\n", result); return 0; }
{ "pile_set_name": "Github" }
#region License // // Copyright (c) 2013, Kooboo team // // Licensed under the BSD License // See the file LICENSE.txt for details. // #endregion using Kooboo.CMS.Common; using Kooboo.CMS.Sites.Extension; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.Mvc; namespace Kooboo.CMS.Sites.Membership { public class SignOutMemberPlugin : IHttpMethodPagePlugin, ISubmissionPlugin { #region ISubmissionPlugin public System.Web.Mvc.ActionResult Submit(Models.Site site, System.Web.Mvc.ControllerContext controllerContext, Models.SubmissionSetting submissionSetting) { SingOutCore(controllerContext); var redirectUrl = MemberPluginHelper.GetReturnUrl(controllerContext); if (string.IsNullOrEmpty(redirectUrl)) { redirectUrl = controllerContext.HttpContext.Request.UrlReferrer.ToString(); } if (controllerContext.HttpContext.Request.IsAjaxRequest()) { JsonResultData resultData = new JsonResultData(); resultData.RedirectUrl = redirectUrl; resultData.Success = true; return new JsonResult() { Data = resultData, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } else { return new RedirectResult(redirectUrl); } } public Dictionary<string, object> Parameters { get { return null; } } #endregion #region LoginCore protected virtual void SingOutCore(ControllerContext controllerContext) { controllerContext.HttpContext.Membership().SignOut(); } #endregion #region IHttpMethodPagePlugin public System.Web.Mvc.ActionResult HttpGet(View.Page_Context context, View.PagePositionContext positionContext) { return null; } public System.Web.Mvc.ActionResult HttpPost(View.Page_Context context, View.PagePositionContext positionContext) { SingOutCore(context.ControllerContext); var redirectUrl = MemberPluginHelper.GetReturnUrl(context.ControllerContext); if (string.IsNullOrEmpty(redirectUrl)) { redirectUrl = context.ControllerContext.HttpContext.Request.UrlReferrer.ToString(); } return new RedirectResult(redirectUrl); } #endregion } }
{ "pile_set_name": "Github" }
# frozen_string_literal: true # WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::StorageGateway class Resource # @param options ({}) # @option options [Client] :client def initialize(options = {}) @client = options[:client] || Client.new(options) end # @return [Client] def client @client end end end
{ "pile_set_name": "Github" }
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * @name: S7.5.2_A1.15; * @section: 7.5.2; * @assertion: The "new" token can not be used as identifier; * @description: Checking if execution of "new=1" fails; * @negative */ new = 1;
{ "pile_set_name": "Github" }
platform_is :windows do require 'win32ole' describe "WIN32OLE_METHOD#return_type_detail" do before :each do ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "Shell") @m_browse_for_folder = WIN32OLE_METHOD.new(ole_type, "BrowseForFolder") end it "raises ArgumentError if argument is given" do lambda { @m_browse_for_folder.return_type_detail(1) }.should raise_error ArgumentError end it "returns expected value for Shell Control's 'BrowseForFolder' method" do @m_browse_for_folder.return_type_detail.should be_kind_of Array @m_browse_for_folder.return_type_detail.should == ['PTR', 'USERDEFINED', 'Folder'] end end end
{ "pile_set_name": "Github" }
var R = require('../source'); var eq = require('./shared/eq'); describe('xor', function() { it('compares two values with exclusive or', function() { eq(R.xor(true, true), false); eq(R.xor(true, false), true); eq(R.xor(false, true), true); eq(R.xor(false, false), false); }); it('when both values are truthy, it should return false', function() { eq(R.xor(true, 'foo'), false); eq(R.xor(42, true), false); eq(R.xor('foo', 42), false); eq(R.xor({}, true), false); eq(R.xor(true, []), false); eq(R.xor([], {}), false); eq(R.xor(new Date(), true), false); eq(R.xor(true, Infinity), false); eq(R.xor(Infinity, new Date()), false); }); it('when both values are falsy, it should return false', function() { eq(R.xor(null, false), false); eq(R.xor(false, undefined), false); eq(R.xor(undefined, null), false); eq(R.xor(0, false), false); eq(R.xor(false, NaN), false); eq(R.xor(NaN, 0), false); eq(R.xor('', false), false); }); it('when one argument is truthy and the other is falsy, it should return true', function() { eq(R.xor('foo', null), true); eq(R.xor(null, 'foo'), true); eq(R.xor(undefined, 42), true); eq(R.xor(42, undefined), true); eq(R.xor(Infinity, NaN), true); eq(R.xor(NaN, Infinity), true); eq(R.xor({}, ''), true); eq(R.xor('', {}), true); eq(R.xor(new Date(), 0), true); eq(R.xor(0, new Date()), true); eq(R.xor([], null), true); eq(R.xor(undefined, []), true); }); it('returns a curried function', function() { eq(R.xor()(true)(true), false); eq(R.xor()(true)(false), true); eq(R.xor()(false)(true), true); eq(R.xor()(false)(false), false); }); });
{ "pile_set_name": "Github" }
subroutine da_radzicevar_adj(qvp0,qra0,qsn0,qgr0,qnr0,qns0,qng0,tmk0,prs,dbz, & in0r,in0s,in0g,rn0_r,rn0_s,rn0_g, & rhos,rhog,dtmk,dqvp,dqra,dqsn,dqgr,dqnr,dqns,dqng,zmm,tlopt, & gropt,zmm_ref) !=================================================================== ! Following Jung et al., 2008 !=================================================================== implicit none integer,intent(in) :: in0r,in0s,in0g integer,intent(in) :: tlopt,gropt ! tlopt=0 nonlinear,=1 tl linear; gropt=0 tl linear; >=1 adj integer,parameter :: dualpol_opt=0 ! completed but not yet been tested real :: rn0_r,rn0_s,rn0_g ! intercept parameter 1/m^4 real :: qra0,qsn0,qgr0, & ! these are read in background states qnr0,qns0,qng0, & tmk0,qvp0 real :: qra,qvp, & ! clone the background qsn,qgr,tmk, & prs,dbz,qnr, & qns,qng,ref, & zrs,zss,zhs, & zmm,zmm_ref, & ! above: background, below: increment for tlopt==1 and gropt==0 but adj for tlopt==1 and gropt>=1 dqra,dqsn,dqgr, & dqnr,dqns,dqng, & dtmk,dqvp real :: rgas=287.04 real :: z_e integer :: i,j,k,ii,jj,kk ! reflectivity operator constant real,parameter :: rdrwave = 107.0 ! unit mm S band real,parameter :: lambda = rdrwave real,parameter :: Kw2 = 0.93 real :: pi = 3.1415926 real,parameter :: mm3todBZ=1.0E+9 real :: rhor = 1000 ! kg m^-3 rainwater density real :: rhos ! kg m^-3 snow density real :: rhog ! kg m^-3 graupel density real :: rhoair ! air density real :: rhows,rhowg ! wet snow, wet graupel ! temporal mixing ratio real :: prain ! pure rain mixing ratio real :: dsnow ! dry snow mixing ratio real :: dgr ! dry graupel mixing ration real :: wsnow ! wet snow mixing ratio real :: wgr ! wet graupel mixing ratio ! parameters for rain real :: alpha_ra = 4.28e-4 real :: alpha_rb = 4.28e-4 real :: beta_ra = 3.04 real :: beta_rb = 2.77 real :: alphar = 0 real :: dr = 3 real :: cr = 3.1415926/6 real :: zrh,zrv real :: para10r ! =(1.-(2.*betarx+1.0)/4.) real :: para14r ! mm3todBZ*(4*lambda**4*alpharx**2/(pi**4*Kw2)) ! *(pi*rhor/rhoa)**(p2/4.)**(n0r)**para10r ! *gamma(-(2.*betarx+1.0)*1d0) ! for rainwater real :: ronv,gonv,sonv ! intercept parameter ! parameters for snow and graupel/hail integer,parameter :: npara_alpharxa=7 real :: para_alpha_rxa(npara_alpharxa,2) ! second dimension: 1 for snow ! 2 for hail/graupel real,save :: para_alpha_rxb(npara_alpharxa,2) ! precalculated coefficients in contribution equations of ice species real :: phimean=0,sigma,ice_abc(3),ice_bac(3) ! A, B, and C in contribution equations of ice species real :: fw ! water fraction real :: pxabk_all(3) ! real :: pxkh,pxkv ! the sum of fwx term real :: pxkh_tlr,pxkv_tlr,pxkh_tlx,pxkv_tlx ! particle derivative of pxkh/pxkv for rain (tlr) and ice species (tlx) real :: zsh,zsv,zgh,zgv,zdsh,zdsv,zdgh,zdgv ! contribution from snow/graupel ! (thelast character means horizontal/vertical) real :: para1sg ! para1sg=mm3todBZ*gamma(7)*lambda**4/pi**4/Kw2*(pi*rhox/rhoa)**1.75 real :: cs=3.1415926/6 real :: cice=440. real :: ds=3. real :: dg=3. real :: alphas = 0 real :: alphag = 0 real :: alpha_rdsa=0.194*10.**(-4) real :: alpha_rdsb=0.191*10.**(-4) !--------------------------------------------- !real :: alpha_rdha=0.191*10.**(-3) ! hail !real :: alpha_rdhb=0.165*10.**(-3) ! hail !-------------------------------------------- real :: alpha_rdha=0.105*10.**(-3) ! graupel real :: alpha_rdhb=0.092*10.**(-3) ! graupel real :: zh_e,zv_e ! for dry graupel REAL,PARAMETER :: sigmahd = 1.0472 REAL,PARAMETER :: Ahd = 0.4308 REAL,PARAMETER :: Bhd = 0.3192 REAL,PARAMETER :: Chd = 0.1250 REAL,PARAMETER :: Dhd = 0.3750 REAL,PARAMETER :: Ckhd = 0.1116 ! for dry snow REAL,PARAMETER :: sigmas = 0.3491 REAL,PARAMETER :: Asd = 0.8140 REAL,PARAMETER :: Bsd = 0.0303 REAL,PARAMETER :: Csd = 0.0778 REAL,PARAMETER :: Dsd = 0.4221 REAL,PARAMETER :: Cksd = 0.7837 real :: ice_abc_d(3),ice_bac_d(3) real :: pdfrrs,pdfrrg,pdfsrs,pdfgrg ! partial derivative of F (r&s,r&g) with respect to (r,s,g) real :: pdfrhot,pdfrhoq ! partial derivative of rho for t and qv real :: prain_coef,dsnow_coef,dgr_coef ! coefficient to determine the ratio of !pure rain, dry swno/graupel in total qr and qs/qg, respectively. real :: qthres real :: temr01,temr02,temr03 ! temporary variable for real integer :: temi01,temi02,temi03 ! temporary variable for integer real :: para_pr,para_pdx_dq,para_pdx_df ! for real :: tc !--------------------------------------------------------------------------------- data para_alpha_rxa(:,1)/0.194e-4,7.094e-4,2.135e-4,-5.225e-4,0,0,0/ data para_alpha_rxb(:,1)/0.191e-4,6.916e-4,-2.841e-4,-1.160e-4,0,0,0/ !----hail-------------- !data para_alpha_rxa(:,2)/0.191e-3,2.39e-3,-12.57e-3,38.71e-3,-65.53e-3,56.16e-3, & ! -18.98e-3/ !data para_alpha_rxb(:,2)/0.165e-3,1.72e-3,-9.92e-3,32.15e-3,-56.0e-3,48.83e-3, & ! -16.69e-3/ !----graupel----------- data para_alpha_rxa(:,2)/1.05E-04,1.82E-03,-3.77E-03,-7.97E-04,1.63E-02,-2.20E-02, & 8.74E-03/ data para_alpha_rxb(:,2)/9.25E-05,1.93E-03,-9.79E-03,2.92E-02,-4.82E-02,3.93E-02, & -1.22E-02/ qthres=rf_qthres qra=qra0 qsn=qsn0 qgr=qgr0 tmk=tmk0 qvp=qvp0 ! if(qra0<qthres) qra=qthres ! if(qsn0<qthres) qsn=qthres ! if(qgr0<qthres) qgr=qthres tc=tmk-273.15 if(tc<=0.0) then qra=max(qthres*(1+exp(-(tc-5.0)**2/6.25)),qra) qsn=max(qthres*2,qsn) qgr=max(qthres*2,qgr) else qra=max(qthres*2,qra) qsn=max(qthres*(1+exp(-(tc-5.0)**2/6.25)),qsn) qgr=max(qthres*(1+exp(-(tc-5.0)**2/6.25)),qgr) endif if(tlopt>=1.and.gropt>=1) then dqra=0 dqgr=0 dqsn=0 dqvp=0 dtmk=0 dqnr=0 dqns=0 dqng=0 endif zrh=0 zsh=0 zgh=0 zdsh=0 zdgh=0 zrv=0 zsv=0 zgv=0 zdsv=0 zdgv=0 ! if(qra<qthres.and.qsn<qthres.and.qgr<qthres) then ! zrs=0 ! zss=0 ! zhs=0 ! ref=0 ! zmm=0 ! dbz=0 ! return ! endif call da_radzicevar_rhoair_tl(tlopt,rhoair,prs,rgas,tmk,qvp,pdfrhot,pdfrhoq) !------------------------------------------------------- ! Calculate variable intercept parameters if wanted !------------------------------------------------------- call da_radzicevar_prepare_interceptpara(in0s,in0g,in0r,rn0_s,rn0_g,rn0_r,sonv,gonv,ronv) !------------------------------------------------------- ! Calculate mixing ratios (pure rain, dry snow/graupel, wet snow/graupel) !------------------------------------------------------- call da_radzicevar_prepare_mixingratios(tlopt,prain_coef,dsnow_coef,dgr_coef, & prain,dsnow,wsnow,dgr,wgr, & qra,qgr,qsn,qthres, & pdfrrs,pdfrrg,pdfsrs,pdfgrg & ) call da_radzicevar_prepare_zmm_adj(tlopt,gropt,zmm,zmm_ref) ! ==================FOR RAIN============================= call da_radzicevar_parameter_zrx(para10r,para14r,para_pr,rhoair,rhor,prain, & beta_ra,alpha_ra,mm3todBZ,lambda,Kw2,pi, & ronv) if(in0r.eq.1) then ! for two moment microphysics scheme, not yet completed else if(tlopt>=1.and.gropt>=1) call da_radzicevar_rain_adj(para_pr,dqra,dqsn,dqgr,dtmk,dqvp,rhoair, & prain_coef,zmm_ref,pdfrrs,pdfsrs,pdfgrg, & pdfrhot,pdfrhoq,pdfrrg,qra,prain) endif if(dualpol_opt==1) then call da_radzicevar_parameter_zrx(para10r,para14r,para_pr,rhoair,rhor,prain, & beta_rb,alpha_rb,mm3todBZ,lambda,Kw2,pi, & ronv) if(in0r.eq.1) then ! for two moment microphysics scheme, not yet completed else if(tlopt>=1.and.gropt>=1) call da_radzicevar_rain_adj(para_pr,dqra,dqsn,dqgr,dtmk,dqvp,rhoair, & prain_coef,zmm_ref,pdfrrs,pdfsrs,pdfgrg, & pdfrhot,pdfrhoq,pdfrrg,qra,prain) endif endif ! ==================FOR snow============================= if(rf_noice==0) then ! -------------------for wet snow---------------------- call da_radzicevar_waterfraction(qra,qsn,fw) rhows=rhos*(1.-fw**2)+rhor*fw**2 call da_radzicevar_parameter_zxx(para1sg,para_pdx_dq,para_pdx_df,rhoair,rhows,wsnow,cs,ds,alphas, & mm3todBZ,lambda,Kw2,pi,sonv) call da_radzicevar_sigma_in_abc(qsn,fw,1,sigma) ! for snow call da_radzicevar_calc_ice_abc(phimean,sigma,ice_abc) ice_bac(1)=ice_abc(2) ice_bac(2)=ice_abc(1) ice_bac(3)=ice_abc(3) pxkh=0 pxkv=0 pxkh_tlr=0 pxkv_tlr=0 pxkh_tlx=0 pxkv_tlx=0 call da_radzicevar_cal_tl_fw4wetice(1,qsn,pxabk_all,para_alpha_rxa,para_alpha_rxb, & pxkh,pxkv,ice_abc,ice_bac,fw,pxkh_tlr, & pxkv_tlr,pxkh_tlx,pxkv_tlx,qra,tlopt, & npara_alpharxa) if(in0s.eq.1) then ! for two moment microphysics scheme, not yet completed else if(tlopt>=1.and.gropt>=1) call da_radzicevar_wetice_adj(para_pdx_dq,para_pdx_df,pxkh,pxkh_tlr, & pxkh_tlx,dqsn,dqra,dtmk,dqvp,qsn,wsnow, & rhoair,dsnow_coef,zmm_ref,pdfsrs, & pdfrrs,pdfrhot,pdfrhoq) endif if(dualpol_opt==1) then if(in0s.eq.1) then ! for two moment microphysics scheme, not yet completed else if(tlopt>=1.and.gropt>=1) call da_radzicevar_wetice_adj(para_pdx_dq,para_pdx_df,pxkv,pxkv_tlr, & pxkv_tlx, dqsn,dqra,dtmk,dqvp,qsn,wsnow, & rhoair,dsnow_coef,zmm_ref,pdfsrs, & pdfrrs,pdfrhot,pdfrhoq) endif endif ! -------------------for dry snow---------------------- call da_radzicevar_parameter_zxx(para1sg,para_pdx_dq,para_pdx_df,rhoair,rhos,dsnow,cs,ds,alphas, & mm3todBZ,lambda,Kw2,pi,sonv) ice_abc_d(1)=Asd ice_abc_d(2)=Bsd ice_abc_d(3)=Csd ice_bac_d(1)=Bsd ice_bac_d(2)=Asd pxabk_all(1)=alpha_rdsa**2 pxabk_all(2)=alpha_rdsb**2 pxabk_all(3)=alpha_rdsb*alpha_rdsa call da_radzicevar_pkx(ice_abc_d,pxabk_all,pxkh) call da_radzicevar_pkx(ice_bac_d,pxabk_all,pxkv) if(in0s.eq.1) then ! for two moment microphysics scheme, not yet completed else if(tlopt>=1.and.gropt>=1) call da_radzicevar_dryice_adj(para_pdx_dq,pxkh,dqsn,dqra,dtmk,dqvp, & rhoair,dsnow_coef,zmm_ref,dsnow,qsn,pdfsrs, & pdfrrs,pdfrhot,pdfrhoq) endif if(dualpol_opt==1) then if(in0s.eq.1) then ! for two moment microphysics scheme, not yet completed else if(tlopt>=1.and.gropt>=1) call da_radzicevar_dryice_adj(para_pdx_dq,pxkv,dqsn,dqra,dtmk,dqvp, & rhoair,dsnow_coef,zmm_ref,dsnow,qsn,pdfsrs, & pdfrrs,pdfrhot,pdfrhoq) endif endif ! ==================FOR graupel========================== ! -------------------for wet graupel--------------------- call da_radzicevar_waterfraction(qra,qgr,fw) rhowg=rhog*(1.-fw**2)+rhor*fw**2 call da_radzicevar_parameter_zxx(para1sg,para_pdx_dq,para_pdx_df,rhoair,rhowg,wgr,cice,dg,alphag, & mm3todBZ,lambda,Kw2,pi,gonv) call da_radzicevar_sigma_in_abc(qgr,fw,2,sigma) ! for snow call da_radzicevar_calc_ice_abc(phimean,sigma,ice_abc) ice_bac(1)=ice_abc(2) ice_bac(2)=ice_abc(1) ice_bac(3)=ice_abc(3) pxkh=0 pxkv=0 pxkh_tlr=0 pxkv_tlr=0 pxkh_tlx=0 pxkv_tlx=0 call da_radzicevar_cal_tl_fw4wetice(2,qgr,pxabk_all,para_alpha_rxa,para_alpha_rxb, & pxkh,pxkv,ice_abc,ice_bac,fw,pxkh_tlr, & pxkv_tlr,pxkh_tlx,pxkv_tlx,qra,tlopt, & npara_alpharxa) if(in0g.eq.1) then ! for two moment microphysics scheme, not yet completed else if(tlopt>=1.and.gropt>=1) call da_radzicevar_wetice_adj(para_pdx_dq,para_pdx_df,pxkh,pxkh_tlr, & pxkh_tlx,dqgr,dqra,dtmk,dqvp,qgr,wgr,rhoair, & dgr_coef,zmm_ref,pdfgrg, & pdfrrg,pdfrhot,pdfrhoq) endif if(dualpol_opt==1) then if(in0g.eq.1) then ! for two moment microphysics scheme, not yet completed else if(tlopt>=1.and.gropt>=1) call da_radzicevar_wetice_adj(para_pdx_dq,para_pdx_df,pxkv,pxkv_tlr, & pxkv_tlx,dqgr,dqra,dtmk,dqvp,qgr,wgr, & rhoair,dgr_coef,zmm_ref,pdfgrg, & pdfrrg,pdfrhot,pdfrhoq) endif endif ! --------------------------for dry graupel---------------------- call da_radzicevar_parameter_zxx(para1sg,para_pdx_dq,para_pdx_df,rhoair,rhog,dgr,cice,dg,alphag, & mm3todBZ,lambda,Kw2,pi,gonv) ice_abc_d(1)=Ahd ice_abc_d(2)=Bhd ice_abc_d(3)=Chd ice_bac_d(1)=Bhd ice_bac_d(2)=Ahd pxabk_all(1)=alpha_rdha**2 pxabk_all(2)=alpha_rdhb**2 pxabk_all(3)=alpha_rdhb*alpha_rdha call da_radzicevar_pkx(ice_abc_d,pxabk_all,pxkh) call da_radzicevar_pkx(ice_bac_d,pxabk_all,pxkv) if(in0s.eq.1) then ! for two moment microphysics scheme, not yet completed else if(tlopt>=1.and.gropt>=1) call da_radzicevar_dryice_adj(para_pdx_dq,pxkh,dqgr,dqra,dtmk,dqvp, & rhoair,dgr_coef,zmm_ref,dgr,qgr,pdfgrg, & pdfrrg,pdfrhot,pdfrhoq) endif if(dualpol_opt==1) then if(in0s.eq.1) then ! for two moment microphysics scheme, not yet completed else if(tlopt>=1.and.gropt>=1) call da_radzicevar_dryice_adj(para_pdx_dq,pxkv,dqgr,dqra,dtmk,dqvp, & rhoair,dgr_coef,zmm_ref,dgr,qgr,pdfgrg, & pdfrrg,pdfrhot,pdfrhoq) endif endif ! ============================done================================= endif !(if rf_noice == 0) end subroutine da_radzicevar_adj
{ "pile_set_name": "Github" }