code
stringlengths
4
1.01M
language
stringclasses
2 values
SUBROUTINE PSGEQR2( M, N, A, IA, JA, DESCA, TAU, WORK, LWORK, $ INFO ) * * -- ScaLAPACK routine (version 1.7) -- * University of Tennessee, Knoxville, Oak Ridge National Laboratory, * and University of California, Berkeley. * May 25, 2001 * * .. Scalar Arguments .. INTEGER IA, INFO, JA, LWORK, M, N * .. * .. Array Arguments .. INTEGER DESCA( * ) REAL A( * ), TAU( * ), WORK( * ) * .. * * Purpose * ======= * * PSGEQR2 computes a QR factorization of a real distributed M-by-N * matrix sub( A ) = A(IA:IA+M-1,JA:JA+N-1) = Q * R. * * Notes * ===== * * Each global data object is described by an associated description * vector. This vector stores the information required to establish * the mapping between an object element and its corresponding process * and memory location. * * Let A be a generic term for any 2D block cyclicly distributed array. * Such a global array has an associated description vector DESCA. * In the following comments, the character _ should be read as * "of the global array". * * NOTATION STORED IN EXPLANATION * --------------- -------------- -------------------------------------- * DTYPE_A(global) DESCA( DTYPE_ )The descriptor type. In this case, * DTYPE_A = 1. * CTXT_A (global) DESCA( CTXT_ ) The BLACS context handle, indicating * the BLACS process grid A is distribu- * ted over. The context itself is glo- * bal, but the handle (the integer * value) may vary. * M_A (global) DESCA( M_ ) The number of rows in the global * array A. * N_A (global) DESCA( N_ ) The number of columns in the global * array A. * MB_A (global) DESCA( MB_ ) The blocking factor used to distribute * the rows of the array. * NB_A (global) DESCA( NB_ ) The blocking factor used to distribute * the columns of the array. * RSRC_A (global) DESCA( RSRC_ ) The process row over which the first * row of the array A is distributed. * CSRC_A (global) DESCA( CSRC_ ) The process column over which the * first column of the array A is * distributed. * LLD_A (local) DESCA( LLD_ ) The leading dimension of the local * array. LLD_A >= MAX(1,LOCr(M_A)). * * Let K be the number of rows or columns of a distributed matrix, * and assume that its process grid has dimension p x q. * LOCr( K ) denotes the number of elements of K that a process * would receive if K were distributed over the p processes of its * process column. * Similarly, LOCc( K ) denotes the number of elements of K that a * process would receive if K were distributed over the q processes of * its process row. * The values of LOCr() and LOCc() may be determined via a call to the * ScaLAPACK tool function, NUMROC: * LOCr( M ) = NUMROC( M, MB_A, MYROW, RSRC_A, NPROW ), * LOCc( N ) = NUMROC( N, NB_A, MYCOL, CSRC_A, NPCOL ). * An upper bound for these quantities may be computed by: * LOCr( M ) <= ceil( ceil(M/MB_A)/NPROW )*MB_A * LOCc( N ) <= ceil( ceil(N/NB_A)/NPCOL )*NB_A * * Arguments * ========= * * M (global input) INTEGER * The number of rows to be operated on, i.e. the number of rows * of the distributed submatrix sub( A ). M >= 0. * * N (global input) INTEGER * The number of columns to be operated on, i.e. the number of * columns of the distributed submatrix sub( A ). N >= 0. * * A (local input/local output) REAL pointer into the * local memory to an array of dimension (LLD_A, LOCc(JA+N-1)). * On entry, the local pieces of the M-by-N distributed matrix * sub( A ) which is to be factored. On exit, the elements on * and above the diagonal of sub( A ) contain the min(M,N) by N * upper trapezoidal matrix R (R is upper triangular if M >= N); * the elements below the diagonal, with the array TAU, * represent the orthogonal matrix Q as a product of elementary * reflectors (see Further Details). * * IA (global input) INTEGER * The row index in the global array A indicating the first * row of sub( A ). * * JA (global input) INTEGER * The column index in the global array A indicating the * first column of sub( A ). * * DESCA (global and local input) INTEGER array of dimension DLEN_. * The array descriptor for the distributed matrix A. * * TAU (local output) REAL, array, dimension * LOCc(JA+MIN(M,N)-1). This array contains the scalar factors * TAU of the elementary reflectors. TAU is tied to the * distributed matrix A. * * WORK (local workspace/local output) REAL array, * dimension (LWORK) * On exit, WORK(1) returns the minimal and optimal LWORK. * * LWORK (local or global input) INTEGER * The dimension of the array WORK. * LWORK is local input and must be at least * LWORK >= Mp0 + MAX( 1, Nq0 ), where * * IROFF = MOD( IA-1, MB_A ), ICOFF = MOD( JA-1, NB_A ), * IAROW = INDXG2P( IA, MB_A, MYROW, RSRC_A, NPROW ), * IACOL = INDXG2P( JA, NB_A, MYCOL, CSRC_A, NPCOL ), * Mp0 = NUMROC( M+IROFF, MB_A, MYROW, IAROW, NPROW ), * Nq0 = NUMROC( N+ICOFF, NB_A, MYCOL, IACOL, NPCOL ), * * and NUMROC, INDXG2P are ScaLAPACK tool functions; * MYROW, MYCOL, NPROW and NPCOL can be determined by calling * the subroutine BLACS_GRIDINFO. * * If LWORK = -1, then LWORK is global input and a workspace * query is assumed; the routine only calculates the minimum * and optimal size for all work arrays. Each of these * values is returned in the first entry of the corresponding * work array, and no error message is issued by PXERBLA. * * INFO (local output) INTEGER * = 0: successful exit * < 0: If the i-th argument is an array and the j-entry had * an illegal value, then INFO = -(i*100+j), if the i-th * argument is a scalar and had an illegal value, then * INFO = -i. * * Further Details * =============== * * The matrix Q is represented as a product of elementary reflectors * * Q = H(ja) H(ja+1) . . . H(ja+k-1), where k = min(m,n). * * Each H(i) has the form * * H(j) = I - tau * v * v' * * where tau is a real scalar, and v is a real vector with v(1:i-1) = 0 * and v(i) = 1; v(i+1:m) is stored on exit in A(ia+i:ia+m-1,ja+i-1), * and tau in TAU(ja+i-1). * * ===================================================================== * * .. Parameters .. INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_, $ LLD_, MB_, M_, NB_, N_, RSRC_ PARAMETER ( BLOCK_CYCLIC_2D = 1, DLEN_ = 9, DTYPE_ = 1, $ CTXT_ = 2, M_ = 3, N_ = 4, MB_ = 5, NB_ = 6, $ RSRC_ = 7, CSRC_ = 8, LLD_ = 9 ) REAL ONE PARAMETER ( ONE = 1.0E+0 ) * .. * .. Local Scalars .. LOGICAL LQUERY CHARACTER COLBTOP, ROWBTOP INTEGER I, II, IACOL, IAROW, ICTXT, J, JJ, K, LWMIN, $ MP, MYCOL, MYROW, NPCOL, NPROW, NQ REAL AJJ, ALPHA * .. * .. External Subroutines .. EXTERNAL BLACS_ABORT, BLACS_GRIDINFO, CHK1MAT, INFOG2L, $ PSELSET, PSLARF, PSLARFG, PB_TOPGET, $ PB_TOPSET, PXERBLA, SGEBR2D, SGEBS2D, $ SLARFG, SSCAL * .. * .. External Functions .. INTEGER INDXG2P, NUMROC EXTERNAL INDXG2P, NUMROC * .. * .. Intrinsic Functions .. INTRINSIC MAX, MIN, MOD, REAL * .. * .. Executable Statements .. * * Get grid parameters * ICTXT = DESCA( CTXT_ ) CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL ) * * Test the input parameters * INFO = 0 IF( NPROW.EQ.-1 ) THEN INFO = -(600+CTXT_) ELSE CALL CHK1MAT( M, 1, N, 2, IA, JA, DESCA, 6, INFO ) IF( INFO.EQ.0 ) THEN IAROW = INDXG2P( IA, DESCA( MB_ ), MYROW, DESCA( RSRC_ ), $ NPROW ) IACOL = INDXG2P( JA, DESCA( NB_ ), MYCOL, DESCA( CSRC_ ), $ NPCOL ) MP = NUMROC( M+MOD( IA-1, DESCA( MB_ ) ), DESCA( MB_ ), $ MYROW, IAROW, NPROW ) NQ = NUMROC( N+MOD( JA-1, DESCA( NB_ ) ), DESCA( NB_ ), $ MYCOL, IACOL, NPCOL ) LWMIN = MP + MAX( 1, NQ ) * WORK( 1 ) = REAL( LWMIN ) LQUERY = ( LWORK.EQ.-1 ) IF( LWORK.LT.LWMIN .AND. .NOT.LQUERY ) $ INFO = -9 END IF END IF * IF( INFO.NE.0 ) THEN CALL PXERBLA( ICTXT, 'PSGEQR2', -INFO ) CALL BLACS_ABORT( ICTXT, 1 ) RETURN ELSE IF( LQUERY ) THEN RETURN END IF * * Quick return if possible * IF( M.EQ.0 .OR. N.EQ.0 ) $ RETURN * CALL PB_TOPGET( ICTXT, 'Broadcast', 'Rowwise', ROWBTOP ) CALL PB_TOPGET( ICTXT, 'Broadcast', 'Columnwise', COLBTOP ) CALL PB_TOPSET( ICTXT, 'Broadcast', 'Rowwise', 'I-ring' ) CALL PB_TOPSET( ICTXT, 'Broadcast', 'Columnwise', ' ' ) * IF( DESCA( M_ ).EQ.1 ) THEN CALL INFOG2L( IA, JA, DESCA, NPROW, NPCOL, MYROW, MYCOL, II, $ JJ, IAROW, IACOL ) IF( MYROW.EQ.IAROW ) THEN NQ = NUMROC( JA+N-1, DESCA( NB_ ), MYCOL, DESCA( CSRC_ ), $ NPCOL ) I = II+(JJ-1)*DESCA( LLD_ ) IF( MYCOL.EQ.IACOL ) THEN AJJ = A( I ) CALL SLARFG( 1, AJJ, A( I ), 1, TAU( JJ ) ) IF( N.GT.1 ) THEN ALPHA = ONE - TAU( JJ ) CALL SGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, ALPHA, 1 ) CALL SSCAL( NQ-JJ, ALPHA, A( I+DESCA( LLD_ ) ), $ DESCA( LLD_ ) ) END IF CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, TAU( JJ ), $ 1 ) A( I ) = AJJ ELSE IF( N.GT.1 ) THEN CALL SGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, ALPHA, $ 1, IAROW, IACOL ) CALL SSCAL( NQ-JJ+1, ALPHA, A( I ), DESCA( LLD_ ) ) END IF END IF ELSE IF( MYCOL.EQ.IACOL ) THEN CALL SGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, TAU( JJ ), 1, $ IAROW, IACOL ) END IF * ELSE * K = MIN( M, N ) DO 10 J = JA, JA+K-1 I = IA + J - JA * * Generate elementary reflector H(j) to annihilate * A(i+1:ia+m-1,j) * CALL PSLARFG( M-J+JA, AJJ, I, J, A, MIN( I+1, IA+M-1 ), J, $ DESCA, 1, TAU ) IF( J.LT.JA+N-1 ) THEN * * Apply H(j)' to A(i:ia+m-1,j+1:ja+n-1) from the left * CALL PSELSET( A, I, J, DESCA, ONE ) * CALL PSLARF( 'Left', M-J+JA, N-J+JA-1, A, I, J, DESCA, 1, $ TAU, A, I, J+1, DESCA, WORK ) END IF CALL PSELSET( A, I, J, DESCA, AJJ ) * 10 CONTINUE * END IF * CALL PB_TOPSET( ICTXT, 'Broadcast', 'Rowwise', ROWBTOP ) CALL PB_TOPSET( ICTXT, 'Broadcast', 'Columnwise', COLBTOP ) * WORK( 1 ) = REAL( LWMIN ) * RETURN * * End of PSGEQR2 * END
Java
require 'test_helper' class CFRGCurvesTest < Minitest::Test def test_curve25519_eddsa_ed25519 vectors = [ [ # TEST 1 hexstr2bin( "9d61b19deffd5a60ba844af492ec2cc4"\ "4449c5697b326919703bac031cae7f60"), # SECRET KEY hexstr2bin( "d75a980182b10ab7d54bfed3c964073a"\ "0ee172f3daa62325af021a68f707511a"), # PUBLIC KEY "", # MESSAGE hexstr2bin( "e5564300c360ac729086e2cc806e828a"\ "84877f1eb8e5d974d873e06522490155"\ "5fb8821590a33bacc61e39701cf9b46b"\ "d25bf5f0595bbe24655141438e7a100b") # SIGNATURE ], [ # TEST 2 hexstr2bin( "4ccd089b28ff96da9db6c346ec114e0f"\ "5b8a319f35aba624da8cf6ed4fb8a6fb"), # SECRET KEY hexstr2bin( "3d4017c3e843895a92b70aa74d1b7ebc"\ "9c982ccf2ec4968cc0cd55f12af4660c"), # PUBLIC KEY hexstr2bin("72"), # MESSAGE hexstr2bin( "92a009a9f0d4cab8720e820b5f642540"\ "a2b27b5416503f8fb3762223ebdb69da"\ "085ac1e43e15996e458f3613d0f11d8c"\ "387b2eaeb4302aeeb00d291612bb0c00") # SIGNATURE ], [ # TEST 3 hexstr2bin( "c5aa8df43f9f837bedb7442f31dcb7b1"\ "66d38535076f094b85ce3a2e0b4458f7"), # SECRET KEY hexstr2bin( "fc51cd8e6218a1a38da47ed00230f058"\ "0816ed13ba3303ac5deb911548908025"), # PUBLIC KEY hexstr2bin("af82"), # MESSAGE hexstr2bin( "6291d657deec24024827e69c3abe01a3"\ "0ce548a284743a445e3680d7db5ac3ac"\ "18ff9b538d16f290ae67f760984dc659"\ "4a7c15e9716ed28dc027beceea1ec40a") # SIGNATURE ], [ # TEST 1024 hexstr2bin( "f5e5767cf153319517630f226876b86c"\ "8160cc583bc013744c6bf255f5cc0ee5"), # SECRET KEY hexstr2bin( "278117fc144c72340f67d0f2316e8386"\ "ceffbf2b2428c9c51fef7c597f1d426e"), # PUBLIC KEY hexstr2bin( "08b8b2b733424243760fe426a4b54908"\ "632110a66c2f6591eabd3345e3e4eb98"\ "fa6e264bf09efe12ee50f8f54e9f77b1"\ "e355f6c50544e23fb1433ddf73be84d8"\ "79de7c0046dc4996d9e773f4bc9efe57"\ "38829adb26c81b37c93a1b270b20329d"\ "658675fc6ea534e0810a4432826bf58c"\ "941efb65d57a338bbd2e26640f89ffbc"\ "1a858efcb8550ee3a5e1998bd177e93a"\ "7363c344fe6b199ee5d02e82d522c4fe"\ "ba15452f80288a821a579116ec6dad2b"\ "3b310da903401aa62100ab5d1a36553e"\ "06203b33890cc9b832f79ef80560ccb9"\ "a39ce767967ed628c6ad573cb116dbef"\ "efd75499da96bd68a8a97b928a8bbc10"\ "3b6621fcde2beca1231d206be6cd9ec7"\ "aff6f6c94fcd7204ed3455c68c83f4a4"\ "1da4af2b74ef5c53f1d8ac70bdcb7ed1"\ "85ce81bd84359d44254d95629e9855a9"\ "4a7c1958d1f8ada5d0532ed8a5aa3fb2"\ "d17ba70eb6248e594e1a2297acbbb39d"\ "502f1a8c6eb6f1ce22b3de1a1f40cc24"\ "554119a831a9aad6079cad88425de6bd"\ "e1a9187ebb6092cf67bf2b13fd65f270"\ "88d78b7e883c8759d2c4f5c65adb7553"\ "878ad575f9fad878e80a0c9ba63bcbcc"\ "2732e69485bbc9c90bfbd62481d9089b"\ "eccf80cfe2df16a2cf65bd92dd597b07"\ "07e0917af48bbb75fed413d238f5555a"\ "7a569d80c3414a8d0859dc65a46128ba"\ "b27af87a71314f318c782b23ebfe808b"\ "82b0ce26401d2e22f04d83d1255dc51a"\ "ddd3b75a2b1ae0784504df543af8969b"\ "e3ea7082ff7fc9888c144da2af58429e"\ "c96031dbcad3dad9af0dcbaaaf268cb8"\ "fcffead94f3c7ca495e056a9b47acdb7"\ "51fb73e666c6c655ade8297297d07ad1"\ "ba5e43f1bca32301651339e22904cc8c"\ "42f58c30c04aafdb038dda0847dd988d"\ "cda6f3bfd15c4b4c4525004aa06eeff8"\ "ca61783aacec57fb3d1f92b0fe2fd1a8"\ "5f6724517b65e614ad6808d6f6ee34df"\ "f7310fdc82aebfd904b01e1dc54b2927"\ "094b2db68d6f903b68401adebf5a7e08"\ "d78ff4ef5d63653a65040cf9bfd4aca7"\ "984a74d37145986780fc0b16ac451649"\ "de6188a7dbdf191f64b5fc5e2ab47b57"\ "f7f7276cd419c17a3ca8e1b939ae49e4"\ "88acba6b965610b5480109c8b17b80e1"\ "b7b750dfc7598d5d5011fd2dcc5600a3"\ "2ef5b52a1ecc820e308aa342721aac09"\ "43bf6686b64b2579376504ccc493d97e"\ "6aed3fb0f9cd71a43dd497f01f17c0e2"\ "cb3797aa2a2f256656168e6c496afc5f"\ "b93246f6b1116398a346f1a641f3b041"\ "e989f7914f90cc2c7fff357876e506b5"\ "0d334ba77c225bc307ba537152f3f161"\ "0e4eafe595f6d9d90d11faa933a15ef1"\ "369546868a7f3a45a96768d40fd9d034"\ "12c091c6315cf4fde7cb68606937380d"\ "b2eaaa707b4c4185c32eddcdd306705e"\ "4dc1ffc872eeee475a64dfac86aba41c"\ "0618983f8741c5ef68d3a101e8a3b8ca"\ "c60c905c15fc910840b94c00a0b9d0"), # MESSAGE hexstr2bin( "0aab4c900501b3e24d7cdf4663326a3a"\ "87df5e4843b2cbdb67cbf6e460fec350"\ "aa5371b1508f9f4528ecea23c436d94b"\ "5e8fcd4f681e30a6ac00a9704a188a03") # SIGNATURE ], [ # TEST SHA(abc) hexstr2bin( "833fe62409237b9d62ec77587520911e"\ "9a759cec1d19755b7da901b96dca3d42"), # SECRET KEY hexstr2bin( "ec172b93ad5e563bf4932c70e1245034"\ "c35467ef2efd4d64ebf819683467e2bf"), # PUBLIC KEY hexstr2bin( "ddaf35a193617abacc417349ae204131"\ "12e6fa4e89a97ea20a9eeee64b55d39a"\ "2192992a274fc1a836ba3c23a3feebbd"\ "454d4423643ce80e2a9ac94fa54ca49f"), # MESSAGE hexstr2bin( "dc2a4459e7369633a52b1bf277839a00"\ "201009a3efbf3ecb69bea2186c26b589"\ "09351fc9ac90b3ecfdfbc7c66431e030"\ "3dca179c138ac17ad9bef1177331a704") # SIGNATURE ] ] vectors.each do |(secret, pk, m, sig)| _pk, sk = JOSE::JWA::Ed25519.keypair(secret) assert_equal pk, _pk _sig = JOSE::JWA::Ed25519.sign(m, sk) assert_equal sig, _sig assert JOSE::JWA::Ed25519.verify(sig, m, pk) if JOSE::JWA::Curve25519_RbNaCl.__supported__? _pk, sk = JOSE::JWA::Ed25519_RbNaCl.keypair(secret) assert_equal pk, _pk _sig = JOSE::JWA::Ed25519_RbNaCl.sign(m, sk) assert_equal sig, _sig assert JOSE::JWA::Ed25519_RbNaCl.verify(sig, m, pk) end end end def test_curve25519_eddsa_ed25519ph vectors = [ [ # TEST abc hexstr2bin( "833fe62409237b9d62ec77587520911e"\ "9a759cec1d19755b7da901b96dca3d42"), # SECRET KEY hexstr2bin( "ec172b93ad5e563bf4932c70e1245034"\ "c35467ef2efd4d64ebf819683467e2bf"), # PUBLIC KEY hexstr2bin("616263"), # MESSAGE hexstr2bin( "dc2a4459e7369633a52b1bf277839a00"\ "201009a3efbf3ecb69bea2186c26b589"\ "09351fc9ac90b3ecfdfbc7c66431e030"\ "3dca179c138ac17ad9bef1177331a704") # SIGNATURE ] ] vectors.each do |(secret, pk, m, sig)| if JOSE::JWA::Curve25519_RbNaCl.__supported__? _pk, sk = JOSE::JWA::Ed25519_RbNaCl.keypair(secret) assert_equal pk, _pk _sig = JOSE::JWA::Ed25519_RbNaCl.sign_ph(m, sk) assert_equal sig, _sig assert JOSE::JWA::Ed25519_RbNaCl.verify_ph(sig, m, pk) end end end def test_curve25519_rfc7748_curve25519 vectors = [ [ 31029842492115040904895560451863089656472772604678260265531221036453811406496, # Input scalar 34426434033919594451155107781188821651316167215306631574996226621102155684838, # Input u-coordinate hexstr2lint("c3da55379de9c6908e94ea4df28d084f32eccf03491c71f754b4075577a28552") # Output u-coordinate ], [ 35156891815674817266734212754503633747128614016119564763269015315466259359304, # Input scalar 8883857351183929894090759386610649319417338800022198945255395922347792736741, # Input u-coordinate hexstr2lint("95cbde9476e8907d7aade45cb4b873f88b595a68799fa152e6f8f7647aac7957") # Output u-coordinate ] ] vectors.each do |(input_scalar, input_u_coordinate, output_u_coordinate)| input_scalar = JOSE::JWA::X25519.coerce_scalar_fe!(input_scalar) input_u_coordinate = JOSE::JWA::X25519.coerce_coordinate_fe!(input_u_coordinate) output_u_coordinate = JOSE::JWA::X25519.coerce_coordinate_fe!(output_u_coordinate) assert_equal output_u_coordinate, JOSE::JWA::X25519.curve25519(input_scalar, input_u_coordinate) if JOSE::JWA::Curve25519_RbNaCl.__supported__? assert_equal output_u_coordinate.to_bytes(256), JOSE::JWA::X25519_RbNaCl.curve25519(input_scalar, input_u_coordinate) end end end def test_curve25519_rfc7748_x25519 vectors = [ [ hexstr2bin("77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a"), # Alice's private key, f hexstr2bin("8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a"), # Alice's public key, X25519(f, 9) hexstr2bin("5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb"), # Bob's private key, g hexstr2bin("de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f"), # Bob's public key, X25519(g, 9) hexstr2bin("4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742") # Their shared secret, K ] ] vectors.each do |(alice_sk, alice_pk, bob_sk, bob_pk, k)| assert_equal k, JOSE::JWA::X25519.shared_secret(alice_pk, bob_sk) assert_equal k, JOSE::JWA::X25519.shared_secret(bob_pk, alice_sk) if JOSE::JWA::Curve25519_RbNaCl.__supported__? assert_equal k, JOSE::JWA::X25519_RbNaCl.shared_secret(alice_pk, bob_sk) assert_equal k, JOSE::JWA::X25519_RbNaCl.shared_secret(bob_pk, alice_sk) end end end def test_curve448_eddsa_ed448 vectors = [ [ # Blank hexstr2bin( "6c82a562cb808d10d632be89c8513ebf"\ "6c929f34ddfa8c9f63c9960ef6e348a3"\ "528c8a3fcc2f044e39a3fc5b94492f8f"\ "032e7549a20098f95b"), # SECRET KEY hexstr2bin( "5fd7449b59b461fd2ce787ec616ad46a"\ "1da1342485a70e1f8a0ea75d80e96778"\ "edf124769b46c7061bd6783df1e50f6c"\ "d1fa1abeafe8256180"), # PUBLIC KEY "", # MESSAGE hexstr2bin( "533a37f6bbe457251f023c0d88f976ae"\ "2dfb504a843e34d2074fd823d41a591f"\ "2b233f034f628281f2fd7a22ddd47d78"\ "28c59bd0a21bfd3980ff0d2028d4b18a"\ "9df63e006c5d1c2d345b925d8dc00b41"\ "04852db99ac5c7cdda8530a113a0f4db"\ "b61149f05a7363268c71d95808ff2e65"\ "2600") # SIGNATURE ], [ # 1 octet hexstr2bin( "c4eab05d357007c632f3dbb48489924d"\ "552b08fe0c353a0d4a1f00acda2c463a"\ "fbea67c5e8d2877c5e3bc397a659949e"\ "f8021e954e0a12274e"), # SECRET KEY hexstr2bin( "43ba28f430cdff456ae531545f7ecd0a"\ "c834a55d9358c0372bfa0c6c6798c086"\ "6aea01eb00742802b8438ea4cb82169c"\ "235160627b4c3a9480"), # PUBLIC KEY hexstr2bin("03"), # MESSAGE hexstr2bin( "26b8f91727bd62897af15e41eb43c377"\ "efb9c610d48f2335cb0bd0087810f435"\ "2541b143c4b981b7e18f62de8ccdf633"\ "fc1bf037ab7cd779805e0dbcc0aae1cb"\ "cee1afb2e027df36bc04dcecbf154336"\ "c19f0af7e0a6472905e799f1953d2a0f"\ "f3348ab21aa4adafd1d234441cf807c0"\ "3a00") # SIGNATURE ], [ # 1 octet (with context) hexstr2bin( "c4eab05d357007c632f3dbb48489924d"\ "552b08fe0c353a0d4a1f00acda2c463a"\ "fbea67c5e8d2877c5e3bc397a659949e"\ "f8021e954e0a12274e"), # SECRET KEY hexstr2bin( "43ba28f430cdff456ae531545f7ecd0a"\ "c834a55d9358c0372bfa0c6c6798c086"\ "6aea01eb00742802b8438ea4cb82169c"\ "235160627b4c3a9480"), # PUBLIC KEY hexstr2bin("03"), # MESSAGE hexstr2bin("666f6f"), # CONTEXT hexstr2bin( "d4f8f6131770dd46f40867d6fd5d5055"\ "de43541f8c5e35abbcd001b32a89f7d2"\ "151f7647f11d8ca2ae279fb842d60721"\ "7fce6e042f6815ea000c85741de5c8da"\ "1144a6a1aba7f96de42505d7a7298524"\ "fda538fccbbb754f578c1cad10d54d0d"\ "5428407e85dcbc98a49155c13764e66c"\ "3c00") # SIGNATURE ], [ # 11 octets hexstr2bin( "cd23d24f714274e744343237b93290f5"\ "11f6425f98e64459ff203e8985083ffd"\ "f60500553abc0e05cd02184bdb89c4cc"\ "d67e187951267eb328"), # SECRET KEY hexstr2bin( "dcea9e78f35a1bf3499a831b10b86c90"\ "aac01cd84b67a0109b55a36e9328b1e3"\ "65fce161d71ce7131a543ea4cb5f7e9f"\ "1d8b00696447001400"), # PUBLIC KEY hexstr2bin("0c3e544074ec63b0265e0c"), # MESSAGE hexstr2bin( "1f0a8888ce25e8d458a21130879b840a"\ "9089d999aaba039eaf3e3afa090a09d3"\ "89dba82c4ff2ae8ac5cdfb7c55e94d5d"\ "961a29fe0109941e00b8dbdeea6d3b05"\ "1068df7254c0cdc129cbe62db2dc957d"\ "bb47b51fd3f213fb8698f064774250a5"\ "028961c9bf8ffd973fe5d5c206492b14"\ "0e00") # SIGNATURE ], [ # 12 octets hexstr2bin( "258cdd4ada32ed9c9ff54e63756ae582"\ "fb8fab2ac721f2c8e676a72768513d93"\ "9f63dddb55609133f29adf86ec9929dc"\ "cb52c1c5fd2ff7e21b"), # SECRET KEY hexstr2bin( "3ba16da0c6f2cc1f30187740756f5e79"\ "8d6bc5fc015d7c63cc9510ee3fd44adc"\ "24d8e968b6e46e6f94d19b945361726b"\ "d75e149ef09817f580"), # PUBLIC KEY hexstr2bin("64a65f3cdedcdd66811e2915"), # MESSAGE hexstr2bin( "7eeeab7c4e50fb799b418ee5e3197ff6"\ "bf15d43a14c34389b59dd1a7b1b85b4a"\ "e90438aca634bea45e3a2695f1270f07"\ "fdcdf7c62b8efeaf00b45c2c96ba457e"\ "b1a8bf075a3db28e5c24f6b923ed4ad7"\ "47c3c9e03c7079efb87cb110d3a99861"\ "e72003cbae6d6b8b827e4e6c143064ff"\ "3c00") # SIGNATURE ], [ # 13 octets hexstr2bin( "7ef4e84544236752fbb56b8f31a23a10"\ "e42814f5f55ca037cdcc11c64c9a3b29"\ "49c1bb60700314611732a6c2fea98eeb"\ "c0266a11a93970100e"), # SECRET KEY hexstr2bin( "b3da079b0aa493a5772029f0467baebe"\ "e5a8112d9d3a22532361da294f7bb381"\ "5c5dc59e176b4d9f381ca0938e13c6c0"\ "7b174be65dfa578e80"), # PUBLIC KEY hexstr2bin("64a65f3cdedcdd66811e2915e7"), # MESSAGE hexstr2bin( "6a12066f55331b6c22acd5d5bfc5d712"\ "28fbda80ae8dec26bdd306743c5027cb"\ "4890810c162c027468675ecf645a8317"\ "6c0d7323a2ccde2d80efe5a1268e8aca"\ "1d6fbc194d3f77c44986eb4ab4177919"\ "ad8bec33eb47bbb5fc6e28196fd1caf5"\ "6b4e7e0ba5519234d047155ac727a105"\ "3100") # SIGNATURE ], [ # 64 octets hexstr2bin( "d65df341ad13e008567688baedda8e9d"\ "cdc17dc024974ea5b4227b6530e339bf"\ "f21f99e68ca6968f3cca6dfe0fb9f4fa"\ "b4fa135d5542ea3f01"), # SECRET KEY hexstr2bin( "df9705f58edbab802c7f8363cfe5560a"\ "b1c6132c20a9f1dd163483a26f8ac53a"\ "39d6808bf4a1dfbd261b099bb03b3fb5"\ "0906cb28bd8a081f00"), # PUBLIC KEY hexstr2bin( "bd0f6a3747cd561bdddf4640a332461a"\ "4a30a12a434cd0bf40d766d9c6d458e5"\ "512204a30c17d1f50b5079631f64eb31"\ "12182da3005835461113718d1a5ef944"), # MESSAGE hexstr2bin( "554bc2480860b49eab8532d2a533b7d5"\ "78ef473eeb58c98bb2d0e1ce488a98b1"\ "8dfde9b9b90775e67f47d4a1c3482058"\ "efc9f40d2ca033a0801b63d45b3b722e"\ "f552bad3b4ccb667da350192b61c508c"\ "f7b6b5adadc2c8d9a446ef003fb05cba"\ "5f30e88e36ec2703b349ca229c267083"\ "3900") # SIGNATURE ], [ # 64 octets hexstr2bin( "d65df341ad13e008567688baedda8e9d"\ "cdc17dc024974ea5b4227b6530e339bf"\ "f21f99e68ca6968f3cca6dfe0fb9f4fa"\ "b4fa135d5542ea3f01"), # SECRET KEY hexstr2bin( "df9705f58edbab802c7f8363cfe5560a"\ "b1c6132c20a9f1dd163483a26f8ac53a"\ "39d6808bf4a1dfbd261b099bb03b3fb5"\ "0906cb28bd8a081f00"), # PUBLIC KEY hexstr2bin( "bd0f6a3747cd561bdddf4640a332461a"\ "4a30a12a434cd0bf40d766d9c6d458e5"\ "512204a30c17d1f50b5079631f64eb31"\ "12182da3005835461113718d1a5ef944"), # MESSAGE hexstr2bin( "554bc2480860b49eab8532d2a533b7d5"\ "78ef473eeb58c98bb2d0e1ce488a98b1"\ "8dfde9b9b90775e67f47d4a1c3482058"\ "efc9f40d2ca033a0801b63d45b3b722e"\ "f552bad3b4ccb667da350192b61c508c"\ "f7b6b5adadc2c8d9a446ef003fb05cba"\ "5f30e88e36ec2703b349ca229c267083"\ "3900") # SIGNATURE ], [ # 256 octets hexstr2bin( "2ec5fe3c17045abdb136a5e6a913e32a"\ "b75ae68b53d2fc149b77e504132d3756"\ "9b7e766ba74a19bd6162343a21c8590a"\ "a9cebca9014c636df5"), # SECRET KEY hexstr2bin( "79756f014dcfe2079f5dd9e718be4171"\ "e2ef2486a08f25186f6bff43a9936b9b"\ "fe12402b08ae65798a3d81e22e9ec80e"\ "7690862ef3d4ed3a00"), # PUBLIC KEY hexstr2bin( "15777532b0bdd0d1389f636c5f6b9ba7"\ "34c90af572877e2d272dd078aa1e567c"\ "fa80e12928bb542330e8409f31745041"\ "07ecd5efac61ae7504dabe2a602ede89"\ "e5cca6257a7c77e27a702b3ae39fc769"\ "fc54f2395ae6a1178cab4738e543072f"\ "c1c177fe71e92e25bf03e4ecb72f47b6"\ "4d0465aaea4c7fad372536c8ba516a60"\ "39c3c2a39f0e4d832be432dfa9a706a6"\ "e5c7e19f397964ca4258002f7c0541b5"\ "90316dbc5622b6b2a6fe7a4abffd9610"\ "5eca76ea7b98816af0748c10df048ce0"\ "12d901015a51f189f3888145c03650aa"\ "23ce894c3bd889e030d565071c59f409"\ "a9981b51878fd6fc110624dcbcde0bf7"\ "a69ccce38fabdf86f3bef6044819de11"), # MESSAGE hexstr2bin( "c650ddbb0601c19ca11439e1640dd931"\ "f43c518ea5bea70d3dcde5f4191fe53f"\ "00cf966546b72bcc7d58be2b9badef28"\ "743954e3a44a23f880e8d4f1cfce2d7a"\ "61452d26da05896f0a50da66a239a8a1"\ "88b6d825b3305ad77b73fbac0836ecc6"\ "0987fd08527c1a8e80d5823e65cafe2a"\ "3d00") # SIGNATURE ], [ # 1023 octets hexstr2bin( "872d093780f5d3730df7c212664b37b8"\ "a0f24f56810daa8382cd4fa3f77634ec"\ "44dc54f1c2ed9bea86fafb7632d8be19"\ "9ea165f5ad55dd9ce8"), # SECRET KEY hexstr2bin( "a81b2e8a70a5ac94ffdbcc9badfc3feb"\ "0801f258578bb114ad44ece1ec0e799d"\ "a08effb81c5d685c0c56f64eecaef8cd"\ "f11cc38737838cf400"), # PUBLIC KEY hexstr2bin( "6ddf802e1aae4986935f7f981ba3f035"\ "1d6273c0a0c22c9c0e8339168e675412"\ "a3debfaf435ed651558007db4384b650"\ "fcc07e3b586a27a4f7a00ac8a6fec2cd"\ "86ae4bf1570c41e6a40c931db27b2faa"\ "15a8cedd52cff7362c4e6e23daec0fbc"\ "3a79b6806e316efcc7b68119bf46bc76"\ "a26067a53f296dafdbdc11c77f7777e9"\ "72660cf4b6a9b369a6665f02e0cc9b6e"\ "dfad136b4fabe723d2813db3136cfde9"\ "b6d044322fee2947952e031b73ab5c60"\ "3349b307bdc27bc6cb8b8bbd7bd32321"\ "9b8033a581b59eadebb09b3c4f3d2277"\ "d4f0343624acc817804728b25ab79717"\ "2b4c5c21a22f9c7839d64300232eb66e"\ "53f31c723fa37fe387c7d3e50bdf9813"\ "a30e5bb12cf4cd930c40cfb4e1fc6225"\ "92a49588794494d56d24ea4b40c89fc0"\ "596cc9ebb961c8cb10adde976a5d602b"\ "1c3f85b9b9a001ed3c6a4d3b1437f520"\ "96cd1956d042a597d561a596ecd3d173"\ "5a8d570ea0ec27225a2c4aaff26306d1"\ "526c1af3ca6d9cf5a2c98f47e1c46db9"\ "a33234cfd4d81f2c98538a09ebe76998"\ "d0d8fd25997c7d255c6d66ece6fa56f1"\ "1144950f027795e653008f4bd7ca2dee"\ "85d8e90f3dc315130ce2a00375a318c7"\ "c3d97be2c8ce5b6db41a6254ff264fa6"\ "155baee3b0773c0f497c573f19bb4f42"\ "40281f0b1f4f7be857a4e59d416c06b4"\ "c50fa09e1810ddc6b1467baeac5a3668"\ "d11b6ecaa901440016f389f80acc4db9"\ "77025e7f5924388c7e340a732e554440"\ "e76570f8dd71b7d640b3450d1fd5f041"\ "0a18f9a3494f707c717b79b4bf75c984"\ "00b096b21653b5d217cf3565c9597456"\ "f70703497a078763829bc01bb1cbc8fa"\ "04eadc9a6e3f6699587a9e75c94e5bab"\ "0036e0b2e711392cff0047d0d6b05bd2"\ "a588bc109718954259f1d86678a579a3"\ "120f19cfb2963f177aeb70f2d4844826"\ "262e51b80271272068ef5b3856fa8535"\ "aa2a88b2d41f2a0e2fda7624c2850272"\ "ac4a2f561f8f2f7a318bfd5caf969614"\ "9e4ac824ad3460538fdc25421beec2cc"\ "6818162d06bbed0c40a387192349db67"\ "a118bada6cd5ab0140ee273204f628aa"\ "d1c135f770279a651e24d8c14d75a605"\ "9d76b96a6fd857def5e0b354b27ab937"\ "a5815d16b5fae407ff18222c6d1ed263"\ "be68c95f32d908bd895cd76207ae7264"\ "87567f9a67dad79abec316f683b17f2d"\ "02bf07e0ac8b5bc6162cf94697b3c27c"\ "d1fea49b27f23ba2901871962506520c"\ "392da8b6ad0d99f7013fbc06c2c17a56"\ "9500c8a7696481c1cd33e9b14e40b82e"\ "79a5f5db82571ba97bae3ad3e0479515"\ "bb0e2b0f3bfcd1fd33034efc6245eddd"\ "7ee2086ddae2600d8ca73e214e8c2b0b"\ "db2b047c6a464a562ed77b73d2d841c4"\ "b34973551257713b753632efba348169"\ "abc90a68f42611a40126d7cb21b58695"\ "568186f7e569d2ff0f9e745d0487dd2e"\ "b997cafc5abf9dd102e62ff66cba87"), # MESSAGE hexstr2bin( "e301345a41a39a4d72fff8df69c98075"\ "a0cc082b802fc9b2b6bc503f926b65bd"\ "df7f4c8f1cb49f6396afc8a70abe6d8a"\ "ef0db478d4c6b2970076c6a0484fe76d"\ "76b3a97625d79f1ce240e7c576750d29"\ "5528286f719b413de9ada3e8eb78ed57"\ "3603ce30d8bb761785dc30dbc320869e"\ "1a00") # SIGNATURE ] ] vectors.each do |vector| secret, pk, m, ctx, sig = vector if sig.nil? sig = ctx ctx = nil end _pk, sk = JOSE::JWA::Ed448.keypair(secret) assert_equal pk, _pk _sig = JOSE::JWA::Ed448.sign(m, sk, ctx) assert_equal sig, _sig assert JOSE::JWA::Ed448.verify(sig, m, pk, ctx) end end def test_curve448_eddsa_ed448ph vectors = [ [ # TEST abc hexstr2bin( "833fe62409237b9d62ec77587520911e"\ "9a759cec1d19755b7da901b96dca3d42"\ "ef7822e0d5104127dc05d6dbefde69e3"\ "ab2cec7c867c6e2c49"), # SECRET KEY hexstr2bin( "259b71c19f83ef77a7abd26524cbdb31"\ "61b590a48f7d17de3ee0ba9c52beb743"\ "c09428a131d6b1b57303d90d8132c276"\ "d5ed3d5d01c0f53880"), # PUBLIC KEY hexstr2bin("616263"), # MESSAGE hexstr2bin( "963cf799d20fdf51c460310c1cf65d0e"\ "83c4ef5aa73332ba5b4c1e7635ff9e9b"\ "6a12b16436fa3681b92575e7eba40ee2"\ "79c487ad724b6d1080e1860e63dbdd58"\ "9f5125505b4de024264625e61b097956"\ "8703f9d9e2bbf5523a1886ee6da1ecb2"\ "0552bb506eb35a042658ec534bfc1c2c"\ "1a00") # SIGNATURE ], [ # TEST abc (with context) hexstr2bin( "833fe62409237b9d62ec77587520911e"\ "9a759cec1d19755b7da901b96dca3d42"\ "ef7822e0d5104127dc05d6dbefde69e3"\ "ab2cec7c867c6e2c49"), # SECRET KEY hexstr2bin( "259b71c19f83ef77a7abd26524cbdb31"\ "61b590a48f7d17de3ee0ba9c52beb743"\ "c09428a131d6b1b57303d90d8132c276"\ "d5ed3d5d01c0f53880"), # PUBLIC KEY hexstr2bin("616263"), # MESSAGE hexstr2bin("666f6f"), # CONTEXT hexstr2bin( "86a6bf52f9e8f84f451b2f392a8d1c3a"\ "414425fac0068f74aeead53b0e6b53d4"\ "555cea1726da4a65202880d407267087"\ "9e8e6fa4d9694c060054f2065dc206a6"\ "e615d0d8c99b95209b696c8125c5fbb9"\ "bc82a0f7ed3d99c4c11c47798ef0f7eb"\ "97b3b72ab4ac86eaf8b43449e8ac30ff"\ "3f00") # SIGNATURE ] ] vectors.each do |vector| secret, pk, m, ctx, sig = vector if sig.nil? sig = ctx ctx = nil end _pk, sk = JOSE::JWA::Ed448.keypair(secret) assert_equal pk, _pk _sig = JOSE::JWA::Ed448.sign_ph(m, sk, ctx) assert_equal sig, _sig assert JOSE::JWA::Ed448.verify_ph(sig, m, pk, ctx) end end def test_curve448_rfc7748_curve448 vectors = [ [ 599189175373896402783756016145213256157230856085026129926891459468622403380588640249457727683869421921443004045221642549886377526240828, # Input scalar 382239910814107330116229961234899377031416365240571325148346555922438025162094455820962429142971339584360034337310079791515452463053830, # Input u-coordinate hexstr2lint("ce3e4ff95a60dc6697da1db1d85e6afbdf79b50a2412d7546d5f239fe14fbaadeb445fc66a01b0779d98223961111e21766282f73dd96b6f") # Output u-coordinate ], [ 633254335906970592779259481534862372382525155252028961056404001332122152890562527156973881968934311400345568203929409663925541994577184, # Input scalar 622761797758325444462922068431234180649590390024811299761625153767228042600197997696167956134770744996690267634159427999832340166786063, # Input u-coordinate hexstr2lint("884a02576239ff7a2f2f63b2db6a9ff37047ac13568e1e30fe63c4a7ad1b3ee3a5700df34321d62077e63633c575c1c954514e99da7c179d") # Output u-coordinate ] ] vectors.each do |(input_scalar, input_u_coordinate, output_u_coordinate)| input_scalar = JOSE::JWA::X448.coerce_scalar_fe!(input_scalar) input_u_coordinate = JOSE::JWA::X448.coerce_coordinate_fe!(input_u_coordinate) output_u_coordinate = JOSE::JWA::X448.coerce_coordinate_fe!(output_u_coordinate) assert_equal output_u_coordinate, JOSE::JWA::X448.curve448(input_scalar, input_u_coordinate) end end def test_curve448_rfc7748_x448 vectors = [ [ hexstr2bin("9a8f4925d1519f5775cf46b04b5800d4ee9ee8bae8bc5565d498c28dd9c9baf574a9419744897391006382a6f127ab1d9ac2d8c0a598726b"), # Alice's private key, f hexstr2bin("9b08f7cc31b7e3e67d22d5aea121074a273bd2b83de09c63faa73d2c22c5d9bbc836647241d953d40c5b12da88120d53177f80e532c41fa0"), # Alice's public key, X448(f, 9) hexstr2bin("1c306a7ac2a0e2e0990b294470cba339e6453772b075811d8fad0d1d6927c120bb5ee8972b0d3e21374c9c921b09d1b0366f10b65173992d"), # Bob's private key, g hexstr2bin("3eb7a829b0cd20f5bcfc0b599b6feccf6da4627107bdb0d4f345b43027d8b972fc3e34fb4232a13ca706dcb57aec3dae07bdc1c67bf33609"), # Bob's public key, X448(g, 9) hexstr2bin("07fff4181ac6cc95ec1c16a94a0f74d12da232ce40a77552281d282bb60c0b56fd2464c335543936521c24403085d59a449a5037514a879d") # Their shared secret, K ] ] vectors.each do |(alice_sk, alice_pk, bob_sk, bob_pk, k)| assert_equal k, JOSE::JWA::X448.shared_secret(alice_pk, bob_sk) assert_equal k, JOSE::JWA::X448.shared_secret(bob_pk, alice_sk) end end private def hexstr2bin(hexstr) return [hexstr].pack('H*') end def hexstr2lint(hexstr) return OpenSSL::BN.new(hexstr2bin(hexstr).reverse, 2).to_i end end
Java
"use strict"; add_task(setupPrefsAndRecentWindowBehavior); let testcases = [ /** * A portal is detected when there's no browser window, * then a browser window is opened, and the portal is logged into * and redirects to a different page. The portal tab should be added * and focused when the window is opened, and left open after login * since it redirected. */ function* test_detectedWithNoBrowserWindow_Redirect() { yield portalDetected(); let win = yield focusWindowAndWaitForPortalUI(); let browser = win.gBrowser.selectedTab.linkedBrowser; let loadPromise = BrowserTestUtils.browserLoaded(browser, false, CANONICAL_URL_REDIRECTED); BrowserTestUtils.loadURI(browser, CANONICAL_URL_REDIRECTED); yield loadPromise; yield freePortal(true); ensurePortalTab(win); ensureNoPortalNotification(win); yield closeWindowAndWaitForXulWindowVisible(win); }, /** * Test the various expected behaviors of the "Show Login Page" button * in the captive portal notification. The button should be visible for * all tabs except the captive portal tab, and when clicked, should * ensure a captive portal tab is open and select it. */ function* test_showLoginPageButton() { let win = yield openWindowAndWaitForFocus(); yield portalDetected(); let notification = ensurePortalNotification(win); testShowLoginPageButtonVisibility(notification, "visible"); function testPortalTabSelectedAndButtonNotVisible() { is(win.gBrowser.selectedTab, tab, "The captive portal tab should be selected."); testShowLoginPageButtonVisibility(notification, "hidden"); } let button = notification.querySelector("button.notification-button"); function* clickButtonAndExpectNewPortalTab() { let p = BrowserTestUtils.waitForNewTab(win.gBrowser, CANONICAL_URL); button.click(); let tab = yield p; is(win.gBrowser.selectedTab, tab, "The captive portal tab should be selected."); return tab; } // Simulate clicking the button. The portal tab should be opened and // selected and the button should hide. let tab = yield clickButtonAndExpectNewPortalTab(); testPortalTabSelectedAndButtonNotVisible(); // Close the tab. The button should become visible. yield BrowserTestUtils.removeTab(tab); ensureNoPortalTab(win); testShowLoginPageButtonVisibility(notification, "visible"); // When the button is clicked, a new portal tab should be opened and // selected. tab = yield clickButtonAndExpectNewPortalTab(); // Open another arbitrary tab. The button should become visible. When it's clicked, // the portal tab should be selected. let anotherTab = yield BrowserTestUtils.openNewForegroundTab(win.gBrowser); testShowLoginPageButtonVisibility(notification, "visible"); button.click(); is(win.gBrowser.selectedTab, tab, "The captive portal tab should be selected."); // Close the portal tab and select the arbitrary tab. The button should become // visible and when it's clicked, a new portal tab should be opened. yield BrowserTestUtils.removeTab(tab); win.gBrowser.selectedTab = anotherTab; testShowLoginPageButtonVisibility(notification, "visible"); tab = yield clickButtonAndExpectNewPortalTab(); yield BrowserTestUtils.removeTab(anotherTab); yield freePortal(true); ensureNoPortalTab(win); ensureNoPortalNotification(win); yield closeWindowAndWaitForXulWindowVisible(win); }, ]; for (let testcase of testcases) { add_task(testcase); }
Java
/** * m59peacemaker's memoize * * See https://github.com/m59peacemaker/angular-pmkr-components/tree/master/src/memoize * Released under the MIT license */ angular.module('syncthing.core') .factory('pmkr.memoize', [ function() { function service() { return memoizeFactory.apply(this, arguments); } function memoizeFactory(fn) { var cache = {}; function memoized() { var args = [].slice.call(arguments); var key = JSON.stringify(args); if (cache.hasOwnProperty(key)) { return cache[key]; } cache[key] = fn.apply(this, arguments); return cache[key]; } return memoized; } return service; } ]);
Java
# # This is the configuration file for the RPi environd # ### Presentation - General # All datetime stamps use typical strftime codes: https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior # The date/time stamp of the last (most current) reading. present_lastread_stamp = "%I:%M %p on %A, %b %d" # How many decimal places to round to when displaying temperatures. For # presentation only - does not impact reading precision in the database. present_temp_precision = 1 ### Presentation - Recent Graph # The date/time stamp on the x-axis present_graph_recent_x = "%I:%M %p" # How many data points to use. # This does _not_ reflect how many points will be drawn. Also consider how # often the readings are made - e.g., if a value is recorded every 15 minutes, # then a full day's worth of data requires 24x(60/15) = 96 points. present_recent_point_count = 720 # How much to reduce the specified number of data points. # This is how many points will be drawn. The value of # present_recent_point_count is divided in to this many chunks, and then time # stamp and value of each chunk is averaged. present_recent_reduce_to = 16 ### Presentation - All Time Graph # < tbd... not implemented yet > ### Files # The static html file that is output. Must be writable by the user running # environd. Presumably this is in the www directory of a web server. www_out = "/var/www/environd.html" # The template to use for generating static html. # Must be readable by the user running environd. html_template = "/opt/environd/template/environd.tpl" # The (flat text) database file. # Must be writable by the user running environd, and must exist, even if empty. database = "/opt/environd/database/temperature_readings.json" # The log file. Must be writable by the user running environd. log_file = "/var/log/environd.log" # Format of the timestamping used internally. # Does not impact presentation unless presented values are omitted. datetime_func_format = "%Y%m%dT%H%M%S" ### Tinker/Debug # Set to True to print all log messages to the terminal, or False to suppress # most output. terminal_verbosity = True # The size in mb after which the db file is rotated. # The entire db is loaded in to memory, but each reading is a mere 60-80 # bytes, so 100 megs is about 10 years of recording every 15 minutes. max_db_file_size = 100 # mb
Java
/* Copyright (c) 2013-2015 Jeffrey Pfau * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef GBA_VIDEO_H #define GBA_VIDEO_H #include <mgba-util/common.h> CXX_GUARD_START #include <mgba/core/log.h> #include <mgba/core/timing.h> #include <mgba/gba/interface.h> mLOG_DECLARE_CATEGORY(GBA_VIDEO); enum { VIDEO_HBLANK_PIXELS = 68, VIDEO_HDRAW_LENGTH = 960, VIDEO_HBLANK_LENGTH = 272, VIDEO_HBLANK_FLIP = 46, VIDEO_HORIZONTAL_LENGTH = 1232, VIDEO_VBLANK_PIXELS = 68, VIDEO_VERTICAL_TOTAL_PIXELS = 228, VIDEO_TOTAL_LENGTH = 280896, OBJ_HBLANK_FREE_LENGTH = 954, OBJ_LENGTH = 1210, BASE_TILE = 0x00010000 }; enum GBAVideoObjMode { OBJ_MODE_NORMAL = 0, OBJ_MODE_SEMITRANSPARENT = 1, OBJ_MODE_OBJWIN = 2 }; enum GBAVideoObjShape { OBJ_SHAPE_SQUARE = 0, OBJ_SHAPE_HORIZONTAL = 1, OBJ_SHAPE_VERTICAL = 2 }; enum GBAVideoBlendEffect { BLEND_NONE = 0, BLEND_ALPHA = 1, BLEND_BRIGHTEN = 2, BLEND_DARKEN = 3 }; DECL_BITFIELD(GBAObjAttributesA, uint16_t); DECL_BITS(GBAObjAttributesA, Y, 0, 8); DECL_BIT(GBAObjAttributesA, Transformed, 8); DECL_BIT(GBAObjAttributesA, Disable, 9); DECL_BIT(GBAObjAttributesA, DoubleSize, 9); DECL_BITS(GBAObjAttributesA, Mode, 10, 2); DECL_BIT(GBAObjAttributesA, Mosaic, 12); DECL_BIT(GBAObjAttributesA, 256Color, 13); DECL_BITS(GBAObjAttributesA, Shape, 14, 2); DECL_BITFIELD(GBAObjAttributesB, uint16_t); DECL_BITS(GBAObjAttributesB, X, 0, 9); DECL_BITS(GBAObjAttributesB, MatIndex, 9, 5); DECL_BIT(GBAObjAttributesB, HFlip, 12); DECL_BIT(GBAObjAttributesB, VFlip, 13); DECL_BITS(GBAObjAttributesB, Size, 14, 2); DECL_BITFIELD(GBAObjAttributesC, uint16_t); DECL_BITS(GBAObjAttributesC, Tile, 0, 10); DECL_BITS(GBAObjAttributesC, Priority, 10, 2); DECL_BITS(GBAObjAttributesC, Palette, 12, 4); struct GBAObj { GBAObjAttributesA a; GBAObjAttributesB b; GBAObjAttributesC c; uint16_t d; }; struct GBAOAMMatrix { int16_t padding0[3]; int16_t a; int16_t padding1[3]; int16_t b; int16_t padding2[3]; int16_t c; int16_t padding3[3]; int16_t d; }; union GBAOAM { struct GBAObj obj[128]; struct GBAOAMMatrix mat[32]; uint16_t raw[512]; }; struct GBAVideoWindowRegion { uint8_t end; uint8_t start; }; #define GBA_TEXT_MAP_TILE(MAP) ((MAP) & 0x03FF) #define GBA_TEXT_MAP_HFLIP(MAP) ((MAP) & 0x0400) #define GBA_TEXT_MAP_VFLIP(MAP) ((MAP) & 0x0800) #define GBA_TEXT_MAP_PALETTE(MAP) (((MAP) & 0xF000) >> 12) DECL_BITFIELD(GBARegisterDISPCNT, uint16_t); DECL_BITS(GBARegisterDISPCNT, Mode, 0, 3); DECL_BIT(GBARegisterDISPCNT, Cgb, 3); DECL_BIT(GBARegisterDISPCNT, FrameSelect, 4); DECL_BIT(GBARegisterDISPCNT, HblankIntervalFree, 5); DECL_BIT(GBARegisterDISPCNT, ObjCharacterMapping, 6); DECL_BIT(GBARegisterDISPCNT, ForcedBlank, 7); DECL_BIT(GBARegisterDISPCNT, Bg0Enable, 8); DECL_BIT(GBARegisterDISPCNT, Bg1Enable, 9); DECL_BIT(GBARegisterDISPCNT, Bg2Enable, 10); DECL_BIT(GBARegisterDISPCNT, Bg3Enable, 11); DECL_BIT(GBARegisterDISPCNT, ObjEnable, 12); DECL_BIT(GBARegisterDISPCNT, Win0Enable, 13); DECL_BIT(GBARegisterDISPCNT, Win1Enable, 14); DECL_BIT(GBARegisterDISPCNT, ObjwinEnable, 15); DECL_BITFIELD(GBARegisterDISPSTAT, uint16_t); DECL_BIT(GBARegisterDISPSTAT, InVblank, 0); DECL_BIT(GBARegisterDISPSTAT, InHblank, 1); DECL_BIT(GBARegisterDISPSTAT, Vcounter, 2); DECL_BIT(GBARegisterDISPSTAT, VblankIRQ, 3); DECL_BIT(GBARegisterDISPSTAT, HblankIRQ, 4); DECL_BIT(GBARegisterDISPSTAT, VcounterIRQ, 5); DECL_BITS(GBARegisterDISPSTAT, VcountSetting, 8, 8); DECL_BITFIELD(GBARegisterBGCNT, uint16_t); DECL_BITS(GBARegisterBGCNT, Priority, 0, 2); DECL_BITS(GBARegisterBGCNT, CharBase, 2, 2); DECL_BIT(GBARegisterBGCNT, Mosaic, 6); DECL_BIT(GBARegisterBGCNT, 256Color, 7); DECL_BITS(GBARegisterBGCNT, ScreenBase, 8, 5); DECL_BIT(GBARegisterBGCNT, Overflow, 13); DECL_BITS(GBARegisterBGCNT, Size, 14, 2); DECL_BITFIELD(GBARegisterBLDCNT, uint16_t); DECL_BIT(GBARegisterBLDCNT, Target1Bg0, 0); DECL_BIT(GBARegisterBLDCNT, Target1Bg1, 1); DECL_BIT(GBARegisterBLDCNT, Target1Bg2, 2); DECL_BIT(GBARegisterBLDCNT, Target1Bg3, 3); DECL_BIT(GBARegisterBLDCNT, Target1Obj, 4); DECL_BIT(GBARegisterBLDCNT, Target1Bd, 5); DECL_BITS(GBARegisterBLDCNT, Effect, 6, 2); DECL_BIT(GBARegisterBLDCNT, Target2Bg0, 8); DECL_BIT(GBARegisterBLDCNT, Target2Bg1, 9); DECL_BIT(GBARegisterBLDCNT, Target2Bg2, 10); DECL_BIT(GBARegisterBLDCNT, Target2Bg3, 11); DECL_BIT(GBARegisterBLDCNT, Target2Obj, 12); DECL_BIT(GBARegisterBLDCNT, Target2Bd, 13); DECL_BITFIELD(GBAWindowControl, uint8_t); DECL_BIT(GBAWindowControl, Bg0Enable, 0); DECL_BIT(GBAWindowControl, Bg1Enable, 1); DECL_BIT(GBAWindowControl, Bg2Enable, 2); DECL_BIT(GBAWindowControl, Bg3Enable, 3); DECL_BIT(GBAWindowControl, ObjEnable, 4); DECL_BIT(GBAWindowControl, BlendEnable, 5); DECL_BITFIELD(GBAMosaicControl, uint16_t); DECL_BITS(GBAMosaicControl, BgH, 0, 4); DECL_BITS(GBAMosaicControl, BgV, 4, 4); DECL_BITS(GBAMosaicControl, ObjH, 8, 4); DECL_BITS(GBAMosaicControl, ObjV, 12, 4); struct GBAVideoRenderer { void (*init)(struct GBAVideoRenderer* renderer); void (*reset)(struct GBAVideoRenderer* renderer); void (*deinit)(struct GBAVideoRenderer* renderer); uint16_t (*writeVideoRegister)(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value); void (*writeVRAM)(struct GBAVideoRenderer* renderer, uint32_t address); void (*writePalette)(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value); void (*writeOAM)(struct GBAVideoRenderer* renderer, uint32_t oam); void (*drawScanline)(struct GBAVideoRenderer* renderer, int y); void (*finishFrame)(struct GBAVideoRenderer* renderer); void (*getPixels)(struct GBAVideoRenderer* renderer, size_t* stride, const void** pixels); void (*putPixels)(struct GBAVideoRenderer* renderer, size_t stride, const void* pixels); uint16_t* palette; uint16_t* vram; union GBAOAM* oam; struct mCacheSet* cache; bool disableBG[4]; bool disableOBJ; bool disableWIN[2]; bool disableOBJWIN; bool highlightBG[4]; bool highlightOBJ[128]; color_t highlightColor; uint8_t highlightAmount; }; struct GBAVideo { struct GBA* p; struct GBAVideoRenderer* renderer; struct mTimingEvent event; int vcount; int shouldStall; uint16_t palette[512]; uint16_t* vram; union GBAOAM oam; int32_t frameCounter; int frameskip; int frameskipCounter; }; void GBAVideoInit(struct GBAVideo* video); void GBAVideoReset(struct GBAVideo* video); void GBAVideoDeinit(struct GBAVideo* video); void GBAVideoDummyRendererCreate(struct GBAVideoRenderer*); void GBAVideoAssociateRenderer(struct GBAVideo* video, struct GBAVideoRenderer* renderer); void GBAVideoWriteDISPSTAT(struct GBAVideo* video, uint16_t value); struct GBASerializedState; void GBAVideoSerialize(const struct GBAVideo* video, struct GBASerializedState* state); void GBAVideoDeserialize(struct GBAVideo* video, const struct GBASerializedState* state); extern MGBA_EXPORT const int GBAVideoObjSizes[16][2]; CXX_GUARD_END #endif
Java
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2008-2015 MonetDB B.V. */ /* This file provides interfaces to perform certain atomic operations * on variables. Atomic in this sense means that an operation * performed in one thread shows up in another thread either * completely or not at all. * * If the symbol ATOMIC_LOCK is defined, a variable of type MT_Lock * must be declared and initialized. The latter can be done using the * macro ATOMIC_INIT which expands to nothing if ATOMIC_LOCK is not * defined. * * The following operations are defined: * ATOMIC_GET -- return the value of a variable; * ATOMIC_SET -- set the value of a variable; * ATOMIC_ADD -- add a value to a variable, return original value; * ATOMIC_SUB -- subtract a value from a variable, return original value; * ATOMIC_INC -- increment a variable's value, return new value; * ATOMIC_DEC -- decrement a variable's value, return new value; * These interfaces work on variables of type ATOMIC_TYPE * (int or lng depending on architecture). * * In addition, the following operations are defined: * ATOMIC_TAS -- test-and-set: set variable to "true" and return old value * ATOMIC_CLEAR -- set variable to "false" * These two operations are only defined on variables of type * ATOMIC_FLAG, and the only values defined for such a variable are * "false" (zero) and "true" (non-zero). The variable can be statically * initialized using the ATOMIC_FLAG_INIT macro. */ #ifndef _GDK_ATOMIC_H_ #define _GDK_ATOMIC_H_ /* define this if you don't want to use atomic instructions */ /* #define NO_ATOMIC_INSTRUCTIONS */ #if defined(HAVE_LIBATOMIC_OPS) && !defined(NO_ATOMIC_INSTRUCTIONS) #include <atomic_ops.h> #define ATOMIC_TYPE AO_t #define ATOMIC_GET(var, lck) AO_load_full(&var) #define ATOMIC_SET(var, val, lck) AO_store_full(&var, (val)) #define ATOMIC_ADD(var, val, lck) AO_fetch_and_add(&var, (val)) #define ATOMIC_SUB(var, val, lck) AO_fetch_and_add(&var, -(val)) #define ATOMIC_INC(var, lck) (AO_fetch_and_add1(&var) + 1) #define ATOMIC_DEC(var, lck) (AO_fetch_and_sub1(&var) - 1) #define ATOMIC_INIT(lck) ((void) 0) #define ATOMIC_FLAG AO_TS_t #define ATOMIC_FLAG_INIT { AO_TS_INITIALIZER } #define ATOMIC_CLEAR(var, lck) AO_CLEAR(&var) #define ATOMIC_TAS(var, lck) (AO_test_and_set_full(&var) != AO_TS_CLEAR) #else #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(NO_ATOMIC_INSTRUCTIONS) #include <intrin.h> #if SIZEOF_SSIZE_T == SIZEOF_LNG #define ATOMIC_TYPE lng #define ATOMIC_GET(var, lck) var #define ATOMIC_SET(var, val, lck) _InterlockedExchange64(&var, (val)) #define ATOMIC_ADD(var, val, lck) _InterlockedExchangeAdd64(&var, val) #define ATOMIC_SUB(var, val, lck) _InterlockedExchangeAdd64(&var, -(val)) #define ATOMIC_INC(var, lck) _InterlockedIncrement64(&var) #define ATOMIC_DEC(var, lck) _InterlockedDecrement64(&var) #pragma intrinsic(_InterlockedExchange64) #pragma intrinsic(_InterlockedExchangeAdd64) #pragma intrinsic(_InterlockedIncrement64) #pragma intrinsic(_InterlockedDecrement64) #pragma intrinsic(_InterlockedCompareExchange64) #else #define ATOMIC_TYPE int #define ATOMIC_GET(var, lck) var #define ATOMIC_SET(var, val, lck) _InterlockedExchange(&var, (val)) #define ATOMIC_ADD(var, val, lck) _InterlockedExchangeAdd(&var, (val)) #define ATOMIC_SUB(var, val, lck) _InterlockedExchangeAdd(&var, -(val)) #define ATOMIC_INC(var, lck) _InterlockedIncrement(&var) #define ATOMIC_DEC(var, lck) _InterlockedDecrement(&var) #pragma intrinsic(_InterlockedExchange) #pragma intrinsic(_InterlockedExchangeAdd) #pragma intrinsic(_InterlockedIncrement) #pragma intrinsic(_InterlockedDecrement) #endif #define ATOMIC_INIT(lck) ((void) 0) #define ATOMIC_FLAG int #define ATOMIC_FLAG_INIT { 0 } #define ATOMIC_CLEAR(var, lck) _InterlockedExchange(&var, 0) #define ATOMIC_TAS(var, lck) _InterlockedCompareExchange(&var, 1, 0) #pragma intrinsic(_InterlockedCompareExchange) #elif (defined(__GNUC__) || defined(__INTEL_COMPILER)) && !(defined(__sun__) && SIZEOF_SIZE_T == SIZEOF_LNG) && !defined(_MSC_VER) && !defined(NO_ATOMIC_INSTRUCTIONS) #if SIZEOF_SSIZE_T == SIZEOF_LNG #define ATOMIC_TYPE lng #else #define ATOMIC_TYPE int #endif #ifdef __ATOMIC_SEQ_CST /* the new way of doing this according to GCC */ #define ATOMIC_GET(var, lck) __atomic_load_n(&var, __ATOMIC_SEQ_CST) #define ATOMIC_SET(var, val, lck) __atomic_store_n(&var, (val), __ATOMIC_SEQ_CST) #define ATOMIC_ADD(var, val, lck) __atomic_fetch_add(&var, (val), __ATOMIC_SEQ_CST) #define ATOMIC_SUB(var, val, lck) __atomic_fetch_sub(&var, (val), __ATOMIC_SEQ_CST) #define ATOMIC_INC(var, lck) __atomic_add_fetch(&var, 1, __ATOMIC_SEQ_CST) #define ATOMIC_DEC(var, lck) __atomic_sub_fetch(&var, 1, __ATOMIC_SEQ_CST) #define ATOMIC_FLAG char #define ATOMIC_FLAG_INIT { 0 } #define ATOMIC_CLEAR(var, lck) __atomic_clear(&var, __ATOMIC_SEQ_CST) #define ATOMIC_TAS(var, lck) __atomic_test_and_set(&var, __ATOMIC_SEQ_CST) #else /* the old way of doing this, (still?) needed for Intel compiler on Linux */ #define ATOMIC_GET(var, lck) var #define ATOMIC_SET(var, val, lck) (var = (val)) #define ATOMIC_ADD(var, val, lck) __sync_fetch_and_add(&var, (val)) #define ATOMIC_SUB(var, val, lck) __sync_fetch_and_sub(&var, (val)) #define ATOMIC_INC(var, lck) __sync_add_and_fetch(&var, 1) #define ATOMIC_DEC(var, lck) __sync_sub_and_fetch(&var, 1) #define ATOMIC_FLAG int #define ATOMIC_FLAG_INIT { 0 } #define ATOMIC_CLEAR(var, lck) __sync_lock_release(&var) #define ATOMIC_TAS(var, lck) __sync_lock_test_and_set(&var, 1) #endif #define ATOMIC_INIT(lck) ((void) 0) #else #if SIZEOF_SSIZE_T == SIZEOF_LNG #define ATOMIC_TYPE lng #else #define ATOMIC_TYPE int #endif static inline ATOMIC_TYPE __ATOMIC_GET(volatile ATOMIC_TYPE *var, pthread_mutex_t *lck) { ATOMIC_TYPE old; pthread_mutex_lock(lck); old = *var; pthread_mutex_unlock(lck); return old; } #define ATOMIC_GET(var, lck) __ATOMIC_GET(&var, &(lck).lock) static inline ATOMIC_TYPE __ATOMIC_SET(volatile ATOMIC_TYPE *var, ATOMIC_TYPE val, pthread_mutex_t *lck) { ATOMIC_TYPE new; pthread_mutex_lock(lck); *var = val; new = *var; pthread_mutex_unlock(lck); return new; } #define ATOMIC_SET(var, val, lck) __ATOMIC_SET(&var, (val), &(lck).lock) static inline ATOMIC_TYPE __ATOMIC_ADD(volatile ATOMIC_TYPE *var, ATOMIC_TYPE val, pthread_mutex_t *lck) { ATOMIC_TYPE old; pthread_mutex_lock(lck); old = *var; *var += val; pthread_mutex_unlock(lck); return old; } #define ATOMIC_ADD(var, val, lck) __ATOMIC_ADD(&var, (val), &(lck).lock) static inline ATOMIC_TYPE __ATOMIC_SUB(volatile ATOMIC_TYPE *var, ATOMIC_TYPE val, pthread_mutex_t *lck) { ATOMIC_TYPE old; pthread_mutex_lock(lck); old = *var; *var -= val; pthread_mutex_unlock(lck); return old; } #define ATOMIC_SUB(var, val, lck) __ATOMIC_SUB(&var, (val), &(lck).lock) static inline ATOMIC_TYPE __ATOMIC_INC(volatile ATOMIC_TYPE *var, pthread_mutex_t *lck) { ATOMIC_TYPE new; pthread_mutex_lock(lck); new = ++*var; pthread_mutex_unlock(lck); return new; } #define ATOMIC_INC(var, lck) __ATOMIC_INC(&var, &(lck).lock) static inline ATOMIC_TYPE __ATOMIC_DEC(volatile ATOMIC_TYPE *var, pthread_mutex_t *lck) { ATOMIC_TYPE new; pthread_mutex_lock(lck); new = --*var; pthread_mutex_unlock(lck); return new; } #define ATOMIC_DEC(var, lck) __ATOMIC_DEC(&var, &(lck).lock) #define USE_PTHREAD_LOCKS /* must use pthread locks */ #define ATOMIC_LOCK /* must use locks for atomic access */ #define ATOMIC_INIT(lck) MT_lock_init(&(lck), #lck) #define ATOMIC_FLAG int #define ATOMIC_FLAG_INIT {0} static inline ATOMIC_FLAG __ATOMIC_TAS(volatile ATOMIC_FLAG *var, pthread_mutex_t *lck) { ATOMIC_FLAG orig; pthread_mutex_lock(lck); if ((orig = *var) == 0) *var = 1; pthread_mutex_unlock(lck); return orig; } #define ATOMIC_TAS(var, lck) __ATOMIC_TAS(&var, &(lck).lock) static inline void __ATOMIC_CLEAR(volatile ATOMIC_FLAG *var, pthread_mutex_t *lck) { pthread_mutex_lock(lck); *var = 0; pthread_mutex_unlock(lck); } #define ATOMIC_CLEAR(var, lck) __ATOMIC_CLEAR(&var, &(lck).lock) #endif #endif /* LIBATOMIC_OPS */ #endif /* _GDK_ATOMIC_H_ */
Java
class VoidTile include IndefiniteArticle DEAD_COORDINATE = -9001 attr_reader :x attr_reader :y attr_reader :z attr_reader :plane def self.generate_hash(x, y, z) { x: x, y: y, z: z, name: '', description: '', colour: 'black', type: 'Void', occupants: 0} end class FakeArray < Array def <<(ignored) self end end @@fakearray = FakeArray.new def initialize(p, x, y, z) @x = x @y = y @z = z @plane = p end def colour 'black' end def type Entity::VoidTileType end def description '' end def name '' end def characters @@fakearray end def visible_character_count 0 end def occupants @@fakearray end def traversible? false end def portals_packets [] end def save end def statuses [] end def type_statuses [] end def to_h {name: self.name, type: self.type.name, type_id: self.type.id, description: self.description, x: self.x, y: self.y, z: self.z, plane: self.plane, occupants: self.visible_character_count} end def unserialise_statuses # do nothing end end
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `CaptureIndex` type in crate `regex_syntax`."> <meta name="keywords" content="rust, rustlang, rust-lang, CaptureIndex"> <title>regex_syntax::CaptureIndex - Rust</title> <link rel="stylesheet" type="text/css" href="../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <p class='location'><a href='index.html'>regex_syntax</a></p><script>window.sidebarCurrent = {name: 'CaptureIndex', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content type"> <h1 class='fqn'><span class='in-band'><a href='index.html'>regex_syntax</a>::<wbr><a class='type' href=''>CaptureIndex</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-1269' class='srclink' href='../src/regex_syntax/lib.rs.html#181' title='goto source code'>[src]</a></span></h1> <pre class='rust typedef'>type CaptureIndex = <a class='enum' href='../core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='../std/primitive.usize.html'>usize</a>&gt;;</pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../"; window.currentCrate = "regex_syntax"; window.playgroundUrl = ""; </script> <script src="../jquery.js"></script> <script src="../main.js"></script> <script defer src="../search-index.js"></script> </body> </html>
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html data-context="About" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>Mozilla Public License Version 2.0 - Legato Docs</title> <meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/> <meta content="legato, iot" name="keywords"/> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/> <meta content="19.11.6" name="legato-version"/> <link href="resources/images/legato.ico" rel="shortcut icon"/> <link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/> <link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/> <link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/> <!--[if IE]> <script src="resources/js/html5shiv.js"></script> <script src="resources/js/respond.js"></script> <![endif]--> <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script> <script src="resources/js/main.js"></script> <script src="tocs/About_Licenses.json"></script> </head> <body> <noscript> <input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/> <div id="nojs"> <label for="modal-closing-trick"> <span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span> </label> </div> </noscript> <div class="wrapper"> <div class="fa fa-bars documentation" id="menu-trigger"></div> <div id="top"> <header> <nav> <a class="navlink" href="/">Introduction</a><a class="navlink" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink selected" href="aboutMain.html">About</a> </nav> </header> </div> <div class="white" id="menudocumentation"> <header> <a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a> <h2>/ About</h2> <nav class="secondary"> <a href="aboutLegato.html">Legato</a><a href="aboutReleaseNotes.html">Release Notes</a><a class="link-selected" href="aboutLicenses.html">Licenses</a><a href="aboutLegatoContributing.html">Contribute Code</a> </nav> <nav class="ui-front"> <i class="fa fa-search" id="search-icon"></i> <input id="searchbox" placeholder="Search"/> </nav> </header> </div> <div id="resizable"> <div id="left"> <div id="tree1"></div> </div> </div> <div class="content"> <div class="header"> <div class="headertitle"> <h1 class="title">Mozilla Public License Version 2.0 </h1> </div> </div><div class="contents"> <div class="textblock"><pre class="fragment">1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.</pre> </div></div> <br clear="left"/> </div> </div> <link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/> <script src="resources/js/tree.jquery.js" type="text/javascript"></script> <script src="resources/js/jquery.cookie.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/> <script src="resources/js/perfect-scrollbar.jquery.min.js"></script> </body> </html>
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `AppendToAutoIdVector` fn in crate `js`."> <meta name="keywords" content="rust, rustlang, rust-lang, AppendToAutoIdVector"> <title>js::glue::AppendToAutoIdVector - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>js</a>::<wbr><a href='index.html'>glue</a></p><script>window.sidebarCurrent = {name: 'AppendToAutoIdVector', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>js</a>::<wbr><a href='index.html'>glue</a>::<wbr><a class='fn' href=''>AppendToAutoIdVector</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-44187' class='srclink' href='../../src/js/glue.rs.html#228' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub unsafe extern fn AppendToAutoIdVector(v: <a href='../../std/primitive.pointer.html'>*mut <a class='struct' href='../../js/jsapi/struct.AutoIdVector.html' title='js::jsapi::AutoIdVector'>AutoIdVector</a></a>, id: <a class='struct' href='../../js/jsapi/struct.jsid.html' title='js::jsapi::jsid'>jsid</a>) -&gt; <a href='../../std/primitive.u8.html'>u8</a></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "js"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_45) on Fri Dec 27 12:52:45 CST 2013 --> <title>UnauthorizedException (apache-cassandra API)</title> <meta name="date" content="2013-12-27"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="UnauthorizedException (apache-cassandra API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/UnauthorizedException.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/exceptions/TruncateException.html" title="class in org.apache.cassandra.exceptions"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/exceptions/UnavailableException.html" title="class in org.apache.cassandra.exceptions"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/exceptions/UnauthorizedException.html" target="_top">Frames</a></li> <li><a href="UnauthorizedException.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#methods_inherited_from_class_org.apache.cassandra.exceptions.CassandraException">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.apache.cassandra.exceptions</div> <h2 title="Class UnauthorizedException" class="title">Class UnauthorizedException</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>java.lang.Throwable</li> <li> <ul class="inheritance"> <li>java.lang.Exception</li> <li> <ul class="inheritance"> <li><a href="../../../../org/apache/cassandra/exceptions/CassandraException.html" title="class in org.apache.cassandra.exceptions">org.apache.cassandra.exceptions.CassandraException</a></li> <li> <ul class="inheritance"> <li><a href="../../../../org/apache/cassandra/exceptions/RequestValidationException.html" title="class in org.apache.cassandra.exceptions">org.apache.cassandra.exceptions.RequestValidationException</a></li> <li> <ul class="inheritance"> <li>org.apache.cassandra.exceptions.UnauthorizedException</li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Serializable, <a href="../../../../org/apache/cassandra/exceptions/TransportException.html" title="interface in org.apache.cassandra.exceptions">TransportException</a></dd> </dl> <hr> <br> <pre>public class <span class="strong">UnauthorizedException</span> extends <a href="../../../../org/apache/cassandra/exceptions/RequestValidationException.html" title="class in org.apache.cassandra.exceptions">RequestValidationException</a></pre> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../serialized-form.html#org.apache.cassandra.exceptions.UnauthorizedException">Serialized Form</a></dd></dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/exceptions/UnauthorizedException.html#UnauthorizedException(java.lang.String)">UnauthorizedException</a></strong>(java.lang.String&nbsp;msg)</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_org.apache.cassandra.exceptions.CassandraException"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.apache.cassandra.exceptions.<a href="../../../../org/apache/cassandra/exceptions/CassandraException.html" title="class in org.apache.cassandra.exceptions">CassandraException</a></h3> <code><a href="../../../../org/apache/cassandra/exceptions/CassandraException.html#code()">code</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Throwable"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Throwable</h3> <code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_org.apache.cassandra.exceptions.TransportException"> <!-- --> </a> <h3>Methods inherited from interface&nbsp;org.apache.cassandra.exceptions.<a href="../../../../org/apache/cassandra/exceptions/TransportException.html" title="interface in org.apache.cassandra.exceptions">TransportException</a></h3> <code><a href="../../../../org/apache/cassandra/exceptions/TransportException.html#getMessage()">getMessage</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="UnauthorizedException(java.lang.String)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>UnauthorizedException</h4> <pre>public&nbsp;UnauthorizedException(java.lang.String&nbsp;msg)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/UnauthorizedException.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/exceptions/TruncateException.html" title="class in org.apache.cassandra.exceptions"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/exceptions/UnavailableException.html" title="class in org.apache.cassandra.exceptions"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/exceptions/UnauthorizedException.html" target="_top">Frames</a></li> <li><a href="UnauthorizedException.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#methods_inherited_from_class_org.apache.cassandra.exceptions.CassandraException">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &copy; 2013 The Apache Software Foundation</small></p> </body> </html>
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `NO_RESET_NOTIFICATION_KHR` constant in crate `glutin`."> <meta name="keywords" content="rust, rustlang, rust-lang, NO_RESET_NOTIFICATION_KHR"> <title>glutin::api::egl::ffi::egl::NO_RESET_NOTIFICATION_KHR - Rust</title> <link rel="stylesheet" type="text/css" href="../../../../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../../../../index.html'>glutin</a>::<wbr><a href='../../../index.html'>api</a>::<wbr><a href='../../index.html'>egl</a>::<wbr><a href='../index.html'>ffi</a>::<wbr><a href='index.html'>egl</a></p><script>window.sidebarCurrent = {name: 'NO_RESET_NOTIFICATION_KHR', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../../../../index.html'>glutin</a>::<wbr><a href='../../../index.html'>api</a>::<wbr><a href='../../index.html'>egl</a>::<wbr><a href='../index.html'>ffi</a>::<wbr><a href='index.html'>egl</a>::<wbr><a class='constant' href=''>NO_RESET_NOTIFICATION_KHR</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-2662' class='srclink' href='../../../../../src/glutin///home/servo/buildbot/slave/doc/build/target/debug/build/glutin-3a49bc866bd01bfd/out/egl_bindings.rs.html#647' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const NO_RESET_NOTIFICATION_KHR: <a class='type' href='../../../../../glutin/api/egl/ffi/egl/types/type.GLenum.html' title='glutin::api::egl::ffi::egl::types::GLenum'>GLenum</a><code> = </code><code>0x31BE</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../../../../"; window.currentCrate = "glutin"; window.playgroundUrl = ""; </script> <script src="../../../../../jquery.js"></script> <script src="../../../../../main.js"></script> <script async src="../../../../../search-index.js"></script> </body> </html>
Java
<!-- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. Copyright (c) 2014 Mozilla Corporation --> <template name="alertdetails"> <div class="container"> <div class="row"> <div class="row"><button class="btn btn-sm btn-warning col-xs-2 makeinvestigation" data-alertid={{esmetadata.id}}>Escalate To Investigation</button></div> <div class="row"><button class="btn btn-sm btn-danger col-xs-2 makeincident" data-alertid={{esmetadata.id}}>Escalate To Incident</button></div> <div class="row" id="alert" > <table class="table table-reactive table-hover table-condensed" id="alert-table"> <thead> <tr> <td class="upperwhite">Timestamp</td> <td class="upperwhite">Links</td> <td class="upperwhite">Severity</td> <td class="upperwhite">Category</td> <td class="upperwhite">Summary</td> </tr> </thead> <tbody> <tr> <td>{{utctimestamp}}</td> <td> <a target="_blank" href="{{kibanaurl}}">open in kibana</a> {{#if url}} <br><a href="{{url}}" target ="_blank">docs</a> {{/if}} </td> <td>{{severity}}</td> <td>{{category}}</td> <td class="alertsummary">{{{ipDecorate summary}}}</td> </tr> </tbody> </table> </div> </div> <table class="table table-reactive table-hover table-condensed" id="alert-events-table"> <tbody class="table-striped"> {{#each this.events}} {{>alert_event}} {{/each}} </tbody> </table> </div> </template> <!--each individual event --> <template name="alert_event"> <tr> <td>{{documentindex}}</td> <td>{{documentid}}</td> <td>{{documenttype}}</td> <td>{{{ ipDecorate documentsource.summary}}}</td> <td>{{>eventdetails}}</td> </tr> </template>
Java
using System.Linq; using Xunit; namespace Kf.Core.Tests._extensions_.Collections { public class IEnumerableOfTExtensionsTests { [Fact] public void Index_Returns_Correct_Values_And_Index() { // Arrange var index = 0; var sut = Enumerable.Range(0, 500); // Act var foreachWithIndex = sut.Index(); // Assert foreach (var element in foreachWithIndex) { Assert.Equal(index, element.Index); Assert.Equal(index, element.Value); Assert.Equal(element.Value, element.Index); index++; } } [Fact] public void ForEachPerformsCorrectAlgorithm() { var sut = Enumerable.Range(0, 500); var result = sut.ForEach(i => { return 0; }); Assert.True(result.All(i => i == 0)); } [Fact] public void ForEachCanReturnDifferentType() { var sut = Enumerable.Range(0, 500); var result = sut.ForEach(i => { return i.ToString("000"); }); Assert.True(result.All(i => i.Length.Equals(3))); } [Fact] public void ForEachCanReturnAndCOntinueLinqStyle() { var sut = Enumerable.Range(0, 500); var result = sut.ForEach(i => { return i.ToString("000"); }); result = result.Where(x => x.Contains("449")); Assert.True(result.Count().Equals(1)); } } }
Java
# coding=utf-8 ''' tagsPlorer package entry point (C) 2021-2021 Arne Bachmann https://github.com/ArneBachmann/tagsplorer ''' from tagsplorer import tp tp.Main().parse_and_run()
Java
/* * Copyright (c) 2014. The Trustees of Indiana University. * * This version of the code is licensed under the MPL 2.0 Open Source license with additional * healthcare disclaimer. If the user is an entity intending to commercialize any application * that uses this code in a for-profit venture, please contact the copyright holder. */ package com.muzima.api.model.algorithm; import com.muzima.api.model.PersonAttributeType; import com.muzima.search.api.model.object.Searchable; import com.muzima.util.JsonUtils; import net.minidev.json.JSONObject; import java.io.IOException; public class PersonAttributeTypeAlgorithm extends BaseOpenmrsAlgorithm { public static final String PERSON_ATTRIBUTE_TYPE_REPRESENTATION = "(uuid,name)"; private String uuid; /** * Implementation of this method will define how the object will be serialized from the String representation. * * @param serialized the string representation * @return the concrete object */ @Override public Searchable deserialize(final String serialized, final boolean isFullSerialization) throws IOException { PersonAttributeType attributeType = new PersonAttributeType(); attributeType.setUuid(JsonUtils.readAsString(serialized, "$['uuid']")); attributeType.setName(JsonUtils.readAsString(serialized, "$['name']")); return attributeType; } /** * Implementation of this method will define how the object will be de-serialized into the String representation. * * @param object the object * @return the string representation */ @Override public String serialize(final Searchable object, final boolean isFullSerialization) throws IOException { PersonAttributeType attributeType = (PersonAttributeType) object; JSONObject jsonObject = new JSONObject(); JsonUtils.writeAsString(jsonObject, "uuid", attributeType.getUuid()); JsonUtils.writeAsString(jsonObject, "name", attributeType.getName()); return jsonObject.toJSONString(); } }
Java
/** * Copyright 2017, Digi International Inc. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at http://mozilla.org/MPL/2.0/. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package com.digi.xbee.api.packet.thread; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsEqual.equalTo; import static org.hamcrest.core.IsNot.not; import static org.hamcrest.core.IsNull.nullValue; import static org.junit.Assert.*; import java.net.Inet6Address; import java.net.UnknownHostException; import java.util.Arrays; import java.util.LinkedHashMap; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import com.digi.xbee.api.models.CoAPURI; import com.digi.xbee.api.models.HTTPMethodEnum; import com.digi.xbee.api.models.RemoteATCommandOptions; import com.digi.xbee.api.packet.APIFrameType; import com.digi.xbee.api.packet.thread.CoAPTxRequestPacket; import com.digi.xbee.api.utils.HexUtils; @PrepareForTest({Inet6Address.class, CoAPTxRequestPacket.class}) @RunWith(PowerMockRunner.class) public class CoAPTxRequestPacketTest { // Constants. private static final String IPV6_ADDRESS = "FDB3:0001:0002:0000:0004:0005:0006:0007"; // Variables. private int frameType = APIFrameType.COAP_TX_REQUEST.getValue(); private int frameID = 0x01; private int options = RemoteATCommandOptions.OPTION_NONE; private Inet6Address destAddress; private HTTPMethodEnum method = HTTPMethodEnum.GET; private String uriData = CoAPURI.URI_DATA_TRANSMISSION; private byte[] data = "Test".getBytes(); @Rule public ExpectedException exception = ExpectedException.none(); public CoAPTxRequestPacketTest() throws Exception { destAddress = (Inet6Address) Inet6Address.getByName(IPV6_ADDRESS); } /** * @throws java.lang.Exception */ @BeforeClass public static void setUpBeforeClass() throws Exception { } /** * @throws java.lang.Exception */ @AfterClass public static void tearDownAfterClass() throws Exception { } /** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { } /** * @throws java.lang.Exception */ @After public void tearDown() throws Exception { } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}. * * <p>A {@code NullPointerException} exception must be thrown when parsing * a {@code null} byte array.</p> */ @Test public final void testCreatePacketNullPayload() { // Set up the resources for the test. byte[] payload = null; exception.expect(NullPointerException.class); exception.expectMessage(is(equalTo("CoAP Tx Request packet payload cannot be null."))); // Call the method under test that should throw a NullPointerException. CoAPTxRequestPacket.createPacket(payload); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}. * * <p>An {@code IllegalArgumentException} exception must be thrown when * parsing an empty byte array.</p> */ @Test public final void testCreatePacketEmptyPayload() { // Set up the resources for the test. byte[] payload = new byte[0]; exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo("Incomplete CoAP Tx Request packet."))); // Call the method under test that should throw an IllegalArgumentException. CoAPTxRequestPacket.createPacket(payload); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}. * * <p>An {@code IllegalArgumentException} exception must be thrown when * parsing a byte array shorter than the needed one is provided.</p> */ @Test public final void testCreatePacketPayloadShorterThanNeeded() { // Set up the resources for the test. byte[] payload = new byte[25]; payload[0] = (byte)frameType; payload[1] = (byte)frameID; payload[2] = (byte)options; payload[3] = (byte)method.getValue(); System.arraycopy(destAddress.getAddress(), 0, payload, 4, destAddress.getAddress().length); payload[20] = (byte)(uriData.length()); System.arraycopy(uriData.getBytes(), 0, payload, 21, uriData.getBytes().length - 1); exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo("Incomplete CoAP Tx Request packet."))); // Call the method under test that should throw an IllegalArgumentException. CoAPTxRequestPacket.createPacket(payload); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}. * * <p>An {@code IllegalArgumentException} exception must be thrown when * parsing a byte array not including the Frame type.</p> */ @Test public final void testCreatePacketPayloadNotIncludingFrameType() { // Set up the resources for the test. byte[] payload = new byte[25 + data.length]; payload[0] = (byte)frameID; payload[1] = (byte)options; payload[2] = (byte)method.getValue(); System.arraycopy(destAddress.getAddress(), 0, payload, 3, destAddress.getAddress().length); payload[20] = (byte)(uriData.length()); System.arraycopy(uriData.getBytes(), 0, payload, 20, uriData.getBytes().length); System.arraycopy(data, 0, payload, 20 + uriData.getBytes().length, data.length); exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo("Payload is not a CoAP Tx Request packet."))); // Call the method under test that should throw an IllegalArgumentException. CoAPTxRequestPacket.createPacket(payload); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}. * * <p>An {@code IllegalArgumentException} exception must be thrown when * parsing a byte array with an invalid IPv6 address.</p> */ @Test public final void testCreatePacketPayloadInvalidIP() throws Exception { // Set up the resources for the test. byte[] payload = new byte[26]; payload[0] = (byte)frameType; payload[1] = (byte)frameID; payload[2] = (byte)options; payload[3] = (byte)method.getValue(); System.arraycopy(destAddress.getAddress(), 0, payload, 4, destAddress.getAddress().length); payload[20] = (byte)(uriData.length()); System.arraycopy(uriData.getBytes(), 0, payload, 21, uriData.getBytes().length); PowerMockito.mockStatic(Inet6Address.class); PowerMockito.when(Inet6Address.getByAddress(Mockito.any(byte[].class))).thenThrow(new UnknownHostException()); exception.expect(IllegalArgumentException.class); // Call the method under test that should throw an IllegalArgumentException. CoAPTxRequestPacket.createPacket(payload); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}. * * <p>A valid CoAP TX Request packet with the provided options and without * data is created.</p> */ @Test public final void testCreatePacketValidPayloadWithoutData() { // Set up the resources for the test. byte[] payload = new byte[26]; payload[0] = (byte)frameType; payload[1] = (byte)frameID; payload[2] = (byte)options; payload[3] = (byte)method.getValue(); System.arraycopy(destAddress.getAddress(), 0, payload, 4, destAddress.getAddress().length); payload[20] = (byte)(uriData.length()); System.arraycopy(uriData.getBytes(), 0, payload, 21, uriData.getBytes().length); // Call the method under test. CoAPTxRequestPacket packet = CoAPTxRequestPacket.createPacket(payload); // Verify the result. assertThat("Returned length is not the expected one", packet.getPacketLength(), is(equalTo(payload.length))); assertThat("Returned frame ID is not the expected one", packet.getFrameID(), is(equalTo(frameID))); assertThat("Returned options are not the expected ones", packet.getTransmitOptions(), is(equalTo(options))); assertThat("Returned RESTul method is not the expected one", packet.getMethod(), is(equalTo(method))); assertThat("Returned dest address is not the expected one", packet.getDestAddress(), is(equalTo(destAddress))); assertThat("Returned URI is not the expected one", packet.getURI(), is(equalTo(uriData))); assertThat("Returned data is not the expected one", packet.getPayload(), is(nullValue())); assertThat("Returned payload array is not the expected one", packet.getPacketData(), is(equalTo(payload))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#createPacket(byte[])}. * * <p>A valid CoAP TX Request packet with the provided options and data is * created.</p> */ @Test public final void testCreatePacketValidPayloadWithData() { // Set up the resources for the test. byte[] payload = new byte[26 + data.length]; payload[0] = (byte)frameType; payload[1] = (byte)frameID; payload[2] = (byte)options; payload[3] = (byte)method.getValue(); System.arraycopy(destAddress.getAddress(), 0, payload, 4, destAddress.getAddress().length); payload[20] = (byte)(uriData.length()); System.arraycopy(uriData.getBytes(), 0, payload, 21, uriData.getBytes().length); System.arraycopy(data, 0, payload, 21 + uriData.getBytes().length, data.length); // Call the method under test. CoAPTxRequestPacket packet = CoAPTxRequestPacket.createPacket(payload); // Verify the result. assertThat("Returned length is not the expected one", packet.getPacketLength(), is(equalTo(payload.length))); assertThat("Returned frame ID is not the expected one", packet.getFrameID(), is(equalTo(frameID))); assertThat("Returned options are not the expected ones", packet.getTransmitOptions(), is(equalTo(options))); assertThat("Returned RESTul method is not the expected one", packet.getMethod(), is(equalTo(method))); assertThat("Returned dest address is not the expected one", packet.getDestAddress(), is(equalTo(destAddress))); assertThat("Returned URI is not the expected one", packet.getURI(), is(equalTo(uriData))); assertThat("Returned data is not the expected one", packet.getPayload(), is(equalTo(data))); assertThat("Returned payload array is not the expected one", packet.getPacketData(), is(equalTo(payload))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}. * * <p>Construct a new CoAP TX Request packet with a frame ID bigger than * 255. This must throw an {@code IllegalArgumentException}.</p> */ @Test public final void testCreateCoAPTxRequestPacketFrameIDBiggerThan255() { // Set up the resources for the test. int frameID = 524; exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo("Frame ID must be between 0 and 255."))); // Call the method under test that should throw an IllegalArgumentException. new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}. * * <p>Construct a new CoAP TX Request packet with a negative frame ID. This * must throw an {@code IllegalArgumentException}.</p> */ @Test public final void testCreateCoAPTxRequestPacketFrameIDNegative() { // Set up the resources for the test. int frameID = -6; exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo("Frame ID must be between 0 and 255."))); // Call the method under test that should throw an IllegalArgumentException. new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}. * * <p>Construct a new CoAP TX Request packet with invalid transmit options. * This must throw a {@code IllegalArgumentException}.</p> */ @Test public final void testCreateCoAPTxRequestPacketTransmitOptionsInvalid() { // Set up the resources for the test. int options = -1; exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo("Transmit options can only be " + RemoteATCommandOptions.OPTION_NONE + " or " + RemoteATCommandOptions.OPTION_APPLY_CHANGES + "."))); // Call the method under test that should throw a NullPointerException. new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}. * * <p>Construct a new CoAP TX Request packet with a null RESTful method. * This must throw a {@code NullPointerException}.</p> */ @Test public final void testCreateCoAPTxRequestPacketMethodNull() { // Set up the resources for the test. HTTPMethodEnum method = null; exception.expect(NullPointerException.class); exception.expectMessage(is(equalTo("HTTP Method cannot be null."))); // Call the method under test that should throw a NullPointerException. new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}. * * <p>Construct a new CoAP TX Request packet with a null destination * address. This must throw a {@code NullPointerException}.</p> */ @Test public final void testCreateCoAPTxRequestPacketDestAddressNull() { // Set up the resources for the test. Inet6Address destAddress = null; exception.expect(NullPointerException.class); exception.expectMessage(is(equalTo("Destination address cannot be null."))); // Call the method under test that should throw a NullPointerException. new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}. * * <p>Construct a new CoAP TX Request packet with a null URI. This must * throw a {@code NullPointerException}.</p> */ @Test public final void testCreateCoAPTxRequestPacketURINull() { // Set up the resources for the test. String uriData = null; exception.expect(NullPointerException.class); exception.expectMessage(is(equalTo("URI cannot be null."))); // Call the method under test that should throw a NullPointerException. new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}. * * <p>Construct a new CoAP TX Request packet without data ({@code null}).</p> */ @Test public final void testCreateCoAPTxRequestPacketValidDataNull() { // Set up the resources for the test. data = null; int expectedLength = 26; // Call the method under test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); // Verify the result. assertThat("Returned length is not the expected one", packet.getPacketLength(), is(equalTo(expectedLength))); assertThat("Returned frame ID is not the expected one", packet.getFrameID(), is(equalTo(frameID))); assertThat("Returned options are not the expected ones", packet.getTransmitOptions(), is(equalTo(options))); assertThat("Returned RESTul method is not the expected one", packet.getMethod(), is(equalTo(method))); assertThat("Returned dest address is not the expected one", packet.getDestAddress(), is(equalTo(destAddress))); assertThat("Returned URI is not the expected one", packet.getURI(), is(equalTo(uriData))); assertThat("Returned data is not the expected one", packet.getPayload(), is(nullValue())); assertThat("CoAP TX Request packet needs API Frame ID", packet.needsAPIFrameID(), is(equalTo(true))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#CoAPTxRequestPacket(int, int, HTTPMethodEnum, Inet6Address, String, byte[])}. * * <p>Construct a new CoAP TX Request packet with data.</p> */ @Test public final void testCreateCoAPTxRequestPacketValidDataNotNull() { // Set up the resources for the test. int expectedLength = 26 + data.length; // Call the method under test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); // Verify the result. assertThat("Returned length is not the expected one", packet.getPacketLength(), is(equalTo(expectedLength))); assertThat("Returned frame ID is not the expected one", packet.getFrameID(), is(equalTo(frameID))); assertThat("Returned options are not the expected ones", packet.getTransmitOptions(), is(equalTo(options))); assertThat("Returned RESTul method is not the expected one", packet.getMethod(), is(equalTo(method))); assertThat("Returned dest address is not the expected one", packet.getDestAddress(), is(equalTo(destAddress))); assertThat("Returned URI is not the expected one", packet.getURI(), is(equalTo(uriData))); assertThat("Returned data is not the expected one", packet.getPayload(), is(data)); assertThat("CoAP TX Request packet needs API Frame ID", packet.needsAPIFrameID(), is(equalTo(true))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#getAPIData()}. * * <p>Test the get API parameters with a {@code null} received data.</p> */ @Test public final void testGetAPIDataReceivedDataNull() { // Set up the resources for the test. byte[] data = null; CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); int expectedLength = 25; byte[] expectedData = new byte[expectedLength]; expectedData[0] = (byte)frameID; expectedData[1] = (byte)options; expectedData[2] = (byte)method.getValue(); System.arraycopy(destAddress.getAddress(), 0, expectedData, 3, destAddress.getAddress().length); expectedData[19] = (byte)(uriData.length()); System.arraycopy(uriData.getBytes(), 0, expectedData, 20, uriData.getBytes().length); // Call the method under test. byte[] apiData = packet.getAPIData(); // Verify the result. assertThat("API data is not the expected", apiData, is(equalTo(expectedData))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#getAPIData()}. * * <p>Test the get API parameters with a not-{@code null} received data.</p> */ @Test public final void testGetAPIDataReceivedDataNotNull() { // Set up the resources for the test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); int expectedLength = 25 + data.length; byte[] expectedData = new byte[expectedLength]; expectedData[0] = (byte)frameID; expectedData[1] = (byte)options; expectedData[2] = (byte)method.getValue(); System.arraycopy(destAddress.getAddress(), 0, expectedData, 3, destAddress.getAddress().length); expectedData[19] = (byte)(uriData.length()); System.arraycopy(uriData.getBytes(), 0, expectedData, 20, uriData.getBytes().length); System.arraycopy(data, 0, expectedData, 20 + uriData.getBytes().length, data.length); // Call the method under test. byte[] apiData = packet.getAPIData(); // Verify the result. assertThat("API data is not the expected", apiData, is(equalTo(expectedData))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#getAPIPacketParameters()}. * * <p>Test the get API parameters with a {@code null} received data.</p> */ @Test public final void testGetAPIPacketParametersReceivedDataNull() { // Set up the resources for the test. byte[] data = null; CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); // Call the method under test. LinkedHashMap<String, String> packetParams = packet.getAPIPacketParameters(); // Verify the result. assertThat("Packet parameters map size is not the expected one", packetParams.size(), is(equalTo(6))); assertThat("Returned transmit options are not the expected ones", packetParams.get("Options"), is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(options, 1))))); assertThat("Returned HTTP method is not the expected one", packetParams.get("Method"), is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(method.getValue(), 1)) + " (" + method.getName() + ")"))); assertThat("Returned dest address is not the expected one", packetParams.get("Destination address"), is(equalTo(HexUtils.prettyHexString(destAddress.getAddress()) + " (" + destAddress.getHostAddress() + ")"))); assertThat("Returned URI length is not the expected one", packetParams.get("URI length"), is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(uriData.length(), 1)) + " (" + uriData.length() + ")"))); assertThat("Returned URI is not the expected one", packetParams.get("URI"), is(equalTo(HexUtils.prettyHexString(HexUtils.byteArrayToHexString(uriData.getBytes())) + " (" + uriData + ")"))); assertThat("RF data is not the expected", packetParams.get("RF data"), is(nullValue(String.class))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#getAPIPacketParameters()}. * * <p>Test the get API parameters with a not-{@code null} received data.</p> */ @Test public final void testGetAPIPacketParametersReceivedDataNotNull() { // Set up the resources for the test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); // Call the method under test. LinkedHashMap<String, String> packetParams = packet.getAPIPacketParameters(); // Verify the result. assertThat("Packet parameters map size is not the expected one", packetParams.size(), is(equalTo(7))); assertThat("Returned transmit options are not the expected ones", packetParams.get("Options"), is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(options, 1))))); assertThat("Returned HTTP method is not the expected one", packetParams.get("Method"), is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(method.getValue(), 1)) + " (" + method.getName() + ")"))); assertThat("Returned dest address is not the expected one", packetParams.get("Destination address"), is(equalTo(HexUtils.prettyHexString(destAddress.getAddress()) + " (" + destAddress.getHostAddress() + ")"))); assertThat("Returned URI length is not the expected one", packetParams.get("URI length"), is(equalTo(HexUtils.prettyHexString(HexUtils.integerToHexString(uriData.length(), 1)) + " (" + uriData.length() + ")"))); assertThat("Returned URI is not the expected one", packetParams.get("URI"), is(equalTo(HexUtils.prettyHexString(HexUtils.byteArrayToHexString(uriData.getBytes())) + " (" + uriData + ")"))); assertThat("RF data is not the expected", packetParams.get("Payload"), is(equalTo(HexUtils.prettyHexString(HexUtils.byteArrayToHexString(data))))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setDestAddress(Inet6Address)}. */ @Test public final void testSetDestAddressNull() { // Set up the resources for the test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); exception.expect(NullPointerException.class); exception.expectMessage(is(equalTo("Destination address cannot be null."))); // Call the method under test that should throw a NullPointerException. packet.setDestAddress(null); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setDestAddress(Inet6Address)}. * * @throws Exception */ @Test public final void testSetDestAddressNotNull() throws Exception { // Set up the resources for the test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); Inet6Address newAddress = (Inet6Address) Inet6Address.getByName("fd8a:cb11:ad71:0000:7662:c401:5efe:dc41"); // Call the method under test. packet.setDestAddress(newAddress); // Verify the result. assertThat("Dest address is not the expected one", packet.getDestAddress(), is(equalTo(newAddress))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setTransmitOptions(int)}. */ @Test public final void testSetTransmitOptionsATURIOptionsIllegal() { // Set up the resources for the test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, CoAPURI.URI_AT_COMMAND, data); exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo("Transmit options can only be " + RemoteATCommandOptions.OPTION_NONE + " or " + RemoteATCommandOptions.OPTION_APPLY_CHANGES + "."))); // Call the method under test that should throw an IllegalArgumentException. packet.setTransmitOptions(0x03); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setTransmitOptions(int)}. */ @Test public final void testSetTransmitOptionsTXURIOptionsIllegal() { // Set up the resources for the test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, CoAPURI.URI_DATA_TRANSMISSION, data); exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo("Transmit options can only be " + RemoteATCommandOptions.OPTION_NONE + " or " + RemoteATCommandOptions.OPTION_APPLY_CHANGES + "."))); // Call the method under test that should throw an IllegalArgumentException. packet.setTransmitOptions(0x02); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setTransmitOptions(int)}. */ @Test public final void testTransmitOptionsValid() { // Set up the resources for the test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); int newOptions = 0x00; // Call the method under test. packet.setTransmitOptions(newOptions); // Verify the result. assertThat("Transmit options are not the expected ones", packet.getTransmitOptions(), is(equalTo(newOptions))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setMethod(HTTPMethodEnum)}. */ @Test public final void testSetMEthodNull() { // Set up the resources for the test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); exception.expect(NullPointerException.class); exception.expectMessage(is(equalTo("HTTP Method cannot be null."))); // Call the method under test that should throw a NullPointerException. packet.setMethod(null); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setMethod(HTTPMethodEnum)}. */ @Test public final void testSetMethodNotNull() { // Set up the resources for the test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); HTTPMethodEnum newMethod = HTTPMethodEnum.PUT; // Call the method under test. packet.setMethod(newMethod); // Verify the result. assertThat("HTTP method is not the expected one", packet.getMethod(), is(equalTo(newMethod))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#getPayload()}. */ @Test public final void testGetDataNullData() { // Set up the resources for the test. byte[] data = null; CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); // Call the method under test. byte[] result = packet.getPayload(); // Verify the result. assertThat("RF data must be the same", result, is(equalTo(data))); assertThat("RF data must be null", result, is(nullValue(byte[].class))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#getPayload()}. */ @Test public final void testGetDataValidData() { // Set up the resources for the test. CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); // Call the method under test. byte[] result = packet.getPayload(); // Verify the result. assertThat("Data must be the same", result, is(equalTo(data))); assertThat("Data must not be the same object", result.hashCode(), is(not(equalTo(data.hashCode())))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setPayload(byte[])}. */ @Test public final void testSetDataNullData() { // Set up the resources for the test. byte[] newData = null; CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); // Call the method under test. packet.setPayload(newData); byte[] result = packet.getPayload(); // Verify the result. assertThat("Data must be the same", result, is(equalTo(newData))); assertThat("Data must be null", result, is(nullValue(byte[].class))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setPayload(byte[])}. */ @Test public final void testSetDataValidData() { // Set up the resources for the test. byte[] newData = "New data".getBytes(); CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); // Call the method under test. packet.setPayload(newData); byte[] result = packet.getPayload(); // Verify the result. assertThat("Data must be the same", result, is(equalTo(newData))); } /** * Test method for {@link com.digi.xbee.api.packet.thread.CoAPTxRequestPacket#setPayload(byte[])}. */ @Test public final void testSetDataAndModifyOriginal() { // Set up the resources for the test. byte[] newData = "New data".getBytes(); CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); // Call the method under test. packet.setPayload(newData); byte[] backup = Arrays.copyOf(newData, newData.length); newData[0] = 0x00; byte[] result = packet.getPayload(); // Verify the result. assertThat("Data must be the same as the setted data", result, is(equalTo(backup))); assertThat("Data must not be the current value of received data", result, is(not(equalTo(data)))); assertThat("Data must not be the same object", result.hashCode(), is(not(equalTo(backup.hashCode())))); assertThat("Data must not be the same object", result.hashCode(), is(not(equalTo(data.hashCode())))); } }
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `GENERATE_MIPMAP` constant in crate `servo`."> <meta name="keywords" content="rust, rustlang, rust-lang, GENERATE_MIPMAP"> <title>servo::gl::GENERATE_MIPMAP - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>servo</a>::<wbr><a href='index.html'>gl</a></p><script>window.sidebarCurrent = {name: 'GENERATE_MIPMAP', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>servo</a>::<wbr><a href='index.html'>gl</a>::<wbr><a class='constant' href=''>GENERATE_MIPMAP</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-3989' class='srclink' href='../../export/gleam/ffi/constant.GENERATE_MIPMAP.html?gotosrc=3989' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const GENERATE_MIPMAP: <a href='../../std/primitive.u32.html'>u32</a><code> = </code><code>33169</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "servo"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
Java
'use strict'; var LIVERELOAD_PORT = 35729; var lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT }); var mountFolder = function (connect, dir) { return connect.static(require('path').resolve(dir)); }; var fs = require('fs'); var delayApiCalls = function (request, response, next) { if (request.url.indexOf('/api') !== -1) { setTimeout(function () { next(); }, 1000); } else { next(); } }; var httpMethods = function (request, response, next) { console.log("request method: " + JSON.stringify(request.method)); var rawpath = request.url.split('?')[0]; console.log("request url: " + JSON.stringify(request.url)); var path = require('path').resolve(__dirname, 'app/' + rawpath); console.log("request path : " + JSON.stringify(path)); console.log("request current dir : " + JSON.stringify(__dirname)); if ((request.method === 'PUT' || request.method === 'POST')) { console.log('inside put/post'); request.content = ''; request.addListener("data", function (chunk) { request.content += chunk; }); request.addListener("end", function () { console.log("request content: " + JSON.stringify(request.content)); if (fs.existsSync(path)) { if (request.method === 'POST') { response.statusCode = 403; response.end('Resource already exists.'); return; } fs.writeFile(path, request.content, function (err) { if (err) { response.statusCode(404); console.log('File not saved: ' + JSON.stringify(err)); response.end('Error writing to file.'); } else { console.log('File saved to: ' + path); response.end('File was saved.'); } }); return; } else { if (request.method === 'PUT') { response.statusCode = 404; response.end('Resource not found: ' + JSON.stringify(request.url)); return; } } if (request.url === '/log') { var filePath = 'server/log/server.log'; var logData = JSON.parse(request.content); fs.appendFile(filePath, logData.logUrl + '\n' + logData.logMessage + '\n', function (err) { if (err) { throw err; } console.log('log saved'); response.end('log was saved'); }); return; } }); return; } next(); }; // # Globbing // for performance reasons we're only matching one level down: // 'test/spec/{,*/}*.js' // use this if you want to recursively match all subfolders: // 'test/spec/**/*.js' module.exports = function (grunt) { require('load-grunt-tasks')(grunt); require('time-grunt')(grunt); // configurable paths var yeomanConfig = { app: 'app', dist: 'dist', doc: 'doc', test: 'test' }; try { yeomanConfig.app = require('./bower.json').appPath || yeomanConfig.app; } catch (e) {} grunt.initConfig({ yeoman: yeomanConfig, watch: { compass: { files: ['<%= yeoman.app %>/styles/**/*.{scss,sass}'], tasks: ['compass:server', 'autoprefixer:tmp'] }, styles: { files: ['<%= yeoman.app %>/styles/**/*.css'], tasks: ['autoprefixer:styles'] }, livereload: { options: { livereload: LIVERELOAD_PORT }, files: [ '<%= yeoman.app %>/**/*.html', '{.tmp,<%= yeoman.app %>}/styles/**/*.css', '{.tmp,<%= yeoman.app %>}/scripts/**/*.js', '{.tmp,<%= yeoman.app %>}/resources/**/*', '<%= yeoman.app %>/images/**/*.{png,jpg,jpeg,gif,webp,svg}' ] } // , // doc: { // files: ['{.tmp,<%= yeoman.app %>}/scripts/**/*.js'], // tasks: ['docular'] // } }, autoprefixer: { options: ['last 1 version'], tmp: { files: [{ expand: true, cwd: '.tmp/styles/', src: '**/*.css', dest: '.tmp/styles/' }] }, styles: { files: [{ expand: true, cwd: '<%= yeoman.app %>/styles/', src: '**/*.css', dest: '.tmp/styles/' }] } }, connect: { options: { protocol: 'http', port: 9000, // Change this to '0.0.0.0' to access the server from outside. hostname: 'localhost' }, livereload: { options: { middleware: function (connect) { return [ delayApiCalls, lrSnippet, mountFolder(connect, '.tmp'), mountFolder(connect, yeomanConfig.app), httpMethods ]; } } }, test: { options: { port: 9090, middleware: function (connect) { return [ mountFolder(connect, '.tmp'), mountFolder(connect, yeomanConfig.app), mountFolder(connect, '<%= yeoman.test %>'), httpMethods ]; } } }, dist: { options: { middleware: function (connect) { return [ delayApiCalls, mountFolder(connect, yeomanConfig.dist), httpMethods ]; } } }, doc: { options: { port: 3000, middleware: function (connect) { return [ mountFolder(connect, yeomanConfig.doc) ]; } } } }, open: { server: { url: '<%= connect.options.protocol %>://<%= connect.options.hostname %>:<%= connect.options.port %>' }, doc: { url: '<%= connect.options.protocol %>://<%= connect.options.hostname %>:9001' } }, clean: { dist: { files: [{ dot: true, src: [ '.tmp', '<%= yeoman.dist %>/*', '!<%= yeoman.dist %>/.git*' ] }] }, server: '.tmp' }, jshint: { options: { jshintrc: '.jshintrc' }, all: [ 'Gruntfile.js', '<%= yeoman.app %>/scripts/{,*/}*.js' ] }, compass: { options: { sassDir: '<%= yeoman.app %>/styles', cssDir: '.tmp/styles', generatedImagesDir: '.tmp/images/generated', imagesDir: '<%= yeoman.app %>/images', javascriptsDir: '<%= yeoman.app %>/scripts', fontsDir: '<%= yeoman.app %>/styles/fonts', importPath: '<%= yeoman.app %>/bower_components', httpImagesPath: '/images', httpGeneratedImagesPath: '/images/generated', httpFontsPath: '/styles/fonts', relativeAssets: false }, dist: { options: { debugInfo: false } }, server: { options: { debugInfo: true } } }, uglify: { dist: { files: { '<%= yeoman.dist %>/scripts/api/angular-jqm.js': ['<%= yeoman.app %>/scripts/api/angular-jqm.js'], '<%= yeoman.dist %>/bower_components/angular-animate/angular-animate.js': ['<%= yeoman.app %>/bower_components/angular-animate/angular-animate.js'], '<%= yeoman.dist %>/bower_components/angular-route/angular-route.js': ['<%= yeoman.app %>/bower_components/angular-route/angular-route.js'], '<%= yeoman.dist %>/bower_components/angular-touch/angular-touch.js': ['<%= yeoman.app %>/bower_components/angular-touch/angular-touch.js'] } } }, rev: { dist: { files: { src: [ '<%= yeoman.dist %>/scripts/*.js', '<%= yeoman.dist %>/styles/*.css', '<%= yeoman.dist %>/images/**/*.{png,jpg,jpeg,gif,webp,svg}', '!<%= yeoman.dist %>/images/glyphicons-*', '<%= yeoman.dist %>/styles/images/*.{gif,png}' ] } } }, useminPrepare: { html: '<%= yeoman.app %>/index.html', options: { dest: '<%= yeoman.dist %>' } }, usemin: { html: ['<%= yeoman.dist %>/*.html', '<%= yeoman.dist %>/views/**/*.html'], css: ['<%= yeoman.dist %>/styles/**/*.css'], options: { assetsDirs: ['<%= yeoman.dist %>/**'] } }, imagemin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.app %>', src: [ 'styles/images/*.{jpg,jpeg,svg,gif}', 'images/*.{jpg,jpeg,svg,gif}' ], dest: '<%= yeoman.dist %>' }] } }, tinypng: { options: { apiKey: "l_QIDgceoKGF8PBNRr3cmYy_Nhfa9F1p", checkSigs: true, sigFile: '<%= yeoman.app %>/images/tinypng_sigs.json', summarize: true, showProgress: true, stopOnImageError: true }, dist: { expand: true, cwd: '<%= yeoman.app %>', src: 'images/**/*.png', dest: '<%= yeoman.app %>' } }, htmlmin: { dist: { options: { removeComments: true, removeCommentsFromCDATA: true, removeCDATASectionsFromCDATA: true, collapseWhitespace: true, // conservativeCollapse: true, collapseBooleanAttributes: true, removeAttributeQuotes: false, removeRedundantAttributes: true, useShortDoctype: true, removeEmptyAttributes: true, removeOptionalTags: true, keepClosingSlash: true, }, files: [{ expand: true, cwd: '<%= yeoman.dist %>', src: [ '*.html', 'views/**/*.html', 'template/**/*.html' ], dest: '<%= yeoman.dist %>' }] } }, // Put files not handled in other tasks here copy: { dist: { files: [{ expand: true, dot: true, cwd: '<%= yeoman.app %>', dest: '<%= yeoman.dist %>', src: [ '*.{ico,png,txt}', '.htaccess', 'api/**', 'images/{,*/}*.{gif,webp}', 'resources/**', 'styles/fonts/*', 'styles/images/*', '*.html', 'views/**/*.html', 'template/**/*.html' ] }, { expand: true, cwd: '.tmp/images', dest: '<%= yeoman.dist %>/images', src: [ 'generated/*' ] }, { expand: true, cwd: '<%= yeoman.app %>/bower_components/angular-i18n', dest: '<%= yeoman.dist %>/resources/i18n/angular', src: [ '*en-us.js', '*es-es.js', '*ja-jp.js', '*ar-eg.js' ] }] }, styles: { expand: true, cwd: '<%= yeoman.app %>/styles', dest: '.tmp/styles', src: '**/*.css' }, i18n: { expand: true, cwd: '<%= yeoman.app %>/bower_components/angular-i18n', dest: '.tmp/resources/i18n/angular', src: [ '*en-us.js', '*es-es.js', '*ja-jp.js', '*ar-eg.js' ] }, fonts: { expand: true, cwd: '<%= yeoman.app %>/bower_components/bootstrap-sass-official/assets/fonts', dest: '.tmp/fonts', src: '**/*' }, png: { expand: true, cwd: '<%= yeoman.app %>', dest: '<%= yeoman.dist %>', src: 'images/**/*.png' } }, concurrent: { server: [ 'compass:server', 'copy:i18n', 'copy:fonts' ], dist: [ 'compass:dist', 'imagemin' ] }, karma: { unit: { configFile: '<%= yeoman.test %>/karma-unit.conf.js', autoWatch: false, singleRun: true }, unit_auto: { configFile: '<%= yeoman.test %>/karma-unit.conf.js' }, midway: { configFile: '<%= yeoman.test %>/karma-midway.conf.js', autoWatch: false, singleRun: true }, midway_auto: { configFile: '<%= yeoman.test %>/karma-midway.conf.js' }, e2e: { configFile: '<%= yeoman.test %>/karma-e2e.conf.js', autoWatch: false, singleRun: true }, e2e_auto: { configFile: '<%= yeoman.test %>/karma-e2e.conf.js' } }, cdnify: { dist: { html: ['<%= yeoman.dist %>/*.html'] } }, ngAnnotate: { dist: { files: [{ expand: true, cwd: '.tmp/concat/scripts', src: '*.js', dest: '.tmp/concat/scripts' }] } }, docular: { showDocularDocs: false, showAngularDocs: true, docular_webapp_target: "doc", groups: [ { groupTitle: 'Appverse HTML5', groupId: 'appverse', groupIcon: 'icon-beer', sections: [ { id: "commonapi", title: "Common API", showSource: true, scripts: ["app/scripts/api/modules", "app/scripts/api/directives" ], docs: ["ngdocs/commonapi"], rank: {} } ] }, { groupTitle: 'Angular jQM', groupId: 'angular-jqm', groupIcon: 'icon-mobile-phone', sections: [ { id: "jqmapi", title: "API", showSource: true, scripts: ["app/scripts/api/angular-jqm.js" ], docs: ["ngdocs/jqmapi"], rank: {} } ] } ] } }); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-karma'); grunt.loadNpmTasks('grunt-docular'); grunt.registerTask('server', [ 'clean:server', 'concurrent:server', 'autoprefixer', 'connect:livereload', 'open:server', 'watch' ]); grunt.registerTask('testserver', [ 'clean:server', 'concurrent:server', 'autoprefixer', 'connect:test' ]); grunt.registerTask('test', [ 'karma:unit', 'testserver', 'karma:midway', 'karma:e2e' ]); grunt.registerTask('test:midway', [ 'testserver', 'karma:midway_auto' ]); grunt.registerTask('test:e2e', [ 'testserver', 'karma:e2e_auto' ]); grunt.registerTask('devmode', [ 'karma:unit_auto' ]); grunt.registerTask('doc', [ 'docular', 'connect:doc', 'open:doc', 'watch:doc' ]); grunt.registerTask('dist', [ 'clean:dist', 'useminPrepare', 'concurrent:dist', 'tinypng', 'copy:png', 'autoprefixer', 'concat', 'copy:dist', 'cdnify', 'ngAnnotate', 'cssmin', 'uglify', 'rev', 'usemin', 'htmlmin', 'connect:dist', // 'docular', // 'connect:doc', 'open:server', // 'open:doc', 'watch' ]); grunt.registerTask('default', [ 'server' ]); };
Java
#!/usr/bin/execlineb -P with-contenv s6-envuidgid www-data foreground { if { s6-test -n $WP_RESET } foreground { ln -s /resetter /public/resetter } foreground { chmod +x /public/resetter/*.sh } } # if [[ $(echo $ROOT_DOMAIN | grep "cyberspaced" | wc -c) > 0 ]]; then # cd /app/website/scripts/ # chmod +x *.sh # fi
Java
#include <stdio.h> int main(int argc, char const *argv[]) { //COQ=customer order quantity, COQV=COQ value, SV= Stock value int COQ,COQV,Credit,SV; if ((COQ<SV)&&(Credit>=COQV)) { printf("Supply successfull\n"); } else if ((COQ<SV)&&(Credit<COQV)) { /* code */ printf("Amount given is less than value of stock supplied."); } else if((COQ>SV)&&(Credit>=COQV)){ printf("Whatever in stock is given. Remaining balance would be returned in two days.\n"); } }
Java
//Copyright (c) 2017 Finjin // //This file is part of Finjin Engine (finjin-engine). // //Finjin Engine 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. // //This Source Code Form is subject to the terms of the Mozilla Public //License, v. 2.0. If a copy of the MPL was not distributed with this //file, You can obtain one at http://mozilla.org/MPL/2.0/. #pragma once //Includes---------------------------------------------------------------------- #include "finjin/engine/GenericInputDevice.hpp" //Types------------------------------------------------------------------------- namespace Finjin { namespace Engine { using namespace Finjin::Common; class WindowsUWPInputContext; } }
Java
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the 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 * http://www.mozilla.org/MPL/ * * 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 Mozilla JavaScript Shell project. * * The Initial Developer of the Original Code is * Alex Fritze. * Portions created by the Initial Developer are Copyright (C) 2003 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Alex Fritze <alex@croczilla.com> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #ifndef __NS_JSSHSERVER_H__ #define __NS_JSSHSERVER_H__ #include "nsIJSShServer.h" #include "nsCOMPtr.h" #include "nsIServerSocket.h" #include "nsStringAPI.h" class nsJSShServer : public nsIJSShServer { public: NS_DECL_ISUPPORTS NS_DECL_NSIJSSHSERVER nsJSShServer(); ~nsJSShServer(); private: nsCOMPtr<nsIServerSocket> mServerSocket; PRUint32 mServerPort; nsCString mServerStartupURI; PRBool mServerLoopbackOnly; }; #endif // __NS_JSSHSERVER_H__
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html data-context="Build Apps" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>legato - Legato Docs</title> <meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/> <meta content="legato, iot" name="keywords"/> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/> <meta content="19.11.6" name="legato-version"/> <link href="resources/images/legato.ico" rel="shortcut icon"/> <link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/> <link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/> <link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/> <!--[if IE]> <script src="resources/js/html5shiv.js"></script> <script src="resources/js/respond.js"></script> <![endif]--> <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script> <script src="resources/js/main.js"></script> <script src="tocs/Build_Apps_Tools.json"></script> </head> <body> <noscript> <input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/> <div id="nojs"> <label for="modal-closing-trick"> <span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span> </label> </div> </noscript> <div class="wrapper"> <div class="fa fa-bars documentation" id="menu-trigger"></div> <div id="top"> <header> <nav> <a class="navlink" href="/">Introduction</a><a class="navlink selected" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink" href="aboutMain.html">About</a> </nav> </header> </div> <div class="white" id="menudocumentation"> <header> <a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a> <h2>/ Build Apps</h2> <nav class="secondary"> <a href="getStarted.html">Get Started</a><a href="concepts.html">Concepts</a><a href="apiGuidesMain.html">API Guides</a><a class="link-selected" href="tools.html">Tools</a><a href="howToMain.html">How To</a><a href="experimentalMain.html">Experimental Features</a> </nav> <nav class="ui-front"> <i class="fa fa-search" id="search-icon"></i> <input id="searchbox" placeholder="Search"/> </nav> </header> </div> <div id="resizable"> <div id="left"> <div id="tree1"></div> </div> </div> <div class="content"> <div class="header"> <div class="headertitle"> <h1 class="title">legato </h1> </div> </div><div class="contents"> <div class="textblock"><p>Use the <code>legato</code> tool to control the Legato Application Framework.</p> <h1>Usage</h1> <p><b><code> legato [start|stop|restart|status|version|help]</code></b></p> <pre class="fragment">legato start </pre><blockquote class="doxtable"> <p>Starts the Legato Application Framework. </p> </blockquote> <pre class="fragment">legato stop </pre><blockquote class="doxtable"> <p>Stops the Legato Application Framework. </p> </blockquote> <pre class="fragment">legato restart </pre><blockquote class="doxtable"> <p>Restarts the Legato Application Framework. </p> </blockquote> <pre class="fragment">legato status </pre><blockquote class="doxtable"> <p>Displays the current running state (started, stopped), system state (good, bad, probation) and </p> </blockquote> <p>system index of Legato.</p> <pre class="fragment">legato version </pre><blockquote class="doxtable"> <p>Displays the current installed version. </p> </blockquote> <pre class="fragment">legato help </pre><blockquote class="doxtable"> <p>Displays usage help. </p> </blockquote> <hr/> <p class="copyright">Copyright (C) Sierra Wireless Inc. </p> </div></div> <br clear="left"/> </div> </div> <link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/> <script src="resources/js/tree.jquery.js" type="text/javascript"></script> <script src="resources/js/jquery.cookie.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/> <script src="resources/js/perfect-scrollbar.jquery.min.js"></script> </body> </html>
Java
# frozen_string_literal: true # Setup used to generate email message class ApplicationMailer < ActionMailer::Base default from: "noreply@smoothiefunds.com" layout "mailer" end
Java
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Resource.Storage.Objects.Update -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Updates an object\'s metadata. -- -- /See:/ <https://developers.google.com/storage/docs/json_api/ Cloud Storage JSON API Reference> for @storage.objects.update@. module Network.Google.Resource.Storage.Objects.Update ( -- * REST Resource ObjectsUpdateResource -- * Creating a Request , objectsUpdate , ObjectsUpdate -- * Request Lenses , ouIfMetagenerationMatch , ouIfGenerationNotMatch , ouIfGenerationMatch , ouPredefinedACL , ouBucket , ouPayload , ouUserProject , ouIfMetagenerationNotMatch , ouObject , ouProjection , ouProvisionalUserProject , ouGeneration ) where import Network.Google.Prelude import Network.Google.Storage.Types -- | A resource alias for @storage.objects.update@ method which the -- 'ObjectsUpdate' request conforms to. type ObjectsUpdateResource = "storage" :> "v1" :> "b" :> Capture "bucket" Text :> "o" :> Capture "object" Text :> QueryParam "ifMetagenerationMatch" (Textual Int64) :> QueryParam "ifGenerationNotMatch" (Textual Int64) :> QueryParam "ifGenerationMatch" (Textual Int64) :> QueryParam "predefinedAcl" ObjectsUpdatePredefinedACL :> QueryParam "userProject" Text :> QueryParam "ifMetagenerationNotMatch" (Textual Int64) :> QueryParam "projection" ObjectsUpdateProjection :> QueryParam "provisionalUserProject" Text :> QueryParam "generation" (Textual Int64) :> QueryParam "alt" AltJSON :> ReqBody '[JSON] Object :> Put '[JSON] Object -- | Updates an object\'s metadata. -- -- /See:/ 'objectsUpdate' smart constructor. data ObjectsUpdate = ObjectsUpdate' { _ouIfMetagenerationMatch :: !(Maybe (Textual Int64)) , _ouIfGenerationNotMatch :: !(Maybe (Textual Int64)) , _ouIfGenerationMatch :: !(Maybe (Textual Int64)) , _ouPredefinedACL :: !(Maybe ObjectsUpdatePredefinedACL) , _ouBucket :: !Text , _ouPayload :: !Object , _ouUserProject :: !(Maybe Text) , _ouIfMetagenerationNotMatch :: !(Maybe (Textual Int64)) , _ouObject :: !Text , _ouProjection :: !(Maybe ObjectsUpdateProjection) , _ouProvisionalUserProject :: !(Maybe Text) , _ouGeneration :: !(Maybe (Textual Int64)) } deriving (Eq, Show, Data, Typeable, Generic) -- | Creates a value of 'ObjectsUpdate' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ouIfMetagenerationMatch' -- -- * 'ouIfGenerationNotMatch' -- -- * 'ouIfGenerationMatch' -- -- * 'ouPredefinedACL' -- -- * 'ouBucket' -- -- * 'ouPayload' -- -- * 'ouUserProject' -- -- * 'ouIfMetagenerationNotMatch' -- -- * 'ouObject' -- -- * 'ouProjection' -- -- * 'ouProvisionalUserProject' -- -- * 'ouGeneration' objectsUpdate :: Text -- ^ 'ouBucket' -> Object -- ^ 'ouPayload' -> Text -- ^ 'ouObject' -> ObjectsUpdate objectsUpdate pOuBucket_ pOuPayload_ pOuObject_ = ObjectsUpdate' { _ouIfMetagenerationMatch = Nothing , _ouIfGenerationNotMatch = Nothing , _ouIfGenerationMatch = Nothing , _ouPredefinedACL = Nothing , _ouBucket = pOuBucket_ , _ouPayload = pOuPayload_ , _ouUserProject = Nothing , _ouIfMetagenerationNotMatch = Nothing , _ouObject = pOuObject_ , _ouProjection = Nothing , _ouProvisionalUserProject = Nothing , _ouGeneration = Nothing } -- | Makes the operation conditional on whether the object\'s current -- metageneration matches the given value. ouIfMetagenerationMatch :: Lens' ObjectsUpdate (Maybe Int64) ouIfMetagenerationMatch = lens _ouIfMetagenerationMatch (\ s a -> s{_ouIfMetagenerationMatch = a}) . mapping _Coerce -- | Makes the operation conditional on whether the object\'s current -- generation does not match the given value. If no live object exists, the -- precondition fails. Setting to 0 makes the operation succeed only if -- there is a live version of the object. ouIfGenerationNotMatch :: Lens' ObjectsUpdate (Maybe Int64) ouIfGenerationNotMatch = lens _ouIfGenerationNotMatch (\ s a -> s{_ouIfGenerationNotMatch = a}) . mapping _Coerce -- | Makes the operation conditional on whether the object\'s current -- generation matches the given value. Setting to 0 makes the operation -- succeed only if there are no live versions of the object. ouIfGenerationMatch :: Lens' ObjectsUpdate (Maybe Int64) ouIfGenerationMatch = lens _ouIfGenerationMatch (\ s a -> s{_ouIfGenerationMatch = a}) . mapping _Coerce -- | Apply a predefined set of access controls to this object. ouPredefinedACL :: Lens' ObjectsUpdate (Maybe ObjectsUpdatePredefinedACL) ouPredefinedACL = lens _ouPredefinedACL (\ s a -> s{_ouPredefinedACL = a}) -- | Name of the bucket in which the object resides. ouBucket :: Lens' ObjectsUpdate Text ouBucket = lens _ouBucket (\ s a -> s{_ouBucket = a}) -- | Multipart request metadata. ouPayload :: Lens' ObjectsUpdate Object ouPayload = lens _ouPayload (\ s a -> s{_ouPayload = a}) -- | The project to be billed for this request. Required for Requester Pays -- buckets. ouUserProject :: Lens' ObjectsUpdate (Maybe Text) ouUserProject = lens _ouUserProject (\ s a -> s{_ouUserProject = a}) -- | Makes the operation conditional on whether the object\'s current -- metageneration does not match the given value. ouIfMetagenerationNotMatch :: Lens' ObjectsUpdate (Maybe Int64) ouIfMetagenerationNotMatch = lens _ouIfMetagenerationNotMatch (\ s a -> s{_ouIfMetagenerationNotMatch = a}) . mapping _Coerce -- | Name of the object. For information about how to URL encode object names -- to be path safe, see Encoding URI Path Parts. ouObject :: Lens' ObjectsUpdate Text ouObject = lens _ouObject (\ s a -> s{_ouObject = a}) -- | Set of properties to return. Defaults to full. ouProjection :: Lens' ObjectsUpdate (Maybe ObjectsUpdateProjection) ouProjection = lens _ouProjection (\ s a -> s{_ouProjection = a}) -- | The project to be billed for this request if the target bucket is -- requester-pays bucket. ouProvisionalUserProject :: Lens' ObjectsUpdate (Maybe Text) ouProvisionalUserProject = lens _ouProvisionalUserProject (\ s a -> s{_ouProvisionalUserProject = a}) -- | If present, selects a specific revision of this object (as opposed to -- the latest version, the default). ouGeneration :: Lens' ObjectsUpdate (Maybe Int64) ouGeneration = lens _ouGeneration (\ s a -> s{_ouGeneration = a}) . mapping _Coerce instance GoogleRequest ObjectsUpdate where type Rs ObjectsUpdate = Object type Scopes ObjectsUpdate = '["https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.full_control"] requestClient ObjectsUpdate'{..} = go _ouBucket _ouObject _ouIfMetagenerationMatch _ouIfGenerationNotMatch _ouIfGenerationMatch _ouPredefinedACL _ouUserProject _ouIfMetagenerationNotMatch _ouProjection _ouProvisionalUserProject _ouGeneration (Just AltJSON) _ouPayload storageService where go = buildClient (Proxy :: Proxy ObjectsUpdateResource) mempty
Java
/* Copyright (C) 2015 haha01haha01 * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace HaJS { public partial class MainForm : Form { public MainForm() { InitializeComponent(); } private void ofdBox_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog() { Filter = "XML Files|*.xml" }; if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; ((TextBox)sender).Text = ofd.FileName; } private void button1_Click(object sender, EventArgs e) { if (serverConfigPathBox.Text == "" || inputXmlBox.Text == "") return; HaJSCompiler jsc = new HaJSCompiler(serverConfigPathBox.Text); string outPath = Path.Combine(Path.GetDirectoryName(inputXmlBox.Text), Path.GetFileNameWithoutExtension(inputXmlBox.Text) + ".js"); #if !DEBUG try { #endif jsc.Compile(inputXmlBox.Text, outPath); MessageBox.Show("Finished compiling to " + outPath); #if !DEBUG } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } #endif } private void button2_Click(object sender, EventArgs e) { if (serverConfigPathBox.Text == "" || inputXmlBox.Text == "") return; HaJSCompiler jsc = new HaJSCompiler(serverConfigPathBox.Text); string folder = Path.GetDirectoryName(inputXmlBox.Text); foreach (FileInfo fi in new DirectoryInfo(folder).GetFiles()) { if (fi.Extension.ToLower() == ".xml") { #if !DEBUG try { #endif jsc.Compile(fi.FullName, Path.Combine(folder, Path.GetFileNameWithoutExtension(fi.FullName) + ".js")); #if !DEBUG } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } #endif } } MessageBox.Show("Finished compiling " + folder); } } }
Java
/* * Copyright © 2013-2019, The SeedStack authors <http://seedstack.org> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.seedstack.seed.core.internal.configuration.tool; import com.google.common.base.Strings; import java.io.PrintStream; import org.fusesource.jansi.Ansi; import org.seedstack.shed.text.TextWrapper; class DetailPrinter { private static final TextWrapper textWrapper = new TextWrapper(120); private final PropertyInfo propertyInfo; DetailPrinter(PropertyInfo propertyInfo) { this.propertyInfo = propertyInfo; } void printDetail(PrintStream stream) { Ansi ansi = Ansi.ansi(); String title = "Details of " + propertyInfo.getName(); ansi .a(title) .newline() .a(Strings.repeat("-", title.length())) .newline().newline(); printSummary(propertyInfo, ansi); printDeclaration(propertyInfo, ansi); printLongDescription(propertyInfo, ansi); printAdditionalInfo(propertyInfo, ansi); ansi.newline(); stream.print(ansi.toString()); } private Ansi printSummary(PropertyInfo propertyInfo, Ansi ansi) { return ansi.a(propertyInfo.getShortDescription()).newline(); } private void printDeclaration(PropertyInfo propertyInfo, Ansi ansi) { ansi .newline() .a(" ") .fgBright(Ansi.Color.MAGENTA) .a(propertyInfo.getType()) .reset() .a(" ") .fgBright(Ansi.Color.BLUE) .a(propertyInfo.getName()) .reset(); Object defaultValue = propertyInfo.getDefaultValue(); if (defaultValue != null) { ansi .a(" = ") .fgBright(Ansi.Color.GREEN) .a(String.valueOf(defaultValue)) .reset(); } ansi .a(";") .newline(); } private void printLongDescription(PropertyInfo propertyInfo, Ansi ansi) { String longDescription = propertyInfo.getLongDescription(); if (longDescription != null) { ansi.newline().a(textWrapper.wrap(longDescription)).newline(); } } private void printAdditionalInfo(PropertyInfo propertyInfo, Ansi ansi) { if (propertyInfo.isMandatory() || propertyInfo.isSingleValue()) { ansi.newline(); } if (propertyInfo.isMandatory()) { ansi.a("* This property is mandatory.").newline(); } if (propertyInfo.isSingleValue()) { ansi.a("* This property is the default property of its declaring object").newline(); } } }
Java
--- layout: "cf" page_title: "Cloud Foundry: cf_service_access" sidebar_current: "docs-cf-resource-service-access" description: |- Provides a Cloud Foundry Service Access resource. --- # cf\_service\_access Provides a Cloud Foundry resource for managing [access](https://docs.cloudfoundry.org/services/access-control.html) to service plans published by Cloud Foundry [service brokers](https://docs.cloudfoundry.org/services/). ## Example Usage The following example enables access to a specific plan of a given service broker within an Org. ``` resource "cf_service_access" "org1-mysql-512mb" { plan = "${cf_service_broker.mysql.service_plans["p-mysql/512mb"]}" org = "${cf_org.org1.id}" } ``` ## Argument Reference The following arguments are supported: * `plan` - (Required) The ID of the service plan to grant access to * `org` - (Required) The ID of the Org which should have access to the plan
Java
const html = require('choo/html'); module.exports = function(name, url) { const dialog = function(state, emit, close) { return html` <send-share-dialog class="flex flex-col items-center text-center p-4 max-w-sm m-auto" > <h1 class="text-3xl font-bold my-4"> ${state.translate('notifyUploadEncryptDone')} </h1> <p class="font-normal leading-normal text-grey-80 dark:text-grey-40"> ${state.translate('shareLinkDescription')}<br /> <span class="word-break-all">${name}</span> </p> <input type="text" id="share-url" class="w-full my-4 border rounded-lg leading-loose h-12 px-2 py-1 dark:bg-grey-80" value="${url}" readonly="true" /> <button class="btn rounded-lg w-full flex-shrink-0 focus:outline" onclick="${share}" title="${state.translate('shareLinkButton')}" > ${state.translate('shareLinkButton')} </button> <button class="link-blue my-4 font-medium cursor-pointer focus:outline" onclick="${close}" title="${state.translate('okButton')}" > ${state.translate('okButton')} </button> </send-share-dialog> `; async function share(event) { event.stopPropagation(); try { await navigator.share({ title: state.translate('-send-brand'), text: state.translate('shareMessage', { name }), url }); } catch (e) { if (e.code === e.ABORT_ERR) { return; } console.error(e); } close(); } }; dialog.type = 'share'; return dialog; };
Java
#ifndef PLASTIQQACCESSIBLESTATECHANGEEVENT_H #define PLASTIQQACCESSIBLESTATECHANGEEVENT_H #include "plastiqobject.h" class PlastiQQAccessibleStateChangeEvent : public PlastiQObject { PLASTIQ_OBJECT(IsQEvent,QAccessibleStateChangeEvent,QAccessibleEvent) PLASTIQ_INHERITS(QAccessibleEvent) public: ~PlastiQQAccessibleStateChangeEvent(); }; #endif // PLASTIQQACCESSIBLESTATECHANGEEVENT_H
Java
using System; using System.Collections.Generic; using System.IO; using System.Windows.Input; using System.Threading; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.GamerServices; namespace Sims2Online.UI.Elements { class UIButton : UIControl { MouseState oldMouseState; KeyboardState oldKBState; Vector2 selected; Texture2D backtex; public string text; public Color color = Color.White; public event EventHandler onClicked; public event EventHandler onHover; public event EventHandler onMouseLeft; public float scale; public override void Init(SpriteBatch spb) { selected = Vector2.Zero; using (var stream1 = new FileStream("./content/colour.png", FileMode.Open)) { backtex = Texture2D.FromStream(spb.GraphicsDevice, stream1); } } public override void Update(SpriteBatch spb, S2OGame game) { spb.Draw(backtex, rect, Color.Black * 0.25f); var currentMouseState = Mouse.GetState(); var currentKBState = Keyboard.GetState(); if (rect.Contains(new Point(currentMouseState.X, currentMouseState.Y)) && currentMouseState.LeftButton == ButtonState.Pressed) { this.onClicked?.Invoke(this, EventArgs.Empty); } else if (rect.Contains(new Point(currentMouseState.X, currentMouseState.Y))) { this.onHover?.Invoke(this, EventArgs.Empty); } else { this.onMouseLeft?.Invoke(this, EventArgs.Empty); } spb.DrawString(S2OGame.Font1, text, new Vector2(rect.X + ((rect.Width / 2) - ((S2OGame.Font1.MeasureString(text) * scale).X / 2)), rect.Y + ((rect.Height / 2) - ((S2OGame.Font1.MeasureString(text) * scale).Y / 2))), color, 0, Vector2.Zero, scale, SpriteEffects.None, 0.5f); oldMouseState = currentMouseState; oldKBState = currentKBState; } } }
Java
billing ======= billing
Java
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Resource.Analytics.Management.WebProperties.Update -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Updates an existing web property. -- -- /See:/ <https://developers.google.com/analytics/ Google Analytics API Reference> for @analytics.management.webproperties.update@. module Network.Google.Resource.Analytics.Management.WebProperties.Update ( -- * REST Resource ManagementWebPropertiesUpdateResource -- * Creating a Request , managementWebPropertiesUpdate , ManagementWebPropertiesUpdate -- * Request Lenses , mwpuWebPropertyId , mwpuPayload , mwpuAccountId ) where import Network.Google.Analytics.Types import Network.Google.Prelude -- | A resource alias for @analytics.management.webproperties.update@ method which the -- 'ManagementWebPropertiesUpdate' request conforms to. type ManagementWebPropertiesUpdateResource = "analytics" :> "v3" :> "management" :> "accounts" :> Capture "accountId" Text :> "webproperties" :> Capture "webPropertyId" Text :> QueryParam "alt" AltJSON :> ReqBody '[JSON] WebProperty :> Put '[JSON] WebProperty -- | Updates an existing web property. -- -- /See:/ 'managementWebPropertiesUpdate' smart constructor. data ManagementWebPropertiesUpdate = ManagementWebPropertiesUpdate' { _mwpuWebPropertyId :: !Text , _mwpuPayload :: !WebProperty , _mwpuAccountId :: !Text } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'ManagementWebPropertiesUpdate' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'mwpuWebPropertyId' -- -- * 'mwpuPayload' -- -- * 'mwpuAccountId' managementWebPropertiesUpdate :: Text -- ^ 'mwpuWebPropertyId' -> WebProperty -- ^ 'mwpuPayload' -> Text -- ^ 'mwpuAccountId' -> ManagementWebPropertiesUpdate managementWebPropertiesUpdate pMwpuWebPropertyId_ pMwpuPayload_ pMwpuAccountId_ = ManagementWebPropertiesUpdate' { _mwpuWebPropertyId = pMwpuWebPropertyId_ , _mwpuPayload = pMwpuPayload_ , _mwpuAccountId = pMwpuAccountId_ } -- | Web property ID mwpuWebPropertyId :: Lens' ManagementWebPropertiesUpdate Text mwpuWebPropertyId = lens _mwpuWebPropertyId (\ s a -> s{_mwpuWebPropertyId = a}) -- | Multipart request metadata. mwpuPayload :: Lens' ManagementWebPropertiesUpdate WebProperty mwpuPayload = lens _mwpuPayload (\ s a -> s{_mwpuPayload = a}) -- | Account ID to which the web property belongs mwpuAccountId :: Lens' ManagementWebPropertiesUpdate Text mwpuAccountId = lens _mwpuAccountId (\ s a -> s{_mwpuAccountId = a}) instance GoogleRequest ManagementWebPropertiesUpdate where type Rs ManagementWebPropertiesUpdate = WebProperty type Scopes ManagementWebPropertiesUpdate = '["https://www.googleapis.com/auth/analytics.edit"] requestClient ManagementWebPropertiesUpdate'{..} = go _mwpuAccountId _mwpuWebPropertyId (Just AltJSON) _mwpuPayload analyticsService where go = buildClient (Proxy :: Proxy ManagementWebPropertiesUpdateResource) mempty
Java
<?php namespace ide\formats\form\elements; use ide\editors\value\BooleanPropertyEditor; use ide\editors\value\ColorPropertyEditor; use ide\editors\value\FontPropertyEditor; use ide\editors\value\IntegerPropertyEditor; use ide\editors\value\PositionPropertyEditor; use ide\editors\value\SimpleTextPropertyEditor; use ide\editors\value\TextPropertyEditor; use ide\formats\form\AbstractFormElement; use php\gui\designer\UXDesignProperties; use php\gui\designer\UXDesignPropertyEditor; use php\gui\layout\UXAnchorPane; use php\gui\layout\UXHBox; use php\gui\layout\UXPanel; use php\gui\UXButton; use php\gui\UXNode; use php\gui\UXTableCell; use php\gui\UXTextField; use php\gui\UXTitledPane; /** * Class ButtonFormElement * @package ide\formats\form */ class PanelFormElement extends AbstractFormElement { public function getGroup() { return 'Панели'; } public function getElementClass() { return UXPanel::class; } public function getName() { return 'Панель'; } public function getIcon() { return 'icons/panel16.png'; } public function getIdPattern() { return "panel%s"; } public function isLayout() { return true; } public function addToLayout($self, $node, $screenX = null, $screenY = null) { /** @var UXPanel $self */ $node->position = $self->screenToLocal($screenX, $screenY); $self->add($node); } public function getLayoutChildren($layout) { $children = flow($layout->children) ->find(function (UXNode $it) { return !$it->classes->has('x-system-element'); }) ->toArray(); return $children; } /** * @return UXNode */ public function createElement() { $button = new UXPanel(); $button->backgroundColor = 'white'; return $button; } public function getDefaultSize() { return [150, 100]; } public function isOrigin($any) { return get_class($any) == UXPanel::class; } }
Java
<HTML> <HEAD> <TITLE>HPL_ptimer_walltime HPL 2.1 Library Functions October 26, 2012</TITLE> </HEAD> <BODY BGCOLOR="WHITE" TEXT = "#000000" LINK = "#0000ff" VLINK = "#000099" ALINK = "#ffff00"> <H1>Name</H1> <B>HPL_ptimer_walltime</B> Return the elapsed (wall-clock) time. <H1>Synopsis</H1> <CODE>#include "hpl.h"</CODE><BR><BR> <CODE>double</CODE> <CODE>HPL_ptimer_walltime();</CODE> <H1>Description</H1> <B>HPL_ptimer_walltime</B> returns the elapsed (wall-clock) time. <H1>See Also</H1> <A HREF="HPL_ptimer_cputime.html">HPL_ptimer_cputime</A>, <A HREF="HPL_ptimer.html">HPL_ptimer</A>. </BODY> </HTML>
Java
package com.storage.mywarehouse.Dao; import com.storage.mywarehouse.View.WarehouseProduct; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Restrictions; import java.util.List; public class WarehouseProductDAO { @SuppressWarnings("unchecked") public static List<WarehouseProduct> findById(int id) { Session session = NewHibernateUtil.getSessionFactory().openSession(); Transaction tx = session.beginTransaction(); List products = session.createCriteria(WarehouseProduct.class) .add(Restrictions.eq("productId", id)) .list(); tx.commit(); session.close(); return products; } @SuppressWarnings("unchecked") public static List<WarehouseProduct> findByQuantity(int quantity) { Session session = NewHibernateUtil.getSessionFactory().openSession(); Transaction tx = session.beginTransaction(); List emptyWarehouseProduct = session.createCriteria(WarehouseProduct.class) .add(Restrictions.eq("quantity", quantity)) .list(); tx.commit(); session.close(); return emptyWarehouseProduct; } @SuppressWarnings("unchecked") public static List<WarehouseProduct> findByParam(String param, String value) { Session session = NewHibernateUtil.getSessionFactory().openSession(); Transaction tx = session.beginTransaction(); List products = session.createCriteria(WarehouseProduct.class) .add(Restrictions.eq(param.toLowerCase(), value)) .list(); tx.commit(); session.close(); return products; } @SuppressWarnings("unchecked") public static List<WarehouseProduct> findByParamContainingValue(String param, String value) { Session session = NewHibernateUtil.getSessionFactory().openSession(); Transaction tx = session.beginTransaction(); List products = session.createCriteria(WarehouseProduct.class) .add(Restrictions.like(param.toLowerCase(), "%" + value + "%")) .list(); tx.commit(); session.close(); return products; } }
Java
![Sozi logo](sozi-logo-bg.png) This is the JavaScript API documentation for Sozi. Additional information about the Sozi project can be found at: * [The main web site for Sozi, with the user manual and tutorials](https://sozi.baierouge.fr) * [The source code repository at GitHub](https://github.com/sozi-projects/Sozi)
Java
# gsd Getting stuff done - more vapourware, this time with shiny new tech ## TL;DR Playing around with shiny new tech by creating a web app for following the [Getting Things Done](https://hamberg.no/gtd/) organisational framework. ## What's this all about? I want to play with a whole bunch of shiny(ish), new(ish) tech and methodologies. I intend to do this by building a vapourware web app to help follow the [Getting Things Done](https://hamberg.no/gtd/) organisational framework. To this end this project will hopefully/kinda/sorta do some of the following: * Built using Clojure * Use BDD to specify the application using plain English * Cucumber * Property based testing * test.check * Use mobile first, responsive web design * Isomorphic web app using Om Next and the Nashorn javascript engine * Continuous deployment ## Contributing Should you ever find this project useful and feel the urge to contribute something back this project follows the [latest C4 process](http://rfc.zeromq.org/spec:42/C4/) for contributions. ## Style guide Code should be formatted as defaulted to by the [Cursive](https://cursive-ide.com/) Intellij plugin. ## License This project uses the [MPLv2](https://www.mozilla.org/en-US/MPL/2.0/).
Java
package iso import ( "fmt" "github.com/mitchellh/multistep" vmwcommon "github.com/mitchellh/packer/builder/vmware/common" "github.com/mitchellh/packer/packer" "log" ) // stepRemoteUpload uploads some thing from the state bag to a remote driver // (if it can) and stores that new remote path into the state bag. type stepRemoteUpload struct { Key string Message string } func (s *stepRemoteUpload) Run(state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(vmwcommon.Driver) ui := state.Get("ui").(packer.Ui) remote, ok := driver.(RemoteDriver) if !ok { return multistep.ActionContinue } path, ok := state.Get(s.Key).(string) if !ok { return multistep.ActionContinue } ui.Say(s.Message) log.Printf("Remote uploading: %s", path) newPath, err := remote.UploadISO(path) if err != nil { err := fmt.Errorf("Error uploading file: %s", err) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } state.Put(s.Key, newPath) return multistep.ActionContinue } func (s *stepRemoteUpload) Cleanup(state multistep.StateBag) { }
Java
package app.intelehealth.client.models.pushRequestApiCall; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.List; public class Person { @SerializedName("uuid") @Expose private String uuid; @SerializedName("gender") @Expose private String gender; @SerializedName("names") @Expose private List<Name> names = null; @SerializedName("birthdate") @Expose private String birthdate; @SerializedName("attributes") @Expose private List<Attribute> attributes = null; @SerializedName("addresses") @Expose private List<Address> addresses = null; public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public List<Name> getNames() { return names; } public void setNames(List<Name> names) { this.names = names; } public String getBirthdate() { return birthdate; } public void setBirthdate(String birthdate) { this.birthdate = birthdate; } public List<Attribute> getAttributes() { return attributes; } public void setAttributes(List<Attribute> attributes) { this.attributes = attributes; } public List<Address> getAddresses() { return addresses; } public void setAddresses(List<Address> addresses) { this.addresses = addresses; } }
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `XK_F1` constant in crate `x11`."> <meta name="keywords" content="rust, rustlang, rust-lang, XK_F1"> <title>x11::keysym::XK_F1 - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>x11</a>::<wbr><a href='index.html'>keysym</a></p><script>window.sidebarCurrent = {name: 'XK_F1', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>x11</a>::<wbr><a href='index.html'>keysym</a>::<wbr><a class='constant' href=''>XK_F1</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-1174' class='srclink' href='../../src/x11/keysym.rs.html#100' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const XK_F1: <a class='type' href='../../libc/types/os/arch/c95/type.c_uint.html' title='libc::types::os::arch::c95::c_uint'>c_uint</a><code> = </code><code>0xFFBE</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "x11"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
Java
{# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. #} {% extends "firefox/base/base-protocol.html" %} {% from "macros-protocol.html" import split, card with context %} {% block page_title %}{{ ftl('firefox-products-are') }}{% endblock %} {% block page_desc %}{{ ftl('learn-more-about') }}{% endblock %} {% block page_css %} {{ css_bundle('more') }} {% endblock %} {% block content %} <main> {% call split( image_url='img/firefox/privacy/promise/privacy-hero.png', include_highres_image=True, block_class='page-hero mzp-l-split-hide-media-on-sm-md mzp-t-split-nospace', theme_class='mzp-t-dark', media_class='mzp-l-split-v-end' ) %} <h2>{{ ftl('learn-more-about-firefox', fallback='firefox-products-are') }}</h2> <p><a href="{{ url('firefox.faq') }}" class="mzp-c-button mzp-t-product">{{ ftl('learn-more-faq') }}</a></p> {% endcall %} <div class="mzp-l-content"> <div class="mzp-l-card-quarter"> {{ card( title=ftl('firefox-fights-for'), ga_title='Firefox Windows', image_url='img/firefox/more/firefox-windows.jpg', desc=ftl('easy-migration-of'), link_url=url('firefox.windows') )}} {{ card( title=ftl('firefox-respects-your'), ga_title='Firefox Mac', image_url='img/firefox/more/firefox-mac.jpg', desc=ftl('firefox-doesnt-spy'), link_url=url('firefox.mac') )}} {{ card( title=ftl('firefox-for-linux'), ga_title='Firefox Linux', image_url='img/firefox/more/firefox-linux.jpg', desc=ftl('new-school-meets'), link_url=url('firefox.linux') )}} {{ card( title=ftl('firefox-for-windows'), ga_title='Firefox Win 64', image_url='img/firefox/more/firefox-64-bit.jpg', desc=ftl('we-worry-about'), link_url=url('firefox.browsers.windows-64-bit') )}} </div> <div class="mzp-l-card-third"> {{ card( title=ftl('the-history-of'), ga_title='Browser History', image_url='img/firefox/more/browser-history.jpg', desc=ftl('firefox-has-been'), link_url=url('firefox.browsers.browser-history') )}} {{ card( title=ftl('what-is-a'), ga_title='What is a browser', image_url='img/firefox/more/what-is-a-browser.jpg', desc=ftl('a-web-browser'), link_url=url('firefox.browsers.what-is-a-browser') )}} {{ card( title=ftl('update-your-browser'), ga_title='Update Browser', image_url='img/firefox/more/update-browser.jpg', desc=ftl('the-firefox-browser'), link_url=url('firefox.browsers.update-browser') )}} </div> <div class="mzp-l-card-third"> {{ card( title=ftl('choose-which-firefox'), ga_title='Firefox All', image_url='img/firefox/more/firefox-all.jpg', desc=ftl('we-believe-everyone'), link_url=url('firefox.all') )}} {{ card( title=ftl('firefox-more-firefox-chromebook'), ga_title='Firefox Products', image_url='img/firefox/more/firefox-chromebook.jpg', desc=ftl('firefox-more-while-on-chromebook'), link_url=url('firefox.browsers.chromebook') )}} {{ card( title=ftl('firefox-more-firefox-quantum'), ga_title='Firefox Browsers', image_url='img/firefox/more/firefox-quantum.jpg', desc=ftl('firefox-more-quantum-was-revolution'), link_url=url('firefox.browsers.quantum') )}} </div> <div class="mzp-l-card-third"> {{ card( title=ftl('firefox-rebel-with'), ga_title="Independent", image_url='img/firefox/more/independent.jpg', desc= ftl('firefox-is-independent'), link_url=url('firefox.features.independent') )}} {{ card( title=ftl('firefox-more-little-book'), ga_title='Features Private Browsing', image_url='img/firefox/more/little-book-of-privacy.jpg', desc= ftl('firefox-more-you-can-reclaim'), link_url=url('firefox.privacy.book') )}} {{ card( title=ftl('incognito-browser-what'), ga_title='Features Private Browsing', image_url='img/firefox/more/incognito-browser.jpg', desc=ftl('firefox-calls-it'), link_url=url('firefox.browsers.incognito-browser') )}} </div> <div class="mzp-l-card-quarter"> {{ card( title=ftl('the-ad-blocker'), ga_title='Featires Adblocker', image_url='img/firefox/more/firefox-adblocker.jpg', desc=ftl('so-many-ads'), link_url=url('firefox.features.adblocker') )}} {{ card( title=ftl('firefox-more-protection'), ga_title='Features Private Browsing', image_url='img/firefox/more/private-browsing.jpg', desc=ftl('were-obsessed-with'), link_url=url('firefox.features.private-browsing') )}} {{ card( title=ftl('take-the-stress'), ga_title='Features Safe Browser', image_url='img/firefox/more/safe-browser.jpg', desc=ftl('building-a-safe'), link_url=url('firefox.features.safebrowser') )}} {{ card( title=ftl('firefox-more-firefox-sync'), ga_title='Features Safe Browser', image_url='img/firefox/more/firefox-sync.jpg', desc=ftl('firefox-more-access-your-sync'), link_url=url('firefox.sync') )}} </div> <div class="mzp-l-card-third"> {{ card( title=ftl('seven-of-the'), ga_title='Compare', image_url='img/firefox/more/compare-browsers.jpg', desc=ftl('we-compare-firefox'), link_url=url('firefox.browsers.compare.index') )}} {{ card( title=ftl('comparing-firefox-chrome'), ga_title='Compare Chrome', image_url='img/firefox/more/firefox-chrome.jpg', desc=ftl('big-isnt-always'), link_url=url('firefox.browsers.compare.chrome') )}} {{ card( title=ftl('comparing-firefox-brave'), ga_title='Compare Brave', image_url='img/firefox/more/firefox-brave.jpg', desc=ftl('be-bold-and'), link_url=url('firefox.browsers.compare.brave') )}} </div> <div class="mzp-l-card-quarter"> {{ card( title=ftl('comparing-firefox-edge'), ga_title='Compare Edge', image_url='img/firefox/more/firefox-edge.jpg', desc=ftl('youll-never-guess'), link_url=url('firefox.browsers.compare.edge') )}} {{ card( title=ftl('comparing-firefox-ie'), ga_title='Compare IE', image_url='img/firefox/more/firefox-ie.jpg', desc=ftl('old-habits-that'), link_url=url('firefox.browsers.compare.ie') )}} {{ card( title=ftl('comparing-firefox-safari'), ga_title='Compare Safari', desc=ftl('you-dont-have'), image_url='img/firefox/more/firefox-safari.jpg', link_url=url('firefox.browsers.compare.safari') )}} {{ card( title=ftl('comparing-firefox-opera'), ga_title='Compare Opera', image_url='img/firefox/more/firefox-opera.jpg', desc=ftl('be-free-to'), link_url=url('firefox.browsers.compare.opera') )}} </div> <div class="mzp-l-card-third"> {{ card( title=ftl('firefox-more-fingerprinter-blocking'), ga_title='Fingerprinter Blocking', image_url='img/firefox/more/fingerprint.png', desc=ftl('firefox-more-fingerprinting-is-a'), link_url=url('firefox.features.fingerprinting') )}} {{ card( title=ftl('firefox-more-translate-the-web'), ga_title='Translate', image_url='img/firefox/more/firefox-all.jpg', desc=ftl('firefox-more-translate-more-than'), link_url=url('firefox.features.translate') )}} {{ card( title=ftl('firefox-more-a-guide-to'), ga_title='Safe Passwords', desc=ftl('firefox-more-more-and-more'), image_url='img/firefox/more/passwords.png', link_url=url('firefox.privacy.passwords') )}} </div> <div class="mzp-l-card-quarter"> {{ card( title=ftl('firefox-more-avoid-misinformation-heading'), ga_title='Avoid Misinformation', image_url='img/firefox/more/avoid-misinformation.jpg', desc=ftl('firefox-more-avoid-misinformation-desc'), link_url=url('firefox.more.misinformation') )}} </div> </div> </main> {% endblock %}
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `MAX_VIEWPORT_DIMS` constant in crate `gleam`."> <meta name="keywords" content="rust, rustlang, rust-lang, MAX_VIEWPORT_DIMS"> <title>gleam::ffi::MAX_VIEWPORT_DIMS - Rust</title> <link rel="stylesheet" type="text/css" href="../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <p class='location'><a href='../index.html'>gleam</a>::<wbr><a href='index.html'>ffi</a></p><script>window.sidebarCurrent = {name: 'MAX_VIEWPORT_DIMS', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>gleam</a>::<wbr><a href='index.html'>ffi</a>::<wbr><a class='constant' href=''>MAX_VIEWPORT_DIMS</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-1365' class='srclink' href='../../src/gleam/home/servo/buildbot/slave/doc/build/target/debug/build/gleam-8cc6d4d4d5b87928/out/gl_bindings.rs.html#805' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const MAX_VIEWPORT_DIMS: <a class='type' href='../../gleam/gl/types/type.GLenum.html' title='gleam::gl::types::GLenum'>GLenum</a><code> = </code><code>3386</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../"; window.currentCrate = "gleam"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script defer src="../../search-index.js"></script> </body> </html>
Java
/* * This file is part of Espruino, a JavaScript interpreter for Microcontrollers * * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * ---------------------------------------------------------------------------- * Utilities and definitions for handling Pins * ---------------------------------------------------------------------------- */ #include "jspin.h" #include "jspininfo.h" // auto-generated #include "jsinteractive.h" #include "jshardware.h" #if defined(PICO) || defined(NUCLEOF401RE) || defined(NUCLEOF411RE) #define PIN_NAMES_DIRECT // work out pin names directly from port + pin in pinInfo #endif bool jshIsPinValid(Pin pin) { // Note, PIN_UNDEFINED is always > JSH_PIN_COUNT return pin < JSH_PIN_COUNT && pinInfo[pin].port!=JSH_PORT_NONE; } Pin jshGetPinFromString(const char *s) { // built in constants if (s[0]=='B' && s[1]=='T' && s[2]=='N') { #ifdef BTN1_PININDEX if (!s[3]) return BTN1_PININDEX; if (s[3]=='1' && !s[4]) return BTN1_PININDEX; #endif #ifdef BTN2_PININDEX if (s[3]=='2' && !s[4]) return BTN2_PININDEX; #endif #ifdef BTN3_PININDEX if (s[3]=='3' && !s[4]) return BTN3_PININDEX; #endif #ifdef BTN4_PININDEX if (s[3]=='4' && !s[4]) return BTN4_PININDEX; #endif } if (s[0]=='L' && s[1]=='E' && s[2]=='D') { #ifdef LED1_PININDEX if (!s[3]) return LED1_PININDEX; if (s[3]=='1' && !s[4]) return LED1_PININDEX; #endif #ifdef LED2_PININDEX if (s[3]=='2' && !s[4]) return LED2_PININDEX; #endif #ifdef LED3_PININDEX if (s[3]=='3' && !s[4]) return LED3_PININDEX; #endif #ifdef LED4_PININDEX if (s[3]=='4' && !s[4]) return LED4_PININDEX; #endif #ifdef LED5_PININDEX if (s[3]=='5' && !s[4]) return LED5_PININDEX; #endif #ifdef LED6_PININDEX if (s[3]=='6' && !s[4]) return LED6_PININDEX; #endif #ifdef LED7_PININDEX if (s[3]=='7' && !s[4]) return LED7_PININDEX; #endif #ifdef LED8_PININDEX if (s[3]=='8' && !s[4]) return LED8_PININDEX; #endif } if ((s[0]>='A' && s[0]<='H') && s[1]) { int port = JSH_PORTA+s[0]-'A'; int pin = -1; if (s[1]>='0' && s[1]<='9') { if (!s[2]) { // D0-D9 pin = (s[1]-'0'); } else if (s[2]>='0' && s[2]<='9') { if (!s[3]) { pin = ((s[1]-'0')*10 + (s[2]-'0')); } else if (!s[4] && s[3]>='0' && s[3]<='9') { pin = ((s[1]-'0')*100 + (s[2]-'0')*10 + (s[3]-'0')); } } } if (pin>=0) { #ifdef PIN_NAMES_DIRECT int i; for (i=0;i<JSH_PIN_COUNT;i++) if (pinInfo[i].port == port && pinInfo[i].pin==pin) return (Pin)i; #else if (port == JSH_PORTA) { if (pin<JSH_PORTA_COUNT) return (Pin)(JSH_PORTA_OFFSET + pin); } else if (port == JSH_PORTB) { if (pin<JSH_PORTB_COUNT) return (Pin)(JSH_PORTB_OFFSET + pin); } else if (port == JSH_PORTC) { if (pin<JSH_PORTC_COUNT) return (Pin)(JSH_PORTC_OFFSET + pin); } else if (port == JSH_PORTD) { if (pin<JSH_PORTD_COUNT) return (Pin)(JSH_PORTD_OFFSET + pin); #if JSH_PORTE_OFFSET!=-1 } else if (port == JSH_PORTE) { if (pin<JSH_PORTE_COUNT) return (Pin)(JSH_PORTE_OFFSET + pin); #endif #if JSH_PORTF_OFFSET!=-1 } else if (port == JSH_PORTF) { if (pin<JSH_PORTF_COUNT) return (Pin)(JSH_PORTF_OFFSET + pin); #endif #if JSH_PORTG_OFFSET!=-1 } else if (port == JSH_PORTG) { if (pin<JSH_PORTG_COUNT) return (Pin)(JSH_PORTG_OFFSET + pin); #endif #if JSH_PORTH_OFFSET!=-1 } else if (port == JSH_PORTH) { if (pin<JSH_PORTH_COUNT) return (Pin)(JSH_PORTH_OFFSET + pin); #endif } #endif } } return PIN_UNDEFINED; } /** Write the pin name to a string. String must have at least 8 characters (to be safe) */ void jshGetPinString(char *result, Pin pin) { result[0] = 0; // just in case #ifdef PIN_NAMES_DIRECT if (jshIsPinValid(pin)) { result[0] = (char)('A'+pinInfo[pin].port-JSH_PORTA); itostr(pinInfo[pin].pin-JSH_PIN0,&result[1],10); #else if ( #if JSH_PORTA_OFFSET!=0 pin>=JSH_PORTA_OFFSET && #endif pin<JSH_PORTA_OFFSET+JSH_PORTA_COUNT) { result[0]='A'; itostr(pin-JSH_PORTA_OFFSET,&result[1],10); } else if (pin>=JSH_PORTB_OFFSET && pin<JSH_PORTB_OFFSET+JSH_PORTB_COUNT) { result[0]='B'; itostr(pin-JSH_PORTB_OFFSET,&result[1],10); } else if (pin>=JSH_PORTC_OFFSET && pin<JSH_PORTC_OFFSET+JSH_PORTC_COUNT) { result[0]='C'; itostr(pin-JSH_PORTC_OFFSET,&result[1],10); } else if (pin>=JSH_PORTD_OFFSET && pin<JSH_PORTD_OFFSET+JSH_PORTD_COUNT) { result[0]='D'; itostr(pin-JSH_PORTD_OFFSET,&result[1],10); #if JSH_PORTE_OFFSET!=-1 } else if (pin>=JSH_PORTE_OFFSET && pin<JSH_PORTE_OFFSET+JSH_PORTE_COUNT) { result[0]='E'; itostr(pin-JSH_PORTE_OFFSET,&result[1],10); #endif #if JSH_PORTF_OFFSET!=-1 } else if (pin>=JSH_PORTF_OFFSET && pin<JSH_PORTF_OFFSET+JSH_PORTF_COUNT) { result[0]='F'; itostr(pin-JSH_PORTF_OFFSET,&result[1],10); #endif #if JSH_PORTG_OFFSET!=-1 } else if (pin>=JSH_PORTG_OFFSET && pin<JSH_PORTG_OFFSET+JSH_PORTG_COUNT) { result[0]='G'; itostr(pin-JSH_PORTG_OFFSET,&result[1],10); #endif #if JSH_PORTH_OFFSET!=-1 } else if (pin>=JSH_PORTH_OFFSET && pin<JSH_PORTH_OFFSET+JSH_PORTH_COUNT) { result[0]='H'; itostr(pin-JSH_PORTH_OFFSET,&result[1],10); #endif #endif } else { strncpy(result, "UNKNOWN", 8); } } /// Given a var, convert it to a pin ID (or -1 if it doesn't exist). safe for undefined! Pin jshGetPinFromVar(JsVar *pinv) { if (jsvIsString(pinv) && pinv->varData.str[5]==0/*should never be more than 4 chars!*/) { return jshGetPinFromString(&pinv->varData.str[0]); } else if (jsvIsInt(pinv) /* This also tests for the Pin datatype */) { return (Pin)jsvGetInteger(pinv); } else return PIN_UNDEFINED; } Pin jshGetPinFromVarAndUnLock(JsVar *pinv) { Pin pin = jshGetPinFromVar(pinv); jsvUnLock(pinv); return pin; } // ---------------------------------------------------------------------------- // Whether a pin's state has been set manually or not BITFIELD_DECL(jshPinStateIsManual, JSH_PIN_COUNT); // TODO: This should be set to all 0 bool jshGetPinStateIsManual(Pin pin) { return BITFIELD_GET(jshPinStateIsManual, pin); } void jshSetPinStateIsManual(Pin pin, bool manual) { BITFIELD_SET(jshPinStateIsManual, pin, manual); } // ---------------------------------------------------------------------------- bool jshPinInput(Pin pin) { bool value = false; if (jshIsPinValid(pin)) { if (!jshGetPinStateIsManual(pin)) jshPinSetState(pin, JSHPINSTATE_GPIO_IN); value = jshPinGetValue(pin); } else jsExceptionHere(JSET_ERROR, "Invalid pin!"); return value; } void jshPinOutput(Pin pin, bool value) { if (jshIsPinValid(pin)) { if (!jshGetPinStateIsManual(pin)) jshPinSetState(pin, JSHPINSTATE_GPIO_OUT); jshPinSetValue(pin, value); } else jsExceptionHere(JSET_ERROR, "Invalid pin!"); } // ---------------------------------------------------------------------------- // Convert an event type flag into a jshPinFunction for an actual hardware device JshPinFunction jshGetPinFunctionFromDevice(IOEventFlags device) { switch (device) { case EV_SERIAL1 : return JSH_USART1; case EV_SERIAL2 : return JSH_USART2; case EV_SERIAL3 : return JSH_USART3; case EV_SERIAL4 : return JSH_USART4; case EV_SERIAL5 : return JSH_USART5; case EV_SERIAL6 : return JSH_USART6; case EV_SPI1 : return JSH_SPI1; case EV_SPI2 : return JSH_SPI2; case EV_SPI3 : return JSH_SPI3; case EV_I2C1 : return JSH_I2C1; case EV_I2C2 : return JSH_I2C2; case EV_I2C3 : return JSH_I2C3; default: return 0; } } /** Try and find a specific type of function for the given pin. Can be given an invalid pin and will return 0. */ JshPinFunction NO_INLINE jshGetPinFunctionForPin(Pin pin, JshPinFunction functionType) { if (!jshIsPinValid(pin)) return 0; int i; for (i=0;i<JSH_PININFO_FUNCTIONS;i++) { if ((pinInfo[pin].functions[i]&JSH_MASK_TYPE) == functionType) return pinInfo[pin].functions[i]; } return 0; } /** Try and find the best pin suitable for the given function. Can return -1. */ Pin NO_INLINE jshFindPinForFunction(JshPinFunction functionType, JshPinFunction functionInfo) { #ifdef OLIMEXINO_STM32 /** Hack, as you can't mix AFs on the STM32F1, and Olimexino reordered the pins * such that D4(AF1) is before D11(AF0) - and there are no SCK/MISO for AF1! */ if (functionType == JSH_SPI1 && functionInfo==JSH_SPI_MOSI) return JSH_PORTD_OFFSET+11; #endif #ifdef PICO /* On the Pico, A9 is used for sensing when USB power is applied. Is someone types in * Serial1.setup(9600) it'll get chosen as it's the first pin, but setting it to an output * totally messes up the STM32 as it's fed with 5V. This ensures that it won't get chosen * UNLESS it is explicitly selected. * * TODO: better way of doing this? A JSH_DONT_DEFAULT flag for pin functions? */ if (functionType == JSH_USART1) { if (functionInfo==JSH_USART_TX) return JSH_PORTB_OFFSET+6; if (functionInfo==JSH_USART_RX) return JSH_PORTB_OFFSET+7; } #endif Pin i; int j; // first, try and find the pin with an AF of 0 - this is usually the 'default' for (i=0;i<JSH_PIN_COUNT;i++) for (j=0;j<JSH_PININFO_FUNCTIONS;j++) if ((pinInfo[i].functions[j]&JSH_MASK_AF) == JSH_AF0 && (pinInfo[i].functions[j]&JSH_MASK_TYPE) == functionType && (pinInfo[i].functions[j]&JSH_MASK_INFO) == functionInfo) return i; // otherwise just try and find anything for (i=0;i<JSH_PIN_COUNT;i++) for (j=0;j<JSH_PININFO_FUNCTIONS;j++) if ((pinInfo[i].functions[j]&JSH_MASK_TYPE) == functionType && (pinInfo[i].functions[j]&JSH_MASK_INFO) == functionInfo) return i; return PIN_UNDEFINED; } /// Given a full pin function, return a string describing it depending of what's in the flags enum void jshPinFunctionToString(JshPinFunction pinFunc, JshPinFunctionToStringFlags flags, char *buf, size_t bufSize) { const char *devStr = ""; JshPinFunction info = JSH_MASK_INFO & pinFunc; JshPinFunction firstDevice = 0; const char *infoStr = 0; buf[0]=0; if (JSH_PINFUNCTION_IS_USART(pinFunc)) { devStr="USART"; firstDevice=JSH_USART1; if (info==JSH_USART_RX) infoStr="RX"; else if (info==JSH_USART_TX) infoStr="TX"; else if (info==JSH_USART_CK) infoStr="CK"; } else if (JSH_PINFUNCTION_IS_SPI(pinFunc)) { devStr="SPI"; firstDevice=JSH_SPI1; if (info==JSH_SPI_MISO) infoStr="MISO"; else if (info==JSH_SPI_MOSI) infoStr="MOSI"; else if (info==JSH_SPI_SCK) infoStr="SCK"; } else if (JSH_PINFUNCTION_IS_I2C(pinFunc)) { devStr="I2C"; firstDevice=JSH_I2C1; if (info==JSH_I2C_SCL) infoStr="SCL"; else if (info==JSH_I2C_SDA) infoStr="SDA"; } else if (JSH_PINFUNCTION_IS_DAC(pinFunc)) { devStr="DAC"; firstDevice=JSH_DAC; if (info==JSH_DAC_CH1) infoStr="CH1"; else if (info==JSH_DAC_CH2) infoStr="CH2"; } else if (JSH_PINFUNCTION_IS_TIMER(pinFunc)) { devStr="TIM"; firstDevice=JSH_TIMER1; char infoStrBuf[5]; infoStr = &infoStrBuf[0]; infoStrBuf[0] = 'C'; infoStrBuf[1] = 'H'; infoStrBuf[2] = (char)('1' + ((info&JSH_MASK_TIMER_CH)>>JSH_SHIFT_INFO)); if (info & JSH_TIMER_NEGATED) { infoStrBuf[3]='N'; infoStrBuf[4] = 0; } else { infoStrBuf[3] = 0; } } int devIdx = 1 + ((((pinFunc&JSH_MASK_TYPE) - firstDevice) >> JSH_SHIFT_TYPE)); if (!devStr) { jsiConsolePrintf("Couldn't convert pin function %d\n", pinFunc); return; } if (flags & JSPFTS_DEVICE) strncat(buf, devStr, bufSize); if (flags & JSPFTS_DEVICE_NUMBER) itostr(devIdx, &buf[strlen(buf)], 10); if (flags & JSPFTS_SPACE) strncat(buf, " ", bufSize); if (infoStr && (flags & JSPFTS_TYPE)) strncat(buf, infoStr, bufSize); } /** Prints a list of capable pins, eg: jshPrintCapablePins(..., "PWM", JSH_TIMER1, JSH_TIMERMAX, 0,0, false) jshPrintCapablePins(..., "SPI", JSH_SPI1, JSH_SPIMAX, JSH_MASK_INFO,JSH_SPI_SCK, false) jshPrintCapablePins(..., "Analog Input", 0,0,0,0, true) - for analogs */ void NO_INLINE jshPrintCapablePins(Pin existingPin, const char *functionName, JshPinFunction typeMin, JshPinFunction typeMax, JshPinFunction pMask, JshPinFunction pData, bool printAnalogs) { if (functionName) { jsError("Pin %p is not capable of %s\nSuitable pins are:", existingPin, functionName); } Pin pin; int i,n=0; for (pin=0;pin<JSH_PIN_COUNT;pin++) { bool has = false; #ifdef STM32F1 int af = 0; #endif if (printAnalogs) { has = pinInfo[pin].analog!=JSH_ANALOG_NONE; } else { for (i=0;i<JSH_PININFO_FUNCTIONS;i++) { JshPinFunction type = pinInfo[pin].functions[i] & JSH_MASK_TYPE; if (type>=typeMin && type<=typeMax && ((pinInfo[pin].functions[i]&pMask)==pData)) { has = true; #ifdef STM32F1 af = pinInfo[pin].functions[i] & JSH_MASK_AF; #endif } } } if (has) { jsiConsolePrintf("%p",pin); #ifdef STM32F1 if (af!=JSH_AF0) jsiConsolePrint("(AF)"); #endif jsiConsolePrint(" "); if (n++==8) { n=0; jsiConsolePrint("\n"); } } } jsiConsolePrint("\n"); }
Java
using Microsoft.EntityFrameworkCore; using Anabi.DataAccess.Ef.DbModels; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Anabi.DataAccess.Ef.EntityConfigurators { public class AssetConfig : BaseEntityConfig<AssetDb> { public override void Configure(EntityTypeBuilder<AssetDb> builder) { builder.HasOne(a => a.Address) .WithMany(b => b.Assets) .HasForeignKey(k => k.AddressId) .OnDelete(DeleteBehavior.Restrict) .HasConstraintName("FK_Assets_Addresses"); builder.HasOne(k => k.Category) .WithMany(b => b.Assets) .HasForeignKey(k => k.CategoryId) .OnDelete(DeleteBehavior.Restrict) .HasConstraintName("FK_Assets_Categories") .IsRequired(); builder.HasOne(d => d.CurrentDecision) .WithMany(b => b.Assets) .HasForeignKey(k => k.DecisionId) .OnDelete(DeleteBehavior.Restrict) .HasConstraintName("FK_Assets_Decisions"); base.Configure(builder); } } }
Java
import { Mongo } from 'meteor/mongo'; const SurveyCaches = new Mongo.Collection('SurveyCaches'); SimpleSchema.debug = true; SurveyCaches.schema = new SimpleSchema({ title: { type: String, }, version: { type: Number, optional: true, autoValue() { return 2; }, }, createdAt: { type: Date, label: 'Created At', optional: true, autoValue() { let val; if (this.isInsert) { val = new Date(); } else if (this.isUpsert) { val = { $setOnInsert: new Date() }; } else { this.unset(); // Prevent user from supplying their own value } return val; }, }, updatedAt: { type: Date, label: 'Updated At', optional: true, autoValue() { let val; if (this.isUpdate) { val = new Date(); } return val; }, }, }); SurveyCaches.attachSchema(SurveyCaches.schema); export default SurveyCaches;
Java
using Alex.Blocks.Materials; namespace Alex.Blocks.Minecraft { public class BlueOrchid : FlowerBase { public BlueOrchid() { Solid = false; Transparent = true; IsFullCube = false; BlockMaterial = Material.Plants; } } }
Java
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* Storage Host Tree */ #storage-tree { min-width: 220px; max-width: 500px; overflow: auto; } #storage-tree { background: var(--theme-sidebar-background); } #storage-tree .tree-widget-item[type="store"]:after { background-image: url(chrome://devtools/skin/images/tool-storage.svg); background-size: 18px 18px; background-position: -1px 0; } /* Columns with date should have a min width so that date is visible */ #expires, #lastAccessed, #creationTime { min-width: 150px; } /* Variables View Sidebar */ #storage-sidebar { max-width: 500px; min-width: 250px; } /* Responsive sidebar */ @media (max-width: 700px) { #storage-tree, #storage-sidebar { max-width: 100%; } #storage-table #path { display: none; } #storage-table .table-widget-cell { min-width: 100px; } }
Java
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ export interface TimeZones { name: string; abbrev: string; offset: string; }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_45) on Fri Dec 27 12:52:52 CST 2013 --> <title>Cassandra.AsyncProcessor.describe_schema_versions (apache-cassandra API)</title> <meta name="date" content="2013-12-27"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Cassandra.AsyncProcessor.describe_schema_versions (apache-cassandra API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Cassandra.AsyncProcessor.describe_schema_versions.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_ring.html" title="class in org.apache.cassandra.thrift"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_snitch.html" title="class in org.apache.cassandra.thrift"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html" target="_top">Frames</a></li> <li><a href="Cassandra.AsyncProcessor.describe_schema_versions.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.apache.cassandra.thrift</div> <h2 title="Class Cassandra.AsyncProcessor.describe_schema_versions" class="title">Class Cassandra.AsyncProcessor.describe_schema_versions&lt;I extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>&gt;</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.apache.thrift.AsyncProcessFunction&lt;I,<a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_schema_versions_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_schema_versions_args</a>,java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&gt;</li> <li> <ul class="inheritance"> <li>org.apache.cassandra.thrift.Cassandra.AsyncProcessor.describe_schema_versions&lt;I&gt;</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Enclosing class:</dt> <dd><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.html" title="class in org.apache.cassandra.thrift">Cassandra.AsyncProcessor</a>&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.html" title="type parameter in Cassandra.AsyncProcessor">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>&gt;</dd> </dl> <hr> <br> <pre>public static class <span class="strong">Cassandra.AsyncProcessor.describe_schema_versions&lt;I extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>&gt;</span> extends org.apache.thrift.AsyncProcessFunction&lt;I,<a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_schema_versions_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_schema_versions_args</a>,java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&gt;</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html#Cassandra.AsyncProcessor.describe_schema_versions()">Cassandra.AsyncProcessor.describe_schema_versions</a></strong>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_schema_versions_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_schema_versions_args</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html#getEmptyArgsInstance()">getEmptyArgsInstance</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>org.apache.thrift.async.AsyncMethodCallback&lt;java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html#getResultHandler(org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer, int)">getResultHandler</a></strong>(org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer&nbsp;fb, int&nbsp;seqid)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected boolean</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html#isOneway()">isOneway</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html#start(I, org.apache.cassandra.thrift.Cassandra.describe_schema_versions_args, org.apache.thrift.async.AsyncMethodCallback)">start</a></strong>(<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html" title="type parameter in Cassandra.AsyncProcessor.describe_schema_versions">I</a>&nbsp;iface, <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_schema_versions_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_schema_versions_args</a>&nbsp;args, org.apache.thrift.async.AsyncMethodCallback&lt;java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&gt;&nbsp;resultHandler)</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_org.apache.thrift.AsyncProcessFunction"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.apache.thrift.AsyncProcessFunction</h3> <code>getMethodName, sendResponse</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="Cassandra.AsyncProcessor.describe_schema_versions()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>Cassandra.AsyncProcessor.describe_schema_versions</h4> <pre>public&nbsp;Cassandra.AsyncProcessor.describe_schema_versions()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getEmptyArgsInstance()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getEmptyArgsInstance</h4> <pre>public&nbsp;<a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_schema_versions_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_schema_versions_args</a>&nbsp;getEmptyArgsInstance()</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code>getEmptyArgsInstance</code>&nbsp;in class&nbsp;<code>org.apache.thrift.AsyncProcessFunction&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html" title="type parameter in Cassandra.AsyncProcessor.describe_schema_versions">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_schema_versions_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_schema_versions_args</a>,java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&gt;</code></dd> </dl> </li> </ul> <a name="getResultHandler(org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer, int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getResultHandler</h4> <pre>public&nbsp;org.apache.thrift.async.AsyncMethodCallback&lt;java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&gt;&nbsp;getResultHandler(org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer&nbsp;fb, int&nbsp;seqid)</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code>getResultHandler</code>&nbsp;in class&nbsp;<code>org.apache.thrift.AsyncProcessFunction&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html" title="type parameter in Cassandra.AsyncProcessor.describe_schema_versions">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_schema_versions_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_schema_versions_args</a>,java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&gt;</code></dd> </dl> </li> </ul> <a name="isOneway()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isOneway</h4> <pre>protected&nbsp;boolean&nbsp;isOneway()</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code>isOneway</code>&nbsp;in class&nbsp;<code>org.apache.thrift.AsyncProcessFunction&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html" title="type parameter in Cassandra.AsyncProcessor.describe_schema_versions">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_schema_versions_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_schema_versions_args</a>,java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&gt;</code></dd> </dl> </li> </ul> <a name="start(org.apache.cassandra.thrift.Cassandra.AsyncIface,org.apache.cassandra.thrift.Cassandra.describe_schema_versions_args,org.apache.thrift.async.AsyncMethodCallback)"> <!-- --> </a><a name="start(I, org.apache.cassandra.thrift.Cassandra.describe_schema_versions_args, org.apache.thrift.async.AsyncMethodCallback)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>start</h4> <pre>public&nbsp;void&nbsp;start(<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html" title="type parameter in Cassandra.AsyncProcessor.describe_schema_versions">I</a>&nbsp;iface, <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_schema_versions_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_schema_versions_args</a>&nbsp;args, org.apache.thrift.async.AsyncMethodCallback&lt;java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&gt;&nbsp;resultHandler) throws org.apache.thrift.TException</pre> <dl> <dt><strong>Specified by:</strong></dt> <dd><code>start</code>&nbsp;in class&nbsp;<code>org.apache.thrift.AsyncProcessFunction&lt;<a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html" title="type parameter in Cassandra.AsyncProcessor.describe_schema_versions">I</a> extends <a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncIface.html" title="interface in org.apache.cassandra.thrift">Cassandra.AsyncIface</a>,<a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_schema_versions_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_schema_versions_args</a>,java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&gt;</code></dd> <dt><span class="strong">Throws:</span></dt> <dd><code>org.apache.thrift.TException</code></dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Cassandra.AsyncProcessor.describe_schema_versions.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_ring.html" title="class in org.apache.cassandra.thrift"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_snitch.html" title="class in org.apache.cassandra.thrift"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.AsyncProcessor.describe_schema_versions.html" target="_top">Frames</a></li> <li><a href="Cassandra.AsyncProcessor.describe_schema_versions.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &copy; 2013 The Apache Software Foundation</small></p> </body> </html>
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html data-context="Build Apps" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>Leaf Workspace Manager - Legato Docs</title> <meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/> <meta content="legato, iot" name="keywords"/> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/> <meta content="21.05.0" name="legato-version"/> <link href="resources/images/legato.ico" rel="shortcut icon"/> <link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/> <link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/> <link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/> <!--[if IE]> <script src="resources/js/html5shiv.js"></script> <script src="resources/js/respond.js"></script> <![endif]--> <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script> <script src="resources/js/main.js"></script> <script src="tocs/Build_Apps_Get_Started.json"></script> </head> <body> <noscript> <input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/> <div id="nojs"> <label for="modal-closing-trick"> <span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span> </label> </div> </noscript> <div class="wrapper"> <div class="fa fa-bars documentation" id="menu-trigger"></div> <div id="top"> <header> <nav> <a class="navlink" href="/">Introduction</a><a class="navlink selected" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink" href="aboutMain.html">About</a> </nav> </header> </div> <div class="white" id="menudocumentation"> <header> <a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a> <h2>/ Build Apps</h2> <nav class="secondary"> <a class="link-selected" href="getStarted.html">Get Started</a><a href="concepts.html">Concepts</a><a href="apiGuidesMain.html">API Guides</a><a href="tools.html">Tools</a><a href="howToMain.html">How To</a><a href="experimentalMain.html">Experimental Features</a><a href="migrationGuide.html">Linux 4.14 Migration Guide</a> </nav> <nav class="ui-front"> <i class="fa fa-search" id="search-icon"></i> <input id="searchbox" placeholder="Search"/> </nav> </header> </div> <div id="resizable"> <div id="left"> <div id="tree1"></div> </div> </div> <div class="content"> <div class="header"> <div class="headertitle"> <h1 class="title">Leaf Workspace Manager </h1> </div> </div><div class="contents"> <div class="textblock"><p>Leaf is a workspace manager that will download, install and configure the required software packages for a Legato development environment.</p> <p>This tutorial will walk you through how to:</p><ul> <li>Install Leaf</li> <li>Set up a remote to point to a package repository</li> <li>Search for a package to install</li> <li>Set up your development environment</li> <li>Use the built in shell to access the development tools</li> <li>Set up your workspace to start development</li> </ul> <p>The basic workflow that should be followed to download and set up a development environment for your target. These tutorials use the packages that have been created for the Legato project as examples.</p> <h1><a class="anchor" id="confLeafInstall"></a> Install Leaf</h1> <p>Leaf is hosted in the Sierra Wireless debian tools repository, and is provided as a <code></code>.deb package to be installed through <code>apt</code>. We have also provided <a class="el" href="confLeaf_Install.html">alternative install instructions</a> for older Ubuntu Distributions (14.04 and below) and instructions for manually installing from a tarball.</p> <p>Install leaf download and set up our debian package from the Sierra Wireless tools repository: </p><pre class="fragment">$ wget https://downloads.sierrawireless.com/tools/leaf/leaf_latest.deb -O /tmp/leaf_latest.deb &amp;&amp; sudo apt install /tmp/leaf_latest.deb </pre><p>Leaf installs tools, images and packages into the <code>~/</code>.leaf/ directory; all configuration is stored in <code>~/</code>.config/leaf/</p> <p>Before searching and installing your first SDK it is recommended to make a separate leaf workspace directory to store all of your custom Legato development. For this site and tutorials we will be setting up the leaf workspace in <code>$HOME/myWorkspace</code>.</p> <pre class="fragment">$ mkdir ~/myWorkspace; cd ~/myWorkspace </pre><h1><a class="anchor" id="confLeafsearch"></a> Search for Packages</h1> <p>Now that you have leaf installed, you can now search through a repository to find the packages to download, install and configure your Development Environment.</p> <dl class="section warning"><dt>Warning</dt><dd>You are able to search leaf from anywhere on your computer; running <code>leaf</code> <code>setup</code> will add config in the directory that you are currently in. It is recommended to create a workspace dir and set up leaf packages from within your workspace.</dd></dl> <p><b>leaf</b> <b>search</b> </p> <p>Using <code>leaf</code> <code>search</code> with no filters will list every package in any repository that you have enabled (it may be a huge list). It is better to search with filters that return a smaller list that is specific for your target.</p> <h2><a class="anchor" id="confLeafsearchTarget"></a> Search for a Target</h2> <pre class="fragment">$ leaf search -t &lt;target&gt; (i.e.; leaf search -t wp76xx will bring back all packages for the wp76 target) </pre><p>The search results will return a package identifier (the package name of the package to install), a high level description of what is in the package, and the tags of the package. You are also able to search filter the search results by tag using the -t flag. </p><pre class="fragment">$ leaf search -t latest (returns all the newest/latest published packages for all targets) $ leaf search -t wp76xx -t latest (returns the latest packages for the wp76 target) </pre><p>To see exactly what is contained in the package perform a search with a <code>-v</code> flag (verbose). This will list the details of what each package contains including the release date and the list of versions of all sub-packages listed as dependencies. </p><pre class="fragment">$ leaf search -t wp76xx -t latest -v (returns the details of the latest package for the wp76 target) </pre><p>For details on each of the components of the package visit the vendors page. Firmware Details (including Yocto distribution, toolchain and firmware): <a href="https://source.sierrawireless.com">source.sierrawireless.com</a> Legato Details: <a href="https://legato.io/releases">Releases</a></p> <h1><a class="anchor" id="confLeafSetup"></a> Set up Development Environment</h1> <p>Now that you know which package that you want to install on your development machine, the next step is to run <code>leaf</code> <code>setup</code>. The <code>setup</code> command will prepare your directory as a workspace and download, install and configure your workspace with a profile (settings specific to your target and version) preparing you to start developing for your target.</p> <pre class="fragment">$ leaf setup &lt;profile name&gt; -p &lt;package identifier&gt; $ leaf setup wp76stable -p swi-wp76_1.0.0 (downloads and installs the swi-wp76_1.0.0 package in the wp76stable profile) </pre><dl class="section note"><dt>Note</dt><dd>Downloading and installing the package may take a few minutes. Leaf configures everything that is needed for you to start developing for your target including the toolchain, Legato application framework and other development tools. It will also take care of installing any apt dependencies. The apt dependencies will require sudo and you will be prompted for your password for sudo privileges.</dd></dl> <p>After installation a new directory (<code>leaf-data</code>) and a new configuration file (<code>leaf-workspace.json</code>) will be created in your workspace directory. The directory contains symbolic links to all the resources needed for development and the leaf tools know how to find the resources for development.</p> <p>You will now be able to use leaf commands to view your environment and use the resources that you just downloaded and installed. For detailed help on the leaf sub-commands see <a class="el" href="toolsLeaf.html">Leaf</a>. </p><pre class="fragment">$ leaf status - displays the profile list and information about the profiles $ leaf select - lets you select different profiles (if you have more then one installed) $ leaf profile delete &lt;profile name&gt; $ leaf profile rename &lt;old name&gt; &lt;new name&gt; - renames your profile </pre><h1><a class="anchor" id="confLeafSetup2nd"></a> Set up a 2nd Profile</h1> <p>To set up a second profile (if you wish to use multiple targets, or multiple versions) run the <code>leaf</code> <code>setup</code> command again and choose a new profile name. </p><pre class="fragment">$ leaf setup &lt;2nd profile&gt; -p &lt;2nd package identifier&gt; $ leaf setup wp76dev -p swi-wp76_1.0.0 </pre><p>To see the two profiles set up use <code>leaf</code> <code>status</code> and <code>leaf</code> <code>select</code> to switch between profiles. </p><pre class="fragment">$ leaf status $ leaf select &lt;profile name&gt;. </pre><h1><a class="anchor" id="confLeafShell"></a> Leaf Shell</h1> <p><code>leaf</code> <code>shell</code> provides an interactive shell that is <b>profile</b> aware to run all of your tools for your development environment. If you need to switch to a different profile (different target or version of software) the shell environment will update all environment variables to point to the version that matches the profile that you are working with.</p> <dl class="section warning"><dt>Warning</dt><dd><code>shell</code> is $PWD dependant; if you switch to another directory outside of your workspace you will lose your <code>leaf</code> environment variables, and it will not be profile aware (automatically switch to the toolchain and tools that match the profile you are using).</dd></dl> <p>i.e.; Using <code>mksys</code> from within the leaf shell will use the version of the tool that is configured for that specific profile and will also build a Legato System with the correct toolchain. If you switch profiles and run <code>mksys</code> again it will use the version configured with the second profile and use the toolchain configured for the second profile environment.</p> <h1><a class="anchor" id="confLeafWorkspace"></a> Set up Workspace</h1> <p>Now that you have all your development environment set up and configured you are now able to start development.</p> <p>All leaf packages are downloaded to <code>$HOME/</code>.leaf by default (see <code>leaf</code> <code>config</code> to <code>update</code>) and are used as references to be included in to your workspace via environment variables.</p> <p>Any new environment variables that you would like added to your development environment can be added with <code>leaf</code> <code>env</code>. See <code>leaf</code> <code>help</code> <code>env</code> for details on adding new environment variables to either a profile or a workspace. </p><pre class="fragment">$ leaf env profile --set MYVAR=1 (sets the environment variable MYVAR to 1 for the current profile) </pre><h1><a class="anchor" id="confLeafDevelopment"></a> Legato Development</h1> <p>Leaf enables a new style of Legato development that allows you to create your component, apps and systems in your own workspace instead of working directly in the Legato directory. This will keep your custom code separate and still allow a full build of Legato Systems. Any changes that you do make directly to the Legato Application Framework will be reflected in your system when you run <code>mksys</code> from within the leaf shell in your workspace.</p> <p>If you do wish to use the Git tracked source code for Legato you are able to check-out the source code for Legato. This version requires you to have an account on GitHub. Use the command <a class="el" href="confLeafSrc.html">leaf getsrc legato</a> to checkout the version of Legato that matches your profile.</p> <h2><a class="anchor" id="confLeafDevelopmentLegato"></a> Legato Workflow Changes</h2> <ul> <li>The version of Legato that you install is pre-built for your module, meaning that there is no need to run make, or set-up the toolchain and other configuration tasks.</li> <li>You do not need to run <code>bin/legs</code> or source <code>bin/configlegatoenv</code> in your bash.rc file. The leaf shell makes sure that all environment variables are set up and are aware of the specific version of Legato that you are using within each profile.</li> <li>Do not add your apps and settings to default.sdef you are now able to <code>#include</code> <code>default.sdef</code> in an sdef in your workspace and build not only your settings but all the default legato apps and configuration.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Because you are now working with a pre-built version of Legato, any changes that you do make to the Legato Application Framework are not tracked, if you wish to modify the framework and build from source code see <code>leaf</code> <code>help</code> <code>legato-source</code> to download and connect tracked Legato source code.</dd></dl> <h2><a class="anchor" id="confLeafDevelopmentSDEF"></a> Set-up SDEF</h2> <p>Using your own <code></code>.sdef file is easy to set up and maintain. Using this method leaves all the Legato configuration in <code>default.sdef</code> and allows you to quickly see and work with your customization to your Legato System.</p> <p>Create a new <code></code>.sdef file in your leaf workspace: </p><pre class="fragment">$ vim mySystem.sdef (or the editor of your choice) </pre><p>In <code>mySystem.sdef</code> use the following line to include all the default Legato settings: </p><pre class="fragment">#include $LEGATO_ROOT/default.sdef </pre><p>You are also able to include any other <code></code>.sdef files you wish using the same method.</p> <p>A couple of very useful environment variables that are set up in Legato:</p><ul> <li><code>$LEGATO_ROOT</code> - resolves to the location of the Legato Application Framework for your profile</li> <li><code>$CURDIR</code> - resolves to the directory where you run the mktools from (i.e.; add <code>$CURDIR/path/to/your/app</code> to the apps section of your .sdef and then run mksys from your workspace directory to build your apps into the update file)</li> </ul> <p>To build your system you no longer need to re-make the build. Run <code>mksys</code> and point it at your <code></code>.sdef. To build a Legato System using your custom sdef run: </p><pre class="fragment">$ mksys -t $LEGATO_TARGET &lt;sdef&gt; (i.e.; mksys -t wp76xx mySystem.sdef from your leaf workspace directory) </pre><h2><a class="anchor" id="confLeafDevelopmentWorkspace"></a> Workspace Layout</h2> <p>Because you are not working directly in the Legato directory anymore, we recommend setting up a directory structure that will be easy to use and organize your apps, kernel modules and other settings for the Legato Application Framework. Remember to use <code>$CURDIR</code> to reference the workspace folder in your .sdef.</p> <p>Example directory structure using the helloWorld app: </p><pre class="fragment"> . ├── apps │   └── helloWorld │   ├── CMakeLists.txt │   ├── helloComponent │   │   ├── Component.cdef │   │   └── helloWorld.c │   └── helloWorld.adef ├── components | └── ... (a directory for each component) ├── drivers | └── ... (a directory for each kernel module) ├── interfaces | └── ... (all apis that your apps export) ├── leaf-data │   └── ... (leaf symbolic links, do not edit) ├── leaf-workspace.json └── mySystem.sdef </pre><p>This is just an example of how you could set up your directory structure, it is up to you and how you connect all of your components, apps and system in your workspace. Working out of the workspace directory lets you easily work with different profiles and switch to a new profile (target and/or version of Legato) and continue to use your same components, apps and/or system to build for your target devices.</p> <h2><a class="anchor" id="confLeafWorkflows"></a> Workflows</h2> <p>The Leaf workflow design includes a hierarchy and is set up with the first install of a leaf package:</p><ul> <li>USER (universal config for all workspace and profiles)</li> <li>WORKSPACE (the working directory for your code and your customization)</li> <li>PROFILE (target/version specific configuration and settings)</li> </ul> <p>See <a class="el" href="confLeafWS.html">leaf help legato-workflow</a> for more details on the relationship between profiles, workspaces and users.</p> <p class="copyright">Copyright (C) Sierra Wireless Inc. </p> </div></div> <br clear="left"/> </div> </div> <link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/> <script src="resources/js/tree.jquery.js" type="text/javascript"></script> <script src="resources/js/jquery.cookie.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/> <script src="resources/js/perfect-scrollbar.jquery.min.js"></script> </body> </html>
Java
package aws import ( "fmt" "testing" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" ) func TestAccDataSourceAWSLambdaLayerVersion_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") dataSourceName := "data.aws_lambda_layer_version.test" resourceName := "aws_lambda_layer_version.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaLayerVersionConfigBasic(rName), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceName, "layer_name", resourceName, "layer_name"), resource.TestCheckResourceAttrPair(dataSourceName, "version", resourceName, "version"), resource.TestCheckResourceAttrPair(dataSourceName, "compatible_runtimes.%", resourceName, "compatible_runtimes.%s"), resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "description"), resource.TestCheckResourceAttrPair(dataSourceName, "license_info", resourceName, "license_info"), resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), resource.TestCheckResourceAttrPair(dataSourceName, "layer_arn", resourceName, "layer_arn"), resource.TestCheckResourceAttrPair(dataSourceName, "created_date", resourceName, "created_date"), resource.TestCheckResourceAttrPair(dataSourceName, "source_code_hash", resourceName, "source_code_hash"), resource.TestCheckResourceAttrPair(dataSourceName, "source_code_size", resourceName, "source_code_size"), ), }, }, }) } func TestAccDataSourceAWSLambdaLayerVersion_version(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") dataSourceName := "data.aws_lambda_layer_version.test" resourceName := "aws_lambda_layer_version.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaLayerVersionConfigVersion(rName), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceName, "layer_name", resourceName, "layer_name"), resource.TestCheckResourceAttrPair(dataSourceName, "version", resourceName, "version"), ), }, }, }) } func TestAccDataSourceAWSLambdaLayerVersion_runtime(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") dataSourceName := "data.aws_lambda_layer_version.test" resourceName := "aws_lambda_layer_version.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaLayerVersionConfigRuntimes(rName), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceName, "layer_name", resourceName, "layer_name"), resource.TestCheckResourceAttrPair(dataSourceName, "version", resourceName, "version"), ), }, }, }) } func testAccDataSourceAWSLambdaLayerVersionConfigBasic(rName string) string { return fmt.Sprintf(` resource "aws_lambda_layer_version" "test" { filename = "test-fixtures/lambdatest.zip" layer_name = %[1]q compatible_runtimes = ["nodejs8.10"] } data "aws_lambda_layer_version" "test" { layer_name = "${aws_lambda_layer_version.test.layer_name}" } `, rName) } func testAccDataSourceAWSLambdaLayerVersionConfigVersion(rName string) string { return fmt.Sprintf(` resource "aws_lambda_layer_version" "test" { filename = "test-fixtures/lambdatest.zip" layer_name = %[1]q compatible_runtimes = ["nodejs8.10"] } resource "aws_lambda_layer_version" "test_two" { filename = "test-fixtures/lambdatest_modified.zip" layer_name = %[1]q compatible_runtimes = ["nodejs8.10"] } data "aws_lambda_layer_version" "test" { layer_name = "${aws_lambda_layer_version.test_two.layer_name}" version = "${aws_lambda_layer_version.test.version}" } `, rName) } func testAccDataSourceAWSLambdaLayerVersionConfigRuntimes(rName string) string { return fmt.Sprintf(` resource "aws_lambda_layer_version" "test" { filename = "test-fixtures/lambdatest.zip" layer_name = %[1]q compatible_runtimes = ["go1.x"] } resource "aws_lambda_layer_version" "test_two" { filename = "test-fixtures/lambdatest_modified.zip" layer_name = "${aws_lambda_layer_version.test.layer_name}" compatible_runtimes = ["nodejs8.10"] } data "aws_lambda_layer_version" "test" { layer_name = "${aws_lambda_layer_version.test_two.layer_name}" compatible_runtime = "go1.x" } `, rName) }
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `Struct_Unnamed7` struct in crate `x11`."> <meta name="keywords" content="rust, rustlang, rust-lang, Struct_Unnamed7"> <title>x11::xinput2::Struct_Unnamed7 - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>x11</a>::<wbr><a href='index.html'>xinput2</a></p><script>window.sidebarCurrent = {name: 'Struct_Unnamed7', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content struct"> <h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>x11</a>::<wbr><a href='index.html'>xinput2</a>::<wbr><a class='struct' href=''>Struct_Unnamed7</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-11156' class='srclink' href='../../src/x11/xinput2.rs.html#328-331' title='goto source code'>[src]</a></span></h1> <pre class='rust struct'>pub struct Struct_Unnamed7 { pub mask_len: <a class='type' href='../../libc/types/os/arch/c95/type.c_int.html' title='libc::types::os::arch::c95::c_int'>c_int</a>, pub mask: <a href='../../std/primitive.pointer.html'>*mut <a class='type' href='../../libc/types/os/arch/c95/type.c_uchar.html' title='libc::types::os::arch::c95::c_uchar'>c_uchar</a></a>, }</pre><h2 class='fields'>Fields</h2> <table><tr class='stab '> <td id='structfield.mask_len'><code>mask_len</code></td><td></td></tr><tr class='stab '> <td id='structfield.mask'><code>mask</code></td><td></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../../x11/xinput2/struct.Struct_Unnamed7.html' title='x11::xinput2::Struct_Unnamed7'>Struct_Unnamed7</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='../../core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&amp;self) -&gt; Self</code></h4> <h4 id='method.clone_from' class='method'><code>fn <a href='../../core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code></h4> </div><h3 class='impl'><code>impl <a class='trait' href='../../core/default/trait.Default.html' title='core::default::Default'>Default</a> for <a class='struct' href='../../x11/xinput2/struct.Struct_Unnamed7.html' title='x11::xinput2::Struct_Unnamed7'>Struct_Unnamed7</a></code></h3><div class='impl-items'><h4 id='method.default' class='method'><code>fn <a href='../../core/default/trait.Default.html#method.default' class='fnname'>default</a>() -&gt; Self</code></h4> </div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><code>impl <a class='trait' href='../../core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='struct' href='../../x11/xinput2/struct.Struct_Unnamed7.html' title='x11::xinput2::Struct_Unnamed7'>Struct_Unnamed7</a></code></h3><div class='impl-items'></div></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "x11"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html data-context="Build Apps" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>Create and Install Bundles - Legato Docs</title> <meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/> <meta content="legato, iot" name="keywords"/> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/> <meta content="19.11.6" name="legato-version"/> <link href="resources/images/legato.ico" rel="shortcut icon"/> <link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/> <link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/> <link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/> <!--[if IE]> <script src="resources/js/html5shiv.js"></script> <script src="resources/js/respond.js"></script> <![endif]--> <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script> <script src="resources/js/main.js"></script> <script src="tocs/Build_Apps_API_Guides.json"></script> </head> <body> <noscript> <input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/> <div id="nojs"> <label for="modal-closing-trick"> <span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span> </label> </div> </noscript> <div class="wrapper"> <div class="fa fa-bars documentation" id="menu-trigger"></div> <div id="top"> <header> <nav> <a class="navlink" href="/">Introduction</a><a class="navlink selected" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink" href="aboutMain.html">About</a> </nav> </header> </div> <div class="white" id="menudocumentation"> <header> <a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a> <h2>/ Build Apps</h2> <nav class="secondary"> <a href="getStarted.html">Get Started</a><a href="concepts.html">Concepts</a><a class="link-selected" href="apiGuidesMain.html">API Guides</a><a href="tools.html">Tools</a><a href="howToMain.html">How To</a><a href="experimentalMain.html">Experimental Features</a> </nav> <nav class="ui-front"> <i class="fa fa-search" id="search-icon"></i> <input id="searchbox" placeholder="Search"/> </nav> </header> </div> <div id="resizable"> <div id="left"> <div id="tree1"></div> </div> </div> <div class="content"> <div class="header"> <div class="headertitle"> <h1 class="title">Create and Install Bundles </h1> </div> </div><div class="contents"> <div class="textblock"><p>Build and update system and App or System bundles and upload them to AirVantage to deploy on your target.</p> <h1><a class="anchor" id="avInstall"></a> Create App or System Bundle</h1> <p>AirVantage supports installing App or System bundles over the air to remote targets. The bundle must be created and then packaged by the <a class="el" href="toolsHost_av-pack.html">av-pack</a> tool.</p> <p><code>Av-pack</code> creates a manifest xml file for AirVantage with the binary image ready to upload to the AirVantage server.</p> <p>Example of building an application for deployment through AirVantage: </p><pre class="fragment">$ mkapp -t wp85 helloWorld.adef $ av-pack -u helloWorld.wp85.update -b _build_helloWorld/wp85 -t abcCo.jsmith.helloWorld </pre><p><a class="el" href="buildToolsmkapp.html">mkapp</a> builds the <code>helloWorld</code> app for the <code>wp85</code> target. The update pack file <code>helloWorld.wp85.update</code> and the AirVantage manifest file <code>manifest.app</code> are generated.</p> <p>The <code>manifest.app</code> file is generated under the builds working directory (e.g., <code></code>./_build_helloWorld/wp85 ).</p> <p><a class="el" href="toolsHost_av-pack.html">av-pack</a> packs these two files together and sets the apps <b>type</b> to <code>abcCo.jsmith.helloWorld</code>.</p> <p>Example of building a system for deployment through AirVantage:</p> <pre class="fragment">$ mksys -t wp85 mySystem.sdef $ av-pack -u mySystem.wp85.update -b build/wp85 -t abcCo.jsmith.mySystem </pre><p><a class="el" href="buildToolsmksys.html">mksys</a> builds the <code>mySystem</code> system for the <code>wp85</code> target. The update pack file <code>mySystem.wp85.update</code> and the AirVantage manifest file <code>manifest.sys</code> are generated.</p> <h2><a class="anchor" id="avInstallAppType"></a> Setting an App Type</h2> <p>The App's type must be a globally-unique app type identifier, <b>unique</b> among <b>all</b> <b>Apps</b> in <b>all</b> <b>companies</b> <b>anywhere</b> on AirVantage.</p> <p>Best Practices in uniquely naming type identifiers:</p><ul> <li>Include a unique identifier for your company name to prevent naming conflicts with other companies in the world.</li> <li>For developers Apps, include the developer's name to prevent conflicts with other developers in the same company.</li> </ul> <dl class="section note"><dt>Note</dt><dd>If no type is specified the type defaults to: <code>appName-legato-application</code>.</dd></dl> <p>The output for this sample is <code>helloWorld.zip</code>. and is located in the build root.</p> <h2><a class="anchor" id="avInstallAppSigs"></a> App Signature Checks</h2> <p>If your target device has been configured for App signature checks or to accept only encrypted Apps, you must use your signing/encryption tool to sign the <code></code>.update file and then pack it with <code>av-pack</code>. Don't sign or encrypt the <code>manifest.app</code> file, or the final <code></code>.zip file, as AirVantage won't be able to read them.</p> <pre class="fragment">$ mkapp -t wp85 helloWorld.adef $ cat helloWorld.wp85.update | myAppSigner &gt; helloWorld.wp85.signed $ av-pack -f helloWorld.wp85.signed abcCo.jsmith.helloWorld _build_helloWorld/wp85 </pre><h1><a class="anchor" id="avInstallCreateInstJob"></a> Create Installation job</h1> <p>To install your App on a remote target, you must first upload your app to AirVantage and then Create an App install job to install the App on the remote target.</p> <p>Upload your App:</p><ul> <li>Click "Develop"</li> <li>Choose "My Apps"</li> <li>Click on the "Release" Button, this will guide you through uploading the zip file you made with <code>av-pack</code>.</li> <li>Once the zip file has been uploaded click "Publish"</li> </ul> <p>Create the App install job:</p><ul> <li>In your system 'Monitor' view</li> <li>"More" menu</li> <li>Choose "Install Application" and select the zip file created in the previous step.</li> </ul> <p>AirVantage will then queue the App to be installed on your Target.</p> <h1><a class="anchor" id="avInstallRcvAgent"></a> Receive App on AirVantage Agent</h1> <p>This requires either:</p><ul> <li>creating an <code>avc</code> control App using the LWM2M AVC API that accepts the download and installation. See <a class="el" href="c_le_avc.html">AirVantage Connector API</a> API for details.</li> <li>using AT commands to download and install the update. For information on AT Commands download the AT Command Reference from your module provider. (e.g., <a href="https://source.sierrawireless.com/resources/airprime/software/airprime_wpx5xx_wp76xx_wp77xx_at_command_reference/">AirPrime WPX5XX/WP76XX AT Command Reference</a> ).</li> </ul> <h2><a class="anchor" id="avInstallUploadStatus"></a> Check Success Status on AirVantage</h2> <p>If the installation was successful, you should find <code>helloWorld</code> in the installed Apps and on the targets' "Monitor" view App list in the AirVantage UI.</p> <h2><a class="anchor" id="avInstallUpload_CustomSystem"></a> Uploading a 17.05 Legato System Bundle</h2> <p>If you have upgraded to 17.05 and wish to sync your Legato System with AirVantage, the target and revision number need to be updated in the App model before it is uploaded to the AirVantage Server.</p> <p>Once you've built your legato system, you need to extract the model.app from the zip file and update name="&lt;target&gt;_&lt;legatoVersion&gt;" and revision="&lt;legatoVersion&gt;" with the target and version that matches your Legato System. (e.g., if version = "abc" then update model.app to name="WP8548_17.05.0_abc" and revision="17.05.0_abc")</p> <pre class="fragment">$ cat build/&lt;target&gt;/system/staging/version # displays the version number </pre><p>In the legato_model.zip, extract model.app; modify the name="&lt;target&gt;_&lt;legatoVersion&gt;" and revision="&lt;legatoVersion&gt;" to match the version number in the build.</p> <pre class="fragment">$ unzip -d . legato_model.zip model.app $ vi model.app # edit the two fields $ zip -ur legato_model.zip model.app </pre><p>Once legato_model.zip has been updated, upload to the AirVantage server and publish the model.</p> <p>Sync the AirVantage Server with your target and this will link to your new App model.</p> <p class="copyright">Copyright (C) Sierra Wireless Inc. </p> </div></div> <br clear="left"/> </div> </div> <link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/> <script src="resources/js/tree.jquery.js" type="text/javascript"></script> <script src="resources/js/jquery.cookie.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/> <script src="resources/js/perfect-scrollbar.jquery.min.js"></script> </body> </html>
Java
/*jslint unparam: true, browser: true, indent: 2 */ ;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.dropdown = { name : 'dropdown', version : '4.3.2', settings : { activeClass: 'open', is_hover: false, opened: function(){}, closed: function(){} }, init : function (scope, method, options) { this.scope = scope || this.scope; Foundation.inherit(this, 'throttle scrollLeft data_options'); if (typeof method === 'object') { $.extend(true, this.settings, method); } if (typeof method !== 'string') { if (!this.settings.init) { this.events(); } return this.settings.init; } else { return this[method].call(this, options); } }, events : function () { var self = this; $(this.scope) .on('click.fndtn.dropdown', '[data-dropdown]', function (e) { var settings = $.extend({}, self.settings, self.data_options($(this))); e.preventDefault(); if (!settings.is_hover) self.toggle($(this)); }) .on('mouseenter', '[data-dropdown]', function (e) { var settings = $.extend({}, self.settings, self.data_options($(this))); if (settings.is_hover) self.toggle($(this)); }) .on('mouseleave', '[data-dropdown-content]', function (e) { var target = $('[data-dropdown="' + $(this).attr('id') + '"]'), settings = $.extend({}, self.settings, self.data_options(target)); if (settings.is_hover) self.close.call(self, $(this)); }) .on('opened.fndtn.dropdown', '[data-dropdown-content]', this.settings.opened) .on('closed.fndtn.dropdown', '[data-dropdown-content]', this.settings.closed); $(document).on('click.fndtn.dropdown touchstart.fndtn.dropdown', function (e) { var parent = $(e.target).closest('[data-dropdown-content]'); if ($(e.target).data('dropdown') || $(e.target).parent().data('dropdown')) { return; } if (!($(e.target).data('revealId')) && (parent.length > 0 && ($(e.target).is('[data-dropdown-content]') || $.contains(parent.first()[0], e.target)))) { e.stopPropagation(); return; } self.close.call(self, $('[data-dropdown-content]')); }); $(window).on('resize.fndtn.dropdown', self.throttle(function () { self.resize.call(self); }, 50)).trigger('resize'); this.settings.init = true; }, close: function (dropdown) { var self = this; dropdown.each(function () { if ($(this).hasClass(self.settings.activeClass)) { $(this) .css(Foundation.rtl ? 'right':'left', '-99999px') .removeClass(self.settings.activeClass) .prev('[data-dropdown]') .removeClass(self.settings.activeClass); $(this).trigger('closed'); } }); }, open: function (dropdown, target) { this .css(dropdown .addClass(this.settings.activeClass), target); dropdown.prev('[data-dropdown]').addClass(this.settings.activeClass); dropdown.trigger('opened'); }, toggle : function (target) { var dropdown = $('#' + target.data('dropdown')); if (dropdown.length === 0) { // No dropdown found, not continuing return; } this.close.call(this, $('[data-dropdown-content]').not(dropdown)); if (dropdown.hasClass(this.settings.activeClass)) { this.close.call(this, dropdown); } else { this.close.call(this, $('[data-dropdown-content]')) this.open.call(this, dropdown, target); } }, resize : function () { var dropdown = $('[data-dropdown-content].open'), target = $("[data-dropdown='" + dropdown.attr('id') + "']"); if (dropdown.length && target.length) { this.css(dropdown, target); } }, css : function (dropdown, target) { var offset_parent = dropdown.offsetParent(); // if (offset_parent.length > 0 && /body/i.test(dropdown.offsetParent()[0].nodeName)) { var position = target.offset(); position.top -= offset_parent.offset().top; position.left -= offset_parent.offset().left; // } else { // var position = target.position(); // } if (this.small()) { dropdown.css({ position : 'absolute', width: '95%', 'max-width': 'none', top: position.top + this.outerHeight(target) }); dropdown.css(Foundation.rtl ? 'right':'left', '2.5%'); } else { if (!Foundation.rtl && $(window).width() > this.outerWidth(dropdown) + target.offset().left && !this.data_options(target).align_right) { var left = position.left; if (dropdown.hasClass('right')) { dropdown.removeClass('right'); } } else { if (!dropdown.hasClass('right')) { dropdown.addClass('right'); } var left = position.left - (this.outerWidth(dropdown) - this.outerWidth(target)); } dropdown.attr('style', '').css({ position : 'absolute', top: position.top + this.outerHeight(target), left: left }); } return dropdown; }, small : function () { return $(window).width() < 768 || $('html').hasClass('lt-ie9'); }, off: function () { $(this.scope).off('.fndtn.dropdown'); $('html, body').off('.fndtn.dropdown'); $(window).off('.fndtn.dropdown'); $('[data-dropdown-content]').off('.fndtn.dropdown'); this.settings.init = false; }, reflow : function () {} }; }(Foundation.zj, this, this.document));
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `is_loaded` fn in crate `gleam`."> <meta name="keywords" content="rust, rustlang, rust-lang, is_loaded"> <title>gleam::gl::Uniform1fv::is_loaded - Rust</title> <link rel="stylesheet" type="text/css" href="../../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <p class='location'><a href='../../index.html'>gleam</a>::<wbr><a href='../index.html'>gl</a>::<wbr><a href='index.html'>Uniform1fv</a></p><script>window.sidebarCurrent = {name: 'is_loaded', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'>Function <a href='../../index.html'>gleam</a>::<wbr><a href='../index.html'>gl</a>::<wbr><a href='index.html'>Uniform1fv</a>::<wbr><a class='fn' href=''>is_loaded</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-6731' class='srclink' href='../../../src/gleam/home/servo/buildbot/slave/doc/build/target/debug/build/gleam-8cc6d4d4d5b87928/out/gl_bindings.rs.html#9249-9251' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub fn is_loaded() -&gt; <a class='primitive' href='../../../std/primitive.bool.html'>bool</a></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../../"; window.currentCrate = "gleam"; window.playgroundUrl = ""; </script> <script src="../../../jquery.js"></script> <script src="../../../main.js"></script> <script defer src="../../../search-index.js"></script> </body> </html>
Java
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_a11y_TextLeafAccessibleWrap_h__ #define mozilla_a11y_TextLeafAccessibleWrap_h__ #include "TextLeafAccessible.h" namespace mozilla { namespace a11y { typedef class TextLeafAccessible TextLeafAccessibleWrap; } // namespace a11y } // namespace mozilla #endif
Java
'use strict'; var inheritance = require('./../../helpers/inheritance'), Field = require('./field'); var FilterField = function(){}; inheritance.inherits(Field,FilterField); FilterField.prototype.isOpen = function(){ return this.world.helper.elementGetter(this._root,this._data.elements.body).isDisplayed(); }; FilterField.prototype.accordionSelf = function(status){ var _this=this; switch(status){ case 'open': return _this.isOpen() .then(function(is){ if(!is){ return _this._root.scrollIntoView() .then(function(){ return _this._root.element(by.css('span.filter__sub-title')).click(); }) .then(function(){ return _this.world.helper.elementGetter(_this._root,_this._data.elements.body).waitToBeCompletelyVisibleAndStable(); }); } }); case 'close': return _this.isOpen() .then(function(is){ if(is){ return _this._root.scrollIntoView() .then(function(){ return _this._root.element(by.css('span.filter__sub-title')).click(); }) .then(function(){ return _this.world.helper.elementGetter(_this._root,_this._data.elements.body).waitToBeHidden(); }); } }); default: throw new Error('Wrong status of slider: '+status); } }; module.exports = FilterField;
Java
body { background-color: dimgray; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #00ffff; text-align: center; width: 506px; word-wrap: break-word; } #description { margin: 30px 40px 30px 40px; } #interaction { margin: 0 40px 0 40px; } #eventNameTextField, #iftttTextField { width: 70%; text-align: center; font-size: 16px; height: 30px; } .code { font-family: monospace; } .placeholder { font-style: italic; } #updateButton { width: 100px; height: 30px; margin: 10px; }
Java
define([ 'jquery', 'underscore', 'backbone', 'text!template/login.html', 'models/campus' ], function ($, _, Backbone, LoginTemplate, CampusModel) { var LoginView = Backbone.View.extend({ tagName: 'section', className: 'container', template: _.template(LoginTemplate), events: { 'submit #frm-login': 'frmLoginOnSubmit', 'click #chk-password': 'chkPasswordOnCheck' }, render: function () { this.el.innerHTML = this.template(); return this; }, frmLoginOnSubmit: function (e) { e.preventDefault(); var self = this; var hostName = self.$('#txt-hostname').val().trim(); var username = self.$('#txt-username').val().trim(); var password = self.$('#txt-password').val().trim(); if (!hostName) { return; } if (!username) { return; } if (!password) { return; } self.$('#btn-submit').prop('disabled', true); var checkingLogin = $.post(hostName + '/main/webservices/rest.php', { action: 'loginNewMessages', username: username, password: password }); $.when(checkingLogin).done(function (response) { if (!response.status) { self.$('#btn-submit').prop('disabled', false); return; } var campusModel = new CampusModel({ url: hostName, username: username, apiKey: response.apiKey }); var savingCampus = campusModel.save(); $.when(savingCampus).done(function () { window.location.reload(); }); $.when(savingCampus).fail(function () { self.$('#btn-submit').prop('disabled', false); }); }); $.when(checkingLogin).fail(function () { self.$('#btn-submit').prop('disabled', false); }); }, chkPasswordOnCheck: function (e) { var inputType = e.target.checked ? 'text' : 'password'; this.$('#txt-password').attr('type', inputType); } }); return LoginView; });
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `XKB_KEY_KP_0` constant in crate `wayland_kbd`."> <meta name="keywords" content="rust, rustlang, rust-lang, XKB_KEY_KP_0"> <title>wayland_kbd::keysyms::XKB_KEY_KP_0 - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>wayland_kbd</a>::<wbr><a href='index.html'>keysyms</a></p><script>window.sidebarCurrent = {name: 'XKB_KEY_KP_0', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>wayland_kbd</a>::<wbr><a href='index.html'>keysyms</a>::<wbr><a class='constant' href=''>XKB_KEY_KP_0</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-284' class='srclink' href='../../src/wayland_kbd/ffi/keysyms.rs.html#237' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const XKB_KEY_KP_0: <a href='../../std/primitive.u32.html'>u32</a><code> = </code><code>0xffb0</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "wayland_kbd"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
Java
using System; namespace Consumer.Samples.Queries { public class DateIdQuery { public DateTime? StartDate { get; set; } public DateTime? EndDate { get; set; } public int? Id { get; set; } } }
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `VertexAttrib2d` mod in crate `gleam`."> <meta name="keywords" content="rust, rustlang, rust-lang, VertexAttrib2d"> <title>gleam::gl::VertexAttrib2d - Rust</title> <link rel="stylesheet" type="text/css" href="../../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <p class='location'><a href='../../index.html'>gleam</a>::<wbr><a href='../index.html'>gl</a></p><script>window.sidebarCurrent = {name: 'VertexAttrib2d', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content mod"> <h1 class='fqn'><span class='in-band'>Module <a href='../../index.html'>gleam</a>::<wbr><a href='../index.html'>gl</a>::<wbr><a class='mod' href=''>VertexAttrib2d</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-7215' class='srclink' href='../../../src/gleam/home/servo/buildbot/slave/doc/build/target/debug/build/gleam-8cc6d4d4d5b87928/out/gl_bindings.rs.html#10523-10540' title='goto source code'>[src]</a></span></h1> <h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2> <table> <tr class=' module-item'> <td><a class='fn' href='fn.is_loaded.html' title='gleam::gl::VertexAttrib2d::is_loaded'>is_loaded</a></td> <td class='docblock short'> </td> </tr> <tr class=' module-item'> <td><a class='fn' href='fn.load_with.html' title='gleam::gl::VertexAttrib2d::load_with'>load_with</a></td> <td class='docblock short'> </td> </tr></table></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../../"; window.currentCrate = "gleam"; window.playgroundUrl = ""; </script> <script src="../../../jquery.js"></script> <script src="../../../main.js"></script> <script defer src="../../../search-index.js"></script> </body> </html>
Java
<iframe src=foo.html height=400></iframe>
Java
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mozilla.javascript.tests; import org.mozilla.javascript.Context; import org.mozilla.javascript.drivers.LanguageVersion; import org.mozilla.javascript.drivers.RhinoTest; import org.mozilla.javascript.drivers.ScriptTestsBase; @RhinoTest("testsrc/jstests/math-max-min-every-element-to-number.js") @LanguageVersion(Context.VERSION_DEFAULT) public class MathMaxMinEveryElementToNumber extends ScriptTestsBase { }
Java
//Copyright (c) 2017 Finjin // //This file is part of Finjin Engine (finjin-engine). // //Finjin Engine 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. // //This Source Code Form is subject to the terms of the Mozilla Public //License, v. 2.0. If a copy of the MPL was not distributed with this //file, You can obtain one at http://mozilla.org/MPL/2.0/. //Includes---------------------------------------------------------------------- #include "FinjinPrecompiled.hpp" #include "XInputGameController.hpp" #include "finjin/common/Convert.hpp" #include "finjin/common/Math.hpp" #include "finjin/engine/GenericInputDevice.hpp" #include <Windows.h> #include <Xinput.h> using namespace Finjin::Engine; //Macros------------------------------------------------------------------------ #define XINPUT_AXIS_MAGNITUDE 32767 #define XINPUT_TRIGGER_MAGNITUDE 255 //Local functions--------------------------------------------------------------- static size_t XInputButtonToButtonIndex(WORD xinputButtonCode) { size_t buttonIndex = 0; for (xinputButtonCode >>= 1; xinputButtonCode != 0; xinputButtonCode >>= 1) buttonIndex++; return buttonIndex; } template <size_t count> void SetXInputButton(StaticVector<InputButton, count>& buttons, WORD xinputButton, const char* displayName, InputComponentSemantic semantic) { auto buttonIndex = XInputButtonToButtonIndex(xinputButton); assert(buttonIndex < buttons.size()); buttons[buttonIndex] .SetIndex(buttonIndex) .SetCode(xinputButton) .SetDisplayName(displayName) .SetSemantic(semantic) .Enable(true); } template <size_t count> void SetXInputAxis(StaticVector<InputAxis, count>& axes, size_t index, float minValue, float maxValue, float deadZone, const char* displayName, InputComponentSemantic semantic) { axes[index] .SetIndex(index) .SetMinMax(minValue, maxValue) .SetDeadZone(deadZone) .SetDisplayName(displayName) .SetSemantic(semantic) .SetProcessing(InputAxisProcessing::NORMALIZE); } static Utf8String XInputSubtypeToString(BYTE subtype) { #if _WIN32_WINNT >= _WIN32_WINNT_WIN8 switch (subtype) { case XINPUT_DEVSUBTYPE_GAMEPAD: return "xinput-gamepad"; case XINPUT_DEVSUBTYPE_WHEEL: return "xinput-wheel"; case XINPUT_DEVSUBTYPE_ARCADE_STICK: return "xinput-arcade-stick"; case XINPUT_DEVSUBTYPE_FLIGHT_STICK: return "xinput-flight-stick"; case XINPUT_DEVSUBTYPE_DANCE_PAD: return "xinput-dance-pad"; case XINPUT_DEVSUBTYPE_GUITAR: return "xinput-guitar"; case XINPUT_DEVSUBTYPE_GUITAR_ALTERNATE: return "xinput-guitar-alt"; case XINPUT_DEVSUBTYPE_DRUM_KIT: return "xinput-drum-kit"; case XINPUT_DEVSUBTYPE_GUITAR_BASS: return "xinput-guitar-bass"; case XINPUT_DEVSUBTYPE_ARCADE_PAD: return "xinput-arcade-pad"; default: return "xinput-gamepad"; } #else return "xinput-gamepad"; #endif } //Local types------------------------------------------------------------------- struct XInputGameController::Impl : public GenericInputDeviceImpl { using Super = GenericInputDeviceImpl; Impl() { this->index = 0; FINJIN_ZERO_ITEM(this->xinputState); } void Reset() { Super::Reset(); this->index = 0; FINJIN_ZERO_ITEM(this->xinputState); this->state.Reset(); } size_t index; XINPUT_CAPABILITIES xinputCapabilities; XINPUT_STATE xinputState; InputDeviceState<InputButton, InputAxis, InputPov, GameControllerConstants::MAX_BUTTON_COUNT, GameControllerConstants::MAX_AXIS_COUNT> state; std::array<HapticFeedback, 2> forceFeedback; //0 = left motor, 1 = right motor }; //Implementation---------------------------------------------------------------- //XInputGameController XInputGameController::XInputGameController() : impl(new Impl) { Reset(); } XInputGameController::~XInputGameController() { } void XInputGameController::Reset() { impl->Reset(); } bool XInputGameController::Create(size_t index) { impl->index = index; impl->instanceName = "XInput Game Controller "; impl->instanceName += Convert::ToString(impl->index + 1); impl->productName = "XInput Game Controller"; impl->displayName = impl->productName; BYTE subtype = XINPUT_DEVSUBTYPE_GAMEPAD; FINJIN_ZERO_ITEM(impl->xinputCapabilities); auto capsResult = XInputGetCapabilities(static_cast<DWORD>(impl->index), XINPUT_FLAG_GAMEPAD, &impl->xinputCapabilities); if (capsResult == 0) { subtype = impl->xinputCapabilities.SubType; impl->state.isConnected = true; XInputGetState(static_cast<DWORD>(impl->index), &impl->xinputState); } else { FINJIN_ZERO_ITEM(impl->xinputState); } impl->productDescriptor = XInputSubtypeToString(subtype); impl->instanceDescriptor = impl->productDescriptor; impl->instanceDescriptor += "-"; impl->instanceDescriptor += Convert::ToString(index); //Buttons impl->state.buttons.resize(sizeof(impl->xinputState.Gamepad.wButtons) * 8); //Button codes are irrengularly defined, so initialize all to disabled, then enable one by one for (auto& button : impl->state.buttons) button.Enable(false); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_A, "A", InputComponentSemantic::ACCEPT); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_B, "B", InputComponentSemantic::CANCEL); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_X, "X", InputComponentSemantic::HANDBRAKE); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_Y, "Y", InputComponentSemantic::CHANGE_VIEW); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_LEFT_SHOULDER, "Left shoulder button", InputComponentSemantic::SHIFT_LEFT); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_RIGHT_SHOULDER, "Right shoulder button", InputComponentSemantic::SHIFT_RIGHT); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_LEFT_THUMB, "Left thumbstick button", InputComponentSemantic::STEER_TOGGLE); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_RIGHT_THUMB, "Right thumbstick button", InputComponentSemantic::LOOK_TOGGLE); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_START, "Start", InputComponentSemantic::SETTINGS); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_BACK, "Back", InputComponentSemantic::SYSTEM_SETTINGS); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_DPAD_UP, "D-pad up", InputComponentSemantic::TOGGLE_UP); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_DPAD_DOWN, "D-pad down", InputComponentSemantic::TOGGLE_DOWN); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_DPAD_LEFT, "D-pad left", InputComponentSemantic::TOGGLE_LEFT); SetXInputButton(impl->state.buttons, XINPUT_GAMEPAD_DPAD_RIGHT, "D-pad right", InputComponentSemantic::TOGGLE_RIGHT); //Axes impl->state.axes.resize(6); SetXInputAxis(impl->state.axes, 0, -XINPUT_AXIS_MAGNITUDE, XINPUT_AXIS_MAGNITUDE, XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, "Left thumbstick X", InputComponentSemantic::STEER_LEFT_RIGHT); SetXInputAxis(impl->state.axes, 1, -XINPUT_AXIS_MAGNITUDE, XINPUT_AXIS_MAGNITUDE, XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, "Left thumbstick Y", InputComponentSemantic::STEER_UP_DOWN); SetXInputAxis(impl->state.axes, 2, -XINPUT_AXIS_MAGNITUDE, XINPUT_AXIS_MAGNITUDE, XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE, "Right thumbstick X", InputComponentSemantic::LOOK_LEFT_RIGHT); SetXInputAxis(impl->state.axes, 3, -XINPUT_AXIS_MAGNITUDE, XINPUT_AXIS_MAGNITUDE, XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE, "Right thumbstick Y", InputComponentSemantic::LOOK_UP_DOWN); SetXInputAxis(impl->state.axes, 4, 0, XINPUT_TRIGGER_MAGNITUDE, XINPUT_GAMEPAD_TRIGGER_THRESHOLD, "Left trigger", InputComponentSemantic::BRAKE); SetXInputAxis(impl->state.axes, 5, 0, XINPUT_TRIGGER_MAGNITUDE, XINPUT_GAMEPAD_TRIGGER_THRESHOLD, "Right trigger", InputComponentSemantic::GAS); return true; } void XInputGameController::Destroy() { Reset(); } void XInputGameController::Update(SimpleTimeDelta elapsedTime, bool isFirstUpdate) { impl->state.connectionChanged = false; if (impl->state.isConnected) { if (XInputGetState(static_cast<DWORD>(impl->index), &impl->xinputState) == 0) { _AcceptUpdate(isFirstUpdate); _SetForce(); for (auto& forceFeedback : impl->forceFeedback) { if (forceFeedback.IsActive()) forceFeedback.Update(elapsedTime); } } else { //Became disconnected impl->state.isConnected = false; impl->state.connectionChanged = true; FINJIN_ZERO_ITEM(impl->xinputState); for (auto& button : impl->state.buttons) button.Update(false, isFirstUpdate); for (auto& axis : impl->state.axes) axis.Update(0, isFirstUpdate); StopHapticFeedback(); } } else { if (XInputGetCapabilities(static_cast<DWORD>(impl->index), XINPUT_FLAG_GAMEPAD, &impl->xinputCapabilities) == 0 && XInputGetState(static_cast<DWORD>(impl->index), &impl->xinputState) == 0) { //Became connected impl->state.isConnected = true; impl->state.connectionChanged = !isFirstUpdate && true; _AcceptUpdate(isFirstUpdate); } } } void XInputGameController::ClearChanged() { impl->state.ClearChanged(); } bool XInputGameController::IsConnected() const { return impl->state.isConnected; } bool XInputGameController::GetConnectionChanged() const { return impl->state.connectionChanged; } size_t XInputGameController::GetIndex() const { return impl->index; } const Utf8String& XInputGameController::GetDisplayName() const { return impl->displayName; } void XInputGameController::SetDisplayName(const Utf8String& value) { impl->displayName = value; } InputDeviceSemantic XInputGameController::GetSemantic() const { return impl->semantic; } void XInputGameController::SetSemantic(InputDeviceSemantic value) { impl->semantic = value; } const Utf8String& XInputGameController::GetProductDescriptor() const { return impl->productDescriptor; } const Utf8String& XInputGameController::GetInstanceDescriptor() const { return impl->instanceDescriptor; } void XInputGameController::_AcceptUpdate(bool isFirstUpdate) { //Buttons for (WORD i = 0; i < impl->state.buttons.size(); i++) impl->state.buttons[i].Update((impl->xinputState.Gamepad.wButtons & (1 << i)) != 0, isFirstUpdate); //Axes impl->state.axes[0].Update(impl->xinputState.Gamepad.sThumbLX, isFirstUpdate); impl->state.axes[1].Update(impl->xinputState.Gamepad.sThumbLY, isFirstUpdate); impl->state.axes[2].Update(impl->xinputState.Gamepad.sThumbRX, isFirstUpdate); impl->state.axes[3].Update(impl->xinputState.Gamepad.sThumbRY, isFirstUpdate); impl->state.axes[4].Update(impl->xinputState.Gamepad.bLeftTrigger, isFirstUpdate); impl->state.axes[5].Update(impl->xinputState.Gamepad.bRightTrigger, isFirstUpdate); } size_t XInputGameController::GetAxisCount() const { return impl->state.axes.size(); } InputAxis* XInputGameController::GetAxis(size_t axisIndex) { return &impl->state.axes[axisIndex]; } size_t XInputGameController::GetButtonCount() const { return impl->state.buttons.size(); } InputButton* XInputGameController::GetButton(size_t buttonIndex) { return &impl->state.buttons[buttonIndex]; } size_t XInputGameController::GetPovCount() const { return 0; } InputPov* XInputGameController::GetPov(size_t povIndex) { return nullptr; } size_t XInputGameController::GetLocatorCount() const { return 0; } InputLocator* XInputGameController::GetLocator(size_t locatorIndex) { return nullptr; } void XInputGameController::AddHapticFeedback(const HapticFeedback* forces, size_t count) { for (size_t forceIndex = 0; forceIndex < count; forceIndex++) { auto& force = forces[forceIndex]; switch (force.motorIndex) { case 0: impl->forceFeedback[0] = force; break; case 1: impl->forceFeedback[1] = force; break; case -1: impl->forceFeedback[0] = impl->forceFeedback[1] = force; break; } } } void XInputGameController::StopHapticFeedback() { //Don't pause the game or deactive the window without first stopping rumble otherwise the controller will continue to rumble XINPUT_VIBRATION vibration; vibration.wLeftMotorSpeed = 0; vibration.wRightMotorSpeed = 0; XInputSetState(static_cast<DWORD>(impl->index), &vibration); impl->forceFeedback[0].Reset(); impl->forceFeedback[1].Reset(); } size_t XInputGameController::CreateGameControllers(XInputGameController* gameControllers, size_t gameControllerCount) { gameControllerCount = std::min(gameControllerCount, (size_t)XUSER_MAX_COUNT); for (size_t gameControllerIndex = 0; gameControllerIndex < gameControllerCount; gameControllerIndex++) gameControllers[gameControllerIndex].Create(gameControllerIndex); return gameControllerCount; } size_t XInputGameController::UpdateGameControllers(SimpleTimeDelta elapsedTime, XInputGameController* gameControllers, size_t gameControllerCount) { for (size_t gameControllerIndex = 0; gameControllerIndex < gameControllerCount; gameControllerIndex++) gameControllers[gameControllerIndex].Update(elapsedTime, false); return gameControllerCount; } XInputGameController* XInputGameController::GetGameControllerByInstanceDescriptor(XInputGameController* gameControllers, size_t gameControllerCount, const Utf8String& descriptor) { for (size_t gameControllerIndex = 0; gameControllerIndex < gameControllerCount; gameControllerIndex++) { if (gameControllers[gameControllerIndex].GetInstanceDescriptor() == descriptor) return &gameControllers[gameControllerIndex]; } return nullptr; } XInputGameController* XInputGameController::GetGameControllerByIndex(XInputGameController* gameControllers, size_t gameControllerCount, size_t deviceIndex) { return &gameControllers[deviceIndex]; } void XInputGameController::_SetForce() { XINPUT_VIBRATION vibration; vibration.wLeftMotorSpeed = RoundToInt((impl->forceFeedback[0].duration > 0 ? impl->forceFeedback[0].intensity : 0.0f) * 65535); vibration.wRightMotorSpeed = RoundToInt((impl->forceFeedback[1].duration > 0 ? impl->forceFeedback[1].intensity : 0.0f) * 65535); XInputSetState(static_cast<DWORD>(impl->index), &vibration); }
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `XKB_KEY_XF86Battery` constant in crate `wayland_kbd`."> <meta name="keywords" content="rust, rustlang, rust-lang, XKB_KEY_XF86Battery"> <title>wayland_kbd::keysyms::XKB_KEY_XF86Battery - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>wayland_kbd</a>::<wbr><a href='index.html'>keysyms</a></p><script>window.sidebarCurrent = {name: 'XKB_KEY_XF86Battery', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../index.html'>wayland_kbd</a>::<wbr><a href='index.html'>keysyms</a>::<wbr><a class='constant' href=''>XKB_KEY_XF86Battery</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-6716' class='srclink' href='../../src/wayland_kbd/ffi/keysyms.rs.html#2616' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const XKB_KEY_XF86Battery: <a href='../../std/primitive.u32.html'>u32</a><code> = </code><code>0x1008FF93</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "wayland_kbd"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
Java
// // Aspia Project // Copyright (C) 2018 Dmitry Chapyshev <dmitry@aspia.ru> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // #include "console/update_settings_dialog.h" #include "build/build_config.h" #include "console/console_settings.h" namespace console { UpdateSettingsDialog::UpdateSettingsDialog(QWidget* parent) : QDialog(parent) { ui.setupUi(this); Settings settings; ui.checkbox_check_updates->setChecked(settings.checkUpdates()); ui.edit_server->setText(settings.updateServer()); if (settings.updateServer() == DEFAULT_UPDATE_SERVER) { ui.checkbox_custom_server->setChecked(false); ui.edit_server->setEnabled(false); } else { ui.checkbox_custom_server->setChecked(true); ui.edit_server->setEnabled(true); } connect(ui.checkbox_custom_server, &QCheckBox::toggled, [this](bool checked) { ui.edit_server->setEnabled(checked); if (!checked) ui.edit_server->setText(DEFAULT_UPDATE_SERVER); }); connect(ui.button_box, &QDialogButtonBox::clicked, [this](QAbstractButton* button) { if (ui.button_box->standardButton(button) == QDialogButtonBox::Ok) { Settings settings; settings.setCheckUpdates(ui.checkbox_check_updates->isChecked()); settings.setUpdateServer(ui.edit_server->text()); } close(); }); } UpdateSettingsDialog::~UpdateSettingsDialog() = default; } // namespace console
Java
<?php /** * Copyright (C) 2014 Ready Business System * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ namespace Rbs\Workflow\Documents; use Change\Workflow\Validator; /** * @name \Rbs\Workflow\Documents\Workflow */ class Workflow extends \Compilation\Rbs\Workflow\Documents\Workflow implements \Change\Workflow\Interfaces\Workflow { /** * @var array */ protected $items; /** * Return Short name * @return string */ public function getName() { return $this->getLabel(); } /** * @return \DateTime|null */ public function getStartDate() { return $this->getStartActivation(); } /** * @return \DateTime|null */ public function getEndDate() { return $this->getEndActivation(); } /** * @return string */ public function startTask() { return $this->getStartTask(); } /** * Return all Workflow items defined * @return \Change\Workflow\Interfaces\WorkflowItem[] */ public function getItems() { if ($this->items === null) { $s = new \Rbs\Workflow\Std\Serializer(); $this->items = $s->unserializeItems($this, $this->getItemsData()); } return $this->items; } /** * @param boolean $identify * @return \Rbs\Workflow\Std\Place */ public function getNewPlace($identify = true) { $place = new \Rbs\Workflow\Std\Place($this); if ($identify) { $place->setId($this->nextId()); $this->addItem($place); } return $place; } /** * @param boolean $identify * @return \Rbs\Workflow\Std\Transition */ public function getNewTransition($identify = true) { $transition = new \Rbs\Workflow\Std\Transition($this); if ($identify) { $transition->setId($this->nextId()); $this->addItem($transition); } return $transition; } /** * @param boolean $identify * @return \Rbs\Workflow\Std\Arc */ public function getNewArc($identify = true) { $arc = new \Rbs\Workflow\Std\Arc($this); if ($identify) { $arc->setId($this->nextId()); $this->addItem($arc); } return $arc; } /** * @return integer */ public function nextId() { $lastId = 0; foreach ($this->getItems() as $item) { if ($item instanceof \Change\Workflow\Interfaces\WorkflowItem) { $lastId = max($lastId, $item->getId()); } } return $lastId + 1; } /** * @param integer $id * @return \Change\Workflow\Interfaces\WorkflowItem|null */ public function getItemById($id) { if ($id !== null) { foreach ($this->getItems() as $item) { if ($item instanceof \Change\Workflow\Interfaces\WorkflowItem && $item->getId() === $id) { return $item; } } } return null; } /** * @param \Change\Workflow\Interfaces\WorkflowItem $item * @throws \RuntimeException * @return $this */ public function addItem(\Change\Workflow\Interfaces\WorkflowItem $item) { $items = $this->getItems(); if (!in_array($item, $items, true)) { if ($item->getWorkflow() !== $this) { throw new \RuntimeException('Invalid item Workflow', 999999); } if (!$item->getId()) { throw new \RuntimeException('Empty item Id', 999999); } if (!is_int($item->getId()) || $this->getItemById($item->getId()) !== null) { throw new \RuntimeException('Invalid item Id', 999999); } $items[] = $item; $this->setItems($items); } return $this; } /** * @param \Change\Workflow\Interfaces\WorkflowItem[] $items */ protected function setItems(array $items) { $this->items = $items; } /** * @return $this */ protected function serializeItems() { if ($this->items !== null) { $s = new \Rbs\Workflow\Std\Serializer(); $array = $s->serializeItems($this->items); $this->setItemsData(count($array) ? $array : null); } return $this; } /** * @return boolean */ public function isValid() { $validator = new Validator(); try { $validator->isValid($this); } catch (\Exception $e) { $this->setErrors($e->getMessage()); return false; } $this->setErrors(null); return true; } public function reset() { parent::reset(); $this->items = null; } protected function onCreate() { $this->serializeItems(); } protected function onUpdate() { $this->serializeItems(); } /** * @return \Rbs\Workflow\Documents\WorkflowInstance */ public function createWorkflowInstance() { /* @var $workflowInstance \Rbs\Workflow\Documents\WorkflowInstance */ $workflowInstance = $this->getDocumentManager()->getNewDocumentInstanceByModelName('Rbs_Workflow_WorkflowInstance'); $workflowInstance->setWorkflow($this); return $workflowInstance; } /** * @param \Change\Documents\Events\Event $event */ public function onDefaultUpdateRestResult(\Change\Documents\Events\Event $event) { parent::onDefaultUpdateRestResult($event); $document = $event->getDocument(); if (!$document instanceof Workflow) { return; } $restResult = $event->getParam('restResult'); if ($restResult instanceof \Change\Http\Rest\V1\Resources\DocumentResult) { $restResult->removeRelAction('delete'); } elseif ($restResult instanceof \Change\Http\Rest\V1\Resources\DocumentLink) { $restResult->removeRelAction('delete'); } } }
Java
const AWS = require('aws-sdk'); const s3 = new AWS.S3(); const conf = require('./config'); const { tmpdir } = require('os'); const fs = require('fs'); const path = require('path'); const mozlog = require('./log'); const log = mozlog('send.storage'); const redis = require('redis'); const redis_client = redis.createClient({ host: conf.redis_host, connect_timeout: 10000 }); redis_client.on('error', err => { log.error('Redis:', err); }); let tempDir = null; if (conf.s3_bucket) { module.exports = { filename: filename, exists: exists, ttl: ttl, length: awsLength, get: awsGet, set: awsSet, setField: setField, delete: awsDelete, forceDelete: awsForceDelete, ping: awsPing, flushall: flushall, quit: quit, metadata }; } else { tempDir = fs.mkdtempSync(`${tmpdir()}${path.sep}send-`); log.info('tempDir', tempDir); module.exports = { filename: filename, exists: exists, ttl: ttl, length: localLength, get: localGet, set: localSet, setField: setField, delete: localDelete, forceDelete: localForceDelete, ping: localPing, flushall: flushall, quit: quit, metadata }; } function flushall() { redis_client.flushdb(); } function quit() { redis_client.quit(); } function metadata(id) { return new Promise((resolve, reject) => { redis_client.hgetall(id, (err, reply) => { if (err || !reply) { return reject(err); } resolve(reply); }); }); } function ttl(id) { return new Promise((resolve, reject) => { redis_client.ttl(id, (err, reply) => { if (err || !reply) { return reject(err); } resolve(reply * 1000); }); }); } function filename(id) { return new Promise((resolve, reject) => { redis_client.hget(id, 'filename', (err, reply) => { if (err || !reply) { return reject(); } resolve(reply); }); }); } function exists(id) { return new Promise((resolve, reject) => { redis_client.exists(id, (rediserr, reply) => { if (reply === 1 && !rediserr) { resolve(); } else { reject(rediserr); } }); }); } function setField(id, key, value) { redis_client.hset(id, key, value); } function localLength(id) { return new Promise((resolve, reject) => { try { resolve(fs.statSync(path.join(tempDir, id)).size); } catch (err) { reject(); } }); } function localGet(id) { return fs.createReadStream(path.join(tempDir, id)); } function localSet(newId, file, filename, meta) { return new Promise((resolve, reject) => { const filepath = path.join(tempDir, newId); const fstream = fs.createWriteStream(filepath); file.pipe(fstream); file.on('limit', () => { file.unpipe(fstream); fstream.destroy(new Error('limit')); }); fstream.on('finish', () => { redis_client.hmset(newId, meta); redis_client.expire(newId, conf.expire_seconds); log.info('localSet:', 'Upload Finished of ' + newId); resolve(meta.delete); }); fstream.on('error', err => { log.error('localSet:', 'Failed upload of ' + newId); fs.unlinkSync(filepath); reject(err); }); }); } function localDelete(id, delete_token) { return new Promise((resolve, reject) => { redis_client.hget(id, 'delete', (err, reply) => { if (!reply || delete_token !== reply) { reject(); } else { redis_client.del(id); log.info('Deleted:', id); resolve(fs.unlinkSync(path.join(tempDir, id))); } }); }); } function localForceDelete(id) { return new Promise((resolve, reject) => { redis_client.del(id); resolve(fs.unlinkSync(path.join(tempDir, id))); }); } function localPing() { return new Promise((resolve, reject) => { redis_client.ping(err => { return err ? reject() : resolve(); }); }); } function awsLength(id) { const params = { Bucket: conf.s3_bucket, Key: id }; return new Promise((resolve, reject) => { s3.headObject(params, function(err, data) { if (!err) { resolve(data.ContentLength); } else { reject(); } }); }); } function awsGet(id) { const params = { Bucket: conf.s3_bucket, Key: id }; try { return s3.getObject(params).createReadStream(); } catch (err) { return null; } } function awsSet(newId, file, filename, meta) { const params = { Bucket: conf.s3_bucket, Key: newId, Body: file }; let hitLimit = false; const upload = s3.upload(params); file.on('limit', () => { hitLimit = true; upload.abort(); }); return upload.promise().then( () => { redis_client.hmset(newId, meta); redis_client.expire(newId, conf.expire_seconds); }, err => { if (hitLimit) { throw new Error('limit'); } else { throw err; } } ); } function awsDelete(id, delete_token) { return new Promise((resolve, reject) => { redis_client.hget(id, 'delete', (err, reply) => { if (!reply || delete_token !== reply) { reject(); } else { const params = { Bucket: conf.s3_bucket, Key: id }; s3.deleteObject(params, function(err, _data) { redis_client.del(id); err ? reject(err) : resolve(err); }); } }); }); } function awsForceDelete(id) { return new Promise((resolve, reject) => { const params = { Bucket: conf.s3_bucket, Key: id }; s3.deleteObject(params, function(err, _data) { redis_client.del(id); err ? reject(err) : resolve(); }); }); } function awsPing() { return localPing().then(() => s3.headBucket({ Bucket: conf.s3_bucket }).promise() ); }
Java
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from socorro.lib import datetimeutil from socorro.unittest.external.es.base import ( ElasticsearchTestCase, SuperSearchWithFields, minimum_es_version, ) # Uncomment these lines to decrease verbosity of the elasticsearch library # while running unit tests. # import logging # logging.getLogger('elasticsearch').setLevel(logging.ERROR) # logging.getLogger('requests').setLevel(logging.ERROR) class IntegrationTestAnalyzers(ElasticsearchTestCase): """Test the custom analyzers we create in our indices. """ def setUp(self): super(IntegrationTestAnalyzers, self).setUp() self.api = SuperSearchWithFields(config=self.config) self.now = datetimeutil.utc_now() @minimum_es_version('1.0') def test_semicolon_keywords(self): """Test the analyzer called `semicolon_keywords`. That analyzer creates tokens (terms) by splitting the input on semicolons (;) only. """ self.index_crash({ 'date_processed': self.now, 'app_init_dlls': '/path/to/dll;;foo;C:\\bar\\boo', }) self.index_crash({ 'date_processed': self.now, 'app_init_dlls': '/path/to/dll;D:\\bar\\boo', }) self.refresh_index() res = self.api.get( app_init_dlls='/path/to/dll', _facets=['app_init_dlls'], ) assert res['total'] == 2 assert 'app_init_dlls' in res['facets'] facet_terms = [x['term'] for x in res['facets']['app_init_dlls']] assert '/path/to/dll' in facet_terms assert 'c:\\bar\\boo' in facet_terms assert 'foo' in facet_terms
Java
namespace Doctran.Test.XmlSerialization { using Doctran.Parsing; internal class TestClass : ITestClass { public TestClass(bool shouldCreate = true) { this.ShouldCreate = shouldCreate; } public string ObjectName => "Test Class"; public IContainer Parent { get; set; } public bool ShouldCreate { get; } } }
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `MS_SYNC` constant in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, MS_SYNC"> <title>libc::consts::os::posix88::MS_SYNC - Rust</title> <link rel="stylesheet" type="text/css" href="../../../../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <a href='../../../../libc/index.html'><img src='http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a> <p class='location'><a href='../../../index.html'>libc</a>::<wbr><a href='../../index.html'>consts</a>::<wbr><a href='../index.html'>os</a>::<wbr><a href='index.html'>posix88</a></p><script>window.sidebarCurrent = {name: 'MS_SYNC', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../../../index.html'>libc</a>::<wbr><a href='../../index.html'>consts</a>::<wbr><a href='../index.html'>os</a>::<wbr><a href='index.html'>posix88</a>::<wbr><a class='constant' href=''>MS_SYNC</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-1832' class='srclink' href='../../../../src/libc/lib.rs.html#2929' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const MS_SYNC: <a class='type' href='../../../../libc/types/os/arch/c95/type.c_int.html' title='libc::types::os::arch::c95::c_int'>c_int</a><code> = </code><code>0x0004</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../../../"; window.currentCrate = "libc"; window.playgroundUrl = "http://play.rust-lang.org/"; </script> <script src="../../../../jquery.js"></script> <script src="../../../../main.js"></script> <script src="../../../../playpen.js"></script> <script async src="../../../../search-index.js"></script> </body> </html>
Java
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef nsPrintOptionsGTK_h__ #define nsPrintOptionsGTK_h__ #include "nsPrintOptionsImpl.h" namespace mozilla { namespace embedding { class PrintData; } // namespace embedding } // namespace mozilla //***************************************************************************** //*** nsPrintOptions //***************************************************************************** class nsPrintOptionsGTK : public nsPrintOptions { public: nsPrintOptionsGTK(); virtual ~nsPrintOptionsGTK(); NS_IMETHODIMP SerializeToPrintData(nsIPrintSettings* aSettings, nsIWebBrowserPrint* aWBP, mozilla::embedding::PrintData* data); NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data, nsIPrintSettings* settings); virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval); }; #endif /* nsPrintOptions_h__ */
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `MADV_DODUMP` constant in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, MADV_DODUMP"> <title>libc::unix::linux::other::MADV_DODUMP - Rust</title> <link rel="stylesheet" type="text/css" href="../../../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../../../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../../../../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'><a href='../../../index.html'>libc</a>::<wbr><a href='../../index.html'>unix</a>::<wbr><a href='../index.html'>linux</a>::<wbr><a href='index.html'>other</a></p><script>window.sidebarCurrent = {name: 'MADV_DODUMP', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../../../index.html'>libc</a>::<wbr><a href='../../index.html'>unix</a>::<wbr><a href='../index.html'>linux</a>::<wbr><a href='index.html'>other</a>::<wbr><a class='constant' href=''>MADV_DODUMP</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-3061' class='srclink' href='../../../../src/libc/unix/notbsd/linux/other/mod.rs.html#415' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const MADV_DODUMP: <a class='type' href='../../../../libc/type.c_int.html' title='libc::c_int'>c_int</a><code> = </code><code>17</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../../../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../../../../jquery.js"></script> <script src="../../../../main.js"></script> <script defer src="../../../../search-index.js"></script> </body> </html>
Java
<!DOCTYPE html> <!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` --> <html> <head> <title>Referrer-Policy: Referrer Policy is set to 'strict-origin-when-cross-origin'</title> <meta charset='utf-8'> <meta name="description" content="Check that a priori insecure subresource gets no referrer information. Otherwise, cross-origin subresources get the origin portion of the referrer URL and same-origin get the stripped referrer URL."> <link rel="author" title="Kristijan Burnik" href="burnik@chromium.org"> <link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-strict-origin-when-cross-origin"> <meta name="assert" content="Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/common/security-features/resources/common.sub.js"></script> <script src="../../../../generic/test-case.sub.js"></script> </head> <body> <script> TestCase( { "expectation": "origin", "origin": "cross-https", "redirection": "no-redirect", "source_context_list": [ { "policyDeliveries": [], "sourceContextType": "srcdoc" } ], "source_scheme": "http", "subresource": "a-tag", "subresource_policy_deliveries": [] }, document.querySelector("meta[name=assert]").content, new SanityChecker() ).start(); </script> <div id="log"></div> </body> </html>
Java
package com.opentrain.app; import android.test.InstrumentationTestCase; import com.opentrain.app.network.NetowrkManager; import java.util.concurrent.CountDownLatch; /** * Created by noam on 27/07/15. */ public class ServerRequestsTest extends InstrumentationTestCase { CountDownLatch countDownLatch = new CountDownLatch(1); public void test1GetMapFromServer() throws Throwable { NetowrkManager.getInstance().getMapFromServer(new NetowrkManager.RequestListener() { @Override public void onResponse(Object response) { assertNotNull(response); countDownLatch.countDown(); } @Override public void onError() { fail(); countDownLatch.countDown(); } }); countDownLatch.await(); } // public void test2AddMappingToServer() throws Throwable { // // Set<String> bssids = new HashSet<>(); // bssids.add("b4:c7:99:0b:aa:c1"); // bssids.add("b4:c7:99:0b:d4:90"); // String stationName = "StationNameTest"; // // Station station = new Station(bssids, System.currentTimeMillis()); // // NetowrkManager.getInstance().addMappingToServer(station.getPostParam(stationName), new NetowrkManager.RequestListener() { // @Override // public void onResponse(Object response) { // // assertNotNull(response); // countDownLatch.countDown(); // } // // @Override // public void onError() { // fail(); // countDownLatch.countDown(); // } // }); // // countDownLatch.await(); // } }
Java
/*------------------------------------------------------------------------- * * pqmq.c * Use the frontend/backend protocol for communication over a shm_mq * * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/backend/libpq/pqmq.c * *------------------------------------------------------------------------- */ #include "postgres.h" #include "libpq/libpq.h" #include "libpq/pqformat.h" #include "libpq/pqmq.h" #include "miscadmin.h" #include "tcop/tcopprot.h" #include "utils/builtins.h" static shm_mq *pq_mq; static shm_mq_handle *pq_mq_handle; static bool pq_mq_busy = false; static pid_t pq_mq_parallel_master_pid = 0; static pid_t pq_mq_parallel_master_backend_id = InvalidBackendId; static void pq_cleanup_redirect_to_shm_mq(dsm_segment *seg, Datum arg); static void mq_comm_reset(void); static int mq_flush(void); static int mq_flush_if_writable(void); static bool mq_is_send_pending(void); static int mq_putmessage(char msgtype, const char *s, size_t len); static void mq_putmessage_noblock(char msgtype, const char *s, size_t len); static void mq_startcopyout(void); static void mq_endcopyout(bool errorAbort); static PQcommMethods PqCommMqMethods = { mq_comm_reset, mq_flush, mq_flush_if_writable, mq_is_send_pending, mq_putmessage, mq_putmessage_noblock, mq_startcopyout, mq_endcopyout }; /* * Arrange to redirect frontend/backend protocol messages to a shared-memory * message queue. */ void pq_redirect_to_shm_mq(dsm_segment *seg, shm_mq_handle *mqh) { PqCommMethods = &PqCommMqMethods; pq_mq = shm_mq_get_queue(mqh); pq_mq_handle = mqh; whereToSendOutput = DestRemote; FrontendProtocol = PG_PROTOCOL_LATEST; on_dsm_detach(seg, pq_cleanup_redirect_to_shm_mq, (Datum) 0); } /* * When the DSM that contains our shm_mq goes away, we need to stop sending * messages to it. */ static void pq_cleanup_redirect_to_shm_mq(dsm_segment *seg, Datum arg) { pq_mq = NULL; pq_mq_handle = NULL; whereToSendOutput = DestNone; } /* * Arrange to SendProcSignal() to the parallel master each time we transmit * message data via the shm_mq. */ void pq_set_parallel_master(pid_t pid, BackendId backend_id) { Assert(PqCommMethods == &PqCommMqMethods); pq_mq_parallel_master_pid = pid; pq_mq_parallel_master_backend_id = backend_id; } static void mq_comm_reset(void) { /* Nothing to do. */ } static int mq_flush(void) { /* Nothing to do. */ return 0; } static int mq_flush_if_writable(void) { /* Nothing to do. */ return 0; } static bool mq_is_send_pending(void) { /* There's never anything pending. */ return 0; } /* * Transmit a libpq protocol message to the shared memory message queue * selected via pq_mq_handle. We don't include a length word, because the * receiver will know the length of the message from shm_mq_receive(). */ static int mq_putmessage(char msgtype, const char *s, size_t len) { shm_mq_iovec iov[2]; shm_mq_result result; /* * If we're sending a message, and we have to wait because the queue is * full, and then we get interrupted, and that interrupt results in trying * to send another message, we respond by detaching the queue. There's no * way to return to the original context, but even if there were, just * queueing the message would amount to indefinitely postponing the * response to the interrupt. So we do this instead. */ if (pq_mq_busy) { if (pq_mq != NULL) shm_mq_detach(pq_mq); pq_mq = NULL; pq_mq_handle = NULL; return EOF; } /* * If the message queue is already gone, just ignore the message. This * doesn't necessarily indicate a problem; for example, DEBUG messages * can be generated late in the shutdown sequence, after all DSMs have * already been detached. */ if (pq_mq == NULL) return 0; pq_mq_busy = true; iov[0].data = &msgtype; iov[0].len = 1; iov[1].data = s; iov[1].len = len; Assert(pq_mq_handle != NULL); for (;;) { result = shm_mq_sendv(pq_mq_handle, iov, 2, true); if (pq_mq_parallel_master_pid != 0) SendProcSignal(pq_mq_parallel_master_pid, PROCSIG_PARALLEL_MESSAGE, pq_mq_parallel_master_backend_id); if (result != SHM_MQ_WOULD_BLOCK) break; WaitLatch(&MyProc->procLatch, WL_LATCH_SET, 0); CHECK_FOR_INTERRUPTS(); ResetLatch(&MyProc->procLatch); } pq_mq_busy = false; Assert(result == SHM_MQ_SUCCESS || result == SHM_MQ_DETACHED); if (result != SHM_MQ_SUCCESS) return EOF; return 0; } static void mq_putmessage_noblock(char msgtype, const char *s, size_t len) { /* * While the shm_mq machinery does support sending a message in * non-blocking mode, there's currently no way to try sending beginning to * send the message that doesn't also commit us to completing the * transmission. This could be improved in the future, but for now we * don't need it. */ elog(ERROR, "not currently supported"); } static void mq_startcopyout(void) { /* Nothing to do. */ } static void mq_endcopyout(bool errorAbort) { /* Nothing to do. */ } /* * Parse an ErrorResponse or NoticeResponse payload and populate an ErrorData * structure with the results. */ void pq_parse_errornotice(StringInfo msg, ErrorData *edata) { /* Initialize edata with reasonable defaults. */ MemSet(edata, 0, sizeof(ErrorData)); edata->elevel = ERROR; edata->assoc_context = CurrentMemoryContext; /* Loop over fields and extract each one. */ for (;;) { char code = pq_getmsgbyte(msg); const char *value; if (code == '\0') { pq_getmsgend(msg); break; } value = pq_getmsgstring(msg); switch (code) { case PG_DIAG_SEVERITY: if (strcmp(value, "DEBUG") == 0) edata->elevel = DEBUG1; /* or some other DEBUG level */ else if (strcmp(value, "LOG") == 0) edata->elevel = LOG; /* can't be COMMERROR */ else if (strcmp(value, "INFO") == 0) edata->elevel = INFO; else if (strcmp(value, "NOTICE") == 0) edata->elevel = NOTICE; else if (strcmp(value, "WARNING") == 0) edata->elevel = WARNING; else if (strcmp(value, "ERROR") == 0) edata->elevel = ERROR; else if (strcmp(value, "FATAL") == 0) edata->elevel = FATAL; else if (strcmp(value, "PANIC") == 0) edata->elevel = PANIC; else elog(ERROR, "unknown error severity"); break; case PG_DIAG_SQLSTATE: if (strlen(value) != 5) elog(ERROR, "malformed sql state"); edata->sqlerrcode = MAKE_SQLSTATE(value[0], value[1], value[2], value[3], value[4]); break; case PG_DIAG_MESSAGE_PRIMARY: edata->message = pstrdup(value); break; case PG_DIAG_MESSAGE_DETAIL: edata->detail = pstrdup(value); break; case PG_DIAG_MESSAGE_HINT: edata->hint = pstrdup(value); break; case PG_DIAG_STATEMENT_POSITION: edata->cursorpos = pg_atoi(value, sizeof(int), '\0'); break; case PG_DIAG_INTERNAL_POSITION: edata->internalpos = pg_atoi(value, sizeof(int), '\0'); break; case PG_DIAG_INTERNAL_QUERY: edata->internalquery = pstrdup(value); break; case PG_DIAG_CONTEXT: edata->context = pstrdup(value); break; case PG_DIAG_SCHEMA_NAME: edata->schema_name = pstrdup(value); break; case PG_DIAG_TABLE_NAME: edata->table_name = pstrdup(value); break; case PG_DIAG_COLUMN_NAME: edata->column_name = pstrdup(value); break; case PG_DIAG_DATATYPE_NAME: edata->datatype_name = pstrdup(value); break; case PG_DIAG_CONSTRAINT_NAME: edata->constraint_name = pstrdup(value); break; case PG_DIAG_SOURCE_FILE: edata->filename = pstrdup(value); break; case PG_DIAG_SOURCE_LINE: edata->lineno = pg_atoi(value, sizeof(int), '\0'); break; case PG_DIAG_SOURCE_FUNCTION: edata->funcname = pstrdup(value); break; default: elog(ERROR, "unknown error field: %d", (int) code); break; } } }
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `XKB_KEY_F14` constant in crate `wayland_kbd`."> <meta name="keywords" content="rust, rustlang, rust-lang, XKB_KEY_F14"> <title>wayland_kbd::ffi::keysyms::XKB_KEY_F14 - Rust</title> <link rel="stylesheet" type="text/css" href="../../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../../index.html'>wayland_kbd</a>::<wbr><a href='../index.html'>ffi</a>::<wbr><a href='index.html'>keysyms</a></p><script>window.sidebarCurrent = {name: 'XKB_KEY_F14', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../../index.html'>wayland_kbd</a>::<wbr><a href='../index.html'>ffi</a>::<wbr><a href='index.html'>keysyms</a>::<wbr><a class='constant' href=''>XKB_KEY_F14</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-362' class='srclink' href='../../../src/wayland_kbd/ffi/keysyms.rs.html#273' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const XKB_KEY_F14: <a href='../../../std/primitive.u32.html'>u32</a><code> = </code><code>0xffcb</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../../"; window.currentCrate = "wayland_kbd"; window.playgroundUrl = ""; </script> <script src="../../../jquery.js"></script> <script src="../../../main.js"></script> <script async src="../../../search-index.js"></script> </body> </html>
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `TEXTURE_CUBE_MAP_NEGATIVE_Z` constant in crate `servo`."> <meta name="keywords" content="rust, rustlang, rust-lang, TEXTURE_CUBE_MAP_NEGATIVE_Z"> <title>servo::script::dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants::TEXTURE_CUBE_MAP_NEGATIVE_Z - Rust</title> <link rel="stylesheet" type="text/css" href="../../../../../../../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../../../../../../../index.html'>servo</a>::<wbr><a href='../../../../../../index.html'>script</a>::<wbr><a href='../../../../../index.html'>dom</a>::<wbr><a href='../../../../index.html'>bindings</a>::<wbr><a href='../../../index.html'>codegen</a>::<wbr><a href='../../index.html'>Bindings</a>::<wbr><a href='../index.html'>WebGLRenderingContextBinding</a>::<wbr><a href='index.html'>WebGLRenderingContextConstants</a></p><script>window.sidebarCurrent = {name: 'TEXTURE_CUBE_MAP_NEGATIVE_Z', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content constant"> <h1 class='fqn'><span class='in-band'><a href='../../../../../../../index.html'>servo</a>::<wbr><a href='../../../../../../index.html'>script</a>::<wbr><a href='../../../../../index.html'>dom</a>::<wbr><a href='../../../../index.html'>bindings</a>::<wbr><a href='../../../index.html'>codegen</a>::<wbr><a href='../../index.html'>Bindings</a>::<wbr><a href='../index.html'>WebGLRenderingContextBinding</a>::<wbr><a href='index.html'>WebGLRenderingContextConstants</a>::<wbr><a class='constant' href=''>TEXTURE_CUBE_MAP_NEGATIVE_Z</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-508443' class='srclink' href='../../../../../../../../export/script/dom/bindings/codegen/Bindings/WebGLRenderingContextBinding/WebGLRenderingContextConstants/constant.TEXTURE_CUBE_MAP_NEGATIVE_Z.html?gotosrc=508443' title='goto source code'>[src]</a></span></h1> <pre class='rust const'>pub const TEXTURE_CUBE_MAP_NEGATIVE_Z: <a href='../../../../../../../../std/primitive.u32.html'>u32</a><code> = </code><code>34074</code></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../../../../../../../"; window.currentCrate = "servo"; window.playgroundUrl = ""; </script> <script src="../../../../../../../../jquery.js"></script> <script src="../../../../../../../../main.js"></script> <script async src="../../../../../../../../search-index.js"></script> </body> </html>
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `get_available_monitors` fn in crate `glutin`."> <meta name="keywords" content="rust, rustlang, rust-lang, get_available_monitors"> <title>glutin::api::x11::get_available_monitors - Rust</title> <link rel="stylesheet" type="text/css" href="../../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../../index.html'>glutin</a>::<wbr><a href='../index.html'>api</a>::<wbr><a href='index.html'>x11</a></p><script>window.sidebarCurrent = {name: 'get_available_monitors', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'>Function <a href='../../index.html'>glutin</a>::<wbr><a href='../index.html'>api</a>::<wbr><a href='index.html'>x11</a>::<wbr><a class='fn' href=''>get_available_monitors</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-21551' class='srclink' href='../../../src/glutin/api/x11/monitor.rs.html#10-16' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub fn get_available_monitors(x: &amp;<a class='struct' href='../../../alloc/arc/struct.Arc.html' title='alloc::arc::Arc'>Arc</a>&lt;<a class='struct' href='../../../glutin/api/x11/struct.XConnection.html' title='glutin::api::x11::XConnection'>XConnection</a>&gt;) -&gt; <a class='struct' href='../../../collections/vec_deque/struct.VecDeque.html' title='collections::vec_deque::VecDeque'>VecDeque</a>&lt;<a class='struct' href='../../../glutin/api/x11/struct.MonitorID.html' title='glutin::api::x11::MonitorID'>MonitorID</a>&gt;</pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../../"; window.currentCrate = "glutin"; window.playgroundUrl = ""; </script> <script src="../../../jquery.js"></script> <script src="../../../main.js"></script> <script async src="../../../search-index.js"></script> </body> </html>
Java
#include "legato.h" #include "interfaces.h" #define dhubIO_DataType_t io_DataType_t static bool IsEnabled = false; static le_timer_Ref_t Timer; #define LATITUDE_NAME "location/value/latitude" #define LONGITUDE_NAME "location/value/longitude" #define PERIOD_NAME "location/period" #define ENABLE_NAME "location/enable" //-------------------------------------------------------------------------------------------------- /** * Function called when the timer expires. */ //-------------------------------------------------------------------------------------------------- static void TimerExpired ( le_timer_Ref_t timer ///< Timer reference ) //-------------------------------------------------------------------------------------------------- { static unsigned int counter = 0; int32_t latitude = 0; int32_t longitude = 0; int32_t horizontalAccuracy = 0; counter += 1; le_result_t result = le_pos_Get2DLocation(&latitude, &longitude, &horizontalAccuracy); if (LE_OK != result) { LE_ERROR("Error %d getting position", result); } LE_INFO("Location: Latitude %d Longitude %d Accuracy %d", latitude, longitude, horizontalAccuracy); // introduce oscillations (20 meters) to latitude latitude += counter % 200; // Location units have to be converted from 1e-6 degrees to degrees io_PushNumeric(LATITUDE_NAME, IO_NOW, latitude * 0.000001); io_PushNumeric(LONGITUDE_NAME, IO_NOW, longitude * 0.000001); } //-------------------------------------------------------------------------------------------------- /** * Call-back function called when an update is received from the Data Hub for the "period" * config setting. */ //-------------------------------------------------------------------------------------------------- static void PeriodUpdateHandler ( double timestamp, ///< time stamp double value, ///< period value, seconds void* contextPtr ///< not used ) //-------------------------------------------------------------------------------------------------- { LE_INFO("Received update to 'period' setting: %lf (timestamped %lf)", value, timestamp); uint32_t ms = (uint32_t)(value * 1000); if (ms == 0) { le_timer_Stop(Timer); } else { le_timer_SetMsInterval(Timer, ms); // If the sensor is enabled and the timer is not already running, start it now. if (IsEnabled && (!le_timer_IsRunning(Timer))) { le_timer_Start(Timer); } } } //-------------------------------------------------------------------------------------------------- /** * Call-back function called when an update is received from the Data Hub for the "enable" * control. */ //-------------------------------------------------------------------------------------------------- static void EnableUpdateHandler ( double timestamp, ///< time stamp bool value, ///< whether input is enabled void* contextPtr ///< not used ) //-------------------------------------------------------------------------------------------------- { LE_INFO("Received update to 'enable' setting: %s (timestamped %lf)", value == false ? "false" : "true", timestamp); IsEnabled = value; if (value) { // If the timer has a non-zero interval and is not already running, start it now. if ((le_timer_GetMsInterval(Timer) != 0) && (!le_timer_IsRunning(Timer))) { le_timer_Start(Timer); } } else { le_timer_Stop(Timer); } } //-------------------------------------------------------------------------------------------------- /** * Call-back for receiving notification that an update is happening. */ //-------------------------------------------------------------------------------------------------- static void UpdateStartEndHandler ( bool isStarting, //< input is starting void* contextPtr //< Not used. ) //-------------------------------------------------------------------------------------------------- { LE_INFO("Configuration update %s.", isStarting ? "starting" : "finished"); } COMPONENT_INIT { le_result_t result; io_AddUpdateStartEndHandler(UpdateStartEndHandler, NULL); // This will be provided to the Data Hub. result = io_CreateInput(LATITUDE_NAME, IO_DATA_TYPE_NUMERIC, "degrees"); LE_ASSERT(result == LE_OK); result = io_CreateInput(LONGITUDE_NAME, IO_DATA_TYPE_NUMERIC, "degrees"); LE_ASSERT(result == LE_OK); // This is my configuration setting. result = io_CreateOutput(PERIOD_NAME, IO_DATA_TYPE_NUMERIC, "s"); LE_ASSERT(result == LE_OK); // Register for notification of updates to our configuration setting. io_AddNumericPushHandler(PERIOD_NAME, PeriodUpdateHandler, NULL); // This is my enable/disable control. result = io_CreateOutput(ENABLE_NAME, IO_DATA_TYPE_BOOLEAN, ""); LE_ASSERT(result == LE_OK); // Set the defaults: enable the sensor, set period to 1s io_SetBooleanDefault(ENABLE_NAME, true); io_SetNumericDefault(PERIOD_NAME, 1); // Register for notification of updates to our enable/disable control. io_AddBooleanPushHandler(ENABLE_NAME, EnableUpdateHandler, NULL); // Create a repeating timer that will call TimerExpired() each time it expires. // Note: we'll start the timer when we receive our configuration setting. Timer = le_timer_Create("gpsSensorTimer"); le_timer_SetRepeat(Timer, 0); le_timer_SetHandler(Timer, TimerExpired); }
Java
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; var fs = require("fs"); var path = require("path"); var utils = require("../utils"); var chai = require("chai"); var expect = chai.expect; var exec = utils.exec; var simpleAddonPath = path.join(__dirname, "..", "fixtures", "simple-addon"); describe("jpm xpi", function () { beforeEach(utils.setup); afterEach(utils.tearDown); it("creates a xpi of the simple-addon", function (done) { var proc = exec("xpi", { addonDir: simpleAddonPath }); proc.on("close", function () { var xpiPath = path.join(simpleAddonPath, "@simple-addon-1.0.0.xpi"); utils.unzipTo(xpiPath, utils.tmpOutputDir).then(function () { utils.compareDirs(simpleAddonPath, utils.tmpOutputDir); fs.unlink(xpiPath); done(); }); }); }); });
Java
"""Django module for the OS2datascanner project."""
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `wl_cursor_image` struct in crate `wayland_sys`."> <meta name="keywords" content="rust, rustlang, rust-lang, wl_cursor_image"> <title>wayland_sys::cursor::wl_cursor_image - Rust</title> <link rel="stylesheet" type="text/css" href="../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <p class='location'><a href='../index.html'>wayland_sys</a>::<wbr><a href='index.html'>cursor</a></p><script>window.sidebarCurrent = {name: 'wl_cursor_image', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content struct"> <h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>wayland_sys</a>::<wbr><a href='index.html'>cursor</a>::<wbr><a class='struct' href=''>wl_cursor_image</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-465' class='srclink' href='../../src/wayland_sys/cursor.rs.html#11-22' title='goto source code'>[src]</a></span></h1> <pre class='rust struct'>pub struct wl_cursor_image { pub width: <a class='primitive' href='../../std/primitive.u32.html'>u32</a>, pub height: <a class='primitive' href='../../std/primitive.u32.html'>u32</a>, pub hotspot_x: <a class='primitive' href='../../std/primitive.u32.html'>u32</a>, pub hotspot_y: <a class='primitive' href='../../std/primitive.u32.html'>u32</a>, pub delay: <a class='primitive' href='../../std/primitive.u32.html'>u32</a>, }</pre><h2 class='fields'>Fields</h2><span id='structfield.width' class='structfield'><code>width: <a class='primitive' href='../../std/primitive.u32.html'>u32</a></code> </span><span class='stab '></span><div class='docblock'><p>actual width</p> </div><span id='structfield.height' class='structfield'><code>height: <a class='primitive' href='../../std/primitive.u32.html'>u32</a></code> </span><span class='stab '></span><div class='docblock'><p>actual height</p> </div><span id='structfield.hotspot_x' class='structfield'><code>hotspot_x: <a class='primitive' href='../../std/primitive.u32.html'>u32</a></code> </span><span class='stab '></span><div class='docblock'><p>hot spot x (must be inside image)</p> </div><span id='structfield.hotspot_y' class='structfield'><code>hotspot_y: <a class='primitive' href='../../std/primitive.u32.html'>u32</a></code> </span><span class='stab '></span><div class='docblock'><p>hot spot y (must be inside image)</p> </div><span id='structfield.delay' class='structfield'><code>delay: <a class='primitive' href='../../std/primitive.u32.html'>u32</a></code> </span><span class='stab '></span><div class='docblock'><p>animation delay to next frame</p> </div></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../"; window.currentCrate = "wayland_sys"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script defer src="../../search-index.js"></script> </body> </html>
Java
<?php include_once 'include/Zend/Json.php'; include_once 'vtlib/Vtiger/Module.php'; include_once 'include/utils/VtlibUtils.php'; include_once 'include/Webservices/Create.php'; include_once 'include/QueryGenerator/QueryGenerator.php'; function do_users4entities($time_start) { global $log_active, $adb; echo "\n==========================================================\n"; $import_result = array(); $modifiedby_id = 1; $import_result['records_created']=0; $import_result['records_updated']=0; // LEADS $sql = get_sql4leads(); $result = $adb->query($sql); while($row=$adb->fetchByAssoc($result)) { echo "Processing lead ".$row['lead_no']." with id ".$row['crmid']."\n"; $user_id = get_agent4location(trim($row['state']),trim($row['code']),trim($row['city']), $row['smownerid'] ); update_user4entity($row['crmid'],$row['smownerid'] , $user_id, $modifiedby_id); $import_result['records_updated']++; } // ACCOUNTS $sql = get_sql4accounts(); $result = $adb->query($sql); while($row=$adb->fetchByAssoc($result)) { echo "Processing account ".$row['account_no']." with id ".$row['crmid']."\n"; $user_id = get_agent4location(trim($row['bill_state']),trim($row['bill_code']),trim($row['bill_city']), $row['smownerid'] ); update_user4entity($row['crmid'],$row['smownerid'] , $user_id, $modifiedby_id); $import_result['records_updated']++; } // CONTACTS $sql = get_sql4contacts(); $result = $adb->query($sql); while($row=$adb->fetchByAssoc($result)) { echo "Processing contact ".$row['contact_no']." with id ".$row['crmid']."\n"; $user_id = get_agent4location(trim($row['bill_state']),trim($row['bill_code']),trim($row['bill_city']), $row['smownerid'] ); update_user4entity($row['crmid'],$row['smownerid'] , $user_id, $modifiedby_id); $import_result['records_updated']++; } return $import_result; } function update_user4entity($entity_id,$previous_owner_id, $user_id,$modifiedby_id) { global $adb,$table_prefix; $sql = "UPDATE ".$table_prefix."_crmentity SET ".$table_prefix."_crmentity.smownerid = ".$user_id." , ".$table_prefix."_crmentity.modifiedby = ".$modifiedby_id." , ".$table_prefix."_crmentity.modifiedtime = GETDATE() WHERE ".$table_prefix."_crmentity.crmid = ".$entity_id." AND ".$table_prefix."_crmentity.smownerid = ".$previous_owner_id." "; $result = $adb->query($sql); } function get_sql4leads() { global $adb,$table_prefix; $sql = "SELECT ".$table_prefix."_crmentity.crmid, ".$table_prefix."_crmentity.setype, ".$table_prefix."_crmentity.smownerid, ".$table_prefix."_crmentity.smcreatorid, ".$table_prefix."_crmentity.createdtime, ".$table_prefix."_crmentity.description, ".$table_prefix."_leaddetails.company, ".$table_prefix."_leaddetails.email, ".$table_prefix."_leaddetails.firstname, ".$table_prefix."_leaddetails.lastname, ".$table_prefix."_leaddetails.lead_no, ".$table_prefix."_leadaddress.city, ".$table_prefix."_leadaddress.code, ".$table_prefix."_leadaddress.country, ".$table_prefix."_leadaddress.state FROM ".$table_prefix."_crmentity JOIN ".$table_prefix."_leaddetails on ".$table_prefix."_leaddetails.leadid = ".$table_prefix."_crmentity.crmid and ".$table_prefix."_leaddetails.converted = 0 JOIN ".$table_prefix."_leadaddress on ".$table_prefix."_leadaddress.leadaddressid = ".$table_prefix."_crmentity.crmid AND ".$table_prefix."_leadaddress.country like 'IT%' WHERE ".$table_prefix."_crmentity.deleted = 0 and ".$table_prefix."_crmentity.setype = 'Leads' and ".$table_prefix."_crmentity.smownerid in (0,9,167)"; return $sql; } function get_sql4accounts() { global $adb,$table_prefix; $sql = "SELECT ".$table_prefix."_crmentity.crmid, ".$table_prefix."_crmentity.setype, ".$table_prefix."_crmentity.smownerid, ".$table_prefix."_crmentity.smcreatorid, ".$table_prefix."_crmentity.createdtime, ".$table_prefix."_crmentity.description, ".$table_prefix."_account.accountname, ".$table_prefix."_account.account_no, ".$table_prefix."_account.email1, ".$table_prefix."_accountbillads.bill_country, ".$table_prefix."_accountbillads.bill_state, ".$table_prefix."_accountbillads.bill_code, ".$table_prefix."_accountbillads.bill_city FROM ".$table_prefix."_crmentity JOIN ".$table_prefix."_account on ".$table_prefix."_account.accountid = ".$table_prefix."_crmentity.crmid JOIN ".$table_prefix."_accountbillads on ".$table_prefix."_accountbillads.accountaddressid = ".$table_prefix."_crmentity.crmid AND ".$table_prefix."_accountbillads.bill_country like 'IT%' WHERE ".$table_prefix."_crmentity.deleted = 0 AND ".$table_prefix."_crmentity.setype = 'Accounts' AND ".$table_prefix."_crmentity.smownerid in (0,9,167)"; return $sql; } function get_sql4contacts() { global $adb,$table_prefix; $sql = "SELECT ".$table_prefix."_crmentity.crmid, ".$table_prefix."_crmentity.setype, ".$table_prefix."_crmentity.smcreatorid, ".$table_prefix."_crmentity.smownerid, ".$table_prefix."_crmentity.createdtime, ".$table_prefix."_crmentity.description, ".$table_prefix."_contactdetails.firstname, ".$table_prefix."_contactdetails.lastname, ".$table_prefix."_contactdetails.contact_no, ".$table_prefix."_contactdetails.email, ".$table_prefix."_contactdetails.accountid, ".$table_prefix."_accountbillads.bill_country, ".$table_prefix."_accountbillads.bill_state, ".$table_prefix."_accountbillads.bill_code, ".$table_prefix."_accountbillads.bill_city FROM ".$table_prefix."_crmentity JOIN ".$table_prefix."_contactdetails on ".$table_prefix."_contactdetails.contactid = ".$table_prefix."_crmentity.crmid JOIN ".$table_prefix."_accountbillads on ".$table_prefix."_accountbillads.accountaddressid = ".$table_prefix."_contactdetails.accountid AND ".$table_prefix."_accountbillads.bill_country like 'IT%' JOIN ".$table_prefix."_crmentity as acc_entity on acc_entity.crmid = ".$table_prefix."_accountbillads.accountaddressid and acc_entity.deleted = 0 WHERE ".$table_prefix."_crmentity.deleted = 0 and ".$table_prefix."_crmentity.setype = 'Contacts' and ".$table_prefix."_crmentity.smownerid in (0,9,167)"; return $sql; } function get_agent4location($state,$code,$city, $previous_owner_id ) { global $adb,$table_prefix, $log_active; $agent_id = $previous_owner_id; $b_Found = false; if(!empty($city) && !$b_Found) { $sql = "SELECT Agente, ".$table_prefix."_users.id , COUNT(Agente) FROM tmp_assegnazione_agenti JOIN ".$table_prefix."_users ON ".$table_prefix."_users.user_name = Agente WHERE Comune like '".$city."%' GROUP BY Agente, ".$table_prefix."_users.id"; $result = $adb->query($sql); while($row=$adb->fetchByAssoc($result)) { $b_Found = true; $agent_id = $row['id']; echo "\tFound ".$agent_id." for city=".$city."\n"; break; } } if(!empty($code) && !$b_Found) { $sql = "SELECT Agente, ".$table_prefix."_users.id , COUNT(Agente) FROM tmp_assegnazione_agenti JOIN ".$table_prefix."_users ON ".$table_prefix."_users.user_name = Agente WHERE Cap = '".$code."' GROUP BY Agente, ".$table_prefix."_users.id"; $result = $adb->query($sql); while($row=$adb->fetchByAssoc($result)) { $b_Found = true; $agent_id = $row['id']; echo "\tFound ".$agent_id." for code=".$code."\n"; break; } } if(!empty($state) && !$b_Found) { $sql = "SELECT Agente, ".$table_prefix."_users.id , COUNT(Agente) FROM tmp_assegnazione_agenti JOIN ".$table_prefix."_users ON ".$table_prefix."_users.user_name = Agente WHERE Provincia = '".$state."' GROUP BY Agente, ".$table_prefix."_users.id"; $result = $adb->query($sql); while($row=$adb->fetchByAssoc($result)) { $b_Found = true; $agent_id = $row['id']; echo "\tFound ".$agent_id." for state=".$state."\n"; break; } } if(!$b_Found) echo "\tNothing found for ".$city." - ".$code." (".$state.") , I'll keep owner with id = ".$agent_id."\n"; return $agent_id; } ?>
Java
package models.message; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import models.SecureTable; import org.codehaus.jackson.annotate.JsonProperty; import com.alvazan.orm.api.z8spi.meta.DboTableMeta; /** */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class StreamModule { @JsonProperty("module") @XmlElement(name="module") public String module; @JsonProperty("params") @XmlElement(name="params") public Map<String, String> params = new HashMap<String, String>(); //I want to do the composite pattern and push this field down into the "Container" while StreamModule is the "Component" of that pattern //but that would not work as unmarshalling the json would break since parser does not know to parse to StreamModule or the Container type which //I had previously called StreamAggregation so this field is only used for the Container type @JsonProperty("childStreams") @XmlElement(name="childStreams") public List<StreamModule> streams = new ArrayList<StreamModule>(); public String getModule() { return module; } public void setModule(String module) { this.module = module; } public Map<String, String> getParams() { return params; } public void setParams(Map<String, String> params) { this.params = params; } public List<StreamModule> getStreams() { return streams; } public void setStreams(List<StreamModule> streams) { this.streams = streams; } @Override public String toString() { return "module=" + module; } } // Register
Java
--- subcategory: "EC2" layout: "aws" page_title: "AWS: aws_ec2_transit_gateway_dx_gateway_attachment" description: |- Get information on an EC2 Transit Gateway's attachment to a Direct Connect Gateway --- # Data Source: aws_ec2_transit_gateway_dx_gateway_attachment Get information on an EC2 Transit Gateway's attachment to a Direct Connect Gateway. ## Example Usage ### By Transit Gateway and Direct Connect Gateway Identifiers ```hcl data "aws_ec2_transit_gateway_dx_gateway_attachment" "example" { transit_gateway_id = aws_ec2_transit_gateway.example.id dx_gateway_id = aws_dx_gateway.example.id } ``` ## Argument Reference The following arguments are supported: * `transit_gateway_id` - (Optional) Identifier of the EC2 Transit Gateway. * `dx_gateway_id` - (Optional) Identifier of the Direct Connect Gateway. * `filter` - (Optional) Configuration block(s) for filtering. Detailed below. * `tags` - (Optional) A map of tags, each pair of which must exactly match a pair on the desired Transit Gateway Direct Connect Gateway Attachment. ### filter Configuration Block The following arguments are supported by the `filter` configuration block: * `name` - (Required) The name of the filter field. Valid values can be found in the [EC2 DescribeTransitGatewayAttachments API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeTransitGatewayAttachments.html). * `values` - (Required) Set of values that are accepted for the given filter field. Results will be selected if any given value matches. ## Attribute Reference In addition to all arguments above, the following attributes are exported: * `id` - EC2 Transit Gateway Attachment identifier * `tags` - Key-value tags for the EC2 Transit Gateway Attachment
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html data-context="Build Apps" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>SMACK Security and Legato - Legato Docs</title> <meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/> <meta content="legato, iot" name="keywords"/> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/> <meta content="20.08.0" name="legato-version"/> <link href="resources/images/legato.ico" rel="shortcut icon"/> <link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/> <link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/> <link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/> <!--[if IE]> <script src="resources/js/html5shiv.js"></script> <script src="resources/js/respond.js"></script> <![endif]--> <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script> <script src="resources/js/main.js"></script> <script src="tocs/Build_Apps_Concepts.json"></script> </head> <body> <noscript> <input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/> <div id="nojs"> <label for="modal-closing-trick"> <span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span> </label> </div> </noscript> <div class="wrapper"> <div class="fa fa-bars documentation" id="menu-trigger"></div> <div id="top"> <header> <nav> <a class="navlink" href="/">Introduction</a><a class="navlink selected" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink" href="aboutMain.html">About</a> </nav> </header> </div> <div class="white" id="menudocumentation"> <header> <a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a> <h2>/ Build Apps</h2> <nav class="secondary"> <a href="getStarted.html">Get Started</a><a class="link-selected" href="concepts.html">Concepts</a><a href="apiGuidesMain.html">API Guides</a><a href="tools.html">Tools</a><a href="howToMain.html">How To</a><a href="experimentalMain.html">Experimental Features</a> </nav> <nav class="ui-front"> <i class="fa fa-search" id="search-icon"></i> <input id="searchbox" placeholder="Search"/> </nav> </header> </div> <div id="resizable"> <div id="left"> <div id="tree1"></div> </div> </div> <div class="content"> <div class="header"> <div class="headertitle"> <h1 class="title">SMACK Security and Legato </h1> </div> </div><div class="contents"> <div class="textblock"><h1><a class="anchor" id="conceptsSecuritySmack_Overview"></a> SMACK Overview</h1> <p>SMACK <b>Simplified Mandatory Access Control Kernel</b> allows an administrator to define labels, for resources within a system. Labels on objects are compared with the labels of a task that tries to access them. By default, access is only allowed if the labels match. There are also a set of Smack-reserved labels that follow a different set of rules, which allows most system objects and processes to be unaffected by Smack restrictions. SMACK is designed to secure users and processes which is why it is enabled within the Legato system.</p> <p>Within Linux files, devices, and other special objects within the filesystem are given permission bits that govern how processes may access these files.</p> <p>For example, listing the root directory of the current active Legato system: </p><pre class="fragment">$ /legato/systems/current $ ll drwxrwxr-x 2 root root 1.9K Sep 27 01:07 apps dr-x---r-x 19 root root 1.4K Sep 27 01:07 appsWriteable drwxrwxr-x 2 root root 2.5K Sep 17 22:44 bin drwxrwxr-x 2 root root 2.1K Sep 27 01:07 config -rw-r--r-- 1 root root 2 Sep 27 01:07 index -rw-rw-rw- 1 root root 37 Sep 27 01:07 info.properties drwxrwxr-x 2 root root 1.5K Sep 17 22:44 lib -rw-r--r-- 1 root root 0 Sep 27 01:07 modified drwxrwxr-x 3 root root 296 Sep 17 22:44 modules -rw-r--r-- 1 root root 4 Sep 27 01:07 status -rw-r--r-- 1 root root 68 Sep 27 01:07 version </pre><p>The first column of the output shows the permission bits for each file. See <a href="https://www.linux.com/learn/understanding-linux-file-permissions">this document</a> for more details on how the standard file permissions work in Linux.</p> <p>File permissions are not enough security for all different potential usages of a production Linux system and security requirements can vary between contexts; the Linux Kernel team implemented a system of plugable security modules, one of which is SMACK.</p> <p>SMACK is layered on top of the existing security module. When a file is opened for reading, writing, or execution the standard file permission bits are always checked first. If that check passes, then the SMACK security module is queried for access. It is then up to that security module to provide a final allow/deny for that object.</p> <p>SMACK works by allowing one to apply to files, processes, devices, and resources like sockets a label. When a process tries to open a file, SMACK will read the label of the process requesting the access. The label of the file or object being accessed is then also read. SMACK will then compare those two labels. If the labels match, access is granted. If the labels are different then SMACK iterate over a list of rules. If a rule is found that matches both labels and the access requested then the access is granted. Otherwise the access is denied, and the error is passed back to the requesting process.</p> <p>While SMACK itself runs entirely within the Linux kernel, there are associated user-space tools and devices that allow one to inspect and change labels as well as update the rules that bind these labels together.</p> <h2><a class="anchor" id="conceptsSecuritySmack_Overview_Lables"></a> SMACK Labels</h2> <p>There are a number of labels built into SMACK, "_", "^", "*", "?", and "@".</p> <p>Built in rules for these labels:</p> <p><code>1</code>. All accesses by processes labelled "*" are denied. <code>2</code>. All read and execute requests, (no write,) for processes labelled, "^" are permitted. <code>3</code>. All read and execute requests, (no write,) on objects labelled, "_" are permitted, no matter what the process label. <code>4</code>. Any access requests, (read, write and execute,) on objects labelled, "*" no matter the process label are permitted. <code>5</code>. Any accesses on an object that has the same label as the process label are permitted. <code>6</code>. Any other accesses are denied, unless there is a user defined rule supplied at runtime.</p> <p>SMACK labels on File System objects are stored as <a href="https://en.wikipedia.org/wiki/Extended_file_attributes#Linux">extended attributes</a>, (xattr.) These extended attributes are a generic way to store extra information to be associated with a file. The labels known to SMACK are:</p> <ul> <li><b>security.SMACK64:</b> The label for the file itself. If a file is being accessed then the access check is performed against the label stored in this attribute.</li> <li><b>security.SMACK64EXEC:</b> When a process is started from a file, the label for the new process can be found in this attribute.</li> <li><b>security.SMACK64IPIN:</b> If the object is a socket this label is used control incoming to the socket.</li> <li><b>security.SMACK64IPOUT:</b> If the object is a socket this label is use to control access to the data being sent out from this device.</li> </ul> <h2><a class="anchor" id="conceptsSecuritySmack_getSetLabels"></a> Getting and Setting Labels</h2> <p>It is possible to read SMACK labels for filesystem (FS) objects. If your process has permission, you can also change labels on FS objects.</p> <p>For files and sockets and other objects that are directly represented in the file system you can use the Linux tool <code>getfattr</code> to read a filesystem objects, "extended attributes."</p> <p>For example I can run <code>getfattr</code> on my helloWorld app to see the following lables: </p><pre class="fragment"># getfattr -dm- helloWorld/ file: helloWorld/ security.SMACK64="framework" </pre><p>It is in these extended attributes that SMACK stores the label(s) for an object. For regular files they can only have the one label attribute named "security.SMACK64". If the object is a socket it can have three labels, <code>security.SMACK64</code>, <code>security.SMACK64IPIN</code>, and <code>security.SMACK64IPOUT</code>.</p> <p>In order to examine the labels of running processes you need to go to the process filesystem, under /proc.</p> <p>For example, in order to display the label of the shell you are currently running in you can issue the following command:</p> <pre class="fragment">cat /proc/$$/attr/current ; echo </pre><p>Where the variable <code>$</code> in the previous line is automatically set by the shell to the PID of the shell's process. If you wish to examine the labels of other processes you need to know their PID. One trick is to use the Linux command <code>pidof</code>. You supply <code>pidof</code> the name of a process.</p> <p>For example, to get the label of the configTree you would issue the command:</p> <pre class="fragment">cat /proc/`pidof helloWorld`/attr/current ; echo </pre><dl class="section note"><dt>Note</dt><dd>If there are multiple processes of the same name, <code>pidof</code> will return a list of PIDs and you may need some other way to determine the PID of the process you want.</dd></dl> <p>If you're writing code to read the label of your own process you can use the <code>self</code> symlink without needing to know the PID for your process. Simply open the file <code>/proc/self/attr/current</code>.</p> <p>You can also do this from the shell, but keep in mind, not all shell commands are built into the shell. Results may differ depending on how you structure your commands.</p> <p>If for example you run: </p><pre class="fragment">cat /proc/self/attr/current ; echo </pre><p>Instead of the previous: </p><pre class="fragment">cat /proc/$$/attr/current ; echo </pre><p>You will end up with the label of the <code>cat</code> process and not the shell process.</p> <h1><a class="anchor" id="conceptsSecuritySmack_Capabilities"></a> SMACK Capabilities</h1> <p>Processes can be given a set of <b>capabilities</b> and its the position of these capabilities that allow certain actions to be taken (i.e.; changing labels on files and processes or changing rules).</p> <p>To modify labels and rules you must have the correct capabilities, by default in the Legato Linux system all process are run by the root user and automatically have this capability.</p> <p>A good place to read more about SMACK and its configuration is to check out its <a href="https://www.kernel.org/doc/Documentation/security/Smack.txt">official documentation</a>.</p> <h1><a class="anchor" id="conceptsSecuritySmack_onlycap"></a> SMACK onlycap</h1> <p>In standard operations, all processes run under the root user are given access to all SMACK labels and have all capabilities enabled. That is any process under root can do pretty much anything it wants with no trouble.</p> <p>This can be a large security hole. If a process can escalate to running something under the root user, then that potentially malicious code can do anything it wants to the device.</p> <p>To resolve this we've enabled SMACK onlycap. SMACK onlycap allows the system administrator to designate a single label with heightened privilege. Once this is in effect only the properly labeled processes may change labels and rules and all of the other SMACK rules are always in effect regardless of the user the process is running under.</p> <p>The Legato makefile includes the option of turning onlycap support on. (Note that you need a Linux system image with the base support enabled.)</p> <p>To build Legato with onlycap support enabled for the <code>wp76</code> run:</p> <pre class="fragment">make menuconfig_wp76xx </pre><p>Then, in the displayed configuration menu, enable SMACK onlycap (Framework &gt; Security Features &gt; Enable SMACK onlycap).</p> <h1><a class="anchor" id="conceptsSecuritySmack_smackUsage"></a> How SMACK is configured in Legato</h1> <p>The Legato Supervisor and Update Daemon is given the label, "admin". Onlycap is enabled on this label, thus only the supervisor and update daemon will be able to adjust labels and rules. Other framework daemons (serviceDirectory, configTree etc.) are given the SMACK label "framework".</p> <p>All applications run under their own labels of the form "app.&lt;app-name&gt;". All unsandboxed apps are given rules to give them access that give them read/write access to the system.</p> <p>SMACK rules are set so IPC bindings between apps work. Here's a code sample of rules to set if a client app needs to access a server app:</p> <p>On the target, set the rules in the <code>/legato/smack/load2</code> file. </p><pre class="fragment">'clientAppLabel' rw 'serverAppLabel' 'serverAppLabel' rw 'clientAppLabel' </pre><p>Sandboxed directories are given labels corresponding to the app's access rights to those directory. Generally, an app only has read and execute permission to its sandboxes /bin directory.</p> <p>Example properties: </p><pre class="fragment">owner = root group = root DAC permissions = ------r-x SMACK label = 'AppLabelrx' </pre><p>The Supervisor also sets up the SMACK rule so the app has the proper access to the directory:</p> <p>On the target, set the rules in the <code>/legato/smack/load2</code> file. </p><pre class="fragment">'AppLabel' rx 'AppLabelrx' </pre><p>App's directories are given different labels from the app itself so that if an IPC binding is present. The remote app has access to the local app but doesn't have direct access to the local app's files.</p> <p>All bundled files within an app's sandbox are given the app's SMACK label. This supports passing file descriptors from one app to another. However, the file descriptor can't be passed onto a third app.</p> <p>Legato also includes an assistance API to help with working with SMACK, see smack.h for more details.</p> <h1><a class="anchor" id="conceptsSecuritySmack_limitations"></a> Limitations</h1> <p>Extended attributes used to store the SMACK label are available on all file systems we currently use with one key feature is missing: when a new file is created, the file should inherit the SMACK label of the creator. Because this feature is missing, our current implementation of SMACK has the following limitations:</p><ul> <li>Mqueue file system will always set new files to "_" label. This means we can't control access between apps that use MQueues.</li> <li>Tmpfs always sets new files to "*" label. This means we can't totally control access to files created in sandboxes because sandboxes use tmpfs. It's only an issue when file descriptors for the created files are passed over IPC to another app. The other app can then pass that fd onto a third app and so on.</li> <li>QMI sockets are currently set to "*" because some apps need to write to them. Ideally, the QMI socket file would be given a label such as "qmi" and a rule would be created to only allow access to the app that requires it. However, there currently isn't a way to specify this in the xdef file.</li> </ul> <h1><a class="anchor" id="conceptsSecuritySmack_troubleshooting"></a> Troubleshooting</h1> <p>If you encounter problems with SMACK permissions while developing your apps you can enable <b>SMACK</b> <b>auditing</b>. To do this you need to change Kernel build flags and rebuild your Linux image.</p> <p>In the Yocto wp76 source tree open the file:</p> <pre class="fragment">kernel/arch/arm/configs/mdm9607_defconfig </pre><p>Make sure that the following flags are set:</p> <pre class="fragment">CONFIG_SECURITY_SMACK_BRINGUP=y CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y </pre><p>Once done, save/rebuild/install the Linux image.</p> <p>To enable logging for an app or label of your choice, write the label that's having troubles to the special device file unconfined, for example if your app is named, "myTestApp". You can run the command in your shell:</p> <p>echo "app.myTestApp" &gt; /legato/smack/unconfined</p> <p>This will bypass all SMACK rules for any accesses for this label, but if the rule would fail in normal operation the SMACK subsystem will now log the access request and the reason for the failure.</p> <dl class="section note"><dt>Note</dt><dd>You can only install one label at a time.</dd></dl> <p class="copyright">Copyright (C) Sierra Wireless Inc. </p> </div></div> <br clear="left"/> </div> </div> <link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/> <script src="resources/js/tree.jquery.js" type="text/javascript"></script> <script src="resources/js/jquery.cookie.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/> <script src="resources/js/perfect-scrollbar.jquery.min.js"></script> </body> </html>
Java
package okta import ( "fmt" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/logical/framework" ) func Factory(conf *logical.BackendConfig) (logical.Backend, error) { return Backend().Setup(conf) } func Backend() *backend { var b backend b.Backend = &framework.Backend{ Help: backendHelp, PathsSpecial: &logical.Paths{ Unauthenticated: []string{ "login/*", }, }, Paths: append([]*framework.Path{ pathConfig(&b), pathUsers(&b), pathGroups(&b), pathUsersList(&b), pathGroupsList(&b), pathLogin(&b), }), AuthRenew: b.pathLoginRenew, } return &b } type backend struct { *framework.Backend } func (b *backend) Login(req *logical.Request, username string, password string) ([]string, *logical.Response, error) { cfg, err := b.Config(req.Storage) if err != nil { return nil, nil, err } if cfg == nil { return nil, logical.ErrorResponse("Okta backend not configured"), nil } client := cfg.OktaClient() auth, err := client.Authenticate(username, password) if err != nil { return nil, logical.ErrorResponse(fmt.Sprintf("Okta auth failed: %v", err)), nil } if auth == nil { return nil, logical.ErrorResponse("okta auth backend unexpected failure"), nil } oktaGroups, err := b.getOktaGroups(cfg, auth.Embedded.User.ID) if err != nil { return nil, logical.ErrorResponse(err.Error()), nil } if b.Logger().IsDebug() { b.Logger().Debug("auth/okta: Groups fetched from Okta", "num_groups", len(oktaGroups), "groups", oktaGroups) } oktaResponse := &logical.Response{ Data: map[string]interface{}{}, } if len(oktaGroups) == 0 { errString := fmt.Sprintf( "no Okta groups found; only policies from locally-defined groups available") oktaResponse.AddWarning(errString) } var allGroups []string // Import the custom added groups from okta backend user, err := b.User(req.Storage, username) if err == nil && user != nil && user.Groups != nil { if b.Logger().IsDebug() { b.Logger().Debug("auth/okta: adding local groups", "num_local_groups", len(user.Groups), "local_groups", user.Groups) } allGroups = append(allGroups, user.Groups...) } // Merge local and Okta groups allGroups = append(allGroups, oktaGroups...) // Retrieve policies var policies []string for _, groupName := range allGroups { group, err := b.Group(req.Storage, groupName) if err == nil && group != nil && group.Policies != nil { policies = append(policies, group.Policies...) } } // Merge local Policies into Okta Policies if user != nil && user.Policies != nil { policies = append(policies, user.Policies...) } if len(policies) == 0 { errStr := "user is not a member of any authorized policy" if len(oktaResponse.Warnings) > 0 { errStr = fmt.Sprintf("%s; additionally, %s", errStr, oktaResponse.Warnings[0]) } oktaResponse.Data["error"] = errStr return nil, oktaResponse, nil } return policies, oktaResponse, nil } func (b *backend) getOktaGroups(cfg *ConfigEntry, userID string) ([]string, error) { if cfg.Token != "" { client := cfg.OktaClient() groups, err := client.Groups(userID) if err != nil { return nil, err } oktaGroups := make([]string, 0, len(*groups)) for _, group := range *groups { oktaGroups = append(oktaGroups, group.Profile.Name) } return oktaGroups, err } return nil, nil } const backendHelp = ` The Okta credential provider allows authentication querying, checking username and password, and associating policies. If an api token is configure groups are pulled down from Okta. Configuration of the connection is done through the "config" and "policies" endpoints by a user with root access. Authentication is then done by suppying the two fields for "login". `
Java
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Oracle Cloud AI Services API // // OCI AI Service solutions can help Enterprise customers integrate AI into their products immediately by using our proven, // pre-trained/custom models or containers, and without a need to set up in house team of AI and ML experts. // This allows enterprises to focus on business drivers and development work rather than AI/ML operations, shortening the time to market. // package aianomalydetection import ( "encoding/json" "github.com/oracle/oci-go-sdk/v46/common" ) // DataSourceDetailsInflux Data Source details for influx. type DataSourceDetailsInflux struct { VersionSpecificDetails InfluxDetails `mandatory:"true" json:"versionSpecificDetails"` // Username for connection to Influx UserName *string `mandatory:"true" json:"userName"` // Password Secret Id for the influx connection PasswordSecretId *string `mandatory:"true" json:"passwordSecretId"` // Measurement name for influx MeasurementName *string `mandatory:"true" json:"measurementName"` // public IP address and port to influx DB Url *string `mandatory:"true" json:"url"` } func (m DataSourceDetailsInflux) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m DataSourceDetailsInflux) MarshalJSON() (buff []byte, e error) { type MarshalTypeDataSourceDetailsInflux DataSourceDetailsInflux s := struct { DiscriminatorParam string `json:"dataSourceType"` MarshalTypeDataSourceDetailsInflux }{ "INFLUX", (MarshalTypeDataSourceDetailsInflux)(m), } return json.Marshal(&s) } // UnmarshalJSON unmarshals from json func (m *DataSourceDetailsInflux) UnmarshalJSON(data []byte) (e error) { model := struct { VersionSpecificDetails influxdetails `json:"versionSpecificDetails"` UserName *string `json:"userName"` PasswordSecretId *string `json:"passwordSecretId"` MeasurementName *string `json:"measurementName"` Url *string `json:"url"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} nn, e = model.VersionSpecificDetails.UnmarshalPolymorphicJSON(model.VersionSpecificDetails.JsonData) if e != nil { return } if nn != nil { m.VersionSpecificDetails = nn.(InfluxDetails) } else { m.VersionSpecificDetails = nil } m.UserName = model.UserName m.PasswordSecretId = model.PasswordSecretId m.MeasurementName = model.MeasurementName m.Url = model.Url return }
Java
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Models { /// <summary> /// 订单状态 /// </summary> public enum OrderState { /// <summary> /// 已提交 /// </summary> Submitted = 10, /// <summary> /// 等待付款 /// </summary> WaitPaying = 30, /// <summary> /// 已付款 /// </summary> Confirming = 50 } }
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html data-context="Build Apps" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>Security - Legato Docs</title> <meta content="legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development" name="description"/> <meta content="legato, iot" name="keywords"/> <meta content="18.08.0" name="legato-version"/> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/> <link href="resources/images/legato.ico" rel="shortcut icon"/> <link href="resources/images/legato.ico" rel="icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="shortcut icon" type="image/x-icon"/> <link href="resources/images/legato.ico" rel="apple-touch-icon" type="image/x-icon"/> <link href="resources/css/style.css" media="screen" rel="stylesheet" type="text/css"/> <link href="resources/css/font-awesome.css" rel="stylesheet" type="text/css"/> <!--[if IE]> <script src="resources/js/html5shiv.js"></script> <script src="resources/js/respond.js"></script> <![endif]--> <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script> <script src="resources/js/main.js"></script> <script src="tocs/Build_Apps_Concepts.json"></script> </head> <body> <noscript> <input class="modal-closing-trick" id="modal-closing-trick" type="checkbox"/> <div id="nojs"> <label for="modal-closing-trick"> <span>You seem to not have Javascript <a href="http://enable-javascript.com">enabled</a>, so site functionality like the search and navigation tree won't work.</span> </label> </div> </noscript> <div class="wrapper"> <div class="fa fa-bars documentation" id="menu-trigger"></div> <div id="top"> <header> <nav> <a class="navlink" href="/">Introduction</a><a class="navlink selected" href="buildAppsMain.html">Build Apps</a><a class="navlink" href="buildPlatformMain.html">Build Platform</a><a class="navlink" href="aboutMain.html">About</a> </nav> </header> </div> <div class="white" id="menudocumentation"> <header> <a href="/"> <img alt="Back to Legato Homepage" id="logo" src="resources/images/legato_logo.png"/></a> <h2>/ Build Apps</h2> <nav class="secondary"> <a href="getStarted.html">Get Started</a><a class="link-selected" href="concepts.html">Concepts</a><a href="apiGuidesMain.html">API Guides</a><a href="tools.html">Tools</a><a href="howToMain.html">How To</a> </nav> <nav class="ui-front"> <i class="fa fa-search" id="search-icon"></i> <input id="searchbox" placeholder="Search"/> </nav> </header> </div> <div id="resizable"> <div id="left"> <div id="tree1"></div> </div> </div> <div class="content"> <div class="header"> <div class="headertitle"> <h1 class="title">Security </h1> </div> </div><div class="contents"> <div class="textblock"><h1>Sandboxing Apps </h1> <p>Legato uses sandboxes to provide a security layer between apps running in the same system. Legato sandboxes isolate apps from the rest of the system. This allows both original equipment manufacturer (OEM) and independent software vendor (ISV) apps to coexist safely on the same device without fear of interfering with each other or breaking the rest of the software stack.</p> <p>Each app has its own unique user ID, group ID, and root directory.</p> <p>Legato sandboxes use <em>chroot</em> to limit an app's view to its own section of the file system only. Files are bound into the chroot jail using bind mounts. The process then only has access to files and directories under its root directory. Only processes with certain capabilities can find their way outside of their root directory; processes belonging to sandboxed apps run as unprivileged users that don't have those capabilities.</p> <p>Legato sandboxes use bind mounts to import files into sandboxes (defined using the <code></code>.adef and <code></code>.sdef <code>requires</code> section). This works like a file system hard link, except that the link is only stored in RAM and can cross over to different file systems. Bind-mounting avoids copying so the overhead is minimal.</p> <p>Access control for files visible within the sandbox is done using a combination of standard POSIX discretionary access control (based on user and group permissions) and mandatory access control provided by Linux's SMACK.</p> <p>A Legato sandboxed app can access services outside its sandbox via inter-process communication (IPC). All available IPC services are advertised by the Service Directory. Apps connect to services through a request to the Service Directory. The Service Directory grants access only if the app has been explicitly bound to a service (using the <code></code>.adef and <code></code>.sdef <code>bindings</code> section). When access is granted, the connection to the client is passed to the server and all communication between the client and the server are direct from that point on. SMACK is also used to add another layer of security to the IPC, limiting the passing of IPC socket file descriptors from one app to another</p> <p>Legato sandboxes also provide <em>resource limitations</em>. Resource limitations place limits on the amount of system resources an app is allowed to consume. Without resource limits, an isolated app can still cause damage by consuming all available resources.</p> <p>For more details on Sandbox Security:</p> <table class="doxtable"> <tr> <th>Section </th><th>Description </th></tr> <tr> <td><a class="el" href="conceptsSecuritySandboxOverview.html">Sandbox Overview</a> </td><td>Overview of Sandbox Security </td></tr> <tr> <td><a class="el" href="conceptsSecuritySandboxConfigSample.html">Sandbox Config Sample</a> </td><td>Configuration Sample of adding Sandboxing to an app </td></tr> <tr> <td><a class="el" href="conceptsSecuritySandboxLimits.html">Sandboxed App Limits</a> </td><td>Sandbox limitations </td></tr> </table> <h1>SMACK </h1> <p>Simplified Mandatory Access Control Kernel (SMACK) provides a simple solution for mandatory access control (MAC). MAC provides the ability for a centralized entity to set access policy for system resources.</p> <p>The Linux default access control policy is governed by permission bits on system resources at the discretion of the resource owner: discretionary access control (DAC). Policies are set in a distributed way so different system users can set access policy for their own resources.</p> <p>MAC policies are often used to overcome DAC limitations for systems that require a higher level of security.</p> <p>SMACK is used to supplement DAC. DAC permissions are checked first; if access is granted, SMACK permissions are then checked. SMACK can only limit access, it can't grant access beyond DAC permissions.</p> <p>SMACK uses 'labels' on resources (objects in SMACK terminology) and processes (subjects) to determine access. Labels on resources can only be set by a privileged process (the <code>CAP_MAC_OVERRIDE</code> label designates a process as <em>privileged</em>)</p> <p>SMACK policies are set by the Legato startup scripts, the Legato Installer and the Legato Supervisor.</p> <table class="doxtable"> <tr> <th>Section </th><th>Description </th></tr> <tr> <td><a class="el" href="conceptsSecuritySmack.html">Implementing SMACK</a> </td><td>Overview of SMACK security as implimented in the Framework </td></tr> </table> <p class="copyright">Copyright (C) Sierra Wireless Inc. </p> </div></div> <br clear="left"/> </div> </div> <link href="resources/css/jqtree.css" rel="stylesheet" type="text/css"/> <script src="resources/js/tree.jquery.js" type="text/javascript"></script> <script src="resources/js/jquery.cookie.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <link href="resources/css/perfect-scrollbar.min.css" rel="stylesheet"/> <script src="resources/js/perfect-scrollbar.jquery.min.js"></script> </body> </html>
Java
import querystring from 'querystring' import SlackRTM from './SlackRTM' import FetchService from 'shared/FetchService' import userStore from 'stores/user/userStore' import accountStore from 'stores/account/accountStore' import { remote, ipcRenderer } from 'electron' import uuid from 'uuid' import { WB_WCFETCH_SERVICE_TEXT_CLEANUP } from 'shared/ipcEvents' const BASE_URL = 'https://slack.com/api/auth.test#sync-channel' class SlackHTTP { /* **************************************************************************/ // Utils /* **************************************************************************/ /** * Rejects a call because the service has no authentication info * @param info: any information we have * @return promise - rejected */ static _rejectWithNoAuth (info) { return Promise.reject(new Error('Service missing authentication information')) } static _fetch (serviceId, url, partitionId, opts) { return Promise.race([ this._fetchRaw(serviceId, url, partitionId, opts), new Promise((resolve, reject) => { setTimeout(() => { reject(new Error('timeout')) }, 30000) }) ]) } static _fetchRaw (serviceId, url, partitionId, opts) { if (userStore.getState().wceSlackHTTPWcThread()) { const wcId = accountStore.getState().getWebcontentTabId(serviceId) if (wcId) { const wc = remote.webContents.fromId(wcId) if (wc && !wc.isDestroyed()) { let isSlack try { isSlack = (new window.URL(wc.getURL())).hostname.endsWith('slack.com') } catch (ex) { isSlack = false } if (isSlack) { return Promise.resolve() .then(() => new Promise((resolve, reject) => { const channel = uuid.v4() let ipcMessageHandler let destroyedHandler let navigationHandler ipcMessageHandler = (evt, args) => { if (args[0] === channel) { wc.removeListener('ipc-message', ipcMessageHandler) wc.removeListener('destroyed', destroyedHandler) wc.removeListener('did-start-navigation', navigationHandler) resolve(args[1]) } } destroyedHandler = () => { wc.removeListener('ipc-message', ipcMessageHandler) wc.removeListener('did-start-navigation', navigationHandler) reject(new Error('inloaderror')) } navigationHandler = () => { wc.removeListener('ipc-message', ipcMessageHandler) wc.removeListener('destroyed', destroyedHandler) wc.removeListener('did-start-navigation', navigationHandler) reject(new Error('inloaderror')) } wc.on('ipc-message', ipcMessageHandler) wc.on('destroyed', destroyedHandler) wc.on('did-start-navigation', navigationHandler) wc.send('WB_WCFETCH_SERVICE_TEXT_RUNNER', channel, url, opts) })) .then( (res) => { ipcRenderer.send(WB_WCFETCH_SERVICE_TEXT_CLEANUP, BASE_URL, partitionId) return Promise.resolve({ status: res.status, ok: res.ok, text: () => Promise.resolve(res.body), json: () => Promise.resolve(JSON.parse(res.body)) }) }, (_err) => { return FetchService.wcRequest(BASE_URL, url, partitionId, opts) } ) } } } return FetchService.wcRequest(BASE_URL, url, partitionId, opts) } else { return FetchService.request(url, partitionId, opts) } } /* **************************************************************************/ // Profile /* **************************************************************************/ /** * Tests the auth * @param auth: the auth token * @return promise */ static testAuth (serviceId, auth, partitionId) { if (!auth) { return this._rejectWithNoAuth() } const query = querystring.stringify({ token: auth, '_x_gantry': true }) return Promise.resolve() .then(() => this._fetch(serviceId, 'https://slack.com/api/auth.test?' + query, partitionId, { credentials: 'include' })) .then((res) => res.ok ? Promise.resolve(res) : Promise.reject(res)) .then((res) => res.json()) .then((res) => res.ok ? Promise.resolve(res) : Promise.reject(res)) } /* **************************************************************************/ // RTM Start /* **************************************************************************/ /** * Starts the RTM sync service * @param auth: the auth token * @return promise */ static startRTM (serviceId, auth, partitionId) { if (!auth) { return this._rejectWithNoAuth() } const query = querystring.stringify({ token: auth, mpim_aware: true, '_x_gantry': true }) return Promise.resolve() .then(() => this._fetch(serviceId, 'https://slack.com/api/rtm.start?' + query, partitionId, { credentials: 'include' })) .then((res) => res.ok ? Promise.resolve(res) : Promise.reject(res)) .then((res) => res.json()) .then((res) => res.ok ? Promise.resolve(res) : Promise.reject(res)) .then((res) => { return { response: res, rtm: new SlackRTM(res.url) } }) } /* **************************************************************************/ // Unread /* **************************************************************************/ /** * Gets the unread info from the server * @param auth: the auth token * @param simpleUnreads = true: true to return the simple unread counts */ static fetchUnreadInfo (serviceId, auth, partitionId, simpleUnreads = true) { if (!auth) { return this._rejectWithNoAuth() } const query = querystring.stringify({ token: auth, simple_unreads: simpleUnreads, mpim_aware: true, include_threads: true, '_x_gantry': true }) return Promise.resolve() .then(() => this._fetch(serviceId, 'https://slack.com/api/users.counts?' + query, partitionId, { credentials: 'include' })) .then((res) => res.ok ? Promise.resolve(res) : Promise.reject(res)) .then((res) => res.json()) .then((res) => res.ok ? Promise.resolve(res) : Promise.reject(res)) } } export default SlackHTTP
Java
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "2D.h" #include "PathAnalysis.h" #include "PathHelpers.h" namespace mozilla { namespace gfx { static float CubicRoot(float aValue) { if (aValue < 0.0) { return -CubicRoot(-aValue); } else { return powf(aValue, 1.0f / 3.0f); } } struct BezierControlPoints { BezierControlPoints() {} BezierControlPoints(const Point &aCP1, const Point &aCP2, const Point &aCP3, const Point &aCP4) : mCP1(aCP1), mCP2(aCP2), mCP3(aCP3), mCP4(aCP4) { } Point mCP1, mCP2, mCP3, mCP4; }; void FlattenBezier(const BezierControlPoints &aPoints, PathSink *aSink, Float aTolerance); Path::Path() { } Path::~Path() { } Float Path::ComputeLength() { EnsureFlattenedPath(); return mFlattenedPath->ComputeLength(); } Point Path::ComputePointAtLength(Float aLength, Point* aTangent) { EnsureFlattenedPath(); return mFlattenedPath->ComputePointAtLength(aLength, aTangent); } void Path::EnsureFlattenedPath() { if (!mFlattenedPath) { mFlattenedPath = new FlattenedPath(); StreamToSink(mFlattenedPath); } } // This is the maximum deviation we allow (with an additional ~20% margin of // error) of the approximation from the actual Bezier curve. const Float kFlatteningTolerance = 0.0001f; void FlattenedPath::MoveTo(const Point &aPoint) { MOZ_ASSERT(!mCalculatedLength); FlatPathOp op; op.mType = FlatPathOp::OP_MOVETO; op.mPoint = aPoint; mPathOps.push_back(op); mLastMove = aPoint; } void FlattenedPath::LineTo(const Point &aPoint) { MOZ_ASSERT(!mCalculatedLength); FlatPathOp op; op.mType = FlatPathOp::OP_LINETO; op.mPoint = aPoint; mPathOps.push_back(op); } void FlattenedPath::BezierTo(const Point &aCP1, const Point &aCP2, const Point &aCP3) { MOZ_ASSERT(!mCalculatedLength); FlattenBezier(BezierControlPoints(CurrentPoint(), aCP1, aCP2, aCP3), this, kFlatteningTolerance); } void FlattenedPath::QuadraticBezierTo(const Point &aCP1, const Point &aCP2) { MOZ_ASSERT(!mCalculatedLength); // We need to elevate the degree of this quadratic B�zier to cubic, so we're // going to add an intermediate control point, and recompute control point 1. // The first and last control points remain the same. // This formula can be found on http://fontforge.sourceforge.net/bezier.html Point CP0 = CurrentPoint(); Point CP1 = (CP0 + aCP1 * 2.0) / 3.0; Point CP2 = (aCP2 + aCP1 * 2.0) / 3.0; Point CP3 = aCP2; BezierTo(CP1, CP2, CP3); } void FlattenedPath::Close() { MOZ_ASSERT(!mCalculatedLength); LineTo(mLastMove); } void FlattenedPath::Arc(const Point &aOrigin, float aRadiusX, float aRadiusY, float aRotationAngle, float aStartAngle, float aEndAngle, bool aAntiClockwise) { ArcToBezier(this, aOrigin, Size(aRadiusX, aRadiusY), aStartAngle, aEndAngle, aAntiClockwise); } Float FlattenedPath::ComputeLength() { if (!mCalculatedLength) { Point currentPoint; for (uint32_t i = 0; i < mPathOps.size(); i++) { if (mPathOps[i].mType == FlatPathOp::OP_MOVETO) { currentPoint = mPathOps[i].mPoint; } else { mCachedLength += Distance(currentPoint, mPathOps[i].mPoint); currentPoint = mPathOps[i].mPoint; } } mCalculatedLength = true; } return mCachedLength; } Point FlattenedPath::ComputePointAtLength(Float aLength, Point *aTangent) { // We track the last point that -wasn't- in the same place as the current // point so if we pass the edge of the path with a bunch of zero length // paths we still get the correct tangent vector. Point lastPointSinceMove; Point currentPoint; for (uint32_t i = 0; i < mPathOps.size(); i++) { if (mPathOps[i].mType == FlatPathOp::OP_MOVETO) { if (Distance(currentPoint, mPathOps[i].mPoint)) { lastPointSinceMove = currentPoint; } currentPoint = mPathOps[i].mPoint; } else { Float segmentLength = Distance(currentPoint, mPathOps[i].mPoint); if (segmentLength) { lastPointSinceMove = currentPoint; if (segmentLength > aLength) { Point currentVector = mPathOps[i].mPoint - currentPoint; Point tangent = currentVector / segmentLength; if (aTangent) { *aTangent = tangent; } return currentPoint + tangent * aLength; } } aLength -= segmentLength; currentPoint = mPathOps[i].mPoint; } } Point currentVector = currentPoint - lastPointSinceMove; if (aTangent) { if (hypotf(currentVector.x, currentVector.y)) { *aTangent = currentVector / hypotf(currentVector.x, currentVector.y); } else { *aTangent = Point(); } } return currentPoint; } // This function explicitly permits aControlPoints to refer to the same object // as either of the other arguments. static void SplitBezier(const BezierControlPoints &aControlPoints, BezierControlPoints *aFirstSegmentControlPoints, BezierControlPoints *aSecondSegmentControlPoints, Float t) { MOZ_ASSERT(aSecondSegmentControlPoints); *aSecondSegmentControlPoints = aControlPoints; Point cp1a = aControlPoints.mCP1 + (aControlPoints.mCP2 - aControlPoints.mCP1) * t; Point cp2a = aControlPoints.mCP2 + (aControlPoints.mCP3 - aControlPoints.mCP2) * t; Point cp1aa = cp1a + (cp2a - cp1a) * t; Point cp3a = aControlPoints.mCP3 + (aControlPoints.mCP4 - aControlPoints.mCP3) * t; Point cp2aa = cp2a + (cp3a - cp2a) * t; Point cp1aaa = cp1aa + (cp2aa - cp1aa) * t; aSecondSegmentControlPoints->mCP4 = aControlPoints.mCP4; if(aFirstSegmentControlPoints) { aFirstSegmentControlPoints->mCP1 = aControlPoints.mCP1; aFirstSegmentControlPoints->mCP2 = cp1a; aFirstSegmentControlPoints->mCP3 = cp1aa; aFirstSegmentControlPoints->mCP4 = cp1aaa; } aSecondSegmentControlPoints->mCP1 = cp1aaa; aSecondSegmentControlPoints->mCP2 = cp2aa; aSecondSegmentControlPoints->mCP3 = cp3a; } static void FlattenBezierCurveSegment(const BezierControlPoints &aControlPoints, PathSink *aSink, Float aTolerance) { /* The algorithm implemented here is based on: * http://cis.usouthal.edu/~hain/general/Publications/Bezier/Bezier%20Offset%20Curves.pdf * * The basic premise is that for a small t the third order term in the * equation of a cubic bezier curve is insignificantly small. This can * then be approximated by a quadratic equation for which the maximum * difference from a linear approximation can be much more easily determined. */ BezierControlPoints currentCP = aControlPoints; Float t = 0; while (t < 1.0f) { Point cp21 = currentCP.mCP2 - currentCP.mCP3; Point cp31 = currentCP.mCP3 - currentCP.mCP1; Float s3 = (cp31.x * cp21.y - cp31.y * cp21.x) / hypotf(cp21.x, cp21.y); t = 2 * Float(sqrt(aTolerance / (3. * abs(s3)))); if (t >= 1.0f) { aSink->LineTo(aControlPoints.mCP4); break; } Point prevCP2, prevCP3, nextCP1, nextCP2, nextCP3; SplitBezier(currentCP, nullptr, &currentCP, t); aSink->LineTo(currentCP.mCP1); } } static inline void FindInflectionApproximationRange(BezierControlPoints aControlPoints, Float *aMin, Float *aMax, Float aT, Float aTolerance) { SplitBezier(aControlPoints, nullptr, &aControlPoints, aT); Point cp21 = aControlPoints.mCP2 - aControlPoints.mCP1; Point cp41 = aControlPoints.mCP4 - aControlPoints.mCP1; if (cp21.x == 0.f && cp21.y == 0.f) { // In this case s3 becomes lim[n->0] (cp41.x * n) / n - (cp41.y * n) / n = cp41.x - cp41.y. // Use the absolute value so that Min and Max will correspond with the // minimum and maximum of the range. *aMin = aT - CubicRoot(abs(aTolerance / (cp41.x - cp41.y))); *aMax = aT + CubicRoot(abs(aTolerance / (cp41.x - cp41.y))); return; } Float s3 = (cp41.x * cp21.y - cp41.y * cp21.x) / hypotf(cp21.x, cp21.y); if (s3 == 0) { // This means within the precision we have it can be approximated // infinitely by a linear segment. Deal with this by specifying the // approximation range as extending beyond the entire curve. *aMin = -1.0f; *aMax = 2.0f; return; } Float tf = CubicRoot(abs(aTolerance / s3)); *aMin = aT - tf * (1 - aT); *aMax = aT + tf * (1 - aT); } /* Find the inflection points of a bezier curve. Will return false if the * curve is degenerate in such a way that it is best approximated by a straight * line. * * The below algorithm was written by Jeff Muizelaar <jmuizelaar@mozilla.com>, explanation follows: * * The lower inflection point is returned in aT1, the higher one in aT2. In the * case of a single inflection point this will be in aT1. * * The method is inspired by the algorithm in "analysis of in?ection points for planar cubic bezier curve" * * Here are some differences between this algorithm and versions discussed elsewhere in the literature: * * zhang et. al compute a0, d0 and e0 incrementally using the follow formula: * * Point a0 = CP2 - CP1 * Point a1 = CP3 - CP2 * Point a2 = CP4 - CP1 * * Point d0 = a1 - a0 * Point d1 = a2 - a1 * Point e0 = d1 - d0 * * this avoids any multiplications and may or may not be faster than the approach take below. * * "fast, precise flattening of cubic bezier path and ofset curves" by hain et. al * Point a = CP1 + 3 * CP2 - 3 * CP3 + CP4 * Point b = 3 * CP1 - 6 * CP2 + 3 * CP3 * Point c = -3 * CP1 + 3 * CP2 * Point d = CP1 * the a, b, c, d can be expressed in terms of a0, d0 and e0 defined above as: * c = 3 * a0 * b = 3 * d0 * a = e0 * * * a = 3a = a.y * b.x - a.x * b.y * b = 3b = a.y * c.x - a.x * c.y * c = 9c = b.y * c.x - b.x * c.y * * The additional multiples of 3 cancel each other out as show below: * * x = (-b + sqrt(b * b - 4 * a * c)) / (2 * a) * x = (-3 * b + sqrt(3 * b * 3 * b - 4 * a * 3 * 9 * c / 3)) / (2 * 3 * a) * x = 3 * (-b + sqrt(b * b - 4 * a * c)) / (2 * 3 * a) * x = (-b + sqrt(b * b - 4 * a * c)) / (2 * a) * * I haven't looked into whether the formulation of the quadratic formula in * hain has any numerical advantages over the one used below. */ static inline void FindInflectionPoints(const BezierControlPoints &aControlPoints, Float *aT1, Float *aT2, uint32_t *aCount) { // Find inflection points. // See www.faculty.idc.ac.il/arik/quality/appendixa.html for an explanation // of this approach. Point A = aControlPoints.mCP2 - aControlPoints.mCP1; Point B = aControlPoints.mCP3 - (aControlPoints.mCP2 * 2) + aControlPoints.mCP1; Point C = aControlPoints.mCP4 - (aControlPoints.mCP3 * 3) + (aControlPoints.mCP2 * 3) - aControlPoints.mCP1; Float a = Float(B.x) * C.y - Float(B.y) * C.x; Float b = Float(A.x) * C.y - Float(A.y) * C.x; Float c = Float(A.x) * B.y - Float(A.y) * B.x; if (a == 0) { // Not a quadratic equation. if (b == 0) { // Instead of a linear acceleration change we have a constant // acceleration change. This means the equation has no solution // and there are no inflection points, unless the constant is 0. // In that case the curve is a straight line, essentially that means // the easiest way to deal with is is by saying there's an inflection // point at t == 0. The inflection point approximation range found will // automatically extend into infinity. if (c == 0) { *aCount = 1; *aT1 = 0; return; } *aCount = 0; return; } *aT1 = -c / b; *aCount = 1; return; } else { Float discriminant = b * b - 4 * a * c; if (discriminant < 0) { // No inflection points. *aCount = 0; } else if (discriminant == 0) { *aCount = 1; *aT1 = -b / (2 * a); } else { /* Use the following formula for computing the roots: * * q = -1/2 * (b + sign(b) * sqrt(b^2 - 4ac)) * t1 = q / a * t2 = c / q */ Float q = sqrtf(discriminant); if (b < 0) { q = b - q; } else { q = b + q; } q *= Float(-1./2); *aT1 = q / a; *aT2 = c / q; if (*aT1 > *aT2) { std::swap(*aT1, *aT2); } *aCount = 2; } } return; } void FlattenBezier(const BezierControlPoints &aControlPoints, PathSink *aSink, Float aTolerance) { Float t1; Float t2; uint32_t count; FindInflectionPoints(aControlPoints, &t1, &t2, &count); // Check that at least one of the inflection points is inside [0..1] if (count == 0 || ((t1 < 0 || t1 > 1.0) && ((t2 < 0 || t2 > 1.0) || count == 1)) ) { FlattenBezierCurveSegment(aControlPoints, aSink, aTolerance); return; } Float t1min = t1, t1max = t1, t2min = t2, t2max = t2; BezierControlPoints remainingCP = aControlPoints; // For both inflection points, calulate the range where they can be linearly // approximated if they are positioned within [0,1] if (count > 0 && t1 >= 0 && t1 < 1.0) { FindInflectionApproximationRange(aControlPoints, &t1min, &t1max, t1, aTolerance); } if (count > 1 && t2 >= 0 && t2 < 1.0) { FindInflectionApproximationRange(aControlPoints, &t2min, &t2max, t2, aTolerance); } BezierControlPoints nextCPs = aControlPoints; BezierControlPoints prevCPs; // Process ranges. [t1min, t1max] and [t2min, t2max] are approximated by line // segments. if (t1min > 0) { // Flatten the Bezier up until the first inflection point's approximation // point. SplitBezier(aControlPoints, &prevCPs, &remainingCP, t1min); FlattenBezierCurveSegment(prevCPs, aSink, aTolerance); } if (t1max >= 0 && t1max < 1.0 && (count == 1 || t2min > t1max)) { // The second inflection point's approximation range begins after the end // of the first, approximate the first inflection point by a line and // subsequently flatten up until the end or the next inflection point. SplitBezier(aControlPoints, nullptr, &nextCPs, t1max); aSink->LineTo(nextCPs.mCP1); if (count == 1 || (count > 1 && t2min >= 1.0)) { // No more inflection points to deal with, flatten the rest of the curve. FlattenBezierCurveSegment(nextCPs, aSink, aTolerance); } } else if (count > 1 && t2min > 1.0) { // We've already concluded t2min <= t1max, so if this is true the // approximation range for the first inflection point runs past the // end of the curve, draw a line to the end and we're done. aSink->LineTo(aControlPoints.mCP4); return; } if (count > 1 && t2min < 1.0 && t2max > 0) { if (t2min > 0 && t2min < t1max) { // In this case the t2 approximation range starts inside the t1 // approximation range. SplitBezier(aControlPoints, nullptr, &nextCPs, t1max); aSink->LineTo(nextCPs.mCP1); } else if (t2min > 0 && t1max > 0) { SplitBezier(aControlPoints, nullptr, &nextCPs, t1max); // Find a control points describing the portion of the curve between t1max and t2min. Float t2mina = (t2min - t1max) / (1 - t1max); SplitBezier(nextCPs, &prevCPs, &nextCPs, t2mina); FlattenBezierCurveSegment(prevCPs, aSink, aTolerance); } else if (t2min > 0) { // We have nothing interesting before t2min, find that bit and flatten it. SplitBezier(aControlPoints, &prevCPs, &nextCPs, t2min); FlattenBezierCurveSegment(prevCPs, aSink, aTolerance); } if (t2max < 1.0) { // Flatten the portion of the curve after t2max SplitBezier(aControlPoints, nullptr, &nextCPs, t2max); // Draw a line to the start, this is the approximation between t2min and // t2max. aSink->LineTo(nextCPs.mCP1); FlattenBezierCurveSegment(nextCPs, aSink, aTolerance); } else { // Our approximation range extends beyond the end of the curve. aSink->LineTo(aControlPoints.mCP4); return; } } } } }
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `removed_by_x9` fn in crate `unicode_bidi`."> <meta name="keywords" content="rust, rustlang, rust-lang, removed_by_x9"> <title>unicode_bidi::prepare::removed_by_x9 - Rust</title> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <p class='location'><a href='../index.html'>unicode_bidi</a>::<wbr><a href='index.html'>prepare</a></p><script>window.sidebarCurrent = {name: 'removed_by_x9', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>unicode_bidi</a>::<wbr><a href='index.html'>prepare</a>::<wbr><a class='fn' href=''>removed_by_x9</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-8279' class='srclink' href='../../src/unicode_bidi/lib.rs.html#647-649' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub fn removed_by_x9(class: <a class='enum' href='../../unicode_bidi/tables/enum.BidiClass.html' title='unicode_bidi::tables::BidiClass'>BidiClass</a>) -&gt; <a href='../../std/primitive.bool.html'>bool</a></pre><div class='docblock'><p>Should this character be ignored in steps after X9?</p> <p><a href="http://www.unicode.org/reports/tr9/#X9">http://www.unicode.org/reports/tr9/#X9</a></p> </div></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div> <div class="shortcuts"> <h1>Keyboard Shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search Tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </div> <script> window.rootPath = "../../"; window.currentCrate = "unicode_bidi"; window.playgroundUrl = ""; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script async src="../../search-index.js"></script> </body> </html>
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `T` enum in crate `style`."> <meta name="keywords" content="rust, rustlang, rust-lang, T"> <title>style::properties::longhands::word_break::computed_value::T - Rust</title> <link rel="stylesheet" type="text/css" href="../../../../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../../../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <p class='location'><a href='../../../../index.html'>style</a>::<wbr><a href='../../../index.html'>properties</a>::<wbr><a href='../../index.html'>longhands</a>::<wbr><a href='../index.html'>word_break</a>::<wbr><a href='index.html'>computed_value</a></p><script>window.sidebarCurrent = {name: 'T', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content enum"> <h1 class='fqn'><span class='in-band'>Enum <a href='../../../../index.html'>style</a>::<wbr><a href='../../../index.html'>properties</a>::<wbr><a href='../../index.html'>longhands</a>::<wbr><a href='../index.html'>word_break</a>::<wbr><a href='index.html'>computed_value</a>::<wbr><a class='enum' href=''>T</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span></span></h1> <pre class='rust enum'>pub enum T { normal, break_all, }</pre><h2 class='variants'>Variants</h2> <span id='variant.normal' class='variant'><code>normal</code></span><span id='variant.break_all' class='variant'><code>break_all</code></span><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></span><span class='out-of-band'></span></h3> <div class='impl-items'><h4 id='method.parse' class='method'><code>fn <a href='#method.parse' class='fnname'>parse</a>(input: &amp;mut <a class='struct' href='../../../../../cssparser/parser/struct.Parser.html' title='cssparser::parser::Parser'>Parser</a>) -&gt; <a class='enum' href='../../../../../core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a>,&nbsp;<a class='primitive' href='../../../../../std/primitive.tuple.html'>()</a>&gt;</code></h4> </div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../heapsize/trait.HeapSizeOf.html' title='heapsize::HeapSizeOf'>HeapSizeOf</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></span><span class='out-of-band'></span></h3> <div class='impl-items'><h4 id='method.heap_size_of_children' class='method'><code>fn <a href='../../../../../heapsize/trait.HeapSizeOf.html#tymethod.heap_size_of_children' class='fnname'>heap_size_of_children</a>(&amp;self) -&gt; <a class='primitive' href='../../../../../std/primitive.usize.html'>usize</a></code></h4> <div class='docblock'><p>Measure the size of any heap-allocated structures that hang off this value, but not the space taken up by the value itself (i.e. what size_of::<T> measures, more or less); that space is handled by the implementation of HeapSizeOf for Box<T> below. <a href="../../../../../heapsize/trait.HeapSizeOf.html#tymethod.heap_size_of_children">Read more</a></p> </div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></span><span class='out-of-band'></span></h3> <div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='../../../../../core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='../../../../../core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='../../../../../core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4> <div class='docblock'><p>Formats the value using the given formatter.</p> </div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../rustc_serialize/serialize/trait.Encodable.html' title='rustc_serialize::serialize::Encodable'>Encodable</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></span><span class='out-of-band'></span></h3> <div class='impl-items'><h4 id='method.encode' class='method'><code>fn <a href='../../../../../rustc_serialize/serialize/trait.Encodable.html#tymethod.encode' class='fnname'>encode</a>&lt;__S:&nbsp;<a class='trait' href='../../../../../rustc_serialize/serialize/trait.Encoder.html' title='rustc_serialize::serialize::Encoder'>Encoder</a>&gt;(&amp;self, __arg_0: &amp;mut __S) -&gt; <a class='enum' href='../../../../../core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='primitive' href='../../../../../std/primitive.tuple.html'>()</a>,&nbsp;__S::Error&gt;</code></h4> </div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../core/hash/trait.Hash.html' title='core::hash::Hash'>Hash</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></span><span class='out-of-band'></span></h3> <div class='impl-items'><h4 id='method.hash' class='method'><code>fn <a href='../../../../../core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a>&lt;__H:&nbsp;<a class='trait' href='../../../../../core/hash/trait.Hasher.html' title='core::hash::Hasher'>Hasher</a>&gt;(&amp;self, __arg_0: &amp;mut __H)</code></h4> <div class='docblock'><p>Feeds this value into the state given, updating the hasher as necessary.</p> </div><h4 id='method.hash_slice' class='method'><code>fn <a href='../../../../../core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a>&lt;H&gt;(data: <a class='primitive' href='../../../../../std/primitive.slice.html'>&amp;[Self]</a>, state: &amp;mut H) <span class='where'>where H: <a class='trait' href='../../../../../core/hash/trait.Hasher.html' title='core::hash::Hasher'>Hasher</a></span></code><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div></h4> <div class='docblock'><p>Feeds a slice of this type into the state provided.</p> </div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></span><span class='out-of-band'></span></h3> <div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></span><span class='out-of-band'></span></h3> <div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='../../../../../core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &amp;<a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a>) -&gt; <a class='primitive' href='../../../../../std/primitive.bool.html'>bool</a></code></h4> <div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../../../../core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p> </div><h4 id='method.ne' class='method'><code>fn <a href='../../../../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='../../../../../std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4> <div class='docblock'><p>This method tests for <code>!=</code>.</p> </div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></span><span class='out-of-band'></span></h3> <div class='impl-items'><h4 id='method.assert_receiver_is_total_eq' class='method'><code>fn <a href='../../../../../core/cmp/trait.Eq.html#method.assert_receiver_is_total_eq' class='fnname'>assert_receiver_is_total_eq</a>(&amp;self)</code></h4> </div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></span><span class='out-of-band'></span></h3> <div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='../../../../../core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></h4> <div class='docblock'><p>Returns a copy of the value. <a href="../../../../../core/clone/trait.Clone.html#tymethod.clone">Read more</a></p> </div><h4 id='method.clone_from' class='method'><code>fn <a href='../../../../../core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4> <div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="../../../../../core/clone/trait.Clone.html#method.clone_from">Read more</a></p> </div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../cssparser/serializer/trait.ToCss.html' title='cssparser::serializer::ToCss'>ToCss</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>T</a></code></span><span class='out-of-band'></span></h3> <div class='impl-items'><h4 id='method.to_css' class='method'><code>fn <a href='../../../../../cssparser/serializer/trait.ToCss.html#tymethod.to_css' class='fnname'>to_css</a>&lt;W&gt;(&amp;self, dest: &amp;mut W) -&gt; <a class='type' href='../../../../../core/fmt/type.Result.html' title='core::fmt::Result'>Result</a> <span class='where'>where W: <a class='trait' href='../../../../../core/fmt/trait.Write.html' title='core::fmt::Write'>Write</a></span></code></h4> <div class='docblock'><p>Serialize <code>self</code> in CSS syntax, writing to <code>dest</code>.</p> </div><h4 id='method.to_css_string' class='method'><code>fn <a href='../../../../../cssparser/serializer/trait.ToCss.html#method.to_css_string' class='fnname'>to_css_string</a>(&amp;self) -&gt; <a class='struct' href='../../../../../collections/string/struct.String.html' title='collections::string::String'>String</a></code></h4> <div class='docblock'><p>Serialize <code>self</code> in CSS syntax and return a string. <a href="../../../../../cssparser/serializer/trait.ToCss.html#method.to_css_string">Read more</a></p> </div><h4 id='method.fmt_to_css' class='method'><code>fn <a href='../../../../../cssparser/serializer/trait.ToCss.html#method.fmt_to_css' class='fnname'>fmt_to_css</a>&lt;W&gt;(&amp;self, dest: &amp;mut W) -&gt; <a class='enum' href='../../../../../core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='primitive' href='../../../../../std/primitive.tuple.html'>()</a>,&nbsp;<a class='struct' href='../../../../../core/fmt/struct.Error.html' title='core::fmt::Error'>Error</a>&gt; <span class='where'>where W: <a class='trait' href='../../../../../core/fmt/trait.Write.html' title='core::fmt::Write'>Write</a></span></code></h4> <div class='docblock'><p>Serialize <code>self</code> in CSS syntax and return a result compatible with <code>std::fmt::Show</code>. <a href="../../../../../cssparser/serializer/trait.ToCss.html#method.fmt_to_css">Read more</a></p> </div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../style/values/computed/trait.ComputedValueAsSpecified.html' title='style::values::computed::ComputedValueAsSpecified'>ComputedValueAsSpecified</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>SpecifiedValue</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-24850' class='srclink' href='../../../../../src/style/home/servo/buildbot/slave/doc/build/target/debug/build/style-9c4aa7d9dd75bd7f/out/properties.rs.html#14714' title='goto source code'>[src]</a></span></h3> <div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='../../../../../style/values/trait.NoViewportPercentage.html' title='style::values::NoViewportPercentage'>NoViewportPercentage</a> for <a class='enum' href='../../../../../style/properties/longhands/word_break/computed_value/enum.T.html' title='style::properties::longhands::word_break::computed_value::T'>SpecifiedValue</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-24851' class='srclink' href='../../../../../src/style/home/servo/buildbot/slave/doc/build/target/debug/build/style-9c4aa7d9dd75bd7f/out/properties.rs.html#14715' title='goto source code'>[src]</a></span></h3> <div class='impl-items'></div></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../../../../"; window.currentCrate = "style"; window.playgroundUrl = ""; </script> <script src="../../../../../jquery.js"></script> <script src="../../../../../main.js"></script> <script defer src="../../../../../search-index.js"></script> </body> </html>
Java
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package components const ( TYPEDELIMITER = "::" TYPEROUTER = "router" TYPENETWORK = "network" TYPEINSTANCE = "instance" GROUPINSTANCE = "ernest.instance_group" PROVIDERTYPE = `$(components.#[_component_id="credentials::vcloud"]._provider)` DATACENTERNAME = `$(components.#[_component_id="credentials::vcloud"].vdc)` DATACENTERTYPE = `$(components.#[_component_id="credentials::vcloud"]._provider)` DATACENTERUSERNAME = `$(components.#[_component_id="credentials::vcloud"].username)` DATACENTERPASSWORD = `$(components.#[_component_id="credentials::vcloud"].password)` DATACENTERREGION = `$(components.#[_component_id="credentials::vcloud"].region)` VCLOUDURL = `$(components.#[_component_id="credentials::vcloud"].vcloud_url)` )
Java