code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
--- # Tutorial Title title: "Using Libpmemobj to Manage Persistent Memory Arrays in C++" # Tutorial post date date: 2018-10-04T00:13:24Z # Publish immediately draft: false # Brief tutorial description description: "This code sample uses libpmemobj, a persistent memory library for C++, to demonstrate how to manage persistent memory arrays." # Tutorial image # eg: image: 'images/events/3.jpg' // Use a local image # eg: image: 'https://myevent.com/heroimg.jpg' // Use an image from the event website image: 'https://www.intel.com/content/dam/develop/external/us/en/images/using-libpmemobj-plus-plus-to-manage-persistent-memory-arrays-in-c-plus-plus-797916.gif' # Tutorial URL # eg: url: "https://www.youtube.com/watch?v=E2KYqdyZcQY" tutorial_url: "https://www.intel.com/content/www/us/en/developer/articles/code-sample/using-libpmemobj-to-manage-persistent-memory-arrays-in-c.html" # Tutorial category tutorials: ['PMDK'] # Post type type: 'tutorial' --- <!--- Do not write any content here. The front matter is the only required information. -->
pbalcer/pbalcer.github.io
content/tutorials/Using-libpmemobj-to-manage-persistent-memory-arrays-in-C++.md
Markdown
bsd-3-clause
1,056
/* * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ /* * ECDSA low level APIs are deprecated for public use, but still ok for * internal use. */ #include "internal/deprecated.h" #include <stdio.h> #include <openssl/x509.h> #include <openssl/ec.h> #include <openssl/core_names.h> #include <openssl/param_build.h> #include <openssl/rand.h> #include "internal/cryptlib.h" #include "internal/provider.h" #include "crypto/asn1.h" #include "crypto/evp.h" #include "crypto/ecx.h" #include "ec_local.h" #include "curve448/curve448_local.h" #include "ecx_backend.h" static int ecx_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) { const ECX_KEY *ecxkey = pkey->pkey.ecx; unsigned char *penc; if (ecxkey == NULL) { ERR_raise(ERR_LIB_EC, EC_R_INVALID_KEY); return 0; } penc = OPENSSL_memdup(ecxkey->pubkey, KEYLEN(pkey)); if (penc == NULL) { ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); return 0; } if (!X509_PUBKEY_set0_param(pk, OBJ_nid2obj(pkey->ameth->pkey_id), V_ASN1_UNDEF, NULL, penc, KEYLEN(pkey))) { OPENSSL_free(penc); ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); return 0; } return 1; } static int ecx_pub_decode(EVP_PKEY *pkey, const X509_PUBKEY *pubkey) { const unsigned char *p; int pklen; X509_ALGOR *palg; ECX_KEY *ecx; int ret = 0; if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey)) return 0; ecx = ossl_ecx_key_op(palg, p, pklen, pkey->ameth->pkey_id, KEY_OP_PUBLIC, NULL, NULL); if (ecx != NULL) { ret = 1; EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, ecx); } return ret; } static int ecx_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { const ECX_KEY *akey = a->pkey.ecx; const ECX_KEY *bkey = b->pkey.ecx; if (akey == NULL || bkey == NULL) return -2; return CRYPTO_memcmp(akey->pubkey, bkey->pubkey, KEYLEN(a)) == 0; } static int ecx_priv_decode_ex(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx, const char *propq) { int ret = 0; ECX_KEY *ecx = ossl_ecx_key_from_pkcs8(p8, libctx, propq); if (ecx != NULL) { ret = 1; EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, ecx); } return ret; } static int ecx_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) { const ECX_KEY *ecxkey = pkey->pkey.ecx; ASN1_OCTET_STRING oct; unsigned char *penc = NULL; int penclen; if (ecxkey == NULL || ecxkey->privkey == NULL) { ERR_raise(ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY); return 0; } oct.data = ecxkey->privkey; oct.length = KEYLEN(pkey); oct.flags = 0; penclen = i2d_ASN1_OCTET_STRING(&oct, &penc); if (penclen < 0) { ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); return 0; } if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(pkey->ameth->pkey_id), 0, V_ASN1_UNDEF, NULL, penc, penclen)) { OPENSSL_clear_free(penc, penclen); ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); return 0; } return 1; } static int ecx_size(const EVP_PKEY *pkey) { return KEYLEN(pkey); } static int ecx_bits(const EVP_PKEY *pkey) { if (IS25519(pkey->ameth->pkey_id)) { return X25519_BITS; } else if(ISX448(pkey->ameth->pkey_id)) { return X448_BITS; } else { return ED448_BITS; } } static int ecx_security_bits(const EVP_PKEY *pkey) { if (IS25519(pkey->ameth->pkey_id)) { return X25519_SECURITY_BITS; } else { return X448_SECURITY_BITS; } } static void ecx_free(EVP_PKEY *pkey) { ossl_ecx_key_free(pkey->pkey.ecx); } /* "parameters" are always equal */ static int ecx_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) { return 1; } static int ecx_key_print(BIO *bp, const EVP_PKEY *pkey, int indent, ASN1_PCTX *ctx, ecx_key_op_t op) { const ECX_KEY *ecxkey = pkey->pkey.ecx; const char *nm = OBJ_nid2ln(pkey->ameth->pkey_id); if (op == KEY_OP_PRIVATE) { if (ecxkey == NULL || ecxkey->privkey == NULL) { if (BIO_printf(bp, "%*s<INVALID PRIVATE KEY>\n", indent, "") <= 0) return 0; return 1; } if (BIO_printf(bp, "%*s%s Private-Key:\n", indent, "", nm) <= 0) return 0; if (BIO_printf(bp, "%*spriv:\n", indent, "") <= 0) return 0; if (ASN1_buf_print(bp, ecxkey->privkey, KEYLEN(pkey), indent + 4) == 0) return 0; } else { if (ecxkey == NULL) { if (BIO_printf(bp, "%*s<INVALID PUBLIC KEY>\n", indent, "") <= 0) return 0; return 1; } if (BIO_printf(bp, "%*s%s Public-Key:\n", indent, "", nm) <= 0) return 0; } if (BIO_printf(bp, "%*spub:\n", indent, "") <= 0) return 0; if (ASN1_buf_print(bp, ecxkey->pubkey, KEYLEN(pkey), indent + 4) == 0) return 0; return 1; } static int ecx_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent, ASN1_PCTX *ctx) { return ecx_key_print(bp, pkey, indent, ctx, KEY_OP_PRIVATE); } static int ecx_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent, ASN1_PCTX *ctx) { return ecx_key_print(bp, pkey, indent, ctx, KEY_OP_PUBLIC); } static int ecx_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) { switch (op) { case ASN1_PKEY_CTRL_SET1_TLS_ENCPT: { ECX_KEY *ecx = ossl_ecx_key_op(NULL, arg2, arg1, pkey->ameth->pkey_id, KEY_OP_PUBLIC, NULL, NULL); if (ecx != NULL) { EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, ecx); return 1; } return 0; } case ASN1_PKEY_CTRL_GET1_TLS_ENCPT: if (pkey->pkey.ecx != NULL) { unsigned char **ppt = arg2; *ppt = OPENSSL_memdup(pkey->pkey.ecx->pubkey, KEYLEN(pkey)); if (*ppt != NULL) return KEYLEN(pkey); } return 0; default: return -2; } } static int ecd_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) { switch (op) { case ASN1_PKEY_CTRL_DEFAULT_MD_NID: /* We currently only support Pure EdDSA which takes no digest */ *(int *)arg2 = NID_undef; return 2; default: return -2; } } static int ecx_set_priv_key(EVP_PKEY *pkey, const unsigned char *priv, size_t len) { OSSL_LIB_CTX *libctx = NULL; ECX_KEY *ecx = NULL; if (pkey->keymgmt != NULL) libctx = ossl_provider_libctx(EVP_KEYMGMT_get0_provider(pkey->keymgmt)); ecx = ossl_ecx_key_op(NULL, priv, len, pkey->ameth->pkey_id, KEY_OP_PRIVATE, libctx, NULL); if (ecx != NULL) { EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, ecx); return 1; } return 0; } static int ecx_set_pub_key(EVP_PKEY *pkey, const unsigned char *pub, size_t len) { OSSL_LIB_CTX *libctx = NULL; ECX_KEY *ecx = NULL; if (pkey->keymgmt != NULL) libctx = ossl_provider_libctx(EVP_KEYMGMT_get0_provider(pkey->keymgmt)); ecx = ossl_ecx_key_op(NULL, pub, len, pkey->ameth->pkey_id, KEY_OP_PUBLIC, libctx, NULL); if (ecx != NULL) { EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, ecx); return 1; } return 0; } static int ecx_get_priv_key(const EVP_PKEY *pkey, unsigned char *priv, size_t *len) { const ECX_KEY *key = pkey->pkey.ecx; if (priv == NULL) { *len = KEYLENID(pkey->ameth->pkey_id); return 1; } if (key == NULL || key->privkey == NULL || *len < (size_t)KEYLENID(pkey->ameth->pkey_id)) return 0; *len = KEYLENID(pkey->ameth->pkey_id); memcpy(priv, key->privkey, *len); return 1; } static int ecx_get_pub_key(const EVP_PKEY *pkey, unsigned char *pub, size_t *len) { const ECX_KEY *key = pkey->pkey.ecx; if (pub == NULL) { *len = KEYLENID(pkey->ameth->pkey_id); return 1; } if (key == NULL || *len < (size_t)KEYLENID(pkey->ameth->pkey_id)) return 0; *len = KEYLENID(pkey->ameth->pkey_id); memcpy(pub, key->pubkey, *len); return 1; } static size_t ecx_pkey_dirty_cnt(const EVP_PKEY *pkey) { /* * We provide no mechanism to "update" an ECX key once it has been set, * therefore we do not have to maintain a dirty count. */ return 1; } static int ecx_pkey_export_to(const EVP_PKEY *from, void *to_keydata, OSSL_FUNC_keymgmt_import_fn *importer, OSSL_LIB_CTX *libctx, const char *propq) { const ECX_KEY *key = from->pkey.ecx; OSSL_PARAM_BLD *tmpl = OSSL_PARAM_BLD_new(); OSSL_PARAM *params = NULL; int selection = 0; int rv = 0; if (tmpl == NULL) return 0; /* A key must at least have a public part */ if (!OSSL_PARAM_BLD_push_octet_string(tmpl, OSSL_PKEY_PARAM_PUB_KEY, key->pubkey, key->keylen)) goto err; selection |= OSSL_KEYMGMT_SELECT_PUBLIC_KEY; if (key->privkey != NULL) { if (!OSSL_PARAM_BLD_push_octet_string(tmpl, OSSL_PKEY_PARAM_PRIV_KEY, key->privkey, key->keylen)) goto err; selection |= OSSL_KEYMGMT_SELECT_PRIVATE_KEY; } params = OSSL_PARAM_BLD_to_param(tmpl); /* We export, the provider imports */ rv = importer(to_keydata, selection, params); err: OSSL_PARAM_BLD_free(tmpl); OSSL_PARAM_free(params); return rv; } static int ecx_generic_import_from(const OSSL_PARAM params[], void *vpctx, int keytype) { EVP_PKEY_CTX *pctx = vpctx; EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(pctx); ECX_KEY *ecx = ossl_ecx_key_new(pctx->libctx, KEYNID2TYPE(keytype), 0, pctx->propquery); if (ecx == NULL) { ERR_raise(ERR_LIB_DH, ERR_R_MALLOC_FAILURE); return 0; } if (!ossl_ecx_key_fromdata(ecx, params, 1) || !EVP_PKEY_assign(pkey, keytype, ecx)) { ossl_ecx_key_free(ecx); return 0; } return 1; } static int ecx_pkey_copy(EVP_PKEY *to, EVP_PKEY *from) { ECX_KEY *ecx = from->pkey.ecx, *dupkey = NULL; int ret; if (ecx != NULL) { dupkey = ossl_ecx_key_dup(ecx, OSSL_KEYMGMT_SELECT_ALL); if (dupkey == NULL) return 0; } ret = EVP_PKEY_assign(to, from->type, dupkey); if (!ret) ossl_ecx_key_free(dupkey); return ret; } static int x25519_import_from(const OSSL_PARAM params[], void *vpctx) { return ecx_generic_import_from(params, vpctx, EVP_PKEY_X25519); } const EVP_PKEY_ASN1_METHOD ossl_ecx25519_asn1_meth = { EVP_PKEY_X25519, EVP_PKEY_X25519, 0, "X25519", "OpenSSL X25519 algorithm", ecx_pub_decode, ecx_pub_encode, ecx_pub_cmp, ecx_pub_print, NULL, ecx_priv_encode, ecx_priv_print, ecx_size, ecx_bits, ecx_security_bits, 0, 0, 0, 0, ecx_cmp_parameters, 0, 0, ecx_free, ecx_ctrl, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ecx_set_priv_key, ecx_set_pub_key, ecx_get_priv_key, ecx_get_pub_key, ecx_pkey_dirty_cnt, ecx_pkey_export_to, x25519_import_from, ecx_pkey_copy, ecx_priv_decode_ex }; static int x448_import_from(const OSSL_PARAM params[], void *vpctx) { return ecx_generic_import_from(params, vpctx, EVP_PKEY_X448); } const EVP_PKEY_ASN1_METHOD ossl_ecx448_asn1_meth = { EVP_PKEY_X448, EVP_PKEY_X448, 0, "X448", "OpenSSL X448 algorithm", ecx_pub_decode, ecx_pub_encode, ecx_pub_cmp, ecx_pub_print, NULL, ecx_priv_encode, ecx_priv_print, ecx_size, ecx_bits, ecx_security_bits, 0, 0, 0, 0, ecx_cmp_parameters, 0, 0, ecx_free, ecx_ctrl, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ecx_set_priv_key, ecx_set_pub_key, ecx_get_priv_key, ecx_get_pub_key, ecx_pkey_dirty_cnt, ecx_pkey_export_to, x448_import_from, ecx_pkey_copy, ecx_priv_decode_ex }; static int ecd_size25519(const EVP_PKEY *pkey) { return ED25519_SIGSIZE; } static int ecd_size448(const EVP_PKEY *pkey) { return ED448_SIGSIZE; } static int ecd_item_verify(EVP_MD_CTX *ctx, const ASN1_ITEM *it, const void *asn, const X509_ALGOR *sigalg, const ASN1_BIT_STRING *str, EVP_PKEY *pkey) { const ASN1_OBJECT *obj; int ptype; int nid; /* Sanity check: make sure it is ED25519/ED448 with absent parameters */ X509_ALGOR_get0(&obj, &ptype, NULL, sigalg); nid = OBJ_obj2nid(obj); if ((nid != NID_ED25519 && nid != NID_ED448) || ptype != V_ASN1_UNDEF) { ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING); return 0; } if (!EVP_DigestVerifyInit(ctx, NULL, NULL, NULL, pkey)) return 0; return 2; } static int ecd_item_sign25519(EVP_MD_CTX *ctx, const ASN1_ITEM *it, const void *asn, X509_ALGOR *alg1, X509_ALGOR *alg2, ASN1_BIT_STRING *str) { /* Set algorithms identifiers */ X509_ALGOR_set0(alg1, OBJ_nid2obj(NID_ED25519), V_ASN1_UNDEF, NULL); if (alg2) X509_ALGOR_set0(alg2, OBJ_nid2obj(NID_ED25519), V_ASN1_UNDEF, NULL); /* Algorithm identifiers set: carry on as normal */ return 3; } static int ecd_sig_info_set25519(X509_SIG_INFO *siginf, const X509_ALGOR *alg, const ASN1_STRING *sig) { X509_SIG_INFO_set(siginf, NID_undef, NID_ED25519, X25519_SECURITY_BITS, X509_SIG_INFO_TLS); return 1; } static int ecd_item_sign448(EVP_MD_CTX *ctx, const ASN1_ITEM *it, const void *asn, X509_ALGOR *alg1, X509_ALGOR *alg2, ASN1_BIT_STRING *str) { /* Set algorithm identifier */ X509_ALGOR_set0(alg1, OBJ_nid2obj(NID_ED448), V_ASN1_UNDEF, NULL); if (alg2 != NULL) X509_ALGOR_set0(alg2, OBJ_nid2obj(NID_ED448), V_ASN1_UNDEF, NULL); /* Algorithm identifier set: carry on as normal */ return 3; } static int ecd_sig_info_set448(X509_SIG_INFO *siginf, const X509_ALGOR *alg, const ASN1_STRING *sig) { X509_SIG_INFO_set(siginf, NID_undef, NID_ED448, X448_SECURITY_BITS, X509_SIG_INFO_TLS); return 1; } static int ed25519_import_from(const OSSL_PARAM params[], void *vpctx) { return ecx_generic_import_from(params, vpctx, EVP_PKEY_ED25519); } const EVP_PKEY_ASN1_METHOD ossl_ed25519_asn1_meth = { EVP_PKEY_ED25519, EVP_PKEY_ED25519, 0, "ED25519", "OpenSSL ED25519 algorithm", ecx_pub_decode, ecx_pub_encode, ecx_pub_cmp, ecx_pub_print, NULL, ecx_priv_encode, ecx_priv_print, ecd_size25519, ecx_bits, ecx_security_bits, 0, 0, 0, 0, ecx_cmp_parameters, 0, 0, ecx_free, ecd_ctrl, NULL, NULL, ecd_item_verify, ecd_item_sign25519, ecd_sig_info_set25519, NULL, NULL, NULL, ecx_set_priv_key, ecx_set_pub_key, ecx_get_priv_key, ecx_get_pub_key, ecx_pkey_dirty_cnt, ecx_pkey_export_to, ed25519_import_from, ecx_pkey_copy, ecx_priv_decode_ex }; static int ed448_import_from(const OSSL_PARAM params[], void *vpctx) { return ecx_generic_import_from(params, vpctx, EVP_PKEY_ED448); } const EVP_PKEY_ASN1_METHOD ossl_ed448_asn1_meth = { EVP_PKEY_ED448, EVP_PKEY_ED448, 0, "ED448", "OpenSSL ED448 algorithm", ecx_pub_decode, ecx_pub_encode, ecx_pub_cmp, ecx_pub_print, NULL, ecx_priv_encode, ecx_priv_print, ecd_size448, ecx_bits, ecx_security_bits, 0, 0, 0, 0, ecx_cmp_parameters, 0, 0, ecx_free, ecd_ctrl, NULL, NULL, ecd_item_verify, ecd_item_sign448, ecd_sig_info_set448, NULL, NULL, NULL, ecx_set_priv_key, ecx_set_pub_key, ecx_get_priv_key, ecx_get_pub_key, ecx_pkey_dirty_cnt, ecx_pkey_export_to, ed448_import_from, ecx_pkey_copy, ecx_priv_decode_ex }; static int pkey_ecx_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { ECX_KEY *ecx = ossl_ecx_key_op(NULL, NULL, 0, ctx->pmeth->pkey_id, KEY_OP_PUBLIC, NULL, NULL); if (ecx != NULL) { EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, ecx); return 1; } return 0; } static int validate_ecx_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen, const unsigned char **privkey, const unsigned char **pubkey) { const ECX_KEY *ecxkey, *peerkey; if (ctx->pkey == NULL || ctx->peerkey == NULL) { ERR_raise(ERR_LIB_EC, EC_R_KEYS_NOT_SET); return 0; } ecxkey = evp_pkey_get_legacy(ctx->pkey); peerkey = evp_pkey_get_legacy(ctx->peerkey); if (ecxkey == NULL || ecxkey->privkey == NULL) { ERR_raise(ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY); return 0; } if (peerkey == NULL) { ERR_raise(ERR_LIB_EC, EC_R_INVALID_PEER_KEY); return 0; } *privkey = ecxkey->privkey; *pubkey = peerkey->pubkey; return 1; } static int pkey_ecx_derive25519(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) { const unsigned char *privkey, *pubkey; if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey) || (key != NULL && ossl_x25519(key, privkey, pubkey) == 0)) return 0; *keylen = X25519_KEYLEN; return 1; } static int pkey_ecx_derive448(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) { const unsigned char *privkey, *pubkey; if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey) || (key != NULL && ossl_x448(key, privkey, pubkey) == 0)) return 0; *keylen = X448_KEYLEN; return 1; } static int pkey_ecx_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { /* Only need to handle peer key for derivation */ if (type == EVP_PKEY_CTRL_PEER_KEY) return 1; return -2; } static const EVP_PKEY_METHOD ecx25519_pkey_meth = { EVP_PKEY_X25519, 0, 0, 0, 0, 0, 0, 0, pkey_ecx_keygen, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, pkey_ecx_derive25519, pkey_ecx_ctrl, 0 }; static const EVP_PKEY_METHOD ecx448_pkey_meth = { EVP_PKEY_X448, 0, 0, 0, 0, 0, 0, 0, pkey_ecx_keygen, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, pkey_ecx_derive448, pkey_ecx_ctrl, 0 }; static int pkey_ecd_digestsign25519(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen) { const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey); if (sig == NULL) { *siglen = ED25519_SIGSIZE; return 1; } if (*siglen < ED25519_SIGSIZE) { ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL); return 0; } if (ossl_ed25519_sign(sig, tbs, tbslen, edkey->pubkey, edkey->privkey, NULL, NULL) == 0) return 0; *siglen = ED25519_SIGSIZE; return 1; } static int pkey_ecd_digestsign448(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen) { const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey); if (sig == NULL) { *siglen = ED448_SIGSIZE; return 1; } if (*siglen < ED448_SIGSIZE) { ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL); return 0; } if (ossl_ed448_sign(edkey->libctx, sig, tbs, tbslen, edkey->pubkey, edkey->privkey, NULL, 0, edkey->propq) == 0) return 0; *siglen = ED448_SIGSIZE; return 1; } static int pkey_ecd_digestverify25519(EVP_MD_CTX *ctx, const unsigned char *sig, size_t siglen, const unsigned char *tbs, size_t tbslen) { const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey); if (siglen != ED25519_SIGSIZE) return 0; return ossl_ed25519_verify(tbs, tbslen, sig, edkey->pubkey, edkey->libctx, edkey->propq); } static int pkey_ecd_digestverify448(EVP_MD_CTX *ctx, const unsigned char *sig, size_t siglen, const unsigned char *tbs, size_t tbslen) { const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey); if (siglen != ED448_SIGSIZE) return 0; return ossl_ed448_verify(edkey->libctx, tbs, tbslen, sig, edkey->pubkey, NULL, 0, edkey->propq); } static int pkey_ecd_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { switch (type) { case EVP_PKEY_CTRL_MD: /* Only NULL allowed as digest */ if (p2 == NULL || (const EVP_MD *)p2 == EVP_md_null()) return 1; ERR_raise(ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE); return 0; case EVP_PKEY_CTRL_DIGESTINIT: return 1; } return -2; } static const EVP_PKEY_METHOD ed25519_pkey_meth = { EVP_PKEY_ED25519, EVP_PKEY_FLAG_SIGCTX_CUSTOM, 0, 0, 0, 0, 0, 0, pkey_ecx_keygen, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, pkey_ecd_ctrl, 0, pkey_ecd_digestsign25519, pkey_ecd_digestverify25519 }; static const EVP_PKEY_METHOD ed448_pkey_meth = { EVP_PKEY_ED448, EVP_PKEY_FLAG_SIGCTX_CUSTOM, 0, 0, 0, 0, 0, 0, pkey_ecx_keygen, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, pkey_ecd_ctrl, 0, pkey_ecd_digestsign448, pkey_ecd_digestverify448 }; #ifdef S390X_EC_ASM # include "s390x_arch.h" static int s390x_pkey_ecx_keygen25519(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { static const unsigned char generator[] = { 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_X25519, 1, ctx->propquery); unsigned char *privkey = NULL, *pubkey; if (key == NULL) { ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); goto err; } pubkey = key->pubkey; privkey = ossl_ecx_key_allocate_privkey(key); if (privkey == NULL) { ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); goto err; } if (RAND_priv_bytes_ex(ctx->libctx, privkey, X25519_KEYLEN, 0) <= 0) goto err; privkey[0] &= 248; privkey[31] &= 127; privkey[31] |= 64; if (s390x_x25519_mul(pubkey, generator, privkey) != 1) goto err; EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key); return 1; err: ossl_ecx_key_free(key); return 0; } static int s390x_pkey_ecx_keygen448(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { static const unsigned char generator[] = { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_X448, 1, ctx->propquery); unsigned char *privkey = NULL, *pubkey; if (key == NULL) { ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); goto err; } pubkey = key->pubkey; privkey = ossl_ecx_key_allocate_privkey(key); if (privkey == NULL) { ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); goto err; } if (RAND_priv_bytes_ex(ctx->libctx, privkey, X448_KEYLEN, 0) <= 0) goto err; privkey[0] &= 252; privkey[55] |= 128; if (s390x_x448_mul(pubkey, generator, privkey) != 1) goto err; EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key); return 1; err: ossl_ecx_key_free(key); return 0; } static int s390x_pkey_ecd_keygen25519(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { static const unsigned char generator_x[] = { 0x1a, 0xd5, 0x25, 0x8f, 0x60, 0x2d, 0x56, 0xc9, 0xb2, 0xa7, 0x25, 0x95, 0x60, 0xc7, 0x2c, 0x69, 0x5c, 0xdc, 0xd6, 0xfd, 0x31, 0xe2, 0xa4, 0xc0, 0xfe, 0x53, 0x6e, 0xcd, 0xd3, 0x36, 0x69, 0x21 }; static const unsigned char generator_y[] = { 0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, }; unsigned char x_dst[32], buff[SHA512_DIGEST_LENGTH]; ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_ED25519, 1, ctx->propquery); unsigned char *privkey = NULL, *pubkey; unsigned int sz; EVP_MD *md = NULL; int rv; if (key == NULL) { ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); goto err; } pubkey = key->pubkey; privkey = ossl_ecx_key_allocate_privkey(key); if (privkey == NULL) { ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); goto err; } if (RAND_priv_bytes_ex(ctx->libctx, privkey, ED25519_KEYLEN, 0) <= 0) goto err; md = EVP_MD_fetch(ctx->libctx, "SHA512", ctx->propquery); if (md == NULL) goto err; rv = EVP_Digest(privkey, 32, buff, &sz, md, NULL); EVP_MD_free(md); if (!rv) goto err; buff[0] &= 248; buff[31] &= 63; buff[31] |= 64; if (s390x_ed25519_mul(x_dst, pubkey, generator_x, generator_y, buff) != 1) goto err; pubkey[31] |= ((x_dst[0] & 0x01) << 7); EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key); return 1; err: ossl_ecx_key_free(key); return 0; } static int s390x_pkey_ecd_keygen448(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { static const unsigned char generator_x[] = { 0x5e, 0xc0, 0x0c, 0xc7, 0x2b, 0xa8, 0x26, 0x26, 0x8e, 0x93, 0x00, 0x8b, 0xe1, 0x80, 0x3b, 0x43, 0x11, 0x65, 0xb6, 0x2a, 0xf7, 0x1a, 0xae, 0x12, 0x64, 0xa4, 0xd3, 0xa3, 0x24, 0xe3, 0x6d, 0xea, 0x67, 0x17, 0x0f, 0x47, 0x70, 0x65, 0x14, 0x9e, 0xda, 0x36, 0xbf, 0x22, 0xa6, 0x15, 0x1d, 0x22, 0xed, 0x0d, 0xed, 0x6b, 0xc6, 0x70, 0x19, 0x4f, 0x00 }; static const unsigned char generator_y[] = { 0x14, 0xfa, 0x30, 0xf2, 0x5b, 0x79, 0x08, 0x98, 0xad, 0xc8, 0xd7, 0x4e, 0x2c, 0x13, 0xbd, 0xfd, 0xc4, 0x39, 0x7c, 0xe6, 0x1c, 0xff, 0xd3, 0x3a, 0xd7, 0xc2, 0xa0, 0x05, 0x1e, 0x9c, 0x78, 0x87, 0x40, 0x98, 0xa3, 0x6c, 0x73, 0x73, 0xea, 0x4b, 0x62, 0xc7, 0xc9, 0x56, 0x37, 0x20, 0x76, 0x88, 0x24, 0xbc, 0xb6, 0x6e, 0x71, 0x46, 0x3f, 0x69, 0x00 }; unsigned char x_dst[57], buff[114]; ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_ED448, 1, ctx->propquery); unsigned char *privkey = NULL, *pubkey; EVP_MD_CTX *hashctx = NULL; EVP_MD *md = NULL; int rv; if (key == NULL) { ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); goto err; } pubkey = key->pubkey; privkey = ossl_ecx_key_allocate_privkey(key); if (privkey == NULL) { ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE); goto err; } if (RAND_priv_bytes_ex(ctx->libctx, privkey, ED448_KEYLEN, 0) <= 0) goto err; hashctx = EVP_MD_CTX_new(); if (hashctx == NULL) goto err; md = EVP_MD_fetch(ctx->libctx, "SHAKE256", ctx->propquery); if (md == NULL) goto err; rv = EVP_DigestInit_ex(hashctx, md, NULL); EVP_MD_free(md); if (rv != 1) goto err; if (EVP_DigestUpdate(hashctx, privkey, 57) != 1) goto err; if (EVP_DigestFinalXOF(hashctx, buff, sizeof(buff)) != 1) goto err; buff[0] &= -4; buff[55] |= 0x80; buff[56] = 0; if (s390x_ed448_mul(x_dst, pubkey, generator_x, generator_y, buff) != 1) goto err; pubkey[56] |= ((x_dst[0] & 0x01) << 7); EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key); EVP_MD_CTX_free(hashctx); return 1; err: ossl_ecx_key_free(key); EVP_MD_CTX_free(hashctx); return 0; } static int s390x_pkey_ecx_derive25519(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) { const unsigned char *privkey, *pubkey; if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey)) return 0; if (key != NULL) return s390x_x25519_mul(key, pubkey, privkey); *keylen = X25519_KEYLEN; return 1; } static int s390x_pkey_ecx_derive448(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) { const unsigned char *privkey, *pubkey; if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey)) return 0; if (key != NULL) return s390x_x448_mul(key, pubkey, privkey); *keylen = X448_KEYLEN; return 1; } static int s390x_pkey_ecd_digestsign25519(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen) { union { struct { unsigned char sig[64]; unsigned char priv[32]; } ed25519; unsigned long long buff[512]; } param; const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey); int rc; if (sig == NULL) { *siglen = ED25519_SIGSIZE; return 1; } if (*siglen < ED25519_SIGSIZE) { ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL); return 0; } memset(&param, 0, sizeof(param)); memcpy(param.ed25519.priv, edkey->privkey, sizeof(param.ed25519.priv)); rc = s390x_kdsa(S390X_EDDSA_SIGN_ED25519, &param.ed25519, tbs, tbslen); OPENSSL_cleanse(param.ed25519.priv, sizeof(param.ed25519.priv)); if (rc != 0) return 0; s390x_flip_endian32(sig, param.ed25519.sig); s390x_flip_endian32(sig + 32, param.ed25519.sig + 32); *siglen = ED25519_SIGSIZE; return 1; } static int s390x_pkey_ecd_digestsign448(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen) { union { struct { unsigned char sig[128]; unsigned char priv[64]; } ed448; unsigned long long buff[512]; } param; const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey); int rc; if (sig == NULL) { *siglen = ED448_SIGSIZE; return 1; } if (*siglen < ED448_SIGSIZE) { ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL); return 0; } memset(&param, 0, sizeof(param)); memcpy(param.ed448.priv + 64 - 57, edkey->privkey, 57); rc = s390x_kdsa(S390X_EDDSA_SIGN_ED448, &param.ed448, tbs, tbslen); OPENSSL_cleanse(param.ed448.priv, sizeof(param.ed448.priv)); if (rc != 0) return 0; s390x_flip_endian64(param.ed448.sig, param.ed448.sig); s390x_flip_endian64(param.ed448.sig + 64, param.ed448.sig + 64); memcpy(sig, param.ed448.sig, 57); memcpy(sig + 57, param.ed448.sig + 64, 57); *siglen = ED448_SIGSIZE; return 1; } static int s390x_pkey_ecd_digestverify25519(EVP_MD_CTX *ctx, const unsigned char *sig, size_t siglen, const unsigned char *tbs, size_t tbslen) { union { struct { unsigned char sig[64]; unsigned char pub[32]; } ed25519; unsigned long long buff[512]; } param; const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey); if (siglen != ED25519_SIGSIZE) return 0; memset(&param, 0, sizeof(param)); s390x_flip_endian32(param.ed25519.sig, sig); s390x_flip_endian32(param.ed25519.sig + 32, sig + 32); s390x_flip_endian32(param.ed25519.pub, edkey->pubkey); return s390x_kdsa(S390X_EDDSA_VERIFY_ED25519, &param.ed25519, tbs, tbslen) == 0 ? 1 : 0; } static int s390x_pkey_ecd_digestverify448(EVP_MD_CTX *ctx, const unsigned char *sig, size_t siglen, const unsigned char *tbs, size_t tbslen) { union { struct { unsigned char sig[128]; unsigned char pub[64]; } ed448; unsigned long long buff[512]; } param; const ECX_KEY *edkey = evp_pkey_get_legacy(EVP_MD_CTX_get_pkey_ctx(ctx)->pkey); if (siglen != ED448_SIGSIZE) return 0; memset(&param, 0, sizeof(param)); memcpy(param.ed448.sig, sig, 57); s390x_flip_endian64(param.ed448.sig, param.ed448.sig); memcpy(param.ed448.sig + 64, sig + 57, 57); s390x_flip_endian64(param.ed448.sig + 64, param.ed448.sig + 64); memcpy(param.ed448.pub, edkey->pubkey, 57); s390x_flip_endian64(param.ed448.pub, param.ed448.pub); return s390x_kdsa(S390X_EDDSA_VERIFY_ED448, &param.ed448, tbs, tbslen) == 0 ? 1 : 0; } static const EVP_PKEY_METHOD ecx25519_s390x_pkey_meth = { EVP_PKEY_X25519, 0, 0, 0, 0, 0, 0, 0, s390x_pkey_ecx_keygen25519, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, s390x_pkey_ecx_derive25519, pkey_ecx_ctrl, 0 }; static const EVP_PKEY_METHOD ecx448_s390x_pkey_meth = { EVP_PKEY_X448, 0, 0, 0, 0, 0, 0, 0, s390x_pkey_ecx_keygen448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, s390x_pkey_ecx_derive448, pkey_ecx_ctrl, 0 }; static const EVP_PKEY_METHOD ed25519_s390x_pkey_meth = { EVP_PKEY_ED25519, EVP_PKEY_FLAG_SIGCTX_CUSTOM, 0, 0, 0, 0, 0, 0, s390x_pkey_ecd_keygen25519, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, pkey_ecd_ctrl, 0, s390x_pkey_ecd_digestsign25519, s390x_pkey_ecd_digestverify25519 }; static const EVP_PKEY_METHOD ed448_s390x_pkey_meth = { EVP_PKEY_ED448, EVP_PKEY_FLAG_SIGCTX_CUSTOM, 0, 0, 0, 0, 0, 0, s390x_pkey_ecd_keygen448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, pkey_ecd_ctrl, 0, s390x_pkey_ecd_digestsign448, s390x_pkey_ecd_digestverify448 }; #endif const EVP_PKEY_METHOD *ossl_ecx25519_pkey_method(void) { #ifdef S390X_EC_ASM if (OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X25519)) return &ecx25519_s390x_pkey_meth; #endif return &ecx25519_pkey_meth; } const EVP_PKEY_METHOD *ossl_ecx448_pkey_method(void) { #ifdef S390X_EC_ASM if (OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X448)) return &ecx448_s390x_pkey_meth; #endif return &ecx448_pkey_meth; } const EVP_PKEY_METHOD *ossl_ed25519_pkey_method(void) { #ifdef S390X_EC_ASM if (OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_ED25519) && OPENSSL_s390xcap_P.kdsa[0] & S390X_CAPBIT(S390X_EDDSA_SIGN_ED25519) && OPENSSL_s390xcap_P.kdsa[0] & S390X_CAPBIT(S390X_EDDSA_VERIFY_ED25519)) return &ed25519_s390x_pkey_meth; #endif return &ed25519_pkey_meth; } const EVP_PKEY_METHOD *ossl_ed448_pkey_method(void) { #ifdef S390X_EC_ASM if (OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_ED448) && OPENSSL_s390xcap_P.kdsa[0] & S390X_CAPBIT(S390X_EDDSA_SIGN_ED448) && OPENSSL_s390xcap_P.kdsa[0] & S390X_CAPBIT(S390X_EDDSA_VERIFY_ED448)) return &ed448_s390x_pkey_meth; #endif return &ed448_pkey_meth; }
jens-maus/amissl
openssl/crypto/ec/ecx_meth.c
C
bsd-3-clause
37,266
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/browser/frame_host/render_widget_host_view_child_frame.h" #include "content/browser/frame_host/cross_process_frame_connector.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/common/gpu/gpu_messages.h" #include "content/common/view_messages.h" #include "content/public/browser/render_process_host.h" namespace content { RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( RenderWidgetHost* widget_host) : host_(RenderWidgetHostImpl::From(widget_host)), frame_connector_(NULL) { host_->SetView(this); } RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() { } void RenderWidgetHostViewChildFrame::InitAsChild( gfx::NativeView parent_view) { NOTREACHED(); } RenderWidgetHost* RenderWidgetHostViewChildFrame::GetRenderWidgetHost() const { return host_; } void RenderWidgetHostViewChildFrame::SetSize(const gfx::Size& size) { host_->WasResized(); } void RenderWidgetHostViewChildFrame::SetBounds(const gfx::Rect& rect) { SetSize(rect.size()); } void RenderWidgetHostViewChildFrame::Focus() { } bool RenderWidgetHostViewChildFrame::HasFocus() const { return false; } bool RenderWidgetHostViewChildFrame::IsSurfaceAvailableForCopy() const { NOTIMPLEMENTED(); return false; } void RenderWidgetHostViewChildFrame::Show() { WasShown(); } void RenderWidgetHostViewChildFrame::Hide() { WasHidden(); } bool RenderWidgetHostViewChildFrame::IsShowing() { return !host_->is_hidden(); } gfx::Rect RenderWidgetHostViewChildFrame::GetViewBounds() const { gfx::Rect rect; if (frame_connector_) rect = frame_connector_->ChildFrameRect(); return rect; } gfx::NativeView RenderWidgetHostViewChildFrame::GetNativeView() const { NOTREACHED(); return NULL; } gfx::NativeViewId RenderWidgetHostViewChildFrame::GetNativeViewId() const { NOTREACHED(); return 0; } gfx::NativeViewAccessible RenderWidgetHostViewChildFrame::GetNativeViewAccessible() { NOTREACHED(); return NULL; } void RenderWidgetHostViewChildFrame::SetBackgroundOpaque(bool opaque) { } gfx::Size RenderWidgetHostViewChildFrame::GetPhysicalBackingSize() const { gfx::Size size; if (frame_connector_) size = frame_connector_->ChildFrameRect().size(); return size; } void RenderWidgetHostViewChildFrame::InitAsPopup( RenderWidgetHostView* parent_host_view, const gfx::Rect& pos) { NOTREACHED(); } void RenderWidgetHostViewChildFrame::InitAsFullscreen( RenderWidgetHostView* reference_host_view) { NOTREACHED(); } void RenderWidgetHostViewChildFrame::ImeCancelComposition() { NOTREACHED(); } #if defined(OS_MACOSX) || defined(USE_AURA) void RenderWidgetHostViewChildFrame::ImeCompositionRangeChanged( const gfx::Range& range, const std::vector<gfx::Rect>& character_bounds) { NOTREACHED(); } #endif void RenderWidgetHostViewChildFrame::WasShown() { if (!host_->is_hidden()) return; host_->WasShown(); } void RenderWidgetHostViewChildFrame::WasHidden() { if (host_->is_hidden()) return; host_->WasHidden(); } void RenderWidgetHostViewChildFrame::MovePluginWindows( const std::vector<WebPluginGeometry>& moves) { } void RenderWidgetHostViewChildFrame::Blur() { } void RenderWidgetHostViewChildFrame::UpdateCursor(const WebCursor& cursor) { } void RenderWidgetHostViewChildFrame::SetIsLoading(bool is_loading) { NOTREACHED(); } void RenderWidgetHostViewChildFrame::TextInputStateChanged( const ViewHostMsg_TextInputState_Params& params) { } void RenderWidgetHostViewChildFrame::RenderProcessGone( base::TerminationStatus status, int error_code) { if (frame_connector_) frame_connector_->RenderProcessGone(); Destroy(); } void RenderWidgetHostViewChildFrame::Destroy() { if (frame_connector_) { frame_connector_->set_view(NULL); frame_connector_ = NULL; } host_->SetView(NULL); host_ = NULL; base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } void RenderWidgetHostViewChildFrame::SetTooltipText( const base::string16& tooltip_text) { } void RenderWidgetHostViewChildFrame::SelectionChanged( const base::string16& text, size_t offset, const gfx::Range& range) { } void RenderWidgetHostViewChildFrame::SelectionBoundsChanged( const ViewHostMsg_SelectionBounds_Params& params) { } #if defined(OS_ANDROID) void RenderWidgetHostViewChildFrame::ShowDisambiguationPopup( const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) { } void RenderWidgetHostViewChildFrame::LockCompositingSurface() { } void RenderWidgetHostViewChildFrame::UnlockCompositingSurface() { } #endif void RenderWidgetHostViewChildFrame::ScrollOffsetChanged() { } void RenderWidgetHostViewChildFrame::AcceleratedSurfaceInitialized(int host_id, int route_id) { } void RenderWidgetHostViewChildFrame::AcceleratedSurfaceBuffersSwapped( const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, int gpu_host_id) { if (frame_connector_) frame_connector_->ChildFrameBuffersSwapped(params, gpu_host_id); } void RenderWidgetHostViewChildFrame::AcceleratedSurfacePostSubBuffer( const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, int gpu_host_id) { } void RenderWidgetHostViewChildFrame::OnSwapCompositorFrame( uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) { if (frame_connector_) { frame_connector_->ChildFrameCompositorFrameSwapped( output_surface_id, host_->GetProcess()->GetID(), host_->GetRoutingID(), frame.Pass()); } } void RenderWidgetHostViewChildFrame::GetScreenInfo( blink::WebScreenInfo* results) { } gfx::Rect RenderWidgetHostViewChildFrame::GetBoundsInRootWindow() { // We do not have any root window specific parts in this view. return GetViewBounds(); } #if defined(USE_AURA) void RenderWidgetHostViewChildFrame::ProcessAckedTouchEvent( const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { } #endif // defined(USE_AURA) bool RenderWidgetHostViewChildFrame::LockMouse() { return false; } void RenderWidgetHostViewChildFrame::UnlockMouse() { } #if defined(OS_MACOSX) void RenderWidgetHostViewChildFrame::SetActive(bool active) { } void RenderWidgetHostViewChildFrame::SetTakesFocusOnlyOnMouseDown(bool flag) { } void RenderWidgetHostViewChildFrame::SetWindowVisibility(bool visible) { } void RenderWidgetHostViewChildFrame::WindowFrameChanged() { } void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() { } bool RenderWidgetHostViewChildFrame::SupportsSpeech() const { return false; } void RenderWidgetHostViewChildFrame::SpeakSelection() { } bool RenderWidgetHostViewChildFrame::IsSpeaking() const { return false; } void RenderWidgetHostViewChildFrame::StopSpeaking() { } bool RenderWidgetHostViewChildFrame::PostProcessEventForPluginIme( const NativeWebKeyboardEvent& event) { return false; } #endif // defined(OS_MACOSX) void RenderWidgetHostViewChildFrame::CopyFromCompositingSurface( const gfx::Rect& src_subrect, const gfx::Size& /* dst_size */, const base::Callback<void(bool, const SkBitmap&)>& callback, const SkColorType color_type) { callback.Run(false, SkBitmap()); } void RenderWidgetHostViewChildFrame::CopyFromCompositingSurfaceToVideoFrame( const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback) { NOTIMPLEMENTED(); callback.Run(false); } bool RenderWidgetHostViewChildFrame::CanCopyToVideoFrame() const { return false; } void RenderWidgetHostViewChildFrame::AcceleratedSurfaceSuspend() { NOTREACHED(); } void RenderWidgetHostViewChildFrame::AcceleratedSurfaceRelease() { } bool RenderWidgetHostViewChildFrame::HasAcceleratedSurface( const gfx::Size& desired_size) { return false; } gfx::GLSurfaceHandle RenderWidgetHostViewChildFrame::GetCompositingSurface() { return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); } #if defined(OS_WIN) void RenderWidgetHostViewChildFrame::SetParentNativeViewAccessible( gfx::NativeViewAccessible accessible_parent) { } gfx::NativeViewId RenderWidgetHostViewChildFrame::GetParentForWindowlessPlugin() const { return NULL; } #endif // defined(OS_WIN) SkColorType RenderWidgetHostViewChildFrame::PreferredReadbackFormat() { return kN32_SkColorType; } } // namespace content
chromium2014/src
content/browser/frame_host/render_widget_host_view_child_frame.cc
C++
bsd-3-clause
8,640
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: * * Test memerror * * Copyright (C) 2011 Data Differential, http://datadifferential.com/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * * The names of its contributors may not be used to endorse or * promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* Test that we are cycling the servers we are creating during testing. */ #include <config.h> #include <libtest/test.hpp> #include <libmemcached/memcached.h> using namespace libtest; #ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif static std::string executable("./clients/memerror"); static test_return_t help_TEST(void *) { const char *args[]= { "--help", 0 }; test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); return TEST_SUCCESS; } static test_return_t version_TEST(void *) { const char *args[]= { "--version", 0 }; test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); return TEST_SUCCESS; } static test_return_t error_test(void *) { const char *args[]= { "memcached_success", 0 }; test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); return TEST_SUCCESS; } static test_return_t SUCCESS_TEST(void *) { const char *args[]= { "0", 0 }; test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); return TEST_SUCCESS; } static test_return_t bad_input_test(void *) { const char *args[]= { "bad input", 0 }; test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); return TEST_SUCCESS; } test_st memerror_tests[] ={ {"--help", 0, help_TEST}, {"--version", 0, version_TEST}, {"<error>", 0, error_test}, {"0", 0, SUCCESS_TEST}, {"<bad input>", 0, bad_input_test}, {0, 0, 0} }; collection_st collection[] ={ {"memerror", 0, 0, memerror_tests }, {0, 0, 0, 0} }; static void *world_create(server_startup_st&, test_return_t& error) { if (libtest::has_memcached() == false) { error= TEST_SKIPPED; return NULL; } return NULL; } void get_world(Framework *world) { world->collections(collection); world->create(world_create); }
Metaswitch/libmemcached-upstream
tests/memerror.cc
C++
bsd-3-clause
3,458
<?php namespace MonkeyData\EshopXmlFeedGenerator\XmlGenerator\Entities; /** * Class CustomerCityEntity * @package MonkeyData\EshopXmlFeedGenerator\XmlGenerator\Entities * @author MD Developers */ class CustomerCityEntity extends Entity { /** * @param mixed $value */ public function __construct($value = null) { parent::__construct("CITY", self::DT_string, $value); } protected function setting() { $this->setRequired(self::RequeredNo); $this->setMaxLength(100); } }
MonkeyData/php-online-store-xml-feed-generator
src/XmlGenerator/Entities/CustomerCityEntity.php
PHP
bsd-3-clause
558
<?php namespace Faker\Provider\hy_AM; class Color extends \Faker\Provider\Color { protected static $safeColorNames = array( 'սև', 'դեղին', 'սպիտակ', 'մոխրագույն', 'կարմիր', 'կապույտ', 'երկնագույն', 'կանաչ', 'կապտականաչ', 'մանուշակագույն', 'շագանակագույն', ); }
achluky/Quotation
vendor/fzaninotto/faker/src/Faker/Provider/hy_AM/Color.php
PHP
bsd-3-clause
395
#!/bin/bash GKE_CLUSTER_NAME=${GKE_CLUSTER_NAME:-'example'} SHARDS=${SHARDS:-'-80,80-'} TABLETS_PER_SHARD=${TABLETS_PER_SHARD:-3} CELLS=${CELLS:-'test'} ./vtgate-down.sh SHARDS=$SHARDS CELLS=$CELLS TABLETS_PER_SHARD=$TABLETS_PER_SHARD ./vttablet-down.sh ./vtctld-down.sh ./etcd-down.sh gcloud compute firewall-rules delete ${GKE_CLUSTER_NAME}-vtctld ${GKE_CLUSTER_NAME}-vtgate -q
tjyang/vitess
examples/kubernetes/vitess-down.sh
Shell
bsd-3-clause
383
require 'spec_helper' class FakesController < Spree::Api::BaseController end describe Spree::Api::BaseController, :type => :controller do render_views controller(Spree::Api::BaseController) do def index render :text => { "products" => [] }.to_json end end before do @routes = ActionDispatch::Routing::RouteSet.new.tap do |r| r.draw { get 'index', to: 'spree/api/base#index' } end end context "when validating based on an order token" do let!(:order) { create :order } context "with a correct order token" do it "succeeds" do api_get :index, order_token: order.guest_token, order_id: order.number expect(response.status).to eq(200) end it "succeeds with an order_number parameter" do api_get :index, order_token: order.guest_token, order_number: order.number expect(response.status).to eq(200) end end context "with an incorrect order token" do it "returns unauthorized" do api_get :index, order_token: "NOT_A_TOKEN", order_id: order.number expect(response.status).to eq(401) end end end context "cannot make a request to the API" do it "without an API key" do api_get :index expect(json_response).to eq({ "error" => "You must specify an API key." }) expect(response.status).to eq(401) end it "with an invalid API key" do request.headers["X-Spree-Token"] = "fake_key" get :index, {} expect(json_response).to eq({ "error" => "Invalid API key (fake_key) specified." }) expect(response.status).to eq(401) end it "using an invalid token param" do get :index, :token => "fake_key" expect(json_response).to eq({ "error" => "Invalid API key (fake_key) specified." }) end end it 'chatches StandardError' do expect(subject).to receive(:authenticate_user).and_return(true) expect(subject).to receive(:load_user_roles).and_return(true) expect(subject).to receive(:index).and_raise("no joy") get :index, :token => "fake_key" expect(json_response).to eq({ "exception" => "no joy" }) end it 'raises Exception' do expect(subject).to receive(:authenticate_user).and_return(true) expect(subject).to receive(:load_user_roles).and_return(true) expect(subject).to receive(:index).and_raise(Exception.new("no joy")) expect { get :index, :token => "fake_key" }.to raise_error(Exception, "no joy") end it "maps semantic keys to nested_attributes keys" do klass = double(:nested_attributes_options => { :line_items => {}, :bill_address => {} }) attributes = { 'line_items' => { :id => 1 }, 'bill_address' => { :id => 2 }, 'name' => 'test order' } mapped = subject.map_nested_attributes_keys(klass, attributes) expect(mapped.has_key?('line_items_attributes')).to be true expect(mapped.has_key?('name')).to be true end it "lets a subclass override the product associations that are eager-loaded" do expect(controller.respond_to?(:product_includes, true)).to be end describe '#error_during_processing' do controller(FakesController) do # GET /foo # Simulates a failed API call. def foo raise StandardError end end # What would be placed in config/initializers/spree.rb Spree::Api::BaseController.error_notifier = Proc.new do |e, controller| MockHoneybadger.notify_or_ignore(e, rack_env: controller.request.env) end ## # Fake HB alert class class MockHoneybadger # https://github.com/honeybadger-io/honeybadger-ruby/blob/master/lib/honeybadger.rb#L136 def self.notify_or_ignore(exception, opts = {}) end end before do user = double(email: "spree@example.com") allow(user).to receive_message_chain :spree_roles, pluck: [] allow(Spree.user_class).to receive_messages find_by: user @routes = ActionDispatch::Routing::RouteSet.new.tap do |r| r.draw { get 'foo' => 'fakes#foo' } end end it 'should notify notify_error_during_processing' do expect(MockHoneybadger).to receive(:notify_or_ignore).once.with(kind_of(Exception), rack_env: kind_of(Hash)) api_get :foo, token: 123 expect(response.status).to eq(422) end end context 'lock_order' do let!(:order) { create :order } controller(Spree::Api::BaseController) do around_filter :lock_order def index render :text => { "products" => [] }.to_json end end context 'without an existing lock' do it 'succeeds' do api_get :index, order_token: order.guest_token, order_id: order.number response.status.should == 200 end end context 'with an existing lock' do around do |example| Spree::OrderMutex.with_lock!(order) { example.run } end it 'returns a 409 conflict' do api_get :index, order_token: order.guest_token, order_id: order.number response.status.should == 409 end end end end
Senjai/solidus
api/spec/controllers/spree/api/base_controller_spec.rb
Ruby
bsd-3-clause
5,123
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=974; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0"/> <title>BLOBkit Samples</title> <link rel='stylesheet' type='text/css' href='../tvb.css' /> <script type="text/javascript" src='../tvb-debug.js'></script> <!-- don't do this test with the -min version, it doesn't have the profiler functions activated --> </head> <body> <script type="text/javascript"> TVB.widget.titleBar.setTitle("Profiler - Performance tests for PushVOD API"); TVB.widget.titleBar.setIcon("http://www.blobforge.com/static/lib/resources/ibk.png"); TVB.widget.titleBar.render(); </script> <ul> <li>Number of repetitions: <span id='iter'>x</span></li> <li>Minimum time: <span id='min'>x</span></li> <li>Average time: <span id='avg'>x</span></li> <li>Maximum time: <span id='max'>x</span></li> </ul> <script type="text/javascript" src="profiler5.js"></script> </body> </html>
BLOBbox/BLOBkit
samples/profiler/profiler5.html
HTML
bsd-3-clause
1,112
// Copyright (C) 2014, Microsoft Corporation. All rights reserved. // This code is governed by the BSD License found in the LICENSE file. module.exports = JSShellRunner; var fs = require('fs'); var cp = require('child_process'); var ConsoleRunner = require('./console'); var counter = 0; function JSShellRunner(args) { args.consolePrintCommand = args.consolePrintCommand || "print"; ConsoleRunner.apply(this, arguments); } JSShellRunner.prototype = Object.create(ConsoleRunner.prototype); JSShellRunner.prototype._createEnv = 'newGlobal()'; JSShellRunner.prototype._runBatched = 'env.evaluate(test);'
muratsu/test262-harness
lib/runners/jsshell.js
JavaScript
bsd-3-clause
614
from os.path import dirname import sys from django.test import TestCase from django.conf import settings from django.test.utils import override_settings import oscar from oscar.core.loading import ( get_model, AppNotFoundError, get_classes, get_class, ClassNotFoundError) from oscar.test.factories import create_product, WishListFactory, UserFactory from tests import temporary_python_path class TestClassLoading(TestCase): """ Oscar's class loading utilities """ def test_load_oscar_classes_correctly(self): Product, Category = get_classes('catalogue.models', ('Product', 'Category')) self.assertEqual('oscar.apps.catalogue.models', Product.__module__) self.assertEqual('oscar.apps.catalogue.models', Category.__module__) def test_load_oscar_class_correctly(self): Product = get_class('catalogue.models', 'Product') self.assertEqual('oscar.apps.catalogue.models', Product.__module__) def test_load_oscar_class_from_dashboard_subapp(self): ReportForm = get_class('dashboard.reports.forms', 'ReportForm') self.assertEqual('oscar.apps.dashboard.reports.forms', ReportForm.__module__) def test_raise_exception_when_bad_appname_used(self): with self.assertRaises(AppNotFoundError): get_classes('fridge.models', ('Product', 'Category')) def test_raise_exception_when_bad_classname_used(self): with self.assertRaises(ClassNotFoundError): get_class('catalogue.models', 'Monkey') def test_raise_importerror_if_app_raises_importerror(self): """ This tests that Oscar doesn't fall back to using the Oscar catalogue app if the overriding app throws an ImportError. """ apps = list(settings.INSTALLED_APPS) apps[apps.index('oscar.apps.catalogue')] = 'tests._site.import_error_app.catalogue' with override_settings(INSTALLED_APPS=apps): with self.assertRaises(ImportError): get_class('catalogue.app', 'CatalogueApplication') class ClassLoadingWithLocalOverrideTests(TestCase): def setUp(self): self.installed_apps = list(settings.INSTALLED_APPS) self.installed_apps[self.installed_apps.index('oscar.apps.shipping')] = 'tests._site.shipping' def test_loading_class_defined_in_local_module(self): with override_settings(INSTALLED_APPS=self.installed_apps): (Free,) = get_classes('shipping.methods', ('Free',)) self.assertEqual('tests._site.shipping.methods', Free.__module__) def test_loading_class_which_is_not_defined_in_local_module(self): with override_settings(INSTALLED_APPS=self.installed_apps): (FixedPrice,) = get_classes('shipping.methods', ('FixedPrice',)) self.assertEqual('oscar.apps.shipping.methods', FixedPrice.__module__) def test_loading_class_from_module_not_defined_in_local_app(self): with override_settings(INSTALLED_APPS=self.installed_apps): (Repository,) = get_classes('shipping.repository', ('Repository',)) self.assertEqual('oscar.apps.shipping.repository', Repository.__module__) def test_loading_classes_defined_in_both_local_and_oscar_modules(self): with override_settings(INSTALLED_APPS=self.installed_apps): (Free, FixedPrice) = get_classes('shipping.methods', ('Free', 'FixedPrice')) self.assertEqual('tests._site.shipping.methods', Free.__module__) self.assertEqual('oscar.apps.shipping.methods', FixedPrice.__module__) def test_loading_classes_with_root_app(self): import tests._site.shipping path = dirname(dirname(tests._site.shipping.__file__)) with temporary_python_path([path]): self.installed_apps[ self.installed_apps.index('tests._site.shipping')] = 'shipping' with override_settings(INSTALLED_APPS=self.installed_apps): (Free,) = get_classes('shipping.methods', ('Free',)) self.assertEqual('shipping.methods', Free.__module__) def test_overriding_view_is_possible_without_overriding_app(self): from oscar.apps.customer.app import application, CustomerApplication # If test fails, it's helpful to know if it's caused by order of # execution self.assertEqual(CustomerApplication().summary_view.__module__, 'tests._site.apps.customer.views') self.assertEqual(application.summary_view.__module__, 'tests._site.apps.customer.views') class ClassLoadingWithLocalOverrideWithMultipleSegmentsTests(TestCase): def setUp(self): self.installed_apps = list(settings.INSTALLED_APPS) self.installed_apps[self.installed_apps.index('oscar.apps.shipping')] = 'tests._site.apps.shipping' def test_loading_class_defined_in_local_module(self): with override_settings(INSTALLED_APPS=self.installed_apps): (Free,) = get_classes('shipping.methods', ('Free',)) self.assertEqual('tests._site.apps.shipping.methods', Free.__module__) class TestGetCoreAppsFunction(TestCase): """ oscar.get_core_apps function """ def test_returns_core_apps_when_no_overrides_specified(self): apps = oscar.get_core_apps() self.assertEqual(oscar.OSCAR_CORE_APPS, apps) def test_uses_non_dashboard_override_when_specified(self): apps = oscar.get_core_apps(overrides=['apps.shipping']) self.assertTrue('apps.shipping' in apps) self.assertTrue('oscar.apps.shipping' not in apps) def test_uses_dashboard_override_when_specified(self): apps = oscar.get_core_apps(overrides=['apps.dashboard.catalogue']) self.assertTrue('apps.dashboard.catalogue' in apps) self.assertTrue('oscar.apps.dashboard.catalogue' not in apps) self.assertTrue('oscar.apps.catalogue' in apps) class TestOverridingCoreApps(TestCase): def test_means_the_overriding_model_is_registered_first(self): klass = get_model('partner', 'StockRecord') self.assertEqual( 'tests._site.apps.partner.models', klass.__module__) class TestAppLabelsForModels(TestCase): def test_all_oscar_models_have_app_labels(self): from django.apps import apps models = apps.get_models() missing = [] for model in models: # Ignore non-Oscar models if 'oscar' not in repr(model): continue # Don't know how to get the actual model's Meta class. But if # the parent doesn't have a Meta class, it's doesn't have an # base in Oscar anyway and is not intended to be overridden abstract_model = model.__base__ meta_class = getattr(abstract_model, 'Meta', None) if meta_class is None: continue if not hasattr(meta_class, 'app_label'): missing.append(model) if missing: self.fail("Those models don't have an app_label set: %s" % missing) class TestDynamicLoadingOn3rdPartyApps(TestCase): core_app_prefix = 'thirdparty_package.apps' def setUp(self): self.installed_apps = list(settings.INSTALLED_APPS) sys.path.append('./tests/_site/') def tearDown(self): sys.path.remove('./tests/_site/') def test_load_core_3rd_party_class_correctly(self): self.installed_apps.append('thirdparty_package.apps.myapp') with override_settings(INSTALLED_APPS=self.installed_apps): Cow, Goat = get_classes('myapp.models', ('Cow', 'Goat'), self.core_app_prefix) self.assertEqual('thirdparty_package.apps.myapp.models', Cow.__module__) self.assertEqual('thirdparty_package.apps.myapp.models', Goat.__module__) def test_load_overriden_3rd_party_class_correctly(self): self.installed_apps.append('apps.myapp') with override_settings(INSTALLED_APPS=self.installed_apps): Cow, Goat = get_classes('myapp.models', ('Cow', 'Goat'), self.core_app_prefix) self.assertEqual('thirdparty_package.apps.myapp.models', Cow.__module__) self.assertEqual('apps.myapp.models', Goat.__module__) class TestMovedClasses(TestCase): def setUp(self): user = UserFactory() product = create_product() self.wishlist = WishListFactory(owner=user) self.wishlist.add(product) def test_load_formset_old_destination(self): BaseBasketLineFormSet = get_class('basket.forms', 'BaseBasketLineFormSet') self.assertEqual('oscar.apps.basket.formsets', BaseBasketLineFormSet.__module__) StockRecordFormSet = get_class('dashboard.catalogue.forms', 'StockRecordFormSet') self.assertEqual('oscar.apps.dashboard.catalogue.formsets', StockRecordFormSet.__module__) OrderedProductFormSet = get_class('dashboard.promotions.forms', 'OrderedProductFormSet') OrderedProductForm = get_class('dashboard.promotions.forms', 'OrderedProductForm') # Since OrderedProductFormSet created with metaclass, it has __module__ # attribute pointing to the Django module. Thus, we test if formset was # loaded correctly by initiating class instance and checking its forms. self.assertTrue(isinstance(OrderedProductFormSet().forms[0], OrderedProductForm)) LineFormset = get_class('wishlists.forms', 'LineFormset') WishListLineForm = get_class('wishlists.forms', 'WishListLineForm') self.assertTrue(isinstance(LineFormset(instance=self.wishlist).forms[0], WishListLineForm)) def test_load_formset_new_destination(self): BaseBasketLineFormSet = get_class('basket.formsets', 'BaseBasketLineFormSet') self.assertEqual('oscar.apps.basket.formsets', BaseBasketLineFormSet.__module__) StockRecordFormSet = get_class('dashboard.catalogue.formsets', 'StockRecordFormSet') self.assertEqual('oscar.apps.dashboard.catalogue.formsets', StockRecordFormSet.__module__) OrderedProductFormSet = get_class('dashboard.promotions.formsets', 'OrderedProductFormSet') OrderedProductForm = get_class('dashboard.promotions.forms', 'OrderedProductForm') self.assertTrue(isinstance(OrderedProductFormSet().forms[0], OrderedProductForm)) LineFormset = get_class('wishlists.formsets', 'LineFormset') WishListLineForm = get_class('wishlists.forms', 'WishListLineForm') self.assertTrue(isinstance(LineFormset(instance=self.wishlist).forms[0], WishListLineForm)) def test_load_formsets_mixed_destination(self): BaseBasketLineFormSet, BasketLineForm = get_classes('basket.forms', ('BaseBasketLineFormSet', 'BasketLineForm')) self.assertEqual('oscar.apps.basket.formsets', BaseBasketLineFormSet.__module__) self.assertEqual('oscar.apps.basket.forms', BasketLineForm.__module__) StockRecordForm, StockRecordFormSet = get_classes( 'dashboard.catalogue.forms', ('StockRecordForm', 'StockRecordFormSet') ) self.assertEqual('oscar.apps.dashboard.catalogue.forms', StockRecordForm.__module__) OrderedProductForm, OrderedProductFormSet = get_classes( 'dashboard.promotions.forms', ('OrderedProductForm', 'OrderedProductFormSet') ) self.assertEqual('oscar.apps.dashboard.promotions.forms', OrderedProductForm.__module__) self.assertTrue(isinstance(OrderedProductFormSet().forms[0], OrderedProductForm)) LineFormset, WishListLineForm = get_classes('wishlists.forms', ('LineFormset', 'WishListLineForm')) self.assertEqual('oscar.apps.wishlists.forms', WishListLineForm.__module__) self.assertTrue(isinstance(LineFormset(instance=self.wishlist).forms[0], WishListLineForm))
sonofatailor/django-oscar
tests/integration/core/test_loading.py
Python
bsd-3-clause
11,789
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ #include <map> #include <queue> #include <set> #include <string> #include <vector> #include "base/basictypes.h" #include "base/callback.h" #include "base/gtest_prod_util.h" #include "base/id_map.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/timer/timer.h" #include "content/browser/background_sync/background_sync_registration_handle.h" #include "content/browser/service_worker/embedded_worker_instance.h" #include "content/browser/service_worker/service_worker_script_cache_map.h" #include "content/common/background_sync_service.mojom.h" #include "content/common/content_export.h" #include "content/common/service_port_service.mojom.h" #include "content/common/service_worker/service_worker_status_code.h" #include "content/common/service_worker/service_worker_types.h" #include "content/public/common/service_registry.h" #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" // Windows headers will redefine SendMessage. #ifdef SendMessage #undef SendMessage #endif class GURL; namespace blink { struct WebCircularGeofencingRegion; } namespace net { class HttpResponseInfo; } namespace content { class EmbeddedWorkerRegistry; class ServiceWorkerContextCore; class ServiceWorkerProviderHost; class ServiceWorkerRegistration; class ServiceWorkerURLRequestJob; struct NavigatorConnectClient; struct PlatformNotificationData; struct ServiceWorkerClientInfo; struct ServiceWorkerVersionInfo; struct TransferredMessagePort; // This class corresponds to a specific version of a ServiceWorker // script for a given pattern. When a script is upgraded, there may be // more than one ServiceWorkerVersion "running" at a time, but only // one of them is activated. This class connects the actual script with a // running worker. class CONTENT_EXPORT ServiceWorkerVersion : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerVersion>), public EmbeddedWorkerInstance::Listener { public: typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; typedef base::Callback<void(ServiceWorkerStatusCode, ServiceWorkerFetchEventResult, const ServiceWorkerResponse&)> FetchCallback; typedef base::Callback<void(ServiceWorkerStatusCode, bool /* accept_connction */, const base::string16& /* name */, const base::string16& /* data */)> ServicePortConnectCallback; enum RunningStatus { STOPPED = EmbeddedWorkerInstance::STOPPED, STARTING = EmbeddedWorkerInstance::STARTING, RUNNING = EmbeddedWorkerInstance::RUNNING, STOPPING = EmbeddedWorkerInstance::STOPPING, }; // Current version status; some of the status (e.g. INSTALLED and ACTIVATED) // should be persisted unlike running status. enum Status { NEW, // The version is just created. INSTALLING, // Install event is dispatched and being handled. INSTALLED, // Install event is finished and is ready to be activated. ACTIVATING, // Activate event is dispatched and being handled. ACTIVATED, // Activation is finished and can run as activated. REDUNDANT, // The version is no longer running as activated, due to // unregistration or replace. }; class Listener { public: virtual void OnRunningStateChanged(ServiceWorkerVersion* version) {} virtual void OnVersionStateChanged(ServiceWorkerVersion* version) {} virtual void OnMainScriptHttpResponseInfoSet( ServiceWorkerVersion* version) {} virtual void OnErrorReported(ServiceWorkerVersion* version, const base::string16& error_message, int line_number, int column_number, const GURL& source_url) {} virtual void OnReportConsoleMessage(ServiceWorkerVersion* version, int source_identifier, int message_level, const base::string16& message, int line_number, const GURL& source_url) {} virtual void OnControlleeAdded(ServiceWorkerVersion* version, ServiceWorkerProviderHost* provider_host) {} virtual void OnControlleeRemoved(ServiceWorkerVersion* version, ServiceWorkerProviderHost* provider_host) { } // Fires when a version transitions from having a controllee to not. virtual void OnNoControllees(ServiceWorkerVersion* version) {} virtual void OnCachedMetadataUpdated(ServiceWorkerVersion* version) {} protected: virtual ~Listener() {} }; ServiceWorkerVersion( ServiceWorkerRegistration* registration, const GURL& script_url, int64 version_id, base::WeakPtr<ServiceWorkerContextCore> context); int64 version_id() const { return version_id_; } int64 registration_id() const { return registration_id_; } const GURL& script_url() const { return script_url_; } const GURL& scope() const { return scope_; } RunningStatus running_status() const { return static_cast<RunningStatus>(embedded_worker_->status()); } ServiceWorkerVersionInfo GetInfo(); Status status() const { return status_; } // This sets the new status and also run status change callbacks // if there're any (see RegisterStatusChangeCallback). void SetStatus(Status status); // Registers status change callback. (This is for one-off observation, // the consumer needs to re-register if it wants to continue observing // status changes) void RegisterStatusChangeCallback(const base::Closure& callback); // Starts an embedded worker for this version. // This returns OK (success) if the worker is already running. void StartWorker(const StatusCallback& callback); // Stops an embedded worker for this version. // This returns OK (success) if the worker is already stopped. void StopWorker(const StatusCallback& callback); // Schedules an update to be run 'soon'. void ScheduleUpdate(); // If an update is scheduled but not yet started, this resets the timer // delaying the start time by a 'small' amount. void DeferScheduledUpdate(); // Starts an update now. void StartUpdate(); // Sends a message event to the associated embedded worker. void DispatchMessageEvent( const base::string16& message, const std::vector<TransferredMessagePort>& sent_message_ports, const StatusCallback& callback); // Sends install event to the associated embedded worker and asynchronously // calls |callback| when it errors out or it gets a response from the worker // to notify install completion. // // This must be called when the status() is NEW. Calling this changes // the version's status to INSTALLING. // Upon completion, the version's status will be changed to INSTALLED // on success, or back to NEW on failure. void DispatchInstallEvent(const StatusCallback& callback); // Sends activate event to the associated embedded worker and asynchronously // calls |callback| when it errors out or it gets a response from the worker // to notify activation completion. // // This must be called when the status() is INSTALLED. Calling this changes // the version's status to ACTIVATING. // Upon completion, the version's status will be changed to ACTIVATED // on success, or back to INSTALLED on failure. void DispatchActivateEvent(const StatusCallback& callback); // Sends fetch event to the associated embedded worker and calls // |callback| with the response from the worker. // // This must be called when the status() is ACTIVATED. Calling this in other // statuses will result in an error SERVICE_WORKER_ERROR_FAILED. void DispatchFetchEvent(const ServiceWorkerFetchRequest& request, const base::Closure& prepare_callback, const FetchCallback& fetch_callback); // Sends sync event to the associated embedded worker and asynchronously calls // |callback| when it errors out or it gets a response from the worker to // notify completion. // // This must be called when the status() is ACTIVATED. void DispatchSyncEvent(BackgroundSyncRegistrationHandle::HandleId handle_id, const StatusCallback& callback); // Sends notificationclick event to the associated embedded worker and // asynchronously calls |callback| when it errors out or it gets a response // from the worker to notify completion. // // This must be called when the status() is ACTIVATED. void DispatchNotificationClickEvent( const StatusCallback& callback, int64_t persistent_notification_id, const PlatformNotificationData& notification_data, int action_index); // Sends push event to the associated embedded worker and asynchronously calls // |callback| when it errors out or it gets a response from the worker to // notify completion. // // This must be called when the status() is ACTIVATED. void DispatchPushEvent(const StatusCallback& callback, const std::string& data); // Sends geofencing event to the associated embedded worker and asynchronously // calls |callback| when it errors out or it gets a response from the worker // to notify completion. // // This must be called when the status() is ACTIVATED. void DispatchGeofencingEvent( const StatusCallback& callback, blink::WebGeofencingEventType event_type, const std::string& region_id, const blink::WebCircularGeofencingRegion& region); // Sends a ServicePort connect event to the associated embedded worker and // asynchronously calls |callback| with the response from the worker. // // This must be called when the status() is ACTIVATED. void DispatchServicePortConnectEvent( const ServicePortConnectCallback& callback, const GURL& target_url, const GURL& origin, int port_id); // Sends a cross origin message event to the associated embedded worker and // asynchronously calls |callback| when the message was sent (or failed to // sent). // It is the responsibility of the code calling this method to make sure that // any transferred message ports are put on hold while potentially a process // for the service worker is spun up. // // This must be called when the status() is ACTIVATED. void DispatchCrossOriginMessageEvent( const NavigatorConnectClient& client, const base::string16& message, const std::vector<TransferredMessagePort>& sent_message_ports, const StatusCallback& callback); // Adds and removes |provider_host| as a controllee of this ServiceWorker. // A potential controllee is a host having the version as its .installing // or .waiting version. void AddControllee(ServiceWorkerProviderHost* provider_host); void RemoveControllee(ServiceWorkerProviderHost* provider_host); // Returns if it has controllee. bool HasControllee() const { return !controllee_map_.empty(); } // Returns whether the service worker has active window clients under its // control. bool HasWindowClients(); // Adds and removes |request_job| as a dependent job not to stop the // ServiceWorker while |request_job| is reading the stream of the fetch event // response from the ServiceWorker. void AddStreamingURLRequestJob(const ServiceWorkerURLRequestJob* request_job); void RemoveStreamingURLRequestJob( const ServiceWorkerURLRequestJob* request_job); // Adds and removes Listeners. void AddListener(Listener* listener); void RemoveListener(Listener* listener); ServiceWorkerScriptCacheMap* script_cache_map() { return &script_cache_map_; } EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); } // Reports the error message to |listeners_|. void ReportError(ServiceWorkerStatusCode status, const std::string& status_message); // Sets the status code to pass to StartWorker callbacks if start fails. void SetStartWorkerStatusCode(ServiceWorkerStatusCode status); // Sets this version's status to REDUNDANT and deletes its resources. // The version must not have controllees. void Doom(); bool is_redundant() const { return status_ == REDUNDANT; } bool skip_waiting() const { return skip_waiting_; } void set_skip_waiting(bool skip_waiting) { skip_waiting_ = skip_waiting; } bool force_bypass_cache_for_scripts() { return force_bypass_cache_for_scripts_; } void set_force_bypass_cache_for_scripts(bool force_bypass_cache_for_scripts) { force_bypass_cache_for_scripts_ = force_bypass_cache_for_scripts; } void SetDevToolsAttached(bool attached); // Sets the HttpResponseInfo used to load the main script. // This HttpResponseInfo will be used for all responses sent back from the // service worker, as the effective security of these responses is equivalent // to that of the ServiceWorker. void SetMainScriptHttpResponseInfo(const net::HttpResponseInfo& http_info); const net::HttpResponseInfo* GetMainScriptHttpResponseInfo(); // Simulate ping timeout. Should be used for tests-only. void SimulatePingTimeoutForTesting(); private: friend class base::RefCounted<ServiceWorkerVersion>; friend class ServiceWorkerMetrics; friend class ServiceWorkerURLRequestJobTest; friend class ServiceWorkerVersionBrowserTest; FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, ActivateWaitingVersion); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, IdleTimeout); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, SetDevToolsAttached); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, StaleUpdate_FreshWorker); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, StaleUpdate_NonActiveWorker); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, StaleUpdate_StartWorker); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, StaleUpdate_RunningWorker); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, StaleUpdate_DoNotDeferTimer); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerWaitForeverInFetchTest, RequestTimeout); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerFailToStartTest, Timeout); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest, TimeoutStartingWorker); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest, TimeoutWorkerInEvent); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, StayAliveAfterPush); class Metrics; class PingController; typedef ServiceWorkerVersion self; using ServiceWorkerClients = std::vector<ServiceWorkerClientInfo>; // Used for UMA; add new entries to the end, before NUM_REQUEST_TYPES. enum RequestType { REQUEST_ACTIVATE, REQUEST_INSTALL, REQUEST_FETCH, REQUEST_SYNC, REQUEST_NOTIFICATION_CLICK, REQUEST_PUSH, REQUEST_GEOFENCING, REQUEST_SERVICE_PORT_CONNECT, NUM_REQUEST_TYPES }; struct RequestInfo { RequestInfo(int id, RequestType type, const base::TimeTicks& time); ~RequestInfo(); int id; RequestType type; base::TimeTicks time; }; template <typename CallbackType> struct PendingRequest { PendingRequest(const CallbackType& callback, const base::TimeTicks& time); ~PendingRequest(); CallbackType callback; base::TimeTicks start_time; }; // Timeout for the worker to start. static const int kStartWorkerTimeoutMinutes; // Timeout for a request to be handled. static const int kRequestTimeoutMinutes; ~ServiceWorkerVersion() override; // EmbeddedWorkerInstance::Listener overrides: void OnThreadStarted() override; void OnStarting() override; void OnStarted() override; void OnStopping() override; void OnStopped(EmbeddedWorkerInstance::Status old_status) override; void OnDetached(EmbeddedWorkerInstance::Status old_status) override; void OnReportException(const base::string16& error_message, int line_number, int column_number, const GURL& source_url) override; void OnReportConsoleMessage(int source_identifier, int message_level, const base::string16& message, int line_number, const GURL& source_url) override; bool OnMessageReceived(const IPC::Message& message) override; void OnStartSentAndScriptEvaluated(ServiceWorkerStatusCode status); void DispatchInstallEventAfterStartWorker(const StatusCallback& callback); void DispatchActivateEventAfterStartWorker(const StatusCallback& callback); void DispatchMessageEventInternal( const base::string16& message, const std::vector<TransferredMessagePort>& sent_message_ports, const StatusCallback& callback); // Message handlers. // This corresponds to the spec's matchAll(options) steps. void OnGetClients(int request_id, const ServiceWorkerClientQueryOptions& options); void OnActivateEventFinished(int request_id, blink::WebServiceWorkerEventResult result); void OnInstallEventFinished(int request_id, blink::WebServiceWorkerEventResult result); void OnFetchEventFinished(int request_id, ServiceWorkerFetchEventResult result, const ServiceWorkerResponse& response); void OnSyncEventFinished(int request_id, ServiceWorkerEventStatus status); void OnNotificationClickEventFinished(int request_id); void OnPushEventFinished(int request_id, blink::WebServiceWorkerEventResult result); void OnGeofencingEventFinished(int request_id); void OnServicePortConnectEventFinished(int request_id, ServicePortConnectResult result, const mojo::String& name, const mojo::String& data); void OnOpenWindow(int request_id, GURL url); void DidOpenWindow(int request_id, int render_process_id, int render_frame_id); void OnOpenWindowFinished(int request_id, const std::string& client_uuid, const ServiceWorkerClientInfo& client_info); void OnSetCachedMetadata(const GURL& url, const std::vector<char>& data); void OnSetCachedMetadataFinished(int64 callback_id, int result); void OnClearCachedMetadata(const GURL& url); void OnClearCachedMetadataFinished(int64 callback_id, int result); void OnPostMessageToClient( const std::string& client_uuid, const base::string16& message, const std::vector<TransferredMessagePort>& sent_message_ports); void OnFocusClient(int request_id, const std::string& client_uuid); void OnNavigateClient(int request_id, const std::string& client_uuid, const GURL& url); void DidNavigateClient(int request_id, int render_process_id, int render_frame_id); void OnNavigateClientFinished(int request_id, const std::string& client_uuid, const ServiceWorkerClientInfo& client); void OnSkipWaiting(int request_id); void OnClaimClients(int request_id); void OnPongFromWorker(); void OnFocusClientFinished(int request_id, const std::string& client_uuid, const ServiceWorkerClientInfo& client); void DidEnsureLiveRegistrationForStartWorker( const StatusCallback& callback, ServiceWorkerStatusCode status, const scoped_refptr<ServiceWorkerRegistration>& protect); void StartWorkerInternal(); void DidSkipWaiting(int request_id); void GetWindowClients(int request_id, const ServiceWorkerClientQueryOptions& options); const std::vector<base::Tuple<int, int, std::string>> GetWindowClientsInternal(bool include_uncontolled); void DidGetWindowClients(int request_id, const ServiceWorkerClientQueryOptions& options, scoped_ptr<ServiceWorkerClients> clients); void GetNonWindowClients(int request_id, const ServiceWorkerClientQueryOptions& options, ServiceWorkerClients* clients); void OnGetClientsFinished(int request_id, ServiceWorkerClients* clients); // The timeout timer periodically calls OnTimeoutTimer, which stops the worker // if it is excessively idle or unresponsive to ping. void StartTimeoutTimer(); void StopTimeoutTimer(); void OnTimeoutTimer(); // Called by PingController for ping protocol. ServiceWorkerStatusCode PingWorker(); void OnPingTimeout(); // Stops the worker if it is idle (has no in-flight requests) or timed out // ping. void StopWorkerIfIdle(); bool HasInflightRequests() const; // RecordStartWorkerResult is added as a start callback by StartTimeoutTimer // and records metrics about startup. void RecordStartWorkerResult(ServiceWorkerStatusCode status); template <typename IDMAP> void RemoveCallbackAndStopIfRedundant(IDMAP* callbacks, int request_id); template <typename CallbackType> int AddRequest( const CallbackType& callback, IDMap<PendingRequest<CallbackType>, IDMapOwnPointer>* callback_map, RequestType request_type); bool MaybeTimeOutRequest(const RequestInfo& info); void SetAllRequestTimes(const base::TimeTicks& ticks); // Returns the reason the embedded worker failed to start, using information // inaccessible to EmbeddedWorkerInstance. Returns |default_code| if it can't // deduce a reason. ServiceWorkerStatusCode DeduceStartWorkerFailureReason( ServiceWorkerStatusCode default_code); // Sets |stale_time_| if this worker is stale, causing an update to eventually // occur once the worker stops or is running too long. void MarkIfStale(); void FoundRegistrationForUpdate( ServiceWorkerStatusCode status, const scoped_refptr<ServiceWorkerRegistration>& registration); void OnStoppedInternal(EmbeddedWorkerInstance::Status old_status); // Called when a connection to a mojo event Dispatcher drops or fails. // Calls callbacks for any outstanding requests to the dispatcher as well // as cleans up the dispatcher. void OnServicePortDispatcherConnectionError(); void OnBackgroundSyncDispatcherConnectionError(); // Called at the beginning of each Dispatch*Event function: records // the time elapsed since idle (generally the time since the previous // event ended). void OnBeginEvent(); const int64 version_id_; const int64 registration_id_; const GURL script_url_; const GURL scope_; Status status_ = NEW; scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; std::vector<StatusCallback> start_callbacks_; std::vector<StatusCallback> stop_callbacks_; std::vector<base::Closure> status_change_callbacks_; // Message callbacks. (Update HasInflightRequests() too when you update this // list.) IDMap<PendingRequest<StatusCallback>, IDMapOwnPointer> activate_requests_; IDMap<PendingRequest<StatusCallback>, IDMapOwnPointer> install_requests_; IDMap<PendingRequest<FetchCallback>, IDMapOwnPointer> fetch_requests_; IDMap<PendingRequest<StatusCallback>, IDMapOwnPointer> sync_requests_; IDMap<PendingRequest<StatusCallback>, IDMapOwnPointer> notification_click_requests_; IDMap<PendingRequest<StatusCallback>, IDMapOwnPointer> push_requests_; IDMap<PendingRequest<StatusCallback>, IDMapOwnPointer> geofencing_requests_; IDMap<PendingRequest<ServicePortConnectCallback>, IDMapOwnPointer> service_port_connect_requests_; ServicePortDispatcherPtr service_port_dispatcher_; BackgroundSyncServiceClientPtr background_sync_dispatcher_; std::set<const ServiceWorkerURLRequestJob*> streaming_url_request_jobs_; std::map<std::string, ServiceWorkerProviderHost*> controllee_map_; // Will be null while shutting down. base::WeakPtr<ServiceWorkerContextCore> context_; base::ObserverList<Listener> listeners_; ServiceWorkerScriptCacheMap script_cache_map_; base::OneShotTimer<ServiceWorkerVersion> update_timer_; // Starts running in StartWorker and continues until the worker is stopped. base::RepeatingTimer<ServiceWorkerVersion> timeout_timer_; // Holds the time the worker last started being considered idle. base::TimeTicks idle_time_; // Holds the time that the outstanding StartWorker() request started. base::TimeTicks start_time_; // Holds the time the worker entered STOPPING status. base::TimeTicks stop_time_; // Holds the time the worker was detected as stale and needs updating. We try // to update once the worker stops, but will also update if it stays alive too // long. base::TimeTicks stale_time_; // New requests are added to |requests_| along with their entry in a callback // map. The timeout timer periodically checks |requests_| for entries that // should time out or have already been fulfilled (i.e., removed from the // callback map). std::queue<RequestInfo> requests_; bool skip_waiting_ = false; bool skip_recording_startup_time_ = false; bool force_bypass_cache_for_scripts_ = false; bool is_update_scheduled_ = false; bool in_dtor_ = false; std::vector<int> pending_skip_waiting_requests_; scoped_ptr<net::HttpResponseInfo> main_script_http_info_; // The status when StartWorker was invoked. Used for UMA. Status prestart_status_ = NEW; // If not OK, the reason that StartWorker failed. Used for // running |start_callbacks_|. ServiceWorkerStatusCode start_worker_status_ = SERVICE_WORKER_OK; scoped_ptr<PingController> ping_controller_; scoped_ptr<Metrics> metrics_; const bool should_exclude_from_uma_ = false; base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); }; } // namespace content #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
CapOM/ChromiumGStreamerBackend
content/browser/service_worker/service_worker_version.h
C
bsd-3-clause
26,828
using System; using System.Text.RegularExpressions; namespace Shouldly.Tests.Strings { [ShouldlyMethods] public static class Verify { static readonly Regex MatchGetHashCode = new Regex("\\(\\d{5,8}\\)"); public static void ShouldFail(Action action, string errorWithSource, string errorWithoutSource, Func<string, string>? messageScrubber = null) { if (messageScrubber == null) { messageScrubber = v => { var msg = MatchGetHashCode.Replace(v, "(000000)"); return msg; }; } else { var scrubber = messageScrubber; messageScrubber = v => { var msg = scrubber(v); var res = MatchGetHashCode.Replace(msg, "(000000)"); return res; }; } action .ShouldSatisfyAllConditions( () => { using (ShouldlyConfiguration.DisableSourceInErrors()) { var sourceDisabledExceptionMsg = messageScrubber(Should.Throw<ShouldAssertException>(action).Message); sourceDisabledExceptionMsg.ShouldBe(errorWithoutSource, "Source not available", StringCompareShould.IgnoreLineEndings); } }, () => { var sourceEnabledExceptionMsg = messageScrubber(Should.Throw<ShouldAssertException>(action).Message); sourceEnabledExceptionMsg.ShouldBe(errorWithSource, "Source available", StringCompareShould.IgnoreLineEndings); }); } } }
JoeMighty/shouldly
src/Shouldly.Tests/Strings/Verify.cs
C#
bsd-3-clause
1,848
// RobotBuilder Version: 1.5 // // This file was generated by RobotBuilder. It contains sections of // code that are automatically generated and assigned by robotbuilder. // These sections will be updated in the future when you export to // Java from RobotBuilder. Do not put any code or make any change in // the blocks indicating autogenerated code or it will be lost on an // update. Deleting the comments indicating the section will prevent // it from being updated in the future. package org.usfirst.frc5571.HolonomicDrive.commands; import org.usfirst.frc5571.HolonomicDrive.Constants; import org.usfirst.frc5571.HolonomicDrive.Robot; import edu.wpi.first.wpilibj.Timer; import edu.wpi.first.wpilibj.command.Command; /* * */ public class ChassisDriveAndTurn extends Command { private Timer timer; private double driveDuration; private double drivePower; private double driveDirection; private double driveAngle; public ChassisDriveAndTurn() { // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES requires(Robot.driveTrain); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES // instantiate a timer timer = new Timer(); // default test values when called from the SmartDashboard driveDuration = 2.0; drivePower = 0.5; driveDirection = 0.0; driveAngle = 90.0; } public ChassisDriveAndTurn(double duration, double power, double direction, double angle) { // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES requires(Robot.driveTrain); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES // instantiate a timer timer = new Timer(); // copy the parameters to the class variables driveDuration = duration; drivePower = power; driveDirection = direction; driveAngle = angle; } // Called just before this Command runs the first time protected void initialize() { // Set the PID up for driving straight Robot.driveTrain.getAngleGyroController().setPID( Constants.DrivetrainAngleGyroControllerP, Constants.DrivetrainAngleGyroControllerI, Constants.DrivetrainAngleGyroControllerD); // Robot.drivetrain.resetGyro(); Robot.driveTrain.getAngleGyroController().setSetpoint( Robot.driveTrain.getGyroValue() + driveAngle); // update the PID direction and power Robot.driveTrain.setDirection(driveDirection); Robot.driveTrain.setMagnitude(drivePower); // enable the PID Robot.driveTrain.getAngleGyroController().enable(); // reset and start the timer timer.reset(); timer.start(); } // Called repeatedly when this Command is scheduled to run protected void execute() { } // Make this return true when this Command no longer needs to run execute() protected boolean isFinished() { return (timer.get() > driveDuration); } // Called once after isFinished returns true protected void end() { // disable the PID and stop the robot Robot.driveTrain.getAngleGyroController().disable(); Robot.driveTrain.holonomicDrive(0, 0, 0); timer.stop(); } // Called when another command which requires one or more of the same // subsystems is scheduled to run protected void interrupted() { // call the end method this.end(); } }
Team5571/Holonomic-Drive
src/org/usfirst/frc5571/HolonomicDrive/commands/ChassisDriveAndTurn.java
Java
bsd-3-clause
3,192
import sys from time import sleep from cachey import Cache, Scorer, nbytes def test_cache(): c = Cache(available_bytes=nbytes(1) * 3) c.put('x', 1, 10) assert c.get('x') == 1 assert 'x' in c c.put('a', 1, 10) c.put('b', 1, 10) c.put('c', 1, 10) assert set(c.data) == set('xbc') c.put('d', 1, 10) assert set(c.data) == set('xcd') c.clear() assert 'x' not in c assert not c.data assert not c.heap def test_cache_scores_update(): c = Cache(available_bytes=nbytes(1) * 2) c.put('x', 1, 1) c.put('y', 1, 1) c.get('x') c.get('x') c.get('x') c.put('z', 1, 1) assert set(c.data) == set('xz') def test_memoize(): c = Cache(available_bytes=nbytes(1) * 3) flag = [0] def slow_inc(x): flag[0] += 1 sleep(0.01) return x + 1 memo_inc = c.memoize(slow_inc) assert memo_inc(1) == 2 assert memo_inc(1) == 2 assert list(c.data.values()) == [2] def test_callbacks(): hit_flag = [False] def hit(key, value): hit_flag[0] = (key, value) miss_flag = [False] def miss(key): miss_flag[0] = key c = Cache(100, hit=hit, miss=miss) c.get('x') assert miss_flag[0] == 'x' assert hit_flag[0] == False c.put('y', 1, 1) c.get('y') assert hit_flag[0] == ('y', 1) def test_just_one_reference(): c = Cache(available_bytes=1000) o = object() x = sys.getrefcount(o) c.put('key', o, cost=10) y = sys.getrefcount(o) assert y == x + 1 c.retire('key') z = sys.getrefcount(o) assert z == x
Winterflower/cachey
cachey/tests/test_cache.py
Python
bsd-3-clause
1,608
from __future__ import absolute_import, division, print_function # ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # ---------------------------------------------------------------------------- class TreeError(Exception): """General tree error""" pass class NoLengthError(TreeError): """Missing length when expected""" pass class DuplicateNodeError(TreeError): """Duplicate nodes with identical names""" pass class MissingNodeError(TreeError): """Expecting a node""" pass class NoParentError(MissingNodeError): """Missing a parent""" pass
Kleptobismol/scikit-bio
skbio/tree/_exception.py
Python
bsd-3-clause
814
body { color: #76838f; background-color: #fff; } a { color: #677ae4; } a:hover, a:focus { color: #8897ec; } img { vertical-align: middle; } .img-thumbnail { background-color: #fff; border: 1px solid #e4eaec; } hr { border-top: 1px solid #e4eaec; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: #37474f; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small { color: #a3afb7; } mark, .mark { background-color: #f2a654; } .text-muted { color: #526069; } .text-primary { color: #677ae4; } a.text-primary:hover, a.text-primary:focus { color: #3c54dc; } .text-success { color: #fff; } a.text-success:hover, a.text-success:focus { color: #e6e6e6; } .text-info { color: #fff; } a.text-info:hover, a.text-info:focus { color: #e6e6e6; } .text-warning { color: #fff; } a.text-warning:hover, a.text-warning:focus { color: #e6e6e6; } .text-danger { color: #fff; } a.text-danger:hover, a.text-danger:focus { color: #e6e6e6; } .bg-primary { color: #fff; background-color: #677ae4; } a.bg-primary:hover, a.bg-primary:focus { background-color: #3c54dc; } .bg-success { background-color: #46be8a; } a.bg-success:hover, a.bg-success:focus { background-color: #369b6f; } .bg-info { background-color: #57c7d4; } a.bg-info:hover, a.bg-info:focus { background-color: #33b6c5; } .bg-warning { background-color: #f2a654; } a.bg-warning:hover, a.bg-warning:focus { background-color: #ee8d25; } .bg-danger { background-color: #f96868; } a.bg-danger:hover, a.bg-danger:focus { background-color: #f73737; } .page-header { border-bottom: 1px solid transparent; } abbr[title], abbr[data-original-title] { border-bottom: 1px dotted #e4eaec; } blockquote { border-left: 5px solid #e4eaec; } blockquote footer, blockquote small, blockquote .small { color: #a3afb7; } .blockquote-reverse, blockquote.pull-right { border-right: 5px solid #e4eaec; } code { color: #5e6fb2; background-color: rgba(237, 239, 249, .1); } kbd { color: #fff; background-color: #677ae4; } pre { color: inherit; background-color: #fff; border: 1px solid #edeffc; } table { background-color: transparent; } caption { color: #526069; } .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { border-top: 1px solid #e4eaec; } .table > thead > tr > th { border-bottom: 2px solid #e4eaec; } .table > tbody + tbody { border-top: 2px solid #e4eaec; } .table .table { background-color: #fff; } .table-bordered { border: 1px solid #e4eaec; } .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { border: 1px solid #e4eaec; } .table-striped > tbody > tr:nth-of-type(odd) { background-color: rgba(243, 247, 249, .3); } .table-hover > tbody > tr:hover { background-color: #f3f7f9; } .table > thead > tr > td.active, .table > tbody > tr > td.active, .table > tfoot > tr > td.active, .table > thead > tr > th.active, .table > tbody > tr > th.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td, .table > tbody > tr.active > td, .table > tfoot > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr.active > th, .table > tfoot > tr.active > th { background-color: #f3f7f9; } .table-hover > tbody > tr > td.active:hover, .table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, .table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th { background-color: #e2ecf1; } .table > thead > tr > td.success, .table > tbody > tr > td.success, .table > tfoot > tr > td.success, .table > thead > tr > th.success, .table > tbody > tr > th.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td, .table > tbody > tr.success > td, .table > tfoot > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr.success > th, .table > tfoot > tr.success > th { background-color: #46be8a; } .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th { background-color: #3dae7d; } .table > thead > tr > td.info, .table > tbody > tr > td.info, .table > tfoot > tr > td.info, .table > thead > tr > th.info, .table > tbody > tr > th.info, .table > tfoot > tr > th.info, .table > thead > tr.info > td, .table > tbody > tr.info > td, .table > tfoot > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr.info > th, .table > tfoot > tr.info > th { background-color: #57c7d4; } .table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th { background-color: #43c0cf; } .table > thead > tr > td.warning, .table > tbody > tr > td.warning, .table > tfoot > tr > td.warning, .table > thead > tr > th.warning, .table > tbody > tr > th.warning, .table > tfoot > tr > th.warning, .table > thead > tr.warning > td, .table > tbody > tr.warning > td, .table > tfoot > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr.warning > th, .table > tfoot > tr.warning > th { background-color: #f2a654; } .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th { background-color: #f09a3c; } .table > thead > tr > td.danger, .table > tbody > tr > td.danger, .table > tfoot > tr > td.danger, .table > thead > tr > th.danger, .table > tbody > tr > th.danger, .table > tfoot > tr > th.danger, .table > thead > tr.danger > td, .table > tbody > tr.danger > td, .table > tfoot > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr.danger > th, .table > tfoot > tr.danger > th { background-color: #f96868; } .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th { background-color: #f84f4f; } @media screen and (max-width: 767px) { .table-responsive { border: 1px solid #e4eaec; } } legend { color: inherit; border-bottom: 1px solid transparent; } output { color: #76838f; } .form-control { color: #76838f; background-color: #fff; border: 1px solid #e4eaec; } .form-control:focus { border-color: #677ae4; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(103, 122, 228, .6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(103, 122, 228, .6); } .form-control.focus, .form-control:focus { border-color: #677ae4; -webkit-box-shadow: none; box-shadow: none; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { background-color: #f3f7f9; } .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline, .has-success.radio label, .has-success.checkbox label, .has-success.radio-inline label, .has-success.checkbox-inline label { color: #fff; } .has-success .form-control { border-color: #fff; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-success .form-control:focus { border-color: #e6e6e6; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #fff; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #fff; } .has-success .input-group-addon { color: #fff; background-color: #46be8a; border-color: #fff; } .has-success .form-control-feedback { color: #fff; } .has-success .form-control { -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } .has-success .form-control:focus { border-color: #fff; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(255, 255, 255, .6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(255, 255, 255, .6); } .has-success .form-control.focus, .has-success .form-control:focus { border-color: #fff; -webkit-box-shadow: none; box-shadow: none; } .has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline, .has-warning.radio label, .has-warning.checkbox label, .has-warning.radio-inline label, .has-warning.checkbox-inline label { color: #fff; } .has-warning .form-control { border-color: #fff; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-warning .form-control:focus { border-color: #e6e6e6; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #fff; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #fff; } .has-warning .input-group-addon { color: #fff; background-color: #f2a654; border-color: #fff; } .has-warning .form-control-feedback { color: #fff; } .has-warning .form-control { -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } .has-warning .form-control:focus { border-color: #fff; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(255, 255, 255, .6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(255, 255, 255, .6); } .has-warning .form-control.focus, .has-warning .form-control:focus { border-color: #fff; -webkit-box-shadow: none; box-shadow: none; } .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline, .has-error.radio label, .has-error.checkbox label, .has-error.radio-inline label, .has-error.checkbox-inline label { color: #fff; } .has-error .form-control { border-color: #fff; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-error .form-control:focus { border-color: #e6e6e6; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #fff; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #fff; } .has-error .input-group-addon { color: #fff; background-color: #f96868; border-color: #fff; } .has-error .form-control-feedback { color: #fff; } .has-error .form-control { -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } .has-error .form-control:focus { border-color: #fff; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(255, 255, 255, .6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(255, 255, 255, .6); } .has-error .form-control.focus, .has-error .form-control:focus { border-color: #fff; -webkit-box-shadow: none; box-shadow: none; } .help-block { color: #bcc2c8; } .btn:hover, .btn:focus, .btn.focus { color: #76838f; } .btn-default { color: #76838f; background-color: #e4eaec; border-color: #e4eaec; } .btn-default:focus, .btn-default.focus { color: #76838f; background-color: #c6d3d7; border-color: #99b0b7; } .btn-default:hover { color: #76838f; background-color: #c6d3d7; border-color: #c0ced3; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { color: #76838f; background-color: #c6d3d7; border-color: #c0ced3; } .btn-default:active:hover, .btn-default.active:hover, .open > .dropdown-toggle.btn-default:hover, .btn-default:active:focus, .btn-default.active:focus, .open > .dropdown-toggle.btn-default:focus, .btn-default:active.focus, .btn-default.active.focus, .open > .dropdown-toggle.btn-default.focus { color: #76838f; background-color: #b1c2c8; border-color: #99b0b7; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { background-image: none; } .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus { background-color: #e4eaec; border-color: #e4eaec; } .btn-default .badge { color: #e4eaec; background-color: #76838f; } .btn-primary { color: #fff; background-color: #677ae4; border-color: #677ae4; } .btn-primary:focus, .btn-primary.focus { color: #fff; background-color: #3c54dc; border-color: #1f34ad; } .btn-primary:hover { color: #fff; background-color: #3c54dc; border-color: #334ddb; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { color: #fff; background-color: #3c54dc; border-color: #334ddb; } .btn-primary:active:hover, .btn-primary.active:hover, .open > .dropdown-toggle.btn-primary:hover, .btn-primary:active:focus, .btn-primary.active:focus, .open > .dropdown-toggle.btn-primary:focus, .btn-primary:active.focus, .btn-primary.active.focus, .open > .dropdown-toggle.btn-primary.focus { color: #fff; background-color: #253fcf; border-color: #1f34ad; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus { background-color: #677ae4; border-color: #677ae4; } .btn-primary .badge { color: #677ae4; background-color: #fff; } .btn-success { color: #fff; background-color: #46be8a; border-color: #46be8a; } .btn-success:focus, .btn-success.focus { color: #fff; background-color: #369b6f; border-color: #226246; } .btn-success:hover { color: #fff; background-color: #369b6f; border-color: #34936a; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { color: #fff; background-color: #369b6f; border-color: #34936a; } .btn-success:active:hover, .btn-success.active:hover, .open > .dropdown-toggle.btn-success:hover, .btn-success:active:focus, .btn-success.active:focus, .open > .dropdown-toggle.btn-success:focus, .btn-success:active.focus, .btn-success.active.focus, .open > .dropdown-toggle.btn-success.focus { color: #fff; background-color: #2d805c; border-color: #226246; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { background-image: none; } .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled.focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success.focus { background-color: #46be8a; border-color: #46be8a; } .btn-success .badge { color: #46be8a; background-color: #fff; } .btn-info { color: #fff; background-color: #57c7d4; border-color: #57c7d4; } .btn-info:focus, .btn-info.focus { color: #fff; background-color: #33b6c5; border-color: #237e89; } .btn-info:hover { color: #fff; background-color: #33b6c5; border-color: #30afbd; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { color: #fff; background-color: #33b6c5; border-color: #30afbd; } .btn-info:active:hover, .btn-info.active:hover, .open > .dropdown-toggle.btn-info:hover, .btn-info:active:focus, .btn-info.active:focus, .open > .dropdown-toggle.btn-info:focus, .btn-info:active.focus, .btn-info.active.focus, .open > .dropdown-toggle.btn-info.focus { color: #fff; background-color: #2b9ca9; border-color: #237e89; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { background-image: none; } .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled.focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info.focus { background-color: #57c7d4; border-color: #57c7d4; } .btn-info .badge { color: #57c7d4; background-color: #fff; } .btn-warning { color: #fff; background-color: #f2a654; border-color: #f2a654; } .btn-warning:focus, .btn-warning.focus { color: #fff; background-color: #ee8d25; border-color: #b8660e; } .btn-warning:hover { color: #fff; background-color: #ee8d25; border-color: #ee881b; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { color: #fff; background-color: #ee8d25; border-color: #ee881b; } .btn-warning:active:hover, .btn-warning.active:hover, .open > .dropdown-toggle.btn-warning:hover, .btn-warning:active:focus, .btn-warning.active:focus, .open > .dropdown-toggle.btn-warning:focus, .btn-warning:active.focus, .btn-warning.active.focus, .open > .dropdown-toggle.btn-warning.focus { color: #fff; background-color: #de7c11; border-color: #b8660e; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { background-image: none; } .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled.focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning.focus { background-color: #f2a654; border-color: #f2a654; } .btn-warning .badge { color: #f2a654; background-color: #fff; } .btn-danger { color: #fff; background-color: #f96868; border-color: #f96868; } .btn-danger:focus, .btn-danger.focus { color: #fff; background-color: #f73737; border-color: #d90909; } .btn-danger:hover { color: #fff; background-color: #f73737; border-color: #f72d2d; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { color: #fff; background-color: #f73737; border-color: #f72d2d; } .btn-danger:active:hover, .btn-danger.active:hover, .open > .dropdown-toggle.btn-danger:hover, .btn-danger:active:focus, .btn-danger.active:focus, .open > .dropdown-toggle.btn-danger:focus, .btn-danger:active.focus, .btn-danger.active.focus, .open > .dropdown-toggle.btn-danger.focus { color: #fff; background-color: #f61515; border-color: #d90909; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { background-image: none; } .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled.focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger.focus { background-color: #f96868; border-color: #f96868; } .btn-danger .badge { color: #f96868; background-color: #fff; } .btn-link { color: #677ae4; } .btn-link:hover, .btn-link:focus { color: #8897ec; text-decoration: underline; } .btn-link[disabled]:hover, fieldset[disabled] .btn-link:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:focus { color: #a3afb7; } .dropdown-menu { background-color: #fff; border: 1px solid #ccc; border: 1px solid #e4eaec; } .dropdown-menu .divider { height: 1px; margin: 10px 0; overflow: hidden; background-color: #e4eaec; } .dropdown-menu > li > a { color: #76838f; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { color: #76838f; background-color: #f3f7f9; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #76838f; background-color: #f3f7f9; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #ccd5db; } .dropdown-header { color: #37474f; } .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); } [data-toggle="buttons"] > .btn input[type="radio"], [data-toggle="buttons"] > .btn-group > .btn input[type="radio"], [data-toggle="buttons"] > .btn input[type="checkbox"], [data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { clip: rect(0, 0, 0, 0); } .input-group-addon { color: #76838f; background-color: #f3f7f9; border: 1px solid #e4eaec; } .nav > li > a:hover, .nav > li > a:focus { background-color: #f3f7f9; } .nav > li.disabled > a { color: #a3afb7; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { color: #a3afb7; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background-color: #f3f7f9; border-color: #677ae4; } .nav-tabs { border-bottom: 1px solid #e4eaec; } .nav-tabs > li > a:hover { border-color: transparent transparent #e4eaec; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #5166d6; background-color: #fff; border: 1px solid #e4eaec; } .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #fff; background-color: #677ae4; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border: 1px solid #e4eaec; } @media (min-width: 768px) { .nav-tabs-justified > li > a { border-bottom: 1px solid #e4eaec; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border-bottom-color: #fff; } } .navbar-default { background-color: #fff; border-color: #e4eaec; } .navbar-default .navbar-brand { color: #37474f; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #37474f; background-color: none; } .navbar-default .navbar-text { color: #76838f; } .navbar-default .navbar-nav > li > a { color: #76838f; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #526069; background-color: rgba(243, 247, 249, .3); } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color: #526069; background-color: rgba(243, 247, 249, .6); } .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #ccd5db; background-color: transparent; } .navbar-default .navbar-toggle { border-color: transparent; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: rgba(243, 247, 249, .3); } .navbar-default .navbar-toggle .icon-bar { background-color: #76838f; } .navbar-default .navbar-collapse, .navbar-default .navbar-form { border-color: #e4eaec; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { color: #526069; background-color: rgba(243, 247, 249, .6); } @media (max-width: 767px) { .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #76838f; } .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #526069; background-color: rgba(243, 247, 249, .3); } .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { color: #526069; background-color: rgba(243, 247, 249, .6); } .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #ccd5db; background-color: transparent; } } .navbar-default .navbar-link { color: #76838f; } .navbar-default .navbar-link:hover { color: #526069; } .navbar-default .btn-link { color: #76838f; } .navbar-default .btn-link:hover, .navbar-default .btn-link:focus { color: #526069; } .navbar-default .btn-link[disabled]:hover, fieldset[disabled] .navbar-default .btn-link:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:focus { color: #ccd5db; } .navbar-inverse { background-color: #677ae4; border-color: rgba(0, 0, 0, .1); } .navbar-inverse .navbar-brand { color: #fff; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #fff; background-color: none; } .navbar-inverse .navbar-text { color: #fff; } .navbar-inverse .navbar-nav > li > a { color: #fff; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #fff; background-color: rgba(0, 0, 0, .1); } .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #fff; background-color: rgba(0, 0, 0, .1); } .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-toggle { border-color: transparent; } .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { background-color: rgba(0, 0, 0, .1); } .navbar-inverse .navbar-toggle .icon-bar { background-color: #fff; } .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { border-color: #495fdf; } .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { color: #fff; background-color: rgba(0, 0, 0, .1); } @media (max-width: 767px) { .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { border-color: rgba(0, 0, 0, .1); } .navbar-inverse .navbar-nav .open .dropdown-menu .divider { background-color: rgba(0, 0, 0, .1); } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #fff; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { color: #fff; background-color: rgba(0, 0, 0, .1); } .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { color: #fff; background-color: rgba(0, 0, 0, .1); } .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #fff; background-color: transparent; } } .navbar-inverse .navbar-link { color: #fff; } .navbar-inverse .navbar-link:hover { color: #fff; } .navbar-inverse .btn-link { color: #fff; } .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus { color: #fff; } .navbar-inverse .btn-link[disabled]:hover, fieldset[disabled] .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:focus { color: #fff; } .breadcrumb { background-color: transparent; } .breadcrumb > li + li:before { color: #677ae4; } .breadcrumb > .active { color: #76838f; } .pagination > li > a, .pagination > li > span { color: #76838f; background-color: transparent; border: 1px solid #e4eaec; } .pagination > li > a:hover, .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { color: #8897ec; background-color: #f3f7f9; border-color: #e4eaec; } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { color: #fff; background-color: #677ae4; border-color: #677ae4; } .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #ccd5db; background-color: transparent; border-color: #e4eaec; } .pager li > a, .pager li > span { background-color: transparent; border: 1px solid #e4eaec; } .pager li > a:hover, .pager li > a:focus { background-color: #fff; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { color: #ccd5db; background-color: transparent; } .label { color: #fff; } a.label:hover, a.label:focus { color: #fff; } .label-default { background-color: #e4eaec; } .label-default[href]:hover, .label-default[href]:focus { background-color: #c6d3d7; } .label-primary { background-color: #677ae4; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #3c54dc; } .label-success { background-color: #46be8a; } .label-success[href]:hover, .label-success[href]:focus { background-color: #369b6f; } .label-info { background-color: #57c7d4; } .label-info[href]:hover, .label-info[href]:focus { background-color: #33b6c5; } .label-warning { background-color: #f2a654; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #ee8d25; } .label-danger { background-color: #f96868; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #f73737; } .badge { color: #76838f; background-color: #e4eaec; } a.badge:hover, a.badge:focus { color: #a3afb7; } .list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #526069; background-color: #e4eaec; } .jumbotron { color: inherit; background-color: #e4eaec; } .jumbotron h1, .jumbotron .h1 { color: inherit; } .jumbotron > hr { border-top-color: #c6d3d7; } .thumbnail { background-color: #fff; border: 1px solid #e4eaec; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { border-color: #677ae4; } .thumbnail .caption { color: #76838f; } .alert-success { color: #46be8a; background-color: rgba(231, 250, 242, .8); border-color: #e7faf2; } .alert-success hr { border-top-color: #d2f6e7; } .alert-success .alert-link { color: #369b6f; } .alert-success .close { color: #46be8a; } .alert-success .close:hover, .alert-success .close:focus { color: #46be8a; } .alert-info { color: #57c7d4; background-color: rgba(236, 249, 250, .8); border-color: #ecf9fa; } .alert-info hr { border-top-color: #d8f3f5; } .alert-info .alert-link { color: #33b6c5; } .alert-info .close { color: #57c7d4; } .alert-info .close:hover, .alert-info .close:focus { color: #57c7d4; } .alert-warning { color: #f2a654; background-color: rgba(255, 243, 230, .8); border-color: #fff3e6; } .alert-warning hr { border-top-color: #ffe7cc; } .alert-warning .alert-link { color: #ee8d25; } .alert-warning .close { color: #f2a654; } .alert-warning .close:hover, .alert-warning .close:focus { color: #f2a654; } .alert-danger { color: #f96868; background-color: rgba(255, 234, 234, .8); border-color: #ffeaea; } .alert-danger hr { border-top-color: #ffd0d0; } .alert-danger .alert-link { color: #f73737; } .alert-danger .close { color: #f96868; } .alert-danger .close:hover, .alert-danger .close:focus { color: #f96868; } .progress { background-color: #e4eaec; } .progress-bar { color: #fff; background-color: #677ae4; } .progress-bar-success { background-color: #46be8a; } .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .progress-bar-info { background-color: #57c7d4; } .progress-striped .progress-bar-info { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .progress-bar-warning { background-color: #f2a654; } .progress-striped .progress-bar-warning { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .progress-bar-danger { background-color: #f96868; } .progress-striped .progress-bar-danger { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .list-group-item { background-color: #fff; border: 1px solid transparent; } a.list-group-item, button.list-group-item { color: #76838f; } a.list-group-item .list-group-item-heading, button.list-group-item .list-group-item-heading { color: #37474f; } a.list-group-item:hover, button.list-group-item:hover, a.list-group-item:focus, button.list-group-item:focus { color: #76838f; background-color: #f3f7f9; } .list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus { color: #ccd5db; background-color: transparent; } .list-group-item.disabled .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text { color: #ccd5db; } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { color: #677ae4; background-color: transparent; border-color: transparent; } .list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text { color: #fff; } .list-group-item-success { color: #fff; background-color: #46be8a; } a.list-group-item-success, button.list-group-item-success { color: #fff; } a.list-group-item-success .list-group-item-heading, button.list-group-item-success .list-group-item-heading { color: inherit; } a.list-group-item-success:hover, button.list-group-item-success:hover, a.list-group-item-success:focus, button.list-group-item-success:focus { color: #fff; background-color: #3dae7d; } a.list-group-item-success.active, button.list-group-item-success.active, a.list-group-item-success.active:hover, button.list-group-item-success.active:hover, a.list-group-item-success.active:focus, button.list-group-item-success.active:focus { color: #fff; background-color: #fff; border-color: #fff; } .list-group-item-info { color: #fff; background-color: #57c7d4; } a.list-group-item-info, button.list-group-item-info { color: #fff; } a.list-group-item-info .list-group-item-heading, button.list-group-item-info .list-group-item-heading { color: inherit; } a.list-group-item-info:hover, button.list-group-item-info:hover, a.list-group-item-info:focus, button.list-group-item-info:focus { color: #fff; background-color: #43c0cf; } a.list-group-item-info.active, button.list-group-item-info.active, a.list-group-item-info.active:hover, button.list-group-item-info.active:hover, a.list-group-item-info.active:focus, button.list-group-item-info.active:focus { color: #fff; background-color: #fff; border-color: #fff; } .list-group-item-warning { color: #fff; background-color: #f2a654; } a.list-group-item-warning, button.list-group-item-warning { color: #fff; } a.list-group-item-warning .list-group-item-heading, button.list-group-item-warning .list-group-item-heading { color: inherit; } a.list-group-item-warning:hover, button.list-group-item-warning:hover, a.list-group-item-warning:focus, button.list-group-item-warning:focus { color: #fff; background-color: #f09a3c; } a.list-group-item-warning.active, button.list-group-item-warning.active, a.list-group-item-warning.active:hover, button.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus, button.list-group-item-warning.active:focus { color: #fff; background-color: #fff; border-color: #fff; } .list-group-item-danger { color: #fff; background-color: #f96868; } a.list-group-item-danger, button.list-group-item-danger { color: #fff; } a.list-group-item-danger .list-group-item-heading, button.list-group-item-danger .list-group-item-heading { color: inherit; } a.list-group-item-danger:hover, button.list-group-item-danger:hover, a.list-group-item-danger:focus, button.list-group-item-danger:focus { color: #fff; background-color: #f84f4f; } a.list-group-item-danger.active, button.list-group-item-danger.active, a.list-group-item-danger.active:hover, button.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus, button.list-group-item-danger.active:focus { color: #fff; background-color: #fff; border-color: #fff; } .panel { background-color: #fff; } .panel-footer { background-color: transparent; border-top: 1px solid #e4eaec; } .panel > .panel-body + .table, .panel > .panel-body + .table-responsive, .panel > .table + .panel-body, .panel > .table-responsive + .panel-body { border-top: 1px solid #e4eaec; } .panel-group .panel-footer + .panel-collapse .panel-body { border-bottom: 1px solid #e4eaec; } .panel-default { border-color: #e4eaec; } .panel-default > .panel-heading { color: #76838f; background-color: #e4eaec; border-color: #e4eaec; } .panel-default > .panel-heading + .panel-collapse > .panel-body { border-top-color: #e4eaec; } .panel-default > .panel-heading .badge { color: #e4eaec; background-color: #76838f; } .panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #e4eaec; } .panel-primary { border-color: #677ae4; } .panel-primary > .panel-heading { color: #fff; background-color: #677ae4; border-color: #677ae4; } .panel-primary > .panel-heading + .panel-collapse > .panel-body { border-top-color: #677ae4; } .panel-primary > .panel-heading .badge { color: #677ae4; background-color: #fff; } .panel-primary > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #677ae4; } .panel-success { border-color: #3dae6a; } .panel-success > .panel-heading { color: #fff; background-color: #46be8a; border-color: #3dae6a; } .panel-success > .panel-heading + .panel-collapse > .panel-body { border-top-color: #3dae6a; } .panel-success > .panel-heading .badge { color: #46be8a; background-color: #fff; } .panel-success > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #3dae6a; } .panel-info { border-color: #3bcdc4; } .panel-info > .panel-heading { color: #fff; background-color: #57c7d4; border-color: #3bcdc4; } .panel-info > .panel-heading + .panel-collapse > .panel-body { border-top-color: #3bcdc4; } .panel-info > .panel-heading .badge { color: #57c7d4; background-color: #fff; } .panel-info > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #3bcdc4; } .panel-warning { border-color: #f18246; } .panel-warning > .panel-heading { color: #fff; background-color: #f2a654; border-color: #f18246; } .panel-warning > .panel-heading + .panel-collapse > .panel-body { border-top-color: #f18246; } .panel-warning > .panel-heading .badge { color: #f2a654; background-color: #fff; } .panel-warning > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #f18246; } .panel-danger { border-color: #f85974; } .panel-danger > .panel-heading { color: #fff; background-color: #f96868; border-color: #f85974; } .panel-danger > .panel-heading + .panel-collapse > .panel-body { border-top-color: #f85974; } .panel-danger > .panel-heading .badge { color: #f96868; background-color: #fff; } .panel-danger > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #f85974; } .well { background-color: #f3f7f9; border: 1px solid #e4eaec; } .close { color: #000; text-shadow: none; } .close:hover, .close:focus { color: #000; } .modal-content { background-color: #fff; border: 1px solid #999; border: 1px solid transparent; } .modal-backdrop { background-color: #000; } .modal-header { border-bottom: 1px solid #e4eaec; } .modal-footer { border-top: 1px solid #e4eaec; } .tooltip-inner { color: #fff; background-color: rgba(0, 0, 0, .8); } .tooltip.top .tooltip-arrow { border-top-color: rgba(0, 0, 0, .8); } .tooltip.top-left .tooltip-arrow { border-top-color: rgba(0, 0, 0, .8); } .tooltip.top-right .tooltip-arrow { border-top-color: rgba(0, 0, 0, .8); } .tooltip.right .tooltip-arrow { border-right-color: rgba(0, 0, 0, .8); } .tooltip.left .tooltip-arrow { border-left-color: rgba(0, 0, 0, .8); } .tooltip.bottom .tooltip-arrow { border-bottom-color: rgba(0, 0, 0, .8); } .tooltip.bottom-left .tooltip-arrow { border-bottom-color: rgba(0, 0, 0, .8); } .tooltip.bottom-right .tooltip-arrow { border-bottom-color: rgba(0, 0, 0, .8); } .popover { background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #e4eaec; border: 1px solid rgba(204, 213, 219, .8); } .popover-title { background-color: #f3f7f9; border-bottom: 1px solid #e2ecf1; } .popover.top > .arrow { border-top-color: #a8bbc2; border-top-color: rgba(204, 213, 219, .85); } .popover.top > .arrow:after { border-top-color: #fff; } .popover.right > .arrow { border-right-color: #a8bbc2; border-right-color: rgba(204, 213, 219, .85); } .popover.right > .arrow:after { border-right-color: #fff; } .popover.bottom > .arrow { border-bottom-color: #a8bbc2; border-bottom-color: rgba(204, 213, 219, .85); } .popover.bottom > .arrow:after { border-bottom-color: #fff; } .popover.left > .arrow { border-left-color: #a8bbc2; border-left-color: rgba(204, 213, 219, .85); } .popover.left > .arrow:after { border-left-color: #fff; } .carousel-control { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); } .carousel-control:hover, .carousel-control:focus { color: #fff; } .carousel-indicators li { border: 1px solid #fff; } .carousel-indicators .active { background-color: #fff; } .carousel-caption { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); } a.text-action { color: #a3afb7; } a.text-action, a.text-action:hover, a.text-action:focus { text-decoration: none; } a.text-action:hover, a.text-action:focus { color: #ccd5db; } a.text-like { color: #a3afb7 !important; } a.text-like, a.text-like:hover, a.text-like:focus { text-decoration: none; } a.text-like.active, a.text-like:hover, a.text-like:focus { color: #f96868 !important; } .img-bordered { border: 1px solid #e4eaec; } .img-bordered-primary { border-color: #677ae4 !important; } .img-bordered-purple { border-color: #7c51d1 !important; } .img-bordered-red { border-color: #e9595b !important; } .img-bordered-green { border-color: #7dd3ae !important; } .img-bordered-orange { border-color: #ec9940 !important; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { text-shadow: rgba(0, 0, 0, .15) 0 0 1px; } mark, .mark { color: #fff; } .drop-cap { color: #263238; } .drop-cap-reversed { color: #fff; background-color: #263238; } .text-primary { color: #677ae4; } a.text-primary:hover, a.text-primary:focus { color: #3c54dc; } .text-success { color: #46be8a; } a.text-success:hover, a.text-success:focus { color: #369b6f; } .text-info { color: #57c7d4; } a.text-info:hover, a.text-info:focus { color: #33b6c5; } .text-warning { color: #f2a654; } a.text-warning:hover, a.text-warning:focus { color: #ee8d25; } .text-danger { color: #f96868; } a.text-danger:hover, a.text-danger:focus { color: #f73737; } blockquote { color: #526069; border-left-width: 2px; } .blockquote-reverse { border-right-width: 2px; } .blockquote { border-left-width: 4px; } .blockquote.blockquote-reverse { border-right-width: 4px; } .blockquote-success { background-color: rgba(70, 190, 138, .1); border-color: #46be8a; } .blockquote-info { background-color: rgba(87, 199, 212, .1); border-color: #57c7d4; } .blockquote-warning { background-color: rgba(242, 166, 84, .1); border-color: #f2a654; } .blockquote-danger { background-color: rgba(249, 104, 104, .1); border-color: #f96868; } code { border: 1px solid #bcc5f4; } .table { color: #76838f; } .table > thead > tr > th, .table > tfoot > tr > th { color: #526069; } .table > thead > tr > th { border-bottom: 1px solid #e4eaec; } .table > tbody + tbody { border-top: 1px solid #e4eaec; } .table .success, .table .warning, .table .danger, .table .info { color: #fff; } .table .success a, .table .warning a, .table .danger a, .table .info a { color: #fff; } .table-primary thead tr, .table-success thead tr, .table-info thead tr, .table-warning thead tr, .table-danger thead tr, .table-dark thead tr { color: #fff; } .table-default thead tr { background: #f3f7f9; } .table-primary thead tr { background: #677ae4; } .table-success thead tr { background: #46be8a; } .table-info thead tr { background: #57c7d4; } .table-warning thead tr { background: #f2a654; } .table-danger thead tr { background: #f96868; } .table-dark thead tr { background: #526069; } .table-gray thead tr { color: #526069; background: #ccd5db; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 1px; } .table-bordered > thead:first-child > tr:first-child > th { border: 1px solid #e4eaec; } .table-section.active tr { background-color: #f3f7f9; } .form-control { -webkit-box-shadow: none; box-shadow: none; } .form-control:not(select) { -webkit-appearance: none; } .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline, .has-success.radio label, .has-success.checkbox label, .has-success.radio-inline label, .has-success.checkbox-inline label { color: #46be8a; } .has-success .form-control { border-color: #46be8a; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-success .form-control:focus { border-color: #369b6f; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #91d9ba; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #91d9ba; } .has-success .input-group-addon { color: #46be8a; background-color: #fff; border-color: #46be8a; } .has-success .form-control-feedback { color: #46be8a; } .has-success .form-control { -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } .has-success .form-control:focus { border-color: #46be8a; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(70, 190, 138, .6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(70, 190, 138, .6); } .has-success .form-control.focus, .has-success .form-control:focus { border-color: #46be8a; -webkit-box-shadow: none; box-shadow: none; } .has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline, .has-warning.radio label, .has-warning.checkbox label, .has-warning.radio-inline label, .has-warning.checkbox-inline label { color: #f2a654; } .has-warning .form-control { border-color: #f2a654; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-warning .form-control:focus { border-color: #ee8d25; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #f9d7b3; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #f9d7b3; } .has-warning .input-group-addon { color: #f2a654; background-color: #fff; border-color: #f2a654; } .has-warning .form-control-feedback { color: #f2a654; } .has-warning .form-control { -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } .has-warning .form-control:focus { border-color: #f2a654; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(242, 166, 84, .6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(242, 166, 84, .6); } .has-warning .form-control.focus, .has-warning .form-control:focus { border-color: #f2a654; -webkit-box-shadow: none; box-shadow: none; } .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline, .has-error.radio label, .has-error.checkbox label, .has-error.radio-inline label, .has-error.checkbox-inline label { color: #f96868; } .has-error .form-control { border-color: #f96868; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-error .form-control:focus { border-color: #f73737; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #fdcaca; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #fdcaca; } .has-error .input-group-addon { color: #f96868; background-color: #fff; border-color: #f96868; } .has-error .form-control-feedback { color: #f96868; } .has-error .form-control { -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } .has-error .form-control:focus { border-color: #f96868; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(249, 104, 104, .6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(249, 104, 104, .6); } .has-error .form-control.focus, .has-error .form-control:focus { border-color: #f96868; -webkit-box-shadow: none; box-shadow: none; } .input-group-file input[type="text"] { background-color: #fff; } .input-group-file .btn-file.btn-outline { border: 1px solid #e4eaec; border-left: none; } .input-group-file .btn-file.btn-outline:hover { border-left: none; } .input-search-close { color: #000; text-shadow: none; } .input-search-close:hover, .input-search-close:focus { color: #000; text-decoration: none; } button.input-search-close { -webkit-appearance: none; background: transparent; border: 0; } .input-search .input-search-icon { color: #a3afb7; } .input-search-btn { background: transparent; border: none; } .input-search-dark .input-search-icon { color: #76838f; } .input-search-dark .form-control { background: #f3f7f9; -webkit-box-shadow: none; box-shadow: none; } .input-search-dark .form-control:focus { background-color: transparent; } /*@btn-floating-xs-padding: 10px;*/ /*@btn-floating-sm-padding: 13px;*/ /*@btn-floating-lg-padding: 15px;*/ .btn:focus, .btn:active:focus, .btn.active:focus { outline: 0; } .btn:active, .btn.active { -webkit-box-shadow: none; box-shadow: none; } .btn-outline.btn-default { color: #76838f; background-color: transparent; } .btn-outline.btn-default:hover, .btn-outline.btn-default:focus, .btn-outline.btn-default:active, .btn-outline.btn-default.active, .open > .dropdown-toggle.btn-outline.btn-default { color: #76838f; background-color: rgba(118, 131, 143, .1); border-color: #e4eaec; } .btn-outline.btn-default:hover .badge, .btn-outline.btn-default:focus .badge, .btn-outline.btn-default:active .badge, .btn-outline.btn-default.active .badge, .open > .dropdown-toggle.btn-outline.btn-default .badge { color: #76838f; background-color: #76838f; } .btn-outline.btn-primary { color: #677ae4; background-color: transparent; } .btn-outline.btn-primary:hover, .btn-outline.btn-primary:focus, .btn-outline.btn-primary:active, .btn-outline.btn-primary.active, .open > .dropdown-toggle.btn-outline.btn-primary { color: #fff; background-color: #677ae4; border-color: #677ae4; } .btn-outline.btn-primary:hover .badge, .btn-outline.btn-primary:focus .badge, .btn-outline.btn-primary:active .badge, .btn-outline.btn-primary.active .badge, .open > .dropdown-toggle.btn-outline.btn-primary .badge { color: #677ae4; background-color: #fff; } .btn-outline.btn-success { color: #46be8a; background-color: transparent; } .btn-outline.btn-success:hover, .btn-outline.btn-success:focus, .btn-outline.btn-success:active, .btn-outline.btn-success.active, .open > .dropdown-toggle.btn-outline.btn-success { color: #fff; background-color: #46be8a; border-color: #46be8a; } .btn-outline.btn-success:hover .badge, .btn-outline.btn-success:focus .badge, .btn-outline.btn-success:active .badge, .btn-outline.btn-success.active .badge, .open > .dropdown-toggle.btn-outline.btn-success .badge { color: #46be8a; background-color: #fff; } .btn-outline.btn-info { color: #57c7d4; background-color: transparent; } .btn-outline.btn-info:hover, .btn-outline.btn-info:focus, .btn-outline.btn-info:active, .btn-outline.btn-info.active, .open > .dropdown-toggle.btn-outline.btn-info { color: #fff; background-color: #57c7d4; border-color: #57c7d4; } .btn-outline.btn-info:hover .badge, .btn-outline.btn-info:focus .badge, .btn-outline.btn-info:active .badge, .btn-outline.btn-info.active .badge, .open > .dropdown-toggle.btn-outline.btn-info .badge { color: #57c7d4; background-color: #fff; } .btn-outline.btn-warning { color: #f2a654; background-color: transparent; } .btn-outline.btn-warning:hover, .btn-outline.btn-warning:focus, .btn-outline.btn-warning:active, .btn-outline.btn-warning.active, .open > .dropdown-toggle.btn-outline.btn-warning { color: #fff; background-color: #f2a654; border-color: #f2a654; } .btn-outline.btn-warning:hover .badge, .btn-outline.btn-warning:focus .badge, .btn-outline.btn-warning:active .badge, .btn-outline.btn-warning.active .badge, .open > .dropdown-toggle.btn-outline.btn-warning .badge { color: #f2a654; background-color: #fff; } .btn-outline.btn-danger { color: #f96868; background-color: transparent; } .btn-outline.btn-danger:hover, .btn-outline.btn-danger:focus, .btn-outline.btn-danger:active, .btn-outline.btn-danger.active, .open > .dropdown-toggle.btn-outline.btn-danger { color: #fff; background-color: #f96868; border-color: #f96868; } .btn-outline.btn-danger:hover .badge, .btn-outline.btn-danger:focus .badge, .btn-outline.btn-danger:active .badge, .btn-outline.btn-danger.active .badge, .open > .dropdown-toggle.btn-outline.btn-danger .badge { color: #f96868; background-color: #fff; } .btn-outline.btn-dark { color: #526069; background-color: transparent; } .btn-outline.btn-dark:hover, .btn-outline.btn-dark:focus, .btn-outline.btn-dark:active, .btn-outline.btn-dark.active, .open > .dropdown-toggle.btn-outline.btn-dark { color: #fff; background-color: #526069; border-color: #526069; } .btn-outline.btn-dark:hover .badge, .btn-outline.btn-dark:focus .badge, .btn-outline.btn-dark:active .badge, .btn-outline.btn-dark.active .badge, .open > .dropdown-toggle.btn-outline.btn-dark .badge { color: #526069; background-color: #fff; } .btn-outline.btn-inverse { color: #fff; background-color: transparent; } .btn-outline.btn-inverse:hover, .btn-outline.btn-inverse:focus, .btn-outline.btn-inverse:active, .btn-outline.btn-inverse.active, .open > .dropdown-toggle.btn-outline.btn-inverse { color: #76838f; background-color: #fff; border-color: #fff; } .btn-outline.btn-inverse:hover .badge, .btn-outline.btn-inverse:focus .badge, .btn-outline.btn-inverse:active .badge, .btn-outline.btn-inverse.active .badge, .open > .dropdown-toggle.btn-outline.btn-inverse .badge { color: #fff; background-color: #76838f; } .btn-default:hover, .btn-default:focus, .btn-default.focus { background-color: #f3f7f9; border-color: #f3f7f9; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { background-color: #ccd5db; border-color: #ccd5db; } .btn-default:active:hover, .btn-default.active:hover, .open > .dropdown-toggle.btn-default:hover, .btn-default:active:focus, .btn-default.active:focus, .open > .dropdown-toggle.btn-default:focus, .btn-default:active.focus, .btn-default.active.focus, .open > .dropdown-toggle.btn-default.focus { background-color: #ccd5db; border-color: #ccd5db; } .btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active { color: #76838f; background-color: #f3f7f9; border-color: #f3f7f9; } .btn-default.btn-up:before { border-bottom-color: #e4eaec; } .btn-default.btn-up:hover:before, .btn-default.btn-up:focus:before { border-bottom-color: #f3f7f9; } .btn-default.btn-up:active:before, .btn-default.btn-up.active:before, .open > .dropdown-toggle.btn-default.btn-up:before { border-bottom-color: #ccd5db; } .btn-default.btn-right:before { border-left-color: #e4eaec; } .btn-default.btn-right:hover:before, .btn-default.btn-right:focus:before { border-left-color: #f3f7f9; } .btn-default.btn-right:active:before, .btn-default.btn-right.active:before, .open > .dropdown-toggle.btn-default.btn-right:before { border-left-color: #ccd5db; } .btn-default.btn-bottom:before { border-top-color: #e4eaec; } .btn-default.btn-bottom:hover:before, .btn-default.btn-bottom:focus:before { border-top-color: #f3f7f9; } .btn-default.btn-bottom:active:before, .btn-default.btn-bottom.active:before, .open > .dropdown-toggle.btn-default.btn-bottom:before { border-top-color: #ccd5db; } .btn-default.btn-left:before { border-right-color: #e4eaec; } .btn-default.btn-left:hover:before, .btn-default.btn-left:focus:before { border-right-color: #f3f7f9; } .btn-default.btn-left:active:before, .btn-default.btn-left.active:before, .open > .dropdown-toggle.btn-default.btn-left:before { border-right-color: #ccd5db; } .btn-primary:hover, .btn-primary:focus, .btn-primary.focus { background-color: #8897ec; border-color: #8897ec; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { background-color: #5166d6; border-color: #5166d6; } .btn-primary:active:hover, .btn-primary.active:hover, .open > .dropdown-toggle.btn-primary:hover, .btn-primary:active:focus, .btn-primary.active:focus, .open > .dropdown-toggle.btn-primary:focus, .btn-primary:active.focus, .btn-primary.active.focus, .open > .dropdown-toggle.btn-primary.focus { background-color: #5166d6; border-color: #5166d6; } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { color: #fff; background-color: #9daaf3; border-color: #9daaf3; } .btn-primary.btn-up:before { border-bottom-color: #677ae4; } .btn-primary.btn-up:hover:before, .btn-primary.btn-up:focus:before { border-bottom-color: #8897ec; } .btn-primary.btn-up:active:before, .btn-primary.btn-up.active:before, .open > .dropdown-toggle.btn-primary.btn-up:before { border-bottom-color: #5166d6; } .btn-primary.btn-right:before { border-left-color: #677ae4; } .btn-primary.btn-right:hover:before, .btn-primary.btn-right:focus:before { border-left-color: #8897ec; } .btn-primary.btn-right:active:before, .btn-primary.btn-right.active:before, .open > .dropdown-toggle.btn-primary.btn-right:before { border-left-color: #5166d6; } .btn-primary.btn-bottom:before { border-top-color: #677ae4; } .btn-primary.btn-bottom:hover:before, .btn-primary.btn-bottom:focus:before { border-top-color: #8897ec; } .btn-primary.btn-bottom:active:before, .btn-primary.btn-bottom.active:before, .open > .dropdown-toggle.btn-primary.btn-bottom:before { border-top-color: #5166d6; } .btn-primary.btn-left:before { border-right-color: #677ae4; } .btn-primary.btn-left:hover:before, .btn-primary.btn-left:focus:before { border-right-color: #8897ec; } .btn-primary.btn-left:active:before, .btn-primary.btn-left.active:before, .open > .dropdown-toggle.btn-primary.btn-left:before { border-right-color: #5166d6; } .btn-success:hover, .btn-success:focus, .btn-success.focus { background-color: #5cd29d; border-color: #5cd29d; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { background-color: #36ab7a; border-color: #36ab7a; } .btn-success:active:hover, .btn-success.active:hover, .open > .dropdown-toggle.btn-success:hover, .btn-success:active:focus, .btn-success.active:focus, .open > .dropdown-toggle.btn-success:focus, .btn-success:active.focus, .btn-success.active.focus, .open > .dropdown-toggle.btn-success.focus { background-color: #36ab7a; border-color: #36ab7a; } .btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled.focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success.focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active { color: #fff; background-color: #7dd3ae; border-color: #7dd3ae; } .btn-success.btn-up:before { border-bottom-color: #46be8a; } .btn-success.btn-up:hover:before, .btn-success.btn-up:focus:before { border-bottom-color: #5cd29d; } .btn-success.btn-up:active:before, .btn-success.btn-up.active:before, .open > .dropdown-toggle.btn-success.btn-up:before { border-bottom-color: #36ab7a; } .btn-success.btn-right:before { border-left-color: #46be8a; } .btn-success.btn-right:hover:before, .btn-success.btn-right:focus:before { border-left-color: #5cd29d; } .btn-success.btn-right:active:before, .btn-success.btn-right.active:before, .open > .dropdown-toggle.btn-success.btn-right:before { border-left-color: #36ab7a; } .btn-success.btn-bottom:before { border-top-color: #46be8a; } .btn-success.btn-bottom:hover:before, .btn-success.btn-bottom:focus:before { border-top-color: #5cd29d; } .btn-success.btn-bottom:active:before, .btn-success.btn-bottom.active:before, .open > .dropdown-toggle.btn-success.btn-bottom:before { border-top-color: #36ab7a; } .btn-success.btn-left:before { border-right-color: #46be8a; } .btn-success.btn-left:hover:before, .btn-success.btn-left:focus:before { border-right-color: #5cd29d; } .btn-success.btn-left:active:before, .btn-success.btn-left.active:before, .open > .dropdown-toggle.btn-success.btn-left:before { border-right-color: #36ab7a; } .btn-info:hover, .btn-info:focus, .btn-info.focus { background-color: #77d6e1; border-color: #77d6e1; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { background-color: #47b8c6; border-color: #47b8c6; } .btn-info:active:hover, .btn-info.active:hover, .open > .dropdown-toggle.btn-info:hover, .btn-info:active:focus, .btn-info.active:focus, .open > .dropdown-toggle.btn-info:focus, .btn-info:active.focus, .btn-info.active.focus, .open > .dropdown-toggle.btn-info.focus { background-color: #47b8c6; border-color: #47b8c6; } .btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled.focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info.focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active { color: #fff; background-color: #9ae1e9; border-color: #9ae1e9; } .btn-info.btn-up:before { border-bottom-color: #57c7d4; } .btn-info.btn-up:hover:before, .btn-info.btn-up:focus:before { border-bottom-color: #77d6e1; } .btn-info.btn-up:active:before, .btn-info.btn-up.active:before, .open > .dropdown-toggle.btn-info.btn-up:before { border-bottom-color: #47b8c6; } .btn-info.btn-right:before { border-left-color: #57c7d4; } .btn-info.btn-right:hover:before, .btn-info.btn-right:focus:before { border-left-color: #77d6e1; } .btn-info.btn-right:active:before, .btn-info.btn-right.active:before, .open > .dropdown-toggle.btn-info.btn-right:before { border-left-color: #47b8c6; } .btn-info.btn-bottom:before { border-top-color: #57c7d4; } .btn-info.btn-bottom:hover:before, .btn-info.btn-bottom:focus:before { border-top-color: #77d6e1; } .btn-info.btn-bottom:active:before, .btn-info.btn-bottom.active:before, .open > .dropdown-toggle.btn-info.btn-bottom:before { border-top-color: #47b8c6; } .btn-info.btn-left:before { border-right-color: #57c7d4; } .btn-info.btn-left:hover:before, .btn-info.btn-left:focus:before { border-right-color: #77d6e1; } .btn-info.btn-left:active:before, .btn-info.btn-left.active:before, .open > .dropdown-toggle.btn-info.btn-left:before { border-right-color: #47b8c6; } .btn-warning:hover, .btn-warning:focus, .btn-warning.focus { background-color: #f4b066; border-color: #f4b066; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { background-color: #ec9940; border-color: #ec9940; } .btn-warning:active:hover, .btn-warning.active:hover, .open > .dropdown-toggle.btn-warning:hover, .btn-warning:active:focus, .btn-warning.active:focus, .open > .dropdown-toggle.btn-warning:focus, .btn-warning:active.focus, .btn-warning.active.focus, .open > .dropdown-toggle.btn-warning.focus { background-color: #ec9940; border-color: #ec9940; } .btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled.focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning.focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active { color: #fff; background-color: #f6be80; border-color: #f6be80; } .btn-warning.btn-up:before { border-bottom-color: #f2a654; } .btn-warning.btn-up:hover:before, .btn-warning.btn-up:focus:before { border-bottom-color: #f4b066; } .btn-warning.btn-up:active:before, .btn-warning.btn-up.active:before, .open > .dropdown-toggle.btn-warning.btn-up:before { border-bottom-color: #ec9940; } .btn-warning.btn-right:before { border-left-color: #f2a654; } .btn-warning.btn-right:hover:before, .btn-warning.btn-right:focus:before { border-left-color: #f4b066; } .btn-warning.btn-right:active:before, .btn-warning.btn-right.active:before, .open > .dropdown-toggle.btn-warning.btn-right:before { border-left-color: #ec9940; } .btn-warning.btn-bottom:before { border-top-color: #f2a654; } .btn-warning.btn-bottom:hover:before, .btn-warning.btn-bottom:focus:before { border-top-color: #f4b066; } .btn-warning.btn-bottom:active:before, .btn-warning.btn-bottom.active:before, .open > .dropdown-toggle.btn-warning.btn-bottom:before { border-top-color: #ec9940; } .btn-warning.btn-left:before { border-right-color: #f2a654; } .btn-warning.btn-left:hover:before, .btn-warning.btn-left:focus:before { border-right-color: #f4b066; } .btn-warning.btn-left:active:before, .btn-warning.btn-left.active:before, .open > .dropdown-toggle.btn-warning.btn-left:before { border-right-color: #ec9940; } .btn-danger:hover, .btn-danger:focus, .btn-danger.focus { background-color: #fa7a7a; border-color: #fa7a7a; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { background-color: #e9595b; border-color: #e9595b; } .btn-danger:active:hover, .btn-danger.active:hover, .open > .dropdown-toggle.btn-danger:hover, .btn-danger:active:focus, .btn-danger.active:focus, .open > .dropdown-toggle.btn-danger:focus, .btn-danger:active.focus, .btn-danger.active.focus, .open > .dropdown-toggle.btn-danger.focus { background-color: #e9595b; border-color: #e9595b; } .btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled.focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger.focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active { color: #fff; background-color: #fa9898; border-color: #fa9898; } .btn-danger.btn-up:before { border-bottom-color: #f96868; } .btn-danger.btn-up:hover:before, .btn-danger.btn-up:focus:before { border-bottom-color: #fa7a7a; } .btn-danger.btn-up:active:before, .btn-danger.btn-up.active:before, .open > .dropdown-toggle.btn-danger.btn-up:before { border-bottom-color: #e9595b; } .btn-danger.btn-right:before { border-left-color: #f96868; } .btn-danger.btn-right:hover:before, .btn-danger.btn-right:focus:before { border-left-color: #fa7a7a; } .btn-danger.btn-right:active:before, .btn-danger.btn-right.active:before, .open > .dropdown-toggle.btn-danger.btn-right:before { border-left-color: #e9595b; } .btn-danger.btn-bottom:before { border-top-color: #f96868; } .btn-danger.btn-bottom:hover:before, .btn-danger.btn-bottom:focus:before { border-top-color: #fa7a7a; } .btn-danger.btn-bottom:active:before, .btn-danger.btn-bottom.active:before, .open > .dropdown-toggle.btn-danger.btn-bottom:before { border-top-color: #e9595b; } .btn-danger.btn-left:before { border-right-color: #f96868; } .btn-danger.btn-left:hover:before, .btn-danger.btn-left:focus:before { border-right-color: #fa7a7a; } .btn-danger.btn-left:active:before, .btn-danger.btn-left.active:before, .open > .dropdown-toggle.btn-danger.btn-left:before { border-right-color: #e9595b; } .btn-inverse { color: #76838f; background-color: #fff; border-color: #e4eaec; } .btn-inverse:focus, .btn-inverse.focus { color: #76838f; background-color: #e6e6e6; border-color: #99b0b7; } .btn-inverse:hover { color: #76838f; background-color: #e6e6e6; border-color: #c0ced3; } .btn-inverse:active, .btn-inverse.active, .open > .dropdown-toggle.btn-inverse { color: #76838f; background-color: #e6e6e6; border-color: #c0ced3; } .btn-inverse:active:hover, .btn-inverse.active:hover, .open > .dropdown-toggle.btn-inverse:hover, .btn-inverse:active:focus, .btn-inverse.active:focus, .open > .dropdown-toggle.btn-inverse:focus, .btn-inverse:active.focus, .btn-inverse.active.focus, .open > .dropdown-toggle.btn-inverse.focus { color: #76838f; background-color: #d4d4d4; border-color: #99b0b7; } .btn-inverse:active, .btn-inverse.active, .open > .dropdown-toggle.btn-inverse { background-image: none; } .btn-inverse.disabled:hover, .btn-inverse[disabled]:hover, fieldset[disabled] .btn-inverse:hover, .btn-inverse.disabled:focus, .btn-inverse[disabled]:focus, fieldset[disabled] .btn-inverse:focus, .btn-inverse.disabled.focus, .btn-inverse[disabled].focus, fieldset[disabled] .btn-inverse.focus { background-color: #fff; border-color: #e4eaec; } .btn-inverse .badge { color: #fff; background-color: #76838f; } .btn-inverse:hover, .btn-inverse:focus, .btn-inverse.focus { background-color: #fff; border-color: #f3f7f9; } .btn-inverse:active, .btn-inverse.active, .open > .dropdown-toggle.btn-inverse { background-color: #fff; border-color: #ccd5db; } .btn-inverse:active:hover, .btn-inverse.active:hover, .open > .dropdown-toggle.btn-inverse:hover, .btn-inverse:active:focus, .btn-inverse.active:focus, .open > .dropdown-toggle.btn-inverse:focus, .btn-inverse:active.focus, .btn-inverse.active.focus, .open > .dropdown-toggle.btn-inverse.focus { background-color: #fff; border-color: #ccd5db; } .btn-inverse.disabled, .btn-inverse[disabled], fieldset[disabled] .btn-inverse, .btn-inverse.disabled:hover, .btn-inverse[disabled]:hover, fieldset[disabled] .btn-inverse:hover, .btn-inverse.disabled:focus, .btn-inverse[disabled]:focus, fieldset[disabled] .btn-inverse:focus, .btn-inverse.disabled.focus, .btn-inverse[disabled].focus, fieldset[disabled] .btn-inverse.focus, .btn-inverse.disabled:active, .btn-inverse[disabled]:active, fieldset[disabled] .btn-inverse:active, .btn-inverse.disabled.active, .btn-inverse[disabled].active, fieldset[disabled] .btn-inverse.active { color: #ccd5db; background-color: #fff; border-color: #a3afb7; } .btn-inverse.btn-up:before { border-bottom-color: #fff; } .btn-inverse.btn-up:hover:before, .btn-inverse.btn-up:focus:before { border-bottom-color: #fff; } .btn-inverse.btn-up:active:before, .btn-inverse.btn-up.active:before, .open > .dropdown-toggle.btn-inverse.btn-up:before { border-bottom-color: #fff; } .btn-inverse.btn-right:before { border-left-color: #fff; } .btn-inverse.btn-right:hover:before, .btn-inverse.btn-right:focus:before { border-left-color: #fff; } .btn-inverse.btn-right:active:before, .btn-inverse.btn-right.active:before, .open > .dropdown-toggle.btn-inverse.btn-right:before { border-left-color: #fff; } .btn-inverse.btn-bottom:before { border-top-color: #fff; } .btn-inverse.btn-bottom:hover:before, .btn-inverse.btn-bottom:focus:before { border-top-color: #fff; } .btn-inverse.btn-bottom:active:before, .btn-inverse.btn-bottom.active:before, .open > .dropdown-toggle.btn-inverse.btn-bottom:before { border-top-color: #fff; } .btn-inverse.btn-left:before { border-right-color: #fff; } .btn-inverse.btn-left:hover:before, .btn-inverse.btn-left:focus:before { border-right-color: #fff; } .btn-inverse.btn-left:active:before, .btn-inverse.btn-left.active:before, .open > .dropdown-toggle.btn-inverse.btn-left:before { border-right-color: #fff; } .btn-dark { color: #fff; background-color: #526069; border-color: #526069; } .btn-dark:focus, .btn-dark.focus { color: #fff; background-color: #3c464c; border-color: #1a1f21; } .btn-dark:hover { color: #fff; background-color: #3c464c; border-color: #374147; } .btn-dark:active, .btn-dark.active, .open > .dropdown-toggle.btn-dark { color: #fff; background-color: #3c464c; border-color: #374147; } .btn-dark:active:hover, .btn-dark.active:hover, .open > .dropdown-toggle.btn-dark:hover, .btn-dark:active:focus, .btn-dark.active:focus, .open > .dropdown-toggle.btn-dark:focus, .btn-dark:active.focus, .btn-dark.active.focus, .open > .dropdown-toggle.btn-dark.focus { color: #fff; background-color: #2c3338; border-color: #1a1f21; } .btn-dark:active, .btn-dark.active, .open > .dropdown-toggle.btn-dark { background-image: none; } .btn-dark.disabled:hover, .btn-dark[disabled]:hover, fieldset[disabled] .btn-dark:hover, .btn-dark.disabled:focus, .btn-dark[disabled]:focus, fieldset[disabled] .btn-dark:focus, .btn-dark.disabled.focus, .btn-dark[disabled].focus, fieldset[disabled] .btn-dark.focus { background-color: #526069; border-color: #526069; } .btn-dark .badge { color: #526069; background-color: #fff; } .btn-dark:hover, .btn-dark:focus, .btn-dark.focus { background-color: #76838f; border-color: #76838f; } .btn-dark:active, .btn-dark.active, .open > .dropdown-toggle.btn-dark { background-color: #37474f; border-color: #37474f; } .btn-dark:active:hover, .btn-dark.active:hover, .open > .dropdown-toggle.btn-dark:hover, .btn-dark:active:focus, .btn-dark.active:focus, .open > .dropdown-toggle.btn-dark:focus, .btn-dark:active.focus, .btn-dark.active.focus, .open > .dropdown-toggle.btn-dark.focus { background-color: #37474f; border-color: #37474f; } .btn-dark.disabled, .btn-dark[disabled], fieldset[disabled] .btn-dark, .btn-dark.disabled:hover, .btn-dark[disabled]:hover, fieldset[disabled] .btn-dark:hover, .btn-dark.disabled:focus, .btn-dark[disabled]:focus, fieldset[disabled] .btn-dark:focus, .btn-dark.disabled.focus, .btn-dark[disabled].focus, fieldset[disabled] .btn-dark.focus, .btn-dark.disabled:active, .btn-dark[disabled]:active, fieldset[disabled] .btn-dark:active, .btn-dark.disabled.active, .btn-dark[disabled].active, fieldset[disabled] .btn-dark.active { color: #fff; background-color: #a3afb7; border-color: #a3afb7; } .btn-dark.btn-up:before { border-bottom-color: #526069; } .btn-dark.btn-up:hover:before, .btn-dark.btn-up:focus:before { border-bottom-color: #76838f; } .btn-dark.btn-up:active:before, .btn-dark.btn-up.active:before, .open > .dropdown-toggle.btn-dark.btn-up:before { border-bottom-color: #37474f; } .btn-dark.btn-right:before { border-left-color: #526069; } .btn-dark.btn-right:hover:before, .btn-dark.btn-right:focus:before { border-left-color: #76838f; } .btn-dark.btn-right:active:before, .btn-dark.btn-right.active:before, .open > .dropdown-toggle.btn-dark.btn-right:before { border-left-color: #37474f; } .btn-dark.btn-bottom:before { border-top-color: #526069; } .btn-dark.btn-bottom:hover:before, .btn-dark.btn-bottom:focus:before { border-top-color: #76838f; } .btn-dark.btn-bottom:active:before, .btn-dark.btn-bottom.active:before, .open > .dropdown-toggle.btn-dark.btn-bottom:before { border-top-color: #37474f; } .btn-dark.btn-left:before { border-right-color: #526069; } .btn-dark.btn-left:hover:before, .btn-dark.btn-left:focus:before { border-right-color: #76838f; } .btn-dark.btn-left:active:before, .btn-dark.btn-left.active:before, .open > .dropdown-toggle.btn-dark.btn-left:before { border-right-color: #37474f; } .btn-dark:hover, .btn-dark:focus { color: #fff; } .btn-dark:active, .btn-dark.active, .open > .dropdown-toggle.btn-dark { color: #fff; } .btn-dark.btn-flat { color: #526069; } .btn-flat { background: none; border: none; -webkit-box-shadow: none; box-shadow: none; } .btn-flat.disabled { color: #a3afb7; } .btn-raised { -webkit-box-shadow: 0 0 2px rgba(0, 0, 0, .18), 0 2px 4px rgba(0, 0, 0, .21); box-shadow: 0 0 2px rgba(0, 0, 0, .18), 0 2px 4px rgba(0, 0, 0, .21); -webkit-transition: -webkit-box-shadow .25s cubic-bezier(.4, 0, .2, 1); -o-transition: box-shadow .25s cubic-bezier(.4, 0, .2, 1); transition: box-shadow .25s cubic-bezier(.4, 0, .2, 1); } .btn-raised:hover, .btn-raised:active, .btn-raised.active, .open > .dropdown-toggle.btn-raised { -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, .15), 0 3px 6px rgba(0, 0, 0, .2); box-shadow: 0 0 3px rgba(0, 0, 0, .15), 0 3px 6px rgba(0, 0, 0, .2); } .btn-raised.disabled, .btn-raised[disabled], fieldset[disabled] .btn-raised { -webkit-box-shadow: none; box-shadow: none; } .btn-label { background-color: rgba(0, 0, 0, .15); } .btn-direction:before { border: 8px solid transparent; } .btn-up:before { border-bottom-color: #e4eaec; } .btn-right:before { border-left-color: #e4eaec; } .btn-bottom:before { border-top-color: #e4eaec; } .btn-left:before { border-right-color: #e4eaec; } .btn-pure, .btn-pure:hover, .btn-pure:focus, .btn-pure:active, .btn-pure.active, .open > .dropdown-toggle.btn-pure, .btn-pure[disabled], fieldset[disabled] .btn-pure { background-color: transparent; border-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .btn-pure:hover, .btn-pure:hover:hover, .btn-pure:focus:hover, .btn-pure:active:hover, .btn-pure.active:hover, .open > .dropdown-toggle.btn-pure:hover, .btn-pure[disabled]:hover, fieldset[disabled] .btn-pure:hover, .btn-pure:focus, .btn-pure:hover:focus, .btn-pure:focus:focus, .btn-pure:active:focus, .btn-pure.active:focus, .open > .dropdown-toggle.btn-pure:focus, .btn-pure[disabled]:focus, fieldset[disabled] .btn-pure:focus, .btn-pure.focus, .btn-pure:hover.focus, .btn-pure:focus.focus, .btn-pure:active.focus, .btn-pure.active.focus, .open > .dropdown-toggle.btn-pure.focus, .btn-pure[disabled].focus, fieldset[disabled] .btn-pure.focus { background-color: transparent; border-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .btn-pure.btn-default { color: #a3afb7; } .btn-pure.btn-default:hover, .btn-pure.btn-default:focus, .btn-pure.btn-default:active, .btn-pure.btn-default.active, .open > .dropdown-toggle.btn-pure.btn-default { color: #ccd5db; } .btn-pure.btn-default:hover:hover, .btn-pure.btn-default:focus:hover, .btn-pure.btn-default:active:hover, .btn-pure.btn-default.active:hover, .open > .dropdown-toggle.btn-pure.btn-default:hover, .btn-pure.btn-default:hover:focus, .btn-pure.btn-default:focus:focus, .btn-pure.btn-default:active:focus, .btn-pure.btn-default.active:focus, .open > .dropdown-toggle.btn-pure.btn-default:focus, .btn-pure.btn-default:hover.focus, .btn-pure.btn-default:focus.focus, .btn-pure.btn-default:active.focus, .btn-pure.btn-default.active.focus, .open > .dropdown-toggle.btn-pure.btn-default.focus { color: #ccd5db; } .btn-pure.btn-default:hover .badge, .btn-pure.btn-default:focus .badge, .btn-pure.btn-default:active .badge, .btn-pure.btn-default.active .badge, .open > .dropdown-toggle.btn-pure.btn-default .badge { color: #ccd5db; } .btn-pure.btn-primary { color: #677ae4; } .btn-pure.btn-primary:hover, .btn-pure.btn-primary:focus, .btn-pure.btn-primary:active, .btn-pure.btn-primary.active, .open > .dropdown-toggle.btn-pure.btn-primary { color: #9daaf3; } .btn-pure.btn-primary:hover:hover, .btn-pure.btn-primary:focus:hover, .btn-pure.btn-primary:active:hover, .btn-pure.btn-primary.active:hover, .open > .dropdown-toggle.btn-pure.btn-primary:hover, .btn-pure.btn-primary:hover:focus, .btn-pure.btn-primary:focus:focus, .btn-pure.btn-primary:active:focus, .btn-pure.btn-primary.active:focus, .open > .dropdown-toggle.btn-pure.btn-primary:focus, .btn-pure.btn-primary:hover.focus, .btn-pure.btn-primary:focus.focus, .btn-pure.btn-primary:active.focus, .btn-pure.btn-primary.active.focus, .open > .dropdown-toggle.btn-pure.btn-primary.focus { color: #9daaf3; } .btn-pure.btn-primary:hover .badge, .btn-pure.btn-primary:focus .badge, .btn-pure.btn-primary:active .badge, .btn-pure.btn-primary.active .badge, .open > .dropdown-toggle.btn-pure.btn-primary .badge { color: #9daaf3; } .btn-pure.btn-success { color: #46be8a; } .btn-pure.btn-success:hover, .btn-pure.btn-success:focus, .btn-pure.btn-success:active, .btn-pure.btn-success.active, .open > .dropdown-toggle.btn-pure.btn-success { color: #7dd3ae; } .btn-pure.btn-success:hover:hover, .btn-pure.btn-success:focus:hover, .btn-pure.btn-success:active:hover, .btn-pure.btn-success.active:hover, .open > .dropdown-toggle.btn-pure.btn-success:hover, .btn-pure.btn-success:hover:focus, .btn-pure.btn-success:focus:focus, .btn-pure.btn-success:active:focus, .btn-pure.btn-success.active:focus, .open > .dropdown-toggle.btn-pure.btn-success:focus, .btn-pure.btn-success:hover.focus, .btn-pure.btn-success:focus.focus, .btn-pure.btn-success:active.focus, .btn-pure.btn-success.active.focus, .open > .dropdown-toggle.btn-pure.btn-success.focus { color: #7dd3ae; } .btn-pure.btn-success:hover .badge, .btn-pure.btn-success:focus .badge, .btn-pure.btn-success:active .badge, .btn-pure.btn-success.active .badge, .open > .dropdown-toggle.btn-pure.btn-success .badge { color: #7dd3ae; } .btn-pure.btn-info { color: #57c7d4; } .btn-pure.btn-info:hover, .btn-pure.btn-info:focus, .btn-pure.btn-info:active, .btn-pure.btn-info.active, .open > .dropdown-toggle.btn-pure.btn-info { color: #9ae1e9; } .btn-pure.btn-info:hover:hover, .btn-pure.btn-info:focus:hover, .btn-pure.btn-info:active:hover, .btn-pure.btn-info.active:hover, .open > .dropdown-toggle.btn-pure.btn-info:hover, .btn-pure.btn-info:hover:focus, .btn-pure.btn-info:focus:focus, .btn-pure.btn-info:active:focus, .btn-pure.btn-info.active:focus, .open > .dropdown-toggle.btn-pure.btn-info:focus, .btn-pure.btn-info:hover.focus, .btn-pure.btn-info:focus.focus, .btn-pure.btn-info:active.focus, .btn-pure.btn-info.active.focus, .open > .dropdown-toggle.btn-pure.btn-info.focus { color: #9ae1e9; } .btn-pure.btn-info:hover .badge, .btn-pure.btn-info:focus .badge, .btn-pure.btn-info:active .badge, .btn-pure.btn-info.active .badge, .open > .dropdown-toggle.btn-pure.btn-info .badge { color: #9ae1e9; } .btn-pure.btn-warning { color: #f2a654; } .btn-pure.btn-warning:hover, .btn-pure.btn-warning:focus, .btn-pure.btn-warning:active, .btn-pure.btn-warning.active, .open > .dropdown-toggle.btn-pure.btn-warning { color: #f6be80; } .btn-pure.btn-warning:hover:hover, .btn-pure.btn-warning:focus:hover, .btn-pure.btn-warning:active:hover, .btn-pure.btn-warning.active:hover, .open > .dropdown-toggle.btn-pure.btn-warning:hover, .btn-pure.btn-warning:hover:focus, .btn-pure.btn-warning:focus:focus, .btn-pure.btn-warning:active:focus, .btn-pure.btn-warning.active:focus, .open > .dropdown-toggle.btn-pure.btn-warning:focus, .btn-pure.btn-warning:hover.focus, .btn-pure.btn-warning:focus.focus, .btn-pure.btn-warning:active.focus, .btn-pure.btn-warning.active.focus, .open > .dropdown-toggle.btn-pure.btn-warning.focus { color: #f6be80; } .btn-pure.btn-warning:hover .badge, .btn-pure.btn-warning:focus .badge, .btn-pure.btn-warning:active .badge, .btn-pure.btn-warning.active .badge, .open > .dropdown-toggle.btn-pure.btn-warning .badge { color: #f6be80; } .btn-pure.btn-danger { color: #f96868; } .btn-pure.btn-danger:hover, .btn-pure.btn-danger:focus, .btn-pure.btn-danger:active, .btn-pure.btn-danger.active, .open > .dropdown-toggle.btn-pure.btn-danger { color: #fa9898; } .btn-pure.btn-danger:hover:hover, .btn-pure.btn-danger:focus:hover, .btn-pure.btn-danger:active:hover, .btn-pure.btn-danger.active:hover, .open > .dropdown-toggle.btn-pure.btn-danger:hover, .btn-pure.btn-danger:hover:focus, .btn-pure.btn-danger:focus:focus, .btn-pure.btn-danger:active:focus, .btn-pure.btn-danger.active:focus, .open > .dropdown-toggle.btn-pure.btn-danger:focus, .btn-pure.btn-danger:hover.focus, .btn-pure.btn-danger:focus.focus, .btn-pure.btn-danger:active.focus, .btn-pure.btn-danger.active.focus, .open > .dropdown-toggle.btn-pure.btn-danger.focus { color: #fa9898; } .btn-pure.btn-danger:hover .badge, .btn-pure.btn-danger:focus .badge, .btn-pure.btn-danger:active .badge, .btn-pure.btn-danger.active .badge, .open > .dropdown-toggle.btn-pure.btn-danger .badge { color: #fa9898; } .btn-pure.btn-dark { color: #526069; } .btn-pure.btn-dark:hover, .btn-pure.btn-dark:focus, .btn-pure.btn-dark:active, .btn-pure.btn-dark.active, .open > .dropdown-toggle.btn-pure.btn-dark { color: #76838f; } .btn-pure.btn-dark:hover:hover, .btn-pure.btn-dark:focus:hover, .btn-pure.btn-dark:active:hover, .btn-pure.btn-dark.active:hover, .open > .dropdown-toggle.btn-pure.btn-dark:hover, .btn-pure.btn-dark:hover:focus, .btn-pure.btn-dark:focus:focus, .btn-pure.btn-dark:active:focus, .btn-pure.btn-dark.active:focus, .open > .dropdown-toggle.btn-pure.btn-dark:focus, .btn-pure.btn-dark:hover.focus, .btn-pure.btn-dark:focus.focus, .btn-pure.btn-dark:active.focus, .btn-pure.btn-dark.active.focus, .open > .dropdown-toggle.btn-pure.btn-dark.focus { color: #76838f; } .btn-pure.btn-dark:hover .badge, .btn-pure.btn-dark:focus .badge, .btn-pure.btn-dark:active .badge, .btn-pure.btn-dark.active .badge, .open > .dropdown-toggle.btn-pure.btn-dark .badge { color: #76838f; } .btn-pure.btn-inverse { color: #fff; } .btn-pure.btn-inverse:hover, .btn-pure.btn-inverse:focus, .btn-pure.btn-inverse:active, .btn-pure.btn-inverse.active, .open > .dropdown-toggle.btn-pure.btn-inverse { color: #fff; } .btn-pure.btn-inverse:hover:hover, .btn-pure.btn-inverse:focus:hover, .btn-pure.btn-inverse:active:hover, .btn-pure.btn-inverse.active:hover, .open > .dropdown-toggle.btn-pure.btn-inverse:hover, .btn-pure.btn-inverse:hover:focus, .btn-pure.btn-inverse:focus:focus, .btn-pure.btn-inverse:active:focus, .btn-pure.btn-inverse.active:focus, .open > .dropdown-toggle.btn-pure.btn-inverse:focus, .btn-pure.btn-inverse:hover.focus, .btn-pure.btn-inverse:focus.focus, .btn-pure.btn-inverse:active.focus, .btn-pure.btn-inverse.active.focus, .open > .dropdown-toggle.btn-pure.btn-inverse.focus { color: #fff; } .btn-pure.btn-inverse:hover .badge, .btn-pure.btn-inverse:focus .badge, .btn-pure.btn-inverse:active .badge, .btn-pure.btn-inverse.active .badge, .open > .dropdown-toggle.btn-pure.btn-inverse .badge { color: #fff; } .caret { border-top: 4px solid; } .dropdown-menu { -webkit-box-shadow: 0 3px 12px rgba(0, 0, 0, .05); box-shadow: 0 3px 12px rgba(0, 0, 0, .05); } .dropdown-menu.bullet:before, .dropdown-menu.bullet:after { border: 7px solid transparent; border-top-width: 0; } .dropdown-menu.bullet:before { border-bottom-color: #e4eaec; } .dropdown-menu.bullet:after { border-bottom-color: #fff; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { -webkit-box-shadow: 0 -3px 12px rgba(0, 0, 0, .05); box-shadow: 0 -3px 12px rgba(0, 0, 0, .05); } .dropup .dropdown-menu.bullet:before, .navbar-fixed-bottom .dropdown .dropdown-menu.bullet:before, .dropup .dropdown-menu.bullet:after, .navbar-fixed-bottom .dropdown .dropdown-menu.bullet:after { border-top-width: 7px; border-bottom-width: 0; } .dropup .dropdown-menu.bullet:before, .navbar-fixed-bottom .dropdown .dropdown-menu.bullet:before { border-top-color: #e4eaec; } .dropup .dropdown-menu.bullet:after, .navbar-fixed-bottom .dropdown .dropdown-menu.bullet:after { border-top-color: #fff; } .dropdown-menu > .dropdown-submenu > a:after { border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 4px dashed; } .dropdown-menu-media .dropdown-menu-header { padding: 20px 20px; background-color: #fff; border-bottom: 1px solid #e4eaec; } .dropdown-menu-media .list-group-item { border: none; } .dropdown-menu-media .list-group-item .media { border-top: 1px solid #e4eaec; } .dropdown-menu-media .list-group-item:first-child .media { border-top: none; } .dropdown-menu-media > .dropdown-menu-footer { background-color: #f3f7f9; border-top: 1px solid #e4eaec; } .dropdown-menu-media > .dropdown-menu-footer > a { color: #a3afb7 !important; } .dropdown-menu-media > .dropdown-menu-footer > a:hover { color: #8897ec !important; background-color: transparent !important; } .dropdown-menu-media > .dropdown-menu-footer > .dropdown-menu-footer-btn:hover { color: #8897ec !important; background-color: transparent !important; } .dropdown-menu-primary > .active > a, .dropdown-menu-primary > .active > a:hover, .dropdown-menu-primary > .active > a:focus { color: #fff; background-color: #677ae4; } .dropdown-menu-success > .active > a, .dropdown-menu-success > .active > a:hover, .dropdown-menu-success > .active > a:focus { color: #fff; background-color: #46be8a; } .dropdown-menu-info > .active > a, .dropdown-menu-info > .active > a:hover, .dropdown-menu-info > .active > a:focus { color: #fff; background-color: #57c7d4; } .dropdown-menu-warning > .active > a, .dropdown-menu-warning > .active > a:hover, .dropdown-menu-warning > .active > a:focus { color: #fff; background-color: #f2a654; } .dropdown-menu-danger > .active > a, .dropdown-menu-danger > .active > a:hover, .dropdown-menu-danger > .active > a:focus { color: #fff; background-color: #f96868; } .dropdown-menu-dark > .active > a, .dropdown-menu-dark > .active > a:hover, .dropdown-menu-dark > .active > a:focus { color: #fff; background-color: #526069; } .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05); } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { border-color: transparent; } .nav-quick { background-color: #fff; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); box-shadow: 0 1px 1px rgba(0, 0, 0, .05); } .nav-quick a { color: #76838f; } .nav-quick a:hover { background-color: #f3f7f9; } .nav-quick-bordered { border-top: 1px solid #e4eaec; border-left: 1px solid #e4eaec; } .nav-quick-bordered li { border-right: 1px solid #e4eaec; border-bottom: 1px solid #e4eaec; } .nav-tabs > li > a { color: #76838f; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #fff; background-color: #677ae4; border-color: transparent; border-bottom-color: #677ae4; } .nav-tabs.nav-justified > li.active > a, .nav-tabs.nav-justified > li.active > a:hover, .nav-tabs.nav-justified > li.active > a:focus { border-color: transparent; border-bottom-color: #677ae4; } .nav-tabs.nav-tabs-bottom { border-top: 1px solid #e4eaec; } .nav-tabs.nav-tabs-bottom > li > a:hover, .nav-tabs.nav-tabs-bottom > li > a:focus { border-top-color: #e4eaec; border-bottom-color: transparent; } .nav-tabs.nav-tabs-bottom.nav-justified { border-top: none; } .nav-tabs.nav-tabs-bottom.nav-justified > li > a { border-top-color: #e4eaec; border-bottom-color: transparent; } .nav-tabs.nav-tabs-bottom.nav-justified > li.active > a, .nav-tabs.nav-tabs-bottom.nav-justified > li.active > a:hover, .nav-tabs.nav-tabs-bottom.nav-justified > li.active > a:focus { border-top: 1px solid #677ae4; } .nav-tabs-solid { border-bottom-color: #f3f7f9; } .nav-tabs-solid > li > a:hover { border-color: transparent; } .nav-tabs-solid > li.active > a, .nav-tabs-solid > li.active > a:hover, .nav-tabs-solid > li.active > a:focus { color: #76838f; background-color: #f3f7f9; border-color: transparent; } .nav-tabs-solid ~ .tab-content { background-color: #f3f7f9; } .nav-tabs-solid.nav-justified > li > a { border: none; } .nav-tabs-solid.nav-justified > li.active > a, .nav-tabs-solid.nav-justified > li.active > a:hover, .nav-tabs-solid.nav-justified > li.active > a:focus { border: none; } .nav-tabs-solid.nav-tabs-bottom > li.active > a, .nav-tabs-solid.nav-tabs-bottom > li.active > a:hover, .nav-tabs-solid.nav-tabs-bottom > li.active > a:focus { border: none; } .nav-tabs-line > li > a { border-bottom: 2px solid transparent; } .nav-tabs-line > li > a:hover, .nav-tabs-line > li > a:focus { background-color: transparent; } .nav-tabs-line > li > a:hover { border-bottom-color: #ccd5db; } .nav-tabs-line > li.active > a, .nav-tabs-line > li.active > a:hover, .nav-tabs-line > li.active > a:focus { color: #677ae4; background-color: transparent; border-bottom: 2px solid #677ae4; } .nav-tabs-line .open > a, .nav-tabs-line .open > a:hover, .nav-tabs-line .open > a:focus { border-color: transparent; border-bottom-color: #ccd5db; } .nav-tabs-line.nav-tabs-bottom > li > a { border-top: 2px solid transparent; border-bottom: none; } .nav-tabs-line.nav-tabs-bottom > li > a:hover { border-top-color: #ccd5db; border-bottom-color: transparent; } .nav-tabs-line.nav-tabs-bottom > li.active > a, .nav-tabs-line.nav-tabs-bottom > li.active > a:hover, .nav-tabs-line.nav-tabs-bottom > li.active > a:focus { border-top: 2px solid #677ae4; border-bottom: none; } .nav-tabs-line.nav-justified > li > a { border-bottom: 2px solid #e4eaec; } .nav-tabs-line.nav-justified > li > a:hover { border-bottom-color: #ccd5db; } .nav-tabs-line.nav-justified > li.active > a, .nav-tabs-line.nav-justified > li.active > a:hover, .nav-tabs-line.nav-justified > li.active > a:focus { border-color: transparent; border-bottom: 2px solid #677ae4; } .nav-tabs-line.nav-justified.nav-tabs-bottom { border-top: none; } .nav-tabs-line.nav-justified.nav-tabs-bottom > li > a { border-top: 2px solid #e4eaec; border-bottom: none; } .nav-tabs-line.nav-justified.nav-tabs-bottom > li > a:hover { border-top-color: #ccd5db; } .nav-tabs-line.nav-justified.nav-tabs-bottom > li.active > a, .nav-tabs-line.nav-justified.nav-tabs-bottom > li.active > a:hover, .nav-tabs-line.nav-justified.nav-tabs-bottom > li.active > a:focus { border-top-color: #677ae4; border-bottom: none; } .nav-tabs-vertical:before, .nav-tabs-vertical:after { display: table; content: " "; } .nav-tabs-vertical:after { clear: both; } .nav-tabs-vertical .nav-tabs { border-right: 1px solid #e4eaec; border-bottom: none; } .nav-tabs-vertical .nav-tabs > li > a:hover { border-right-color: #e4eaec; border-bottom-color: transparent; } .nav-tabs-vertical .nav-tabs > li.active > a, .nav-tabs-vertical .nav-tabs > li.active > a:hover, .nav-tabs-vertical .nav-tabs > li.active > a:focus { border-right-color: #677ae4; } .nav-tabs-vertical .nav-tabs-reverse { border-right: none; border-left: 1px solid #e4eaec; } .nav-tabs-vertical .nav-tabs-reverse > li > a:hover { border-right-color: transparent; border-left-color: #e4eaec; } .nav-tabs-vertical .nav-tabs-reverse > li.active > a, .nav-tabs-vertical .nav-tabs-reverse > li.active > a:hover, .nav-tabs-vertical .nav-tabs-reverse > li.active > a:focus { border-left-color: #677ae4; } .nav-tabs-vertical .nav-tabs-solid { border-right-color: #f3f7f9; } .nav-tabs-vertical .nav-tabs-solid > li > a:hover { border-color: transparent; } .nav-tabs-vertical .nav-tabs-solid > li.active > a, .nav-tabs-vertical .nav-tabs-solid > li.active > a:hover, .nav-tabs-vertical .nav-tabs-solid > li.active > a:focus { border-color: transparent; } .nav-tabs-vertical .nav-tabs-solid.nav-tabs-reverse { border-left-color: #f3f7f9; } .nav-tabs-vertical .nav-tabs-line > li > a { border-right: 2px solid transparent; border-bottom: none; } .nav-tabs-vertical .nav-tabs-line > li > a:hover { border-right-color: #ccd5db; } .nav-tabs-vertical .nav-tabs-line > li.active > a, .nav-tabs-vertical .nav-tabs-line > li.active > a:hover, .nav-tabs-vertical .nav-tabs-line > li.active > a:focus { border-right: 2px solid #677ae4; border-bottom: none; } .nav-tabs-vertical .nav-tabs-line.nav-tabs-reverse > li > a { border-right-width: 1px; border-left: 2px solid transparent; } .nav-tabs-vertical .nav-tabs-line.nav-tabs-reverse > li > a:hover { border-color: transparent; border-left-color: #ccd5db; } .nav-tabs-vertical .nav-tabs-line.nav-tabs-reverse > li.active > a, .nav-tabs-vertical .nav-tabs-line.nav-tabs-reverse > li.active > a:hover, .nav-tabs-vertical .nav-tabs-line.nav-tabs-reverse > li.active > a:focus { border-right: 1px solid transparent; border-left: 2px solid #677ae4; } .nav-tabs-inverse .nav-tabs-solid { border-bottom-color: #fff; } .nav-tabs-inverse .nav-tabs-solid > li.active > a, .nav-tabs-inverse .nav-tabs-solid > li.active > a:hover, .nav-tabs-inverse .nav-tabs-solid > li.active > a:focus { color: #76838f; background-color: #fff; } .nav-tabs-inverse.nav-tabs-vertical .nav-tabs-solid { border-right-color: #fff; } .nav-tabs-inverse.nav-tabs-vertical .nav-tabs-solid.nav-tabs-reverse { border-left-color: #fff; } .nav-tabs-inverse .tab-content { background: #fff; } .navbar-toggle { background: transparent !important; } .navbar-toggle:hover { background: transparent !important; } .navbar { border: none; -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, .08); box-shadow: 0 2px 4px rgba(0, 0, 0, .08); } .navbar-form .icon { color: rgba(55, 71, 79, .4); } .navbar-form .form-control { background-color: #f3f7f9; border: none; } @media (max-width: 767px) { .navbar-search .navbar-form { border-bottom: none; } } .navbar-search-overlap { background-color: #fff; } .navbar-search-overlap .form-control { background-color: transparent !important; } .navbar-search-overlap .form-control:focus { border-color: transparent; } .navbar-default .navbar-toolbar > li > a { color: #76838f; } .navbar-default .navbar-toolbar > li > a:hover, .navbar-default .navbar-toolbar > li > a:focus { color: #526069; background-color: rgba(243, 247, 249, .3); } .navbar-default .navbar-toolbar > .active > a, .navbar-default .navbar-toolbar > .active > a:hover, .navbar-default .navbar-toolbar > .active > a:focus { color: #526069; background-color: rgba(243, 247, 249, .6); } .navbar-default .navbar-toolbar > .disabled > a, .navbar-default .navbar-toolbar > .disabled > a:hover, .navbar-default .navbar-toolbar > .disabled > a:focus { color: #ccd5db; background-color: transparent; } .navbar-default .navbar-toggle { color: #76838f; } .navbar-default .navbar-toolbar > .open > a, .navbar-default .navbar-toolbar > .open > a:hover, .navbar-default .navbar-toolbar > .open > a:focus { color: #526069; background-color: rgba(243, 247, 249, .6); } .navbar-inverse .navbar-toolbar > li > a { color: #fff; } .navbar-inverse .navbar-toolbar > li > a:hover, .navbar-inverse .navbar-toolbar > li > a:focus { color: #fff; background-color: rgba(0, 0, 0, .1); } .navbar-inverse .navbar-toolbar > .active > a, .navbar-inverse .navbar-toolbar > .active > a:hover, .navbar-inverse .navbar-toolbar > .active > a:focus { color: #fff; background-color: rgba(0, 0, 0, .1); } .navbar-inverse .navbar-toolbar > .disabled > a, .navbar-inverse .navbar-toolbar > .disabled > a:hover, .navbar-inverse .navbar-toolbar > .disabled > a:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-toggle { color: #fff; } .navbar-inverse .navbar-toolbar > .open > a, .navbar-inverse .navbar-toolbar > .open > a:hover, .navbar-inverse .navbar-toolbar > .open > a:focus { color: #fff; background-color: rgba(0, 0, 0, .1); } .breadcrumb li .icon { text-decoration: none; } .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #ccd5db; background-color: transparent; border-color: #e4eaec; } .pagination-gap > li > a:hover { background-color: transparent; border-color: #677ae4; } .pagination-no-border > li > a { border: none; } .pager li > a, .pager li > span { color: #76838f; } .pager li > a:hover, .pager li > a:focus { color: #677ae4; } .pager li > a:hover, .pager li > a:focus { border-color: #677ae4; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { border-color: #e4eaec; } .label.label-outline { color: #f3f7f9; background-color: transparent; border-color: #f3f7f9; } .label-outline { border: 1px solid transparent; } .label-default { color: #76838f; background-color: #e4eaec; } .label-default[href]:hover, .label-default[href]:focus { background-color: #f3f7f9; } .label-default.label-outline { color: #e4eaec; background-color: transparent; border-color: #e4eaec; } .label-default[href]:hover, .label-default[href]:focus { color: #a3afb7; } .label-default.label-outline { color: #76838f; } .label-primary { background-color: #677ae4; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #8897ec; } .label-primary.label-outline { color: #677ae4; background-color: transparent; border-color: #677ae4; } .label-success { background-color: #46be8a; } .label-success[href]:hover, .label-success[href]:focus { background-color: #5cd29d; } .label-success.label-outline { color: #46be8a; background-color: transparent; border-color: #46be8a; } .label-info { background-color: #57c7d4; } .label-info[href]:hover, .label-info[href]:focus { background-color: #77d6e1; } .label-info.label-outline { color: #57c7d4; background-color: transparent; border-color: #57c7d4; } .label-warning { background-color: #f2a654; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #f4b066; } .label-warning.label-outline { color: #f2a654; background-color: transparent; border-color: #f2a654; } .label-danger { background-color: #f96868; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #fa7a7a; } .label-danger.label-outline { color: #f96868; background-color: transparent; border-color: #f96868; } .label-dark { background-color: #526069; } .label-dark[href]:hover, .label-dark[href]:focus { background-color: #76838f; } .label-dark.label-outline { color: #526069; background-color: transparent; border-color: #526069; } .badge-primary { color: #fff; background-color: #677ae4; } .badge-primary[href]:hover, .badge-primary[href]:focus { color: #fff; background-color: #3c54dc; } .list-group-item.active > .badge-primary, .nav-pills > .active > a > .badge-primary { color: #fff; background-color: #677ae4; } .badge-success { color: #fff; background-color: #46be8a; } .badge-success[href]:hover, .badge-success[href]:focus { color: #fff; background-color: #369b6f; } .list-group-item.active > .badge-success, .nav-pills > .active > a > .badge-success { color: #fff; background-color: #46be8a; } .badge-info { color: #fff; background-color: #57c7d4; } .badge-info[href]:hover, .badge-info[href]:focus { color: #fff; background-color: #33b6c5; } .list-group-item.active > .badge-info, .nav-pills > .active > a > .badge-info { color: #fff; background-color: #57c7d4; } .badge-warning { color: #fff; background-color: #f2a654; } .badge-warning[href]:hover, .badge-warning[href]:focus { color: #fff; background-color: #ee8d25; } .list-group-item.active > .badge-warning, .nav-pills > .active > a > .badge-warning { color: #fff; background-color: #f2a654; } .badge-danger { color: #fff; background-color: #f96868; } .badge-danger[href]:hover, .badge-danger[href]:focus { color: #fff; background-color: #f73737; } .list-group-item.active > .badge-danger, .nav-pills > .active > a > .badge-danger { color: #fff; background-color: #f96868; } .badge-dark { color: #fff; background-color: #526069; } .badge-dark[href]:hover, .badge-dark[href]:focus { color: #fff; background-color: #3c464c; } .list-group-item.active > .badge-dark, .nav-pills > .active > a > .badge-dark { color: #fff; background-color: #526069; } .thumbnail { border: none; } .alert-alt { color: #76838f; background-color: rgba(243, 247, 249, .8); border: none; border-left: 3px solid transparent; } .alert-alt a, .alert-alt .alert-link { text-decoration: none; } .alert-dismissible .close { text-decoration: none; } .alert-dismissible.alert-alt .close { color: #a3afb7; } .alert-dismissible.alert-alt .close:hover, .alert-dismissible.alert-alt .close:focus { color: #a3afb7; } .alert-primary { color: #677ae4; background-color: rgba(237, 239, 249, .8); border-color: #edeff9; } .alert-primary hr { border-top-color: #dadef3; } .alert-primary .alert-link { color: #3c54dc; } .alert-primary .close { color: #677ae4; } .alert-primary .close:hover, .alert-primary .close:focus { color: #677ae4; } .alert-primary .alert-link { color: #5166d6; } .alert-alt.alert-primary { border-color: #677ae4; } .alert-alt.alert-primary a, .alert-alt.alert-primary .alert-link { color: #677ae4; } .alert-success .alert-link { color: #36ab7a; } .alert-alt.alert-success { border-color: #46be8a; } .alert-alt.alert-success a, .alert-alt.alert-success .alert-link { color: #46be8a; } .alert-info .alert-link { color: #47b8c6; } .alert-alt.alert-info { border-color: #57c7d4; } .alert-alt.alert-info a, .alert-alt.alert-info .alert-link { color: #57c7d4; } .alert-warning .alert-link { color: #ec9940; } .alert-alt.alert-warning { border-color: #f2a654; } .alert-alt.alert-warning a, .alert-alt.alert-warning .alert-link { color: #f2a654; } .alert-danger .alert-link { color: #e9595b; } .alert-alt.alert-danger { border-color: #f96868; } .alert-alt.alert-danger a, .alert-alt.alert-danger .alert-link { color: #f96868; } .alert-facebook { color: #fff; background-color: #3b5998; border-color: #3b5998; } .alert-facebook hr { border-top-color: #344e86; } .alert-facebook .alert-link { color: #e6e6e6; } .alert-facebook .close { color: #fff; } .alert-facebook .close:hover, .alert-facebook .close:focus { color: #fff; } .alert-facebook .alert-link { color: #fff; } .alert-twitter { color: #fff; background-color: #55acee; border-color: #55acee; } .alert-twitter hr { border-top-color: #3ea1ec; } .alert-twitter .alert-link { color: #e6e6e6; } .alert-twitter .close { color: #fff; } .alert-twitter .close:hover, .alert-twitter .close:focus { color: #fff; } .alert-twitter .alert-link { color: #fff; } .alert-google-plus { color: #fff; background-color: #dd4b39; border-color: #dd4b39; } .alert-google-plus hr { border-top-color: #d73925; } .alert-google-plus .alert-link { color: #e6e6e6; } .alert-google-plus .close { color: #fff; } .alert-google-plus .close:hover, .alert-google-plus .close:focus { color: #fff; } .alert-google-plus .alert-link { color: #fff; } .alert-linkedin { color: #fff; background-color: #0976b4; border-color: #0976b4; } .alert-linkedin hr { border-top-color: #08669c; } .alert-linkedin .alert-link { color: #e6e6e6; } .alert-linkedin .close { color: #fff; } .alert-linkedin .close:hover, .alert-linkedin .close:focus { color: #fff; } .alert-linkedin .alert-link { color: #fff; } .alert-flickr { color: #fff; background-color: #ff0084; border-color: #ff0084; } .alert-flickr hr { border-top-color: #e60077; } .alert-flickr .alert-link { color: #e6e6e6; } .alert-flickr .close { color: #fff; } .alert-flickr .close:hover, .alert-flickr .close:focus { color: #fff; } .alert-flickr .alert-link { color: #fff; } .alert-tumblr { color: #fff; background-color: #35465c; border-color: #35465c; } .alert-tumblr hr { border-top-color: #2c3a4c; } .alert-tumblr .alert-link { color: #e6e6e6; } .alert-tumblr .close { color: #fff; } .alert-tumblr .close:hover, .alert-tumblr .close:focus { color: #fff; } .alert-tumblr .alert-link { color: #fff; } .alert-github { color: #fff; background-color: #4183c4; border-color: #4183c4; } .alert-github hr { border-top-color: #3876b4; } .alert-github .alert-link { color: #e6e6e6; } .alert-github .close { color: #fff; } .alert-github .close:hover, .alert-github .close:focus { color: #fff; } .alert-github .alert-link { color: #fff; } .alert-dribbble { color: #fff; background-color: #c32361; border-color: #c32361; } .alert-dribbble hr { border-top-color: #ad1f56; } .alert-dribbble .alert-link { color: #e6e6e6; } .alert-dribbble .close { color: #fff; } .alert-dribbble .close:hover, .alert-dribbble .close:focus { color: #fff; } .alert-dribbble .alert-link { color: #fff; } .alert-youtube { color: #fff; background-color: #b31217; border-color: #b31217; } .alert-youtube hr { border-top-color: #9c1014; } .alert-youtube .alert-link { color: #e6e6e6; } .alert-youtube .close { color: #fff; } .alert-youtube .close:hover, .alert-youtube .close:focus { color: #fff; } .alert-youtube .alert-link { color: #fff; } .alert.dark .alert-link { color: #fff !important; } .alert.dark .alert-left-border { border: none; border-left: 3px solid transparent; } .alert.dark.alert-dismissible.alert-alt .close { color: #fff; } .alert.dark.alert-dismissible.alert-alt .close:hover, .alert.dark.alert-dismissible.alert-alt .close:focus { color: #fff; } .alert.dark.alert-primary { color: #fff; background-color: #677ae4; border-color: #677ae4; } .alert.dark.alert-primary hr { border-top-color: #5167e0; } .alert.dark.alert-primary .alert-link { color: #e6e6e6; } .alert.dark.alert-primary .close { color: #fff; } .alert.dark.alert-primary .close:hover, .alert.dark.alert-primary .close:focus { color: #fff; } .alert-alt.alert.dark.alert-primary { border-color: #2a3fb1; } .alert-alt.alert.dark.alert-primary a, .alert-alt.alert.dark.alert-primary .alert-link { color: #fff; } .alert.dark.alert-success { color: #fff; background-color: #46be8a; border-color: #46be8a; } .alert.dark.alert-success hr { border-top-color: #3dae7d; } .alert.dark.alert-success .alert-link { color: #e6e6e6; } .alert.dark.alert-success .close { color: #fff; } .alert.dark.alert-success .close:hover, .alert.dark.alert-success .close:focus { color: #fff; } .alert-alt.alert.dark.alert-success { border-color: #247151; } .alert-alt.alert.dark.alert-success a, .alert-alt.alert.dark.alert-success .alert-link { color: #fff; } .alert.dark.alert-info { color: #fff; background-color: #57c7d4; border-color: #57c7d4; } .alert.dark.alert-info hr { border-top-color: #43c0cf; } .alert.dark.alert-info .alert-link { color: #e6e6e6; } .alert.dark.alert-info .close { color: #fff; } .alert.dark.alert-info .close:hover, .alert.dark.alert-info .close:focus { color: #fff; } .alert-alt.alert.dark.alert-info { border-color: #2e8893; } .alert-alt.alert.dark.alert-info a, .alert-alt.alert.dark.alert-info .alert-link { color: #fff; } .alert.dark.alert-warning { color: #fff; background-color: #f2a654; border-color: #f2a654; } .alert.dark.alert-warning hr { border-top-color: #f09a3c; } .alert.dark.alert-warning .alert-link { color: #e6e6e6; } .alert.dark.alert-warning .close { color: #fff; } .alert.dark.alert-warning .close:hover, .alert.dark.alert-warning .close:focus { color: #fff; } .alert-alt.alert.dark.alert-warning { border-color: #cb7314; } .alert-alt.alert.dark.alert-warning a, .alert-alt.alert.dark.alert-warning .alert-link { color: #fff; } .alert.dark.alert-danger { color: #fff; background-color: #f96868; border-color: #f96868; } .alert.dark.alert-danger hr { border-top-color: #f84f4f; } .alert.dark.alert-danger .alert-link { color: #e6e6e6; } .alert.dark.alert-danger .close { color: #fff; } .alert.dark.alert-danger .close:hover, .alert.dark.alert-danger .close:focus { color: #fff; } .alert-alt.alert.dark.alert-danger { border-color: #d91d1f; } .alert-alt.alert.dark.alert-danger a, .alert-alt.alert.dark.alert-danger .alert-link { color: #fff; } .progress { -webkit-box-shadow: none; box-shadow: none; } .progress-bar { -webkit-box-shadow: none; box-shadow: none; } .progress-bar-indicating.active:before { background-color: #fff; } .vertical .progress-bar-indicating.active:before { background-color: #fff; } .progress-skill .progress-bar > span { color: #526069; } .media .media { border-bottom: none; } .media-meta { color: #526069; } .list-group .media { border-bottom: 0; } a.list-group-item.disabled, a.list-group-item.disabled:hover, a.list-group-item.disabled:focus { color: #ccd5db; background-color: #f3f7f9; } a.list-group-item.active, a.list-group-item.active:hover, a.list-group-item.active:focus { color: #fff; background-color: #677ae4; } .list-group.bg-inherit .list-group-item { background-color: transparent; border-bottom-color: rgba(0, 0, 0, .075); } .list-group.bg-inherit .list-group-item:last-child { border-bottom-color: transparent; } .list-group.bg-inherit .list-group-item:hover { background-color: rgba(0, 0, 0, .075); border-color: transparent; } .list-group-bordered .list-group-item { border-color: #e4eaec; } .list-group-bordered .list-group-item.active, .list-group-bordered .list-group-item.active:hover, .list-group-bordered .list-group-item.active:focus { color: #fff; background-color: #5166d6; border-color: #5166d6; } .list-group-dividered .list-group-item { border-top-color: #e4eaec; } .list-group-dividered .list-group-item.active:hover { border-top-color: #e4eaec; } .list-group-dividered .list-group-item:last-child { border-bottom-color: #e4eaec; } .list-group-dividered .list-group-item:first-child { border-top-color: transparent; } .list-group-dividered .list-group-item:first-child.active:hover { border-top-color: transparent; } .list-group-item-dark { color: #fff; background-color: #526069; } a.list-group-item-dark, button.list-group-item-dark { color: #fff; } a.list-group-item-dark .list-group-item-heading, button.list-group-item-dark .list-group-item-heading { color: inherit; } a.list-group-item-dark:hover, button.list-group-item-dark:hover, a.list-group-item-dark:focus, button.list-group-item-dark:focus { color: #fff; background-color: #47535b; } a.list-group-item-dark.active, button.list-group-item-dark.active, a.list-group-item-dark.active:hover, button.list-group-item-dark.active:hover, a.list-group-item-dark.active:focus, button.list-group-item-dark.active:focus { color: #fff; background-color: #fff; border-color: #fff; } .panel { border-width: 0; } .panel > .nav-tabs-vertical .nav-tabs > li > a { border-left: none; } .panel > .nav-tabs-vertical .nav-tabs.nav-tabs-reverse > li > a { border-right: none; } .panel-heading { border-bottom: 1px solid transparent; } .panel-heading > .nav-tabs { border-bottom: none; } .panel-body > .list-group-dividered:only-child > .list-group-item:last-child { border-bottom-color: transparent; } .panel-footer { border-top: 1px solid transparent; } .table + .panel-footer { border-color: #e4eaec; } .panel-title { color: #37474f; } .panel-title small { color: #76838f; } .panel-desc { color: #76838f; } .panel-actions a { color: inherit; } .panel-actions .panel-action { color: #a3afb7; text-decoration: none; background-color: transparent; } .panel-actions .panel-action:hover { color: #526069; } .panel-actions .panel-action:active { color: #526069; } .panel-toolbar { background-color: transparent; border-top: 1px solid #e4eaec; border-bottom: 1px solid #e4eaec; } .panel-bordered .panel-toolbar { border-top-color: transparent; } .panel-toolbar .btn { color: #a3afb7; } .panel-toolbar .btn:hover, .panel-toolbar .btn:active, .panel-toolbar .btn.active { color: #76838f; } .panel-control { border: none; -webkit-box-shadow: none; box-shadow: none; } .panel-bordered > .panel-heading { border-bottom: 1px solid #e4eaec; } .panel-bordered > .panel-footer { border-top: 1px solid #e4eaec; } .panel.panel-transparent { background: transparent; border-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .panel.panel-transparent > .panel-heading, .panel.panel-transparent > .panel-footer { border-color: transparent; } .panel-primary, .panel-info, .panel-success, .panel-warning, .panel-danger, .panel-dark { border: none; } .panel-primary .panel-heading, .panel-info .panel-heading, .panel-success .panel-heading, .panel-warning .panel-heading, .panel-danger .panel-heading, .panel-dark .panel-heading { border: none; } .panel-primary .panel-title, .panel-info .panel-title, .panel-success .panel-title, .panel-warning .panel-title, .panel-danger .panel-title, .panel-dark .panel-title { color: #fff; } .panel-primary .panel-action, .panel-info .panel-action, .panel-success .panel-action, .panel-warning .panel-action, .panel-danger .panel-action, .panel-dark .panel-action { color: #fff; } .well { -webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, .02); box-shadow: inset 0 0 1px rgba(0, 0, 0, .02); } .well-primary { color: #fff; background-color: #677ae4; } .well-success { color: #fff; background-color: #46be8a; } .well-info { color: #fff; background-color: #57c7d4; } .well-warning { color: #fff; background-color: #f2a654; } .well-danger { color: #fff; background-color: #f96868; } .modal-content { border: none; -webkit-box-shadow: 0 2px 12px rgba(0, 0, 0, .2); box-shadow: 0 2px 12px rgba(0, 0, 0, .2); } .modal-header { border-bottom: none; } .modal-footer { border-top: none; } .modal-sidebar { background-color: #fff; } .modal-sidebar .modal-content { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .modal-sidebar .modal-header { border-bottom: none; } .modal-sidebar .modal-footer { border-top: none; } .modal-fill-in { background-color: transparent; } .modal-fill-in.in { background-color: rgba(255, 255, 255, .95); } .modal-fill-in .modal-content { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .modal-fill-in .modal-header { border-bottom: none; } .modal-fill-in .modal-footer { border-top: none; } .modal-primary .modal-header { background-color: #677ae4; } .modal-primary .modal-header * { color: #fff; } .modal-success .modal-header { background-color: #46be8a; } .modal-success .modal-header * { color: #fff; } .modal-info .modal-header { background-color: #57c7d4; } .modal-info .modal-header * { color: #fff; } .modal-warning .modal-header { background-color: #f2a654; } .modal-warning .modal-header * { color: #fff; } .modal-danger .modal-header { background-color: #f96868; } .modal-danger .modal-header * { color: #fff; } .modal.modal-just-me .modal-backdrop { background-color: #fff; } .modal.modal-just-me.in { background: #fff; } .tooltip-primary + .tooltip .tooltip-inner { color: #fff; background-color: #677ae4; } .tooltip-primary + .tooltip.top .tooltip-arrow { border-top-color: #677ae4; } .tooltip-primary + .tooltip.right .tooltip-arrow { border-right-color: #677ae4; } .tooltip-primary + .tooltip.bottom .tooltip-arrow { border-bottom-color: #677ae4; } .tooltip-primary + .tooltip.left .tooltip-arrow { border-left-color: #677ae4; } .tooltip-success + .tooltip .tooltip-inner { color: #fff; background-color: #46be8a; } .tooltip-success + .tooltip.top .tooltip-arrow { border-top-color: #46be8a; } .tooltip-success + .tooltip.right .tooltip-arrow { border-right-color: #46be8a; } .tooltip-success + .tooltip.bottom .tooltip-arrow { border-bottom-color: #46be8a; } .tooltip-success + .tooltip.left .tooltip-arrow { border-left-color: #46be8a; } .tooltip-info + .tooltip .tooltip-inner { color: #fff; background-color: #57c7d4; } .tooltip-info + .tooltip.top .tooltip-arrow { border-top-color: #57c7d4; } .tooltip-info + .tooltip.right .tooltip-arrow { border-right-color: #57c7d4; } .tooltip-info + .tooltip.bottom .tooltip-arrow { border-bottom-color: #57c7d4; } .tooltip-info + .tooltip.left .tooltip-arrow { border-left-color: #57c7d4; } .tooltip-warning + .tooltip .tooltip-inner { color: #fff; background-color: #f2a654; } .tooltip-warning + .tooltip.top .tooltip-arrow { border-top-color: #f2a654; } .tooltip-warning + .tooltip.right .tooltip-arrow { border-right-color: #f2a654; } .tooltip-warning + .tooltip.bottom .tooltip-arrow { border-bottom-color: #f2a654; } .tooltip-warning + .tooltip.left .tooltip-arrow { border-left-color: #f2a654; } .tooltip-danger + .tooltip .tooltip-inner { color: #fff; background-color: #f96868; } .tooltip-danger + .tooltip.top .tooltip-arrow { border-top-color: #f96868; } .tooltip-danger + .tooltip.right .tooltip-arrow { border-right-color: #f96868; } .tooltip-danger + .tooltip.bottom .tooltip-arrow { border-bottom-color: #f96868; } .tooltip-danger + .tooltip.left .tooltip-arrow { border-left-color: #f96868; } .popover { -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, .05); box-shadow: 0 2px 6px rgba(0, 0, 0, .05); } .popover.bottom > .arrow:after { border-bottom-color: #f3f7f9; } .popover-primary + .popover .popover-title { color: #fff; background-color: #677ae4; border-color: #677ae4; } .popover-primary + .popover.bottom .arrow { border-bottom-color: #677ae4; } .popover-primary + .popover.bottom .arrow:after { border-bottom-color: #677ae4; } .popover-success + .popover .popover-title { color: #fff; background-color: #46be8a; border-color: #46be8a; } .popover-success + .popover.bottom .arrow { border-bottom-color: #46be8a; } .popover-success + .popover.bottom .arrow:after { border-bottom-color: #46be8a; } .popover-info + .popover .popover-title { color: #fff; background-color: #57c7d4; border-color: #57c7d4; } .popover-info + .popover.bottom .arrow { border-bottom-color: #57c7d4; } .popover-info + .popover.bottom .arrow:after { border-bottom-color: #57c7d4; } .popover-warning + .popover .popover-title { color: #fff; background-color: #f2a654; border-color: #f2a654; } .popover-warning + .popover.bottom .arrow { border-bottom-color: #f2a654; } .popover-warning + .popover.bottom .arrow:after { border-bottom-color: #f2a654; } .popover-danger + .popover .popover-title { color: #fff; background-color: #f96868; border-color: #f96868; } .popover-danger + .popover.bottom .arrow { border-bottom-color: #f96868; } .popover-danger + .popover.bottom .arrow:after { border-bottom-color: #f96868; } .carousel-caption h1, .carousel-caption h2, .carousel-caption h3, .carousel-caption h4, .carousel-caption h5, .carousel-caption h6 { color: inherit; } .carousel-indicators li { background-color: rgba(255, 255, 255, .3); border: none; } .carousel-indicators-scaleup li { border: none; } .carousel-indicators-fillin li { background-color: transparent; -webkit-box-shadow: 0 0 0 2px #fff inset; box-shadow: 0 0 0 2px #fff inset; } .carousel-indicators-fillin .active { -webkit-box-shadow: 0 0 0 8px #fff inset; box-shadow: 0 0 0 8px #fff inset; } .carousel-indicators-fall li:after { background-color: rgba(0, 0, 0, .3); } .carousel-indicators-fall .active { background-color: transparent; } .site-navbar { background-color: #677ae4; } .site-navbar .navbar-header { color: #fff; background-color: transparent; } .site-navbar .navbar-header .navbar-toggle { color: #fff; } .site-navbar .navbar-header .hamburger:before, .site-navbar .navbar-header .hamburger:after, .site-navbar .navbar-header .hamburger .hamburger-bar { background-color: #fff; } .site-navbar .navbar-header .navbar-brand { color: #fff; } .site-navbar .container-fluid { background-color: #fff; } .site-navbar.navbar-inverse .container-fluid { background-color: transparent; } .site-menubar { color: rgba(163, 175, 183, .9); background: #263238; } .site-menubar.site-menubar-light { background: #fff; } .site-menubar-section > h4, .site-menubar-section > h5 { color: #76838f; } .site-menubar-footer > a { color: #76838f; background-color: #21292e; } .site-menubar-footer > a:hover, .site-menubar-footer > a:focus { background-color: #1e2427; } .site-menubar-light .site-menubar-footer > a { background-color: #e4eaec; } .site-menubar-light .site-menubar-footer > a:hover, .site-menubar-light .site-menubar-footer > a:focus { background-color: #d5dee1; } .site-menu-item a { color: rgba(163, 175, 183, .9); } .site-menu > .site-menu-item { padding: 0; } .site-menu > .site-menu-item.open { background: #242f35; } .site-menu > .site-menu-item.open > a { color: #fff; background: transparent; } .site-menu > .site-menu-item.open.hover > a { background: transparent; } .site-menu > .site-menu-item.hover, .site-menu > .site-menu-item:hover { color: rgba(255, 255, 255, .8); } .site-menu > .site-menu-item.hover > a, .site-menu > .site-menu-item:hover > a { color: rgba(255, 255, 255, .8); background-color: rgba(255, 255, 255, .02); } .site-menu > .site-menu-item.active { background: #242f35; border-top: 1px solid rgba(0, 0, 0, .04); border-bottom: 1px solid rgba(0, 0, 0, .04); } .site-menu > .site-menu-item.active > a { color: #fff; background: transparent; } .site-menu > .site-menu-item.active.hover > a { background: transparent; } .site-menu .site-menu-sub { background: transparent; } .site-menu .site-menu-sub .site-menu-item { color: rgba(163, 175, 183, .9); background: transparent; } .site-menu .site-menu-sub .site-menu-item.has-sub { border-top: 1px solid transparent; border-bottom: 1px solid transparent; } .site-menu .site-menu-sub .site-menu-item.has-sub.open { border-top-color: rgba(0, 0, 0, .06); border-bottom-color: rgba(0, 0, 0, .06); } .site-menu .site-menu-sub .site-menu-item.open { background: rgba(0, 0, 0, .06); } .site-menu .site-menu-sub .site-menu-item.open > a { color: #fff; } .site-menu .site-menu-sub .site-menu-item.open.hover > a { background-color: transparent; } .site-menu .site-menu-sub .site-menu-item.hover > a, .site-menu .site-menu-sub .site-menu-item:hover > a { color: rgba(255, 255, 255, .8); background-color: rgba(255, 255, 255, .02); } .site-menu .site-menu-sub .site-menu-item.active { background: rgba(0, 0, 0, .06); } .site-menu .site-menu-sub .site-menu-item.active > a { color: #fff; } .site-menu .site-menu-sub .site-menu-item.active.hover > a { background-color: transparent; } .site-menubar-light .site-menu-item a { color: rgba(118, 131, 143, .9); } .site-menubar-light .site-menu-item.hover > a, .site-menubar-light .site-menu-item:hover > a { background: transparent; } .site-menubar-light .site-menu > .site-menu-item.open { background: rgba(70, 91, 212, .05); } .site-menubar-light .site-menu > .site-menu-item.open > a { color: #677ae4; } .site-menubar-light .site-menu > .site-menu-item.hover, .site-menubar-light .site-menu > .site-menu-item:hover { background-color: rgba(70, 91, 212, .05); } .site-menubar-light .site-menu > .site-menu-item.hover > a, .site-menubar-light .site-menu > .site-menu-item:hover > a { color: #677ae4; } .site-menubar-light .site-menu > .site-menu-item.active { background: rgba(70, 91, 212, .05); } .site-menubar-light .site-menu > .site-menu-item.active > a { color: #677ae4; } .site-menubar-light .site-menu .site-menu-sub .site-menu-item.open { background: rgba(70, 91, 212, .03); } .site-menubar-light .site-menu .site-menu-sub .site-menu-item.open > a { color: #677ae4; } .site-menubar-light .site-menu .site-menu-sub .site-menu-item.hover, .site-menubar-light .site-menu .site-menu-sub .site-menu-item:hover { background-color: rgba(70, 91, 212, .03); } .site-menubar-light .site-menu .site-menu-sub .site-menu-item.hover > a, .site-menubar-light .site-menu .site-menu-sub .site-menu-item:hover > a { color: #677ae4; } .site-menubar-light .site-menu .site-menu-sub .site-menu-item.hover.open, .site-menubar-light .site-menu .site-menu-sub .site-menu-item:hover.open { background-color: rgba(70, 91, 212, .03); } .site-menubar-light .site-menu .site-menu-sub .site-menu-item.active { background: rgba(70, 91, 212, .03); } .site-menubar-light .site-menu .site-menu-sub .site-menu-item.active > a { color: #677ae4; } .site-gridmenu { background-color: #263238; } .site-gridmenu li > a { color: #a3afb7; } .site-gridmenu li:hover > a { color: #fff; background-color: rgba(255, 255, 255, .02); } .page { background: #f1f4f5; } .page-description { color: #a3afb7; } .page-header { background: transparent; border-bottom: none; } .page-header-bordered { background-color: #fff; border-bottom-color: transparent; } .page-header-tabs .nav-tabs-line { border-bottom-color: transparent; } .page-aside { background: #fff; border-right-color: #e4eaec; } .page-aside-section:after { border-bottom-color: #e4eaec; } .page-aside-title { color: #526069; } .page-aside .list-group-item { border: none; } .page-aside .list-group-item .icon { color: #a3afb7; } .page-aside .list-group-item:hover, .page-aside .list-group-item:focus { color: #677ae4; background-color: #f3f7f9; border: none; } .page-aside .list-group-item:hover > .icon, .page-aside .list-group-item:focus > .icon { color: #677ae4; } .page-aside .list-group-item.active { color: #677ae4; background-color: transparent; } .page-aside .list-group-item.active > .icon { color: #677ae4; } .page-aside .list-group-item.active:hover, .page-aside .list-group-item.active:focus { color: #677ae4; background-color: #f3f7f9; border: none; } .page-aside .list-group-item.active:hover > .icon, .page-aside .list-group-item.active:focus > .icon { color: #677ae4; } .page-aside .list-group.has-actions .list-group-item .item-actions .btn-icon { background-color: transparent; } .page-aside .list-group.has-actions .list-group-item .item-actions .btn-icon:hover .icon { color: #677ae4; } .page-aside .list-group.has-actions .list-group-item:hover .item-actions .icon { color: #76838f; } @media (max-width: 767px) { .page-aside { border-color: transparent; } .page-aside .page-aside-inner { background-color: white; border-right-color: #e4eaec; } } .site-footer { background-color: rgba(0, 0, 0, .02); border-top-color: #e4eaec; } .site-footer .scroll-to-top { color: #76838f; } @media (min-width: 1200px) { .layout-boxed { background: #e4eaec; } } .site-print { padding-top: 0; } .site-print .site-navbar, .site-print .site-menubar, .site-print .site-gridmenu, .site-print .site-footer { display: none; } .site-print .page { margin: 0 !important; } .site-menubar-fold.site-menubar-fold-alt .site-menu > .site-menu-item.active, .site-menubar-fold.site-menubar-fold-alt .site-menu > .site-menu-item.open, .site-menubar-fold.site-menubar-fold-alt .site-menu > .site-menu-item.hover { background: #37474f; } .site-menubar-fold.site-menubar-fold-alt .site-menu > .site-menu-item > a .site-menu-title { background: #37474f; } .site-menubar-fold.site-menubar-fold-alt .site-menubar-light .site-menu > .site-menu-item.active, .site-menubar-fold.site-menubar-fold-alt .site-menubar-light .site-menu > .site-menu-item.open, .site-menubar-fold.site-menubar-fold-alt .site-menubar-light .site-menu > .site-menu-item.hover { background: #e8f1f8; } .site-menubar-fold.site-menubar-fold-alt .site-menubar-light .site-menu > .site-menu-item > a .site-menu-title { background: #e8f1f8; } @media screen and (max-width: 767px), screen and (min-width: 1200px) { .css-menubar .site-menu-category { color: #76838f; } } .site-menubar-unfold .site-menu-category { color: #76838f; } @media (max-width: 767px) { .site-gridmenu { background: rgba(38, 50, 56, .9); } } body.site-navbar-small { padding-top: 60px; } .site-navbar-small .site-navbar { height: 60px; min-height: 60px; } .site-navbar-small .site-navbar .navbar-brand { height: 60px; padding: 19px 20px; } .site-navbar-small .site-navbar .navbar-nav { margin: 9.5px -15px; } @media (min-width: 768px) { .site-navbar-small .site-navbar .navbar-nav > li > a { padding-top: 19px; padding-bottom: 19px; } } .site-navbar-small .site-navbar .navbar-toggle { height: 60px; padding: 19px 15px; } .site-navbar-small .site-navbar .navbar-toolbar > li > a { padding-top: 19px; padding-bottom: 19px; } .site-navbar-small .site-navbar .navbar-nav > li > a.navbar-avatar, .site-navbar-small .site-navbar .navbar-toolbar > li > a.navbar-avatar { padding-top: 15px; padding-bottom: 15px; } .site-navbar-small .site-navbar .navbar-search-overlap .form-control { height: 60px !important; } .site-navbar-small .site-menubar { top: 60px; height: -webkit-calc(100% - 60px); height: calc(100% - 60px); } .site-navbar-small .site-gridmenu { top: 60px; } @media (max-width: 767px) { body.site-navbar-collapse-show.site-navbar-small { padding-top: 120px; } .site-navbar-small .site-menubar { top: 60px; } .site-navbar-collapse-show .site-navbar-small .site-menubar { top: 120px; height: -webkit-calc(100% - 120px); height: calc(100% - 120px); } .site-navbar-small .page-aside { top: 60px; } .site-navbar-collapse-show .site-navbar-small .page-aside { top: 120px; } } .checkbox-custom label::before { background-color: #fff; border: 1px solid #e4eaec; } .checkbox-custom label::after { color: #76838f; } .checkbox-custom input[type="checkbox"]:focus + label::before, .checkbox-custom input[type="radio"]:focus + label::before { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .checkbox-custom input[type="checkbox"]:checked + label::before, .checkbox-custom input[type="radio"]:checked + label::before { border-color: #e4eaec; } .checkbox-custom input[type="checkbox"]:disabled + label::before, .checkbox-custom input[type="radio"]:disabled + label::before { background-color: #f3f7f9; border-color: #e4eaec; } .checkbox-default input[type="checkbox"]:checked + label::before, .checkbox-default input[type="radio"]:checked + label::before { background-color: #fff; border-color: #e4eaec; border-width: 1px; } .checkbox-default input[type="checkbox"]:checked + label::after, .checkbox-default input[type="radio"]:checked + label::after { color: #677ae4; } .checkbox-primary input[type="checkbox"]:checked + label::before, .checkbox-primary input[type="radio"]:checked + label::before { background-color: #677ae4; border-color: #677ae4; } .checkbox-primary input[type="checkbox"]:checked + label::after, .checkbox-primary input[type="radio"]:checked + label::after { color: #fff; } .checkbox-danger input[type="checkbox"]:checked + label::before, .checkbox-danger input[type="radio"]:checked + label::before { background-color: #f96868; border-color: #f96868; } .checkbox-danger input[type="checkbox"]:checked + label::after, .checkbox-danger input[type="radio"]:checked + label::after { color: #fff; } .checkbox-info input[type="checkbox"]:checked + label::before, .checkbox-info input[type="radio"]:checked + label::before { background-color: #57c7d4; border-color: #57c7d4; } .checkbox-info input[type="checkbox"]:checked + label::after, .checkbox-info input[type="radio"]:checked + label::after { color: #fff; } .checkbox-warning input[type="checkbox"]:checked + label::before, .checkbox-warning input[type="radio"]:checked + label::before { background-color: #f2a654; border-color: #f2a654; } .checkbox-warning input[type="checkbox"]:checked + label::after, .checkbox-warning input[type="radio"]:checked + label::after { color: #fff; } .checkbox-success input[type="checkbox"]:checked + label::before, .checkbox-success input[type="radio"]:checked + label::before { background-color: #46be8a; border-color: #46be8a; } .checkbox-success input[type="checkbox"]:checked + label::after, .checkbox-success input[type="radio"]:checked + label::after { color: #fff; } .radio-custom label::before { background-color: #fff; border: 1px solid #e4eaec; } .radio-custom label::after { background-color: transparent; border: 2px solid #76838f; } .radio-custom input[type="radio"]:focus + label::before { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .radio-custom input[type="radio"]:checked + label::before { border-color: #e4eaec; } .radio-default input[type="radio"]:checked + label::before { background-color: #fff; border-color: #e4eaec; border-width: 1px; } .radio-default input[type="radio"]:checked + label::after { border-color: #677ae4; } .radio-primary input[type="radio"]:checked + label::before { border-color: #677ae4; } .radio-primary input[type="radio"]:checked + label::after { border-color: #fff; } .radio-danger input[type="radio"]:checked + label::before { border-color: #f96868; } .radio-danger input[type="radio"]:checked + label::after { border-color: #fff; } .radio-info input[type="radio"]:checked + label::before { border-color: #57c7d4; } .radio-info input[type="radio"]:checked + label::after { border-color: #fff; } .radio-warning input[type="radio"]:checked + label::before { border-color: #f2a654; } .radio-warning input[type="radio"]:checked + label::after { border-color: #fff; } .radio-success input[type="radio"]:checked + label::before { border-color: #46be8a; } .radio-success input[type="radio"]:checked + label::after { border-color: #fff; } .form-material .form-control { background-color: transparent; } .form-material .form-control, .form-material .form-control:focus, .form-material .form-control.focus { background-image: -webkit-gradient(linear, left top, left bottom, from(#677ae4), to(#677ae4)), -webkit-gradient(linear, left top, left bottom, from(#e4eaec), to(#e4eaec)); background-image: -webkit-linear-gradient(#677ae4, #677ae4), -webkit-linear-gradient(#e4eaec, #e4eaec); background-image: -o-linear-gradient(#677ae4, #677ae4), -o-linear-gradient(#e4eaec, #e4eaec); background-image: linear-gradient(#677ae4, #677ae4), linear-gradient(#e4eaec, #e4eaec); } .no-cssgradients .form-material .form-control { border-bottom: 2px solid #e4eaec; } .form-material .form-control::-webkit-input-placeholder { color: #a3afb7; } .form-material .form-control::-moz-placeholder { color: #a3afb7; } .form-material .form-control:-ms-input-placeholder { color: #a3afb7; } .form-material .form-control:disabled::-webkit-input-placeholder { color: #ccd5db; } .form-material .form-control:disabled::-moz-placeholder { color: #ccd5db; } .form-material .form-control:disabled:-ms-input-placeholder { color: #ccd5db; } .no-cssgradients .form-material .form-control:focus, .no-cssgradients .form-material .form-control.focus { background: transparent; border-bottom: 2px solid #677ae4; } .form-material .form-control:disabled, .form-material .form-control[disabled], fieldset[disabled] .form-material .form-control { background: transparent; border-bottom: 1px dashed #ccd5db; } .form-material .form-control:disabled ~ .floating-label, .form-material .form-control[disabled] ~ .floating-label, fieldset[disabled] .form-material .form-control ~ .floating-label { color: #ccd5db; } .form-material .floating-label { color: #76838f; } .form-material .form-control:focus ~ .floating-label, .form-material .form-control.focus ~ .floating-label { color: #677ae4; } .form-material .form-control:not(.empty):invalid ~ .floating-label, .form-material .form-control.focus:invalid ~ .floating-label { color: #f96868; } .form-material .form-control:invalid { background-image: -webkit-gradient(linear, left top, left bottom, from(#f96868), to(#f96868)), -webkit-gradient(linear, left top, left bottom, from(#e4eaec), to(#e4eaec)); background-image: -webkit-linear-gradient(#f96868, #f96868), -webkit-linear-gradient(#e4eaec, #e4eaec); background-image: -o-linear-gradient(#f96868, #f96868), -o-linear-gradient(#e4eaec, #e4eaec); background-image: linear-gradient(#f96868, #f96868), linear-gradient(#e4eaec, #e4eaec); } .form-material.form-group.has-warning .form-control:focus, .form-material.form-group.has-warning .form-control.focus, .form-material.form-group.has-warning .form-control:not(.empty) { background-image: -webkit-gradient(linear, left top, left bottom, from(#f2a654), to(#f2a654)), -webkit-gradient(linear, left top, left bottom, from(#e4eaec), to(#e4eaec)); background-image: -webkit-linear-gradient(#f2a654, #f2a654), -webkit-linear-gradient(#e4eaec, #e4eaec); background-image: -o-linear-gradient(#f2a654, #f2a654), -o-linear-gradient(#e4eaec, #e4eaec); background-image: linear-gradient(#f2a654, #f2a654), linear-gradient(#e4eaec, #e4eaec); } .no-cssgradients .form-material.form-group.has-warning .form-control:focus, .no-cssgradients .form-material.form-group.has-warning .form-control.focus, .no-cssgradients .form-material.form-group.has-warning .form-control:not(.empty) { background: transparent; border-bottom: 2px solid #f2a654; } .form-material.form-group.has-warning .form-control:-webkit-autofill { background-image: -webkit-gradient(linear, left top, left bottom, from(#f2a654), to(#f2a654)), -webkit-gradient(linear, left top, left bottom, from(#e4eaec), to(#e4eaec)); background-image: -webkit-linear-gradient(#f2a654, #f2a654), -webkit-linear-gradient(#e4eaec, #e4eaec); background-image: linear-gradient(#f2a654, #f2a654), linear-gradient(#e4eaec, #e4eaec); } .no-cssgradients .form-material.form-group.has-warning .form-control:-webkit-autofill { background: transparent; border-bottom: 2px solid #f2a654; } .form-material.form-group.has-warning .form-control:not(.empty) { -webkit-background-size: 100% 2px, 100% 1px; background-size: 100% 2px, 100% 1px; } .form-material.form-group.has-warning .control-label { color: #f2a654; } .form-material.form-group.has-warning .form-control:focus ~ .floating-label, .form-material.form-group.has-warning .form-control.focus ~ .floating-label, .form-material.form-group.has-warning .form-control:not(.empty) ~ .floating-label { color: #f2a654; } .form-material.form-group.has-warning .form-control:-webkit-autofill ~ .floating-label { color: #f2a654; } .form-material.form-group.has-error .form-control:focus, .form-material.form-group.has-error .form-control.focus, .form-material.form-group.has-error .form-control:not(.empty) { background-image: -webkit-gradient(linear, left top, left bottom, from(#f96868), to(#f96868)), -webkit-gradient(linear, left top, left bottom, from(#e4eaec), to(#e4eaec)); background-image: -webkit-linear-gradient(#f96868, #f96868), -webkit-linear-gradient(#e4eaec, #e4eaec); background-image: -o-linear-gradient(#f96868, #f96868), -o-linear-gradient(#e4eaec, #e4eaec); background-image: linear-gradient(#f96868, #f96868), linear-gradient(#e4eaec, #e4eaec); } .no-cssgradients .form-material.form-group.has-error .form-control:focus, .no-cssgradients .form-material.form-group.has-error .form-control.focus, .no-cssgradients .form-material.form-group.has-error .form-control:not(.empty) { background: transparent; border-bottom: 2px solid #f96868; } .form-material.form-group.has-error .form-control:-webkit-autofill { background-image: -webkit-gradient(linear, left top, left bottom, from(#f96868), to(#f96868)), -webkit-gradient(linear, left top, left bottom, from(#e4eaec), to(#e4eaec)); background-image: -webkit-linear-gradient(#f96868, #f96868), -webkit-linear-gradient(#e4eaec, #e4eaec); background-image: linear-gradient(#f96868, #f96868), linear-gradient(#e4eaec, #e4eaec); } .no-cssgradients .form-material.form-group.has-error .form-control:-webkit-autofill { background: transparent; border-bottom: 2px solid #f96868; } .form-material.form-group.has-error .form-control:not(.empty) { -webkit-background-size: 100% 2px, 100% 1px; background-size: 100% 2px, 100% 1px; } .form-material.form-group.has-error .control-label { color: #f96868; } .form-material.form-group.has-error .form-control:focus ~ .floating-label, .form-material.form-group.has-error .form-control.focus ~ .floating-label, .form-material.form-group.has-error .form-control:not(.empty) ~ .floating-label { color: #f96868; } .form-material.form-group.has-error .form-control:-webkit-autofill ~ .floating-label { color: #f96868; } .form-material.form-group.has-success .form-control:focus, .form-material.form-group.has-success .form-control.focus, .form-material.form-group.has-success .form-control:not(.empty) { background-image: -webkit-gradient(linear, left top, left bottom, from(#46be8a), to(#46be8a)), -webkit-gradient(linear, left top, left bottom, from(#e4eaec), to(#e4eaec)); background-image: -webkit-linear-gradient(#46be8a, #46be8a), -webkit-linear-gradient(#e4eaec, #e4eaec); background-image: -o-linear-gradient(#46be8a, #46be8a), -o-linear-gradient(#e4eaec, #e4eaec); background-image: linear-gradient(#46be8a, #46be8a), linear-gradient(#e4eaec, #e4eaec); } .no-cssgradients .form-material.form-group.has-success .form-control:focus, .no-cssgradients .form-material.form-group.has-success .form-control.focus, .no-cssgradients .form-material.form-group.has-success .form-control:not(.empty) { background: transparent; border-bottom: 2px solid #46be8a; } .form-material.form-group.has-success .form-control:-webkit-autofill { background-image: -webkit-gradient(linear, left top, left bottom, from(#46be8a), to(#46be8a)), -webkit-gradient(linear, left top, left bottom, from(#e4eaec), to(#e4eaec)); background-image: -webkit-linear-gradient(#46be8a, #46be8a), -webkit-linear-gradient(#e4eaec, #e4eaec); background-image: linear-gradient(#46be8a, #46be8a), linear-gradient(#e4eaec, #e4eaec); } .no-cssgradients .form-material.form-group.has-success .form-control:-webkit-autofill { background: transparent; border-bottom: 2px solid #46be8a; } .form-material.form-group.has-success .form-control:not(.empty) { -webkit-background-size: 100% 2px, 100% 1px; background-size: 100% 2px, 100% 1px; } .form-material.form-group.has-success .control-label { color: #46be8a; } .form-material.form-group.has-success .form-control:focus ~ .floating-label, .form-material.form-group.has-success .form-control.focus ~ .floating-label, .form-material.form-group.has-success .form-control:not(.empty) ~ .floating-label { color: #46be8a; } .form-material.form-group.has-success .form-control:-webkit-autofill ~ .floating-label { color: #46be8a; } .form-material.form-group.has-info .form-control:focus, .form-material.form-group.has-info .form-control.focus, .form-material.form-group.has-info .form-control:not(.empty) { background-image: -webkit-gradient(linear, left top, left bottom, from(#57c7d4), to(#57c7d4)), -webkit-gradient(linear, left top, left bottom, from(#e4eaec), to(#e4eaec)); background-image: -webkit-linear-gradient(#57c7d4, #57c7d4), -webkit-linear-gradient(#e4eaec, #e4eaec); background-image: -o-linear-gradient(#57c7d4, #57c7d4), -o-linear-gradient(#e4eaec, #e4eaec); background-image: linear-gradient(#57c7d4, #57c7d4), linear-gradient(#e4eaec, #e4eaec); } .no-cssgradients .form-material.form-group.has-info .form-control:focus, .no-cssgradients .form-material.form-group.has-info .form-control.focus, .no-cssgradients .form-material.form-group.has-info .form-control:not(.empty) { background: transparent; border-bottom: 2px solid #57c7d4; } .form-material.form-group.has-info .form-control:-webkit-autofill { background-image: -webkit-gradient(linear, left top, left bottom, from(#57c7d4), to(#57c7d4)), -webkit-gradient(linear, left top, left bottom, from(#e4eaec), to(#e4eaec)); background-image: -webkit-linear-gradient(#57c7d4, #57c7d4), -webkit-linear-gradient(#e4eaec, #e4eaec); background-image: linear-gradient(#57c7d4, #57c7d4), linear-gradient(#e4eaec, #e4eaec); } .no-cssgradients .form-material.form-group.has-info .form-control:-webkit-autofill { background: transparent; border-bottom: 2px solid #57c7d4; } .form-material.form-group.has-info .form-control:not(.empty) { -webkit-background-size: 100% 2px, 100% 1px; background-size: 100% 2px, 100% 1px; } .form-material.form-group.has-info .control-label { color: #57c7d4; } .form-material.form-group.has-info .form-control:focus ~ .floating-label, .form-material.form-group.has-info .form-control.focus ~ .floating-label, .form-material.form-group.has-info .form-control:not(.empty) ~ .floating-label { color: #57c7d4; } .form-material.form-group.has-info .form-control:-webkit-autofill ~ .floating-label { color: #57c7d4; } .form-material .input-group .input-group-addon { background: transparent; } .primary-100 { color: #edeff9 !important; } .primary-200 { color: #dadef5 !important; } .primary-300 { color: #bcc5f4 !important; } .primary-400 { color: #9daaf3 !important; } .primary-500 { color: #8897ec !important; } .primary-600 { color: #677ae4 !important; } .primary-700 { color: #5166d6 !important; } .primary-800 { color: #465bd4 !important; } .bg-primary-100 { background-color: #edeff9 !important; } .bg-primary-200 { background-color: #dadef5 !important; } .bg-primary-300 { background-color: #bcc5f4 !important; } .bg-primary-400 { background-color: #9daaf3 !important; } .bg-primary-500 { background-color: #8897ec !important; } .bg-primary-600 { background-color: #677ae4 !important; } .bg-primary-700 { background-color: #5166d6 !important; } .bg-primary-800 { background-color: #465bd4 !important; } .bg-white { color: #76838f; background-color: #fff; } .bg-primary { color: #fff; background-color: #677ae4; } .bg-primary:hover { background-color: #92a0ec; } .bg-primary a, a.bg-primary { color: #fff; } .bg-primary a:hover, a.bg-primary:hover { color: #fff; } .bg-success { color: #fff; background-color: #46be8a; } .bg-success:hover { background-color: #6ccba2; } .bg-success a, a.bg-success { color: #fff; } .bg-success a:hover, a.bg-success:hover { color: #fff; } .bg-info { color: #fff; background-color: #57c7d4; } .bg-info:hover { background-color: #80d5de; } .bg-info a, a.bg-info { color: #fff; } .bg-info a:hover, a.bg-info:hover { color: #fff; } .bg-warning { color: #fff; background-color: #f2a654; } .bg-warning:hover { background-color: #f6bf83; } .bg-warning a, a.bg-warning { color: #fff; } .bg-warning a:hover, a.bg-warning:hover { color: #fff; } .bg-danger { color: #fff; background-color: #f96868; } .bg-danger:hover { background-color: #fb9999; } .bg-danger a, a.bg-danger { color: #fff; } .bg-danger a:hover, a.bg-danger:hover { color: #fff; } .bg-dark { color: #fff; background-color: #526069; } .bg-dark:hover { background-color: #687a86; } .bg-dark a, a.bg-dark { color: #fff; } .bg-dark a:hover, a.bg-dark:hover { color: #fff; } .avatar i { border-color: #fff; } .avatar-online i { background-color: #46be8a; } .avatar-off i { background-color: #526069; } .avatar-busy i { background-color: #f2a654; } .avatar-away i { background-color: #f96868; } .status-online { background-color: #46be8a; } .status-off { background-color: #526069; } .status-busy { background-color: #f2a654; } .status-away { background-color: #f96868; } .counter > .counter-number, .counter .counter-number-group { color: #37474f; } .counter-inverse { color: #fff; } .counter-inverse > .counter-number, .counter-inverse .counter-number-group { color: #fff; } .counter-inverse .counter-icon { color: #fff; } .widget { background-color: #fff; } .widget-shadow { -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); box-shadow: 0 1px 1px rgba(0, 0, 0, .05); } .widget-title { color: #37474f; } .overlay-panel .widget-title { color: #fff; } .widget-metas { color: #a3afb7; } .widget-metas.type-link > a { color: #a3afb7; } .widget-metas.type-link > a:hover { color: #ccd5db; } .widget-metas.type-link > a + a:before { background-color: #a3afb7; } .overlay-background .widget-time { color: #fff; } .widget-actions a { color: #a3afb7; } .widget-actions a.active, .widget-actions a:hover, .widget-actions a:focus { color: #ccd5db; } .widget-actions-sidebar a { border-right: 1px solid #e4eaec; } .widget-actions-sidebar a + a { border-top: 1px solid #e4eaec; } .widget-watermark.darker { color: black; } .widget-watermark.lighter { color: white; } .widget-divider:after { background-color: #fff; } .comments .comment { border: none; border-bottom-color: #e4eaec; } .comments .comment .comment:first-child { border-top-color: #e4eaec; } .comments .comment .comment:last-child { border-bottom: none; } .comment-author, .comment-author:hover, .comment-author:focus { color: #37474f; } .comment-meta { color: #a3afb7; } .chat-box { background-color: #fff; } .chat-content { color: #fff; background-color: #677ae4; } .chat-content:before { border-color: transparent; border-left-color: #677ae4; } .chat-content + .chat-content:before { border-color: transparent; } .chat-time { color: rgba(255, 255, 255, .6); } .chat-left .chat-content { color: #76838f; background-color: #dfe9ef; } .chat-left .chat-content:before { border-right-color: #dfe9ef; border-left-color: transparent; } .chat-left .chat-content + .chat-content:before { border-color: transparent; } .chat-left .chat-time { color: #a3afb7; } .step { background-color: #f3f7f9; } .step-number { color: #fff; background: #e4eaec; } .step-title { color: #526069; } .step.current { color: #fff; background-color: #677ae4; } .step.current .step-title { color: #fff; } .step.current .step-number { color: #677ae4; background-color: #fff; } .step.disabled { color: #ccd5db; } .step.disabled .step-title { color: #ccd5db; } .step.disabled .step-number { background-color: #ccd5db; } .step.error { color: #fff; background-color: #f96868; } .step.error .step-title { color: #fff; } .step.error .step-number { color: #f96868; background-color: #fff; } .step.done { color: #fff; background-color: #46be8a; } .step.done .step-title { color: #fff; } .step.done .step-number { color: #46be8a; background-color: #fff; } .pearl:before, .pearl:after { background-color: #f3f7f9; } .pearl-number, .pearl-icon { color: #fff; background: #ccd5db; border-color: #ccd5db; } .pearl-title { color: #526069; } .pearl.current:before, .pearl.current:after { background-color: #677ae4; } .pearl.current .pearl-number, .pearl.current .pearl-icon { color: #677ae4; background-color: #fff; border-color: #677ae4; } .pearl.disabled:before, .pearl.disabled:after { background-color: #f3f7f9; } .pearl.disabled .pearl-number, .pearl.disabled .pearl-icon { color: #fff; background-color: #ccd5db; border-color: #ccd5db; } .pearl.error:before { background-color: #677ae4; } .pearl.error:after { background-color: #f3f7f9; } .pearl.error .pearl-number, .pearl.error .pearl-icon { color: #f96868; background-color: #fff; border-color: #f96868; } .pearl.done:before, .pearl.done:after { background-color: #677ae4; } .pearl.done .pearl-number, .pearl.done .pearl-icon { color: #fff; background-color: #677ae4; border-color: #677ae4; } .timeline { background: transparent; } .timeline:before { background-color: #e4eaec; } .timeline > li.timeline-period { background: #f1f4f5; } .timeline-dot { color: #fff; background-color: #677ae4; } .timeline-info { background: #e4eaec; border: 1px solid #e4eaec; } .testimonial-content { background-color: #f3f7f9; } .testimonial-content:before { background-color: #f3f7f9; } .testimonial-control a { color: #ccd5db; } .testimonial-control a:hover { color: #8897ec; } .ribbon-primary .ribbon-inner { background-color: #677ae4; } .ribbon-primary.ribbon-bookmark .ribbon-inner:before { border-color: #677ae4; border-right-color: transparent; } .ribbon-primary.ribbon-bookmark.ribbon-reverse .ribbon-inner:before { border-right-color: #677ae4; border-left-color: transparent; } .ribbon-primary.ribbon-bookmark.ribbon-vertical .ribbon-inner:before { border-right-color: #677ae4; border-bottom-color: transparent; } .ribbon-primary.ribbon-bookmark.ribbon-vertical.ribbon-reverse .ribbon-inner:before { border-right-color: #677ae4; border-bottom-color: transparent; border-left-color: #677ae4; } .ribbon-primary.ribbon-corner .ribbon-inner { background-color: transparent; } .ribbon-primary.ribbon-corner .ribbon-inner:before { border-top-color: #677ae4; border-left-color: #677ae4; } .ribbon-primary.ribbon-corner.ribbon-reverse .ribbon-inner:before { border-right-color: #677ae4; border-left-color: transparent; } .ribbon-primary.ribbon-corner.ribbon-bottom .ribbon-inner:before { border-top-color: transparent; border-bottom-color: #677ae4; } .ribbon-primary .ribbon-inner:after { border-top-color: #5166d6; border-right-color: #5166d6; } .ribbon-primary.ribbon-reverse .ribbon-inner:after { border-right-color: transparent; border-left-color: #5166d6; } .ribbon-primary.ribbon-bottom .ribbon-inner:after { border-top-color: transparent; border-bottom-color: #5166d6; } .ribbon-success .ribbon-inner { background-color: #46be8a; } .ribbon-success.ribbon-bookmark .ribbon-inner:before { border-color: #46be8a; border-right-color: transparent; } .ribbon-success.ribbon-bookmark.ribbon-reverse .ribbon-inner:before { border-right-color: #46be8a; border-left-color: transparent; } .ribbon-success.ribbon-bookmark.ribbon-vertical .ribbon-inner:before { border-right-color: #46be8a; border-bottom-color: transparent; } .ribbon-success.ribbon-bookmark.ribbon-vertical.ribbon-reverse .ribbon-inner:before { border-right-color: #46be8a; border-bottom-color: transparent; border-left-color: #46be8a; } .ribbon-success.ribbon-corner .ribbon-inner { background-color: transparent; } .ribbon-success.ribbon-corner .ribbon-inner:before { border-top-color: #46be8a; border-left-color: #46be8a; } .ribbon-success.ribbon-corner.ribbon-reverse .ribbon-inner:before { border-right-color: #46be8a; border-left-color: transparent; } .ribbon-success.ribbon-corner.ribbon-bottom .ribbon-inner:before { border-top-color: transparent; border-bottom-color: #46be8a; } .ribbon-success .ribbon-inner:after { border-top-color: #36ab7a; border-right-color: #36ab7a; } .ribbon-success.ribbon-reverse .ribbon-inner:after { border-right-color: transparent; border-left-color: #36ab7a; } .ribbon-success.ribbon-bottom .ribbon-inner:after { border-top-color: transparent; border-bottom-color: #36ab7a; } .ribbon-info .ribbon-inner { background-color: #57c7d4; } .ribbon-info.ribbon-bookmark .ribbon-inner:before { border-color: #57c7d4; border-right-color: transparent; } .ribbon-info.ribbon-bookmark.ribbon-reverse .ribbon-inner:before { border-right-color: #57c7d4; border-left-color: transparent; } .ribbon-info.ribbon-bookmark.ribbon-vertical .ribbon-inner:before { border-right-color: #57c7d4; border-bottom-color: transparent; } .ribbon-info.ribbon-bookmark.ribbon-vertical.ribbon-reverse .ribbon-inner:before { border-right-color: #57c7d4; border-bottom-color: transparent; border-left-color: #57c7d4; } .ribbon-info.ribbon-corner .ribbon-inner { background-color: transparent; } .ribbon-info.ribbon-corner .ribbon-inner:before { border-top-color: #57c7d4; border-left-color: #57c7d4; } .ribbon-info.ribbon-corner.ribbon-reverse .ribbon-inner:before { border-right-color: #57c7d4; border-left-color: transparent; } .ribbon-info.ribbon-corner.ribbon-bottom .ribbon-inner:before { border-top-color: transparent; border-bottom-color: #57c7d4; } .ribbon-info .ribbon-inner:after { border-top-color: #47b8c6; border-right-color: #47b8c6; } .ribbon-info.ribbon-reverse .ribbon-inner:after { border-right-color: transparent; border-left-color: #47b8c6; } .ribbon-info.ribbon-bottom .ribbon-inner:after { border-top-color: transparent; border-bottom-color: #47b8c6; } .ribbon-warning .ribbon-inner { background-color: #f2a654; } .ribbon-warning.ribbon-bookmark .ribbon-inner:before { border-color: #f2a654; border-right-color: transparent; } .ribbon-warning.ribbon-bookmark.ribbon-reverse .ribbon-inner:before { border-right-color: #f2a654; border-left-color: transparent; } .ribbon-warning.ribbon-bookmark.ribbon-vertical .ribbon-inner:before { border-right-color: #f2a654; border-bottom-color: transparent; } .ribbon-warning.ribbon-bookmark.ribbon-vertical.ribbon-reverse .ribbon-inner:before { border-right-color: #f2a654; border-bottom-color: transparent; border-left-color: #f2a654; } .ribbon-warning.ribbon-corner .ribbon-inner { background-color: transparent; } .ribbon-warning.ribbon-corner .ribbon-inner:before { border-top-color: #f2a654; border-left-color: #f2a654; } .ribbon-warning.ribbon-corner.ribbon-reverse .ribbon-inner:before { border-right-color: #f2a654; border-left-color: transparent; } .ribbon-warning.ribbon-corner.ribbon-bottom .ribbon-inner:before { border-top-color: transparent; border-bottom-color: #f2a654; } .ribbon-warning .ribbon-inner:after { border-top-color: #ec9940; border-right-color: #ec9940; } .ribbon-warning.ribbon-reverse .ribbon-inner:after { border-right-color: transparent; border-left-color: #ec9940; } .ribbon-warning.ribbon-bottom .ribbon-inner:after { border-top-color: transparent; border-bottom-color: #ec9940; } .ribbon-danger .ribbon-inner { background-color: #f96868; } .ribbon-danger.ribbon-bookmark .ribbon-inner:before { border-color: #f96868; border-right-color: transparent; } .ribbon-danger.ribbon-bookmark.ribbon-reverse .ribbon-inner:before { border-right-color: #f96868; border-left-color: transparent; } .ribbon-danger.ribbon-bookmark.ribbon-vertical .ribbon-inner:before { border-right-color: #f96868; border-bottom-color: transparent; } .ribbon-danger.ribbon-bookmark.ribbon-vertical.ribbon-reverse .ribbon-inner:before { border-right-color: #f96868; border-bottom-color: transparent; border-left-color: #f96868; } .ribbon-danger.ribbon-corner .ribbon-inner { background-color: transparent; } .ribbon-danger.ribbon-corner .ribbon-inner:before { border-top-color: #f96868; border-left-color: #f96868; } .ribbon-danger.ribbon-corner.ribbon-reverse .ribbon-inner:before { border-right-color: #f96868; border-left-color: transparent; } .ribbon-danger.ribbon-corner.ribbon-bottom .ribbon-inner:before { border-top-color: transparent; border-bottom-color: #f96868; } .ribbon-danger .ribbon-inner:after { border-top-color: #e9595b; border-right-color: #e9595b; } .ribbon-danger.ribbon-reverse .ribbon-inner:after { border-right-color: transparent; border-left-color: #e9595b; } .ribbon-danger.ribbon-bottom .ribbon-inner:after { border-top-color: transparent; border-bottom-color: #e9595b; } .color-selector > li { background-color: #677ae4; } .color-selector > li input[type="radio"]:checked + label:after { color: #fff; } .color-selector > li.color-selector-disabled { background-color: #ccd5db !important; }
killprd/tiwwocz
frontend/media/assets/skins/indigo.css
CSS
bsd-3-clause
168,150
package com.compositesw.services.system.admin.resource; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.compositesw.services.system.util.common.AttributeList; /** * <p>Java class for foreignKey complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="foreignKey"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="primaryKeyName" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="primaryKeyTable" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="columns"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="column" type="{http://www.compositesw.com/services/system/admin/resource}foreignKeyColumn" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="attributes" type="{http://www.compositesw.com/services/system/util/common}attributeList" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "foreignKey", propOrder = { "name", "primaryKeyName", "primaryKeyTable", "columns", "attributes" }) public class ForeignKey { @XmlElement(required = true) protected String name; @XmlElement(required = true) protected String primaryKeyName; @XmlElement(required = true) protected String primaryKeyTable; @XmlElement(required = true) protected ForeignKey.Columns columns; protected AttributeList attributes; /** * Gets the value of the name property. * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * Sets the value of the name property. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } /** * Gets the value of the primaryKeyName property. * * @return * possible object is * {@link String } * */ public String getPrimaryKeyName() { return primaryKeyName; } /** * Sets the value of the primaryKeyName property. * * @param value * allowed object is * {@link String } * */ public void setPrimaryKeyName(String value) { this.primaryKeyName = value; } /** * Gets the value of the primaryKeyTable property. * * @return * possible object is * {@link String } * */ public String getPrimaryKeyTable() { return primaryKeyTable; } /** * Sets the value of the primaryKeyTable property. * * @param value * allowed object is * {@link String } * */ public void setPrimaryKeyTable(String value) { this.primaryKeyTable = value; } /** * Gets the value of the columns property. * * @return * possible object is * {@link ForeignKey.Columns } * */ public ForeignKey.Columns getColumns() { return columns; } /** * Sets the value of the columns property. * * @param value * allowed object is * {@link ForeignKey.Columns } * */ public void setColumns(ForeignKey.Columns value) { this.columns = value; } /** * Gets the value of the attributes property. * * @return * possible object is * {@link AttributeList } * */ public AttributeList getAttributes() { return attributes; } /** * Sets the value of the attributes property. * * @param value * allowed object is * {@link AttributeList } * */ public void setAttributes(AttributeList value) { this.attributes = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="column" type="{http://www.compositesw.com/services/system/admin/resource}foreignKeyColumn" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "column" }) public static class Columns { protected List<ForeignKeyColumn> column; /** * Gets the value of the column property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the column property. * * <p> * For example, to add a new item, do as follows: * <pre> * getColumn().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ForeignKeyColumn } * * */ public List<ForeignKeyColumn> getColumn() { if (column == null) { column = new ArrayList<ForeignKeyColumn>(); } return this.column; } } }
dvbu-test/PDTool
CISAdminApi7.0.0/src/com/compositesw/services/system/admin/resource/ForeignKey.java
Java
bsd-3-clause
6,513
<?php namespace test\m\p; class j { }
theosyspe/levent_01
vendor/ZF2/bin/test/m/p/j.php
PHP
bsd-3-clause
37
<?php /** * If you need an environment-specific system or application configuration, * there is an example in the documentation * @see http://framework.zend.com/manual/current/en/tutorials/config.advanced.html#environment-specific-system-configuration * @see http://framework.zend.com/manual/current/en/tutorials/config.advanced.html#environment-specific-application-configuration */ return array( // This should be an array of module namespaces used in the application. 'modules' => array( 'Application', 'Users', ), // These are various options for the listeners attached to the ModuleManager 'module_listener_options' => array( // This should be an array of paths in which modules reside. // If a string key is provided, the listener will consider that a module // namespace, the value of that key the specific path to that module's // Module class. 'module_paths' => array( './module', './vendor', ), // An array of paths from which to glob configuration files after // modules are loaded. These effectively override configuration // provided by modules themselves. Paths may use GLOB_BRACE notation. 'config_glob_paths' => array( 'config/autoload/{{,*.}global,{,*.}local}.php', ), // Whether or not to enable a configuration cache. // If enabled, the merged configuration will be cached and used in // subsequent requests. //'config_cache_enabled' => $booleanValue, // The key used to create the configuration cache file name. //'config_cache_key' => $stringKey, // Whether or not to enable a module class map cache. // If enabled, creates a module class map cache which will be used // by in future requests, to reduce the autoloading process. //'module_map_cache_enabled' => $booleanValue, // The key used to create the class map cache file name. //'module_map_cache_key' => $stringKey, // The path in which to cache merged configuration. //'cache_dir' => $stringPath, // Whether or not to enable modules dependency checking. // Enabled by default, prevents usage of modules that depend on other modules // that weren't loaded. // 'check_dependencies' => true, ), // Used to create an own service manager. May contain one or more child arrays. //'service_listener_options' => array( // array( // 'service_manager' => $stringServiceManagerName, // 'config_key' => $stringConfigKey, // 'interface' => $stringOptionalInterface, // 'method' => $stringRequiredMethodName, // ), // ), // Initial configuration with which to seed the ServiceManager. // Should be compatible with Zend\ServiceManager\Config. // 'service_manager' => array(), );
nassafou/comm-app
config/application.config.php
PHP
bsd-3-clause
2,971
package com.oracle.pts.ws; import com.oracle.pts.custom.AttributeEntry; import com.oracle.pts.custom.CustomFieldHolder; import com.oracle.pts.custom.DataSet; import com.oracle.pts.custom.MetaInfo; import com.oracle.pts.custom.MetaInfoFactory; import com.oracle.pts.custom.OptyMetaInfoFactory; import com.oracle.pts.custom.SalesPartyMetaInfoFactory; import com.oracle.pts.util.XMLUtil; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.xml.soap.SOAPBody; import javax.xml.soap.SOAPElement; import javax.xml.soap.SOAPHeader; import javax.xml.soap.SOAPPart; import javax.xml.ws.handler.soap.SOAPMessageContext; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class CRMProcessor { // private String objName; private MetaInfoFactory metaInfoFactory; private MetaInfo metaInfo; // private List<DataSet> dataSetList; public static final int DEPTH = 1; private XMLUtil xmlUtil; public static boolean disable; private String objectName = null; public static final String OPPORTUNITY = "OPPORTUNITY"; public static final String SALEA_PARTY = "SALEA_PARTY"; public CRMProcessor() { super(); init(); } public CRMProcessor(String objectName) { super(); this.objectName=objectName; init(); } private void init(){ if(objectName!=null){ if(objectName.equalsIgnoreCase(SALEA_PARTY)){ metaInfoFactory = new SalesPartyMetaInfoFactory(); metaInfo = metaInfoFactory.getMetaInfo(); } else if(objectName.equalsIgnoreCase(OPPORTUNITY)){ metaInfoFactory = new OptyMetaInfoFactory(); metaInfo = metaInfoFactory.getMetaInfo(); } } else{ metaInfoFactory = new SalesPartyMetaInfoFactory(); metaInfo = metaInfoFactory.getMetaInfo(); xmlUtil = new XMLUtil(); } } public boolean handleMessage(SOAPMessageContext ctx) { CustomFieldHolder customFieldHolder = new CustomFieldHolder(); String objectName = customFieldHolder.getObjectName(); System.out.println("objectName ************** " + objectName); SOAPBody soapBody; SOAPHeader soapHeader; SOAPPart soapPart; try { soapBody = ctx.getMessage().getSOAPBody(); soapHeader = ctx.getMessage().getSOAPHeader(); soapPart = ctx.getMessage().getSOAPPart(); XMLUtil xmlUtil = new XMLUtil(); NodeList nodeList = soapBody.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); String nodeName = node.getNodeName(); nodeName = nodeName.substring(node.getNodeName().indexOf(":") + 1, nodeName.length()); System.out.println("name *************** " + nodeName); if (nodeName.equals("create"+objectName)) { handleCreateEntity(node); xmlUtil.print(soapBody); } else if (nodeName.equals("delete"+objectName)) { // no need modification for delete } else if (nodeName.equals("update" + objectName)) { System.out.println("findUpdate" + objectName + "*******************"); xmlUtil.print(soapBody); handleupdateEntity(node); } else if (nodeName.equals("get"+objectName)) { } else if (nodeName.equals("find" + objectName + "Response")) { System.out.println("find" + objectName + "Response*******************"); handlefindEntityResponse(node); xmlUtil.print(soapBody); } else if (nodeName.equals("create" + objectName + "Response")) { System.out.println("create" + objectName + "Response*******************"); xmlUtil.print(soapBody); } else if (nodeName.equals("get" + objectName + "Response")) { System.out.println("get" + objectName + "Response*******************"); // xmlUtil.print(soapBody); handlegetEntityResponse(node); } } System.out.println("mBody****"); // xmlUtil.print(soapBody); } catch (Exception e) { e.printStackTrace(); } return true; } public void handleCreateEntity(Node node) { CustomFieldHolder customFieldHolder = new CustomFieldHolder(); String objectName = customFieldHolder.getObjectName(); try { String prefix = ""; NodeList cNodeList = node.getChildNodes(); for (int j = 0; j < cNodeList.getLength(); j++) { Node cNode = cNodeList.item(j); String cNodeName = cNode.getNodeName(); cNodeName = cNodeName.substring(cNode.getNodeName().indexOf(":") + 1, cNodeName.length()); System.out.println("cName *********** " + cNodeName); if (cNodeName.equalsIgnoreCase(objectName)) { NodeList ccNodeList = cNode.getChildNodes(); for (int k = 0; k < ccNodeList.getLength(); k++) { Node ccNode = ccNodeList.item(k); String ccNodeName = ccNode.getNodeName(); ccNodeName = ccNodeName.substring(ccNode.getNodeName().indexOf(":") + 1, ccNodeName.length()); prefix = ccNode.getNodeName().substring(0, ccNode.getNodeName().indexOf(":")); break; } System.out.println("prefix ********* " + prefix); SOAPElement soapElement = (SOAPElement)cNode; List<AttributeEntry> attrList = customFieldHolder.getDataSet().getAttributeList(); for(AttributeEntry attr:attrList){ String fieldName = attr.getName(); String fieldValue = attr.getValue(); SOAPElement customElement = soapElement.addChildElement(fieldName, prefix); customElement.addTextNode(fieldValue); } List<DataSet> cDataSetList = customFieldHolder.getDataSet().getChildDataSet(); for(DataSet cDataSet:cDataSetList){ SOAPElement customElement = soapElement.addChildElement(cDataSet.getName(), prefix); for(AttributeEntry attr:cDataSet.getAttributeList()){ SOAPElement cCustomElement = customElement.addChildElement(attr.getName(),prefix); cCustomElement.addTextNode(attr.getValue()); } } } } } catch (Exception e) { e.printStackTrace(); } } public void handleupdateEntity(Node node) { handleCreateEntity(node); } public void handlefindEntityResponse(Node node) { try { String prefix = ""; NodeList cNodeList = node.getChildNodes(); for (int j = 0; j < cNodeList.getLength(); j++) { Node cNode = cNodeList.item(j); String cNodeName = cNode.getNodeName(); cNodeName = cNodeName.substring(cNode.getNodeName().indexOf(":") + 1, cNodeName.length()); if (cNodeName.equals("result")) { CustomFieldHolder customFieldHolder = new CustomFieldHolder(); List<DataSet> dataSetList = customFieldHolder.getDataSetList(); DataSet dataSet = new DataSet(); dataSet.setName(customFieldHolder.getObjectName()); String keyName = CustomFieldHolder.getKeyName(dataSet.getName()); NodeList ccNodeList = cNode.getChildNodes(); for (int k = 0; k < ccNodeList.getLength(); k++) { Node ccNode = ccNodeList.item(k); String ccNodeName = ccNode.getNodeName(); ccNodeName = ccNodeName.substring(ccNode.getNodeName().indexOf(":") + 1, ccNodeName.length()); MetaInfo cMetaInfo = metaInfo.getChildMetaInfo(ccNodeName); if (cMetaInfo!=null ) {// child DataSet cDataSet = dataSet.getChildDataSetByName(ccNodeName); processData(cDataSet,ccNode,cMetaInfo); } else{ // attribute if(keyName.equals(ccNodeName)){ dataSet.setId(ccNode.getTextContent()); } if (ccNodeName.contains("_c")) { AttributeEntry attr = new AttributeEntry(); attr.setName(ccNodeName); attr.setValue(ccNode.getTextContent()); dataSet.getAttributeList().add(attr); } } } dataSetList.add(dataSet); SOAPElement soapElement = (SOAPElement)cNode; } } } catch (Exception e) { e.printStackTrace(); } } public void handlegetEntityResponse(Node node) { handlefindEntityResponse(node); } public void processData(DataSet dataSet,Node node,MetaInfo metaInfo) { String keyName = CustomFieldHolder.getKeyName(dataSet.getName()); NodeList cNodeList = node.getChildNodes(); for (int i = 0; i < cNodeList.getLength(); i++) { Node cNode = cNodeList.item(i); String cNodeName = cNode.getNodeName().substring(cNode.getNodeName().lastIndexOf(':') + 1, cNode.getNodeName().length()); MetaInfo cMetaInfo = metaInfo.getChildMetaInfo(cNodeName); if (cMetaInfo!=null ) { String type = metaInfo.getChildListType().get(cNodeName); DataSet cDataSet = dataSet.getChildDataSetByName(cNodeName); String subType = metaInfo.getChildListSubType().get(cNodeName); cDataSet.setType(type); cDataSet.setSubType(subType); cDataSet.setParentDataSet(dataSet); cDataSet.setDepth(dataSet.getDepth()+1); if(cDataSet.getDepth()<CRMProcessor.DEPTH){ processData(cDataSet,cNode,cMetaInfo); } } else{ if(cNodeName.equals("#text")==false){ if(keyName.equals(cNodeName)){ dataSet.setId(cNode.getTextContent()); } if (cNodeName.contains("_c")) { AttributeEntry attributeEntry = new AttributeEntry(); attributeEntry.setLabel(cNodeName); attributeEntry.setName(cNodeName); attributeEntry.setValue(cNode.getTextContent()); dataSet.getAttributeList().add(attributeEntry); } } } } } }
delkyd/Oracle-Cloud
PaaS-SaaS_DynamicWS/CFHandler/JAX_WS_handlers_Accelerator/JAX_WS_handlers_Accelerator/src/com/oracle/pts/ws/CRMProcessor.java
Java
bsd-3-clause
13,296
#! /bin/bash killall -9 nameserver killall -9 chunkserver killall -9 bfs_client rm -rf nameserver* chunkserver* rm -rf master* slave* rm -rf bfs_client rm -rf bfs.flag rm -rf client.* rm -rf core.*
00k/ToyDFS
sandbox/clear.sh
Shell
bsd-3-clause
200
/* =============================================================================== FILE: LASzipper.hpp CONTENTS: Writes (optionally compressed) LIDAR points to LAS formats 1.0 - 1.3. This is not actually used by LASlib but by the LASzip interface of libLAS. PROGRAMMERS: martin.isenburg@gmail.com - http://rapidlasso.com COPYRIGHT: (c) 2007-2012, martin isenburg, rapidlasso - tools to catch reality This is free software; you can redistribute and/or modify it under the terms of the GNU Lesser General Licence as published by the Free Software Foundation. See the COPYING file for more information. This software is distributed WITHOUT ANY WARRANTY and without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. CHANGE HISTORY: 8 May 2011 -- added an option for variable chunking via chunk() 23 April 2011 -- changed interface for simplicity and chunking support 10 January 2011 -- licensing change for LGPL release and liblas integration 12 December 2010 -- created from LASwriter/LASreader after Howard got pushy (-; =============================================================================== */ #ifndef LAS_ZIPPER_HPP #define LAS_ZIPPER_HPP #include <stdio.h> #include "laszip.hpp" #ifdef LZ_WIN32_VC6 #include <fstream.h> #else #include <istream> #include <fstream> using namespace std; #endif class ByteStreamOut; class LASwritePoint; class LASZIP_DLL LASzipper { public: bool open(FILE* outfile, const LASzip* laszip); bool open(ostream& outstream, const LASzip* laszip); bool write(const unsigned char* const * point); bool chunk(); bool close(); LASzipper(); ~LASzipper(); // in case a function returns false this string describes the problem const char* get_error() const; private: unsigned int count; ByteStreamOut* stream; LASwritePoint* writer; bool return_error(const char* err); char* error_string; }; #endif
saeedghsh/SSRR13
Andreas/slam6d/3rdparty/lastools/laslib/inc/laszipper.hpp
C++
bsd-3-clause
2,061
<!DOCTYPE html> <html> <head> <title>cannon.js - bounce demo</title> <meta charset="utf-8"> <link rel="stylesheet" href="css/style.css" type="text/css"/> </head> <body> <script src="../build/cannon.js"></script> <script src="../build/cannon.demo.js"></script> <script src="../libs/dat.gui.js"></script> <script src="../libs/Three.js"></script> <script src="../libs/TrackballControls.js"></script> <script src="../libs/Detector.js"></script> <script src="../libs/Stats.js"></script> <script src="../libs/smoothie.js"></script> <script> var demo = new CANNON.Demo(); var size = 1; var height = 5; var damping = 0.01; demo.addScene("Bounce",function(){ var world = demo.getWorld(); world.gravity.set(0,0,-10); world.broadphase = new CANNON.NaiveBroadphase(); // ground plane var groundMaterial = new CANNON.Material(); var groundShape = new CANNON.Plane(); var groundBody = new CANNON.Body({ mass: 0, material: groundMaterial }); groundBody.addShape(groundShape); world.add(groundBody); demo.addVisual(groundBody); var mass = 10; var sphereShape = new CANNON.Sphere(size); // Shape on plane var mat1 = new CANNON.Material(); var shapeBody1 = new CANNON.Body({ mass: mass, material: mat1 }); shapeBody1.addShape(sphereShape); shapeBody1.position.set(3*size, size, height); shapeBody1.linearDamping = damping; world.add(shapeBody1); demo.addVisual(shapeBody1); var mat2 = new CANNON.Material(); var shapeBody2 = new CANNON.Body({ mass: mass, material: mat2 }); shapeBody2.addShape(sphereShape); shapeBody2.position.set(0 , size , height); shapeBody2.linearDamping = damping; world.add(shapeBody2); demo.addVisual(shapeBody2); var mat3 = new CANNON.Material(); var shapeBody3 = new CANNON.Body({ mass: mass, material: mat3 }); shapeBody3.addShape(sphereShape); shapeBody3.position.set(-3*size , size , height); shapeBody3.linearDamping = damping; world.add(shapeBody3); demo.addVisual(shapeBody3); // Create contact material behaviour var mat1_ground = new CANNON.ContactMaterial(groundMaterial, mat1, { friction: 0.0, restitution: 0.0 }); var mat2_ground = new CANNON.ContactMaterial(groundMaterial, mat2, { friction: 0.0, restitution: 0.7 }); var mat3_ground = new CANNON.ContactMaterial(groundMaterial, mat3, { friction: 0.0, restitution: 0.9 }); world.addContactMaterial(mat1_ground); world.addContactMaterial(mat2_ground); world.addContactMaterial(mat3_ground); }); demo.start(); </script> </body> </html>
kustomzone/kzone
node_modules/cannon/demos/bounce.html
HTML
bsd-3-clause
3,023
// Copyright 2017 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "fxjs/xfa/cjx_container.h" #include <vector> #include "fxjs/xfa/cfxjse_class.h" #include "fxjs/xfa/cfxjse_engine.h" #include "fxjs/xfa/cfxjse_value.h" #include "xfa/fxfa/parser/cxfa_arraynodelist.h" #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/cxfa_field.h" const CJX_MethodSpec CJX_Container::MethodSpecs[] = { {"getDelta", getDelta_static}, {"getDeltas", getDeltas_static}}; CJX_Container::CJX_Container(CXFA_Node* node) : CJX_Node(node) { DefineMethods(MethodSpecs); } CJX_Container::~CJX_Container() {} bool CJX_Container::DynamicTypeIs(TypeTag eType) const { return eType == static_type__ || ParentType__::DynamicTypeIs(eType); } CJS_Result CJX_Container::getDelta( CFX_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) { return CJS_Result::Success(); } CJS_Result CJX_Container::getDeltas( CFX_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) { auto* pEngine = static_cast<CFXJSE_Engine*>(runtime); return CJS_Result::Success(pEngine->NewXFAObject( new CXFA_ArrayNodeList(GetDocument()), GetDocument()->GetScriptContext()->GetJseNormalClass()->GetTemplate())); }
endlessm/chromium-browser
third_party/pdfium/fxjs/xfa/cjx_container.cpp
C++
bsd-3-clause
1,423
## Unit Tests The unit tests are located in ```src/test/java/com/yahoo/gondola/core/GondolaTest.java```. To run the unit tests without having to build the package: ``` mvn test ``` To run a single test, for example, the test called 'missingEntry': ``` mvn test -Dtest=GondolaTest#missingEntry ``` ## Tsunami Test This fuzz test is designed to find concurrency bugs in the Raft implementation. Here's how it works: 1. The test creates N writer threads for each node in the Raft cluster. 2. A writer thread has an id and a private counter and attempts to write its thread id and counter value to its assigned node. When a write succeeds, the counter is incremented. Writes by threads assigned to the current leader are expected to succeed whereas writes by threads threads assigned to non-leaders are expected to get exceptions. 3. A single reader thread reads Raft entries, one-at-a-time, from each node in round-robin fashion and ensures that the entries are identical. 4. The reader also records the counter values for every writer and checks that the latest counter values are monotonically increasing. 5. A restarter thread randomly and continuously restarts nodes to simulate random server failures. 6. The Tsunami storage implementation induces random failures on all storage operations. 7. The Tsunami network implementation generates random read, write, and connection failures on all networking operations. The wrapper will also delay and duplicate sent messages. #### Running Tsunami To run the Tsunami test you will need access to a MySQL database. Edit ```conf/gondola-tsunami.conf``` and set the fields - url, user, password - with the correct credentials to your database. ``` storage_mysql { class = com.yahoo.gondola.impl.MySqlStorage url = "jdbc:mysql://127.0.0.1:3306/gondola" user = root password = root } ``` The test will automatically create the necessary tables if it doesn't find them. In one console, run the gondola agent command. This process listens for commands to start and stop a gondola instance. ``` > ./bin/gondola-agent 2015-09-27 10:07:58,638 INFO Initialize system, kill all gondola processes 2015-09-27 10:07:59,973 INFO Listening on port 1200 ... ``` In another console, run the tsunami test: ``` > ./bin/tsunami Dropping all tables 2015-09-27 10:20:00,879 INFO Connecting to gondola agent at localhost:1200 2015-09-27 10:20:00,881 INFO Connecting to gondola agent at localhost:1200 2015-09-27 10:20:00,882 INFO Connecting to gondola agent at localhost:1200 2015-09-27 10:20:00,968 INFO writes: 0, reads: 0, errors: 0, waiting for index=0 on host1 2015-09-27 10:20:00,970 INFO Creating instance host1 2015-09-27 10:20:00,980 INFO host1: up=false, host2: up=false, host3: up=false 2015-09-27 10:20:00,980 INFO lastWrite: 0, lastRead: 0 2015-09-27 10:20:01,013 INFO Creating instance host2 2015-09-27 10:20:01,018 INFO Creating instance host3 2015-09-27 10:20:06,050 INFO --- SAFE phase --- 2015-09-27 10:20:09,612 INFO --- NASTY phase --- 2015-09-27 10:20:10,980 INFO writes: 80, reads: 79, errors: 30, waiting for index=80 on host2 2015-09-27 10:20:10,981 INFO host1: up=true, host2: up=true, host3: up=true 2015-09-27 10:20:10,981 INFO lastWrite: 80, lastRead: 79 2015-09-27 10:20:13,316 INFO Killing instance host2 2015-09-27 10:20:13,694 ERROR EOF: Failed to execute: g 124 30000 2015-09-27 10:20:13,697 ERROR EOF: Failed to execute: g 124 30000 2015-09-27 10:20:18,274 INFO Killing instance host3 2015-09-27 10:20:19,325 INFO Failed to write A2-45: [localhost:1099] c A2-45 -> ERROR: Not leader - leader is null 2015-09-27 10:20:19,325 INFO Failed to write A0-48: [localhost:1099] c A0-48 -> ERROR: Not leader - leader is null 2015-09-27 10:20:19,325 INFO Failed to write A4-47: [localhost:1099] c A4-47 -> ERROR: Not leader - leader is null 2015-09-27 10:20:19,325 INFO Failed to write A1-49: [localhost:1099] c A1-49 -> ERROR: Not leader - leader is null 2015-09-27 10:20:19,326 INFO Failed to write A3-41: [localhost:1099] c A3-41 -> ERROR: Not leader - leader is null 2015-09-27 10:20:20,413 INFO Creating instance host2 2015-09-27 10:20:20,985 INFO writes: 225, reads: 123, errors: 82, waiting for index=124 on host2 2015-09-27 10:20:20,985 INFO host1: up=true, host2: up=true, host3: up=false 2015-09-27 10:20:20,985 INFO lastWrite: 225, lastRead: 123 2015-09-27 10:20:23,192 ERROR EOF: Failed to execute: g 124 30000 2015-09-27 10:20:27,938 INFO Creating instance host3 2015-09-27 10:20:30,986 INFO writes: 246, reads: 214, errors: 128, waiting for index=215 on host2 2015-09-27 10:20:30,987 INFO host1: up=true, host2: up=true, host3: up=true 2015-09-27 10:20:30,987 INFO lastWrite: 252, lastRead: 214 2015-09-27 10:20:31,033 INFO Killing instance host3 2015-09-27 10:20:32,396 INFO Creating instance host3 2015-09-27 10:20:33,485 ERROR [localhost:1099] g 229 30000 -> ERROR: Unhandled exception: Nasty exception for index=229 2015-09-27 10:20:33,901 INFO Killing instance host2 2015-09-27 10:20:35,504 WARN Command at index 232 for writer A0=48 is a duplicate 2015-09-27 10:20:35,508 WARN Command at index 233 for writer A2=45 is a duplicate 2015-09-27 10:20:35,511 WARN Command at index 234 for writer A1=49 is a duplicate 2015-09-27 10:20:35,515 WARN Command at index 235 for writer A3=41 is a duplicate 2015-09-27 10:20:35,518 WARN Command at index 236 for writer A4=47 is a duplicate 2015-09-27 10:20:40,990 INFO writes: 444, reads: 449, errors: 194, waiting for index=450 on host2 2015-09-27 10:20:40,991 INFO host1: up=true, host2: up=false, host3: up=true 2015-09-27 10:20:40,991 INFO lastWrite: 450, lastRead: 449 2015-09-27 10:20:42,429 INFO Creating instance host2 2015-09-27 10:20:50,991 INFO writes: 640, reads: 645, errors: 259, waiting for index=646 on host2 2015-09-27 10:20:50,991 INFO host1: up=true, host2: up=true, host3: up=true 2015-09-27 10:20:50,992 INFO lastWrite: 646, lastRead: 645 2015-09-27 10:20:56,000 INFO Killing instance host2 2015-09-27 10:20:58,709 INFO Creating instance host2 2015-09-27 10:21:00,994 INFO writes: 830, reads: 835, errors: 329, waiting for index=836 on host2 2015-09-27 10:21:00,995 INFO host1: up=true, host2: up=true, host3: up=true 2015-09-27 10:21:00,995 INFO lastWrite: 836, lastRead: 835 2015-09-27 10:21:01,102 ERROR [localhost:1099] g 838 30000 -> ERROR: Unhandled exception: Nasty exception for index=838 2015-09-27 10:21:02,103 ERROR EOF: Failed to execute: g 838 30000 2015-09-27 10:21:10,584 INFO --- SYNC phase --- 2015-09-27 10:21:10,995 INFO writes: 1024, reads: 1030, errors: 396, waiting for index=1031 on host1 2015-09-27 10:21:10,995 INFO host1: up=true, host2: up=true, host3: up=true 2015-09-27 10:21:10,995 INFO lastWrite: 1030, lastRead: 1030 2015-09-27 10:21:12,792 INFO Creating instance host3 2015-09-27 10:21:12,796 INFO --- SAFE phase --- ... 2015-09-27 06:33:42,210 ERROR Command index=270742 from host1=A1-19118 does not match command from host2=A0-19014 > ``` Run the tsunimi test for as long as you can, days if possible. It will continously try to find an error in the Raft implementation. As it runs, it periodically prints out its status: ``` writes: 640, reads: 645, errors: 259... ``` As long as the number of write and reads continue to increase, the test is running properly. If tsunami does find an issue, the test will exit and print one of two types of errors: * Command at index X...does not match...": This error indicates that not all hosts are returning the same value at index X. * Command at index X for writer...is not one bigger than last index: This error indicates that the counter written by a writer is not equal to or one larger than it's last written value. Either a value was lost or an older value reappeared. ## Performance TODO ## Usage #### Code The first step in using Gondola is to copy the config file ```conf/gondola-sample.conf```. It contains a sample of a host/shard topology that you can modify to hold your topology. From this config file, you can create a Gondola instance. The following are the lines of code to commit a command to the Raft log: ``` Config config = new Config(new File(configFile)); Gondola gondola = new Gondola(config, hostId); Shard shard = gondola.getShard(shardId); Command command = shard.checkoutCommand(); command.commit(bytes, offset, len); ``` The following lines of code is used to retrieve committed commands from the Raft log: ``` Shard shard = gondola.getCluster(shardId); Command command = shard.getCommittedCommand(index); // index starting from 1 String value = command.getString(); ``` ## Architecture These are the major classes in the implementation: | Class | Description | |:--------|-------------| | Client | Represents the client code. It is assumed that the client has many threads writing to the Raft log. | | Shard | Represents a set of Raft nodes, only one of which can be a leader. The Shard object also has a pool of Command object which are used for committing and reading Raft commands. The Command objects are pooled to avoid needless garbage collection. | | Config | Is an interface that provides access to all configuration information. The Config implementation can be a file or an adapter retrieving configs from some storage. | | Connection | Represents a channel of communication between the local and remote member. | | Exchange | Is reponsible for creating a Connection between the local and remote member. | | Gondola | The Gondola instance that represents all the nodes in a particular host. | Member | Represents a Raft node. All commands that are written by the client are placed in the CommandQueue. When the commands are processed from the CommandQueue, they are processed in as large as a batch that will fit into a Raft message. The command is assigned a Raft index. After the message is sent to the other members, the processed Command objects are moved to the WaitQueue, blocking the client until the Command's Raft index has been committed. The IncomingQueue holds Raft messages that need to be processed. | | Message Pool | All Raft messages are represented by Message objects. The Message objects are pooled to avoid garbage collection. Message objects are reference counted, so they can be added to more than one outgoing queue for delivery to a remote member. | | Peer | Represents remote members that this host needs to communicate with. The peer is responsible for sending and receiving messages from the remote member. The Peer is also responsible for backfilling the remote member if necessary. | | SaveQueue | Is responsible for persisting messages in the SaveQueue to storage. The SaveQueue employs threads to allow inserts to happen concurrently. | | Storage | Is an interface that can be implemented by any storage system that can provide strong consistency. | The following is a rough class diagram of the major classes showing the major relationships between the classes: ![Design Diagram](https://raw.githubusercontent.com/yahoo/gondola/master/core/src/main/resources/gondola_design.png) [source](https://docs.google.com/drawings/d/1DZwNXhH3iycqqBMFVulvyXVtIOar7h_USkMBdfTAWU4/edit)
patc888/gondola
core/README.md
Markdown
bsd-3-clause
11,118
/* Copyright (c) 2015, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <odp.h> #include "odp_cunit_common.h" #include "cpumask.h" #include "mask_common.h" /* default worker parameter to get all that may be available */ #define ALL_AVAILABLE 0 void cpumask_test_odp_cpumask_def_control(void) { unsigned num; unsigned mask_count; unsigned max_cpus = mask_capacity(); odp_cpumask_t mask; num = odp_cpumask_default_control(&mask, ALL_AVAILABLE); mask_count = odp_cpumask_count(&mask); CU_ASSERT(mask_count == num); CU_ASSERT(num > 0); CU_ASSERT(num <= max_cpus); } void cpumask_test_odp_cpumask_def_worker(void) { unsigned num; unsigned mask_count; unsigned max_cpus = mask_capacity(); odp_cpumask_t mask; num = odp_cpumask_default_worker(&mask, ALL_AVAILABLE); mask_count = odp_cpumask_count(&mask); CU_ASSERT(mask_count == num); CU_ASSERT(num > 0); CU_ASSERT(num <= max_cpus); } void cpumask_test_odp_cpumask_def(void) { unsigned mask_count; unsigned num_worker; unsigned num_control; unsigned max_cpus = mask_capacity(); unsigned available_cpus = odp_cpu_count(); unsigned requested_cpus; odp_cpumask_t mask; CU_ASSERT(available_cpus <= max_cpus); if (available_cpus > 1) requested_cpus = available_cpus - 1; else requested_cpus = available_cpus; num_worker = odp_cpumask_default_worker(&mask, requested_cpus); mask_count = odp_cpumask_count(&mask); CU_ASSERT(mask_count == num_worker); num_control = odp_cpumask_default_control(&mask, 1); mask_count = odp_cpumask_count(&mask); CU_ASSERT(mask_count == num_control); CU_ASSERT(num_control == 1); CU_ASSERT(num_worker <= available_cpus); CU_ASSERT(num_worker > 0); } odp_testinfo_t cpumask_suite[] = { ODP_TEST_INFO(cpumask_test_odp_cpumask_to_from_str), ODP_TEST_INFO(cpumask_test_odp_cpumask_equal), ODP_TEST_INFO(cpumask_test_odp_cpumask_zero), ODP_TEST_INFO(cpumask_test_odp_cpumask_set), ODP_TEST_INFO(cpumask_test_odp_cpumask_clr), ODP_TEST_INFO(cpumask_test_odp_cpumask_isset), ODP_TEST_INFO(cpumask_test_odp_cpumask_count), ODP_TEST_INFO(cpumask_test_odp_cpumask_and), ODP_TEST_INFO(cpumask_test_odp_cpumask_or), ODP_TEST_INFO(cpumask_test_odp_cpumask_xor), ODP_TEST_INFO(cpumask_test_odp_cpumask_copy), ODP_TEST_INFO(cpumask_test_odp_cpumask_first), ODP_TEST_INFO(cpumask_test_odp_cpumask_last), ODP_TEST_INFO(cpumask_test_odp_cpumask_next), ODP_TEST_INFO(cpumask_test_odp_cpumask_setall), ODP_TEST_INFO(cpumask_test_odp_cpumask_def_control), ODP_TEST_INFO(cpumask_test_odp_cpumask_def_worker), ODP_TEST_INFO(cpumask_test_odp_cpumask_def), ODP_TEST_INFO_NULL, }; odp_suiteinfo_t cpumask_suites[] = { {"Cpumask", NULL, NULL, cpumask_suite}, ODP_SUITE_INFO_NULL, }; int cpumask_main(void) { int ret = odp_cunit_register(cpumask_suites); if (ret == 0) ret = odp_cunit_run(); return ret; }
rsalveti/odp
test/validation/cpumask/cpumask.c
C
bsd-3-clause
2,881
//============================================================================== // Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II // Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI // Copyright 2011 - 2012 MetaScale SAS // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE.txt or copy at // http://www.boost.org/LICENSE_1_0.txt //============================================================================== #ifndef NT2_CORE_FUNCTIONS_COMMON_BAND_HPP_INCLUDED #define NT2_CORE_FUNCTIONS_COMMON_BAND_HPP_INCLUDED #include <nt2/core/functions/band.hpp> #include <nt2/include/functions/simd/is_greater_equal.hpp> #include <nt2/include/functions/simd/is_less_equal.hpp> #include <nt2/include/functions/simd/bitwise_cast.hpp> #include <nt2/include/functions/simd/if_else_zero.hpp> #include <nt2/include/functions/simd/logical_and.hpp> #include <nt2/include/functions/simd/enumerate.hpp> #include <nt2/include/functions/simd/is_equal.hpp> #include <nt2/include/functions/simd/minus.hpp> #include <nt2/include/functions/simd/plus.hpp> #include <nt2/include/functions/run.hpp> #include <nt2/core/utility/as_subscript.hpp> #include <nt2/core/utility/as_index.hpp> #include <nt2/sdk/meta/as_signed.hpp> #include <nt2/sdk/meta/as_index.hpp> namespace nt2 { namespace ext { NT2_FUNCTOR_IMPLEMENTATION( nt2::tag::run_, tag::cpu_ , (A0)(State)(Data) , ((node_ < A0, nt2::tag::band_ , boost::mpl::long_<1> , nt2::container::domain > )) (generic_< integer_<State> >) (target_< unspecified_<Data> >) ) { typedef typename Data::type result_type; BOOST_FORCEINLINE result_type operator()(A0 const& a0, State const& p, Data const& t) const { typedef typename meta::as_index<result_type>::type i_t; typedef typename result_of::as_subscript<_2D,i_t>::type s_t; // Retrieve 2D position from the linear index s_t const pos = as_subscript(_2D(a0.extent()),enumerate<i_t>(p)); // Return the upper triangular section with 1 on the diagonal return nt2::if_else_zero( nt2::eq(pos[0],pos[1]) , nt2::run(boost::proto::child_c<0>(a0),p,t) ); } }; NT2_FUNCTOR_IMPLEMENTATION( nt2::tag::run_, tag::cpu_ , (A0)(State)(Data) , ((node_ < A0, nt2::tag::band_ , boost::mpl::long_<2> , nt2::container::domain > )) (generic_< integer_<State> >) (target_< unspecified_<Data> >) ) { typedef typename Data::type result_type; BOOST_FORCEINLINE result_type operator()(A0 const& a0, State const& p, Data const& t) const { typedef typename meta::as_index<result_type>::type i_t; typedef typename result_of::as_subscript<_2D,i_t>::type s_t; typedef typename nt2::meta::as_signed<typename s_t::value_type>::type p_t; // Retrieve the band width std::ptrdiff_t o = boost::proto::value(boost::proto::child_c<1>(a0)); // Retrieve 2D position from the linear index s_t const pos = as_subscript(_2D(a0.extent()), nt2::enumerate<i_t>(p) ); p_t const is = bitwise_cast<p_t>(pos[0]); p_t const js = bitwise_cast<p_t>(pos[1]); // Return the band between +/-offset around the main diagonal return nt2::if_else_zero( nt2::logical_and( nt2::le(is,js + o) , nt2::ge(is,js - o) ) , nt2::run(boost::proto::child_c<0>(a0),p,t) ); } }; NT2_FUNCTOR_IMPLEMENTATION( nt2::tag::run_, tag::cpu_ , (A0)(State)(Data) , ((node_ < A0, nt2::tag::band_ , boost::mpl::long_<3> , nt2::container::domain > )) (generic_< integer_<State> >) (target_< unspecified_<Data> >) ) { typedef typename Data::type result_type; BOOST_FORCEINLINE result_type operator()(A0 const& a0, State const& p, Data const& t) const { typedef typename meta::as_index<result_type>::type i_t; typedef typename result_of::as_subscript<_2D,i_t>::type s_t; typedef typename nt2::meta::as_signed<typename s_t::value_type>::type p_t; // Retrieve the band width and positive them std::ptrdiff_t const od = boost::proto::value(boost::proto::child_c<1>(a0)); std::ptrdiff_t const ou = boost::proto::value(boost::proto::child_c<2>(a0)); // Retrieve 2D position from the linear index s_t const pos = as_subscript(_2D(a0.extent()), nt2::enumerate<i_t>(p) ); p_t const is = bitwise_cast<p_t>(pos[0]); p_t const js = bitwise_cast<p_t>(pos[1]); // Return the band between +/-offset around the main diagonal return nt2::if_else_zero( nt2::logical_and( nt2::le(is,js - od) , nt2::ge(is,js - ou) ) , nt2::run(boost::proto::child_c<0>(a0),p,t) ); } }; } } #endif
hainm/pythran
third_party/nt2/core/functions/common/band.hpp
C++
bsd-3-clause
6,035
//============================================================================== // Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II // Copyright 2009 - 2013 LRI UMR 8623 CNRS/Univ Paris Sud XI // Copyright 2012 - 2013 MetaScale SAS // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE.txt or copy at // http://www.boost.org/LICENSE_1_0.txt //============================================================================== #ifndef NT2_CORE_FUNCTIONS_LOGPI_HPP_INCLUDED #define NT2_CORE_FUNCTIONS_LOGPI_HPP_INCLUDED #include <nt2/include/functor.hpp> #include <nt2/include/constants/logpi.hpp> #include <nt2/sdk/meta/generative_hierarchy.hpp> #include <nt2/core/container/dsl/generative.hpp> #include <nt2/core/functions/common/generative.hpp> #include <nt2/sdk/parameters.hpp> #include <boost/preprocessor/arithmetic/inc.hpp> #include <boost/preprocessor/repetition/repeat_from_to.hpp> namespace nt2 { #define M0(z,n,t) \ NT2_FUNCTION_IMPLEMENTATION(nt2::tag::Logpi,logpi, n) \ /**/ BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_INC(BOOST_PP_INC(NT2_MAX_DIMENSIONS)),M0,~) #undef M0 } namespace nt2 { namespace ext { /// INTERNAL ONLY template<typename Domain, typename Expr, int N> struct value_type<tag::Logpi,Domain,N,Expr> : meta::generative_value<Expr> {}; /// INTERNAL ONLY template<typename Domain, typename Expr, int N> struct size_of<tag::Logpi,Domain,N,Expr> : meta::generative_size<Expr> {}; } } #endif
hainm/pythran
third_party/nt2/core/functions/logpi.hpp
C++
bsd-3-clause
1,624
//------------------------------------------------------------------------------ // <auto-generated> // Dieser Code wurde von einem Tool generiert. // Laufzeitversion:4.0.30319.42000 // // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // der Code erneut generiert wird. // </auto-generated> //------------------------------------------------------------------------------ using NMFExamples.Pcm.Core; using NMFExamples.Pcm.Core.Entity; using NMFExamples.Pcm.Parameter; using NMFExamples.Pcm.Repository; using NMF.Collections.Generic; using NMF.Collections.ObjectModel; using NMF.Expressions; using NMF.Expressions.Linq; using NMF.Models; using NMF.Models.Collections; using NMF.Models.Expressions; using NMF.Models.Meta; using NMF.Models.Repository; using NMF.Serialization; using NMF.Utilities; using System; using global::System.Collections; using global::System.Collections.Generic; using global::System.Collections.ObjectModel; using global::System.Collections.Specialized; using System.ComponentModel; using System.Diagnostics; using System.Linq; namespace NMFExamples.Pcm.Core.Composition { /// <summary> /// The public interface for ProvidedInfrastructureDelegationConnector /// </summary> [DefaultImplementationTypeAttribute(typeof(ProvidedInfrastructureDelegationConnector))] [XmlDefaultImplementationTypeAttribute(typeof(ProvidedInfrastructureDelegationConnector))] public interface IProvidedInfrastructureDelegationConnector : IModelElement, IDelegationConnector { /// <summary> /// The innerProvidedRole__ProvidedInfrastructureDelegationConnector property /// </summary> IInfrastructureProvidedRole InnerProvidedRole__ProvidedInfrastructureDelegationConnector { get; set; } /// <summary> /// The outerProvidedRole__ProvidedInfrastructureDelegationConnector property /// </summary> IInfrastructureProvidedRole OuterProvidedRole__ProvidedInfrastructureDelegationConnector { get; set; } /// <summary> /// The assemblyContext__ProvidedInfrastructureDelegationConnector property /// </summary> IAssemblyContext AssemblyContext__ProvidedInfrastructureDelegationConnector { get; set; } /// <summary> /// Gets fired before the InnerProvidedRole__ProvidedInfrastructureDelegationConnector property changes its value /// </summary> event global::System.EventHandler<ValueChangedEventArgs> InnerProvidedRole__ProvidedInfrastructureDelegationConnectorChanging; /// <summary> /// Gets fired when the InnerProvidedRole__ProvidedInfrastructureDelegationConnector property changed its value /// </summary> event global::System.EventHandler<ValueChangedEventArgs> InnerProvidedRole__ProvidedInfrastructureDelegationConnectorChanged; /// <summary> /// Gets fired before the OuterProvidedRole__ProvidedInfrastructureDelegationConnector property changes its value /// </summary> event global::System.EventHandler<ValueChangedEventArgs> OuterProvidedRole__ProvidedInfrastructureDelegationConnectorChanging; /// <summary> /// Gets fired when the OuterProvidedRole__ProvidedInfrastructureDelegationConnector property changed its value /// </summary> event global::System.EventHandler<ValueChangedEventArgs> OuterProvidedRole__ProvidedInfrastructureDelegationConnectorChanged; /// <summary> /// Gets fired before the AssemblyContext__ProvidedInfrastructureDelegationConnector property changes its value /// </summary> event global::System.EventHandler<ValueChangedEventArgs> AssemblyContext__ProvidedInfrastructureDelegationConnectorChanging; /// <summary> /// Gets fired when the AssemblyContext__ProvidedInfrastructureDelegationConnector property changed its value /// </summary> event global::System.EventHandler<ValueChangedEventArgs> AssemblyContext__ProvidedInfrastructureDelegationConnectorChanged; } }
NMFCode/NMF
IntegrationTests/ComponentBasedSoftwareArchitectures/Pcm/Core/Composition/IProvidedInfrastructureDelegationConnector.cs
C#
bsd-3-clause
4,293
<!DOCTYPE html> <link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> <!-- Merge these tests into upstream wpt test if/when added to the css-contain spec --> <link rel="help" href="https://drafts.csswg.org/css-contain/#contain-property"> <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/1031"> <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5796"> <link rel="match" href="fieldset-inline-size-ref.html"> <p>The fieldset below has block-size containment. It should not make any inline-size room for the blue legend line, but it should fit the hotpink square in the block direction (but not in the inline direction, where it should overflow the right border of the fieldset.</p> <fieldset style="border:20px solid; width:0; min-width:0;"> <legend> <div style="width:200px; height:2px; background:blue;"></div> </legend> <div style="width:100px; height:100px; background:hotpink;"></div> </fieldset>
nwjs/chromium.src
third_party/blink/web_tests/wpt_internal/css/css-contain/fieldset-inline-size-ref.html
HTML
bsd-3-clause
977
<?php namespace common\rbac; use yii\web\ForbiddenHttpException; use yii\base\Module; use Yii; use yii\web\User; use yii\di\Instance; class AccessControl extends \yii\base\ActionFilter { public function beforeAction($action) { $actionId = $action->getUniqueId(); $user = $this->getUser(); } } ?>
Darkdion/bkt
common/rbac/AccessControl3.php
PHP
bsd-3-clause
322
/* Copyright 2005-2008 Intel Corporation. All Rights Reserved. This file is part of Threading Building Blocks. Threading Building Blocks is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. Threading Building Blocks 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 Threading Building Blocks; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA As a special exception, you may use this file as part of a free software library without restriction. Specifically, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other files to produce an executable, this file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ #ifndef __TBB_task_H #define __TBB_task_H #include "tbb_stddef.h" #if __TBB_EXCEPTIONS #include "tbb/cache_aligned_allocator.h" #endif /* __TBB_EXCEPTIONS */ namespace tbb { class task; class task_list; #if __TBB_EXCEPTIONS class task_group_context; class tbb_exception; #endif /* __TBB_EXCEPTIONS */ //! @cond INTERNAL namespace internal { class scheduler { public: //! For internal use only virtual void spawn( task& first, task*& next ) = 0; //! For internal use only virtual void wait_for_all( task& parent, task* child ) = 0; //! For internal use only virtual void spawn_root_and_wait( task& first, task*& next ) = 0; //! Pure virtual destructor; // Have to have it just to shut up overzealous compilation warnings virtual ~scheduler() = 0; }; //! A reference count /** Should always be non-negative. A signed type is used so that underflow can be detected. */ typedef intptr reference_count; //! An id as used for specifying affinity. typedef unsigned short affinity_id; #if __TBB_EXCEPTIONS struct context_list_node_t { context_list_node_t *my_prev, *my_next; }; class allocate_root_with_context_proxy { task_group_context& my_context; public: allocate_root_with_context_proxy ( task_group_context& ctx ) : my_context(ctx) {} task& allocate( size_t size ) const; void free( task& ) const; }; #endif /* __TBB_EXCEPTIONS */ class allocate_root_proxy { public: static task& allocate( size_t size ); static void free( task& ); }; class allocate_continuation_proxy { public: task& allocate( size_t size ) const; void free( task& ) const; }; class allocate_child_proxy { public: task& allocate( size_t size ) const; void free( task& ) const; }; class allocate_additional_child_of_proxy { task& self; task& parent; public: allocate_additional_child_of_proxy( task& self_, task& parent_ ) : self(self_), parent(parent_) {} task& allocate( size_t size ) const; void free( task& ) const; }; //! Memory prefix to a task object. /** This class is internal to the library. Do not reference it directly, except within the library itself. Fields are ordered in way that preserves backwards compatibility and yields good packing on typical 32-bit and 64-bit platforms. @ingroup task_scheduling */ class task_prefix { private: friend class tbb::task; friend class tbb::task_list; friend class internal::scheduler; friend class internal::allocate_root_proxy; friend class internal::allocate_child_proxy; friend class internal::allocate_continuation_proxy; friend class internal::allocate_additional_child_of_proxy; #if __TBB_EXCEPTIONS //! Shared context that is used to communicate asynchronous state changes /** Currently it is used to broadcast cancellation requests generated both by users and as the result of unhandled exceptions in the task::execute() methods. */ task_group_context *context; #endif /* __TBB_EXCEPTIONS */ //! The scheduler that allocated the task, or NULL if task is big. /** Small tasks are pooled by the scheduler that allocated the task. If a scheduler needs to free a small task allocated by another scheduler, it returns the task to that other scheduler. This policy avoids memory space blowup issues for memory allocators that allocate from thread-specific pools. */ scheduler* origin; //! scheduler that owns the task. scheduler* owner; //! task whose reference count includes me. /** In the "blocking style" of programming, this field points to the parent task. In the "continuation-passing style" of programming, this field points to the continuation of the parent. */ tbb::task* parent; //! Reference count used for synchronization. /** In the "continuation-passing style" of programming, this field is the difference of the number of allocated children minus the number of children that have completed. In the "blocking style" of programming, this field is one more than the difference. */ reference_count ref_count; //! Scheduling depth int depth; //! A task::state_type, stored as a byte for compactness. /** This state is exposed to users via method task::state(). */ unsigned char state; //! Miscellaneous state that is not directly visible to users, stored as a byte for compactness. /** 0x0 -> version 1.0 task 0x1 -> version 3.0 task 0x2 -> task_proxy 0x40 -> task has live ref_count */ unsigned char extra_state; affinity_id affinity; //! "next" field for list of task tbb::task* next; //! task corresponding to this task_prefix. tbb::task& task() {return *reinterpret_cast<tbb::task*>(this+1);} }; } // namespace internal //! @endcond #if __TBB_EXCEPTIONS //! Used to form groups of tasks /** @ingroup task_scheduling The context services explicit cancellation requests from user code, and unhandled exceptions intercepted during tasks execution. Intercepting an exception results in generating internal cancellation requests (which is processed in exactly the same way as external ones). The context is associated with one or more root tasks and defines the cancellation group that includes all the descendants of the corresponding root task(s). Association is established when a context object is passed as an argument to the task::allocate_root() method. See task_group_context::task_group_context for more details. The context can be bound to another one, and other contexts can be bound to it, forming a tree-like structure: parent -> this -> children. Arrows here designate cancellation propagation direction. If a task in a cancellation group is canceled all the other tasks in this group and groups bound to it (as children) get canceled too. **/ class task_group_context : internal::no_copy { public: enum kind_type { isolated, bound }; private: union { //! Flavor of this context: bound or isolated. kind_type my_kind; uintptr_t _my_kind_aligner; }; //! Pointer to the context of the parent cancellation group. NULL for isolated contexts. task_group_context *my_parent; //! Used to form the thread specific list of contexts without additional memory allocation. /** A context is included into the list of the current thread when its binding to its parent happens. Any context can be present in the list of one thread only. **/ internal::context_list_node_t my_node; //! Leading padding protecting accesses to frequently used members from false sharing. /** Read accesses to the field my_cancellation_requested are on the hot path inside the scheduler. This padding ensures that this field never shares the same cache line with a local variable that is frequently written to. **/ char _leading_padding[internal::NFS_MaxLineSize - 2 * sizeof(uintptr_t)- sizeof(void*) - sizeof(internal::context_list_node_t)]; //! Specifies whether cancellation was request for this task group. uintptr_t my_cancellation_requested; //! Version for run-time checks. /** Run-time version checks may become necessary in the scheduler implementation if in the future the meaning of the existing members will be changed or new members requiring non-zero initialization. **/ uintptr_t my_version; //! Pointer to the exception being propagated across this task group. tbb_exception *my_exception; //! Scheduler that registered this context in its thread specific list. /** This field is not terribly necessary, but it allows to get a small performance benefit by getting us rid of using thread local storage. We do not care about extra memory it takes since this data structure is excessively padded anyway. **/ void *my_owner; //! Trailing padding protecting accesses to frequently used members from false sharing /** \sa _leading_padding **/ char _trailing_padding[internal::NFS_MaxLineSize - sizeof(intptr_t) - 2 * sizeof(void*)]; public: //! Default & binding constructor. /** By default a bound context is created. That is this context will be bound (as child) to the context of the task calling task::allocate_root(this_context) method. Cancellation requests passed to the parent context are propagated to all the contexts bound to it. If task_group_context::isolated is used as the argument, then the tasks associated with this context will never be affected by events in any other context. Creating isolated context is involves much less overhead, but they have limited utility. Normally when an exception occur in an algorithm that has nested algorithms running one would want all the nested ones canceled as well. Such behavior requires nested algorithms to use bound contexts. There is one good place where using isolated algorithms is beneficial. It is a master thread. That is if a particular algorithm is invoked directly from the master thread (not from a TBB task), supplying it with explicitly created isolated context will result in a faster algorithm startup. */ task_group_context ( kind_type relation_with_parent = bound ) : my_kind(relation_with_parent) , my_version(0) { init(); } ~task_group_context (); //! Forcefully reinitializes context object after an algorithm it was used with finished. /** Because the method assumes that the all the tasks that used to be associated with this context have already finished, you must be extremely careful to not invalidate the context while it is still in use somewhere in the task hierarchy. IMPORTANT: It is assumed that this method is not used concurrently! The method does not change the context's parent if it is set. **/ void reset (); //! Initiates cancellation of all tasks in this cancellation group and its subordinate groups. /** \return false if cancellation has already been requested, true otherwise. Note that canceling never fails. When false is returned, it just means that another thread (or this one) has already sent cancellation request to this context or to one of its ancestors (if this context is bound). It is guaranteed that when this method is called on the same context, true may be returned by at most one invocation. **/ bool cancel_group_execution (); //! Returns true if the context received cancellation request. bool is_group_execution_cancelled () const; protected: //! Out-of-line part of the constructor. /** Separated to facilitate future support for backward binary compatibility. **/ void init (); private: friend class task; friend class internal::allocate_root_with_context_proxy; static const kind_type binding_required = bound; static const kind_type binding_completed = kind_type(bound+1); //! Checks if any of the ancestors has a cancellation request outstanding, //! and propagates it back to descendants. void propagate_cancellation_from_ancestors (); }; // class task_group_context #endif /* __TBB_EXCEPTIONS */ //! Base class for user-defined tasks. /** @ingroup task_scheduling */ class task: internal::no_copy { //! Set reference count void internal_set_ref_count( int count ); protected: //! Default constructor. task() {prefix().extra_state=1;} public: //! Destructor. virtual ~task() {} //! Should be overridden by derived classes. virtual task* execute() = 0; //! Enumeration of task states that the scheduler considers. enum state_type { //! task is running, and will be destroyed after method execute() completes. executing, //! task to be rescheduled. reexecute, //! task is in ready pool, or is going to be put there, or was just taken off. ready, //! task object is freshly allocated or recycled. allocated, //! task object is on free list, or is going to be put there, or was just taken off. freed, //! task to be recycled as continuation recycle }; //------------------------------------------------------------------------ // Allocating tasks //------------------------------------------------------------------------ //! Returns proxy for overloaded new that allocates a root task. static internal::allocate_root_proxy allocate_root() { return internal::allocate_root_proxy(); } #if __TBB_EXCEPTIONS //! Returns proxy for overloaded new that allocates a root task associated with user supplied context. static internal::allocate_root_with_context_proxy allocate_root( task_group_context& ctx ) { return internal::allocate_root_with_context_proxy(ctx); } #endif /* __TBB_EXCEPTIONS */ //! Returns proxy for overloaded new that allocates a continuation task of *this. /** The continuation's parent becomes the parent of *this. */ internal::allocate_continuation_proxy& allocate_continuation() { return *reinterpret_cast<internal::allocate_continuation_proxy*>(this); } //! Returns proxy for overloaded new that allocates a child task of *this. internal::allocate_child_proxy& allocate_child() { return *reinterpret_cast<internal::allocate_child_proxy*>(this); } //! Like allocate_child, except that task's parent becomes "t", not this. /** Typically used in conjunction with schedule_to_reexecute to implement while loops. Atomically increments the reference count of t.parent() */ internal::allocate_additional_child_of_proxy allocate_additional_child_of( task& t ) { return internal::allocate_additional_child_of_proxy(*this,t); } //! Destroy a task. /** Usually, calling this method is unnecessary, because a task is implicitly deleted after its execute() method runs. However, sometimes a task needs to be explicitly deallocated, such as when a root task is used as the parent in spawn_and_wait_for_all. */ void destroy( task& victim ); //------------------------------------------------------------------------ // Recycling of tasks //------------------------------------------------------------------------ //! Change this to be a continuation of its former self. /** The caller must guarantee that the task's refcount does not become zero until after the method execute() returns. Typically, this is done by having method execute() return a pointer to a child of the task. If the guarantee cannot be made, use method recycle_as_safe_continuation instead. Because of the hazard, this method may be deprecated in the future. */ void recycle_as_continuation() { __TBB_ASSERT( prefix().state==executing, "execute not running?" ); prefix().state = allocated; } //! Recommended to use, safe variant of recycle_as_continuation /** For safety, it requires additional increment of ref_count. */ void recycle_as_safe_continuation() { __TBB_ASSERT( prefix().state==executing, "execute not running?" ); prefix().state = recycle; } //! Change this to be a child of new_parent. void recycle_as_child_of( task& new_parent ) { internal::task_prefix& p = prefix(); __TBB_ASSERT( prefix().state==executing||prefix().state==allocated, "execute not running, or already recycled" ); __TBB_ASSERT( prefix().ref_count==0, "no child tasks allowed when recycled as a child" ); __TBB_ASSERT( p.parent==NULL, "parent must be null" ); __TBB_ASSERT( new_parent.prefix().state<=recycle, "corrupt parent's state" ); __TBB_ASSERT( new_parent.prefix().state!=freed, "parent already freed" ); p.state = allocated; p.parent = &new_parent; p.depth = new_parent.prefix().depth+1; #if __TBB_EXCEPTIONS p.context = new_parent.prefix().context; #endif /* __TBB_EXCEPTIONS */ } //! Schedule this for reexecution after current execute() returns. /** Requires that this.execute() be running. */ void recycle_to_reexecute() { __TBB_ASSERT( prefix().state==executing, "execute not running, or already recycled" ); __TBB_ASSERT( prefix().ref_count==0, "no child tasks allowed when recycled for reexecution" ); prefix().state = reexecute; } //! A scheduling depth. /** Guaranteed to be a signed integral type. */ typedef internal::intptr depth_type; //! Scheduling depth depth_type depth() const {return prefix().depth;} //! Set scheduling depth to given value. /** The depth must be non-negative */ void set_depth( depth_type new_depth ) { __TBB_ASSERT( state()!=ready, "cannot change depth of ready task" ); __TBB_ASSERT( new_depth>=0, "depth cannot be negative" ); __TBB_ASSERT( new_depth==int(new_depth), "integer overflow error"); prefix().depth = int(new_depth); } //! Change scheduling depth by given amount. /** The resulting depth must be non-negative. */ void add_to_depth( int delta ) { __TBB_ASSERT( state()!=ready, "cannot change depth of ready task" ); __TBB_ASSERT( prefix().depth>=-delta, "depth cannot be negative" ); prefix().depth+=delta; } //------------------------------------------------------------------------ // Spawning and blocking //------------------------------------------------------------------------ //! Set reference count void set_ref_count( int count ) { #if TBB_DO_ASSERT internal_set_ref_count(count); #else prefix().ref_count = count; #endif /* TBB_DO_ASSERT */ } //! Schedule task for execution when a worker becomes available. /** After all children spawned so far finish their method task::execute, their parent's method task::execute may start running. Therefore, it is important to ensure that at least one child has not completed until the parent is ready to run. */ void spawn( task& child ) { __TBB_ASSERT( is_owned_by_current_thread(), "'this' not owned by current thread" ); prefix().owner->spawn( child, child.prefix().next ); } //! Spawn multiple tasks and clear list. /** All of the tasks must be at the same depth. */ void spawn( task_list& list ); //! Similar to spawn followed by wait_for_all, but more efficient. void spawn_and_wait_for_all( task& child ) { __TBB_ASSERT( is_owned_by_current_thread(), "'this' not owned by current thread" ); prefix().owner->wait_for_all( *this, &child ); } //! Similar to spawn followed by wait_for_all, but more efficient. void spawn_and_wait_for_all( task_list& list ); //! Spawn task allocated by allocate_root, wait for it to complete, and deallocate it. /** The thread that calls spawn_root_and_wait must be the same thread that allocated the task. */ static void spawn_root_and_wait( task& root ) { __TBB_ASSERT( root.is_owned_by_current_thread(), "root not owned by current thread" ); root.prefix().owner->spawn_root_and_wait( root, root.prefix().next ); } //! Spawn root tasks on list and wait for all of them to finish. /** If there are more tasks than worker threads, the tasks are spawned in order of front to back. */ static void spawn_root_and_wait( task_list& root_list ); //! Wait for reference count to become one, and set reference count to zero. /** Works on tasks while waiting. */ void wait_for_all() { __TBB_ASSERT( is_owned_by_current_thread(), "'this' not owned by current thread" ); prefix().owner->wait_for_all( *this, NULL ); } //! The task() currently being run by this thread. static task& self(); //! task on whose behalf this task is working, or NULL if this is a root. task* parent() const {return prefix().parent;} //! True if task is owned by different thread than thread that owns its parent. bool is_stolen_task() const { internal::task_prefix& p = prefix(); internal::task_prefix& q = parent()->prefix(); return p.owner!=q.owner; } //------------------------------------------------------------------------ // Debugging //------------------------------------------------------------------------ //! Current execution state state_type state() const {return state_type(prefix().state);} //! The internal reference count. int ref_count() const { #if TBB_DO_ASSERT internal::reference_count ref_count = prefix().ref_count; __TBB_ASSERT( ref_count==int(ref_count), "integer overflow error"); #endif return int(prefix().ref_count); } //! True if this task is owned by the calling thread; false otherwise. bool is_owned_by_current_thread() const; //------------------------------------------------------------------------ // Affinity //------------------------------------------------------------------------ //! An id as used for specifying affinity. /** Guaranteed to be integral type. Value of 0 means no affinity. */ typedef internal::affinity_id affinity_id; //! Set affinity for this task. void set_affinity( affinity_id id ) {prefix().affinity = id;} //! Current affinity of this task affinity_id affinity() const {return prefix().affinity;} //! Invoked by scheduler to notify task that it ran on unexpected thread. /** Invoked before method execute() runs, if task is stolen, or task has affinity but will be executed on another thread. The default action does nothing. */ virtual void note_affinity( affinity_id id ); #if __TBB_EXCEPTIONS //! Initiates cancellation of all tasks in this cancellation group and its subordinate groups. /** \return false if cancellation has already been requested, true otherwise. **/ bool cancel_group_execution () { return prefix().context->cancel_group_execution(); } //! Returns true if the context received cancellation request. bool is_cancelled () const { return prefix().context->is_group_execution_cancelled(); } #endif /* __TBB_EXCEPTIONS */ private: friend class task_list; friend class internal::scheduler; friend class internal::allocate_root_proxy; #if __TBB_EXCEPTIONS friend class internal::allocate_root_with_context_proxy; #endif /* __TBB_EXCEPTIONS */ friend class internal::allocate_continuation_proxy; friend class internal::allocate_child_proxy; friend class internal::allocate_additional_child_of_proxy; //! Get reference to corresponding task_prefix. /** Version tag prevents loader on Linux from using the wrong symbol in debug builds. **/ internal::task_prefix& prefix( internal::version_tag* = NULL ) const { return reinterpret_cast<internal::task_prefix*>(const_cast<task*>(this))[-1]; } }; // class task //! task that does nothing. Useful for synchronization. /** @ingroup task_scheduling */ class empty_task: public task { /*override*/ task* execute() { return NULL; } }; //! A list of children. /** Used for method task::spawn_children @ingroup task_scheduling */ class task_list: internal::no_copy { private: task* first; task** next_ptr; friend class task; public: //! Construct empty list task_list() : first(NULL), next_ptr(&first) {} //! Destroys the list, but does not destroy the task objects. ~task_list() {} //! True if list if empty; false otherwise. bool empty() const {return !first;} //! Push task onto back of list. void push_back( task& task ) { task.prefix().next = NULL; *next_ptr = &task; next_ptr = &task.prefix().next; } //! Pop the front task from the list. task& pop_front() { __TBB_ASSERT( !empty(), "attempt to pop item from empty task_list" ); task* result = first; first = result->prefix().next; if( !first ) next_ptr = &first; return *result; } //! Clear the list void clear() { first=NULL; next_ptr=&first; } }; inline void task::spawn( task_list& list ) { __TBB_ASSERT( is_owned_by_current_thread(), "'this' not owned by current thread" ); if( task* t = list.first ) { prefix().owner->spawn( *t, *list.next_ptr ); list.clear(); } } inline void task::spawn_root_and_wait( task_list& root_list ) { if( task* t = root_list.first ) { __TBB_ASSERT( t->is_owned_by_current_thread(), "'this' not owned by current thread" ); t->prefix().owner->spawn_root_and_wait( *t, *root_list.next_ptr ); root_list.clear(); } } } // namespace tbb inline void *operator new( size_t bytes, const tbb::internal::allocate_root_proxy& p ) { return &p.allocate(bytes); } inline void operator delete( void* task, const tbb::internal::allocate_root_proxy& p ) { p.free( *static_cast<tbb::task*>(task) ); } #if __TBB_EXCEPTIONS inline void *operator new( size_t bytes, const tbb::internal::allocate_root_with_context_proxy& p ) { return &p.allocate(bytes); } inline void operator delete( void* task, const tbb::internal::allocate_root_with_context_proxy& p ) { p.free( *static_cast<tbb::task*>(task) ); } #endif /* __TBB_EXCEPTIONS */ inline void *operator new( size_t bytes, const tbb::internal::allocate_continuation_proxy& p ) { return &p.allocate(bytes); } inline void operator delete( void* task, const tbb::internal::allocate_continuation_proxy& p ) { p.free( *static_cast<tbb::task*>(task) ); } inline void *operator new( size_t bytes, const tbb::internal::allocate_child_proxy& p ) { return &p.allocate(bytes); } inline void operator delete( void* task, const tbb::internal::allocate_child_proxy& p ) { p.free( *static_cast<tbb::task*>(task) ); } inline void *operator new( size_t bytes, const tbb::internal::allocate_additional_child_of_proxy& p ) { return &p.allocate(bytes); } inline void operator delete( void* task, const tbb::internal::allocate_additional_child_of_proxy& p ) { p.free( *static_cast<tbb::task*>(task) ); } #endif /* __TBB_task_H */
anasazi/POP-REU-Project
pkgs/libs/tbblib/src/include/tbb/task.h
C
bsd-3-clause
28,443
--- layout: redirect newurl: http://pmem.io/libpmemobj-cpp/master/doxygen/search/all_72.html ---
krzycz/krzycz.github.io
nvml/cpp_obj/master/cpp_html/search/all_72.md
Markdown
bsd-3-clause
97
<?php namespace common\models; use Yii; use yii\base\Model; use yii\data\ActiveDataProvider; use common\models\Attributes; /** * AttributesSearch represents the model behind the search form about `common\models\Attributes`. */ class AttributesSearch extends Attributes { /** * @inheritdoc */ public function rules() { return [ [['id', 'entity_id', 'status'], 'integer'], [['name', 'display_name'], 'safe'], [['lower_limit', 'upper_limit'], 'number'], ]; } /** * @inheritdoc */ public function scenarios() { // bypass scenarios() implementation in the parent class return Model::scenarios(); } /** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params, $general_attributes = null, $slider_attributes = null) { $query = Attributes::find(); if($general_attributes){ $attrs = unserialize($general_attributes); $query->where(['id'=>$attrs]); } $query->orderBy('name'); $dataProvider = new ActiveDataProvider([ 'query' => $query, 'pagination' =>false, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere([ 'id' => $this->id, 'entity_id' => $this->entity_id, 'lower_limit' => $this->lower_limit, 'upper_limit' => $this->upper_limit, 'status' => $this->status, ]); $query->andFilterWhere(['like', 'name', $this->name]); $query->andFilterWhere(['like', 'display_name', $this->display_name]); return $dataProvider; } }
61ds/drish
_protected/common/models/AttributesSearch.php
PHP
bsd-3-clause
1,962
// $Id: Surge.h,v 1.8 2003/10/07 21:45:11 idgay Exp $ /* tab:4 * "Copyright (c) 2000-2003 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * * Copyright (c) 2002-2003 Intel Corporation * All rights reserved. * * This file is distributed under the terms in the attached INTEL-LICENSE * file. If you do not find these files, copies can be found by writing to * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, * 94704. Attention: Intel License Inquiry. */ int INITIAL_TIMER_RATE = 2048; int FOCUS_TIMER_RATE = 1000; int FOCUS_NOTME_TIMER_RATE = 1000; enum { SURGE_TYPE_SENSORREADING = 0, SURGE_TYPE_ROOTBEACON = 1, SURGE_TYPE_SETRATE = 2, SURGE_TYPE_SLEEP = 3, SURGE_TYPE_WAKEUP = 4, SURGE_TYPE_FOCUS = 5, SURGE_TYPE_UNFOCUS = 6 }; typedef struct SurgeMsg { uint8_t type; uint16_t reading; uint16_t parentaddr; } __attribute__ ((packed)) SurgeMsg; enum { AM_SURGEMSG = 17 };
fresskarma/tinyos-1.x
apps/Surge/Surge.h
C
bsd-3-clause
1,974
package eddefs import ( "errors" "sort" "github.com/u-root/u-root/cmds/core/elvish/edit/ui" "github.com/u-root/u-root/cmds/core/elvish/eval" "github.com/u-root/u-root/cmds/core/elvish/eval/vals" "github.com/u-root/u-root/cmds/core/elvish/hashmap" "github.com/u-root/u-root/cmds/core/elvish/parse" ) var errValueShouldBeFn = errors.New("value should be function") // BindingMap is a special Map that converts its key to ui.Key and ensures // that its values satisfy eval.CallableValue. type BindingMap struct { hashmap.Map } var EmptyBindingMap = BindingMap{vals.EmptyMap} // Repr returns the representation of the binding table as if it were an // ordinary map keyed by strings. func (bt BindingMap) Repr(indent int) string { var builder vals.MapReprBuilder builder.Indent = indent var keys ui.Keys for it := bt.Map.Iterator(); it.HasElem(); it.Next() { k, _ := it.Elem() keys = append(keys, k.(ui.Key)) } sort.Sort(keys) for _, k := range keys { v, _ := bt.Map.Index(k) builder.WritePair(parse.Quote(k.String()), indent+2, vals.Repr(v, indent+2)) } return builder.String() } // Index converts the index to ui.Key and uses the Index of the inner Map. func (bt BindingMap) Index(index interface{}) (interface{}, error) { return vals.Index(bt.Map, ui.ToKey(index)) } func (bt BindingMap) HasKey(k interface{}) bool { _, ok := bt.Map.Index(k) return ok } func (bt BindingMap) GetKey(k ui.Key) eval.Callable { v, ok := bt.Map.Index(k) if !ok { panic("get called when key not present") } return v.(eval.Callable) } func (bt BindingMap) GetOrDefault(k ui.Key) eval.Callable { switch { case bt.HasKey(k): return bt.GetKey(k) case bt.HasKey(ui.Default): return bt.GetKey(ui.Default) } return nil } // Assoc converts the index to ui.Key, ensures that the value is CallableValue, // uses the Assoc of the inner Map and converts the result to a BindingTable. func (bt BindingMap) Assoc(k, v interface{}) (interface{}, error) { key := ui.ToKey(k) f, ok := v.(eval.Callable) if !ok { return nil, errValueShouldBeFn } map2 := bt.Map.Assoc(key, f) return BindingMap{map2}, nil } // Dissoc converts the key to ui.Key and calls the Dissoc method of the inner // map. func (bt BindingMap) Dissoc(k interface{}) interface{} { return BindingMap{bt.Map.Dissoc(ui.ToKey(k))} } // MakeBindingMapCallable implements eval.CustomCallable interface for makeBindingMap. func MakeBindingMapCallable() eval.CustomCallable { return &makeBindingMapCallable{} } func makeBindingMap(raw hashmap.Map) (BindingMap, error) { converted := vals.EmptyMap for it := raw.Iterator(); it.HasElem(); it.Next() { k, v := it.Elem() f, ok := v.(eval.Callable) if !ok { return EmptyBindingMap, errValueShouldBeFn } converted = converted.Assoc(ui.ToKey(k), f) } return BindingMap{converted}, nil } type makeBindingMapCallable struct { } func (*makeBindingMapCallable) Target() interface{} { return makeBindingMap } func (*makeBindingMapCallable) Call(f *eval.Frame, args []interface{}, opts eval.RawOptions, inputs eval.Inputs) ([]interface{}, error) { out, err := makeBindingMap(args[0].(hashmap.Map)) return []interface{}{out}, err }
hugelgupf/u-root
cmds/core/elvish/edit/eddefs/binding_map.go
GO
bsd-3-clause
3,180
var chai = require('chai'); var sinon = require('sinon'); var chrome = require('sinon-chrome'); var expect = chai.expect; describe('Chrome Dev Tools', function() { it('should work', function() { chrome.browserAction.setTitle({title: 'hello'}); sinon.assert.calledOnce(chrome.browserAction.setTitle); }); });
jaythaceo/chrome-wakatime
tests/helpers/Chrome.spec.js
JavaScript
bsd-3-clause
333
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ #define CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/platform_file.h" #include "content/common/content_export.h" #include "content/common/webkitplatformsupport_impl.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorkerRepository.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h" namespace webkit_glue { class WebClipboardImpl; } namespace content { class GamepadSharedMemoryReader; class Hyphenator; class RendererClipboardClient; class WebFileSystemImpl; class WebSharedWorkerRepositoryImpl; class CONTENT_EXPORT RendererWebKitPlatformSupportImpl : public WebKitPlatformSupportImpl { public: RendererWebKitPlatformSupportImpl(); virtual ~RendererWebKitPlatformSupportImpl(); void set_plugin_refresh_allowed(bool plugin_refresh_allowed) { plugin_refresh_allowed_ = plugin_refresh_allowed; } // WebKitPlatformSupport methods: virtual WebKit::WebClipboard* clipboard() OVERRIDE; virtual WebKit::WebMimeRegistry* mimeRegistry() OVERRIDE; virtual WebKit::WebFileUtilities* fileUtilities() OVERRIDE; virtual WebKit::WebSandboxSupport* sandboxSupport() OVERRIDE; virtual WebKit::WebCookieJar* cookieJar() OVERRIDE; virtual bool sandboxEnabled() OVERRIDE; virtual unsigned long long visitedLinkHash( const char* canonicalURL, size_t length) OVERRIDE; virtual bool isLinkVisited(unsigned long long linkHash) OVERRIDE; virtual WebKit::WebMessagePortChannel* createMessagePortChannel() OVERRIDE; virtual void prefetchHostName(const WebKit::WebString&) OVERRIDE; virtual void cacheMetadata( const WebKit::WebURL&, double, const char*, size_t) OVERRIDE; virtual WebKit::WebString defaultLocale() OVERRIDE; virtual void suddenTerminationChanged(bool enabled) OVERRIDE; virtual WebKit::WebStorageNamespace* createLocalStorageNamespace( const WebKit::WebString& path, unsigned quota) OVERRIDE; virtual WebKit::WebKitPlatformSupport::FileHandle databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags) OVERRIDE; virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, bool sync_dir) OVERRIDE; virtual long databaseGetFileAttributes( const WebKit::WebString& vfs_file_name) OVERRIDE; virtual long long databaseGetFileSize( const WebKit::WebString& vfs_file_name) OVERRIDE; virtual long long databaseGetSpaceAvailableForOrigin( const WebKit::WebString& origin_identifier) OVERRIDE; virtual WebKit::WebString signedPublicKeyAndChallengeString( unsigned key_size_index, const WebKit::WebString& challenge, const WebKit::WebURL& url) OVERRIDE; virtual void screenColorProfile(WebKit::WebVector<char>* to_profile) OVERRIDE; virtual WebKit::WebIDBFactory* idbFactory() OVERRIDE; virtual WebKit::WebFileSystem* fileSystem() OVERRIDE; virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository() OVERRIDE; virtual bool canAccelerate2dCanvas(); virtual double audioHardwareSampleRate() OVERRIDE; virtual size_t audioHardwareBufferSize() OVERRIDE; virtual WebKit::WebAudioDevice* createAudioDevice( size_t buffer_size, unsigned channels, double sample_rate, WebKit::WebAudioDevice::RenderCallback* callback) OVERRIDE; virtual WebKit::WebBlobRegistry* blobRegistry() OVERRIDE; virtual void sampleGamepads(WebKit::WebGamepads&) OVERRIDE; virtual WebKit::WebString userAgent(const WebKit::WebURL& url) OVERRIDE; virtual void GetPlugins(bool refresh, std::vector<webkit::WebPluginInfo>* plugins) OVERRIDE; virtual WebKit::WebRTCPeerConnectionHandler* createRTCPeerConnectionHandler( WebKit::WebRTCPeerConnectionHandlerClient* client) OVERRIDE; virtual WebKit::WebMediaStreamCenter* createMediaStreamCenter( WebKit::WebMediaStreamCenterClient* client) OVERRIDE; virtual bool canHyphenate(const WebKit::WebString& locale) OVERRIDE; virtual size_t computeLastHyphenLocation(const char16* characters, size_t length, size_t before_index, const WebKit::WebString& locale) OVERRIDE; // Disables the WebSandboxSupport implementation for testing. // Tests that do not set up a full sandbox environment should call // SetSandboxEnabledForTesting(false) _before_ creating any instances // of this class, to ensure that we don't attempt to use sandbox-related // file descriptors or other resources. // // Returns the previous |enable| value. static bool SetSandboxEnabledForTesting(bool enable); // Set WebGamepads to return when sampleGamepads() is invoked. static void SetMockGamepadsForTesting(const WebKit::WebGamepads& pads); protected: virtual GpuChannelHostFactory* GetGpuChannelHostFactory() OVERRIDE; private: bool CheckPreparsedJsCachingEnabled() const; scoped_ptr<RendererClipboardClient> clipboard_client_; scoped_ptr<webkit_glue::WebClipboardImpl> clipboard_; class FileUtilities; scoped_ptr<FileUtilities> file_utilities_; class MimeRegistry; scoped_ptr<MimeRegistry> mime_registry_; class SandboxSupport; scoped_ptr<SandboxSupport> sandbox_support_; // This counter keeps track of the number of times sudden termination is // enabled or disabled. It starts at 0 (enabled) and for every disable // increments by 1, for every enable decrements by 1. When it reaches 0, // we tell the browser to enable fast termination. int sudden_termination_disables_; // If true, then a GetPlugins call is allowed to rescan the disk. bool plugin_refresh_allowed_; // Implementation of the WebSharedWorkerRepository APIs (provides an interface // to WorkerService on the browser thread. scoped_ptr<WebSharedWorkerRepositoryImpl> shared_worker_repository_; scoped_ptr<WebKit::WebIDBFactory> web_idb_factory_; scoped_ptr<WebFileSystemImpl> web_file_system_; scoped_ptr<WebKit::WebBlobRegistry> blob_registry_; scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; scoped_ptr<content::Hyphenator> hyphenator_; }; } // namespace content #endif // CONTENT_RENDERER_RENDERER_WEBKITPLATFORMSUPPORT_IMPL_H_
leiferikb/bitpop-private
content/renderer/renderer_webkitplatformsupport_impl.h
C
bsd-3-clause
6,462
#!/bin/bash echo "This is not a script to run. Please read this script" exit readonly MODULE_NAME=SVM readonly MODULE_USERNAME=your_username readonly MODULE_PATH=${MODULE_USERNAME,,}/${MODULE_NAME,,} echo $MODULE_NAME echo $MODULE_USERNAME echo $MODULE_PATH # initialize a module screwjack init basic -n $MODULE_NAME -d "A simple SVM" -v "0.1" -c "python main.py" -b "zetdata/sci-python:2.7" # change directory into the module cd ${MODULE_NAME,,} # Add param/input/output screwjack param_add C float screwjack input_add X csv screwjack input_add Y csv screwjack output_add MODEL model.dummy # Test in local screwjack --username=$MODULE_USERNAME run local --param-C=0.1 --X=iris_X.csv --Y=iris_Y.csv --MODEL=tmp.model # Test in docker screwjack --username=$MODULE_USERNAME run docker --param-C=0.1 --X=iris_X.csv --Y=iris_Y.csv --MODEL=tmp.model # Clean up docker rm $(docker ps -aq) docker rmi $(docker inspect -f "{{ .id }}" $MODULE_PATH)
DataCanvasIO/example-modules
tutorials/basic/quickstart.sh
Shell
bsd-3-clause
950
<html> <body> <p id="one" class="after">one</p> </body> </html>
huubbouma/diazo
lib/diazo/tests/v1-before-replace-after-content/content.html
HTML
bsd-3-clause
72
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test for distributed trial worker side. """ import os from cStringIO import StringIO from zope.interface.verify import verifyObject from twisted.trial.reporter import TestResult from twisted.trial.unittest import TestCase from twisted.trial._dist.worker import ( LocalWorker, LocalWorkerAMP, LocalWorkerTransport, WorkerProtocol) from twisted.trial._dist import managercommands, workercommands from twisted.scripts import trial from twisted.test.proto_helpers import StringTransport from twisted.internet.interfaces import ITransport, IAddress from twisted.internet.defer import fail, succeed from twisted.internet.main import CONNECTION_DONE from twisted.internet.error import ConnectionDone from twisted.python.failure import Failure from twisted.protocols.amp import AMP class FakeAMP(AMP): """ A fake amp protocol. """ class WorkerProtocolTestCase(TestCase): """ Tests for L{WorkerProtocol}. """ def setUp(self): """ Set up a transport, a result stream and a protocol instance. """ self.serverTransport = StringTransport() self.clientTransport = StringTransport() self.server = WorkerProtocol() self.server.makeConnection(self.serverTransport) self.client = FakeAMP() self.client.makeConnection(self.clientTransport) def test_run(self): """ Calling the L{workercommands.Run} command on the client returns a response with C{success} sets to C{True}. """ d = self.client.callRemote(workercommands.Run, testCase="doesntexist") def check(result): self.assertTrue(result['success']) d.addCallback(check) self.server.dataReceived(self.clientTransport.value()) self.clientTransport.clear() self.client.dataReceived(self.serverTransport.value()) self.serverTransport.clear() return d def test_start(self): """ The C{start} command changes the current path. """ curdir = os.path.realpath(os.path.curdir) self.addCleanup(os.chdir, curdir) self.server.start('..') self.assertNotEqual(os.path.realpath(os.path.curdir), curdir) class LocalWorkerAMPTestCase(TestCase): """ Test case for distributed trial's manager-side local worker AMP protocol """ def setUp(self): self.managerTransport = StringTransport() self.managerAMP = LocalWorkerAMP() self.managerAMP.makeConnection(self.managerTransport) self.result = TestResult() self.workerTransport = StringTransport() self.worker = AMP() self.worker.makeConnection(self.workerTransport) config = trial.Options() self.testName = "twisted.doesnexist" config['tests'].append(self.testName) self.testCase = trial._getSuite(config)._tests.pop() self.managerAMP.run(self.testCase, self.result) self.managerTransport.clear() def pumpTransports(self): """ Sends data from C{self.workerTransport} to C{self.managerAMP}, and then data from C{self.managerTransport} back to C{self.worker}. """ self.managerAMP.dataReceived(self.workerTransport.value()) self.workerTransport.clear() self.worker.dataReceived(self.managerTransport.value()) def test_runSuccess(self): """ Run a test, and succeed. """ results = [] d = self.worker.callRemote(managercommands.AddSuccess, testName=self.testName) d.addCallback(lambda result: results.append(result['success'])) self.pumpTransports() self.assertTrue(results) def test_runExpectedFailure(self): """ Run a test, and fail expectedly. """ results = [] d = self.worker.callRemote(managercommands.AddExpectedFailure, testName=self.testName, error='error', todo='todoReason') d.addCallback(lambda result: results.append(result['success'])) self.pumpTransports() self.assertEqual(self.testCase, self.result.expectedFailures[0][0]) self.assertTrue(results) def test_runError(self): """ Run a test, and encounter an error. """ results = [] d = self.worker.callRemote(managercommands.AddError, testName=self.testName, error='error', errorClass='exceptions.ValueError', frames=[]) d.addCallback(lambda result: results.append(result['success'])) self.pumpTransports() self.assertEqual(self.testCase, self.result.errors[0][0]) self.assertTrue(results) def test_runErrorWithFrames(self): """ L{LocalWorkerAMP._buildFailure} recreates the C{Failure.frames} from the C{frames} argument passed to C{AddError}. """ results = [] d = self.worker.callRemote(managercommands.AddError, testName=self.testName, error='error', errorClass='exceptions.ValueError', frames=["file.py", "invalid code", "3"]) d.addCallback(lambda result: results.append(result['success'])) self.pumpTransports() self.assertEqual(self.testCase, self.result.errors[0][0]) self.assertEqual( [('file.py', 'invalid code', 3, [], [])], self.result.errors[0][1].frames) self.assertTrue(results) def test_runFailure(self): """ Run a test, and fail. """ results = [] d = self.worker.callRemote(managercommands.AddFailure, testName=self.testName, fail='fail', failClass='exceptions.RuntimeError', frames=[]) d.addCallback(lambda result: results.append(result['success'])) self.pumpTransports() self.assertEqual(self.testCase, self.result.failures[0][0]) self.assertTrue(results) def test_runSkip(self): """ Run a test, but skip it. """ results = [] d = self.worker.callRemote(managercommands.AddSkip, testName=self.testName, reason='reason') d.addCallback(lambda result: results.append(result['success'])) self.pumpTransports() self.assertEqual(self.testCase, self.result.skips[0][0]) self.assertTrue(results) def test_runUnexpectedSuccesses(self): """ Run a test, and succeed unexpectedly. """ results = [] d = self.worker.callRemote(managercommands.AddUnexpectedSuccess, testName=self.testName, todo='todo') d.addCallback(lambda result: results.append(result['success'])) self.pumpTransports() self.assertEqual(self.testCase, self.result.unexpectedSuccesses[0][0]) self.assertTrue(results) def test_testWrite(self): """ L{LocalWorkerAMP.testWrite} writes the data received to its test stream. """ results = [] stream = StringIO() self.managerAMP.setTestStream(stream) d = self.worker.callRemote(managercommands.TestWrite, out="Some output") d.addCallback(lambda result: results.append(result['success'])) self.pumpTransports() self.assertEqual("Some output\n", stream.getvalue()) self.assertTrue(results) def test_stopAfterRun(self): """ L{LocalWorkerAMP.run} calls C{stopTest} on its test result once the C{Run} commands has succeeded. """ result = object() stopped = [] def fakeCallRemote(command, testCase): return succeed(result) self.managerAMP.callRemote = fakeCallRemote class StopTestResult(TestResult): def stopTest(self, test): stopped.append(test) d = self.managerAMP.run(self.testCase, StopTestResult()) self.assertEqual([self.testCase], stopped) return d.addCallback(self.assertIdentical, result) class FakeAMProtocol(AMP): """ A fake implementation of L{AMP} for testing. """ id = 0 dataString = "" def dataReceived(self, data): self.dataString += data def setTestStream(self, stream): self.testStream = stream class FakeTransport(object): """ A fake process transport implementation for testing. """ dataString = "" calls = 0 def writeToChild(self, fd, data): self.dataString += data def loseConnection(self): self.calls += 1 class LocalWorkerTestCase(TestCase): """ Tests for L{LocalWorker} and L{LocalWorkerTransport}. """ def test_childDataReceived(self): """ L{LocalWorker.childDataReceived} forwards the received data to linked L{AMP} protocol if the right file descriptor, otherwise forwards to C{ProcessProtocol.childDataReceived}. """ fakeTransport = FakeTransport() localWorker = LocalWorker(FakeAMProtocol(), '.', 'test.log') localWorker.makeConnection(fakeTransport) localWorker._outLog = StringIO() localWorker.childDataReceived(4, "foo") localWorker.childDataReceived(1, "bar") self.assertEqual("foo", localWorker._ampProtocol.dataString) self.assertEqual("bar", localWorker._outLog.getvalue()) def test_outReceived(self): """ L{LocalWorker.outReceived} logs the output into its C{_outLog} log file. """ fakeTransport = FakeTransport() localWorker = LocalWorker(FakeAMProtocol(), '.', 'test.log') localWorker.makeConnection(fakeTransport) localWorker._outLog = StringIO() data = "The quick brown fox jumps over the lazy dog" localWorker.outReceived(data) self.assertEqual(data, localWorker._outLog.getvalue()) def test_errReceived(self): """ L{LocalWorker.errReceived} logs the errors into its C{_errLog} log file. """ fakeTransport = FakeTransport() localWorker = LocalWorker(FakeAMProtocol(), '.', 'test.log') localWorker.makeConnection(fakeTransport) localWorker._errLog = StringIO() data = "The quick brown fox jumps over the lazy dog" localWorker.errReceived(data) self.assertEqual(data, localWorker._errLog.getvalue()) def test_write(self): """ L{LocalWorkerTransport.write} forwards the written data to the given transport. """ transport = FakeTransport() localTransport = LocalWorkerTransport(transport) data = "The quick brown fox jumps over the lazy dog" localTransport.write(data) self.assertEqual(data, transport.dataString) def test_writeSequence(self): """ L{LocalWorkerTransport.writeSequence} forwards the written data to the given transport. """ transport = FakeTransport() localTransport = LocalWorkerTransport(transport) data = ("The quick ", "brown fox jumps ", "over the lazy dog") localTransport.writeSequence(data) self.assertEqual("".join(data), transport.dataString) def test_loseConnection(self): """ L{LocalWorkerTransport.loseConnection} forwards the call to the given transport. """ transport = FakeTransport() localTransport = LocalWorkerTransport(transport) localTransport.loseConnection() self.assertEqual(transport.calls, 1) def test_connectionLost(self): """ L{LocalWorker.connectionLost} closes the log streams. """ class FakeStream(object): callNumber = 0 def close(self): self.callNumber += 1 transport = FakeTransport() localWorker = LocalWorker(FakeAMProtocol(), '.', 'test.log') localWorker.makeConnection(transport) localWorker._outLog = FakeStream() localWorker._errLog = FakeStream() localWorker.connectionLost(None) self.assertEqual(localWorker._outLog.callNumber, 1) self.assertEqual(localWorker._errLog.callNumber, 1) def test_processEnded(self): """ L{LocalWorker.processEnded} calls C{connectionLost} on itself and on the L{AMP} protocol. """ class FakeStream(object): callNumber = 0 def close(self): self.callNumber += 1 transport = FakeTransport() protocol = FakeAMProtocol() localWorker = LocalWorker(protocol, '.', 'test.log') localWorker.makeConnection(transport) localWorker._outLog = FakeStream() localWorker.processEnded(Failure(CONNECTION_DONE)) self.assertEqual(localWorker._outLog.callNumber, 1) self.assertIdentical(None, protocol.transport) return self.assertFailure(localWorker.endDeferred, ConnectionDone) def test_addresses(self): """ L{LocalWorkerTransport.getPeer} and L{LocalWorkerTransport.getHost} return L{IAddress} objects. """ localTransport = LocalWorkerTransport(None) self.assertTrue(verifyObject(IAddress, localTransport.getPeer())) self.assertTrue(verifyObject(IAddress, localTransport.getHost())) def test_transport(self): """ L{LocalWorkerTransport} implements L{ITransport} to be able to be used by L{AMP}. """ localTransport = LocalWorkerTransport(None) self.assertTrue(verifyObject(ITransport, localTransport)) def test_startError(self): """ L{LocalWorker} swallows the exceptions returned by the L{AMP} protocol start method, as it generates unnecessary errors. """ def failCallRemote(command, directory): return fail(RuntimeError("oops")) transport = FakeTransport() protocol = FakeAMProtocol() protocol.callRemote = failCallRemote localWorker = LocalWorker(protocol, '.', 'test.log') localWorker.makeConnection(transport) self.assertEqual([], self.flushLoggedErrors(RuntimeError))
hlzz/dotfiles
graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/trial/_dist/test/test_worker.py
Python
bsd-3-clause
15,115
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__new_delete_array_char_66a.cpp Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_delete_array.label.xml Template File: sources-sinks-66a.tmpl.cpp */ /* * @description * CWE: 762 Mismatched Memory Management Routines * BadSource: Allocate data using new * GoodSource: Allocate data using new [] * Sinks: * GoodSink: Deallocate data using delete * BadSink : Deallocate data using delete [] * Flow Variant: 66 Data flow: data passed in an array from one function to another in different source files * * */ #include "std_testcase.h" namespace CWE762_Mismatched_Memory_Management_Routines__new_delete_array_char_66 { #ifndef OMITBAD /* bad function declaration */ void badSink(char * dataArray[]); void bad() { char * data; char * dataArray[5]; /* Initialize data*/ data = NULL; /* POTENTIAL FLAW: Allocate memory with a function that requires delete to free the memory */ data = new char; /* put data in array */ dataArray[2] = data; badSink(dataArray); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void goodG2BSink(char * dataArray[]); static void goodG2B() { char * data; char * dataArray[5]; /* Initialize data*/ data = NULL; /* FIX: Allocate memory from the heap using new [] */ data = new char[100]; dataArray[2] = data; goodG2BSink(dataArray); } /* goodB2G uses the BadSource with the GoodSink */ void goodB2GSink(char * dataArray[]); static void goodB2G() { char * data; char * dataArray[5]; /* Initialize data*/ data = NULL; /* POTENTIAL FLAW: Allocate memory with a function that requires delete to free the memory */ data = new char; dataArray[2] = data; goodB2GSink(dataArray); } void good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE762_Mismatched_Memory_Management_Routines__new_delete_array_char_66; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
JianpingZeng/xcc
xcc/test/juliet/testcases/CWE762_Mismatched_Memory_Management_Routines/s06/CWE762_Mismatched_Memory_Management_Routines__new_delete_array_char_66a.cpp
C++
bsd-3-clause
2,885
/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_UTILITY_H_ #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_UTILITY_H_ #include <cstddef> // size_t, ptrdiff_t #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" #include "webrtc/typedefs.h" namespace webrtc { enum RtpVideoCodecTypes { kRtpGenericVideo = 0, kRtpFecVideo = 10, kRtpVp8Video = 11 }; const uint8_t kRtpMarkerBitMask = 0x80; namespace ModuleRTPUtility { // January 1970, in NTP seconds. const uint32_t NTP_JAN_1970 = 2208988800UL; // Magic NTP fractional unit. const double NTP_FRAC = 4.294967296E+9; struct AudioPayload { uint32_t frequency; uint8_t channels; uint32_t rate; }; struct VideoPayload { RtpVideoCodecTypes videoCodecType; uint32_t maxRate; }; union PayloadUnion { AudioPayload Audio; VideoPayload Video; }; struct Payload { char name[RTP_PAYLOAD_NAME_SIZE]; bool audio; PayloadUnion typeSpecific; }; typedef std::map<int8_t, Payload*> PayloadTypeMap; // Return the current RTP timestamp from the NTP timestamp // returned by the specified clock. uint32_t GetCurrentRTP(Clock* clock, uint32_t freq); // Return the current RTP absolute timestamp. uint32_t ConvertNTPTimeToRTP(uint32_t NTPsec, uint32_t NTPfrac, uint32_t freq); uint32_t pow2(uint8_t exp); // Returns a pointer to the payload data given a packet. const uint8_t* GetPayloadData(const RTPHeader& rtp_header, const uint8_t* packet); // Returns payload length given a packet. uint16_t GetPayloadDataLength(const RTPHeader& rtp_header, const uint16_t packet_length); // Returns true if |newTimestamp| is older than |existingTimestamp|. // |wrapped| will be set to true if there has been a wraparound between the // two timestamps. bool OldTimestamp(uint32_t newTimestamp, uint32_t existingTimestamp, bool* wrapped); bool StringCompare(const char* str1, const char* str2, const uint32_t length); void AssignUWord32ToBuffer(uint8_t* dataBuffer, uint32_t value); void AssignUWord24ToBuffer(uint8_t* dataBuffer, uint32_t value); void AssignUWord16ToBuffer(uint8_t* dataBuffer, uint16_t value); /** * Converts a network-ordered two-byte input buffer to a host-ordered value. * \param[in] dataBuffer Network-ordered two-byte buffer to convert. * \return Host-ordered value. */ uint16_t BufferToUWord16(const uint8_t* dataBuffer); /** * Converts a network-ordered three-byte input buffer to a host-ordered value. * \param[in] dataBuffer Network-ordered three-byte buffer to convert. * \return Host-ordered value. */ uint32_t BufferToUWord24(const uint8_t* dataBuffer); /** * Converts a network-ordered four-byte input buffer to a host-ordered value. * \param[in] dataBuffer Network-ordered four-byte buffer to convert. * \return Host-ordered value. */ uint32_t BufferToUWord32(const uint8_t* dataBuffer); class RTPHeaderParser { public: RTPHeaderParser(const uint8_t* rtpData, const uint32_t rtpDataLength); ~RTPHeaderParser(); bool RTCP() const; bool ParseRtcp(RTPHeader* header) const; bool Parse(RTPHeader& parsedPacket, RtpHeaderExtensionMap* ptrExtensionMap = NULL) const; private: void ParseOneByteExtensionHeader( RTPHeader& parsedPacket, const RtpHeaderExtensionMap* ptrExtensionMap, const uint8_t* ptrRTPDataExtensionEnd, const uint8_t* ptr) const; uint8_t ParsePaddingBytes( const uint8_t* ptrRTPDataExtensionEnd, const uint8_t* ptr) const; const uint8_t* const _ptrRTPDataBegin; const uint8_t* const _ptrRTPDataEnd; }; enum FrameTypes { kIFrame, // key frame kPFrame // Delta frame }; struct RTPPayloadVP8 { bool nonReferenceFrame; bool beginningOfPartition; int partitionID; bool hasPictureID; bool hasTl0PicIdx; bool hasTID; bool hasKeyIdx; int pictureID; int tl0PicIdx; int tID; bool layerSync; int keyIdx; int frameWidth; int frameHeight; const uint8_t* data; uint16_t dataLength; }; union RTPPayloadUnion { RTPPayloadVP8 VP8; }; struct RTPPayload { void SetType(RtpVideoCodecTypes videoType); RtpVideoCodecTypes type; FrameTypes frameType; RTPPayloadUnion info; }; // RTP payload parser class RTPPayloadParser { public: RTPPayloadParser(const RtpVideoCodecTypes payloadType, const uint8_t* payloadData, const uint16_t payloadDataLength, // Length w/o padding. const int32_t id); ~RTPPayloadParser(); bool Parse(RTPPayload& parsedPacket) const; private: bool ParseGeneric(RTPPayload& parsedPacket) const; bool ParseVP8(RTPPayload& parsedPacket) const; int ParseVP8Extension(RTPPayloadVP8 *vp8, const uint8_t *dataPtr, int dataLength) const; int ParseVP8PictureID(RTPPayloadVP8 *vp8, const uint8_t **dataPtr, int *dataLength, int *parsedBytes) const; int ParseVP8Tl0PicIdx(RTPPayloadVP8 *vp8, const uint8_t **dataPtr, int *dataLength, int *parsedBytes) const; int ParseVP8TIDAndKeyIdx(RTPPayloadVP8 *vp8, const uint8_t **dataPtr, int *dataLength, int *parsedBytes) const; int ParseVP8FrameSize(RTPPayload& parsedPacket, const uint8_t *dataPtr, int dataLength) const; private: int32_t _id; const uint8_t* _dataPtr; const uint16_t _dataLength; const RtpVideoCodecTypes _videoType; }; } // namespace ModuleRTPUtility } // namespace webrtc #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_UTILITY_H_
wangscript/libjingle-1
trunk/third_party/webrtc/modules/rtp_rtcp/source/rtp_utility.h
C
bsd-3-clause
7,540
var makeAFailure=function(){function n(n){}function e(n){throw new Error("failed!")}function r(r){var i=null;if(r.failed){i=e}else{i=n}i(r)}function i(){var n={failed:true,value:42};r(n)}return i}(); //# sourceMappingURL=test.map
beeftornado/sentry
tests/relay_integration/lang/javascript/example-project/test.min.js
JavaScript
bsd-3-clause
230
<!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="Docutils 0.17.1: http://docutils.sourceforge.net/" /> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="lang:clipboard.copy" content="Copy to clipboard"> <meta name="lang:clipboard.copied" content="Copied to clipboard"> <meta name="lang:search.language" content="en"> <meta name="lang:search.pipeline.stopwords" content="True"> <meta name="lang:search.pipeline.trimmer" content="True"> <meta name="lang:search.result.none" content="No matching documents"> <meta name="lang:search.result.one" content="1 matching document"> <meta name="lang:search.result.other" content="# matching documents"> <meta name="lang:search.tokenizer" content="[\s\-]+"> <link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin> <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet"> <style> body, input { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif } code, kbd, pre { font-family: "Roboto Mono", "Courier New", Courier, monospace } </style> <link rel="stylesheet" href="../_static/stylesheets/application.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/> <link rel="stylesheet" href="../_static/fonts/material-icons.css"/> <meta name="theme-color" content="#3f51b5"> <script src="../_static/javascripts/modernizr.js"></script> <title>statsmodels.tsa.statespace.mlemodel.MLEResults.t_test &#8212; statsmodels</title> <link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png"> <link rel="manifest" href="../_static/icons/site.webmanifest"> <link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191"> <meta name="msapplication-TileColor" content="#2b5797"> <meta name="msapplication-config" content="../_static/icons/browserconfig.xml"> <link rel="stylesheet" href="../_static/stylesheets/examples.css"> <link rel="stylesheet" href="../_static/stylesheets/deprecation.css"> <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="../_static/material.css" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" /> <link rel="stylesheet" type="text/css" href="../_static/plot_directive.css" /> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="statsmodels.tsa.statespace.mlemodel.MLEResults.t_test_pairwise" href="statsmodels.tsa.statespace.mlemodel.MLEResults.t_test_pairwise.html" /> <link rel="prev" title="statsmodels.tsa.statespace.mlemodel.MLEResults.summary" href="statsmodels.tsa.statespace.mlemodel.MLEResults.summary.html" /> </head> <body dir=ltr data-md-color-primary=indigo data-md-color-accent=blue> <svg class="md-svg"> <defs data-children-count="0"> <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg> </defs> </svg> <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search"> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <a href="#generated/statsmodels.tsa.statespace.mlemodel.MLEResults.t_test" tabindex="1" class="md-skip"> Skip to content </a> <header class="md-header" data-md-component="header"> <nav class="md-header-nav md-grid"> <div class="md-flex navheader"> <div class="md-flex__cell md-flex__cell--shrink"> <a href="../index.html" title="statsmodels" class="md-header-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" height="26" alt="statsmodels logo"> </a> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label> </div> <div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title"> <span class="md-header-nav__topic">statsmodels v0.13.2</span> <span class="md-header-nav__topic"> statsmodels.tsa.statespace.mlemodel.MLEResults.t_test </span> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> <div class="md-search" data-md-component="search" role="dialog"> <label class="md-search__overlay" for="__search"></label> <div class="md-search__inner" role="search"> <form class="md-search__form" action="../search.html" method="get" name="search"> <input type="text" class="md-search__input" name="q" placeholder="Search" autocapitalize="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <label class="md-icon md-search__icon" for="__search"></label> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> &#xE5CD; </button> </form> <div class="md-search__output"> <div class="md-search__scrollwrap" data-md-scrollfix> <div class="md-search-result" data-md-component="result"> <div class="md-search-result__meta"> Type to start searching </div> <ol class="md-search-result__list"></ol> </div> </div> </div> </div> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <div class="md-header-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> </div> <script src="../_static/javascripts/version_dropdown.js"></script> <script> var json_loc = "../../versions-v2.json", target_loc = "../../", text = "Versions"; $( document ).ready( add_version_dropdown(json_loc, target_loc, text)); </script> </div> </nav> </header> <div class="md-container"> <nav class="md-tabs" data-md-component="tabs"> <div class="md-tabs__inner md-grid"> <ul class="md-tabs__list"> <li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li> <li class="md-tabs__item"><a href="../statespace.html" class="md-tabs__link">Time Series Analysis by State Space Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">statespace</span></code></a></li> <li class="md-tabs__item"><a href="statsmodels.tsa.statespace.mlemodel.MLEResults.html" class="md-tabs__link">statsmodels.tsa.statespace.mlemodel.MLEResults</a></li> </ul> </div> </nav> <main class="md-main"> <div class="md-main__inner md-grid" data-md-component="container"> <div class="md-sidebar md-sidebar--primary" data-md-component="navigation"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--primary" data-md-level="0"> <label class="md-nav__title md-nav__title--site" for="__drawer"> <a href="../index.html" title="statsmodels" class="md-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48"> </a> <a href="../index.html" title="statsmodels">statsmodels v0.13.2</a> </label> <div class="md-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../install.html" class="md-nav__link">Installing statsmodels</a> </li> <li class="md-nav__item"> <a href="../gettingstarted.html" class="md-nav__link">Getting started</a> </li> <li class="md-nav__item"> <a href="../user-guide.html" class="md-nav__link">User Guide</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../user-guide.html#background" class="md-nav__link">Background</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../tsa.html" class="md-nav__link">Time Series analysis <code class="xref py py-mod docutils literal notranslate"><span class="pre">tsa</span></code></a> </li> <li class="md-nav__item"> <a href="../statespace.html" class="md-nav__link">Time Series Analysis by State Space Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">statespace</span></code></a> </li> <li class="md-nav__item"> <a href="../vector_ar.html" class="md-nav__link">Vector Autoregressions <code class="xref py py-mod docutils literal notranslate"><span class="pre">tsa.vector_ar</span></code></a> </li></ul> </li> <li class="md-nav__item"> <a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a> </li></ul> </li> <li class="md-nav__item"> <a href="../examples/index.html" class="md-nav__link">Examples</a> </li> <li class="md-nav__item"> <a href="../api.html" class="md-nav__link">API Reference</a> </li> <li class="md-nav__item"> <a href="../about.html" class="md-nav__link">About statsmodels</a> </li> <li class="md-nav__item"> <a href="../dev/index.html" class="md-nav__link">Developer Page</a> </li> <li class="md-nav__item"> <a href="../release/index.html" class="md-nav__link">Release Notes</a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--secondary"> <ul class="md-nav__list" data-md-scrollfix=""> <li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.tsa.statespace.mlemodel.MLEResults.t_test.rst.txt">Show Source</a> </li> <li id="searchbox" class="md-nav__item"></li> </ul> </nav> </div> </div> </div> <div class="md-content"> <article class="md-content__inner md-typeset" role="main"> <section id="statsmodels-tsa-statespace-mlemodel-mleresults-t-test"> <h1 id="generated-statsmodels-tsa-statespace-mlemodel-mleresults-t-test--page-root">statsmodels.tsa.statespace.mlemodel.MLEResults.t_test<a class="headerlink" href="#generated-statsmodels-tsa-statespace-mlemodel-mleresults-t-test--page-root" title="Permalink to this headline">¶</a></h1> <dl class="py method"> <dt class="sig sig-object py" id="statsmodels.tsa.statespace.mlemodel.MLEResults.t_test"> <span class="sig-prename descclassname"><span class="pre">MLEResults.</span></span><span class="sig-name descname"><span class="pre">t_test</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">r_matrix</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cov_p</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_t</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#statsmodels.tsa.statespace.mlemodel.MLEResults.t_test" title="Permalink to this definition">¶</a></dt> <dd><p>Compute a t-test for a each linear hypothesis of the form Rb = q.</p> <dl class="field-list"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><dl> <dt><strong>r_matrix</strong><span class="classifier">{<a class="reference external" href="https://numpy.org/doc/stable/glossary.html#term-array_like" title="(in NumPy v1.22)"><span>array_like</span></a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><code class="docutils literal notranslate"><span class="pre">str</span></code></a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.10)"><code class="docutils literal notranslate"><span class="pre">tuple</span></code></a>}</span></dt><dd><p>One of:</p> <ul class="simple"> <li><p>array : If an array is given, a p x k 2d array or length k 1d array specifying the linear restrictions. It is assumed that the linear combination is equal to zero.</p></li> <li><p>str : The full hypotheses to test can be given as a string. See the examples.</p></li> <li><p>tuple : A tuple of arrays in the form (R, q). If q is given, can be either a scalar or a length p row vector.</p></li> </ul> </dd> <dt><strong>cov_p</strong><span class="classifier"><a class="reference external" href="https://numpy.org/doc/stable/glossary.html#term-array_like" title="(in NumPy v1.22)"><span>array_like</span></a>, <code class="xref py py-obj docutils literal notranslate"><span class="pre">optional</span></code></span></dt><dd><p>An alternative estimate for the parameter covariance matrix. If None is given, self.normalized_cov_params is used.</p> </dd> <dt><strong>use_t</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bltin-boolean-values" title="(in Python v3.10)"><span class="xref std std-ref">bool</span></a>, <code class="xref py py-obj docutils literal notranslate"><span class="pre">optional</span></code></span></dt><dd><p>If use_t is None, then the default of the model is used. If use_t is True, then the p-values are based on the t distribution. If use_t is False, then the p-values are based on the normal distribution.</p> </dd> </dl> </dd> <dt class="field-even">Returns</dt> <dd class="field-even"><dl class="simple"> <dt><code class="xref py py-obj docutils literal notranslate"><span class="pre">ContrastResults</span></code></dt><dd><p>The results for the test are attributes of this results instance. The available results have the same elements as the parameter table in <cite>summary()</cite>.</p> </dd> </dl> </dd> </dl> <div class="admonition seealso"> <p class="admonition-title">See also</p> <dl class="simple"> <dt><a class="reference internal" href="statsmodels.tsa.statespace.mlemodel.MLEResults.tvalues.html#statsmodels.tsa.statespace.mlemodel.MLEResults.tvalues" title="statsmodels.tsa.statespace.mlemodel.MLEResults.tvalues"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvalues</span></code></a></dt><dd><p>Individual t statistics for the estimated parameters.</p> </dd> <dt><a class="reference internal" href="statsmodels.tsa.statespace.mlemodel.MLEResults.f_test.html#statsmodels.tsa.statespace.mlemodel.MLEResults.f_test" title="statsmodels.tsa.statespace.mlemodel.MLEResults.f_test"><code class="xref py py-obj docutils literal notranslate"><span class="pre">f_test</span></code></a></dt><dd><p>Perform an F tests on model parameters.</p> </dd> <dt><code class="xref py py-obj docutils literal notranslate"><span class="pre">patsy.DesignInfo.linear_constraint</span></code></dt><dd><p>Specify a linear constraint.</p> </dd> </dl> </div> <p class="rubric">Examples</p> <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> <span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">statsmodels.api</span> <span class="k">as</span> <span class="nn">sm</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">data</span> <span class="o">=</span> <span class="n">sm</span><span class="o">.</span><span class="n">datasets</span><span class="o">.</span><span class="n">longley</span><span class="o">.</span><span class="n">load</span><span class="p">()</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">data</span><span class="o">.</span><span class="n">exog</span> <span class="o">=</span> <span class="n">sm</span><span class="o">.</span><span class="n">add_constant</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">exog</span><span class="p">)</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">results</span> <span class="o">=</span> <span class="n">sm</span><span class="o">.</span><span class="n">OLS</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">endog</span><span class="p">,</span> <span class="n">data</span><span class="o">.</span><span class="n">exog</span><span class="p">)</span><span class="o">.</span><span class="n">fit</span><span class="p">()</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">r</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros_like</span><span class="p">(</span><span class="n">results</span><span class="o">.</span><span class="n">params</span><span class="p">)</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">r</span><span class="p">[</span><span class="mi">5</span><span class="p">:]</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="go">[ 0. 0. 0. 0. 0. 1. -1.]</span> </pre></div> </div> <p>r tests that the coefficients on the 5th and 6th independent variable are the same.</p> <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">T_test</span> <span class="o">=</span> <span class="n">results</span><span class="o">.</span><span class="n">t_test</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">T_test</span><span class="p">)</span> <span class="go"> Test for Constraints</span> <span class="go">==============================================================================</span> <span class="go"> coef std err t P&gt;|t| [0.025 0.975]</span> <span class="go">------------------------------------------------------------------------------</span> <span class="go">c0 -1829.2026 455.391 -4.017 0.003 -2859.368 -799.037</span> <span class="go">==============================================================================</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">T_test</span><span class="o">.</span><span class="n">effect</span> <span class="go">-1829.2025687192481</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">T_test</span><span class="o">.</span><span class="n">sd</span> <span class="go">455.39079425193762</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">T_test</span><span class="o">.</span><span class="n">tvalue</span> <span class="go">-4.0167754636411717</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">T_test</span><span class="o">.</span><span class="n">pvalue</span> <span class="go">0.0015163772380899498</span> </pre></div> </div> <p>Alternatively, you can specify the hypothesis tests using a string</p> <div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">statsmodels.formula.api</span> <span class="kn">import</span> <span class="n">ols</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">dta</span> <span class="o">=</span> <span class="n">sm</span><span class="o">.</span><span class="n">datasets</span><span class="o">.</span><span class="n">longley</span><span class="o">.</span><span class="n">load_pandas</span><span class="p">()</span><span class="o">.</span><span class="n">data</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">formula</span> <span class="o">=</span> <span class="s1">'TOTEMP ~ GNPDEFL + GNP + UNEMP + ARMED + POP + YEAR'</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">results</span> <span class="o">=</span> <span class="n">ols</span><span class="p">(</span><span class="n">formula</span><span class="p">,</span> <span class="n">dta</span><span class="p">)</span><span class="o">.</span><span class="n">fit</span><span class="p">()</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">hypotheses</span> <span class="o">=</span> <span class="s1">'GNPDEFL = GNP, UNEMP = 2, YEAR/1829 = 1'</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">t_test</span> <span class="o">=</span> <span class="n">results</span><span class="o">.</span><span class="n">t_test</span><span class="p">(</span><span class="n">hypotheses</span><span class="p">)</span> <span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">t_test</span><span class="p">)</span> <span class="go"> Test for Constraints</span> <span class="go">==============================================================================</span> <span class="go"> coef std err t P&gt;|t| [0.025 0.975]</span> <span class="go">------------------------------------------------------------------------------</span> <span class="go">c0 15.0977 84.937 0.178 0.863 -177.042 207.238</span> <span class="go">c1 -2.0202 0.488 -8.231 0.000 -3.125 -0.915</span> <span class="go">c2 1.0001 0.249 0.000 1.000 0.437 1.563</span> <span class="go">==============================================================================</span> </pre></div> </div> </dd></dl> </section> </article> </div> </div> </main> </div> <footer class="md-footer"> <div class="md-footer-nav"> <nav class="md-footer-nav__inner md-grid"> <a href="statsmodels.tsa.statespace.mlemodel.MLEResults.summary.html" title="statsmodels.tsa.statespace.mlemodel.MLEResults.summary" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> <div class="md-flex__cell md-flex__cell--shrink"> <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> </div> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> <span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Previous </span> statsmodels.tsa.statespace.mlemodel.MLEResults.summary </span> </div> </a> <a href="statsmodels.tsa.statespace.mlemodel.MLEResults.t_test_pairwise.html" title="statsmodels.tsa.statespace.mlemodel.MLEResults.t_test_pairwise" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Next </span> statsmodels.tsa.statespace.mlemodel.MLEResults.t_test_pairwise </span> </div> <div class="md-flex__cell md-flex__cell--shrink"><i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> </div> </a> </nav> </div> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-footer-copyright"> <div class="md-footer-copyright__highlight"> &#169; Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. </div> Last updated on Feb 08, 2022. <br/> Created using <a href="http://www.sphinx-doc.org/">Sphinx</a> 4.4.0. and <a href="https://github.com/bashtage/sphinx-material/">Material for Sphinx</a> </div> </div> </div> </footer> <script src="../_static/javascripts/application.js"></script> <script>app.initialize({version: "1.0.4", url: {base: ".."}})</script> </body> </html>
statsmodels/statsmodels.github.io
v0.13.2/generated/statsmodels.tsa.statespace.mlemodel.MLEResults.t_test.html
HTML
bsd-3-clause
28,712
package com.ociweb.iot.grove.oled; import com.ociweb.iot.maker.image.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ociweb.iot.maker.FogCommandChannel; import com.ociweb.pronghorn.iot.schema.I2CCommandSchema; import com.ociweb.pronghorn.pipe.DataOutputBlobWriter; /** * * @author Ray Lo * */ public abstract class BinaryOLED implements FogBmpDisplayable { Logger logger = LoggerFactory.getLogger((BinaryOLED.class)); protected final FogCommandChannel ch; protected final int[] data_out; protected final int[] cmd_out; protected final int i2c_address; protected static final int BATCH_SIZE = 50; public static final int COMMAND_MODE = 0x80; public static final int DATA_MODE = 0x40; protected BinaryOLED(FogCommandChannel ch, int[] data_out, int[]cmd_out, int i2c_address){ this.ch = ch; this.data_out = data_out; this.cmd_out = cmd_out; this.i2c_address = i2c_address; ch.ensureI2CWriting(16, BATCH_SIZE); } public FogBitmap newEmptyBmp() { return new FogBitmap(newBmpLayout()); } /** * Sends a "data" identifier byte followed by the user-supplied byte over the i2c. * @return true if the command byte and the supplied byte were succesfully sent, false otherwise. */ protected boolean sendData(){ return sendData(0, data_out.length); } protected boolean sendData(int[] data){ return sendData(data, 0, data.length); } /** * If no data is supplied, we are using the default data_out held by this object * @param start * @param length * @return true */ protected boolean sendData(int start, int length){ return sendData(data_out, start,length); } /** * Send an array of data * Implemented by calling {@link #sendData(int[], int, int, int)}, which recursively calls itself * exactly 'm' times, where 'm' is the number of batches requires to send the data array specified by the start and length. * Implemented to use an array of passed-in data instead of defaulting to this.data_out so that one doesn't have * to go through the trouble of copying the entire data array if the data array is already constructed * @param start * @param length * @return true if the i2c bus is ready, false otherwise. */ protected boolean sendData(int[] data, int start, int length){ if (!ch.i2cIsReady( ( (length + 1) * 2 / BATCH_SIZE) + 1) ){ return false; } //call the helper method to recursively send batches return sendData(data, start,BATCH_SIZE, start+length); } /** * The private method required. for {@link BinaryOLED#sendData(int[], int, int)} to function. * @param data * @param start * @param length * @param finalTargetIndex * @return true if the i2c bus is ready, false otherwise. */ private boolean sendData(int [] data, int start, int length, int finalTargetIndex){ DataOutputBlobWriter<I2CCommandSchema> i2cPayloadWriter = ch.i2cCommandOpen(i2c_address); i2cPayloadWriter.write(DATA_MODE); int i; for (i = start; i < Math.min(start + length - 1, finalTargetIndex); i++){ i2cPayloadWriter.write(data[i]); } ch.i2cCommandClose(i2cPayloadWriter); ch.i2cFlushBatch(); if (i == finalTargetIndex){ return true; } return sendData(data, i, BATCH_SIZE, finalTargetIndex); //calls itself recursively until we reach finalTargetIndex } /** * Send a single byte of command. * @param b * @return true if the i2c bus is ready, false otherwise. */ protected boolean sendCommand(int b){ if (!ch.i2cIsReady()){ return false; } DataOutputBlobWriter<I2CCommandSchema> i2cPayloadWriter = ch.i2cCommandOpen(i2c_address); i2cPayloadWriter.write(COMMAND_MODE); i2cPayloadWriter.write(b); ch.i2cCommandClose(i2cPayloadWriter); return true; } /** * Unliked send data, sendCommands makes the assumption that the call is not sending more than one batch worth of commands *Each command involves two bytes. So if the caller is trying to send a command array of size 5, they are really sending *10 bytes. * @param start * @param length * @return true */ protected boolean sendCommands(int start, int length){ return sendCommands(cmd_out,start,length); } protected boolean sendCommands(int[] cmd, int start, int length){ if (!ch.i2cIsReady( (length * 2 / BATCH_SIZE) + 1) ){ //TODO: this math is newly added, may need to double-check. logger.trace("I2C is not ready"); return false; } //call the helper method to recursively send batches return sendCommands(cmd, start,BATCH_SIZE, start+length); } private boolean sendCommands(int [] cmd, int start, int length, int finalTargetIndex){ DataOutputBlobWriter<I2CCommandSchema> i2cPayloadWriter = ch.i2cCommandOpen(i2c_address); length = length / 2; //we need to send two bytes for each command int i; for (i = start; i < Math.min(start + length, finalTargetIndex); i++){ i2cPayloadWriter.write(COMMAND_MODE); i2cPayloadWriter.write(cmd[i]); } ch.i2cCommandClose(i2cPayloadWriter); ch.i2cFlushBatch(); if (i == finalTargetIndex){ return true; } return sendCommands(cmd, i, BATCH_SIZE, finalTargetIndex); //calls itself recursively until we reach finalTargetIndex } //This is protected at David Giovannini's request. protected abstract boolean init(); public abstract boolean clear(); public abstract boolean cleanClear(); public abstract boolean displayOn(); public abstract boolean displayOff(); public abstract boolean inverseOn(); public abstract boolean inverseOff(); public abstract boolean setContrast(int contrast); public abstract boolean setTextRowCol(int row, int col); public abstract boolean printCharSequence(CharSequence s); public abstract boolean printCharSequenceAt(CharSequence s, int row, int col); public abstract boolean activateScroll(); public abstract boolean deactivateScroll(); public abstract boolean setUpScroll(); public abstract boolean display(int[][] raw_image); public abstract boolean display(int[][] raw_image, int pixelDepth); public abstract boolean setHorizontalMode(); public abstract boolean setVerticalMode(); public abstract boolean display(FogBitmap bmp); public abstract FogBitmapLayout newBmpLayout(); }
oci-pronghorn/PronghornIoT
foglight/src/main/java/com/ociweb/iot/grove/oled/BinaryOLED.java
Java
bsd-3-clause
6,182
// // Copyright (C) 2015-2021 Virgil Security Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // (1) Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // (2) Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in // the documentation and/or other materials provided with the // distribution. // // (3) Neither the name of the copyright holder nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING // IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Lead Maintainer: Virgil Security Inc. <support@virgilsecurity.com> // #import <Foundation/Foundation.h> /** Represents key entry for VSSKeyStorage. */ NS_SWIFT_NAME(KeyEntry) @interface VSSKeyEntry : NSObject /** Factory method which allocates and initalizes VSSKeyEntry instance. @param name NSString with key entry name @param value Key raw value @param meta NSDictionary with any meta data @return allocated and initialized VSSCreateCardRequest instance */ + (VSSKeyEntry * __nonnull)keyEntryWithName:(NSString * __nonnull)name value:(NSData * __nonnull)value meta:(NSDictionary<NSString *, NSString *> * __nullable)meta; /** Factory method which allocates and initalizes VSSKeyEntry instance. @param name NSString with key entry name @param value Key raw value @return allocated and initialized VSSKeyEntry instance */ + (VSSKeyEntry * __nonnull)keyEntryWithName:(NSString * __nonnull)name value:(NSData * __nonnull)value; /** NSString with key entry name */ @property (nonatomic, readonly, copy) NSString * __nonnull name; /** Key raw value */ @property (nonatomic, readonly, copy) NSData * __nonnull value; /** NSDictionary with any meta data */ @property (nonatomic, readonly, copy) NSDictionary<NSString *, NSString *> * __nullable meta; /** Unavailable no-argument initializer inherited from NSObject. */ - (instancetype __nonnull)init NS_UNAVAILABLE; @end
VirgilSecurity/virgil-sdk-keys-x
Source/KeychainStorage/VSSKeyEntry.h
C
bsd-3-clause
2,977
/* global expect */ import { forumLocation } from '../../../../../config/env.json'; const { getGuideUrl } = require('./'); describe('index', () => { describe('getGuideUrl', () => { it('should use forum topic url when forumTopicId is supplied', () => { const value = getGuideUrl({ forumTopicId: 12345, title: 'a sample title' }); expect(value).toEqual(`${forumLocation}/t/12345`); }); it('should use search endpoint when no forumTopicId is supplied', () => { const value = getGuideUrl({ title: '& a sample title?' }); expect(value).toEqual( `${forumLocation}/search?q=%26%20a%20sample%20title%3F%20in%3Atitle%20order%3Aviews` ); }); }); });
jonathanihm/freeCodeCamp
client/src/templates/Challenges/utils/index.test.js
JavaScript
bsd-3-clause
738
/**************************************************************************** * Core Library Version 1.7, August 2004 * Copyright (c) 1995-2004 Exact Computation Project * All rights reserved. * * This file is part of CGAL (www.cgal.org). * You can redistribute it and/or modify it under the terms of the GNU * Lesser General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * Licensees holding a valid commercial license may use this file in * accordance with the commercial license agreement provided with the * software. * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * * $URL$ * $Id$ ***************************************************************************/ /***************************************************************** * File: segment3d.h * Synopsis: * Basic 3-dimensional geometry * Author: Shubin Zhao (shubinz@cs.nyu.edu), 2001. * ***************************************************************** * CORE Library Version 1.4 (July 2001) * Chee Yap <yap@cs.nyu.edu> * Chen Li <chenli@cs.nyu.edu> * Zilin Du <zilin@cs.nyu.edu> * * Copyright (c) 1995, 1996, 1998, 1999, 2000, 2001 Exact Computation Project * * WWW URL: http://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $Id$ *****************************************************************/ #ifndef _SEGMENT3D_H_ #define _SEGMENT3D_H_ #include <CGAL/CORE/geom3d/point3d.h> #include <CGAL/CORE/geom3d/line3d.h> /************************************************************ * Class Segment3d: * * An instance s of Segment3d is a finite or infinite line segment * in the three dimensional plane, defined by a start point * s.startPt() and a stop point s.stopPt(). It can be regarded * as an open or a closed segment (default: open), and directed * or not (default: directed). * * We do not necessarily assume that startPt() != stopPt(). ************************************************************/ #define S_TYPE_FINITE 0 #define S_TYPE_RAY 1 #define S_TYPE_LINE 2 class Plane3d; class Segment3d : public GeomObj{ private: Point3d p0; Point3d p1; bool directed; // segments can be directed or not (default is directed) bool open; // segments can be open or closed (default is open) //int finite; // 0=finite, 1=ray, 2=line (default is 0) public: /************************************************************ * constructors ************************************************************/ Segment3d(const Segment3d &s); Segment3d(const Point3d &p, const Point3d &q); //finite segment with endpoints p and q Segment3d(const Point3d & p, const Vector & v); //ray segment Segment3d(); //trivial segment from (0,0) to (0,0) virtual ~Segment3d() {} /************************************************************* * member functions *************************************************************/ virtual int dim() const { return 1; } Point3d startPt() const { return p0; } Point3d stopPt() const { return p1; } Vector direction() const { return p1 - p0; } void reverse(); // reverses the direction of the segment void setDirected( bool beDirected ) { directed = beDirected; } void setOpen( bool beOpen ) { open = beOpen; } void setStartPt( Point3d& p ) { p0 = p; } void setStopPt ( Point3d& p ) { p1 = p; } double length() const { return p0.distance(p1); } //length of segment Line3d toLine() const { return Line3d(p0,p1); } double distance( const Point3d& p ) const; // returns the Euclidean distance between this segment and point q Point3d nearPt( const Point3d& q ) const; // returns the point on segment closest to q; /************************************************************* * predicates *************************************************************/ bool isDirected() const { return directed; } bool isOpen() const {return open; } bool isTrivial() const {return p0 == p1; } bool isCollinear( const Point3d& p ) const {return toLine().contains(p); } bool contains( const Segment3d& s ) const { return contains(s.startPt()) && contains(s.stopPt()); } bool isCoincident( const Segment3d& s) const; bool isCoplanar( const Line3d& s) const; bool isCoplanar( const Segment3d& s) const; bool contains( const Point3d& p ) const; bool operator==( const Segment3d& s ) { return isCoincident( s ); } bool operator!=( const Segment3d& s ) { return !operator==(s); } /************************************************************* * intersection *************************************************************/ int intersects( const Line3d& l ) const; //decides whether *this and t intersect in one point // return dim of intersetion int intersects( const Segment3d& s ) const; //decides whether *this and t intersect in one point // return dim of intersetion GeomObj* intersection( const Line3d& l ) const; // return intersection point if this segment and l intersect at a single point // the intersection point is returned GeomObj* intersection( const Segment3d& s ) const; // return intersection point if this segment and s intersect at a single point // the intersection point is returned Plane3d bisect_plane() const; // return bisector plane /************************************************************* * I/O *************************************************************/ friend std::istream& operator>>(std::istream& in, Segment3d& l); friend std::ostream& operator<<(std::ostream& out, const Segment3d& l); }; //class Segment3d #endif
hlzz/dotfiles
graphics/cgal/CGAL_Core/include/CGAL/CORE/geom3d/segment3d.h
C
bsd-3-clause
6,581
¿Deseas agregar a los organizadores del curso como tus profesores/profesoras? Si los aceptas, podrán ver la lista de los problemas que has resuelto y de los que has intentado resolver
samdsmx/omegaup
frontend/privacy/accept_teacher/es.md
Markdown
bsd-3-clause
186
#ifndef PYTHONIC_MATH_SIN_HPP #define PYTHONIC_MATH_SIN_HPP #include "pythonic/include/math/sin.hpp" #include "pythonic/utils/proxy.hpp" #include <cmath> namespace pythonic { namespace math { ALIAS(sin, std::sin); PROXY_IMPL(pythonic::math, sin); } } #endif
hainm/pythran
pythran/pythonic/math/sin.hpp
C++
bsd-3-clause
277
<?php use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\Pjax; /* @var $this yii\web\View */ /* @var $searchModel backend\models\AddmissionPaymentDetailsSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Addmission Payment Details'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="addmission-payment-details-index"> <h1><?= Html::encode($this->title) ?></h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?= Html::a(Yii::t('app', 'Create Addmission Payment Details'), ['create'], ['class' => 'btn btn-success']) ?> </p> <?php Pjax::begin(); ?> <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], 'id', 'student_id', 'class_id', 'amt', 'pay_mode', // 'pay_mode_detail', // 'remarks:ntext', // 'session_id', ['class' => 'yii\grid\ActionColumn'], ], ]); ?> <?php Pjax::end(); ?></div>
riteshsingh1/a
backend/views/addmission-payment-details/index.php
PHP
bsd-3-clause
1,155
var structarm__fir__decimate__instance__q31 = [ [ "M", "structarm__fir__decimate__instance__q31.html#ad3d6936c36303b30dd38f1eddf248ae5", null ], [ "numTaps", "structarm__fir__decimate__instance__q31.html#a37915d42b0dc5e3057ebe83110798482", null ], [ "pCoeffs", "structarm__fir__decimate__instance__q31.html#a030d0391538c2481c5b348fd09a952ff", null ], [ "pState", "structarm__fir__decimate__instance__q31.html#a0ef0ef9e265f7ab873cfc6daa7593fdb", null ] ];
lpodkalicki/blog
stm32/STM32Cube_FW_F0_V1.9.0/Drivers/CMSIS/Documentation/DSP/html/structarm__fir__decimate__instance__q31.js
JavaScript
bsd-3-clause
476
/* * Copyright (c) 2009-2015, United States Government, as represented by the Secretary of Health and Human Services. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the United States Government nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE UNITED STATES GOVERNMENT BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package gov.hhs.fha.nhinc.callback.openSAML; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import gov.hhs.fha.nhinc.util.AbstractSuppressRootLoggerTest; import java.security.PrivateKey; import java.security.cert.X509Certificate; import java.security.interfaces.RSAPublicKey; import java.util.HashMap; import org.junit.Before; import org.junit.Test; /** * @author mweaver/jsmith * */ public class CertificateManagerImplTest extends AbstractSuppressRootLoggerTest{ private CertificateManagerImpl certManager; private final String KEY_STORE_PATH = "src/test/resources/gov/hhs/fha/nhinc/callback/gateway.jks"; private final String TRUST_STORE_PATH = "src/test/resources/gov/hhs/fha/nhinc/callback/cacerts.jks"; @Before public void setUp() { final HashMap<String, String> keyStoreMap = new HashMap<String, String>(); keyStoreMap.put(CertificateManagerImpl.KEY_STORE_KEY, KEY_STORE_PATH); keyStoreMap.put(CertificateManagerImpl.KEY_STORE_PASSWORD_KEY, "changeit"); keyStoreMap.put(CertificateManagerImpl.KEY_STORE_TYPE_KEY, "JKS"); final HashMap<String, String> trustStoreMap = new HashMap<String, String>(); trustStoreMap.put(CertificateManagerImpl.TRUST_STORE_KEY, TRUST_STORE_PATH); trustStoreMap.put(CertificateManagerImpl.TRUST_STORE_PASSWORD_KEY, "changeit"); trustStoreMap.put(CertificateManagerImpl.TRUST_STORE_TYPE_KEY, "JKS"); certManager = (CertificateManagerImpl) CertificateManagerImpl .getInstance(keyStoreMap, trustStoreMap); } @Test public void testGetInstance() { assertTrue(certManager instanceof CertificateManagerImpl); assertNotNull(certManager.getKeyStore()); assertNotNull(certManager.getTrustStore()); } @Test public void testGetInstance_StoresNotSet() { HashMap<String, String> mockKeyStoreMap = mock(HashMap.class); HashMap<String, String> mockTrustStoreMap = mock(HashMap.class); CertificateManagerImpl certManager = (CertificateManagerImpl) CertificateManagerImpl .getInstance(mockKeyStoreMap, mockTrustStoreMap); assertTrue(certManager instanceof CertificateManagerImpl); assertNull(certManager.getKeyStore()); assertNull(certManager.getTrustStore()); } @Test public void testGetDefaultPrivateKey() throws Exception { PrivateKey privateKey = certManager.getDefaultPrivateKey(); assertNotNull(privateKey); assertEquals(privateKey.getAlgorithm(), "RSA"); assertEquals(privateKey.getFormat(), "PKCS#8"); } @Test public void testGetDefaultPublicKey() { RSAPublicKey publicKey = certManager.getDefaultPublicKey(); assertNotNull(publicKey); assertEquals(publicKey.getAlgorithm(), "RSA"); assertEquals(publicKey.getFormat(), "X.509"); } @Test public void testGetDefaultCertificate() throws Exception { X509Certificate certificate = certManager.getDefaultCertificate(); assertNotNull(certificate); assertEquals(certificate.getSigAlgName(), "SHA256withRSA"); assertEquals(certificate.getSigAlgOID(), "1.2.840.113549.1.1.11"); } }
beiyuxinke/CONNECT
Product/Production/Common/CONNECTCoreLib/src/test/java/gov/hhs/fha/nhinc/callback/openSAML/CertificateManagerImplTest.java
Java
bsd-3-clause
4,809
from threading import Thread import Queue from django.core.urlresolvers import reverse from django.conf import settings from django import forms from django.http import HttpRequest from django.test import TestCase import haystack from haystack.forms import model_choices, SearchForm, ModelSearchForm from haystack.query import EmptySearchQuerySet from haystack.sites import SearchSite from haystack.views import SearchView, FacetedSearchView, search_view_factory from core.models import MockModel, AnotherMockModel class InitialedSearchForm(SearchForm): q = forms.CharField(initial='Search for...', required=False, label='Search') class SearchViewTestCase(TestCase): def setUp(self): super(SearchViewTestCase, self).setUp() mock_index_site = SearchSite() mock_index_site.register(MockModel) mock_index_site.register(AnotherMockModel) # Stow. self.old_site = haystack.site haystack.site = mock_index_site self.old_engine = getattr(settings, 'HAYSTACK_SEARCH_ENGINE') settings.HAYSTACK_SEARCH_ENGINE = 'dummy' def tearDown(self): haystack.site = self.old_site settings.HAYSTACK_SEARCH_ENGINE = self.old_engine super(SearchViewTestCase, self).tearDown() def test_search_no_query(self): response = self.client.get(reverse('haystack_search')) self.assertEqual(response.status_code, 200) def test_search_query(self): response = self.client.get(reverse('haystack_search'), {'q': 'hello world'}) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.context[-1]['page'].object_list), 1) self.assertEqual(response.context[-1]['page'].object_list[0].content_type(), 'haystack.dummymodel') self.assertEqual(response.context[-1]['page'].object_list[0].pk, 1) def test_invalid_page(self): response = self.client.get(reverse('haystack_search'), {'q': 'hello world', 'page': '165233'}) self.assertEqual(response.status_code, 404) def test_empty_results(self): sv = SearchView() self.assert_(isinstance(sv.get_results(), EmptySearchQuerySet)) def test_initial_data(self): sv = SearchView(form_class=InitialedSearchForm) sv.request = HttpRequest() form = sv.build_form() self.assert_(isinstance(form, InitialedSearchForm)) self.assertEqual(form.fields['q'].initial, 'Search for...') self.assertEqual(form.as_p(), u'<p><label for="id_q">Search:</label> <input type="text" name="q" value="Search for..." id="id_q" /></p>') def test_thread_safety(self): exceptions = [] def threaded_view(queue, view, request): import time; time.sleep(2) try: inst = view(request) queue.put(request.GET['name']) except Exception, e: exceptions.append(e) raise class ThreadedSearchView(SearchView): def __call__(self, request): print "Name: %s" % request.GET['name'] return super(ThreadedSearchView, self).__call__(request) view = search_view_factory(view_class=ThreadedSearchView) queue = Queue.Queue() request_1 = HttpRequest() request_1.GET = {'name': 'foo'} request_2 = HttpRequest() request_2.GET = {'name': 'bar'} th1 = Thread(target=threaded_view, args=(queue, view, request_1)) th2 = Thread(target=threaded_view, args=(queue, view, request_2)) th1.start() th2.start() th1.join() th2.join() foo = queue.get() bar = queue.get() self.assertNotEqual(foo, bar) class ResultsPerPageTestCase(TestCase): urls = 'core.tests.results_per_page_urls' def test_custom_results_per_page(self): response = self.client.get('/search/', {'q': 'hello world'}) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.context[-1]['page'].object_list), 1) self.assertEqual(response.context[-1]['paginator'].per_page, 1) response = self.client.get('/search2/', {'q': 'hello world'}) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.context[-1]['page'].object_list), 1) self.assertEqual(response.context[-1]['paginator'].per_page, 2) class FacetedSearchViewTestCase(TestCase): def setUp(self): super(FacetedSearchViewTestCase, self).setUp() mock_index_site = SearchSite() mock_index_site.register(MockModel) mock_index_site.register(AnotherMockModel) # Stow. self.old_site = haystack.site haystack.site = mock_index_site self.old_engine = getattr(settings, 'HAYSTACK_SEARCH_ENGINE') settings.HAYSTACK_SEARCH_ENGINE = 'dummy' def tearDown(self): haystack.site = self.old_site settings.HAYSTACK_SEARCH_ENGINE = self.old_engine super(FacetedSearchViewTestCase, self).tearDown() def test_search_no_query(self): response = self.client.get(reverse('haystack_faceted_search')) self.assertEqual(response.status_code, 200) self.assertEqual(response.context['facets'], {}) def test_empty_results(self): fsv = FacetedSearchView() self.assert_(isinstance(fsv.get_results(), EmptySearchQuerySet)) class BasicSearchViewTestCase(TestCase): def setUp(self): super(BasicSearchViewTestCase, self).setUp() mock_index_site = SearchSite() mock_index_site.register(MockModel) mock_index_site.register(AnotherMockModel) # Stow. self.old_site = haystack.site haystack.site = mock_index_site self.old_engine = getattr(settings, 'HAYSTACK_SEARCH_ENGINE') settings.HAYSTACK_SEARCH_ENGINE = 'dummy' def tearDown(self): haystack.site = self.old_site settings.HAYSTACK_SEARCH_ENGINE = self.old_engine super(BasicSearchViewTestCase, self).tearDown() def test_search_no_query(self): response = self.client.get(reverse('haystack_basic_search')) self.assertEqual(response.status_code, 200) def test_search_query(self): response = self.client.get(reverse('haystack_basic_search'), {'q': 'hello world'}) self.assertEqual(response.status_code, 200) self.assertEqual(type(response.context[-1]['form']), ModelSearchForm) self.assertEqual(len(response.context[-1]['page'].object_list), 1) self.assertEqual(response.context[-1]['page'].object_list[0].content_type(), 'haystack.dummymodel') self.assertEqual(response.context[-1]['page'].object_list[0].pk, 1) self.assertEqual(response.context[-1]['query'], 'hello world') def test_invalid_page(self): response = self.client.get(reverse('haystack_basic_search'), {'q': 'hello world', 'page': '165233'}) self.assertEqual(response.status_code, 404)
soad241/django-haystack
tests/core/tests/views.py
Python
bsd-3-clause
7,147
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "core/animation/ListInterpolationFunctions.h" #include "core/animation/UnderlyingValueOwner.h" #include "core/css/CSSValueList.h" #include "wtf/MathExtras.h" #include <memory> namespace blink { DEFINE_NON_INTERPOLABLE_VALUE_TYPE(NonInterpolableList); bool ListInterpolationFunctions::equalValues(const InterpolationValue& a, const InterpolationValue& b, EqualNonInterpolableValuesCallback equalNonInterpolableValues) { if (!a && !b) return true; if (!a || !b) return false; const InterpolableList& interpolableListA = toInterpolableList(*a.interpolableValue); const InterpolableList& interpolableListB = toInterpolableList(*b.interpolableValue); if (interpolableListA.length() != interpolableListB.length()) return false; size_t length = interpolableListA.length(); if (length == 0) return true; const NonInterpolableList& nonInterpolableListA = toNonInterpolableList(*a.nonInterpolableValue); const NonInterpolableList& nonInterpolableListB = toNonInterpolableList(*b.nonInterpolableValue); for (size_t i = 0; i < length; i++) { if (!equalNonInterpolableValues(nonInterpolableListA.get(i), nonInterpolableListB.get(i))) return false; } return true; } PairwiseInterpolationValue ListInterpolationFunctions::maybeMergeSingles(InterpolationValue&& start, InterpolationValue&& end, MergeSingleItemConversionsCallback mergeSingleItemConversions) { size_t startLength = toInterpolableList(*start.interpolableValue).length(); size_t endLength = toInterpolableList(*end.interpolableValue).length(); if (startLength == 0 && endLength == 0) { return PairwiseInterpolationValue( std::move(start.interpolableValue), std::move(end.interpolableValue), nullptr); } if (startLength == 0) { std::unique_ptr<InterpolableValue> startInterpolableValue = end.interpolableValue->cloneAndZero(); return PairwiseInterpolationValue( std::move(startInterpolableValue), std::move(end.interpolableValue), end.nonInterpolableValue.release()); } if (endLength == 0) { std::unique_ptr<InterpolableValue> endInterpolableValue = start.interpolableValue->cloneAndZero(); return PairwiseInterpolationValue( std::move(start.interpolableValue), std::move(endInterpolableValue), start.nonInterpolableValue.release()); } size_t finalLength = lowestCommonMultiple(startLength, endLength); std::unique_ptr<InterpolableList> resultStartInterpolableList = InterpolableList::create(finalLength); std::unique_ptr<InterpolableList> resultEndInterpolableList = InterpolableList::create(finalLength); Vector<RefPtr<NonInterpolableValue>> resultNonInterpolableValues(finalLength); InterpolableList& startInterpolableList = toInterpolableList(*start.interpolableValue); InterpolableList& endInterpolableList = toInterpolableList(*end.interpolableValue); NonInterpolableList& startNonInterpolableList = toNonInterpolableList(*start.nonInterpolableValue); NonInterpolableList& endNonInterpolableList = toNonInterpolableList(*end.nonInterpolableValue); for (size_t i = 0; i < finalLength; i++) { InterpolationValue start(startInterpolableList.get(i % startLength)->clone(), startNonInterpolableList.get(i % startLength)); InterpolationValue end(endInterpolableList.get(i % endLength)->clone(), endNonInterpolableList.get(i % endLength)); PairwiseInterpolationValue result = mergeSingleItemConversions(std::move(start), std::move(end)); if (!result) return nullptr; resultStartInterpolableList->set(i, std::move(result.startInterpolableValue)); resultEndInterpolableList->set(i, std::move(result.endInterpolableValue)); resultNonInterpolableValues[i] = result.nonInterpolableValue.release(); } return PairwiseInterpolationValue( std::move(resultStartInterpolableList), std::move(resultEndInterpolableList), NonInterpolableList::create(std::move(resultNonInterpolableValues))); } static void repeatToLength(InterpolationValue& value, size_t length) { InterpolableList& interpolableList = toInterpolableList(*value.interpolableValue); NonInterpolableList& nonInterpolableList = toNonInterpolableList(*value.nonInterpolableValue); size_t currentLength = interpolableList.length(); ASSERT(currentLength > 0); if (currentLength == length) return; ASSERT(currentLength < length); std::unique_ptr<InterpolableList> newInterpolableList = InterpolableList::create(length); Vector<RefPtr<NonInterpolableValue>> newNonInterpolableValues(length); for (size_t i = length; i-- > 0;) { newInterpolableList->set(i, i < currentLength ? std::move(interpolableList.getMutable(i)) : interpolableList.get(i % currentLength)->clone()); newNonInterpolableValues[i] = nonInterpolableList.get(i % currentLength); } value.interpolableValue = std::move(newInterpolableList); value.nonInterpolableValue = NonInterpolableList::create(std::move(newNonInterpolableValues)); } static bool nonInterpolableListsAreCompatible(const NonInterpolableList& a, const NonInterpolableList& b, size_t length, ListInterpolationFunctions::NonInterpolableValuesAreCompatibleCallback nonInterpolableValuesAreCompatible) { for (size_t i = 0; i < length; i++) { if (!nonInterpolableValuesAreCompatible(a.get(i % a.length()), b.get(i % b.length()))) return false; } return true; } void ListInterpolationFunctions::composite(UnderlyingValueOwner& underlyingValueOwner, double underlyingFraction, const InterpolationType& type, const InterpolationValue& value, NonInterpolableValuesAreCompatibleCallback nonInterpolableValuesAreCompatible, CompositeItemCallback compositeItem) { size_t underlyingLength = toInterpolableList(*underlyingValueOwner.value().interpolableValue).length(); if (underlyingLength == 0) { ASSERT(!underlyingValueOwner.value().nonInterpolableValue); underlyingValueOwner.set(type, value); return; } const InterpolableList& interpolableList = toInterpolableList(*value.interpolableValue); size_t valueLength = interpolableList.length(); if (valueLength == 0) { ASSERT(!value.nonInterpolableValue); underlyingValueOwner.mutableValue().interpolableValue->scale(underlyingFraction); return; } const NonInterpolableList& nonInterpolableList = toNonInterpolableList(*value.nonInterpolableValue); size_t newLength = lowestCommonMultiple(underlyingLength, valueLength); if (!nonInterpolableListsAreCompatible(toNonInterpolableList(*underlyingValueOwner.value().nonInterpolableValue), nonInterpolableList, newLength, nonInterpolableValuesAreCompatible)) { underlyingValueOwner.set(type, value); return; } InterpolationValue& underlyingValue = underlyingValueOwner.mutableValue(); if (underlyingLength < newLength) repeatToLength(underlyingValue, newLength); InterpolableList& underlyingInterpolableList = toInterpolableList(*underlyingValue.interpolableValue); NonInterpolableList& underlyingNonInterpolableList = toNonInterpolableList(*underlyingValue.nonInterpolableValue); for (size_t i = 0; i < newLength; i++) { compositeItem( underlyingInterpolableList.getMutable(i), underlyingNonInterpolableList.getMutable(i), underlyingFraction, *interpolableList.get(i % valueLength), nonInterpolableList.get(i % valueLength)); } } } // namespace blink
danakj/chromium
third_party/WebKit/Source/core/animation/ListInterpolationFunctions.cpp
C++
bsd-3-clause
7,884
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE126_Buffer_Overread__char_declare_memcpy_64a.c Label Definition File: CWE126_Buffer_Overread.stack.label.xml Template File: sources-sink-64a.tmpl.c */ /* * @description * CWE: 126 Buffer Over-read * BadSource: Set data pointer to a small buffer * GoodSource: Set data pointer to a large buffer * Sinks: memcpy * BadSink : Copy data to string using memcpy * Flow Variant: 64 Data flow: void pointer to data passed from one function to another in different source files * * */ #include "std_testcase.h" #include <wchar.h> #ifndef OMITBAD /* bad function declaration */ void CWE126_Buffer_Overread__char_declare_memcpy_64b_badSink(void * dataVoidPtr); void CWE126_Buffer_Overread__char_declare_memcpy_64_bad() { char * data; char dataBadBuffer[50]; char dataGoodBuffer[100]; memset(dataBadBuffer, 'A', 50-1); /* fill with 'A's */ dataBadBuffer[50-1] = '\0'; /* null terminate */ memset(dataGoodBuffer, 'A', 100-1); /* fill with 'A's */ dataGoodBuffer[100-1] = '\0'; /* null terminate */ /* FLAW: Set data pointer to a small buffer */ data = dataBadBuffer; CWE126_Buffer_Overread__char_declare_memcpy_64b_badSink(&data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE126_Buffer_Overread__char_declare_memcpy_64b_goodG2BSink(void * dataVoidPtr); static void goodG2B() { char * data; char dataBadBuffer[50]; char dataGoodBuffer[100]; memset(dataBadBuffer, 'A', 50-1); /* fill with 'A's */ dataBadBuffer[50-1] = '\0'; /* null terminate */ memset(dataGoodBuffer, 'A', 100-1); /* fill with 'A's */ dataGoodBuffer[100-1] = '\0'; /* null terminate */ /* FIX: Set data pointer to a large buffer */ data = dataGoodBuffer; CWE126_Buffer_Overread__char_declare_memcpy_64b_goodG2BSink(&data); } void CWE126_Buffer_Overread__char_declare_memcpy_64_good() { goodG2B(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE126_Buffer_Overread__char_declare_memcpy_64_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE126_Buffer_Overread__char_declare_memcpy_64_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
JianpingZeng/xcc
xcc/test/juliet/testcases/CWE126_Buffer_Overread/s01/CWE126_Buffer_Overread__char_declare_memcpy_64a.c
C
bsd-3-clause
2,842
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_src_char_cat_51a.cpp Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_src.label.xml Template File: sources-sink-51a.tmpl.cpp */ /* * @description * CWE: 122 Heap Based Buffer Overflow * BadSource: Initialize data as a large string * GoodSource: Initialize data as a small string * Sink: cat * BadSink : Copy data to string using strcat * Flow Variant: 51 Data flow: data passed as an argument from one function to another in different source files * * */ #include "std_testcase.h" #include <wchar.h> namespace CWE122_Heap_Based_Buffer_Overflow__cpp_src_char_cat_51 { #ifndef OMITBAD /* bad function declaration */ void badSink(char * data); void bad() { char * data; data = new char[100]; /* FLAW: Initialize data as a large buffer that is larger than the small buffer used in the sink */ memset(data, 'A', 100-1); /* fill with 'A's */ data[100-1] = '\0'; /* null terminate */ badSink(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* good function declarations */ void goodG2BSink(char * data); /* goodG2B uses the GoodSource with the BadSink */ static void goodG2B() { char * data; data = new char[100]; /* FIX: Initialize data as a small buffer that as small or smaller than the small buffer used in the sink */ memset(data, 'A', 50-1); /* fill with 'A's */ data[50-1] = '\0'; /* null terminate */ goodG2BSink(data); } void good() { goodG2B(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE122_Heap_Based_Buffer_Overflow__cpp_src_char_cat_51; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
JianpingZeng/xcc
xcc/test/juliet/testcases/CWE122_Heap_Based_Buffer_Overflow/s05/CWE122_Heap_Based_Buffer_Overflow__cpp_src_char_cat_51a.cpp
C++
bsd-3-clause
2,450
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>ASTResource xref</title> <link type="text/css" rel="stylesheet" href="../../../../../../stylesheet.css" /> </head> <body> <div id="overview"><a href="../../../../../../../apidocs/net/sourceforge/pmd/lang/java/ast/ASTResource.html">View Javadoc</a></div><pre> <a class="jxr_linenumber" name="1" href="#1">1</a> <em class="jxr_comment">/*<em class="jxr_comment"> Generated By:JJTree: Do not edit this line. ASTResource.java Version 4.1 */</em></em> <a class="jxr_linenumber" name="2" href="#2">2</a> <em class="jxr_comment">/*<em class="jxr_comment"> JavaCCOptions:MULTI=true,NODE_USES_PARSER=true,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY= */</em></em> <a class="jxr_linenumber" name="3" href="#3">3</a> <strong class="jxr_keyword">package</strong> net.sourceforge.pmd.lang.java.ast; <a class="jxr_linenumber" name="4" href="#4">4</a> <a class="jxr_linenumber" name="5" href="#5">5</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../net/sourceforge/pmd/lang/java/ast/ASTResource.html">ASTResource</a> <strong class="jxr_keyword">extends</strong> <a href="../../../../../../net/sourceforge/pmd/lang/java/ast/ASTFormalParameter.html">ASTFormalParameter</a> { <a class="jxr_linenumber" name="6" href="#6">6</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../../net/sourceforge/pmd/lang/java/ast/ASTResource.html">ASTResource</a>(<strong class="jxr_keyword">int</strong> id) { <a class="jxr_linenumber" name="7" href="#7">7</a> <strong class="jxr_keyword">super</strong>(id); <a class="jxr_linenumber" name="8" href="#8">8</a> } <a class="jxr_linenumber" name="9" href="#9">9</a> <a class="jxr_linenumber" name="10" href="#10">10</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../../net/sourceforge/pmd/lang/java/ast/ASTResource.html">ASTResource</a>(<a href="../../../../../../net/sourceforge/pmd/lang/java/ast/JavaParser.html">JavaParser</a> p, <strong class="jxr_keyword">int</strong> id) { <a class="jxr_linenumber" name="11" href="#11">11</a> <strong class="jxr_keyword">super</strong>(p, id); <a class="jxr_linenumber" name="12" href="#12">12</a> } <a class="jxr_linenumber" name="13" href="#13">13</a> <a class="jxr_linenumber" name="14" href="#14">14</a> <a class="jxr_linenumber" name="15" href="#15">15</a> <em class="jxr_javadoccomment">/**</em><em class="jxr_javadoccomment"> Accept the visitor. **/</em> <a class="jxr_linenumber" name="16" href="#16">16</a> <strong class="jxr_keyword">public</strong> Object jjtAccept(<a href="../../../../../../net/sourceforge/pmd/lang/java/ast/JavaParserVisitor.html">JavaParserVisitor</a> visitor, Object data) { <a class="jxr_linenumber" name="17" href="#17">17</a> <strong class="jxr_keyword">return</strong> visitor.visit(<strong class="jxr_keyword">this</strong>, data); <a class="jxr_linenumber" name="18" href="#18">18</a> } <a class="jxr_linenumber" name="19" href="#19">19</a> } <a class="jxr_linenumber" name="20" href="#20">20</a> <em class="jxr_comment">/*<em class="jxr_comment"> JavaCC - OriginalChecksum=92734fc70bba91fd9422150dbf87d5c4 (do not edit this line) */</em></em> </pre> <hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body> </html>
daejunpark/jsaf
third_party/pmd/docs/xref/net/sourceforge/pmd/lang/java/ast/ASTResource.html
HTML
bsd-3-clause
3,647
from django.conf import settings def bitgroup_cache_key(slug): return "%s:%s" % ( getattr(settings, 'PAGEBIT_CACHE_PREFIX', 'pagebits'), slug )
frankwiles/django-pagebits
pagebits/utils.py
Python
bsd-3-clause
171
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__unsigned_int_min_sub_64a.c Label Definition File: CWE191_Integer_Underflow.label.xml Template File: sources-sinks-64a.tmpl.c */ /* * @description * CWE: 191 Integer Underflow * BadSource: min Set data to the min value for unsigned int * GoodSource: Set data to a small, non-zero number (negative two) * Sinks: sub * GoodSink: Ensure there will not be an underflow before subtracting 1 from data * BadSink : Subtract 1 from data, which can cause an Underflow * Flow Variant: 64 Data flow: void pointer to data passed from one function to another in different source files * * */ #include "std_testcase.h" #ifndef OMITBAD /* bad function declaration */ void CWE191_Integer_Underflow__unsigned_int_min_sub_64b_badSink(void * dataVoidPtr); void CWE191_Integer_Underflow__unsigned_int_min_sub_64_bad() { unsigned int data; data = 0; /* POTENTIAL FLAW: Use the minimum size of the data type */ data = 0; CWE191_Integer_Underflow__unsigned_int_min_sub_64b_badSink(&data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE191_Integer_Underflow__unsigned_int_min_sub_64b_goodG2BSink(void * dataVoidPtr); static void goodG2B() { unsigned int data; data = 0; /* FIX: Use a small, non-zero value that will not cause an underflow in the sinks */ data = -2; CWE191_Integer_Underflow__unsigned_int_min_sub_64b_goodG2BSink(&data); } /* goodB2G uses the BadSource with the GoodSink */ void CWE191_Integer_Underflow__unsigned_int_min_sub_64b_goodB2GSink(void * dataVoidPtr); static void goodB2G() { unsigned int data; data = 0; /* POTENTIAL FLAW: Use the minimum size of the data type */ data = 0; CWE191_Integer_Underflow__unsigned_int_min_sub_64b_goodB2GSink(&data); } void CWE191_Integer_Underflow__unsigned_int_min_sub_64_good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE191_Integer_Underflow__unsigned_int_min_sub_64_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE191_Integer_Underflow__unsigned_int_min_sub_64_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
JianpingZeng/xcc
xcc/test/juliet/testcases/CWE191_Integer_Underflow/s03/CWE191_Integer_Underflow__unsigned_int_min_sub_64a.c
C
bsd-3-clause
2,844
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE789_Uncontrolled_Mem_Alloc__new_char_fgets_05.cpp Label Definition File: CWE789_Uncontrolled_Mem_Alloc__new.label.xml Template File: sources-sinks-05.tmpl.cpp */ /* * @description * CWE: 789 Uncontrolled Memory Allocation * BadSource: fgets Read data from the console using fgets() * GoodSource: Small number greater than zero * Sinks: * GoodSink: Allocate memory with new [] and check the size of the memory to be allocated * BadSink : Allocate memory with new [], but incorrectly check the size of the memory to be allocated * Flow Variant: 05 Control flow: if(staticTrue) and if(staticFalse) * * */ #include "std_testcase.h" #ifndef _WIN32 #include <wchar.h> #endif #define CHAR_ARRAY_SIZE (3 * sizeof(data) + 2) #define HELLO_STRING "hello" /* The two variables below are not defined as "const", but are never assigned any other value, so a tool should be able to identify that reads of these will always return their initialized values. */ static int staticTrue = 1; /* true */ static int staticFalse = 0; /* false */ namespace CWE789_Uncontrolled_Mem_Alloc__new_char_fgets_05 { #ifndef OMITBAD void bad() { size_t data; /* Initialize data */ data = 0; if(staticTrue) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(staticTrue) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = new char[data]; /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); delete [] myString; } else { printLine("Input is less than the length of the source string"); } } } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodB2G1() - use badsource and goodsink by changing the second staticTrue to staticFalse */ static void goodB2G1() { size_t data; /* Initialize data */ data = 0; if(staticTrue) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(staticFalse) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { { char * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING) && data < 100) { myString = new char[data]; /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); delete [] myString; } else { printLine("Input is less than the length of the source string or too large"); } } } } /* goodB2G2() - use badsource and goodsink by reversing the blocks in the second if */ static void goodB2G2() { size_t data; /* Initialize data */ data = 0; if(staticTrue) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(staticTrue) { { char * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING) && data < 100) { myString = new char[data]; /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); delete [] myString; } else { printLine("Input is less than the length of the source string or too large"); } } } } /* goodG2B1() - use goodsource and badsink by changing the first staticTrue to staticFalse */ static void goodG2B1() { size_t data; /* Initialize data */ data = 0; if(staticFalse) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { /* FIX: Use a relatively small number for memory allocation */ data = 20; } if(staticTrue) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = new char[data]; /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); delete [] myString; } else { printLine("Input is less than the length of the source string"); } } } } /* goodG2B2() - use goodsource and badsink by reversing the blocks in the first if */ static void goodG2B2() { size_t data; /* Initialize data */ data = 0; if(staticTrue) { /* FIX: Use a relatively small number for memory allocation */ data = 20; } if(staticTrue) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = new char[data]; /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); delete [] myString; } else { printLine("Input is less than the length of the source string"); } } } } void good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE789_Uncontrolled_Mem_Alloc__new_char_fgets_05; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
JianpingZeng/xcc
xcc/test/juliet/testcases/CWE789_Uncontrolled_Mem_Alloc/s02/CWE789_Uncontrolled_Mem_Alloc__new_char_fgets_05.cpp
C++
bsd-3-clause
9,134
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2015, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above // copyright notice, this list of conditions and the following // disclaimer. // // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided with // the distribution. // // * Neither the name of John Haddon nor the names of // any other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////// #ifndef GAFFERIMAGE_IMAGEMETADATA_H #define GAFFERIMAGE_IMAGEMETADATA_H #include "Gaffer/CompoundDataPlug.h" #include "GafferImage/MetadataProcessor.h" namespace GafferImage { class ImageMetadata : public MetadataProcessor { public : ImageMetadata( const std::string &name=defaultName<ImageMetadata>() ); virtual ~ImageMetadata(); IE_CORE_DECLARERUNTIMETYPEDEXTENSION( GafferImage::ImageMetadata, ImageMetadataTypeId, MetadataProcessor ); Gaffer::CompoundDataPlug *metadataPlug(); const Gaffer::CompoundDataPlug *metadataPlug() const; virtual void affects( const Gaffer::Plug *input, AffectedPlugsContainer &outputs ) const; protected : virtual void hashProcessedMetadata( const Gaffer::Context *context, IECore::MurmurHash &h ) const; virtual IECore::ConstCompoundObjectPtr computeProcessedMetadata( const Gaffer::Context *context, const IECore::CompoundObject *inputMetadata ) const; private : static size_t g_firstPlugIndex; }; IE_CORE_DECLAREPTR( ImageMetadata ); } // namespace GafferImage #endif // GAFFERIMAGE_IMAGEMETADATA_H
chippey/gaffer
include/GafferImage/ImageMetadata.h
C
bsd-3-clause
2,907
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Determines whether certain gpu-related features are blacklisted or not. // The format of a valid software_rendering_list.json file is defined in // <gpu/config/gpu_control_list_format.txt>. // The supported "features" can be found in <gpu/config/gpu_blacklist.cc>. #include "gpu/config/gpu_control_list_jsons.h" #define LONG_STRING_CONST(...) #__VA_ARGS__ namespace gpu { const char kSoftwareRenderingListJson[] = LONG_STRING_CONST( { "name": "software rendering list", // Please update the version number whenever you change this file. "version": "9.8", "entries": [ { "id": 1, "description": "ATI Radeon X1900 is not compatible with WebGL on the Mac", "webkit_bugs": [47028], "os": { "type": "macosx" }, "vendor_id": "0x1002", "device_id": ["0x7249"], "features": [ "webgl", "flash_3d", "flash_stage3d" ] }, { "id": 3, "description": "GL driver is software rendered. GPU acceleration is disabled", "cr_bugs": [59302, 315217], "os": { "type": "linux" }, "gl_renderer": "(?i).*software.*", "features": [ "all" ] }, { "id": 4, "description": "The Intel Mobile 945 Express family of chipsets is not compatible with WebGL", "cr_bugs": [232035], "os": { "type": "any" }, "vendor_id": "0x8086", "device_id": ["0x27AE", "0x27A2"], "features": [ "webgl", "flash_3d", "flash_stage3d", "accelerated_2d_canvas" ] }, { "id": 5, "description": "ATI/AMD cards with older drivers in Linux are crash-prone", "cr_bugs": [71381, 76428, 73910, 101225, 136240, 357314], "os": { "type": "linux" }, "vendor_id": "0x1002", "exceptions": [ { "driver_vendor": ".*AMD.*", "driver_version": { "op": ">=", "style": "lexical", "value": "8.98" } }, { "driver_vendor": "Mesa", "driver_version": { "op": ">=", "value": "10.0.4" } } ], "features": [ "all" ] }, { "id": 8, "description": "NVIDIA GeForce FX Go5200 is assumed to be buggy", "cr_bugs": [72938], "os": { "type": "any" }, "vendor_id": "0x10de", "device_id": ["0x0324"], "features": [ "all" ] }, { "id": 10, "description": "NVIDIA GeForce 7300 GT on Mac does not support WebGL", "cr_bugs": [73794], "os": { "type": "macosx" }, "vendor_id": "0x10de", "device_id": ["0x0393"], "features": [ "webgl", "flash_3d", "flash_stage3d" ] }, { "id": 12, "description": "Drivers older than 2009-01 on Windows are possibly unreliable", "cr_bugs": [72979, 89802, 315205], "os": { "type": "win" }, "driver_date": { "op": "<", "value": "2009.1" }, "exceptions": [ { "vendor_id": "0x8086", "device_id": ["0x29a2"], "driver_version": { "op": ">=", "value": "7.15.10.1624" } }, { "driver_vendor": "osmesa" }, { "vendor_id": "0x1414", "device_id": ["0x02c1"] } ], "features": [ "all" ] }, { "id": 17, "description": "Older Intel mesa drivers are crash-prone", "cr_bugs": [76703, 164555, 225200, 340886], "os": { "type": "linux" }, "vendor_id": "0x8086", "driver_vendor": "Mesa", "driver_version": { "op": "<", "value": "10.1" }, "exceptions": [ { "device_id": ["0x0102", "0x0106", "0x0112", "0x0116", "0x0122", "0x0126", "0x010a", "0x0152", "0x0156", "0x015a", "0x0162", "0x0166"], "driver_version": { "op": ">=", "value": "8.0" } }, { "device_id": ["0xa001", "0xa002", "0xa011", "0xa012", "0x29a2", "0x2992", "0x2982", "0x2972", "0x2a12", "0x2a42", "0x2e02", "0x2e12", "0x2e22", "0x2e32", "0x2e42", "0x2e92"], "driver_version": { "op": ">", "value": "8.0.2" } }, { "device_id": ["0x0042", "0x0046"], "driver_version": { "op": ">", "value": "8.0.4" } }, { "device_id": ["0x2a02"], "driver_version": { "op": ">=", "value": "9.1" } }, { "device_id": ["0x0a16", "0x0a26"], "driver_version": { "op": ">=", "value": "10.0.1" } } ], "features": [ "all" ] }, { "id": 18, "description": "NVIDIA Quadro FX 1500 is buggy", "cr_bugs": [84701], "os": { "type": "linux" }, "vendor_id": "0x10de", "device_id": ["0x029e"], "features": [ "all" ] }, { "id": 23, "description": "Mesa drivers in linux older than 7.11 are assumed to be buggy", "os": { "type": "linux" }, "driver_vendor": "Mesa", "driver_version": { "op": "<", "value": "7.11" }, "exceptions": [ { "driver_vendor": "osmesa" } ], "features": [ "all" ] }, { "id": 24, "description": "Accelerated 2d canvas is unstable in Linux at the moment", "os": { "type": "linux" }, "features": [ "accelerated_2d_canvas" ] }, { "id": 27, "description": "ATI/AMD cards with older drivers in Linux are crash-prone", "cr_bugs": [95934, 94973, 136240, 357314], "os": { "type": "linux" }, "gl_vendor": "ATI.*", "exceptions": [ { "driver_vendor": ".*AMD.*", "driver_version": { "op": ">=", "style": "lexical", "value": "8.98" } }, { "driver_vendor": "Mesa", "driver_version": { "op": ">=", "value": "10.0.4" } } ], "features": [ "all" ] }, { "id": 28, "description": "ATI/AMD cards with third-party drivers in Linux are crash-prone", "cr_bugs": [95934, 94973, 357314], "os": { "type": "linux" }, "gl_vendor": "X\\.Org.*", "gl_renderer": ".*AMD.*", "exceptions": [ { "driver_vendor": "Mesa", "driver_version": { "op": ">=", "value": "10.0.4" } } ], "features": [ "all" ] }, { "id": 29, "description": "ATI/AMD cards with third-party drivers in Linux are crash-prone", "cr_bugs": [95934, 94973, 357314], "os": { "type": "linux" }, "gl_vendor": "X\\.Org.*", "gl_renderer": ".*ATI.*", "exceptions": [ { "driver_vendor": "Mesa", "driver_version": { "op": ">=", "value": "10.0.4" } } ], "features": [ "all" ] }, { "id": 30, "description": "NVIDIA cards with nouveau drivers in Linux are crash-prone", "cr_bugs": [94103], "os": { "type": "linux" }, "vendor_id": "0x10de", "gl_vendor": "(?i)nouveau.*", "features": [ "all" ] }, { "id": 32, "description": "Accelerated 2d canvas is disabled on Windows systems with low perf stats", "cr_bugs": [116350, 151500], "os": { "type": "win" }, "perf_overall": { "op": "<", "value": "3.5" }, "exceptions": [ { "perf_gaming": { "op": ">", "value": "3.5" } }, { "cpu_info": "(?i).*Atom.*" } ], "features": [ "accelerated_2d_canvas" ] }, { "id": 34, "description": "S3 Trio (used in Virtual PC) is not compatible", "cr_bugs": [119948], "os": { "type": "win" }, "vendor_id": "0x5333", "device_id": ["0x8811"], "features": [ "all" ] }, { "id": 35, "description": "Stage3D is not supported on Linux", "cr_bugs": [129848], "os": { "type": "linux" }, "features": [ "flash_stage3d" ] }, { "id": 37, "description": "Older drivers are unreliable for Optimus on Linux", "cr_bugs": [131308, 363418], "os": { "type": "linux" }, "multi_gpu_style": "optimus", "exceptions": [ { "driver_vendor": "Mesa", "driver_version": { "op": ">=", "value": "10.1" }, "gl_vendor": "Intel.*" } ], "features": [ "all" ] }, { "id": 38, "description": "Accelerated 2D canvas is unstable for NVidia GeForce 9400M on Lion", "cr_bugs": [130495], "os": { "type": "macosx", "version": { "op": "=", "value": "10.7" } }, "vendor_id": "0x10de", "device_id": ["0x0863"], "features": [ "accelerated_2d_canvas" ] }, { "id": 42, "description": "AMD Radeon HD 6490M and 6970M on Snow Leopard are buggy", "cr_bugs": [137307, 285350], "os": { "type": "macosx", "version": { "op": "=", "value": "10.6" } }, "vendor_id": "0x1002", "device_id": ["0x6760", "0x6720"], "features": [ "webgl" ] }, { "id": 44, "description": "Intel HD 4000 causes kernel panic on Lion", "cr_bugs": [134015], "os": { "type": "macosx", "version": { "op": "between", "value": "10.7.0", "value2": "10.7.4" } }, "vendor_id": "0x8086", "device_id": ["0x0166"], "multi_gpu_category": "any", "features": [ "all" ] }, { "id": 45, "description": "Parallels drivers older than 7 are buggy", "cr_bugs": [138105], "os": { "type": "win" }, "vendor_id": "0x1ab8", "driver_version": { "op": "<", "value": "7" }, "features": [ "all" ] }, { "id": 46, "description": "ATI FireMV 2400 cards on Windows are buggy", "cr_bugs": [124152], "os": { "type": "win" }, "vendor_id": "0x1002", "device_id": ["0x3151"], "features": [ "all" ] }, { "id": 47, "description": "NVIDIA linux drivers older than 295.* are assumed to be buggy", "cr_bugs": [78497], "os": { "type": "linux" }, "vendor_id": "0x10de", "driver_vendor": "NVIDIA", "driver_version": { "op": "<", "value": "295" }, "features": [ "all" ] }, { "id": 48, "description": "Accelerated video decode is unavailable on Mac and Linux", "cr_bugs": [137247, 133828], "exceptions": [ { "os": { "type": "chromeos" } }, { "os": { "type": "win" } }, { "os": { "type": "android" } } ], "features": [ "accelerated_video_decode" ] }, { "id": 49, "description": "NVidia GeForce GT 650M can cause the system to hang with flash 3D", "cr_bugs": [140175], "os": { "type": "macosx", "version": { "op": "between", "value": "10.8.0", "value2": "10.8.1" } }, "multi_gpu_style": "optimus", "vendor_id": "0x10de", "device_id": ["0x0fd5"], "features": [ "flash_3d", "flash_stage3d" ] }, { "id": 50, "description": "Disable VMware software renderer on older Mesa", "cr_bugs": [145531, 332596], "os": { "type": "linux" }, "gl_vendor": "VMware.*", "exceptions": [ { "driver_vendor": "Mesa", "driver_version": { "op": ">=", "value": "9.2.1" }, "gl_renderer": ".*SVGA3D.*" } ], "features": [ "all" ] }, { "id": 53, "description": "The Intel GMA500 is too slow for Stage3D", "cr_bugs": [152096], "vendor_id": "0x8086", "device_id": ["0x8108", "0x8109"], "features": [ "flash_stage3d" ] }, { "id": 56, "description": "NVIDIA linux drivers are unstable when using multiple Open GL contexts and with low memory", "cr_bugs": [145600], "os": { "type": "linux" }, "vendor_id": "0x10de", "driver_vendor": "NVIDIA", "features": [ "accelerated_video_decode", "flash_3d", "flash_stage3d" ] }, { // Panel fitting is only used with OS_CHROMEOS. To avoid displaying an // error in chrome:gpu on every other platform, this blacklist entry needs // to only match on chromeos. The drawback is that panel_fitting will not // appear to be blacklisted if accidentally queried on non-chromeos. "id": 57, "description": "Chrome OS panel fitting is only supported for Intel IVB and SNB Graphics Controllers", "os": { "type": "chromeos" }, "exceptions": [ { "vendor_id": "0x8086", "device_id": ["0x0106", "0x0116", "0x0166"] } ], "features": [ "panel_fitting" ] }, { "id": 59, "description": "NVidia driver 8.15.11.8593 is crashy on Windows", "cr_bugs": [155749], "os": { "type": "win" }, "vendor_id": "0x10de", "driver_version": { "op": "=", "value": "8.15.11.8593" }, "features": [ "accelerated_video_decode" ] }, { "id": 62, "description": "Accelerated 2D canvas buggy on old Qualcomm Adreno", "cr_bugs": [161575], "os": { "type": "android" }, "gl_renderer": ".*Adreno.*", "driver_version": { "op": "<", "value": "4.1" }, "features": [ "accelerated_2d_canvas" ] }, { "id": 64, "description": "Hardware video decode is only supported in win7+", "cr_bugs": [159458], "os": { "type": "win", "version": { "op": "<", "value": "6.1" } }, "features": [ "accelerated_video_decode" ] }, { "id": 68, "description": "VMware Fusion 4 has corrupt rendering with Win Vista+", "cr_bugs": [169470], "os": { "type": "win", "version": { "op": ">=", "value": "6.0" } }, "vendor_id": "0x15ad", "driver_version": { "op": "<=", "value": "7.14.1.1134" }, "features": [ "all" ] }, { "id": 69, "description": "NVIDIA driver 8.17.11.9621 is buggy with Stage3D baseline mode", "cr_bugs": [172771], "os": { "type": "win" }, "vendor_id": "0x10de", "driver_version": { "op": "=", "value": "8.17.11.9621" }, "features": [ "flash_stage3d_baseline" ] }, { "id": 70, "description": "NVIDIA driver 8.17.11.8267 is buggy with Stage3D baseline mode", "cr_bugs": [172771], "os": { "type": "win" }, "vendor_id": "0x10de", "driver_version": { "op": "=", "value": "8.17.11.8267" }, "features": [ "flash_stage3d_baseline" ] }, { "id": 71, "description": "All Intel drivers before 8.15.10.2021 are buggy with Stage3D baseline mode", "cr_bugs": [172771], "os": { "type": "win" }, "vendor_id": "0x8086", "driver_version": { "op": "<", "value": "8.15.10.2021" }, "features": [ "flash_stage3d_baseline" ] }, { "id": 72, "description": "NVIDIA GeForce 6200 LE is buggy with WebGL", "cr_bugs": [232529], "os": { "type": "win" }, "vendor_id": "0x10de", "device_id": ["0x0163"], "features": [ "webgl" ] }, { "id": 73, "description": "WebGL is buggy with the NVIDIA GeForce GT 330M, 9400, and 9400M on MacOSX earlier than 10.8", "cr_bugs": [233523], "os": { "type": "macosx", "version": { "op": "<", "value": "10.8" } }, "vendor_id": "0x10de", "device_id": ["0x0a29", "0x0861", "0x0863"], "features": [ "webgl" ] }, { "id": 74, "description": "GPU access is blocked if users don't have proper graphics driver installed after Windows installation", "cr_bugs": [248178], "os": { "type": "win" }, "driver_vendor": "Microsoft", "exceptions": [ { "vendor_id": "0x1414", "device_id": ["0x02c1"] } ], "features": [ "all" ] }, ) // String split to avoid MSVC char limit. LONG_STRING_CONST( { "id": 76, "description": "WebGL is disabled on Android unless GPU reset notification is supported", "os": { "type": "android" }, "exceptions": [ { "gl_reset_notification_strategy": { "op": "=", "value": "33362" } }, { "gl_renderer": "Mali-400.*", "gl_extensions": ".*EXT_robustness.*" } ], "features": [ "webgl" ] }, { "id": 78, "description": "Accelerated video decode interferes with GPU sandbox on older Intel drivers", "cr_bugs": [180695], "os": { "type": "win" }, "vendor_id": "0x8086", "driver_version": { "op": "between", "value": "8.15.10.1883", "value2": "8.15.10.2702" }, "features": [ "accelerated_video_decode" ] }, { "id": 79, "description": "Disable GPU on all Windows versions prior to and including Vista", "cr_bugs": [315199], "os": { "type": "win", "version": { "op": "<=", "value": "6.0" } }, "features": [ "all" ] }, { "id": 81, "description": "Apple software renderer used under VMWare hangs on Mac OS 10.6 and 10.7", "cr_bugs": [230931], "os": { "type": "macosx", "version": { "op": "<=", "value": "10.7" } }, "vendor_id": "0x15ad", "features": [ "all" ] }, { "id": 82, "description": "MediaCodec is still too buggy to use for encoding (b/11536167)", "os": { "type": "android" }, "features": [ "accelerated_video_encode" ] }, { "id": 83, "description": "Samsung Galaxy NOTE is too buggy to use for video decoding", "cr_bugs": [308721], "os": { "type": "android" }, "machine_model_name": ["GT-.*"], "features": [ "accelerated_video_decode" ] }, { "id": 85, "description": "Samsung Galaxy S4 is too buggy to use for video decoding", "cr_bugs": [329072], "os": { "type": "android" }, "machine_model_name": ["SCH-.*"], "features": [ "accelerated_video_decode" ] }, { "id": 86, "description": "Intel Graphics Media Accelerator 3150 causes the GPU process to hang running WebGL", "cr_bugs": [305431], "os": { "type": "win" }, "vendor_id": "0x8086", "device_id": ["0xa011"], "features": [ "webgl" ] }, { "id": 87, "description": "Accelerated video decode on Intel driver 10.18.10.3308 is incompatible with the GPU sandbox", "cr_bugs": [298968], "os": { "type": "win" }, "vendor_id": "0x8086", "driver_version": { "op": "=", "value": "10.18.10.3308" }, "features": [ "accelerated_video_decode" ] }, { "id": 88, "description": "Accelerated video decode on AMD driver 13.152.1.8000 is incompatible with the GPU sandbox", "cr_bugs": [298968], "os": { "type": "win" }, "vendor_id": "0x1002", "driver_version": { "op": "=", "value": "13.152.1.8000" }, "features": [ "accelerated_video_decode" ] }, { "id": 89, "description": "Accelerated video decode interferes with GPU sandbox on certain AMD drivers", "cr_bugs": [298968], "os": { "type": "win" }, "vendor_id": "0x1002", "driver_version": { "op": "between", "value": "8.810.4.5000", "value2": "8.970.100.1100" }, "features": [ "accelerated_video_decode" ] }, { "id": 90, "description": "Accelerated video decode interferes with GPU sandbox on certain NVIDIA drivers", "cr_bugs": [298968], "os": { "type": "win" }, "vendor_id": "0x10de", "driver_version": { "op": "between", "value": "8.17.12.5729", "value2": "8.17.12.8026" }, "features": [ "accelerated_video_decode" ] }, { "id": 91, "description": "Accelerated video decode interferes with GPU sandbox on certain NVIDIA drivers", "cr_bugs": [298968], "os": { "type": "win" }, "vendor_id": "0x10de", "driver_version": { "op": "between", "value": "9.18.13.783", "value2": "9.18.13.1090" }, "features": [ "accelerated_video_decode" ] }, { "id": 92, "description": "Accelerated video decode does not work with the discrete GPU on AMD switchables", "cr_bugs": [298968], "os": { "type": "win" }, "multi_gpu_style": "amd_switchable_discrete", "features": [ "accelerated_video_decode" ] }, { "id": 93, "description": "GLX indirect rendering (X remoting) is not supported", "cr_bugs": [72373], "os": { "type": "linux" }, "direct_rendering": false, "features": [ "all" ] }, { "id": 94, "description": "Intel driver version 8.15.10.1749 causes GPU process hangs.", "cr_bugs": [350566], "os": { "type": "win" }, "vendor_id": "0x8086", "driver_version": { "op": "=", "value": "8.15.10.1749" }, "features": [ "all" ] }, { "id": 95, "description": "AMD driver version 13.101 is unstable on linux.", "cr_bugs": [363378], "os": { "type": "linux" }, "vendor_id": "0x1002", "driver_vendor": ".*AMD.*", "driver_version": { "op": "=", "value": "13.101" }, "features": [ "all" ] }, { "id": 96, "description": "GPU rasterization is whitelisted on select devices on Android", "cr_bugs": [362779], "os": { "type": "android" }, "exceptions": [ { "machine_model_name": ["Nexus 4", "Nexus 5", "Nexus 7", "XT1049", "XT1050", "XT1052", "XT1053", "XT1055", "XT1056", "XT1058", "XT1060", "HTC One", "C5303", "C6603", "C6903", "GT-I8262", "GT-I8552", "GT-I9195", "GT-I9500", "GT-I9505", "SAMSUNG-SCH-I337", "SCH-I545", "SGH-M919", "SM-N900", "SM-N9005", "SPH-L720", "XT907", "XT1032", "XT1033", "XT1080"] }, { "os": { "type": "android", "version": { "op": ">=", "value": "4.4.99" } } }, { "os": { "type": "android", "version": { "op": ">=", "value": "4.4" } }, "gl_type": "gles", "gl_version": { "op": ">=", "value": "3.0" } } ], "features": [ "gpu_rasterization" ] }, { "id": 99, "description": "GPU rasterization is blacklisted on non-Android", "cr_bugs": [362779], "exceptions": [ { "os": { "type": "android" } } ], "features": [ "gpu_rasterization" ] }, { "id": 100, "description": "GPU rasterization is blacklisted on Nexus 10", "cr_bugs": [407144], "gl_renderer": ".*Mali-T604.*", "features": [ "gpu_rasterization" ] }, { "id": 101, "description": "Samsung Galaxy Tab is too buggy to use for video decoding", "cr_bugs": [408353], "os": { "type": "android" }, "machine_model_name": ["SM-.*"], "features": [ "accelerated_video_decode" ] } ] } ); // LONG_STRING_CONST macro } // namespace gpu
crosswalk-project/chromium-crosswalk-efl
gpu/config/software_rendering_list_json.cc
C++
bsd-3-clause
26,377
package com.compositesw.services.system.admin.archive; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for performArchiveImportResponse complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="performArchiveImportResponse"> * &lt;complexContent> * &lt;extension base="{http://www.compositesw.com/services/system/admin/archive}archiveReportResponse"> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "performArchiveImportResponse") public class PerformArchiveImportResponse extends ArchiveReportResponse { }
dvbu-test/PDTool
CISAdminApi7.0.0/src/com/compositesw/services/system/admin/archive/PerformArchiveImportResponse.java
Java
bsd-3-clause
830
/* * Copyright (c) 2013 Chun-Ying Huang * * This file is part of GamingAnywhere (GA). * * GA is free software; you can redistribute it and/or modify it * under the terms of the 3-clause BSD License as published by the * Free Software Foundation: http://directory.fsf.org/wiki/License:BSD_3Clause * * GA 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. * * You should have received a copy of the 3-clause BSD License along with GA; * if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /** * @file * implementation: common GA functions and macros */ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <time.h> #include <pthread.h> #ifndef WIN32 #ifndef ANDROID #include <execinfo.h> #endif /* !ANDROID */ #include <signal.h> #include <unistd.h> #include <sys/time.h> #include <sys/syscall.h> #endif /* !WIN32 */ #ifdef ANDROID #include <android/log.h> #endif /* ANDROID */ #ifdef __APPLE__ #include <syslog.h> #endif #if !defined(WIN32) && !defined(__APPLE__) && !defined(ANDROID) #include <X11/Xlib.h> #endif #include "ga-common.h" #include "ga-conf.h" #ifndef ANDROID_NO_FFMPEG #include "ga-avcodec.h" #endif #include "rtspconf.h" #include <map> #include <list> using namespace std; #ifndef NIPQUAD /** For printing IPv4 addresses: convert an unsigned int to 4 unsigned char. */ #define NIPQUAD(x) ((unsigned char*)&(x))[0], \ ((unsigned char*)&(x))[1], \ ((unsigned char*)&(x))[2], \ ((unsigned char*)&(x))[3] #endif /** The gloabl log file name */ static char *ga_logfile = NULL; /** * Compute the time difference for two \a timeval data structure, i.e., * \a tv1 - \a tv2. * * @param tv1 [in] Pointer to the first \a timeval data structure. * @param tv2 [in] Pointer to the second \a timeval data structure. * @return The difference in micro seconds. */ EXPORT long long tvdiff_us(struct timeval *tv1, struct timeval *tv2) { struct timeval delta; delta.tv_sec = tv1->tv_sec - tv2->tv_sec; delta.tv_usec = tv1->tv_usec - tv2->tv_usec; if(delta.tv_usec < 0) { delta.tv_sec--; delta.tv_usec += 1000000; } return 1000000LL*delta.tv_sec + delta.tv_usec; } /** * Sleep and wake up at \a ptv + \a interval (micro seconds). * * @param interval [in] The expected sleeping time (in micro seconds). * @param ptv [in] Pointer to the baseline time. * @return Currently always return 0. * * This function is useful for controlling precise sleeps. * We usually have to process each video frame in a fixed interval. * Each time interval includes the processing time and the sleeping time. * However, the processing time could be different in each iteration, so * the sleeping time has to be adapted as well. * To achieve the goal, we have to obtain the baseline time \a ptv * (using \a gettimeofday function) * \em before the processing task and call this function \em after * the processing task. In this case, the \a interval is set to the total * length of the interval, e.g., 41667 for 24fps video. * * This function sleeps for \a interval micro seconds if the baseline * time is not specified. */ EXPORT long long ga_usleep(long long interval, struct timeval *ptv) { long long delta; struct timeval tv; if(ptv != NULL) { gettimeofday(&tv, NULL); delta = tvdiff_us(&tv, ptv); if(delta >= interval) { usleep(1); return -1; } interval -= delta; } usleep(interval); return 0LL; } /** * Write message \a s into the log file. * This in an internal function only called by \em ga_log function. * * @param tv [in] The timestamp of logging. * @param s [in] The message to be written. * * This function is SLOW, but it attempts to make all writes successfull. * It appends the message into the file each time when it is called. */ static void ga_writelog(struct timeval tv, const char *s) { FILE *fp; if(ga_logfile == NULL) return; if((fp = fopen(ga_logfile, "at")) != NULL) { fprintf(fp, "[%d] %ld.%06ld %s", getpid(), tv.tv_sec, tv.tv_usec, s); fclose(fp); } return; } /** * Write log messages and print on Android console. * * @param fmt [in] The format string for the message. * @param ... [in] The arguments for replacing specifiers in the format string. * * This function has the same syntax as the \em printf function. * It outputs a timestamp before the message, and optionally writing * the message into a log file if log feature is turned on. */ EXPORT int ga_log(const char *fmt, ...) { char msg[4096]; struct timeval tv; va_list ap; // gettimeofday(&tv, NULL); va_start(ap, fmt); #ifdef ANDROID __android_log_vprint(ANDROID_LOG_INFO, "ga_log.native", fmt, ap); #endif vsnprintf(msg, sizeof(msg), fmt, ap); va_end(ap); #ifdef __APPLE__ syslog(LOG_NOTICE, "%s", msg); #endif // ga_writelog(tv, msg); // return 0; } /** * Print out log messages (on \em stderr or log console (on Android)). * * @param fmt [in] The format string for the message. * @param ... [in] The arguments for replacing specifiers in the format string. * * This function has the same syntax as the \em printf function. * It outputs a timestamp before the message. */ EXPORT int ga_error(const char *fmt, ...) { char msg[4096]; struct timeval tv; va_list ap; gettimeofday(&tv, NULL); va_start(ap, fmt); #ifdef ANDROID __android_log_vprint(ANDROID_LOG_INFO, "ga_log.native", fmt, ap); #endif vsnprintf(msg, sizeof(msg), fmt, ap); va_end(ap); #ifdef __APPLE__ syslog(LOG_NOTICE, "%s", msg); #endif fprintf(stderr, "# [%d] %ld.%06ld %s", getpid(), tv.tv_sec, tv.tv_usec, msg); // ga_writelog(tv, msg); // return -1; } /** * malloc() and return the offset to align pointer at 16-byte boundary. * * @param size [in] Requested memory space. * @param ptr [out] Pointer to the memory pointer. * @param alignment [out] Pointer to the alignment value. * @return 0 on success, or -1 on failure. * * Note: The actually allocated memory space is \a size + 16. * Data should be stored starting from \a *ptr + \a *alignment. */ EXPORT int ga_malloc(int size, void **ptr, int *alignment) { if((*ptr = malloc(size+16)) == NULL) return -1; #ifdef __x86_64__ *alignment = 16 - (((unsigned long long) *ptr) & 0x0f); #else *alignment = 16 - (((unsigned) *ptr) & 0x0f); #endif return 0; } /** * Compute the alignment offset for a given pointer and the align-to value. * * @param ptr [in] The pointer address used to compute alignment offset. * @param alignto [in] The align-to value, must be 2^n, e.g., 1, 2, 4, 8, 16. * @return The alignment offset has to be added to the pointer address. * * Note that this function does not check the alignto value. * The caller must ensure that the \a alignto value must be 2^n, n >= 0. */ EXPORT int ga_alignment(void *ptr, int alignto) { int mask = alignto - 1; #ifdef __x86_64__ return alignto - (((unsigned long long) ptr) & mask); #else return alignto - (((unsigned) ptr) & mask); #endif } /** * Get the thread ID in long format. */ EXPORT long ga_gettid() { #ifdef WIN32 return GetCurrentThreadId(); #elif defined __APPLE__ return pthread_mach_thread_np(pthread_self()); #elif defined ANDROID return gettid(); #else return (pid_t) syscall(SYS_gettid); #endif } /** * Initialize windows socket sub-system. * * @return 0 on success and -1 on error. */ static int winsock_init() { #ifdef WIN32 WSADATA wd; if(WSAStartup(MAKEWORD(2,2), &wd) != 0) return -1; #endif return 0; } /** * List registered ffmpeg codecs. * This function is for debug purpose, and could be removed in the future. */ EXPORT void ga_dump_codecs() { int n, count; char buf[8192], *ptr; AVCodec *c = NULL; n = snprintf(buf, sizeof(buf), "Registered codecs: "); ptr = &buf[n]; count = 0; for(c = av_codec_next(NULL); c != NULL; c = av_codec_next(c)) { n = snprintf(ptr, sizeof(buf)-(ptr-buf), "%s ", c->name); ptr += n; count++; } snprintf(ptr, sizeof(buf)-(ptr-buf), "(%d)\n", count); ga_error(buf); return; } /** * Initialize GamingAnywhere * * @param config [in] Pathname to the configuration file * @param url [in] URL to the server URL address, in the form of rtsp://serveraddress:port/path * @return 0 on success or -1 on error */ EXPORT int ga_init(const char *config, const char *url) { srand(time(0)); winsock_init(); #ifndef ANDROID_NO_FFMPEG av_register_all(); avcodec_register_all(); avformat_network_init(); //ga_dump_codecs(); #endif if(config != NULL) { if(ga_conf_load(config) < 0) { ga_error("GA: cannot load configuration file '%s'\n", config); return -1; } } if(url != NULL) { if(ga_url_parse(url) < 0) { ga_error("GA: invalid URL '%s'\n", url); return -1; } } return 0; } /** * Deinitialize GamingAnywhere: currently do nothing */ EXPORT void ga_deinit() { return; } /** * Enable log feature * * This function must be called if you plan to write logs into a file. * It reads the \em logfile option specified in the configuration file. */ EXPORT void ga_openlog() { char fn[1024]; FILE *fp; // if(ga_conf_readv("logfile", fn, sizeof(fn)) == NULL) return; if((fp = fopen(fn, "at")) != NULL) { fclose(fp); ga_logfile = strdup(fn); } // return; } /** * Disable log feature */ EXPORT void ga_closelog() { if(ga_logfile != NULL) { free(ga_logfile); ga_logfile = NULL; } return; } // save file feature /** * Internal function for \em ga_save_init and \em ga_save_init_txt. * Returns the FILE pointer. * * @param filename [in] Pathname to store the image data. * @param mode [in] File access mode pass to \em fopen function. * @return FILE pointer to the opened file. */ static FILE * ga_save_init_internal(const char *filename, const char *mode) { FILE *fp = NULL; if(filename != NULL) { fp = fopen(filename, mode); if(fp == NULL) { ga_error("save file: open %s failed.\n", filename); } } return fp; } /** * Return the FILE pointer used to store saved raw image frame data. * * @param filename [in] Pathname to store the image data. * @return FILE pointer to the opened file. * * This function must be called if you plan to use the * save raw video image feature. * All captured images will be stored in this single file. */ EXPORT FILE * ga_save_init(const char *filename) { return ga_save_init_internal(filename, "wb"); } /** * Return the FILE pointer used to stora text-based meta-data for saved image frame. * * @param filename [in] Pathname to store the text-based meta-data. * @return the FILE pointer to the opened file. * * This function can be called optionally when you need to store * text-based meta data for saved raw video image. * All stored meta-data will be stored in this single file. */ EXPORT FILE * ga_save_init_txt(const char *filename) { return ga_save_init_internal(filename, "wt"); } /** * Save arbitrary binary data. * * @param fp [in] FILE pointer to the opened file (by \em ga_save_init). * @param buffer [in] Pointer to the data memory. * @param size [in] Size of the data, in bytes. */ EXPORT int ga_save_data(FILE *fp, unsigned char *buffer, int size) { if(fp == NULL || buffer == NULL || size < 0) return -1; if(size == 0) return 0; return fwrite(buffer, sizeof(char), size, fp); } /** * Save text data. * * @param fp [in] FILE pointer to the opened file (by \em ga_save_init_txt). * @param fmt [in] Pointer the for format string. * @param ... [in] Arguments for specifiers in the format string. */ EXPORT int ga_save_printf(FILE *fp, const char *fmt, ...) { int wlen; va_list ap; if(fp == NULL) return -1; va_start(ap, fmt); wlen = vfprintf(fp, fmt, ap); va_end(ap); fflush(fp); return wlen; } /** * Save YUV420 image frame data * * @param fp [in] FILE pointer to the opened file (by \em ga_save_init). * @param w [in] Width of the frame. * @param h [in] Height of the frame. * @param planes [in] Pointers to address of (3) planes [Y, U, and V]. * @param linesize [in] Pointers to linesize. */ EXPORT int ga_save_yuv420p(FILE *fp, int w, int h, unsigned char *planes[], int linesize[]) { int i, j, wlen, written = 0; int w2 = w/2; int h2 = h/2; int expected = w * h * 3 / 2; unsigned char *src; if(fp == NULL || w <= 0 || h <= 0 || planes == NULL || linesize == NULL) return -1; // write Y src = planes[0]; for(i = 0; i < h; i++) { if((wlen = fwrite(src, sizeof(char), w, fp)) < 0) goto err_save_yuv; written += wlen; src += linesize[0]; } // write U/V for(j = 1; j < 3; j++) { src = planes[j]; for(i = 0; i < h2; i++) { if((wlen = fwrite(src, sizeof(char), w2, fp)) < 0) goto err_save_yuv; written += wlen; src += linesize[j]; } } // if(written != expected) { ga_error("save YUV (%dx%d): expected %d, save %d (frame may be corrupted)\n", w, h, expected, written); } // fflush(fp); return written; err_save_yuv: return -1; } /** * Save RGB4 image frame data * * @param fp [in] FILE pointer to the opened file (by \em ga_save_init). * @param w [in] Width of the frame. * @param h [in] Height of the frame. * @param planes [in] Pointers to the image data memory. * @param linesize [in] linesize, usually \a h * pixel size plus (optional) alignments. */ EXPORT int ga_save_rgb4(FILE *fp, int w, int h, unsigned char *planes, int linesize) { int i, wlen, written = 0; int w4 = w*4; int expected = w * h * 4; if(fp == NULL || w <= 0 || h <= 0 || planes == NULL || linesize < w4) return -1; // write for(i = 0; i < h; i++) { if((wlen = fwrite(planes, sizeof(char), w4, fp)) < 0) goto err_save_rgb4; written += wlen; planes += linesize; } // if(written != expected) { ga_error("save RGB4 (%dx%d): expected %d, save %d (frame may be corrupted)\n", w, h, expected, written); } // fflush(fp); return written; err_save_rgb4: return -1; } /** * Close a file opened by \em ga_save_init or \em ga_save_init_txt * * @param fp [in] The opened file pointer. * @return This function currently always returns 0. */ EXPORT int ga_save_close(FILE *fp) { if(fp != NULL) { fclose(fp); } return 0; } // static map<int,list<int> > aggmap; /** * Clear everything in the aggregated output buffer. */ EXPORT void ga_aggregated_reset() { aggmap.clear(); return; } /** * Output aggregated statistic numbers periodically * * @param key [in] The key used to uniquely identify an record series. * @param limit [in] Output buffered records when the number of records * reaches the \a limit * @param value [in] The value to be output * * This function is used to reduce the output frequency of statistics. * If you need to output integer statistics but does not want the output * affect the performance too much. * You can consider use the aggregated output function. * Call this function to output an integer value as usual but the output * is only output when the number of records reaches the limit. * The \a key value must be different for different statistic series. * The \a limit value would be better to be a distinct prime number: * To prevent output from different series collides at the same time. */ EXPORT void ga_aggregated_print(int key, unsigned int limit, int value) { map<int,list<int> >::iterator mi; // push data if((mi = aggmap.find(key)) == aggmap.end()) { aggmap[key].push_back(value); return; } else { mi->second.push_back(value); } // output? if(mi->second.size() >= limit) { int pos, left, wlen; char *ptr, buf[16384] = "AGGREGATED-VALUES:"; list<int>::iterator li; struct timeval tv; // pos = snprintf(buf, sizeof(buf), "AGGREGATED-OUTPUT[%04x]:", key); left = sizeof(buf) - pos; ptr = buf + pos; for(li = mi->second.begin(); li != mi->second.end() && left>16; li++) { wlen = snprintf(ptr, left, " %d", *li); ptr += wlen; left -= wlen; } if(li != mi->second.end()) { ga_error("insufficeient space for aggregated messages.\n"); } mi->second.clear(); // gettimeofday(&tv, NULL); #ifdef ANDROID __android_log_write(ANDROID_LOG_INFO, "ga_log.native", buf); #else fprintf(stderr, "# [%d] %ld.%06ld %s\n", getpid(), tv.tv_sec, tv.tv_usec, buf); #endif ga_writelog(tv, buf); } // return; } /** * Find mpeg start code 00 00 01 or 00 00 00 01. * * @param buf [in] The byte buffer to search. * @param end [in] End of the byte buffer. * @param startcode_len [out] Length of start code. * @return pointer to the beginning of the start code, or NULL if not found. * * If a non-NULL pointer is returned, you can read the frame data start from * the returned pointer plus \a startcode_len. */ EXPORT unsigned char * ga_find_startcode(unsigned char *buf, unsigned char *end, int *startcode_len) { unsigned char *ptr; for(ptr = buf; ptr < end-4; ptr++) { if(*ptr == 0 && *(ptr+1)==0) { if(*(ptr+2) == 1) { *startcode_len = 3; return ptr; } else if(*(ptr+2)==0 && *(ptr+3)==1) { *startcode_len = 4; return ptr; } } } return NULL; } /** * Convert a number represented in a string to a long integer. * * @param str [in] The number string. * @return The converted number in long format. */ EXPORT long ga_atoi(const char *str) { // XXX: not sure why sometimes windows strtol failed on // handling read-only constant strings ... char buf[64]; long val; strncpy(buf, str, sizeof(buf)); val = strtol(buf, NULL, 0); return val; } EXPORT struct gaRect * ga_fillrect(struct gaRect *rect, int left, int top, int right, int bottom) { if(rect == NULL) return NULL; #define SWAP(a,b) do { int tmp = a; a = b; b = tmp; } while(0); if(left > right) SWAP(left, right); if(top > bottom) SWAP(top, bottom); #undef SWAP rect->left = left; rect->top = top; rect->right = right; rect->bottom = bottom; // rect->width = rect->right - rect->left + 1; rect->height = rect->bottom - rect->top + 1; rect->linesize = rect->width * RGBA_SIZE; rect->size = rect->width * rect->height * RGBA_SIZE; // if(rect->width <= 0 || rect->height <= 0) { ga_error("# invalid rect size (%dx%d)\n", rect->width, rect->height); return NULL; } // return rect; } #ifdef WIN32 EXPORT int ga_crop_window(struct gaRect *rect, struct gaRect **prect) { char wndname[1024], wndclass[1024]; char *pname; char *pclass; int dw, dh, find_wnd_arg = 0; HWND hWnd; RECT client; POINT lt, rb; // if(rect == NULL || prect == NULL) return -1; // pname = ga_conf_readv("find-window-name", wndname, sizeof(wndname)); pclass = ga_conf_readv("find-window-class", wndclass, sizeof(wndclass)); // if(pname != NULL && *pname != '\0') find_wnd_arg++; if(pclass != NULL && *pclass != '\0') find_wnd_arg++; if(find_wnd_arg <= 0) { *prect = NULL; return 0; } // if((hWnd = FindWindow(pclass, pname)) == NULL) { ga_error("FindWindow failed for '%s/%s'\n", pclass ? pclass : "", pname ? pname : ""); return -1; } // GetWindowText(hWnd, wndname, sizeof(wndname)); dw = GetSystemMetrics(SM_CXSCREEN); dh = GetSystemMetrics(SM_CYSCREEN); // ga_error("Found window (0x%08x) :%s%s%s%s\n", hWnd, pclass ? " class=" : "", pclass ? pclass : "", pname ? " name=" : "", pname ? pname : ""); // if(SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW) == 0) { ga_error("SetWindowPos failed.\n"); return -1; } if(GetClientRect(hWnd, &client) == 0) { ga_error("GetClientRect failed.\n"); return -1; } if(SetForegroundWindow(hWnd) == 0) { ga_error("SetForegroundWindow failed.\n"); } // lt.x = client.left; lt.y = client.top; rb.x = client.right-1; rb.y = client.bottom-1; // if(ClientToScreen(hWnd, &lt) == 0 || ClientToScreen(hWnd, &rb) == 0) { ga_error("Map from client coordinate to screen coordinate failed.\n"); return -1; } // rect->left = lt.x; rect->top = lt.y; rect->right = rb.x; rect->bottom = rb.y; // size check: multiples of 2? if((rect->right - rect->left + 1) % 2 != 0) rect->left--; if((rect->bottom - rect->top + 1) % 2 != 0) rect->top--; // if(rect->left < 0 || rect->top < 0 || rect->right >= dw || rect->bottom >= dh) { ga_error("Invalid window: (%d,%d)-(%d,%d) w=%d h=%d (screen dimension = %dx%d).\n", rect->left, rect->top, rect->right, rect->bottom, rect->right - rect->left + 1, rect->bottom - rect->top + 1); return -1; } // *prect = rect; return 1; } #elif defined(__APPLE__) || defined(ANDROID) int ga_crop_window(struct gaRect *rect, struct gaRect **prect) { // XXX: implement find window for Apple *prect = NULL; return 0; } #else /* X11 */ Window FindWindowX(Display *dpy, Window top, const char *name) { Window *children, dummy; unsigned int i, nchildren; Window w = 0; char *window_name; if(XFetchName(dpy, top, &window_name) && !strcmp(window_name, name)) { return(top); } if(!XQueryTree(dpy, top, &dummy, &dummy, &children, &nchildren)) return(0); for(i = 0; i < nchildren; i++) { w = FindWindowX(dpy, children[i], name); if (w) { break; } } if (children) XFree ((char *)children); return(w); } int GetClientRectX(Display *dpy, int screen, Window window, struct gaRect *rect) { XWindowAttributes win_attributes; int rx, ry; Window tmpwin; // if(rect == NULL) return -1; if(!XGetWindowAttributes(dpy, window, &win_attributes)) return -1; XTranslateCoordinates(dpy, window, win_attributes.root, -win_attributes.border_width, -win_attributes.border_width, &rx, &ry, &tmpwin); rect->left = rx; rect->top = ry; rect->right = rx + win_attributes.width - 1; rect->bottom = ry + win_attributes.height - 1; return 0; } int ga_crop_window(struct gaRect *rect, struct gaRect **prect) { char display[16], wndname[1024]; char *pdisplay, *pname; Display *d = NULL; int dw, dh, screen = 0; Window w = 0; // if(rect == NULL || prect == NULL) return -1; // if((pdisplay = ga_conf_readv("display", display, sizeof(display))) == NULL) { *prect = NULL; return 0; } if((pname = ga_conf_readv("find-window-name", wndname, sizeof(wndname))) == NULL) { *prect = NULL; return 0; } // if((d = XOpenDisplay(pdisplay)) == NULL) { ga_error("ga_crop_window: cannot open display %s\n", display); return -1; } screen = XDefaultScreen(d); dw = DisplayWidth(d, screen); dh = DisplayHeight(d, screen); if((w = FindWindowX(d, RootWindow(d, screen), pname)) == 0) { ga_error("FindWindowX failed for %s/%s\n", pdisplay, pname); XCloseDisplay(d); return -1; } if(GetClientRectX(d, screen, w, rect) < 0) { ga_error("GetClientRectX failed for %s/%s\n", pdisplay, pname); XCloseDisplay(d); return -1; } XRaiseWindow(d, w); XSetInputFocus(d, w, RevertToNone, CurrentTime); XCloseDisplay(d); // size check: multiples of 2? if((rect->right - rect->left + 1) % 2 != 0) rect->left--; if((rect->bottom - rect->top + 1) % 2 != 0) rect->top--; // window is all visible? if(rect->left < 0 || rect->top < 0 || rect->right >= dw || rect->bottom >= dh) { ga_error("Invalid window: (%d,%d)-(%d,%d) w=%d h=%d (screen dimension = %dx%d).\n", rect->left, rect->top, rect->right, rect->bottom, rect->right - rect->left + 1, rect->bottom - rect->top + 1, dw, dh); return -1; } // *prect = rect; return 1; } #endif /** * Show the backtrace of current process * This function is only for debug purpose. */ EXPORT void ga_backtrace() { #if defined(WIN32) || defined(ANDROID) return; #else int j, nptrs; #define SIZE 100 void *buffer[SIZE]; char **strings; nptrs = backtrace(buffer, SIZE); printf("-- backtrace() returned %d addresses -----------\n", nptrs); strings = backtrace_symbols(buffer, nptrs); if (strings == NULL) { perror("backtrace_symbols"); exit(-1); } for (j = 0; j < nptrs; j++) printf("%s\n", strings[j]); free(strings); printf("------------------------------------------------\n"); #endif /* WIN32 */ } /** * This function is not used. * It is sometimes that a function is optimized out because it is not * called by the function. * Put those function here to prevent them from being optimized out. */ EXPORT void ga_dummyfunc() { #ifndef ANDROID_NO_FFMPEG // place some required functions - for link purpose swr_alloc_set_opts(NULL, 0, (AVSampleFormat) 0, 0, 0, (AVSampleFormat) 0, 0, 0, NULL); #endif return; } /** * Data struture to describe codecs supported by GA. * The last data must have a key of NULL. */ struct ga_codec_entry { const char *key; /**< Key to identify the codec, must be unique */ enum AVCodecID id; /**< codec Id: defined in (ffmpeg) AVCodecID */ const char *mime; /**< MIME-type name */ const char *ffmpeg_decoders[4]; /**< The ffmpeg decoder name */ }; /** * The codec table. */ struct ga_codec_entry ga_codec_table[] = { { "H264", AV_CODEC_ID_H264, "video/avc", { "h264", NULL } }, { "H265", AV_CODEC_ID_H265, "video/hevc", { "hevc", NULL } }, { "VP8", AV_CODEC_ID_VP8, "video/x-vnd.on2.vp8", { "libvpx", NULL } }, { "MPA", AV_CODEC_ID_MP3, "audio/mpeg", { "mp3", NULL } }, { "OPUS", AV_CODEC_ID_OPUS, "audio/opus", { "libopus", NULL } }, { NULL, AV_CODEC_ID_NONE, NULL, { NULL } } /* END */ }; /** * Get the codec entry from the codec table by key. */ static ga_codec_entry * ga_lookup_core(const char *key) { int i = 0; while(i >= 0 && ga_codec_table[i].key != NULL) { if(strcasecmp(ga_codec_table[i].key, key) == 0) return &ga_codec_table[i]; i++; } return NULL; } /** * Get the codec MIME-type from the codec table by key. */ EXPORT const char * ga_lookup_mime(const char *key) { struct ga_codec_entry * e = ga_lookup_core(key); if(e==NULL || e->mime==NULL) { ga_error("ga_lookup[%s]: mime not found\n", key); return NULL; } return e->mime; } /** * Get the codec ffmpeg decoders from the codec table by key. */ EXPORT const char ** ga_lookup_ffmpeg_decoders(const char *key) { struct ga_codec_entry * e = ga_lookup_core(key); if(e==NULL || e->ffmpeg_decoders==NULL) { ga_error("ga_lookup[%s]: ffmpeg decoders not found\n", key); return NULL; } return e->ffmpeg_decoders; } /** * Get the codec Id from the codec table by key. */ EXPORT enum AVCodecID ga_lookup_codec_id(const char *key) { struct ga_codec_entry * e = ga_lookup_core(key); if(e==NULL) { ga_error("ga_lookup[%s]: codec id not found\n", key); return AV_CODEC_ID_NONE; } return e->id; } #ifdef ANDROID /** * Built-in signal handler for emulating pthread_cancel. */ static void pthread_cancel_handler(int s) { if(s == SIGUSR2) { pthread_exit(NULL); } return; } #endif /** * Initialize the emulated pthread_cancel function. * * This function MUST be called before calling pthread_cancel. * Otherwise, the entire process would be killed. * pthread_cancel() emulating is done by using pthread_kill, * which wake up the specified thread to handle the signal. * * This function can be called only once because a handler is * registered process-wide. * * This function registers a handler for SIGUSR2. */ EXPORT void pthread_cancel_init() { #ifdef ANDROID signal(SIGUSR2, pthread_cancel_handler); #endif return; } #ifdef ANDROID /** * Emulate pthread_cancel in Android * * @param thread [in] thread id. * * The threa to be cancelled must be setup by calling pthread_cancel_init(). * Otherwise, it could be terminated, and not sure if there would be side-effect * or not. */ EXPORT int pthread_cancel(pthread_t thread) { return pthread_kill(thread, SIGUSR2); } #endif
chunying/gaminganywhere
ga/core/ga-common.cpp
C++
bsd-3-clause
27,425
/*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef QTHANDLENEWAPPINSTANCE_H #define QTHANDLENEWAPPINSTANCE_H #include <QString> class QtSingleApplication; bool createTemporaryDir(QString &path); QString handleNewAppInstance(QtSingleApplication *singleApp, int argc, char **argv, const QString &newInstanceArg); #endif // QTHANDLENEWAPPINSTANCE_H
fmilano/mitk
Utilities/qtsingleapplication/qthandlenewappinstance.h
C
bsd-3-clause
691
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_53d.c Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE131.label.xml Template File: sources-sink-53d.tmpl.c */ /* * @description * CWE: 121 Stack Based Buffer Overflow * BadSource: Allocate memory without using sizeof(int) * GoodSource: Allocate memory using sizeof(int) * Sink: memcpy * BadSink : Copy array to data using memcpy() * Flow Variant: 53 Data flow: data passed as an argument from one function through two others to a fourth; all four functions are in different source files * * */ #include "std_testcase.h" /* all the sinks are the same, we just want to know where the hit originated if a tool flags one */ #ifndef OMITBAD void CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_53d_badSink(int * data) { { int source[10] = {0}; /* POTENTIAL FLAW: Possible buffer overflow if data was not allocated correctly in the source */ memcpy(data, source, 10*sizeof(int)); printIntLine(data[0]); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_53d_goodG2BSink(int * data) { { int source[10] = {0}; /* POTENTIAL FLAW: Possible buffer overflow if data was not allocated correctly in the source */ memcpy(data, source, 10*sizeof(int)); printIntLine(data[0]); } } #endif /* OMITGOOD */
JianpingZeng/xcc
xcc/test/juliet/testcases/CWE121_Stack_Based_Buffer_Overflow/s01/CWE121_Stack_Based_Buffer_Overflow__CWE131_memcpy_53d.c
C
bsd-3-clause
1,544
import logging import pytest def test_tracing_by_function_if_enable(track_logger, handler): msg1 = 'TEST1' msg2 = 'TEST2' msg3 = 'TEST3' track_logger.setLevel(logging.INFO) track_logger.enable_tracking() track_logger.debug(msg1) track_logger.info(msg2) track_logger.disable_tracking() track_logger.debug(msg3) record = handler.pop() assert record.msg == msg2 assert record.levelname == logging.getLevelName(logging.INFO) with pytest.raises(IndexError): handler.pop() def test_tracing_by_function_if_enable_with_exc(track_logger, handler): msg1 = 'TEST1' msg2 = 'TEST2' msg3 = 'TEST3' track_logger.setLevel(logging.INFO) track_logger.enable_tracking() try: track_logger.debug(msg1) track_logger.info(msg2) raise Exception except Exception: track_logger.exit_with_exc() track_logger.debug(msg3) track_logger.disable_tracking() record_2 = handler.pop() record_1 = handler.pop() assert record_1.msg == msg1 assert record_1.levelname == logging.getLevelName(logging.DEBUG) assert record_2.msg == msg2 assert record_2.levelname == logging.getLevelName(logging.INFO) with pytest.raises(IndexError): handler.pop() def test_tracing_by_context(track_logger, handler): msg1 = 'TEST1' msg2 = 'TEST2' msg3 = 'TEST3' track_logger.setLevel(logging.INFO) with track_logger.trace: track_logger.debug(msg1) track_logger.info(msg2) track_logger.debug(msg3) record = handler.pop() assert record.msg == msg2 assert record.levelname == logging.getLevelName(logging.INFO) with pytest.raises(IndexError): handler.pop() def test_tracing_by_context_with_exc(track_logger, handler): msg1 = 'TEST1' msg2 = 'TEST2' msg3 = 'TEST3' track_logger.setLevel(logging.INFO) try: with track_logger.trace: track_logger.debug(msg1) track_logger.info(msg2) raise Exception except Exception: pass track_logger.debug(msg3) record_2 = handler.pop() record_1 = handler.pop() assert record_1.msg == msg1 assert record_1.levelname == logging.getLevelName(logging.DEBUG) assert record_2.msg == msg2 assert record_2.levelname == logging.getLevelName(logging.INFO) with pytest.raises(IndexError): handler.pop() def test_tracing_by_decorator(track_logger, handler): msg1 = 'TEST1' msg2 = 'TEST2' msg3 = 'TEST3' track_logger.setLevel(logging.INFO) @track_logger.trace def trace_func(): track_logger.debug(msg1) track_logger.info(msg2) trace_func() track_logger.debug(msg3) record = handler.pop() assert record.msg == msg2 assert record.levelname == logging.getLevelName(logging.INFO) with pytest.raises(IndexError): handler.pop() def test_tracing_by_decorator_with_exc(track_logger, handler): msg1 = 'TEST1' msg2 = 'TEST2' msg3 = 'TEST3' track_logger.setLevel(logging.INFO) @track_logger.trace def trace_func(): track_logger.debug(msg1) track_logger.info(msg2) raise Exception try: trace_func() except Exception: pass track_logger.debug(msg3) record_2 = handler.pop() record_1 = handler.pop() assert record_1.msg == msg1 assert record_1.levelname == logging.getLevelName(logging.DEBUG) assert record_2.msg == msg2 assert record_2.levelname == logging.getLevelName(logging.INFO) with pytest.raises(IndexError): handler.pop()
kivio/python-structured-logging
tests/test_tracking_logger.py
Python
bsd-3-clause
3,755
/* BLIS An object-based framework for developing high-performance BLAS-like libraries. Copyright (C) 2014, The University of Texas Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of The University of Texas nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ void bli_trsv_basic_check( obj_t* alpha, obj_t* a, obj_t* x ); void bli_trsv_check( obj_t* alpha, obj_t* a, obj_t* x ); void bli_trsv_int_check( obj_t* alpha, obj_t* a, obj_t* x, trsv_t* cntl );
tkelman/blis
frame/2/trsv/bli_trsv_check.h
C
bsd-3-clause
2,041
"use strict"; /** * @license * Copyright (c) 2015 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); /// <reference path="../../custom_typings/main.d.ts" /> const path = require("path"); const model_1 = require("../model/model"); const analysis_context_1 = require("./analysis-context"); const cancel_token_1 = require("./cancel-token"); class NoKnownParserError extends Error { } exports.NoKnownParserError = NoKnownParserError; /** * A static analyzer for web projects. * * An Analyzer can load and parse documents of various types, and extract * arbitrary information from the documents, and transitively load * dependencies. An Analyzer instance is configured with parsers, and scanners * which do the actual work of understanding different file types. */ class Analyzer { constructor(options) { if (options.__contextPromise) { this._urlLoader = options.urlLoader; this.urlResolver = options.urlResolver; this._analysisComplete = options.__contextPromise; } else { const context = new analysis_context_1.AnalysisContext(options); this.urlResolver = context.resolver; this._urlLoader = context.loader; this._analysisComplete = Promise.resolve(context); } } /** * Loads, parses and analyzes the root document of a dependency graph and its * transitive dependencies. */ analyze(urls, options = {}) { return __awaiter(this, void 0, void 0, function* () { const previousAnalysisComplete = this._analysisComplete; const uiUrls = this.brandUserInputUrls(urls); let filesWithParsers; this._analysisComplete = (() => __awaiter(this, void 0, void 0, function* () { const previousContext = yield previousAnalysisComplete; filesWithParsers = this._filterFilesByParsableExtension(uiUrls, previousContext); return yield previousContext.analyze(filesWithParsers, options.cancelToken || cancel_token_1.neverCancels); }))(); const context = yield this._analysisComplete; const resolvedUrls = context.resolveUserInputUrls(filesWithParsers); return this._constructAnalysis(context, resolvedUrls); }); } analyzePackage(options = {}) { return __awaiter(this, void 0, void 0, function* () { const previousAnalysisComplete = this._analysisComplete; let analysis; this._analysisComplete = (() => __awaiter(this, void 0, void 0, function* () { const previousContext = yield previousAnalysisComplete; if (!previousContext.loader.readDirectory) { throw new Error(`This analyzer doesn't support analyzerPackage, ` + `the urlLoader can't list the files in a directory.`); } const allFiles = yield previousContext.loader.readDirectory('', true); // TODO(rictic): parameterize this, perhaps with polymer.json. const filesInPackage = allFiles.filter((file) => !model_1.Analysis.isExternal(file)); const filesWithParsers = this._filterFilesByParsableExtension(filesInPackage, previousContext); const newContext = yield previousContext.analyze(filesWithParsers, options.cancelToken || cancel_token_1.neverCancels); const resolvedFilesWithParsers = newContext.resolveUserInputUrls(filesWithParsers); analysis = this._constructAnalysis(newContext, resolvedFilesWithParsers); return newContext; }))(); yield this._analysisComplete; return analysis; }); } _filterFilesByParsableExtension(filenames, context) { const extensions = new Set(context.parsers.keys()); return filenames.filter((fn) => extensions.has(path.extname(fn).substring(1))); } _constructAnalysis(context, urls) { const getUrlResultPair = (url) => [url, context.getDocument(url)]; return new model_1.Analysis(new Map(urls.map(getUrlResultPair)), context); } /** * Clears all information about the given files from our caches, such that * future calls to analyze() will reload these files if they're needed. * * The analyzer assumes that if this method isn't called with a file's url, * then that file has not changed and does not need to be reloaded. * * @param urls The urls of files which may have changed. */ filesChanged(urls) { return __awaiter(this, void 0, void 0, function* () { const previousAnalysisComplete = this._analysisComplete; this._analysisComplete = (() => __awaiter(this, void 0, void 0, function* () { const previousContext = yield previousAnalysisComplete; return yield previousContext.filesChanged(this.brandUserInputUrls(urls)); }))(); yield this._analysisComplete; }); } /** * Clear all cached information from this analyzer instance. * * Note: if at all possible, instead tell the analyzer about the specific * files that changed rather than clearing caches like this. Caching provides * large performance gains. */ clearCaches() { return __awaiter(this, void 0, void 0, function* () { const previousAnalysisComplete = this._analysisComplete; this._analysisComplete = (() => __awaiter(this, void 0, void 0, function* () { const previousContext = yield previousAnalysisComplete; return yield previousContext.clearCaches(); }))(); yield this._analysisComplete; }); } /** * Returns a copy of the analyzer. If options are given, the AnalysisContext * is also forked and individual properties are overridden by the options. * is forked with the given options. * * When the analysis context is forked, its cache is preserved, so you will * see a mixture of pre-fork and post-fork contents when you analyze with a * forked analyzer. * * Note: this feature is experimental. It may be removed without being * considered a breaking change, so check for its existence before calling * it. */ _fork(options) { const contextPromise = (() => __awaiter(this, void 0, void 0, function* () { return options ? (yield this._analysisComplete)._fork(undefined, options) : (yield this._analysisComplete); }))(); return new Analyzer({ urlLoader: this._urlLoader, urlResolver: this.urlResolver, __contextPromise: contextPromise }); } /** * Returns `true` if the provided resolved URL can be loaded. Obeys the * semantics defined by `UrlLoader` and should only be used to check * resolved URLs. */ canLoad(resolvedUrl) { return this._urlLoader.canLoad(resolvedUrl); } /** * Loads the content at the provided resolved URL. Obeys the semantics * defined by `UrlLoader` and should only be used to attempt to load resolved * URLs. */ load(resolvedUrl) { return __awaiter(this, void 0, void 0, function* () { const result = yield (yield this._analysisComplete).load(resolvedUrl); if (!result.successful) { throw new Error(result.error); } return result.value; }); } /** * Resoves `url` to a new location. */ resolveUrl(url) { return this.urlResolver.resolve(url); } // Urls from the user are assumed to be package relative brandUserInputUrls(urls) { return urls; } } exports.Analyzer = Analyzer; //# sourceMappingURL=analyzer.js.map
endlessm/chromium-browser
third_party/node/node_modules/polymer-bundler/node_modules/polymer-analyzer/lib/core/analyzer.js
JavaScript
bsd-3-clause
9,067
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/mus/public/cpp/view_tracker.h" namespace mus { ViewTracker::ViewTracker() {} ViewTracker::~ViewTracker() { for (Views::iterator i = views_.begin(); i != views_.end(); ++i) (*i)->RemoveObserver(this); } void ViewTracker::Add(View* view) { if (views_.count(view)) return; view->AddObserver(this); views_.insert(view); } void ViewTracker::Remove(View* view) { if (views_.count(view)) { views_.erase(view); view->RemoveObserver(this); } } bool ViewTracker::Contains(View* view) { return views_.count(view) > 0; } void ViewTracker::OnViewDestroying(View* view) { DCHECK_GT(views_.count(view), 0u); Remove(view); } } // namespace mus
CapOM/ChromiumGStreamerBackend
components/mus/public/cpp/view_tracker.cc
C++
bsd-3-clause
859
/*********************************************************************************************************************** ** ** Copyright (c) 2011, 2014 ETH Zurich ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without modification, are permitted provided that the ** following conditions are met: ** ** * Redistributions of source code must retain the above copyright notice, this list of conditions and the ** following disclaimer. ** * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the ** following disclaimer in the documentation and/or other materials provided with the distribution. ** * Neither the name of the ETH Zurich nor the names of its contributors may be used to endorse or promote products ** derived from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, ** INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** **********************************************************************************************************************/ #include "VNewExpressionStyle.h" namespace OOVisualization { VNewExpressionStyle::~VNewExpressionStyle() {} } /* namespace OOVisualization */
patrick-luethi/Envision
OOVisualization/src/expressions/VNewExpressionStyle.cpp
C++
bsd-3-clause
1,975
#!/usr/bin/env python import sys from roslaunch.xmlloader import XmlLoader, loader from rosgraph.names import get_ros_namespace from rqt_launchtree.launchtree_context import LaunchtreeContext class LaunchtreeLoader(XmlLoader): def _include_tag(self, tag, context, ros_config, default_machine, is_core, verbose): inc_filename = self.resolve_args(tag.attributes['file'].value, context) ros_config.push_level(inc_filename, unique=True) result = super(LaunchtreeLoader, self)._include_tag(tag, context, ros_config, default_machine, is_core, verbose) ros_config.pop_level() return result def _node_tag(self, tag, context, ros_config, default_machine, is_test=False, verbose=True): try: if is_test: self._check_attrs(tag, context, ros_config, XmlLoader.TEST_ATTRS) (name,) = self.opt_attrs(tag, context, ('name',)) test_name, time_limit, retry = self._test_attrs(tag, context) if not name: name = test_name else: self._check_attrs(tag, context, ros_config, XmlLoader.NODE_ATTRS) (name,) = self.reqd_attrs(tag, context, ('name',)) except Exception as e: pass # will be handled in super ros_config.push_level(name) result = super(LaunchtreeLoader, self)._node_tag(tag, context, ros_config, default_machine, is_test, verbose) ros_config.pop_level() return result def _rosparam_tag(self, tag, context, ros_config, verbose): param_file = tag.attributes['file'].value \ if tag.attributes.has_key('file') else '' if param_file != '': param_filename = self.resolve_args(param_file, context) level_name = ros_config.push_level(param_filename, unique=True) result = super(LaunchtreeLoader, self)._rosparam_tag(tag, context, ros_config, verbose) if param_file != '': ros_config.pop_level() context.add_rosparam(tag.attributes.get('command', 'load'), param_filename, level_name) return result def _load_launch(self, launch, ros_config, is_core=False, filename=None, argv=None, verbose=True): if argv is None: argv = sys.argv self._launch_tag(launch, ros_config, filename) self.root_context = LaunchtreeContext(get_ros_namespace(), filename, config=ros_config) loader.load_sysargs_into_context(self.root_context, argv) if len(launch.getElementsByTagName('master')) > 0: print "WARNING: ignoring defunct <master /> tag" self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
pschillinger/rqt_launchtree
src/rqt_launchtree/launchtree_loader.py
Python
bsd-3-clause
2,423
package com.mentatlabs.nsa package scalac package options /* -optimise * ========= * 2.5.0 - 2.5.1: Optimize. implies -Xinline, -Xcloselim and -Xdce // previously -XO * 2.6.0 - 2.11.8: Generates faster bytecode by applying optimisations to the program * 2.12.0: Compiler flag for the optimizer in Scala 2.11 */ case object ScalacOptimise extends ScalacOptionBoolean("-optimise", ScalacVersions.`2.6.0`)
mentat-labs/sbt-nsa
nsa-core/src/main/scala/com/mentatlabs/nsa/scalac/options/ScalacOptimise.scala
Scala
bsd-3-clause
431
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.9.1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>PMDK C++ bindings: Class Members</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">PMDK C++ bindings &#160;<span id="projectnumber">1.13.0-git107.g7e59f08f</span> </div> <div id="projectbrief">This is the C++ bindings documentation for PMDK&#39;s libpmemobj.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.9.1 --> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ var searchBox = new SearchBox("searchBox", "search",false,'Search','.html'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function(){initNavTree('functions_n.html',''); initResizable(); }); /* @license-end */ </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="contents"> <div class="textblock">Here is a list of all documented class members with links to the class documentation for each member:</div> <h3><a id="index_n"></a>- n -</h3><ul> <li>native_handle() : <a class="el" href="classpmem_1_1obj_1_1condition__variable.html#a50a0e13cb4b1601f1416cca92ac59e4c">pmem::obj::condition_variable</a> , <a class="el" href="classpmem_1_1obj_1_1mutex.html#a0128dcaaf043e6a2ce86e503678c9447">pmem::obj::mutex</a> , <a class="el" href="classpmem_1_1obj_1_1shared__mutex.html#a1f59afab85e7ab4aca1f01c45ff87b29">pmem::obj::shared_mutex</a> , <a class="el" href="classpmem_1_1obj_1_1timed__mutex.html#a1b511d4db388a6d3d069fc93bd4e982b">pmem::obj::timed_mutex</a> </li> <li>native_handle_type : <a class="el" href="classpmem_1_1obj_1_1condition__variable.html#a5d6f2b49f88a03db9e9f3a2b49f6bf6d">pmem::obj::condition_variable</a> , <a class="el" href="classpmem_1_1obj_1_1mutex.html#a746ecab28758da55f241b0f7b76ced36">pmem::obj::mutex</a> , <a class="el" href="classpmem_1_1obj_1_1shared__mutex.html#ad4c7fd0b2addf9babd42dc3827585c87">pmem::obj::shared_mutex</a> , <a class="el" href="classpmem_1_1obj_1_1timed__mutex.html#ac561c19b42016f409ae142395645f99b">pmem::obj::timed_mutex</a> </li> <li>no_flush() : <a class="el" href="structpmem_1_1obj_1_1allocation__flag.html#a711ecb9df197e2d2c9fe1a2a496e302c">pmem::obj::allocation_flag</a> </li> <li>none() : <a class="el" href="structpmem_1_1obj_1_1allocation__flag.html#ae89f1ed6c125d3bd67fd33c0cff27c76">pmem::obj::allocation_flag</a> , <a class="el" href="structpmem_1_1obj_1_1allocation__flag__atomic.html#a0f5b05f867e70150598eb890f0f8a350">pmem::obj::allocation_flag_atomic</a> </li> <li>notify_all() : <a class="el" href="classpmem_1_1obj_1_1condition__variable.html#a7fe698f5498498eaf15251c0bb877405">pmem::obj::condition_variable</a> </li> <li>notify_one() : <a class="el" href="classpmem_1_1obj_1_1condition__variable.html#ae8bb6885b36cd6b24961e33c5a184db9">pmem::obj::condition_variable</a> </li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li> </ul> </div> </body> </html>
pbalcer/pbalcer.github.io
content/libpmemobj-cpp/master/doxygen/functions_n.html
HTML
bsd-3-clause
5,769
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.8"/> <title>AADC: C:/Development/3510_AADC_ADTF/trunk/src/adtfUser/demo/src/AADC_QrPlayer/stdafx.cpp Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="AADC_keyvisual_small.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">AADC </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.8 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('adtf_user_2demo_2src_2_a_a_d_c___qr_player_2stdafx_8cpp_source.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">stdafx.cpp</div> </div> </div><!--header--> <div class="contents"> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/**********************************************************************</span></div> <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">* Copyright (c) 2014 BFFT Gesellschaft fuer Fahrzeugtechnik mbH.</span></div> <div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">* All rights reserved.</span></div> <div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">**********************************************************************</span></div> <div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">* $Author:: spiesra $ $Date:: 2014-07-23 07:38:53#$ $Rev:: 24461 $</span></div> <div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">**********************************************************************/</span></div> <div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#include &quot;stdafx.h&quot;</span></div> </div><!-- fragment --></div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_bf0627c79eaa05e472db4d05c4a37772.html">adtfUser</a></li><li class="navelem"><a class="el" href="dir_d4e2df275ed78dae5e1fc83de5b88ffc.html">demo</a></li><li class="navelem"><a class="el" href="dir_95004a1ab28d47ff63067a1d7e06c07d.html">src</a></li><li class="navelem"><a class="el" href="dir_f1256f8502f05c4b6e2d2923e57fb40d.html">AADC_QrPlayer</a></li><li class="navelem"><b>stdafx.cpp</b></li> <li class="footer">Generated on Tue Sep 16 2014 14:13:25 for AADC by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.8 </li> </ul> </div> </body> </html>
KAtana-Karlsruhe/AADC_2015_KAtana
doc/html/adtf_user_2demo_2src_2_a_a_d_c___qr_player_2stdafx_8cpp_source.html
HTML
bsd-3-clause
7,306
<?php namespace backend\models; use yii\base\Model; use yii\data\ActiveDataProvider; use common\models\SearchModelInterface; use common\models\vks\Participant; use yii\mongodb\validators\MongoIdValidator; /** * VksParticipantSearch represents the model behind the search form about `common\models\vks\Participant`. */ class VksParticipantSearch extends Participant implements SearchModelInterface { /** * @inheritdoc */ public function rules() { return [ ['companyId', MongoIdValidator::className(), 'forceFormat' => 'object'], [['name', 'shortName', 'dialString', 'note'], 'safe'], ]; } /** * @inheritdoc */ public function scenarios() { // bypass scenarios() implementation in the parent class return Model::scenarios(); } /** * Creates data provider instance with search query applied * * @return ActiveDataProvider */ public function search() { $query = Participant::find()->with('company'); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['like', 'name', $this->name]) ->andFilterWhere(['like', 'shortName', $this->shortName]) ->andFilterWhere(['companyId' => $this->companyId]) ->andFilterWhere(['like', 'dialString', $this->dialString]) ->andFilterWhere(['like', 'note', $this->note]); return $dataProvider; } }
shubnikofff/teleport
backend/models/VksParticipantSearch.php
PHP
bsd-3-clause
1,735
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} -- | Auxilary definitions for 'Semigroup' -- -- This module provides some @newtype@ wrappers and helpers which are -- reexported from the "Data.Semigroup" module or imported directly -- by some other modules. -- -- This module also provides internal definitions related to the -- 'Semigroup' class some. -- -- This module exists mostly to simplify or workaround import-graph -- issues; there is also a .hs-boot file to allow "GHC.Base" and other -- modules to import method default implementations for 'stimes' -- -- @since 4.11.0.0 module Data.Semigroup.Internal where import GHC.Base hiding (Any) import GHC.Enum import GHC.Num import GHC.Read import GHC.Show import GHC.Generics import GHC.Real -- | This is a valid definition of 'stimes' for an idempotent 'Semigroup'. -- -- When @x <> x = x@, this definition should be preferred, because it -- works in /O(1)/ rather than /O(log n)/. stimesIdempotent :: Integral b => b -> a -> a stimesIdempotent n x | n <= 0 = errorWithoutStackTrace "stimesIdempotent: positive multiplier expected" | otherwise = x -- | This is a valid definition of 'stimes' for an idempotent 'Monoid'. -- -- When @mappend x x = x@, this definition should be preferred, because it -- works in /O(1)/ rather than /O(log n)/ stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a stimesIdempotentMonoid n x = case compare n 0 of LT -> errorWithoutStackTrace "stimesIdempotentMonoid: negative multiplier" EQ -> mempty GT -> x -- | This is a valid definition of 'stimes' for a 'Monoid'. -- -- Unlike the default definition of 'stimes', it is defined for 0 -- and so it should be preferred where possible. stimesMonoid :: (Integral b, Monoid a) => b -> a -> a stimesMonoid n x0 = case compare n 0 of LT -> errorWithoutStackTrace "stimesMonoid: negative multiplier" EQ -> mempty GT -> f x0 n where f x y | even y = f (x `mappend` x) (y `quot` 2) | y == 1 = x | otherwise = g (x `mappend` x) (y `quot` 2) x -- See Note [Half of y - 1] g x y z | even y = g (x `mappend` x) (y `quot` 2) z | y == 1 = x `mappend` z | otherwise = g (x `mappend` x) (y `quot` 2) (x `mappend` z) -- See Note [Half of y - 1] -- this is used by the class definitionin GHC.Base; -- it lives here to avoid cycles stimesDefault :: (Integral b, Semigroup a) => b -> a -> a stimesDefault y0 x0 | y0 <= 0 = errorWithoutStackTrace "stimes: positive multiplier expected" | otherwise = f x0 y0 where f x y | even y = f (x <> x) (y `quot` 2) | y == 1 = x | otherwise = g (x <> x) (y `quot` 2) x -- See Note [Half of y - 1] g x y z | even y = g (x <> x) (y `quot` 2) z | y == 1 = x <> z | otherwise = g (x <> x) (y `quot` 2) (x <> z) -- See Note [Half of y - 1] {- Note [Half of y - 1] ~~~~~~~~~~~~~~~~~~~~~ Since y is guaranteed to be odd and positive here, half of y - 1 can be computed as y `quot` 2, optimising subtraction away. -} stimesMaybe :: (Integral b, Semigroup a) => b -> Maybe a -> Maybe a stimesMaybe _ Nothing = Nothing stimesMaybe n (Just a) = case compare n 0 of LT -> errorWithoutStackTrace "stimes: Maybe, negative multiplier" EQ -> Nothing GT -> Just (stimes n a) stimesList :: Integral b => b -> [a] -> [a] stimesList n x | n < 0 = errorWithoutStackTrace "stimes: [], negative multiplier" | otherwise = rep n where rep 0 = [] rep i = x ++ rep (i - 1) -- | The dual of a 'Monoid', obtained by swapping the arguments of 'mappend'. -- -- >>> getDual (mappend (Dual "Hello") (Dual "World")) -- "WorldHello" newtype Dual a = Dual { getDual :: a } deriving (Eq, Ord, Read, Show, Bounded, Generic, Generic1) -- | @since 4.9.0.0 instance Semigroup a => Semigroup (Dual a) where Dual a <> Dual b = Dual (b <> a) stimes n (Dual a) = Dual (stimes n a) -- | @since 2.01 instance Monoid a => Monoid (Dual a) where mempty = Dual mempty -- | @since 4.8.0.0 instance Functor Dual where fmap = coerce -- | @since 4.8.0.0 instance Applicative Dual where pure = Dual (<*>) = coerce -- | @since 4.8.0.0 instance Monad Dual where m >>= k = k (getDual m) -- | The monoid of endomorphisms under composition. -- -- >>> let computation = Endo ("Hello, " ++) <> Endo (++ "!") -- >>> appEndo computation "Haskell" -- "Hello, Haskell!" newtype Endo a = Endo { appEndo :: a -> a } deriving (Generic) -- | @since 4.9.0.0 instance Semigroup (Endo a) where (<>) = coerce ((.) :: (a -> a) -> (a -> a) -> (a -> a)) stimes = stimesMonoid -- | @since 2.01 instance Monoid (Endo a) where mempty = Endo id -- | Boolean monoid under conjunction ('&&'). -- -- >>> getAll (All True <> mempty <> All False) -- False -- -- >>> getAll (mconcat (map (\x -> All (even x)) [2,4,6,7,8])) -- False newtype All = All { getAll :: Bool } deriving (Eq, Ord, Read, Show, Bounded, Generic) -- | @since 4.9.0.0 instance Semigroup All where (<>) = coerce (&&) stimes = stimesIdempotentMonoid -- | @since 2.01 instance Monoid All where mempty = All True -- | Boolean monoid under disjunction ('||'). -- -- >>> getAny (Any True <> mempty <> Any False) -- True -- -- >>> getAny (mconcat (map (\x -> Any (even x)) [2,4,6,7,8])) -- True newtype Any = Any { getAny :: Bool } deriving (Eq, Ord, Read, Show, Bounded, Generic) -- | @since 4.9.0.0 instance Semigroup Any where (<>) = coerce (||) stimes = stimesIdempotentMonoid -- | @since 2.01 instance Monoid Any where mempty = Any False -- | Monoid under addition. -- -- >>> getSum (Sum 1 <> Sum 2 <> mempty) -- 3 newtype Sum a = Sum { getSum :: a } deriving (Eq, Ord, Read, Show, Bounded, Generic, Generic1, Num) -- | @since 4.9.0.0 instance Num a => Semigroup (Sum a) where (<>) = coerce ((+) :: a -> a -> a) stimes n (Sum a) = Sum (fromIntegral n * a) -- | @since 2.01 instance Num a => Monoid (Sum a) where mempty = Sum 0 -- | @since 4.8.0.0 instance Functor Sum where fmap = coerce -- | @since 4.8.0.0 instance Applicative Sum where pure = Sum (<*>) = coerce -- | @since 4.8.0.0 instance Monad Sum where m >>= k = k (getSum m) -- | Monoid under multiplication. -- -- >>> getProduct (Product 3 <> Product 4 <> mempty) -- 12 newtype Product a = Product { getProduct :: a } deriving (Eq, Ord, Read, Show, Bounded, Generic, Generic1, Num) -- | @since 4.9.0.0 instance Num a => Semigroup (Product a) where (<>) = coerce ((*) :: a -> a -> a) stimes n (Product a) = Product (a ^ n) -- | @since 2.01 instance Num a => Monoid (Product a) where mempty = Product 1 -- | @since 4.8.0.0 instance Functor Product where fmap = coerce -- | @since 4.8.0.0 instance Applicative Product where pure = Product (<*>) = coerce -- | @since 4.8.0.0 instance Monad Product where m >>= k = k (getProduct m) -- | Monoid under '<|>'. -- -- @since 4.8.0.0 newtype Alt f a = Alt {getAlt :: f a} deriving (Generic, Generic1, Read, Show, Eq, Ord, Num, Enum, Monad, MonadPlus, Applicative, Alternative, Functor) -- | @since 4.9.0.0 instance Alternative f => Semigroup (Alt f a) where (<>) = coerce ((<|>) :: f a -> f a -> f a) stimes = stimesMonoid -- | @since 4.8.0.0 instance Alternative f => Monoid (Alt f a) where mempty = Alt empty
ezyang/ghc
libraries/base/Data/Semigroup/Internal.hs
Haskell
bsd-3-clause
7,619
/* * software YUV to RGB converter * * Copyright (C) 2009 Konstantin Shishkov * * 1,4,8bpp support and context / deglobalize stuff * by Michael Niedermayer (michaelni@gmx.at) * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include "libavutil/cpu.h" #include "libavutil/bswap.h" #include "config.h" #include "rgb2rgb.h" #include "swscale.h" #include "swscale_internal.h" #include "libavutil/pixdesc.h" /* Color space conversion coefficients for YCbCr -> RGB mapping. * * Entries are {crv, cbu, cgu, cgv} * * crv = (255 / 224) * 65536 * (1 - cr) / 0.5 * cbu = (255 / 224) * 65536 * (1 - cb) / 0.5 * cgu = (255 / 224) * 65536 * (cb / cg) * (1 - cb) / 0.5 * cgv = (255 / 224) * 65536 * (cr / cg) * (1 - cr) / 0.5 * * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1. */ const int32_t ff_yuv2rgb_coeffs[11][4] = { { 117489, 138438, 13975, 34925 }, /* no sequence_display_extension */ { 117489, 138438, 13975, 34925 }, /* ITU-R Rec. 709 (1990) */ { 104597, 132201, 25675, 53279 }, /* unspecified */ { 104597, 132201, 25675, 53279 }, /* reserved */ { 104448, 132798, 24759, 53109 }, /* FCC */ { 104597, 132201, 25675, 53279 }, /* ITU-R Rec. 624-4 System B, G */ { 104597, 132201, 25675, 53279 }, /* SMPTE 170M */ { 117579, 136230, 16907, 35559 }, /* SMPTE 240M (1987) */ { 0 }, /* YCgCo */ { 110013, 140363, 12277, 42626 }, /* Bt-2020-NCL */ { 110013, 140363, 12277, 42626 }, /* Bt-2020-CL */ }; const int *sws_getCoefficients(int colorspace) { if (colorspace > 10 || colorspace < 0 || colorspace == 8) colorspace = SWS_CS_DEFAULT; return ff_yuv2rgb_coeffs[colorspace]; } #define LOADCHROMA(i) \ U = pu[i]; \ V = pv[i]; \ r = (void *)c->table_rV[V+YUVRGB_TABLE_HEADROOM]; \ g = (void *)(c->table_gU[U+YUVRGB_TABLE_HEADROOM] + c->table_gV[V+YUVRGB_TABLE_HEADROOM]); \ b = (void *)c->table_bU[U+YUVRGB_TABLE_HEADROOM]; #define PUTRGB(dst, src, i) \ Y = src[2 * i]; \ dst[2 * i] = r[Y] + g[Y] + b[Y]; \ Y = src[2 * i + 1]; \ dst[2 * i + 1] = r[Y] + g[Y] + b[Y]; #define PUTRGB24(dst, src, i) \ Y = src[2 * i]; \ dst[6 * i + 0] = r[Y]; \ dst[6 * i + 1] = g[Y]; \ dst[6 * i + 2] = b[Y]; \ Y = src[2 * i + 1]; \ dst[6 * i + 3] = r[Y]; \ dst[6 * i + 4] = g[Y]; \ dst[6 * i + 5] = b[Y]; #define PUTBGR24(dst, src, i) \ Y = src[2 * i]; \ dst[6 * i + 0] = b[Y]; \ dst[6 * i + 1] = g[Y]; \ dst[6 * i + 2] = r[Y]; \ Y = src[2 * i + 1]; \ dst[6 * i + 3] = b[Y]; \ dst[6 * i + 4] = g[Y]; \ dst[6 * i + 5] = r[Y]; #define PUTRGBA(dst, ysrc, asrc, i, s) \ Y = ysrc[2 * i]; \ dst[2 * i] = r[Y] + g[Y] + b[Y] + (asrc[2 * i] << s); \ Y = ysrc[2 * i + 1]; \ dst[2 * i + 1] = r[Y] + g[Y] + b[Y] + (asrc[2 * i + 1] << s); #define PUTRGB48(dst, src, i) \ Y = src[ 2 * i]; \ dst[12 * i + 0] = dst[12 * i + 1] = r[Y]; \ dst[12 * i + 2] = dst[12 * i + 3] = g[Y]; \ dst[12 * i + 4] = dst[12 * i + 5] = b[Y]; \ Y = src[ 2 * i + 1]; \ dst[12 * i + 6] = dst[12 * i + 7] = r[Y]; \ dst[12 * i + 8] = dst[12 * i + 9] = g[Y]; \ dst[12 * i + 10] = dst[12 * i + 11] = b[Y]; #define PUTBGR48(dst, src, i) \ Y = src[2 * i]; \ dst[12 * i + 0] = dst[12 * i + 1] = b[Y]; \ dst[12 * i + 2] = dst[12 * i + 3] = g[Y]; \ dst[12 * i + 4] = dst[12 * i + 5] = r[Y]; \ Y = src[2 * i + 1]; \ dst[12 * i + 6] = dst[12 * i + 7] = b[Y]; \ dst[12 * i + 8] = dst[12 * i + 9] = g[Y]; \ dst[12 * i + 10] = dst[12 * i + 11] = r[Y]; #define YUV2RGBFUNC(func_name, dst_type, alpha) \ static int func_name(SwsContext *c, const uint8_t *src[], \ int srcStride[], int srcSliceY, int srcSliceH, \ uint8_t *dst[], int dstStride[]) \ { \ int y; \ \ if (!alpha && c->srcFormat == AV_PIX_FMT_YUV422P) { \ srcStride[1] *= 2; \ srcStride[2] *= 2; \ } \ for (y = 0; y < srcSliceH; y += 2) { \ int yd = y + srcSliceY; \ dst_type *dst_1 = \ (dst_type *)(dst[0] + (yd) * dstStride[0]); \ dst_type *dst_2 = \ (dst_type *)(dst[0] + (yd + 1) * dstStride[0]); \ dst_type av_unused *r, *g, *b; \ const uint8_t *py_1 = src[0] + y * srcStride[0]; \ const uint8_t *py_2 = py_1 + srcStride[0]; \ const uint8_t *pu = src[1] + (y >> 1) * srcStride[1]; \ const uint8_t *pv = src[2] + (y >> 1) * srcStride[2]; \ const uint8_t av_unused *pa_1, *pa_2; \ unsigned int h_size = c->dstW >> 3; \ if (alpha) { \ pa_1 = src[3] + y * srcStride[3]; \ pa_2 = pa_1 + srcStride[3]; \ } \ while (h_size--) { \ int av_unused U, V, Y; \ #define ENDYUV2RGBLINE(dst_delta, ss) \ pu += 4 >> ss; \ pv += 4 >> ss; \ py_1 += 8 >> ss; \ py_2 += 8 >> ss; \ dst_1 += dst_delta >> ss; \ dst_2 += dst_delta >> ss; \ } \ if (c->dstW & (4 >> ss)) { \ int av_unused Y, U, V; \ #define ENDYUV2RGBFUNC() \ } \ } \ return srcSliceH; \ } #define CLOSEYUV2RGBFUNC(dst_delta) \ ENDYUV2RGBLINE(dst_delta, 0) \ ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_48, uint8_t, 0) LOADCHROMA(0); PUTRGB48(dst_1, py_1, 0); PUTRGB48(dst_2, py_2, 0); LOADCHROMA(1); PUTRGB48(dst_2, py_2, 1); PUTRGB48(dst_1, py_1, 1); LOADCHROMA(2); PUTRGB48(dst_1, py_1, 2); PUTRGB48(dst_2, py_2, 2); LOADCHROMA(3); PUTRGB48(dst_2, py_2, 3); PUTRGB48(dst_1, py_1, 3); ENDYUV2RGBLINE(48, 0) LOADCHROMA(0); PUTRGB48(dst_1, py_1, 0); PUTRGB48(dst_2, py_2, 0); LOADCHROMA(1); PUTRGB48(dst_2, py_2, 1); PUTRGB48(dst_1, py_1, 1); ENDYUV2RGBLINE(48, 1) LOADCHROMA(0); PUTRGB48(dst_1, py_1, 0); PUTRGB48(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_bgr48, uint8_t, 0) LOADCHROMA(0); PUTBGR48(dst_1, py_1, 0); PUTBGR48(dst_2, py_2, 0); LOADCHROMA(1); PUTBGR48(dst_2, py_2, 1); PUTBGR48(dst_1, py_1, 1); LOADCHROMA(2); PUTBGR48(dst_1, py_1, 2); PUTBGR48(dst_2, py_2, 2); LOADCHROMA(3); PUTBGR48(dst_2, py_2, 3); PUTBGR48(dst_1, py_1, 3); ENDYUV2RGBLINE(48, 0) LOADCHROMA(0); PUTBGR48(dst_1, py_1, 0); PUTBGR48(dst_2, py_2, 0); LOADCHROMA(1); PUTBGR48(dst_2, py_2, 1); PUTBGR48(dst_1, py_1, 1); ENDYUV2RGBLINE(48, 1) LOADCHROMA(0); PUTBGR48(dst_1, py_1, 0); PUTBGR48(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0) LOADCHROMA(0); PUTRGB(dst_1, py_1, 0); PUTRGB(dst_2, py_2, 0); LOADCHROMA(1); PUTRGB(dst_2, py_2, 1); PUTRGB(dst_1, py_1, 1); LOADCHROMA(2); PUTRGB(dst_1, py_1, 2); PUTRGB(dst_2, py_2, 2); LOADCHROMA(3); PUTRGB(dst_2, py_2, 3); PUTRGB(dst_1, py_1, 3); ENDYUV2RGBLINE(8, 0) LOADCHROMA(0); PUTRGB(dst_1, py_1, 0); PUTRGB(dst_2, py_2, 0); LOADCHROMA(1); PUTRGB(dst_2, py_2, 1); PUTRGB(dst_1, py_1, 1); ENDYUV2RGBLINE(8, 1) LOADCHROMA(0); PUTRGB(dst_1, py_1, 0); PUTRGB(dst_2, py_2, 0); ENDYUV2RGBFUNC() #if HAVE_BIGENDIAN YUV2RGBFUNC(yuva2argb_c, uint32_t, 1) #else YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) #endif LOADCHROMA(0); PUTRGBA(dst_1, py_1, pa_1, 0, 24); PUTRGBA(dst_2, py_2, pa_2, 0, 24); LOADCHROMA(1); PUTRGBA(dst_2, py_2, pa_2, 1, 24); PUTRGBA(dst_1, py_1, pa_1, 1, 24); LOADCHROMA(2); PUTRGBA(dst_1, py_1, pa_1, 2, 24); PUTRGBA(dst_2, py_2, pa_2, 2, 24); LOADCHROMA(3); PUTRGBA(dst_2, py_2, pa_2, 3, 24); PUTRGBA(dst_1, py_1, pa_1, 3, 24); pa_1 += 8; pa_2 += 8; ENDYUV2RGBLINE(8, 0) LOADCHROMA(0); PUTRGBA(dst_1, py_1, pa_1, 0, 24); PUTRGBA(dst_2, py_2, pa_2, 0, 24); LOADCHROMA(1); PUTRGBA(dst_2, py_2, pa_2, 1, 24); PUTRGBA(dst_1, py_1, pa_1, 1, 24); pa_1 += 4; pa_2 += 4; ENDYUV2RGBLINE(8, 1) LOADCHROMA(0); PUTRGBA(dst_1, py_1, pa_1, 0, 24); PUTRGBA(dst_2, py_2, pa_2, 0, 24); ENDYUV2RGBFUNC() #if HAVE_BIGENDIAN YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) #else YUV2RGBFUNC(yuva2argb_c, uint32_t, 1) #endif LOADCHROMA(0); PUTRGBA(dst_1, py_1, pa_1, 0, 0); PUTRGBA(dst_2, py_2, pa_2, 0, 0); LOADCHROMA(1); PUTRGBA(dst_2, py_2, pa_2, 1, 0); PUTRGBA(dst_1, py_1, pa_1, 1, 0); LOADCHROMA(2); PUTRGBA(dst_1, py_1, pa_1, 2, 0); PUTRGBA(dst_2, py_2, pa_2, 2, 0); LOADCHROMA(3); PUTRGBA(dst_2, py_2, pa_2, 3, 0); PUTRGBA(dst_1, py_1, pa_1, 3, 0); pa_1 += 8; pa_2 += 8; ENDYUV2RGBLINE(8, 0) LOADCHROMA(0); PUTRGBA(dst_1, py_1, pa_1, 0, 0); PUTRGBA(dst_2, py_2, pa_2, 0, 0); LOADCHROMA(1); PUTRGBA(dst_2, py_2, pa_2, 1, 0); PUTRGBA(dst_1, py_1, pa_1, 1, 0); pa_1 += 4; pa_2 += 4; ENDYUV2RGBLINE(8, 1) LOADCHROMA(0); PUTRGBA(dst_1, py_1, pa_1, 0, 0); PUTRGBA(dst_2, py_2, pa_2, 0, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0) LOADCHROMA(0); PUTRGB24(dst_1, py_1, 0); PUTRGB24(dst_2, py_2, 0); LOADCHROMA(1); PUTRGB24(dst_2, py_2, 1); PUTRGB24(dst_1, py_1, 1); LOADCHROMA(2); PUTRGB24(dst_1, py_1, 2); PUTRGB24(dst_2, py_2, 2); LOADCHROMA(3); PUTRGB24(dst_2, py_2, 3); PUTRGB24(dst_1, py_1, 3); ENDYUV2RGBLINE(24, 0) LOADCHROMA(0); PUTRGB24(dst_1, py_1, 0); PUTRGB24(dst_2, py_2, 0); LOADCHROMA(1); PUTRGB24(dst_2, py_2, 1); PUTRGB24(dst_1, py_1, 1); ENDYUV2RGBLINE(24, 1) LOADCHROMA(0); PUTRGB24(dst_1, py_1, 0); PUTRGB24(dst_2, py_2, 0); ENDYUV2RGBFUNC() // only trivial mods from yuv2rgb_c_24_rgb YUV2RGBFUNC(yuv2rgb_c_24_bgr, uint8_t, 0) LOADCHROMA(0); PUTBGR24(dst_1, py_1, 0); PUTBGR24(dst_2, py_2, 0); LOADCHROMA(1); PUTBGR24(dst_2, py_2, 1); PUTBGR24(dst_1, py_1, 1); LOADCHROMA(2); PUTBGR24(dst_1, py_1, 2); PUTBGR24(dst_2, py_2, 2); LOADCHROMA(3); PUTBGR24(dst_2, py_2, 3); PUTBGR24(dst_1, py_1, 3); ENDYUV2RGBLINE(24, 0) LOADCHROMA(0); PUTBGR24(dst_1, py_1, 0); PUTBGR24(dst_2, py_2, 0); LOADCHROMA(1); PUTBGR24(dst_2, py_2, 1); PUTBGR24(dst_1, py_1, 1); ENDYUV2RGBLINE(24, 1) LOADCHROMA(0); PUTBGR24(dst_1, py_1, 0); PUTBGR24(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_16_ordered_dither, uint16_t, 0) const uint8_t *d16 = ff_dither_2x2_8[y & 1]; const uint8_t *e16 = ff_dither_2x2_4[y & 1]; const uint8_t *f16 = ff_dither_2x2_8[(y & 1)^1]; #define PUTRGB16(dst, src, i, o) \ Y = src[2 * i]; \ dst[2 * i] = r[Y + d16[0 + o]] + \ g[Y + e16[0 + o]] + \ b[Y + f16[0 + o]]; \ Y = src[2 * i + 1]; \ dst[2 * i + 1] = r[Y + d16[1 + o]] + \ g[Y + e16[1 + o]] + \ b[Y + f16[1 + o]]; LOADCHROMA(0); PUTRGB16(dst_1, py_1, 0, 0); PUTRGB16(dst_2, py_2, 0, 0 + 8); LOADCHROMA(1); PUTRGB16(dst_2, py_2, 1, 2 + 8); PUTRGB16(dst_1, py_1, 1, 2); LOADCHROMA(2); PUTRGB16(dst_1, py_1, 2, 4); PUTRGB16(dst_2, py_2, 2, 4 + 8); LOADCHROMA(3); PUTRGB16(dst_2, py_2, 3, 6 + 8); PUTRGB16(dst_1, py_1, 3, 6); CLOSEYUV2RGBFUNC(8) YUV2RGBFUNC(yuv2rgb_c_15_ordered_dither, uint16_t, 0) const uint8_t *d16 = ff_dither_2x2_8[y & 1]; const uint8_t *e16 = ff_dither_2x2_8[(y & 1)^1]; #define PUTRGB15(dst, src, i, o) \ Y = src[2 * i]; \ dst[2 * i] = r[Y + d16[0 + o]] + \ g[Y + d16[1 + o]] + \ b[Y + e16[0 + o]]; \ Y = src[2 * i + 1]; \ dst[2 * i + 1] = r[Y + d16[1 + o]] + \ g[Y + d16[0 + o]] + \ b[Y + e16[1 + o]]; LOADCHROMA(0); PUTRGB15(dst_1, py_1, 0, 0); PUTRGB15(dst_2, py_2, 0, 0 + 8); LOADCHROMA(1); PUTRGB15(dst_2, py_2, 1, 2 + 8); PUTRGB15(dst_1, py_1, 1, 2); LOADCHROMA(2); PUTRGB15(dst_1, py_1, 2, 4); PUTRGB15(dst_2, py_2, 2, 4 + 8); LOADCHROMA(3); PUTRGB15(dst_2, py_2, 3, 6 + 8); PUTRGB15(dst_1, py_1, 3, 6); CLOSEYUV2RGBFUNC(8) // r, g, b, dst_1, dst_2 YUV2RGBFUNC(yuv2rgb_c_12_ordered_dither, uint16_t, 0) const uint8_t *d16 = ff_dither_4x4_16[y & 3]; #define PUTRGB12(dst, src, i, o) \ Y = src[2 * i]; \ dst[2 * i] = r[Y + d16[0 + o]] + \ g[Y + d16[0 + o]] + \ b[Y + d16[0 + o]]; \ Y = src[2 * i + 1]; \ dst[2 * i + 1] = r[Y + d16[1 + o]] + \ g[Y + d16[1 + o]] + \ b[Y + d16[1 + o]]; LOADCHROMA(0); PUTRGB12(dst_1, py_1, 0, 0); PUTRGB12(dst_2, py_2, 0, 0 + 8); LOADCHROMA(1); PUTRGB12(dst_2, py_2, 1, 2 + 8); PUTRGB12(dst_1, py_1, 1, 2); LOADCHROMA(2); PUTRGB12(dst_1, py_1, 2, 4); PUTRGB12(dst_2, py_2, 2, 4 + 8); LOADCHROMA(3); PUTRGB12(dst_2, py_2, 3, 6 + 8); PUTRGB12(dst_1, py_1, 3, 6); CLOSEYUV2RGBFUNC(8) // r, g, b, dst_1, dst_2 YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0) const uint8_t *d32 = ff_dither_8x8_32[yd & 7]; const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; #define PUTRGB8(dst, src, i, o) \ Y = src[2 * i]; \ dst[2 * i] = r[Y + d32[0 + o]] + \ g[Y + d32[0 + o]] + \ b[Y + d64[0 + o]]; \ Y = src[2 * i + 1]; \ dst[2 * i + 1] = r[Y + d32[1 + o]] + \ g[Y + d32[1 + o]] + \ b[Y + d64[1 + o]]; LOADCHROMA(0); PUTRGB8(dst_1, py_1, 0, 0); PUTRGB8(dst_2, py_2, 0, 0 + 8); LOADCHROMA(1); PUTRGB8(dst_2, py_2, 1, 2 + 8); PUTRGB8(dst_1, py_1, 1, 2); LOADCHROMA(2); PUTRGB8(dst_1, py_1, 2, 4); PUTRGB8(dst_2, py_2, 2, 4 + 8); LOADCHROMA(3); PUTRGB8(dst_2, py_2, 3, 6 + 8); PUTRGB8(dst_1, py_1, 3, 6); ENDYUV2RGBLINE(8, 0) const uint8_t *d32 = ff_dither_8x8_32[yd & 7]; const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; LOADCHROMA(0); PUTRGB8(dst_1, py_1, 0, 0); PUTRGB8(dst_2, py_2, 0, 0 + 8); LOADCHROMA(1); PUTRGB8(dst_2, py_2, 1, 2 + 8); PUTRGB8(dst_1, py_1, 1, 2); ENDYUV2RGBLINE(8, 1) const uint8_t *d32 = ff_dither_8x8_32[yd & 7]; const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; LOADCHROMA(0); PUTRGB8(dst_1, py_1, 0, 0); PUTRGB8(dst_2, py_2, 0, 0 + 8); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0) const uint8_t * d64 = ff_dither_8x8_73[yd & 7]; const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; int acc; #define PUTRGB4D(dst, src, i, o) \ Y = src[2 * i]; \ acc = r[Y + d128[0 + o]] + \ g[Y + d64[0 + o]] + \ b[Y + d128[0 + o]]; \ Y = src[2 * i + 1]; \ acc |= (r[Y + d128[1 + o]] + \ g[Y + d64[1 + o]] + \ b[Y + d128[1 + o]]) << 4; \ dst[i] = acc; LOADCHROMA(0); PUTRGB4D(dst_1, py_1, 0, 0); PUTRGB4D(dst_2, py_2, 0, 0 + 8); LOADCHROMA(1); PUTRGB4D(dst_2, py_2, 1, 2 + 8); PUTRGB4D(dst_1, py_1, 1, 2); LOADCHROMA(2); PUTRGB4D(dst_1, py_1, 2, 4); PUTRGB4D(dst_2, py_2, 2, 4 + 8); LOADCHROMA(3); PUTRGB4D(dst_2, py_2, 3, 6 + 8); PUTRGB4D(dst_1, py_1, 3, 6); ENDYUV2RGBLINE(4, 0) const uint8_t * d64 = ff_dither_8x8_73[yd & 7]; const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; int acc; LOADCHROMA(0); PUTRGB4D(dst_1, py_1, 0, 0); PUTRGB4D(dst_2, py_2, 0, 0 + 8); LOADCHROMA(1); PUTRGB4D(dst_2, py_2, 1, 2 + 8); PUTRGB4D(dst_1, py_1, 1, 2); ENDYUV2RGBLINE(4, 1) const uint8_t * d64 = ff_dither_8x8_73[yd & 7]; const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; int acc; LOADCHROMA(0); PUTRGB4D(dst_1, py_1, 0, 0); PUTRGB4D(dst_2, py_2, 0, 0 + 8); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0) const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; #define PUTRGB4DB(dst, src, i, o) \ Y = src[2 * i]; \ dst[2 * i] = r[Y + d128[0 + o]] + \ g[Y + d64[0 + o]] + \ b[Y + d128[0 + o]]; \ Y = src[2 * i + 1]; \ dst[2 * i + 1] = r[Y + d128[1 + o]] + \ g[Y + d64[1 + o]] + \ b[Y + d128[1 + o]]; LOADCHROMA(0); PUTRGB4DB(dst_1, py_1, 0, 0); PUTRGB4DB(dst_2, py_2, 0, 0 + 8); LOADCHROMA(1); PUTRGB4DB(dst_2, py_2, 1, 2 + 8); PUTRGB4DB(dst_1, py_1, 1, 2); LOADCHROMA(2); PUTRGB4DB(dst_1, py_1, 2, 4); PUTRGB4DB(dst_2, py_2, 2, 4 + 8); LOADCHROMA(3); PUTRGB4DB(dst_2, py_2, 3, 6 + 8); PUTRGB4DB(dst_1, py_1, 3, 6); ENDYUV2RGBLINE(8, 0) const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; LOADCHROMA(0); PUTRGB4DB(dst_1, py_1, 0, 0); PUTRGB4DB(dst_2, py_2, 0, 0 + 8); LOADCHROMA(1); PUTRGB4DB(dst_2, py_2, 1, 2 + 8); PUTRGB4DB(dst_1, py_1, 1, 2); ENDYUV2RGBLINE(8, 1) const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; LOADCHROMA(0); PUTRGB4DB(dst_1, py_1, 0, 0); PUTRGB4DB(dst_2, py_2, 0, 0 + 8); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t, 0) const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; char out_1 = 0, out_2 = 0; g = c->table_gU[128 + YUVRGB_TABLE_HEADROOM] + c->table_gV[128 + YUVRGB_TABLE_HEADROOM]; #define PUTRGB1(out, src, i, o) \ Y = src[2 * i]; \ out += out + g[Y + d128[0 + o]]; \ Y = src[2 * i + 1]; \ out += out + g[Y + d128[1 + o]]; PUTRGB1(out_1, py_1, 0, 0); PUTRGB1(out_2, py_2, 0, 0 + 8); PUTRGB1(out_2, py_2, 1, 2 + 8); PUTRGB1(out_1, py_1, 1, 2); PUTRGB1(out_1, py_1, 2, 4); PUTRGB1(out_2, py_2, 2, 4 + 8); PUTRGB1(out_2, py_2, 3, 6 + 8); PUTRGB1(out_1, py_1, 3, 6); dst_1[0] = out_1; dst_2[0] = out_2; CLOSEYUV2RGBFUNC(1) SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) { SwsFunc t = NULL; if (ARCH_PPC) t = ff_yuv2rgb_init_ppc(c); if (ARCH_X86) t = ff_yuv2rgb_init_x86(c); if (t) return t; av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found from %s to %s.\n", av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat)); switch (c->dstFormat) { case AV_PIX_FMT_BGR48BE: case AV_PIX_FMT_BGR48LE: return yuv2rgb_c_bgr48; case AV_PIX_FMT_RGB48BE: case AV_PIX_FMT_RGB48LE: return yuv2rgb_c_48; case AV_PIX_FMT_ARGB: case AV_PIX_FMT_ABGR: if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) return yuva2argb_c; case AV_PIX_FMT_RGBA: case AV_PIX_FMT_BGRA: return (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) ? yuva2rgba_c : yuv2rgb_c_32; case AV_PIX_FMT_RGB24: return yuv2rgb_c_24_rgb; case AV_PIX_FMT_BGR24: return yuv2rgb_c_24_bgr; case AV_PIX_FMT_RGB565: case AV_PIX_FMT_BGR565: return yuv2rgb_c_16_ordered_dither; case AV_PIX_FMT_RGB555: case AV_PIX_FMT_BGR555: return yuv2rgb_c_15_ordered_dither; case AV_PIX_FMT_RGB444: case AV_PIX_FMT_BGR444: return yuv2rgb_c_12_ordered_dither; case AV_PIX_FMT_RGB8: case AV_PIX_FMT_BGR8: return yuv2rgb_c_8_ordered_dither; case AV_PIX_FMT_RGB4: case AV_PIX_FMT_BGR4: return yuv2rgb_c_4_ordered_dither; case AV_PIX_FMT_RGB4_BYTE: case AV_PIX_FMT_BGR4_BYTE: return yuv2rgb_c_4b_ordered_dither; case AV_PIX_FMT_MONOBLACK: return yuv2rgb_c_1_ordered_dither; } return NULL; } static void fill_table(uint8_t* table[256 + 2*YUVRGB_TABLE_HEADROOM], const int elemsize, const int64_t inc, void *y_tab) { int i; uint8_t *y_table = y_tab; y_table -= elemsize * (inc >> 9); for (i = 0; i < 256 + 2*YUVRGB_TABLE_HEADROOM; i++) { int64_t cb = av_clip_uint8(i-YUVRGB_TABLE_HEADROOM)*inc; table[i] = y_table + elemsize * (cb >> 16); } } static void fill_gv_table(int table[256 + 2*YUVRGB_TABLE_HEADROOM], const int elemsize, const int64_t inc) { int i; int off = -(inc >> 9); for (i = 0; i < 256 + 2*YUVRGB_TABLE_HEADROOM; i++) { int64_t cb = av_clip_uint8(i-YUVRGB_TABLE_HEADROOM)*inc; table[i] = elemsize * (off + (cb >> 16)); } } static uint16_t roundToInt16(int64_t f) { int r = (f + (1 << 15)) >> 16; if (r < -0x7FFF) return 0x8000; else if (r > 0x7FFF) return 0x7FFF; else return r; } av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation) { const int isRgb = c->dstFormat == AV_PIX_FMT_RGB32 || c->dstFormat == AV_PIX_FMT_RGB32_1 || c->dstFormat == AV_PIX_FMT_BGR24 || c->dstFormat == AV_PIX_FMT_RGB565BE || c->dstFormat == AV_PIX_FMT_RGB565LE || c->dstFormat == AV_PIX_FMT_RGB555BE || c->dstFormat == AV_PIX_FMT_RGB555LE || c->dstFormat == AV_PIX_FMT_RGB444BE || c->dstFormat == AV_PIX_FMT_RGB444LE || c->dstFormat == AV_PIX_FMT_RGB8 || c->dstFormat == AV_PIX_FMT_RGB4 || c->dstFormat == AV_PIX_FMT_RGB4_BYTE || c->dstFormat == AV_PIX_FMT_MONOBLACK; const int isNotNe = c->dstFormat == AV_PIX_FMT_NE(RGB565LE, RGB565BE) || c->dstFormat == AV_PIX_FMT_NE(RGB555LE, RGB555BE) || c->dstFormat == AV_PIX_FMT_NE(RGB444LE, RGB444BE) || c->dstFormat == AV_PIX_FMT_NE(BGR565LE, BGR565BE) || c->dstFormat == AV_PIX_FMT_NE(BGR555LE, BGR555BE) || c->dstFormat == AV_PIX_FMT_NE(BGR444LE, BGR444BE); const int bpp = c->dstFormatBpp; uint8_t *y_table; uint16_t *y_table16; uint32_t *y_table32; int i, base, rbase, gbase, bbase, av_uninit(abase), needAlpha; const int yoffs = (fullRange ? 384 : 326) + YUVRGB_TABLE_LUMA_HEADROOM; const int table_plane_size = 1024 + 2*YUVRGB_TABLE_LUMA_HEADROOM; int64_t crv = inv_table[0]; int64_t cbu = inv_table[1]; int64_t cgu = -inv_table[2]; int64_t cgv = -inv_table[3]; int64_t cy = 1 << 16; int64_t oy = 0; int64_t yb = 0; if (!fullRange) { cy = (cy * 255) / 219; oy = 16 << 16; } else { crv = (crv * 224) / 255; cbu = (cbu * 224) / 255; cgu = (cgu * 224) / 255; cgv = (cgv * 224) / 255; } cy = (cy * contrast) >> 16; crv = (crv * contrast * saturation) >> 32; cbu = (cbu * contrast * saturation) >> 32; cgu = (cgu * contrast * saturation) >> 32; cgv = (cgv * contrast * saturation) >> 32; oy -= 256 * brightness; c->uOffset = 0x0400040004000400LL; c->vOffset = 0x0400040004000400LL; c->yCoeff = roundToInt16(cy * (1 << 13)) * 0x0001000100010001ULL; c->vrCoeff = roundToInt16(crv * (1 << 13)) * 0x0001000100010001ULL; c->ubCoeff = roundToInt16(cbu * (1 << 13)) * 0x0001000100010001ULL; c->vgCoeff = roundToInt16(cgv * (1 << 13)) * 0x0001000100010001ULL; c->ugCoeff = roundToInt16(cgu * (1 << 13)) * 0x0001000100010001ULL; c->yOffset = roundToInt16(oy * (1 << 3)) * 0x0001000100010001ULL; c->yuv2rgb_y_coeff = (int16_t)roundToInt16(cy * (1 << 13)); c->yuv2rgb_y_offset = (int16_t)roundToInt16(oy * (1 << 9)); c->yuv2rgb_v2r_coeff = (int16_t)roundToInt16(crv * (1 << 13)); c->yuv2rgb_v2g_coeff = (int16_t)roundToInt16(cgv * (1 << 13)); c->yuv2rgb_u2g_coeff = (int16_t)roundToInt16(cgu * (1 << 13)); c->yuv2rgb_u2b_coeff = (int16_t)roundToInt16(cbu * (1 << 13)); //scale coefficients by cy crv = ((crv * (1 << 16)) + 0x8000) / FFMAX(cy, 1); cbu = ((cbu * (1 << 16)) + 0x8000) / FFMAX(cy, 1); cgu = ((cgu * (1 << 16)) + 0x8000) / FFMAX(cy, 1); cgv = ((cgv * (1 << 16)) + 0x8000) / FFMAX(cy, 1); av_freep(&c->yuvTable); #define ALLOC_YUV_TABLE(x) \ c->yuvTable = av_malloc(x); \ if (!c->yuvTable) \ return AVERROR(ENOMEM); switch (bpp) { case 1: ALLOC_YUV_TABLE(table_plane_size); y_table = c->yuvTable; yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; for (i = 0; i < table_plane_size - 110; i++) { y_table[i + 110] = av_clip_uint8((yb + 0x8000) >> 16) >> 7; yb += cy; } fill_table(c->table_gU, 1, cgu, y_table + yoffs); fill_gv_table(c->table_gV, 1, cgv); break; case 4: case 4 | 128: rbase = isRgb ? 3 : 0; gbase = 1; bbase = isRgb ? 0 : 3; ALLOC_YUV_TABLE(table_plane_size * 3); y_table = c->yuvTable; yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; for (i = 0; i < table_plane_size - 110; i++) { int yval = av_clip_uint8((yb + 0x8000) >> 16); y_table[i + 110] = (yval >> 7) << rbase; y_table[i + 37 + table_plane_size] = ((yval + 43) / 85) << gbase; y_table[i + 110 + 2*table_plane_size] = (yval >> 7) << bbase; yb += cy; } fill_table(c->table_rV, 1, crv, y_table + yoffs); fill_table(c->table_gU, 1, cgu, y_table + yoffs + table_plane_size); fill_table(c->table_bU, 1, cbu, y_table + yoffs + 2*table_plane_size); fill_gv_table(c->table_gV, 1, cgv); break; case 8: rbase = isRgb ? 5 : 0; gbase = isRgb ? 2 : 3; bbase = isRgb ? 0 : 6; ALLOC_YUV_TABLE(table_plane_size * 3); y_table = c->yuvTable; yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; for (i = 0; i < table_plane_size - 38; i++) { int yval = av_clip_uint8((yb + 0x8000) >> 16); y_table[i + 16] = ((yval + 18) / 36) << rbase; y_table[i + 16 + table_plane_size] = ((yval + 18) / 36) << gbase; y_table[i + 37 + 2*table_plane_size] = ((yval + 43) / 85) << bbase; yb += cy; } fill_table(c->table_rV, 1, crv, y_table + yoffs); fill_table(c->table_gU, 1, cgu, y_table + yoffs + table_plane_size); fill_table(c->table_bU, 1, cbu, y_table + yoffs + 2*table_plane_size); fill_gv_table(c->table_gV, 1, cgv); break; case 12: rbase = isRgb ? 8 : 0; gbase = 4; bbase = isRgb ? 0 : 8; ALLOC_YUV_TABLE(table_plane_size * 3 * 2); y_table16 = c->yuvTable; yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; for (i = 0; i < table_plane_size; i++) { uint8_t yval = av_clip_uint8((yb + 0x8000) >> 16); y_table16[i] = (yval >> 4) << rbase; y_table16[i + table_plane_size] = (yval >> 4) << gbase; y_table16[i + 2*table_plane_size] = (yval >> 4) << bbase; yb += cy; } if (isNotNe) for (i = 0; i < table_plane_size * 3; i++) y_table16[i] = av_bswap16(y_table16[i]); fill_table(c->table_rV, 2, crv, y_table16 + yoffs); fill_table(c->table_gU, 2, cgu, y_table16 + yoffs + table_plane_size); fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2*table_plane_size); fill_gv_table(c->table_gV, 2, cgv); break; case 15: case 16: rbase = isRgb ? bpp - 5 : 0; gbase = 5; bbase = isRgb ? 0 : (bpp - 5); ALLOC_YUV_TABLE(table_plane_size * 3 * 2); y_table16 = c->yuvTable; yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; for (i = 0; i < table_plane_size; i++) { uint8_t yval = av_clip_uint8((yb + 0x8000) >> 16); y_table16[i] = (yval >> 3) << rbase; y_table16[i + table_plane_size] = (yval >> (18 - bpp)) << gbase; y_table16[i + 2*table_plane_size] = (yval >> 3) << bbase; yb += cy; } if (isNotNe) for (i = 0; i < table_plane_size * 3; i++) y_table16[i] = av_bswap16(y_table16[i]); fill_table(c->table_rV, 2, crv, y_table16 + yoffs); fill_table(c->table_gU, 2, cgu, y_table16 + yoffs + table_plane_size); fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2*table_plane_size); fill_gv_table(c->table_gV, 2, cgv); break; case 24: case 48: ALLOC_YUV_TABLE(table_plane_size); y_table = c->yuvTable; yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; for (i = 0; i < table_plane_size; i++) { y_table[i] = av_clip_uint8((yb + 0x8000) >> 16); yb += cy; } fill_table(c->table_rV, 1, crv, y_table + yoffs); fill_table(c->table_gU, 1, cgu, y_table + yoffs); fill_table(c->table_bU, 1, cbu, y_table + yoffs); fill_gv_table(c->table_gV, 1, cgv); break; case 32: case 64: base = (c->dstFormat == AV_PIX_FMT_RGB32_1 || c->dstFormat == AV_PIX_FMT_BGR32_1) ? 8 : 0; rbase = base + (isRgb ? 16 : 0); gbase = base + 8; bbase = base + (isRgb ? 0 : 16); needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat); if (!needAlpha) abase = (base + 24) & 31; ALLOC_YUV_TABLE(table_plane_size * 3 * 4); y_table32 = c->yuvTable; yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; for (i = 0; i < table_plane_size; i++) { unsigned yval = av_clip_uint8((yb + 0x8000) >> 16); y_table32[i] = (yval << rbase) + (needAlpha ? 0 : (255u << abase)); y_table32[i + table_plane_size] = yval << gbase; y_table32[i + 2*table_plane_size] = yval << bbase; yb += cy; } fill_table(c->table_rV, 4, crv, y_table32 + yoffs); fill_table(c->table_gU, 4, cgu, y_table32 + yoffs + table_plane_size); fill_table(c->table_bU, 4, cbu, y_table32 + yoffs + 2*table_plane_size); fill_gv_table(c->table_gV, 4, cgv); break; default: if(!isPlanar(c->dstFormat) || bpp <= 24) av_log(c, AV_LOG_ERROR, "%ibpp not supported by yuv2rgb\n", bpp); return AVERROR(EINVAL); } return 0; }
endlessm/chromium-browser
third_party/ffmpeg/libswscale/yuv2rgb.c
C
bsd-3-clause
35,176
/* * Copyright (c) 2012 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <limits.h> #include <math.h> #include <stdio.h> #include <time.h> #include "native_client/src/include/build_config.h" #include "native_client/src/include/nacl_assert.h" #include "native_client/src/include/nacl_macros.h" #include "native_client/tests/performance/perf_test_runner.h" double TimeIterations(PerfTest *test, int iterations) { struct timespec start_time; struct timespec end_time; ASSERT_EQ(clock_gettime(CLOCK_MONOTONIC, &start_time), 0); for (int i = 0; i < iterations; i++) { test->run(); } ASSERT_EQ(clock_gettime(CLOCK_MONOTONIC, &end_time), 0); double total_time = (end_time.tv_sec - start_time.tv_sec + (double) (end_time.tv_nsec - start_time.tv_nsec) / 1e9); // Output the raw data. printf(" %.3f usec (%g sec) per iteration: %g sec for %i iterations\n", total_time / iterations * 1e6, total_time / iterations, total_time, iterations); return total_time; } int CalibrateIterationCount(PerfTest *test, double target_time, int sample_count) { int calibration_iterations = 100; double calibration_time; for (;;) { calibration_time = TimeIterations(test, calibration_iterations); // If the test completed too quickly to get an accurate // measurement, try a larger number of iterations. if (calibration_time >= 1e-5) break; ASSERT_LE(calibration_iterations, INT_MAX / 10); calibration_iterations *= 10; } double iterations_d = (target_time / (calibration_time / calibration_iterations) / sample_count); // Sanity checks for very fast or very slow tests. ASSERT_LE(iterations_d, INT_MAX); int iterations = iterations_d; if (iterations < 1) iterations = 1; return iterations; } void TimePerfTest(PerfTest *test, double *mean, double *stddev) { // 'target_time' is the amount of time we aim to run this perf test // for in total. double target_time = 0.5; // seconds // 'sample_count' is the number of separate timings we take in order // to measure the variability of the results. int sample_count = 5; int iterations = CalibrateIterationCount(test, target_time, sample_count); double sum = 0; double sum_of_squares = 0; for (int i = 0; i < sample_count; i++) { double time = TimeIterations(test, iterations) / iterations; sum += time; sum_of_squares += time * time; } *mean = sum / sample_count; *stddev = sqrt(sum_of_squares / sample_count - *mean * *mean); } void PerfTestRealTime(const char *description_string, const char *test_name, PerfTest *test, double *result_mean) { double mean; double stddev; printf("Measuring real time:\n"); TimePerfTest(test, &mean, &stddev); printf(" mean: %.6f usec\n", mean * 1e6); printf(" stddev: %.6f usec\n", stddev * 1e6); printf(" relative stddev: %.2f%%\n", stddev / mean * 100); // Output the result in a format that Buildbot will recognise in the // logs and record, using the Chromium perf testing infrastructure. printf("RESULT %s: %s= {%.6f, %.6f} us\n", test_name, description_string, mean * 1e6, stddev * 1e6); *result_mean = mean; } #if defined(__i386__) || defined(__x86_64__) static INLINE uint64_t ReadTimestampCounter() { uint32_t edx; // Top 32 bits of timestamp uint32_t eax; // Bottom 32 bits of timestamp // NaCl's x86 validators don't allow rdtscp, so we can't check // whether the thread has been moved to a different core. __asm__ volatile("rdtsc" : "=d"(edx), "=a"(eax)); return (((uint64_t) edx) << 32) | eax; } static int CompareUint64(const void *val1, const void *val2) { uint64_t i1 = *(uint64_t *) val1; uint64_t i2 = *(uint64_t *) val2; if (i1 == i2) return 0; return i1 < i2 ? -1 : 1; } void PerfTestCycleCount(const char *description_string, const char *test_name, PerfTest *test, uint64_t *result_cycles) { printf("Measuring clock cycles:\n"); uint64_t times[101]; for (size_t i = 0; i < NACL_ARRAY_SIZE(times); i++) { uint64_t start_time = ReadTimestampCounter(); test->run(); uint64_t end_time = ReadTimestampCounter(); times[i] = end_time - start_time; } // We expect the first run to be slower because caches won't be // warm. We print the first and slowest runs so that we can verify // this. printf(" first runs (cycles): "); for (size_t i = 0; i < 10; i++) printf(" %" PRId64, times[i]); printf(" ...\n"); qsort(times, NACL_ARRAY_SIZE(times), sizeof(times[0]), CompareUint64); printf(" slowest runs (cycles): ..."); for (size_t i = NACL_ARRAY_SIZE(times) - 10; i < NACL_ARRAY_SIZE(times); i++) printf(" %" PRId64, times[i]); printf("\n"); int count = NACL_ARRAY_SIZE(times) - 1; uint64_t q1 = times[count * 1 / 4]; // First quartile uint64_t q2 = times[count * 1 / 2]; // Median uint64_t q3 = times[count * 3 / 4]; // Third quartile printf(" min: %" PRId64 " cycles\n", times[0]); printf(" q1: %" PRId64 " cycles\n", q1); printf(" median: %" PRId64 " cycles\n", q2); printf(" q3: %" PRId64 " cycles\n", q3); printf(" max: %" PRId64 " cycles\n", times[count]); // The "{...}" RESULT syntax usually means standard deviation but // here we report the interquartile range. printf("RESULT %s_CycleCount: %s= {%" PRId64 ", %" PRId64 "} count\n", test_name, description_string, q2, q3 - q1); *result_cycles = q2; } #endif void RunPerfTest(const char *description_string, const char *test_name, PerfTest *test) { printf("\n%s:\n", test_name); double mean_time; PerfTestRealTime(description_string, test_name, test, &mean_time); #if defined(__i386__) || defined(__x86_64__) uint64_t cycles; PerfTestCycleCount(description_string, test_name, test, &cycles); // The apparent clock speed can be used to sanity-check the results, // e.g. to see whether the CPU is in power-saving mode. printf("Apparent clock speed: %.0f MHz\n", cycles / mean_time / 1e6); #endif delete test; } int main(int argc, char **argv) { const char *description_string = argc >= 2 ? argv[1] : "time"; // Turn off stdout buffering to aid debugging. setvbuf(stdout, NULL, _IONBF, 0); #define RUN_TEST(class_name) \ extern PerfTest *Make##class_name(); \ RunPerfTest(description_string, #class_name, Make##class_name()); RUN_TEST(TestNull); #if defined(__native_client__) RUN_TEST(TestNaClSyscall); #endif #if NACL_LINUX || NACL_OSX RUN_TEST(TestHostSyscall); #endif RUN_TEST(TestSetjmpLongjmp); RUN_TEST(TestClockGetTime); #if !NACL_OSX RUN_TEST(TestTlsVariable); #endif RUN_TEST(TestMmapAnonymous); RUN_TEST(TestAtomicIncrement); RUN_TEST(TestUncontendedMutexLock); RUN_TEST(TestCondvarSignalNoOp); RUN_TEST(TestThreadCreateAndJoin); RUN_TEST(TestThreadWakeup); #if defined(__native_client__) // Test untrusted fault handling. This should come last because, on // Windows, registering a fault handler has a performance impact on // thread creation and exit. This is because when the Windows debug // exception handler is attached to sel_ldr as a debugger, Windows // suspends the whole sel_ldr process every time a thread is created // or exits. RUN_TEST(TestCatchingFault); // Measure that overhead by running MakeTestThreadCreateAndJoin again. RunPerfTest(description_string, "TestThreadCreateAndJoinAfterSettingFaultHandler", MakeTestThreadCreateAndJoin()); #endif #undef RUN_TEST return 0; }
endlessm/chromium-browser
native_client/tests/performance/perf_test_runner.cc
C++
bsd-3-clause
7,715
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage * @package Mage_Centinel * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Abstract Validation State Model for Visa */ class Mage_Centinel_Model_State_Visa extends Mage_Centinel_Model_StateAbstract { /** * Analyse lookup`s results. If it has require params for authenticate, return true * * @return bool */ public function isAuthenticateAllowed() { return $this->_isLookupStrictSuccessful() && is_null($this->getAuthenticateEciFlag()); } /** * Analyse authenticate`s results. If authenticate is successful return true and false if it failure * Result depends from flag self::getIsModeStrict() * * @return bool */ public function isAuthenticateSuccessful() { $paResStatus = $this->getAuthenticatePaResStatus(); $eciFlag = $this->getAuthenticateEciFlag(); $xid = $this->getAuthenticateXid(); $cavv = $this->getAuthenticateCavv(); $errorNo = $this->getAuthenticateErrorNo(); $signatureVerification = $this->getAuthenticateSignatureVerification(); //Test cases 1-5, 11 if ($this->_isLookupStrictSuccessful()) { if ($paResStatus == 'Y' && $eciFlag == '05' && $xid != '' && $cavv != '' && $errorNo == '0') { //Test case 1 if ($signatureVerification == 'Y') { return true; } //Test case 2 if ($signatureVerification == 'N') { return false; } } //Test case 3 if ($paResStatus == 'N' && $signatureVerification == 'Y' && $eciFlag == '07' && $xid != '' && $cavv == '' && $errorNo == '0') { return false; } //Test case 4 if ($paResStatus == 'A' && $signatureVerification == 'Y' && $eciFlag == '06' && $xid != '' && $cavv != '' && $errorNo == '0') { if ($this->getIsModeStrict()) { return false; } else { return true; } } //Test case 5 if ($paResStatus == 'U' && $signatureVerification == 'Y' && $eciFlag == '07' && $xid != '' && $cavv == '' && $errorNo == '0') { if ($this->getIsModeStrict()) { return false; } else { return true; } } //Test case 11 if ($paResStatus == 'U' && $signatureVerification == '' && $eciFlag == '07' && $xid == '' && $cavv == '' && $errorNo == '1050') { if ($this->getIsModeStrict()) { return false; } else { return true; } } } //Test cases 6-10 if (!$this->getIsModeStrict() && $this->_isLookupSoftSuccessful()) { if ($paResStatus == '' && $signatureVerification == '' && $eciFlag == '' && $xid == '' && $cavv == '' && $errorNo == '0') { return true; } elseif ($paResStatus == false && $signatureVerification == false && $eciFlag == false && $xid == false && $cavv == false && $errorNo == false) { return true; } } return false; } /** * Analyse lookup`s results. If lookup is strict successful return true * * @return bool */ protected function _isLookupStrictSuccessful() { //Test cases 1-5, 11 if ($this->getLookupEnrolled() == 'Y' && $this->getLookupAcsUrl() != '' && $this->getLookupPayload() != '' && $this->getLookupErrorNo() == '0') { return true; } return false; } /** * Analyse lookup`s results. If lookup is soft successful return true * * @return bool */ protected function _isLookupSoftSuccessful() { $acsUrl = $this->getLookupAcsUrl(); $payload = $this->getLookupPayload(); $errorNo = $this->getLookupErrorNo(); $enrolled = $this->getLookupEnrolled(); //Test cases 7,8 if ($acsUrl == '' && $payload == '' && $errorNo == '0' && ($enrolled == 'N' || $enrolled == 'U')) { return true; } //Test case 6 if ($enrolled == '' && $acsUrl == '' && $payload == '' && $errorNo == 'Timeout number') { return true; } //Test cases 9,10 if ($enrolled == 'U' && $acsUrl == '' && $payload == '' && $errorNo == '1001') { return true; } return false; } }
5452/durex
includes/src/Mage_Centinel_Model_State_Visa.php
PHP
bsd-3-clause
5,614
CONTIKI=../../../../../.. TARGET = mikro-e VERSION? = $(shell git describe --abbrev=4 --dirty --always --tags) CONTIKI_WITH_IPV6 = 1 CONTIKI_WITH_RPL = 0 USE_SERIAL_PADS = 1 APPS += letmecreateiot CFLAGS += -DVERSION=$(VERSION) CFLAGS += -Wall -Wno-pointer-sign CFLAGS += -I $(CONTIKI)/platform/$(TARGET) CFLAGS += -fno-short-double LDFLAGS += -Wl,--defsym,_min_heap_size=32000 APPS += letmecreateiot SMALL=0 all: main xc32-bin2hex main.$(TARGET) include $(CONTIKI)/Makefile.include
CreatorDev/LetMeCreateIoT
examples/motion/Makefile
Makefile
bsd-3-clause
492
<?php /** * app.php * @author Revin Roman * @link https://rmrevin.com */ $base_dir = realpath(__DIR__ . '/../..'); $vendor_dir = realpath($base_dir . '/vendor'); $path_list = [ $vendor_dir . '/yiisoft/extensions.php', $base_dir . '/.extensions.php', ]; $extensions = []; foreach ($path_list as $path) { if (file_exists($path)) { $extensions = array_merge($extensions, require_once $path); } } return [ 'name' => APP_NAME, 'vendorPath' => $vendor_dir, 'extensions' => $extensions, 'language' => 'en', ];
cookyii/project
common/config/app.php
PHP
bsd-3-clause
552
/** * Copyright (C) Zhang,Yuexiang (xfeep) * */ package nginx.clojure.anno; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR}) @Retention(RetentionPolicy.RUNTIME) public @interface Suspendable { }
kjniemi/nginx-clojure
src/java/nginx/clojure/anno/Suspendable.java
Java
bsd-3-clause
387
#!/usr/local/bin/perl # VC-32.pl - unified script for Microsoft Visual C++, covering Win32, # Win64 and WinCE [follow $FLAVOR variable to trace the differences]. # $ssl= "ssleay32"; if ($fips && !$shlib) { $crypto="libeayfips32"; $crypto_compat = "libeaycompat32.lib"; } else { $crypto="libeay32"; } if ($fipscanisterbuild) { $fips_canister_path = "\$(LIB_D)\\fipscanister.lib"; } $o='\\'; $cp='$(PERL) util/copy.pl'; $mkdir='$(PERL) util/mkdir-p.pl'; $rm='del /Q'; $zlib_lib="zlib1.lib"; # Santize -L options for ms link $l_flags =~ s/-L("\[^"]+")/\/libpath:$1/g; $l_flags =~ s/-L(\S+)/\/libpath:$1/g; # C compiler stuff $cc='cl'; if ($FLAVOR =~ /WIN64/) { # Note that we currently don't have /WX on Win64! There is a lot of # warnings, but only of two types: # # C4344: conversion from '__int64' to 'int/long', possible loss of data # C4267: conversion from 'size_t' to 'int/long', possible loss of data # # Amount of latter type is minimized by aliasing strlen to function of # own desing and limiting its return value to 2GB-1 (see e_os.h). As # per 0.9.8 release remaining warnings were explicitly examined and # considered safe to ignore. # $base_cflags=' /W3 /Gs0 /GF /Gy /nologo -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DOPENSSL_SYSNAME_WIN32 -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE'; $base_cflags.=' -D_CRT_SECURE_NO_DEPRECATE'; # shut up VC8 $base_cflags.=' -D_CRT_NONSTDC_NO_DEPRECATE'; # shut up VC8 my $f = $shlib || $fips ?' /MD':' /MT'; $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib $opt_cflags=$f.' /Ox'; $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; $lflags="/nologo /subsystem:console /opt:ref"; } elsif ($FLAVOR =~ /CE/) { # sanity check die '%OSVERSION% is not defined' if (!defined($ENV{'OSVERSION'})); die '%PLATFORM% is not defined' if (!defined($ENV{'PLATFORM'})); die '%TARGETCPU% is not defined' if (!defined($ENV{'TARGETCPU'})); # # Idea behind this is to mimic flags set by eVC++ IDE... # $wcevers = $ENV{'OSVERSION'}; # WCENNN die '%OSVERSION% value is insane' if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/); $wcecdefs = "-D_WIN32_WCE=$1$2 -DUNDER_CE=$1$2"; # -D_WIN32_WCE=NNN $wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN $wceplatf = $ENV{'PLATFORM'}; $wceplatf =~ tr/a-z0-9 /A-Z0-9_/d; $wcecdefs .= " -DWCE_PLATFORM_$wceplatf"; $wcetgt = $ENV{'TARGETCPU'}; # just shorter name... SWITCH: for($wcetgt) { /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_"; $wcelflag.=" /machine:IX86"; last; }; /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt"; $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/); $wcecdefs.=" -QRarch4T -QRinterwork-return"; $wcelflag.=" /machine:THUMB"; last; }; /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt"; $wcelflag.=" /machine:ARM"; last; }; /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32"; $wcelflag.=" /machine:MIPSFPU"; last; }; /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; $wcecdefs.=" -DMIPSII -QMmips16"; $wcelflag.=" /machine:MIPS16"; last; }; /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; $wcecdefs.=" -QMmips2"; $wcelflag.=" /machine:MIPS"; last; }; /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000"; $wcelflag.=" /machine:MIPS"; last; }; /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_$wcetgt_ -DSHx"; $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/); $wcelflag.=" /machine:$wcetgt"; last; }; { $wcecdefs.=" -D$wcetgt -D_$wcetgt_"; $wcelflag.=" /machine:$wcetgt"; last; }; } $cc='$(CC)'; $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -I$(WCECOMPAT)/include -DOPENSSL_SMALL_FOOTPRINT'; $base_cflags.=" $wcecdefs"; $opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics... $dbg_clfags=' /MC /Od -DDEBUG -D_DEBUG'; $lflags="/nologo /opt:ref $wcelflag"; } else # Win32 { $base_cflags=' /W3 /WX /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32'; $base_cflags.=' -D_CRT_SECURE_NO_DEPRECATE'; # shut up VC8 $base_cflags.=' -D_CRT_NONSTDC_NO_DEPRECATE'; # shut up VC8 my $f = $shlib || $fips ?' /MD':' /MT'; $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib $opt_cflags=$f.' /Ox /O2 /Ob2'; $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; $lflags="/nologo /subsystem:console /opt:ref"; } $mlflags=''; $out_def="out32"; $out_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/); $tmp_def="tmp32"; $tmp_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/); $inc_def="inc32"; if ($debug) { $cflags=$dbg_cflags.$base_cflags.' /Zi'; $lflags.=" /debug"; $mlflags.=' /debug'; } else { $cflags=$opt_cflags.$base_cflags; } $obj='.obj'; $ofile="/Fo"; # EXE linking stuff $link="link"; $rsc="rc"; $efile="/out:"; $exep='.exe'; if ($no_sock) { $ex_libs=''; } elsif ($FLAVOR =~ /CE/) { $ex_libs='winsock.lib'; } else { $ex_libs='wsock32.lib'; } my $oflow; if ($FLAVOR =~ /WIN64/ and `cl 2>&1` =~ /14\.00\.4[0-9]{4}\./) { $oflow=' bufferoverflowu.lib'; } else { $oflow=""; } if ($FLAVOR =~ /CE/) { $ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib'; $ex_libs.=' /nodefaultlib:oldnames.lib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86"); } else { $ex_libs.=' gdi32.lib crypt32.lib advapi32.lib user32.lib'; $ex_libs.= $oflow; } # As native NT API is pure UNICODE, our WIN-NT build defaults to UNICODE, # but gets linked with unicows.lib to ensure backward compatibility. if ($FLAVOR =~ /NT/) { $cflags.=" -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE"; $ex_libs="unicows.lib $ex_libs"; } # static library stuff $mklib='lib /nologo'; $ranlib=''; $plib=""; $libp=".lib"; $shlibp=($shlib)?".dll":".lib"; $lfile='/out:'; $shlib_ex_obj=""; $app_ex_obj="setargv.obj" if ($FLAVOR !~ /CE/); if ($nasm) { my $ver=`nasm -v 2>NUL`; my $vew=`nasmw -v 2>NUL`; # pick newest version $asm=($ver gt $vew?"nasm":"nasmw")." -f win32"; $afile='-o '; } elsif ($ml64) { $asm='ml64 /c /Cp /Cx'; $asm.=' /Zi' if $debug; $afile='/Fo'; } else { $asm='ml /nologo /Cp /coff /c /Cx'; $asm.=" /Zi" if $debug; $afile='/Fo'; } $aes_asm_obj=''; $bn_asm_obj=''; $bn_asm_src=''; $des_enc_obj=''; $des_enc_src=''; $bf_enc_obj=''; $bf_enc_src=''; if (!$no_asm) { if ($FLAVOR =~ "WIN32") { $aes_asm_obj='crypto\aes\asm\a_win32.obj'; $aes_asm_src='crypto\aes\asm\a_win32.asm'; $bn_asm_obj='crypto\bn\asm\bn_win32.obj crypto\bn\asm\mt_win32.obj'; $bn_asm_src='crypto\bn\asm\bn_win32.asm crypto\bn\asm\mt_win32.asm'; $bnco_asm_obj='crypto\bn\asm\co_win32.obj'; $bnco_asm_src='crypto\bn\asm\co_win32.asm'; $des_enc_obj='crypto\des\asm\d_win32.obj crypto\des\asm\y_win32.obj'; $des_enc_src='crypto\des\asm\d_win32.asm crypto\des\asm\y_win32.asm'; $bf_enc_obj='crypto\bf\asm\b_win32.obj'; $bf_enc_src='crypto\bf\asm\b_win32.asm'; $cast_enc_obj='crypto\cast\asm\c_win32.obj'; $cast_enc_src='crypto\cast\asm\c_win32.asm'; $rc4_enc_obj='crypto\rc4\asm\r4_win32.obj'; $rc4_enc_src='crypto\rc4\asm\r4_win32.asm'; $rc5_enc_obj='crypto\rc5\asm\r5_win32.obj'; $rc5_enc_src='crypto\rc5\asm\r5_win32.asm'; $md5_asm_obj='crypto\md5\asm\m5_win32.obj'; $md5_asm_src='crypto\md5\asm\m5_win32.asm'; $sha1_asm_obj='crypto\sha\asm\s1_win32.obj crypto\sha\asm\sha512-sse2.obj'; $sha1_asm_src='crypto\sha\asm\s1_win32.asm crypto\sha\asm\sha512-sse2.asm'; $rmd160_asm_obj='crypto\ripemd\asm\rm_win32.obj'; $rmd160_asm_src='crypto\ripemd\asm\rm_win32.asm'; $cpuid_asm_obj='crypto\cpu_win32.obj'; $cpuid_asm_src='crypto\cpu_win32.asm'; $cflags.=" -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DAES_ASM -DBN_ASM -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT -DMD5_ASM -DSHA1_ASM -DRMD160_ASM"; } elsif ($FLAVOR =~ "WIN64A") { $aes_asm_obj='$(OBJ_D)\aes-x86_64.obj'; $aes_asm_src='crypto\aes\asm\aes-x86_64.asm'; $bn_asm_obj='$(OBJ_D)\x86_64-mont.obj $(OBJ_D)\bn_asm.obj'; $bn_asm_src='crypto\bn\asm\x86_64-mont.asm'; $sha1_asm_obj='$(OBJ_D)\sha1-x86_64.obj $(OBJ_D)\sha256-x86_64.obj $(OBJ_D)\sha512-x86_64.obj'; $sha1_asm_src='crypto\sha\asm\sha1-x86_64.asm crypto\sha\asm\sha256-x86_64.asm crypto\sha\asm\sha512-x86_64.asm'; $cpuid_asm_obj='$(OBJ_D)\cpuid-x86_64.obj'; $cpuid_asm_src='crypto\cpuid-x86_64.asm'; $cflags.=" -DOPENSSL_CPUID_OBJ -DAES_ASM -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM"; } } if ($shlib && $FLAVOR !~ /CE/) { $mlflags.=" $lflags /dll"; # $cflags =~ s| /MD| /MT|; $lib_cflag=" -D_WINDLL"; $out_def="out32dll"; $tmp_def="tmp32dll"; # # Engage Applink... # $app_ex_obj.=" \$(OBJ_D)\\applink.obj /implib:\$(TMP_D)\\junk.lib"; $cflags.=" -DOPENSSL_USE_APPLINK -I."; # I'm open for better suggestions than overriding $banner... $banner=<<'___'; @echo Building OpenSSL $(OBJ_D)\applink.obj: ms\applink.c $(CC) /Fo$(OBJ_D)\applink.obj $(APP_CFLAGS) -c ms\applink.c $(OBJ_D)\uplink.obj: ms\uplink.c ms\applink.c $(CC) /Fo$(OBJ_D)\uplink.obj $(SHLIB_CFLAGS) -c ms\uplink.c $(INCO_D)\applink.c: ms\applink.c $(CP) ms\applink.c $(INCO_D)\applink.c EXHEADER= $(EXHEADER) $(INCO_D)\applink.c LIBS_DEP=$(LIBS_DEP) $(OBJ_D)\applink.obj ___ $banner .= "CRYPTOOBJ=\$(OBJ_D)\\uplink.obj \$(CRYPTOOBJ)\n"; $banner.=<<'___' if ($FLAVOR =~ /WIN64/); CRYPTOOBJ=ms\uptable.obj $(CRYPTOOBJ) ___ } elsif ($shlib && $FLAVOR =~ /CE/) { $mlflags.=" $lflags /dll"; $lib_cflag=" -D_WINDLL -D_DLL"; $out_def='out32dll_$(TARGETCPU)'; $tmp_def='tmp32dll_$(TARGETCPU)'; } $cflags.=" /Fd$out_def"; sub do_lib_rule { my($objs,$target,$name,$shlib,$ign,$base_addr) = @_; local($ret); $taget =~ s/\//$o/g if $o ne '/'; my $base_arg; if ($base_addr ne "") { $base_arg= " /base:$base_addr"; } else { $base_arg = ""; } if ($target =~ /O_CRYPTO/ && $fipsdso) { $name = "/def:ms/libeayfips.def"; } elsif ($name ne "") { $name =~ tr/a-z/A-Z/; $name = "/def:ms/${name}.def"; } # $target="\$(LIB_D)$o$target"; # $ret.="$target: $objs\n"; if (!$shlib) { # $ret.="\t\$(RM) \$(O_$Name)\n"; $ex =' '; $ret.="$target: $objs\n"; $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs $ex\n<<\n"; } else { my $ex = ""; if ($target !~ /O_CRYPTO/) { $ex .= " \$(L_CRYPTO)"; #$ex .= " \$(L_FIPS)" if $fipsdso; } my $fipstarget; if ($fipsdso) { $fipstarget = "O_FIPS"; } else { $fipstarget = "O_CRYPTO"; } if ($name eq "") { $ex.= $oflow; if ($target =~ /capi/) { $ex.=' crypt32.lib advapi32.lib'; } } elsif ($FLAVOR =~ /CE/) { $ex.=' winsock.lib $(WCECOMPAT)/lib/wcecompatex.lib'; } else { $ex.=' unicows.lib' if ($FLAVOR =~ /NT/); $ex.=' wsock32.lib gdi32.lib advapi32.lib user32.lib'; $ex.=' crypt32.lib'; $ex.= $oflow; } $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/; if ($fips && $target =~ /$fipstarget/) { $ex.= $mwex unless $fipscanisterbuild; $ret.="$target: $objs \$(PREMAIN_DSO_EXE)"; if ($fipsdso) { $ex.=" \$(OBJ_D)\\\$(LIBFIPS).res"; $ret.=" \$(OBJ_D)\\\$(LIBFIPS).res"; $ret.=" ms/\$(LIBFIPS).def"; } $ret.="\n\tSET FIPS_LINK=\$(LINK)\n"; $ret.="\tSET FIPS_CC=\$(CC)\n"; $ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n"; $ret.="\tSET PREMAIN_DSO_EXE=\$(PREMAIN_DSO_EXE)\n"; $ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n"; $ret.="\tSET FIPS_TARGET=$target\n"; $ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n"; $ret.="\t\$(FIPSLINK) \$(MLFLAGS) /fixed /map $base_arg $efile$target "; $ret.="$name @<<\n \$(SHLIB_EX_OBJ) $objs "; $ret.="\$(OBJ_D)${o}fips_premain.obj $ex\n<<\n"; } else { $ret.="$target: $objs"; if ($target =~ /O_CRYPTO/ && $fipsdso) { $ret .= " \$(O_FIPS)"; $ex .= " \$(L_FIPS)"; } $ret.="\n\t\$(LINK) \$(MLFLAGS) $efile$target $name @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n"; } $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;2\n\n"; } $ret.="\n"; return($ret); } sub do_link_rule { my($target,$files,$dep_libs,$libs,$standalone)=@_; local($ret,$_); $file =~ s/\//$o/g if $o ne '/'; $n=&bname($targer); $ret.="$target: $files $dep_libs\n"; if ($standalone == 1) { $ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n\t"; $ret.= "\$(EX_LIBS) " if ($files =~ /O_FIPSCANISTER/ && !$fipscanisterbuild); $ret.="$files $libs\n<<\n"; } elsif ($standalone == 2) { $ret.="\tSET FIPS_LINK=\$(LINK)\n"; $ret.="\tSET FIPS_CC=\$(CC)\n"; $ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n"; $ret.="\tSET PREMAIN_DSO_EXE=\n"; $ret.="\tSET FIPS_TARGET=$target\n"; $ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n"; $ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n"; $ret.="\t\$(FIPSLINK) \$(LFLAGS) /fixed /map $efile$target @<<\n"; $ret.="\t\$(APP_EX_OBJ) $files \$(OBJ_D)${o}fips_premain.obj $libs\n<<\n"; } else { $ret.="\t\$(LINK) \$(LFLAGS) $efile$target @<<\n"; $ret.="\t\$(APP_EX_OBJ) $files $libs\n<<\n"; } $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;1\n\n"; return($ret); } sub do_rlink_rule { local($target,$rl_start, $rl_mid, $rl_end,$dep_libs,$libs)=@_; local($ret,$_); my $files = "$rl_start $rl_mid $rl_end"; $file =~ s/\//$o/g if $o ne '/'; $n=&bname($targer); $ret.="$target: $files $dep_libs \$(FIPS_SHA1_EXE)\n"; $ret.="\t\$(PERL) ms\\segrenam.pl \$\$a $rl_start\n"; $ret.="\t\$(PERL) ms\\segrenam.pl \$\$b $rl_mid\n"; $ret.="\t\$(PERL) ms\\segrenam.pl \$\$c $rl_end\n"; $ret.="\t\$(MKLIB) $lfile$target @<<\n\t$files\n<<\n"; $ret.="\t\$(FIPS_SHA1_EXE) $target > ${target}.sha1\n"; $ret.="\t\$(PERL) util${o}copy.pl -stripcr fips${o}fips_premain.c \$(LIB_D)${o}fips_premain.c\n"; $ret.="\t\$(CP) fips${o}fips_premain.c.sha1 \$(LIB_D)${o}fips_premain.c.sha1\n"; $ret.="\n"; return($ret); } sub do_sdef_rule { my $ret = "ms/\$(LIBFIPS).def: \$(O_FIPSCANISTER)\n"; $ret.="\t\$(PERL) util/mksdef.pl \$(MLFLAGS) /out:dummy.dll /def:ms/libeay32.def @<<\n \$(O_FIPSCANISTER)\n<<\n"; $ret.="\n"; return $ret; } 1;
GaloisInc/hacrypto
src/C/openssl/openssl-0.9.8zh/util/pl/VC-32.pl
Perl
bsd-3-clause
14,335
/******************************************************************************* * This file is part of Pebble. * * Copyright (c) 2014 by Mitchell Bösecke * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. ******************************************************************************/ package com.mitchellbosecke.pebble.tokenParser; import java.util.ArrayList; import java.util.List; import com.mitchellbosecke.pebble.error.ParserException; import com.mitchellbosecke.pebble.lexer.Token; import com.mitchellbosecke.pebble.lexer.TokenStream; import com.mitchellbosecke.pebble.node.BodyNode; import com.mitchellbosecke.pebble.node.IfNode; import com.mitchellbosecke.pebble.node.RenderableNode; import com.mitchellbosecke.pebble.node.expression.Expression; import com.mitchellbosecke.pebble.parser.Parser; import com.mitchellbosecke.pebble.parser.StoppingCondition; import com.mitchellbosecke.pebble.utils.Pair; public class IfTokenParser extends AbstractTokenParser { @Override public RenderableNode parse(Token token, Parser parser) throws ParserException { TokenStream stream = parser.getStream(); int lineNumber = token.getLineNumber(); // skip the 'if' token stream.next(); List<Pair<Expression<?>, BodyNode>> conditionsWithBodies = new ArrayList<>(); Expression<?> expression = parser.getExpressionParser().parseExpression(); stream.expect(Token.Type.EXECUTE_END); BodyNode body = parser.subparse(decideIfFork); conditionsWithBodies.add(new Pair<Expression<?>, BodyNode>(expression, body)); BodyNode elseBody = null; boolean end = false; while (!end) { switch (stream.current().getValue()) { case "else": stream.next(); stream.expect(Token.Type.EXECUTE_END); elseBody = parser.subparse(decideIfEnd); break; case "elseif": stream.next(); expression = parser.getExpressionParser().parseExpression(); stream.expect(Token.Type.EXECUTE_END); body = parser.subparse(decideIfFork); conditionsWithBodies.add(new Pair<Expression<?>, BodyNode>(expression, body)); break; case "endif": stream.next(); end = true; break; default: throw new ParserException( null, String.format("Unexpected end of template. Pebble was looking for the following tags \"else\", \"elseif\", or \"endif\""), stream.current().getLineNumber(), stream.getFilename()); } } stream.expect(Token.Type.EXECUTE_END); return new IfNode(lineNumber, conditionsWithBodies, elseBody); } private StoppingCondition decideIfFork = new StoppingCondition() { @Override public boolean evaluate(Token token) { return token.test(Token.Type.NAME, "elseif", "else", "endif"); } }; private StoppingCondition decideIfEnd = new StoppingCondition() { @Override public boolean evaluate(Token token) { return token.test(Token.Type.NAME, "endif"); } }; @Override public String getTag() { return "if"; } }
hectorlf/pebble
src/main/java/com/mitchellbosecke/pebble/tokenParser/IfTokenParser.java
Java
bsd-3-clause
3,455
/******************************************************************************* * This file is part of Pebble. * <p> * Copyright (c) 2014 by Mitchell Bösecke * <p> * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. ******************************************************************************/ package com.mitchellbosecke.pebble.template; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.Map; /** * A stack data structure used to represent the scope of variables that are currently accessible. Pushing a new scope * will allow the template to add variables with names of pre-existing variables without * overriding the originals; to access the original variables you would pop the scope again. */ public class ScopeChain { /** * The stack of scopes */ private LinkedList<Scope> stack = new LinkedList<>(); /** * Constructs an empty scope chain without any known scopes. */ public ScopeChain() { } /** * Constructs a new scope chain with one known scope. * * @param map The map of variables used to initialize a scope. */ public ScopeChain(Map<String, Object> map) { Scope scope = new Scope(new HashMap<>(map), false); stack.push(scope); } /** * Creates a deep copy of the ScopeChain. This is used for the parallel tag * because every new thread should have a "snapshot" of the scopes, i.e. if * one thread adds a new object to a scope, it should not be available to * the other threads. * <p> * This will construct a new scope chain and new scopes but it will continue * to have references to the original user-provided variables. This is why * it is important for the user to only provide thread-safe variables * when using the "parallel" tag. * * @return A copy of the scope chain */ public ScopeChain deepCopy() { ScopeChain copy = new ScopeChain(); for (Scope originalScope : stack) { copy.stack.add(originalScope.shallowCopy()); } return copy; } /** * Adds an empty non-local scope to the scope chain */ public void pushScope() { pushScope(new HashMap<String, Object>()); } /** * Adds a new non-local scope to the scope chain * * @param map The known variables of this scope. */ public void pushScope(Map<String, Object> map) { Scope scope = new Scope(map, false); stack.push(scope); } /** * Adds a new local scope to the scope chain */ public void pushLocalScope() { Scope scope = new Scope(new HashMap<String, Object>(), true); stack.push(scope); } /** * Pops the most recent scope from the scope chain. */ public void popScope() { stack.pop(); } /** * Adds a variable to the current scope. * * @param key The name of the variable * @param value The value of the variable */ public void put(String key, Object value) { stack.peek().put(key, value); } /** * Retrieves a variable from the scope chain, starting at the current * scope and working it's way up all visible scopes. * * @param key The name of the variable * @return The value of the variable */ public Object get(String key) { Object result; /* * The majority of time, the requested variable will be in the first * scope so we do a quick lookup in that scope before attempting to * create an iterator, etc. This is solely for performance. */ Scope scope = stack.getFirst(); result = scope.get(key); if (result == null) { Iterator<Scope> iterator = stack.iterator(); // account for the first lookup we did iterator.next(); while (result == null && iterator.hasNext()) { scope = iterator.next(); result = scope.get(key); if (scope.isLocal()) { break; } } } return result; } /** * This method checks if the given {@code key} does exists within the scope * chain. * * @param key the for which the the check should be executed for. * @return {@code true} when the key does exists or {@code false} when the * given key does not exists. */ public boolean containsKey(String key) { /* * The majority of time, the requested variable will be in the first * scope so we do a quick lookup in that scope before attempting to * create an iterator, etc. This is solely for performance. */ Scope scope = stack.getFirst(); if (scope.containsKey(key)) { return true; } Iterator<Scope> iterator = stack.iterator(); // account for the first lookup we did iterator.next(); while (iterator.hasNext()) { scope = iterator.next(); if (scope.containsKey(key)) { return true; } if (scope.isLocal()) { break; } } return false; } /** * Checks if the current scope contains a variable without * then looking up the scope chain. * * @param variableName The name of the variable * @return Whether or not the variable exists in the current scope */ public boolean currentScopeContainsVariable(String variableName) { return stack.getFirst().containsKey(variableName); } /** * Sets the value of a variable in the first scope in the chain that * already contains the variable; adds a variable to the current scope * if an existing variable is not found. * * @param key The name of the variable * @param value The value of the variable */ public void set(String key, Object value) { /* * The majority of time, the requested variable will be in the first * scope so we do a quick lookup in that scope before attempting to * create an iterator, etc. This is solely for performance. */ Scope scope = stack.getFirst(); if (scope.isLocal() || scope.containsKey(key)) { scope.put(key, value); return; } Iterator<Scope> iterator = stack.iterator(); // account for the first lookup we did iterator.next(); while (iterator.hasNext()) { scope = iterator.next(); if (scope.isLocal() || scope.containsKey(key)) { scope.put(key, value); return; } } // no existing variable, create a new one put(key, value); } }
hectorlf/pebble
src/main/java/com/mitchellbosecke/pebble/template/ScopeChain.java
Java
bsd-3-clause
6,958
""" Provides Matlab-like tic, tac and toc functions. """ import time import numpy as np class __Timer__: """Computes elapsed time, between tic, tac, and toc. Methods ------- tic : Resets timer. toc : Returns and prints time elapsed since last tic(). tac : Returns and prints time elapsed since last tic(), tac() or toc() whichever occured last. loop_timer : Returns and prints the total and average time elapsed for n runs of a given function. """ start = None last = None def tic(self): """ Save time for future use with `tac()` or `toc()`. """ t = time.time() self.start = t self.last = t def tac(self, verbose=True, digits=2): """ Return and print elapsed time since last `tic()`, `tac()`, or `toc()`. Parameters ---------- verbose : bool, optional(default=True) If True, then prints time. digits : scalar(int), optional(default=2) Number of digits printed for time elapsed. Returns ------- elapsed : scalar(float) Time elapsed since last `tic()`, `tac()`, or `toc()`. """ if self.start is None: raise Exception("tac() without tic()") t = time.time() elapsed = t-self.last self.last = t if verbose: m, s = divmod(elapsed, 60) h, m = divmod(m, 60) print("TAC: Elapsed: %d:%02d:%0d.%0*d" % (h, m, s, digits, (s % 1)*(10**digits))) return elapsed def toc(self, verbose=True, digits=2): """ Return and print time elapsed since last `tic()`. Parameters ---------- verbose : bool, optional(default=True) If True, then prints time. digits : scalar(int), optional(default=2) Number of digits printed for time elapsed. Returns ------- elapsed : scalar(float) Time elapsed since last `tic()`. """ if self.start is None: raise Exception("toc() without tic()") t = time.time() self.last = t elapsed = t-self.start if verbose: m, s = divmod(elapsed, 60) h, m = divmod(m, 60) print("TOC: Elapsed: %d:%02d:%0d.%0*d" % (h, m, s, digits, (s % 1)*(10**digits))) return elapsed def loop_timer(self, n, function, args=None, verbose=True, digits=2, best_of=3): """ Return and print the total and average time elapsed for n runs of function. Parameters ---------- n : scalar(int) Number of runs. function : function Function to be timed. args : list, optional(default=None) Arguments of the function. verbose : bool, optional(default=True) If True, then prints average time. digits : scalar(int), optional(default=2) Number of digits printed for time elapsed. best_of : scalar(int), optional(default=3) Average time over best_of runs. Returns ------- average_time : scalar(float) Average time elapsed for n runs of function. average_of_best : scalar(float) Average of best_of times for n runs of function. """ tic() all_times = np.empty(n) for run in range(n): if hasattr(args, '__iter__'): function(*args) elif args is None: function() else: function(args) all_times[run] = tac(verbose=False, digits=digits) elapsed = toc(verbose=False, digits=digits) m, s = divmod(elapsed, 60) h, m = divmod(m, 60) print("Total run time: %d:%02d:%0d.%0*d" % (h, m, s, digits, (s % 1)*(10**digits))) average_time = all_times.mean() average_of_best = np.sort(all_times)[:best_of].mean() if verbose: m, s = divmod(average_time, 60) h, m = divmod(m, 60) print("Average time for %d runs: %d:%02d:%0d.%0*d" % (n, h, m, s, digits, (s % 1)*(10**digits))) m, s = divmod(average_of_best, 60) h, m = divmod(m, 60) print("Average of %d best times: %d:%02d:%0d.%0*d" % (best_of, h, m, s, digits, (s % 1)*(10**digits))) return average_time, average_of_best __timer__ = __Timer__() def tic(): return __timer__.tic() def tac(verbose=True, digits=2): return __timer__.tac(verbose, digits) def toc(verbose=True, digits=2): return __timer__.toc(verbose, digits) def loop_timer(n, function, args=None, verbose=True, digits=2, best_of=3): return __timer__.loop_timer(n, function, args, verbose, digits, best_of) # Set docstring _names = ['tic', 'tac', 'toc', 'loop_timer'] _funcs = [eval(name) for name in _names] _methods = [getattr(__Timer__, name) for name in _names] for _func, _method in zip(_funcs, _methods): _func.__doc__ = _method.__doc__
oyamad/QuantEcon.py
quantecon/util/timing.py
Python
bsd-3-clause
5,239
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/bind.h" #include "base/memory/scoped_ptr.h" #include "content/browser/geolocation/fake_access_token_store.h" #include "content/browser/geolocation/location_arbitrator_impl.h" #include "content/browser/geolocation/mock_location_provider.h" #include "content/public/common/geoposition.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" using ::testing::NiceMock; namespace content { class MockLocationObserver { public: // Need a vtable for GMock. virtual ~MockLocationObserver() {} void InvalidateLastPosition() { last_position_.latitude = 100; last_position_.error_code = Geoposition::ERROR_CODE_NONE; ASSERT_FALSE(last_position_.Validate()); } // Delegate void OnLocationUpdate(const Geoposition& position) { last_position_ = position; } Geoposition last_position_; }; double g_fake_time_now_secs = 1; base::Time GetTimeNowForTest() { return base::Time::FromDoubleT(g_fake_time_now_secs); } void AdvanceTimeNow(const base::TimeDelta& delta) { g_fake_time_now_secs += delta.InSecondsF(); } void SetPositionFix(MockLocationProvider* provider, double latitude, double longitude, double accuracy) { Geoposition position; position.error_code = Geoposition::ERROR_CODE_NONE; position.latitude = latitude; position.longitude = longitude; position.accuracy = accuracy; position.timestamp = GetTimeNowForTest(); ASSERT_TRUE(position.Validate()); provider->HandlePositionChanged(position); } void SetReferencePosition(MockLocationProvider* provider) { SetPositionFix(provider, 51.0, -0.1, 400); } namespace { class TestingLocationArbitrator : public LocationArbitratorImpl { public: TestingLocationArbitrator( const LocationArbitratorImpl::LocationUpdateCallback& callback, AccessTokenStore* access_token_store) : LocationArbitratorImpl(callback), cell_(NULL), gps_(NULL), access_token_store_(access_token_store) { } virtual base::Time GetTimeNow() const OVERRIDE { return GetTimeNowForTest(); } virtual AccessTokenStore* NewAccessTokenStore() OVERRIDE { return access_token_store_.get(); } virtual LocationProvider* NewNetworkLocationProvider( AccessTokenStore* access_token_store, net::URLRequestContextGetter* context, const GURL& url, const string16& access_token) OVERRIDE { return new MockLocationProvider(&cell_); } virtual LocationProvider* NewSystemLocationProvider() OVERRIDE { return new MockLocationProvider(&gps_); } // Two location providers, with nice short names to make the tests more // readable. Note |gps_| will only be set when there is a high accuracy // observer registered (and |cell_| when there's at least one observer of any // type). MockLocationProvider* cell_; MockLocationProvider* gps_; scoped_refptr<AccessTokenStore> access_token_store_; }; } // namespace class GeolocationLocationArbitratorTest : public testing::Test { protected: // testing::Test virtual void SetUp() { access_token_store_ = new NiceMock<FakeAccessTokenStore>; observer_.reset(new MockLocationObserver); LocationArbitratorImpl::LocationUpdateCallback callback = base::Bind(&MockLocationObserver::OnLocationUpdate, base::Unretained(observer_.get())); arbitrator_.reset(new TestingLocationArbitrator( callback, access_token_store_.get())); } // testing::Test virtual void TearDown() { } void CheckLastPositionInfo(double latitude, double longitude, double accuracy) { Geoposition geoposition = observer_->last_position_; EXPECT_TRUE(geoposition.Validate()); EXPECT_DOUBLE_EQ(latitude, geoposition.latitude); EXPECT_DOUBLE_EQ(longitude, geoposition.longitude); EXPECT_DOUBLE_EQ(accuracy, geoposition.accuracy); } base::TimeDelta SwitchOnFreshnessCliff() { // Add 1, to ensure it meets any greater-than test. return base::TimeDelta::FromMilliseconds( LocationArbitratorImpl::kFixStaleTimeoutMilliseconds + 1); } MockLocationProvider* cell() { return arbitrator_->cell_; } MockLocationProvider* gps() { return arbitrator_->gps_; } scoped_refptr<FakeAccessTokenStore> access_token_store_; scoped_ptr<MockLocationObserver> observer_; scoped_ptr<TestingLocationArbitrator> arbitrator_; base::MessageLoop loop_; }; TEST_F(GeolocationLocationArbitratorTest, CreateDestroy) { EXPECT_TRUE(access_token_store_.get()); EXPECT_TRUE(arbitrator_ != NULL); arbitrator_.reset(); SUCCEED(); } TEST_F(GeolocationLocationArbitratorTest, OnPermissionGranted) { EXPECT_FALSE(arbitrator_->HasPermissionBeenGranted()); arbitrator_->OnPermissionGranted(); EXPECT_TRUE(arbitrator_->HasPermissionBeenGranted()); // Can't check the provider has been notified without going through the // motions to create the provider (see next test). EXPECT_FALSE(cell()); EXPECT_FALSE(gps()); } TEST_F(GeolocationLocationArbitratorTest, NormalUsage) { ASSERT_TRUE(access_token_store_.get()); ASSERT_TRUE(arbitrator_ != NULL); EXPECT_FALSE(cell()); EXPECT_FALSE(gps()); arbitrator_->StartProviders(false); EXPECT_TRUE(access_token_store_->access_token_set_.empty()); EXPECT_TRUE(access_token_store_->access_token_set_.empty()); access_token_store_->NotifyDelegateTokensLoaded(); ASSERT_TRUE(cell()); EXPECT_TRUE(gps()); EXPECT_EQ(MockLocationProvider::LOW_ACCURACY, cell()->state_); EXPECT_EQ(MockLocationProvider::LOW_ACCURACY, gps()->state_); EXPECT_FALSE(observer_->last_position_.Validate()); EXPECT_EQ(Geoposition::ERROR_CODE_NONE, observer_->last_position_.error_code); SetReferencePosition(cell()); EXPECT_TRUE(observer_->last_position_.Validate() || observer_->last_position_.error_code != Geoposition::ERROR_CODE_NONE); EXPECT_EQ(cell()->position_.latitude, observer_->last_position_.latitude); EXPECT_FALSE(cell()->is_permission_granted_); EXPECT_FALSE(arbitrator_->HasPermissionBeenGranted()); arbitrator_->OnPermissionGranted(); EXPECT_TRUE(arbitrator_->HasPermissionBeenGranted()); EXPECT_TRUE(cell()->is_permission_granted_); } TEST_F(GeolocationLocationArbitratorTest, SetObserverOptions) { arbitrator_->StartProviders(false); access_token_store_->NotifyDelegateTokensLoaded(); ASSERT_TRUE(cell()); ASSERT_TRUE(gps()); EXPECT_EQ(MockLocationProvider::LOW_ACCURACY, cell()->state_); EXPECT_EQ(MockLocationProvider::LOW_ACCURACY, gps()->state_); SetReferencePosition(cell()); EXPECT_EQ(MockLocationProvider::LOW_ACCURACY, cell()->state_); EXPECT_EQ(MockLocationProvider::LOW_ACCURACY, gps()->state_); arbitrator_->StartProviders(true); EXPECT_EQ(MockLocationProvider::HIGH_ACCURACY, cell()->state_); EXPECT_EQ(MockLocationProvider::HIGH_ACCURACY, gps()->state_); } TEST_F(GeolocationLocationArbitratorTest, Arbitration) { arbitrator_->StartProviders(false); access_token_store_->NotifyDelegateTokensLoaded(); ASSERT_TRUE(cell()); ASSERT_TRUE(gps()); SetPositionFix(cell(), 1, 2, 150); // First position available EXPECT_TRUE(observer_->last_position_.Validate()); CheckLastPositionInfo(1, 2, 150); SetPositionFix(gps(), 3, 4, 50); // More accurate fix available CheckLastPositionInfo(3, 4, 50); SetPositionFix(cell(), 5, 6, 150); // New fix is available but it's less accurate, older fix should be kept. CheckLastPositionInfo(3, 4, 50); // Advance time, and notify once again AdvanceTimeNow(SwitchOnFreshnessCliff()); cell()->HandlePositionChanged(cell()->position_); // New fix is available, less accurate but fresher CheckLastPositionInfo(5, 6, 150); // Advance time, and set a low accuracy position AdvanceTimeNow(SwitchOnFreshnessCliff()); SetPositionFix(cell(), 5.676731, 139.629385, 1000); CheckLastPositionInfo(5.676731, 139.629385, 1000); // 15 secs later, step outside. Switches to gps signal. AdvanceTimeNow(base::TimeDelta::FromSeconds(15)); SetPositionFix(gps(), 3.5676457, 139.629198, 50); CheckLastPositionInfo(3.5676457, 139.629198, 50); // 5 mins later switch cells while walking. Stay on gps. AdvanceTimeNow(base::TimeDelta::FromMinutes(5)); SetPositionFix(cell(), 3.567832, 139.634648, 300); SetPositionFix(gps(), 3.5677675, 139.632314, 50); CheckLastPositionInfo(3.5677675, 139.632314, 50); // Ride train and gps signal degrades slightly. Stay on fresher gps AdvanceTimeNow(base::TimeDelta::FromMinutes(5)); SetPositionFix(gps(), 3.5679026, 139.634777, 300); CheckLastPositionInfo(3.5679026, 139.634777, 300); // 14 minutes later AdvanceTimeNow(base::TimeDelta::FromMinutes(14)); // GPS reading misses a beat, but don't switch to cell yet to avoid // oscillating. SetPositionFix(gps(), 3.5659005, 139.682579, 300); AdvanceTimeNow(base::TimeDelta::FromSeconds(7)); SetPositionFix(cell(), 3.5689579, 139.691420, 1000); CheckLastPositionInfo(3.5659005, 139.682579, 300); // 1 minute later AdvanceTimeNow(base::TimeDelta::FromMinutes(1)); // Enter tunnel. Stay on fresher gps for a moment. SetPositionFix(cell(), 3.5657078, 139.68922, 300); SetPositionFix(gps(), 3.5657104, 139.690341, 300); CheckLastPositionInfo(3.5657104, 139.690341, 300); // 2 minutes later AdvanceTimeNow(base::TimeDelta::FromMinutes(2)); // Arrive in station. Cell moves but GPS is stale. Switch to fresher cell. SetPositionFix(cell(), 3.5658700, 139.069979, 1000); CheckLastPositionInfo(3.5658700, 139.069979, 1000); } TEST_F(GeolocationLocationArbitratorTest, TwoOneShotsIsNewPositionBetter) { arbitrator_->StartProviders(false); access_token_store_->NotifyDelegateTokensLoaded(); ASSERT_TRUE(cell()); ASSERT_TRUE(gps()); // Set the initial position. SetPositionFix(cell(), 3, 139, 100); CheckLastPositionInfo(3, 139, 100); // Restart providers to simulate a one-shot request. arbitrator_->StopProviders(); // To test 240956, perform a throwaway alloc. // This convinces the allocator to put the providers in a new memory location. MockLocationProvider* fakeMockProvider = NULL; LocationProvider* fakeProvider = new MockLocationProvider(&fakeMockProvider); arbitrator_->StartProviders(false); access_token_store_->NotifyDelegateTokensLoaded(); // Advance the time a short while to simulate successive calls. AdvanceTimeNow(base::TimeDelta::FromMilliseconds(5)); // Update with a less accurate position to verify 240956. SetPositionFix(cell(), 3, 139, 150); CheckLastPositionInfo(3, 139, 150); // No delete required for fakeMockProvider. It points to fakeProvider. delete fakeProvider; } } // namespace content
cvsuser-chromium/chromium
content/browser/geolocation/location_arbitrator_impl_unittest.cc
C++
bsd-3-clause
10,985
<?php /** * Message translations. * * This file is automatically generated by 'yii message' command. * It contains the localizable messages extracted from source code. * You may modify this file by translating the extracted messages. * * Each array element represents the translation (value) of a message (key). * If the value is empty, the message is considered as not translated. * Messages that no longer need translation will have their translations * enclosed between a pair of '@@' marks. * * Message string can be used with plural forms format. Check i18n section * of the guide for details. * * NOTE: this file must be saved in UTF-8 encoding. */ return [ 'Assignments have been updated' => 'Les affectations ont été mises à jour', 'Auth item with such name already exists' => 'L\'objet de Auth avec un nom identique existe déjà', 'Class "{0}" does not exist' => 'La classe "{0}" n\'existe pas', 'Classname of the rule associated with this item' => 'Le nom de la classe de la règle associée à cet objet', 'Create' => 'Créer', 'Create new permission' => 'Créer nouvelle permission', 'Create new role' => 'Créer nouveau rôle', 'Description' => 'Description', 'Invalid value' => 'Valeur invalide', 'Item has been created' => 'Objet a été crée', 'Item has been updated' => 'Objet a été mis à jour', 'Name' => 'Nom', 'New permission' => 'Nouveau autorisation', 'New role' => 'Nouveau rôle', 'New user' => 'Nouvel utilisateur', 'Permissions' => 'Permissions', 'Roles' => 'Rôles', 'Rule class can not be instantiated' => 'La classe de règle ne peut pas être instanciée', 'Rule class must extend "yii\rbac\Rule"' => 'La classe de règle doit étendre "yii\rbac\Rule"', 'Rule name' => 'Nom de la règle', 'Save' => 'Sauvegarder', 'The item description (Optional).' => 'La description de l\'objet (Facultatif)', 'The name of the item.' => 'Le nom de l\'objet.', 'There is neither role nor permission with name "{0}"' => 'Il n\'y a ni rôle, ni l\'autorisation avec le nom "{0}"', 'Update assignments' => 'Modifier affectations', 'Update permission' => 'Modifier permission', 'Update role' => 'Modifier rôle', 'Users' => 'Utlisateurs', ];
diginmanager/digin
vendor/dektrium/yii2-rbac/messages/fr/rbac.php
PHP
bsd-3-clause
2,291
#import <UIKit/UIKit.h> #import "NTLNCacheCleaner.h" @class NTLNBrowserViewController; @class NTLNFriendsViewController; @class NTLNMentionsViewController; @class NTLNSentsViewController; @class NTLNUnreadsViewController; @class NTLNSettingViewController; @class NTLNFavoriteViewController; @class NTLNDirectMessageViewController; @interface NTLNAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate, NTLNCacheCleanerDelegate> { UIWindow *window; UITabBarController *tabBarController; NTLNFriendsViewController *friendsViewController; NTLNMentionsViewController *replysViewController; NTLNSentsViewController *sentsViewController; NTLNUnreadsViewController *unreadsViewController; NTLNSettingViewController *settingViewController; NTLNFavoriteViewController *favoriteViewController; NTLNDirectMessageViewController *directMessageViewController; BOOL applicationActive; } @property (nonatomic, retain) UIWindow *window; @property (nonatomic, retain) UITabBarController *tabBarController; @property (readonly) BOOL applicationActive; - (BOOL)isInMoreTab:(UIViewController*)vc; - (void)presentTwitterAccountSettingView; - (void)resetAllTimelinesAndCache; @end
qskycolor/ntlniph
NatsuLion/app/NTLNAppDelegate.h
C
bsd-3-clause
1,201
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tests that a set of symbols are truly pruned from the translator. Compares the pruned down "on-device" translator with the "fat" host build which has not been pruned down. """ import glob import re import subprocess import sys import unittest class SymbolInfo(object): def __init__(self, lib_name, sym_name, t, size): self.lib_name = lib_name self.sym_name = sym_name self.type = t self.size = size def is_weak(t): t = t.upper() return t == 'V' or t == 'W' def is_local(t): # According to the NM documentation: # "If lowercase, the symbol is usually local... There are however a few # lowercase symbols that are shown for special global symbols # ("u", "v" and "w")." return t != 'u' and not is_weak(t) and t.islower() def merge_symbols(sdict1, sdict2): for sym_name, v2 in sdict2.iteritems(): # Check for duplicate symbols. if sym_name in sdict1: v1 = sdict1[sym_name] # Only print warning if they are not weak / differently sized. if (not (is_weak(v2.type) or is_weak(v1.type)) and v1.size != v2.size): print 'Warning symbol %s defined in both %s(%d, %s) and %s(%d, %s)' % ( sym_name, v1.lib_name, v1.size, v1.type, v2.lib_name, v2.size, v2.type) # Arbitrarily take the max. The sizes are approximate anyway, # since the host binaries are built from a different compiler. v1.size = max(v1.size, v2.size) continue # Otherwise just copy info over to sdict2. sdict1[sym_name] = sdict2[sym_name] return sdict1 class TestTranslatorPruned(unittest.TestCase): pruned_symbols = {} unpruned_symbols = {} @classmethod def get_symbol_info(cls, nm_tool, bin_name): results = {} nm_cmd = [nm_tool, '--size-sort', '--demangle', bin_name] print 'Getting symbols and sizes by running:\n' + ' '.join(nm_cmd) for line in iter(subprocess.check_output(nm_cmd).splitlines()): (hex_size, t, sym_name) = line.split(' ', 2) # Only track defined and non-BSS symbols. if t != 'U' and t.upper() != 'B': info = SymbolInfo(bin_name, sym_name, t, int(hex_size, 16)) # For local symbols, tack the library name on as a prefix. # That should still match the regexes later. if is_local(t): key = bin_name + '$' + sym_name else: key = sym_name # The same library can have the same local symbol. Just sum up sizes. if key in results: old = results[key] old.size = old.size + info.size else: results[key] = info return results @classmethod def setUpClass(cls): nm_tool = sys.argv[1] host_binaries = glob.glob(sys.argv[2]) target_binary = sys.argv[3] print 'Getting symbol info from %s (host) and %s (target)' % ( sys.argv[2], sys.argv[3]) assert host_binaries, ('Did not glob any binaries from: ' % sys.argv[2]) for b in host_binaries: cls.unpruned_symbols = merge_symbols(cls.unpruned_symbols, cls.get_symbol_info(nm_tool, b)) cls.pruned_symbols = cls.get_symbol_info(nm_tool, target_binary) # Do an early check that these aren't stripped binaries. assert cls.unpruned_symbols, 'No symbols from host?' assert cls.pruned_symbols, 'No symbols from target?' def size_of_matching_syms(self, sym_regex, sym_infos): # Check if a given sym_infos has symbols matching sym_regex, and # return the total size of all matching symbols. total = 0 for sym_name, sym_info in sym_infos.iteritems(): if re.search(sym_regex, sym_info.sym_name): total += sym_info.size return total def test_prunedNotFullyStripped(self): """Make sure that the test isn't accidentally passing. The test can accidentally pass if the translator is stripped of symbols. Then it would look like everything is pruned out. Look for a symbol that's guaranteed not to be pruned out. """ pruned = self.size_of_matching_syms('stream_init.*NaClSrpc', TestTranslatorPruned.pruned_symbols) self.assertNotEqual(pruned, 0) def test_didPrune(self): """Check for classes/namespaces/symbols that we have intentionally pruned. Check that the symbols are not present anymore in the translator, and check that the symbols actually do exist in the developer tools. That prevents the test from accidentally passing if the symbols have been renamed to something else. """ total = 0 pruned_list = [ 'LLParser', 'LLLexer', 'MCAsmParser', '::AsmParser', 'ARMAsmParser', 'X86AsmParser', 'ELFAsmParser', 'COFFAsmParser', 'DarwinAsmParser', 'MCAsmLexer', '::AsmLexer', # Gigantic Asm MatchTable (globbed for all targets), 'MatchTable', 'PBQP', # Can only check *InstPrinter::print*, not *::getRegisterName(): # https://code.google.com/p/nativeclient/issues/detail?id=3326 'ARMInstPrinter::print', 'X86.*InstPrinter::print', # Currently pruned by hacking Triple.h. That covers most things, # but not all. E.g., container-specific relocation handling. '.*MachObjectWriter', 'TargetLoweringObjectFileMachO', 'MCMachOStreamer', '.*MCAsmInfoDarwin', '.*COFFObjectWriter', 'TargetLoweringObjectFileCOFF', '.*COFFStreamer', '.*AsmInfoGNUCOFF', # This is not pruned out: 'MCSectionMachO', 'MCSectionCOFF', # 'MachineModuleInfoMachO', ... ] for sym_regex in pruned_list: unpruned = self.size_of_matching_syms( sym_regex, TestTranslatorPruned.unpruned_symbols) pruned = self.size_of_matching_syms( sym_regex, TestTranslatorPruned.pruned_symbols) self.assertNotEqual(unpruned, 0, 'Unpruned never had ' + sym_regex) self.assertEqual(pruned, 0, 'Pruned still has ' + sym_regex) # Bytes pruned is approximate since the host build is different # from the target build (different inlining / optimizations). print 'Pruned out approx %d bytes worth of %s symbols' % (unpruned, sym_regex) total += unpruned print 'Total %d bytes' % total if __name__ == '__main__': if len(sys.argv) != 4: print 'Usage: %s <nm_tool> <unpruned_host_binary> <pruned_target_binary>' sys.exit(1) suite = unittest.TestLoader().loadTestsFromTestCase(TestTranslatorPruned) result = unittest.TextTestRunner(verbosity=2).run(suite) if result.wasSuccessful(): sys.exit(0) else: sys.exit(1)
CTSRD-SOAAP/chromium-42.0.2311.135
native_client/pnacl/prune_test.py
Python
bsd-3-clause
6,842
package org.basex.query.func; import static org.basex.query.QueryError.*; import static org.basex.query.QueryText.*; import static org.basex.util.Token.*; import org.basex.query.*; import org.basex.query.ann.*; import org.basex.query.expr.*; import org.basex.query.expr.Expr.Flag; import org.basex.query.util.list.*; import org.basex.query.value.item.*; import org.basex.query.value.type.*; import org.basex.query.value.type.SeqType.Occ; import org.basex.query.var.*; import org.basex.util.*; import org.basex.util.hash.*; import org.basex.util.similarity.*; /** * This class provides access to built-in and user-defined functions. * * @author BaseX Team 2005-16, BSD License * @author Christian Gruen */ public final class Functions extends TokenSet { /** Singleton instance. */ private static final Functions INSTANCE = new Functions(); /** Function classes. */ private Function[] funcs = new Function[Array.CAPACITY]; /** * Returns the singleton instance. * @return instance */ public static Functions get() { return INSTANCE; } /** * Constructor, registering built-in XQuery functions. */ private Functions() { for(final Function sig : Function.VALUES) { final String desc = sig.desc; final byte[] ln = token(desc.substring(0, desc.indexOf('('))); final int i = put(new QNm(ln, sig.uri()).id()); if(funcs[i] != null) throw Util.notExpected("Function defined twice: " + sig); funcs[i] = sig; } } /** * Tries to resolve the specified function with xs namespace as a cast. * @param arity number of arguments * @param name function name * @param ii input info * @return cast type if found, {@code null} otherwise * @throws QueryException query exception */ private static Type getCast(final QNm name, final long arity, final InputInfo ii) throws QueryException { final byte[] ln = name.local(); Type type = ListType.find(name); if(type == null) type = AtomType.find(name, false); // no constructor function found, or abstract type specified if(type != null && type != AtomType.NOT && type != AtomType.AAT) { if(arity == 1) return type; throw FUNCTYPES_X_X_X_X.get(ii, name.string(), arity, "s", 1); } // include similar function name in error message final Levenshtein ls = new Levenshtein(); for(final AtomType t : AtomType.VALUES) { if(t.parent == null) continue; final byte[] u = t.name.uri(); if(eq(u, XS_URI) && t != AtomType.NOT && t != AtomType.AAT && ls.similar( lc(ln), lc(t.string()))) throw FUNCSIMILAR_X_X.get(ii, name.prefixId(), t.string()); } // no similar name: constructor function found, or abstract type specified throw WHICHFUNC_X.get(ii, name.prefixId()); } /** * Tries to resolve the specified function as a built-in one. * @param name function name * @param arity number of arguments * @param ii input info * @return function spec if found, {@code null} otherwise * @throws QueryException query exception */ private Function getBuiltIn(final QNm name, final long arity, final InputInfo ii) throws QueryException { final int id = id(name.id()); if(id == 0) return null; final Function fl = funcs[id]; if(!eq(fl.uri(), name.uri())) return null; // check number of arguments if(arity >= fl.minMax[0] && arity <= fl.minMax[1]) return fl; throw FUNCARGNUM_X_X_X.get(ii, fl, arity, arity == 1 ? "" : "s"); } /** * Returns the specified function. * @param name function qname * @param args optional arguments * @param sc static context * @param ii input info * @return function instance * @throws QueryException query exception */ public StandardFunc get(final QNm name, final Expr[] args, final StaticContext sc, final InputInfo ii) throws QueryException { final Function fl = getBuiltIn(name, args.length, ii); return fl == null ? null : fl.get(sc, ii, args); } /** * Creates either a {@link FuncItem} or a {@link Closure} depending on when the method is called. * At parse and compile time a closure is generated to enable inlining and compilation, at * runtime we directly generate a function item. * @param anns function annotations * @param name function name, may be {@code null} * @param params formal parameters * @param ft function type * @param expr function body * @param scp variable scope * @param sc static context * @param ii input info * @param runtime run-time flag * @param updating flag for updating functions * @return the function expression */ private static Expr closureOrFItem(final AnnList anns, final QNm name, final Var[] params, final FuncType ft, final Expr expr, final VarScope scp, final StaticContext sc, final InputInfo ii, final boolean runtime, final boolean updating) { return runtime ? new FuncItem(sc, anns, name, params, ft, expr, scp.stackSize()) : new Closure(ii, name, updating ? null : ft.type, params, expr, anns, null, sc, scp); } /** * Gets a function literal for a known function. * @param name function name * @param arity number of arguments * @param qc query context * @param sc static context * @param ii input info * @param runtime {@code true} if this method is called at run-time, {@code false} otherwise * @return function literal if found, {@code null} otherwise * @throws QueryException query exception */ public static Expr getLiteral(final QNm name, final int arity, final QueryContext qc, final StaticContext sc, final InputInfo ii, final boolean runtime) throws QueryException { // parse type constructors if(eq(name.uri(), XS_URI)) { final Type type = getCast(name, arity, ii); final VarScope scp = new VarScope(sc); final Var[] args = { scp.newLocal(qc, new QNm(ITEMM, ""), SeqType.AAT_ZO, true) }; final Expr e = new Cast(sc, ii, new VarRef(ii, args[0]), type.seqType()); final AnnList anns = new AnnList(); final FuncType ft = FuncType.get(anns, e.seqType(), args); return closureOrFItem(anns, name, args, ft, e, scp, sc, ii, runtime, false); } // built-in functions final Function fn = get().getBuiltIn(name, arity, ii); if(fn != null) { final AnnList anns = new AnnList(); final VarScope scp = new VarScope(sc); final FuncType ft = fn.type(arity, anns); final QNm[] argNames = fn.argNames(arity); final Var[] args = new Var[arity]; final Expr[] calls = new Expr[arity]; for(int i = 0; i < arity; i++) { args[i] = scp.newLocal(qc, argNames[i], ft.argTypes[i], true); calls[i] = new VarRef(ii, args[i]); } final StandardFunc sf = fn.get(sc, ii, calls); final boolean upd = sf.has(Flag.UPD); if(upd) { anns.add(new Ann(ii, Annotation.UPDATING)); qc.updating(); } return sf.has(Flag.CTX) || sf.has(Flag.POS) ? new FuncLit(anns, name, args, sf, ft, scp, sc, ii) : closureOrFItem(anns, name, args, fn.type(arity, anns), sf, scp, sc, ii, runtime, upd); } // user-defined function final StaticFunc sf = qc.funcs.get(name, arity, ii, false); if(sf != null) { final FuncType ft = sf.funcType(); final VarScope scp = new VarScope(sc); final Var[] args = new Var[arity]; final Expr[] calls = new Expr[arity]; for(int a = 0; a < arity; a++) { args[a] = scp.newLocal(qc, sf.argName(a), ft.argTypes[a], true); calls[a] = new VarRef(ii, args[a]); } final boolean upd = sf.updating; final TypedFunc tf = qc.funcs.getFuncRef(sf.name, calls, sc, ii); final Expr f = closureOrFItem(tf.anns, sf.name, args, ft, tf.fun, scp, sc, ii, runtime, upd); if(upd) qc.updating(); return f; } // Java function final VarScope scp = new VarScope(sc); final FuncType jt = FuncType.arity(arity); final Var[] vs = new Var[arity]; final Expr[] args = new Expr[vs.length]; final int vl = vs.length; for(int v = 0; v < vl; v++) { vs[v] = scp.newLocal(qc, new QNm(ARG + (v + 1), ""), SeqType.ITEM_ZM, true); args[v] = new VarRef(ii, vs[v]); } final Expr jf = JavaFunction.get(name, args, qc, sc, ii); return jf == null ? null : new FuncLit(new AnnList(), name, vs, jf, jt, scp, sc, ii); } /** * Returns a function item for a user-defined function. * @param sf static function * @param qc query context * @param sc static context * @param info input info * @return resulting value * @throws QueryException query exception */ public static FuncItem getUser(final StaticFunc sf, final QueryContext qc, final StaticContext sc, final InputInfo info) throws QueryException { final FuncType ft = sf.funcType(); final VarScope scp = new VarScope(sc); final int arity = sf.args.length; final Var[] args = new Var[arity]; final int al = args.length; final Expr[] calls = new Expr[al]; for(int a = 0; a < al; a++) { args[a] = scp.newLocal(qc, sf.argName(a), ft.argTypes[a], true); calls[a] = new VarRef(info, args[a]); } final TypedFunc tf = qc.funcs.getFuncRef(sf.name, calls, sc, info); return new FuncItem(sc, tf.anns, sf.name, args, ft, tf.fun, scp.stackSize()); } /** * Returns a function with the specified name and number of arguments. * @param name name of the function * @param args optional arguments * @param qc query context * @param sc static context * @param ii input info * @return function instance, or {@code null} * @throws QueryException query exception */ public static TypedFunc get(final QNm name, final Expr[] args, final QueryContext qc, final StaticContext sc, final InputInfo ii) throws QueryException { // get namespace and local name // parse type constructors if(eq(name.uri(), XS_URI)) { final Type type = getCast(name, args.length, ii); final SeqType to = SeqType.get(type, Occ.ZERO_ONE); return TypedFunc.constr(new Cast(sc, ii, args[0], to)); } // built-in functions final StandardFunc fun = get().get(name, args, sc, ii); if(fun != null) { final AnnList anns = new AnnList(); if(fun.sig.has(Flag.UPD)) { anns.add(new Ann(ii, Annotation.UPDATING)); qc.updating(); } return new TypedFunc(fun, anns); } // user-defined function final TypedFunc tf = qc.funcs.getRef(name, args, sc, ii); if(tf != null) { if(tf.anns.contains(Annotation.UPDATING)) qc.updating(); return tf; } // Java function final JavaFunction jf = JavaFunction.get(name, args, qc, sc, ii); if(jf != null) return TypedFunc.java(jf); // add user-defined function that has not been declared yet if(FuncType.find(name) == null) return qc.funcs.getFuncRef(name, args, sc, ii); // no function found return null; } /** * Returns an exception if the name of a built-in function is similar to the specified name. * @param name name of input function * @param ii input info * @return query exception or {@code null} */ QueryException similarError(final QNm name, final InputInfo ii) { // find similar function in three runs final byte[] local = name.local(), uri = name.uri(); final Levenshtein ls = new Levenshtein(); for(int mode = 0; mode < 3; mode++) { for(final byte[] key : this) { final int i = indexOf(key, '}'); final byte[] slocal = substring(key, i + 1), suri = substring(key, 2, i); if(mode == 0 ? // find functions with identical URIs and similar local names eq(uri, suri) && ls.similar(local, slocal) : mode == 1 ? // find functions with identical local names eq(local, substring(key, i + 1)) : // find functions with identical URIs and local names that start with the specified name eq(uri, substring(key, 2, i)) && startsWith(substring(key, i + 1), local)) { final QNm sim = new QNm(slocal, suri); return FUNCSIMILAR_X_X.get(ii, name.prefixId(), sim.prefixId()); } } } return null; } @Override protected void rehash(final int s) { super.rehash(s); funcs = Array.copy(funcs, new Function[s]); } }
drmacro/basex
basex-core/src/main/java/org/basex/query/func/Functions.java
Java
bsd-3-clause
12,393
package com.fsck.k9.message; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import android.app.Activity; import android.app.PendingIntent; import android.content.Intent; import android.os.Bundle; import com.fsck.k9.Account.QuoteStyle; import com.fsck.k9.Identity; import com.fsck.k9.activity.compose.ComposeCryptoStatus; import com.fsck.k9.activity.compose.ComposeCryptoStatus.ComposeCryptoStatusBuilder; import com.fsck.k9.activity.compose.RecipientPresenter.CryptoMode; import com.fsck.k9.activity.compose.RecipientPresenter.CryptoProviderState; import com.fsck.k9.activity.misc.Attachment; import com.fsck.k9.mail.Address; import com.fsck.k9.mail.BodyPart; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.internet.BinaryTempFileBody; import com.fsck.k9.mail.internet.MimeMessage; import com.fsck.k9.mail.internet.MimeMultipart; import com.fsck.k9.mail.internet.MimeUtility; import com.fsck.k9.mail.internet.TextBody; import com.fsck.k9.message.MessageBuilder.Callback; import com.fsck.k9.view.RecipientSelectView.Recipient; import org.apache.commons.io.IOUtils; import org.apache.james.mime4j.util.MimeUtil; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.openintents.openpgp.util.OpenPgpApi; import org.openintents.openpgp.util.OpenPgpApi.OpenPgpDataSource; import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.eq; import static org.mockito.Matchers.same; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; @RunWith(RobolectricTestRunner.class) @Config(manifest = "src/main/AndroidManifest.xml", sdk = 21) public class PgpMessageBuilderTest { public static final long TEST_SIGN_KEY_ID = 123L; public static final long TEST_SELF_ENCRYPT_KEY_ID = 234L; public static final String TEST_MESSAGE_TEXT = "message text with a ☭ CCCP symbol"; private ComposeCryptoStatusBuilder cryptoStatusBuilder = createDefaultComposeCryptoStatusBuilder(); private OpenPgpApi openPgpApi = mock(OpenPgpApi.class); private PgpMessageBuilder pgpMessageBuilder = createDefaultPgpMessageBuilder(openPgpApi); @Test(expected = AssertionError.class) public void build__withDisabledCrypto__shouldError() throws MessagingException { pgpMessageBuilder.setCryptoStatus(cryptoStatusBuilder.setCryptoMode(CryptoMode.DISABLE).build()); pgpMessageBuilder.buildAsync(mock(Callback.class)); } @Test public void build__withCryptoProviderNotOk__shouldThrow() throws MessagingException { cryptoStatusBuilder.setCryptoMode(CryptoMode.SIGN_ONLY); CryptoProviderState[] cryptoProviderStates = { CryptoProviderState.LOST_CONNECTION, CryptoProviderState.UNCONFIGURED, CryptoProviderState.UNINITIALIZED, CryptoProviderState.ERROR }; for (CryptoProviderState state : cryptoProviderStates) { cryptoStatusBuilder.setCryptoProviderState(state); pgpMessageBuilder.setCryptoStatus(cryptoStatusBuilder.build()); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); verify(mockCallback).onMessageBuildException(any(MessagingException.class)); verifyNoMoreInteractions(mockCallback); } } @Test public void buildSign__withNoDetachedSignatureInResult__shouldThrow() throws MessagingException { cryptoStatusBuilder.setCryptoMode(CryptoMode.SIGN_ONLY); pgpMessageBuilder.setCryptoStatus(cryptoStatusBuilder.build()); Intent returnIntent = new Intent(); returnIntent.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); when(openPgpApi.executeApi(any(Intent.class), any(OpenPgpDataSource.class), any(OutputStream.class))) .thenReturn(returnIntent); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); verify(mockCallback).onMessageBuildException(any(MessagingException.class)); verifyNoMoreInteractions(mockCallback); } @Test public void buildSign__withDetachedSignatureInResult__shouldSucceed() throws MessagingException { cryptoStatusBuilder.setCryptoMode(CryptoMode.SIGN_ONLY); pgpMessageBuilder.setCryptoStatus(cryptoStatusBuilder.build()); ArgumentCaptor<Intent> capturedApiIntent = ArgumentCaptor.forClass(Intent.class); Intent returnIntent = new Intent(); returnIntent.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); returnIntent.putExtra(OpenPgpApi.RESULT_DETACHED_SIGNATURE, new byte[] { 1, 2, 3 }); when(openPgpApi.executeApi(capturedApiIntent.capture(), any(OpenPgpDataSource.class), any(OutputStream.class))) .thenReturn(returnIntent); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); Intent expectedIntent = new Intent(OpenPgpApi.ACTION_DETACHED_SIGN); expectedIntent.putExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, TEST_SIGN_KEY_ID); expectedIntent.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true); assertIntentEqualsActionAndExtras(expectedIntent, capturedApiIntent.getValue()); ArgumentCaptor<MimeMessage> captor = ArgumentCaptor.forClass(MimeMessage.class); verify(mockCallback).onMessageBuildSuccess(captor.capture(), eq(false)); verifyNoMoreInteractions(mockCallback); MimeMessage message = captor.getValue(); Assert.assertEquals("message must be multipart/signed", "multipart/signed", message.getMimeType()); MimeMultipart multipart = (MimeMultipart) message.getBody(); Assert.assertEquals("multipart/signed must consist of two parts", 2, multipart.getCount()); BodyPart contentBodyPart = multipart.getBodyPart(0); Assert.assertEquals("first part must have content type text/plain", "text/plain", MimeUtility.getHeaderParameter(contentBodyPart.getContentType(), null)); Assert.assertTrue("signed message body must be TextBody", contentBodyPart.getBody() instanceof TextBody); Assert.assertEquals(MimeUtil.ENC_QUOTED_PRINTABLE, ((TextBody) contentBodyPart.getBody()).getEncoding()); assertContentOfBodyPartEquals("content must match the message text", contentBodyPart, TEST_MESSAGE_TEXT); BodyPart signatureBodyPart = multipart.getBodyPart(1); Assert.assertEquals("second part must be pgp signature", "application/pgp-signature", signatureBodyPart.getContentType()); assertContentOfBodyPartEquals("content must match the supplied detached signature", signatureBodyPart, new byte[] { 1, 2, 3 }); } @Test public void buildSign__withUserInteractionResult__shouldReturnUserInteraction() throws MessagingException { cryptoStatusBuilder.setCryptoMode(CryptoMode.SIGN_ONLY); pgpMessageBuilder.setCryptoStatus(cryptoStatusBuilder.build()); Intent returnIntent = mock(Intent.class); when(returnIntent.getIntExtra(eq(OpenPgpApi.RESULT_CODE), anyInt())) .thenReturn(OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); final PendingIntent mockPendingIntent = mock(PendingIntent.class); when(returnIntent.getParcelableExtra(eq(OpenPgpApi.RESULT_INTENT))) .thenReturn(mockPendingIntent); when(openPgpApi.executeApi(any(Intent.class), any(OpenPgpDataSource.class), any(OutputStream.class))) .thenReturn(returnIntent); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); ArgumentCaptor<PendingIntent> captor = ArgumentCaptor.forClass(PendingIntent.class); verify(mockCallback).onMessageBuildReturnPendingIntent(captor.capture(), anyInt()); verifyNoMoreInteractions(mockCallback); PendingIntent pendingIntent = captor.getValue(); Assert.assertSame(pendingIntent, mockPendingIntent); } @Test public void buildSign__withReturnAfterUserInteraction__shouldSucceed() throws MessagingException { cryptoStatusBuilder.setCryptoMode(CryptoMode.SIGN_ONLY); pgpMessageBuilder.setCryptoStatus(cryptoStatusBuilder.build()); int returnedRequestCode; { Intent returnIntent = spy(new Intent()); returnIntent.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); PendingIntent mockPendingIntent = mock(PendingIntent.class); when(returnIntent.getParcelableExtra(eq(OpenPgpApi.RESULT_INTENT))) .thenReturn(mockPendingIntent); when(openPgpApi.executeApi(any(Intent.class), any(OpenPgpDataSource.class), any(OutputStream.class))) .thenReturn(returnIntent); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); verify(returnIntent).getIntExtra(eq(OpenPgpApi.RESULT_CODE), anyInt()); ArgumentCaptor<PendingIntent> piCaptor = ArgumentCaptor.forClass(PendingIntent.class); ArgumentCaptor<Integer> rcCaptor = ArgumentCaptor.forClass(Integer.class); verify(mockCallback).onMessageBuildReturnPendingIntent(piCaptor.capture(), rcCaptor.capture()); verifyNoMoreInteractions(mockCallback); returnedRequestCode = rcCaptor.getValue(); Assert.assertSame(mockPendingIntent, piCaptor.getValue()); } { Intent returnIntent = spy(new Intent()); returnIntent.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); Intent mockReturnIntent = mock(Intent.class); when(openPgpApi.executeApi(same(mockReturnIntent), any(OpenPgpDataSource.class), any(OutputStream.class))) .thenReturn(returnIntent); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.onActivityResult(returnedRequestCode, Activity.RESULT_OK, mockReturnIntent, mockCallback); verify(openPgpApi).executeApi(same(mockReturnIntent), any(OpenPgpDataSource.class), any(OutputStream.class)); verify(returnIntent).getIntExtra(eq(OpenPgpApi.RESULT_CODE), anyInt()); } } @Test public void buildEncrypt__withoutRecipients__shouldThrow() throws MessagingException { cryptoStatusBuilder .setCryptoMode(CryptoMode.OPPORTUNISTIC) .setRecipients(new ArrayList<Recipient>()); pgpMessageBuilder.setCryptoStatus(cryptoStatusBuilder.build()); Intent returnIntent = spy(new Intent()); returnIntent.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); when(openPgpApi.executeApi(any(Intent.class), any(OpenPgpDataSource.class), any(OutputStream.class))) .thenReturn(returnIntent); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); verify(mockCallback).onMessageBuildException(any(MessagingException.class)); verifyNoMoreInteractions(mockCallback); } @Test public void buildEncrypt__shouldSucceed() throws MessagingException { ComposeCryptoStatus cryptoStatus = cryptoStatusBuilder .setCryptoMode(CryptoMode.PRIVATE) .setRecipients(Collections.singletonList(new Recipient("test", "test@example.org", "labru", -1, "key"))) .build(); pgpMessageBuilder.setCryptoStatus(cryptoStatus); ArgumentCaptor<Intent> capturedApiIntent = ArgumentCaptor.forClass(Intent.class); Intent returnIntent = new Intent(); returnIntent.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); when(openPgpApi.executeApi(capturedApiIntent.capture(), any(OpenPgpDataSource.class), any(OutputStream.class))).thenReturn(returnIntent); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); Intent expectedApiIntent = new Intent(OpenPgpApi.ACTION_SIGN_AND_ENCRYPT); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, TEST_SIGN_KEY_ID); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_KEY_IDS, new long[] { TEST_SELF_ENCRYPT_KEY_ID }); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_ENCRYPT_OPPORTUNISTIC, false); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_USER_IDS, cryptoStatus.getRecipientAddresses()); assertIntentEqualsActionAndExtras(expectedApiIntent, capturedApiIntent.getValue()); ArgumentCaptor<MimeMessage> captor = ArgumentCaptor.forClass(MimeMessage.class); verify(mockCallback).onMessageBuildSuccess(captor.capture(), eq(false)); verifyNoMoreInteractions(mockCallback); MimeMessage message = captor.getValue(); Assert.assertEquals("message must be multipart/encrypted", "multipart/encrypted", message.getMimeType()); MimeMultipart multipart = (MimeMultipart) message.getBody(); Assert.assertEquals("multipart/encrypted must consist of two parts", 2, multipart.getCount()); BodyPart dummyBodyPart = multipart.getBodyPart(0); Assert.assertEquals("first part must be pgp encrypted dummy part", "application/pgp-encrypted", dummyBodyPart.getContentType()); assertContentOfBodyPartEquals("content must match the supplied detached signature", dummyBodyPart, "Version: 1"); BodyPart encryptedBodyPart = multipart.getBodyPart(1); Assert.assertEquals("second part must be octet-stream of encrypted data", "application/octet-stream", encryptedBodyPart.getContentType()); Assert.assertTrue("message body must be BinaryTempFileBody", encryptedBodyPart.getBody() instanceof BinaryTempFileBody); Assert.assertEquals(MimeUtil.ENC_7BIT, ((BinaryTempFileBody) encryptedBodyPart.getBody()).getEncoding()); } @Test public void buildEncrypt__withInlineEnabled__shouldSucceed() throws MessagingException { ComposeCryptoStatus cryptoStatus = cryptoStatusBuilder .setCryptoMode(CryptoMode.PRIVATE) .setRecipients(Collections.singletonList(new Recipient("test", "test@example.org", "labru", -1, "key"))) .setEnablePgpInline(true) .build(); pgpMessageBuilder.setCryptoStatus(cryptoStatus); ArgumentCaptor<Intent> capturedApiIntent = ArgumentCaptor.forClass(Intent.class); Intent returnIntent = new Intent(); returnIntent.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); when(openPgpApi.executeApi(capturedApiIntent.capture(), any(OpenPgpDataSource.class), any(OutputStream.class))) .thenReturn(returnIntent); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); Intent expectedApiIntent = new Intent(OpenPgpApi.ACTION_SIGN_AND_ENCRYPT); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, TEST_SIGN_KEY_ID); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_KEY_IDS, new long[] { TEST_SELF_ENCRYPT_KEY_ID }); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_ENCRYPT_OPPORTUNISTIC, false); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_USER_IDS, cryptoStatus.getRecipientAddresses()); assertIntentEqualsActionAndExtras(expectedApiIntent, capturedApiIntent.getValue()); ArgumentCaptor<MimeMessage> captor = ArgumentCaptor.forClass(MimeMessage.class); verify(mockCallback).onMessageBuildSuccess(captor.capture(), eq(false)); verifyNoMoreInteractions(mockCallback); MimeMessage message = captor.getValue(); Assert.assertEquals("text/plain", message.getMimeType()); Assert.assertTrue("message body must be BinaryTempFileBody", message.getBody() instanceof BinaryTempFileBody); Assert.assertEquals(MimeUtil.ENC_7BIT, ((BinaryTempFileBody) message.getBody()).getEncoding()); } @Test public void buildSign__withInlineEnabled__shouldSucceed() throws MessagingException { ComposeCryptoStatus cryptoStatus = cryptoStatusBuilder .setCryptoMode(CryptoMode.SIGN_ONLY) .setRecipients(Collections.singletonList(new Recipient("test", "test@example.org", "labru", -1, "key"))) .setEnablePgpInline(true) .build(); pgpMessageBuilder.setCryptoStatus(cryptoStatus); ArgumentCaptor<Intent> capturedApiIntent = ArgumentCaptor.forClass(Intent.class); Intent returnIntent = new Intent(); returnIntent.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); when(openPgpApi.executeApi(capturedApiIntent.capture(), any(OpenPgpDataSource.class), any(OutputStream.class))) .thenReturn(returnIntent); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); Intent expectedApiIntent = new Intent(OpenPgpApi.ACTION_SIGN); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, TEST_SIGN_KEY_ID); expectedApiIntent.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true); assertIntentEqualsActionAndExtras(expectedApiIntent, capturedApiIntent.getValue()); ArgumentCaptor<MimeMessage> captor = ArgumentCaptor.forClass(MimeMessage.class); verify(mockCallback).onMessageBuildSuccess(captor.capture(), eq(false)); verifyNoMoreInteractions(mockCallback); MimeMessage message = captor.getValue(); Assert.assertEquals("message must be text/plain", "text/plain", message.getMimeType()); } @Test public void buildSignWithAttach__withInlineEnabled__shouldThrow() throws MessagingException { ComposeCryptoStatus cryptoStatus = cryptoStatusBuilder .setCryptoMode(CryptoMode.SIGN_ONLY) .setEnablePgpInline(true) .build(); pgpMessageBuilder.setCryptoStatus(cryptoStatus); pgpMessageBuilder.setAttachments(Collections.singletonList(Attachment.createAttachment(null, 0, null))); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); verify(mockCallback).onMessageBuildException(any(MessagingException.class)); verifyNoMoreInteractions(mockCallback); verifyNoMoreInteractions(openPgpApi); } @Test public void buildEncryptWithAttach__withInlineEnabled__shouldThrow() throws MessagingException { ComposeCryptoStatus cryptoStatus = cryptoStatusBuilder .setCryptoMode(CryptoMode.OPPORTUNISTIC) .setEnablePgpInline(true) .build(); pgpMessageBuilder.setCryptoStatus(cryptoStatus); pgpMessageBuilder.setAttachments(Collections.singletonList(Attachment.createAttachment(null, 0, null))); Callback mockCallback = mock(Callback.class); pgpMessageBuilder.buildAsync(mockCallback); verify(mockCallback).onMessageBuildException(any(MessagingException.class)); verifyNoMoreInteractions(mockCallback); verifyNoMoreInteractions(openPgpApi); } private ComposeCryptoStatusBuilder createDefaultComposeCryptoStatusBuilder() { return new ComposeCryptoStatusBuilder() .setEnablePgpInline(false) .setSigningKeyId(TEST_SIGN_KEY_ID) .setSelfEncryptId(TEST_SELF_ENCRYPT_KEY_ID) .setRecipients(new ArrayList<Recipient>()) .setCryptoProviderState(CryptoProviderState.OK); } private static PgpMessageBuilder createDefaultPgpMessageBuilder(OpenPgpApi openPgpApi) { PgpMessageBuilder b = new PgpMessageBuilder(RuntimeEnvironment.application); b.setOpenPgpApi(openPgpApi); Identity identity = new Identity(); identity.setName("tester"); identity.setEmail("test@example.org"); identity.setDescription("test identity"); identity.setSignatureUse(false); b.setSubject("subject") .setTo(new ArrayList<Address>()) .setCc(new ArrayList<Address>()) .setBcc(new ArrayList<Address>()) .setInReplyTo("inreplyto") .setReferences("references") .setRequestReadReceipt(false) .setIdentity(identity) .setMessageFormat(SimpleMessageFormat.TEXT) .setText(TEST_MESSAGE_TEXT) .setAttachments(new ArrayList<Attachment>()) .setSignature("signature") .setQuoteStyle(QuoteStyle.PREFIX) .setQuotedTextMode(QuotedTextMode.NONE) .setQuotedText("quoted text") .setQuotedHtmlContent(new InsertableHtmlContent()) .setReplyAfterQuote(false) .setSignatureBeforeQuotedText(false) .setIdentityChanged(false) .setSignatureChanged(false) .setCursorPosition(0) .setMessageReference(null) .setDraft(false); return b; } private static void assertContentOfBodyPartEquals(String reason, BodyPart signatureBodyPart, byte[] expected) { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); signatureBodyPart.getBody().writeTo(bos); Assert.assertArrayEquals(reason, expected, bos.toByteArray()); } catch (IOException | MessagingException e) { Assert.fail(); } } private static void assertContentOfBodyPartEquals(String reason, BodyPart signatureBodyPart, String expected) { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); InputStream inputStream = MimeUtility.decodeBody(signatureBodyPart.getBody()); IOUtils.copy(inputStream, bos); Assert.assertEquals(reason, expected, new String(bos.toByteArray())); } catch (IOException | MessagingException e) { Assert.fail(); } } private static void assertIntentEqualsActionAndExtras(Intent expected, Intent actual) { Assert.assertEquals(expected.getAction(), actual.getAction()); Bundle expectedExtras = expected.getExtras(); Bundle intentExtras = actual.getExtras(); if (expectedExtras.size() != intentExtras.size()) { Assert.assertEquals(expectedExtras.size(), intentExtras.size()); } for (String key : expectedExtras.keySet()) { Object intentExtra = intentExtras.get(key); Object expectedExtra = expectedExtras.get(key); if (intentExtra == null) { if (expectedExtra == null) { continue; } Assert.fail("found null for an expected non-null extra: " + key); } if (intentExtra instanceof long[]) { if (!Arrays.equals((long[]) intentExtra, (long[]) expectedExtra)) { Assert.assertArrayEquals((long[]) expectedExtra, (long[]) intentExtra); } } else { if (!intentExtra.equals(expectedExtra)) { Assert.assertEquals(expectedExtra, intentExtra); } } } } }
gilbertw1/k-9
k9mail/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.java
Java
bsd-3-clause
24,096
For information, api and documentation about this module: visit <b><a href="http://itsa.io">itsa.io</a></b> [![Build Status](https://travis-ci.org/itsa/event-dom.svg?branch=master)](https://travis-ci.org/itsa/event-dom) [![browser support](https://ci.testling.com/itsa/event-dom.png)](https://ci.testling.com/itsa/event-dom)
ItsAsbreuk/event-dom
README.md
Markdown
bsd-3-clause
326
/** * SAHARA Rig Client * * Software abstraction of physical rig to provide rig session control * and rig device control. Automatically tests rig hardware and reports * the rig status to ensure rig goodness. * * @license See LICENSE in the top level directory for complete license terms. * * Copyright (c) 2009, University of Technology, Sydney * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the University of Technology, Sydney nor the names * of its contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Michael Diponio (mdiponio) * @date 8th November 2009 * * Changelog: * - 08/11/2009 - mdiponio - Initial file creation. */ package au.edu.uts.eng.remotelabs.rigclient.rig.internal; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import au.edu.uts.eng.remotelabs.rigclient.util.ILogger; import au.edu.uts.eng.remotelabs.rigclient.util.LoggerFactory; /** * Moves the contents into a new directory. */ public class DirectoryCopier { /** File content buffer. */ private final byte buf[]; /** Logger object. */ private final ILogger logger; /** * Constructor. */ public DirectoryCopier() { this.logger = LoggerFactory.getLoggerInstance(); this.buf = new byte[4096]; } /** * Copies a directories contents to another directory. If the * supplied destination directory does not exist, it is created before * proceeding with copying the contents to it. * * @param fromDir location of files to copy * @param toDir destination of files * @return true if successful */ public boolean copyDirectory(final String fromDir, final String toDir) { try { this.recursiveCopy(fromDir, toDir); return true; } catch (IOException e) { this.logger.error("Failed to copy directory contents with error " + e.getMessage()); return false; } } /** * Recursively copies a directories contents to another directory. If the * supplied destination directory does not exist, it is created before * proceeding with copying the contents to it. * * @param fromDir location of files to copy * @param toDir destination of files * @throws IOException error copying directories */ public void recursiveCopy(final String fromDir, final String toDir) throws IOException { this.logger.debug("Copying the contents of " + fromDir + " to " + toDir + "."); final File fromFile = new File(fromDir); final File toFile = new File(toDir); if (!fromFile.isDirectory()) { this.logger.warn(fromDir + " is not a directory. Directory copy failed."); throw new IOException(fromDir + " is not a directory."); } if (!toFile.exists() && !toFile.mkdirs()) { this.logger.warn("Failed to create directory " + toDir + ". Directory copy failed."); throw new IOException("Failed to create directory " + toDir + "."); } for (File f : fromFile.listFiles()) { if (f.isDirectory()) { this.copyDirectory(f.getAbsolutePath(), toDir + File.separatorChar + f.getName()); } else { this.copyFile(f, toFile); } } } /** * Copies the provided file into the destination directory. * * @param fromFile file to copy * @param destination directory to copy file into * @throws IOException error copying file */ public void copyFile(final File fromFile, final File destination) throws IOException { this.logger.debug("Copying file " + fromFile.getName() + " in " + fromFile.getParent() + " to " + destination + "."); int len; FileInputStream fis = null; FileOutputStream fos = null; try { final File toFile = new File(destination, fromFile.getName()); fis = new FileInputStream(fromFile); fos = new FileOutputStream(toFile); while ((len = fis.read(this.buf)) > 0) { fos.write(this.buf, 0, len); } } finally { if (fis != null) fis.close(); if (fos != null) fos.close(); } } }
jeking3/rig-client
src/au/edu/uts/eng/remotelabs/rigclient/rig/internal/DirectoryCopier.java
Java
bsd-3-clause
5,944
/*========================================================================= Program: Visualization Toolkit Module: vtkOpenGLPolyDataMapper2D.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkOpenGLPolyDataMapper2D - 2D PolyData support for OpenGL // .SECTION Description // vtkOpenGLPolyDataMapper2D provides 2D PolyData annotation support for // vtk under OpenGL. Normally the user should use vtkPolyDataMapper2D // which in turn will use this class. // .SECTION See Also // vtkPolyDataMapper2D #ifndef vtkOpenGLPolyDataMapper2D_h #define vtkOpenGLPolyDataMapper2D_h #include "vtkRenderingOpenGL2Module.h" // For export macro #include "vtkPolyDataMapper2D.h" #include "vtkglVBOHelper.h" // used for ivars class vtkRenderer; class vtkPoints; namespace vtkgl {class CellBO; } class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLPolyDataMapper2D : public vtkPolyDataMapper2D { public: vtkTypeMacro(vtkOpenGLPolyDataMapper2D, vtkPolyDataMapper2D); static vtkOpenGLPolyDataMapper2D *New(); virtual void PrintSelf(ostream& os, vtkIndent indent); // Description: // Actually draw the poly data. void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor); // Description: // Release any graphics resources that are being consumed by this mapper. // The parameter window could be used to determine which graphic // resources to release. void ReleaseGraphicsResources(vtkWindow *); protected: vtkOpenGLPolyDataMapper2D(); ~vtkOpenGLPolyDataMapper2D(); // Description: // Does the shader source need to be recomputed virtual bool GetNeedToRebuildShader(vtkgl::CellBO &cellBO, vtkViewport *ren, vtkActor2D *act); // Description: // Build the shader source code virtual void BuildShader(std::string &VertexCode, std::string &fragmentCode, std::string &geometryCode, vtkViewport *ren, vtkActor2D *act); // Description: // Determine what shader to use and compile/link it virtual void UpdateShader(vtkgl::CellBO &cellBO, vtkViewport *viewport, vtkActor2D *act); // Description: // Set the shader parameteres related to the mapper/input data, called by UpdateShader virtual void SetMapperShaderParameters(vtkgl::CellBO &cellBO, vtkViewport *ren, vtkActor2D *act); // Description: // Set the shader parameteres related to the Camera void SetCameraShaderParameters(vtkgl::CellBO &cellBO, vtkViewport *viewport, vtkActor2D *act); // Description: // Set the shader parameteres related to the property void SetPropertyShaderParameters(vtkgl::CellBO &cellBO, vtkViewport *viewport, vtkActor2D *act); // Description: // Update the scene when necessary. void UpdateVBO(vtkActor2D *act, vtkViewport *viewport); // The VBO and its layout. vtkgl::BufferObject VBO; vtkgl::VBOLayout Layout; // Structures for the various cell types we render. vtkgl::CellBO Points; vtkgl::CellBO Lines; vtkgl::CellBO Tris; vtkgl::CellBO TriStrips; vtkTimeStamp VBOUpdateTime; // When was the VBO updated? vtkPoints *TransformedPoints; private: vtkOpenGLPolyDataMapper2D(const vtkOpenGLPolyDataMapper2D&); // Not implemented. void operator=(const vtkOpenGLPolyDataMapper2D&); // Not implemented. }; #endif
hendradarwin/VTK
Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.h
C
bsd-3-clause
3,670
SELECT STRCMP('text', 'text2') FROM db_root; SELECT STRCMP(123, 'text2') FROM db_root; SELECT STRCMP('text', 123) FROM db_root; SELECT STRCMP(NULL, 'text2') FROM db_root; SELECT STRCMP(123, NULL) FROM db_root; SELECT STRCMP(NULL, NULL) FROM db_root;
CUBRID/cubrid-testcases
sql/_12_mysql_compatibility/_03_string_functions/cases/_011_strcmp.sql
SQL
bsd-3-clause
255