hexsha
stringlengths
40
40
size
int64
3
1.05M
ext
stringclasses
163 values
lang
stringclasses
53 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
112
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
113
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
float64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
113
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
3
1.05M
avg_line_length
float64
1
966k
max_line_length
int64
1
977k
alphanum_fraction
float64
0
1
ed7df62815b2956585ea0cfdaccc8fc5b50387fc
27,820
pl
Perl
crypto/bn/asm/parisc-mont.pl
JamesWP/openssl
922241de76dce66a04e0217bfc270a5228b694f3
[ "Apache-2.0" ]
4
2017-07-18T18:24:43.000Z
2018-01-28T19:26:37.000Z
crypto/bn/asm/parisc-mont.pl
JamesWP/openssl
922241de76dce66a04e0217bfc270a5228b694f3
[ "Apache-2.0" ]
1
2016-02-27T16:30:29.000Z
2016-02-27T19:50:04.000Z
crypto/bn/asm/parisc-mont.pl
JamesWP/openssl
922241de76dce66a04e0217bfc270a5228b694f3
[ "Apache-2.0" ]
3
2016-02-27T14:35:30.000Z
2017-03-13T03:38:09.000Z
#! /usr/bin/env perl # Copyright 2009-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # https://www.openssl.org/source/license.html # ==================================================================== # Written by Andy Polyakov <appro@openssl.org> for the OpenSSL # project. The module is, however, dual licensed under OpenSSL and # CRYPTOGAMS licenses depending on where you obtain it. For further # details see http://www.openssl.org/~appro/cryptogams/. # ==================================================================== # On PA-7100LC this module performs ~90-50% better, less for longer # keys, than code generated by gcc 3.2 for PA-RISC 1.1. Latter means # that compiler utilized xmpyu instruction to perform 32x32=64-bit # multiplication, which in turn means that "baseline" performance was # optimal in respect to instruction set capabilities. Fair comparison # with vendor compiler is problematic, because OpenSSL doesn't define # BN_LLONG [presumably] for historical reasons, which drives compiler # toward 4 times 16x16=32-bit multiplications [plus complementary # shifts and additions] instead. This means that you should observe # several times improvement over code generated by vendor compiler # for PA-RISC 1.1, but the "baseline" is far from optimal. The actual # improvement coefficient was never collected on PA-7100LC, or any # other 1.1 CPU, because I don't have access to such machine with # vendor compiler. But to give you a taste, PA-RISC 1.1 code path # reportedly outperformed code generated by cc +DA1.1 +O3 by factor # of ~5x on PA-8600. # # On PA-RISC 2.0 it has to compete with pa-risc2[W].s, which is # reportedly ~2x faster than vendor compiler generated code [according # to comment in pa-risc2[W].s]. Here comes a catch. Execution core of # this implementation is actually 32-bit one, in the sense that it # operates on 32-bit values. But pa-risc2[W].s operates on arrays of # 64-bit BN_LONGs... How do they interoperate then? No problem. This # module picks halves of 64-bit values in reverse order and pretends # they were 32-bit BN_LONGs. But can 32-bit core compete with "pure" # 64-bit code such as pa-risc2[W].s then? Well, the thing is that # 32x32=64-bit multiplication is the best even PA-RISC 2.0 can do, # i.e. there is no "wider" multiplication like on most other 64-bit # platforms. This means that even being effectively 32-bit, this # implementation performs "64-bit" computational task in same amount # of arithmetic operations, most notably multiplications. It requires # more memory references, most notably to tp[num], but this doesn't # seem to exhaust memory port capacity. And indeed, dedicated PA-RISC # 2.0 code path provides virtually same performance as pa-risc2[W].s: # it's ~10% better for shortest key length and ~10% worse for longest # one. # # In case it wasn't clear. The module has two distinct code paths: # PA-RISC 1.1 and PA-RISC 2.0 ones. Latter features carry-free 64-bit # additions and 64-bit integer loads, not to mention specific # instruction scheduling. In 64-bit build naturally only 2.0 code path # is assembled. In 32-bit application context both code paths are # assembled, PA-RISC 2.0 CPU is detected at run-time and proper path # is taken automatically. Also, in 32-bit build the module imposes # couple of limitations: vector lengths has to be even and vector # addresses has to be 64-bit aligned. Normally neither is a problem: # most common key lengths are even and vectors are commonly malloc-ed, # which ensures alignment. # # Special thanks to polarhome.com for providing HP-UX account on # PA-RISC 1.1 machine, and to correspondent who chose to remain # anonymous for testing the code on PA-RISC 2.0 machine. $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; # $output is the last argument if it looks like a file (it has an extension) # $flavour is the first argument if it doesn't look like a file $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef; $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef; $output and open STDOUT,">$output"; if ($flavour =~ /64/) { $LEVEL ="2.0W"; $SIZE_T =8; $FRAME_MARKER =80; $SAVED_RP =16; $PUSH ="std"; $PUSHMA ="std,ma"; $POP ="ldd"; $POPMB ="ldd,mb"; $BN_SZ =$SIZE_T; } else { $LEVEL ="1.1"; #$LEVEL.="\n\t.ALLOW\t2.0"; $SIZE_T =4; $FRAME_MARKER =48; $SAVED_RP =20; $PUSH ="stw"; $PUSHMA ="stwm"; $POP ="ldw"; $POPMB ="ldwm"; $BN_SZ =$SIZE_T; if (open CONF,"<${dir}../../opensslconf.h") { while(<CONF>) { if (m/#\s*define\s+SIXTY_FOUR_BIT/) { $BN_SZ=8; $LEVEL="2.0"; last; } } close CONF; } } $FRAME=8*$SIZE_T+$FRAME_MARKER; # 8 saved regs + frame marker # [+ argument transfer] $LOCALS=$FRAME-$FRAME_MARKER; $FRAME+=32; # local variables $tp="%r31"; $ti1="%r29"; $ti0="%r28"; $rp="%r26"; $ap="%r25"; $bp="%r24"; $np="%r23"; $n0="%r22"; # passed through stack in 32-bit $num="%r21"; # passed through stack in 32-bit $idx="%r20"; $arrsz="%r19"; $nm1="%r7"; $nm0="%r6"; $ab1="%r5"; $ab0="%r4"; $fp="%r3"; $hi1="%r2"; $hi0="%r1"; $xfer=$n0; # accommodates [-16..15] offset in fld[dw]s $fm0="%fr4"; $fti=$fm0; $fbi="%fr5L"; $fn0="%fr5R"; $fai="%fr6"; $fab0="%fr7"; $fab1="%fr8"; $fni="%fr9"; $fnm0="%fr10"; $fnm1="%fr11"; $code=<<___; .LEVEL $LEVEL .SPACE \$TEXT\$ .SUBSPA \$CODE\$,QUAD=0,ALIGN=8,ACCESS=0x2C,CODE_ONLY .EXPORT bn_mul_mont,ENTRY,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR .ALIGN 64 bn_mul_mont .PROC .CALLINFO FRAME=`$FRAME-8*$SIZE_T`,NO_CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=6 .ENTRY $PUSH %r2,-$SAVED_RP(%sp) ; standard prologue $PUSHMA %r3,$FRAME(%sp) $PUSH %r4,`-$FRAME+1*$SIZE_T`(%sp) $PUSH %r5,`-$FRAME+2*$SIZE_T`(%sp) $PUSH %r6,`-$FRAME+3*$SIZE_T`(%sp) $PUSH %r7,`-$FRAME+4*$SIZE_T`(%sp) $PUSH %r8,`-$FRAME+5*$SIZE_T`(%sp) $PUSH %r9,`-$FRAME+6*$SIZE_T`(%sp) $PUSH %r10,`-$FRAME+7*$SIZE_T`(%sp) ldo -$FRAME(%sp),$fp ___ $code.=<<___ if ($SIZE_T==4); ldw `-$FRAME_MARKER-4`($fp),$n0 ldw `-$FRAME_MARKER-8`($fp),$num nop nop ; alignment ___ $code.=<<___ if ($BN_SZ==4); comiclr,<= 6,$num,%r0 ; are vectors long enough? b L\$abort ldi 0,%r28 ; signal "unhandled" add,ev %r0,$num,$num ; is $num even? b L\$abort nop or $ap,$np,$ti1 extru,= $ti1,31,3,%r0 ; are ap and np 64-bit aligned? b L\$abort nop nop ; alignment nop fldws 0($n0),${fn0} fldws,ma 4($bp),${fbi} ; bp[0] ___ $code.=<<___ if ($BN_SZ==8); comib,> 3,$num,L\$abort ; are vectors long enough? ldi 0,%r28 ; signal "unhandled" addl $num,$num,$num ; I operate on 32-bit values fldws 4($n0),${fn0} ; only low part of n0 fldws 4($bp),${fbi} ; bp[0] in flipped word order ___ $code.=<<___; fldds 0($ap),${fai} ; ap[0,1] fldds 0($np),${fni} ; np[0,1] sh2addl $num,%r0,$arrsz ldi 31,$hi0 ldo 36($arrsz),$hi1 ; space for tp[num+1] andcm $hi1,$hi0,$hi1 ; align addl $hi1,%sp,%sp $PUSH $fp,-$SIZE_T(%sp) ldo `$LOCALS+16`($fp),$xfer ldo `$LOCALS+32+4`($fp),$tp xmpyu ${fai}L,${fbi},${fab0} ; ap[0]*bp[0] xmpyu ${fai}R,${fbi},${fab1} ; ap[1]*bp[0] xmpyu ${fn0},${fab0}R,${fm0} addl $arrsz,$ap,$ap ; point at the end addl $arrsz,$np,$np subi 0,$arrsz,$idx ; j=0 ldo 8($idx),$idx ; j++++ xmpyu ${fni}L,${fm0}R,${fnm0} ; np[0]*m xmpyu ${fni}R,${fm0}R,${fnm1} ; np[1]*m fstds ${fab0},-16($xfer) fstds ${fnm0},-8($xfer) fstds ${fab1},0($xfer) fstds ${fnm1},8($xfer) flddx $idx($ap),${fai} ; ap[2,3] flddx $idx($np),${fni} ; np[2,3] ___ $code.=<<___ if ($BN_SZ==4); mtctl $hi0,%cr11 ; $hi0 still holds 31 extrd,u,*= $hi0,%sar,1,$hi0 ; executes on PA-RISC 1.0 b L\$parisc11 nop ___ $code.=<<___; # PA-RISC 2.0 code-path xmpyu ${fai}L,${fbi},${fab0} ; ap[j]*bp[0] xmpyu ${fni}L,${fm0}R,${fnm0} ; np[j]*m ldd -16($xfer),$ab0 fstds ${fab0},-16($xfer) extrd,u $ab0,31,32,$hi0 extrd,u $ab0,63,32,$ab0 ldd -8($xfer),$nm0 fstds ${fnm0},-8($xfer) ldo 8($idx),$idx ; j++++ addl $ab0,$nm0,$nm0 ; low part is discarded extrd,u $nm0,31,32,$hi1 L\$1st xmpyu ${fai}R,${fbi},${fab1} ; ap[j+1]*bp[0] xmpyu ${fni}R,${fm0}R,${fnm1} ; np[j+1]*m ldd 0($xfer),$ab1 fstds ${fab1},0($xfer) addl $hi0,$ab1,$ab1 extrd,u $ab1,31,32,$hi0 ldd 8($xfer),$nm1 fstds ${fnm1},8($xfer) extrd,u $ab1,63,32,$ab1 addl $hi1,$nm1,$nm1 flddx $idx($ap),${fai} ; ap[j,j+1] flddx $idx($np),${fni} ; np[j,j+1] addl $ab1,$nm1,$nm1 extrd,u $nm1,31,32,$hi1 xmpyu ${fai}L,${fbi},${fab0} ; ap[j]*bp[0] xmpyu ${fni}L,${fm0}R,${fnm0} ; np[j]*m ldd -16($xfer),$ab0 fstds ${fab0},-16($xfer) addl $hi0,$ab0,$ab0 extrd,u $ab0,31,32,$hi0 ldd -8($xfer),$nm0 fstds ${fnm0},-8($xfer) extrd,u $ab0,63,32,$ab0 addl $hi1,$nm0,$nm0 stw $nm1,-4($tp) ; tp[j-1] addl $ab0,$nm0,$nm0 stw,ma $nm0,8($tp) ; tp[j-1] addib,<> 8,$idx,L\$1st ; j++++ extrd,u $nm0,31,32,$hi1 xmpyu ${fai}R,${fbi},${fab1} ; ap[j]*bp[0] xmpyu ${fni}R,${fm0}R,${fnm1} ; np[j]*m ldd 0($xfer),$ab1 fstds ${fab1},0($xfer) addl $hi0,$ab1,$ab1 extrd,u $ab1,31,32,$hi0 ldd 8($xfer),$nm1 fstds ${fnm1},8($xfer) extrd,u $ab1,63,32,$ab1 addl $hi1,$nm1,$nm1 ldd -16($xfer),$ab0 addl $ab1,$nm1,$nm1 ldd -8($xfer),$nm0 extrd,u $nm1,31,32,$hi1 addl $hi0,$ab0,$ab0 extrd,u $ab0,31,32,$hi0 stw $nm1,-4($tp) ; tp[j-1] extrd,u $ab0,63,32,$ab0 addl $hi1,$nm0,$nm0 ldd 0($xfer),$ab1 addl $ab0,$nm0,$nm0 ldd,mb 8($xfer),$nm1 extrd,u $nm0,31,32,$hi1 stw,ma $nm0,8($tp) ; tp[j-1] ldo -1($num),$num ; i-- subi 0,$arrsz,$idx ; j=0 ___ $code.=<<___ if ($BN_SZ==4); fldws,ma 4($bp),${fbi} ; bp[1] ___ $code.=<<___ if ($BN_SZ==8); fldws 0($bp),${fbi} ; bp[1] in flipped word order ___ $code.=<<___; flddx $idx($ap),${fai} ; ap[0,1] flddx $idx($np),${fni} ; np[0,1] fldws 8($xfer),${fti}R ; tp[0] addl $hi0,$ab1,$ab1 extrd,u $ab1,31,32,$hi0 extrd,u $ab1,63,32,$ab1 ldo 8($idx),$idx ; j++++ xmpyu ${fai}L,${fbi},${fab0} ; ap[0]*bp[1] xmpyu ${fai}R,${fbi},${fab1} ; ap[1]*bp[1] addl $hi1,$nm1,$nm1 addl $ab1,$nm1,$nm1 extrd,u $nm1,31,32,$hi1 fstws,mb ${fab0}L,-8($xfer) ; save high part stw $nm1,-4($tp) ; tp[j-1] fcpy,sgl %fr0,${fti}L ; zero high part fcpy,sgl %fr0,${fab0}L addl $hi1,$hi0,$hi0 extrd,u $hi0,31,32,$hi1 fcnvxf,dbl,dbl ${fti},${fti} ; 32-bit unsigned int -> double fcnvxf,dbl,dbl ${fab0},${fab0} stw $hi0,0($tp) stw $hi1,4($tp) fadd,dbl ${fti},${fab0},${fab0} ; add tp[0] fcnvfx,dbl,dbl ${fab0},${fab0} ; double -> 33-bit unsigned int xmpyu ${fn0},${fab0}R,${fm0} ldo `$LOCALS+32+4`($fp),$tp L\$outer xmpyu ${fni}L,${fm0}R,${fnm0} ; np[0]*m xmpyu ${fni}R,${fm0}R,${fnm1} ; np[1]*m fstds ${fab0},-16($xfer) ; 33-bit value fstds ${fnm0},-8($xfer) flddx $idx($ap),${fai} ; ap[2] flddx $idx($np),${fni} ; np[2] ldo 8($idx),$idx ; j++++ ldd -16($xfer),$ab0 ; 33-bit value ldd -8($xfer),$nm0 ldw 0($xfer),$hi0 ; high part xmpyu ${fai}L,${fbi},${fab0} ; ap[j]*bp[i] xmpyu ${fni}L,${fm0}R,${fnm0} ; np[j]*m extrd,u $ab0,31,32,$ti0 ; carry bit extrd,u $ab0,63,32,$ab0 fstds ${fab1},0($xfer) addl $ti0,$hi0,$hi0 ; account carry bit fstds ${fnm1},8($xfer) addl $ab0,$nm0,$nm0 ; low part is discarded ldw 0($tp),$ti1 ; tp[1] extrd,u $nm0,31,32,$hi1 fstds ${fab0},-16($xfer) fstds ${fnm0},-8($xfer) L\$inner xmpyu ${fai}R,${fbi},${fab1} ; ap[j+1]*bp[i] xmpyu ${fni}R,${fm0}R,${fnm1} ; np[j+1]*m ldd 0($xfer),$ab1 fstds ${fab1},0($xfer) addl $hi0,$ti1,$ti1 addl $ti1,$ab1,$ab1 ldd 8($xfer),$nm1 fstds ${fnm1},8($xfer) extrd,u $ab1,31,32,$hi0 extrd,u $ab1,63,32,$ab1 flddx $idx($ap),${fai} ; ap[j,j+1] flddx $idx($np),${fni} ; np[j,j+1] addl $hi1,$nm1,$nm1 addl $ab1,$nm1,$nm1 ldw 4($tp),$ti0 ; tp[j] stw $nm1,-4($tp) ; tp[j-1] xmpyu ${fai}L,${fbi},${fab0} ; ap[j]*bp[i] xmpyu ${fni}L,${fm0}R,${fnm0} ; np[j]*m ldd -16($xfer),$ab0 fstds ${fab0},-16($xfer) addl $hi0,$ti0,$ti0 addl $ti0,$ab0,$ab0 ldd -8($xfer),$nm0 fstds ${fnm0},-8($xfer) extrd,u $ab0,31,32,$hi0 extrd,u $nm1,31,32,$hi1 ldw 8($tp),$ti1 ; tp[j] extrd,u $ab0,63,32,$ab0 addl $hi1,$nm0,$nm0 addl $ab0,$nm0,$nm0 stw,ma $nm0,8($tp) ; tp[j-1] addib,<> 8,$idx,L\$inner ; j++++ extrd,u $nm0,31,32,$hi1 xmpyu ${fai}R,${fbi},${fab1} ; ap[j]*bp[i] xmpyu ${fni}R,${fm0}R,${fnm1} ; np[j]*m ldd 0($xfer),$ab1 fstds ${fab1},0($xfer) addl $hi0,$ti1,$ti1 addl $ti1,$ab1,$ab1 ldd 8($xfer),$nm1 fstds ${fnm1},8($xfer) extrd,u $ab1,31,32,$hi0 extrd,u $ab1,63,32,$ab1 ldw 4($tp),$ti0 ; tp[j] addl $hi1,$nm1,$nm1 addl $ab1,$nm1,$nm1 ldd -16($xfer),$ab0 ldd -8($xfer),$nm0 extrd,u $nm1,31,32,$hi1 addl $hi0,$ab0,$ab0 addl $ti0,$ab0,$ab0 stw $nm1,-4($tp) ; tp[j-1] extrd,u $ab0,31,32,$hi0 ldw 8($tp),$ti1 ; tp[j] extrd,u $ab0,63,32,$ab0 addl $hi1,$nm0,$nm0 ldd 0($xfer),$ab1 addl $ab0,$nm0,$nm0 ldd,mb 8($xfer),$nm1 extrd,u $nm0,31,32,$hi1 stw,ma $nm0,8($tp) ; tp[j-1] addib,= -1,$num,L\$outerdone ; i-- subi 0,$arrsz,$idx ; j=0 ___ $code.=<<___ if ($BN_SZ==4); fldws,ma 4($bp),${fbi} ; bp[i] ___ $code.=<<___ if ($BN_SZ==8); ldi 12,$ti0 ; bp[i] in flipped word order addl,ev %r0,$num,$num ldi -4,$ti0 addl $ti0,$bp,$bp fldws 0($bp),${fbi} ___ $code.=<<___; flddx $idx($ap),${fai} ; ap[0] addl $hi0,$ab1,$ab1 flddx $idx($np),${fni} ; np[0] fldws 8($xfer),${fti}R ; tp[0] addl $ti1,$ab1,$ab1 extrd,u $ab1,31,32,$hi0 extrd,u $ab1,63,32,$ab1 ldo 8($idx),$idx ; j++++ xmpyu ${fai}L,${fbi},${fab0} ; ap[0]*bp[i] xmpyu ${fai}R,${fbi},${fab1} ; ap[1]*bp[i] ldw 4($tp),$ti0 ; tp[j] addl $hi1,$nm1,$nm1 fstws,mb ${fab0}L,-8($xfer) ; save high part addl $ab1,$nm1,$nm1 extrd,u $nm1,31,32,$hi1 fcpy,sgl %fr0,${fti}L ; zero high part fcpy,sgl %fr0,${fab0}L stw $nm1,-4($tp) ; tp[j-1] fcnvxf,dbl,dbl ${fti},${fti} ; 32-bit unsigned int -> double fcnvxf,dbl,dbl ${fab0},${fab0} addl $hi1,$hi0,$hi0 fadd,dbl ${fti},${fab0},${fab0} ; add tp[0] addl $ti0,$hi0,$hi0 extrd,u $hi0,31,32,$hi1 fcnvfx,dbl,dbl ${fab0},${fab0} ; double -> 33-bit unsigned int stw $hi0,0($tp) stw $hi1,4($tp) xmpyu ${fn0},${fab0}R,${fm0} b L\$outer ldo `$LOCALS+32+4`($fp),$tp L\$outerdone addl $hi0,$ab1,$ab1 addl $ti1,$ab1,$ab1 extrd,u $ab1,31,32,$hi0 extrd,u $ab1,63,32,$ab1 ldw 4($tp),$ti0 ; tp[j] addl $hi1,$nm1,$nm1 addl $ab1,$nm1,$nm1 extrd,u $nm1,31,32,$hi1 stw $nm1,-4($tp) ; tp[j-1] addl $hi1,$hi0,$hi0 addl $ti0,$hi0,$hi0 extrd,u $hi0,31,32,$hi1 stw $hi0,0($tp) stw $hi1,4($tp) ldo `$LOCALS+32`($fp),$tp sub %r0,%r0,%r0 ; clear borrow ___ $code.=<<___ if ($BN_SZ==4); ldws,ma 4($tp),$ti0 extru,= $rp,31,3,%r0 ; is rp 64-bit aligned? b L\$sub_pa11 addl $tp,$arrsz,$tp L\$sub ldwx $idx($np),$hi0 subb $ti0,$hi0,$hi1 ldwx $idx($tp),$ti0 addib,<> 4,$idx,L\$sub stws,ma $hi1,4($rp) subb $ti0,%r0,$hi1 ___ $code.=<<___ if ($BN_SZ==8); ldd,ma 8($tp),$ti0 L\$sub ldd $idx($np),$hi0 shrpd $ti0,$ti0,32,$ti0 ; flip word order std $ti0,-8($tp) ; save flipped value sub,db $ti0,$hi0,$hi1 ldd,ma 8($tp),$ti0 addib,<> 8,$idx,L\$sub std,ma $hi1,8($rp) extrd,u $ti0,31,32,$ti0 ; carry in flipped word order sub,db $ti0,%r0,$hi1 ___ $code.=<<___; ldo `$LOCALS+32`($fp),$tp sub $rp,$arrsz,$rp ; rewind rp subi 0,$arrsz,$idx L\$copy ldd 0($tp),$ti0 ldd 0($rp),$hi0 std,ma %r0,8($tp) comiclr,= 0,$hi1,%r0 copy $ti0,$hi0 addib,<> 8,$idx,L\$copy std,ma $hi0,8($rp) ___ if ($BN_SZ==4) { # PA-RISC 1.1 code-path $ablo=$ab0; $abhi=$ab1; $nmlo0=$nm0; $nmhi0=$nm1; $nmlo1="%r9"; $nmhi1="%r8"; $code.=<<___; b L\$done nop .ALIGN 8 L\$parisc11 xmpyu ${fai}L,${fbi},${fab0} ; ap[j]*bp[0] xmpyu ${fni}L,${fm0}R,${fnm0} ; np[j]*m ldw -12($xfer),$ablo ldw -16($xfer),$hi0 ldw -4($xfer),$nmlo0 ldw -8($xfer),$nmhi0 fstds ${fab0},-16($xfer) fstds ${fnm0},-8($xfer) ldo 8($idx),$idx ; j++++ add $ablo,$nmlo0,$nmlo0 ; discarded addc %r0,$nmhi0,$hi1 ldw 4($xfer),$ablo ldw 0($xfer),$abhi nop L\$1st_pa11 xmpyu ${fai}R,${fbi},${fab1} ; ap[j+1]*bp[0] flddx $idx($ap),${fai} ; ap[j,j+1] xmpyu ${fni}R,${fm0}R,${fnm1} ; np[j+1]*m flddx $idx($np),${fni} ; np[j,j+1] add $hi0,$ablo,$ablo ldw 12($xfer),$nmlo1 addc %r0,$abhi,$hi0 ldw 8($xfer),$nmhi1 add $ablo,$nmlo1,$nmlo1 fstds ${fab1},0($xfer) addc %r0,$nmhi1,$nmhi1 fstds ${fnm1},8($xfer) add $hi1,$nmlo1,$nmlo1 ldw -12($xfer),$ablo addc %r0,$nmhi1,$hi1 ldw -16($xfer),$abhi xmpyu ${fai}L,${fbi},${fab0} ; ap[j]*bp[0] ldw -4($xfer),$nmlo0 xmpyu ${fni}L,${fm0}R,${fnm0} ; np[j]*m ldw -8($xfer),$nmhi0 add $hi0,$ablo,$ablo stw $nmlo1,-4($tp) ; tp[j-1] addc %r0,$abhi,$hi0 fstds ${fab0},-16($xfer) add $ablo,$nmlo0,$nmlo0 fstds ${fnm0},-8($xfer) addc %r0,$nmhi0,$nmhi0 ldw 0($xfer),$abhi add $hi1,$nmlo0,$nmlo0 ldw 4($xfer),$ablo stws,ma $nmlo0,8($tp) ; tp[j-1] addib,<> 8,$idx,L\$1st_pa11 ; j++++ addc %r0,$nmhi0,$hi1 ldw 8($xfer),$nmhi1 ldw 12($xfer),$nmlo1 xmpyu ${fai}R,${fbi},${fab1} ; ap[j]*bp[0] xmpyu ${fni}R,${fm0}R,${fnm1} ; np[j]*m add $hi0,$ablo,$ablo fstds ${fab1},0($xfer) addc %r0,$abhi,$hi0 fstds ${fnm1},8($xfer) add $ablo,$nmlo1,$nmlo1 ldw -16($xfer),$abhi addc %r0,$nmhi1,$nmhi1 ldw -12($xfer),$ablo add $hi1,$nmlo1,$nmlo1 ldw -8($xfer),$nmhi0 addc %r0,$nmhi1,$hi1 ldw -4($xfer),$nmlo0 add $hi0,$ablo,$ablo stw $nmlo1,-4($tp) ; tp[j-1] addc %r0,$abhi,$hi0 ldw 0($xfer),$abhi add $ablo,$nmlo0,$nmlo0 ldw 4($xfer),$ablo addc %r0,$nmhi0,$nmhi0 ldws,mb 8($xfer),$nmhi1 add $hi1,$nmlo0,$nmlo0 ldw 4($xfer),$nmlo1 addc %r0,$nmhi0,$hi1 stws,ma $nmlo0,8($tp) ; tp[j-1] ldo -1($num),$num ; i-- subi 0,$arrsz,$idx ; j=0 fldws,ma 4($bp),${fbi} ; bp[1] flddx $idx($ap),${fai} ; ap[0,1] flddx $idx($np),${fni} ; np[0,1] fldws 8($xfer),${fti}R ; tp[0] add $hi0,$ablo,$ablo addc %r0,$abhi,$hi0 ldo 8($idx),$idx ; j++++ xmpyu ${fai}L,${fbi},${fab0} ; ap[0]*bp[1] xmpyu ${fai}R,${fbi},${fab1} ; ap[1]*bp[1] add $hi1,$nmlo1,$nmlo1 addc %r0,$nmhi1,$nmhi1 add $ablo,$nmlo1,$nmlo1 addc %r0,$nmhi1,$hi1 fstws,mb ${fab0}L,-8($xfer) ; save high part stw $nmlo1,-4($tp) ; tp[j-1] fcpy,sgl %fr0,${fti}L ; zero high part fcpy,sgl %fr0,${fab0}L add $hi1,$hi0,$hi0 addc %r0,%r0,$hi1 fcnvxf,dbl,dbl ${fti},${fti} ; 32-bit unsigned int -> double fcnvxf,dbl,dbl ${fab0},${fab0} stw $hi0,0($tp) stw $hi1,4($tp) fadd,dbl ${fti},${fab0},${fab0} ; add tp[0] fcnvfx,dbl,dbl ${fab0},${fab0} ; double -> 33-bit unsigned int xmpyu ${fn0},${fab0}R,${fm0} ldo `$LOCALS+32+4`($fp),$tp L\$outer_pa11 xmpyu ${fni}L,${fm0}R,${fnm0} ; np[0]*m xmpyu ${fni}R,${fm0}R,${fnm1} ; np[1]*m fstds ${fab0},-16($xfer) ; 33-bit value fstds ${fnm0},-8($xfer) flddx $idx($ap),${fai} ; ap[2,3] flddx $idx($np),${fni} ; np[2,3] ldw -16($xfer),$abhi ; carry bit actually ldo 8($idx),$idx ; j++++ ldw -12($xfer),$ablo ldw -8($xfer),$nmhi0 ldw -4($xfer),$nmlo0 ldw 0($xfer),$hi0 ; high part xmpyu ${fai}L,${fbi},${fab0} ; ap[j]*bp[i] xmpyu ${fni}L,${fm0}R,${fnm0} ; np[j]*m fstds ${fab1},0($xfer) addl $abhi,$hi0,$hi0 ; account carry bit fstds ${fnm1},8($xfer) add $ablo,$nmlo0,$nmlo0 ; discarded ldw 0($tp),$ti1 ; tp[1] addc %r0,$nmhi0,$hi1 fstds ${fab0},-16($xfer) fstds ${fnm0},-8($xfer) ldw 4($xfer),$ablo ldw 0($xfer),$abhi L\$inner_pa11 xmpyu ${fai}R,${fbi},${fab1} ; ap[j+1]*bp[i] flddx $idx($ap),${fai} ; ap[j,j+1] xmpyu ${fni}R,${fm0}R,${fnm1} ; np[j+1]*m flddx $idx($np),${fni} ; np[j,j+1] add $hi0,$ablo,$ablo ldw 4($tp),$ti0 ; tp[j] addc %r0,$abhi,$abhi ldw 12($xfer),$nmlo1 add $ti1,$ablo,$ablo ldw 8($xfer),$nmhi1 addc %r0,$abhi,$hi0 fstds ${fab1},0($xfer) add $ablo,$nmlo1,$nmlo1 fstds ${fnm1},8($xfer) addc %r0,$nmhi1,$nmhi1 ldw -12($xfer),$ablo add $hi1,$nmlo1,$nmlo1 ldw -16($xfer),$abhi addc %r0,$nmhi1,$hi1 xmpyu ${fai}L,${fbi},${fab0} ; ap[j]*bp[i] ldw 8($tp),$ti1 ; tp[j] xmpyu ${fni}L,${fm0}R,${fnm0} ; np[j]*m ldw -4($xfer),$nmlo0 add $hi0,$ablo,$ablo ldw -8($xfer),$nmhi0 addc %r0,$abhi,$abhi stw $nmlo1,-4($tp) ; tp[j-1] add $ti0,$ablo,$ablo fstds ${fab0},-16($xfer) addc %r0,$abhi,$hi0 fstds ${fnm0},-8($xfer) add $ablo,$nmlo0,$nmlo0 ldw 4($xfer),$ablo addc %r0,$nmhi0,$nmhi0 ldw 0($xfer),$abhi add $hi1,$nmlo0,$nmlo0 stws,ma $nmlo0,8($tp) ; tp[j-1] addib,<> 8,$idx,L\$inner_pa11 ; j++++ addc %r0,$nmhi0,$hi1 xmpyu ${fai}R,${fbi},${fab1} ; ap[j]*bp[i] ldw 12($xfer),$nmlo1 xmpyu ${fni}R,${fm0}R,${fnm1} ; np[j]*m ldw 8($xfer),$nmhi1 add $hi0,$ablo,$ablo ldw 4($tp),$ti0 ; tp[j] addc %r0,$abhi,$abhi fstds ${fab1},0($xfer) add $ti1,$ablo,$ablo fstds ${fnm1},8($xfer) addc %r0,$abhi,$hi0 ldw -16($xfer),$abhi add $ablo,$nmlo1,$nmlo1 ldw -12($xfer),$ablo addc %r0,$nmhi1,$nmhi1 ldw -8($xfer),$nmhi0 add $hi1,$nmlo1,$nmlo1 ldw -4($xfer),$nmlo0 addc %r0,$nmhi1,$hi1 add $hi0,$ablo,$ablo stw $nmlo1,-4($tp) ; tp[j-1] addc %r0,$abhi,$abhi add $ti0,$ablo,$ablo ldw 8($tp),$ti1 ; tp[j] addc %r0,$abhi,$hi0 ldw 0($xfer),$abhi add $ablo,$nmlo0,$nmlo0 ldw 4($xfer),$ablo addc %r0,$nmhi0,$nmhi0 ldws,mb 8($xfer),$nmhi1 add $hi1,$nmlo0,$nmlo0 ldw 4($xfer),$nmlo1 addc %r0,$nmhi0,$hi1 stws,ma $nmlo0,8($tp) ; tp[j-1] addib,= -1,$num,L\$outerdone_pa11; i-- subi 0,$arrsz,$idx ; j=0 fldws,ma 4($bp),${fbi} ; bp[i] flddx $idx($ap),${fai} ; ap[0] add $hi0,$ablo,$ablo addc %r0,$abhi,$abhi flddx $idx($np),${fni} ; np[0] fldws 8($xfer),${fti}R ; tp[0] add $ti1,$ablo,$ablo addc %r0,$abhi,$hi0 ldo 8($idx),$idx ; j++++ xmpyu ${fai}L,${fbi},${fab0} ; ap[0]*bp[i] xmpyu ${fai}R,${fbi},${fab1} ; ap[1]*bp[i] ldw 4($tp),$ti0 ; tp[j] add $hi1,$nmlo1,$nmlo1 addc %r0,$nmhi1,$nmhi1 fstws,mb ${fab0}L,-8($xfer) ; save high part add $ablo,$nmlo1,$nmlo1 addc %r0,$nmhi1,$hi1 fcpy,sgl %fr0,${fti}L ; zero high part fcpy,sgl %fr0,${fab0}L stw $nmlo1,-4($tp) ; tp[j-1] fcnvxf,dbl,dbl ${fti},${fti} ; 32-bit unsigned int -> double fcnvxf,dbl,dbl ${fab0},${fab0} add $hi1,$hi0,$hi0 addc %r0,%r0,$hi1 fadd,dbl ${fti},${fab0},${fab0} ; add tp[0] add $ti0,$hi0,$hi0 addc %r0,$hi1,$hi1 fcnvfx,dbl,dbl ${fab0},${fab0} ; double -> 33-bit unsigned int stw $hi0,0($tp) stw $hi1,4($tp) xmpyu ${fn0},${fab0}R,${fm0} b L\$outer_pa11 ldo `$LOCALS+32+4`($fp),$tp L\$outerdone_pa11 add $hi0,$ablo,$ablo addc %r0,$abhi,$abhi add $ti1,$ablo,$ablo addc %r0,$abhi,$hi0 ldw 4($tp),$ti0 ; tp[j] add $hi1,$nmlo1,$nmlo1 addc %r0,$nmhi1,$nmhi1 add $ablo,$nmlo1,$nmlo1 addc %r0,$nmhi1,$hi1 stw $nmlo1,-4($tp) ; tp[j-1] add $hi1,$hi0,$hi0 addc %r0,%r0,$hi1 add $ti0,$hi0,$hi0 addc %r0,$hi1,$hi1 stw $hi0,0($tp) stw $hi1,4($tp) ldo `$LOCALS+32+4`($fp),$tp sub %r0,%r0,%r0 ; clear borrow ldw -4($tp),$ti0 addl $tp,$arrsz,$tp L\$sub_pa11 ldwx $idx($np),$hi0 subb $ti0,$hi0,$hi1 ldwx $idx($tp),$ti0 addib,<> 4,$idx,L\$sub_pa11 stws,ma $hi1,4($rp) subb $ti0,%r0,$hi1 ldo `$LOCALS+32`($fp),$tp sub $rp,$arrsz,$rp ; rewind rp subi 0,$arrsz,$idx L\$copy_pa11 ldw 0($tp),$ti0 ldw 0($rp),$hi0 stws,ma %r0,4($tp) comiclr,= 0,$hi1,%r0 copy $ti0,$hi0 addib,<> 4,$idx,L\$copy_pa11 stws,ma $hi0,4($rp) nop ; alignment L\$done ___ } $code.=<<___; ldi 1,%r28 ; signal "handled" ldo $FRAME($fp),%sp ; destroy tp[num+1] $POP `-$FRAME-$SAVED_RP`(%sp),%r2 ; standard epilogue $POP `-$FRAME+1*$SIZE_T`(%sp),%r4 $POP `-$FRAME+2*$SIZE_T`(%sp),%r5 $POP `-$FRAME+3*$SIZE_T`(%sp),%r6 $POP `-$FRAME+4*$SIZE_T`(%sp),%r7 $POP `-$FRAME+5*$SIZE_T`(%sp),%r8 $POP `-$FRAME+6*$SIZE_T`(%sp),%r9 $POP `-$FRAME+7*$SIZE_T`(%sp),%r10 L\$abort bv (%r2) .EXIT $POPMB -$FRAME(%sp),%r3 .PROCEND .STRINGZ "Montgomery Multiplication for PA-RISC, CRYPTOGAMS by <appro\@openssl.org>" ___ # Explicitly encode PA-RISC 2.0 instructions used in this module, so # that it can be compiled with .LEVEL 1.0. It should be noted that I # wouldn't have to do this, if GNU assembler understood .ALLOW 2.0 # directive... my $ldd = sub { my ($mod,$args) = @_; my $orig = "ldd$mod\t$args"; if ($args =~ /%r([0-9]+)\(%r([0-9]+)\),%r([0-9]+)/) # format 4 { my $opcode=(0x03<<26)|($2<<21)|($1<<16)|(3<<6)|$3; sprintf "\t.WORD\t0x%08x\t; %s",$opcode,$orig; } elsif ($args =~ /(\-?[0-9]+)\(%r([0-9]+)\),%r([0-9]+)/) # format 5 { my $opcode=(0x03<<26)|($2<<21)|(1<<12)|(3<<6)|$3; $opcode|=(($1&0xF)<<17)|(($1&0x10)<<12); # encode offset $opcode|=(1<<5) if ($mod =~ /^,m/); $opcode|=(1<<13) if ($mod =~ /^,mb/); sprintf "\t.WORD\t0x%08x\t; %s",$opcode,$orig; } else { "\t".$orig; } }; my $std = sub { my ($mod,$args) = @_; my $orig = "std$mod\t$args"; if ($args =~ /%r([0-9]+),(\-?[0-9]+)\(%r([0-9]+)\)/) # format 6 { my $opcode=(0x03<<26)|($3<<21)|($1<<16)|(1<<12)|(0xB<<6); $opcode|=(($2&0xF)<<1)|(($2&0x10)>>4); # encode offset $opcode|=(1<<5) if ($mod =~ /^,m/); $opcode|=(1<<13) if ($mod =~ /^,mb/); sprintf "\t.WORD\t0x%08x\t; %s",$opcode,$orig; } else { "\t".$orig; } }; my $extrd = sub { my ($mod,$args) = @_; my $orig = "extrd$mod\t$args"; # I only have ",u" completer, it's implicitly encoded... if ($args =~ /%r([0-9]+),([0-9]+),([0-9]+),%r([0-9]+)/) # format 15 { my $opcode=(0x36<<26)|($1<<21)|($4<<16); my $len=32-$3; $opcode |= (($2&0x20)<<6)|(($2&0x1f)<<5); # encode pos $opcode |= (($len&0x20)<<7)|($len&0x1f); # encode len sprintf "\t.WORD\t0x%08x\t; %s",$opcode,$orig; } elsif ($args =~ /%r([0-9]+),%sar,([0-9]+),%r([0-9]+)/) # format 12 { my $opcode=(0x34<<26)|($1<<21)|($3<<16)|(2<<11)|(1<<9); my $len=32-$2; $opcode |= (($len&0x20)<<3)|($len&0x1f); # encode len $opcode |= (1<<13) if ($mod =~ /,\**=/); sprintf "\t.WORD\t0x%08x\t; %s",$opcode,$orig; } else { "\t".$orig; } }; my $shrpd = sub { my ($mod,$args) = @_; my $orig = "shrpd$mod\t$args"; if ($args =~ /%r([0-9]+),%r([0-9]+),([0-9]+),%r([0-9]+)/) # format 14 { my $opcode=(0x34<<26)|($2<<21)|($1<<16)|(1<<10)|$4; my $cpos=63-$3; $opcode |= (($cpos&0x20)<<6)|(($cpos&0x1f)<<5); # encode sa sprintf "\t.WORD\t0x%08x\t; %s",$opcode,$orig; } else { "\t".$orig; } }; my $sub = sub { my ($mod,$args) = @_; my $orig = "sub$mod\t$args"; if ($mod eq ",db" && $args =~ /%r([0-9]+),%r([0-9]+),%r([0-9]+)/) { my $opcode=(0x02<<26)|($2<<21)|($1<<16)|$3; $opcode|=(1<<10); # e1 $opcode|=(1<<8); # e2 $opcode|=(1<<5); # d sprintf "\t.WORD\t0x%08x\t; %s",$opcode,$orig } else { "\t".$orig; } }; sub assemble { my ($mnemonic,$mod,$args)=@_; my $opcode = eval("\$$mnemonic"); ref($opcode) eq 'CODE' ? &$opcode($mod,$args) : "\t$mnemonic$mod\t$args"; } if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1` =~ /GNU assembler/) { $gnuas = 1; } foreach (split("\n",$code)) { s/\`([^\`]*)\`/eval $1/ge; # flip word order in 64-bit mode... s/(xmpyu\s+)($fai|$fni)([LR])/$1.$2.($3 eq "L"?"R":"L")/e if ($BN_SZ==8); # assemble 2.0 instructions in 32-bit mode... s/^\s+([a-z]+)([\S]*)\s+([\S]*)/&assemble($1,$2,$3)/e if ($BN_SZ==4); s/(\.LEVEL\s+2\.0)W/$1w/ if ($gnuas && $SIZE_T==8); s/\.SPACE\s+\$TEXT\$/.text/ if ($gnuas && $SIZE_T==8); s/\.SUBSPA.*// if ($gnuas && $SIZE_T==8); s/\bbv\b/bve/ if ($SIZE_T==8); print $_,"\n"; } close STDOUT or die "error closing STDOUT: $!";
27.571853
85
0.57092
ed693945c187c263ca8329521eb723f54b07e927
3,767
pm
Perl
auto-lib/Paws/STS/AssumeRoleWithSAML.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
2
2016-09-22T09:18:33.000Z
2017-06-20T01:36:58.000Z
auto-lib/Paws/STS/AssumeRoleWithSAML.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/STS/AssumeRoleWithSAML.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
null
null
null
package Paws::STS::AssumeRoleWithSAML; use Moose; has DurationSeconds => (is => 'ro', isa => 'Int'); has Policy => (is => 'ro', isa => 'Str'); has PrincipalArn => (is => 'ro', isa => 'Str', required => 1); has RoleArn => (is => 'ro', isa => 'Str', required => 1); has SAMLAssertion => (is => 'ro', isa => 'Str', required => 1); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'AssumeRoleWithSAML'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::STS::AssumeRoleWithSAMLResponse'); class_has _result_key => (isa => 'Str', is => 'ro', default => 'AssumeRoleWithSAMLResult'); 1; ### main pod documentation begin ### =head1 NAME Paws::STS::AssumeRoleWithSAML - Arguments for method AssumeRoleWithSAML on Paws::STS =head1 DESCRIPTION This class represents the parameters used for calling the method AssumeRoleWithSAML on the AWS Security Token Service service. Use the attributes of this class as arguments to method AssumeRoleWithSAML. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to AssumeRoleWithSAML. As an example: $service_obj->AssumeRoleWithSAML(Att1 => $value1, Att2 => $value2, ...); Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. =head1 ATTRIBUTES =head2 DurationSeconds => Int The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds. An expiration can also be specified in the SAML authentication response's C<SessionNotOnOrAfter> value. The actual expiration time is whichever value is shorter. The maximum duration for a session is 1 hour, and the minimum duration is 15 minutes, even if values outside this range are specified. =head2 Policy => Str An IAM policy in JSON format. The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, I<B<and>> the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the I<IAM User Guide>. The policy plain text must be 2048 bytes or shorter. However, an internal conversion compresses it into a packed binary format with a separate limit. The PackedPolicySize response element indicates by percentage how close to the upper size limit the policy is, with 100% equaling the maximum allowed size. =head2 B<REQUIRED> PrincipalArn => Str The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP. =head2 B<REQUIRED> RoleArn => Str The Amazon Resource Name (ARN) of the role that the caller is assuming. =head2 B<REQUIRED> SAMLAssertion => Str The base-64 encoded SAML authentication response provided by the IdP. For more information, see Configuring a Relying Party and Adding Claims in the I<Using IAM> guide. =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method AssumeRoleWithSAML in L<Paws::STS> =head1 BUGS and CONTRIBUTIONS The source code is located here: https://github.com/pplu/aws-sdk-perl Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues =cut
33.936937
249
0.751526
ed3712d0b2ac28feb11452ca895c37dc2077f496
4,054
pm
Perl
lib/Net/Amazon/S3/ACL/Set.pm
kdesjard/net-amazon-s3
fff55f3a84cf3423ad7b5fa84813dcd30580897b
[ "Artistic-1.0" ]
13
2015-03-29T05:06:35.000Z
2021-12-23T20:51:43.000Z
lib/Net/Amazon/S3/ACL/Set.pm
kdesjard/net-amazon-s3
fff55f3a84cf3423ad7b5fa84813dcd30580897b
[ "Artistic-1.0" ]
92
2015-05-18T15:20:03.000Z
2022-01-14T14:08:05.000Z
lib/Net/Amazon/S3/ACL/Set.pm
kdesjard/net-amazon-s3
fff55f3a84cf3423ad7b5fa84813dcd30580897b
[ "Artistic-1.0" ]
39
2015-03-01T14:12:16.000Z
2021-12-01T17:50:18.000Z
package Net::Amazon::S3::ACL::Set; # ABSTRACT: Representation of explicit ACL use Moose 0.85; use MooseX::StrictConstructor 0.16; use Moose::Util::TypeConstraints; use Ref::Util (); use Safe::Isa (); use Net::Amazon::S3::Constants; use Net::Amazon::S3::ACL::Grantee::User; use Net::Amazon::S3::ACL::Grantee::Group; use Net::Amazon::S3::ACL::Grantee::Email; class_type 'Net::Amazon::S3::ACL::Set'; my %permission_map = ( full_control => Net::Amazon::S3::Constants::HEADER_GRANT_FULL_CONTROL, read => Net::Amazon::S3::Constants::HEADER_GRANT_READ, read_acp => Net::Amazon::S3::Constants::HEADER_GRANT_READ_ACP, write => Net::Amazon::S3::Constants::HEADER_GRANT_WRITE, write_acp => Net::Amazon::S3::Constants::HEADER_GRANT_WRITE_ACP, ); my %grantees_map = ( id => 'Net::Amazon::S3::ACL::Grantee::User', user => 'Net::Amazon::S3::ACL::Grantee::User', uri => 'Net::Amazon::S3::ACL::Grantee::Group', group => 'Net::Amazon::S3::ACL::Grantee::Group', email => 'Net::Amazon::S3::ACL::Grantee::Email', ); has _grantees => ( is => 'ro', default => sub { +{} }, ); sub build_headers { my ($self) = @_; my %headers; while (my ($header, $grantees) = each %{ $self->_grantees }) { $headers{$header} = join ', ', map $_->format_for_header, @$grantees; } %headers; } sub grant_full_control { my ($self, @grantees) = @_; $self->_grant (full_control => @grantees); } sub grant_read { my ($self, @grantees) = @_; $self->_grant (read => @grantees); } sub grant_read_acp { my ($self, @grantees) = @_; $self->_grant (read_acp => @grantees); } sub grant_write { my ($self, @grantees) = @_; $self->_grant (write => @grantees); } sub grant_write_acp { my ($self, @grantees) = @_; $self->_grant (write_acp => @grantees); } sub _grant { my ($self, $permission, @grantees) = @_; $self = $self->new unless ref $self; my $key = lc $permission; $key =~ tr/-/_/; die "Unknown permission $permission" unless exists $permission_map{$key}; return unless @grantees; my $list = $self->_grantees->{$permission_map{$key}} ||= []; while (@grantees) { my $type = shift @grantees; if ($type->$Safe::Isa::_isa ('Net::Amazon::S3::ACL::Grantee')) { push @{ $list }, $type; next; } die "Unknown grantee type $type" unless exists $grantees_map{$type}; die "Grantee type $type requires one argument" unless @grantees; my @grantee = (shift @grantees); @grantees = @{ $grantee[0] } if Ref::Util::is_plain_arrayref ($grantee[0]); push @{ $list }, map $grantees_map{$type}->new ($_), @grantee; } return $self; } 1; __END__ =pod =encoding utf8 =head1 SYNOPSIS use Net::Amazon::S3::ACL; $acl = Net::Amazon::S3::ACL->new ->grant_full_control ( id => 11112222333, id => 444455556666, uri => 'predefined group uri', email => 'email-address', ) ->grant_write ( ... ) ; =head1 DESCRIPTION Class representing explicit Amazon S3 ACL configuration. =head1 METHODS =head2 new Creates new instance. =head2 grant_full_control (@grantees) =head2 grant_read (@grantees) =head2 grant_read_acp (@grantees) =head2 grant_write (@grantees) =head2 grant_write_acp (@grantees) =head1 GRANTEES See also L<"Who Is a Grantee?"|https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#specifying-grantee> in Amazon S3 documentation. Each grant_* method accepts list of grantees either in key-value format or as an instance of C<Net::Amazon::S3::ACL::Grantee::*>. =over =item canonical user ID ->grant_read ( id => 123, Net::Amazon::S3::ACL::Grantee::User->new (123), ) =item predefined group uri ->grant_read ( uri => 'http://...', Net::Amazon::S3::ACL::Grantee::Group->new ('http://...'), Net::Amazon::S3::ACL::Grantee::Group->ALL_USERS, ) =item email address ->grant_read ( email => 'foo@bar.baz', Net::Amazon::S3::ACL::Grantee::Email->new ('foo@bar.baz'), ); =back =head1 AUTHOR Branislav Zahradník <barney@cpan.org> =head1 COPYRIGHT AND LICENSE This module is part of L<Net::Amazon::S3>. =cut
19.77561
116
0.647509
ed883d098109194254f1939c43d9dc020a37c034
2,542
pl
Perl
extra_reports_creator/create_extra_reports.pl
Devils-Knight/mycpan-indexer
d4ecb45a17edd938dd8b652bbcbf22246fe96b88
[ "Artistic-2.0" ]
1
2016-05-08T12:59:59.000Z
2016-05-08T12:59:59.000Z
extra_reports_creator/create_extra_reports.pl
Devils-Knight/mycpan-indexer
d4ecb45a17edd938dd8b652bbcbf22246fe96b88
[ "Artistic-2.0" ]
2
2015-03-09T16:19:00.000Z
2021-07-07T21:53:17.000Z
extra_reports_creator/create_extra_reports.pl
Devils-Knight/mycpan-indexer
d4ecb45a17edd938dd8b652bbcbf22246fe96b88
[ "Artistic-2.0" ]
7
2015-02-16T14:47:22.000Z
2022-03-13T15:53:45.000Z
#!perl use utf8; use 5.010; use strict; use warnings; use File::Basename qw( basename ); use File::Spec::Functions qw( catfile ); use YAML qw( LoadFile ); my @dirs = @ARGV; my $count; my $output_dir = 'extra_reports'; mkdir $output_dir, 0755 unless -d $output_dir; foreach my $dir ( @dirs ) { opendir my $dh, $dir or warn "Could not open $dir: $!\n"; FILE: while( my $file = readdir( $dh ) ) { next if $file =~ /^\./; my $yaml = eval { LoadFile( catfile( $dir, $file ) ) }; unless( defined $yaml ) { warn "$file did not parse correctly\n"; next FILE; } if( $yaml->{run_info}{indexer_id} =~ /joe\@example\.com/ ) { $yaml->{run_info}{indexer_id} = 'brian d foy <brian.d.foy@gmail.com>'; } my $dist_file = $yaml->{dist_info}{dist_file}; unless( defined $yaml->{dist_info}{dist_file} ) { warn "$file did have a dist_file entry\n"; next FILE; } $dist_file =~ s/.*authors.id.//; my $basename = basename( $dist_file ); my $stripped = $basename =~ s/\.(tar\.gz|tgz|zip)\z//; unless( $stripped ) { warn "[$basename] still has a file extension\n"; } open my $fh, '>', catfile( $output_dir, $basename ) or do { warn "Could not open extra reports file for [$dist_file]: $!\n"; next FILE; }; print $fh <<"HEADER"; # This is an extract of the packages and versions found in a Perl distribution. # You can use collections of these files with MyCPAN::App::DPAN so you don't # have to analyze files yourself when you want to create a new version of # your custom CPAN. # # This extra report was extracted from # # run: $yaml->{run_info}{uuid} # date: @{ [ scalar localtime $yaml->{run_info}{run_start_time} ] } ($yaml->{run_info}{run_start_time}) # system: $yaml->{run_info}{system_id} # runner: $yaml->{run_info}{indexer_id} # # PACKAGE [TAB] VERSION [TAB] RELATIVE DISTRO FILE HEADER foreach my $module ( @{ $yaml->{dist_info}{module_info} } ) { no warnings 'uninitialized'; my $version = $module->{version_info}{value}; if( $version =~ /[^0-9_.]/ ) { my $hex = unpack 'H*', $version; warn "Strange version in $file for $module->{primary_package}: [$version|$hex]\n"; } write_line( $fh, { version => $version || '', distro => $dist_file, 'package' => $module->{primary_package}, } ); } } } sub write_line { my( $fh, $hash ) = @_; no warnings 'uninitialized'; say $fh join "\t", @{ $hash }{ qw(package version distro) }; }
23.537037
104
0.600708
ed21c3398f031ac6cf5377c7bbfa0c849dc1a3ac
2,789
perl
Perl
regexredux/regexredux.perl-3.perl
fradav/benchmarksgame
512e88a15a3cebffd9d4d6411d6cffef4f65c4bd
[ "MIT", "BSD-3-Clause" ]
1
2019-10-13T06:59:02.000Z
2019-10-13T06:59:02.000Z
regexredux/regexredux.perl-3.perl
fradav/benchmarksgame
512e88a15a3cebffd9d4d6411d6cffef4f65c4bd
[ "MIT", "BSD-3-Clause" ]
null
null
null
regexredux/regexredux.perl-3.perl
fradav/benchmarksgame
512e88a15a3cebffd9d4d6411d6cffef4f65c4bd
[ "MIT", "BSD-3-Clause" ]
null
null
null
# The Computer Language Benchmarks Game # https://salsa.debian.org/benchmarksgame-team/benchmarksgame/ # # contributed by A. Sinan Unur # # This version uses both fork and threads. The # child does the matching work and parallelizes # it using threads while the parent does the # substitutions. # # Mixing threads and forks may not be good for # your health, but here it is. use threads; use constant ITEMS_PER_THREAD => 3; run(); sub count_matches { my $seq = shift; my $keys = shift; my $patterns = shift; my %results; for my $i (0 .. $#$patterns) { $results{ $keys->[$i] } = () = $seq =~ /$patterns->[$i]/g; } return %results; } sub run { my @variants = qw/ agggtaaa|tttaccct [cgt]gggtaaa|tttaccc[acg] a[act]ggtaaa|tttacc[agt]t ag[act]gtaaa|tttac[agt]ct agg[act]taaa|ttta[agt]cct aggg[acg]aaa|ttt[cgt]ccct agggt[cgt]aa|tt[acg]accct agggta[cgt]a|t[acg]taccct agggtaa[cgt]|[acg]ttaccct /; my @variants_re = map qr/$_/iaa, @variants; my @iub = map { my $x = $_; sub { $_[0] =~ s/$x->[0]/$x->[1]/g }} ( [ qr{ tHa [Nt] }x, '<4>' ], [ qr{ aND | caN | Ha[DS] | WaS }x, '<3>' ], [ qr{ a [NSt] | BY }x, '<2>' ], [ qr{ < [^>]* > }x, '|' ], [ qr{ \| [^|] [^|]* \| }x, '-' ], ); my $seq = do { local $/; <STDIN> }; my $input_length = length( $seq ); $seq =~ s/>.*\n|\n//g; my $cleaned_length = length( $seq ); pipe(my $reader, my $writer) or die "Failed to set up pipe: $!"; my $pid = fork; if (!$pid) { # we are in the child die "Failed to fork: $!" unless defined $pid; close $reader or die "Failed to close parent's reader in child: $!"; my @threads = map threads->create( { context => 'list' }, \&count_matches, $seq, [ @variants[$_ .. ($_ + (ITEMS_PER_THREAD - 1))] ], [ @variants_re[$_ .. ($_ + (ITEMS_PER_THREAD - 1))] ], ), grep !($_ % ITEMS_PER_THREAD), 0 .. $#variants ; my %results = map $_->join, @threads; print $writer "$_ $results{$_}\n" for @variants; close $writer or die "Failed to close child's writer in child: $!"; exit( 0 ); } else { # we are in the parent close $writer or die "Failed to close child's writer in parent: $!"; # do our own work $_->($seq) for @iub; # print match counts from child print while <$reader>; close $reader or die "Failed to close parent's reader in parent: $!"; waitpid($pid, 0); print "$_\n" for '', $input_length, $cleaned_length, length( $seq ); } }
26.065421
77
0.516314
ed4adf9876157dfc75ca51bb6bb011f02be08c13
433
pl
Perl
ndk/prebuilt/linux-x86_64/lib/perl5/5.16.2/unicore/lib/Scx/Lisu.pl
efortuna/AndroidSDKClone
240e73b763c159af6bbcd111f2705b549e85295a
[ "Apache-2.0" ]
1
2019-07-10T15:21:02.000Z
2019-07-10T15:21:02.000Z
ndk/prebuilt/linux-x86_64/lib/perl5/5.16.2/unicore/lib/Scx/Lisu.pl
efortuna/AndroidSDKClone
240e73b763c159af6bbcd111f2705b549e85295a
[ "Apache-2.0" ]
null
null
null
ndk/prebuilt/linux-x86_64/lib/perl5/5.16.2/unicore/lib/Scx/Lisu.pl
efortuna/AndroidSDKClone
240e73b763c159af6bbcd111f2705b549e85295a
[ "Apache-2.0" ]
1
2019-02-25T11:55:44.000Z
2019-02-25T11:55:44.000Z
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is machine-generated by lib/unicore/mktables from the Unicode # database, Version 6.1.0. Any changes made here will be lost! # !!!!!!! INTERNAL PERL USE ONLY !!!!!!! # This file is for internal use by core Perl only. The format and even the # name or existence of this file are subject to change without notice. Don't # use it directly. return <<'END'; A4D0 A4FF END
30.928571
77
0.674365
ed3cfed95726df4ae741c2fa73905bfac99f40a4
422
pl
Perl
bin/junos_vlan_descr.pl
jdg71nl/opensyssetup
05a07da2952eed073a21ff59fdc210d357f93524
[ "Apache-2.0" ]
null
null
null
bin/junos_vlan_descr.pl
jdg71nl/opensyssetup
05a07da2952eed073a21ff59fdc210d357f93524
[ "Apache-2.0" ]
null
null
null
bin/junos_vlan_descr.pl
jdg71nl/opensyssetup
05a07da2952eed073a21ff59fdc210d357f93524
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/perl my $ip = shift @ARGV || 0; while (my $line=<STDIN>) { chomp $line; $line =~ /v(\d+)([-_][\w\d-]+)/ ; my $vlan = $1 || 0; my $d = $2 || ''; my $descr = "v${vlan}${d}"; if ($vlan == 0) { print "$line\n"; } else { if ($ip) { print "set vlan v$vlan vlan-id $vlan l3-interface vlan.$vlan description $descr\n"; } else { print "set vlan v$vlan vlan-id $vlan description $descr\n"; } } }
21.1
86
0.518957
ed46f73d3597d32b4e11ece5dd99ddce0542b776
1,852
pm
Perl
lib/Google/Ads/AdWords/v201809/AdGroupOperation.pm
googleads/googleads-perl-lib
69e66d7e46fbd8ad901581b108ea6c14212701cf
[ "Apache-2.0" ]
4
2015-04-23T01:59:40.000Z
2021-10-12T23:14:36.000Z
lib/Google/Ads/AdWords/v201809/AdGroupOperation.pm
googleads/googleads-perl-lib
69e66d7e46fbd8ad901581b108ea6c14212701cf
[ "Apache-2.0" ]
23
2015-02-19T17:03:58.000Z
2019-07-01T10:15:46.000Z
lib/Google/Ads/AdWords/v201809/AdGroupOperation.pm
googleads/googleads-perl-lib
69e66d7e46fbd8ad901581b108ea6c14212701cf
[ "Apache-2.0" ]
10
2015-08-03T07:51:58.000Z
2020-09-26T16:17:46.000Z
package Google::Ads::AdWords::v201809::AdGroupOperation; use strict; use warnings; __PACKAGE__->_set_element_form_qualified(1); sub get_xmlns { 'https://adwords.google.com/api/adwords/cm/v201809' }; our $XML_ATTRIBUTE_CLASS; undef $XML_ATTRIBUTE_CLASS; sub __get_attr_class { return $XML_ATTRIBUTE_CLASS; } use base qw(Google::Ads::AdWords::v201809::Operation); # Variety: sequence use Class::Std::Fast::Storable constructor => 'none'; use base qw(Google::Ads::SOAP::Typelib::ComplexType); { # BLOCK to scope variables my %operator_of :ATTR(:get<operator>); my %Operation__Type_of :ATTR(:get<Operation__Type>); my %operand_of :ATTR(:get<operand>); __PACKAGE__->_factory( [ qw( operator Operation__Type operand ) ], { 'operator' => \%operator_of, 'Operation__Type' => \%Operation__Type_of, 'operand' => \%operand_of, }, { 'operator' => 'Google::Ads::AdWords::v201809::Operator', 'Operation__Type' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'operand' => 'Google::Ads::AdWords::v201809::AdGroup', }, { 'operator' => 'operator', 'Operation__Type' => 'Operation.Type', 'operand' => 'operand', } ); } # end BLOCK 1; =pod =head1 NAME Google::Ads::AdWords::v201809::AdGroupOperation =head1 DESCRIPTION Perl data type class for the XML Schema defined complexType AdGroupOperation from the namespace https://adwords.google.com/api/adwords/cm/v201809. AdGroup operations for adding/updating/removing adgroups. =head2 PROPERTIES The following properties may be accessed using get_PROPERTY / set_PROPERTY methods: =over =item * operand =back =head1 METHODS =head2 new Constructor. The following data structure may be passed to new(): =head1 AUTHOR Generated by SOAP::WSDL =cut
16.535714
86
0.678186
ed7c7a8ff940515c89c97e1226055c1f42c45da7
56,294
pm
Perl
local/lib/perl5/Date/Manip/TZ/euamst00.pm
jkb78/extrajnm
6890e38e15f85ea9c09a141aa14affad0b8e91e7
[ "MIT" ]
null
null
null
local/lib/perl5/Date/Manip/TZ/euamst00.pm
jkb78/extrajnm
6890e38e15f85ea9c09a141aa14affad0b8e91e7
[ "MIT" ]
null
null
null
local/lib/perl5/Date/Manip/TZ/euamst00.pm
jkb78/extrajnm
6890e38e15f85ea9c09a141aa14affad0b8e91e7
[ "MIT" ]
null
null
null
package # Date::Manip::TZ::euamst00; # Copyright (c) 2008-2015 Sullivan Beck. All rights reserved. # This program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # This file was automatically generated. Any changes to this file will # be lost the next time 'tzdata' is run. # Generated on: Wed Nov 25 11:33:47 EST 2015 # Data version: tzdata2015g # Code version: tzcode2015g # This module contains data from the zoneinfo time zone database. The original # data was obtained from the URL: # ftp://ftp.iana.org/tz use strict; use warnings; require 5.010000; our (%Dates,%LastRule); END { undef %Dates; undef %LastRule; } our ($VERSION); $VERSION='6.52'; END { undef $VERSION; } %Dates = ( 1 => [ [ [1,1,2,0,0,0],[1,1,2,0,19,32],'+00:19:32',[0,19,32], 'LMT',0,[1834,12,31,23,40,27],[1834,12,31,23,59,59], '0001010200:00:00','0001010200:19:32','1834123123:40:27','1834123123:59:59' ], ], 1834 => [ [ [1834,12,31,23,40,28],[1835,1,1,0,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1916,4,30,23,40,27],[1916,4,30,23,59,59], '1834123123:40:28','1835010100:00:00','1916043023:40:27','1916043023:59:59' ], ], 1916 => [ [ [1916,4,30,23,40,28],[1916,5,1,1,0,0],'+01:19:32',[1,19,32], 'NST',1,[1916,9,30,22,40,27],[1916,9,30,23,59,59], '1916043023:40:28','1916050101:00:00','1916093022:40:27','1916093023:59:59' ], [ [1916,9,30,22,40,28],[1916,9,30,23,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1917,4,16,1,40,27],[1917,4,16,1,59,59], '1916093022:40:28','1916093023:00:00','1917041601:40:27','1917041601:59:59' ], ], 1917 => [ [ [1917,4,16,1,40,28],[1917,4,16,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1917,9,17,1,40,27],[1917,9,17,2,59,59], '1917041601:40:28','1917041603:00:00','1917091701:40:27','1917091702:59:59' ], [ [1917,9,17,1,40,28],[1917,9,17,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1918,4,1,1,40,27],[1918,4,1,1,59,59], '1917091701:40:28','1917091702:00:00','1918040101:40:27','1918040101:59:59' ], ], 1918 => [ [ [1918,4,1,1,40,28],[1918,4,1,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1918,9,30,1,40,27],[1918,9,30,2,59,59], '1918040101:40:28','1918040103:00:00','1918093001:40:27','1918093002:59:59' ], [ [1918,9,30,1,40,28],[1918,9,30,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1919,4,7,1,40,27],[1919,4,7,1,59,59], '1918093001:40:28','1918093002:00:00','1919040701:40:27','1919040701:59:59' ], ], 1919 => [ [ [1919,4,7,1,40,28],[1919,4,7,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1919,9,29,1,40,27],[1919,9,29,2,59,59], '1919040701:40:28','1919040703:00:00','1919092901:40:27','1919092902:59:59' ], [ [1919,9,29,1,40,28],[1919,9,29,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1920,4,5,1,40,27],[1920,4,5,1,59,59], '1919092901:40:28','1919092902:00:00','1920040501:40:27','1920040501:59:59' ], ], 1920 => [ [ [1920,4,5,1,40,28],[1920,4,5,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1920,9,27,1,40,27],[1920,9,27,2,59,59], '1920040501:40:28','1920040503:00:00','1920092701:40:27','1920092702:59:59' ], [ [1920,9,27,1,40,28],[1920,9,27,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1921,4,4,1,40,27],[1921,4,4,1,59,59], '1920092701:40:28','1920092702:00:00','1921040401:40:27','1921040401:59:59' ], ], 1921 => [ [ [1921,4,4,1,40,28],[1921,4,4,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1921,9,26,1,40,27],[1921,9,26,2,59,59], '1921040401:40:28','1921040403:00:00','1921092601:40:27','1921092602:59:59' ], [ [1921,9,26,1,40,28],[1921,9,26,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1922,3,26,1,40,27],[1922,3,26,1,59,59], '1921092601:40:28','1921092602:00:00','1922032601:40:27','1922032601:59:59' ], ], 1922 => [ [ [1922,3,26,1,40,28],[1922,3,26,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1922,10,8,1,40,27],[1922,10,8,2,59,59], '1922032601:40:28','1922032603:00:00','1922100801:40:27','1922100802:59:59' ], [ [1922,10,8,1,40,28],[1922,10,8,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1923,6,1,1,40,27],[1923,6,1,1,59,59], '1922100801:40:28','1922100802:00:00','1923060101:40:27','1923060101:59:59' ], ], 1923 => [ [ [1923,6,1,1,40,28],[1923,6,1,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1923,10,7,1,40,27],[1923,10,7,2,59,59], '1923060101:40:28','1923060103:00:00','1923100701:40:27','1923100702:59:59' ], [ [1923,10,7,1,40,28],[1923,10,7,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1924,3,30,1,40,27],[1924,3,30,1,59,59], '1923100701:40:28','1923100702:00:00','1924033001:40:27','1924033001:59:59' ], ], 1924 => [ [ [1924,3,30,1,40,28],[1924,3,30,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1924,10,5,1,40,27],[1924,10,5,2,59,59], '1924033001:40:28','1924033003:00:00','1924100501:40:27','1924100502:59:59' ], [ [1924,10,5,1,40,28],[1924,10,5,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1925,6,5,1,40,27],[1925,6,5,1,59,59], '1924100501:40:28','1924100502:00:00','1925060501:40:27','1925060501:59:59' ], ], 1925 => [ [ [1925,6,5,1,40,28],[1925,6,5,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1925,10,4,1,40,27],[1925,10,4,2,59,59], '1925060501:40:28','1925060503:00:00','1925100401:40:27','1925100402:59:59' ], [ [1925,10,4,1,40,28],[1925,10,4,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1926,5,15,1,40,27],[1926,5,15,1,59,59], '1925100401:40:28','1925100402:00:00','1926051501:40:27','1926051501:59:59' ], ], 1926 => [ [ [1926,5,15,1,40,28],[1926,5,15,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1926,10,3,1,40,27],[1926,10,3,2,59,59], '1926051501:40:28','1926051503:00:00','1926100301:40:27','1926100302:59:59' ], [ [1926,10,3,1,40,28],[1926,10,3,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1927,5,15,1,40,27],[1927,5,15,1,59,59], '1926100301:40:28','1926100302:00:00','1927051501:40:27','1927051501:59:59' ], ], 1927 => [ [ [1927,5,15,1,40,28],[1927,5,15,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1927,10,2,1,40,27],[1927,10,2,2,59,59], '1927051501:40:28','1927051503:00:00','1927100201:40:27','1927100202:59:59' ], [ [1927,10,2,1,40,28],[1927,10,2,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1928,5,15,1,40,27],[1928,5,15,1,59,59], '1927100201:40:28','1927100202:00:00','1928051501:40:27','1928051501:59:59' ], ], 1928 => [ [ [1928,5,15,1,40,28],[1928,5,15,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1928,10,7,1,40,27],[1928,10,7,2,59,59], '1928051501:40:28','1928051503:00:00','1928100701:40:27','1928100702:59:59' ], [ [1928,10,7,1,40,28],[1928,10,7,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1929,5,15,1,40,27],[1929,5,15,1,59,59], '1928100701:40:28','1928100702:00:00','1929051501:40:27','1929051501:59:59' ], ], 1929 => [ [ [1929,5,15,1,40,28],[1929,5,15,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1929,10,6,1,40,27],[1929,10,6,2,59,59], '1929051501:40:28','1929051503:00:00','1929100601:40:27','1929100602:59:59' ], [ [1929,10,6,1,40,28],[1929,10,6,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1930,5,15,1,40,27],[1930,5,15,1,59,59], '1929100601:40:28','1929100602:00:00','1930051501:40:27','1930051501:59:59' ], ], 1930 => [ [ [1930,5,15,1,40,28],[1930,5,15,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1930,10,5,1,40,27],[1930,10,5,2,59,59], '1930051501:40:28','1930051503:00:00','1930100501:40:27','1930100502:59:59' ], [ [1930,10,5,1,40,28],[1930,10,5,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1931,5,15,1,40,27],[1931,5,15,1,59,59], '1930100501:40:28','1930100502:00:00','1931051501:40:27','1931051501:59:59' ], ], 1931 => [ [ [1931,5,15,1,40,28],[1931,5,15,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1931,10,4,1,40,27],[1931,10,4,2,59,59], '1931051501:40:28','1931051503:00:00','1931100401:40:27','1931100402:59:59' ], [ [1931,10,4,1,40,28],[1931,10,4,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1932,5,22,1,40,27],[1932,5,22,1,59,59], '1931100401:40:28','1931100402:00:00','1932052201:40:27','1932052201:59:59' ], ], 1932 => [ [ [1932,5,22,1,40,28],[1932,5,22,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1932,10,2,1,40,27],[1932,10,2,2,59,59], '1932052201:40:28','1932052203:00:00','1932100201:40:27','1932100202:59:59' ], [ [1932,10,2,1,40,28],[1932,10,2,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1933,5,15,1,40,27],[1933,5,15,1,59,59], '1932100201:40:28','1932100202:00:00','1933051501:40:27','1933051501:59:59' ], ], 1933 => [ [ [1933,5,15,1,40,28],[1933,5,15,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1933,10,8,1,40,27],[1933,10,8,2,59,59], '1933051501:40:28','1933051503:00:00','1933100801:40:27','1933100802:59:59' ], [ [1933,10,8,1,40,28],[1933,10,8,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1934,5,15,1,40,27],[1934,5,15,1,59,59], '1933100801:40:28','1933100802:00:00','1934051501:40:27','1934051501:59:59' ], ], 1934 => [ [ [1934,5,15,1,40,28],[1934,5,15,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1934,10,7,1,40,27],[1934,10,7,2,59,59], '1934051501:40:28','1934051503:00:00','1934100701:40:27','1934100702:59:59' ], [ [1934,10,7,1,40,28],[1934,10,7,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1935,5,15,1,40,27],[1935,5,15,1,59,59], '1934100701:40:28','1934100702:00:00','1935051501:40:27','1935051501:59:59' ], ], 1935 => [ [ [1935,5,15,1,40,28],[1935,5,15,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1935,10,6,1,40,27],[1935,10,6,2,59,59], '1935051501:40:28','1935051503:00:00','1935100601:40:27','1935100602:59:59' ], [ [1935,10,6,1,40,28],[1935,10,6,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1936,5,15,1,40,27],[1936,5,15,1,59,59], '1935100601:40:28','1935100602:00:00','1936051501:40:27','1936051501:59:59' ], ], 1936 => [ [ [1936,5,15,1,40,28],[1936,5,15,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1936,10,4,1,40,27],[1936,10,4,2,59,59], '1936051501:40:28','1936051503:00:00','1936100401:40:27','1936100402:59:59' ], [ [1936,10,4,1,40,28],[1936,10,4,2,0,0],'+00:19:32',[0,19,32], 'AMT',0,[1937,5,22,1,40,27],[1937,5,22,1,59,59], '1936100401:40:28','1936100402:00:00','1937052201:40:27','1937052201:59:59' ], ], 1937 => [ [ [1937,5,22,1,40,28],[1937,5,22,3,0,0],'+01:19:32',[1,19,32], 'NST',1,[1937,6,30,22,40,27],[1937,6,30,23,59,59], '1937052201:40:28','1937052203:00:00','1937063022:40:27','1937063023:59:59' ], [ [1937,6,30,22,40,28],[1937,7,1,0,0,28],'+01:20:00',[1,20,0], 'NEST',1,[1937,10,3,1,39,59],[1937,10,3,2,59,59], '1937063022:40:28','1937070100:00:28','1937100301:39:59','1937100302:59:59' ], [ [1937,10,3,1,40,0],[1937,10,3,2,0,0],'+00:20:00',[0,20,0], 'NET',0,[1938,5,15,1,39,59],[1938,5,15,1,59,59], '1937100301:40:00','1937100302:00:00','1938051501:39:59','1938051501:59:59' ], ], 1938 => [ [ [1938,5,15,1,40,0],[1938,5,15,3,0,0],'+01:20:00',[1,20,0], 'NEST',1,[1938,10,2,1,39,59],[1938,10,2,2,59,59], '1938051501:40:00','1938051503:00:00','1938100201:39:59','1938100202:59:59' ], [ [1938,10,2,1,40,0],[1938,10,2,2,0,0],'+00:20:00',[0,20,0], 'NET',0,[1939,5,15,1,39,59],[1939,5,15,1,59,59], '1938100201:40:00','1938100202:00:00','1939051501:39:59','1939051501:59:59' ], ], 1939 => [ [ [1939,5,15,1,40,0],[1939,5,15,3,0,0],'+01:20:00',[1,20,0], 'NEST',1,[1939,10,8,1,39,59],[1939,10,8,2,59,59], '1939051501:40:00','1939051503:00:00','1939100801:39:59','1939100802:59:59' ], [ [1939,10,8,1,40,0],[1939,10,8,2,0,0],'+00:20:00',[0,20,0], 'NET',0,[1940,5,15,23,39,59],[1940,5,15,23,59,59], '1939100801:40:00','1939100802:00:00','1940051523:39:59','1940051523:59:59' ], ], 1940 => [ [ [1940,5,15,23,40,0],[1940,5,16,1,40,0],'+02:00:00',[2,0,0], 'CEST',1,[1942,11,2,0,59,59],[1942,11,2,2,59,59], '1940051523:40:00','1940051601:40:00','1942110200:59:59','1942110202:59:59' ], ], 1942 => [ [ [1942,11,2,1,0,0],[1942,11,2,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1943,3,29,0,59,59],[1943,3,29,1,59,59], '1942110201:00:00','1942110202:00:00','1943032900:59:59','1943032901:59:59' ], ], 1943 => [ [ [1943,3,29,1,0,0],[1943,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1943,10,4,0,59,59],[1943,10,4,2,59,59], '1943032901:00:00','1943032903:00:00','1943100400:59:59','1943100402:59:59' ], [ [1943,10,4,1,0,0],[1943,10,4,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1944,4,3,0,59,59],[1944,4,3,1,59,59], '1943100401:00:00','1943100402:00:00','1944040300:59:59','1944040301:59:59' ], ], 1944 => [ [ [1944,4,3,1,0,0],[1944,4,3,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1944,10,2,0,59,59],[1944,10,2,2,59,59], '1944040301:00:00','1944040303:00:00','1944100200:59:59','1944100202:59:59' ], [ [1944,10,2,1,0,0],[1944,10,2,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1945,4,2,0,59,59],[1945,4,2,1,59,59], '1944100201:00:00','1944100202:00:00','1945040200:59:59','1945040201:59:59' ], ], 1945 => [ [ [1945,4,2,1,0,0],[1945,4,2,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1945,9,16,0,59,59],[1945,9,16,2,59,59], '1945040201:00:00','1945040203:00:00','1945091600:59:59','1945091602:59:59' ], [ [1945,9,16,1,0,0],[1945,9,16,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1977,4,3,0,59,59],[1977,4,3,1,59,59], '1945091601:00:00','1945091602:00:00','1977040300:59:59','1977040301:59:59' ], ], 1977 => [ [ [1977,4,3,1,0,0],[1977,4,3,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1977,9,25,0,59,59],[1977,9,25,2,59,59], '1977040301:00:00','1977040303:00:00','1977092500:59:59','1977092502:59:59' ], [ [1977,9,25,1,0,0],[1977,9,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1978,4,2,0,59,59],[1978,4,2,1,59,59], '1977092501:00:00','1977092502:00:00','1978040200:59:59','1978040201:59:59' ], ], 1978 => [ [ [1978,4,2,1,0,0],[1978,4,2,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1978,10,1,0,59,59],[1978,10,1,2,59,59], '1978040201:00:00','1978040203:00:00','1978100100:59:59','1978100102:59:59' ], [ [1978,10,1,1,0,0],[1978,10,1,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1979,4,1,0,59,59],[1979,4,1,1,59,59], '1978100101:00:00','1978100102:00:00','1979040100:59:59','1979040101:59:59' ], ], 1979 => [ [ [1979,4,1,1,0,0],[1979,4,1,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1979,9,30,0,59,59],[1979,9,30,2,59,59], '1979040101:00:00','1979040103:00:00','1979093000:59:59','1979093002:59:59' ], [ [1979,9,30,1,0,0],[1979,9,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1980,4,6,0,59,59],[1980,4,6,1,59,59], '1979093001:00:00','1979093002:00:00','1980040600:59:59','1980040601:59:59' ], ], 1980 => [ [ [1980,4,6,1,0,0],[1980,4,6,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1980,9,28,0,59,59],[1980,9,28,2,59,59], '1980040601:00:00','1980040603:00:00','1980092800:59:59','1980092802:59:59' ], [ [1980,9,28,1,0,0],[1980,9,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1981,3,29,0,59,59],[1981,3,29,1,59,59], '1980092801:00:00','1980092802:00:00','1981032900:59:59','1981032901:59:59' ], ], 1981 => [ [ [1981,3,29,1,0,0],[1981,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1981,9,27,0,59,59],[1981,9,27,2,59,59], '1981032901:00:00','1981032903:00:00','1981092700:59:59','1981092702:59:59' ], [ [1981,9,27,1,0,0],[1981,9,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1982,3,28,0,59,59],[1982,3,28,1,59,59], '1981092701:00:00','1981092702:00:00','1982032800:59:59','1982032801:59:59' ], ], 1982 => [ [ [1982,3,28,1,0,0],[1982,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1982,9,26,0,59,59],[1982,9,26,2,59,59], '1982032801:00:00','1982032803:00:00','1982092600:59:59','1982092602:59:59' ], [ [1982,9,26,1,0,0],[1982,9,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1983,3,27,0,59,59],[1983,3,27,1,59,59], '1982092601:00:00','1982092602:00:00','1983032700:59:59','1983032701:59:59' ], ], 1983 => [ [ [1983,3,27,1,0,0],[1983,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1983,9,25,0,59,59],[1983,9,25,2,59,59], '1983032701:00:00','1983032703:00:00','1983092500:59:59','1983092502:59:59' ], [ [1983,9,25,1,0,0],[1983,9,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1984,3,25,0,59,59],[1984,3,25,1,59,59], '1983092501:00:00','1983092502:00:00','1984032500:59:59','1984032501:59:59' ], ], 1984 => [ [ [1984,3,25,1,0,0],[1984,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1984,9,30,0,59,59],[1984,9,30,2,59,59], '1984032501:00:00','1984032503:00:00','1984093000:59:59','1984093002:59:59' ], [ [1984,9,30,1,0,0],[1984,9,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1985,3,31,0,59,59],[1985,3,31,1,59,59], '1984093001:00:00','1984093002:00:00','1985033100:59:59','1985033101:59:59' ], ], 1985 => [ [ [1985,3,31,1,0,0],[1985,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1985,9,29,0,59,59],[1985,9,29,2,59,59], '1985033101:00:00','1985033103:00:00','1985092900:59:59','1985092902:59:59' ], [ [1985,9,29,1,0,0],[1985,9,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1986,3,30,0,59,59],[1986,3,30,1,59,59], '1985092901:00:00','1985092902:00:00','1986033000:59:59','1986033001:59:59' ], ], 1986 => [ [ [1986,3,30,1,0,0],[1986,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1986,9,28,0,59,59],[1986,9,28,2,59,59], '1986033001:00:00','1986033003:00:00','1986092800:59:59','1986092802:59:59' ], [ [1986,9,28,1,0,0],[1986,9,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1987,3,29,0,59,59],[1987,3,29,1,59,59], '1986092801:00:00','1986092802:00:00','1987032900:59:59','1987032901:59:59' ], ], 1987 => [ [ [1987,3,29,1,0,0],[1987,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1987,9,27,0,59,59],[1987,9,27,2,59,59], '1987032901:00:00','1987032903:00:00','1987092700:59:59','1987092702:59:59' ], [ [1987,9,27,1,0,0],[1987,9,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1988,3,27,0,59,59],[1988,3,27,1,59,59], '1987092701:00:00','1987092702:00:00','1988032700:59:59','1988032701:59:59' ], ], 1988 => [ [ [1988,3,27,1,0,0],[1988,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1988,9,25,0,59,59],[1988,9,25,2,59,59], '1988032701:00:00','1988032703:00:00','1988092500:59:59','1988092502:59:59' ], [ [1988,9,25,1,0,0],[1988,9,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1989,3,26,0,59,59],[1989,3,26,1,59,59], '1988092501:00:00','1988092502:00:00','1989032600:59:59','1989032601:59:59' ], ], 1989 => [ [ [1989,3,26,1,0,0],[1989,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1989,9,24,0,59,59],[1989,9,24,2,59,59], '1989032601:00:00','1989032603:00:00','1989092400:59:59','1989092402:59:59' ], [ [1989,9,24,1,0,0],[1989,9,24,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1990,3,25,0,59,59],[1990,3,25,1,59,59], '1989092401:00:00','1989092402:00:00','1990032500:59:59','1990032501:59:59' ], ], 1990 => [ [ [1990,3,25,1,0,0],[1990,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1990,9,30,0,59,59],[1990,9,30,2,59,59], '1990032501:00:00','1990032503:00:00','1990093000:59:59','1990093002:59:59' ], [ [1990,9,30,1,0,0],[1990,9,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1991,3,31,0,59,59],[1991,3,31,1,59,59], '1990093001:00:00','1990093002:00:00','1991033100:59:59','1991033101:59:59' ], ], 1991 => [ [ [1991,3,31,1,0,0],[1991,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1991,9,29,0,59,59],[1991,9,29,2,59,59], '1991033101:00:00','1991033103:00:00','1991092900:59:59','1991092902:59:59' ], [ [1991,9,29,1,0,0],[1991,9,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1992,3,29,0,59,59],[1992,3,29,1,59,59], '1991092901:00:00','1991092902:00:00','1992032900:59:59','1992032901:59:59' ], ], 1992 => [ [ [1992,3,29,1,0,0],[1992,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1992,9,27,0,59,59],[1992,9,27,2,59,59], '1992032901:00:00','1992032903:00:00','1992092700:59:59','1992092702:59:59' ], [ [1992,9,27,1,0,0],[1992,9,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1993,3,28,0,59,59],[1993,3,28,1,59,59], '1992092701:00:00','1992092702:00:00','1993032800:59:59','1993032801:59:59' ], ], 1993 => [ [ [1993,3,28,1,0,0],[1993,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1993,9,26,0,59,59],[1993,9,26,2,59,59], '1993032801:00:00','1993032803:00:00','1993092600:59:59','1993092602:59:59' ], [ [1993,9,26,1,0,0],[1993,9,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1994,3,27,0,59,59],[1994,3,27,1,59,59], '1993092601:00:00','1993092602:00:00','1994032700:59:59','1994032701:59:59' ], ], 1994 => [ [ [1994,3,27,1,0,0],[1994,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1994,9,25,0,59,59],[1994,9,25,2,59,59], '1994032701:00:00','1994032703:00:00','1994092500:59:59','1994092502:59:59' ], [ [1994,9,25,1,0,0],[1994,9,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1995,3,26,0,59,59],[1995,3,26,1,59,59], '1994092501:00:00','1994092502:00:00','1995032600:59:59','1995032601:59:59' ], ], 1995 => [ [ [1995,3,26,1,0,0],[1995,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1995,9,24,0,59,59],[1995,9,24,2,59,59], '1995032601:00:00','1995032603:00:00','1995092400:59:59','1995092402:59:59' ], [ [1995,9,24,1,0,0],[1995,9,24,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1996,3,31,0,59,59],[1996,3,31,1,59,59], '1995092401:00:00','1995092402:00:00','1996033100:59:59','1996033101:59:59' ], ], 1996 => [ [ [1996,3,31,1,0,0],[1996,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1996,10,27,0,59,59],[1996,10,27,2,59,59], '1996033101:00:00','1996033103:00:00','1996102700:59:59','1996102702:59:59' ], [ [1996,10,27,1,0,0],[1996,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1997,3,30,0,59,59],[1997,3,30,1,59,59], '1996102701:00:00','1996102702:00:00','1997033000:59:59','1997033001:59:59' ], ], 1997 => [ [ [1997,3,30,1,0,0],[1997,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1997,10,26,0,59,59],[1997,10,26,2,59,59], '1997033001:00:00','1997033003:00:00','1997102600:59:59','1997102602:59:59' ], [ [1997,10,26,1,0,0],[1997,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1998,3,29,0,59,59],[1998,3,29,1,59,59], '1997102601:00:00','1997102602:00:00','1998032900:59:59','1998032901:59:59' ], ], 1998 => [ [ [1998,3,29,1,0,0],[1998,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1998,10,25,0,59,59],[1998,10,25,2,59,59], '1998032901:00:00','1998032903:00:00','1998102500:59:59','1998102502:59:59' ], [ [1998,10,25,1,0,0],[1998,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1999,3,28,0,59,59],[1999,3,28,1,59,59], '1998102501:00:00','1998102502:00:00','1999032800:59:59','1999032801:59:59' ], ], 1999 => [ [ [1999,3,28,1,0,0],[1999,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1999,10,31,0,59,59],[1999,10,31,2,59,59], '1999032801:00:00','1999032803:00:00','1999103100:59:59','1999103102:59:59' ], [ [1999,10,31,1,0,0],[1999,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2000,3,26,0,59,59],[2000,3,26,1,59,59], '1999103101:00:00','1999103102:00:00','2000032600:59:59','2000032601:59:59' ], ], 2000 => [ [ [2000,3,26,1,0,0],[2000,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2000,10,29,0,59,59],[2000,10,29,2,59,59], '2000032601:00:00','2000032603:00:00','2000102900:59:59','2000102902:59:59' ], [ [2000,10,29,1,0,0],[2000,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2001,3,25,0,59,59],[2001,3,25,1,59,59], '2000102901:00:00','2000102902:00:00','2001032500:59:59','2001032501:59:59' ], ], 2001 => [ [ [2001,3,25,1,0,0],[2001,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2001,10,28,0,59,59],[2001,10,28,2,59,59], '2001032501:00:00','2001032503:00:00','2001102800:59:59','2001102802:59:59' ], [ [2001,10,28,1,0,0],[2001,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2002,3,31,0,59,59],[2002,3,31,1,59,59], '2001102801:00:00','2001102802:00:00','2002033100:59:59','2002033101:59:59' ], ], 2002 => [ [ [2002,3,31,1,0,0],[2002,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2002,10,27,0,59,59],[2002,10,27,2,59,59], '2002033101:00:00','2002033103:00:00','2002102700:59:59','2002102702:59:59' ], [ [2002,10,27,1,0,0],[2002,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2003,3,30,0,59,59],[2003,3,30,1,59,59], '2002102701:00:00','2002102702:00:00','2003033000:59:59','2003033001:59:59' ], ], 2003 => [ [ [2003,3,30,1,0,0],[2003,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2003,10,26,0,59,59],[2003,10,26,2,59,59], '2003033001:00:00','2003033003:00:00','2003102600:59:59','2003102602:59:59' ], [ [2003,10,26,1,0,0],[2003,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2004,3,28,0,59,59],[2004,3,28,1,59,59], '2003102601:00:00','2003102602:00:00','2004032800:59:59','2004032801:59:59' ], ], 2004 => [ [ [2004,3,28,1,0,0],[2004,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2004,10,31,0,59,59],[2004,10,31,2,59,59], '2004032801:00:00','2004032803:00:00','2004103100:59:59','2004103102:59:59' ], [ [2004,10,31,1,0,0],[2004,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2005,3,27,0,59,59],[2005,3,27,1,59,59], '2004103101:00:00','2004103102:00:00','2005032700:59:59','2005032701:59:59' ], ], 2005 => [ [ [2005,3,27,1,0,0],[2005,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2005,10,30,0,59,59],[2005,10,30,2,59,59], '2005032701:00:00','2005032703:00:00','2005103000:59:59','2005103002:59:59' ], [ [2005,10,30,1,0,0],[2005,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2006,3,26,0,59,59],[2006,3,26,1,59,59], '2005103001:00:00','2005103002:00:00','2006032600:59:59','2006032601:59:59' ], ], 2006 => [ [ [2006,3,26,1,0,0],[2006,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2006,10,29,0,59,59],[2006,10,29,2,59,59], '2006032601:00:00','2006032603:00:00','2006102900:59:59','2006102902:59:59' ], [ [2006,10,29,1,0,0],[2006,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2007,3,25,0,59,59],[2007,3,25,1,59,59], '2006102901:00:00','2006102902:00:00','2007032500:59:59','2007032501:59:59' ], ], 2007 => [ [ [2007,3,25,1,0,0],[2007,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2007,10,28,0,59,59],[2007,10,28,2,59,59], '2007032501:00:00','2007032503:00:00','2007102800:59:59','2007102802:59:59' ], [ [2007,10,28,1,0,0],[2007,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2008,3,30,0,59,59],[2008,3,30,1,59,59], '2007102801:00:00','2007102802:00:00','2008033000:59:59','2008033001:59:59' ], ], 2008 => [ [ [2008,3,30,1,0,0],[2008,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2008,10,26,0,59,59],[2008,10,26,2,59,59], '2008033001:00:00','2008033003:00:00','2008102600:59:59','2008102602:59:59' ], [ [2008,10,26,1,0,0],[2008,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2009,3,29,0,59,59],[2009,3,29,1,59,59], '2008102601:00:00','2008102602:00:00','2009032900:59:59','2009032901:59:59' ], ], 2009 => [ [ [2009,3,29,1,0,0],[2009,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2009,10,25,0,59,59],[2009,10,25,2,59,59], '2009032901:00:00','2009032903:00:00','2009102500:59:59','2009102502:59:59' ], [ [2009,10,25,1,0,0],[2009,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2010,3,28,0,59,59],[2010,3,28,1,59,59], '2009102501:00:00','2009102502:00:00','2010032800:59:59','2010032801:59:59' ], ], 2010 => [ [ [2010,3,28,1,0,0],[2010,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2010,10,31,0,59,59],[2010,10,31,2,59,59], '2010032801:00:00','2010032803:00:00','2010103100:59:59','2010103102:59:59' ], [ [2010,10,31,1,0,0],[2010,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2011,3,27,0,59,59],[2011,3,27,1,59,59], '2010103101:00:00','2010103102:00:00','2011032700:59:59','2011032701:59:59' ], ], 2011 => [ [ [2011,3,27,1,0,0],[2011,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2011,10,30,0,59,59],[2011,10,30,2,59,59], '2011032701:00:00','2011032703:00:00','2011103000:59:59','2011103002:59:59' ], [ [2011,10,30,1,0,0],[2011,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2012,3,25,0,59,59],[2012,3,25,1,59,59], '2011103001:00:00','2011103002:00:00','2012032500:59:59','2012032501:59:59' ], ], 2012 => [ [ [2012,3,25,1,0,0],[2012,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2012,10,28,0,59,59],[2012,10,28,2,59,59], '2012032501:00:00','2012032503:00:00','2012102800:59:59','2012102802:59:59' ], [ [2012,10,28,1,0,0],[2012,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2013,3,31,0,59,59],[2013,3,31,1,59,59], '2012102801:00:00','2012102802:00:00','2013033100:59:59','2013033101:59:59' ], ], 2013 => [ [ [2013,3,31,1,0,0],[2013,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2013,10,27,0,59,59],[2013,10,27,2,59,59], '2013033101:00:00','2013033103:00:00','2013102700:59:59','2013102702:59:59' ], [ [2013,10,27,1,0,0],[2013,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2014,3,30,0,59,59],[2014,3,30,1,59,59], '2013102701:00:00','2013102702:00:00','2014033000:59:59','2014033001:59:59' ], ], 2014 => [ [ [2014,3,30,1,0,0],[2014,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2014,10,26,0,59,59],[2014,10,26,2,59,59], '2014033001:00:00','2014033003:00:00','2014102600:59:59','2014102602:59:59' ], [ [2014,10,26,1,0,0],[2014,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2015,3,29,0,59,59],[2015,3,29,1,59,59], '2014102601:00:00','2014102602:00:00','2015032900:59:59','2015032901:59:59' ], ], 2015 => [ [ [2015,3,29,1,0,0],[2015,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2015,10,25,0,59,59],[2015,10,25,2,59,59], '2015032901:00:00','2015032903:00:00','2015102500:59:59','2015102502:59:59' ], [ [2015,10,25,1,0,0],[2015,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2016,3,27,0,59,59],[2016,3,27,1,59,59], '2015102501:00:00','2015102502:00:00','2016032700:59:59','2016032701:59:59' ], ], 2016 => [ [ [2016,3,27,1,0,0],[2016,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2016,10,30,0,59,59],[2016,10,30,2,59,59], '2016032701:00:00','2016032703:00:00','2016103000:59:59','2016103002:59:59' ], [ [2016,10,30,1,0,0],[2016,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2017,3,26,0,59,59],[2017,3,26,1,59,59], '2016103001:00:00','2016103002:00:00','2017032600:59:59','2017032601:59:59' ], ], 2017 => [ [ [2017,3,26,1,0,0],[2017,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2017,10,29,0,59,59],[2017,10,29,2,59,59], '2017032601:00:00','2017032603:00:00','2017102900:59:59','2017102902:59:59' ], [ [2017,10,29,1,0,0],[2017,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2018,3,25,0,59,59],[2018,3,25,1,59,59], '2017102901:00:00','2017102902:00:00','2018032500:59:59','2018032501:59:59' ], ], 2018 => [ [ [2018,3,25,1,0,0],[2018,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2018,10,28,0,59,59],[2018,10,28,2,59,59], '2018032501:00:00','2018032503:00:00','2018102800:59:59','2018102802:59:59' ], [ [2018,10,28,1,0,0],[2018,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2019,3,31,0,59,59],[2019,3,31,1,59,59], '2018102801:00:00','2018102802:00:00','2019033100:59:59','2019033101:59:59' ], ], 2019 => [ [ [2019,3,31,1,0,0],[2019,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2019,10,27,0,59,59],[2019,10,27,2,59,59], '2019033101:00:00','2019033103:00:00','2019102700:59:59','2019102702:59:59' ], [ [2019,10,27,1,0,0],[2019,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2020,3,29,0,59,59],[2020,3,29,1,59,59], '2019102701:00:00','2019102702:00:00','2020032900:59:59','2020032901:59:59' ], ], 2020 => [ [ [2020,3,29,1,0,0],[2020,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2020,10,25,0,59,59],[2020,10,25,2,59,59], '2020032901:00:00','2020032903:00:00','2020102500:59:59','2020102502:59:59' ], [ [2020,10,25,1,0,0],[2020,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2021,3,28,0,59,59],[2021,3,28,1,59,59], '2020102501:00:00','2020102502:00:00','2021032800:59:59','2021032801:59:59' ], ], 2021 => [ [ [2021,3,28,1,0,0],[2021,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2021,10,31,0,59,59],[2021,10,31,2,59,59], '2021032801:00:00','2021032803:00:00','2021103100:59:59','2021103102:59:59' ], [ [2021,10,31,1,0,0],[2021,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2022,3,27,0,59,59],[2022,3,27,1,59,59], '2021103101:00:00','2021103102:00:00','2022032700:59:59','2022032701:59:59' ], ], 2022 => [ [ [2022,3,27,1,0,0],[2022,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2022,10,30,0,59,59],[2022,10,30,2,59,59], '2022032701:00:00','2022032703:00:00','2022103000:59:59','2022103002:59:59' ], [ [2022,10,30,1,0,0],[2022,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2023,3,26,0,59,59],[2023,3,26,1,59,59], '2022103001:00:00','2022103002:00:00','2023032600:59:59','2023032601:59:59' ], ], 2023 => [ [ [2023,3,26,1,0,0],[2023,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2023,10,29,0,59,59],[2023,10,29,2,59,59], '2023032601:00:00','2023032603:00:00','2023102900:59:59','2023102902:59:59' ], [ [2023,10,29,1,0,0],[2023,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2024,3,31,0,59,59],[2024,3,31,1,59,59], '2023102901:00:00','2023102902:00:00','2024033100:59:59','2024033101:59:59' ], ], 2024 => [ [ [2024,3,31,1,0,0],[2024,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2024,10,27,0,59,59],[2024,10,27,2,59,59], '2024033101:00:00','2024033103:00:00','2024102700:59:59','2024102702:59:59' ], [ [2024,10,27,1,0,0],[2024,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2025,3,30,0,59,59],[2025,3,30,1,59,59], '2024102701:00:00','2024102702:00:00','2025033000:59:59','2025033001:59:59' ], ], 2025 => [ [ [2025,3,30,1,0,0],[2025,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2025,10,26,0,59,59],[2025,10,26,2,59,59], '2025033001:00:00','2025033003:00:00','2025102600:59:59','2025102602:59:59' ], [ [2025,10,26,1,0,0],[2025,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2026,3,29,0,59,59],[2026,3,29,1,59,59], '2025102601:00:00','2025102602:00:00','2026032900:59:59','2026032901:59:59' ], ], 2026 => [ [ [2026,3,29,1,0,0],[2026,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2026,10,25,0,59,59],[2026,10,25,2,59,59], '2026032901:00:00','2026032903:00:00','2026102500:59:59','2026102502:59:59' ], [ [2026,10,25,1,0,0],[2026,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2027,3,28,0,59,59],[2027,3,28,1,59,59], '2026102501:00:00','2026102502:00:00','2027032800:59:59','2027032801:59:59' ], ], 2027 => [ [ [2027,3,28,1,0,0],[2027,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2027,10,31,0,59,59],[2027,10,31,2,59,59], '2027032801:00:00','2027032803:00:00','2027103100:59:59','2027103102:59:59' ], [ [2027,10,31,1,0,0],[2027,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2028,3,26,0,59,59],[2028,3,26,1,59,59], '2027103101:00:00','2027103102:00:00','2028032600:59:59','2028032601:59:59' ], ], 2028 => [ [ [2028,3,26,1,0,0],[2028,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2028,10,29,0,59,59],[2028,10,29,2,59,59], '2028032601:00:00','2028032603:00:00','2028102900:59:59','2028102902:59:59' ], [ [2028,10,29,1,0,0],[2028,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2029,3,25,0,59,59],[2029,3,25,1,59,59], '2028102901:00:00','2028102902:00:00','2029032500:59:59','2029032501:59:59' ], ], 2029 => [ [ [2029,3,25,1,0,0],[2029,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2029,10,28,0,59,59],[2029,10,28,2,59,59], '2029032501:00:00','2029032503:00:00','2029102800:59:59','2029102802:59:59' ], [ [2029,10,28,1,0,0],[2029,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2030,3,31,0,59,59],[2030,3,31,1,59,59], '2029102801:00:00','2029102802:00:00','2030033100:59:59','2030033101:59:59' ], ], 2030 => [ [ [2030,3,31,1,0,0],[2030,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2030,10,27,0,59,59],[2030,10,27,2,59,59], '2030033101:00:00','2030033103:00:00','2030102700:59:59','2030102702:59:59' ], [ [2030,10,27,1,0,0],[2030,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2031,3,30,0,59,59],[2031,3,30,1,59,59], '2030102701:00:00','2030102702:00:00','2031033000:59:59','2031033001:59:59' ], ], 2031 => [ [ [2031,3,30,1,0,0],[2031,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2031,10,26,0,59,59],[2031,10,26,2,59,59], '2031033001:00:00','2031033003:00:00','2031102600:59:59','2031102602:59:59' ], [ [2031,10,26,1,0,0],[2031,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2032,3,28,0,59,59],[2032,3,28,1,59,59], '2031102601:00:00','2031102602:00:00','2032032800:59:59','2032032801:59:59' ], ], 2032 => [ [ [2032,3,28,1,0,0],[2032,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2032,10,31,0,59,59],[2032,10,31,2,59,59], '2032032801:00:00','2032032803:00:00','2032103100:59:59','2032103102:59:59' ], [ [2032,10,31,1,0,0],[2032,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2033,3,27,0,59,59],[2033,3,27,1,59,59], '2032103101:00:00','2032103102:00:00','2033032700:59:59','2033032701:59:59' ], ], 2033 => [ [ [2033,3,27,1,0,0],[2033,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2033,10,30,0,59,59],[2033,10,30,2,59,59], '2033032701:00:00','2033032703:00:00','2033103000:59:59','2033103002:59:59' ], [ [2033,10,30,1,0,0],[2033,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2034,3,26,0,59,59],[2034,3,26,1,59,59], '2033103001:00:00','2033103002:00:00','2034032600:59:59','2034032601:59:59' ], ], 2034 => [ [ [2034,3,26,1,0,0],[2034,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2034,10,29,0,59,59],[2034,10,29,2,59,59], '2034032601:00:00','2034032603:00:00','2034102900:59:59','2034102902:59:59' ], [ [2034,10,29,1,0,0],[2034,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2035,3,25,0,59,59],[2035,3,25,1,59,59], '2034102901:00:00','2034102902:00:00','2035032500:59:59','2035032501:59:59' ], ], 2035 => [ [ [2035,3,25,1,0,0],[2035,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2035,10,28,0,59,59],[2035,10,28,2,59,59], '2035032501:00:00','2035032503:00:00','2035102800:59:59','2035102802:59:59' ], [ [2035,10,28,1,0,0],[2035,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2036,3,30,0,59,59],[2036,3,30,1,59,59], '2035102801:00:00','2035102802:00:00','2036033000:59:59','2036033001:59:59' ], ], 2036 => [ [ [2036,3,30,1,0,0],[2036,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2036,10,26,0,59,59],[2036,10,26,2,59,59], '2036033001:00:00','2036033003:00:00','2036102600:59:59','2036102602:59:59' ], [ [2036,10,26,1,0,0],[2036,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2037,3,29,0,59,59],[2037,3,29,1,59,59], '2036102601:00:00','2036102602:00:00','2037032900:59:59','2037032901:59:59' ], ], 2037 => [ [ [2037,3,29,1,0,0],[2037,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2037,10,25,0,59,59],[2037,10,25,2,59,59], '2037032901:00:00','2037032903:00:00','2037102500:59:59','2037102502:59:59' ], [ [2037,10,25,1,0,0],[2037,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2038,3,28,0,59,59],[2038,3,28,1,59,59], '2037102501:00:00','2037102502:00:00','2038032800:59:59','2038032801:59:59' ], ], 2038 => [ [ [2038,3,28,1,0,0],[2038,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2038,10,31,0,59,59],[2038,10,31,2,59,59], '2038032801:00:00','2038032803:00:00','2038103100:59:59','2038103102:59:59' ], [ [2038,10,31,1,0,0],[2038,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2039,3,27,0,59,59],[2039,3,27,1,59,59], '2038103101:00:00','2038103102:00:00','2039032700:59:59','2039032701:59:59' ], ], 2039 => [ [ [2039,3,27,1,0,0],[2039,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2039,10,30,0,59,59],[2039,10,30,2,59,59], '2039032701:00:00','2039032703:00:00','2039103000:59:59','2039103002:59:59' ], [ [2039,10,30,1,0,0],[2039,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2040,3,25,0,59,59],[2040,3,25,1,59,59], '2039103001:00:00','2039103002:00:00','2040032500:59:59','2040032501:59:59' ], ], 2040 => [ [ [2040,3,25,1,0,0],[2040,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2040,10,28,0,59,59],[2040,10,28,2,59,59], '2040032501:00:00','2040032503:00:00','2040102800:59:59','2040102802:59:59' ], [ [2040,10,28,1,0,0],[2040,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2041,3,31,0,59,59],[2041,3,31,1,59,59], '2040102801:00:00','2040102802:00:00','2041033100:59:59','2041033101:59:59' ], ], 2041 => [ [ [2041,3,31,1,0,0],[2041,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2041,10,27,0,59,59],[2041,10,27,2,59,59], '2041033101:00:00','2041033103:00:00','2041102700:59:59','2041102702:59:59' ], [ [2041,10,27,1,0,0],[2041,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2042,3,30,0,59,59],[2042,3,30,1,59,59], '2041102701:00:00','2041102702:00:00','2042033000:59:59','2042033001:59:59' ], ], 2042 => [ [ [2042,3,30,1,0,0],[2042,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2042,10,26,0,59,59],[2042,10,26,2,59,59], '2042033001:00:00','2042033003:00:00','2042102600:59:59','2042102602:59:59' ], [ [2042,10,26,1,0,0],[2042,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2043,3,29,0,59,59],[2043,3,29,1,59,59], '2042102601:00:00','2042102602:00:00','2043032900:59:59','2043032901:59:59' ], ], 2043 => [ [ [2043,3,29,1,0,0],[2043,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2043,10,25,0,59,59],[2043,10,25,2,59,59], '2043032901:00:00','2043032903:00:00','2043102500:59:59','2043102502:59:59' ], [ [2043,10,25,1,0,0],[2043,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2044,3,27,0,59,59],[2044,3,27,1,59,59], '2043102501:00:00','2043102502:00:00','2044032700:59:59','2044032701:59:59' ], ], 2044 => [ [ [2044,3,27,1,0,0],[2044,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2044,10,30,0,59,59],[2044,10,30,2,59,59], '2044032701:00:00','2044032703:00:00','2044103000:59:59','2044103002:59:59' ], [ [2044,10,30,1,0,0],[2044,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2045,3,26,0,59,59],[2045,3,26,1,59,59], '2044103001:00:00','2044103002:00:00','2045032600:59:59','2045032601:59:59' ], ], 2045 => [ [ [2045,3,26,1,0,0],[2045,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2045,10,29,0,59,59],[2045,10,29,2,59,59], '2045032601:00:00','2045032603:00:00','2045102900:59:59','2045102902:59:59' ], [ [2045,10,29,1,0,0],[2045,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2046,3,25,0,59,59],[2046,3,25,1,59,59], '2045102901:00:00','2045102902:00:00','2046032500:59:59','2046032501:59:59' ], ], 2046 => [ [ [2046,3,25,1,0,0],[2046,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2046,10,28,0,59,59],[2046,10,28,2,59,59], '2046032501:00:00','2046032503:00:00','2046102800:59:59','2046102802:59:59' ], [ [2046,10,28,1,0,0],[2046,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2047,3,31,0,59,59],[2047,3,31,1,59,59], '2046102801:00:00','2046102802:00:00','2047033100:59:59','2047033101:59:59' ], ], 2047 => [ [ [2047,3,31,1,0,0],[2047,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2047,10,27,0,59,59],[2047,10,27,2,59,59], '2047033101:00:00','2047033103:00:00','2047102700:59:59','2047102702:59:59' ], [ [2047,10,27,1,0,0],[2047,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2048,3,29,0,59,59],[2048,3,29,1,59,59], '2047102701:00:00','2047102702:00:00','2048032900:59:59','2048032901:59:59' ], ], 2048 => [ [ [2048,3,29,1,0,0],[2048,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2048,10,25,0,59,59],[2048,10,25,2,59,59], '2048032901:00:00','2048032903:00:00','2048102500:59:59','2048102502:59:59' ], [ [2048,10,25,1,0,0],[2048,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2049,3,28,0,59,59],[2049,3,28,1,59,59], '2048102501:00:00','2048102502:00:00','2049032800:59:59','2049032801:59:59' ], ], 2049 => [ [ [2049,3,28,1,0,0],[2049,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2049,10,31,0,59,59],[2049,10,31,2,59,59], '2049032801:00:00','2049032803:00:00','2049103100:59:59','2049103102:59:59' ], [ [2049,10,31,1,0,0],[2049,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2050,3,27,0,59,59],[2050,3,27,1,59,59], '2049103101:00:00','2049103102:00:00','2050032700:59:59','2050032701:59:59' ], ], 2050 => [ [ [2050,3,27,1,0,0],[2050,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2050,10,30,0,59,59],[2050,10,30,2,59,59], '2050032701:00:00','2050032703:00:00','2050103000:59:59','2050103002:59:59' ], [ [2050,10,30,1,0,0],[2050,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2051,3,26,0,59,59],[2051,3,26,1,59,59], '2050103001:00:00','2050103002:00:00','2051032600:59:59','2051032601:59:59' ], ], 2051 => [ [ [2051,3,26,1,0,0],[2051,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2051,10,29,0,59,59],[2051,10,29,2,59,59], '2051032601:00:00','2051032603:00:00','2051102900:59:59','2051102902:59:59' ], [ [2051,10,29,1,0,0],[2051,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2052,3,31,0,59,59],[2052,3,31,1,59,59], '2051102901:00:00','2051102902:00:00','2052033100:59:59','2052033101:59:59' ], ], 2052 => [ [ [2052,3,31,1,0,0],[2052,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2052,10,27,0,59,59],[2052,10,27,2,59,59], '2052033101:00:00','2052033103:00:00','2052102700:59:59','2052102702:59:59' ], [ [2052,10,27,1,0,0],[2052,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2053,3,30,0,59,59],[2053,3,30,1,59,59], '2052102701:00:00','2052102702:00:00','2053033000:59:59','2053033001:59:59' ], ], 2053 => [ [ [2053,3,30,1,0,0],[2053,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2053,10,26,0,59,59],[2053,10,26,2,59,59], '2053033001:00:00','2053033003:00:00','2053102600:59:59','2053102602:59:59' ], [ [2053,10,26,1,0,0],[2053,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2054,3,29,0,59,59],[2054,3,29,1,59,59], '2053102601:00:00','2053102602:00:00','2054032900:59:59','2054032901:59:59' ], ], 2054 => [ [ [2054,3,29,1,0,0],[2054,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2054,10,25,0,59,59],[2054,10,25,2,59,59], '2054032901:00:00','2054032903:00:00','2054102500:59:59','2054102502:59:59' ], [ [2054,10,25,1,0,0],[2054,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2055,3,28,0,59,59],[2055,3,28,1,59,59], '2054102501:00:00','2054102502:00:00','2055032800:59:59','2055032801:59:59' ], ], 2055 => [ [ [2055,3,28,1,0,0],[2055,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2055,10,31,0,59,59],[2055,10,31,2,59,59], '2055032801:00:00','2055032803:00:00','2055103100:59:59','2055103102:59:59' ], [ [2055,10,31,1,0,0],[2055,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2056,3,26,0,59,59],[2056,3,26,1,59,59], '2055103101:00:00','2055103102:00:00','2056032600:59:59','2056032601:59:59' ], ], 2056 => [ [ [2056,3,26,1,0,0],[2056,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2056,10,29,0,59,59],[2056,10,29,2,59,59], '2056032601:00:00','2056032603:00:00','2056102900:59:59','2056102902:59:59' ], [ [2056,10,29,1,0,0],[2056,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2057,3,25,0,59,59],[2057,3,25,1,59,59], '2056102901:00:00','2056102902:00:00','2057032500:59:59','2057032501:59:59' ], ], 2057 => [ [ [2057,3,25,1,0,0],[2057,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2057,10,28,0,59,59],[2057,10,28,2,59,59], '2057032501:00:00','2057032503:00:00','2057102800:59:59','2057102802:59:59' ], [ [2057,10,28,1,0,0],[2057,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2058,3,31,0,59,59],[2058,3,31,1,59,59], '2057102801:00:00','2057102802:00:00','2058033100:59:59','2058033101:59:59' ], ], 2058 => [ [ [2058,3,31,1,0,0],[2058,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2058,10,27,0,59,59],[2058,10,27,2,59,59], '2058033101:00:00','2058033103:00:00','2058102700:59:59','2058102702:59:59' ], [ [2058,10,27,1,0,0],[2058,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2059,3,30,0,59,59],[2059,3,30,1,59,59], '2058102701:00:00','2058102702:00:00','2059033000:59:59','2059033001:59:59' ], ], 2059 => [ [ [2059,3,30,1,0,0],[2059,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2059,10,26,0,59,59],[2059,10,26,2,59,59], '2059033001:00:00','2059033003:00:00','2059102600:59:59','2059102602:59:59' ], [ [2059,10,26,1,0,0],[2059,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2060,3,28,0,59,59],[2060,3,28,1,59,59], '2059102601:00:00','2059102602:00:00','2060032800:59:59','2060032801:59:59' ], ], 2060 => [ [ [2060,3,28,1,0,0],[2060,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2060,10,31,0,59,59],[2060,10,31,2,59,59], '2060032801:00:00','2060032803:00:00','2060103100:59:59','2060103102:59:59' ], [ [2060,10,31,1,0,0],[2060,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2061,3,27,0,59,59],[2061,3,27,1,59,59], '2060103101:00:00','2060103102:00:00','2061032700:59:59','2061032701:59:59' ], ], 2061 => [ [ [2061,3,27,1,0,0],[2061,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2061,10,30,0,59,59],[2061,10,30,2,59,59], '2061032701:00:00','2061032703:00:00','2061103000:59:59','2061103002:59:59' ], [ [2061,10,30,1,0,0],[2061,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2062,3,26,0,59,59],[2062,3,26,1,59,59], '2061103001:00:00','2061103002:00:00','2062032600:59:59','2062032601:59:59' ], ], 2062 => [ [ [2062,3,26,1,0,0],[2062,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2062,10,29,0,59,59],[2062,10,29,2,59,59], '2062032601:00:00','2062032603:00:00','2062102900:59:59','2062102902:59:59' ], [ [2062,10,29,1,0,0],[2062,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2063,3,25,0,59,59],[2063,3,25,1,59,59], '2062102901:00:00','2062102902:00:00','2063032500:59:59','2063032501:59:59' ], ], 2063 => [ [ [2063,3,25,1,0,0],[2063,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2063,10,28,0,59,59],[2063,10,28,2,59,59], '2063032501:00:00','2063032503:00:00','2063102800:59:59','2063102802:59:59' ], [ [2063,10,28,1,0,0],[2063,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2064,3,30,0,59,59],[2064,3,30,1,59,59], '2063102801:00:00','2063102802:00:00','2064033000:59:59','2064033001:59:59' ], ], 2064 => [ [ [2064,3,30,1,0,0],[2064,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2064,10,26,0,59,59],[2064,10,26,2,59,59], '2064033001:00:00','2064033003:00:00','2064102600:59:59','2064102602:59:59' ], [ [2064,10,26,1,0,0],[2064,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2065,3,29,0,59,59],[2065,3,29,1,59,59], '2064102601:00:00','2064102602:00:00','2065032900:59:59','2065032901:59:59' ], ], 2065 => [ [ [2065,3,29,1,0,0],[2065,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2065,10,25,0,59,59],[2065,10,25,2,59,59], '2065032901:00:00','2065032903:00:00','2065102500:59:59','2065102502:59:59' ], [ [2065,10,25,1,0,0],[2065,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2066,3,28,0,59,59],[2066,3,28,1,59,59], '2065102501:00:00','2065102502:00:00','2066032800:59:59','2066032801:59:59' ], ], ); %LastRule = ( 'zone' => { 'dstoff' => '+02:00:00', 'stdoff' => '+01:00:00', }, 'rules' => { '03' => { 'flag' => 'last', 'dow' => '7', 'num' => '0', 'type' => 'u', 'time' => '01:00:00', 'isdst' => '1', 'abb' => 'CEST', }, '10' => { 'flag' => 'last', 'dow' => '7', 'num' => '0', 'type' => 'u', 'time' => '01:00:00', 'isdst' => '0', 'abb' => 'CET', }, }, ); 1;
49.68579
88
0.505631
ed75746c396e6a3f9eabecd9773c9e63f0c5dd58
1,724
pm
Perl
View/lib/perl/CgiApp/NcbiBLAST.pm
EuPathDB-Infra/ApiCommonWebsite
99a62b0bc17fab7c0a5cf552c3a8aa1361f59033
[ "Apache-2.0" ]
2
2019-09-19T14:36:38.000Z
2019-11-21T05:02:04.000Z
View/lib/perl/CgiApp/NcbiBLAST.pm
EuPathDB-Infra/ApiCommonWebsite
99a62b0bc17fab7c0a5cf552c3a8aa1361f59033
[ "Apache-2.0" ]
9
2020-06-17T18:57:42.000Z
2022-02-23T20:25:10.000Z
View/lib/perl/CgiApp/NcbiBLAST.pm
EuPathDB-Infra/ApiCommonWebsite
99a62b0bc17fab7c0a5cf552c3a8aa1361f59033
[ "Apache-2.0" ]
null
null
null
# Test module for CgiApp # returns protein alignment from blastp vs NRDB and reports if # running in cgi or Apache::Registry environment package ApiCommonWebsite::View::CgiApp::NcbiBLAST; @ISA = qw( EbrcWebsiteCommon::View::CgiApp ); use strict; use URI::Escape; use LWP::UserAgent; use HTTP::Request::Common qw(POST); use EbrcWebsiteCommon::View::CgiApp; sub run { my ($self,$cgi) = @_; my $project_id = $cgi->param('project_id'); my $program = $cgi->param('program'); my $database = $cgi->param('database'); my $source_ID = $cgi->param('source_ID'); my $id_type = $cgi->param('id_type'); my $qh = $self->getQueryHandle($cgi); my $sql; if($id_type eq 'protein'){ $sql = "select SEQUENCE from APIDBTUNING.PROTEINSEQUENCE where SOURCE_ID = '" . $source_ID . "' and PROJECT_ID= '" . $project_id . "'"; }else{ die "cannot find the protein sequence from database based on entered source_ID and PROJECT_ID" ; } my $sh = $qh->prepare($sql); $sh->execute(); my $seq = $sh->fetchrow_array(); $sh->finish(); my $ua = LWP::UserAgent->new; my $args = "CMD=Put&PROGRAM=$program&DATABASE=$database&QUERY=" . $seq; my $req = new HTTP::Request POST => 'https://blast.ncbi.nlm.nih.gov/blast/Blast.cgi'; $req->content_type('application/x-www-form-urlencoded'); $req->content($args); # get the response my $response = $ua->request($req); # parse out the request id $response->content =~ /^ RID = (.*$)/m; my $rid=$1; print "Location: https://blast.ncbi.nlm.nih.gov/blast/Blast.cgi?NCBI_GI=T&FORMAT_OBJECT=Alignment&ALIGNMENTS=5&CMD=Get&FORMAT_TYPE=HTML&RID=$rid"."\n\n"; } 1;
26.9375
157
0.63109
ed618890db75c7432a86cae9ae2635bf92de3289
566
pm
Perl
lib/VMOMI/VirtualMachineMemoryReservationInfo.pm
restump/p5-vmomi
e2571d72a1f552ddd0258ad289ec229d8d12a147
[ "Apache-2.0" ]
1
2020-07-22T21:56:34.000Z
2020-07-22T21:56:34.000Z
lib/VMOMI/VirtualMachineMemoryReservationInfo.pm
restump/p5-vmomi
e2571d72a1f552ddd0258ad289ec229d8d12a147
[ "Apache-2.0" ]
null
null
null
lib/VMOMI/VirtualMachineMemoryReservationInfo.pm
restump/p5-vmomi
e2571d72a1f552ddd0258ad289ec229d8d12a147
[ "Apache-2.0" ]
1
2016-07-19T19:56:09.000Z
2016-07-19T19:56:09.000Z
package VMOMI::VirtualMachineMemoryReservationInfo; use parent 'VMOMI::DynamicData'; use strict; use warnings; our @class_ancestors = ( 'DynamicData', ); our @class_members = ( ['virtualMachineMin', undef, 0, ], ['virtualMachineMax', undef, 0, ], ['virtualMachineReserved', undef, 0, ], ['allocationPolicy', undef, 0, ], ); sub get_class_ancestors { return @class_ancestors; } sub get_class_members { my $class = shift; my @super_members = $class->SUPER::get_class_members(); return (@super_members, @class_members); } 1;
19.517241
59
0.676678
ed9b64e90e3d0b4dbf772ef543e82adf1ebb3b7e
5,075
pm
Perl
lib/MIP/Recipes/Build/Rd_dna.pm
J35P312/MIP
fe9641346f5d82601b72d05169dc955b95423615
[ "MIT" ]
null
null
null
lib/MIP/Recipes/Build/Rd_dna.pm
J35P312/MIP
fe9641346f5d82601b72d05169dc955b95423615
[ "MIT" ]
null
null
null
lib/MIP/Recipes/Build/Rd_dna.pm
J35P312/MIP
fe9641346f5d82601b72d05169dc955b95423615
[ "MIT" ]
null
null
null
package MIP::Recipes::Build::Rd_dna; use 5.026; use Carp; use charnames qw{ :full :short }; use English qw{ -no_match_vars }; use open qw{ :encoding(UTF-8) :std }; use Params::Check qw{ allow check last_error }; use strict; use utf8; use warnings; use warnings qw{ FATAL utf8 }; ## CPANM use autodie qw{ :all }; use Readonly; BEGIN { require Exporter; use base qw{ Exporter }; # Set the version for version checking our $VERSION = 1.03; # Functions and variables which can be optionally exported our @EXPORT_OK = qw{ build_rd_dna_meta_files }; } ## Constants Readonly my $SPACE => q{ }; Readonly my $EMPTY_STR => q{}; Readonly my $TAB => qq{\t}; sub build_rd_dna_meta_files { ## Function : Build rare disease DNA pipeline recipe meta files for wes/wgs data analysis. ## Returns : ## Arguments: $active_parameter_href => Active parameters for this analysis hash {REF} ## : $file_info_href => File info hash {REF} ## : $infile_lane_prefix_href => Infile(s) without the ".ending" {REF} ## : $job_id_href => Job id hash {REF} ## : $log => Log object to write to ## : $parameter_href => Parameter hash {REF} ## : $sample_info_href => Info on samples and case hash {REF} my ($arg_href) = @_; ## Flatten argument(s) my $active_parameter_href; my $file_info_href; my $infile_lane_prefix_href; my $job_id_href; my $log; my $parameter_href; my $sample_info_href; my $tmpl = { active_parameter_href => { default => {}, defined => 1, required => 1, store => \$active_parameter_href, strict_type => 1, }, file_info_href => { default => {}, defined => 1, required => 1, store => \$file_info_href, strict_type => 1, }, infile_lane_prefix_href => { default => {}, defined => 1, required => 1, store => \$infile_lane_prefix_href, strict_type => 1, }, job_id_href => { default => {}, defined => 1, required => 1, store => \$job_id_href, strict_type => 1, }, log => { defined => 1, required => 1, store => \$log, }, parameter_href => { default => {}, defined => 1, required => 1, store => \$parameter_href, strict_type => 1, }, sample_info_href => { default => {}, defined => 1, required => 1, store => \$sample_info_href, strict_type => 1, }, }; check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!}; use MIP::Recipes::Build::Bwa_prerequisites qw{ build_bwa_prerequisites }; use MIP::Recipes::Build::Capture_file_prerequisites qw{ build_capture_file_prerequisites }; use MIP::Recipes::Build::Human_genome_prerequisites qw{ build_human_genome_prerequisites }; use MIP::Recipes::Build::Rtg_prerequisites qw{ build_rtg_prerequisites }; my %build_recipe = ( bwa_build_reference => \&build_bwa_prerequisites, exome_target_bed => \&build_capture_file_prerequisites, human_genome_reference_file_endings => \&build_human_genome_prerequisites, rtg_vcfeval_reference_genome => \&build_rtg_prerequisites, ); BUILD_RECIPE: foreach my $parameter_build_name ( keys %build_recipe ) { RECIPE: foreach my $recipe ( @{ $parameter_href->{$parameter_build_name}{associated_recipe} } ) { next RECIPE if ( not $active_parameter_href->{$recipe} ); next BUILD_RECIPE if ( not $parameter_href->{$parameter_build_name}{build_file} == 1 ); $build_recipe{$parameter_build_name}->( { active_parameter_href => $active_parameter_href, file_info_href => $file_info_href, infile_lane_prefix_href => $infile_lane_prefix_href, job_id_href => $job_id_href, log => $log, parameter_build_suffixes_ref => \@{ $file_info_href->{$parameter_build_name} }, parameter_href => $parameter_href, recipe_name => $recipe, sample_info_href => $sample_info_href, } ); ## Build once for all associated recipes $parameter_href->{$parameter_build_name}{build_file} = 0; } } $log->info( $TAB . q{Reference check: Reference prerequisites checked} ); return 1; } 1;
31.521739
90
0.52867
73d27331e8f93a46e29e4653f1b79d335876354a
3,076
pm
Perl
lib/Number/Phone/StubCountry/IR.pm
gitpan/Number-Phone
8975172ee2b95ac1f6b710d69f033d7feebcdf38
[ "Apache-2.0" ]
null
null
null
lib/Number/Phone/StubCountry/IR.pm
gitpan/Number-Phone
8975172ee2b95ac1f6b710d69f033d7feebcdf38
[ "Apache-2.0" ]
null
null
null
lib/Number/Phone/StubCountry/IR.pm
gitpan/Number-Phone
8975172ee2b95ac1f6b710d69f033d7feebcdf38
[ "Apache-2.0" ]
null
null
null
# automatically generated file, don't edit # Copyright 2011 David Cantrell, derived from data from libphonenumber # http://code.google.com/p/libphonenumber/ # # 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 Number::Phone::StubCountry::IR; use base qw(Number::Phone::StubCountry); use strict; use warnings; our $VERSION = 1.20141203221723; my $formatters = [{'pattern' => '(21)(\\d{3,5})','leading_digits' => '21'},{'pattern' => '(\\d{2})(\\d{4})(\\d{4})','leading_digits' => '[1-8]'},{'leading_digits' => '9','pattern' => '(\\d{3})(\\d{3})(\\d{3,4})'},{'pattern' => '(\\d{3})(\\d{2})(\\d{2,3})','leading_digits' => '9'},{'pattern' => '(\\d{3})(\\d{3})','leading_digits' => '9'}]; my $validators = {'personal_number' => '','voip' => '(?:[2-6]0\\d|993)\\d{7}','mobile' => '9(?:0[12]|[1-3]\\d)\\d{7}','special_rate' => '()|()|(9990\\d{0,6})','toll_free' => '','fixed_line' => '(?:1[137]|2[13-68]|3[1458]|4[145]|5[146-8]|6[146]|7[1467]|8[13467])\\d{8}','geographic' => '(?:1[137]|2[13-68]|3[1458]|4[145]|5[146-8]|6[146]|7[1467]|8[13467])\\d{8}','pager' => '943\\d{7}'};sub areaname { my $self = shift; my $number = $self->{number}; my %map = (9811 => "Mazandaran",9813 => "Gilan",9817 => "Golestan",9821 => "Tehran\ province",9823 => "Semnan\ province",9824 => "Zanjan\ province",9825 => "Qom\ province",9826 => "Alborz",9828 => "Qazvin\ province",9831 => "Isfahan\ province",9834 => "Kerman\ province",9835 => "Yazd\ province",9838 => "Chahar\-mahal\ and\ Bakhtiari",9841 => "East\ Azarbaijan",9844 => "West\ Azarbaijan",9845 => "Ardabil\ province",9851 => "Razavi\ Khorasan",9854 => "Sistan\ and\ Baluchestan",9856 => "South\ Khorasan",9857 => "North\ Khorasan",9858 => "North\ Khorasan",9861 => "Khuzestan",9864 => "North\ Khorasan",9866 => "Lorestan",9871 => "Fars",9874 => "Kohgiluyeh\ and\ Boyer\-Ahmad",9876 => "Hormozgan",9877 => "Bushehr\ province",9881 => "Hamadan\ province",9883 => "Kermanshah\ province",9884 => "Ilam\ province",9886 => "Markazi",9887 => "Kurdistan",); foreach my $prefix (map { substr($number, 0, $_) } reverse(1..length($number))) { return $map{"98$prefix"} if exists($map{"98$prefix"}); } return undef; } sub new { my $class = shift; my $number = shift; $number =~ s/(^\+98|\D)//g; my $self = bless({ number => $number, formatters => $formatters, validators => $validators }, $class); return $self if ($self->is_valid()); $number =~ s/(^0)//g; $self = bless({ number => $number, formatters => $formatters, validators => $validators }, $class); return $self->is_valid() ? $self : undef; } 1;
68.355556
1,298
0.625813
ed8794fd5f451d80c12a625d7e5a172838f0d9e7
5,970
pl
Perl
webapp/perl/local/lib/perl5/auto/share/dist/DateTime-Locale/mas-TZ.pl
tomoyanp/isucon9-qualify-20210912
f84b5d1c82f9d41bbba02422c1a6acd358d9c41a
[ "MIT" ]
null
null
null
webapp/perl/local/lib/perl5/auto/share/dist/DateTime-Locale/mas-TZ.pl
tomoyanp/isucon9-qualify-20210912
f84b5d1c82f9d41bbba02422c1a6acd358d9c41a
[ "MIT" ]
5
2021-05-20T04:16:14.000Z
2022-02-12T01:40:02.000Z
webapp/perl/local/lib/perl5/auto/share/dist/DateTime-Locale/mas-TZ.pl
matsubara0507/isucon9-kansousen
77b19085d76add98a3ce7370063a8636cde62499
[ "MIT" ]
null
null
null
{ am_pm_abbreviated => [ "\N{U+0190}nkak\N{U+025b}ny\N{U+00e1}", "\N{U+0190}nd\N{U+00e1}m\N{U+00e2}", ], available_formats => { Bh => "h B", Bhm => "h:mm B", Bhms => "h:mm:ss B", E => "ccc", EBhm => "E h:mm B", EBhms => "E h:mm:ss B", EHm => "E HH:mm", EHms => "E HH:mm:ss", Ed => "d, E", Ehm => "E h:mm a", Ehms => "E h:mm:ss a", Gy => "G y", GyMMM => "G y MMM", GyMMMEd => "G y MMM d, E", GyMMMd => "G y MMM d", H => "HH", Hm => "HH:mm", Hms => "HH:mm:ss", Hmsv => "HH:mm:ss v", Hmv => "HH:mm v", M => "L", MEd => "E, M/d", MMM => "LLL", MMMEd => "E, MMM d", MMMMEd => "E, MMMM d", "MMMMW-count-other" => "'week' W 'of' MMMM", MMMMd => "MMMM d", MMMd => "MMM d", Md => "M/d", d => "d", h => "h a", hm => "h:mm a", hms => "h:mm:ss a", hmsv => "h:mm:ss a v", hmv => "h:mm a v", ms => "mm:ss", y => "y", yM => "M/y", yMEd => "E, M/d/y", yMMM => "MMM y", yMMMEd => "E, MMM d, y", yMMMM => "MMMM y", yMMMd => "y MMM d", yMd => "y-MM-dd", yQQQ => "QQQ y", yQQQQ => "QQQQ y", "yw-count-other" => "'week' w 'of' Y", }, code => "mas-TZ", date_format_full => "EEEE, d MMMM y", date_format_long => "d MMMM y", date_format_medium => "d MMM y", date_format_short => "dd/MM/y", datetime_format_full => "{1} {0}", datetime_format_long => "{1} {0}", datetime_format_medium => "{1} {0}", datetime_format_short => "{1} {0}", day_format_abbreviated => [ "Jtt", "Jnn", "Jtn", "Alh", "Iju", "Jmo", "Jpi", ], day_format_narrow => [ 3, 4, 5, 6, 7, 1, 2, ], day_format_wide => [ "Jumat\N{U+00e1}tu", "Jumane", "Jumat\N{U+00e1}n\N{U+0254}", "Ala\N{U+00e1}misi", "Jum\N{U+00e1}a", "Jumam\N{U+00f3}si", "Jumap\N{U+00ed}l\N{U+00ed}", ], day_stand_alone_abbreviated => [ "Jtt", "Jnn", "Jtn", "Alh", "Iju", "Jmo", "Jpi", ], day_stand_alone_narrow => [ 3, 4, 5, 6, 7, 1, 2, ], day_stand_alone_wide => [ "Jumat\N{U+00e1}tu", "Jumane", "Jumat\N{U+00e1}n\N{U+0254}", "Ala\N{U+00e1}misi", "Jum\N{U+00e1}a", "Jumam\N{U+00f3}si", "Jumap\N{U+00ed}l\N{U+00ed}", ], era_abbreviated => [ "MY", "EY", ], era_narrow => [ "MY", "EY", ], era_wide => [ "Me\N{U+00ed}n\N{U+014d} Y\N{U+025b}\N{U+0301}s\N{U+0289}", "E\N{U+00ed}n\N{U+014d} Y\N{U+025b}\N{U+0301}s\N{U+0289}", ], first_day_of_week => 1, glibc_date_1_format => "%a %b %e %H:%M:%S %Z %Y", glibc_date_format => "%m/%d/%y", glibc_datetime_format => "%a %b %e %H:%M:%S %Y", glibc_time_12_format => "%I:%M:%S %p", glibc_time_format => "%H:%M:%S", language => "Masai", month_format_abbreviated => [ "Dal", "Ar\N{U+00e1}", "\N{U+0186}\N{U+025b}n", "Doy", "L\N{U+00e9}p", "Rok", "S\N{U+00e1}s", "B\N{U+0254}\N{U+0301}r", "K\N{U+00fa}s", "G\N{U+00ed}s", "Sh\N{U+0289}\N{U+0301}", "Nt\N{U+0289}\N{U+0301}", ], month_format_narrow => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ], month_format_wide => [ "Oladal\N{U+0289}\N{U+0301}", "Ar\N{U+00e1}t", "\N{U+0186}\N{U+025b}n\N{U+0268}\N{U+0301}\N{U+0254}\N{U+0268}\N{U+014b}\N{U+0254}k", "Olodoy\N{U+00ed}\N{U+00f3}r\N{U+00ed}\N{U+00ea} ink\N{U+00f3}k\N{U+00fa}\N{U+00e2}", "Oloil\N{U+00e9}p\N{U+016b}ny\N{U+012b}\N{U+0113} ink\N{U+00f3}k\N{U+00fa}\N{U+00e2}", "K\N{U+00fa}j\N{U+00fa}\N{U+0254}r\N{U+0254}k", "M\N{U+00f3}rus\N{U+00e1}sin", "\N{U+0186}l\N{U+0254}\N{U+0301}\N{U+0268}\N{U+0301}b\N{U+0254}\N{U+0301}r\N{U+00e1}r\N{U+025b}", "K\N{U+00fa}sh\N{U+00ee}n", "Olg\N{U+00ed}san", "P\N{U+0289}sh\N{U+0289}\N{U+0301}ka", "Nt\N{U+0289}\N{U+0301}\N{U+014b}\N{U+0289}\N{U+0301}s", ], month_stand_alone_abbreviated => [ "Dal", "Ar\N{U+00e1}", "\N{U+0186}\N{U+025b}n", "Doy", "L\N{U+00e9}p", "Rok", "S\N{U+00e1}s", "B\N{U+0254}\N{U+0301}r", "K\N{U+00fa}s", "G\N{U+00ed}s", "Sh\N{U+0289}\N{U+0301}", "Nt\N{U+0289}\N{U+0301}", ], month_stand_alone_narrow => [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ], month_stand_alone_wide => [ "Oladal\N{U+0289}\N{U+0301}", "Ar\N{U+00e1}t", "\N{U+0186}\N{U+025b}n\N{U+0268}\N{U+0301}\N{U+0254}\N{U+0268}\N{U+014b}\N{U+0254}k", "Olodoy\N{U+00ed}\N{U+00f3}r\N{U+00ed}\N{U+00ea} ink\N{U+00f3}k\N{U+00fa}\N{U+00e2}", "Oloil\N{U+00e9}p\N{U+016b}ny\N{U+012b}\N{U+0113} ink\N{U+00f3}k\N{U+00fa}\N{U+00e2}", "K\N{U+00fa}j\N{U+00fa}\N{U+0254}r\N{U+0254}k", "M\N{U+00f3}rus\N{U+00e1}sin", "\N{U+0186}l\N{U+0254}\N{U+0301}\N{U+0268}\N{U+0301}b\N{U+0254}\N{U+0301}r\N{U+00e1}r\N{U+025b}", "K\N{U+00fa}sh\N{U+00ee}n", "Olg\N{U+00ed}san", "P\N{U+0289}sh\N{U+0289}\N{U+0301}ka", "Nt\N{U+0289}\N{U+0301}\N{U+014b}\N{U+0289}\N{U+0301}s", ], name => "Masai Tanzania", native_language => "Maa", native_name => "Maa Tansania", native_script => undef, native_territory => "Tansania", native_variant => undef, quarter_format_abbreviated => [ "E1", "E2", "E3", "E4", ], quarter_format_narrow => [ 1, 2, 3, 4, ], quarter_format_wide => [ "Erobo 1", "Erobo 2", "Erobo 3", "Erobo 4", ], quarter_stand_alone_abbreviated => [ "E1", "E2", "E3", "E4", ], quarter_stand_alone_narrow => [ 1, 2, 3, 4, ], quarter_stand_alone_wide => [ "Erobo 1", "Erobo 2", "Erobo 3", "Erobo 4", ], script => undef, territory => "Tanzania", time_format_full => "HH:mm:ss zzzz", time_format_long => "HH:mm:ss z", time_format_medium => "HH:mm:ss", time_format_short => "HH:mm", variant => undef, version => 35, }
21.948529
101
0.483417
73dc8cab70dcf5a539b37c7be5e3ffb69a76409a
16
pl
Perl
HelloWorld/ProgrammingPerl/ch05/ch05.134.pl
grtlinux/KieaPerl
ed8e1e3359ad0186d5cc4f7ed037e956d2f26c9e
[ "Apache-2.0" ]
null
null
null
HelloWorld/ProgrammingPerl/ch05/ch05.134.pl
grtlinux/KieaPerl
ed8e1e3359ad0186d5cc4f7ed037e956d2f26c9e
[ "Apache-2.0" ]
null
null
null
HelloWorld/ProgrammingPerl/ch05/ch05.134.pl
grtlinux/KieaPerl
ed8e1e3359ad0186d5cc4f7ed037e956d2f26c9e
[ "Apache-2.0" ]
null
null
null
/^cat|dog|cow$/
8
15
0.5625
ed7b4ffcbfba18a0c5dbc6152552ee000a599c09
4,958
pl
Perl
perl/vendor/lib/auto/share/dist/DateTime-Locale/bm-ML.pl
ifleeyo180/VspriteMoodleWebsite
38baa924829c83808d2c87d44740ff365927a646
[ "Apache-2.0" ]
2
2021-11-19T22:37:28.000Z
2021-11-22T18:04:55.000Z
perl/vendor/lib/auto/share/dist/DateTime-Locale/bm-ML.pl
ifleeyo180/VspriteMoodleWebsite
38baa924829c83808d2c87d44740ff365927a646
[ "Apache-2.0" ]
6
2021-11-18T00:39:48.000Z
2021-11-20T00:31:40.000Z
perl/vendor/lib/auto/share/dist/DateTime-Locale/bm-ML.pl
ifleeyo180/VspriteMoodleWebsite
38baa924829c83808d2c87d44740ff365927a646
[ "Apache-2.0" ]
null
null
null
{ am_pm_abbreviated => [ "AM", "PM", ], available_formats => { Bh => "h B", Bhm => "h:mm B", Bhms => "h:mm:ss B", E => "ccc", EBhm => "E h:mm B", EBhms => "E h:mm:ss B", EHm => "E HH:mm", EHms => "E HH:mm:ss", Ed => "d, E", Ehm => "E h:mm a", Ehms => "E h:mm:ss a", Gy => "G y", GyMMM => "G y MMM", GyMMMEd => "G y MMM d, E", GyMMMd => "G y MMM d", H => "HH", Hm => "HH:mm", Hms => "HH:mm:ss", Hmsv => "HH:mm:ss v", Hmv => "HH:mm v", M => "M", MEd => "MM-dd, E", MMM => "MMM", MMMEd => "E d MMM", MMMMEd => "E d MMMM", "MMMMW-count-other" => "'week' W 'of' MMMM", MMMMd => "d MMMM", MMMd => "d MMM", MMd => "d/MM", MMdd => "dd/MM", Md => "d/M", d => "d", h => "h a", hm => "h:mm a", hms => "h:mm:ss a", hmsv => "h:mm:ss a v", hmv => "h:mm a v", ms => "m:ss", y => "y", yM => "M/y", yMEd => "E d/M/y", yMM => "MM/y", yMMM => "MMM y", yMMMEd => "E d MMM y", yMMMM => "MMMM y", yMMMd => "d MMM y", yMd => "d/M/y", yQQQ => "QQQ y", yQQQQ => "QQQQ y", "yw-count-other" => "'week' w 'of' Y", }, code => "bm-ML", date_format_full => "EEEE d MMMM y", date_format_long => "d MMMM y", date_format_medium => "d MMM, y", date_format_short => "d/M/y", datetime_format_full => "{1} {0}", datetime_format_long => "{1} {0}", datetime_format_medium => "{1} {0}", datetime_format_short => "{1} {0}", day_format_abbreviated => [ "nt\N{U+025b}", "tar", "ara", "ala", "jum", "sib", "kar", ], day_format_narrow => [ "N", "T", "A", "A", "J", "S", "K", ], day_format_wide => [ "nt\N{U+025b}n\N{U+025b}", "tarata", "araba", "alamisa", "juma", "sibiri", "kari", ], day_stand_alone_abbreviated => [ "nt\N{U+025b}", "tar", "ara", "ala", "jum", "sib", "kar", ], day_stand_alone_narrow => [ "N", "T", "A", "A", "J", "S", "K", ], day_stand_alone_wide => [ "nt\N{U+025b}n\N{U+025b}", "tarata", "araba", "alamisa", "juma", "sibiri", "kari", ], era_abbreviated => [ "J.-C. \N{U+0272}\N{U+025b}", "ni J.-C.", ], era_narrow => [ "J.-C. \N{U+0272}\N{U+025b}", "ni J.-C.", ], era_wide => [ "jezu krisiti \N{U+0272}\N{U+025b}", "jezu krisiti mink\N{U+025b}", ], first_day_of_week => 1, glibc_date_1_format => "%a %b %e %H:%M:%S %Z %Y", glibc_date_format => "%m/%d/%y", glibc_datetime_format => "%a %b %e %H:%M:%S %Y", glibc_time_12_format => "%I:%M:%S %p", glibc_time_format => "%H:%M:%S", language => "Bambara", month_format_abbreviated => [ "zan", "feb", "mar", "awi", "m\N{U+025b}", "zuw", "zul", "uti", "s\N{U+025b}t", "\N{U+0254}ku", "now", "des", ], month_format_narrow => [ "Z", "F", "M", "A", "M", "Z", "Z", "U", "S", "\N{U+0186}", "N", "D", ], month_format_wide => [ "zanwuye", "feburuye", "marisi", "awirili", "m\N{U+025b}", "zuw\N{U+025b}n", "zuluye", "uti", "s\N{U+025b}tanburu", "\N{U+0254}kut\N{U+0254}buru", "nowanburu", "desanburu", ], month_stand_alone_abbreviated => [ "zan", "feb", "mar", "awi", "m\N{U+025b}", "zuw", "zul", "uti", "s\N{U+025b}t", "\N{U+0254}ku", "now", "des", ], month_stand_alone_narrow => [ "Z", "F", "M", "A", "M", "Z", "Z", "U", "S", "\N{U+0186}", "N", "D", ], month_stand_alone_wide => [ "zanwuye", "feburuye", "marisi", "awirili", "m\N{U+025b}", "zuw\N{U+025b}n", "zuluye", "uti", "s\N{U+025b}tanburu", "\N{U+0254}kut\N{U+0254}buru", "nowanburu", "desanburu", ], name => "Bambara Mali", native_language => "bamanakan", native_name => "bamanakan Mali", native_script => undef, native_territory => "Mali", native_variant => undef, quarter_format_abbreviated => [ "KS1", "KS2", "KS3", "KS4", ], quarter_format_narrow => [ 1, 2, 3, 4, ], quarter_format_wide => [ "kalo saba f\N{U+0254}l\N{U+0254}", "kalo saba filanan", "kalo saba sabanan", "kalo saba naaninan", ], quarter_stand_alone_abbreviated => [ "KS1", "KS2", "KS3", "KS4", ], quarter_stand_alone_narrow => [ 1, 2, 3, 4, ], quarter_stand_alone_wide => [ "kalo saba f\N{U+0254}l\N{U+0254}", "kalo saba filanan", "kalo saba sabanan", "kalo saba naaninan", ], script => undef, territory => "Mali", time_format_full => "HH:mm:ss zzzz", time_format_long => "HH:mm:ss z", time_format_medium => "HH:mm:ss", time_format_short => "HH:mm", variant => undef, version => 38, }
18.029091
51
0.452198
ed97107c40fae3e42a5bb6c07f203506286f69a0
268
pm
Perl
lib/MetaCPAN/Web/Controller/Tools.pm
hstejas/metacpan-web
f6d9725ecae678a8d8260f3504fd1f2e3b36d990
[ "Artistic-1.0" ]
1
2021-03-05T10:43:19.000Z
2021-03-05T10:43:19.000Z
lib/MetaCPAN/Web/Controller/Tools.pm
hstejas/metacpan-web
f6d9725ecae678a8d8260f3504fd1f2e3b36d990
[ "Artistic-1.0" ]
1
2020-11-09T15:18:40.000Z
2020-11-09T15:18:40.000Z
lib/MetaCPAN/Web/Controller/Tools.pm
hstejas/metacpan-web
f6d9725ecae678a8d8260f3504fd1f2e3b36d990
[ "Artistic-1.0" ]
1
2020-03-17T13:55:24.000Z
2020-03-17T13:55:24.000Z
package MetaCPAN::Web::Controller::Tools; use Moose; use namespace::autoclean; BEGIN { extends 'MetaCPAN::Web::Controller' } sub tools : Path : Args(0) { my ( $self, $c ) = @_; $c->stash( template => 'tools.html' ); } __PACKAGE__->meta->make_immutable; 1;
17.866667
45
0.645522
ed2f50a02ad0d3a39fbd9bf48724f62512b77438
3,140
t
Perl
t/bcftools_merge.t
BuildJet/MIP
f1f63117a7324e37dbcaa16c0298f4b4c857d44c
[ "MIT" ]
null
null
null
t/bcftools_merge.t
BuildJet/MIP
f1f63117a7324e37dbcaa16c0298f4b4c857d44c
[ "MIT" ]
null
null
null
t/bcftools_merge.t
BuildJet/MIP
f1f63117a7324e37dbcaa16c0298f4b4c857d44c
[ "MIT" ]
null
null
null
#!/usr/bin/env perl use 5.026; use Carp; use charnames qw{ :full :short }; use English qw{ -no_match_vars }; use File::Basename qw{ dirname }; use File::Spec::Functions qw{ catdir }; use FindBin qw{ $Bin }; use open qw{ :encoding(UTF-8) :std }; use Params::Check qw{ allow check last_error }; use Test::More; use utf8; use warnings qw{ FATAL utf8 }; ## CPANM use autodie qw{ :all }; use Modern::Perl qw{ 2018 }; use Readonly; ## MIPs lib/ use lib catdir( dirname($Bin), q{lib} ); use MIP::Constants qw{ $COMMA $SPACE }; use MIP::Test::Commands qw{ test_function }; use MIP::Test::Fixtures qw{ test_standard_cli }; my $VERBOSE = 1; our $VERSION = 1.01; $VERBOSE = test_standard_cli( { verbose => $VERBOSE, version => $VERSION, } ); BEGIN { use MIP::Test::Fixtures qw{ test_import }; ### Check all internal dependency modules and imports ## Modules with import my %perl_module = ( q{MIP::Program::Bcftools} => [qw{ bcftools_merge }], q{MIP::Test::Fixtures} => [qw{ test_standard_cli }], ); test_import( { perl_module_href => \%perl_module, } ); } use MIP::Program::Bcftools qw{ bcftools_merge }; diag( q{Test bcftools_merge from Bcftools.pm v} . $MIP::Program::Bcftools::VERSION . $COMMA . $SPACE . q{Perl} . $SPACE . $PERL_VERSION . $SPACE . $EXECUTABLE_NAME ); ## Base arguments my @function_base_commands = qw{ bcftools }; my %base_argument = ( filehandle => { input => undef, expected_output => \@function_base_commands, }, stderrfile_path => { input => q{stderrfile.test}, expected_output => q{2> stderrfile.test}, }, stderrfile_path_append => { input => q{stderrfile.test}, expected_output => q{2>> stderrfile.test}, }, stdoutfile_path => { input => q{stdoutfile.test}, expected_output => q{1> stdoutfile.test}, }, ); ## Can be duplicated with %base_argument and/or %specific_argument ## to enable testing of each individual argument my %specific_argument = ( infile_paths_ref => { inputs_ref => [qw{ infile_path_ref1 infile_path_ref2 infile_path_ref3 }], expected_output => q{infile_path_ref1 infile_path_ref2 infile_path_ref3}, }, outfile_path => { input => q{outfile.txt}, expected_output => q{--output outfile.txt}, }, output_type => { input => q{v}, expected_output => q{--output-type v}, }, ); ## Coderef - enables generalized use of generate call my $module_function_cref = \&bcftools_merge; ## Test both base and function specific arguments my @arguments = ( \%base_argument, \%specific_argument ); ARGUMENT_HASH_REF: foreach my $argument_href (@arguments) { my @commands = test_function( { argument_href => $argument_href, do_test_base_command => 1, function_base_commands_ref => \@function_base_commands, module_function_cref => $module_function_cref, } ); } done_testing();
26.166667
86
0.612739
eda13706368463e83bbdb11db3e713f07cad154d
47,637
t
Perl
S05-mass/named-chars.t
b2gills/roast
4b689b3c9cc2642fdeb8176a24415ec1540f013f
[ "Artistic-2.0" ]
null
null
null
S05-mass/named-chars.t
b2gills/roast
4b689b3c9cc2642fdeb8176a24415ec1540f013f
[ "Artistic-2.0" ]
null
null
null
S05-mass/named-chars.t
b2gills/roast
4b689b3c9cc2642fdeb8176a24415ec1540f013f
[ "Artistic-2.0" ]
null
null
null
use v6; use Test; =begin pod This file was originally derived from the perl5 CPAN module Perl6::Rules, version 0.3 (12 Apr 2004), file t/named_chars.t. # L<S02/Unicode codepoints/"(Within a regex you may also use \C to match a character # that is not the specified character.)"> =end pod plan 431; ok("abc\x[a]def" ~~ m/\c[LINE FEED (LF)]/, 'Unanchored named LINE FEED (LF)'); ok("abc\c[LINE FEED (LF)]def" ~~ m/\x[A]/, 'Unanchored \x[A]'); ok("abc\c[LINE FEED (LF)]def" ~~ m/\o[12]/, 'Unanchored \o[12]'); ok("abc\x[a]def" ~~ m/^ abc \c[LINE FEED (LF)] def $/, 'Anchored LINE FEED (LF)'); ok("abc\x[c]def" ~~ m/\c[FORM FEED (FF)]/, 'Unanchored named FORM FEED (FF)'); ok("abc\c[FORM FEED (FF)]def" ~~ m/\x[C]/, 'Unanchored \x[C]'); ok("abc\c[FORM FEED (FF)]def" ~~ m/\o[14]/, 'Unanchored \o[14]'); ok("abc\x[c]def" ~~ m/^ abc \c[FORM FEED (FF)] def $/, 'Anchored FORM FEED (FF)'); ok("abc\x[c]\x[a]def" ~~ m/\c[FORM FEED (FF), LINE FEED (LF)]/, 'Multiple FORM FEED (FF), LINE FEED (LF)'); ok("\x[c]\x[a]" ~~ m/<[\c[FORM FEED (FF), LINE FEED (LF)]]>/, 'Charclass multiple FORM FEED (FF), LINE FEED (LF)'); ok(!( "\x[c]\x[a]" ~~ m/^ <-[\c[FORM FEED (FF), LINE FEED (LF)]]>/ ), 'Negative charclass FORM FEED (FF), LINE FEED (LF)'); ok(!( "\x[c]" ~~ m/^ \C[FORM FEED (FF)]/ ), 'Negative named FORM FEED (FF) nomatch'); ok("\x[a]" ~~ m/^ \C[FORM FEED (FF)]/, 'Negative named FORM FEED (FF) match'); ok(!( "\x[c]" ~~ m/^ <[\C[FORM FEED (FF)]]>/ ), 'Negative charclass named FORM FEED (FF) nomatch'); ok("\x[a]" ~~ m/^ <[\C[FORM FEED (FF)]]>/, 'Negative charclass named FORM FEED (FF) match'); ok(!( "\x[c]" ~~ m/^ \X[C]/ ), 'Negative hex \X[C] nomatch'); ok(!( "\x[c]" ~~ m/^ <[\X[C]]>/ ), 'Negative charclass hex \X[C] nomatch'); ok("\x[c]" ~~ m/^ \X[A]/, 'Negative hex \X[A] match'); ok("\x[c]" ~~ m/^ <[\X[A]]>/, 'Negative charclass hex \X[A] match'); ok("abc\x[d]def" ~~ m/\c[CARRIAGE RETURN (CR)]/, 'Unanchored named CARRIAGE RETURN (CR)'); ok("abc\c[CARRIAGE RETURN (CR)]def" ~~ m/\x[d]/, 'Unanchored \x[d]'); ok("abc\c[CARRIAGE RETURN (CR)]def" ~~ m/\o[15]/, 'Unanchored \o[15]'); ok("abc\x[d]def" ~~ m/^ abc \c[CARRIAGE RETURN (CR)] def $/, 'Anchored CARRIAGE RETURN (CR)'); ok("abc\x[d]\x[c]def" ~~ m/\c[CARRIAGE RETURN (CR), FORM FEED (FF)]/, 'Multiple CARRIAGE RETURN (CR), FORM FEED (FF)'); ok("\x[d]\x[c]" ~~ m/<[\c[CARRIAGE RETURN (CR), FORM FEED (FF)]]>/, 'Charclass multiple CARRIAGE RETURN (CR), FORM FEED (FF)'); ok(!( "\x[d]\x[c]" ~~ m/^ <-[\c[CARRIAGE RETURN (CR), FORM FEED (FF)]]>/ ), 'Negative charclass CARRIAGE RETURN (CR), FORM FEED (FF)'); ok(!( "\x[d]" ~~ m/^ \C[CARRIAGE RETURN (CR)]/ ), 'Negative named CARRIAGE RETURN (CR) nomatch'); ok("\x[c]" ~~ m/^ \C[CARRIAGE RETURN (CR)]/, 'Negative named CARRIAGE RETURN (CR) match'); ok(!( "\x[d]" ~~ m/^ <[\C[CARRIAGE RETURN (CR)]]>/ ), 'Negative charclass named CARRIAGE RETURN (CR) nomatch'); ok("\x[c]" ~~ m/^ <[\C[CARRIAGE RETURN (CR)]]>/, 'Negative charclass named CARRIAGE RETURN (CR) match'); ok(!( "\x[d]" ~~ m/^ \X[D]/ ), 'Negative hex \X[D] nomatch'); ok(!( "\x[d]" ~~ m/^ <[\X[D]]>/ ), 'Negative charclass hex \X[D] nomatch'); ok("\x[d]" ~~ m/^ \X[C]/, 'Negative hex \X[C] match'); ok("\x[d]" ~~ m/^ <[\X[C]]>/, 'Negative charclass hex \X[C] match'); ok("abc\x[85]def" ~~ m/\c[NEXT LINE (NEL)]/, 'Unanchored named NEXT LINE (NEL)'); ok("abc\c[NEXT LINE (NEL)]def" ~~ m/\x[85]/, 'Unanchored \x[85]'); ok("abc\c[NEXT LINE (NEL)]def" ~~ m/\o[205]/, 'Unanchored \o[205]'); ok("abc\x[85]def" ~~ m/^ abc \c[NEXT LINE (NEL)] def $/, 'Anchored NEXT LINE (NEL)'); ok("abc\x[85]\x[d]def" ~~ m/\c[NEXT LINE (NEL), CARRIAGE RETURN (CR)]/, 'Multiple NEXT LINE (NEL), CARRIAGE RETURN (CR)'); ok("\x[85]\x[d]" ~~ m/<[\c[NEXT LINE (NEL), CARRIAGE RETURN (CR)]]>/, 'Charclass multiple NEXT LINE (NEL), CARRIAGE RETURN (CR)'); ok(!( "\x[85]\x[d]" ~~ m/^ <-[\c[NEXT LINE (NEL), CARRIAGE RETURN (CR)]]>/ ), 'Negative charclass NEXT LINE (NEL), CARRIAGE RETURN (CR)'); ok(!( "\x[85]" ~~ m/^ \C[NEXT LINE (NEL)]/ ), 'Negative named NEXT LINE (NEL) nomatch'); ok("\x[d]" ~~ m/^ \C[NEXT LINE (NEL)]/, 'Negative named NEXT LINE (NEL) match'); ok(!( "\x[85]" ~~ m/^ <[\C[NEXT LINE (NEL)]]>/ ), 'Negative charclass named NEXT LINE (NEL) nomatch'); ok("\x[d]" ~~ m/^ <[\C[NEXT LINE (NEL)]]>/, 'Negative charclass named NEXT LINE (NEL) match'); ok(!( "\x[85]" ~~ m/^ \X[85]/ ), 'Negative hex \X[85] nomatch'); ok(!( "\x[85]" ~~ m/^ <[\X[85]]>/ ), 'Negative charclass hex \X[85] nomatch'); ok("\x[85]" ~~ m/^ \X[D]/, 'Negative hex \X[D] match'); ok("\x[85]" ~~ m/^ <[\X[D]]>/, 'Negative charclass hex \X[D] match'); ok("abc\c[LINE FEED (LF)]def" ~~ m/\c[LINE FEED (LF)]/, 'Unanchored named LINE FEED (LF)'); ok("abc\c[LINE FEED (LF)]def" ~~ m/^ abc \c[LINE FEED (LF)] def $/, 'Anchored LINE FEED (LF)'); ok("abc\c[LINE FEED (LF)]\x[85]def" ~~ m/\c[LINE FEED (LF), NEXT LINE (NEL)]/, 'Multiple LINE FEED (LF), NEXT LINE (NEL)'); ok("\c[LINE FEED (LF)]\x[85]" ~~ m/<[\c[LINE FEED (LF), NEXT LINE (NEL)]]>/, 'Charclass multiple LINE FEED (LF), NEXT LINE (NEL)'); ok(!( "\c[LINE FEED (LF)]\x[85]" ~~ m/^ <-[\c[LINE FEED (LF), NEXT LINE (NEL)]]>/ ), 'Negative charclass LINE FEED (LF), NEXT LINE (NEL)'); ok(!( "\c[LINE FEED (LF)]" ~~ m/^ \C[LINE FEED (LF)]/ ), 'Negative named LINE FEED (LF) nomatch'); ok("\x[85]" ~~ m/^ \C[LINE FEED (LF)]/, 'Negative named LINE FEED (LF) match'); ok(!( "\c[LINE FEED (LF)]" ~~ m/^ <[\C[LINE FEED (LF)]]>/ ), 'Negative charclass named LINE FEED (LF) nomatch'); ok("\x[85]" ~~ m/^ <[\C[LINE FEED (LF)]]>/, 'Negative charclass named LINE FEED (LF) match'); ok("abc\c[FORM FEED (FF)]def" ~~ m/\c[FORM FEED (FF)]/, 'Unanchored named FORM FEED (FF)'); ok("abc\c[FORM FEED (FF)]def" ~~ m/^ abc \c[FORM FEED (FF)] def $/, 'Anchored FORM FEED (FF)'); ok("abc\c[FORM FEED (FF)]\c[LINE FEED (LF)]def" ~~ m/\c[FORM FEED (FF), LINE FEED (LF)]/, 'Multiple FORM FEED (FF), LINE FEED (LF)'); ok("\c[FORM FEED (FF)]\c[LINE FEED (LF)]" ~~ m/<[\c[FORM FEED (FF), LINE FEED (LF)]]>/, 'Charclass multiple FORM FEED (FF), LINE FEED (LF)'); ok(!( "\c[FORM FEED (FF)]\c[LINE FEED (LF)]" ~~ m/^ <-[\c[FORM FEED (FF), LINE FEED (LF)]]>/ ), 'Negative charclass FORM FEED (FF), LINE FEED (LF)'); ok(!( "\c[FORM FEED (FF)]" ~~ m/^ \C[FORM FEED (FF)]/ ), 'Negative named FORM FEED (FF) nomatch'); ok("\c[LINE FEED (LF)]" ~~ m/^ \C[FORM FEED (FF)]/, 'Negative named FORM FEED (FF) match'); ok(!( "\c[FORM FEED (FF)]" ~~ m/^ <[\C[FORM FEED (FF)]]>/ ), 'Negative charclass named FORM FEED (FF) nomatch'); ok("\c[LINE FEED (LF)]" ~~ m/^ <[\C[FORM FEED (FF)]]>/, 'Negative charclass named FORM FEED (FF) match'); ok("abc\c[CARRIAGE RETURN (CR)]def" ~~ m/\c[CARRIAGE RETURN (CR)]/, 'Unanchored named CARRIAGE RETURN (CR)'); ok("abc\c[CARRIAGE RETURN (CR)]def" ~~ m/^ abc \c[CARRIAGE RETURN (CR)] def $/, 'Anchored CARRIAGE RETURN (CR)'); ok("abc\c[CARRIAGE RETURN (CR)]\c[FORM FEED (FF)]def" ~~ m/\c[CARRIAGE RETURN (CR),FORM FEED (FF)]/, 'Multiple CARRIAGE RETURN (CR),FORM FEED (FF)'); ok("\c[CARRIAGE RETURN (CR)]\c[FORM FEED (FF)]" ~~ m/<[\c[CARRIAGE RETURN (CR),FORM FEED (FF)]]>/, 'Charclass multiple CARRIAGE RETURN (CR),FORM FEED (FF)'); ok(!( "\c[CARRIAGE RETURN (CR)]\c[FORM FEED (FF)]" ~~ m/^ <-[\c[CARRIAGE RETURN (CR),FORM FEED (FF)]]>/ ), 'Negative charclass CARRIAGE RETURN (CR),FORM FEED (FF)'); ok(!( "\c[CARRIAGE RETURN (CR)]" ~~ m/^ \C[CARRIAGE RETURN (CR)]/ ), 'Negative named CARRIAGE RETURN (CR) nomatch'); ok("\c[FORM FEED (FF)]" ~~ m/^ \C[CARRIAGE RETURN (CR)]/, 'Negative named CARRIAGE RETURN (CR) match'); ok(!( "\c[CARRIAGE RETURN (CR)]" ~~ m/^ <[\C[CARRIAGE RETURN (CR)]]>/ ), 'Negative charclass named CARRIAGE RETURN (CR) nomatch'); ok("\c[FORM FEED (FF)]" ~~ m/^ <[\C[CARRIAGE RETURN (CR)]]>/, 'Negative charclass named CARRIAGE RETURN (CR) match'); ok("abc\c[NEXT LINE (NEL)]def" ~~ m/\c[NEXT LINE (NEL)]/, 'Unanchored named NEXT LINE (NEL)'); ok("abc\c[NEXT LINE (NEL)]def" ~~ m/^ abc \c[NEXT LINE (NEL)] def $/, 'Anchored NEXT LINE (NEL)'); ok("abc\c[NEXT LINE (NEL)]\c[CARRIAGE RETURN (CR)]def" ~~ m/\c[NEXT LINE (NEL),CARRIAGE RETURN (CR)]/, 'Multiple NEXT LINE (NEL),CARRIAGE RETURN (CR)'); ok("\c[NEXT LINE (NEL)]\c[CARRIAGE RETURN (CR)]" ~~ m/<[\c[NEXT LINE (NEL),CARRIAGE RETURN (CR)]]>/, 'Charclass multiple NEXT LINE (NEL),CARRIAGE RETURN (CR)'); ok(!( "\c[NEXT LINE (NEL)]\c[CARRIAGE RETURN (CR)]" ~~ m/^ <-[\c[NEXT LINE (NEL),CARRIAGE RETURN (CR)]]>/ ), 'Negative charclass NEXT LINE (NEL),CARRIAGE RETURN (CR)'); ok(!( "\c[NEXT LINE (NEL)]" ~~ m/^ \C[NEXT LINE (NEL)]/ ), 'Negative named NEXT LINE (NEL) nomatch'); ok("\c[CARRIAGE RETURN (CR)]" ~~ m/^ \C[NEXT LINE (NEL)]/, 'Negative named NEXT LINE (NEL) match'); ok(!( "\c[NEXT LINE (NEL)]" ~~ m/^ <[\C[NEXT LINE (NEL)]]>/ ), 'Negative charclass named NEXT LINE (NEL) nomatch'); ok("\c[CARRIAGE RETURN (CR)]" ~~ m/^ <[\C[NEXT LINE (NEL)]]>/, 'Negative charclass named NEXT LINE (NEL) match'); ok("abc\c[LF]def" ~~ m/\c[LF]/, 'Unanchored named LF'); ok("abc\c[LF]def" ~~ m/^ abc \c[LF] def $/, 'Anchored LF'); ok("abc\c[LF]\c[NEXT LINE (NEL)]def" ~~ m/\c[LF, NEXT LINE (NEL)]/, 'Multiple LF, NEXT LINE (NEL)'); ok("\c[LF]\c[NEXT LINE (NEL)]" ~~ m/<[\c[LF, NEXT LINE (NEL)]]>/, 'Charclass multiple LF, NEXT LINE (NEL)'); ok(!( "\c[LF]\c[NEXT LINE (NEL)]" ~~ m/^ <-[\c[LF, NEXT LINE (NEL)]]>/ ), 'Negative charclass LF, NEXT LINE (NEL)'); ok(!( "\c[LF]" ~~ m/^ \C[LF]/ ), 'Negative named LF nomatch'); ok("\c[NEXT LINE (NEL)]" ~~ m/^ \C[LF]/, 'Negative named LF match'); ok(!( "\c[LF]" ~~ m/^ <[\C[LF]]>/ ), 'Negative charclass named LF nomatch'); ok("\c[NEXT LINE (NEL)]" ~~ m/^ <[\C[LF]]>/, 'Negative charclass named LF match'); ok("abc\c[FF]def" ~~ m/\c[FF]/, 'Unanchored named FF'); ok("abc\c[FF]def" ~~ m/^ abc \c[FF] def $/, 'Anchored FF'); ok("abc\c[FF]\c[LF]def" ~~ m/\c[FF,LF]/, 'Multiple FF,LF'); ok("\c[FF]\c[LF]" ~~ m/<[\c[FF,LF]]>/, 'Charclass multiple FF,LF'); ok(!( "\c[FF]\c[LF]" ~~ m/^ <-[\c[FF,LF]]>/ ), 'Negative charclass FF,LF'); ok(!( "\c[FF]" ~~ m/^ \C[FF]/ ), 'Negative named FF nomatch'); ok("\c[LF]" ~~ m/^ \C[FF]/, 'Negative named FF match'); ok(!( "\c[FF]" ~~ m/^ <[\C[FF]]>/ ), 'Negative charclass named FF nomatch'); ok("\c[LF]" ~~ m/^ <[\C[FF]]>/, 'Negative charclass named FF match'); ok("abc\c[CR]def" ~~ m/\c[CR]/, 'Unanchored named CR'); ok("abc\c[CR]def" ~~ m/^ abc \c[CR] def $/, 'Anchored CR'); ok("abc\c[CR]\c[FF]def" ~~ m/\c[CR,FF]/, 'Multiple CR,FF'); ok("\c[CR]\c[FF]" ~~ m/<[\c[CR,FF]]>/, 'Charclass multiple CR,FF'); ok(!( "\c[CR]\c[FF]" ~~ m/^ <-[\c[CR,FF]]>/ ), 'Negative charclass CR,FF'); ok(!( "\c[CR]" ~~ m/^ \C[CR]/ ), 'Negative named CR nomatch'); ok("\c[FF]" ~~ m/^ \C[CR]/, 'Negative named CR match'); ok(!( "\c[CR]" ~~ m/^ <[\C[CR]]>/ ), 'Negative charclass named CR nomatch'); ok("\c[FF]" ~~ m/^ <[\C[CR]]>/, 'Negative charclass named CR match'); ok("abc\c[NEL]def" ~~ m/\c[NEL]/, 'Unanchored named NEL'); ok("abc\c[NEL]def" ~~ m/^ abc \c[NEL] def $/, 'Anchored NEL'); ok("abc\c[NEL]\c[CR]def" ~~ m/\c[NEL,CR]/, 'Multiple NEL,CR'); ok("\c[NEL]\c[CR]" ~~ m/<[\c[NEL,CR]]>/, 'Charclass multiple NEL,CR'); ok(!( "\c[NEL]\c[CR]" ~~ m/^ <-[\c[NEL,CR]]>/ ), 'Negative charclass NEL,CR'); ok(!( "\c[NEL]" ~~ m/^ \C[NEL]/ ), 'Negative named NEL nomatch'); ok("\c[CR]" ~~ m/^ \C[NEL]/, 'Negative named NEL match'); ok(!( "\c[NEL]" ~~ m/^ <[\C[NEL]]>/ ), 'Negative charclass named NEL nomatch'); ok("\c[CR]" ~~ m/^ <[\C[NEL]]>/, 'Negative charclass named NEL match'); ok("abc\x[fd55]def" ~~ m/\c[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM]/, 'Unanchored named ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM'); ok("abc\c[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM]def" ~~ m/\x[fd55]/, 'Unanchored \x[fd55]'); ok("abc\c[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM]def" ~~ m/\o[176525]/, 'Unanchored \o[176525]'); ok("abc\x[fd55]def" ~~ m/^ abc \c[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM] def $/, 'Anchored ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM'); ok("abc\x[fd55]\c[NEL]def" ~~ m/\c[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM,NEL]/, 'Multiple ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM,NEL'); ok("\x[fd55]\c[NEL]" ~~ m/<[\c[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM,NEL]]>/, 'Charclass multiple ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM,NEL'); ok(!( "\x[fd55]\c[NEL]" ~~ m/^ <-[\c[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM,NEL]]>/ ), 'Negative charclass ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM,NEL'); ok(!( "\x[fd55]" ~~ m/^ \C[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM]/ ), 'Negative named ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM nomatch'); ok("\c[NEL]" ~~ m/^ \C[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM]/, 'Negative named ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM match'); ok(!( "\x[fd55]" ~~ m/^ <[\C[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM]]>/ ), 'Negative charclass named ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM nomatch'); ok("\c[NEL]" ~~ m/^ <[\C[ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM]]>/, 'Negative charclass named ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM match'); ok(!( "\x[fd55]" ~~ m/^ \X[FD55]/ ), 'Negative hex \X[FD55] nomatch'); ok(!( "\x[fd55]" ~~ m/^ <[\X[FD55]]>/ ), 'Negative charclass hex \X[FD55] nomatch'); ok("\x[5b4]def" ~~ m/\c[HEBREW POINT HIRIQ]/, 'Solitary named HEBREW POINT HIRIQ'); ok("\c[HEBREW POINT HIRIQ]def" ~~ m/\x[5B4]/, 'Solitary \x[5B4]'); ok("\c[HEBREW POINT HIRIQ]def" ~~ m/\o[2664]/, 'Solitary \o[2664]'); ok("abc\x[5b4]def" ~~ m/^ abc \c[HEBREW POINT HIRIQ] def $/, 'Anchored HEBREW POINT HIRIQ'); ok("\x[5b4]\x[fd55]def" ~~ m/\c[HEBREW POINT HIRIQ,ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM]/, 'Solitary multiple HEBREW POINT HIRIQ,ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM'); ok("\x[5b4]\x[fd55]" ~~ m/<[\c[HEBREW POINT HIRIQ,ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM]]>/, 'Charclass multiple HEBREW POINT HIRIQ,ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM'); ok(!( "\x[5b4]\x[fd55]" ~~ m/^ <-[\c[HEBREW POINT HIRIQ,ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM]]>/ ), 'Negative charclass HEBREW POINT HIRIQ,ARABIC LIGATURE TEH WITH MEEM WITH JEEM INITIAL FORM'); ok(!( "\x[5b4]" ~~ m/^ \C[HEBREW POINT HIRIQ]/ ), 'Negative named HEBREW POINT HIRIQ nomatch'); ok("\x[fd55]" ~~ m/^ \C[HEBREW POINT HIRIQ]/, 'Negative named HEBREW POINT HIRIQ match'); ok(!( "\x[5b4]" ~~ m/^ <[\C[HEBREW POINT HIRIQ]]>/ ), 'Negative charclass named HEBREW POINT HIRIQ nomatch'); ok("\x[fd55]" ~~ m/^ <[\C[HEBREW POINT HIRIQ]]>/, 'Negative charclass named HEBREW POINT HIRIQ match'); ok(!( "\x[5b4]" ~~ m/^ \X[5B4]/ ), 'Negative hex \X[5B4] nomatch'); ok(!( "\x[5b4]" ~~ m/^ <[\X[5B4]]>/ ), 'Negative charclass hex \X[5B4] nomatch'); ok("\x[5b4]" ~~ m/^ \X[FD55]/, 'Negative hex \X[FD55] match'); ok("\x[5b4]" ~~ m/^ <[\X[FD55]]>/, 'Negative charclass hex \X[FD55] match'); ok("abc\x[1ea2]def" ~~ m/\c[LATIN CAPITAL LETTER A WITH HOOK ABOVE]/, 'Unanchored named LATIN CAPITAL LETTER A WITH HOOK ABOVE'); ok("abc\c[LATIN CAPITAL LETTER A WITH HOOK ABOVE]def" ~~ m/\x[1EA2]/, 'Unanchored \x[1EA2]'); ok("abc\c[LATIN CAPITAL LETTER A WITH HOOK ABOVE]def" ~~ m/\o[17242]/, 'Unanchored \o[17242]'); ok("abc\x[1ea2]def" ~~ m/^ abc \c[LATIN CAPITAL LETTER A WITH HOOK ABOVE] def $/, 'Anchored LATIN CAPITAL LETTER A WITH HOOK ABOVE'); ok("\x[1ea2]\x[5b4]def" ~~ m/\c[LATIN CAPITAL LETTER A WITH HOOK ABOVE,HEBREW POINT HIRIQ]/, 'Solitary multiple LATIN CAPITAL LETTER A WITH HOOK ABOVE,HEBREW POINT HIRIQ'); ok("\x[1ea2]\x[5b4]" ~~ m/<[\c[LATIN CAPITAL LETTER A WITH HOOK ABOVE,HEBREW POINT HIRIQ]]>/, 'Charclass multiple LATIN CAPITAL LETTER A WITH HOOK ABOVE,HEBREW POINT HIRIQ'); ok(!( "\x[1ea2]\x[5b4]" ~~ m/^ <-[\c[LATIN CAPITAL LETTER A WITH HOOK ABOVE,HEBREW POINT HIRIQ]]>/ ), 'Negative charclass LATIN CAPITAL LETTER A WITH HOOK ABOVE,HEBREW POINT HIRIQ'); ok(!( "\x[1ea2]" ~~ m/^ \C[LATIN CAPITAL LETTER A WITH HOOK ABOVE]/ ), 'Negative named LATIN CAPITAL LETTER A WITH HOOK ABOVE nomatch'); ok("\x[5b4]" ~~ m/^ \C[LATIN CAPITAL LETTER A WITH HOOK ABOVE]/, 'Negative named LATIN CAPITAL LETTER A WITH HOOK ABOVE match'); ok(!( "\x[1ea2]" ~~ m/^ <[\C[LATIN CAPITAL LETTER A WITH HOOK ABOVE]]>/ ), 'Negative charclass named LATIN CAPITAL LETTER A WITH HOOK ABOVE nomatch'); ok("\x[5b4]" ~~ m/^ <[\C[LATIN CAPITAL LETTER A WITH HOOK ABOVE]]>/, 'Negative charclass named LATIN CAPITAL LETTER A WITH HOOK ABOVE match'); ok(!( "\x[1ea2]" ~~ m/^ \X[1EA2]/ ), 'Negative hex \X[1EA2] nomatch'); ok(!( "\x[1ea2]" ~~ m/^ <[\X[1EA2]]>/ ), 'Negative charclass hex \X[1EA2] nomatch'); ok("\x[1ea2]" ~~ m/^ \X[5B4]/, 'Negative hex \X[5B4] match'); ok("\x[1ea2]" ~~ m/^ <[\X[5B4]]>/, 'Negative charclass hex \X[5B4] match'); ok("abc\x[565]def" ~~ m/\c[ARMENIAN SMALL LETTER ECH]/, 'Unanchored named ARMENIAN SMALL LETTER ECH'); ok("abc\c[ARMENIAN SMALL LETTER ECH]def" ~~ m/\x[565]/, 'Unanchored \x[565]'); ok("abc\c[ARMENIAN SMALL LETTER ECH]def" ~~ m/\o[2545]/, 'Unanchored \o[2545]'); ok("abc\x[565]def" ~~ m/^ abc \c[ARMENIAN SMALL LETTER ECH] def $/, 'Anchored ARMENIAN SMALL LETTER ECH'); ok("abc\x[565]\x[1ea2]def" ~~ m/\c[ARMENIAN SMALL LETTER ECH,LATIN CAPITAL LETTER A WITH HOOK ABOVE]/, 'Multiple ARMENIAN SMALL LETTER ECH,LATIN CAPITAL LETTER A WITH HOOK ABOVE'); ok("\x[565]\x[1ea2]" ~~ m/<[\c[ARMENIAN SMALL LETTER ECH,LATIN CAPITAL LETTER A WITH HOOK ABOVE]]>/, 'Charclass multiple ARMENIAN SMALL LETTER ECH,LATIN CAPITAL LETTER A WITH HOOK ABOVE'); ok(!( "\x[565]\x[1ea2]" ~~ m/^ <-[\c[ARMENIAN SMALL LETTER ECH,LATIN CAPITAL LETTER A WITH HOOK ABOVE]]>/ ), 'Negative charclass ARMENIAN SMALL LETTER ECH,LATIN CAPITAL LETTER A WITH HOOK ABOVE'); ok(!( "\x[565]" ~~ m/^ \C[ARMENIAN SMALL LETTER ECH]/ ), 'Negative named ARMENIAN SMALL LETTER ECH nomatch'); ok("\x[1ea2]" ~~ m/^ \C[ARMENIAN SMALL LETTER ECH]/, 'Negative named ARMENIAN SMALL LETTER ECH match'); ok(!( "\x[565]" ~~ m/^ <[\C[ARMENIAN SMALL LETTER ECH]]>/ ), 'Negative charclass named ARMENIAN SMALL LETTER ECH nomatch'); ok("\x[1ea2]" ~~ m/^ <[\C[ARMENIAN SMALL LETTER ECH]]>/, 'Negative charclass named ARMENIAN SMALL LETTER ECH match'); ok(!( "\x[565]" ~~ m/^ \X[565]/ ), 'Negative hex \X[565] nomatch'); ok(!( "\x[565]" ~~ m/^ <[\X[565]]>/ ), 'Negative charclass hex \X[565] nomatch'); ok("\x[565]" ~~ m/^ \X[1EA2]/, 'Negative hex \X[1EA2] match'); ok("\x[565]" ~~ m/^ <[\X[1EA2]]>/, 'Negative charclass hex \X[1EA2] match'); ok("abc\x[25db]def" ~~ m/\c[LOWER HALF INVERSE WHITE CIRCLE]/, 'Unanchored named LOWER HALF INVERSE WHITE CIRCLE'); ok("abc\c[LOWER HALF INVERSE WHITE CIRCLE]def" ~~ m/\x[25DB]/, 'Unanchored \x[25DB]'); ok("abc\c[LOWER HALF INVERSE WHITE CIRCLE]def" ~~ m/\o[22733]/, 'Unanchored \o[22733]'); ok("abc\x[25db]def" ~~ m/^ abc \c[LOWER HALF INVERSE WHITE CIRCLE] def $/, 'Anchored LOWER HALF INVERSE WHITE CIRCLE'); ok("abc\x[25db]\x[565]def" ~~ m/\c[LOWER HALF INVERSE WHITE CIRCLE,ARMENIAN SMALL LETTER ECH]/, 'Multiple LOWER HALF INVERSE WHITE CIRCLE,ARMENIAN SMALL LETTER ECH'); ok("\x[25db]\x[565]" ~~ m/<[\c[LOWER HALF INVERSE WHITE CIRCLE,ARMENIAN SMALL LETTER ECH]]>/, 'Charclass multiple LOWER HALF INVERSE WHITE CIRCLE,ARMENIAN SMALL LETTER ECH'); ok(!( "\x[25db]\x[565]" ~~ m/^ <-[\c[LOWER HALF INVERSE WHITE CIRCLE,ARMENIAN SMALL LETTER ECH]]>/ ), 'Negative charclass LOWER HALF INVERSE WHITE CIRCLE,ARMENIAN SMALL LETTER ECH'); ok(!( "\x[25db]" ~~ m/^ \C[LOWER HALF INVERSE WHITE CIRCLE]/ ), 'Negative named LOWER HALF INVERSE WHITE CIRCLE nomatch'); ok("\x[565]" ~~ m/^ \C[LOWER HALF INVERSE WHITE CIRCLE]/, 'Negative named LOWER HALF INVERSE WHITE CIRCLE match'); ok(!( "\x[25db]" ~~ m/^ <[\C[LOWER HALF INVERSE WHITE CIRCLE]]>/ ), 'Negative charclass named LOWER HALF INVERSE WHITE CIRCLE nomatch'); ok("\x[565]" ~~ m/^ <[\C[LOWER HALF INVERSE WHITE CIRCLE]]>/, 'Negative charclass named LOWER HALF INVERSE WHITE CIRCLE match'); ok(!( "\x[25db]" ~~ m/^ \X[25DB]/ ), 'Negative hex \X[25DB] nomatch'); ok(!( "\x[25db]" ~~ m/^ <[\X[25DB]]>/ ), 'Negative charclass hex \X[25DB] nomatch'); ok("\x[25db]" ~~ m/^ \X[565]/, 'Negative hex \X[565] match'); ok("\x[25db]" ~~ m/^ <[\X[565]]>/, 'Negative charclass hex \X[565] match'); ok("abc\x[fe7d]def" ~~ m/\c[ARABIC SHADDA MEDIAL FORM]/, 'Unanchored named ARABIC SHADDA MEDIAL FORM'); ok("abc\c[ARABIC SHADDA MEDIAL FORM]def" ~~ m/\x[fe7d]/, 'Unanchored \x[fe7d]'); ok("abc\c[ARABIC SHADDA MEDIAL FORM]def" ~~ m/\o[177175]/, 'Unanchored \o[177175]'); ok("abc\x[fe7d]def" ~~ m/^ abc \c[ARABIC SHADDA MEDIAL FORM] def $/, 'Anchored ARABIC SHADDA MEDIAL FORM'); ok("abc\x[fe7d]\x[25db]def" ~~ m/\c[ARABIC SHADDA MEDIAL FORM,LOWER HALF INVERSE WHITE CIRCLE]/, 'Multiple ARABIC SHADDA MEDIAL FORM,LOWER HALF INVERSE WHITE CIRCLE'); ok("\x[fe7d]\x[25db]" ~~ m/<[\c[ARABIC SHADDA MEDIAL FORM,LOWER HALF INVERSE WHITE CIRCLE]]>/, 'Charclass multiple ARABIC SHADDA MEDIAL FORM,LOWER HALF INVERSE WHITE CIRCLE'); ok(!( "\x[fe7d]\x[25db]" ~~ m/^ <-[\c[ARABIC SHADDA MEDIAL FORM,LOWER HALF INVERSE WHITE CIRCLE]]>/ ), 'Negative charclass ARABIC SHADDA MEDIAL FORM,LOWER HALF INVERSE WHITE CIRCLE'); ok(!( "\x[fe7d]" ~~ m/^ \C[ARABIC SHADDA MEDIAL FORM]/ ), 'Negative named ARABIC SHADDA MEDIAL FORM nomatch'); ok("\x[25db]" ~~ m/^ \C[ARABIC SHADDA MEDIAL FORM]/, 'Negative named ARABIC SHADDA MEDIAL FORM match'); ok(!( "\x[fe7d]" ~~ m/^ <[\C[ARABIC SHADDA MEDIAL FORM]]>/ ), 'Negative charclass named ARABIC SHADDA MEDIAL FORM nomatch'); ok("\x[25db]" ~~ m/^ <[\C[ARABIC SHADDA MEDIAL FORM]]>/, 'Negative charclass named ARABIC SHADDA MEDIAL FORM match'); ok(!( "\x[fe7d]" ~~ m/^ \X[FE7D]/ ), 'Negative hex \X[FE7D] nomatch'); ok(!( "\x[fe7d]" ~~ m/^ <[\X[FE7D]]>/ ), 'Negative charclass hex \X[FE7D] nomatch'); ok("\x[fe7d]" ~~ m/^ \X[25DB]/, 'Negative hex \X[25DB] match'); ok("\x[fe7d]" ~~ m/^ <[\X[25DB]]>/, 'Negative charclass hex \X[25DB] match'); ok("abc\x[a15d]def" ~~ m/\c[YI SYLLABLE NDO]/, 'Unanchored named YI SYLLABLE NDO'); ok("abc\c[YI SYLLABLE NDO]def" ~~ m/\x[A15D]/, 'Unanchored \x[A15D]'); ok("abc\c[YI SYLLABLE NDO]def" ~~ m/\o[120535]/, 'Unanchored \o[120535]'); ok("abc\x[a15d]def" ~~ m/^ abc \c[YI SYLLABLE NDO] def $/, 'Anchored YI SYLLABLE NDO'); ok("abc\x[a15d]\x[fe7d]def" ~~ m/\c[YI SYLLABLE NDO, ARABIC SHADDA MEDIAL FORM]/, 'Multiple YI SYLLABLE NDO, ARABIC SHADDA MEDIAL FORM'); ok("\x[a15d]\x[fe7d]" ~~ m/<[\c[YI SYLLABLE NDO, ARABIC SHADDA MEDIAL FORM]]>/, 'Charclass multiple YI SYLLABLE NDO, ARABIC SHADDA MEDIAL FORM'); ok(!( "\x[a15d]\x[fe7d]" ~~ m/^ <-[\c[YI SYLLABLE NDO, ARABIC SHADDA MEDIAL FORM]]>/ ), 'Negative charclass YI SYLLABLE NDO, ARABIC SHADDA MEDIAL FORM'); ok(!( "\x[a15d]" ~~ m/^ \C[YI SYLLABLE NDO]/ ), 'Negative named YI SYLLABLE NDO nomatch'); ok("\x[fe7d]" ~~ m/^ \C[YI SYLLABLE NDO]/, 'Negative named YI SYLLABLE NDO match'); ok(!( "\x[a15d]" ~~ m/^ <[\C[YI SYLLABLE NDO]]>/ ), 'Negative charclass named YI SYLLABLE NDO nomatch'); ok("\x[fe7d]" ~~ m/^ <[\C[YI SYLLABLE NDO]]>/, 'Negative charclass named YI SYLLABLE NDO match'); ok(!( "\x[a15d]" ~~ m/^ \X[A15D]/ ), 'Negative hex \X[A15D] nomatch'); ok(!( "\x[a15d]" ~~ m/^ <[\X[A15D]]>/ ), 'Negative charclass hex \X[A15D] nomatch'); ok("\x[a15d]" ~~ m/^ \X[FE7D]/, 'Negative hex \X[FE7D] match'); ok("\x[a15d]" ~~ m/^ <[\X[FE7D]]>/, 'Negative charclass hex \X[FE7D] match'); ok("abc\x[2964]def" ~~ m/\c[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN]/, 'Unanchored named RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN'); ok("abc\c[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN]def" ~~ m/\x[2964]/, 'Unanchored \x[2964]'); ok("abc\c[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN]def" ~~ m/\o[24544]/, 'Unanchored \o[24544]'); ok("abc\x[2964]def" ~~ m/^ abc \c[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN] def $/, 'Anchored RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN'); ok("abc\x[2964]\x[a15d]def" ~~ m/\c[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN,YI SYLLABLE NDO]/, 'Multiple RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN,YI SYLLABLE NDO'); ok("\x[2964]\x[a15d]" ~~ m/<[\c[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN,YI SYLLABLE NDO]]>/, 'Charclass multiple RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN,YI SYLLABLE NDO'); ok(!( "\x[2964]\x[a15d]" ~~ m/^ <-[\c[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN,YI SYLLABLE NDO]]>/ ), 'Negative charclass RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN,YI SYLLABLE NDO'); ok(!( "\x[2964]" ~~ m/^ \C[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN]/ ), 'Negative named RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN nomatch'); ok("\x[a15d]" ~~ m/^ \C[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN]/, 'Negative named RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN match'); ok(!( "\x[2964]" ~~ m/^ <[\C[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN]]>/ ), 'Negative charclass named RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN nomatch'); ok("\x[a15d]" ~~ m/^ <[\C[RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN]]>/, 'Negative charclass named RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN match'); ok(!( "\x[2964]" ~~ m/^ \X[2964]/ ), 'Negative hex \X[2964] nomatch'); ok(!( "\x[2964]" ~~ m/^ <[\X[2964]]>/ ), 'Negative charclass hex \X[2964] nomatch'); ok("\x[2964]" ~~ m/^ \X[A15D]/, 'Negative hex \X[A15D] match'); ok("\x[2964]" ~~ m/^ <[\X[A15D]]>/, 'Negative charclass hex \X[A15D] match'); ok("abc\x[ff6d]def" ~~ m/\c[HALFWIDTH KATAKANA LETTER SMALL YU]/, 'Unanchored named HALFWIDTH KATAKANA LETTER SMALL YU'); ok("abc\c[HALFWIDTH KATAKANA LETTER SMALL YU]def" ~~ m/\x[FF6D]/, 'Unanchored \x[FF6D]'); ok("abc\c[HALFWIDTH KATAKANA LETTER SMALL YU]def" ~~ m/\o[177555]/, 'Unanchored \o[177555]'); ok("abc\x[ff6d]def" ~~ m/^ abc \c[HALFWIDTH KATAKANA LETTER SMALL YU] def $/, 'Anchored HALFWIDTH KATAKANA LETTER SMALL YU'); ok("abc\x[ff6d]\x[2964]def" ~~ m/\c[HALFWIDTH KATAKANA LETTER SMALL YU, RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN]/, 'Multiple HALFWIDTH KATAKANA LETTER SMALL YU, RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN'); ok("\x[ff6d]\x[2964]" ~~ m/<[\c[HALFWIDTH KATAKANA LETTER SMALL YU, RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN]]>/, 'Charclass multiple HALFWIDTH KATAKANA LETTER SMALL YU, RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN'); ok(!( "\x[ff6d]\x[2964]" ~~ m/^ <-[\c[HALFWIDTH KATAKANA LETTER SMALL YU, RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN]]>/ ), 'Negative charclass HALFWIDTH KATAKANA LETTER SMALL YU, RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN'); ok(!( "\x[ff6d]" ~~ m/^ \C[HALFWIDTH KATAKANA LETTER SMALL YU]/ ), 'Negative named HALFWIDTH KATAKANA LETTER SMALL YU nomatch'); ok("\x[2964]" ~~ m/^ \C[HALFWIDTH KATAKANA LETTER SMALL YU]/, 'Negative named HALFWIDTH KATAKANA LETTER SMALL YU match'); ok(!( "\x[ff6d]" ~~ m/^ <[\C[HALFWIDTH KATAKANA LETTER SMALL YU]]>/ ), 'Negative charclass named HALFWIDTH KATAKANA LETTER SMALL YU nomatch'); ok("\x[2964]" ~~ m/^ <[\C[HALFWIDTH KATAKANA LETTER SMALL YU]]>/, 'Negative charclass named HALFWIDTH KATAKANA LETTER SMALL YU match'); ok(!( "\x[ff6d]" ~~ m/^ \X[FF6D]/ ), 'Negative hex \X[FF6D] nomatch'); ok(!( "\x[ff6d]" ~~ m/^ <[\X[FF6D]]>/ ), 'Negative charclass hex \X[FF6D] nomatch'); ok("\x[ff6d]" ~~ m/^ \X[2964]/, 'Negative hex \X[2964] match'); ok("\x[ff6d]" ~~ m/^ <[\X[2964]]>/, 'Negative charclass hex \X[2964] match'); ok("abc\x[36]def" ~~ m/\c[DIGIT SIX]/, 'Unanchored named DIGIT SIX'); ok("abc\c[DIGIT SIX]def" ~~ m/\x[36]/, 'Unanchored \x[36]'); ok("abc\c[DIGIT SIX]def" ~~ m/\o[66]/, 'Unanchored \o[66]'); ok("abc\x[36]def" ~~ m/^ abc \c[DIGIT SIX] def $/, 'Anchored DIGIT SIX'); ok("abc\x[36]\x[ff6d]def" ~~ m/\c[DIGIT SIX,HALFWIDTH KATAKANA LETTER SMALL YU]/, 'Multiple DIGIT SIX,HALFWIDTH KATAKANA LETTER SMALL YU'); ok("\x[36]\x[ff6d]" ~~ m/<[\c[DIGIT SIX,HALFWIDTH KATAKANA LETTER SMALL YU]]>/, 'Charclass multiple DIGIT SIX,HALFWIDTH KATAKANA LETTER SMALL YU'); ok(!( "\x[36]\x[ff6d]" ~~ m/^ <-[\c[DIGIT SIX,HALFWIDTH KATAKANA LETTER SMALL YU]]>/ ), 'Negative charclass DIGIT SIX,HALFWIDTH KATAKANA LETTER SMALL YU'); ok(!( "\x[36]" ~~ m/^ \C[DIGIT SIX]/ ), 'Negative named DIGIT SIX nomatch'); ok("\x[ff6d]" ~~ m/^ \C[DIGIT SIX]/, 'Negative named DIGIT SIX match'); ok(!( "\x[36]" ~~ m/^ <[\C[DIGIT SIX]]>/ ), 'Negative charclass named DIGIT SIX nomatch'); ok("\x[ff6d]" ~~ m/^ <[\C[DIGIT SIX]]>/, 'Negative charclass named DIGIT SIX match'); ok(!( "\x[36]" ~~ m/^ \X[36]/ ), 'Negative hex \X[36] nomatch'); ok(!( "\x[36]" ~~ m/^ <[\X[36]]>/ ), 'Negative charclass hex \X[36] nomatch'); ok("\x[36]" ~~ m/^ \X[FF6D]/, 'Negative hex \X[FF6D] match'); ok("\x[36]" ~~ m/^ <[\X[FF6D]]>/, 'Negative charclass hex \X[FF6D] match'); ok("abc\x[1323]def" ~~ m/\c[ETHIOPIC SYLLABLE THAA]/, 'Unanchored named ETHIOPIC SYLLABLE THAA'); ok("abc\c[ETHIOPIC SYLLABLE THAA]def" ~~ m/\x[1323]/, 'Unanchored \x[1323]'); ok("abc\c[ETHIOPIC SYLLABLE THAA]def" ~~ m/\o[11443]/, 'Unanchored \o[11443]'); ok("abc\x[1323]def" ~~ m/^ abc \c[ETHIOPIC SYLLABLE THAA] def $/, 'Anchored ETHIOPIC SYLLABLE THAA'); ok("abc\x[1323]\x[36]def" ~~ m/\c[ETHIOPIC SYLLABLE THAA, DIGIT SIX]/, 'Multiple ETHIOPIC SYLLABLE THAA, DIGIT SIX'); ok("\x[1323]\x[36]" ~~ m/<[\c[ETHIOPIC SYLLABLE THAA, DIGIT SIX]]>/, 'Charclass multiple ETHIOPIC SYLLABLE THAA, DIGIT SIX'); ok(!( "\x[1323]\x[36]" ~~ m/^ <-[\c[ETHIOPIC SYLLABLE THAA, DIGIT SIX]]>/ ), 'Negative charclass ETHIOPIC SYLLABLE THAA, DIGIT SIX'); ok(!( "\x[1323]" ~~ m/^ \C[ETHIOPIC SYLLABLE THAA]/ ), 'Negative named ETHIOPIC SYLLABLE THAA nomatch'); ok("\x[36]" ~~ m/^ \C[ETHIOPIC SYLLABLE THAA]/, 'Negative named ETHIOPIC SYLLABLE THAA match'); ok(!( "\x[1323]" ~~ m/^ <[\C[ETHIOPIC SYLLABLE THAA]]>/ ), 'Negative charclass named ETHIOPIC SYLLABLE THAA nomatch'); ok("\x[36]" ~~ m/^ <[\C[ETHIOPIC SYLLABLE THAA]]>/, 'Negative charclass named ETHIOPIC SYLLABLE THAA match'); ok(!( "\x[1323]" ~~ m/^ \X[1323]/ ), 'Negative hex \X[1323] nomatch'); ok(!( "\x[1323]" ~~ m/^ <[\X[1323]]>/ ), 'Negative charclass hex \X[1323] nomatch'); ok("\x[1323]" ~~ m/^ \X[36]/, 'Negative hex \X[36] match'); ok("\x[1323]" ~~ m/^ <[\X[36]]>/, 'Negative charclass hex \X[36] match'); ok("abc\x[1697]def" ~~ m/\c[OGHAM LETTER UILLEANN]/, 'Unanchored named OGHAM LETTER UILLEANN'); ok("abc\c[OGHAM LETTER UILLEANN]def" ~~ m/\x[1697]/, 'Unanchored \x[1697]'); ok("abc\c[OGHAM LETTER UILLEANN]def" ~~ m/\o[13227]/, 'Unanchored \o[13227]'); ok("abc\x[1697]def" ~~ m/^ abc \c[OGHAM LETTER UILLEANN] def $/, 'Anchored OGHAM LETTER UILLEANN'); ok("abc\x[1697]\x[1323]def" ~~ m/\c[OGHAM LETTER UILLEANN,ETHIOPIC SYLLABLE THAA]/, 'Multiple OGHAM LETTER UILLEANN,ETHIOPIC SYLLABLE THAA'); ok("\x[1697]\x[1323]" ~~ m/<[\c[OGHAM LETTER UILLEANN,ETHIOPIC SYLLABLE THAA]]>/, 'Charclass multiple OGHAM LETTER UILLEANN,ETHIOPIC SYLLABLE THAA'); ok(!( "\x[1697]\x[1323]" ~~ m/^ <-[\c[OGHAM LETTER UILLEANN,ETHIOPIC SYLLABLE THAA]]>/ ), 'Negative charclass OGHAM LETTER UILLEANN,ETHIOPIC SYLLABLE THAA'); ok(!( "\x[1697]" ~~ m/^ \C[OGHAM LETTER UILLEANN]/ ), 'Negative named OGHAM LETTER UILLEANN nomatch'); ok("\x[1323]" ~~ m/^ \C[OGHAM LETTER UILLEANN]/, 'Negative named OGHAM LETTER UILLEANN match'); ok(!( "\x[1697]" ~~ m/^ <[\C[OGHAM LETTER UILLEANN]]>/ ), 'Negative charclass named OGHAM LETTER UILLEANN nomatch'); ok("\x[1323]" ~~ m/^ <[\C[OGHAM LETTER UILLEANN]]>/, 'Negative charclass named OGHAM LETTER UILLEANN match'); ok(!( "\x[1697]" ~~ m/^ \X[1697]/ ), 'Negative hex \X[1697] nomatch'); ok(!( "\x[1697]" ~~ m/^ <[\X[1697]]>/ ), 'Negative charclass hex \X[1697] nomatch'); ok("\x[1697]" ~~ m/^ \X[1323]/, 'Negative hex \X[1323] match'); ok("\x[1697]" ~~ m/^ <[\X[1323]]>/, 'Negative charclass hex \X[1323] match'); ok("abc\x[fe8b]def" ~~ m/\c[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM]/, 'Unanchored named ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM'); ok("abc\c[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM]def" ~~ m/\x[fe8b]/, 'Unanchored \x[fe8b]'); ok("abc\c[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM]def" ~~ m/\o[177213]/, 'Unanchored \o[177213]'); ok("abc\x[fe8b]def" ~~ m/^ abc \c[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM] def $/, 'Anchored ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM'); ok("abc\x[fe8b]\x[1697]def" ~~ m/\c[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM,OGHAM LETTER UILLEANN]/, 'Multiple ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM,OGHAM LETTER UILLEANN'); ok("\x[fe8b]\x[1697]" ~~ m/<[\c[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM,OGHAM LETTER UILLEANN]]>/, 'Charclass multiple ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM,OGHAM LETTER UILLEANN'); ok(!( "\x[fe8b]\x[1697]" ~~ m/^ <-[\c[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM,OGHAM LETTER UILLEANN]]>/ ), 'Negative charclass ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM,OGHAM LETTER UILLEANN'); ok(!( "\x[fe8b]" ~~ m/^ \C[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM]/ ), 'Negative named ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM nomatch'); ok("\x[1697]" ~~ m/^ \C[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM]/, 'Negative named ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM match'); ok(!( "\x[fe8b]" ~~ m/^ <[\C[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM]]>/ ), 'Negative charclass named ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM nomatch'); ok("\x[1697]" ~~ m/^ <[\C[ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM]]>/, 'Negative charclass named ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM match'); ok(!( "\x[fe8b]" ~~ m/^ \X[FE8B]/ ), 'Negative hex \X[FE8B] nomatch'); ok(!( "\x[fe8b]" ~~ m/^ <[\X[FE8B]]>/ ), 'Negative charclass hex \X[FE8B] nomatch'); ok("\x[fe8b]" ~~ m/^ \X[1697]/, 'Negative hex \X[1697] match'); ok("\x[fe8b]" ~~ m/^ <[\X[1697]]>/, 'Negative charclass hex \X[1697] match'); ok("abc\x[16de]def" ~~ m/\c[RUNIC LETTER DAGAZ DAEG D]/, 'Unanchored named RUNIC LETTER DAGAZ DAEG D'); ok("abc\c[RUNIC LETTER DAGAZ DAEG D]def" ~~ m/\x[16DE]/, 'Unanchored \x[16DE]'); ok("abc\c[RUNIC LETTER DAGAZ DAEG D]def" ~~ m/\o[13336]/, 'Unanchored \o[13336]'); ok("abc\x[16de]def" ~~ m/^ abc \c[RUNIC LETTER DAGAZ DAEG D] def $/, 'Anchored RUNIC LETTER DAGAZ DAEG D'); ok("abc\x[16de]\x[fe8b]def" ~~ m/\c[RUNIC LETTER DAGAZ DAEG D,ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM]/, 'Multiple RUNIC LETTER DAGAZ DAEG D,ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM'); ok("\x[16de]\x[fe8b]" ~~ m/<[\c[RUNIC LETTER DAGAZ DAEG D,ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM]]>/, 'Charclass multiple RUNIC LETTER DAGAZ DAEG D,ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM'); ok(!( "\x[16de]\x[fe8b]" ~~ m/^ <-[\c[RUNIC LETTER DAGAZ DAEG D,ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM]]>/ ), 'Negative charclass RUNIC LETTER DAGAZ DAEG D,ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM'); ok(!( "\x[16de]" ~~ m/^ \C[RUNIC LETTER DAGAZ DAEG D]/ ), 'Negative named RUNIC LETTER DAGAZ DAEG D nomatch'); ok("\x[fe8b]" ~~ m/^ \C[RUNIC LETTER DAGAZ DAEG D]/, 'Negative named RUNIC LETTER DAGAZ DAEG D match'); ok(!( "\x[16de]" ~~ m/^ <[\C[RUNIC LETTER DAGAZ DAEG D]]>/ ), 'Negative charclass named RUNIC LETTER DAGAZ DAEG D nomatch'); ok("\x[fe8b]" ~~ m/^ <[\C[RUNIC LETTER DAGAZ DAEG D]]>/, 'Negative charclass named RUNIC LETTER DAGAZ DAEG D match'); ok(!( "\x[16de]" ~~ m/^ \X[16DE]/ ), 'Negative hex \X[16DE] nomatch'); ok(!( "\x[16de]" ~~ m/^ <[\X[16DE]]>/ ), 'Negative charclass hex \X[16DE] nomatch'); ok("\x[16de]" ~~ m/^ \X[FE8B]/, 'Negative hex \X[FE8B] match'); ok("\x[16de]" ~~ m/^ <[\X[FE8B]]>/, 'Negative charclass hex \X[FE8B] match'); ok("abc\x[64]def" ~~ m/\c[LATIN SMALL LETTER D]/, 'Unanchored named LATIN SMALL LETTER D'); ok("abc\c[LATIN SMALL LETTER D]def" ~~ m/\x[64]/, 'Unanchored \x[64]'); ok("abc\c[LATIN SMALL LETTER D]def" ~~ m/\o[144]/, 'Unanchored \o[144]'); ok("abc\x[64]def" ~~ m/^ abc \c[LATIN SMALL LETTER D] def $/, 'Anchored LATIN SMALL LETTER D'); ok("abc\x[64]\x[16de]def" ~~ m/\c[LATIN SMALL LETTER D,RUNIC LETTER DAGAZ DAEG D]/, 'Multiple LATIN SMALL LETTER D,RUNIC LETTER DAGAZ DAEG D'); ok("\x[64]\x[16de]" ~~ m/<[\c[LATIN SMALL LETTER D,RUNIC LETTER DAGAZ DAEG D]]>/, 'Charclass multiple LATIN SMALL LETTER D,RUNIC LETTER DAGAZ DAEG D'); ok(!( "\x[64]\x[16de]" ~~ m/^ <-[\c[LATIN SMALL LETTER D,RUNIC LETTER DAGAZ DAEG D]]>/ ), 'Negative charclass LATIN SMALL LETTER D,RUNIC LETTER DAGAZ DAEG D'); ok(!( "\x[64]" ~~ m/^ \C[LATIN SMALL LETTER D]/ ), 'Negative named LATIN SMALL LETTER D nomatch'); ok("\x[16de]" ~~ m/^ \C[LATIN SMALL LETTER D]/, 'Negative named LATIN SMALL LETTER D match'); ok(!( "\x[64]" ~~ m/^ <[\C[LATIN SMALL LETTER D]]>/ ), 'Negative charclass named LATIN SMALL LETTER D nomatch'); ok("\x[16de]" ~~ m/^ <[\C[LATIN SMALL LETTER D]]>/, 'Negative charclass named LATIN SMALL LETTER D match'); ok(!( "\x[64]" ~~ m/^ \X[64]/ ), 'Negative hex \X[64] nomatch'); ok(!( "\x[64]" ~~ m/^ <[\X[64]]>/ ), 'Negative charclass hex \X[64] nomatch'); ok("\x[64]" ~~ m/^ \X[16DE]/, 'Negative hex \X[16DE] match'); ok("\x[64]" ~~ m/^ <[\X[16DE]]>/, 'Negative charclass hex \X[16DE] match'); ok("abc\x[2724]def" ~~ m/\c[HEAVY FOUR BALLOON-SPOKED ASTERISK]/, 'Unanchored named HEAVY FOUR BALLOON-SPOKED ASTERISK'); ok("abc\c[HEAVY FOUR BALLOON-SPOKED ASTERISK]def" ~~ m/\x[2724]/, 'Unanchored \x[2724]'); ok("abc\c[HEAVY FOUR BALLOON-SPOKED ASTERISK]def" ~~ m/\o[23444]/, 'Unanchored \o[23444]'); ok("abc\x[2724]def" ~~ m/^ abc \c[HEAVY FOUR BALLOON-SPOKED ASTERISK] def $/, 'Anchored HEAVY FOUR BALLOON-SPOKED ASTERISK'); ok("abc\x[2724]\x[64]def" ~~ m/\c[HEAVY FOUR BALLOON-SPOKED ASTERISK,LATIN SMALL LETTER D]/, 'Multiple HEAVY FOUR BALLOON-SPOKED ASTERISK,LATIN SMALL LETTER D'); ok("\x[2724]\x[64]" ~~ m/<[\c[HEAVY FOUR BALLOON-SPOKED ASTERISK,LATIN SMALL LETTER D]]>/, 'Charclass multiple HEAVY FOUR BALLOON-SPOKED ASTERISK,LATIN SMALL LETTER D'); ok(!( "\x[2724]\x[64]" ~~ m/^ <-[\c[HEAVY FOUR BALLOON-SPOKED ASTERISK,LATIN SMALL LETTER D]]>/ ), 'Negative charclass HEAVY FOUR BALLOON-SPOKED ASTERISK,LATIN SMALL LETTER D'); ok(!( "\x[2724]" ~~ m/^ \C[HEAVY FOUR BALLOON-SPOKED ASTERISK]/ ), 'Negative named HEAVY FOUR BALLOON-SPOKED ASTERISK nomatch'); ok("\x[64]" ~~ m/^ \C[HEAVY FOUR BALLOON-SPOKED ASTERISK]/, 'Negative named HEAVY FOUR BALLOON-SPOKED ASTERISK match'); ok(!( "\x[2724]" ~~ m/^ <[\C[HEAVY FOUR BALLOON-SPOKED ASTERISK]]>/ ), 'Negative charclass named HEAVY FOUR BALLOON-SPOKED ASTERISK nomatch'); ok("\x[64]" ~~ m/^ <[\C[HEAVY FOUR BALLOON-SPOKED ASTERISK]]>/, 'Negative charclass named HEAVY FOUR BALLOON-SPOKED ASTERISK match'); ok(!( "\x[2724]" ~~ m/^ \X[2724]/ ), 'Negative hex \X[2724] nomatch'); ok(!( "\x[2724]" ~~ m/^ <[\X[2724]]>/ ), 'Negative charclass hex \X[2724] nomatch'); ok("\x[2724]" ~~ m/^ \X[64]/, 'Negative hex \X[64] match'); ok("\x[2724]" ~~ m/^ <[\X[64]]>/, 'Negative charclass hex \X[64] match'); ok("abc\x[2719]def" ~~ m/\c[OUTLINED GREEK CROSS]/, 'Unanchored named OUTLINED GREEK CROSS'); ok("abc\c[OUTLINED GREEK CROSS]def" ~~ m/\x[2719]/, 'Unanchored \x[2719]'); ok("abc\c[OUTLINED GREEK CROSS]def" ~~ m/\o[23431]/, 'Unanchored \o[23431]'); ok("abc\x[2719]def" ~~ m/^ abc \c[OUTLINED GREEK CROSS] def $/, 'Anchored OUTLINED GREEK CROSS'); ok("abc\x[2719]\x[2724]def" ~~ m/\c[OUTLINED GREEK CROSS,HEAVY FOUR BALLOON-SPOKED ASTERISK]/, 'Multiple OUTLINED GREEK CROSS,HEAVY FOUR BALLOON-SPOKED ASTERISK'); ok("\x[2719]\x[2724]" ~~ m/<[\c[OUTLINED GREEK CROSS,HEAVY FOUR BALLOON-SPOKED ASTERISK]]>/, 'Charclass multiple OUTLINED GREEK CROSS,HEAVY FOUR BALLOON-SPOKED ASTERISK'); ok(!( "\x[2719]\x[2724]" ~~ m/^ <-[\c[OUTLINED GREEK CROSS,HEAVY FOUR BALLOON-SPOKED ASTERISK]]>/ ), 'Negative charclass OUTLINED GREEK CROSS,HEAVY FOUR BALLOON-SPOKED ASTERISK'); ok(!( "\x[2719]" ~~ m/^ \C[OUTLINED GREEK CROSS]/ ), 'Negative named OUTLINED GREEK CROSS nomatch'); ok("\x[2724]" ~~ m/^ \C[OUTLINED GREEK CROSS]/, 'Negative named OUTLINED GREEK CROSS match'); ok(!( "\x[2719]" ~~ m/^ <[\C[OUTLINED GREEK CROSS]]>/ ), 'Negative charclass named OUTLINED GREEK CROSS nomatch'); ok("\x[2724]" ~~ m/^ <[\C[OUTLINED GREEK CROSS]]>/, 'Negative charclass named OUTLINED GREEK CROSS match'); ok(!( "\x[2719]" ~~ m/^ \X[2719]/ ), 'Negative hex \X[2719] nomatch'); ok(!( "\x[2719]" ~~ m/^ <[\X[2719]]>/ ), 'Negative charclass hex \X[2719] nomatch'); ok("\x[2719]" ~~ m/^ \X[2724]/, 'Negative hex \X[2724] match'); ok("\x[2719]" ~~ m/^ <[\X[2724]]>/, 'Negative charclass hex \X[2724] match'); ok("abc\x[e97]def" ~~ m/\c[LAO LETTER THO TAM]/, 'Unanchored named LAO LETTER THO TAM'); ok("abc\c[LAO LETTER THO TAM]def" ~~ m/\x[e97]/, 'Unanchored \x[e97]'); ok("abc\c[LAO LETTER THO TAM]def" ~~ m/\o[7227]/, 'Unanchored \o[7227]'); ok("abc\x[e97]def" ~~ m/^ abc \c[LAO LETTER THO TAM] def $/, 'Anchored LAO LETTER THO TAM'); ok("abc\x[e97]\x[2719]def" ~~ m/\c[LAO LETTER THO TAM, OUTLINED GREEK CROSS]/, 'Multiple LAO LETTER THO TAM, OUTLINED GREEK CROSS'); ok("\x[e97]\x[2719]" ~~ m/<[\c[LAO LETTER THO TAM, OUTLINED GREEK CROSS]]>/, 'Charclass multiple LAO LETTER THO TAM, OUTLINED GREEK CROSS'); ok(!( "\x[e97]\x[2719]" ~~ m/^ <-[\c[LAO LETTER THO TAM, OUTLINED GREEK CROSS]]>/ ), 'Negative charclass LAO LETTER THO TAM, OUTLINED GREEK CROSS'); ok(!( "\x[e97]" ~~ m/^ \C[LAO LETTER THO TAM]/ ), 'Negative named LAO LETTER THO TAM nomatch'); ok("\x[2719]" ~~ m/^ \C[LAO LETTER THO TAM]/, 'Negative named LAO LETTER THO TAM match'); ok(!( "\x[e97]" ~~ m/^ <[\C[LAO LETTER THO TAM]]>/ ), 'Negative charclass named LAO LETTER THO TAM nomatch'); ok("\x[2719]" ~~ m/^ <[\C[LAO LETTER THO TAM]]>/, 'Negative charclass named LAO LETTER THO TAM match'); ok(!( "\x[e97]" ~~ m/^ \X[E97]/ ), 'Negative hex \X[E97] nomatch'); ok(!( "\x[e97]" ~~ m/^ <[\X[E97]]>/ ), 'Negative charclass hex \X[E97] nomatch'); ok("\x[e97]" ~~ m/^ \X[2719]/, 'Negative hex \X[2719] match'); ok("\x[e97]" ~~ m/^ <[\X[2719]]>/, 'Negative charclass hex \X[2719] match'); ok("abc\x[a42d]def" ~~ m/\c[YI SYLLABLE JJYT]/, 'Unanchored named YI SYLLABLE JJYT'); ok("abc\c[YI SYLLABLE JJYT]def" ~~ m/\x[a42d]/, 'Unanchored \x[a42d]'); ok("abc\c[YI SYLLABLE JJYT]def" ~~ m/\o[122055]/, 'Unanchored \o[122055]'); ok("abc\x[a42d]def" ~~ m/^ abc \c[YI SYLLABLE JJYT] def $/, 'Anchored YI SYLLABLE JJYT'); ok("abc\x[a42d]\x[e97]def" ~~ m/\c[YI SYLLABLE JJYT,LAO LETTER THO TAM]/, 'Multiple YI SYLLABLE JJYT,LAO LETTER THO TAM'); ok("\x[a42d]\x[e97]" ~~ m/<[\c[YI SYLLABLE JJYT,LAO LETTER THO TAM]]>/, 'Charclass multiple YI SYLLABLE JJYT,LAO LETTER THO TAM'); ok(!( "\x[a42d]\x[e97]" ~~ m/^ <-[\c[YI SYLLABLE JJYT,LAO LETTER THO TAM]]>/ ), 'Negative charclass YI SYLLABLE JJYT,LAO LETTER THO TAM'); ok(!( "\x[a42d]" ~~ m/^ \C[YI SYLLABLE JJYT]/ ), 'Negative named YI SYLLABLE JJYT nomatch'); ok("\x[e97]" ~~ m/^ \C[YI SYLLABLE JJYT]/, 'Negative named YI SYLLABLE JJYT match'); ok(!( "\x[a42d]" ~~ m/^ <[\C[YI SYLLABLE JJYT]]>/ ), 'Negative charclass named YI SYLLABLE JJYT nomatch'); ok("\x[e97]" ~~ m/^ <[\C[YI SYLLABLE JJYT]]>/, 'Negative charclass named YI SYLLABLE JJYT match'); ok(!( "\x[a42d]" ~~ m/^ \X[A42D]/ ), 'Negative hex \X[A42D] nomatch'); ok(!( "\x[a42d]" ~~ m/^ <[\X[A42D]]>/ ), 'Negative charclass hex \X[A42D] nomatch'); ok("\x[a42d]" ~~ m/^ \X[E97]/, 'Negative hex \X[E97] match'); ok("\x[a42d]" ~~ m/^ <[\X[E97]]>/, 'Negative charclass hex \X[E97] match'); ok("abc\x[ff6e]def" ~~ m/\c[HALFWIDTH KATAKANA LETTER SMALL YO]/, 'Unanchored named HALFWIDTH KATAKANA LETTER SMALL YO'); ok("abc\c[HALFWIDTH KATAKANA LETTER SMALL YO]def" ~~ m/\x[FF6E]/, 'Unanchored \x[FF6E]'); ok("abc\c[HALFWIDTH KATAKANA LETTER SMALL YO]def" ~~ m/\o[177556]/, 'Unanchored \o[177556]'); ok("abc\x[ff6e]def" ~~ m/^ abc \c[HALFWIDTH KATAKANA LETTER SMALL YO] def $/, 'Anchored HALFWIDTH KATAKANA LETTER SMALL YO'); ok("abc\x[ff6e]\x[a42d]def" ~~ m/\c[HALFWIDTH KATAKANA LETTER SMALL YO,YI SYLLABLE JJYT]/, 'Multiple HALFWIDTH KATAKANA LETTER SMALL YO,YI SYLLABLE JJYT'); ok("\x[ff6e]\x[a42d]" ~~ m/<[\c[HALFWIDTH KATAKANA LETTER SMALL YO,YI SYLLABLE JJYT]]>/, 'Charclass multiple HALFWIDTH KATAKANA LETTER SMALL YO,YI SYLLABLE JJYT'); ok(!( "\x[ff6e]\x[a42d]" ~~ m/^ <-[\c[HALFWIDTH KATAKANA LETTER SMALL YO,YI SYLLABLE JJYT]]>/ ), 'Negative charclass HALFWIDTH KATAKANA LETTER SMALL YO,YI SYLLABLE JJYT'); ok(!( "\x[ff6e]" ~~ m/^ \C[HALFWIDTH KATAKANA LETTER SMALL YO]/ ), 'Negative named HALFWIDTH KATAKANA LETTER SMALL YO nomatch'); ok("\x[a42d]" ~~ m/^ \C[HALFWIDTH KATAKANA LETTER SMALL YO]/, 'Negative named HALFWIDTH KATAKANA LETTER SMALL YO match'); ok(!( "\x[ff6e]" ~~ m/^ <[\C[HALFWIDTH KATAKANA LETTER SMALL YO]]>/ ), 'Negative charclass named HALFWIDTH KATAKANA LETTER SMALL YO nomatch'); ok("\x[a42d]" ~~ m/^ <[\C[HALFWIDTH KATAKANA LETTER SMALL YO]]>/, 'Negative charclass named HALFWIDTH KATAKANA LETTER SMALL YO match'); ok(!( "\x[ff6e]" ~~ m/^ \X[FF6E]/ ), 'Negative hex \X[FF6E] nomatch'); ok(!( "\x[ff6e]" ~~ m/^ <[\X[FF6E]]>/ ), 'Negative charclass hex \X[FF6E] nomatch'); ok("\x[ff6e]" ~~ m/^ \X[A42D]/, 'Negative hex \X[A42D] match'); ok("\x[ff6e]" ~~ m/^ <[\X[A42D]]>/, 'Negative charclass hex \X[A42D] match'); # names special cases (see http://www.unicode.org/reports/tr18/#Name_Properties) "... that require special-casing ..." ok("\x[0F68]" ~~ m/\c[TIBETAN LETTER A]/, 'match named TIBETAN LETTER A'); ok("\x[0F60]" ~~ m/\c[TIBETAN LETTER -A]/, 'match named TIBETAN LETTER -A'); ok(!("\c[TIBETAN LETTER A]" ~~ m/\c[TIBETAN LETTER -A]/), 'nomatch named TIBETAN LETTER A versus -A'); ok(!("\c[TIBETAN LETTER -A]" ~~ m/\c[TIBETAN LETTER A]/), 'nomatch named TIBETAN LETTER -A versus A'); ok("\x[0FB8]" ~~ m/\c[TIBETAN SUBJOINED LETTER A]/, 'match named TIBETAN SUBJOINED LETTER A'); ok("\x[0FB0]" ~~ m/\c[TIBETAN SUBJOINED LETTER -A]/, 'match named TIBETAN SUBJOINED LETTER -A'); ok(!("\c[TIBETAN SUBJOINED LETTER A]" ~~ m/\c[TIBETAN SUBJOINED LETTER -A]/), 'nomatch named TIBETAN SUBJOINED LETTER A versus -A'); ok(!("\c[TIBETAN SUBJOINED LETTER -A]" ~~ m/\c[TIBETAN SUBJOINED LETTER A]/), 'nomatch named TIBETAN SUBJOINED LETTER -A versus A'); ok("\x[116C]" ~~ m/\c[HANGUL JUNGSEONG OE]/, 'match named HANGUL JUNGSEONG OE'); ok("\x[1180]" ~~ m/\c[HANGUL JUNGSEONG O-E]/, 'match named HANGUL JUNGSEONG O-E'); ok(!("\c[HANGUL JUNGSEONG OE]" ~~ m/\c[HANGUL JUNGSEONG O-E]/), 'nomatch named HANGUL JUNGSEONG OE versus O-E'); ok(!("\c[HANGUL JUNGSEONG O-E]" ~~ m/\c[HANGUL JUNGSEONG OE]/), 'nomatch named HANGUL JUNGSEONG O-E versus OE'); # TODO: name aliases (see http://www.unicode.org/reports/tr18/#Name_Properties) # for U+0009 the implementation could accept the official name CHARACTER TABULATION, and also the aliases HORIZONTAL TABULATION, HT, and TAB # XXX should Perl-5 aliases be supported as a minimum? # XXX should there be something like "use warning 'deprecated'"? # TODO: named sequences (see http://www.unicode.org/reports/tr18/#Name_Properties) # TODO: loose match, disregarding case, spaces and hyphen (see http://www.unicode.org/reports/tr18/#Name_Properties) # TODO: global prefix like "LATIN LETTER" (see http://www.unicode.org/reports/tr18/#Name_Properties) # XXX should this be supported? # TODO: border values # \x[0000], \x[007F], \x[0080], \x[00FF], # \x[FFFF], \x[00010000], \x[0010FFFF], # \x[00110000], ... \x[FFFFFFFF] XXX should do what? # TODO: Grapheme # XXX The character name of a grapheme is a list of NFC-names? # TODO: no-names (like <control>) , invalid names, deprecated names # vim: ft=perl6
98.627329
283
0.64347
ed947a0c961b7236637545970a4b58d8f02cce48
1,006
pm
Perl
lib/Google/Ads/GoogleAds/V5/Common/TextList.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
lib/Google/Ads/GoogleAds/V5/Common/TextList.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
lib/Google/Ads/GoogleAds/V5/Common/TextList.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
# Copyright 2020, Google LLC # # 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 Google::Ads::GoogleAds::V5::Common::TextList; use strict; use warnings; use base qw(Google::Ads::GoogleAds::BaseEntity); use Google::Ads::GoogleAds::Utils::GoogleAdsHelper; sub new { my ($class, $args) = @_; my $self = {texts => $args->{texts}}; # Delete the unassigned fields in this object for a more concise JSON payload remove_unassigned_fields($self, $args); bless $self, $class; return $self; } 1;
28.742857
79
0.730616
eda28191c414d3be4797337961599d5cd6f11fe3
865
pm
Perl
lib/Smolder/Debug.pm
rurban/smolder
929c6a5e14e82eb2d592f0df75e49d42f4e92fd1
[ "BSD-3-Clause" ]
10
2015-05-14T20:52:26.000Z
2021-05-26T06:49:55.000Z
lib/Smolder/Debug.pm
rurban/smolder
929c6a5e14e82eb2d592f0df75e49d42f4e92fd1
[ "BSD-3-Clause" ]
null
null
null
lib/Smolder/Debug.pm
rurban/smolder
929c6a5e14e82eb2d592f0df75e49d42f4e92fd1
[ "BSD-3-Clause" ]
2
2015-05-11T14:15:52.000Z
2015-09-16T13:24:38.000Z
package Smolder::Debug; use Carp qw(longmess); use Data::Dumper; use strict; use warnings; use base qw(Exporter); our @EXPORT = qw( dd dp dps dpo dpso ); sub dump_one_line { my ($value) = @_; return Data::Dumper->new([$value])->Indent(0)->Sortkeys(1)->Quotekeys(0)->Terse(1)->Dump(); } sub _dump_value_with_caller { my ($value) = @_; my $dump = Data::Dumper->new([$value])->Indent(1)->Sortkeys(1)->Quotekeys(0)->Terse(1)->Dump(); my @caller = caller(1); return sprintf("[dp at %s line %d.] %s\n", $caller[1], $caller[2], $dump); } sub dd { die _dump_value_with_caller(@_); } sub dp { print STDERR _dump_value_with_caller(@_); } sub dps { print STDERR longmess(_dump_value_with_caller(@_)); } sub dpo { print _dump_value_with_caller(@_); } sub dpso { print longmess(_dump_value_with_caller(@_)); } 1;
16.960784
99
0.633526
ed6e9dd761aef753692c4787736e43110eba9f18
3,958
pm
Perl
cloud/aws/ec2/mode/discovery.pm
xdrive05/centreon-plugins
8227ba680fdfd2bb0d8a806ea61ec1611c2779dc
[ "Apache-2.0" ]
1
2021-03-16T22:20:32.000Z
2021-03-16T22:20:32.000Z
cloud/aws/ec2/mode/discovery.pm
xdrive05/centreon-plugins
8227ba680fdfd2bb0d8a806ea61ec1611c2779dc
[ "Apache-2.0" ]
null
null
null
cloud/aws/ec2/mode/discovery.pm
xdrive05/centreon-plugins
8227ba680fdfd2bb0d8a806ea61ec1611c2779dc
[ "Apache-2.0" ]
null
null
null
# # Copyright 2020 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package cloud::aws::ec2::mode::discovery; use base qw(centreon::plugins::mode); use strict; use warnings; use JSON::XS; sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; $options{options}->add_options(arguments => { "prettify" => { name => 'prettify' }, }); return $self; } sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); } sub run { my ($self, %options) = @_; my @disco_data; my $disco_stats; $disco_stats->{start_time} = time(); my %asgs; my $instances = $options{custom}->discovery( region => $self->{option_results}->{region}, service => 'ec2', command => 'describe-instances' ); foreach my $reservation (@{$instances->{Reservations}}) { foreach my $instance (@{$reservation->{Instances}}) { next if (!defined($instance->{InstanceId})); my %asg; $asg{type} = "asg"; my %ec2; $ec2{type} = "ec2"; $ec2{id} = $instance->{InstanceId}; $ec2{state} = $instance->{State}->{Name}; $ec2{key_name} = $instance->{KeyName}; $ec2{private_ip} = $instance->{PrivateIpAddress}; $ec2{private_dns_name} = $instance->{PrivateDnsName}; $ec2{public_dns_name} = $instance->{PublicDnsName}; $ec2{instance_type} = $instance->{InstanceType}; $ec2{vpc_id} = $instance->{VpcId}; foreach my $tag (@{$instance->{Tags}}) { if ($tag->{Key} eq "aws:autoscaling:groupName" && defined($tag->{Value})) { $ec2{asg} = $tag->{Value}; next if (defined($asgs{$tag->{Value}})); $asg{name} = $tag->{Value}; $asgs{$tag->{Value}} = 1; } if ($tag->{Key} eq "Name" && defined($tag->{Value})) { $ec2{name} = $tag->{Value}; } push @{$ec2{tags}}, { key => $tag->{Key}, value => $tag->{Value} }; } push @disco_data, \%ec2; push @disco_data, \%asg if (defined($asg{name}) && $asg{name} ne ''); } } $disco_stats->{end_time} = time(); $disco_stats->{duration} = $disco_stats->{end_time} - $disco_stats->{start_time}; $disco_stats->{discovered_items} = @disco_data; $disco_stats->{results} = \@disco_data; my $encoded_data; eval { if (defined($self->{option_results}->{prettify})) { $encoded_data = JSON::XS->new->utf8->pretty->encode($disco_stats); } else { $encoded_data = JSON::XS->new->utf8->encode($disco_stats); } }; if ($@) { $encoded_data = '{"code":"encode_error","message":"Cannot encode discovered data into JSON format"}'; } $self->{output}->output_add(short_msg => $encoded_data); $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1); $self->{output}->exit(); } 1; __END__ =head1 MODE EC2/ASG discovery. =over 8 =item B<--prettify> Prettify JSON output. =back =cut
29.759398
109
0.567458
ed81c62440289213eb3cb657a638143ce3a3e67f
177
pl
Perl
soldunga/#safetynet.pl
GiverofMemory/FVProject-Quests
8754c17305f1b9f56fff5e2952127f628be10646
[ "MIT" ]
1
2021-11-25T23:33:55.000Z
2021-11-25T23:33:55.000Z
soldunga/#safetynet.pl
GiverofMemory/FVProject-Quests
8754c17305f1b9f56fff5e2952127f628be10646
[ "MIT" ]
6
2020-02-12T16:39:52.000Z
2021-08-16T22:12:59.000Z
soldunga/#safetynet.pl
GiverofMemory/FVProject-Quests
8754c17305f1b9f56fff5e2952127f628be10646
[ "MIT" ]
7
2019-12-28T20:06:14.000Z
2021-11-23T17:21:38.000Z
sub EVENT_SPAWN { $x = $npc->GetX(); $y = $npc->GetY(); quest::set_proximity($x - 5, $x + 5, $y - 5, $y + 5); } sub EVENT_ENTER { quest::movepc(31,-485,-476,73); }
16.090909
56
0.514124
ed1c2353ad5c896fbd1f7160872ea618da9b13f2
3,506
pm
Perl
perl/vendor/lib/Crypt/PRNG/ChaCha20.pm
luiscarlosg27/xampp
c295dbdd435c9c62fbd4cc6fc42097bea7a900a0
[ "Apache-2.0" ]
2
2021-07-24T12:46:49.000Z
2021-08-02T08:37:53.000Z
perl/vendor/lib/Crypt/PRNG/ChaCha20.pm
luiscarlosg27/xampp
c295dbdd435c9c62fbd4cc6fc42097bea7a900a0
[ "Apache-2.0" ]
3
2021-01-27T10:09:28.000Z
2021-05-11T21:20:12.000Z
perl/vendor/lib/Crypt/PRNG/ChaCha20.pm
luiscarlosg27/xampp
c295dbdd435c9c62fbd4cc6fc42097bea7a900a0
[ "Apache-2.0" ]
null
null
null
package Crypt::PRNG::ChaCha20; use strict; use warnings; our $VERSION = '0.068'; use base qw(Crypt::PRNG Exporter); our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw(); use CryptX; { ### stolen from Bytes::Random::Secure my $RNG_object = undef; my $fetch_RNG = sub { # Lazily, instantiate the RNG object, but only once. $RNG_object = Crypt::PRNG::ChaCha20->new unless defined $RNG_object && ref($RNG_object) ne 'SCALAR'; return $RNG_object; }; sub rand { return $fetch_RNG->()->double(@_) } sub irand { return $fetch_RNG->()->int32(@_) } sub random_bytes { return $fetch_RNG->()->bytes(@_) } sub random_bytes_hex { return $fetch_RNG->()->bytes_hex(@_) } sub random_bytes_b64 { return $fetch_RNG->()->bytes_b64(@_) } sub random_bytes_b64u { return $fetch_RNG->()->bytes_b64u(@_) } sub random_string_from { return $fetch_RNG->()->string_from(@_) } sub random_string { return $fetch_RNG->()->string(@_) } } 1; =pod =head1 NAME Crypt::PRNG::ChaCha20 - Cryptographically secure PRNG based on ChaCha20 (stream cipher) algorithm =head1 SYNOPSIS ### Functional interface: use Crypt::PRNG::ChaCha20 qw(random_bytes random_bytes_hex random_bytes_b64 random_string random_string_from rand irand); $octets = random_bytes(45); $hex_string = random_bytes_hex(45); $base64_string = random_bytes_b64(45); $base64url_string = random_bytes_b64u(45); $alphanumeric_string = random_string(30); $string = random_string_from('ACGT', 64); $floating_point_number_0_to_1 = rand; $floating_point_number_0_to_88 = rand(88); $unsigned_32bit_int = irand; ### OO interface: use Crypt::PRNG::ChaCha20; $prng = Crypt::PRNG::ChaCha20->new; #or $prng = Crypt::PRNG::ChaCha20->new("some data used for seeding PRNG"); $octets = $prng->bytes(45); $hex_string = $prng->bytes_hex(45); $base64_string = $prng->bytes_b64(45); $base64url_string = $prng->bytes_b64u(45); $alphanumeric_string = $prng->string(30); $string = $prng->string_from('ACGT', 64); $floating_point_number_0_to_1 = rand; $floating_point_number_0_to_88 = rand(88); $unsigned_32bit_int = irand; =head1 DESCRIPTION Provides an interface to the ChaCha20 based pseudo random number generator All methods and functions are the same as for L<Crypt::PRNG>. =head1 FUNCTIONS =head2 random_bytes See L<Crypt::PRNG/random_bytes>. =head2 random_bytes_hex See L<Crypt::PRNG/random_bytes_hex>. =head2 random_bytes_b64 See L<Crypt::PRNG/random_bytes_b64>. =head2 random_bytes_b64u See L<Crypt::PRNG/random_bytes_b64u>. =head2 random_string See L<Crypt::PRNG/random_string>. =head2 random_string_from See L<Crypt::PRNG/random_string_from>. =head2 rand See L<Crypt::PRNG/rand>. =head2 irand See L<Crypt::PRNG/irand>. =head1 METHODS =head2 new See L<Crypt::PRNG/new>. =head2 bytes See L<Crypt::PRNG/bytes>. =head2 bytes_hex See L<Crypt::PRNG/bytes_hex>. =head2 bytes_b64 See L<Crypt::PRNG/bytes_b64>. =head2 bytes_b64u See L<Crypt::PRNG/bytes_b64u>. =head2 string See L<Crypt::PRNG/string>. =head2 string_from See L<Crypt::PRNG/string_from>. =head2 double See L<Crypt::PRNG/double>. =head2 int32 See L<Crypt::PRNG/int32>. =head1 SEE ALSO =over =item * L<Crypt::PRNG> =item * L<https://tools.ietf.org/html/rfc7539> =back =cut
21.776398
145
0.703651
ed0d102a1a59e3d76523910ee33db72c47030f34
11,667
pl
Perl
gnu/usr.bin/binutils-2.17/etc/texi2pod.pl
ArrogantWombatics/openbsd-src
75721e1d44322953075b7c4b89337b163a395291
[ "BSD-3-Clause" ]
1
2019-02-16T13:29:23.000Z
2019-02-16T13:29:23.000Z
gnu/usr.bin/binutils-2.17/etc/texi2pod.pl
ArrogantWombatics/openbsd-src
75721e1d44322953075b7c4b89337b163a395291
[ "BSD-3-Clause" ]
1
2018-08-21T03:56:33.000Z
2018-08-21T03:56:33.000Z
gnu/usr.bin/binutils-2.17/etc/texi2pod.pl
ArrogantWombaticus/openbsd-src
75721e1d44322953075b7c4b89337b163a395291
[ "BSD-3-Clause" ]
null
null
null
#! /usr/bin/perl -w # Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. # This file is part of GCC. # GCC 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. # GCC 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 GCC; see the file COPYING. If not, write to # the Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston MA 02110-1301, USA. # This does trivial (and I mean _trivial_) conversion of Texinfo # markup to Perl POD format. It's intended to be used to extract # something suitable for a manpage from a Texinfo document. $output = 0; $skipping = 0; %sects = (); $section = ""; @icstack = (); @endwstack = (); @skstack = (); @instack = (); $shift = ""; %defs = (); $fnno = 1; $inf = ""; $ibase = ""; @ipath = (); while ($_ = shift) { if (/^-D(.*)$/) { if ($1 ne "") { $flag = $1; } else { $flag = shift; } $value = ""; ($flag, $value) = ($flag =~ /^([^=]+)(?:=(.+))?/); die "no flag specified for -D\n" unless $flag ne ""; die "flags may only contain letters, digits, hyphens, dashes and underscores\n" unless $flag =~ /^[a-zA-Z0-9_-]+$/; $defs{$flag} = $value; } elsif (/^-I(.*)$/) { if ($1 ne "") { $flag = $1; } else { $flag = shift; } push (@ipath, $flag); } elsif (/^-/) { usage(); } else { $in = $_, next unless defined $in; $out = $_, next unless defined $out; usage(); } } if (defined $in) { $inf = gensym(); open($inf, "<$in") or die "opening \"$in\": $!\n"; $ibase = $1 if $in =~ m|^(.+)/[^/]+$|; } else { $inf = \*STDIN; } if (defined $out) { open(STDOUT, ">$out") or die "opening \"$out\": $!\n"; } while(defined $inf) { while(<$inf>) { # Certain commands are discarded without further processing. /^\@(?: [a-z]+index # @*index: useful only in complete manual |need # @need: useful only in printed manual |(?:end\s+)?group # @group .. @end group: ditto |page # @page: ditto |node # @node: useful only in .info file |(?:end\s+)?ifnottex # @ifnottex .. @end ifnottex: use contents )\b/x and next; chomp; # Look for filename and title markers. /^\@setfilename\s+([^.]+)/ and $fn = $1, next; /^\@settitle\s+([^.]+)/ and $tl = postprocess($1), next; # Identify a man title but keep only the one we are interested in. /^\@c\s+man\s+title\s+([A-Za-z0-9-]+)\s+(.+)/ and do { if (exists $defs{$1}) { $fn = $1; $tl = postprocess($2); } next; }; # Look for blocks surrounded by @c man begin SECTION ... @c man end. # This really oughta be @ifman ... @end ifman and the like, but such # would require rev'ing all other Texinfo translators. /^\@c\s+man\s+begin\s+([A-Z]+)\s+([A-Za-z0-9-]+)/ and do { $output = 1 if exists $defs{$2}; $sect = $1; next; }; /^\@c\s+man\s+begin\s+([A-Z]+)/ and $sect = $1, $output = 1, next; /^\@c\s+man\s+end/ and do { $sects{$sect} = "" unless exists $sects{$sect}; $sects{$sect} .= postprocess($section); $section = ""; $output = 0; next; }; # handle variables /^\@set\s+([a-zA-Z0-9_-]+)\s*(.*)$/ and do { $defs{$1} = $2; next; }; /^\@clear\s+([a-zA-Z0-9_-]+)/ and do { delete $defs{$1}; next; }; next unless $output; # Discard comments. (Can't do it above, because then we'd never see # @c man lines.) /^\@c\b/ and next; # End-block handler goes up here because it needs to operate even # if we are skipping. /^\@end\s+([a-z]+)/ and do { # Ignore @end foo, where foo is not an operation which may # cause us to skip, if we are presently skipping. my $ended = $1; next if $skipping && $ended !~ /^(?:ifset|ifclear|ignore|menu|iftex|copying)$/; die "\@end $ended without \@$ended at line $.\n" unless defined $endw; die "\@$endw ended by \@end $ended at line $.\n" unless $ended eq $endw; $endw = pop @endwstack; if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) { $skipping = pop @skstack; next; } elsif ($ended =~ /^(?:example|smallexample|display)$/) { $shift = ""; $_ = ""; # need a paragraph break } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) { $_ = "\n=back\n"; $ic = pop @icstack; } else { die "unknown command \@end $ended at line $.\n"; } }; # We must handle commands which can cause skipping even while we # are skipping, otherwise we will not process nested conditionals # correctly. /^\@ifset\s+([a-zA-Z0-9_-]+)/ and do { push @endwstack, $endw; push @skstack, $skipping; $endw = "ifset"; $skipping = 1 unless exists $defs{$1}; next; }; /^\@ifclear\s+([a-zA-Z0-9_-]+)/ and do { push @endwstack, $endw; push @skstack, $skipping; $endw = "ifclear"; $skipping = 1 if exists $defs{$1}; next; }; /^\@(ignore|menu|iftex|copying)\b/ and do { push @endwstack, $endw; push @skstack, $skipping; $endw = $1; $skipping = 1; next; }; next if $skipping; # Character entities. First the ones that can be replaced by raw text # or discarded outright: s/\@copyright\{\}/(c)/g; s/\@dots\{\}/.../g; s/\@enddots\{\}/..../g; s/\@([.!? ])/$1/g; s/\@[:-]//g; s/\@bullet(?:\{\})?/*/g; s/\@TeX\{\}/TeX/g; s/\@pounds\{\}/\#/g; s/\@minus(?:\{\})?/-/g; s/\\,/,/g; # Now the ones that have to be replaced by special escapes # (which will be turned back into text by unmunge()) s/&/&amp;/g; s/\@\{/&lbrace;/g; s/\@\}/&rbrace;/g; s/\@\@/&at;/g; # Inside a verbatim block, handle @var specially. if ($shift ne "") { s/\@var\{([^\}]*)\}/<$1>/g; } # POD doesn't interpret E<> inside a verbatim block. if ($shift eq "") { s/</&lt;/g; s/>/&gt;/g; } else { s/</&LT;/g; s/>/&GT;/g; } # Single line command handlers. /^\@include\s+(.+)$/ and do { push @instack, $inf; $inf = gensym(); $file = postprocess($1); # Try cwd and $ibase, then explicit -I paths. $done = 0; foreach $path ("", $ibase, @ipath) { $mypath = $file; $mypath = $path . "/" . $mypath if ($path ne ""); open($inf, "<" . $mypath) and ($done = 1, last); } die "cannot find $file" if !$done; next; }; /^\@(?:section|unnumbered|unnumberedsec|center)\s+(.+)$/ and $_ = "\n=head2 $1\n"; /^\@subsection\s+(.+)$/ and $_ = "\n=head3 $1\n"; # Block command handlers: /^\@itemize(?:\s+(\@[a-z]+|\*|-))?/ and do { push @endwstack, $endw; push @icstack, $ic; if (defined $1) { $ic = $1; } else { $ic = '@bullet'; } $_ = "\n=over 4\n"; $endw = "itemize"; }; /^\@enumerate(?:\s+([a-zA-Z0-9]+))?/ and do { push @endwstack, $endw; push @icstack, $ic; if (defined $1) { $ic = $1 . "."; } else { $ic = "1."; } $_ = "\n=over 4\n"; $endw = "enumerate"; }; /^\@([fv]?table)\s+(\@[a-z]+)/ and do { push @endwstack, $endw; push @icstack, $ic; $endw = $1; $ic = $2; $ic =~ s/\@(?:samp|strong|key|gcctabopt|env)/B/; $ic =~ s/\@(?:code|kbd)/C/; $ic =~ s/\@(?:dfn|var|emph|cite|i)/I/; $ic =~ s/\@(?:file)/F/; $_ = "\n=over 4\n"; }; /^\@((?:small)?example|display)/ and do { push @endwstack, $endw; $endw = $1; $shift = "\t"; $_ = ""; # need a paragraph break }; /^\@itemx?\s*(.+)?$/ and do { if (defined $1) { # Entity escapes prevent munging by the <> processing below. $_ = "\n=item $ic\&LT;$1\&GT;\n"; } else { $_ = "\n=item $ic\n"; $ic =~ y/A-Ya-y/B-Zb-z/; $ic =~ s/(\d+)/$1 + 1/eg; } }; $section .= $shift.$_."\n"; } # End of current file. close($inf); $inf = pop @instack; } die "No filename or title\n" unless defined $fn && defined $tl; $sects{NAME} = "$fn \- $tl\n"; $sects{FOOTNOTES} .= "=back\n" if exists $sects{FOOTNOTES}; for $sect (qw(NAME SYNOPSIS DESCRIPTION OPTIONS ENVIRONMENT FILES BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) { if(exists $sects{$sect}) { $head = $sect; $head =~ s/SEEALSO/SEE ALSO/; print "=head1 $head\n\n"; print scalar unmunge ($sects{$sect}); print "\n"; } } sub usage { die "usage: $0 [-D toggle...] [infile [outfile]]\n"; } sub postprocess { local $_ = $_[0]; # @value{foo} is replaced by whatever 'foo' is defined as. while (m/(\@value\{([a-zA-Z0-9_-]+)\})/g) { if (! exists $defs{$2}) { print STDERR "Option $2 not defined\n"; s/\Q$1\E//; } else { $value = $defs{$2}; s/\Q$1\E/$value/; } } # Formatting commands. # Temporary escape for @r. s/\@r\{([^\}]*)\}/R<$1>/g; s/\@(?:dfn|var|emph|cite|i)\{([^\}]*)\}/I<$1>/g; s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g; s/\@(?:gccoptlist|samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g; s/\@sc\{([^\}]*)\}/\U$1/g; s/\@file\{([^\}]*)\}/F<$1>/g; s/\@w\{([^\}]*)\}/S<$1>/g; s/\@(?:dmn|math)\{([^\}]*)\}/$1/g; # keep references of the form @ref{...}, print them bold s/\@(?:ref)\{([^\}]*)\}/B<$1>/g; # Change double single quotes to double quotes. s/''/"/g; s/``/"/g; # Cross references are thrown away, as are @noindent and @refill. # (@noindent is impossible in .pod, and @refill is unnecessary.) # @* is also impossible in .pod; we discard it and any newline that # follows it. Similarly, our macro @gol must be discarded. s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g; s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g; s/;\s+\@pxref\{(?:[^\}]*)\}//g; s/\@noindent\s*//g; s/\@refill//g; s/\@gol//g; s/\@\*\s*\n?//g; # @uref can take one, two, or three arguments, with different # semantics each time. @url and @email are just like @uref with # one argument, for our purposes. s/\@(?:uref|url|email)\{([^\},]*)\}/&lt;B<$1>&gt;/g; s/\@uref\{([^\},]*),([^\},]*)\}/$2 (C<$1>)/g; s/\@uref\{([^\},]*),([^\},]*),([^\},]*)\}/$3/g; # Un-escape <> at this point. s/&LT;/</g; s/&GT;/>/g; # Now un-nest all B<>, I<>, R<>. Theoretically we could have # indefinitely deep nesting; in practice, one level suffices. 1 while s/([BIR])<([^<>]*)([BIR])<([^<>]*)>/$1<$2>$3<$4>$1</g; # Replace R<...> with bare ...; eliminate empty markup, B<>; # shift white space at the ends of [BI]<...> expressions outside # the expression. s/R<([^<>]*)>/$1/g; s/[BI]<>//g; s/([BI])<(\s+)([^>]+)>/$2$1<$3>/g; s/([BI])<([^>]+?)(\s+)>/$1<$2>$3/g; # Extract footnotes. This has to be done after all other # processing because otherwise the regexp will choke on formatting # inside @footnote. while (/\@footnote/g) { s/\@footnote\{([^\}]+)\}/[$fnno]/; add_footnote($1, $fnno); $fnno++; } return $_; } sub unmunge { # Replace escaped symbols with their equivalents. local $_ = $_[0]; s/&lt;/E<lt>/g; s/&gt;/E<gt>/g; s/&lbrace;/\{/g; s/&rbrace;/\}/g; s/&at;/\@/g; s/&amp;/&/g; return $_; } sub add_footnote { unless (exists $sects{FOOTNOTES}) { $sects{FOOTNOTES} = "\n=over 4\n\n"; } $sects{FOOTNOTES} .= "=item $fnno.\n\n"; $fnno++; $sects{FOOTNOTES} .= $_[0]; $sects{FOOTNOTES} .= "\n\n"; } # stolen from Symbol.pm { my $genseq = 0; sub gensym { my $name = "GEN" . $genseq++; my $ref = \*{$name}; delete $::{$name}; return $ref; } }
25.585526
80
0.528242
ed04a88e49dc067e47605f4ce867c2f9d1f9c7ac
492
t
Perl
t/03_table.t
tokubass/p5-HTMLishElement-Maker
6e9fbdb4c8736c0b1c555b388f82dde96a607299
[ "Artistic-1.0" ]
null
null
null
t/03_table.t
tokubass/p5-HTMLishElement-Maker
6e9fbdb4c8736c0b1c555b388f82dde96a607299
[ "Artistic-1.0" ]
null
null
null
t/03_table.t
tokubass/p5-HTMLishElement-Maker
6e9fbdb4c8736c0b1c555b388f82dde96a607299
[ "Artistic-1.0" ]
null
null
null
use Test::More; use strict; use warnings; use HTMLishElement::Maker qw/htmlish/; use Data::Dumper; subtest 'table' => sub { my $table = htmlish('<table>'); my $tbody = htmlish('<tbody>'); my $tr = htmlish('<tr>'); $table->push($tbody); $tbody->push($tr); for my $text ( qw/aa bb cc/ ) { $tr->push( htmlish('<td>')->push($text) ); } is($table->print, '<table><tbody><tr><td>aa</td><td>bb</td><td>cc</td></tr></tbody></table>'); }; done_testing;
21.391304
98
0.552846
ed2fa6624eb03b22b9b54b78b7b3ea8a1ad0aa12
2,094
pl
Perl
admin/RunReports.pl
y-young/musicbrainz-server
06c4f16176b3615349b052f165c898b411455dae
[ "BSD-2-Clause" ]
577
2015-01-15T12:18:50.000Z
2022-03-16T20:41:57.000Z
admin/RunReports.pl
navap/musicbrainz-server
75162fb76e8a55d6c578a527fbcbfab5d7e4c5c8
[ "BSD-2-Clause" ]
1,227
2015-04-16T01:00:29.000Z
2022-03-30T15:08:46.000Z
admin/RunReports.pl
navap/musicbrainz-server
75162fb76e8a55d6c578a527fbcbfab5d7e4c5c8
[ "BSD-2-Clause" ]
280
2015-01-04T08:39:41.000Z
2022-03-10T17:09:59.000Z
#!/usr/bin/env perl use strict; use warnings; use FindBin; use lib "$FindBin::Bin/../lib"; use MusicBrainz::Server::Context; use MusicBrainz::Server::ReportFactory; use POSIX qw( SIGALRM ); $| = 1; @ARGV = "^" if not @ARGV; my $c = MusicBrainz::Server::Context->create_script_context(); my $errors = 0; for my $name (MusicBrainz::Server::ReportFactory->all_report_names) { unless (grep { $name =~ /$_/i } @ARGV) { print localtime() . " : Not running $name\n"; next; } my $report = MusicBrainz::Server::ReportFactory->create_report($name, $c); print localtime() . " : Running $name\n"; my $t0 = time; my $ONE_HOUR = 1 * 60 * 60; my $exit_code = eval { my $child = fork(); if ($child == 0) { alarm($ONE_HOUR); my $action = POSIX::SigAction->new(sub { exit(42); }); $action->safe(1); POSIX::sigaction(SIGALRM, $action); Sql::run_in_transaction(sub { $report->run; $c->sql->do('DELETE FROM report.index WHERE report_name = ?', $report->table); $c->sql->insert_row('report.index', { report_name => $report->table }) }, $c->sql); alarm(0); exit(0); } waitpid($child, 0); if (($? >> 8) == 42) { die "Report took over 1 hour to run"; } }; if ($@) { warn "$name died with $@\n"; ++$errors; next; } my $t = time() - $t0; print localtime() . " : $name finished; time=$t\n"; } print localtime() . " : Completed with 1 error\n" if $errors == 1; print localtime() . " : Completed with $errors errors\n" if $errors != 1; exit($errors ? 1 : 0); =head1 COPYRIGHT AND LICENSE Copyright (C) 2012 MetaBrainz Foundation Copyright (C) 2009 Lukas Lalinsky Copyright (C) 1998 Robert Kaye This file is part of MusicBrainz, the open internet music database, and is licensed under the GPL version 2, or (at your option) any later version: http://www.gnu.org/licenses/gpl-2.0.txt =cut
26.175
94
0.557307
ed45ef83190cc03a6d205e71b6d286669cdb2169
1,700
pl
Perl
demos/demos/widget_lib/notebook.pl
cboleary/perl-tk
88dd549c36e1e615837c3dc185f553b5a9533792
[ "TCL" ]
28
2015-01-02T00:31:12.000Z
2021-12-21T09:03:05.000Z
demos/demos/widget_lib/notebook.pl
cboleary/perl-tk
88dd549c36e1e615837c3dc185f553b5a9533792
[ "TCL" ]
44
2015-01-07T22:25:25.000Z
2022-03-28T13:34:44.000Z
demos/demos/widget_lib/notebook.pl
cboleary/perl-tk
88dd549c36e1e615837c3dc185f553b5a9533792
[ "TCL" ]
18
2015-01-02T00:32:47.000Z
2022-03-24T12:57:40.000Z
# Notebook, selectable pages. use Tk; use Tk::DialogBox; use Tk::NoteBook; use Tk::LabEntry; my $name = "Rajappa Iyer"; my $email = "rsi\@netcom.com"; my $os = "Linux"; use vars qw($top); $top = MainWindow->new; my $pb = $top->Button(-text => "Notebook", -command => \&donotebook); $pb->pack; MainLoop; my $f; sub donotebook { if (not defined $f) { # The current example uses a DialogBox, but you could just # as easily not use one... replace the following by # $n = $top->NoteBook(-ipadx => 6, -ipady => 6); # Of course, then you'd have to take care of the OK and Cancel # buttons yourself. :-) $f = $top->DialogBox(-title => "Personal Profile", -buttons => ["OK", "Cancel"]); my $n = $f->add('NoteBook', -ipadx => 6, -ipady => 6); my $address_p = $n->add("address", -label => "Address", -underline => 0); my $pref_p = $n->add("pref", -label => "Preferences", -underline => 0); $address_p->LabEntry(-label => "Name: ", -labelPack => [-side => "left", -anchor => "w"], -width => 20, -textvariable => \$name)->pack(-side => "top", -anchor => "nw"); $address_p->LabEntry(-label => "Email Address:", -labelPack => [-side => "left", -anchor => "w"], -width => 50, -textvariable => \$email)->pack(-side => "top", -anchor => "nw"); $pref_p->LabEntry(-label => "Operating System:", -labelPack => [-side => "left"], -width => 15, -textvariable => \$os)->pack(-side => "top", -anchor => "nw"); $n->pack(-expand => "yes", -fill => "both", -padx => 5, -pady => 5, -side => "top"); } my $result = $f->Show; if ($result =~ /OK/) { print "name = $name, email = $email, os = $os\n"; } }
28.333333
74
0.547059
73fb43ae7a2e20504d95492504a41153854183c8
5,691
pm
Perl
modules/EnsEMBL/Web/Component/Experiment/Features.pm
kiwiroy/ensembl-webcode
697a66eb5414d717be0a1a2b25ec1ad3e1fc61bb
[ "Apache-2.0", "MIT" ]
null
null
null
modules/EnsEMBL/Web/Component/Experiment/Features.pm
kiwiroy/ensembl-webcode
697a66eb5414d717be0a1a2b25ec1ad3e1fc61bb
[ "Apache-2.0", "MIT" ]
null
null
null
modules/EnsEMBL/Web/Component/Experiment/Features.pm
kiwiroy/ensembl-webcode
697a66eb5414d717be0a1a2b25ec1ad3e1fc61bb
[ "Apache-2.0", "MIT" ]
null
null
null
=head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute 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. =cut package EnsEMBL::Web::Component::Experiment::Features; use strict; use HTML::Entities qw(encode_entities); use base qw(EnsEMBL::Web::Component::Experiment); sub content { my $self = shift; my $object = $self->object; my $hub = $self->hub; my $table = $self->new_table( [ { 'key' => 'source', 'title' => 'Source' }, { 'key' => 'project', 'title' => 'Project' }, { 'key' => 'evidence_type', 'title' => 'Evidence Type' }, { 'key' => 'cell_type', 'title' => 'Cell type' }, { 'key' => 'feature_type', 'title' => 'Evidence' }, { 'key' => 'gene', 'title' => 'Transcription Factor Gene' }, { 'key' => 'motif', 'title' => 'PWMs' } ], [], {'data_table' => 1} ); my $feature_sets_info = $object->get_feature_sets_info; for my $feature_set_info (@$feature_sets_info) { (my $evidence_type = encode_entities($feature_set_info->{'evidence_label'})) =~ s/\s/&nbsp;/g; my @links; foreach my $source (@{$feature_set_info->{'source_info'}}){ push @links, $self->source_link($source->[0], $source->[1]); } my $source_link = join ' ', @links; $table->add_row({ 'source' => $source_link, 'project' => $self->project_link($feature_set_info->{'project_name'}, $feature_set_info->{'project_url'} || ''), 'evidence_type' => $evidence_type, 'cell_type' => $self->cell_type_link($feature_set_info->{'cell_type_name'}, $feature_set_info->{'efo_id'}), 'feature_type' => $self->evidence_link($feature_set_info->{'feature_type_name'}), 'gene' => $self->gene_links($feature_set_info->{'xref_genes'}), 'motif' => $self->motif_links($feature_set_info->{'binding_motifs'}), }); } my $total_experiments = $object->total_experiments; my $shown_experiments = @$feature_sets_info; my $html = sprintf('<a name="%s"></a>', $object->URL_ANCHOR); if ($object->is_single_feature_view) { $html = "<p>Showing a single experiment out of $total_experiments experiments</p>"; } elsif ($total_experiments == $shown_experiments) { $html .= "<p>Showing all $total_experiments experiments</p>"; } else { my $applied_filters = $object->applied_filters; my $display_filters = {}; for my $filter_key (sort keys %$applied_filters) { my $filter_title = $object->get_filter_title($filter_key); $display_filters->{$filter_title} = [ map sprintf('%s (<a href="%s">remove</a>)', $_, $object->get_url({$filter_title, $_}, -1), ), @{$applied_filters->{$filter_key}} ]; } $html .= sprintf('<p>Showing %s/%s experiments</p><div class="tinted-box"><p class="half-margin">Filters applied: %s</p></div>', $shown_experiments, $total_experiments, join('; ', map sprintf('%s', join '; ', (@{$display_filters->{$_}})), sort keys %$display_filters) ); } return $html.$table->render; } sub source_link { my ($self, $source_label, $source_link) = @_; $source_link ||= "http://www.ebi.ac.uk/ena/data/view/$source_label" if $source_label =~ /^SRX/; return $source_link ? sprintf('<a href="%s" title="View source">%s</a>', encode_entities($source_link), encode_entities($source_label) ) : encode_entities($source_label) ; } sub project_link { my ($self, $project_name, $project_link) = @_; ($project_name = encode_entities($project_name)) =~ s/\s/&nbsp;/g; return $project_link ? sprintf('<a href="%s" title="View Project\'s webpage">%s</a>', encode_entities($project_link), $project_name ) : $project_name ; } sub cell_type_link { my ($self, $ctype_name, $efo_id) = @_; return $efo_id ? sprintf('<a href="http://bioportal.bioontology.org/ontologies/46432?p=terms&amp;conceptid=%s" title="View Experimental Factor Ontology for %s on BioPortal">%2$s</a>', encode_entities($efo_id), encode_entities($ctype_name) ) : encode_entities($ctype_name) ; } sub evidence_link { my ($self, $feature_type_name) = @_; my $object = $self->object; return $object->is_feature_type_filter_on ? encode_entities($feature_type_name) : sprintf('<a href="%s" title="%s experiments with feature type name %s">%3$s</a>', $object->get_url({'feature_type' => $feature_type_name}, 1), $object->is_filter_applied ? 'Filter' : 'View all', encode_entities($feature_type_name), ) ; } sub motif_links { my ($self, $motifs) = @_; return join ' ', map qq(<a href="http://jaspar.genereg.net/cgi-bin/jaspar_db.pl?ID=$_&amp;rm=present&amp;collection=CORE" title="View motif">$_</a>), @$motifs; } sub gene_links { my ($self, $genes) = @_; my $hub = $self->hub; return $self->join_with_and(map sprintf('<a href="%s" title="View gene">%s</a>', $hub->url({'type' => 'Gene', 'action' => 'Summary', 'g' => $_}), $_), @$genes); } 1;
35.792453
172
0.61606
ed47213504e1dc0e9cbb4ab63345eb680adf6203
5,594
pm
Perl
network/allied/snmp/mode/components/temperature.pm
xdrive05/centreon-plugins
8227ba680fdfd2bb0d8a806ea61ec1611c2779dc
[ "Apache-2.0" ]
1
2021-03-16T22:20:32.000Z
2021-03-16T22:20:32.000Z
network/allied/snmp/mode/components/temperature.pm
xdrive05/centreon-plugins
8227ba680fdfd2bb0d8a806ea61ec1611c2779dc
[ "Apache-2.0" ]
null
null
null
network/allied/snmp/mode/components/temperature.pm
xdrive05/centreon-plugins
8227ba680fdfd2bb0d8a806ea61ec1611c2779dc
[ "Apache-2.0" ]
null
null
null
# # Copyright 2020 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package network::allied::snmp::mode::components::temperature; use strict; use warnings; my $map_status = { 1 => 'outOfRange', 2 => 'inRange', }; my $mapping = { atEnvMonv2TemperatureDescription => { oid => '.1.3.6.1.4.1.207.8.4.4.3.12.3.1.4' }, atEnvMonv2TemperatureCurrent => { oid => '.1.3.6.1.4.1.207.8.4.4.3.12.3.1.5' }, atEnvMonv2TemperatureUpperThreshold => { oid => '.1.3.6.1.4.1.207.8.4.4.3.12.3.1.6' }, atEnvMonv2TemperatureStatus => { oid => '.1.3.6.1.4.1.207.8.4.4.3.12.3.1.7', map => $map_status }, }; my $oid_atEnvMonv2TemperatureEntry = '.1.3.6.1.4.1.207.8.4.4.3.12.3.1'; sub load { my ($self) = @_; push @{$self->{request}}, { oid => $oid_atEnvMonv2TemperatureEntry, start => $mapping->{atEnvMonv2TemperatureDescription}->{oid} }; } sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "checking temperatures"); $self->{components}->{temperature} = { name => 'temperatures', total => 0, skip => 0 }; return if ($self->check_filter(section => 'temperature')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_atEnvMonv2TemperatureEntry}})) { next if ($oid !~ /^$mapping->{atEnvMonv2TemperatureStatus}->{oid}\.(\d+)\.(\d+)\.(\d+)$/); my ($stack_id, $board_index, $temp_index) = ($1, $2, $3); my $instance = $stack_id . '.' . $board_index . '.' . $temp_index; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_atEnvMonv2TemperatureEntry}, instance => $instance); next if ($self->check_filter(section => 'temperature', instance => $instance)); $self->{components}->{temperature}->{total}++; $self->{output}->output_add( long_msg => sprintf( "temperature '%s' status is %s [instance: %s, speed: %s, stack: %s, board: %s]", $result->{atEnvMonv2TemperatureDescription}, $result->{atEnvMonv2TemperatureStatus}, $instance, $result->{atEnvMonv2TemperatureCurrent}, $stack_id, $board_index ) ); my $exit = $self->get_severity(label => 'default', section => 'temperature', value => $result->{atEnvMonv2TemperatureStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add( severity => $exit, short_msg => sprintf( "temperature '%s' status is %s", $result->{atEnvMonv2TemperatureDescription}, $result->{atEnvMonv2TemperatureStatus} ) ); } next if (!defined($result->{atEnvMonv2TemperatureCurrent})); my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{atEnvMonv2TemperatureCurrent}); if ($checked == 0) { my $warn_th = ''; my $crit_th = ':' . $result->{atEnvMonv2TemperatureUpperThreshold}; $self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $instance, value => $warn_th); $self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $instance, value => $crit_th); $exit = $self->{perfdata}->threshold_check( value => $result->{atEnvMonv2TemperatureCurrent}, threshold => [ { label => 'critical-temperature-instance-' . $instance, exit_litteral => 'critical' }, { label => 'warning-temperature-instance-' . $instance, exit_litteral => 'warning' } ] ); $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $instance); $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance) } if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { $self->{output}->output_add( severity => $exit2, short_msg => sprintf( "temperture '%s' is %s C", $result->{atEnvMonv2TemperatureDescription}, $result->{atEnvMonv2TemperatureCurrent} ) ); } $self->{output}->perfdata_add( nlabel => 'hardware.temperature.celsius', unit => 'C', instances => ['stack=' . $stack_id, 'board=' . $board_index, 'description=' . $result->{atEnvMonv2TemperatureDescription}], value => $result->{atEnvMonv2TemperatureCurrent}, warning => $warn, critical => $crit ); } } 1;
45.112903
173
0.582052
ed7ca1e7f9443b2fad7ccec98ef338a37e88529f
4,946
pm
Perl
auto-lib/Paws/DynamoDB/GlobalSecondaryIndexDescription.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/DynamoDB/GlobalSecondaryIndexDescription.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/DynamoDB/GlobalSecondaryIndexDescription.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
# Generated by default/object.tt package Paws::DynamoDB::GlobalSecondaryIndexDescription; use Moose; has Backfilling => (is => 'ro', isa => 'Bool'); has IndexArn => (is => 'ro', isa => 'Str'); has IndexName => (is => 'ro', isa => 'Str'); has IndexSizeBytes => (is => 'ro', isa => 'Int'); has IndexStatus => (is => 'ro', isa => 'Str'); has ItemCount => (is => 'ro', isa => 'Int'); has KeySchema => (is => 'ro', isa => 'ArrayRef[Paws::DynamoDB::KeySchemaElement]'); has Projection => (is => 'ro', isa => 'Paws::DynamoDB::Projection'); has ProvisionedThroughput => (is => 'ro', isa => 'Paws::DynamoDB::ProvisionedThroughputDescription'); 1; ### main pod documentation begin ### =head1 NAME Paws::DynamoDB::GlobalSecondaryIndexDescription =head1 USAGE This class represents one of two things: =head3 Arguments in a call to a service Use the attributes of this class as arguments to methods. You shouldn't make instances of this class. Each attribute should be used as a named argument in the calls that expect this type of object. As an example, if Att1 is expected to be a Paws::DynamoDB::GlobalSecondaryIndexDescription object: $service_obj->Method(Att1 => { Backfilling => $value, ..., ProvisionedThroughput => $value }); =head3 Results returned from an API call Use accessors for each attribute. If Att1 is expected to be an Paws::DynamoDB::GlobalSecondaryIndexDescription object: $result = $service_obj->Method(...); $result->Att1->Backfilling =head1 DESCRIPTION Represents the properties of a global secondary index. =head1 ATTRIBUTES =head2 Backfilling => Bool Indicates whether the index is currently backfilling. I<Backfilling> is the process of reading items from the table and determining whether they can be added to the index. (Not all items will qualify: For example, a partition key cannot have any duplicate values.) If an item can be added to the index, DynamoDB will do so. After all items have been processed, the backfilling operation is complete and C<Backfilling> is false. You can delete an index that is being created during the C<Backfilling> phase when C<IndexStatus> is set to CREATING and C<Backfilling> is true. You can't delete the index that is being created when C<IndexStatus> is set to CREATING and C<Backfilling> is false. For indexes that were created during a C<CreateTable> operation, the C<Backfilling> attribute does not appear in the C<DescribeTable> output. =head2 IndexArn => Str The Amazon Resource Name (ARN) that uniquely identifies the index. =head2 IndexName => Str The name of the global secondary index. =head2 IndexSizeBytes => Int The total size of the specified index, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value. =head2 IndexStatus => Str The current state of the global secondary index: =over =item * C<CREATING> - The index is being created. =item * C<UPDATING> - The index is being updated. =item * C<DELETING> - The index is being deleted. =item * C<ACTIVE> - The index is ready for use. =back =head2 ItemCount => Int The number of items in the specified index. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value. =head2 KeySchema => ArrayRef[L<Paws::DynamoDB::KeySchemaElement>] The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types: =over =item * C<HASH> - partition key =item * C<RANGE> - sort key =back The partition key of an item is also known as its I<hash attribute>. The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. The sort key of an item is also known as its I<range attribute>. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value. =head2 Projection => L<Paws::DynamoDB::Projection> Represents attributes that are copied (projected) from the table into the global secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. =head2 ProvisionedThroughput => L<Paws::DynamoDB::ProvisionedThroughputDescription> Represents the provisioned throughput settings for the specified global secondary index. For current minimum and maximum provisioned throughput values, see Limits (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) in the I<Amazon DynamoDB Developer Guide>. =head1 SEE ALSO This class forms part of L<Paws>, describing an object used in L<Paws::DynamoDB> =head1 BUGS and CONTRIBUTIONS The source code is located here: L<https://github.com/pplu/aws-sdk-perl> Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> =cut
27.786517
118
0.751719
ed58f0f1f0006fa227977ddbe2496d6025288d88
984
pl
Perl
examples/bin_expand.pl
autolife/HackaMol
559bc07d0341cbf2459d7fcd104ae5dee865710d
[ "Artistic-1.0" ]
null
null
null
examples/bin_expand.pl
autolife/HackaMol
559bc07d0341cbf2459d7fcd104ae5dee865710d
[ "Artistic-1.0" ]
null
null
null
examples/bin_expand.pl
autolife/HackaMol
559bc07d0341cbf2459d7fcd104ae5dee865710d
[ "Artistic-1.0" ]
null
null
null
#!/usr/bin/env perl # Demian Riccardi August, 22, 2013 # use Modern::Perl; use HackaMol; use Math::Vector::Real; my $t1 = time; my $angle = shift; $angle = 180 unless ( defined($angle) ); my $hack = HackaMol->new( name => "hackitup" ); my @atoms = $hack->read_file_atoms("t/lib/1L2Y.pdb"); my $max_t = $atoms[0]->count_coords - 1; my $mol = HackaMol::Molecule->new( name => 'trp-cage', atoms => [@atoms] ); my @groups = $hack->group_by_atom_attr( 'resid', $mol->all_atoms ); $mol->push_groups(@groups); $_->translate( -$_->COM, 1 ) foreach $mol->all_groups; $mol->print_xyz; $mol->t(1); $mol->print_xyz; my %Z; foreach my $atom ( $mol->all_atoms ) { my $z = $atom->Z; $Z{$z}++; $atom->push_coords( V( 3 * $z, $Z{$z} / 4, 0 ) ); } $mol->t($max_t+1); $mol->print_xyz; $_->push_coords( V( 3 * $_->Z, 0, 0 ) ) foreach $mol->all_atoms; $mol->t($max_t+2); $mol->print_xyz; $_->push_coords( V( 0, 0, 0 ) ) foreach $mol->all_atoms; $mol->t($max_t+3); $mol->print_xyz;
22.883721
75
0.601626
73f418921bd543804ca5e40a1ea262e6cf251b55
19
pl
Perl
HelloWorld/ProgrammingPerl/ch21/ch21.008.pl
grtlinux/KieaPerl
ed8e1e3359ad0186d5cc4f7ed037e956d2f26c9e
[ "Apache-2.0" ]
null
null
null
HelloWorld/ProgrammingPerl/ch21/ch21.008.pl
grtlinux/KieaPerl
ed8e1e3359ad0186d5cc4f7ed037e956d2f26c9e
[ "Apache-2.0" ]
null
null
null
HelloWorld/ProgrammingPerl/ch21/ch21.008.pl
grtlinux/KieaPerl
ed8e1e3359ad0186d5cc4f7ed037e956d2f26c9e
[ "Apache-2.0" ]
null
null
null
@foo[0] = <STDIN>;
9.5
18
0.473684
ed55aa06187448a9f044ffbeed8a713dbdbbbf84
2,624
pm
Perl
perl/vendor/lib/MooseX/ClassAttribute/Trait/Role.pm
ifleeyo180/VspriteMoodleWebsite
38baa924829c83808d2c87d44740ff365927a646
[ "Apache-2.0" ]
2
2021-07-24T12:46:49.000Z
2021-08-02T08:37:53.000Z
perl/vendor/lib/MooseX/ClassAttribute/Trait/Role.pm
ifleeyo180/VspriteMoodleWebsite
38baa924829c83808d2c87d44740ff365927a646
[ "Apache-2.0" ]
6
2021-11-18T00:39:48.000Z
2021-11-20T00:31:40.000Z
perl/vendor/lib/MooseX/ClassAttribute/Trait/Role.pm
ifleeyo180/VspriteMoodleWebsite
38baa924829c83808d2c87d44740ff365927a646
[ "Apache-2.0" ]
null
null
null
package MooseX::ClassAttribute::Trait::Role; use strict; use warnings; our $VERSION = '0.29'; use MooseX::ClassAttribute::Meta::Role::Attribute; use Scalar::Util qw( blessed ); use namespace::autoclean; use Moose::Role; with 'MooseX::ClassAttribute::Trait::Mixin::HasClassAttributes'; around add_class_attribute => sub { my $orig = shift; my $self = shift; my $attr = ( blessed $_[0] && $_[0]->isa('Class::MOP::Mixin::AttributeCore') ? $_[0] : MooseX::ClassAttribute::Meta::Role::Attribute->new(@_) ); $self->$orig($attr); return $attr; }; sub _attach_class_attribute { my ( $self, $attribute ) = @_; $attribute->attach_to_role($self); } sub composition_class_roles { return 'MooseX::ClassAttribute::Trait::Role::Composite'; } 1; # ABSTRACT: A trait for roles with class attributes __END__ =pod =encoding UTF-8 =head1 NAME MooseX::ClassAttribute::Trait::Role - A trait for roles with class attributes =head1 VERSION version 0.29 =head1 SYNOPSIS for my $attr ( HasClassAttributes->meta()->get_all_class_attributes() ) { print $attr->name(); } =head1 DESCRIPTION This role adds awareness of class attributes to a role metaclass object. It provides a set of introspection methods that largely parallel the existing attribute methods, except they operate on class attributes. =head1 METHODS Every method provided by this role has an analogous method in C<Class::MOP::Class> or C<Moose::Meta::Class> for regular attributes. =head2 $meta->has_class_attribute($name) =head2 $meta->get_class_attribute($name) =head2 $meta->get_class_attribute_list() These methods are exactly like their counterparts in L<MooseX::ClassAttribute::Trait::Class>. =head2 $meta->add_class_attribute(...) This accepts the same options as the L<Moose::Meta::Attribute> C<add_attribute()> method. However, if an attribute is specified as "required" an error will be thrown. =head2 $meta->remove_class_attribute($name) If the named class attribute exists, it is removed from the role. =head1 BUGS See L<MooseX::ClassAttribute> for details. Bugs may be submitted through L<the RT bug tracker|http://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-ClassAttribute> (or L<bug-moosex-classattribute@rt.cpan.org|mailto:bug-moosex-classattribute@rt.cpan.org>). I am also usually active on IRC as 'drolsky' on C<irc://irc.perl.org>. =head1 AUTHOR Dave Rolsky <autarch@urth.org> =head1 COPYRIGHT AND LICENCE This software is Copyright (c) 2016 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) =cut
22.42735
122
0.727134
73d35a287186d739eccdb496c68de9eb5d3bb954
3,641
pl
Perl
scripts/MergeYamlConf.pl
falquaddoomi/monarch-app
e337d87a563ec630aca45492f28a6564f980068b
[ "BSD-3-Clause" ]
45
2015-01-05T21:08:29.000Z
2021-04-02T19:35:08.000Z
scripts/MergeYamlConf.pl
falquaddoomi/monarch-app
e337d87a563ec630aca45492f28a6564f980068b
[ "BSD-3-Clause" ]
1,063
2015-01-03T00:20:34.000Z
2020-02-06T00:23:15.000Z
scripts/MergeYamlConf.pl
monicacecilia/monarch-app
70c7907f46afd3885fcccfcebce5f3c38466ca25
[ "BSD-3-Clause" ]
43
2015-01-13T14:51:57.000Z
2022-01-28T21:49:59.000Z
#!/usr/bin/perl =head1 NAME MergeYamlConf.pl - Merge Yaml configurations using a base configuration with fields that can be overriden by the input config =head1 SYNOPSIS TableGenerator.pl --input --reference --output [ --help ] =head1 OPTIONS <--input, -i> Input YAML file, used to override or add data to the reference yaml file <--reference,-r> Reference YAML file, will be added to input if a key or field does not exist or is undefined <--output,-o> Path to output file <--help,-h> Print this help message. =head1 CONTACT Kent Shefchek kshefchek@gmail.com =cut use strict; use Getopt::Long qw(:config no_ignore_case no_auto_abbrev pass_through); use Config::YAML; use Pod::Usage; # Option Variables my $input; my $output; my $reference; my $help; # Input &GetOptions("input|i=s" => \$input, "reference|ref=s" => \$reference, "output|o=s" => \$output, "help|h" => \$help ) || pod2usage(); ## Display documentation if ($help){ pod2usage( {-exitval => 0, -verbose => 2, -output => \*STDERR} ); } # Check options &checkParameters($input, $reference, $output); # Run my $inputFile; my $referenceFile; my $outputFile; open ($outputFile, ">$output") or die "Cannot open $output: $!"; my $inputHash = Config::YAML->new(config => $input, output => $output); my $referenceHash = Config::YAML->new(config => $reference, output => $output); my $mergedHash = merge($referenceHash, $inputHash); my $newYaml = Config::YAML->new(config => $output); $newYaml->fold($mergedHash); $newYaml->write; exit(0); ## Subroutines ## ## Merge two hashes together, based on merge sub in ## @ktlm's confyaml2json.pl with merging of fields list added sub merge { my $default_hash = shift || {}; my $in_hash = shift || {}; ## my $ret_hash = {}; ## For defined in default, incoming over default. foreach my $key (keys %$default_hash){ if( defined $in_hash->{$key} ){ $ret_hash->{$key} = $in_hash->{$key}; }else{ $ret_hash->{$key} = $default_hash->{$key}; } } ## For undefined in default, just use incoming. foreach my $key (keys %$in_hash){ if( ! defined $default_hash->{$key} ){ $ret_hash->{$key} = $in_hash->{$key}; } } ## Now merge fields list my $refFields = $default_hash->{'fields'}; my $inputFields = $in_hash->{'fields'}; foreach my $refField (@$refFields){ my $isInHash = 0; if (defined $refField->{'id'}){ foreach my $inputField (@$inputFields){ if ($refField->{'id'} eq $inputField->{'id'}){ $isInHash = 1; } } if (!$isInHash){ push($ret_hash->{'fields'}, $refField); } } } return $ret_hash; } # checkParameters checks that the required parameters were passed, sub checkParameters { my $input = shift; my $reference = shift; my $output = shift; # Check options if (!defined $input){ die "--input is a required option"; } if (!defined $reference){ die "--reference is a required option"; } if (!defined $output){ die "--output is a required option"; } } # log takes a string as input and prints it to the log file passed # on the command line sub log{ my $logOut = shift; my $msg = shift; my $timestamp = localtime(time); if (defined $logOut){ print $logOut "$timestamp: $msg\n"; }else { print STDOUT "$timestamp: $msg\n"; } }
22.066667
72
0.584729
ed67aaf296c6c38b2ad15c6154dffb9eb2788dac
2,931
pl
Perl
core/transaction/system_entity.pl
drkameleon/terminusdb
44a1ad6cc39d244e204de7ad6b4d46e1a47ea735
[ "Apache-2.0" ]
null
null
null
core/transaction/system_entity.pl
drkameleon/terminusdb
44a1ad6cc39d244e204de7ad6b4d46e1a47ea735
[ "Apache-2.0" ]
1
2022-03-25T19:25:33.000Z
2022-03-25T19:25:33.000Z
core/transaction/system_entity.pl
drkameleon/terminusdb
44a1ad6cc39d244e204de7ad6b4d46e1a47ea735
[ "Apache-2.0" ]
null
null
null
:- module(system_entity, [ database_exists/2, database_exists/3, organization_database_name_uri/4, organization_name_uri/3, organization_name_exists/2, database_finalized/3, user_name_uri/3, agent_name_uri/3, agent_name_exists/2, insert_db_object/6 ]). :- use_module(library(terminus_store)). :- use_module(core(util)). :- use_module(core(query)). :- use_module(core(triple)). :- use_module(descriptor). database_exists(Organization,DB) :- database_exists(system_descriptor{}, Organization, DB). database_exists(Askable, Organization, DB) :- organization_database_name_uri(Askable, Organization, DB, _). organization_database_name_uri(Askable, Organization, DB, Db_Uri) :- once(ask(Askable, ( t(Organization_Uri, system:resource_name, Organization^^xsd:string), t(Organization_Uri, rdf:type, system:'Organization'), t(Organization_Uri, system:resource_includes, Db_Uri), t(Db_Uri, system:resource_name, DB^^xsd:string), t(Db_Uri, rdf:type, system:'Database') ))). organization_name_uri(Askable,Organization, Uri) :- once(ask(Askable, ( t(Uri, system:organization_name, Organization^^xsd:string), t(Uri, rdf:type, system:'Organization') ))). organization_name_exists(Askable, Name) :- organization_name_uri(Askable, Name, _). database_finalized(Askable,Organization,Database) :- organization_database_name_uri(Askable,Organization,Database,Db_Uri), once(ask(Askable, t(Db_Uri, system:database_state, system:finalized))). user_name_uri(Askable, User_Name, Uri) :- once(ask(Askable, ( t(Uri, system:agent_name, User_Name^^xsd:string), t(Uri, rdf:type, system:'User')))). /* * agent_name_uri(Askable, Name, User_URI) is semidet. */ agent_name_uri(Askable, Name, User_URI) :- once(ask(Askable, t(User_URI, system:agent_name, Name^^xsd:string), [compress_prefixes(false)] )). agent_name_exists(Askable, Name) :- agent_name_uri(Askable, Name, _). insert_db_object(System_Transaction, Organization_Name, Database_Name, Label, Comment, DB_Uri) :- ask(System_Transaction, ( t(Organization_Uri, system:organization_name, Organization_Name^^xsd:string), random_idgen(doc:'Database', [Organization_Name^^xsd:string, Database_Name^^xsd:string], DB_Uri), insert(DB_Uri, rdf:type, system:'Database'), insert(DB_Uri, system:resource_name, Database_Name^^xsd:string), insert(DB_Uri, rdfs:label, Label@en), insert(DB_Uri, rdfs:comment, Comment@en), insert(Organization_Uri, system:organization_database, DB_Uri) )).
36.6375
109
0.643125
eda1acc8ddd01ae9410f26c1fa8b03e2cdedb769
3,216
pl
Perl
sandbox/genMETA.pl
jonasbn/Release-Checklist
b7ddc61ff1d0f2c270da57f4b279ce5feb341d48
[ "Artistic-2.0" ]
null
null
null
sandbox/genMETA.pl
jonasbn/Release-Checklist
b7ddc61ff1d0f2c270da57f4b279ce5feb341d48
[ "Artistic-2.0" ]
null
null
null
sandbox/genMETA.pl
jonasbn/Release-Checklist
b7ddc61ff1d0f2c270da57f4b279ce5feb341d48
[ "Artistic-2.0" ]
null
null
null
#!/pro/bin/perl use strict; use warnings; use Getopt::Long qw(:config bundling nopermute); GetOptions ( "c|check" => \ my $check, "v|verbose:1" => \(my $opt_v = 0), ) or die "usage: $0 [--check]\n"; use lib "sandbox"; use genMETA; my $meta = genMETA->new ( from => "Checklist.pm", verbose => $opt_v, ); $meta->from_data (<DATA>); # This project maintains META.json manually # META.yml is generated in xt/50_manifest.t and not kept in git if ($check) { $meta->check_encoding (); $meta->check_required (); my @ef = glob "examples/*"; $meta->check_minimum ([ "t", @ef, "Checklist.pm", "Makefile.PL" ]); $meta->done_testing (); } elsif ($opt_v) { $meta->print_yaml (); } else { my $rd = join "-" => $meta->{h}{name}, $meta->{h}{version}; $ENV{REGEN_META} = 1; system $^X, "xt/50_manifest.t"; system "cp", "-p", $_, "$rd/$_" for map { "META.$_" } qw( json yml ); } __END__ --- #YAML:1.0 name: Release-Checklist version: VERSION abstract: A QA checklist for CPAN releases license: perl author: - H.Merijn Brand <h.m.brand@xs4all.nl> generated_by: Author distribution_type: module release_status: stable provides: Release::Checklist: file: Checklist.pm version: VERSION requires: perl: 5.006 Test::More: 0.88 configure_requires: ExtUtils::MakeMaker: 0 test_requires: Test::Harness: 0 Test::More: 0.88 recommends: perl: 5.030000 CPAN::Meta::Converter: 2.150010 CPAN::Meta::Validator: 2.150010 Devel::Cover: 1.36 Devel::PPPort: 3.62 JSON::PP: 4.06 Module::CPANTS::Analyse: 1.01 Module::Release: 2.128 Parse::CPAN::Meta: 2.150010 Perl::Critic: 1.140 Perl::Critic::TooMuchCode: 0.15 Perl::MinimumVersion: 1.38 Perl::Tidy: 20210111 Pod::Escapes: 1.07 Pod::Parser: 1.63 Pod::Spell: 1.20 Pod::Spell::CommonMistakes: 1.002 Test2::Harness: 1.000044 Test::CPAN::Changes: 0.400002 Test::CPAN::Meta::YAML: 0.25 Test::Kwalitee: 1.28 Test::Manifest: 2.022 Test::MinimumVersion: 0.101082 Test::MinimumVersion::Fast: 0.04 Test::More: 1.302183 Test::Perl::Critic: 1.04 Test::Perl::Critic::Policy: 1.140 Test::Pod: 1.52 Test::Pod::Coverage: 1.10 Test::Version: 2.09 Text::Aspell: 0.09 Text::Ispell: 0.04 Text::Markdown: 1.000031 resources: license: http://dev.perl.org/licenses/ repository: https://github.com/Tux/Release-Checklist bugtracker: https://github.com/Tux/Release-Checklist/issues xIRC: irc://irc.perl.org/#toolchain meta-spec: version: 1.4 url: http://module-build.sourceforge.net/META-spec-v1.4.html
30.628571
79
0.521766
ed67ce1311cdf0b2c7051237f00cc6d7807aab5a
1,646
pm
Perl
apps/java/weblogic/jmx/plugin.pm
petneli/centreon-plugins
d131e60a1859fdd0e959623de56e6e7512c669af
[ "Apache-2.0" ]
316
2015-01-18T20:37:21.000Z
2022-03-27T00:20:35.000Z
apps/java/weblogic/jmx/plugin.pm
petneli/centreon-plugins
d131e60a1859fdd0e959623de56e6e7512c669af
[ "Apache-2.0" ]
2,333
2015-04-26T19:10:19.000Z
2022-03-31T15:35:21.000Z
apps/java/weblogic/jmx/plugin.pm
petneli/centreon-plugins
d131e60a1859fdd0e959623de56e6e7512c669af
[ "Apache-2.0" ]
371
2015-01-18T20:37:23.000Z
2022-03-22T10:10:16.000Z
# # Copyright 2021 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package apps::java::weblogic::jmx::plugin; use strict; use warnings; use base qw(centreon::plugins::script_custom); sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; $self->{version} = '0.1'; %{$self->{modes}} = ( 'class-count' => 'centreon::common::jvm::mode::classcount', 'memory' => 'centreon::common::jvm::mode::memory', 'memory-detailed' => 'centreon::common::jvm::mode::memorydetailed', 'threads' => 'centreon::common::jvm::mode::threads', 'work-manager' => 'apps::java::weblogic::jmx::mode::workmanager', ); $self->{custom_modes}{jolokia} = 'centreon::common::protocols::jmx::custom::jolokia'; return $self; } 1; __END__ =head1 PLUGIN DESCRIPTION Check WebLogic in JMX. Need Jolokia agent. =cut
30.481481
89
0.676185
ed183729a45424757e0b0c93f87911a5220c81ae
714
pl
Perl
2021/day1/day01.pl
qfen/aoc2021
4b3faa7cbe9382f6e0f92902a32cffa52129ae0d
[ "BSD-2-Clause" ]
null
null
null
2021/day1/day01.pl
qfen/aoc2021
4b3faa7cbe9382f6e0f92902a32cffa52129ae0d
[ "BSD-2-Clause" ]
null
null
null
2021/day1/day01.pl
qfen/aoc2021
4b3faa7cbe9382f6e0f92902a32cffa52129ae0d
[ "BSD-2-Clause" ]
null
null
null
#!/usr/bin/perl # https://adventofcode.com/2021/day/1 # https://adventofcode.com/2021/day/1/input # Usage: day01.pl < FILE use v5.28; use warnings; my $int; my $prev = ~0; # for part 1 my @windows; # for part 2 my($part1, $part2) = (0, 0); while (my $line = <STDIN>) { chomp $line; warn "non-numeric" if $line =~ /[^\d]/; $int = int $line; # part 1: count number of times this input is larger than previous line $part1++ if $int > $prev; $prev = $int; # part 2: count number of times this 3-line sliding window is greater # than the preceding window $windows[$_] += $int for (1 .. 3); $part2++ if $. > 3 and $windows[1] > $windows[0]; shift @windows; } say "part 1: $part1"; say "part 2: $part2";
22.3125
72
0.62465
73ffa22793347da5bedccc61088b1eb280f9e0a1
2,806
pm
Perl
lib/Photonic/WE/R2/WaveP.pm
wlmb/Photonic
07d8f7721dbfe3cdadaf2421ca7aba489ac6710e
[ "Artistic-1.0" ]
7
2019-04-01T19:03:06.000Z
2021-07-21T04:59:11.000Z
lib/Photonic/WE/R2/WaveP.pm
wlmb/Photonic
07d8f7721dbfe3cdadaf2421ca7aba489ac6710e
[ "Artistic-1.0" ]
21
2019-02-21T18:37:39.000Z
2022-03-29T16:45:45.000Z
lib/Photonic/WE/R2/WaveP.pm
wlmb/Photonic
07d8f7721dbfe3cdadaf2421ca7aba489ac6710e
[ "Artistic-1.0" ]
7
2017-02-20T12:13:32.000Z
2021-03-03T11:45:58.000Z
package Photonic::WE::R2::WaveP; $Photonic::WE::R2::WaveP::VERSION = '0.021'; =encoding UTF-8 =head1 NAME Photonic::WE::R2::WaveP =head1 VERSION version 0.021 =head1 COPYRIGHT NOTICE Photonic - A perl package for calculations on photonics and metamaterials. Copyright (C) 2016 by W. Luis Mochán 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 1, 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 mochan@fis.unam.mx Instituto de Ciencias Físicas, UNAM Apartado Postal 48-3 62251 Cuernavaca, Morelos México =cut =head1 SYNOPSIS use Photonic::WE::R2::WaveP; my $W=Photonic::WE::R2::WaveP->new(haydock=>$h, nh=>$nh, smallE=>$s); my $WaveProjection=$W->evaluate($epsB); =head1 DESCRIPTION Calculates the macroscopic projected wave operator for a given fixed Photonic::WE::R2::Haydock structure as a function of the dielectric functions of the components. NOTE: Only works along principal directions, as it treats Green's function as scalar. =head1 METHODS =over 4 =item * new(haydock=>$h, nh=>$nh, smallE=>$smallE) Initializes the structure. $h is Photonic::WE::R2::Haydock structure (required). $nh is the maximum number of Haydock coefficients to use (required). $smallE is the criteria of convergence (default 1e-7). =item * evaluate($epsB) Returns the macroscopic wave operator for a given value of the dielectric functions of the particle $epsB. The host's response $epsA is taken from the metric. =back =head1 ACCESSORS (read only) =over 4 =item * waveOperator The macroscopic wave operator of the last operation =item * All accessors of Photonic::WE::R2::GreenP =back =cut use namespace::autoclean; use PDL::Lite; use Photonic::Types; use Moose; use MooseX::StrictConstructor; extends 'Photonic::WE::R2::GreenP'; has 'waveOperator' => (is=>'ro', isa=>'Photonic::Types::PDLComplex', init_arg=>undef, writer=>'_waveOperator', documentation=>'Wave operator from last evaluation'); around 'evaluate' => sub { my $orig=shift; my $self=shift; my $greenP=$self->$orig(@_); my $wave=1/$greenP; #only works along principal directions!! $self->_waveOperator($wave); return $wave; }; __PACKAGE__->meta->make_immutable; 1; __END__
23
86
0.73129
ed0bb9bb175a6c3e97116c911ae8fb5aea3ca745
2,017
pm
Perl
lib/Monitorel.pm
yuuki/Monitorel
9e853f6d10bfd40f66b1cce98664235db91d8d84
[ "Artistic-1.0" ]
1
2017-07-04T08:04:33.000Z
2017-07-04T08:04:33.000Z
lib/Monitorel.pm
yuuki/Monitorel
9e853f6d10bfd40f66b1cce98664235db91d8d84
[ "Artistic-1.0" ]
null
null
null
lib/Monitorel.pm
yuuki/Monitorel
9e853f6d10bfd40f66b1cce98664235db91d8d84
[ "Artistic-1.0" ]
null
null
null
package Monitorel; use strict; use warnings; use parent qw(Amon2); use 5.008005; our $VERSION = "0.01"; 1; __END__ =encoding utf-8 =head1 NAME Monitorel - A Web API providing server performance metrics graphs =head1 SYNOPSIS # Enqueue Job use TheSchwartz; use Monitorel::Worker::TheSchwartz; my $client = TheSchwartz->new( databases => [{ dsn => $dsn, user => $user, pass => $passwd }], ); my $job_id = $client->insert('Monitorel::Worker::TheSchwartz', { agent => 'Nginx', fqdn => 'localhost', stats => [qw(ActiveConnections AcceptedConnections Requests)], tag => 'nginx', # Option type => { # Option ActiveConnections => 'gauge', AcceptedConnections => 'derive', Requests => 'derive', }, label => { # Option ActiveConnections => 'active', AcceptedConnections => 'accepted', Requests => 'requests', }, }); # Dequeue Job perl script/parallel_worker_dispatcher.pl # Web API for graph image (Memcached hit rate sample) curl http://localhost/rrdtool?s=[(def:cmd_get:::=path:localhost,memcached,cmd_get:value:AVERAGE),(def:get_hits:::=path:localhost,memcached,get_hits:value:AVERAGE),(cdef:hit_rate:::=get_hits,cmd_get,/,100,*),(line1:hit_rate:::@0000ff:hit_rate)!end=now,height=200,start=now-1d,width=400] =head1 DESCRIPTION Monitorel provides graph API for server metrics. Monitorel - has many agent plugins such as Nginx, MySQL, SNMP, Redis, and so on. - stores metrics values into RRD. =head2 SETUP SAMPLES # Generate rrdfiles with random metrics perl ./script/rrdsetup.pl # Access sample graph endpoint http://localhost:3000/samples =head1 AUTHOR Yuuki Tsubouchi E<lt>yuuki@cpan.orgE<gt> =head1 SEE ALSO =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut
25.858974
289
0.639068
ed9c28984419cf7d8c3aa75d9d5b229c01fbcbf1
1,445
pm
Perl
modules/EnsEMBL/Web/Component/Help/EmailSent.pm
nerdstrike/ensembl-webcode
ab69513124329e1b2d686c7d2c9f1d7689996a0b
[ "Apache-2.0", "MIT" ]
null
null
null
modules/EnsEMBL/Web/Component/Help/EmailSent.pm
nerdstrike/ensembl-webcode
ab69513124329e1b2d686c7d2c9f1d7689996a0b
[ "Apache-2.0", "MIT" ]
null
null
null
modules/EnsEMBL/Web/Component/Help/EmailSent.pm
nerdstrike/ensembl-webcode
ab69513124329e1b2d686c7d2c9f1d7689996a0b
[ "Apache-2.0", "MIT" ]
null
null
null
=head1 LICENSE Copyright [1999-2013] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute 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. =cut package EnsEMBL::Web::Component::Help::EmailSent; use strict; use warnings; use base qw(EnsEMBL::Web::Component::Help); sub _init { my $self = shift; $self->cacheable( 0 ); $self->ajaxable( 0 ); $self->configurable( 0 ); } sub content { my $self = shift; my $hub = $self->hub; my $email = $hub->species_defs->ENSEMBL_HELPDESK_EMAIL; return $hub->param('result') ? qq(<p>Thank you. Your message has been sent to our HelpDesk. You should receive a confirmation email shortly.</p> <p>If you do not receive a confirmation, please email us directly at <a href="mailto:$email">$email</a>. Thank you.</p>) : qq(<p>There was some problem sending your message. Please try again, or email us directly at <a href="mailto:$email">$email</a>. Thank you.</p>) ; } 1;
31.413043
150
0.723875
73f71c5ac16f3a9a954c9d70a2af10c8fddf1f56
2,076
pm
Perl
tests/wicked/wlan/sut/t07_multi_networks_wpa_psk.pm
Dawei-Pang/os-autoinst-distri-opensuse
013cccfcdc84edb8faff13eab1ab2e6288aacd26
[ "FSFAP" ]
null
null
null
tests/wicked/wlan/sut/t07_multi_networks_wpa_psk.pm
Dawei-Pang/os-autoinst-distri-opensuse
013cccfcdc84edb8faff13eab1ab2e6288aacd26
[ "FSFAP" ]
5
2019-01-17T03:09:17.000Z
2019-08-20T06:34:48.000Z
tests/wicked/wlan/sut/t07_multi_networks_wpa_psk.pm
Dawei-Pang/os-autoinst-distri-opensuse
013cccfcdc84edb8faff13eab1ab2e6288aacd26
[ "FSFAP" ]
null
null
null
# SUSE's openQA tests # # Copyright © 2021 SUSE LLC # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. # Summary: Test WiFi setup with wicked (WPA-PSK with DHCP) # the configuration contains multiple network configurations. # - WiFi Access point: # - Use virtual wlan devices # - AP with hostapd is running in network namespace # - dnsmasq for DHCP server # - WiFi Station: # - connect using ifcfg-wlan1 and `wicked ifup` # - check if STA is associated to AP # - ping both directions AP <-> STA # # Maintainer: cfamullaconrad@suse.com use Mojo::Base 'wicked::wlan'; use testapi; has wicked_version => '>=0.6.66'; has ssid => 'Virtual WiFi PSK Secured'; has psk => 'TopSecretWifiPassphrase!'; has hostapd_conf => q( ctrl_interface=/var/run/hostapd interface={{ref_ifc}} driver=nl80211 country_code=DE ssid={{ssid}} channel=11 hw_mode=g ieee80211n=1 wpa=3 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP CCMP wpa_passphrase={{psk}} auth_algs=3 beacon_int=100 ); has ifcfg_wlan => sub { [ q( BOOTPROTO='dhcp' STARTMODE='auto' WIRELESS_AUTH_MODE='psk' WIRELESS_ESSID='NO_NOT_FIND_ME' WIRELESS_WPA_PSK='SOMETHING!!' WIRELESS_AUTH_MODE_1='psk' WIRELESS_ESSID_1='{{ssid}}' WIRELESS_WPA_PSK_1='{{psk}}' ), q( BOOTPROTO='dhcp' STARTMODE='auto' WIRELESS_AUTH_MODE='psk' WIRELESS_ESSID='{{ssid}}' WIRELESS_WPA_PSK='{{psk}}' WIRELESS_AUTH_MODE_2='psk' WIRELESS_ESSID_2='NO_NOT_FIND_ME' WIRELESS_WPA_PSK_2='SOMETHING!!' ), q( BOOTPROTO='dhcp' STARTMODE='auto' WIRELESS_ESSID='{{ssid}}' WIRELESS_WPA_PSK='{{psk}}' WIRELESS_ESSID_2='NO_NOT_FIND_ME' WIRELESS_WPA_PSK_2='SOMETHING!!' ) ] }; 1;
23.862069
70
0.635838
ed0a333557da38f815a0c24630f9a0cd2cc07752
3,406
pm
Perl
lib/Haxorware/Configuration/Settings.pm
andronics/haxorware
d62e136bbf8fac1efadea37d392cddc28b219671
[ "Artistic-2.0", "Unlicense" ]
1
2020-11-13T00:54:00.000Z
2020-11-13T00:54:00.000Z
lib/Haxorware/Configuration/Settings.pm
andronics/haxorware
d62e136bbf8fac1efadea37d392cddc28b219671
[ "Artistic-2.0", "Unlicense" ]
null
null
null
lib/Haxorware/Configuration/Settings.pm
andronics/haxorware
d62e136bbf8fac1efadea37d392cddc28b219671
[ "Artistic-2.0", "Unlicense" ]
null
null
null
package Haxorware::Configuration::Settings; use Haxorware::Meta::Attributes::Traits::Reference; use Haxorware::Meta::Types::Configuration; use Moose::Role; # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = has 'dhcp_server' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 1, path => 'settings.html', parameter => 'dhcpserver' ); has 'disable_firmware_upgrade' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 1, path => 'settings.html', parameter => 'disswdld' ); has 'disable_ip_filters' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 0, path => 'settings.html', parameter => 'bootfilters' ); has 'factory_mode' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 0, path => 'settings.html', parameter => 'factory' ); has 'force_network_access' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 0, path => 'settings.html', parameter => 'fna' ); has 'ignore_t1' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 0, path => 'settings.html', parameter => 't1dis' ); has 'ignore_t2' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 1, path => 'settings.html', parameter => 't2dis' ); has 'ignore_t3' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 1, path => 'settings.html', parameter => 't3dis' ); has 'ignore_t4' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 0, path => 'settings.html', parameter => 't4dis' ); has 'host' => ( traits => [qw/Reference/], is => 'rw', isa => 'IPv4Address', default => '192.168.100.1', path => 'settings.html', parameter => 'msg_ip' ); has 'tftp_bypass' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 1, path => 'settings.html', parameter => 'enfbypass' ); has 'telnet_startup' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 1, path => 'settings.html', parameter => 'telnetd' ); has 'telnet_password' => ( traits => [qw/Reference/], is => 'rw', isa => 'Str', default => '', path => 'settings.html', parameter => 'telnet_pass' ); has 'telnet_username' => ( traits => [qw/Reference/], is => 'rw', isa => 'Str', default => '', path => 'settings.html', parameter => 'telnet_user' ); has 'webgui_protection' => ( traits => [qw/Reference/], is => 'rw', isa => 'Bool', default => 0, path => 'settings.html', parameter => 'httpdauth' ); has 'webgui_password' => ( traits => [qw/Reference/], is => 'rw', isa => 'Str', default => '', init_arg => 'password', path => 'settings.html', parameter => 'httpd_pass' ); has 'webgui_username' => ( traits => [qw/Reference/], is => 'rw', isa => 'Str', default => '', init_arg => 'username', path => 'settings.html', parameter => 'httpd_user' ); # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = sub telnet_start { my $self = shift; return $self->_request( action => 'settings.html', content => { action => 'start' } ); } sub telnet_stop { my $self = shift; return $self->_request( action => 'settings.html', content => { action => 'stop' } ); } # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 1;
83.073171
172
0.519671
ed8946df95938cedb2149f72b794665a419c42be
971
pl
Perl
.travis/apt.pl
Hellmonk/posthellcrawl
362cdb2e511a451683f4754f147d5e737658cc84
[ "CC0-1.0" ]
21
2016-11-03T13:52:57.000Z
2021-06-25T07:51:20.000Z
.travis/apt.pl
Implojin/hellcrawl
cbb74c842c7b3f85492c75484174de947c2a5014
[ "CC0-1.0" ]
34
2017-01-31T11:33:10.000Z
2018-09-25T07:34:59.000Z
.travis/apt.pl
Implojin/hellcrawl
cbb74c842c7b3f85492c75484174de947c2a5014
[ "CC0-1.0" ]
6
2017-01-04T03:21:49.000Z
2021-02-15T02:30:39.000Z
#!/usr/bin/env perl use strict; use warnings; run(qw(sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y)); run(qw(sudo add-apt-repository ppa:zoogie/sdl2-snapshots -y)); retry(qw(sudo apt-get update -qq)); if ($ENV{CXX} eq "clang++") { retry(qw(sudo apt-get install -qq libstdc++6-4.7-dev)); } elsif ($ENV{CXX} eq "g++") { retry(qw(sudo apt-get install -qq g++-4.7)); } sub run { my @cmd = @_; print "Running '@cmd'\n"; my $ret = system(@cmd); exit($ret) if $ret; return; } sub retry { my (@cmd) = @_; my $tries = 5; my $sleep = 5; my $ret; while ($tries--) { print "Running '@cmd'\n"; $ret = system(@cmd); return if $ret == 0; print "'@cmd' failed ($ret), retrying in $sleep seconds...\n"; sleep $sleep; } print "Failed to run '@cmd' ($ret)\n"; # 1 if there was a signal or system() failed, otherwise the exit status. exit($ret & 127 ? 1 : $ret >> 8); }
22.068182
76
0.555098
ed430801526b5a6a24e8caaaeed22d5c4f3952df
11,353
t
Perl
t/mojo/reactor_poll.t
kathackeray/mojo
4093223cae00eb516e38f2226749d2963597cca3
[ "Artistic-2.0" ]
896
2015-01-01T10:56:31.000Z
2018-09-06T02:12:44.000Z
t/mojo/reactor_poll.t
kathackeray/mojo
4093223cae00eb516e38f2226749d2963597cca3
[ "Artistic-2.0" ]
488
2015-01-12T14:59:58.000Z
2018-09-07T21:31:02.000Z
t/mojo/reactor_poll.t
kathackeray/mojo
4093223cae00eb516e38f2226749d2963597cca3
[ "Artistic-2.0" ]
334
2015-01-12T14:34:48.000Z
2018-09-06T10:15:38.000Z
use Mojo::Base -strict; BEGIN { $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll' } use Test::More; use IO::Socket::INET; use Mojo::Reactor::Poll; use Mojo::Util qw(steady_time); # Instantiation my $reactor = Mojo::Reactor::Poll->new; is ref $reactor, 'Mojo::Reactor::Poll', 'right object'; is ref Mojo::Reactor::Poll->new, 'Mojo::Reactor::Poll', 'right object'; undef $reactor; is ref Mojo::Reactor::Poll->new, 'Mojo::Reactor::Poll', 'right object'; use_ok 'Mojo::IOLoop'; $reactor = Mojo::IOLoop->singleton->reactor; is ref $reactor, 'Mojo::Reactor::Poll', 'right object'; # Make sure it stops automatically when not watching for events my $triggered; Mojo::IOLoop->next_tick(sub { $triggered++ }); Mojo::IOLoop->start; ok $triggered, 'reactor waited for one event'; my $time = time; Mojo::IOLoop->start; Mojo::IOLoop->one_tick; ok time < ($time + 10), 'stopped automatically'; # Listen my $listen = IO::Socket::INET->new(Listen => 5, LocalAddr => '127.0.0.1'); my $port = $listen->sockport; my ($readable, $writable); $reactor->io($listen => sub { pop() ? $writable++ : $readable++ })->watch($listen, 0, 0)->watch($listen, 1, 1); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok !$readable, 'handle is not readable'; ok !$writable, 'handle is not writable'; # Connect my $client = IO::Socket::INET->new(PeerAddr => '127.0.0.1', PeerPort => $port); $reactor->timer(1 => sub { shift->stop }); $reactor->start; ok $readable, 'handle is readable'; ok !$writable, 'handle is not writable'; # Accept my $server = $listen->accept; ok $reactor->remove($listen), 'removed'; ok !$reactor->remove($listen), 'not removed again'; ($readable, $writable) = (); $reactor->io($client => sub { pop() ? $writable++ : $readable++ }); $reactor->again($reactor->timer(0.025 => sub { shift->stop })); $reactor->start; ok !$readable, 'handle is not readable'; ok $writable, 'handle is writable'; print $client "hello!\n"; sleep 1; ok $reactor->remove($client), 'removed'; ($readable, $writable) = (); $reactor->io($server => sub { pop() ? $writable++ : $readable++ }); $reactor->watch($server, 1, 0); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok $readable, 'handle is readable'; ok !$writable, 'handle is not writable'; ($readable, $writable) = (); $reactor->watch($server, 1, 1); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok $readable, 'handle is readable'; ok $writable, 'handle is writable'; ($readable, $writable) = (); $reactor->watch($server, 0, 0); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok !$readable, 'handle is not readable'; ok !$writable, 'handle is not writable'; ($readable, $writable) = (); $reactor->watch($server, 1, 0); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok $readable, 'handle is readable'; ok !$writable, 'handle is not writable'; ($readable, $writable) = (); $reactor->io($server => sub { pop() ? $writable++ : $readable++ }); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok $readable, 'handle is readable'; ok $writable, 'handle is writable'; # Timers my ($timer, $recurring); $reactor->timer(0 => sub { $timer++ }); ok $reactor->remove($reactor->timer(0 => sub { $timer++ })), 'removed'; my $id = $reactor->recurring(0 => sub { $recurring++ }); ($readable, $writable) = (); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok $readable, 'handle is readable again'; ok $writable, 'handle is writable again'; ok $timer, 'timer was triggered'; ok $recurring, 'recurring was triggered'; my $done; ($readable, $writable, $timer, $recurring) = (); $reactor->timer(0.025 => sub { $done = shift->is_running }); $reactor->one_tick while !$done; ok $readable, 'handle is readable again'; ok $writable, 'handle is writable again'; ok !$timer, 'timer was not triggered'; ok $recurring, 'recurring was triggered again'; ($readable, $writable, $timer, $recurring) = (); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok $readable, 'handle is readable again'; ok $writable, 'handle is writable again'; ok !$timer, 'timer was not triggered'; ok $recurring, 'recurring was triggered again'; ok $reactor->remove($id), 'removed'; ok !$reactor->remove($id), 'not removed again'; ($readable, $writable, $timer, $recurring) = (); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok $readable, 'handle is readable again'; ok $writable, 'handle is writable again'; ok !$timer, 'timer was not triggered'; ok !$recurring, 'recurring was not triggered again'; ($readable, $writable, $timer, $recurring) = (); my $next_tick; is $reactor->next_tick(sub { $next_tick++ }), undef, 'returned undef'; $id = $reactor->recurring(0 => sub { $recurring++ }); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok $readable, 'handle is readable again'; ok $writable, 'handle is writable again'; ok !$timer, 'timer was not triggered'; ok $recurring, 'recurring was triggered again'; ok $next_tick, 'next tick was triggered'; # Reset $reactor->next_tick(sub { die 'Reset failed' }); $reactor->reset; ($readable, $writable, $recurring) = (); $reactor->next_tick(sub { shift->stop }); $reactor->start; ok !$readable, 'io event was not triggered again'; ok !$writable, 'io event was not triggered again'; ok !$recurring, 'recurring was not triggered again'; my $reactor2 = Mojo::Reactor::Poll->new; is ref $reactor2, 'Mojo::Reactor::Poll', 'right object'; # Ordered next_tick my $result = []; for my $i (1 .. 10) { $reactor->next_tick(sub { push @$result, $i }); } $reactor->start; is_deeply $result, [1 .. 10], 'right result'; # Reset while watchers are active $writable = undef; $reactor->io($_ => sub { ++$writable and shift->reset })->watch($_, 0, 1) for $client, $server; $reactor->start; is $writable, 1, 'only one handle was writable'; # Concurrent reactors $timer = 0; $reactor->recurring(0 => sub { $timer++ }); my $timer2; $reactor2->recurring(0 => sub { $timer2++ }); $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok $timer, 'timer was triggered'; ok !$timer2, 'timer was not triggered'; $timer = $timer2 = 0; $reactor2->timer(0.025 => sub { shift->stop }); $reactor2->start; ok !$timer, 'timer was not triggered'; ok $timer2, 'timer was triggered'; $timer = $timer2 = 0; $reactor->timer(0.025 => sub { shift->stop }); $reactor->start; ok $timer, 'timer was triggered'; ok !$timer2, 'timer was not triggered'; $timer = $timer2 = 0; $reactor2->timer(0.025 => sub { shift->stop }); $reactor2->start; ok !$timer, 'timer was not triggered'; ok $timer2, 'timer was triggered'; $reactor->reset; # Restart timer my ($single, $pair, $one, $two, $last); $reactor->timer(0.025 => sub { $single++ }); $one = $reactor->timer( 0.025 => sub { my $reactor = shift; $last++ if $single && $pair; $pair++ ? $reactor->stop : $reactor->again($two); } ); $two = $reactor->timer( 0.025 => sub { my $reactor = shift; $last++ if $single && $pair; $pair++ ? $reactor->stop : $reactor->again($one); } ); $reactor->start; is $pair, 2, 'timer pair was triggered'; ok $single, 'single timer was triggered'; ok $last, 'timers were triggered in the right order'; # Reset timer my $before = steady_time; my ($after, $again); $one = $reactor->timer(300 => sub { $after = steady_time }); $two = $reactor->recurring( 300 => sub { my $reactor = shift; $reactor->remove($two) if ++$again > 3; } ); $reactor->timer( 0.025 => sub { my $reactor = shift; $reactor->again($one, 0.025); $reactor->again($two, 0.025); } ); $reactor->start; ok $after, 'timer was triggered'; ok(($after - $before) < 200, 'less than 200 seconds'); is $again, 4, 'recurring timer triggered four times'; # Restart inactive timer $id = $reactor->timer(0 => sub { }); ok $reactor->remove($id), 'removed'; eval { $reactor->again($id) }; like $@, qr/Timer not active/, 'right error'; # Change inactive I/O watcher ok !$reactor->remove($listen), 'not removed again'; eval { $reactor->watch($listen, 1, 1) }; like $@, qr!I/O watcher not active!, 'right error'; # Error my $err; $reactor->unsubscribe('error')->on( error => sub { shift->stop; $err = pop; } ); $reactor->timer(0 => sub { die "works!\n" }); $reactor->start; like $err, qr/works!/, 'right error'; # Reset events $reactor->on(error => sub { }); ok $reactor->has_subscribers('error'), 'has subscribers'; $reactor->reset; ok !$reactor->has_subscribers('error'), 'no subscribers'; # Recursion $timer = undef; $reactor = $reactor->new; $reactor->timer(0 => sub { ++$timer and shift->one_tick }); $reactor->one_tick; is $timer, 1, 'timer was triggered once'; # Detection is(Mojo::Reactor::Poll->detect, 'Mojo::Reactor::Poll', 'right class'); # Reactor in control is ref Mojo::IOLoop->singleton->reactor, 'Mojo::Reactor::Poll', 'right object'; ok !Mojo::IOLoop->is_running, 'loop is not running'; my ($buffer, $server_err, $server_running, $client_err, $client_running); $id = Mojo::IOLoop->server( {address => '127.0.0.1'} => sub { my ($loop, $stream) = @_; $stream->write('test' => sub { shift->write('321') }); $server_running = Mojo::IOLoop->is_running; eval { Mojo::IOLoop->start }; $server_err = $@; } ); $port = Mojo::IOLoop->acceptor($id)->port; Mojo::IOLoop->client( {port => $port} => sub { my ($loop, $err, $stream) = @_; $stream->on( read => sub { my ($stream, $chunk) = @_; $buffer .= $chunk; return unless $buffer eq 'test321'; Mojo::IOLoop->singleton->reactor->stop; } ); $client_running = Mojo::IOLoop->is_running; eval { Mojo::IOLoop->start }; $client_err = $@; } ); Mojo::IOLoop->singleton->reactor->start; ok !Mojo::IOLoop->is_running, 'loop is not running'; like $server_err, qr/^Mojo::IOLoop already running/, 'right error'; like $client_err, qr/^Mojo::IOLoop already running/, 'right error'; ok $server_running, 'loop is running'; ok $client_running, 'loop is running'; # Abstract methods eval { Mojo::Reactor->again }; like $@, qr/Method "again" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->io }; like $@, qr/Method "io" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->is_running }; like $@, qr/Method "is_running" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->next_tick }; like $@, qr/Method "next_tick" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->one_tick }; like $@, qr/Method "one_tick" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->recurring }; like $@, qr/Method "recurring" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->remove }; like $@, qr/Method "remove" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->reset }; like $@, qr/Method "reset" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->start }; like $@, qr/Method "start" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->stop }; like $@, qr/Method "stop" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->timer }; like $@, qr/Method "timer" not implemented by subclass/, 'right error'; eval { Mojo::Reactor->watch }; like $@, qr/Method "watch" not implemented by subclass/, 'right error'; done_testing();
33.489676
111
0.645116
ed4bd6b9f830cd1d86ed2c7edbeddb6d000eeeaf
3,820
pm
Perl
lib/Log/Dispatch/ArrayWithLimits.pm
gitpan/Log-Dispatch-ArrayWithLimits
1ac79065781c2d32021fefd2b106f54594454663
[ "Artistic-1.0" ]
null
null
null
lib/Log/Dispatch/ArrayWithLimits.pm
gitpan/Log-Dispatch-ArrayWithLimits
1ac79065781c2d32021fefd2b106f54594454663
[ "Artistic-1.0" ]
null
null
null
lib/Log/Dispatch/ArrayWithLimits.pm
gitpan/Log-Dispatch-ArrayWithLimits
1ac79065781c2d32021fefd2b106f54594454663
[ "Artistic-1.0" ]
null
null
null
package Log::Dispatch::ArrayWithLimits; use 5.010001; use warnings; use strict; use parent qw(Log::Dispatch::Output); our $DATE = '2015-01-03'; # DATE our $VERSION = '0.04'; # VERSION sub new { my ($class, %args) = @_; my $self = {}; $self->{array} = $args{array} // []; if (!ref($self->{array})) { no strict 'refs'; say "$self->{array}"; $self->{array} = \@{"$self->{array}"}; } $self->{max_elems} = $args{max_elems} // undef; bless $self, $class; $self->_basic_init(%args); $self; } sub log_message { my $self = shift; my %args = @_; push @{$self->{array}}, $args{message}; if (defined($self->{max_elems}) && @{$self->{array}} > $self->{max_elems}) { # splice() is not supported for threads::shared-array, so we use # repeated shift while (@{$self->{array}} > $self->{max_elems}) { shift @{$self->{array}}; } } } 1; # ABSTRACT: Log to array, with some limits applied __END__ =pod =encoding UTF-8 =head1 NAME Log::Dispatch::ArrayWithLimits - Log to array, with some limits applied =head1 VERSION This document describes version 0.04 of Log::Dispatch::ArrayWithLimits (from Perl distribution Log-Dispatch-ArrayWithLimits), released on 2015-01-03. =head1 SYNOPSIS use Log::Dispatch::ArrayWithLimits; my $file = Log::Dispatch::ArrayWithLimits( min_level => 'info', array => $ary, # default: [], you can always refer by name e.g. 'My::array' to refer to @My::array max_elems => 100, # defaults unlimited ); $file->log(level => 'info', message => "Your comment\n"); =head1 DESCRIPTION This module functions similarly to L<Log::Dispatch::Array>, with a few differences: =over =item * only the messages (strings) are stored =item * allow specifying array variable name (e.g. "My::array" instead of \@My:array) This makes it possible to use in L<Log::Log4perl> configuration, which is a text file. =item * can apply some limits Currently only max_elems (the maximum number of elements in the array) is available. Future limits will be added. =back Logging to an in-process array can be useful when debugging/testing, or when you want to let users of your program connect to your program to request viewing the ogs being produced. =head1 METHODS =head2 new(%args) Constructor. This method takes a hash of parameters. The following options are valid: C<min_level> and C<max_level> (see L<Log::Dispatch> documentation); C<array> (a reference to an array, or if value is string, will be taken as name of array variable; this is so this module can be used/configured e.g. by L<Log::Log4perl> because configuration is specified via a text file), C<max_elems>. =head2 log_message(message => STR) Send a message to the appropriate output. Generally this shouldn't be called directly but should be called through the C<log()> method (in LLog::Dispatch::Output>). =head1 SEE ALSO L<Log::Dispatch> L<Log::Dispatch::Array> =head1 HOMEPAGE Please visit the project's homepage at L<https://metacpan.org/release/Log-Dispatch-ArrayWithLimits>. =head1 SOURCE Source repository is at L<https://github.com/sharyanto/perl-Log-Dispatch-ArrayWithLimits>. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Log-Dispatch-ArrayWithLimits> When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR perlancar <perlancar@cpan.org> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2015 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut
25.986395
150
0.694764
ed40406abfb7d986d27ade8b3e54a10b3a29a8e5
35,437
pm
Perl
modules/Bio/EnsEMBL/Analysis/Hive/Config/GenebuilderStatic.pm
jmgonzmart/ensembl-analysis
41c1d362bc0abce91a81a6615b3d61a6b82b7da5
[ "Apache-2.0" ]
null
null
null
modules/Bio/EnsEMBL/Analysis/Hive/Config/GenebuilderStatic.pm
jmgonzmart/ensembl-analysis
41c1d362bc0abce91a81a6615b3d61a6b82b7da5
[ "Apache-2.0" ]
null
null
null
modules/Bio/EnsEMBL/Analysis/Hive/Config/GenebuilderStatic.pm
jmgonzmart/ensembl-analysis
41c1d362bc0abce91a81a6615b3d61a6b82b7da5
[ "Apache-2.0" ]
null
null
null
=head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2022] EMBL-European Bioinformatics Institute 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. =head1 CONTACT Please email comments or questions to the public Ensembl developers list at <http://lists.ensembl.org/mailman/listinfo/dev>. Questions may also be sent to the Ensembl help desk at <http://www.ensembl.org/Help/Contact>. =head1 NAME Bio::EnsEMBL::Analysis::Hive::Config::GenebuilderStatic =head1 SYNOPSIS use Bio::EnsEMBL::Analysis::Tools::Utilities qw(get_analysis_settings); use parent ('Bio::EnsEMBL::Analysis::Hive::Config::HiveBaseConfig_conf'); sub pipeline_analyses { my ($self) = @_; return [ { -logic_name => 'run_uniprot_blast', -module => 'Bio::EnsEMBL::Analysis::Hive::RunnableDB::HiveAssemblyLoading::HiveBlastGenscanPep', -parameters => { blast_db_path => $self->o('uniprot_blast_db_path'), blast_exe_path => $self->o('uniprot_blast_exe_path'), commandline_params => '-cpus 3 -hitdist 40', repeat_masking_logic_names => ['repeatmasker_'.$self->o('repeatmasker_library')], prediction_transcript_logic_names => ['genscan'], iid_type => 'feature_id', logic_name => 'uniprot', module => 'HiveBlastGenscanPep', get_analysis_settings('Bio::EnsEMBL::Analysis::Hive::Config::GenebuilderStatic',$self->o('uniprot_set'), }, -flow_into => { -1 => ['run_uniprot_blast_himem'], -2 => ['run_uniprot_blast_long'], }, -rc_name => 'blast', }, ]; } =head1 DESCRIPTION This is the config file for all genebuilder analysis. You should use it in your Hive configuration file to specify the parameters of an analysis. You can either choose an existing config or you can create a new one based on the default hash. =head1 METHODS _master_config_settings: contains all possible parameters =cut package Bio::EnsEMBL::Analysis::Hive::Config::GenebuilderStatic; use strict; use warnings; use parent ('Bio::EnsEMBL::Analysis::Hive::Config::BaseStatic'); sub _master_config { my ($self, $key) = @_; my %config = ( default => [], primates_basic => [ 'IG_C_gene', 'IG_J_gene', 'IG_V_gene', 'IG_D_gene', 'TR_C_gene', 'TR_J_gene', 'TR_V_gene', 'TR_D_gene', 'seleno_self', 'fish_pe12_seleno_1', 'human_pe12_seleno_1', 'mammals_pe12_seleno_1', 'seleno_other_1', 'vert_pe12_seleno_1', 'mouse_pe12_seleno_1', 'self_pe12_seleno_1', 'reptiles_pe12_seleno_1', 'aves_pe12_seleno_1', 'amphibians_seleno_1', 'fish_pe12_seleno_2', 'human_pe12_seleno_2', 'mammals_pe12_seleno_2', 'seleno_other_2', 'vert_pe12_seleno_2', 'mouse_pe12_seleno_2', 'self_pe12_seleno_2', 'reptiles_pe12_seleno_2', 'aves_pe12_seleno_2', 'amphibians_seleno_2', 'fish_pe12_seleno_3', 'human_pe12_seleno_3', 'mammals_pe12_seleno_3', 'seleno_other_3', 'vert_pe12_seleno_3', 'mouse_pe12_seleno_3', 'self_pe12_seleno_3', 'reptiles_pe12_seleno_3', 'aves_pe12_seleno_3', 'amphibians_seleno_3', 'fish_pe12_seleno_4', 'human_pe12_seleno_4', 'mammals_pe12_seleno_4', 'seleno_other_4', 'vert_pe12_seleno_4', 'mouse_pe12_seleno_4', 'self_pe12_seleno_4', 'reptiles_pe12_seleno_4', 'aves_pe12_seleno_4', 'amphibians_seleno_4', 'cdna2genome', 'edited', 'gw_gtag', 'gw_nogtag', 'gw_exo', 'projection_1', 'projection_2', 'rnaseq_merged_1', 'rnaseq_merged_2', 'rnaseq_tissue_1', 'rnaseq_tissue_2', 'self_pe12_sp_1', 'self_pe12_tr_1', 'self_pe12_sp_2', 'self_pe12_tr_2', 'human_pe12_sp_1', 'human_pe12_tr_1', 'primates_pe12_sp_1', 'primates_pe12_tr_1', 'genblast_select_1', 'genblast_select_2', 'mammals_pe12_sp_1', 'mammals_pe12_tr_1', 'human_pe12_sp_2', 'human_pe12_tr_2', 'primates_pe12_sp_2', 'primates_pe12_tr_2', 'mammals_pe12_sp_2', 'mammals_pe12_tr_2', 'projection_3', 'projection_4', 'genblast_select_3', 'genblast_select_4', 'projection_5', 'projection_6', 'genblast_select_5', 'genblast_select_6', 'human_pe12_sp_6', 'human_pe12_tr_6', ], mammals_basic => [ 'IG_C_gene', 'IG_J_gene', 'IG_V_gene', 'IG_D_gene', 'TR_C_gene', 'TR_J_gene', 'TR_V_gene', 'TR_D_gene', 'seleno_self', 'fish_pe12_seleno_1', 'human_pe12_seleno_1', 'mammals_pe12_seleno_1', 'seleno_other_1', 'vert_pe12_seleno_1', 'mouse_pe12_seleno_1', 'self_pe12_seleno_1', 'reptiles_pe12_seleno_1', 'aves_pe12_seleno_1', 'amphibians_seleno_1', 'fish_pe12_seleno_2', 'human_pe12_seleno_2', 'mammals_pe12_seleno_2', 'seleno_other_2', 'vert_pe12_seleno_2', 'mouse_pe12_seleno_2', 'self_pe12_seleno_2', 'reptiles_pe12_seleno_2', 'aves_pe12_seleno_2', 'amphibians_seleno_2', 'fish_pe12_seleno_3', 'human_pe12_seleno_3', 'mammals_pe12_seleno_3', 'seleno_other_3', 'vert_pe12_seleno_3', 'mouse_pe12_seleno_3', 'self_pe12_seleno_3', 'reptiles_pe12_seleno_3', 'aves_pe12_seleno_3', 'amphibians_seleno_3', 'fish_pe12_seleno_4', 'human_pe12_seleno_4', 'mammals_pe12_seleno_4', 'seleno_other_4', 'vert_pe12_seleno_4', 'mouse_pe12_seleno_4', 'self_pe12_seleno_4', 'reptiles_pe12_seleno_4', 'aves_pe12_seleno_4', 'amphibians_seleno_4', 'cdna2genome', 'edited', 'gw_gtag', 'gw_nogtag', 'gw_exo', 'realign_1', 'realign_2', 'realign_3', 'realign_4', 'realign_5', 'realign_6', 'rnaseq_merged_1', 'rnaseq_merged_2', 'rnaseq_merged_3', 'self_pe12_sp_1', 'self_pe12_tr_1', 'self_pe12_sp_2', 'self_pe12_tr_2', 'human_pe12_sp_1', 'human_pe12_tr_1', 'human_pe12_tr_2', 'human_pe12_sp_2', 'mouse_pe12_sp_1', 'mouse_pe12_tr_1', 'mouse_pe12_sp_2', 'mouse_pe12_tr_2', 'mammals_pe12_sp_1', 'mammals_pe12_tr_1', 'mammals_pe12_sp_2', 'mammals_pe12_tr_2', 'rnaseq_tissue_1', 'rnaseq_tissue_2', 'rnaseq_tissue_3', 'human_pe12_sp_3', 'human_pe12_tr_3', 'mouse_pe12_sp_3', 'mouse_pe12_tr_3', 'self_pe3_sp_1', 'self_pe3_tr_1', 'mammals_pe12_sp_3', 'mammals_pe12_tr_3', 'vert_pe12_sp_1', 'vert_pe12_tr_1', 'rnaseq_merged_4', 'human_pe12_sp_4', 'human_pe12_tr_4', 'mouse_pe12_sp_4', 'mouse_pe12_tr_4', 'mammals_pe12_sp_4', 'mammals_pe12_tr_4', 'vert_pe12_sp_3', 'vert_pe12_tr_3', 'rnaseq_merged_5', 'rnaseq_tissue_5', 'human_pe12_sp_5', 'human_pe12_tr_5', 'mouse_pe12_sp_5', 'mouse_pe12_tr_5', 'vert_pe12_sp_4', 'vert_pe12_tr_4', ], reptiles_basic => [ ], fish_basic => [ 'IG_C_gene', 'IG_J_gene', 'IG_V_gene', 'IG_D_gene', 'TR_C_gene', 'TR_J_gene', 'TR_V_gene', 'TR_D_gene', 'seleno_self', 'fish_pe12_seleno_1', 'human_pe12_seleno_1', 'mammals_pe12_seleno_1', 'seleno_other_1', 'vert_pe12_seleno_1', 'mouse_pe12_seleno_1', 'self_pe12_seleno_1', 'reptiles_pe12_seleno_1', 'aves_pe12_seleno_1', 'amphibians_seleno_1', 'fish_pe12_seleno_2', 'human_pe12_seleno_2', 'mammals_pe12_seleno_2', 'seleno_other_2', 'vert_pe12_seleno_2', 'mouse_pe12_seleno_2', 'self_pe12_seleno_2', 'reptiles_pe12_seleno_2', 'aves_pe12_seleno_2', 'amphibians_seleno_2', 'fish_pe12_seleno_3', 'human_pe12_seleno_3', 'mammals_pe12_seleno_3', 'seleno_other_3', 'vert_pe12_seleno_3', 'mouse_pe12_seleno_3', 'self_pe12_seleno_3', 'reptiles_pe12_seleno_3', 'aves_pe12_seleno_3', 'amphibians_seleno_3', 'fish_pe12_seleno_4', 'human_pe12_seleno_4', 'mammals_pe12_seleno_4', 'seleno_other_4', 'vert_pe12_seleno_4', 'mouse_pe12_seleno_4', 'self_pe12_seleno_4', 'reptiles_pe12_seleno_4', 'aves_pe12_seleno_4', 'amphibians_seleno_4', 'cdna2genome', 'edited', 'gw_gtag', 'gw_nogtag', 'gw_exo', 'projection_1', 'projection_2', 'genblast_rnaseq_top', 'genblast_rnaseq_high', 'genblast_rnaseq_medium', 'genblast_rnaseq_low', 'genblast_rnaseq_weak', 'rnaseq_merged_1', 'rnaseq_merged_2', 'rnaseq_merged_3', 'rnaseq_merged_4', 'rnaseq_merged_5', 'rnaseq_tissue_1', 'rnaseq_tissue_2', 'rnaseq_tissue_3', 'rnaseq_tissue_4', 'rnaseq_tissue_5', 'self_pe12_sp_1', 'self_pe12_tr_1', 'self_pe12_sp_2', 'self_pe12_tr_2', 'genblast_select_1', 'genblast_select_2', 'projection_3', 'projection_4', 'fish_pe12_sp_1', 'fish_pe12_tr_1', 'fish_pe12_sp_2', 'fish_pe12_tr_2', 'genblast_select_3', 'genblast_select_4', 'rnaseq_merged_6', 'rnaseq_tissue_6', 'projection_5', 'projection_6', 'fish_pe12_sp_3', 'fish_pe12_tr_3', 'fish_pe12_sp_4', 'fish_pe12_tr_4', 'human_pe12_sp_1', 'human_pe12_tr_1', 'mammals_pe12_sp_1', 'mammals_pe12_tr_1', 'vert_pe12_sp_1', 'vert_pe12_tr_1', 'genblast_select_5', 'genblast_select_6', 'human_pe12_sp_2', 'human_pe12_tr_2', 'vert_pe12_sp_2', 'vert_pe12_tr_2', 'mammals_pe12_sp_2', 'mammals_pe12_tr_2', 'human_pe12_sp_3', 'human_pe12_tr_3', 'vert_pe12_sp_3', 'vert_pe12_tr_3', 'mammals_pe12_sp_3', 'mammals_pe12_tr_3', 'fish_pe12_sp_5', 'fish_pe12_tr_5', 'fish_pe12_sp_6', 'fish_pe12_tr_6', 'projection_7', 'human_pe12_sp_4', 'human_pe12_tr_4', 'vert_pe12_sp_4', 'vert_pe12_tr_4', 'mammals_pe12_sp_4', 'mammals_pe12_tr_4', 'mammals_pe12_sp_5', 'mammals_pe12_tr_5', 'vert_pe12_sp_5', 'vert_pe12_tr_5', 'human_pe12_sp_5', 'human_pe12_tr_5', 'mammals_pe12_sp_6', 'mammals_pe12_tr_6', 'vert_pe12_sp_6', 'vert_pe12_tr_6', 'human_pe12_sp_6', 'human_pe12_tr_6', 'fish_pe12_sp_int_1', 'fish_pe12_tr_int_1', 'mammals_pe12_sp_int_1', 'mammals_pe12_tr_int_1', 'vert_pe12_sp_int_1', 'vert_pe12_tr_int_1', 'human_pe12_sp_int_1', 'human_pe12_tr_int_1', 'fish_pe12_sp_int_2', 'fish_pe12_tr_int_2', 'mammals_pe12_sp_int_2', 'mammals_pe12_tr_int_2', 'vert_pe12_sp_int_2', 'vert_pe12_tr_int_2', 'human_pe12_sp_int_2', 'human_pe12_tr_int_2', 'fish_pe12_sp_int_3', 'fish_pe12_tr_int_3', 'mammals_pe12_sp_int_3', 'mammals_pe12_tr_int_3', 'vert_pe12_sp_int_3', 'vert_pe12_tr_int_3', 'human_pe12_sp_int_3', 'human_pe12_tr_int_3', 'fish_pe12_sp_int_4', 'fish_pe12_tr_int_4', 'mammals_pe12_sp_int_4', 'mammals_pe12_tr_int_4', 'vert_pe12_sp_int_4', 'vert_pe12_tr_int_4', 'human_pe12_sp_int_4', 'human_pe12_tr_int_4', 'fish_pe12_sp_int_5', 'fish_pe12_tr_int_5', 'mammals_pe12_sp_int_5', 'mammals_pe12_tr_int_5', 'vert_pe12_sp_int_5', 'vert_pe12_tr_int_5', 'human_pe12_sp_int_5', 'human_pe12_tr_int_5', 'fish_pe12_sp_int_6', 'fish_pe12_tr_int_6', 'mammals_pe12_sp_int_6', 'mammals_pe12_tr_int_6', 'vert_pe12_sp_int_6', 'vert_pe12_tr_int_6', 'human_pe12_sp_int_6', 'human_pe12_tr_int_6', 'rnaseq_merged', 'rnaseq_tissue', ], fish_complete => [ 'IG_C_gene', 'IG_J_gene', 'IG_V_gene', 'IG_D_gene', 'TR_C_gene', 'TR_J_gene', 'TR_V_gene', 'TR_D_gene', 'seleno_self', 'fish_pe12_seleno_1', 'human_pe12_seleno_1', 'mammals_pe12_seleno_1', 'seleno_other_1', 'vert_pe12_seleno_1', 'mouse_pe12_seleno_1', 'self_pe12_seleno_1', 'reptiles_pe12_seleno_1', 'aves_pe12_seleno_1', 'amphibians_seleno_1', 'fish_pe12_seleno_2', 'human_pe12_seleno_2', 'mammals_pe12_seleno_2', 'seleno_other_2', 'vert_pe12_seleno_2', 'mouse_pe12_seleno_2', 'self_pe12_seleno_2', 'reptiles_pe12_seleno_2', 'aves_pe12_seleno_2', 'amphibians_seleno_2', 'fish_pe12_seleno_3', 'human_pe12_seleno_3', 'mammals_pe12_seleno_3', 'seleno_other_3', 'vert_pe12_seleno_3', 'mouse_pe12_seleno_3', 'self_pe12_seleno_3', 'reptiles_pe12_seleno_3', 'aves_pe12_seleno_3', 'amphibians_seleno_3', 'fish_pe12_seleno_4', 'human_pe12_seleno_4', 'mammals_pe12_seleno_4', 'seleno_other_4', 'vert_pe12_seleno_4', 'mouse_pe12_seleno_4', 'self_pe12_seleno_4', 'reptiles_pe12_seleno_4', 'aves_pe12_seleno_4', 'amphibians_seleno_4', 'cdna2genome', 'edited', 'gw_gtag', 'gw_nogtag', 'gw_exo', 'realign_80', 'realign_95', 'realign_50', 'self_pe12_sp_95', 'self_pe12_sp_80', 'self_pe12_tr_95', 'self_pe12_tr_80', 'self_pe3_tr_95', 'self_pe3_tr_80', 'rnaseq_95', 'rnaseq_80', 'fish_pe12_sp_80', 'fish_pe12_sp_95', 'fish_pe12_tr_80', 'fish_pe12_tr_95', 'human_pe12_sp_80', 'human_pe12_sp_95', 'human_pe12_tr_80', 'human_pe12_tr_95', 'mouse_pe12_sp_95', 'mouse_pe12_sp_80', 'mouse_pe12_tr_80', 'mouse_pe12_tr_95', 'mammals_pe12_sp_80', 'mammals_pe12_sp_95', 'mammals_pe12_tr_95', 'mammals_pe12_tr_80', 'vert_pe12_sp_95', 'vert_pe12_sp_80', 'vert_pe12_tr_80', 'vert_pe12_tr_95', ], distant_vertebrate => [ 'IG_C_gene', 'IG_J_gene', 'IG_V_gene', 'IG_D_gene', 'TR_C_gene', 'TR_J_gene', 'TR_V_gene', 'TR_D_gene', 'seleno_self', 'fish_pe12_seleno_1', 'human_pe12_seleno_1', 'mammals_pe12_seleno_1', 'seleno_other_1', 'vert_pe12_seleno_1', 'mouse_pe12_seleno_1', 'self_pe12_seleno_1', 'reptiles_pe12_seleno_1', 'aves_pe12_seleno_1', 'amphibians_seleno_1', 'fish_pe12_seleno_2', 'human_pe12_seleno_2', 'mammals_pe12_seleno_2', 'seleno_other_2', 'vert_pe12_seleno_2', 'mouse_pe12_seleno_2', 'self_pe12_seleno_2', 'reptiles_pe12_seleno_2', 'aves_pe12_seleno_2', 'amphibians_seleno_2', 'fish_pe12_seleno_3', 'human_pe12_seleno_3', 'mammals_pe12_seleno_3', 'seleno_other_3', 'vert_pe12_seleno_3', 'mouse_pe12_seleno_3', 'self_pe12_seleno_3', 'reptiles_pe12_seleno_3', 'aves_pe12_seleno_3', 'amphibians_seleno_3', 'fish_pe12_seleno_4', 'human_pe12_seleno_4', 'mammals_pe12_seleno_4', 'seleno_other_4', 'vert_pe12_seleno_4', 'mouse_pe12_seleno_4', 'self_pe12_seleno_4', 'reptiles_pe12_seleno_4', 'aves_pe12_seleno_4', 'amphibians_seleno_4', 'cdna2genome', 'edited', 'gw_gtag', 'gw_nogtag', 'gw_exo', 'rnaseq_merged_1', 'rnaseq_merged_2', 'rnaseq_merged_3', 'rnaseq_tissue_1', 'rnaseq_tissue_2', 'rnaseq_tissue_3', 'genblast_select_1', 'genblast_select_2', 'vert_pe12_sp_1', 'vert_pe12_sp_2', 'realign_1', 'realign_2', 'self_pe12_sp_1', 'self_pe12_sp_2', 'self_pe12_tr_1', 'self_pe12_tr_2', 'rnaseq_merged_4', 'rnaseq_tissue_4', 'genblast_select_3', 'vert_pe12_sp_3', 'vert_pe12_tr_1', 'vert_pe12_tr_2', 'realign_3', 'rnaseq_merged_5', 'rnaseq_tissue_5', 'genblast_select_4', 'vert_pe12_sp_4', 'vert_pe12_tr_3', 'realign_4', 'rnaseq_merged_6', 'rnaseq_tissue_6', 'genblast_select_5', 'vert_pe12_sp_5', 'vert_pe12_tr_4', 'realign_5', 'genblast_select_6', 'vert_pe12_sp_6', 'realign_6', 'vert_pe12_tr_6', 'rnaseq_merged_7', 'rnaseq_tissue_7', 'genblast_select_7', 'vert_pe12_sp_7', 'realign_7', 'vert_pe12_tr_7', ], birds_basic => [ ], hemiptera_basic => [ 'IG_C_gene', 'IG_J_gene', 'IG_V_gene', 'IG_D_gene', 'TR_C_gene', 'TR_J_gene', 'TR_V_gene', 'TR_D_gene', 'seleno_self', 'fish_pe12_seleno_1', 'human_pe12_seleno_1', 'mammals_pe12_seleno_1', 'seleno_other_1', 'vert_pe12_seleno_1', 'mouse_pe12_seleno_1', 'self_pe12_seleno_1', 'reptiles_pe12_seleno_1', 'aves_pe12_seleno_1', 'amphibians_seleno_1', 'fish_pe12_seleno_2', 'human_pe12_seleno_2', 'mammals_pe12_seleno_2', 'seleno_other_2', 'vert_pe12_seleno_2', 'mouse_pe12_seleno_2', 'self_pe12_seleno_2', 'reptiles_pe12_seleno_2', 'aves_pe12_seleno_2', 'amphibians_seleno_2', 'fish_pe12_seleno_3', 'human_pe12_seleno_3', 'mammals_pe12_seleno_3', 'seleno_other_3', 'vert_pe12_seleno_3', 'mouse_pe12_seleno_3', 'self_pe12_seleno_3', 'reptiles_pe12_seleno_3', 'aves_pe12_seleno_3', 'amphibians_seleno_3', 'fish_pe12_seleno_4', 'human_pe12_seleno_4', 'mammals_pe12_seleno_4', 'seleno_other_4', 'vert_pe12_seleno_4', 'mouse_pe12_seleno_4', 'self_pe12_seleno_4', 'reptiles_pe12_seleno_4', 'aves_pe12_seleno_4', 'amphibians_seleno_4', 'cdna2genome', 'edited', 'gw_gtag', 'gw_nogtag', 'gw_exo', 'rnaseq_merged_1', 'rnaseq_merged_2', 'rnaseq_merged_3', 'rnaseq_merged_4', 'rnaseq_merged_5', 'rnaseq_merged_6', 'rnaseq_merged_7', 'rnaseq_tissue_1', 'rnaseq_tissue_2', 'rnaseq_tissue_3', 'rnaseq_tissue_4', 'rnaseq_tissue_5', 'rnaseq_tissue_6', 'rnaseq_tissue_7', 'self_pe12_sp_1', 'self_pe12_tr_1', 'self_pe12_sp_2', 'self_pe12_tr_2', 'self_pe12_sp_3', 'self_pe12_tr_3', 'self_pe12_sp_4', 'self_pe12_tr_4', 'hemiptera_pe12_sp_1', 'pisum_pe12_sp_1', 'drosophila_sp_1', 'flies_sp_1', 'hemiptera_pe12_sp_2', 'pisum_pe12_sp_2', 'drosophila_sp_2', 'flies_sp_2', 'hemiptera_pe12_sp_3', 'pisum_pe12_sp_3', 'drosophila_sp_3', 'flies_sp_3', 'hemiptera_pe12_sp_4', 'pisum_pe12_sp_4', 'drosophila_sp_4', 'flies_sp_4', 'hemiptera_pe12_tr_1', 'pisum_pe12_tr_1', 'drosophila_tr_1', 'flies_tr_1', 'hemiptera_pe12_tr_2', 'pisum_pe12_tr_2', 'drosophila_tr_2', 'flies_tr_2', 'hemiptera_pe12_tr_3', 'pisum_pe12_tr_3', 'drosophila_tr_3', 'flies_tr_3', 'hemiptera_pe12_tr_4', 'pisum_pe12_tr_4', 'drosophila_tr_4', 'flies_tr_4', 'rnaseq_merged', 'rnaseq_tissue', ], insects_basic => [], non_vertebrates_basic => [], metazoa_basic => [], plants_basic => [], fungi_basic => [], protists_basic => [], self_patch => [ 'self_pe12_sp_95', 'self_pe12_sp_80', 'self_pe12_tr_95', 'self_pe12_tr_80', 'self_frag_pe12_sp_95', 'self_frag_pe12_tr_95', 'self_frag_pe12_sp_80', 'self_frag_pe12_tr_80', ], ); return $config{$key}; } 1;
43.480982
129
0.363857
ed890d586f4a57a6317c2d5352fb4980f8e80b7c
756
pm
Perl
auto-lib/Paws/Lightsail/GetStaticIpsResult.pm
agimenez/aws-sdk-perl
9c4dff7d1af2ff0210c28ca44fb9e92bc625712b
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/Lightsail/GetStaticIpsResult.pm
agimenez/aws-sdk-perl
9c4dff7d1af2ff0210c28ca44fb9e92bc625712b
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/Lightsail/GetStaticIpsResult.pm
agimenez/aws-sdk-perl
9c4dff7d1af2ff0210c28ca44fb9e92bc625712b
[ "Apache-2.0" ]
null
null
null
package Paws::Lightsail::GetStaticIpsResult; use Moose; has NextPageToken => (is => 'ro', isa => 'Str', traits => ['Unwrapped'], xmlname => 'nextPageToken' ); has StaticIps => (is => 'ro', isa => 'ArrayRef[Paws::Lightsail::StaticIp]', traits => ['Unwrapped'], xmlname => 'staticIps' ); has _request_id => (is => 'ro', isa => 'Str'); ### main pod documentation begin ### =head1 NAME Paws::Lightsail::GetStaticIpsResult =head1 ATTRIBUTES =head2 NextPageToken => Str A token used for advancing to the next page of results from your get static IPs request. =head2 StaticIps => ArrayRef[L<Paws::Lightsail::StaticIp>] An array of key-value pairs containing information about your get static IPs request. =head2 _request_id => Str =cut 1;
21.6
128
0.687831
ed8eabebe4384b6c3541d8f03a4477e5a58d091d
2,607
t
Perl
t/01-basic.t
cog/Games-Cards-ShuffleTrack
9134fc0d1a6229e54af0301ee599157f7a817e93
[ "Artistic-2.0", "Unlicense" ]
1
2016-02-24T23:26:28.000Z
2016-02-24T23:26:28.000Z
t/01-basic.t
cog/Games-Cards-ShuffleTrack
9134fc0d1a6229e54af0301ee599157f7a817e93
[ "Artistic-2.0", "Unlicense" ]
null
null
null
t/01-basic.t
cog/Games-Cards-ShuffleTrack
9134fc0d1a6229e54af0301ee599157f7a817e93
[ "Artistic-2.0", "Unlicense" ]
null
null
null
#!perl -T use 5.006; use strict; use warnings; use Test::More; plan tests => 126; use Games::Cards::ShuffleTrack; my $deck = Games::Cards::ShuffleTrack->new(); my @original_deck = @{$deck->get_deck}; my ($top_card, $bottom_card) = $deck->find( 1, -1 ); # $deck is a deck isa_ok( $deck, 'Games::Cards::ShuffleTrack'); # deck has 52 cards is( $deck->deck_size(), 52 ); is( $deck->size(), 52 ); is( $deck->original_size, 52 ); # adding cards increases deck size $deck->put( 'Joker' ); cmp_ok( $deck->size, '>', $deck->original_size ); # removing cards decreases deck size $deck->restart; $deck->take_random; cmp_ok( $deck->size, '<', $deck->original_size ); $deck->restart; is( $deck->size, $deck->original_size ); # deck is face down is( $deck->orientation, 'down' ); # turning the deck face up results in a face up deck and the original top and bottom cards are now reversed $deck->restart; ok( $deck->turn ); is( $deck->orientation, 'up' ); is( $deck->find( $top_card ), 52 ); is( $deck->find( $bottom_card ), 1 ); ok( $deck->turn ); is( $deck->orientation, 'down' ); # deck has 52 cards is( scalar @{$deck->get_deck()}, 52); # all cards are different (only one of each card) my $cards; for my $card ( @{$deck->get_deck()} ) { $cards->{$card}++; }; for my $card (keys %$cards) { is($cards->{$card}, 1); }; # fournier and new_deck_order share the order of diamonds $deck->restart; my $fournier = Games::Cards::ShuffleTrack->new('fournier'); for ( 27 .. 39 ) { is( $deck->find( $_ ), $fournier->find( $_ ) ); } # fournier and new_deck_order don't share the order of hearts, spades and clubs for ( 1 .. 26, 40 .. 52 ) { isnt( $deck->find( $_ ), $fournier->find( $_ ) ); } # empty deck doesn't have cards my $empty_deck = Games::Cards::ShuffleTrack->new( 'empty' ); is_deeply( $empty_deck->get_deck, [] ); # restarting an empty deck results in an empty deck $empty_deck->restart; is_deeply( $empty_deck->get_deck, [] ); # reseting a shuffled deck that started with new_deck order results in a deck in new deck order my $other_new_deck = Games::Cards::ShuffleTrack->new; $deck->riffle_shuffle; $deck->riffle_shuffle; $deck->restart; is_deeply( $deck->get_deck, $other_new_deck->get_deck ); $deck->riffle_shuffle; $deck->restart; is_deeply( $deck->get_deck, $other_new_deck->get_deck ); # creating a pile with just 4 cards works well my $pile = Games::Cards::ShuffleTrack->new( [qw/AC AH AS AD/] ); is( $pile->deck_size, 4 ); is( $pile->find( 1 ), 'AC' ); # final test to see if we can still restart the deck $deck->restart; is_deeply( $deck->get_deck, [@original_deck] );
25.811881
107
0.662447
ed96b1f99ea3a83b3c0f1f5b3f6ad37c5a9889ad
701
pl
Perl
src/test/resources/com/igormaznitsa/prologparser/points_test2.pl
raydac/java-prolog-parser
9eba0ab72656fee1364d39c81c6e0a5f9be8e200
[ "Apache-2.0" ]
8
2015-03-14T12:34:52.000Z
2019-06-26T03:36:15.000Z
src/test/resources/com/igormaznitsa/prologparser/points_test2.pl
raydac/java-prolog-parser
9eba0ab72656fee1364d39c81c6e0a5f9be8e200
[ "Apache-2.0" ]
null
null
null
src/test/resources/com/igormaznitsa/prologparser/points_test2.pl
raydac/java-prolog-parser
9eba0ab72656fee1364d39c81c6e0a5f9be8e200
[ "Apache-2.0" ]
2
2019-06-19T08:16:36.000Z
2019-06-26T03:37:50.000Z
loop(0,_,_):- !. loop(N,List,Rnd):- Rnd <- nextInt returns X, Rnd <- nextInt returns Y, java_object('java.awt.Point', [X,Y], Obj), List <- add(Obj), N1 is N - 1, loop(N1, List, Rnd). print_elements(List,0):-!. print_elements(List,N):-!. List <- get(N) returns Obj, !, stdout <- println(Obj), N1 is N - 1, print_elements(List,N1). test(N) :- class('java.lang.System') <- currentTimeMillis returns T0, java_object('java.util.ArrayList', [], List), java_object('java.util.Random', [], Rnd), loop(N, List, Rnd), List <- size returns Len, Len1 is Len - 1, print_elements(List,Len1), class('java.lang.System') <- currentTimeMillis returns T1, DT is T1 - T0, stdout <- println(DT).
26.961538
59
0.64194
ed3a3fe537daa0f6cfea91c7e624128c2e7db95e
7,633
pm
Perl
os/windows/local/mode/pendingreboot.pm
centreon-lab/centreon-plugins
68096c697a9e1baf89a712674a193d9a9321503c
[ "Apache-2.0" ]
null
null
null
os/windows/local/mode/pendingreboot.pm
centreon-lab/centreon-plugins
68096c697a9e1baf89a712674a193d9a9321503c
[ "Apache-2.0" ]
null
null
null
os/windows/local/mode/pendingreboot.pm
centreon-lab/centreon-plugins
68096c697a9e1baf89a712674a193d9a9321503c
[ "Apache-2.0" ]
null
null
null
# # Copyright 2022 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package os::windows::local::mode::pendingreboot; use base qw(centreon::plugins::templates::counter); use strict; use warnings; use centreon::plugins::misc; use centreon::common::powershell::windows::pendingreboot; use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold); use JSON::XS; sub custom_status_output { my ($self, %options) = @_; return sprintf( "'%s': reboot pending is %s [Windows Update: %s][Component Based Servicing: %s][SCCM Client: %s][File Rename Operations: %s][Computer Name Change: %s]", $self->{result_values}->{WindowsVersion}, $self->{result_values}->{RebootPending}, $self->{result_values}->{WindowsUpdate}, $self->{result_values}->{CBServicing}, $self->{result_values}->{CCMClientSDK}, $self->{result_values}->{PendFileRename}, $self->{result_values}->{PendComputerRename} ); } sub custom_status_calc { my ($self, %options) = @_; $self->{result_values}->{WindowsVersion} = $options{new_datas}->{$self->{instance} . '_WindowsVersion'}; $self->{result_values}->{CBServicing} = $options{new_datas}->{$self->{instance} . '_CBServicing'}; $self->{result_values}->{RebootPending} = $options{new_datas}->{$self->{instance} . '_RebootPending'}; $self->{result_values}->{WindowsUpdate} = $options{new_datas}->{$self->{instance} . '_WindowsUpdate'}; $self->{result_values}->{CCMClientSDK} = $options{new_datas}->{$self->{instance} . '_CCMClientSDK'}; $self->{result_values}->{PendComputerRename} = $options{new_datas}->{$self->{instance} . '_PendComputerRename'}; $self->{result_values}->{PendFileRename} = $options{new_datas}->{$self->{instance} . '_PendFileRename'}; return 0; } sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ { name => 'pendingreboot', type => 0 }, ]; $self->{maps_counters}->{pendingreboot} = [ { label => 'status', , threshold => 0, set => { key_values => [ { name => 'WindowsVersion' }, { name => 'CBServicing' }, { name => 'RebootPending' }, { name => 'WindowsUpdate' }, { name => 'CCMClientSDK' }, { name => 'PendComputerRename' }, { name => 'PendFileRename' } ], closure_custom_calc => $self->can('custom_status_calc'), closure_custom_output => $self->can('custom_status_output'), closure_custom_perfdata => sub { return 0; }, closure_custom_threshold_check => \&catalog_status_threshold } } ]; } sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; $options{options}->add_options(arguments => { 'timeout:s' => { name => 'timeout', default => 50 }, 'command:s' => { name => 'command', default => 'powershell.exe' }, 'command-path:s' => { name => 'command_path' }, 'command-options:s' => { name => 'command_options', default => '-InputFormat none -NoLogo -EncodedCommand' }, 'no-ps' => { name => 'no_ps' }, 'ps-exec-only' => { name => 'ps_exec_only' }, 'ps-display' => { name => 'ps_display' }, 'warning-status:s' => { name => 'warning_status', default => '%{RebootPending} =~ /true/i' }, 'critical-status:s' => { name => 'critical_status', default => '' } }); return $self; } sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); $self->change_macros(macros => ['warning_status', 'critical_status']); } sub manage_selection { my ($self, %options) = @_; if (!defined($self->{option_results}->{no_ps})) { my $ps = centreon::common::powershell::windows::pendingreboot::get_powershell(); if (defined($self->{option_results}->{ps_display})) { $self->{output}->output_add( severity => 'OK', short_msg => $ps ); $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); $self->{output}->exit(); } $self->{option_results}->{command_options} .= " " . centreon::plugins::misc::powershell_encoded($ps); } my ($stdout) = centreon::plugins::misc::execute( output => $self->{output}, options => $self->{option_results}, command => $self->{option_results}->{command}, command_path => $self->{option_results}->{command_path}, command_options => $self->{option_results}->{command_options} ); if (defined($self->{option_results}->{ps_exec_only})) { $self->{output}->output_add( severity => 'OK', short_msg => $stdout ); $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); $self->{output}->exit(); } my $decoded; eval { $decoded = JSON::XS->new->decode($self->{output}->decode($stdout)); }; if ($@) { $self->{output}->add_option_msg(short_msg => "Cannot decode json response: $@"); $self->{output}->option_exit(); } #{ WindowsVersion: "Microsoft Windows 2003 Server", CBServicing: false, WindowsUpdate: false, CCMClientSDK: null, PendComputerRename: false, PendFileRename: false, PendFileRenVal: null, RebootPending: false } foreach (keys %$decoded) { $decoded->{$_} = '-' if (!defined($decoded->{$_})); $decoded->{$_} = 'true' if ($decoded->{$_} =~ /^(?:true|1)$/i); $decoded->{$_} = 'false' if ($decoded->{$_} =~ /^(?:false|0)$/i); } $self->{pendingreboot} = $decoded; } 1; __END__ =head1 MODE Check windows pending reboot. =over 8 =item B<--timeout> Set timeout time for command execution (Default: 50 sec) =item B<--no-ps> Don't encode powershell. To be used with --command and 'type' command. =item B<--command> Command to get information (Default: 'powershell.exe'). Can be changed if you have output in a file. To be used with --no-ps option!!! =item B<--command-path> Command path (Default: none). =item B<--command-options> Command options (Default: '-InputFormat none -NoLogo -EncodedCommand'). =item B<--ps-display> Display powershell script. =item B<--ps-exec-only> Print powershell output. =item B<--warning-status> Set warning threshold for status (Default: '%{RebootPending} =~ /true/i'). Can used special variables like: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, %{PendFileRename}, %{PendComputerRename}. =item B<--critical-status> Set critical threshold for status (Default: ''). Can used special variables like: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, %{PendFileRename}, %{PendComputerRename}. =back =cut
35.668224
212
0.617451
eda0001c685534c225e370cb1ae37d81677396be
3,912
t
Perl
t/001_mouse/024-isa.t
gluesys/p5-Mouse
b3805f0444a98a4c746e427ebf668a8189ca0f3c
[ "Artistic-1.0" ]
21
2015-05-13T04:45:53.000Z
2019-07-25T09:43:23.000Z
t/001_mouse/024-isa.t
gluesys/p5-Mouse
b3805f0444a98a4c746e427ebf668a8189ca0f3c
[ "Artistic-1.0" ]
48
2015-01-19T11:01:58.000Z
2019-08-13T09:48:13.000Z
t/001_mouse/024-isa.t
gluesys/p5-Mouse
b3805f0444a98a4c746e427ebf668a8189ca0f3c
[ "Artistic-1.0" ]
20
2015-03-02T04:21:52.000Z
2019-08-14T03:02:00.000Z
#!/usr/bin/env perl use strict; use warnings; use Test::More; use Test::Exception; use IO::Handle; my @types = qw/Any Item Bool Undef Defined Value Num Int Str ClassName Ref ScalarRef ArrayRef HashRef CodeRef RegexpRef GlobRef FileHandle Object/; my @type_values = ( undef , [qw/Any Item Undef Bool/], 0 => [qw/Any Item Defined Bool Value Num Int Str/], 1 => [qw/Any Item Defined Bool Value Num Int Str/], 42 => [qw/Any Item Defined Value Num Int Str/], 1.5 => [qw/Any Item Defined Value Num Str/], '' => [qw/Any Item Defined Bool Value Str/], '0' => [qw/Any Item Defined Bool Value Num Int Str/], '1' => [qw/Any Item Defined Bool Value Num Int Str/], '42' => [qw/Any Item Defined Value Num Int Str/], '1.5' => [qw/Any Item Defined Value Num Str/], 't' => [qw/Any Item Defined Value Str/], 'f' => [qw/Any Item Defined Value Str/], 'undef' => [qw/Any Item Defined Value Str/], 'Test::More' => [qw/Any Item Defined Value Str ClassName/], \undef => [qw/Any Item Defined Ref ScalarRef/], \1 => [qw/Any Item Defined Ref ScalarRef/], \"foo" => [qw/Any Item Defined Ref ScalarRef/], [], => [qw/Any Item Defined Ref ArrayRef/], [undef, \1] => [qw/Any Item Defined Ref ArrayRef/], {} => [qw/Any Item Defined Ref HashRef/], sub { die } => [qw/Any Item Defined Ref CodeRef/], qr/.*/ => [qw/Any Item Defined Ref RegexpRef/], \*main::ok => [qw/Any Item Defined Ref GlobRef/], \*STDOUT => [qw/Any Item Defined Ref GlobRef FileHandle/], IO::Handle->new => [qw/Any Item Defined Ref Object FileHandle/], Test::Builder->new => [qw/Any Item Defined Ref Object/], ); my %values_for_type; for (my $i = 1; $i < @type_values; $i += 2) { my ($value, $valid_types) = @type_values[$i-1, $i]; my %is_invalid = map { $_ => 1 } @types; delete @is_invalid{@$valid_types}; push @{ $values_for_type{$_}{invalid} }, $value for grep { $is_invalid{$_} } @types; push @{ $values_for_type{$_}{valid} }, $value for grep { !$is_invalid{$_} } @types; } do { package Class; use Mouse; for my $type (@types) { has $type => ( is => 'rw', isa => $type, ); } }; can_ok(Class => @types); for my $type (@types) { note "For $type"; for my $value (@{ $values_for_type{$type}{valid} }) { lives_ok { my $via_new = Class->new($type => $value); is_deeply($via_new->$type, $value, "correctly set a $type in the constructor"); } or die; lives_ok { my $via_set = Class->new; is($via_set->$type, undef, "initially unset"); $via_set->$type($value); is_deeply($via_set->$type, $value, "correctly set a $type in the setter"); } or die; } for my $value (@{ $values_for_type{$type}{invalid} }) { my $display = defined($value) ? overload::StrVal($value) : 'undef'; my $via_new; throws_ok { $via_new = Class->new($type => $value); } qr/Attribute \($type\) does not pass the type constraint because: Validation failed for '$type' with value \Q$display\E/; is($via_new, undef, "no object created") or die; my $via_set = Class->new; throws_ok { $via_set->$type($value); } qr/Attribute \($type\) does not pass the type constraint because: Validation failed for '$type' with value \Q$display\E/; is($via_set->$type, undef, "value for $type not set") or die; } } done_testing;
38.352941
131
0.525562
ed88fd0d8d0ea5f9bde4144ac3ca6241c651eb5d
2,817
t
Perl
stats/tests/stats.t
rianoc/ml
75d3bd514703643ad7cf58dec960b05bd90e8b5d
[ "Apache-2.0" ]
51
2018-11-05T23:43:27.000Z
2022-03-12T07:26:05.000Z
stats/tests/stats.t
rianoc/ml
75d3bd514703643ad7cf58dec960b05bd90e8b5d
[ "Apache-2.0" ]
6
2018-10-17T10:11:12.000Z
2021-07-28T10:22:24.000Z
stats/tests/stats.t
rianoc/ml
75d3bd514703643ad7cf58dec960b05bd90e8b5d
[ "Apache-2.0" ]
27
2018-10-04T09:34:12.000Z
2022-01-02T05:32:06.000Z
\l ml.q \l util/init.q \l stats/init.q \l fresh/init.q np:.p.import[`numpy] ols:.p.import[`statsmodels.api]`:OLS wls:.p.import[`statsmodels.api]`:WLS x:1000?1000 xf:1000?100f plaintab:([]4 5 6.;1 2 3.;-1 -2 -3.;0.4 0.5 0.6) plaintabn:plaintab,'([]x4:1 3 0n) plaintabn2:plaintab,'([]x4:`a`a`b) symTab:([]`a`a`a`b`b`c;101011b) symTab2:([]"abbcca";"x"$til 6) timeTab:([]"p"$til 5;"z"$1 3 2 2 1) .ml.stats.percentile[x;0.75]~np[`:percentile][x;75]` .ml.stats.percentile[x;0.02]~np[`:percentile][x;2]` .ml.stats.percentile[xf;0.5]~np[`:percentile][xf;50]` .ml.stats.percentile[3 0n 4 4 0n 4 4 3 3 4;0.5]~4.0 descKeys:`count`mean`std`min`q1`q2`q3`max keySym:`count`type`nulls`countDistinct`mode`freq temporalKeys:`count`type`min`max`nulls`range`countDistinct`mode`freq .ml.stats.describe[symTab]~flip `x`x1!flip keySym!(6 6;`symbol`boolean;0 0i;3 2;(`a;1b);1 2) .ml.stats.describe[symTab2]~flip `x`x1!flip keySym!(6 6;`char`byte;0 0i;3 6;("a";0x00);2 1) .ml.stats.describe[timeTab]~flip `x`x1!flip temporalKeys!(5 5;`timestamp`datetime;("p"$0;"z"$1);("p"$4;"z"$3);0 0i;(0D00:00:00.000000004;2f);5 3;("p"$0;"z"$1);1 1) .ml.stats.describeFuncs:descKeys!.ml.stats.describeFuncs[descKeys] ("f"$flip value .ml.stats.describe[plaintab])~flip .ml.df2tab .p.import[`pandas][`:DataFrame.describe][.ml.tab2df[plaintab]] ("f"$flip value .ml.stats.describe[plaintabn])~flip (.ml.df2tab .p.import[`pandas][`:DataFrame.describe][.ml.tab2df[plaintab]]),'"f"$([]x4:3 2,sdev[1 3 0n],1 1.5 2 2.5 3) all all(flip value .ml.stats.describe[plaintabn2])=flip (.ml.df2tab .p.import[`pandas][`:DataFrame.describe][.ml.tab2df[plaintab]]),'([]x4:3f,7#(::)) vec1: 6 2 5 1 9 2 4 vec2:1 9 7 2 3 4 1 mdlOLS1:.ml.stats.OLS.fit[7+2*til 10;til 10;1b] mdlOLS2:.ml.stats.OLS.fit[7+2*til 10;til 10;0b] mdlOLS3:.ml.stats.OLS.fit[vec2;vec1;0b] mdlOLS1.modelInfo.coef~ols[7+2*til 10;1f,'til 10][`:fit][][`:params]` mdlOLS2.modelInfo.coef~ols[7+2*til 10;til 10][`:fit][][`:params]` mdlOLS3.modelInfo.coef~ols[vec2;vec1][`:fit][][`:params]` mdlOLS1.predict[vec1]~19 11 17 9 25 11 15f mdlOLS2.predict[7+2*til 10]~ols[7+2*til 10;til 10][`:fit][][`:predict][7+2*til 10]` mdlOLS3.predict[vec2]~ols[vec2;vec1][`:fit][][`:predict][vec2]` mdlWLS1:.ml.stats.WLS.fit[7+2*til 10;til 10;(5#1),(5#2);1b] mdlWLS2:.ml.stats.WLS.fit[7+2*til 10;til 10;(5#1),(5#2);0b] mdlWLS3:.ml.stats.WLS.fit[vec2;vec1;til count vec1;0b] mdlWLS1.modelInfo.coef~wls[7+2*til 10;1f,'til 10;(5#1),(5#2)][`:fit][][`:params]` mdlWLS2.modelInfo.coef~wls[7+2*til 10;til 10;(5#1),(5#2)][`:fit][][`:params]` mdlWLS3.modelInfo.coef~wls[vec2;vec1;til count vec1][`:fit][][`:params]` mdlWLS1.predict[vec2]~9 25 21 11 13 15 9f mdlWLS2.predict[7+2*til 10]~wls[7+2*til 10;til 10;(5#1),(5#2)][`:fit][][`:predict][7+2*til 10]` mdlWLS3.predict[vec2]~wls[vec2;vec1;til count vec1][`:fit][][`:predict][vec2]`
49.421053
170
0.673056
ed9582f8c30576f37654020c69766f1ed9f3437a
4,807
pl
Perl
webapp/perl/local/lib/perl5/auto/share/dist/DateTime-Locale/kea-CV.pl
AK-10/AK-10-isucon8-preliminary-revenge
f390710721b2f2e3d9f60120394ec37c9c96b975
[ "MIT" ]
2
2019-04-15T04:28:23.000Z
2019-04-16T12:45:51.000Z
webapp/perl/local/lib/perl5/auto/share/dist/DateTime-Locale/kea-CV.pl
AK-10/AK-10-isucon8-preliminary-revenge
f390710721b2f2e3d9f60120394ec37c9c96b975
[ "MIT" ]
16
2019-08-28T23:45:01.000Z
2019-12-20T02:12:13.000Z
webapp/perl/local/lib/perl5/auto/share/dist/DateTime-Locale/kea-CV.pl
AK-10/AK-10-isucon8-preliminary-revenge
f390710721b2f2e3d9f60120394ec37c9c96b975
[ "MIT" ]
1
2019-04-14T01:11:20.000Z
2019-04-14T01:11:20.000Z
{ am_pm_abbreviated => [ "am", "pm", ], available_formats => { Bh => "h B", Bhm => "h:mm B", Bhms => "h:mm:ss B", E => "ccc", EBhm => "E h:mm B", EBhms => "E h:mm:ss B", EHm => "E, HH:mm", EHms => "E, HH:mm:ss", Ed => "E, d", Ehm => "E, h:mm a", Ehms => "E, h:mm:ss a", Gy => "y G", GyMMM => "MMM y G", GyMMMEd => "E, d MMM y G", GyMMMd => "d MMM y G", H => "HH", Hm => "HH:mm", Hms => "HH:mm:ss", Hmsv => "HH:mm:ss (v)", Hmv => "HH:mm (v)", M => "L", MEd => "E, dd/MM", MMM => "LLL", MMMEd => "E, d MMM", MMMMEd => "E, d 'di' MMMM", "MMMMW-count-other" => "'week' W 'of' MMMM", MMMMd => "d 'di' MMMM", MMMd => "d MMM", MMdd => "dd/MM", Md => "dd/MM", d => "d", h => "h a", hm => "h:mm a", hms => "h:mm:ss a", hmsv => "h:mm:ss a (v)", hmv => "h:mm a (v)", mmss => "mm:ss", ms => "mm:ss", y => "y", yM => "MM/y", yMEd => "E, dd/MM/y", yMM => "MM/y", yMMM => "MMM y", yMMMEd => "E, d MMM y", yMMMM => "MMMM 'di' y", yMMMd => "d MMM y", yMd => "dd/MM/y", yQQQ => "QQQ y", yQQQQ => "QQQQ 'di' y", "yw-count-other" => "'week' w 'of' Y", }, code => "kea-CV", date_format_full => "EEEE, d 'di' MMMM 'di' y", date_format_long => "d 'di' MMMM 'di' y", date_format_medium => "d MMM y", date_format_short => "d/M/y", datetime_format_full => "{1} {0}", datetime_format_long => "{1} {0}", datetime_format_medium => "{1} {0}", datetime_format_short => "{1} {0}", day_format_abbreviated => [ "sig", "ter", "kua", "kin", "ses", "sab", "dum", ], day_format_narrow => [ "S", "T", "K", "K", "S", "S", "D", ], day_format_wide => [ "sigunda-fera", "tersa-fera", "kuarta-fera", "kinta-fera", "sesta-fera", "sabadu", "dumingu", ], day_stand_alone_abbreviated => [ "sig", "ter", "kua", "kin", "ses", "sab", "dum", ], day_stand_alone_narrow => [ "S", "T", "K", "K", "S", "S", "D", ], day_stand_alone_wide => [ "sigunda-fera", "tersa-fera", "kuarta-fera", "kinta-fera", "sesta-fera", "s\N{U+00e1}badu", "dumingu", ], era_abbreviated => [ "AK", "DK", ], era_narrow => [ "AK", "DK", ], era_wide => [ "Antis di Kristu", "Dispos di Kristu", ], first_day_of_week => 1, glibc_date_1_format => "%a %b %e %H:%M:%S %Z %Y", glibc_date_format => "%m/%d/%y", glibc_datetime_format => "%a %b %e %H:%M:%S %Y", glibc_time_12_format => "%I:%M:%S %p", glibc_time_format => "%H:%M:%S", language => "Kabuverdianu", month_format_abbreviated => [ "Jan", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Otu", "Nuv", "Diz", ], month_format_narrow => [ "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D", ], month_format_wide => [ "Janeru", "Febreru", "Marsu", "Abril", "Maiu", "Junhu", "Julhu", "Agostu", "Setenbru", "Otubru", "Nuvenbru", "Dizenbru", ], month_stand_alone_abbreviated => [ "Jan", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Otu", "Nuv", "Diz", ], month_stand_alone_narrow => [ "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D", ], month_stand_alone_wide => [ "Janeru", "Febreru", "Marsu", "Abril", "Maiu", "Junhu", "Julhu", "Agostu", "Setenbru", "Otubru", "Nuvenbru", "Dizenbru", ], name => "Kabuverdianu Cape Verde", native_language => "kabuverdianu", native_name => "kabuverdianu Kabu Verdi", native_script => undef, native_territory => "Kabu Verdi", native_variant => undef, quarter_format_abbreviated => [ "T1", "T2", "T3", "T4", ], quarter_format_narrow => [ 1, 2, 3, 4, ], quarter_format_wide => [ "1\N{U+00ba} trimestri", "2\N{U+00ba} trimestri", "3\N{U+00ba} trimestri", "4\N{U+00ba} trimestri", ], quarter_stand_alone_abbreviated => [ "T1", "T2", "T3", "T4", ], quarter_stand_alone_narrow => [ 1, 2, 3, 4, ], quarter_stand_alone_wide => [ "1\N{U+00ba} trimestri", "2\N{U+00ba} trimestri", "3\N{U+00ba} trimestri", "4\N{U+00ba} trimestri", ], script => undef, territory => "Cape Verde", time_format_full => "HH:mm:ss zzzz", time_format_long => "HH:mm:ss z", time_format_medium => "HH:mm:ss", time_format_short => "HH:mm", variant => undef, version => 33, }
17.48
51
0.450385
ed85c99bc0fb412b93b5a1ea2bcc7810bc8a15f0
3,400
t
Perl
t/RPM/Grill/Plugin/Manifest/60perms.t
default-to-open/rpmgrill
7031b60bf40c5679c8f50d9a5e1a55f4bcedf9e9
[ "Artistic-2.0" ]
7
2015-05-27T01:36:22.000Z
2021-08-24T09:35:15.000Z
t/RPM/Grill/Plugin/Manifest/60perms.t
default-to-open/rpmgrill
7031b60bf40c5679c8f50d9a5e1a55f4bcedf9e9
[ "Artistic-2.0" ]
17
2015-07-01T06:50:57.000Z
2019-04-17T18:59:56.000Z
t/RPM/Grill/Plugin/Manifest/60perms.t
default-to-open/rpmgrill
7031b60bf40c5679c8f50d9a5e1a55f4bcedf9e9
[ "Artistic-2.0" ]
10
2015-06-30T11:44:55.000Z
2018-05-24T18:33:52.000Z
# -*- perl -*- # # tests for the permissions check in Manifest module # use strict; use warnings; use Test::More; use Test::Differences; use File::Temp qw(tempdir); use lib "t/lib"; use FakeTree; # pass 1: read DATA my @tests = FakeTree::read_tests( *DATA ); #use Data::Dumper;print Dumper(\@tests);exit 0; plan tests => 3 + @tests; # Pass 2: do the tests my $tempdir = tempdir("t-SecurityPolicy.XXXXXX", CLEANUP => !$ENV{DEBUG}); # Tests 1-3 : load our modules. If any of these fail, abort. use_ok 'RPM::Grill' or exit; use_ok 'RPM::Grill::RPM' or exit; use_ok 'RPM::Grill::Plugin::Manifest' or exit; ############################################################################### # BEGIN override ->nvr() package RPM::Grill::RPM; use subs qw(nvr); package RPM::Grill; use subs qw(major_release); package main; # Set a fake NVR { no warnings 'redefine'; *RPM::Grill::RPM::nvr = sub { return "1.el7"; }; *RPM::Grill::major_release = sub { return "RHEL7"; }; } # END override ->nvr() ############################################################################### for my $i (0 .. $#tests) { my $t = $tests[$i]; # Create new tempdir for this individual test my $temp_subdir = sprintf("%s/%02d", $tempdir, $i); my $g = FakeTree::make_fake_tree( $temp_subdir, $t->{setup} ); my $expected_gripes; if ($t->{expect}) { $expected_gripes = eval "{ Manifest => [ $t->{expect} ] }"; die "eval failed:\n\n $t->{gripe_string} \n\n $@\n" if $@; } bless $g, 'RPM::Grill::Plugin::Manifest'; $g->analyze(); eq_or_diff $g->{gripes}, $expected_gripes, $t->{name}; } __DATA__ --------owned-by-root------------------------------------------- >> -rw-r--r-- root root 0 /noarch/mypkg/usr/bin/foo -------not-in-bin-dir------------------------------------------- >> -rw-r--r-- badusr badgrp 0 /noarch/mypkg/usr/lib/foo >> -rw-r--r-- badusr badgrp 0 /noarch/mypkg/usr/share/bin/foo -------owned-by-foo--------------------------------------- >> -rw-r--r-- foo root 0 /noarch/mypkg/usr/bin/foo ...expect: { arch => 'noarch', code => 'BinfileBadOwner', context => { path => '/usr/bin/foo' }, diag => 'Owned by \'<tt>foo</tt>\'; files in /usr/bin must be owned by root', subpackage => 'mypkg' } -------group-badgrp--------------------------------------- >> -rw-r--r-- root badgrp 0 /noarch/mypkg/usr/bin/foo ...expect: { arch => 'noarch', code => 'BinfileBadGroup', context => { path => '/usr/bin/foo' }, diag => 'Owned by group \'<tt>badgrp</tt>\'; files in /usr/bin must be group \'root\'', subpackage => 'mypkg' } -------both-bad--------------------------------------- >> -rw-r--r-- badusr badgrp 0 /noarch/mypkg/usr/sbin/foo ...expect: { arch => 'noarch', code => 'BinfileBadOwner', context => { path => '/usr/sbin/foo' }, diag => 'Owned by \'<tt>badusr</tt>\'; files in /usr/sbin must be owned by root', subpackage => 'mypkg' }, { arch => 'noarch', code => 'BinfileBadGroup', context => { path => '/usr/sbin/foo' }, diag => 'Owned by group \'<tt>badgrp</tt>\'; files in /usr/sbin must be group \'root\'', subpackage => 'mypkg' }
23.943662
94
0.491471
ed4ad57376a8d0ed3aec4a30c6860256730631dc
1,166
pm
Perl
plugins/MediaManager/extlib/Net/Amazon/Validate/ItemSearch/de/Brand.pm
byrnereese/mt-plugin-mediamanager
79940b6bee5f8af9fc28040d253fb6734e5d9ea3
[ "ClArtistic" ]
null
null
null
plugins/MediaManager/extlib/Net/Amazon/Validate/ItemSearch/de/Brand.pm
byrnereese/mt-plugin-mediamanager
79940b6bee5f8af9fc28040d253fb6734e5d9ea3
[ "ClArtistic" ]
1
2019-03-18T15:24:41.000Z
2019-03-18T15:24:41.000Z
plugins/MediaManager/extlib/Net/Amazon/Validate/ItemSearch/de/Brand.pm
byrnereese/mt-plugin-mediamanager
79940b6bee5f8af9fc28040d253fb6734e5d9ea3
[ "ClArtistic" ]
null
null
null
# -*- perl -*- # !!! DO NOT EDIT !!! # This file was automatically generated. package Net::Amazon::Validate::ItemSearch::de::Brand; use 5.006; use strict; use warnings; sub new { my ($class , %options) = @_; my $self = { '_default' => 'Apparel', %options, }; push @{$self->{_options}}, 'Apparel'; push @{$self->{_options}}, 'Baby'; push @{$self->{_options}}, 'Kitchen'; bless $self, $class; } sub user_or_default { my ($self, $user) = @_; if (defined $user && length($user) > 0) { return $self->find_match($user); } return $self->default(); } sub default { my ($self) = @_; return $self->{_default}; } sub find_match { my ($self, $value) = @_; for (@{$self->{_options}}) { return $_ if lc($_) eq lc($value); } die "$value is not a valid value for de::Brand!\n"; } 1; __END__ =head1 NAME Net::Amazon::Validate::ItemSearch::de::Brand - valid search indices for the de locale and the Brand operation. =head1 DESCRIPTION The default value is Apparel, unless mode is specified. The list of available values are: Apparel Baby Kitchen =cut
18.21875
110
0.58319
ed7b179b14d9053527768c9d5b6e5c00ac5ec248
3,154
pm
Perl
auto-lib/Paws/Transcribe/ListTranscriptionJobs.pm
galenhuntington/aws-sdk-perl
13b775dcb5f0b3764f0a82f3679ed5c7721e67d3
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/Transcribe/ListTranscriptionJobs.pm
galenhuntington/aws-sdk-perl
13b775dcb5f0b3764f0a82f3679ed5c7721e67d3
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/Transcribe/ListTranscriptionJobs.pm
galenhuntington/aws-sdk-perl
13b775dcb5f0b3764f0a82f3679ed5c7721e67d3
[ "Apache-2.0" ]
null
null
null
package Paws::Transcribe::ListTranscriptionJobs; use Moose; has JobNameContains => (is => 'ro', isa => 'Str'); has MaxResults => (is => 'ro', isa => 'Int'); has NextToken => (is => 'ro', isa => 'Str'); has Status => (is => 'ro', isa => 'Str'); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'ListTranscriptionJobs'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Transcribe::ListTranscriptionJobsResponse'); class_has _result_key => (isa => 'Str', is => 'ro'); 1; ### main pod documentation begin ### =head1 NAME Paws::Transcribe::ListTranscriptionJobs - Arguments for method ListTranscriptionJobs on L<Paws::Transcribe> =head1 DESCRIPTION This class represents the parameters used for calling the method ListTranscriptionJobs on the L<Amazon Transcribe Service|Paws::Transcribe> service. Use the attributes of this class as arguments to method ListTranscriptionJobs. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to ListTranscriptionJobs. =head1 SYNOPSIS my $transcribe = Paws->service('Transcribe'); my $ListTranscriptionJobsResponse = $transcribe->ListTranscriptionJobs( JobNameContains => 'MyTranscriptionJobName', # OPTIONAL MaxResults => 1, # OPTIONAL NextToken => 'MyNextToken', # OPTIONAL Status => 'IN_PROGRESS', # OPTIONAL ); # Results: my $NextToken = $ListTranscriptionJobsResponse->NextToken; my $Status = $ListTranscriptionJobsResponse->Status; my $TranscriptionJobSummaries = $ListTranscriptionJobsResponse->TranscriptionJobSummaries; # Returns a L<Paws::Transcribe::ListTranscriptionJobsResponse> object. Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/transcribe/ListTranscriptionJobs> =head1 ATTRIBUTES =head2 JobNameContains => Str When specified, the jobs returned in the list are limited to jobs whose name contains the specified string. =head2 MaxResults => Int The maximum number of jobs to return in the response. If there are fewer results in the list, this response contains only the actual results. =head2 NextToken => Str If the result of the previous request to C<ListTranscriptionJobs> was truncated, include the C<NextToken> to fetch the next set of jobs. =head2 Status => Str When specified, returns only transcription jobs with the specified status. Valid values are: C<"IN_PROGRESS">, C<"FAILED">, C<"COMPLETED"> =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method ListTranscriptionJobs in L<Paws::Transcribe> =head1 BUGS and CONTRIBUTIONS The source code is located here: L<https://github.com/pplu/aws-sdk-perl> Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> =cut
32.854167
249
0.718136
ed2040c8831b5a0380a3f5db7e134471a7822813
987
t
Perl
t/01-basic.t
kentnl/Dist-Zilla-Plugin-Prereqs-MatchInstalled-All
cce52f55a0803f5acea8341180c7dd03bd8f873b
[ "Artistic-1.0" ]
null
null
null
t/01-basic.t
kentnl/Dist-Zilla-Plugin-Prereqs-MatchInstalled-All
cce52f55a0803f5acea8341180c7dd03bd8f873b
[ "Artistic-1.0" ]
null
null
null
t/01-basic.t
kentnl/Dist-Zilla-Plugin-Prereqs-MatchInstalled-All
cce52f55a0803f5acea8341180c7dd03bd8f873b
[ "Artistic-1.0" ]
null
null
null
use strict; use warnings; use Test::More; use Test::DZil qw( simple_ini Builder ); my $zilla = Builder->from_config( { dist_root => 'invalid' }, { add_files => { 'source/dist.ini' => simple_ini( [ 'Prereqs' => { 'Moose' => 0 } ], # ['Prereqs::MatchInstalled::All'], ['MetaConfig'], # ), } } ); $zilla->chrome->logger->set_debug(1); $zilla->build; ok( exists $zilla->distmeta->{prereqs}, '->prereqs' ) and ok( exists $zilla->distmeta->{prereqs}->{runtime}, '->prereqs/runtime' ) and ok( exists $zilla->distmeta->{prereqs}->{runtime}->{requires}, '->prereqs/runtime/requires' ) and ok( exists $zilla->distmeta->{prereqs}->{runtime}->{requires}->{Moose}, '->prereqs/runtime/requires/Moose' ) and cmp_ok( $zilla->distmeta->{prereqs}->{runtime}->{requires}->{Moose}, 'ne', '0', "Moose != 0" ); note explain $zilla->distmeta; note explain $zilla->log_messages; done_testing;
30.84375
114
0.580547
ed7f8439ab247268b0e96844e9505161c75ccee3
1,308
t
Perl
demo/return-test.t
TOPLLab/gaiwan
8123efdaf4944ed6c339d893db37f8c920e91ae9
[ "BSD-3-Clause" ]
3
2021-04-12T11:43:30.000Z
2022-03-01T18:37:31.000Z
demo/return-test.t
TOPLLab/gaiwan
8123efdaf4944ed6c339d893db37f8c920e91ae9
[ "BSD-3-Clause" ]
2
2021-03-30T08:30:45.000Z
2021-04-14T12:35:03.000Z
demo/return-test.t
TOPLLab/gaiwan
8123efdaf4944ed6c339d893db37f8c920e91ae9
[ "BSD-3-Clause" ]
null
null
null
abstraction bitonic_select(round:int , arrPerBlock:int) { shaper split(i,d:C[2*n]) : tuple(C,C)[n] { let blockid = i/arrPerBlock in let blockstart = blockid * arrPerBlock * 2 in let blockoffset = i % arrPerBlock in let pos = blockstart + blockoffset in tuple(d[pos],d[pos+arrPerBlock]) } | mapper bitonic_select_impl(i, a:tuple(int,int)) : tuple(int, int) { if((i%(2^(round+1))) < (2^round)){ if(a[[0]] < a[[1]]) {a} else {tuple(a[[1]],a[[0]])} } else { -- lower half if(a[[0]] < a[[1]]) {tuple(a[[1]],a[[0]])} else {a} } } | shaper join(i,d:tuple(B,B)[n]) : B[2*n] { let arrowBlock = i/(2*arrPerBlock) in let arrowBlockStart = arrowBlock * arrPerBlock in let arrowOffset = i % arrPerBlock in let arrow = d[arrowBlock * arrPerBlock + arrowOffset] in if(arrowBlockStart*2+arrPerBlock < i){ arrow[[0]] }else{ arrow[[1]] } } } abstraction randomizer() { shaper randomizer(i) : int[n]{ (i * 593) % 1000 } } let h = { @fresh(33554432) | randomizer() } in {return h} | 25:round { (round+1):step { bitonic_select(round,2^(round - step)) } }
32.7
71
0.511468
73e71113c78dc15e027887b6ebb255db6e0afaa2
1,032
pm
Perl
fatlib/Date/Manip/TZ/etgmt00.pm
bokutin/RecordStream
580c0957042c5005b41056ee1dd6ae6a8d614c56
[ "Artistic-1.0" ]
142
2015-01-23T18:35:10.000Z
2022-02-02T12:07:31.000Z
fatlib/Date/Manip/TZ/etgmt00.pm
bokutin/RecordStream
580c0957042c5005b41056ee1dd6ae6a8d614c56
[ "Artistic-1.0" ]
30
2015-01-08T18:15:47.000Z
2020-06-29T18:59:40.000Z
fatlib/Date/Manip/TZ/etgmt00.pm
bokutin/RecordStream
580c0957042c5005b41056ee1dd6ae6a8d614c56
[ "Artistic-1.0" ]
15
2015-01-23T01:15:24.000Z
2021-06-16T19:14:11.000Z
package # Date::Manip::TZ::etgmt00; # Copyright (c) 2008-2014 Sullivan Beck. All rights reserved. # This program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # This file was automatically generated. Any changes to this file will # be lost the next time 'tzdata' is run. # Generated on: Thu Aug 21 13:06:11 EDT 2014 # Data version: tzdata2014f # Code version: tzcode2014f # This module contains data from the zoneinfo time zone database. The original # data was obtained from the URL: # ftp://ftp.iana.org/tz use strict; use warnings; require 5.010000; our (%Dates,%LastRule); END { undef %Dates; undef %LastRule; } our ($VERSION); $VERSION='6.47'; END { undef $VERSION; } %Dates = ( 1 => [ [ [1,1,2,0,0,0],[1,1,2,0,0,0],'+00:00:00',[0,0,0], 'GMT',0,[9999,12,31,0,0,0],[9999,12,31,0,0,0], '0001010200:00:00','0001010200:00:00','9999123100:00:00','9999123100:00:00' ], ], ); %LastRule = ( ); 1;
23.454545
88
0.632752
ed589079dd326e4f5bf538ece1bd76fb21f32f01
40,977
pm
Perl
Slim/Plugin/RandomPlay/Plugin.pm
raptor2101/slimserver
3d9a513bd80793d7da7408e533bfd99a03869918
[ "BSD-3-Clause" ]
null
null
null
Slim/Plugin/RandomPlay/Plugin.pm
raptor2101/slimserver
3d9a513bd80793d7da7408e533bfd99a03869918
[ "BSD-3-Clause" ]
null
null
null
Slim/Plugin/RandomPlay/Plugin.pm
raptor2101/slimserver
3d9a513bd80793d7da7408e533bfd99a03869918
[ "BSD-3-Clause" ]
null
null
null
package Slim::Plugin::RandomPlay::Plugin; # Originally written by Kevin Deane-Freeman (slim-mail (A_t) deane-freeman.com). # New world order by Dan Sully - <dan | at | slimdevices.com> # Fairly substantial rewrite by Max Spicer # This code is derived from code with the following copyright message: # # Logitech Media Server Copyright 2005-2016 Logitech. # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License, # version 2. use strict; use base qw(Slim::Plugin::Base); use Slim::Buttons::Home; use Slim::Music::VirtualLibraries; use Slim::Player::ProtocolHandlers; use Slim::Utils::Alarm; use Slim::Utils::Cache; use Slim::Utils::Log; use Slim::Utils::Misc; use Slim::Utils::Strings qw(string cstring); use Slim::Utils::Prefs; use Slim::Player::Sync; use constant MENU_WEIGHT => 60; # playlist commands that will stop random play my $stopcommands = [ 'clear', 'loadtracks', # multiple play 'playtracks', # single play 'load', # old style url load (no play) 'play', # old style url play 'loadalbum', # old style multi-item load 'playalbum', # old style multi-item play ]; # map CLI command args to internal mix types my %mixTypeMap = ( 'tracks' => 'track', 'contributors' => 'contributor', 'albums' => 'album', 'year' => 'year', 'artists' => 'contributor', ); my @mixTypes = ('track', 'contributor', 'album', 'year'); # Genres for each client (don't access this directly - use getGenres()) my $genres; my $functions; my $htmlTemplate = 'plugins/RandomPlay/list.html'; my $log = Slim::Utils::Log->addLogCategory({ 'category' => 'plugin.randomplay', 'defaultLevel' => 'ERROR', 'description' => __PACKAGE__->getDisplayName(), }); my $prefs = preferences('plugin.randomplay'); my $cache; my $initialized = 0; $prefs->migrate( 1, sub { require Slim::Utils::Prefs::OldPrefs; my $newtracks = Slim::Utils::Prefs::OldPrefs->get('plugin_random_number_of_tracks'); if ( !defined $newtracks ) { $newtracks = 10; } my $continuous = Slim::Utils::Prefs::OldPrefs->get('plugin_random_keep_adding_tracks'); if ( !defined $continuous ) { $continuous = 1; } my $oldtracks = Slim::Utils::Prefs::OldPrefs->get('plugin_random_number_of_old_tracks'); if ( !defined $oldtracks ) { $oldtracks = 10; } $prefs->set( 'newtracks', $newtracks ); $prefs->set( 'oldtracks', $oldtracks ); $prefs->set( 'continuous', $continuous ); $prefs->set( 'exclude_genres', Slim::Utils::Prefs::OldPrefs->get('plugin_random_exclude_genres') || [] ); 1; } ); $prefs->setChange(sub { my $new = $_[1]; my $old = $_[3]; # let's verify whether the list actually has changed my $dirty; if (scalar @$new != scalar @$old) { $dirty = 1; } else { my %old = map { $_ => 1 } @$old; foreach (@$new) { if (!$old{$_}) { $dirty = 1; last; } } } # only wipe player's idList if the genre list has changed _resetCache() if $dirty; $genres = undef; }, 'exclude_genres'); $prefs->setChange(\&_resetCache, 'library'); sub _resetCache { return unless $cache; foreach ( Slim::Player::Client::clients() ) { $cache->remove('rnd_idList_' . $_->id); $cache->remove('rnd_years_' . $_->id); } } $prefs->setValidate({ 'validator' => 'intlimit', 'low' => 1, 'high' => 100 }, 'newtracks' ); sub weight { MENU_WEIGHT } sub initPlugin { my $class = shift; $genres = undef; # Regenerate the genre map after a rescan. Slim::Control::Request::subscribe(\&_libraryChanged, [['library','rescan'], ['changed','done']]); return if $initialized || !Slim::Schema::hasLibrary(); $initialized = 1; # create function map if (!$functions) { foreach (keys %mixTypeMap) { my $type = $mixTypeMap{$_}; $functions->{$_} = sub { playRandom(shift, $type); } } } $class->SUPER::initPlugin(); # set up our subscription Slim::Control::Request::subscribe(\&commandCallback, [['playlist'], ['newsong', 'delete', @$stopcommands]]); # |requires Client # | |is a Query # | | |has Tags # | | | |Function to call # C Q T F Slim::Control::Request::addDispatch(['randomplay', '_mode'], [1, 0, 1, \&cliRequest]); Slim::Control::Request::addDispatch(['randomplaygenrelist', '_index', '_quantity'], [1, 1, 0, \&chooseGenresMenu]); Slim::Control::Request::addDispatch(['randomplaychoosegenre', '_genre', '_value'], [1, 0, 0, \&chooseGenre]); Slim::Control::Request::addDispatch(['randomplaylibrarylist', '_index', '_quantity'], [1, 1, 0, \&chooseLibrariesMenu]); Slim::Control::Request::addDispatch(['randomplaychooselibrary', '_library'], [1, 0, 0, \&chooseLibrary]); Slim::Control::Request::addDispatch(['randomplaygenreselectall', '_value'], [1, 0, 0, \&genreSelectAllOrNone]); Slim::Control::Request::addDispatch(['randomplayisactive'], [1, 1, 0, \&cliIsActive]); Slim::Player::ProtocolHandlers->registerHandler( randomplay => 'Slim::Plugin::RandomPlay::ProtocolHandler' ); # register handler for starting mix of last type on remote button press [Default is press and hold shuffle] Slim::Buttons::Common::setFunction('randomPlay', \&buttonStart); my @item = ( { stringToken => 'PLUGIN_RANDOM_TRACK', id => 'randomtracks', weight => 10, style => 'itemplay', nextWindow => 'nowPlaying', node => 'randomplay', actions => { play => { player => 0, cmd => [ 'randomplay', 'tracks' ], }, go => { player => 0, cmd => [ 'randomplay', 'tracks' ], }, }, }, { stringToken => 'PLUGIN_RANDOM_ALBUM', id => 'randomalbums', weight => 20, style => 'itemplay', nextWindow => 'nowPlaying', node => 'randomplay', actions => { play => { player => 0, cmd => [ 'randomplay', 'albums' ], }, go => { player => 0, cmd => [ 'randomplay', 'albums' ], }, }, }, { stringToken => 'PLUGIN_RANDOM_CONTRIBUTOR', id => 'randomartists', weight => 30, style => 'itemplay', nextWindow => 'nowPlaying', node => 'randomplay', actions => { play => { player => 0, cmd => [ 'randomplay', 'contributors' ], }, go => { player => 0, cmd => [ 'randomplay', 'contributors' ], }, }, }, { stringToken => 'PLUGIN_RANDOM_YEAR', id => 'randomyears', weight => 40, style => 'itemplay', nextWindow => 'nowPlaying', node => 'randomplay', actions => { play => { player => 0, cmd => [ 'randomplay', 'year' ], }, go => { player => 0, cmd => [ 'randomplay', 'year' ], }, }, }, { stringToken => 'PLUGIN_RANDOM_CHOOSE_GENRES', id => 'randomchoosegenres', weight => 50, window => { titleStyle => 'random' }, node => 'randomplay', actions => { go => { player => 0, cmd => [ 'randomplaygenrelist' ], }, }, }, { stringToken => 'PLUGIN_RANDOM_LIBRARY_FILTER', id => 'randomchooselibrary', weight => 55, window => { titleStyle => 'random' }, node => 'randomplay', actions => { go => { player => 0, cmd => [ 'randomplaylibrarylist' ], }, }, }, { stringToken => 'PLUGIN_RANDOM_DISABLE', id => 'randomdisable', weight => 100, style => 'itemplay', nextWindow => 'refresh', node => 'randomplay', actions => { play => { player => 0, cmd => [ 'randomplay', 'disable' ], }, go => { player => 0, cmd => [ 'randomplay', 'disable' ], }, }, }, { stringToken => $class->getDisplayName(), weight => MENU_WEIGHT, id => 'randomplay', node => 'myMusic', isANode => 1, windowStyle => 'text_list', window => { titleStyle => 'random' }, }, ); Slim::Control::Jive::registerPluginMenu(\@item); Slim::Menu::GenreInfo->registerInfoProvider( randomPlay => ( after => 'top', func => \&_genreInfoMenu, ) ); Slim::Utils::Alarm->addPlaylists('PLUGIN_RANDOMPLAY', [ { title => '{PLUGIN_RANDOM_TRACK}', url => 'randomplay://track' }, { title => '{PLUGIN_RANDOM_CONTRIBUTOR}', url => 'randomplay://contributor' }, { title => '{PLUGIN_RANDOM_ALBUM}', url => 'randomplay://album' }, { title => '{PLUGIN_RANDOM_YEAR}', url => 'randomplay://year' }, ] ); $cache = Slim::Utils::Cache->new(); } sub postinitPlugin { my $class = shift; # if user has the Don't Stop The Music plugin enabled, register ourselves if ( Slim::Utils::PluginManager->isEnabled('Slim::Plugin::DontStopTheMusic::Plugin') ) { require Slim::Plugin::DontStopTheMusic::Plugin; my $mixWithGenres = sub { my ($type, $client, $cb) = @_; return unless $client; my %genres; foreach my $track (@{ Slim::Player::Playlist::playList($client) }) { if ( $track->remote ) { $genres{$track->genre}++ if $track->genre; } else { foreach ( $track->genres ) { $genres{$_->name}++ } } } # don't seed from radio stations - only do if we're playing from some track based source if (keys %genres) { # reset all genres to only use those present in our queue $client->execute(['randomplaygenreselectall', 0]); foreach (keys %genres) { $client->execute(['randomplaychoosegenre', $_, 1]); } } $cb->($client, ['randomplay://' . $type]); }; Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_TITLEMIX_WITH_GENRES', sub { $mixWithGenres->('track', @_); }); Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_TRACK', sub { my ($client, $cb) = @_; $client->execute(['randomplaygenreselectall', 0]); $cb->($client, ['randomplay://track']); }); Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_ALBUM_MIX_WITH_GENRES', sub { $mixWithGenres->('album', @_); }); Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_ALBUM_ITEM', sub { my ($client, $cb) = @_; $client->execute(['randomplaygenreselectall', 0]); $cb->($client, ['randomplay://album']); }); Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_CONTRIBUTOR_ITEM', sub { my ($client, $cb) = @_; $client->execute(['randomplaygenreselectall', 0]); $cb->($client, ['randomplay://contributor']); }); Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_YEAR_ITEM', sub { my ($client, $cb) = @_; $client->execute(['randomplaygenreselectall', 0]); $cb->($client, ['randomplay://year']); }); } } sub _shutdown { $initialized = 0; $genres = undef; # unsubscribe Slim::Control::Request::unsubscribe(\&commandCallback); # remove Jive menus Slim::Control::Jive::deleteMenuItem('randomplay'); # remove player-UI mode Slim::Buttons::Common::setFunction('randomPlay', sub {}); # remove web menus webPages(); } sub shutdownPlugin { my $class = shift; # unsubscribe Slim::Control::Request::unsubscribe(\&_libraryChanged); _shutdown(); } sub _libraryChanged { my $request = shift; if ( $request->getParam('_newvalue') || $request->isCommand([['rescan'],['done']]) ) { __PACKAGE__->initPlugin(); } else { _shutdown(); } } sub _genreInfoMenu { my ($client, $url, $genre, $remoteMeta, $tags) = @_; if ($genre) { my $params = {'genre_id'=> $genre->id}; my @items; my $action; $action = { command => [ 'randomplay', 'track' ], fixedParams => $params, }; push @items, { itemActions => { play => $action, items => $action, }, nextWindow => 'nowPlaying', type => 'play', name => sprintf('%s %s %s %s', cstring($client, 'PLUGIN_RANDOMPLAY'), cstring($client, 'GENRE'), cstring($client, 'SONGS'), $genre->name), }; $action = { command => [ 'randomplay', 'album' ], fixedParams => $params, }; push @items, { itemActions => { play => $action, items => $action, }, nextWindow => 'nowPlaying', type => 'play', name => sprintf('%s %s %s %s', cstring($client, 'PLUGIN_RANDOMPLAY'), cstring($client, 'GENRE'), cstring($client, 'ALBUMS'), $genre->name), }; return \@items; } else { return { type => 'text', name => cstring($client, 'UNMIXABLE', cstring($client, 'PLUGIN_RANDOMPLAY')), }; } } sub genreSelectAllOrNone { my $request = shift; if (!$initialized) { $request->setStatusBadConfig(); return; } my $client = $request->client(); my $enable = $request->getParam(''); my $value = $request->getParam('_value'); my $genres = getGenres($client); my @excluded = (); for my $genre (keys %$genres) { $genres->{$genre}->{'enabled'} = $value; if ($value == 0) { push @excluded, $genre; } } # set the exclude_genres pref to either all genres or none $prefs->set('exclude_genres', [@excluded]); $request->setStatusDone(); } sub chooseGenre { my $request = shift; if (!$initialized) { $request->setStatusBadConfig(); return; } my $client = $request->client(); my $genre = $request->getParam('_genre'); my $value = $request->getParam('_value'); my $genres = getGenres($client); # in $genres, an enabled genre returns true for $genres->{'enabled'} # so we set enabled to 0 for this genre, then $genres->{$genre}->{'enabled'} = $value; my @excluded = (); for my $genre (keys %$genres) { push @excluded, $genre if $genres->{$genre}->{'enabled'} == 0; } # set the exclude_genres pref to all disabled genres $prefs->set('exclude_genres', [@excluded]); $request->setStatusDone(); } # create the Choose Genres menu for a given player sub chooseGenresMenu { my $request = shift; if (!$initialized) { $request->setStatusBadConfig(); return; } my $client = $request->client(); my $genres = getGenres($client); my @menu = (); # first a "choose all" item push @menu, { text => $client->string('PLUGIN_RANDOM_SELECT_ALL'), nextWindow => 'refresh', actions => { go => { player => 0, cmd => [ 'randomplaygenreselectall', 1 ], }, }, }; # then a "choose none" item push @menu, { text => $client->string('PLUGIN_RANDOM_SELECT_NONE'), nextWindow => 'refresh', actions => { go => { player => 0, cmd => [ 'randomplaygenreselectall', 0 ], }, }, }; for my $genre ( getSortedGenres($client) ) { my $val = $genres->{$genre}->{'enabled'}; push @menu, { text => $genre, checkbox => ($val == 1) + 0, actions => { on => { player => 0, cmd => ['randomplaychoosegenre', $genre, 1], }, off => { player => 0, cmd => ['randomplaychoosegenre', $genre, 0], }, }, }; } Slim::Control::Jive::sliceAndShip($request, $client, \@menu); } sub chooseLibrary { my $request = shift; if (!$initialized) { $request->setStatusBadConfig(); return; } $prefs->set('library', $request->getParam('_library') || ''); $request->setStatusDone(); } # create the Choose Library menu for a given player sub chooseLibrariesMenu { my $request = shift; if (!$initialized) { $request->setStatusBadConfig(); return; } my $client = $request->client(); my $library_id = $prefs->get('library'); my $libraries = _getLibraries(); my @menu = ({ text => cstring($client, 'ALL_LIBRARY'), radio => ($library_id ? 0 : 1), actions => { 'do' => { player => 0, cmd => ['randomplaychooselibrary', 0, 1], }, }, }); foreach my $id ( sort { lc($libraries->{$a}) cmp lc($libraries->{$b}) } keys %$libraries ) { push @menu, { text => $libraries->{$id}, radio => ($id eq $library_id ? 1 : 0), actions => { 'do' => { player => 0, cmd => ['randomplaychooselibrary', $id, 1], }, }, }; } Slim::Control::Jive::sliceAndShip($request, $client, \@menu); } # Find tracks matching parameters and add them to the playlist sub findAndAdd { my ($client, $type, $limit, $addOnly) = @_; my $idList = $cache->get('rnd_idList_' . $client->id) || []; if ( main::INFOLOG && $log->is_info ) { $log->info(sprintf("Starting random selection of %s items for type: $type", defined($limit) ? $limit : 'unlimited')); } if ( !scalar @$idList ) { main::DEBUGLOG && $log->debug('Initialize ID list to be randomized'); # Search the database for all items of $type which match find criteria my @joins = (); # Initialize find to only include user's selected genres. If they've deselected # all genres, this clause will be ignored by find, so all genres will be used. my $filteredGenres = getFilteredGenres($client); my $excludedGenres = getFilteredGenres($client, 1); my $queryGenres; my $queryLibrary; # Only look for genre tracks if we have some, but not all # genres selected. Or no genres selected. if ( (scalar @$filteredGenres > 0 && scalar @$excludedGenres != 0) || scalar @$filteredGenres != 0 && scalar @$excludedGenres > 0 ) { $queryGenres = join(',', @$filteredGenres); } $queryLibrary = $prefs->get('library') || Slim::Music::VirtualLibraries->getLibraryIdForClient($client); if ($type =~ /track|year/) { # it's messy reaching that far in to Slim::Control::Queries, but it's >5x faster on a Raspberry Pi2 with 100k tracks than running the full "titles" query (undef, $idList) = Slim::Control::Queries::_getTagDataForTracks( 'II', { where => '(tracks.content_type != "cpl" AND tracks.content_type != "src" AND tracks.content_type != "ssp" AND tracks.content_type != "dir")', year => $type eq 'year' && getRandomYear($client, $filteredGenres), genreId => $queryGenres, libraryId => $queryLibrary, } ); $type = 'track'; } else { my %categories = ( album => ['albums', 0, 999_999, 'tags:t'], contributor => ['artists', 0, 999_999], track => [] ); $categories{year} = $categories{track}; $categories{artist} = $categories{contributor}; my $query = $categories{$type}; push @$query, 'genre_id:' . $queryGenres if $queryGenres; push @$query, 'library_id:' . $queryLibrary if $queryLibrary; my $request = Slim::Control::Request::executeRequest($client, $query); my $loop = "${type}s_loop"; $loop = 'artists_loop' if $type eq 'contributor'; $idList = [ map { $_->{id} } @{ $request->getResult($loop) || [] } ]; } # shuffle ID list Slim::Player::Playlist::fischer_yates_shuffle($idList); } elsif ($type eq 'year') { $type = 'track'; } # get first ID from our randomized list my @randomIds = splice @$idList, 0, $limit; $cache->set('rnd_idList_' . $client->id, $idList, 'never'); if (!scalar @randomIds) { logWarning("Didn't get a valid object for findAndAdd()!"); return undef; } # Add the items to the end foreach my $id (@randomIds) { if ( main::INFOLOG && $log->is_info ) { $log->info(sprintf("%s %s: #%d", $addOnly ? 'Adding' : 'Playing', $type, $id )); } # Replace the current playlist with the first item / track or add it to end my $request = $client->execute([ 'playlist', $addOnly ? 'addtracks' : 'loadtracks', sprintf('%s.id=%d', $type, $id) ]); # indicate request source $request->source('PLUGIN_RANDOMPLAY'); $addOnly++; } } # Returns a hash whose keys are the genres in the db sub getGenres { my $client = shift; my $library_id = $prefs->get('library') || Slim::Music::VirtualLibraries->getLibraryIdForClient($client); $genres ||= {}; return $genres->{$library_id} if keys %$genres && $genres->{$library_id}; $genres->{$library_id} ||= {}; my $query = ['genres', 0, 999_999]; push @$query, 'library_id:' . $library_id if $library_id; my $request = Slim::Control::Request::executeRequest($client, $query); # Extract each genre name into a hash my %exclude = map { $_ => 1 } @{ $prefs->get('exclude_genres') }; my $i = 0; foreach my $genre ( @{ $request->getResult('genres_loop') || [] } ) { my $name = $genre->{genre}; # Put the name here as well so the hash can be passed to # INPUT.Choice as part of listRef later on $genres->{$library_id}->{$name} = { 'name' => $name, 'id' => $genre->{id}, 'enabled' => !$exclude{$name}, 'sort' => $i++, }; } return $genres->{$library_id}; } sub getSortedGenres { my $client = shift; my $genres = getGenres($client); return sort { $genres->{$a}->{sort} <=> $genres->{$b}->{sort}; } keys %$genres; } # Returns an array of the non-excluded genres in the db sub getFilteredGenres { my ($client, $returnExcluded, $namesOnly) = @_; # use second arg to set what values we return. we may need list of ids or names my $value = $namesOnly ? 'name' : 'id'; my $genres = getGenres($client); return [ map { $genres->{$_}->{$value}; } grep { ($genres->{$_}->{'enabled'} && !$returnExcluded) || ($returnExcluded && !$genres->{$_}->{'enabled'}) } keys %$genres ]; } sub getRandomYear { my $client = shift; my $filteredGenres = shift; main::DEBUGLOG && $log->debug("Starting random year selection"); my $years = $cache->get('rnd_years_' . $client->id) || []; if (!scalar @$years) { my %cond = (); my %attr = ( 'order_by' => Slim::Utils::OSDetect->getOS()->sqlHelperClass()->randomFunction(), 'group_by' => 'me.year', ); if (ref($filteredGenres) eq 'ARRAY' && scalar @$filteredGenres > 0) { $cond{'genreTracks.genre'} = $filteredGenres; $attr{'join'} = ['genreTracks']; } if ( my $library_id = $prefs->get('library') || Slim::Music::VirtualLibraries->getLibraryIdForClient($client) ) { $cond{'libraryTracks.library'} = $library_id; $attr{'join'} ||= []; push @{$attr{'join'}}, 'libraryTracks'; } $years = [ Slim::Schema->rs('Track')->search(\%cond, \%attr)->get_column('me.year')->all ]; } my $year = shift @$years; $cache->set('rnd_years_' . $client->id, $years, 'never'); main::DEBUGLOG && $log->debug("Selected year $year"); return $year; } # Add random tracks to playlist if necessary sub playRandom { # If addOnly, then track(s) are appended to end. Otherwise, a new playlist is created. my ($client, $type, $addOnly) = @_; $client = $client->master; main::DEBUGLOG && $log->debug("Called with type $type"); $client->pluginData('type', '') unless $client->pluginData('type'); $type ||= 'track'; $type = lc($type); # Whether to keep adding tracks after generating the initial playlist my $continuousMode = $prefs->get('continuous'); if ($type ne $client->pluginData('type')) { $cache->remove('rnd_idList_' . $client->id); } my $songIndex = Slim::Player::Source::streamingSongIndex($client); my $songsRemaining = Slim::Player::Playlist::count($client) - $songIndex - 1; main::DEBUGLOG && $log->debug("$songsRemaining songs remaining, songIndex = $songIndex"); # Work out how many items need adding my $numItems = 0; if ($type =~ /track|year/) { # Add new tracks if there aren't enough after the current track my $numRandomTracks = $prefs->get('newtracks'); if (!$addOnly) { $numItems = $numRandomTracks; } elsif ($songsRemaining < $numRandomTracks) { $numItems = $numRandomTracks - $songsRemaining; } else { main::DEBUGLOG && $log->debug("$songsRemaining items remaining so not adding new track"); } } elsif ($type ne 'disable' && ($type ne $client->pluginData('type') || !$addOnly || $songsRemaining <= 0)) { # Old artist/album/year is finished or new random mix started. Add a new one $numItems = 1; } if ($numItems) { # String to show with showBriefly my $string = ''; if ($type ne 'track') { $string = $client->string('PLUGIN_RANDOM_' . uc($type) . '_ITEM') . ': '; } # If not track mode, add tracks then go round again to check whether the playlist only # contains one track (i.e. the artist/album/year only had one track in it). If so, # add another artist/album/year or the plugin would never add more when the first finished in continuous mode. for (my $i = 0; $i < 2; $i++) { if ($i == 0 || ($type =~ /track|year/ && Slim::Player::Playlist::count($client) == 1 && $continuousMode)) { if ($i == 1) { $string .= ' // '; } # Get the tracks. year is a special case as we do a find for all tracks that match # the previously selected year findAndAdd($client, $type, $numItems, # 2nd time round just add tracks to end $i == 0 ? $addOnly : 1 ); } } # Do a show briefly the first time things are added, or every time a new album/artist/year is added if (!$addOnly || $type ne $client->pluginData('type') || $type !~ /track|year/) { if ($type eq 'track') { $string = $client->string("PLUGIN_RANDOM_TRACK"); } # Don't do showBrieflys if visualiser screensavers are running as the display messes up if (Slim::Buttons::Common::mode($client) !~ /^SCREENSAVER./) { $client->showBriefly( { jive => undef, 'line' => [ string($addOnly ? 'ADDING_TO_PLAYLIST' : 'NOW_PLAYING'), $string ] }, 2, undef, undef, 1); } } # Never show random as modified, since its a living playlist $client->currentPlaylistModified(0); } if ($type eq 'disable') { main::INFOLOG && $log->info("Cyclic mode ended"); # Don't do showBrieflys if visualiser screensavers are running as # the display messes up if (Slim::Buttons::Common::mode($client) !~ /^SCREENSAVER./ && !$client->pluginData('disableMix')) { $client->showBriefly( { jive => string('PLUGIN_RANDOM_DISABLED'), 'line' => [ string('PLUGIN_RANDOMPLAY'), string('PLUGIN_RANDOM_DISABLED') ] } ); } $client->pluginData('disableMix', 0); $client->pluginData('type', ''); } else { if ( main::INFOLOG && $log->is_info ) { $log->info(sprintf( "Playing %s %s mode with %i items", $continuousMode ? 'continuous' : 'static', $type, Slim::Player::Playlist::count($client) )); } #BUG 5444: store the status so that users re-visiting the random mix # will see a continuous mode state. if ($continuousMode) { $client->pluginData('type', $type); } } } # Returns the display text for the currently selected item in the menu sub getDisplayText { my ($client, $item) = @_; $client = $client->master; my $string = 'PLUGIN_RANDOM_' . ($item eq 'genreFilter' ? 'GENRE_FILTER' : uc($item)); $string =~ s/S$//; # if showing the current mode, show altered string if ($item eq ($client->pluginData('type') || '')) { return string($string . '_PLAYING'); # if a mode is active, handle the temporarily added disable option } elsif ($item eq 'disable' && $client->pluginData('type')) { return join(' ', string('PLUGIN_RANDOM_PRESS_RIGHT'), string('PLUGIN_RANDOM_' . uc($client->pluginData('type')) . '_DISABLE') ); } else { return string($string); } } # Returns the overlay to be display next to items in the menu sub getOverlay { my ($client, $item) = @_; # Put the right arrow by genre filter and notesymbol by mixes if ($item =~ /^(?:genreFilter|library_filter)$/) { return [undef, $client->symbols('rightarrow')]; } elsif (ref $item && ref $item eq 'HASH') { my $value = $item->{value} || ''; my $library_id = $prefs->get('library') || ''; return [undef, Slim::Buttons::Common::radioButtonOverlay($client, ($value eq $library_id) ? 1 : 0)]; } elsif ($item ne 'disable') { return [undef, $client->symbols('notesymbol')]; } else { return [undef, undef]; } } # Returns the overlay for the select genres mode i.e. the checkbox state sub getGenreOverlay { my ($client, $item) = @_; my $rv = 0; my $genres = getGenres($client); if ($item->{'selectAll'}) { # This item should be ticked if all the genres are selected my $genresEnabled = 0; for my $genre (keys %{$genres}) { if ($genres->{$genre}->{'enabled'}) { $genresEnabled++; } } $rv = $genresEnabled == scalar keys %{$genres}; $item->{'enabled'} = $rv; } else { $rv = $genres->{$item->{'name'}}->{'enabled'}; } return [undef, Slim::Buttons::Common::checkBoxOverlay($client, $rv)]; } # Toggle the exclude state of a genre in the select genres mode sub toggleGenreState { my ($client, $item) = @_; my $genres = getGenres($client); if ($item->{'selectAll'}) { $item->{'enabled'} = ! $item->{'enabled'}; # Enable/disable every genre foreach my $genre (keys %$genres) { $genres->{$genre}->{'enabled'} = $item->{'enabled'}; } } else { # Toggle the selected state of the current item $genres->{$item->{'name'}}->{'enabled'} = ! $genres->{$item->{'name'}}->{'enabled'}; } $prefs->set('exclude_genres', getFilteredGenres($client, 1, 1) ); $client->update; } sub toggleLibrarySelection { my ($client, $item) = @_; return unless $item && ref $item; $prefs->set('library', $item->{value} || ''); } # Do what's necessary when play or add button is pressed sub handlePlayOrAdd { my ($client, $item, $add) = @_; if ( main::DEBUGLOG && $log->is_debug ) { $log->debug(sprintf("RandomPlay: %s button pushed on type %s", $add ? 'Add' : 'Play', $item)); } # reconstruct the list of options, adding and removing the 'disable' option where applicable if ($item ne 'genreFilter') { my $listRef = $client->modeParam('listRef'); if ($item eq 'disable') { pop @$listRef; } elsif (!$client->pluginData('type')) { # only add disable option if starting a mode from idle state push @$listRef, 'disable'; } $client->modeParam('listRef', $listRef); # Go go go! playRandom($client, $item, $add); } } sub setMode { my $class = shift; my $client = shift; my $method = shift; if (!$initialized) { $client->bumpRight(); return; } if ($method eq 'pop') { Slim::Buttons::Common::popMode($client); return; } # use INPUT.Choice to display the list of feeds my %params = ( header => '{PLUGIN_RANDOMPLAY}', headerAddCount => 1, listRef => [qw(track album contributor year genreFilter library_filter)], name => \&getDisplayText, overlayRef => \&getOverlay, modeName => 'RandomPlay', onPlay => sub { handlePlayOrAdd(@_[0,1], 0) }, onAdd => sub { handlePlayOrAdd(@_[0,1], 1) }, onRight => sub { my ($client, $item) = @_; if ($item eq 'genreFilter') { my $genres = getGenres($client); # Insert Select All option at top of genre list my @listRef = ({ name => $client->string('PLUGIN_RANDOM_SELECT_ALL'), # Mark the fact that isn't really a genre selectAll => 1, value => 1, }); # Add the genres foreach my $genre ( getSortedGenres($client) ) { # HACK: add 'value' so that INPUT.Choice won't complain as much. nasty setup there. $genres->{$genre}->{'value'} = $genres->{$genre}->{'id'}; push @listRef, $genres->{$genre}; } Slim::Buttons::Common::pushModeLeft($client, 'INPUT.Choice', { header => '{PLUGIN_RANDOM_GENRE_FILTER}', headerAddCount => 1, listRef => \@listRef, modeName => 'RandomPlayGenreFilter', overlayRef => \&getGenreOverlay, onRight => \&toggleGenreState, }); } elsif ($item eq 'library_filter') { my $library_id = $prefs->get('library'); my $libraries = _getLibraries(); my @listRef = ({ name => cstring($client, 'ALL_LIBRARY'), }); foreach my $id ( sort { lc($libraries->{$a}) cmp lc($libraries->{$b}) } keys %$libraries ) { push @listRef, { name => $libraries->{$id}, value => $id }; } Slim::Buttons::Common::pushModeLeft($client, 'INPUT.Choice', { header => '{PLUGIN_RANDOM_LIBRARY_FILTER}', headerAddCount => 1, listRef => \@listRef, modeName => 'RandomPlayLibraryFilter', overlayRef => \&getOverlay, onRight => \&toggleLibrarySelection, }); } elsif ($item eq 'disable') { handlePlayOrAdd($client, $item, 0); } else { $client->bumpRight(); } }, ); # if we have an active mode, temporarily add the disable option to the list. if ($client->master->pluginData('type')) { push @{$params{'listRef'}}, 'disable'; } Slim::Buttons::Common::pushMode($client, 'INPUT.Choice', \%params); } sub commandCallback { my $request = shift; my $client = $request->client(); # Don't respond to callback for ourself or for requests originating from the alarm clock. This is necessary, # as the alarm clock uses a playlist play command to start random mixes and we then get notified of them so # could end up stopping immediately. if ($request->source && ($request->source eq 'PLUGIN_RANDOMPLAY' || $request->source eq 'ALARM')) { return; } if (!defined $client || !$client->master->pluginData('type') || !$prefs->get('continuous')) { return; } $client = $client->master; # Bug 8652, ignore playlist play commands for our randomplay:// URL if ( $request->isCommand( [['playlist'], ['play']] ) ) { my $url = $request->getParam('_item'); my $type = $client->pluginData('type'); if ( $url eq "randomplay://$type" ) { return; } } if ( main::DEBUGLOG && $log->is_debug ) { $log->debug(sprintf("Received command %s", $request->getRequestString)); $log->debug(sprintf("While in mode: %s, from %s", $client->pluginData('type'), $client->name)); } my $songIndex = Slim::Player::Source::streamingSongIndex($client); if ($request->isCommand([['playlist'], ['newsong']]) || $request->isCommand([['playlist'], ['delete']]) && $request->getParam('_index') > $songIndex) { if (main::INFOLOG && $log->is_info) { if ($request->isCommand([['playlist'], ['newsong']])) { if (Slim::Player::Sync::isSlave($client)) { main::DEBUGLOG && $log->debug(sprintf("Ignoring new song notification for slave player")); return; } else { $log->info(sprintf("New song detected ($songIndex)")); } } else { $log->info(sprintf("Deletion detected (%s)", $request->getParam('_index'))); } } my $songsToKeep = $prefs->get('oldtracks'); my $playlistCount = Slim::Player::Playlist::count($client); if ($songIndex && $songsToKeep ne '' && $songIndex > $songsToKeep) { if ( main::INFOLOG && $log->is_info ) { $log->info(sprintf("Stripping off %i completed track(s)", $songIndex - $songsToKeep)); } # Delete tracks before this one on the playlist for (my $i = 0; $i < $songIndex - $songsToKeep; $i++) { my $request = $client->execute(['playlist', 'delete', 0]); $request->source('PLUGIN_RANDOMPLAY'); } } Slim::Utils::Timers::killTimers($client, \&_addTracksLater); # Bug: 16890 only defer adding tracks if we are not nearing end of the playlist # this avoids repeating the playlist due to the user skipping tracks if ($playlistCount - $songIndex > $prefs->get('newtracks') / 2) { Slim::Utils::Timers::setTimer($client, time() + 10, \&_addTracksLater); } else { playRandom($client, $client->pluginData('type'), 1); } } elsif ($request->isCommand([['playlist'], $stopcommands])) { if ( main::INFOLOG && $log->is_info ) { $log->info(sprintf("Cyclic mode ending due to playlist: %s command", $request->getRequestString)); } Slim::Utils::Timers::killTimers($client, \&_addTracksLater); playRandom($client, 'disable'); } } sub _addTracksLater { my $client = shift; if ($client->pluginData('type')) { playRandom($client, $client->pluginData('type'), 1); } } sub cliRequest { my $request = shift; if (!$initialized) { $request->setStatusBadConfig(); return; } # get our parameters my $mode = $request->getParam('_mode'); # try mapping CLI plural values on singular values used internally (eg. albums -> album) $mode = $mixTypeMap{$mode} || $mode; my $client = $request->client(); # return quickly if we lack some information if ($mode && $mode eq 'disable' && $client) { # nothing to do here unless a mix is going on if ( !$client->pluginData('type') ) { $request->setStatusDone(); return; } $client->pluginData('disableMix', 1); } elsif (!defined $mode || !(scalar grep /$mode/, @mixTypes) || !$client) { $request->setStatusBadParams(); return; } if (my $genre = $request->getParam('genre_id')){ my $name = Slim::Schema->find('Genre', $genre)->name; my $genres = getGenres($client); # in $genres, an enabled genre returns true for $genres->{'enabled'} my @excluded = (); for (keys %$genres) { push @excluded, $_ unless $_ eq $name; } # set the exclude_genres pref to all disabled genres $prefs->set('exclude_genres', [@excluded]); $genres->{$name}->{'enabled'} = 1; } playRandom($client, $mode); $request->setStatusDone(); } sub cliIsActive { my $request = shift; my $client = $request->client(); $request->addResult('_randomplayisactive', active($client) ); $request->setStatusDone(); } # legacy method to allow mapping to remote buttons sub getFunctions { return $functions; } sub buttonStart { my $client = shift; playRandom($client, $client->pluginData('type') || 'track'); } sub webPages { my $class = shift; my $urlBase = 'plugins/RandomPlay'; if ($initialized) { Slim::Web::Pages->addPageLinks("browse", { 'PLUGIN_RANDOMPLAY' => $htmlTemplate }); } else { Slim::Web::Pages->delPageLinks("browse", 'PLUGIN_RANDOMPLAY'); return; } Slim::Web::Pages->addPageFunction("$urlBase/list.html", \&handleWebList); Slim::Web::Pages->addPageFunction("$urlBase/mix.html", \&handleWebMix); Slim::Web::Pages->addPageFunction("$urlBase/settings.html", \&handleWebSettings); Slim::Web::HTTP::CSRF->protectURI("$urlBase/list.html"); Slim::Web::HTTP::CSRF->protectURI("$urlBase/mix.html"); Slim::Web::HTTP::CSRF->protectURI("$urlBase/settings.html"); } # Draws the plugin's web page sub handleWebList { my ($client, $params) = @_; if ($client) { # Pass on the current pref values and now playing info my $genres = getGenres($client); $params->{'pluginRandomGenreList'} = $genres; $params->{'pluginRandomGenreListSort'} = [ getSortedGenres($client) ]; $params->{'pluginRandomNumTracks'} = $prefs->get('newtracks'); $params->{'pluginRandomNumOldTracks'} = $prefs->get('oldtracks'); $params->{'pluginRandomContinuousMode'}= $prefs->get('continuous'); $params->{'pluginRandomNowPlaying'} = $client->master->pluginData('type'); $params->{'pluginRandomUseLibrary'} = $prefs->get('library'); $params->{'mixTypes'} = \@mixTypes; $params->{'favorites'} = {}; map { $params->{'favorites'}->{$_} = Slim::Utils::Favorites->new($client)->findUrl("randomplay://$_") || Slim::Utils::Favorites->new($client)->findUrl("randomplay://$mixTypeMap{$_}") || 0; } keys %mixTypeMap, @mixTypes; $params->{'libraries'} ||= _getLibraries(); } return Slim::Web::HTTP::filltemplatefile($htmlTemplate, $params); } # Handles play requests from plugin's web page sub handleWebMix { my ($client, $params) = @_; if (defined $client && $params->{'type'}) { playRandom($client, $params->{'type'}, $params->{'addOnly'}); } handleWebList($client, $params); } # Handles settings changes from plugin's web page sub handleWebSettings { my ($client, $params) = @_; my $genres = getGenres($client); # %$params will contain a key called genre_<genre id> for each ticked checkbox on the page for my $genre (keys %{$genres}) { if ($params->{'genre_'.$genres->{$genre}->{'id'}}) { delete($genres->{$genre}); } } $prefs->set('exclude_genres', [keys %{$genres}]); $prefs->set('newtracks', $params->{'numTracks'}); $prefs->set('oldtracks', $params->{'numOldTracks'}); $prefs->set('continuous', $params->{'continuousMode'} ? 1 : 0); $prefs->set('library', $params->{'useLibrary'}); # Pass on to check if the user requested a new mix as well handleWebMix($client, $params); } sub _getLibraries { my $libraries = Slim::Music::VirtualLibraries->getLibraries(); my %libraries; %libraries = map { $_ => $libraries->{$_}->{name} } keys %$libraries if keys %$libraries; return \%libraries; } sub active { my $client = shift; return $client->master->pluginData('type'); } # Called by Slim::Utils::Alarm to get the playlists that should be presented as options # for an alarm playlist. sub getAlarmPlaylists { my $class = shift; return [ { type => 'PLUGIN_RANDOMPLAY', items => [ { title => '{PLUGIN_RANDOM_TRACK}', url => 'randomplay://track' }, { title => '{PLUGIN_RANDOM_ALBUM}', url => 'randomplay://album' }, { title => '{PLUGIN_RANDOM_CONTRIBUTOR}', url => 'randomplay://contributor' }, { title => '{PLUGIN_RANDOM_YEAR}', url => 'randomplay://year' }, ] } ]; } 1; __END__
26.233675
156
0.609513
ed7802275daff3b4bd01f78559296d828944f804
356
pm
Perl
perl/vendor/lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm
ifleeyo180/VspriteMoodleWebsite
38baa924829c83808d2c87d44740ff365927a646
[ "Apache-2.0" ]
2
2021-11-19T22:37:28.000Z
2021-11-22T18:04:55.000Z
perl/vendor/lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm
ifleeyo180/VspriteMoodleWebsite
38baa924829c83808d2c87d44740ff365927a646
[ "Apache-2.0" ]
6
2021-11-18T00:39:48.000Z
2021-11-20T00:31:40.000Z
perl/vendor/lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm
ifleeyo180/VspriteMoodleWebsite
38baa924829c83808d2c87d44740ff365927a646
[ "Apache-2.0" ]
null
null
null
package Moose::Meta::Method::Accessor::Native::Hash::keys; our $VERSION = '2.2014'; use strict; use warnings; use Moose::Role; with 'Moose::Meta::Method::Accessor::Native::Reader'; sub _maximum_arguments { 0 } sub _return_value { my $self = shift; my ($slot_access) = @_; return 'keys %{ (' . $slot_access . ') }'; } no Moose::Role; 1;
15.478261
58
0.634831
eda1aca57f8a5f5faab078bde1dc654b836b051b
9,693
pm
Perl
mayachemtools/lib/DBUtil.pm
sirimullalab/redial-2020
efddbb76d152b9668658f3096020e8a21cdfbec9
[ "MIT" ]
8
2020-09-09T15:10:40.000Z
2022-01-04T02:11:13.000Z
mayachemtools/lib/DBUtil.pm
sirimullalab/redial-2020
efddbb76d152b9668658f3096020e8a21cdfbec9
[ "MIT" ]
null
null
null
mayachemtools/lib/DBUtil.pm
sirimullalab/redial-2020
efddbb76d152b9668658f3096020e8a21cdfbec9
[ "MIT" ]
5
2020-09-06T05:36:39.000Z
2022-01-09T07:11:05.000Z
package DBUtil; # # File: DBUtil.pm # Author: Manish Sud <msud@san.rr.com> # # Copyright (C) 2020 Manish Sud. All rights reserved. # # This file is part of MayaChemTools. # # MayaChemTools 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 3 of the License, or (at your option) any # later version. # # MayaChemTools is distributed in the hope that it will be useful, but without # any warranty; without even the implied warranty of merchantability of 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 MayaChemTools; if not, see <http://www.gnu.org/licenses/> or # write to the Free Software Foundation Inc., 59 Temple Place, Suite 330, # Boston, MA, 02111-1307, USA. # use strict; use Exporter; use Carp; use DBI; use TextUtil; use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @ISA = qw(Exporter); @EXPORT = qw(DBConnect DBDisconnect DBFetchSchemaTableNames DBSetupDescribeSQL DBSetupSelectSQL DBSQLToTextFile); @EXPORT_OK = qw(); %EXPORT_TAGS = (all => [@EXPORT, @EXPORT_OK]); # Connect to a specified database... sub DBConnect { my($DBDriver, $DBName, $DBHost, $DBUser, $DBPassword) = @_; my($DBHandle, $DataSource); if ($DBDriver eq "Oracle") { $DataSource = qq(DBI:$DBDriver:$DBHost); } else { $DataSource = qq(DBI:$DBDriver:database=$DBName); if ($DBHost) { $DataSource .= qq(;host=$DBHost); } } # Don't raise the error; otherwise, DBI functions termiates on encountering an error. # All terminations decisions are made outside of DBI functions... $DBHandle = DBI->connect($DataSource, $DBUser, $DBPassword, { RaiseError => 0, AutoCommit => 0 }) or croak "Couldn't connect to database..."; return $DBHandle; } # Disconnect from a database... sub DBDisconnect { my($DBHandle) = @_; $DBHandle->disconnect or carp "Couldn't disconnect from a database..."; } # Fetch all table name for a database schema... sub DBFetchSchemaTableNames { my($DBDriver, $DBHandle, $SchemaName) = @_; my(@SchemaTableNames, $SQL, $SQLHandle); @SchemaTableNames = (); $SchemaName = (defined $SchemaName && length $SchemaName) ? $SchemaName : ""; if ($DBDriver eq "mysql") { # Switch schemas... $SQL = qq(USE $SchemaName); $SQLHandle = $DBHandle->prepare($SQL) or return @SchemaTableNames; $SQLHandle->execute or return @SchemaTableNames; $SQLHandle->finish or return @SchemaTableNames; # Setup to fetch table names... $SQL = qq(SHOW TABLES); } elsif ($DBDriver eq "Oracle") { $SQL = qq(SELECT SEGMENT_NAME FROM DBA_SEGMENTS WHERE OWNER = '$SchemaName' AND SEGMENT_TYPE = 'TABLE' ORDER BY SEGMENT_NAME); } elsif ($DBDriver =~ /^(Pg|Postgres)$/i) { $SQL = qq(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '$SchemaName'); } $SQLHandle = $DBHandle->prepare($SQL) or return @SchemaTableNames; $SQLHandle->execute or return @SchemaTableNames; my(@RowValues, $TableName); while (@RowValues = $SQLHandle->fetchrow_array) { $TableName = ($DBDriver =~ /^(mysql|Oracle)$/i) ? uc($RowValues[0]) : $RowValues[0]; if (defined $TableName && length $TableName) { push @SchemaTableNames, $TableName; } } $SQLHandle->finish or return @SchemaTableNames; return @SchemaTableNames; } # Setup describe SQL statement... sub DBSetupDescribeSQL { my($DBDriver, $TableName, $SchemaName); my($DescribeSQL); $DBDriver = ""; $TableName = ""; $SchemaName = ""; if (@_ == 3) { ($DBDriver, $TableName, $SchemaName) = @_; } else { ($DBDriver, $TableName) = @_; } $TableName = (defined $TableName && length $TableName) ? $TableName : ""; $SchemaName = (defined $SchemaName && length $SchemaName) ? $SchemaName : ""; $DescribeSQL = ($SchemaName) ? ("DESCRIBE " . "$SchemaName" . ".$TableName") : "DESCRIBE $TableName"; if ($DBDriver eq "Oracle") { $DescribeSQL = qq(SELECT COLUMN_NAME "Column_Name", DECODE(NULLABLE, 'N','Not Null','Y','Null') "Null", DATA_TYPE "Data_Type", DATA_LENGTH "Data_Length", DATA_PRECISION "Data_Precision" FROM DBA_TAB_COLUMNS WHERE TABLE_NAME = '$TableName'); if ($SchemaName) { $DescribeSQL .= qq( AND OWNER = '$SchemaName'); } $DescribeSQL .= qq( ORDER BY COLUMN_ID); } elsif ($DBDriver =~ /^(Pg|Postgres)$/i) { $DescribeSQL = qq(SELECT COLUMN_NAME "Column_Name", data_type "Data_Type" FROM information_schema.columns WHERE table_name ='$TableName'); if ($SchemaName) { $DescribeSQL .= " and table_schema = '$SchemaName'"; } } return $DescribeSQL; } # Setup describe SQL statement... sub DBSetupSelectSQL { my($DBDriver, $TableName, $SchemaName); my($SelectSQL); $DBDriver = ""; $TableName = ""; $SchemaName = ""; if (@_ == 3) { ($DBDriver, $TableName, $SchemaName) = @_; } else { ($DBDriver, $TableName) = @_; } $TableName = (defined $TableName && length $TableName) ? $TableName : ""; $SchemaName = (defined $SchemaName && length $SchemaName) ? $SchemaName : ""; $SelectSQL = ($SchemaName) ? ("SELECT * FROM " . "$SchemaName" . ".$TableName") : "SELECT * FROM $TableName"; return $SelectSQL; } # Prepare and execute a SQL statement and write out results into # a text file. sub DBSQLToTextFile { my($DBHandle, $SQL, $TextFile, $OutDelim, $OutQuote, $ExportDataLabels, $ExportLOBs, $ReplaceNullStr); my($SQLHandle, $Status); $Status = 1; $ExportDataLabels = 1; $ExportLOBs = 0; $ReplaceNullStr = ""; if (@_ == 8) { ($DBHandle, $SQL, $TextFile, $OutDelim, $OutQuote, $ExportDataLabels, $ExportLOBs, $ReplaceNullStr) = @_; } elsif (@_ == 7) { ($DBHandle, $SQL, $TextFile, $OutDelim, $OutQuote, $ExportDataLabels, $ExportLOBs) = @_; } elsif (@_ == 6) { ($DBHandle, $SQL, $TextFile, $OutDelim, $OutQuote, $ExportDataLabels) = @_; } else { ($DBHandle, $SQL, $TextFile, $OutDelim, $OutQuote) = @_; } # Execute SQL statement... $SQLHandle = $DBHandle->prepare($SQL) or return $Status; $SQLHandle->execute() or return $Status; my($FieldsNum, @FieldNames, @RowValues, @ColNumsToExport, @ColLabels, $ColNum, $ColLabelsLine, @Values, $Value, $ValuesLine); $Status = 0; # Figure out which column numbers need to be exported... $FieldsNum = $SQLHandle->{NUM_OF_FIELDS}; @FieldNames = @{$SQLHandle->{NAME}}; @ColNumsToExport = (); if ($ExportLOBs) { @ColNumsToExport = (0 .. $#FieldNames); } else { my(@FieldTypes, @FieldTypeNames, $Type, $TypeName); @FieldTypes = @{$SQLHandle->{TYPE}}; @FieldTypeNames = map { scalar $DBHandle->type_info($_)->{TYPE_NAME} } @FieldTypes; for $ColNum (0 .. $#FieldNames) { if ($FieldTypeNames[$ColNum] !~ /lob|bytea/i ) { push @ColNumsToExport, $ColNum; } } } if ($ExportDataLabels) { # Print out column labels... @ColLabels = (); for $ColNum (@ColNumsToExport) { push @ColLabels, $FieldNames[$ColNum]; } $ColLabelsLine = JoinWords(\@ColLabels, $OutDelim, $OutQuote); print $TextFile "$ColLabelsLine\n"; } # Print out row values... while (@RowValues = $SQLHandle->fetchrow_array) { @Values = (); for $ColNum (@ColNumsToExport) { if (defined($RowValues[$ColNum]) && length($RowValues[$ColNum])) { $Value = $RowValues[$ColNum]; } else { $Value = $ReplaceNullStr ? $ReplaceNullStr : ""; } push @Values, $Value; } $ValuesLine = JoinWords(\@Values, $OutDelim, $OutQuote); print $TextFile "$ValuesLine\n"; } $SQLHandle->finish or return $Status; $Status = 0; return $Status; } 1; __END__ =head1 NAME DBUtil =head1 SYNOPSIS use DBUtil; use DBUtil qw(:all); =head1 DESCRIPTION B<DBUtil> module provides the following functions: DBConnect, DBDisconnect, DBFetchSchemaTableNames, DBSQLToTextFile, DBSetupDescribeSQL, DBSetupSelectSQL DBUtil package uses Perl DBI for interacting with MySQL Oracle, and PostgreSQL databases. =head1 FUNCTIONS =over 4 =item B<DBConnect> $DBHandle = DBConnect($DBDriver, $DBName, $DBHost, $DBUser, $DBPassword); Connects to a database using specified parameters and returns a B<DBHandle>. =item B<DBDisconnect> DBDisconnect($DBHandle); Disconnects from a database specified by I<DBHandle>. =item B<DBFetchSchemaTableNames> @SchemaTableNames = DBFetchSchemaTableNames($DBDriver, $DBHandle, $SchemaName); Returns an array of all the table names in a database I<SchemaName>. =item B<DBSetupDescribeSQL> $DescribeSQL = DBSetupDescribeSQL($DBDriver, $TableName, [$SchemaName]); Sets up and returns a SQL statement to describe a table for MySQ, Oracle or PostgreSQL. =item B<DBSetupSelectSQL> $SelectSQL = DBSetupSelectSQL($DBDriver, $TableName, $SchemaName); Sets up and returns a SQL statement to retrieve all columns from a table for MySQL, Oracle, or PostgreSQL. =item B<DBSQLToTextFile> $Status = DBSQLToTextFile($DBHandle, $SQL, \*TEXTFILE, $OutDelim, $OutQuote, [$ExportDataLabels, $ExportLOBs, $ReplaceNullStr]); Executes a I<SQL> statement and export all data into a text file. =back =head1 AUTHOR Manish Sud <msud@san.rr.com> =head1 COPYRIGHT Copyright (C) 2020 Manish Sud. All rights reserved. This file is part of MayaChemTools. MayaChemTools 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 3 of the License, or (at your option) any later version. =cut
29.733129
244
0.676468
ed8fe40bd517396e05cec965e334b775524f82e9
651
pm
Perl
lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm
clayne/Moose
3da4722b04814b5476e05cbab1d4b9a2e5128c63
[ "Artistic-1.0" ]
94
2015-01-04T18:17:36.000Z
2021-11-18T04:51:22.000Z
lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm
clayne/Moose
3da4722b04814b5476e05cbab1d4b9a2e5128c63
[ "Artistic-1.0" ]
82
2015-01-01T18:57:16.000Z
2021-04-13T17:58:38.000Z
lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm
clayne/Moose
3da4722b04814b5476e05cbab1d4b9a2e5128c63
[ "Artistic-1.0" ]
69
2015-01-06T00:59:52.000Z
2022-01-17T16:52:38.000Z
package Moose::Meta::Method::Accessor::Native::Hash::get; our $VERSION = '2.2202'; use strict; use warnings; use Moose::Role; with 'Moose::Meta::Method::Accessor::Native::Reader', 'Moose::Meta::Method::Accessor::Native::Hash'; sub _minimum_arguments { 1 } sub _inline_check_arguments { my $self = shift; return ( 'for (@_) {', $self->_inline_check_var_is_valid_key('$_'), '}', ); } sub _return_value { my $self = shift; my ($slot_access) = @_; return '@_ > 1 ' . '? @{ (' . $slot_access . ') }{@_} ' . ': ' . $slot_access . '->{$_[0]}'; } no Moose::Role; 1;
18.083333
57
0.540707
ed6d646a6e3e60d0f5d7cbefb174c34ccc61d3a5
941
al
Perl
src/GaIA/pkgs/perl/ActivePerl-5.8.7.815-i686-linux-2.2.17-gcc-211909/perl/lib/site_perl/5.8.7/i686-linux-thread-multi/auto/Tk/Listbox/DataExtend.al
uninth/UNItools
c8b1fbfd5d3753b5b14fa19033e39737dedefc00
[ "BSD-3-Clause" ]
null
null
null
src/GaIA/pkgs/perl/ActivePerl-5.8.7.815-i686-linux-2.2.17-gcc-211909/perl/lib/site_perl/5.8.7/i686-linux-thread-multi/auto/Tk/Listbox/DataExtend.al
uninth/UNItools
c8b1fbfd5d3753b5b14fa19033e39737dedefc00
[ "BSD-3-Clause" ]
null
null
null
src/GaIA/pkgs/perl/ActivePerl-5.8.7.815-i686-linux-2.2.17-gcc-211909/perl/lib/site_perl/5.8.7/i686-linux-thread-multi/auto/Tk/Listbox/DataExtend.al
uninth/UNItools
c8b1fbfd5d3753b5b14fa19033e39737dedefc00
[ "BSD-3-Clause" ]
1
2021-06-08T15:59:26.000Z
2021-06-08T15:59:26.000Z
# NOTE: Derived from ../blib/lib/Tk/Listbox.pm. # Changes made here will be lost when autosplit is run again. # See AutoSplit.pm. package Tk::Listbox; #line 775 "../blib/lib/Tk/Listbox.pm (autosplit into ../blib/lib/auto/Tk/Listbox/DataExtend.al)" # DataExtend # # This procedure is called for key-presses such as Shift-KEndData. # If the selection mode isn't multiple or extend then it does nothing. # Otherwise it moves the active element to el and, if we're in # extended mode, extends the selection to that point. # # Arguments: # w - The listbox widget. # el - An integer element number. sub DataExtend { my $w = shift; my $el = shift; my $mode = $w->cget('-selectmode'); if ($mode eq 'extended') { $w->activate($el); $w->see($el); if ($w->selectionIncludes('anchor')) { $w->Motion($el) } } elsif ($mode eq 'multiple') { $w->activate($el); $w->see($el) } } # end of Tk::Listbox::DataExtend 1;
23.525
96
0.656748
ed72c9ca8c40a52e4af464f907114b9a41827ca7
353
t
Perl
samples/Turing/turing.t
barrettotte/linguist
accc1608083d5299e5a9929de0e91cac1fa6bff1
[ "MIT" ]
8,271
2015-01-01T15:04:43.000Z
2022-03-31T06:18:14.000Z
samples/Turing/turing.t
barrettotte/linguist
accc1608083d5299e5a9929de0e91cac1fa6bff1
[ "MIT" ]
3,238
2015-01-01T14:25:12.000Z
2022-03-30T17:37:51.000Z
samples/Turing/turing.t
barrettotte/linguist
accc1608083d5299e5a9929de0e91cac1fa6bff1
[ "MIT" ]
4,070
2015-01-01T11:40:51.000Z
2022-03-31T13:45:53.000Z
% Accepts a number and calculates its factorial function factorial (n: int) : real if n = 0 then result 1 else result n * factorial (n - 1) end if end factorial var n: int loop put "Please input an integer: " .. get n exit when n >= 0 put "Input must be a non-negative integer." end loop put "The factorial of ", n, " is ", factorial (n)
18.578947
49
0.668555
ed87798de09d1e2d8aec1b9b13cba5cdaf99ca9c
470
t
Perl
perl/t/TO/App/SystemMonitor/sub__loadConfiguration.t
god-of-hellfire/TO-App-SystemMonitor
862f1c4ef990afd6db034bd02fd29072572a4110
[ "MIT" ]
null
null
null
perl/t/TO/App/SystemMonitor/sub__loadConfiguration.t
god-of-hellfire/TO-App-SystemMonitor
862f1c4ef990afd6db034bd02fd29072572a4110
[ "MIT" ]
null
null
null
perl/t/TO/App/SystemMonitor/sub__loadConfiguration.t
god-of-hellfire/TO-App-SystemMonitor
862f1c4ef990afd6db034bd02fd29072572a4110
[ "MIT" ]
null
null
null
#!/usr/bin/env perl use warnings FATAL => 'all'; use strict; use Test::More tests => 2; use Test::Exception; BEGIN { no warnings; # Load testee use_ok('TO::App::SystemMonitor'); # Mock internal functions *TO::App::SystemMonitor::syslog = sub { return; }; *TO::App::SystemMonitor::LoadFile = sub { return; }; }; # Call _loadConfiguration w/o arguments is(TO::App::SystemMonitor::_loadConfiguration(), undef, 'Call _loadConfiguration w/o arguments');
18.8
97
0.682979
ed72fb7449d3e25a494877f404c138c228bee443
2,471
pm
Perl
auto-lib/Paws/Glacier/DescribeJob.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
2
2016-09-22T09:18:33.000Z
2017-06-20T01:36:58.000Z
auto-lib/Paws/Glacier/DescribeJob.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/Glacier/DescribeJob.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
null
null
null
package Paws::Glacier::DescribeJob; use Moose; has AccountId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'accountId' , required => 1); has JobId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'jobId' , required => 1); has VaultName => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'vaultName' , required => 1); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'DescribeJob'); class_has _api_uri => (isa => 'Str', is => 'ro', default => '/{accountId}/vaults/{vaultName}/jobs/{jobId}'); class_has _api_method => (isa => 'Str', is => 'ro', default => 'GET'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Glacier::GlacierJobDescription'); class_has _result_key => (isa => 'Str', is => 'ro'); 1; ### main pod documentation begin ### =head1 NAME Paws::Glacier::DescribeJob - Arguments for method DescribeJob on Paws::Glacier =head1 DESCRIPTION This class represents the parameters used for calling the method DescribeJob on the Amazon Glacier service. Use the attributes of this class as arguments to method DescribeJob. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to DescribeJob. As an example: $service_obj->DescribeJob(Att1 => $value1, Att2 => $value2, ...); Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. =head1 ATTRIBUTES =head2 B<REQUIRED> AccountId => Str The C<AccountId> value is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single aposC<->apos (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens (apos-apos) in the ID. =head2 B<REQUIRED> JobId => Str The ID of the job to describe. =head2 B<REQUIRED> VaultName => Str The name of the vault. =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method DescribeJob in L<Paws::Glacier> =head1 BUGS and CONTRIBUTIONS The source code is located here: https://github.com/pplu/aws-sdk-perl Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues =cut
32.513158
249
0.701335
ed93854bfeff23e706b83d1eec1c02943c4469ea
1,609
t
Perl
test/instrument/pattern/when.t
arvidj/bisect_ppx
c3b8b5cd6f74ecbcfb2b3a4ae2b172e3f1fd93a6
[ "MIT" ]
206
2016-05-04T08:38:33.000Z
2022-03-23T16:27:31.000Z
test/instrument/pattern/when.t
arvidj/bisect_ppx
c3b8b5cd6f74ecbcfb2b3a4ae2b172e3f1fd93a6
[ "MIT" ]
290
2016-04-02T18:05:29.000Z
2022-03-14T07:35:39.000Z
test/instrument/pattern/when.t
arvidj/bisect_ppx
c3b8b5cd6f74ecbcfb2b3a4ae2b172e3f1fd93a6
[ "MIT" ]
35
2016-05-11T17:15:58.000Z
2022-02-09T10:40:22.000Z
If there is a pattern guard, pattern instrumentation is placed on it instead. The nested expression gets a fresh instrumentation point, being the out-edge of the guard, rather than the pattern. $ bash ../test.sh <<'EOF' > let _ = > match `A `B with > | `A (`B | `C) when print_endline "foo"; true -> () > | _ -> () > EOF let _ = match `A `B with | `A (`B | `C) as ___bisect_matched_value___ when (match[@ocaml.warning "-4-8-9-11-26-27-28-33"] ___bisect_matched_value___ with | `A `B -> ___bisect_visit___ 1; () | `A `C -> ___bisect_visit___ 2; () | _ -> ()); ___bisect_post_visit___ 0 (print_endline "foo"); true -> ___bisect_visit___ 3; () | _ -> ___bisect_visit___ 4; () $ bash ../test.sh <<'EOF' > let _ = > match () with > | () -> () > | exception (Exit | Failure _) when print_endline "foo"; true -> () > EOF let _ = match () with | exception ((Exit | Failure _) as ___bisect_matched_value___) when (match[@ocaml.warning "-4-8-9-11-26-27-28-33"] ___bisect_matched_value___ with | Exit -> ___bisect_visit___ 2; () | Failure _ -> ___bisect_visit___ 3; () | _ -> ()); ___bisect_post_visit___ 0 (print_endline "foo"); true -> ___bisect_visit___ 4; () | () -> ___bisect_visit___ 1; ()
27.741379
79
0.487881
ed44a1505799a3c23b3ad49c78c75cc5f5c19387
3,078
pm
Perl
config/CELL_MetaConfig.pm
smithfarm/cell
bc5f11df46b45f65c729e8840868722f59da1af7
[ "BSD-3-Clause" ]
null
null
null
config/CELL_MetaConfig.pm
smithfarm/cell
bc5f11df46b45f65c729e8840868722f59da1af7
[ "BSD-3-Clause" ]
7
2015-07-30T08:53:55.000Z
2020-02-10T22:18:14.000Z
config/CELL_MetaConfig.pm
smithfarm/cell
bc5f11df46b45f65c729e8840868722f59da1af7
[ "BSD-3-Clause" ]
2
2016-09-03T10:15:02.000Z
2018-08-15T20:53:03.000Z
# ************************************************************************* # Copyright (c) 2014-2020, SUSE LLC # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # 3. Neither the name of SUSE LLC nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # ************************************************************************* #-------------------------------------------------------------# # CELL_MetaConfig.pm # # App::CELL's own site configuration parameters. This file # is stored in the "distro sharedir" and is always loaded # before the files in the application sitedir. # # In addition to being used by App::CELL, the files in the # distro sharedir (CELL_MetaConfig.pm, CELL_Config.pm, and # CELL_SiteConfig.pm along with CELL_Message_en.conf, # CELL_Message_cz.conf, etc.) can be used as models for # populating the application sitedir. # # See App::CELL::Guide for details. #-------------------------------------------------------------# # unique value used by App::CELL::Load::init routine sanity check set('CELL_LOAD_SANITY_META', 'Baz'); # boolean value expressing whether _any_ sitedir has been loaded this is # incremented on every sitedir load, so it also expresses how many sitedirs # have been loaded set('CELL_META_SITEDIR_LOADED', 0); # list of sitedirs found and loaded set('CELL_META_SITEDIR_LIST', []); # date and time when App::CELL was initialized set('CELL_META_START_DATETIME', ''); # for unit testing set( 'CELL_META_UNIT_TESTING', [ 1, 2, 3, 'a', 'b', 'c' ] ); #-------------------------------------------------------------# # DO NOT EDIT ANYTHING BELOW THIS LINE # #-------------------------------------------------------------# use strict; use warnings; 1;
42.75
77
0.659519
eda2aa5a8f41c6449eef4bbecea0d49a0ab3666f
775
pl
Perl
examples/ping_pong/pong.pl
Simerax/pErlang
80b5172b3bd94f52f97f0877215fa9496d8f45c2
[ "MIT" ]
null
null
null
examples/ping_pong/pong.pl
Simerax/pErlang
80b5172b3bd94f52f97f0877215fa9496d8f45c2
[ "MIT" ]
null
null
null
examples/ping_pong/pong.pl
Simerax/pErlang
80b5172b3bd94f52f97f0877215fa9496d8f45c2
[ "MIT" ]
null
null
null
#!perl use warnings; use strict; # :all really imports ALL # all Erlang types, Atom, Float, List, etc. # Functions encode and decode to read and send messages # you might just want to use :types to import the Erlang types use pErlang::Import qw(:all); main(); sub main { my ($ok, $msg) = decode(\*STDIN); # actually calls pErlang::Decode::decode() if($ok) { if($msg->isa('pErlang::Atom')) { if($msg eq 'ping') { # or $msg->name() # name method if atom type my $pong = Atom('pong'); print encode($pong); # same as decode } } } else { #when !$ok then the second value ($msg) contains an error string print STDERR "There was an error decoding the message: $msg\n"; } }
26.724138
80
0.583226
ed98d7860fa72105826e64fd12b7be536103c3c1
1,820
t
Perl
t/env.t
s1037989/Mojolicious-Plugin-Syslog
7949d7e793cec65c8971c8063dfcc1c82b67cab9
[ "ClArtistic" ]
2
2019-05-04T19:52:01.000Z
2022-03-26T14:00:15.000Z
t/env.t
s1037989/Mojolicious-Plugin-Syslog
7949d7e793cec65c8971c8063dfcc1c82b67cab9
[ "ClArtistic" ]
1
2019-09-20T06:31:10.000Z
2019-09-22T12:11:23.000Z
t/env.t
s1037989/Mojolicious-Plugin-Syslog
7949d7e793cec65c8971c8063dfcc1c82b67cab9
[ "ClArtistic" ]
1
2022-03-26T11:55:31.000Z
2022-03-26T11:55:31.000Z
use Mojo::Base -strict; use Test::Mojo; use Test::More; @main::openlog = (); @main::messages = (); mock_syslog(); use Mojolicious::Lite; get '/bar' => sub { die "Oops!\n" }; get '/foo' => sub { my $c = shift; Mojo::IOLoop->timer(0.1 => sub { $c->render(text => 'foo') }); }; $ENV{MOJO_SYSLOG_FACILITY} = 'local0'; $ENV{MOJO_SYSLOG_IDENT} = 'cool_app'; $ENV{MOJO_SYSLOG_LOGOPT} = 'pid'; $ENV{MOJO_SYSLOG_ENABLE} = '1'; $ENV{MOJO_SYSLOG_ACCESS_LOG} = '%H %P %C'; plugin syslog => {only_syslog => 1}; is_deeply \@main::openlog, [qw(cool_app pid local0)], 'openlog'; my $t = Test::Mojo->new; $t->app->log->level('info'); $t->get_ok('/foo')->status_is(200); $t->get_ok('/bar')->status_is(500); $t->get_ok('/baz')->status_is(404); my @expected = ( [L_INFO => qr{GET /foo 200}], [L_ERR => qr{Oops!}], [L_WARNING => qr{GET /bar 500}], [L_INFO => qr{GET /baz 404}], ); my $i = 0; while (@expected) { my $msg = shift @main::messages; my $exp = shift @expected; is $msg->[0], $exp->[0], "log level $i"; like $msg->[1], $exp->[1], "log message $i"; $i++; } done_testing; sub mock_syslog { $INC{'Sys/Syslog.pm'} = __FILE__; eval <<'HERE' or die $@; package Sys::Syslog; use Mojo::Util 'monkey_patch'; sub import { my $caller = caller; monkey_patch $caller => LOG_CRIT => sub { 'L_CRIT' }; monkey_patch $caller => LOG_DEBUG => sub { 'L_DEBUG' }; monkey_patch $caller => LOG_ERR => sub { 'L_ERR' }; monkey_patch $caller => LOG_INFO => sub { 'L_INFO' }; monkey_patch $caller => LOG_WARNING => sub { 'L_WARNING' }; monkey_patch $caller => LOG_USER => sub { die }; monkey_patch $caller => openlog => sub { push @main::openlog, @_ }; monkey_patch $caller => syslog => sub { push @main::messages, [shift, sprintf shift, @_] }; } 1; HERE }
25.277778
94
0.591758
ed9fdaa6b2ebd57db65a2824bf6fc97482c57788
1,285
pl
Perl
t/features/step_definitions/bind_steps.pl
debian-janitor/libnet-ldapapi-perl
70e265ebc11e2b359bb40bec7908bf397ee80e4a
[ "FSFAP" ]
null
null
null
t/features/step_definitions/bind_steps.pl
debian-janitor/libnet-ldapapi-perl
70e265ebc11e2b359bb40bec7908bf397ee80e4a
[ "FSFAP" ]
1
2017-12-27T19:51:01.000Z
2017-12-27T20:12:38.000Z
t/features/step_definitions/bind_steps.pl
debian-janitor/libnet-ldapapi-perl
70e265ebc11e2b359bb40bec7908bf397ee80e4a
[ "FSFAP" ]
2
2017-12-25T05:46:07.000Z
2021-09-01T03:33:02.000Z
#!/usr/bin/perl use strict; use warnings; #use Net::LDAPapi; use Test::More; use Test::BDD::Cucumber::StepFile; our %TestConfig = %main::TestConfig; When qr/I've (asynchronously )?bound with (.+?) authentication to the directory/, sub { my $async = $1 ? 1 : 0; my $type = lc($2); my $func = "bind_s"; my %args = (); if ($async) { $func = "bind"; } S->{'bind_async'} = $async; if ($type eq "default") { $type = lc($TestConfig{'ldap'}{'default_bind_type'}); } S->{'bind_type'} = $type; S->{'bind_result'} = "skipped"; if ($type eq "anonymous") { return if $TestConfig{'ldap'}{'bind_types'}{'anonymous'}{'enabled'} != 1; } elsif ($type eq "simple") { return if $TestConfig{'ldap'}{'bind_types'}{'simple'}{'enabled'} != 1; %args = ( -dn => $TestConfig{'ldap'}{'bind_types'}{'simple'}{'bind_dn'}, -password => $TestConfig{'ldap'}{'bind_types'}{'simple'}{'bind_pw'} ); } elsif ($type eq "sasl") { return if $TestConfig{'ldap'}{'bind_types'}{'sasl'}{'enabled'} != 1; S->{'object'}->sasl_parms(%{$TestConfig{'ldap'}{'bind_types'}{'sasl'}{'sasl_parms'}}); %args = ( -type => S->{'object'}->LDAP_AUTH_SASL ); } S->{'bind_result'} = S->{'object'}->$func(%args); }; 1;
23.796296
90
0.553307
ed78cb1d4815bafc282880c190d33940160adc95
805
pm
Perl
lib/Bio/RefBuild/Process/StarGenomeGenerateParamsProcess.pm
FAANG/reference_data_builder
a045c025c3ebe5c3c11cdd196d6053653a49e550
[ "Apache-2.0" ]
1
2017-01-13T18:02:15.000Z
2017-01-13T18:02:15.000Z
lib/Bio/RefBuild/Process/StarGenomeGenerateParamsProcess.pm
FAANG/reference_data_builder
a045c025c3ebe5c3c11cdd196d6053653a49e550
[ "Apache-2.0" ]
1
2015-10-23T09:03:58.000Z
2015-10-23T09:07:48.000Z
lib/Bio/RefBuild/Process/StarGenomeGenerateParamsProcess.pm
FAANG/reference_data_builder
a045c025c3ebe5c3c11cdd196d6053653a49e550
[ "Apache-2.0" ]
null
null
null
package Bio::RefBuild::Process::StarGenomeGenerateParamsProcess; use strict; use warnings; use base ('Bio::EnsEMBL::Hive::Process'); use Bio::RefBuild::Util::StarGenomeGenerateParams; use autodie; sub fetch_input { my ($self) = @_; my $fasta = $self->param_required('fasta_file'); } sub write_output { my ($self) = @_; my $fasta_file_name = $self->param_required('fasta_file'); my $in_fh; if ( $fasta_file_name =~ m/\.gz$/ ) { open( $in_fh, '-|', 'gzip', '-dc', $fasta_file_name ); } else { open( $in_fh, '<', $fasta_file_name ); } my $param_calc = Bio::RefBuild::Util::StarGenomeGenerateParams->new( fasta_in_fh => $in_fh, ); my $params = $param_calc->calculate_params; $self->dataflow_output_id( $params, 1 ); } 1;
20.125
80
0.618634
ed7ec67ca77408f7a3a0f9f6d01612f78ce3b39c
2,394
pm
Perl
lib/WebService/Hexonet/Connector/Column.pm
hexonet/perl-sdk
6e57bc7fd56f89a9cd894853505caea87a822aff
[ "MIT" ]
null
null
null
lib/WebService/Hexonet/Connector/Column.pm
hexonet/perl-sdk
6e57bc7fd56f89a9cd894853505caea87a822aff
[ "MIT" ]
51
2019-04-03T15:40:49.000Z
2022-03-23T15:35:27.000Z
lib/WebService/Hexonet/Connector/Column.pm
hexonet/perl-sdk
6e57bc7fd56f89a9cd894853505caea87a822aff
[ "MIT" ]
null
null
null
package WebService::Hexonet::Connector::Column; use 5.030; use strict; use warnings; our $VERSION = 'v2.2.0'; sub new { my ( $class, $key, @data ) = @_; my $self = {}; $self->{key} = $key; @{ $self->{data} } = @data; $self->{length} = scalar @data; return bless $self, $class; } sub getKey { my $self = shift; return $self->{key}; } sub getData { my $self = shift; return $self->{data}; } sub getDataByIndex { my $self = shift; my $idx = shift; return $self->{data}[ $idx ] if $self->hasDataIndex($idx); return; } sub hasDataIndex { my $self = shift; my $idx = shift; return $idx < $self->{length}; } 1; __END__ =pod =head1 NAME WebService::Hexonet::Connector::Column - Library to cover API response data in column-based way. =head1 SYNOPSIS This module is internally used by the L<WebService::Hexonet::Connector::Response|WebService::Hexonet::Connector::Response> module. To be used in the way: # specify the column name $key = "DOMAIN"; # specify the column data as array @data = ('mydomain.com', 'mydomain.net'); # create a new instance by $col = WebService::Hexonet::Connector::Column->new($key, @data); =head1 DESCRIPTION HEXONET Backend API always responds in plain-text format that needs to get parsed into a useful data structure. For simplifying data access we created this library and also the Record library to provide an additional and more customerfriendly way to access data. Previously getHash and getListHash were the only possibilities to access data in Response library. =head2 Methods =over =item C<new( $key, @data )> Returns a new L<WebService::Hexonet::Connector::Column|WebService::Hexonet::Connector::Column> object. Specify the column name in $key and the column data in @data. =item C<getKey> Returns the column name as string. =item C<getData> Returns the full column data as array. =item C<getDataByIndex( $index )> Returns the column data of the specified index as scalar. Returns undef if not found. =item C<hasDataIndex( $index )> Checks if the given index exists in the column data. Returns boolean 0 or 1. =back =head1 LICENSE AND COPYRIGHT This program is licensed under the L<MIT License|https://raw.githubusercontent.com/hexonet/perl-sdk/master/LICENSE>. =head1 AUTHOR L<HEXONET GmbH|https://www.hexonet.net> =cut
20.637931
130
0.691312
ed83acb89f1df772b08a1bf1e7377706951460cc
2,821
pm
Perl
t/lib/TestServer/Users.pm
mjgardner/JIRA-REST-Class
9d8f065425eef06e42bd2afd734657736580ca41
[ "Artistic-2.0" ]
2
2016-12-12T19:27:16.000Z
2019-03-28T16:05:50.000Z
t/lib/TestServer/Users.pm
mjgardner/JIRA-REST-Class
9d8f065425eef06e42bd2afd734657736580ca41
[ "Artistic-2.0" ]
9
2016-12-07T00:10:54.000Z
2018-01-22T19:02:22.000Z
t/lib/TestServer/Users.pm
mjgardner/JIRA-REST-Class
9d8f065425eef06e42bd2afd734657736580ca41
[ "Artistic-2.0" ]
5
2016-12-05T21:48:18.000Z
2017-05-26T09:28:24.000Z
package TestServer::Users; use base qw( TestServer::Plugin ); use strict; use warnings; use 5.010; use JSON; sub import { my $class = __PACKAGE__; $class->register_dispatch( '/rest/api/latest/myself' => sub { $class->myself(@_) }, ); } sub myself { my ( $class, $server, $cgi ) = @_; return $class->response($server, $class->user($server, $cgi, 'packy')); } sub user { my ( $class, $server, $cgi, $key ) = @_; my ($user) = grep { $_->{key} eq $key } @{ $class->users($server, $cgi) }; return $user; } sub minuser { my ( $class, $server, $cgi, $key ) = @_; my $user = $class->user($server, $cgi, $key); my $min = {}; foreach my $k ( qw/ active avatarUrls displayName key name self / ) { $min->{$k} = $user->{$k}; } return $min; } sub users { my ( $class, $server, $cgi ) = @_; my $url = "http://localhost:" . $server->port; my $grav_packy = 'http://www.gravatar.com/avatar/' . 'eec44a1b7d907db7922446f61898bffc?d=mm'; my $grav_nobody = 'http://www.gravatar.com/avatar/' . '54c28ffbbe4efe304714c42dd5d713ce?d=mm'; return [ { active => JSON::PP::true, applicationRoles => { items => [], size => 1 }, avatarUrls => { "16x16" => "$grav_packy&s=16", "24x24" => "$grav_packy&s=24", "32x32" => "$grav_packy&s=32", "48x48" => "$grav_packy&s=48" }, displayName => "Packy Anderson", emailAddress => 'packy\@cpan.org', expand => "groups,applicationRoles", groups => { items => [], size => 2 }, key => "packy", locale => "en_US", name => "packy", self => "$url/rest/api/2/user?username=packy", timeZone => "America/New_York" }, { active => JSON::PP::true, applicationRoles => { items => [], size => 1 }, avatarUrls => { "16x16" => "$grav_nobody&s=16", "24x24" => "$grav_nobody&s=24", "32x32" => "$grav_nobody&s=32", "48x48" => "$grav_nobody&s=48" }, displayName => "Kay Koch", emailAddress => 'packy\@cpan.org', expand => "groups,applicationRoles", groups => { items => [], size => 1 }, key => "kelonzi", locale => "en_US", name => "kelonzi", self => "$url/rest/api/2/user?username=kelonzi", timeZone => "America/New_York" } ]; } 1;
25.1875
75
0.442396
ed9a7616ff5241700fb49bb48f23616a5a93aefc
11,711
pm
Perl
4_trans/Load.pm
mishin/presentation
026cc0e41ad8e9bec64f4579e511fe3f83ab231f
[ "Apache-2.0" ]
4
2015-07-02T17:12:22.000Z
2021-11-28T14:35:04.000Z
4_trans/Load.pm
mishin/presentation
026cc0e41ad8e9bec64f4579e511fe3f83ab231f
[ "Apache-2.0" ]
2
2015-06-28T12:46:34.000Z
2021-07-06T10:31:25.000Z
4_trans/Load.pm
mishin/presentation
026cc0e41ad8e9bec64f4579e511fe3f83ab231f
[ "Apache-2.0" ]
1
2015-06-28T09:52:08.000Z
2015-06-28T09:52:08.000Z
package FBS::Load; use 5.01; use warnings; use strict; use Carp; use Smart::Comments; use POSIX; use Test::More; our ( @ISA, $VERSION, @EXPORT_OK ); BEGIN { $VERSION = '0.0.1'; require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(get_user_param get_connect get_cobdate_sql welcome_cob_date test_10_persent); } #use version; #my $VERSION = qv('0.0.1'); # Other recommended modules (uncomment to use): #use IO::Prompt; #use Perl6::Export; #use Perl6::Slurp; #use Perl6::Say; #use YAML::Tiny; use YAML::Tiny; #read config sub get_user_param { my ( $pwd, $config_name ) = @_; my $my_yml_file = $pwd . qq{/$config_name}; # Open the config my $yaml = YAML::Tiny::LoadFile($my_yml_file); return $yaml; } #conn to database sub get_connect_string { my $yaml = shift; my $init_user = shift; my $user = $yaml->{ $init_user . '_un' }; my $password = $yaml->{ $init_user . '_pw' }; my $prod_database_tns = $yaml->{prod_database_tns}; my $driver = $yaml->{driver}; #return " sqlsh -d DBI:$driver:$prod_database_tns -u $user -p $password -i < "; my $connections; my $MAX_TRIES = 3; TRY: for my $try ( 1 .. $MAX_TRIES ) { ### Connecting to server $prod_database_tns under user $user... done $connections = DBI->connect( 'dbi:' . $driver . ':' . $prod_database_tns, $user, $password ); last TRY if $connections; } croak "Can't contact server ($prod_database_tns)" if not $connections; return $connections; } # # make connect to database # sub get_connect { my $ref_init_users = shift; my $yaml = shift; my @init_users = @{$ref_init_users}; my %connect_of; for my $user (@init_users) { $connect_of{$user} = get_connect_string( $yaml, $user ); } return \%connect_of; } # # get sql for search COB_DATE # sub get_cobdate_sql { return <<END; select to_char(t.cob_date, 'yyyy-mm-dd') cd, to_char(t.cob_date, 'dd-Mon-yyyy') cd_disp, case when t.is_tue_cob = 1 then 'WE' when t.is_me_cob = 1 then 'ME' else 'WE' end we_name from fbs_owner.FBS_COB_DATES t where cob_date <= sysdate -- + 6 and rownum < 2 order by t.cob_date desc END } # # get sql for search COB_DATE # sub welcome_cob_date { my ( $rwa_owner_user, $ref_ini ) = @_; my ( $ref_connect, $ref_cd ) = @{$ref_ini}; my %connect_of = %{$ref_connect}; my ( $cob_date, $cob_date_display, $we_name ) = @{$ref_cd}; my $now_time = get_now( $rwa_owner_user, $ref_connect, $cob_date ); my $BST = "London time:\t" . DateTime->now->set_time_zone("Europe/London")->iso8601; my $disp = qq{ For COB_DATE=$cob_date 1 http://jira.gto.intranet.db.com:2020/jira/secure/Dashboard.jspa 2 Create Issue ('c') Project : FRM Disclosures Support; Issue Type: Production support; Create -> sybmit Priority->Medium;Component/s->FBS Title ->$we_name FBS load $cob_date_display ========================================================== Description ========================================================== For $we_name FBS load it needs to: * do regular FBS data load (fcl_copy_tuned_new_prod.sh for FCL_COPY, EUS script) * check manually FxRates table load * check manually DB_INSTRUMENT tables load * prepare checking counts report Component/s: FBS Assignee: "Assign To Me" Priority: Medium (don't change) ========================================================== add Watchers (nicks for speed) ========================================================== eealina,marlch,herrdx,agrahar,bhnehas ========================================================== NOW_TIME: $now_time BST_TIME: $BST ========================================================== add number of Jira to "runs history" in https://wiki.tools.intranet.db.com/confluence/display/FCL/FBS+Production+Life+Cycle }; return $disp; } # # data in t+1 10pm fiormat, where t=COB_DATE # sub get_now { my ( $rwa_owner_user, $ref_connect, $cob_date ) = @_; my %connect_of = %{$ref_connect}; my $sql = q{}; $sql = <<"END"; select 't+'||round(trunc(sysdate)- to_date('$cob_date','yyyy-mm-dd'))||' '||to_char(sysdate,'hham') "Time Now" from dual END my $dbh = $connect_of{$rwa_owner_user}; my $now = $dbh->selectrow_array($sql); return $now; #select 't+'||round(sysdate- to_date('$cob_date','yyyy-mm-dd'))||' '||to_char(sysdate,'hhmiam') "Time Now" from dual } #test if bigger or lower not lower then 10% sub test_10_persent { my ( $calc_value, $orig_value, $persent, $message ) = @_; if ( $calc_value >= $orig_value ) { cmp_ok( $calc_value, '>=', $orig_value, $message . " $calc_value >= $orig_value " ); } else { my $cal_persent = floor( abs( ( ( $calc_value - $orig_value ) / $orig_value ) * 100 ) ); cmp_ok( $cal_persent, '<=', $persent, $message . " $calc_value <= $orig_value but not lower then 10 %" ); } } # Module implementation here 1; # Magic true value required at end of module __END__ =head1 NAME FBS::Load - [Weekly load FBS data in group SL3 . Automate some operation and stored rules in local database. SQL::Lite] =head1 VERSION This document describes FBS::Load version 0.0.1 =head1 SYNOPSIS use FBS::Load; =for author to fill in: Brief code example(s) here showing commonest usage(s). This section will be as far as many users bother reading so make it as educational and exeplary as possible. =head1 DESCRIPTION =for author to fill in: Write a full description of the module and its features here. Use subsections (=head2, =head3) as appropriate. =head1 INTERFACE =for author to fill in: Write a separate section listing the public components of the modules interface. These normally consist of either subroutines that may be exported, or methods that may be called on objects belonging to the classes provided by the module. =head2 Methods =over 4 =item * C<< get_user_param ( $pwd, $config_name ) >> =item * my $yaml = get_user_param( $ENV{PWD}, 'fbs_load.yml' ); #Global hash with parameters Read ini file_name as input parameter in YAML in current directory.Returns hash $yaml. =item * C<< get_connect_string ( $yaml, $init_user ) >> =item * $connect_of{$user} = get_connect_string( $yaml, $user ); Read connect parameters from $yaml hash, make connect string and make connect to database: =item * C<< get_connect ( \@init_user_connects, $yaml ) >> =item * my %connect_of = ();my $ref_connect = \%connect_of; =item * my $ref_connect = get_connect( \@init_user_connects, $yaml ); %connect_of = %{$ref_connect}; Make connect to appropriate database =item * C<< get_cobdate_sql ( ) >> =item * my $ref_cd = $dbh_fbs->selectrow_arrayref( get_cobdate_sql() ); Return sql for find COB_DATE from fbs_owner.FBS_COB_DATES =item * C<< welcome_cob_date ( $rwa_owner_user, $ref_ini ) >> =item * my $echo_curr_fbsl_load = welcome_cob_date($rwa_owner_user, $ref_ini); =item * print $echo_curr_fbsl_load; Return current FBS load parameters for create Jira and information needed to add to Confluence. =item * C<< get_now ( $rwa_owner_user, $ref_connect, $ref_cd ) >> =item * my $now_time = get_now($rwa_owner_user, $ref_connect,$cob_date); Return date in format t+1 10pm where t - COB_DATE. =item * C<< test_10_persent( $calc_value, $orig_value, $persent, $message ) >> =item * test is passed if the result is more or less does not less than 10 per cent use Test::More qw/no_plan/; use POSIX; my $calc_value = 22; my $orig_value = 20; my $persent = 10; #% my $message = 'MIS'; test_10_persent( $calc_value, $orig_value, $persent, $message ); =back =head1 DIAGNOSTICS =for author to fill in: List every single error and warning message that the module can generate (even the ones that will "never happen"), with a full explanation of each problem, one or more likely causes, and any suggested remedies. =over =item C<< Error message here, perhaps with %s placeholders >> [Description of error here] =item C<< Another error message here >> [Description of error here] [Et cetera, et cetera] =back =head1 CONFIGURATION AND ENVIRONMENT =for author to fill in: A full explanation of any configuration system(s) used by the module, including the names and locations of any configuration files, and the meaning of any environment variables or properties that can be set. These descriptions must also include details of any configuration language used. FBS::Load requires no configuration files or environment variables. =head1 DEPENDENCIES =for author to fill in: A list of all the other modules that this module relies upon, including any restrictions on versions, and an indication whether the module is part of the standard Perl distribution, part of the module's distribution, or must be installed separately. ] None. =head1 INCOMPATIBILITIES =for author to fill in: A list of any modules that this module cannot be used in conjunction with. This may be due to name conflicts in the interface, or competition for system or program resources, or due to internal limitations of Perl (for example, many modules that use source code filters are mutually incompatible). None reported. =head1 BUGS AND LIMITATIONS =for author to fill in: A list of known problems with the module, together with some indication Whether they are likely to be fixed in an upcoming release. Also a list of restrictions on the features the module does provide: data types that cannot be handled, performance issues and the circumstances in which they may arise, practical limitations on the size of data sets, special cases that are not (yet) handled, etc. No bugs have been reported. Please report any bugs or feature requests to C<bug-fbs-load@rt.cpan.org>, or through the web interface at L<http://rt.cpan.org>. =head1 AUTHOR Nikolay Mishin C<< <mi@ya.ru> >> =head1 LICENCE AND COPYRIGHT Copyright (c) 2011, Nikolay Mishin C<< <mi@ya.ru> >>. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L<perlartistic>. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. 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 SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
29.424623
120
0.670993
eda500312bdbc6ac1806049b8f2a316b1d0a1c69
5,147
pl
Perl
asm/des686.pl
ClausKlein/libdes
aa2aebe0586d2cfb591914b614145323197a6783
[ "FSFAP" ]
null
null
null
asm/des686.pl
ClausKlein/libdes
aa2aebe0586d2cfb591914b614145323197a6783
[ "FSFAP" ]
null
null
null
asm/des686.pl
ClausKlein/libdes
aa2aebe0586d2cfb591914b614145323197a6783
[ "FSFAP" ]
null
null
null
#!/usr/local/bin/perl $prog="des686.pl"; # base code is in microsft # op dest, source # format. # # WILL NOT WORK ANYMORE WITH desboth.pl require "desboth.pl"; if ( ($ARGV[0] eq "elf")) { require "x86unix.pl"; } elsif ( ($ARGV[0] eq "a.out")) { $aout=1; require "x86unix.pl"; } elsif ( ($ARGV[0] eq "sol")) { $sol=1; require "x86unix.pl"; } elsif ( ($ARGV[0] eq "cpp")) { $cpp=1; require "x86unix.pl"; } elsif ( ($ARGV[0] eq "win32")) { require "x86ms.pl"; } else { print STDERR <<"EOF"; Pick one target type from elf - linux, FreeBSD etc a.out - old linux sol - x86 solaris cpp - format so x86unix.cpp can be used win32 - Windows 95/Windows NT EOF exit(1); } &comment("Don't even think of reading this code"); &comment("It was automatically generated by $prog"); &comment("Which is a perl program used to generate the x86 assember for"); &comment("any of elf, a.out, Win32, or Solaris"); &comment("It can be found in SSLeay 0.6.5+ or in libdes 3.26+"); &comment("eric <eay\@mincom.oz.au>"); &comment(""); &file("dx86xxxx"); $L="edi"; $R="esi"; &des_encrypt("des_encrypt",1); &des_encrypt("des_encrypt2",0); &des_encrypt3("des_encrypt3",1); &des_encrypt3("des_decrypt3",0); &file_end(); sub des_encrypt { local($name,$do_ip)=@_; &function_begin($name,3); &comment(""); &comment("Load the 2 words"); &mov("eax",&wparam(0)); &mov($L,&DWP(0,"eax","",0)); &mov($R,&DWP(4,"eax","",0)); $ksp=&wparam(1); if ($do_ip) { &comment(""); &comment("IP"); &IP($L,$R,"eax"); } &comment(""); &comment("fixup rotate"); &rotl($R,3); &rotl($L,3); &exch($L,$R); &comment(""); &comment("load counter, key_schedule and enc flag"); &mov("eax",&wparam(2)); # get encrypt flag &mov("ebp",&wparam(1)); # get ks &cmp("eax","0"); &je(&label("start_decrypt")); # encrypting part for ($i=0; $i<16; $i+=2) { &comment(""); &comment("Round $i"); &D_ENCRYPT($L,$R,$i*2,"ebp","des_SPtrans","ecx","edx","eax","ebx"); &comment(""); &comment("Round ".sprintf("%d",$i+1)); &D_ENCRYPT($R,$L,($i+1)*2,"ebp","des_SPtrans","ecx","edx","eax","ebx"); } &jmp(&label("end")); &set_label("start_decrypt"); for ($i=15; $i>0; $i-=2) { &comment(""); &comment("Round $i"); &D_ENCRYPT($L,$R,$i*2,"ebp","des_SPtrans","ecx","edx","eax","ebx"); &comment(""); &comment("Round ".sprintf("%d",$i-1)); &D_ENCRYPT($R,$L,($i-1)*2,"ebp","des_SPtrans","ecx","edx","eax","ebx"); } &set_label("end"); &comment(""); &comment("Fixup"); &rotr($L,3); # r &rotr($R,3); # l if ($do_ip) { &comment(""); &comment("FP"); &FP($R,$L,"eax"); } &mov("eax",&wparam(0)); &mov(&DWP(0,"eax","",0),$L); &mov(&DWP(4,"eax","",0),$R); &function_end($name); } # The logic is to load R into 2 registers and operate on both at the same time. # We also load the 2 R's into 2 more registers so we can do the 'move word down a byte' # while also masking the other copy and doing a lookup. We then also accumulate the # L value in 2 registers then combine them at the end. sub D_ENCRYPT { local($L,$R,$S,$ks,$desSP,$u,$t,$tmp1,$tmp2,$tmp3)=@_; &mov( $u, &DWP(&n2a($S*4),$ks,"",0)); &mov( $t, &DWP(&n2a(($S+1)*4),$ks,"",0)); &xor( $u, $R ); &xor( $t, $R ); &rotr( $t, 4 ); # the numbers at the end of the line are origional instruction order &mov( $tmp2, $u ); # 1 2 &mov( $tmp1, $t ); # 1 1 &and( $tmp2, "0xfc" ); # 1 4 &and( $tmp1, "0xfc" ); # 1 3 &shr( $t, 8 ); # 1 5 &xor( $L, &DWP("0x100+$desSP",$tmp1,"",0)); # 1 7 &shr( $u, 8 ); # 1 6 &mov( $tmp1, &DWP(" $desSP",$tmp2,"",0)); # 1 8 &mov( $tmp2, $u ); # 2 2 &xor( $L, $tmp1 ); # 1 9 &and( $tmp2, "0xfc" ); # 2 4 &mov( $tmp1, $t ); # 2 1 &and( $tmp1, "0xfc" ); # 2 3 &shr( $t, 8 ); # 2 5 &xor( $L, &DWP("0x300+$desSP",$tmp1,"",0)); # 2 7 &shr( $u, 8 ); # 2 6 &mov( $tmp1, &DWP("0x200+$desSP",$tmp2,"",0)); # 2 8 &mov( $tmp2, $u ); # 3 2 &xor( $L, $tmp1 ); # 2 9 &and( $tmp2, "0xfc" ); # 3 4 &mov( $tmp1, $t ); # 3 1 &shr( $u, 8 ); # 3 6 &and( $tmp1, "0xfc" ); # 3 3 &shr( $t, 8 ); # 3 5 &xor( $L, &DWP("0x500+$desSP",$tmp1,"",0)); # 3 7 &mov( $tmp1, &DWP("0x400+$desSP",$tmp2,"",0)); # 3 8 &and( $t, "0xfc" ); # 4 1 &xor( $L, $tmp1 ); # 3 9 &and( $u, "0xfc" ); # 4 2 &xor( $L, &DWP("0x700+$desSP",$t,"",0)); # 4 3 &xor( $L, &DWP("0x600+$desSP",$u,"",0)); # 4 4 } sub PERM_OP { local($a,$b,$tt,$shift,$mask)=@_; &mov( $tt, $a ); &shr( $tt, $shift ); &xor( $tt, $b ); &and( $tt, $mask ); &xor( $b, $tt ); &shl( $tt, $shift ); &xor( $a, $tt ); } sub IP { local($l,$r,$tt)=@_; &PERM_OP($r,$l,$tt, 4,"0x0f0f0f0f"); &PERM_OP($l,$r,$tt,16,"0x0000ffff"); &PERM_OP($r,$l,$tt, 2,"0x33333333"); &PERM_OP($l,$r,$tt, 8,"0x00ff00ff"); &PERM_OP($r,$l,$tt, 1,"0x55555555"); } sub FP { local($l,$r,$tt)=@_; &PERM_OP($l,$r,$tt, 1,"0x55555555"); &PERM_OP($r,$l,$tt, 8,"0x00ff00ff"); &PERM_OP($l,$r,$tt, 2,"0x33333333"); &PERM_OP($r,$l,$tt,16,"0x0000ffff"); &PERM_OP($l,$r,$tt, 4,"0x0f0f0f0f"); } sub n2a { sprintf("%d",$_[0]); }
22.281385
87
0.5238
ed595c8f0b09746fea46cf7905097b32811e1314
443
pm
Perl
auto-lib/Paws/ECRPublic/PutImageResponse.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
164
2015-01-08T14:58:53.000Z
2022-02-20T19:16:24.000Z
auto-lib/Paws/ECRPublic/PutImageResponse.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
348
2015-01-07T22:08:38.000Z
2022-01-27T14:34:44.000Z
auto-lib/Paws/ECRPublic/PutImageResponse.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
87
2015-04-22T06:29:47.000Z
2021-09-29T14:45:55.000Z
package Paws::ECRPublic::PutImageResponse; use Moose; has Image => (is => 'ro', isa => 'Paws::ECRPublic::Image', traits => ['NameInRequest'], request_name => 'image' ); has _request_id => (is => 'ro', isa => 'Str'); ### main pod documentation begin ### =head1 NAME Paws::ECRPublic::PutImageResponse =head1 ATTRIBUTES =head2 Image => L<Paws::ECRPublic::Image> Details of the image uploaded. =head2 _request_id => Str =cut 1;
16.407407
116
0.659142
ed0837a977bc740cf7f0f39ff3b997a79742de2f
142
pl
Perl
MCA/5th Sem/Theory & Practical/Compiler Design/CDPractical/Melvin/SP/Q3.pl
peace-shillong/Computer-Applications-Theory-and-Practical-Part-2
fecab1b992fde6b7e0bdb7e93077725090b92d9b
[ "MIT" ]
null
null
null
MCA/5th Sem/Theory & Practical/Compiler Design/CDPractical/Melvin/SP/Q3.pl
peace-shillong/Computer-Applications-Theory-and-Practical-Part-2
fecab1b992fde6b7e0bdb7e93077725090b92d9b
[ "MIT" ]
null
null
null
MCA/5th Sem/Theory & Practical/Compiler Design/CDPractical/Melvin/SP/Q3.pl
peace-shillong/Computer-Applications-Theory-and-Practical-Part-2
fecab1b992fde6b7e0bdb7e93077725090b92d9b
[ "MIT" ]
null
null
null
#!/usr/bin/perl print "Enter radius: "; $r=<STDIN>; chomp($r); $d=$r*$r; $c=2*3.14*$r*$r; print "Diameter is $d \nCircumference is $c \n";
12.909091
48
0.577465
ed17e1b843327d4a7de78caa3c222dd8f2d15121
2,466
pm
Perl
auto-lib/Paws/RDS/CloudwatchLogsExportConfiguration.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
164
2015-01-08T14:58:53.000Z
2022-02-20T19:16:24.000Z
auto-lib/Paws/RDS/CloudwatchLogsExportConfiguration.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
348
2015-01-07T22:08:38.000Z
2022-01-27T14:34:44.000Z
auto-lib/Paws/RDS/CloudwatchLogsExportConfiguration.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
87
2015-04-22T06:29:47.000Z
2021-09-29T14:45:55.000Z
# Generated by default/object.tt package Paws::RDS::CloudwatchLogsExportConfiguration; use Moose; has DisableLogTypes => (is => 'ro', isa => 'ArrayRef[Str|Undef]'); has EnableLogTypes => (is => 'ro', isa => 'ArrayRef[Str|Undef]'); 1; ### main pod documentation begin ### =head1 NAME Paws::RDS::CloudwatchLogsExportConfiguration =head1 USAGE This class represents one of two things: =head3 Arguments in a call to a service Use the attributes of this class as arguments to methods. You shouldn't make instances of this class. Each attribute should be used as a named argument in the calls that expect this type of object. As an example, if Att1 is expected to be a Paws::RDS::CloudwatchLogsExportConfiguration object: $service_obj->Method(Att1 => { DisableLogTypes => $value, ..., EnableLogTypes => $value }); =head3 Results returned from an API call Use accessors for each attribute. If Att1 is expected to be an Paws::RDS::CloudwatchLogsExportConfiguration object: $result = $service_obj->Method(...); $result->Att1->DisableLogTypes =head1 DESCRIPTION The configuration setting for the log types to be enabled for export to CloudWatch Logs for a specific DB instance or DB cluster. The C<EnableLogTypes> and C<DisableLogTypes> arrays determine which logs will be exported (or not exported) to CloudWatch Logs. The values within these arrays depend on the DB engine being used. For more information about exporting CloudWatch Logs for Amazon RDS DB instances, see Publishing Database Logs to Amazon CloudWatch Logs (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch) in the I<Amazon RDS User Guide>. For more information about exporting CloudWatch Logs for Amazon Aurora DB clusters, see Publishing Database Logs to Amazon CloudWatch Logs (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch) in the I<Amazon Aurora User Guide>. =head1 ATTRIBUTES =head2 DisableLogTypes => ArrayRef[Str|Undef] The list of log types to disable. =head2 EnableLogTypes => ArrayRef[Str|Undef] The list of log types to enable. =head1 SEE ALSO This class forms part of L<Paws>, describing an object used in L<Paws::RDS> =head1 BUGS and CONTRIBUTIONS The source code is located here: L<https://github.com/pplu/aws-sdk-perl> Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> =cut
30.825
127
0.773723
ed8550de8a491cdd80e1f451f21eb3e62c06dc5b
7,214
pl
Perl
external/webkit/Tools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl
ghsecuritylab/android_platform_sony_nicki
526381be7808e5202d7865aa10303cb5d249388a
[ "Apache-2.0" ]
15
2015-05-25T19:28:05.000Z
2021-05-03T09:21:22.000Z
Tools/Tools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl
FMSoftCN/mdolphin-core
48ffdcf587a48a7bb4345ae469a45c5b64ffad0e
[ "Apache-2.0" ]
2
2017-07-25T09:37:22.000Z
2017-08-04T07:18:56.000Z
Tools/Tools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl
FMSoftCN/mdolphin-core
48ffdcf587a48a7bb4345ae469a45c5b64ffad0e
[ "Apache-2.0" ]
7
2019-01-30T08:56:04.000Z
2021-11-19T16:14:54.000Z
#!/usr/bin/perl -w # # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) # # 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 Apple Computer, Inc. ("Apple") 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. # Unit tests of parseSvnDiffHeader(). use strict; use warnings; use Test::More; use VCSUtils; # The array of test cases. my @testCaseHashRefs = ( { # New test diffName => "simple diff", inputText => <<'END', Index: WebKitTools/Scripts/VCSUtils.pm =================================================================== --- WebKitTools/Scripts/VCSUtils.pm (revision 53004) +++ WebKitTools/Scripts/VCSUtils.pm (working copy) @@ -32,6 +32,7 @@ use strict; use warnings; END expectedReturn => [ { svnConvertedText => <<'END', Index: WebKitTools/Scripts/VCSUtils.pm =================================================================== --- WebKitTools/Scripts/VCSUtils.pm (revision 53004) +++ WebKitTools/Scripts/VCSUtils.pm (working copy) END indexPath => "WebKitTools/Scripts/VCSUtils.pm", sourceRevision => "53004", }, "@@ -32,6 +32,7 @@ use strict;\n"], expectedNextLine => " use warnings;\n", }, { # New test diffName => "new file", inputText => <<'END', Index: WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl =================================================================== --- WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0) +++ WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0) @@ -0,0 +1,262 @@ +#!/usr/bin/perl -w END expectedReturn => [ { svnConvertedText => <<'END', Index: WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl =================================================================== --- WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0) +++ WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0) END indexPath => "WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl", isNew => 1, }, "@@ -0,0 +1,262 @@\n"], expectedNextLine => "+#!/usr/bin/perl -w\n", }, { # New test diffName => "copied file", inputText => <<'END', Index: index_path.py =================================================================== --- index_path.py (revision 53048) (from copied_from_path.py:53048) +++ index_path.py (working copy) @@ -0,0 +1,7 @@ +# Python file... END expectedReturn => [ { svnConvertedText => <<'END', Index: index_path.py =================================================================== --- index_path.py (revision 53048) (from copied_from_path.py:53048) +++ index_path.py (working copy) END copiedFromPath => "copied_from_path.py", indexPath => "index_path.py", sourceRevision => 53048, }, "@@ -0,0 +1,7 @@\n"], expectedNextLine => "+# Python file...\n", }, { # New test diffName => "contains \\r\\n lines", inputText => <<END, # No single quotes to allow interpolation of "\r" Index: index_path.py\r ===================================================================\r --- index_path.py (revision 53048)\r +++ index_path.py (working copy)\r @@ -0,0 +1,7 @@\r +# Python file...\r END expectedReturn => [ { svnConvertedText => <<END, # No single quotes to allow interpolation of "\r" Index: index_path.py\r ===================================================================\r --- index_path.py (revision 53048)\r +++ index_path.py (working copy)\r END indexPath => "index_path.py", sourceRevision => 53048, }, "@@ -0,0 +1,7 @@\r\n"], expectedNextLine => "+# Python file...\r\n", }, { # New test diffName => "contains path corrections", inputText => <<'END', Index: index_path.py =================================================================== --- bad_path (revision 53048) (from copied_from_path.py:53048) +++ bad_path (working copy) @@ -0,0 +1,7 @@ +# Python file... END expectedReturn => [ { svnConvertedText => <<'END', Index: index_path.py =================================================================== --- index_path.py (revision 53048) (from copied_from_path.py:53048) +++ index_path.py (working copy) END copiedFromPath => "copied_from_path.py", indexPath => "index_path.py", sourceRevision => 53048, }, "@@ -0,0 +1,7 @@\n"], expectedNextLine => "+# Python file...\n", }, #### # Binary test cases ## { # New test diffName => "binary file", inputText => <<'END', Index: test_file.swf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: test_file.swf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA== END expectedReturn => [ { svnConvertedText => <<'END', Index: test_file.swf =================================================================== Cannot display: file marked as a binary type. END indexPath => "test_file.swf", isBinary => 1, }, "svn:mime-type = application/octet-stream\n"], expectedNextLine => "\n", }, ); my $testCasesCount = @testCaseHashRefs; plan(tests => 2 * $testCasesCount); # Total number of assertions. foreach my $testCase (@testCaseHashRefs) { my $testNameStart = "parseSvnDiffHeader(): $testCase->{diffName}: comparing"; my $fileHandle; open($fileHandle, "<", \$testCase->{inputText}); my $line = <$fileHandle>; my @got = VCSUtils::parseSvnDiffHeader($fileHandle, $line); my $expectedReturn = $testCase->{expectedReturn}; is_deeply(\@got, $expectedReturn, "$testNameStart return value."); my $gotNextLine = <$fileHandle>; is($gotNextLine, $testCase->{expectedNextLine}, "$testNameStart next read line."); }
32.642534
87
0.61949
ed85dacd57b72261dc9a36e06b68245e7795995a
1,887
t
Perl
t/io/inplace.t
shlomif/perl5-for-JavaScript--take2
00956acb7c18b1c91286e970effcff38ba3072d0
[ "Artistic-1.0-Perl" ]
1
2015-09-02T14:43:46.000Z
2015-09-02T14:43:46.000Z
t/io/inplace.t
shlomif/perl5-for-JavaScript
2409f617bcf4dce3aefb6ddddedc326d0bcbe15d
[ "Artistic-1.0-Perl" ]
1
2021-08-28T10:07:37.000Z
2021-08-28T10:07:37.000Z
t/io/inplace.t
shlomif/perl5-for-JavaScript
2409f617bcf4dce3aefb6ddddedc326d0bcbe15d
[ "Artistic-1.0-Perl" ]
null
null
null
#!./perl use strict; require './test.pl'; $^I = $^O eq 'VMS' ? '_bak' : '.bak'; plan( tests => 6 ); my @tfiles = (tempfile(), tempfile(), tempfile()); my @tfiles_bak = map "$_$^I", @tfiles; END { unlink_all(@tfiles_bak); } for my $file (@tfiles) { runperl( prog => 'print qq(foo\n);', args => ['>', $file] ); } @ARGV = @tfiles; while (<>) { s/foo/bar/; } continue { print; } is ( runperl( prog => 'print<>;', args => \@tfiles ), "bar\nbar\nbar\n", "file contents properly replaced" ); is ( runperl( prog => 'print<>;', args => \@tfiles_bak ), "foo\nfoo\nfoo\n", "backup file contents stay the same" ); SKIP: { # based on code, dosish and epoc systems can't do no-backup inplace # edits $^O =~ /^(MSWin32|cygwin|uwin|dos|epoc|os2)$/ and skip("Can't inplace edit without backups on $^O", 4); our @ifiles = ( tempfile(), tempfile(), tempfile() ); { for my $file (@ifiles) { runperl( prog => 'print qq(bar\n);', args => [ '>', $file ] ); } local $^I = ''; local @ARGV = @ifiles; while (<>) { print "foo$_"; } is(scalar(@ARGV), 0, "consumed ARGV"); # runperl may quote its arguments, so don't expect to be able # to reuse things you send it. my @my_ifiles = @ifiles; is( runperl( prog => 'print<>;', args => \@my_ifiles ), "foobar\nfoobar\nfoobar\n", "normal inplace edit"); } # test * equivalence RT #70802 { for my $file (@ifiles) { runperl( prog => 'print qq(bar\n);', args => [ '>', $file ] ); } local $^I = '*'; local @ARGV = @ifiles; while (<>) { print "foo$_"; } is(scalar(@ARGV), 0, "consumed ARGV"); my @my_ifiles = @ifiles; is( runperl( prog => 'print<>;', args => \@my_ifiles ), "foobar\nfoobar\nfoobar\n", "normal inplace edit"); } END { unlink_all(@ifiles); } }
20.290323
71
0.531532
ed798d007aa42be1d448737226d09354e7448080
7,341
t
Perl
v5.24/t/win32/runenv.t
perl11/p5-coretests
65f340f49aea59bd666f1bf5c077a66004b51731
[ "Artistic-2.0" ]
1
2015-12-07T12:45:44.000Z
2015-12-07T12:45:44.000Z
v5.24/t/win32/runenv.t
perl11/p5-coretests
65f340f49aea59bd666f1bf5c077a66004b51731
[ "Artistic-2.0" ]
null
null
null
v5.24/t/win32/runenv.t
perl11/p5-coretests
65f340f49aea59bd666f1bf5c077a66004b51731
[ "Artistic-2.0" ]
null
null
null
#!./perl # # Tests for Perl run-time environment variable settings # Clone of t/run/runenv.t but without the forking, and with cmd.exe-friendly -e syntax. # # $PERL5OPT, $PERL5LIB, etc. BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib'; require Config; import Config; require File::Temp; import File::Temp qw/:POSIX/; require Win32; ($::os_id, $::os_major) = ( Win32::GetOSVersion() )[ 4, 1 ]; if ($::os_id == 2 and $::os_major == 6) { # Vista, Server 2008 (incl R2), 7 $::tests = 43; } else { $::tests = 40; } require './test.pl'; } skip_all "requires compilation with PERL_IMPLICIT_SYS" unless $Config{ccflags} =~/(?:\A|\s)-DPERL_IMPLICIT_SYS\b/; plan tests => $::tests; my $PERL = '.\perl'; my $NL = $/; delete $ENV{PERLLIB}; delete $ENV{PERL5LIB}; delete $ENV{PERL5OPT}; # Run perl with specified environment and arguments, return (STDOUT, STDERR) sub runperl_and_capture { my ($env, $args) = @_; # Clear out old env local %ENV = %ENV; delete $ENV{PERLLIB}; delete $ENV{PERL5LIB}; delete $ENV{PERL5OPT}; # Populate with our desired env for my $k (keys %$env) { $ENV{$k} = $env->{$k}; } # This is slightly expensive, but this is more reliable than # trying to emulate fork(), and we still get STDERR and STDOUT individually. my $stderr_cache = tmpnam(); my $stdout = `$PERL @$args 2>$stderr_cache`; my $stderr = ''; if (-s $stderr_cache) { open(my $stderr_cache_fh, "<", $stderr_cache) or die "Could not retrieve STDERR output: $!"; while ( defined(my $s_line = <$stderr_cache_fh>) ) { $stderr .= $s_line; } close $stderr_cache_fh; unlink $stderr_cache; } return ($stdout, $stderr); } sub try { my ($env, $args, $stdout, $stderr) = @_; my ($actual_stdout, $actual_stderr) = runperl_and_capture($env, $args); local $::Level = $::Level + 1; is $actual_stdout, $stdout; is $actual_stderr, $stderr; } # PERL5OPT Command-line options (switches). Switches in # this variable are taken as if they were on # every Perl command line. Only the -[DIMUdmtw] # switches are allowed. When running taint # checks (because the program was running setuid # or setgid, or the -T switch was used), this # variable is ignored. If PERL5OPT begins with # -T, tainting will be enabled, and any # subsequent options ignored. try({PERL5OPT => '-w'}, ['-e', '"print $::x"'], "", qq(Name "main::x" used only once: possible typo at -e line 1.${NL}Use of uninitialized value \$x in print at -e line 1.${NL})); try({PERL5OPT => '-Mstrict'}, ['-I..\lib', '-e', '"print $::x"'], "", ""); try({PERL5OPT => '-Mstrict'}, ['-I..\lib', '-e', '"print $x"'], "", qq(Global symbol "\$x" requires explicit package name (did you forget to declare "my \$x"?) at -e line 1.${NL}Execution of -e aborted due to compilation errors.${NL})); # Fails in 5.6.0 try({PERL5OPT => '-Mstrict -w'}, ['-I..\lib', '-e', '"print $x"'], "", qq(Global symbol "\$x" requires explicit package name (did you forget to declare "my \$x"?) at -e line 1.${NL}Execution of -e aborted due to compilation errors.${NL})); # Fails in 5.6.0 try({PERL5OPT => '-w -Mstrict'}, ['-I..\lib', '-e', '"print $::x"'], "", <<ERROR Name "main::x" used only once: possible typo at -e line 1. Use of uninitialized value \$x in print at -e line 1. ERROR ); # Fails in 5.6.0 try({PERL5OPT => '-w -Mstrict'}, ['-I..\lib', '-e', '"print $::x"'], "", <<ERROR Name "main::x" used only once: possible typo at -e line 1. Use of uninitialized value \$x in print at -e line 1. ERROR ); try({PERL5OPT => '-MExporter'}, ['-I..\lib', '-e0'], "", ""); # Fails in 5.6.0 try({PERL5OPT => '-MExporter -MExporter'}, ['-I..\lib', '-e0'], "", ""); try({PERL5OPT => '-Mstrict -Mwarnings'}, ['-I..\lib', '-e', '"print \"ok\" if $INC{\"strict.pm\"} and $INC{\"warnings.pm\"}"'], "ok", ""); open my $fh, ">", "Oooof.pm" or die "Can't write Oooof.pm: $!"; print $fh "package Oooof; 1;\n"; close $fh; END { 1 while unlink "Oooof.pm" } try({PERL5OPT => '-I. -MOooof'}, ['-e', '"print \"ok\" if $INC{\"Oooof.pm\"} eq \"Oooof.pm\""'], "ok", ""); try({PERL5OPT => '-w -w'}, ['-e', '"print $ENV{PERL5OPT}"'], '-w -w', ''); try({PERL5OPT => '-t'}, ['-e', '"print ${^TAINT}"'], '-1', ''); try({PERL5OPT => '-W'}, ['-I..\lib','-e', '"local $^W = 0; no warnings; print $x"'], '', <<ERROR Name "main::x" used only once: possible typo at -e line 1. Use of uninitialized value \$x in print at -e line 1. ERROR ); try({PERLLIB => "foobar$Config{path_sep}42"}, ['-e', '"print grep { $_ eq \"foobar\" } @INC"'], 'foobar', ''); try({PERLLIB => "foobar$Config{path_sep}42"}, ['-e', '"print grep { $_ eq \"42\" } @INC"'], '42', ''); try({PERL5LIB => "foobar$Config{path_sep}42"}, ['-e', '"print grep { $_ eq \"foobar\" } @INC"'], 'foobar', ''); try({PERL5LIB => "foobar$Config{path_sep}42"}, ['-e', '"print grep { $_ eq \"42\" } @INC"'], '42', ''); try({PERL5LIB => "foo", PERLLIB => "bar"}, ['-e', '"print grep { $_ eq \"foo\" } @INC"'], 'foo', ''); try({PERL5LIB => "foo", PERLLIB => "bar"}, ['-e', '"print grep { $_ eq \"bar\" } @INC"'], '', ''); # Tests for S_incpush_use_sep(): my @dump_inc = ('-e', '"print \"$_\n\" foreach @INC"'); my ($out, $err) = runperl_and_capture({}, [@dump_inc]); is ($err, '', 'No errors when determining @INC'); my @default_inc = split /\n/, $out; if ($Config{usecperl} or $Config{ccflags} =~ /Dfortify_inc/) { isnt ($default_inc[-1], '.', '. not last in @INC'); } else { is ($default_inc[-1], '.', '. is last in @INC'); } my $sep = $Config{path_sep}; my @test_cases = ( ['nothing', ''], ['something', 'zwapp', 'zwapp'], ['two things', "zwapp${sep}bam", 'zwapp', 'bam'], ['two things, ::', "zwapp${sep}${sep}bam", 'zwapp', 'bam'], [': at start', "${sep}zwapp", 'zwapp'], [': at end', "zwapp${sep}", 'zwapp'], [':: sandwich ::', "${sep}${sep}zwapp${sep}${sep}", 'zwapp'], [':', "${sep}"], ['::', "${sep}${sep}"], [':::', "${sep}${sep}${sep}"], ['two things and :', "zwapp${sep}bam${sep}", 'zwapp', 'bam'], [': and two things', "${sep}zwapp${sep}bam", 'zwapp', 'bam'], [': two things :', "${sep}zwapp${sep}bam${sep}", 'zwapp', 'bam'], ['three things', "zwapp${sep}bam${sep}${sep}owww", 'zwapp', 'bam', 'owww'], ); # This block added to verify fix for RT #87322 if ($::os_id == 2 and $::os_major == 6) { # Vista, Server 2008 (incl R2), 7 my @big_perl5lib = ('z' x 16) x 2049; push @testcases, [ 'enough items so PERL5LIB val is longer than 32k', join($sep, @big_perl5lib), @big_perl5lib, ]; } foreach ( @testcases ) { my ($name, $lib, @expect) = @$_; push @expect, @default_inc; ($out, $err) = runperl_and_capture({PERL5LIB => $lib}, [@dump_inc]); is ($err, '', "No errors when determining \@INC for $name"); my @inc = split /\n/, $out; is (scalar @inc, scalar @expect, "expected number of elements in \@INC for $name"); is ("@inc", "@expect", "expected elements in \@INC for $name"); }
28.453488
172
0.54652
ed5dd6b957a7982241a6c30a6f00d0554aee1ec0
4,554
pm
Perl
black-hole-solitaire/Games-Solitaire-BlackHole-Solver/lib/Games/Solitaire/BlackHole/Solver/App.pm
ferki/black-hole-solitaire
f4192671dff39e9e70fe13fdf9bd38ffaabb3881
[ "MIT" ]
null
null
null
black-hole-solitaire/Games-Solitaire-BlackHole-Solver/lib/Games/Solitaire/BlackHole/Solver/App.pm
ferki/black-hole-solitaire
f4192671dff39e9e70fe13fdf9bd38ffaabb3881
[ "MIT" ]
null
null
null
black-hole-solitaire/Games-Solitaire-BlackHole-Solver/lib/Games/Solitaire/BlackHole/Solver/App.pm
ferki/black-hole-solitaire
f4192671dff39e9e70fe13fdf9bd38ffaabb3881
[ "MIT" ]
null
null
null
package Games::Solitaire::BlackHole::Solver::App; use 5.014; use Moo; extends('Games::Solitaire::BlackHole::Solver::App::Base'); =head1 NAME Games::Solitaire::BlackHole::Solver::App - a command line application implemented as a class to solve the Black Hole solitaire. =head1 SYNOPSIS use Games::Solitaire::BlackHole::Solver::App; my $app = Games::Solitaire::BlackHole::Solver::App->new; $app->run(); And then from the command-line: $ black-hole-solve myboard.txt =head1 DESCRIPTION A script that encapsulates this application accepts a filename pointing at the file containing the board or C<"-"> for specifying the standard input. A board looks like this and can be generated for PySol using the make_pysol_board.py in the contrib/ . Foundations: AS KD JH JS 8H 4C 7D 7H TD 4H JD 9S 5S AH 3S 6H 9C 9D 8S 7S 2H 6S AC JC QH QD 4S TS 6C QS QC 8D 3D KH 5H 5C 8C 4D KC TC 6D 3C 3H 2C KS TH AD 5D 7C 9H 2S 2D Other flags: =over 4 =item * --version =item * --help =item * --man =item * -o/--output solution_file.txt Output to a solution file. =item * --quiet Do not emit the solution. =item * --next-task Add a new task (see L<https://en.wikipedia.org/wiki/Context_switch> ). =item * --task-name [name] Name the task. =item * --seed [index] Set the PRNG seed for the task. =item * --prelude [num-iters]@[task-name],[num-iters2]@[task-name2] Start from running the iters counts for each task IDs. Similar to L<https://fc-solve.shlomifish.org/docs/distro/USAGE.html#prelude_flag> . =back More information about Black Hole Solitaire can be found at: =over 4 =item * L<http://en.wikipedia.org/wiki/Black_Hole_%28solitaire%29> =item * L<http://pysolfc.sourceforge.net/doc/rules/blackhole.html> =back =head1 METHODS =head2 $self->new() Instantiates an object. =head2 $self->run() Runs the application. =cut sub run { my $self = shift; my $RANK_KING = $self->_RANK_KING; $self->_process_cmd_line( { extra_flags => {} } ); $self->_set_up_solver( 0, [ 1, $RANK_KING ] ); my $verdict = 0; $self->_next_task; QUEUE_LOOP: while ( my $state = $self->_get_next_state_wrapper ) { # The foundation my $no_cards = 1; my @_pending; if (1) { $self->_find_moves( \@_pending, $state, \$no_cards ); } if ($no_cards) { $self->_trace_solution( $state, ); $verdict = 1; last QUEUE_LOOP; } last QUEUE_LOOP if not $self->_process_pending_items( \@_pending, $state ); } return $self->_my_exit( $verdict, ); } =head1 SEE ALSO The Black Hole Solitaire Solvers homepage is at L<http://www.shlomifish.org/open-source/projects/black-hole-solitaire-solver/> and one can find there an implementation of this solver as a C library (under the same licence), which is considerably faster and consumes less memory, and has had some other improvements. =head1 AUTHOR Shlomi Fish, L<http://www.shlomifish.org/> =head1 BUGS Please report any bugs or feature requests to C<games-solitaire-blackhole-solver rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-Solitaire-BlackHole-Solver>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 COPYRIGHT AND LICENSE Copyright (c) 2010 Shlomi Fish 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. =cut 1;
22.656716
141
0.694554
ed62760c99d4776e4725eeef1949f70f0b9513df
3,859
pm
Perl
perl/vendor/lib/Test2/Todo.pm
Light2027/OnlineCampusSandbox
8dcaaf62af1342470f9e7be6d42bd0f16eb910b8
[ "Apache-2.0" ]
null
null
null
perl/vendor/lib/Test2/Todo.pm
Light2027/OnlineCampusSandbox
8dcaaf62af1342470f9e7be6d42bd0f16eb910b8
[ "Apache-2.0" ]
3
2021-01-27T10:09:28.000Z
2021-05-11T21:20:12.000Z
perl/vendor/lib/Test2/Todo.pm
Light2027/OnlineCampusSandbox
8dcaaf62af1342470f9e7be6d42bd0f16eb910b8
[ "Apache-2.0" ]
null
null
null
package Test2::Todo; use strict; use warnings; use Carp qw/croak/; use Test2::Util::HashBase qw/hub _filter reason/; use Test2::API qw/test2_stack/; use overload '""' => \&reason, fallback => 1; our $VERSION = '0.000129'; sub init { my $self = shift; my $reason = $self->{+REASON}; croak "The 'reason' attribute is required" unless defined $reason; my $hub = $self->{+HUB} ||= test2_stack->top; $self->{+_FILTER} = $hub->pre_filter( sub { my ($active_hub, $event) = @_; # Turn a diag into a note return Test2::Event::Note->new(%$event) if ref($event) eq 'Test2::Event::Diag'; if ($active_hub == $hub) { $event->set_todo($reason) if $event->can('set_todo'); $event->add_amnesty({tag => 'TODO', details => $reason}); $event->set_effective_pass(1) if $event->isa('Test2::Event::Ok'); } else { $event->add_amnesty({tag => 'TODO', details => $reason, inherited => 1}); } return $event; }, inherit => 1, todo => $reason, ); } sub end { my $self = shift; my $hub = $self->{+HUB} or return; $hub->pre_unfilter($self->{+_FILTER}); delete $self->{+HUB}; delete $self->{+_FILTER}; } sub DESTROY { my $self = shift; $self->end; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Test2::Todo - TODO extension for Test2. =head1 DESCRIPTION This is an object that lets you create and manage TODO states for tests. This is an extension, not a plugin or a tool. This library can be used by plugins and tools to manage todo states. If you simply want to write a todo test then you should look at the C<todo> function provided by L<Test2::Tools::Basic>. =head1 SYNOPSIS use Test2::Todo; # Start the todo my $todo = Test2::Todo->new(reason => 'Fix later'); # Will be considered todo, so suite still passes ok(0, "oops"); # End the todo $todo->end; # TODO has ended, this test will actually fail. ok(0, "oops"); =head1 CONSTRUCTION OPTIONS =over 4 =item reason (required) The reason for the todo, this can be any defined value. =item hub (optional) The hub to which the TODO state should be applied. If none is provided then the current global hub is used. =back =head1 INSTANCE METHODS =over 4 =item $todo->end End the todo state. =back =head1 CLASS METHODS =over 4 =item $count = Test2::Todo->hub_in_todo($hub) If the hub has any todo objects this will return the total number of them. If the hub has no todo objects it will return 0. =back =head1 OTHER NOTES =head2 How it works When an instance is created a filter sub is added to the L<Test2::Hub>. This filter will set the C<todo> and C<diag_todo> attributes on all events as they come in. When the instance is destroyed, or C<end()> is called, the filter is removed. When a new hub is pushed (such as when a subtest is started) the new hub will inherit the filter, but it will only set C<diag_todo>, it will not set C<todo> on events in child hubs. =head2 $todo->end is called at destruction If your C<$todo> object falls out of scope and gets garbage collected, the todo will end. =head2 Can I use multiple instances? Yes. The most recently created one that is still active will win. =head1 SOURCE The source code repository for Test2-Suite can be found at F<https://github.com/Test-More/Test2-Suite/>. =head1 MAINTAINERS =over 4 =item Chad Granum E<lt>exodist@cpan.orgE<gt> =back =head1 AUTHORS =over 4 =item Chad Granum E<lt>exodist@cpan.orgE<gt> =back =head1 COPYRIGHT Copyright 2018 Chad Granum E<lt>exodist@cpan.orgE<gt>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See F<http://dev.perl.org/licenses/> =cut
20.859459
91
0.654574
73ea6d47b52cf6235e887529250c1f7d2e89184d
7,944
pl
Perl
3rdParty/curl/curl-7.57.0/docs/cmdline-opts/gen.pl
geetaanand/arangodb
6a4f462fa209010cd064f99e63d85ce1d432c500
[ "Apache-2.0" ]
8
2017-12-14T12:25:17.000Z
2021-11-11T11:59:39.000Z
3rdParty/curl/curl-7.57.0/docs/cmdline-opts/gen.pl
geetaanand/arangodb
6a4f462fa209010cd064f99e63d85ce1d432c500
[ "Apache-2.0" ]
21
2020-01-04T09:04:27.000Z
2020-02-01T04:38:25.000Z
3rdParty/curl/curl-7.57.0/docs/cmdline-opts/gen.pl
geetaanand/arangodb
6a4f462fa209010cd064f99e63d85ce1d432c500
[ "Apache-2.0" ]
10
2019-02-14T00:06:55.000Z
2021-06-13T05:08:31.000Z
#!/usr/bin/perl =begin comment This script generates the manpage. Example: gen.pl mainpage > curl.1 Dev notes: We open *input* files in :crlf translation (a no-op on many platforms) in case we have CRLF line endings in Windows but a perl that defaults to LF. Unfortunately it seems some perls like msysgit can't handle a global input-only :crlf so it has to be specified on each file open for text input. =end comment =cut my $some_dir=$ARGV[1] || "."; opendir(my $dh, $some_dir) || die "Can't opendir $some_dir: $!"; my @s = grep { /\.d$/ && -f "$some_dir/$_" } readdir($dh); closedir $dh; my %optshort; my %optlong; my %helplong; my %arglong; my %redirlong; my %protolong; # get the long name version, return the man page string sub manpageify { my ($k)=@_; my $l; if($optlong{$k} ne "") { # both short + long $l = "\\fI-".$optlong{$k}.", --$k\\fP"; } else { # only long $l = "\\fI--$k\\fP"; } return $l; } sub printdesc { my @desc = @_; for my $d (@desc) { # skip lines starting with space (examples) if($d =~ /^[^ ]/) { for my $k (keys %optlong) { my $l = manpageify($k); $d =~ s/--$k([^a-z0-9_-])/$l$1/; } } print $d; } } sub seealso { my($standalone, $data)=@_; if($standalone) { return sprintf ".SH \"SEE ALSO\"\n$data\n"; } else { return "See also $data. "; } } sub overrides { my ($standalone, $data)=@_; if($standalone) { return ".SH \"OVERRIDES\"\n$data\n"; } else { return $data; } } sub protocols { my ($standalone, $data)=@_; if($standalone) { return ".SH \"PROTOCOLS\"\n$data\n"; } else { return "($data) "; } } sub added { my ($standalone, $data)=@_; if($standalone) { return ".SH \"ADDED\"\nAdded in curl version $data\n"; } else { return "Added in $data. "; } } sub single { my ($f, $standalone)=@_; open(F, "<:crlf", "$some_dir/$f") || return 1; my $short; my $long; my $tags; my $added; my $protocols; my $arg; my $mutexed; my $requires; my $seealso; my $magic; # cmdline special option while(<F>) { if(/^Short: *(.)/i) { $short=$1; } elsif(/^Long: *(.*)/i) { $long=$1; } elsif(/^Added: *(.*)/i) { $added=$1; } elsif(/^Tags: *(.*)/i) { $tags=$1; } elsif(/^Arg: *(.*)/i) { $arg=$1; } elsif(/^Magic: *(.*)/i) { $magic=$1; } elsif(/^Mutexed: *(.*)/i) { $mutexed=$1; } elsif(/^Protocols: *(.*)/i) { $protocols=$1; } elsif(/^See-also: *(.*)/i) { $seealso=$1; } elsif(/^Requires: *(.*)/i) { $requires=$1; } elsif(/^Help: *(.*)/i) { ; } elsif(/^---/) { if(!$long) { print STDERR "WARN: no 'Long:' in $f\n"; } last; } else { chomp; print STDERR "WARN: unrecognized line in $f, ignoring:\n:'$_';" } } my @dest; while(<F>) { push @desc, $_; } close(F); my $opt; if(defined($short) && $long) { $opt = "-$short, --$long"; } elsif($short && !$long) { $opt = "-$short"; } elsif($long && !$short) { $opt = "--$long"; } if($arg) { $opt .= " $arg"; } if($standalone) { print ".TH curl 1 \"30 Nov 2016\" \"curl 7.52.0\" \"curl manual\"\n"; print ".SH OPTION\n"; print "curl $opt\n"; } else { print ".IP \"$opt\"\n"; } if($protocols) { print protocols($standalone, $protocols); } if($standalone) { print ".SH DESCRIPTION\n"; } printdesc(@desc); undef @desc; my @foot; if($seealso) { my @m=split(/ /, $seealso); my $mstr; for my $k (@m) { my $l = manpageify($k); $mstr .= sprintf "%s$l", $mstr?" and ":""; } push @foot, seealso($standalone, $mstr); } if($requires) { my $l = manpageify($long); push @foot, "$l requires that the underlying libcurl". " was built to support $requires. "; } if($mutexed) { my @m=split(/ /, $mutexed); my $mstr; for my $k (@m) { my $l = manpageify($k); $mstr .= sprintf "%s$l", $mstr?" and ":""; } push @foot, overrides($standalone, "This option overrides $mstr. "); } if($added) { push @foot, added($standalone, $added); } if($foot[0]) { print "\n"; my $f = join("", @foot); $f =~ s/ +\z//; # remove trailing space print "$f\n"; } return 0; } sub getshortlong { my ($f)=@_; open(F, "<:crlf", "$some_dir/$f"); my $short; my $long; my $help; my $arg; my $protocols; while(<F>) { if(/^Short: (.)/i) { $short=$1; } elsif(/^Long: (.*)/i) { $long=$1; } elsif(/^Help: (.*)/i) { $help=$1; } elsif(/^Arg: (.*)/i) { $arg=$1; } elsif(/^Protocols: (.*)/i) { $protocols=$1; } elsif(/^---/) { last; } } close(F); if($short) { $optshort{$short}=$long; } if($long) { $optlong{$long}=$short; $helplong{$long}=$help; $arglong{$long}=$arg; $protolong{$long}=$protocols; } } sub indexoptions { foreach my $f (@s) { getshortlong($f); } } sub header { my ($f)=@_; open(F, "<:crlf", "$some_dir/$f"); my @d; while(<F>) { push @d, $_; } close(F); printdesc(@d); } sub listhelp { foreach my $f (sort keys %helplong) { my $long = $f; my $short = $optlong{$long}; my $opt; if(defined($short) && $long) { $opt = "-$short, --$long"; } elsif($long && !$short) { $opt = " --$long"; } my $arg = $arglong{$long}; if($arg) { $opt .= " $arg"; } my $desc = $helplong{$f}; $desc =~ s/\"/\\\"/g; # escape double quotes my $line = sprintf " {\"%s\",\n \"%s\"},\n", $opt, $desc; if(length($opt) + length($desc) > 78) { print STDERR "WARN: the --$long line is too long\n"; } print $line; } } sub mainpage { # show the page header header("page-header"); # output docs for all options foreach my $f (sort @s) { single($f, 0); } header("page-footer"); } sub showonly { my ($f) = @_; if(single($f, 1)) { print STDERR "$f: failed\n"; } } sub showprotocols { my %prots; foreach my $f (keys %optlong) { my @p = split(/ /, $protolong{$f}); for my $p (@p) { $prots{$p}++; } } for(sort keys %prots) { printf "$_ (%d options)\n", $prots{$_}; } } sub getargs { my $f; do { $f = shift @ARGV; if($f eq "mainpage") { mainpage(); return; } elsif($f eq "listhelp") { listhelp(); return; } elsif($f eq "single") { showonly(shift @ARGV); return; } elsif($f eq "protos") { showprotocols(); return; } } while($f); print "Usage: gen.pl <mainpage/listhelp/single FILE/protos> [srcdir]\n"; } #------------------------------------------------------------------------ # learn all existing options indexoptions(); getargs();
20.580311
79
0.42573
ed34efb1fa4467ed07c7c45af088a4e22e8fee0f
3,447
pm
Perl
lib/Minilla/ReleaseTest.pm
sanko/Minilla
a0558cfc250c7a795780d883c6642155a8a9ce77
[ "Artistic-1.0" ]
45
2015-01-13T14:09:59.000Z
2022-02-17T17:24:55.000Z
lib/Minilla/ReleaseTest.pm
sanko/Minilla
a0558cfc250c7a795780d883c6642155a8a9ce77
[ "Artistic-1.0" ]
131
2015-01-13T13:56:31.000Z
2022-03-13T06:05:09.000Z
lib/Minilla/ReleaseTest.pm
sanko/Minilla
a0558cfc250c7a795780d883c6642155a8a9ce77
[ "Artistic-1.0" ]
45
2015-02-03T04:30:57.000Z
2022-02-18T03:53:45.000Z
package Minilla::ReleaseTest; use strict; use warnings; use utf8; use Data::Section::Simple qw(get_data_section); use File::pushd; use File::Spec::Functions qw(catfile); use File::Path qw(mkpath); use Minilla::Logger; use Minilla::Util qw(spew); sub write_release_tests { my ($class, $project, $dir) = @_; mkpath(catfile($dir, 'xt', 'minilla')); my $stopwords = do { my $append_people_into_stopwords = sub { my $people = shift; my @stopwords; for (@{$people || +[]}) { s!<.*!!; # trim e-mail address push @stopwords, split(/\s+/, $_); } return @stopwords; }; my @stopwords; push @stopwords, $append_people_into_stopwords->($project->contributors); push @stopwords, $append_people_into_stopwords->($project->authors); local $Data::Dumper::Terse = 1; local $Data::Dumper::Useqq = 1; local $Data::Dumper::Purity = 1; local $Data::Dumper::Indent = 0; Data::Dumper::Dumper([map { split /\s+/, $_ } @stopwords]); }; my $config = $project->config->{ReleaseTest}; my $name = $project->dist_name; for my $file (qw( xt/minilla/minimum_version.t xt/minilla/cpan_meta.t xt/minilla/pod.t xt/minilla/spelling.t xt/minilla/permissions.t )) { infof("Writing release tests: %s\n", $file); if ($file eq 'xt/minilla/minimum_version.t' && ($config->{MinimumVersion}||'') eq 'false') { infof("Skipping MinimumVersion"); next; } my $content = get_data_section($file); $content =~s!<<DIST>>!$name!g; $content =~s!<<STOPWORDS>>!$stopwords!g; spew(catfile($dir, $file), $content); } } sub prereqs { +{ develop => { requires => { 'Test::MinimumVersion::Fast' => 0.04, 'Test::CPAN::Meta' => 0, 'Test::Pod' => 1.41, 'Test::Spellunker' => 'v0.2.7', 'Test::PAUSE::Permissions' => 0.07, }, }, }; } 1; __DATA__ @@ xt/minilla/minimum_version.t use Test::More; eval "use Test::MinimumVersion::Fast 0.04"; if ($@) { plan skip_all => "Test::MinimumVersion::Fast required for testing perl minimum version"; } all_minimum_version_from_metayml_ok(); @@ xt/minilla/cpan_meta.t use Test::More; eval "use Test::CPAN::Meta"; plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; plan skip_all => "There is no META.yml" unless -f "META.yml"; meta_yaml_ok(); @@ xt/minilla/pod.t use strict; use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); @@ xt/minilla/spelling.t use strict; use Test::More; use File::Spec; eval q{ use Test::Spellunker v0.2.2 }; plan skip_all => "Test::Spellunker is not installed." if $@; plan skip_all => "no ENV[HOME]" unless $ENV{HOME}; my $spelltest_switchfile = ".spellunker.en"; plan skip_all => "no ~/$spelltest_switchfile" unless -e File::Spec->catfile($ENV{HOME}, $spelltest_switchfile); add_stopwords('<<DIST>>'); add_stopwords(@{<<STOPWORDS>>}); all_pod_files_spelling_ok('lib'); @@ xt/minilla/permissions.t use strict; use Test::More; eval q{ use Test::PAUSE::Permissions 0.04 }; plan skip_all => "Test::PAUSE::Permissions is not installed." if $@; all_permissions_ok({dev => 1});
27.576
111
0.59443
ed9a02f498007912cde926f82417e93f42c4928d
9,428
pm
Perl
lib/App/FilterOrgByHeadlines.pm
gitpan/App-OrgUtils
cdac787ccbff888c70a12a0f9ee85511e7b6d325
[ "Artistic-1.0" ]
null
null
null
lib/App/FilterOrgByHeadlines.pm
gitpan/App-OrgUtils
cdac787ccbff888c70a12a0f9ee85511e7b6d325
[ "Artistic-1.0" ]
null
null
null
lib/App/FilterOrgByHeadlines.pm
gitpan/App-OrgUtils
cdac787ccbff888c70a12a0f9ee85511e7b6d325
[ "Artistic-1.0" ]
null
null
null
package App::FilterOrgByHeadlines; our $DATE = '2015-01-03'; # DATE our $VERSION = '0.23'; # VERSION use 5.010; use strict; use warnings; our %SPEC; sub _match { my ($hl, $op) = @_; if (ref($op) eq 'Regexp') { return $hl =~ $op; } elsif ($op =~ m!\A/(.*)/(i?)\z!) { my $re; # XXX possible arbitrary code execution eval "\$re = qr/$1/$2"; die if $@; return $hl =~ $re; } else { return index($hl, $op) >= 0; } } $SPEC{filter_org_by_headlines} = { v => 1.1, summary => 'Filter Org by headlines', description => <<'_', This routine uses simple regex instead of Org::Parser, for faster performance. _ args => { input => { #schema => ['any*', of => ['str*', ['array*', of => 'str*']]], schema => ['str*'], description => <<'_', Value is either a string or an array of strings. _ req => 1, pos => 0, cmdline_src => 'stdin_or_files', }, min_level => { schema => 'int*', tags => ['category:filtering'], }, max_level => { schema => 'int*', tags => ['category:filtering'], }, level => { schema => 'int*', tags => ['category:filtering'], }, match => { schema => ['any*', of=>['str*', 're*']], summary => 'Only include headline which matches this', description => <<'_', Value is either a string or a regex. If string is in the form of `/.../` or `/.../i` it is assumed to be a regex. _ tags => ['category:filtering'], }, parent_match => { schema => ['any*', of=>['str*', 're*']], summary => 'Only include headline whose parent matches this', description => <<'_', Value is either a string or a regex. If string is in the form of `/.../` or `/.../i` it is assumed to be a regex. _ tags => ['category:filtering'], }, ascendant_match => { schema => ['any*', of=>['str*', 're*']], summary => 'Only include headline whose ascendant matches this', description => <<'_', Value is either a string or a regex. If string is in the form of `/.../` or `/.../i` it is assumed to be a regex. _ tags => ['category:filtering'], }, is_todo => { schema => 'bool', summary => 'Only include headline which is a todo item', 'summary.alt.bool.not' => 'Only include headline which is not a todo item', tags => ['category:filtering'], }, is_done => { schema => 'bool', summary => 'Only include headline which is a done todo item', 'summary.alt.bool.not' => 'Only include headline which is a todo item but not done', tags => ['category:filtering'], }, # XXX todo_state => str* with_content => { schema => 'bool', summary => 'Include headline content', 'summary.alt.bool.not' => "Don't include headline content, just print the headlines", default => 1, }, with_preamble => { schema => 'bool', summary => 'Include text before any headline', 'summary.alt.bool.not' => "Don't include text before any headline", default => 1, }, }, result_naked => 1, result => { schema => 'str*', }, }; sub filter_org_by_headlines { my %args = @_; my $input = $args{input}; my $with_ct = $args{with_content} // 1; my $with_pre = $args{with_preamble} // 1; my $curhl; my $curlevel; my $curtodokw; my $curhl_filtered; my @parenthls; # ([hl, level], ...) my %todo_keywords = map {$_=>1} qw(TODO); my %done_keywords = map {$_=>1} qw(DONE); my $seen_todo_def; my $out; LINE: for my $line (ref($input) ? @$input : split(/^/, $input)) { my $is_hl; if ($line =~ /^#\+TODO:\s*(.+)/) { my $arg = $1; if (!$seen_todo_def++) { %todo_keywords = (); %done_keywords = (); } my $done_s = $arg =~ s/\s*\|\s*(.*)// ? $1 : ''; my $todo_s = $arg; $todo_keywords{$_}++ for grep {length} split /\s+/, $todo_s; $done_keywords{$_}++ for grep {length} split /\s+/, $done_s; } elsif ($line =~ /^(\*+)\s+(.*)/) { $is_hl++; my $level = length($1); my $arg = $2; if ($curlevel && $curlevel < $level) { push @parenthls, [$curhl, $curlevel]; } elsif (@parenthls) { @parenthls = grep { $_->[1] < $level } @parenthls; } $curhl = $line; $curlevel = $level; $curtodokw = undef; if ($arg =~ /(\w+)\s/) { if ($todo_keywords{$1} || $done_keywords{$1}) { $curtodokw = $1; } } undef $curhl_filtered; } # filtering my $include; FILTER: { if (!$curhl) { $include++ if $with_pre; last FILTER; } last if !$with_ct && !$is_hl; if (defined $curhl_filtered) { $include++ if !$curhl_filtered; last FILTER; } $curhl_filtered = 1 if $is_hl; if (defined $args{min_level}) { last if $curlevel < $args{min_level}; } if (defined $args{max_level}) { last if $curlevel > $args{max_level}; } if (defined $args{level}) { last if $curlevel != $args{level}; } if (defined $args{is_todo}) { my $kw = $curtodokw // ''; last if ( ($todo_keywords{$kw} || $done_keywords{$kw}) xor $args{is_todo} ); } if (defined $args{is_done}) { my $kw = $curtodokw // ''; last unless $kw; last if ( $done_keywords{$kw} xor $args{is_done} ); } if (defined $args{match}) { last unless _match($curhl, $args{match}); } if (defined $args{parent_match}) { last unless @parenthls; last unless _match($parenthls[-1][0], $args{parent_match}); } if (defined $args{ascendant_match}) { for (@parenthls) { do { $include++; last FILTER } if _match($_->[0], $args{ascendant_match}); } last; } $curhl_filtered = 0 if $is_hl; $include = 1; } $out .= $line if $include; } $out; } 1; # ABSTRACT: Filter Org by headlines __END__ =pod =encoding UTF-8 =head1 NAME App::FilterOrgByHeadlines - Filter Org by headlines =head1 VERSION This document describes version 0.23 of App::FilterOrgByHeadlines (from Perl distribution App-OrgUtils), released on 2015-01-03. =head1 FUNCTIONS =head2 filter_org_by_headlines(%args) -> str Filter Org by headlines. This routine uses simple regex instead of Org::Parser, for faster performance. Arguments ('*' denotes required arguments): =over 4 =item * B<ascendant_match> => I<str|re> Only include headline whose ascendant matches this. Value is either a string or a regex. If string is in the form of C</.../> or C</.../i> it is assumed to be a regex. =item * B<input>* => I<str> Value is either a string or an array of strings. =item * B<is_done> => I<bool> Only include headline which is a done todo item. =item * B<is_todo> => I<bool> Only include headline which is a todo item. =item * B<level> => I<int> =item * B<match> => I<str|re> Only include headline which matches this. Value is either a string or a regex. If string is in the form of C</.../> or C</.../i> it is assumed to be a regex. =item * B<max_level> => I<int> =item * B<min_level> => I<int> =item * B<parent_match> => I<str|re> Only include headline whose parent matches this. Value is either a string or a regex. If string is in the form of C</.../> or C</.../i> it is assumed to be a regex. =item * B<with_content> => I<bool> (default: 1) Include headline content. =item * B<with_preamble> => I<bool> (default: 1) Include text before any headline. =back Return value: (str) =head1 HOMEPAGE Please visit the project's homepage at L<https://metacpan.org/release/App-OrgUtils>. =head1 SOURCE Source repository is at L<https://github.com/sharyanto/perl-App-OrgUtils>. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=App-OrgUtils> When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR perlancar <perlancar@cpan.org> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2015 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut
27.014327
134
0.515274
ed87c83ae469f0e03ec274c27be35ea5175c5d4d
818
pm
Perl
lib/Google/Ads/GoogleAds/V4/Enums/BudgetStatusEnum.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
lib/Google/Ads/GoogleAds/V4/Enums/BudgetStatusEnum.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
lib/Google/Ads/GoogleAds/V4/Enums/BudgetStatusEnum.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
# Copyright 2020, Google LLC # # 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 Google::Ads::GoogleAds::V4::Enums::BudgetStatusEnum; use strict; use warnings; use Const::Exporter enums => [ UNSPECIFIED => "UNSPECIFIED", UNKNOWN => "UNKNOWN", ENABLED => "ENABLED", REMOVED => "REMOVED" ]; 1;
29.214286
74
0.723716
ed05c66440ff5519860750a4461571c785297da6
610
pl
Perl
Codes/2.Definition_Matrix_4_BP/2.4.BP_Children_Extractor.pl
ahmadpgh/simDEF
55f5f6e8b7c326a743bbfbd18a19e1098177bfb0
[ "MIT" ]
2
2017-10-01T20:11:40.000Z
2018-03-09T08:56:28.000Z
Codes/2.Definition_Matrix_4_BP/2.4.BP_Children_Extractor.pl
ahmadpgh/simDEF
55f5f6e8b7c326a743bbfbd18a19e1098177bfb0
[ "MIT" ]
2
2018-03-03T03:30:15.000Z
2018-03-03T04:45:46.000Z
Codes/2.Definition_Matrix_4_BP/2.4.BP_Children_Extractor.pl
ahmadpgh/simDEF
55f5f6e8b7c326a743bbfbd18a19e1098177bfb0
[ "MIT" ]
null
null
null
# This code extracts children of GO terms included in BP ontology (Please read the read-me file before use!) use IO::File; $r = IO::File->new("../../Extra/BP/BP_GO_parents.dat","r") or die "Can not open file to read from;\nWe need to have parents first!\n"; open(my $w, '>', "../../Extra/BP/BP_GO_children.dat") or die "Could not open file to write in\n"; %hash; foreach(<$r>){ chomp; my @a = split ":: "; my @child = split " ", $a[0]; my @par = split " ", $a[1]; foreach(@par){ $hash{$_} .= " ".$child[0]; } } foreach(sort keys %hash){ $w->print("$_:\:$hash{$_}\n"); }
26.521739
135
0.572131
ed5554905141506a326a9e44be692b532426e190
8,315
pl
Perl
usr/skb/eclipse_kernel/lib/kernel_bips.pl
mslovy/barrelfish
780bc02cfbc3594b0ae46ca3a921d183557839be
[ "MIT" ]
81
2015-01-02T23:53:38.000Z
2021-12-26T23:04:47.000Z
usr/skb/eclipse_kernel/lib/kernel_bips.pl
linusyang/barrelfish
5341930917c25b515d1c49cea9ac74f645cec81f
[ "MIT" ]
1
2016-09-21T06:27:06.000Z
2016-10-05T07:16:28.000Z
usr/skb/eclipse_kernel/lib/kernel_bips.pl
linusyang/barrelfish
5341930917c25b515d1c49cea9ac74f645cec81f
[ "MIT" ]
7
2015-03-11T14:27:15.000Z
2017-11-08T23:03:45.000Z
% ---------------------------------------------------------------------- % BEGIN LICENSE BLOCK % Version: CMPL 1.1 % % The contents of this file are subject to the Cisco-style Mozilla Public % License Version 1.1 (the "License"); you may not use this file except % in compliance with the License. You may obtain a copy of the License % at www.eclipse-clp.org/license. % % Software distributed under the License is distributed on an "AS IS" % basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See % the License for the specific language governing rights and limitations % under the License. % % The Original Code is The ECLiPSe Constraint Logic Programming System. % The Initial Developer of the Original Code is Cisco Systems, Inc. % Portions created by the Initial Developer are % Copyright (C) 1989-2006 Cisco Systems, Inc. All Rights Reserved. % % Contributor(s): ECRC GmbH % Contributor(s): IC-Parc, Imperal College London % % END LICENSE BLOCK % % % ECLiPSe kernel built-ins % % System: ECLiPSe Constraint Logic Programming System % Version: $Id: kernel_bips.pl,v 1.1 2008/06/30 17:43:47 jschimpf Exp $ % % ---------------------------------------------------------------------- % Part of module sepia_kernel :- system. :- export substring/4, substring/5, append_strings/3, keysort/2, sort/2, number_sort/2, msort/2, merge/3, number_merge/3, prune_instances/2, wait/2. %---------------------------------------------------------------------- % String builtins %---------------------------------------------------------------------- :- skipped append_strings/3, substring/4, substring/5. /* append_strings(S1, S2, S3) iff String3 is the concatenation of * String1 and String2 * Periklis Tsahageas/18-8-88 * implements BSI's specification : * all arguments strings or variables, otherwise type error * if var(S3) and [var(S1) or var(S2)] : instantiation fault. * i.e. the normal prolog relation without infinite backtracking. */ append_strings(X,Y,Z) :- var(Z), !, concat_strings(X,Y,Z). append_strings(X,Y,Z) :- string(Z), !, append_strings1(X,Y,Z). append_strings(X,Y,Z) :- error(5, append_strings(X,Y,Z)). append_strings1(X,Y,Z) :- var_or_string(X), var_or_string(Y), !, string_list(Z, ZL), append(XL, YL, ZL), string_list(X, XL), string_list(Y, YL). append_strings1(X, Y, Z) :- error(5, append_strings(X, Y, Z)). var_or_string(X) :- var(X). var_or_string(X) :- string(X). % substring(+String, ?Pos, ?Len, ?SubStr) :- % % This predicate conforms to the BSI substring/4 specification. % That's why all the error checks are there. % We implement it using the deterministic builtin % first_substring(+String, +Pos, +Len, ?SubStr). substring(String, Pos, Len, SubStr) :- check_string(String), ( var(Pos) -> true ; integer(Pos) -> ( (Pos > 0) -> true ; set_bip_error(6) ) ; set_bip_error(5) ), check_var_or_arity(Len), check_var_or_string(SubStr), !, (string(SubStr)->string_length(SubStr, Len); true), Total is string_length(String) + 1, ( integer(Pos) -> ( integer(Len) -> true ; MaxLen is Total - Pos, between(0, MaxLen, 1, Len) ) ; ( integer(Len) -> MaxPos is Total - Len, between(1, MaxPos, 1, Pos) ; between(1, Total, 1, Pos), MaxLen is Total - Pos, between(0, MaxLen, 1, Len) ) ), first_substring(String, Pos, Len, SubStr). substring(String, Pos, Len, SubStr) :- get_bip_error(ErrorCode), error(ErrorCode, substring(String, Pos, Len, SubStr)). % substring(+String, ?Before, ?Length, ?After, ?SubString) :- % % This predicate is true iff string 'String' can be split % into three pieces, 'StringL', 'SubString' and 'StringR'. % In addition it must be split so that 'Before' is the length % of string 'StringL', 'Length' is the length of string % 'SubString' and 'After' is the length of the string 'StringR'. % We implement it using the deterministic builtin % first_substring(+String, +Pos, +Len, ?SubStr). substring(String, Before, Length, After, SubString) :- check_string(String), check_var_or_arity(Before), check_var_or_arity(Length), check_var_or_arity(After), check_var_or_string(SubString), !, (string(SubString)->string_length(SubString, Length); true), StringLength is string_length(String), ( integer(Before) -> ( integer(Length) -> ( integer(After) -> StringLength =:= Before + Length + After ; % 'After' is a var! After is StringLength - Before - Length, After >= 0 ) ; % 'Length' is a var! ( integer(After) -> Length is StringLength - Before - After, Length >= 0 ; % 'Length' and 'After' are vars! MaxLength is StringLength - Before, between(0, MaxLength, 1, Length), After is MaxLength - Length ) ) ; % 'Before' is a var! ( integer(Length) -> ( integer(After) -> Before is StringLength - Length - After, Before >= 0 ; % 'Before' and 'After' are vars! MaxBefore is StringLength - Length, between(0, MaxBefore, 1, Before), After is MaxBefore - Before ) ; % 'Before' and 'Length' are vars! ( integer(After) -> MaxBefore is StringLength - After, between(0, MaxBefore, 1, Before), Length is MaxBefore - Before ; % 'Before', 'Length' and 'After' are vars! between(0, StringLength, 1, Before), MaxLength is StringLength - Before, between(0, MaxLength, 1, Length), After is StringLength - Before - Length ) ) ), % first_substring/4 uses position, not index, so add 1. Pos is Before + 1, first_substring(String, Pos, Length, SubString). substring(String, Before, Length, After, SubString) :- get_bip_error(ErrorCode), error(ErrorCode, substring(String, Before, Length, After, SubString)). :- export string_list/3. string_list(String, List, Format) :- var(Format), !, error(4, string_list(String, List, Format)). string_list(String, List, utf8) :- !, utf8_list(String, List). string_list(String, List, 'bytes') :- !, string_list(String, List). string_list(String, List, Format) :- error(6, string_list(String, List, Format)). %---------------------------------------------------------------------- % Sort builtins %---------------------------------------------------------------------- :- skipped keysort/2, sort/2, number_sort/2, msort/2, merge/3, number_merge/3, prune_instances/2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /* :- mode keysort(+, -), merge(+, +, -), msort(+, -), sort(+, -), number_sort(+, -), prune_instances(+, -). */ keysort(R, S) :- sort(1, =<, R, S). msort(R, S) :- sort(0, =<, R, S). sort(R, S) :- sort(0, <, R, S). number_sort(R, S) :- number_sort(0, =<, R, S). merge(A, B, M) :- merge(0, =<, A, B, M). number_merge(A, B, M) :- number_merge(0, =<, A, B, M). prune_instances(List, Pruned) :- % sorting the list first is not necessary, but likely to reduce % the number of instance checks because duplicates are removed, % identical functors are grouped together, and variables are % moved to the front. sort(List, PreSortedList), prune_instances(PreSortedList, [], Pruned). :- mode prune_instances(+,+,?). prune_instances([First|Rest], SoFar, Result) :- insert_pruned(First, SoFar, NewSoFar), prune_instances(Rest, NewSoFar, Result). prune_instances([], Result, Result). % insert elem into the list (which is itself pruned) :- mode insert_pruned(?,+,-). insert_pruned(Elem, [], [Elem]). insert_pruned(Elem, [First|Rest], Result) :- ( instance(Elem, First) -> Result = [First|Rest] % already subsumed by list ; instance(First, Elem) -> Result = [Elem|Res0], % replace first instance remove_instances(Elem, Rest, Res0) % remove any others ; Result = [First|Res0], insert_pruned(Elem, Rest, Res0) % keep checking ). :- mode remove_instances(?,+,-). remove_instances(_Elem, [], []). remove_instances(Elem, [First|Rest], Result) :- ( instance(First, Elem) -> remove_instances(Elem, Rest, Result) ; Result = [First|Res0], remove_instances(Elem, Rest, Res0) ). %---------------------------------------------------------------------- % OS builtins %---------------------------------------------------------------------- wait(Pid, Status) :- wait(Pid, Status, hang).
26.065831
73
0.612748
eda5cd6bc0096fb6b5844a927c891340cdc50a7d
9,682
pm
Perl
lib/Zonemaster/Engine/Translator.pm
pnax/zonemaster-engine
5124989b8a05263b4445aaa181478e0b1f0737a2
[ "CC-BY-4.0" ]
null
null
null
lib/Zonemaster/Engine/Translator.pm
pnax/zonemaster-engine
5124989b8a05263b4445aaa181478e0b1f0737a2
[ "CC-BY-4.0" ]
null
null
null
lib/Zonemaster/Engine/Translator.pm
pnax/zonemaster-engine
5124989b8a05263b4445aaa181478e0b1f0737a2
[ "CC-BY-4.0" ]
null
null
null
package Zonemaster::Engine::Translator; use version; our $VERSION = version->declare("v1.0.8"); use 5.014002; use strict; use warnings; use Zonemaster::Engine; use Carp; use Locale::Messages qw[textdomain]; use Locale::TextDomain qw[Zonemaster-Engine]; use POSIX qw[setlocale LC_MESSAGES]; use Readonly; use Moose; use MooseX::Singleton; has 'locale' => ( is => 'rw', isa => 'Str' ); has 'data' => ( is => 'ro', isa => 'HashRef', lazy => 1, builder => '_load_data' ); has 'all_tag_descriptions' => ( is => 'ro', isa => 'HashRef', builder => '_build_all_tag_descriptions' ); has '_last_language' => ( is => 'rw', isa => 'Str', builder => '_build_last_language' ); ### ### Tag descriptions ### Readonly my %TAG_DESCRIPTIONS => ( CANNOT_CONTINUE => sub { __x # SYSTEM:CANNOT_CONTINUE "Not enough data about {zone} was found to be able to run tests.", @_; }, PROFILE_FILE => sub { __x # SYSTEM:PROFILE_FILE "Profile was read from {name}.", @_; }, DEPENDENCY_VERSION => sub { __x # SYSTEM:DEPENDENCY_VERSION "Using prerequisite module {name} version {version}.", @_; }, GLOBAL_VERSION => sub { __x # SYSTEM:GLOBAL_VERSION "Using version {version} of the Zonemaster engine.", @_; }, LOGGER_CALLBACK_ERROR => sub { __x # SYSTEM:LOGGER_CALLBACK_ERROR "Logger callback died with error: {exception}", @_; }, LOOKUP_ERROR => sub { __x # SYSTEM:LOOKUP_ERROR "DNS query to {ns} for {name}/{type}/{class} failed with error: {message}", @_; }, MODULE_ERROR => sub { __x # SYSTEM:MODULE_ERROR "Fatal error in {module}: {msg}", @_; }, MODULE_VERSION => sub { __x # SYSTEM:MODULE_VERSION "Using module {module} version {version}.", @_; }, MODULE_END => sub { __x # SYSTEM:MODULE_END "Module {module} finished running.", @_; }, NO_NETWORK => sub { __x # SYSTEM:NO_NETWORK "Both IPv4 and IPv6 are disabled."; }, UNKNOWN_METHOD => sub { __x # SYSTEM:UNKNOWN_METHOD "Request to run unknown method {method} in module {module}.", @_; }, UNKNOWN_MODULE => sub { __x # SYSTEM:UNKNOWN_MODULE "Request to run {method} in unknown module {module}. Known modules: {known}.", @_; }, SKIP_IPV4_DISABLED => sub { __x # SYSTEM:SKIP_IPV4_DISABLED "IPv4 is disabled, not sending query to {ns_list}.", @_; }, SKIP_IPV6_DISABLED => sub { __x # SYSTEM:SKIP_IPV6_DISABLED "IPv6 is disabled, not sending query to {ns_list}.", @_; }, FAKE_DELEGATION => sub { __x # SYSTEM:FAKE_DELEGATION "Followed a fake delegation."; }, ADDED_FAKE_DELEGATION => sub { __x # SYSTEM:ADDED_FAKE_DELEGATION "Added a fake delegation for domain {domain} to name server {ns}.", @_; }, FAKE_DELEGATION_TO_SELF => sub { __x # SYSTEM:FAKE_DELEGATION_TO_SELF "Name server {ns} not adding fake delegation for domain {domain} to itself.", @_; }, FAKE_DELEGATION_IN_ZONE_NO_IP => sub { __x # SYSTEM:FAKE_DELEGATION_IN_ZONE_NO_IP "The fake delegation of domain {domain} includes an in-zone name server {nsname} " . "without mandatory glue (without IP address).", @_; }, FAKE_DELEGATION_NO_IP => sub { __x # SYSTEM:FAKE_DELEGATION_NO_IP "The fake delegation of domain {domain} includes a name server {nsname} " . "that cannot be resolved to any IP address.", @_; }, PACKET_BIG => sub { __x # SYSTEM:PACKET_BIG "Big packet size ({size}) (try with \"{command}\").", @_; }, ); ### ### Builder Methods ### around 'BUILDARGS' => sub { my ( $orig, $class, $args ) = @_; $args->{locale} //= _init_locale(); return $class->$orig( $args ); }; # Get the program's underlying LC_MESSAGES and make sure it can be effectively # updated down the line. # # If the underlying LC_MESSAGES is invalid, it attempts to second guess Perls # fallback locale. # # Side effects: # * Updates the program's underlying LC_MESSAGES to the returned value. # * Unsets LC_ALL. sub _init_locale { my $locale = setlocale( LC_MESSAGES, "" ); delete $ENV{LC_ALL}; if ( !defined $locale ) { my $language = $ENV{LANGUAGE} // ""; for my $value ( split /:/, $language ) { if ( $value ne "" && $value !~ /[.]/ ) { $value .= ".UTF-8"; } $locale = setlocale( LC_MESSAGES, $value ); if ( defined $locale ) { last; } } $locale //= "C"; } return $locale; } sub _load_data { my $self = shift; my $old_locale = $self->locale; $self->locale( 'C' ); my %data; for my $mod ( keys %{ $self->all_tag_descriptions } ) { for my $tag ( keys %{ $self->all_tag_descriptions->{$mod} } ) { $data{$mod}{$tag} = $self->_translate_tag( $mod, $tag, {} ); } } $self->locale( $old_locale ); return \%data; } sub _build_all_tag_descriptions { my %all_tag_descriptions; $all_tag_descriptions{SYSTEM} = \%TAG_DESCRIPTIONS; foreach my $mod ( 'Basic', Zonemaster::Engine->modules ) { my $module = 'Zonemaster::Engine::Test::' . $mod; $all_tag_descriptions{ uc( $mod ) } = $module->tag_descriptions; } return \%all_tag_descriptions; } sub _build_last_language { return $ENV{LANGUAGE} // ''; } ### ### Method modifiers ### around 'locale' => sub { my $next = shift; my ( $self, @args ) = @_; return $self->$next() unless @args; my $new_locale = shift @args; # On some systems gettext takes its locale from setlocale(). defined setlocale( LC_MESSAGES, $new_locale ) or return; $self->_last_language( $ENV{LANGUAGE} // '' ); # On some systems gettext takes its locale from %ENV. $ENV{LC_MESSAGES} = $new_locale; # On some systems gettext refuses to switch over to another locale unless # the textdomain is reset. textdomain( 'Zonemaster-Engine' ); $self->$next( $new_locale ); return $new_locale; }; ### ### Working methods ### sub to_string { my ( $self, $entry ) = @_; return sprintf( "%7.2f %-9s %s", $entry->timestamp, $entry->level, $self->translate_tag( $entry ) ); } sub translate_tag { my ( $self, $entry ) = @_; return $self->_translate_tag( $entry->module, $entry->tag, $entry->printable_args ) // $entry->string; } sub _translate_tag { my ( $self, $module, $tag, $args ) = @_; if ( $ENV{LANGUAGE} // '' ne $self->_last_language ) { $self->locale( $self->locale ); } my $code = $self->all_tag_descriptions->{$module}{$tag}; if ( $code ) { return $code->( %{$args} ); } else { return undef; } } no Moose; __PACKAGE__->meta->make_immutable; 1; =head1 NAME Zonemaster::Engine::Translator - translation support for Zonemaster =head1 SYNOPSIS Zonemaster::Engine::Translator->initialize({ locale => 'sv_SE.UTF-8' }); my $trans = Zonemaster::Engine::Translator->instance; say $trans->to_string($entry); This is a singleton class. The instance of this class requires exclusive control over C<$ENV{LC_MESSAGES}> and the program's underlying LC_MESSAGES. At times it resets gettext's textdomain. On construction it unsets C<$ENV{LC_ALL}> and from then on it must remain unset. On systems that support C<$ENV{LANGUAGE}>, this variable overrides the locale() attribute unless the locale() attribute is set to C<"C">. =head1 ATTRIBUTES =over =item locale The locale used for localized messages. say $translator->locale(); if ( !$translator->locale( 'sv_SE.UTF-8' ) ) { say "failed to update locale"; } The value of this attribute is mirrored in C<$ENV{LC_MESSAGES}>. When writing to this attribute, a request is made to update the program's underlying LC_MESSAGES. If this request fails, the attribute value remains unchanged and an empty list is returned. As a side effect when successfully updating this attribute gettext's textdomain is reset. =item data A reference to a hash with translation data. This is unlikely to be useful to end-users. =back =head1 METHODS =over =item initialize(%args) Provide initial values for the single instance of this class. Zonemaster::Engine::Translator->initialize( locale => 'sv_SE.UTF-8' ); This method must be called at most once and before the first call to instance(). =item instance() Returns the single instance of this class. my $translator = Zonemaster::Engine::Translator->instance; If initialize() has not been called prior to the first call to instance(), it is the same as if initialize() had been called without arguments. =item new(%args) Use of this method is deprecated. See L<MooseX::Singleton->new|MooseX::Singleton/"Singleton->new">. =over =item locale If no initial value is provided to the constructor, one is determined by calling setlocale( LC_MESSAGES, "" ). =back =item to_string($entry) Takes a L<Zonemaster::Engine::Logger::Entry> object as its argument and returns a translated string with the timestamp, level, message and arguments in the entry. =item translate_tag Takes a L<Zonemaster::Engine::Logger::Entry> object as its argument and returns a translation of its tag and arguments. =item BUILD Internal method that's only mentioned here to placate L<Pod::Coverage>. =back =cut
26.453552
155
0.623322
ed044a905f4c9e726730fcc3daddf70a1c6f0d79
294
pm
Perl
auto-lib/Paws/AutoScaling/PolicyARNType.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
2
2016-09-22T09:18:33.000Z
2017-06-20T01:36:58.000Z
auto-lib/Paws/AutoScaling/PolicyARNType.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/AutoScaling/PolicyARNType.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
null
null
null
package Paws::AutoScaling::PolicyARNType; use Moose; has PolicyARN => (is => 'ro', isa => 'Str'); 1; ### main pod documentation begin ### =head1 NAME Paws::AutoScaling::PolicyARNType =head1 ATTRIBUTES =head2 PolicyARN => Str The Amazon Resource Name (ARN) of the policy. =cut
11.307692
46
0.673469
ed96184ac8d0cd73ca654e7d0c6e08f2a52cc31b
10,097
pl
Perl
plugins/TaggingHelper/mt-tagging_helper.pl
ARK-Web/mt-plugin-tagging-helper
d7ffcb4da335a9e2587f4d751993e8721172fdc9
[ "MIT" ]
null
null
null
plugins/TaggingHelper/mt-tagging_helper.pl
ARK-Web/mt-plugin-tagging-helper
d7ffcb4da335a9e2587f4d751993e8721172fdc9
[ "MIT" ]
null
null
null
plugins/TaggingHelper/mt-tagging_helper.pl
ARK-Web/mt-plugin-tagging-helper
d7ffcb4da335a9e2587f4d751993e8721172fdc9
[ "MIT" ]
null
null
null
package MT::Plugin::TaggingHelper; use strict; use MT::Template::Context; use MT::Plugin; @MT::Plugin::TaggingHelper::ISA = qw(MT::Plugin); use vars qw($PLUGIN_NAME $VERSION); $PLUGIN_NAME = 'TaggingHelper'; $VERSION = '0.5.1'; use MT; my $plugin = new MT::Plugin::TaggingHelper({ name => $PLUGIN_NAME, version => $VERSION, description => "<MT_TRANS phrase='description of TaggingHelper'>", doc_link => 'http://blog.aklaswad.com/mtplugins/tagginghelper/', author_name => 'akira sawada', author_link => 'http://blog.aklaswad.com/', l10n_class => 'TaggingHelper::L10N', }); MT->add_plugin($plugin); my $mt_version = MT->version_number; if ($mt_version =~ /^6/){ MT->add_callback('template_param.edit_entry', 9, $plugin, \&hdlr_mt5_param); } elsif ($mt_version =~ /^5/){ MT->add_callback('template_param.edit_entry', 9, $plugin, \&hdlr_mt5_param); } elsif ($mt_version =~ /^4/){ MT->add_callback('template_param.edit_entry', 9, $plugin, \&hdlr_mt4_param); } elsif ($mt_version =~ /^7/){ MT->add_callback('template_source.edit_entry', 9, $plugin, \&hdlr_mt7_source_edit_entry); MT->add_callback('template_param.edit_entry', 9, $plugin, \&hdlr_mt7_param_edit_entry); } else { MT->add_callback('MT::App::CMS::AppTemplateSource.edit_entry', 9, $plugin, \&hdlr_mt3_source); } sub _build_html { my $html = <<'EOT'; <style type="text/css"> #tagging_helper_container { cursor: Default; width: 100%; text-align: right; } #tagging_helper_block { cursor: Default; text-align: left; margin: 10px 0; line-height: 1.8em; } .taghelper_tag { cursor: Default; color: #41687b; margin: 0 5px; white-space: nowrap; } .taghelper_tag:hover { cursor: Pointer; color: #246; text-decoration: underline; } .taghelper_tag_selected { cursor: Default; color: #41687b; background-color: #bcd; margin: 0 5px; white-space: nowrap; } .taghelper_tag_selected:hover { cursor: Pointer; color: #246; text-decoration: underline; } .taghelper_command { cursor: Default; color: #61889b; margin-left: 11px; } .taghelper_command:hover { cursor: Pointer; color: #a2ad00; } </style> <script type="text/javascript"> // simple js syntax, because MT3.3 dosen't have js library. // just use RegExp.escape; which appear both MT3.3 and MT4. var TaggingHelper = new Object(); TaggingHelper.close = function() { document.getElementById('tagging_helper_block').style.display = 'none'; } TaggingHelper.compareStrAscend = function (a, b){ return a.localeCompare(b); } TaggingHelper.compareByCount = function (a, b){ return tags_json[b] - tags_json[a] || a.localeCompare(b); } __getbody TaggingHelper.open = function (mode) { var block = document.getElementById('tagging_helper_block'); if (block.style.display == 'none') { block.style.display = 'block'; } var tags = tags_json; var tagary = new Array(); if (mode == 'abc' || mode == 'count') { for (var tag in tags ){ tagary.push(tag); } } else { var body = this.getBody(); for (var tag in tags ) { var exp = new RegExp(RegExp.escape(tag)); if (exp.test(body)) { tagary.push(tag); } } } if (mode == 'count') tagary.sort(this.compareByCount); else tagary.sort(this.compareStrAscend); var v = document.getElementById('tags').value; var taglist = ''; var table = document.createElement('div'); table.className = 'taghelper-table'; for (var i=0; i< tagary.length; i++) { var tag = tagary[i]; var e = document.createElement('span'); e.onclick = TaggingHelper.action; e.th_tag = tag; e.appendChild( document.createTextNode(tag) ); var exp = new RegExp("^(.*, ?)?" + RegExp.escape(tag) + "( ?\,.*)?$"); e.className = (exp.test(v)) ? 'taghelper_tag_selected' : 'taghelper_tag'; table.appendChild(e); table.appendChild( document.createTextNode(' ') ); } while (block.childNodes.length) block.removeChild(block.childNodes.item(0)); block.appendChild(table); } TaggingHelper.action = function (evt) { // IE-Firefox compatible var e = evt || window.event; var a = e.target || e.srcElement; var s = a.th_tag; var v = document.getElementById('tags').value; var exp = new RegExp("^(.*, ?)?" + RegExp.escape(s) + "( ?\,.*)?$"); if (exp.test(v)) { v = v.replace(exp, "$1$2"); if (tag_delim == ',') { v = v.replace(/ *, *, */g, ', '); } else { v = v.replace(/ +/g, ' '); } a.className = 'taghelper_tag'; } else { v += (tag_delim == ',' ? ', ' : ' ') + s; a.className = 'taghelper_tag_selected'; } v = v.replace(/^[ \,]+/, ''); v = v.replace(/[ \,]+$/, ''); document.getElementById('tags').value = v; } </script> <div id="tagging_helper_container"> <span id="taghelper_abc" onclick="TaggingHelper.open('abc')" class="taghelper_command"><MT_TRANS phrase="alphabetical"></span> <span id="taghelper_count" onclick="TaggingHelper.open('count')" class="taghelper_command"><MT_TRANS phrase="frequency"></span> <span id="taghelper_match" onclick="TaggingHelper.open('match')" class="taghelper_command"><MT_TRANS phrase="match in body"></span> <span id="taghelper_close" onclick="TaggingHelper.close()" class="taghelper_command"><MT_TRANS phrase="close"></span> <div id="tagging_helper_block" style="display: none;"></div> </div> EOT my $getbody3 = <<'EOT'; TaggingHelper.getBody = function () { // for MT 3.3 return document.getElementById('text').value + '\n' + document.getElementById('text_more').value; } EOT my $getbody4 = <<'EOT'; TaggingHelper.getBody = function () { // for MT 4 // get both current editting field and hidden input fields. // currently i don't care about duplication. // but it's very nasty. FIXME! return app.editor.getHTML() + '\n' + document.getElementById('editor-input-content').value + '\n' + document.getElementById('editor-input-extended').value; } EOT my $getbody7 = <<'EOT'; TaggingHelper.getBody = function () { // for MT 6/7 return jQuery('#editor-input-content_ifr').contents().find('body').html() + '\n' + jQuery('#editor-input-extended_ifr').contents().find('body').html(); } EOT my $getbody = ($mt_version =~ /^[45]/) ? $getbody4 : $getbody3; $getbody = $getbody7 if $mt_version =~ /^[67]/; $html =~ s/__getbody/$getbody/; return $plugin->translate_templatized($html); } sub hdlr_mt3_source { my ($eh, $app, $tmpl) = @_; my $html = _build_html(); my $pattern = quotemeta(<<'EOT'); <!--[if lte IE 6.5]><div id="iehack"><![endif]--> <div id="tags_completion" class="full-width"></div> <!--[if lte IE 6.5]></div><![endif]--> </div> EOT $$tmpl =~ s!($pattern)!$1$html!; } sub hdlr_mt4_param { my ($eh, $app, $param, $tmpl) = @_; my $html = _build_html(); die 'something wrong...' unless UNIVERSAL::isa($tmpl, 'MT::Template'); my $host_node = $tmpl->getElementById('tags') or die 'cannot find tags field in the screen.'; $host_node->innerHTML($host_node->innerHTML . $html); 1; } sub hdlr_mt5_param { my ($eh, $app, $param, $tmpl) = @_; my $html = _build_html(); die 'something wrong...' unless UNIVERSAL::isa($tmpl, 'MT::Template'); my $host_node = $tmpl->getElementById('tags') or die 'cannot find tags field in the screen.'; $host_node->innerHTML($host_node->innerHTML . $html); my $blog_id = $app->param('blog_id') or return 1; my $entry_class = 'entry'; my %terms; # $terms{blog_id} = $blog_id; $terms{object_datasource} = 'entry'; my $iter = MT->model('objecttag')->count_group_by( \%terms, { sort => 'cnt', direction => 'ascend', group => ['tag_id'], join => MT::Entry->join_on( undef, { #class => $entry_class, id => \'= objecttag_object_id', } ), }, ); my %tag_counts; while ( my ( $cnt, $id ) = $iter->() ) { $tag_counts{$id} = $cnt; } my %tags = map { $_->name => $tag_counts{ $_->id } } MT->model('tag')->load({ id => [ keys %tag_counts ] }); my $tags_json = MT::Util::to_json( \%tags ); $param->{js_include} .= qq{ <script type="text/javascript"> var tags_json = $tags_json; </script> }; 1; } # for MT7 sub hdlr_mt7_source_edit_entry { my ($eh, $app, $tmpl_ref) = @_; my $html = _build_html(); my $pattern = q(<input .*?id="tags".*?/>); die 'not found id="tags"' unless ($$tmpl_ref =~ m/$pattern/s); $$tmpl_ref =~ s/($pattern)/$1$html/s; } sub hdlr_mt7_param_edit_entry { my ($eh, $app, $param, $tmpl) = @_; my $blog_id = $app->param('blog_id') or return 1; my $entry_class = 'entry'; my %terms; # $terms{blog_id} = $blog_id; $terms{object_datasource} = 'entry'; my $iter = MT->model('objecttag')->count_group_by( \%terms, { sort => 'cnt', direction => 'ascend', group => ['tag_id'], join => MT::Entry->join_on( undef, { #class => $entry_class, id => \'= objecttag_object_id', } ), }, ); my %tag_counts; while ( my ( $cnt, $id ) = $iter->() ) { $tag_counts{$id} = $cnt; } my %tags = map { $_->name => $tag_counts{ $_->id } } MT->model('tag')->load({ id => [ keys %tag_counts ] }); my $tags_json = MT::Util::to_json( \%tags ); $param->{js_include} .= qq{ <script type="text/javascript"> var tags_json = $tags_json; </script> }; 1; } 1;
28.766382
135
0.575517
ed57b71aa04f729fc56be2c17be1126f7b0fd988
116
t
Perl
VideoServer/scripts/perl/POE-Filter-FSSocket/t/01_basic.t
zengfanmao/mpds
c2bba464eaddc9ec70604a8614d84c5334461e8e
[ "MIT" ]
null
null
null
VideoServer/scripts/perl/POE-Filter-FSSocket/t/01_basic.t
zengfanmao/mpds
c2bba464eaddc9ec70604a8614d84c5334461e8e
[ "MIT" ]
null
null
null
VideoServer/scripts/perl/POE-Filter-FSSocket/t/01_basic.t
zengfanmao/mpds
c2bba464eaddc9ec70604a8614d84c5334461e8e
[ "MIT" ]
null
null
null
#!/usr/bin/env perl use warnings; use strict; use Test::More tests => 1; use_ok("POE::Filter::FSSocket"); exit;
10.545455
32
0.663793
ed210d229349019b5d83b01c313d057d62618844
4,206
pm
Perl
lib/Slic3r/GUI/Preferences.pm
beanz/Slic3r
36231347f9bd683c5196d3ee6e1e2447ac5ced95
[ "CC-BY-3.0" ]
1
2016-08-05T03:48:28.000Z
2016-08-05T03:48:28.000Z
lib/Slic3r/GUI/Preferences.pm
liningzhanm/3D
34f1853dd0bf67e24646ae7912b94a59c52e9682
[ "CC-BY-3.0" ]
null
null
null
lib/Slic3r/GUI/Preferences.pm
liningzhanm/3D
34f1853dd0bf67e24646ae7912b94a59c52e9682
[ "CC-BY-3.0" ]
null
null
null
package Slic3r::GUI::Preferences; use Wx qw(:dialog :id :misc :sizer :systemsettings wxTheApp); use Wx::Event qw(EVT_BUTTON EVT_TEXT_ENTER); use base 'Wx::Dialog'; sub new { my ($class, $parent) = @_; my $self = $class->SUPER::new($parent, -1, "Preferences", wxDefaultPosition, wxDefaultSize); $self->{values} = {}; my $optgroup; $optgroup = Slic3r::GUI::OptionsGroup->new( parent => $self, title => 'General', on_change => sub { my ($opt_id) = @_; $self->{values}{$opt_id} = $optgroup->get_value($opt_id); }, label_width => 200, ); $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( opt_id => 'mode', type => 'select', label => 'Mode', tooltip => 'Choose between a simpler, basic mode and an expert mode with more options and more complicated interface.', labels => ['Simple','Expert'], values => ['simple','expert'], default => $Slic3r::GUI::Settings->{_}{mode}, width => 100, )); $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( opt_id => 'version_check', type => 'bool', label => 'Check for updates', tooltip => 'If this is enabled, Slic3r will check for updates daily and display a reminder if a newer version is available.', default => $Slic3r::GUI::Settings->{_}{version_check} // 1, readonly => !wxTheApp->have_version_check, )); $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( opt_id => 'remember_output_path', type => 'bool', label => 'Remember output directory', tooltip => 'If this is enabled, Slic3r will prompt the last output directory instead of the one containing the input files.', default => $Slic3r::GUI::Settings->{_}{remember_output_path}, )); $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( opt_id => 'autocenter', type => 'bool', label => 'Auto-center parts', tooltip => 'If this is enabled, Slic3r will auto-center objects around the print bed center.', default => $Slic3r::GUI::Settings->{_}{autocenter}, )); $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( opt_id => 'background_processing', type => 'bool', label => 'Background processing', tooltip => 'If this is enabled, Slic3r will pre-process objects as soon as they\'re loaded in order to save time when exporting G-code.', default => $Slic3r::GUI::Settings->{_}{background_processing}, readonly => !$Slic3r::have_threads, )); $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( opt_id => 'no_controller', type => 'bool', label => 'Disable USB/serial connection', tooltip => 'Disable communication with the printer over a serial / USB cable. This simplifies the user interface in case the printer is never attached to the computer.', default => $Slic3r::GUI::Settings->{_}{no_controller}, )); my $sizer = Wx::BoxSizer->new(wxVERTICAL); $sizer->Add($optgroup->sizer, 0, wxEXPAND | wxBOTTOM | wxLEFT | wxRIGHT, 10); my $buttons = $self->CreateStdDialogButtonSizer(wxOK | wxCANCEL); EVT_BUTTON($self, wxID_OK, sub { $self->_accept }); $sizer->Add($buttons, 0, wxEXPAND | wxBOTTOM | wxLEFT | wxRIGHT, 10); $self->SetSizer($sizer); $sizer->SetSizeHints($self); return $self; } sub _accept { my $self = shift; if ($self->{values}{mode} || defined($self->{values}{no_controller})) { Slic3r::GUI::warning_catcher($self)->("You need to restart Slic3r to make the changes effective."); } $Slic3r::GUI::Settings->{_}{$_} = $self->{values}{$_} for keys %{$self->{values}}; wxTheApp->save_settings; $self->EndModal(wxID_OK); $self->Close; # needed on Linux } 1;
43.360825
181
0.591536
ed67c2eb3e19ae89d6383bb53ccbd9d6cab3c534
824
pm
Perl
test/mock_services/Services/webproxy/Filters/Filter403.pm
btovar/cvmfs
23a98b0ec0a9407f83f29728bb8c7fbf331cbdc0
[ "BSD-3-Clause" ]
null
null
null
test/mock_services/Services/webproxy/Filters/Filter403.pm
btovar/cvmfs
23a98b0ec0a9407f83f29728bb8c7fbf331cbdc0
[ "BSD-3-Clause" ]
null
null
null
test/mock_services/Services/webproxy/Filters/Filter403.pm
btovar/cvmfs
23a98b0ec0a9407f83f29728bb8c7fbf331cbdc0
[ "BSD-3-Clause" ]
null
null
null
package Filters::Filter403; use strict; use warnings; use HTTP::Proxy::HeaderFilter::simple; use HTTP::Proxy::BodyFilter::simple; our $header = HTTP::Proxy::HeaderFilter::simple->new ( sub { $_[2]->code( 403 ); $_[2]->message ( 'Forbidden' ); } ); our $body = HTTP::Proxy::BodyFilter::simple->new ( sub { my ( $self, $dataref, $message, $protocol, $buffer ) = @_; unless (defined ($buffer)){ my $html = '<!DOCTYPE html>'. '<html><head><title>403 Forbidden</title><style type="text/css">'. 'body { padding: 40pt; }'. 'body, h1, h2, p { color: #333; font-family: Arial, sans-serif; margin: 0; }'. 'div { width: 200px; background: #eee; padding: 2em; }'. '</style></head><body><div><h1>403</h1><h2>Forbidden</h2></div></body></html>'; $$dataref = $html; } } ); 1;
24.969697
84
0.586165
eda1f832c26fa0b8cd38ba70ba3a4ab49278dd15
2,123
t
Perl
testcases/t/544-focus-multiple-outputs.t
ashwin2802/i3
1e7550fa174819b42ae6b75c74c4710233cfa2a3
[ "BSD-3-Clause" ]
6,636
2015-01-01T21:48:25.000Z
2022-03-31T20:03:48.000Z
testcases/t/544-focus-multiple-outputs.t
ashwin2802/i3
1e7550fa174819b42ae6b75c74c4710233cfa2a3
[ "BSD-3-Clause" ]
397
2015-01-01T20:05:51.000Z
2022-02-10T14:37:13.000Z
testcases/t/544-focus-multiple-outputs.t
ashwin2802/i3
1e7550fa174819b42ae6b75c74c4710233cfa2a3
[ "BSD-3-Clause" ]
511
2015-01-05T02:39:12.000Z
2022-03-23T12:24:47.000Z
#!perl # vim:ts=4:sw=4:expandtab # # Please read the following documents before working on tests: # • https://build.i3wm.org/docs/testsuite.html # (or docs/testsuite) # # • https://build.i3wm.org/docs/lib-i3test.html # (alternatively: perldoc ./testcases/lib/i3test.pm) # # • https://build.i3wm.org/docs/ipc.html # (or docs/ipc) # # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf # (unless you are already familiar with Perl) # # Test using multiple output for 'focus output …' # Ticket: #4619 use i3test i3_config => <<EOT; # i3 config file (v4) font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 fake-outputs 1024x768+0+0,1024x768+1024+0,1024x768+0+768,1024x768+1024+768 EOT ############################################################################### # Test using "next" special keyword ############################################################################### is(focused_output, "fake-0", 'sanity check'); for (my $i = 1; $i < 9; $i++) { cmd 'focus output next'; my $out = $i % 4; is(focused_output, "fake-$out", 'focus output next cycle'); } ############################################################################### # Same as above but explicitely type all the outputs ############################################################################### is(focused_output, "fake-0", 'sanity check'); for (my $i = 1; $i < 10; $i++) { cmd 'focus output fake-0 fake-1 fake-2 fake-3'; my $out = $i % 4; is(focused_output, "fake-$out", 'focus output next cycle'); } ############################################################################### # Use a subset of the outputs plus some non-existing outputs ############################################################################### cmd 'focus output fake-1'; is(focused_output, "fake-1", 'start from fake-1 which is not included in output list'); my @order = (0, 3, 2); for (my $i = 0; $i < 10; $i++) { cmd 'focus output doesnotexist fake-0 alsodoesnotexist fake-3 fake-2'; my $out = $order[$i % 3]; is(focused_output, "fake-$out", 'focus output next cycle'); } done_testing;
31.220588
87
0.514366