text stringlengths 2 1.04M | meta dict |
|---|---|
namespace FluentBuilders.Core
{
/// <summary>
/// Simple interface for a builder factory.
/// </summary>
public interface IBuilderFactory
{
T Create<T>() where T : IBuilder;
}
}
| {
"content_hash": "f7cbba76991424554f1885d5ab62a3ba",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 47,
"avg_line_length": 21.1,
"alnum_prop": 0.5971563981042654,
"repo_name": "peter-raven/FluentBuilders",
"id": "dcc08e9aa16a1aaaabf9289f1c5450a7e8f57d2e",
"size": "213",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Core/IBuilderFactory.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "51968"
}
],
"symlink_target": ""
} |
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "lkc.h"
static const char nohelp_text[] = "There is no help available for this option.";
struct menu rootmenu;
static struct menu **last_entry_ptr;
struct file *file_list;
struct file *current_file;
void menu_warn(struct menu *menu, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "%s:%d:warning: ", menu->file->name, menu->lineno);
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
va_end(ap);
}
static void prop_warn(struct property *prop, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "%s:%d:warning: ", prop->file->name, prop->lineno);
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
va_end(ap);
}
void _menu_init(void)
{
current_entry = current_menu = &rootmenu;
last_entry_ptr = &rootmenu.list;
}
void menu_add_entry(struct symbol *sym)
{
struct menu *menu;
menu = xmalloc(sizeof(*menu));
memset(menu, 0, sizeof(*menu));
menu->sym = sym;
menu->parent = current_menu;
menu->file = current_file;
menu->lineno = zconf_lineno();
*last_entry_ptr = menu;
last_entry_ptr = &menu->next;
current_entry = menu;
if (sym)
menu_add_symbol(P_SYMBOL, sym, NULL);
}
void menu_end_entry(void)
{
}
struct menu *menu_add_menu(void)
{
menu_end_entry();
last_entry_ptr = ¤t_entry->list;
return current_menu = current_entry;
}
void menu_end_menu(void)
{
last_entry_ptr = ¤t_menu->next;
current_menu = current_menu->parent;
}
static struct expr *menu_check_dep(struct expr *e)
{
if (!e)
return e;
switch (e->type) {
case E_NOT:
e->left.expr = menu_check_dep(e->left.expr);
break;
case E_OR:
case E_AND:
e->left.expr = menu_check_dep(e->left.expr);
e->right.expr = menu_check_dep(e->right.expr);
break;
case E_SYMBOL:
/* change 'm' into 'm' && MODULES */
if (e->left.sym == &symbol_mod)
return expr_alloc_and(e, expr_alloc_symbol(modules_sym));
break;
default:
break;
}
return e;
}
void menu_add_dep(struct expr *dep)
{
current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep));
}
void menu_set_type(int type)
{
struct symbol *sym = current_entry->sym;
if (sym->type == type)
return;
if (sym->type == S_UNKNOWN) {
sym->type = type;
return;
}
menu_warn(current_entry,
"ignoring type redefinition of '%s' from '%s' to '%s'",
sym->name ? sym->name : "<choice>",
sym_type_name(sym->type), sym_type_name(type));
}
struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep)
{
struct property *prop = prop_alloc(type, current_entry->sym);
prop->menu = current_entry;
prop->expr = expr;
prop->visible.expr = menu_check_dep(dep);
if (prompt) {
if (isspace(*prompt)) {
prop_warn(prop, "leading whitespace ignored");
while (isspace(*prompt))
prompt++;
}
if (current_entry->prompt && current_entry != &rootmenu)
prop_warn(prop, "prompt redefined");
/* Apply all upper menus' visibilities to actual prompts. */
if(type == P_PROMPT) {
struct menu *menu = current_entry;
while ((menu = menu->parent) != NULL) {
struct expr *dup_expr;
if (!menu->visibility)
continue;
/*
* Do not add a reference to the
* menu's visibility expression but
* use a copy of it. Otherwise the
* expression reduction functions
* will modify expressions that have
* multiple references which can
* cause unwanted side effects.
*/
dup_expr = expr_copy(menu->visibility);
prop->visible.expr
= expr_alloc_and(prop->visible.expr,
dup_expr);
}
}
current_entry->prompt = prop;
}
prop->text = prompt;
return prop;
}
struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep)
{
return menu_add_prop(type, prompt, NULL, dep);
}
void menu_add_visibility(struct expr *expr)
{
current_entry->visibility = expr_alloc_and(current_entry->visibility,
expr);
}
void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep)
{
menu_add_prop(type, NULL, expr, dep);
}
void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
{
menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep);
}
void menu_add_option(int token, char *arg)
{
switch (token) {
case T_OPT_MODULES:
if (modules_sym)
zconf_error("symbol '%s' redefines option 'modules'"
" already defined by symbol '%s'",
current_entry->sym->name,
modules_sym->name
);
modules_sym = current_entry->sym;
break;
case T_OPT_DEFCONFIG_LIST:
if (!sym_defconfig_list)
sym_defconfig_list = current_entry->sym;
else if (sym_defconfig_list != current_entry->sym)
zconf_error("trying to redefine defconfig symbol");
break;
case T_OPT_ENV:
prop_add_env(arg);
break;
}
}
static int menu_validate_number(struct symbol *sym, struct symbol *sym2)
{
return sym2->type == S_INT || sym2->type == S_HEX ||
(sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name));
}
static void sym_check_prop(struct symbol *sym)
{
struct property *prop;
struct symbol *sym2;
for (prop = sym->prop; prop; prop = prop->next) {
switch (prop->type) {
case P_DEFAULT:
if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) &&
prop->expr->type != E_SYMBOL)
prop_warn(prop,
"default for config symbol '%s'"
" must be a single symbol", sym->name);
if (prop->expr->type != E_SYMBOL)
break;
sym2 = prop_get_symbol(prop);
if (sym->type == S_HEX || sym->type == S_INT) {
if (!menu_validate_number(sym, sym2))
prop_warn(prop,
"'%s': number is invalid",
sym->name);
}
break;
case P_SELECT:
sym2 = prop_get_symbol(prop);
if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE)
prop_warn(prop,
"config symbol '%s' uses select, but is "
"not boolean or tristate", sym->name);
else if (sym2->type != S_UNKNOWN &&
sym2->type != S_BOOLEAN &&
sym2->type != S_TRISTATE)
prop_warn(prop,
"'%s' has wrong type. 'select' only "
"accept arguments of boolean and "
"tristate type", sym2->name);
break;
case P_RANGE:
if (sym->type != S_INT && sym->type != S_HEX)
prop_warn(prop, "range is only allowed "
"for int or hex symbols");
if (!menu_validate_number(sym, prop->expr->left.sym) ||
!menu_validate_number(sym, prop->expr->right.sym))
prop_warn(prop, "range is invalid");
break;
default:
;
}
}
}
void menu_finalize(struct menu *parent)
{
struct menu *menu, *last_menu;
struct symbol *sym;
struct property *prop;
struct expr *parentdep, *basedep, *dep, *dep2, **ep;
sym = parent->sym;
if (parent->list) {
if (sym && sym_is_choice(sym)) {
if (sym->type == S_UNKNOWN) {
/* find the first choice value to find out choice type */
current_entry = parent;
for (menu = parent->list; menu; menu = menu->next) {
if (menu->sym && menu->sym->type != S_UNKNOWN) {
menu_set_type(menu->sym->type);
break;
}
}
}
/* set the type of the remaining choice values */
for (menu = parent->list; menu; menu = menu->next) {
current_entry = menu;
if (menu->sym && menu->sym->type == S_UNKNOWN)
menu_set_type(sym->type);
}
parentdep = expr_alloc_symbol(sym);
} else if (parent->prompt)
parentdep = parent->prompt->visible.expr;
else
parentdep = parent->dep;
for (menu = parent->list; menu; menu = menu->next) {
basedep = expr_transform(menu->dep);
basedep = expr_alloc_and(expr_copy(parentdep), basedep);
basedep = expr_eliminate_dups(basedep);
menu->dep = basedep;
if (menu->sym)
prop = menu->sym->prop;
else
prop = menu->prompt;
for (; prop; prop = prop->next) {
if (prop->menu != menu)
continue;
dep = expr_transform(prop->visible.expr);
dep = expr_alloc_and(expr_copy(basedep), dep);
dep = expr_eliminate_dups(dep);
if (menu->sym && menu->sym->type != S_TRISTATE)
dep = expr_trans_bool(dep);
prop->visible.expr = dep;
if (prop->type == P_SELECT) {
struct symbol *es = prop_get_symbol(prop);
es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr,
expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
}
}
}
for (menu = parent->list; menu; menu = menu->next)
menu_finalize(menu);
} else if (sym) {
basedep = parent->prompt ? parent->prompt->visible.expr : NULL;
basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no);
basedep = expr_eliminate_dups(expr_transform(basedep));
last_menu = NULL;
for (menu = parent->next; menu; menu = menu->next) {
dep = menu->prompt ? menu->prompt->visible.expr : menu->dep;
if (!expr_contains_symbol(dep, sym))
break;
if (expr_depends_symbol(dep, sym))
goto next;
dep = expr_trans_compare(dep, E_UNEQUAL, &symbol_no);
dep = expr_eliminate_dups(expr_transform(dep));
dep2 = expr_copy(basedep);
expr_eliminate_eq(&dep, &dep2);
expr_free(dep);
if (!expr_is_yes(dep2)) {
expr_free(dep2);
break;
}
expr_free(dep2);
next:
menu_finalize(menu);
menu->parent = parent;
last_menu = menu;
}
if (last_menu) {
parent->list = parent->next;
parent->next = last_menu->next;
last_menu->next = NULL;
}
sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep);
}
for (menu = parent->list; menu; menu = menu->next) {
if (sym && sym_is_choice(sym) &&
menu->sym && !sym_is_choice_value(menu->sym)) {
current_entry = menu;
menu->sym->flags |= SYMBOL_CHOICEVAL;
if (!menu->prompt)
menu_warn(menu, "choice value must have a prompt");
for (prop = menu->sym->prop; prop; prop = prop->next) {
if (prop->type == P_DEFAULT)
prop_warn(prop, "defaults for choice "
"values not supported");
if (prop->menu == menu)
continue;
if (prop->type == P_PROMPT &&
prop->menu->parent->sym != sym)
prop_warn(prop, "choice value used outside its choice group");
}
/* Non-tristate choice values of tristate choices must
* depend on the choice being set to Y. The choice
* values' dependencies were propagated to their
* properties above, so the change here must be re-
* propagated.
*/
if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) {
basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes);
menu->dep = expr_alloc_and(basedep, menu->dep);
for (prop = menu->sym->prop; prop; prop = prop->next) {
if (prop->menu != menu)
continue;
prop->visible.expr = expr_alloc_and(expr_copy(basedep),
prop->visible.expr);
}
}
menu_add_symbol(P_CHOICE, sym, NULL);
prop = sym_get_choice_prop(sym);
for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr)
;
*ep = expr_alloc_one(E_LIST, NULL);
(*ep)->right.sym = menu->sym;
}
if (menu->list && (!menu->prompt || !menu->prompt->text)) {
for (last_menu = menu->list; ; last_menu = last_menu->next) {
last_menu->parent = parent;
if (!last_menu->next)
break;
}
last_menu->next = menu->next;
menu->next = menu->list;
menu->list = NULL;
}
}
if (sym && !(sym->flags & SYMBOL_WARNED)) {
if (sym->type == S_UNKNOWN)
menu_warn(parent, "config symbol defined without type");
if (sym_is_choice(sym) && !parent->prompt)
menu_warn(parent, "choice must have a prompt");
/* Check properties connected to this symbol */
sym_check_prop(sym);
sym->flags |= SYMBOL_WARNED;
}
if (sym && !sym_is_optional(sym) && parent->prompt) {
sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr,
expr_alloc_and(parent->prompt->visible.expr,
expr_alloc_symbol(&symbol_mod)));
}
}
bool menu_has_prompt(struct menu *menu)
{
if (!menu->prompt)
return false;
return true;
}
/*
* Determine if a menu is empty.
* A menu is considered empty if it contains no or only
* invisible entries.
*/
bool menu_is_empty(struct menu *menu)
{
struct menu *child;
for (child = menu->list; child; child = child->next) {
if (menu_is_visible(child))
return(false);
}
return(true);
}
bool menu_is_visible(struct menu *menu)
{
struct menu *child;
struct symbol *sym;
tristate visible;
if (!menu->prompt)
return false;
if (menu->visibility) {
if (expr_calc_value(menu->visibility) == no)
return no;
}
sym = menu->sym;
if (sym) {
sym_calc_value(sym);
visible = menu->prompt->visible.tri;
} else
visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr);
if (visible != no)
return true;
if (!sym || sym_get_tristate_value(menu->sym) == no)
return false;
for (child = menu->list; child; child = child->next) {
if (menu_is_visible(child)) {
if (sym)
sym->flags |= SYMBOL_DEF_USER;
return true;
}
}
return false;
}
const char *menu_get_prompt(struct menu *menu)
{
if (menu->prompt)
return menu->prompt->text;
else if (menu->sym)
return menu->sym->name;
return NULL;
}
struct menu *menu_get_root_menu(struct menu *menu)
{
return &rootmenu;
}
struct menu *menu_get_parent_menu(struct menu *menu)
{
enum prop_type type;
for (; menu != &rootmenu; menu = menu->parent) {
type = menu->prompt ? menu->prompt->type : 0;
if (type == P_MENU)
break;
}
return menu;
}
bool menu_has_help(struct menu *menu)
{
return menu->help != NULL;
}
const char *menu_get_help(struct menu *menu)
{
if (menu->help)
return menu->help;
else
return "";
}
static void get_prompt_str(struct gstr *r, struct property *prop,
struct list_head *head)
{
int i, j;
struct menu *submenu[8], *menu, *location = NULL;
struct jump_key *jump;
str_printf(r, _("Prompt: %s\n"), _(prop->text));
menu = prop->menu->parent;
for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
bool accessible = menu_is_visible(menu);
submenu[i++] = menu;
if (location == NULL && accessible)
location = menu;
}
if (head && location) {
jump = xmalloc(sizeof(struct jump_key));
if (menu_is_visible(prop->menu)) {
/*
* There is not enough room to put the hint at the
* beginning of the "Prompt" line. Put the hint on the
* last "Location" line even when it would belong on
* the former.
*/
jump->target = prop->menu;
} else
jump->target = location;
if (list_empty(head))
jump->index = 0;
else
jump->index = list_entry(head->prev, struct jump_key,
entries)->index + 1;
list_add_tail(&jump->entries, head);
}
if (i > 0) {
str_printf(r, _(" Location:\n"));
for (j = 4; --i >= 0; j += 2) {
menu = submenu[i];
if (head && location && menu == location)
jump->offset = strlen(r->s);
str_printf(r, "%*c-> %s", j, ' ',
_(menu_get_prompt(menu)));
if (menu->sym) {
str_printf(r, " (%s [=%s])", menu->sym->name ?
menu->sym->name : _("<choice>"),
sym_get_string_value(menu->sym));
}
str_append(r, "\n");
}
}
}
/*
* get property of type P_SYMBOL
*/
static struct property *get_symbol_prop(struct symbol *sym)
{
struct property *prop = NULL;
for_all_properties(sym, prop, P_SYMBOL)
break;
return prop;
}
/*
* head is optional and may be NULL
*/
void get_symbol_str(struct gstr *r, struct symbol *sym,
struct list_head *head)
{
bool hit;
struct property *prop;
if (sym && sym->name) {
str_printf(r, "Symbol: %s [=%s]\n", sym->name,
sym_get_string_value(sym));
str_printf(r, "Type : %s\n", sym_type_name(sym->type));
if (sym->type == S_INT || sym->type == S_HEX) {
prop = sym_get_range_prop(sym);
if (prop) {
str_printf(r, "Range : ");
expr_gstr_print(prop->expr, r);
str_append(r, "\n");
}
}
}
for_all_prompts(sym, prop)
get_prompt_str(r, prop, head);
prop = get_symbol_prop(sym);
if (prop) {
str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
prop->menu->lineno);
if (!expr_is_yes(prop->visible.expr)) {
str_append(r, _(" Depends on: "));
expr_gstr_print(prop->visible.expr, r);
str_append(r, "\n");
}
}
hit = false;
for_all_properties(sym, prop, P_SELECT) {
if (!hit) {
str_append(r, " Selects: ");
hit = true;
} else
str_printf(r, " && ");
expr_gstr_print(prop->expr, r);
}
if (hit)
str_append(r, "\n");
if (sym->rev_dep.expr) {
str_append(r, _(" Selected by: "));
expr_gstr_print(sym->rev_dep.expr, r);
str_append(r, "\n");
}
str_append(r, "\n\n");
}
struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head)
{
struct symbol *sym;
struct gstr res = str_new();
int i;
for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
get_symbol_str(&res, sym, head);
if (!i)
str_append(&res, _("No matches found.\n"));
return res;
}
void menu_get_ext_help(struct menu *menu, struct gstr *help)
{
struct symbol *sym = menu->sym;
const char *help_text = nohelp_text;
if (menu_has_help(menu)) {
if (sym->name)
str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
help_text = menu_get_help(menu);
}
str_printf(help, "%s\n", _(help_text));
if (sym)
get_symbol_str(help, sym, NULL);
}
| {
"content_hash": "547893d0d9c63a1db853e19f7a18692e",
"timestamp": "",
"source": "github",
"line_count": 691,
"max_line_length": 102,
"avg_line_length": 24.6917510853835,
"alnum_prop": 0.6142890634157777,
"repo_name": "TechV/DroneOS",
"id": "db1512ae30cc48d6f2ea87bc26a082a084551811",
"size": "17176",
"binary": false,
"copies": "529",
"ref": "refs/heads/master",
"path": "DroneOS/buildroot/support/kconfig/menu.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "69099"
},
{
"name": "Arc",
"bytes": "257"
},
{
"name": "Bison",
"bytes": "15399"
},
{
"name": "C",
"bytes": "382560"
},
{
"name": "C++",
"bytes": "52438"
},
{
"name": "CSS",
"bytes": "81402"
},
{
"name": "JavaScript",
"bytes": "105210"
},
{
"name": "Makefile",
"bytes": "1598252"
},
{
"name": "Perl",
"bytes": "36726"
},
{
"name": "Python",
"bytes": "216857"
},
{
"name": "Shell",
"bytes": "110640"
}
],
"symlink_target": ""
} |
from __future__ import unicode_literals
from django.db import migrations, models
def load_data(apps, schema_editor):
AccountType = apps.get_model("profiles", "AccountType")
AccountType.objects.get_or_create(
name="GITHUB",
display_name="Github",
social_auth_provider_name="github",
link_to_account_with_param="https://github.com/{account_name}",
link_to_avatar_with_params="https://github.com/{account_name}.png?size={size}"
)
AccountType.objects.get_or_create(
name="STEEM",
display_name="Steem",
social_auth_provider_name="steemconnect",
link_to_account_with_param="https://steemit.com/@{account_name}",
link_to_avatar_with_params="https://steemitimages.com/u/{account_name}/avatar"
)
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_initial'),
]
operations = [
migrations.RunPython(load_data)
]
| {
"content_hash": "93e7e0ebf7e56fcd498f45fd7d23a47c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 86,
"avg_line_length": 28.38235294117647,
"alnum_prop": 0.6435233160621762,
"repo_name": "noisy/steemprojects.com",
"id": "0e9362c775464cf324fe4b2876dca0d70f3d40d6",
"size": "965",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "profiles/migrations/0002_accounttype_data_migration.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "63399"
},
{
"name": "Dockerfile",
"bytes": "1731"
},
{
"name": "HTML",
"bytes": "155684"
},
{
"name": "Makefile",
"bytes": "2785"
},
{
"name": "Python",
"bytes": "431771"
},
{
"name": "Shell",
"bytes": "5227"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Coq bench</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../../..">Unstable</a></li>
<li><a href=".">8.4.5 / concurrency:system dev</a></li>
<li class="active"><a href="">2015-02-02 21:24:19</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="../../../../../about.html">About</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href=".">« Up</a>
<h1>
concurrency:system
<small>
dev
<span class="label label-success">11 s</span>
</small>
</h1>
<p><em><script>document.write(moment("2015-02-02 21:24:19 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2015-02-02 21:24:19 UTC)</em><p>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>ruby lint.rb unstable ../unstable/packages/coq:concurrency:system/coq:concurrency:system.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --dry-run coq:concurrency:system.dev coq.8.4.5</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>2 s</dd>
</dl>
<p>Dry install without Coq, to test if the problem was incompatibility with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>ulimit -Sv 2000000; timeout 5m opam install -y --deps-only coq:concurrency:system.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>17 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>ulimit -Sv 2000000; timeout 5m opam install -y --verbose coq:concurrency:system.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>11 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 282 K</p>
<ul>
<li>71 K <code>/home/bench/.opam/system/lib/coq/user-contrib/Concurrency/Events.vo</code></li>
<li>69 K <code>/home/bench/.opam/system/lib/coq/user-contrib/Concurrency/Extraction.vo</code></li>
<li>51 K <code>/home/bench/.opam/system/lib/coq/user-contrib/Concurrency/Run.vo</code></li>
<li>33 K <code>/home/bench/.opam/system/lib/coq/user-contrib/Concurrency/Test.vo</code></li>
<li>33 K <code>/home/bench/.opam/system/lib/coq/user-contrib/Concurrency/Computation.vo</code></li>
<li>23 K <code>/home/bench/.opam/system/lib/coq/user-contrib/Concurrency/StdLib.vo</code></li>
<li>1 K <code>/home/bench/.opam/system/lib/coq:concurrency:system/opam.config</code></li>
<li>1 K <code>/home/bench/.opam/system/install/coq:concurrency:system.install</code></li>
</ul>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq:concurrency:system.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>3 s</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html> | {
"content_hash": "2e8c4f869febeaabd8e1d3fe4fb3ae6c",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 157,
"avg_line_length": 44.04895104895105,
"alnum_prop": 0.5019844419749167,
"repo_name": "coq-bench/coq-bench.github.io-old",
"id": "b68d3527f2669b80e439d839962a4beeff783441",
"size": "6301",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.02.1-1.2.0/unstable/8.4.5/concurrency:system/dev/2015-02-02_21-24-19.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
require 'unicode_normalize/tables.rb'
module UnicodeNormalize
## Constant for max hash capacity to avoid DoS attack
MAX_HASH_LENGTH = 18000 # enough for all test cases, otherwise tests get slow
## Regular Expressions and Hash Constants
REGEXP_D = Regexp.compile(REGEXP_D_STRING, Regexp::EXTENDED)
REGEXP_C = Regexp.compile(REGEXP_C_STRING, Regexp::EXTENDED)
REGEXP_K = Regexp.compile(REGEXP_K_STRING, Regexp::EXTENDED)
NF_HASH_D = Hash.new do |hash, key|
hash.shift if hash.length>MAX_HASH_LENGTH # prevent DoS attack
hash[key] = nfd_one(key)
end
NF_HASH_C = Hash.new do |hash, key|
hash.shift if hash.length>MAX_HASH_LENGTH # prevent DoS attack
hash[key] = nfc_one(key)
end
## Constants For Hangul
# for details such as the meaning of the identifiers below, please see
# http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf, pp. 144/145
SBASE = 0xAC00
LBASE = 0x1100
VBASE = 0x1161
TBASE = 0x11A7
LCOUNT = 19
VCOUNT = 21
TCOUNT = 28
NCOUNT = VCOUNT * TCOUNT
SCOUNT = LCOUNT * NCOUNT
# Unicode-based encodings (except UTF-8)
UNICODE_ENCODINGS = [Encoding::UTF_16BE, Encoding::UTF_16LE, Encoding::UTF_32BE, Encoding::UTF_32LE,
Encoding::GB18030, Encoding::UCS_2BE, Encoding::UCS_4BE]
## Hangul Algorithm
def self.hangul_decomp_one(target)
syllable_index = target.ord - SBASE
return target if syllable_index < 0 || syllable_index >= SCOUNT
l = LBASE + syllable_index / NCOUNT
v = VBASE + (syllable_index % NCOUNT) / TCOUNT
t = TBASE + syllable_index % TCOUNT
(t==TBASE ? [l, v] : [l, v, t]).pack('U*') + target[1..-1]
end
def self.hangul_comp_one(string)
length = string.length
if length>1 and 0 <= (lead =string[0].ord-LBASE) and lead < LCOUNT and
0 <= (vowel=string[1].ord-VBASE) and vowel < VCOUNT
lead_vowel = SBASE + (lead * VCOUNT + vowel) * TCOUNT
if length>2 and 0 <= (trail=string[2].ord-TBASE) and trail < TCOUNT
(lead_vowel + trail).chr(Encoding::UTF_8) + string[3..-1]
else
lead_vowel.chr(Encoding::UTF_8) + string[2..-1]
end
else
string
end
end
## Canonical Ordering
def self.canonical_ordering_one(string)
sorting = string.each_char.collect { |c| [c, CLASS_TABLE[c]] }
(sorting.length-2).downto(0) do |i| # almost, but not exactly bubble sort
(0..i).each do |j|
later_class = sorting[j+1].last
if 0<later_class and later_class<sorting[j].last
sorting[j], sorting[j+1] = sorting[j+1], sorting[j]
end
end
end
return sorting.collect(&:first).join('')
end
## Normalization Forms for Patterns (not whole Strings)
def self.nfd_one(string)
string = string.chars.map! {|c| DECOMPOSITION_TABLE[c] || c}.join('')
canonical_ordering_one(hangul_decomp_one(string))
end
def self.nfc_one(string)
nfd_string = nfd_one string
start = nfd_string[0]
last_class = CLASS_TABLE[start]-1
accents = ''
nfd_string[1..-1].each_char do |accent|
accent_class = CLASS_TABLE[accent]
if last_class<accent_class and composite = COMPOSITION_TABLE[start+accent]
start = composite
else
accents << accent
last_class = accent_class
end
end
hangul_comp_one(start+accents)
end
def self.normalize(string, form = :nfc)
encoding = string.encoding
case encoding
when Encoding::UTF_8
case form
when :nfc then
string.gsub REGEXP_C, NF_HASH_C
when :nfd then
string.gsub REGEXP_D, NF_HASH_D
when :nfkc then
string.gsub(REGEXP_K, KOMPATIBLE_TABLE).gsub(REGEXP_C, NF_HASH_C)
when :nfkd then
string.gsub(REGEXP_K, KOMPATIBLE_TABLE).gsub(REGEXP_D, NF_HASH_D)
else
raise ArgumentError, "Invalid normalization form #{form}."
end
when Encoding::US_ASCII
string
when *UNICODE_ENCODINGS
normalize(string.encode(Encoding::UTF_8), form).encode(encoding)
else
raise Encoding::CompatibilityError, "Unicode Normalization not appropriate for #{encoding}"
end
end
def self.normalized?(string, form = :nfc)
encoding = string.encoding
case encoding
when Encoding::UTF_8
case form
when :nfc then
string.scan REGEXP_C do |match|
return false if NF_HASH_C[match] != match
end
true
when :nfd then
string.scan REGEXP_D do |match|
return false if NF_HASH_D[match] != match
end
true
when :nfkc then
normalized?(string, :nfc) and string !~ REGEXP_K
when :nfkd then
normalized?(string, :nfd) and string !~ REGEXP_K
else
raise ArgumentError, "Invalid normalization form #{form}."
end
when Encoding::US_ASCII
true
when *UNICODE_ENCODINGS
normalized? string.encode(Encoding::UTF_8), form
else
raise Encoding::CompatibilityError, "Unicode Normalization not appropriate for #{encoding}"
end
end
end # module
| {
"content_hash": "fa11a40da6b8c685bdfba44783c5770d",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 102,
"avg_line_length": 33.11538461538461,
"alnum_prop": 0.6227255129694154,
"repo_name": "rhomobile/rhodes",
"id": "8f0e8a20d1180154651ef8f3e7309271765ed99c",
"size": "5299",
"binary": false,
"copies": "13",
"ref": "refs/heads/master",
"path": "lib/framework/unicode_normalize/normalize.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "6291"
},
{
"name": "Batchfile",
"bytes": "115330"
},
{
"name": "C",
"bytes": "61309502"
},
{
"name": "C#",
"bytes": "702078"
},
{
"name": "C++",
"bytes": "16790255"
},
{
"name": "COBOL",
"bytes": "187"
},
{
"name": "CSS",
"bytes": "641054"
},
{
"name": "GAP",
"bytes": "76344"
},
{
"name": "HTML",
"bytes": "1827679"
},
{
"name": "Java",
"bytes": "6590034"
},
{
"name": "JavaScript",
"bytes": "1828506"
},
{
"name": "MATLAB",
"bytes": "123"
},
{
"name": "Makefile",
"bytes": "360667"
},
{
"name": "Mustache",
"bytes": "20693"
},
{
"name": "NASL",
"bytes": "285"
},
{
"name": "NSIS",
"bytes": "75538"
},
{
"name": "Objective-C",
"bytes": "5257884"
},
{
"name": "Objective-C++",
"bytes": "479778"
},
{
"name": "Perl",
"bytes": "1710"
},
{
"name": "QML",
"bytes": "29477"
},
{
"name": "QMake",
"bytes": "117073"
},
{
"name": "Rebol",
"bytes": "130"
},
{
"name": "Roff",
"bytes": "328967"
},
{
"name": "Ruby",
"bytes": "17391657"
},
{
"name": "SWIG",
"bytes": "65013"
},
{
"name": "Shell",
"bytes": "39045"
},
{
"name": "SourcePawn",
"bytes": "4786"
},
{
"name": "XSLT",
"bytes": "4315"
}
],
"symlink_target": ""
} |
package com.googlecode.jstdmavenplugin;
public interface ProcessExecutor
{
String execute(ProcessConfiguration config);
}
| {
"content_hash": "7a99ff4ccdc44bc826e9816b9128486c",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 48,
"avg_line_length": 18.285714285714285,
"alnum_prop": 0.8125,
"repo_name": "wavesoftware/jstd-maven-plugin",
"id": "7abc8ddeeeb3f278b00b5300bc6fcc63f63a88c0",
"size": "199",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/googlecode/jstdmavenplugin/ProcessExecutor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package jp77.beta.utillib;
public class Queue<T> {
protected Node _First = null;
protected Node _Last = null;
protected int _Length = 0;
public Queue() {}
public Queue(T initial) {
push(initial);
}
public void push(T i) {
final Node TEMP = new Node();
TEMP._Value = i;
if(_Last == null) {
_First = TEMP;
_Last = TEMP;
} else {
_Last._Next = TEMP;
_Last = TEMP;
}
_Length++;
}
public T pop() {
final T TEMP = _First._Value;
_First = _First._Next;
_Length--;
if(_First == null) {
_Last = null;
}
return TEMP;
}
public boolean isEmpty() {
return _Length == 0;
}
public int length() {
return _Length;
}
protected class Node {
public T _Value = null;
public Node _Next = null;
@Override
public String toString() {
return _Value.toString();
}
}
}
| {
"content_hash": "cd7e36c6f66cc8427fce16f6d42d88de",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 31,
"avg_line_length": 13.62295081967213,
"alnum_prop": 0.5812274368231047,
"repo_name": "J-P-77/utilities",
"id": "eabf1ffc54249a859659863eaa350dba6aa19605",
"size": "1982",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/jp77/beta/utillib/Queue.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1642664"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
Ectrogella eunotiae Friedmann, 1952
### Remarks
null | {
"content_hash": "3ee94f0b943de4d087efc53492fb15cb",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 12.615384615384615,
"alnum_prop": 0.725609756097561,
"repo_name": "mdoering/backbone",
"id": "8b3ec53d986ba003b3c75a95783a659b7a301c9f",
"size": "223",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Chromista/Oomycota/Oomycetes/Myzocytiopsidales/Ectrogellaceae/Ectrogella/Ectrogella bacillariacearum/ Syn. Ectrogella eunotiae/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package com.github.dozermapper.core.functional_tests;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
public class UntypedCollectionTest extends AbstractFunctionalTest {
@Before
public void setUp() throws Exception {
super.setUp();
mapper = getMapper("mappings/untypedCollection.xml");
}
@Test
public void testMapperDeepIndexForUntypedList() {
Map<String, String> map = new HashMap<>();
map.put("name", "fooname");
map.put("bars[0]_id", "1234");
map.put("bars[1]_id", "2345");
Foo f = mapper.map(map, Foo.class);
assertThat(f.getName(), equalTo("fooname"));
assertThat(((Bar)f.getBars().get(0)).getId(), equalTo("1234"));
assertThat(((Bar)f.getBars().get(1)).getId(), equalTo("2345"));
Map<String, String> m2 = new HashMap<>();
mapper.map(f, m2);
assertThat(m2.get("name"), equalTo("fooname"));
assertThat(m2.get("bars[0]_id"), equalTo("1234"));
assertThat(m2.get("bars[1]_id"), equalTo("2345"));
}
public static class Bar {
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
public static class Foo {
private String name;
private List bars;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List getBars() {
return bars;
}
public void setBars(List bars) {
this.bars = bars;
}
}
}
| {
"content_hash": "ce2a1a04b971b8474180fb64b9935265",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 71,
"avg_line_length": 23.68831168831169,
"alnum_prop": 0.5729166666666666,
"repo_name": "garethahealy/dozer",
"id": "43769a10269803c612dfce762cea953adbdb83f9",
"size": "2426",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "core/src/test/java/com/github/dozermapper/core/functional_tests/UntypedCollectionTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2318876"
},
{
"name": "Shell",
"bytes": "1703"
}
],
"symlink_target": ""
} |
#include "cyPm.h"
#include "CyLib.h"
/*******************************************************************************
* Function Name: CySysPmSleep
********************************************************************************
*
* Summary:
* Puts the part into the Sleep state. This is a CPU-centric power mode.
* It means that the CPU has indicated that it is in the sleep mode and
* its main clock can be removed. It is identical to Active from a peripheral
* point of view. Any enabled interrupts can cause wakeup from the Sleep mode.
*
* Parameters:
* None
*
* Return:
* None
*
*******************************************************************************/
void CySysPmSleep(void)
{
uint8 interruptState;
interruptState = CyEnterCriticalSection();
/* CM0 enters Sleep mode upon execution of WFI */
CY_PM_CM0_SCR_REG &= (uint32) (~CY_PM_CM0_SCR_SLEEPDEEP);
/* Sleep and wait for interrupt */
CY_PM_WFI;
CyExitCriticalSection(interruptState);
}
/*******************************************************************************
* Function Name: CySysPmDeepSleep
********************************************************************************
*
* Summary:
* Puts the part into the Deep Sleep state. If the firmware attempts to enter
* this mode before the system is ready (that is, when
* PWR_CONTROL.LPM_READY = 0), then the device will go into the Sleep mode
* instead and automatically enter the originally intended mode when the
* holdoff expires.
*
* The wakeup occurs when an interrupt is received from a DeepSleep or
* Hibernate peripheral. For more details, see a corresponding
* peripheral's datasheet.
*
* Parameters:
* None
*
* Return:
* None
*
*******************************************************************************/
void CySysPmDeepSleep(void)
{
uint8 interruptState;
#if(CY_IP_SRSSV2)
volatile uint32 clkSelectReg;
#endif /* (CY_IP_SRSSV2) */
interruptState = CyEnterCriticalSection();
#if(CY_IP_SRSSV2)
/* Device enters DeepSleep mode when CPU asserts SLEEPDEEP signal */
CY_PM_PWR_CONTROL_REG &= (uint32) (~CY_PM_PWR_CONTROL_HIBERNATE);
#endif /* (CY_IP_SRSSV2) */
#if (CY_IP_CPUSS && CY_IP_SRSSV2)
CY_PM_CPUSS_CONFIG_REG |= CY_PM_CPUSS_CONFIG_FLSH_ACC_BYPASS;
#endif /* (CY_IP_CPUSS && CY_IP_SRSSV2) */
/* Adjust delay to wait for references to settle on wakeup from Deep Sleep */
CY_PM_PWR_KEY_DELAY_REG = CY_SFLASH_DPSLP_KEY_DELAY_REG;
/* CM0 enters DeepSleep/Hibernate mode upon execution of WFI */
CY_PM_CM0_SCR_REG |= CY_PM_CM0_SCR_SLEEPDEEP;
#if(CY_IP_SRSSV2)
/* Preserve system clock configuration and
* reduce sysclk to <=12 MHz (Cypress ID #158710, #179888).
*/
clkSelectReg = CY_SYS_CLK_SELECT_REG;
CySysClkWriteSysclkDiv(CY_SYS_CLK_SYSCLK_DIV4);
#endif /* (CY_IP_SRSSV2) */
/* Sleep and wait for interrupt */
CY_PM_WFI;
#if(CY_IP_SRSSV2)
/* Restore system clock configuration */
CY_SYS_CLK_SELECT_REG = clkSelectReg;
#endif /* (CY_IP_SRSSV2) */
#if (CY_IP_CPUSS && CY_IP_SRSSV2)
CY_PM_CPUSS_CONFIG_REG &= (uint32) (~CY_PM_CPUSS_CONFIG_FLSH_ACC_BYPASS);
#endif /* (CY_IP_CPUSS && CY_IP_SRSSV2) */
CyExitCriticalSection(interruptState);
}
#if(CY_IP_SRSSV2)
/*******************************************************************************
* Function Name: CySysPmHibernate
********************************************************************************
*
* Summary:
* Puts the part into the Hibernate state. Only SRAM and UDBs are retained;
* most internal supplies are off. Wakeup is possible from a pin or a hibernate
* comparator only.
*
* It is expected that the firmware has already frozen the IO-Cells using
* CySysPmFreezeIo() function before the call to this function. If this is
* omitted, the IO-cells will be frozen in the same way as they are
* in the Active to Deep Sleep transition, but will lose their state on wake up
* (because of the reset occurring at that time).
*
* Because all the CPU state is lost, the CPU will start up at the reset vector.
* To save the firmware state through the Hibernate low power mode, a
* corresponding variable should be defined with CY_NOINIT attribute. It
* prevents data from being initialized to zero on startup. The interrupt
* cause of the hibernate peripheral is retained, such that it can be either
* read by the firmware or cause an interrupt after the firmware has booted and
* enabled the corresponding interrupt. To distinguish the wakeup from
* the Hibernate mode and the general Reset event, the CySysPmGetResetReason()
* function could be used.
*
* Parameters:
* None
*
* Return:
* None
*
*******************************************************************************/
void CySysPmHibernate(void)
{
uint8 interruptState;
interruptState = CyEnterCriticalSection();
#if (CY_IP_HOBTO_DEVICE)
/* Disable input buffers for all ports */
CySysPmHibPinsDisableInputBuf();
#endif /* (CY_IP_HOBTO_DEVICE) */
/* Device enters Hibernate mode when CPU asserts SLEEPDEEP signal */
CY_PM_PWR_CONTROL_REG |= CY_PM_PWR_CONTROL_HIBERNATE;
/* Adjust delay to wait for references to settle on wakeup from hibernate */
CY_PM_PWR_KEY_DELAY_REG = CY_SFLASH_HIB_KEY_DELAY_REG;
/* CM0 enters DeepSleep/Hibernate mode upon execution of WFI */
CY_PM_CM0_SCR_REG |= CY_PM_CM0_SCR_SLEEPDEEP;
/* Save token that will retain through a STOP/WAKEUP sequence
* thus could be used by CySysPmGetResetReason() to differentiate
* WAKEUP from a general RESET event.
*/
CY_PM_PWR_STOP_REG = (CY_PM_PWR_STOP_REG & (uint32)(~CY_PM_PWR_STOP_TOKEN_MASK)) | CY_PM_PWR_STOP_TOKEN_HIB;
/* Sleep and wait for interrupt. Wakeup from Hibernate is performed
* through RESET state, causing a normal Boot procedure to occur.
* The WFI instruction doesn't put the core to sleep if its wake condition
* is true when the instruction is executed.
*/
CY_PM_WFI;
CyExitCriticalSection(interruptState);
}
/*******************************************************************************
* Function Name: CySysPmStop
********************************************************************************
*
* Summary:
* Puts the part into the Stop state. All internal supplies are off;
* no state is retained.
*
* Wakeup from Stop is performed by toggling the wakeup pin, causing
* a normal boot procedure to occur. To configure the wakeup pin,
* the Digital Input Pin component should be placed on the schematic,
* assigned to the wakeup pin, and resistively pulled up or down to the inverse
* state of the wakeup polarity. To distinguish the wakeup from the Stop mode
* and the general Reset event, CySysPmGetResetReason() function could be used.
* The wakeup pin is active low by default. The wakeup pin polarity
* could be changed with the CySysPmSetWakeupPolarity() function.
*
* This function freezes IO cells implicitly. It is not possible to enter
* the STOP mode before freezing the IO cells. The IO cells remain frozen after
* awake from the Stop mode until the firmware unfreezes them after booting
* explicitly with CySysPmUnfreezeIo() function call.
*
* Parameters:
* None
*
* Return:
* None
*
*******************************************************************************/
void CySysPmStop(void)
{
(void) CyEnterCriticalSection();
/* Update token to indicate Stop mode transition. Preserve only polarity. */
CY_PM_PWR_STOP_REG = (CY_PM_PWR_STOP_REG & CY_PM_PWR_STOP_POLARITY) | CY_PM_PWR_STOP_TOKEN_STOP;
/* Freeze IO-Cells to save IO-Cell state */
CySysPmFreezeIo();
/* Initiates transition to Stop state */
CY_PM_PWR_STOP_REG = CY_PM_PWR_STOP_REG | CY_PM_PWR_STOP_STOP;
/* Depending on the clock frequency and internal timing delays,
* the final AHB transaction may or may not complete. To guard against
* accidentally executing an unintended instruction, it is recommended
* to add 2 NOP cycles after the final write to the STOP register.
*/
CY_NOP;
CY_NOP;
/* Should never get to this WFI instruction */
CY_PM_WFI;
/* Wakeup from Stop is performed by toggling of Wakeup pin,
* causing a normal Boot procedure to occur. No need to exit
* from the critical section.
*/
}
/*******************************************************************************
* Function Name: CySysPmSetWakeupPolarity
********************************************************************************
*
* Summary:
* Wake up from the stop mode is performed by toggling the wakeup pin,
* causing a normal boot procedure to occur. This function assigns
* the wakeup pin active level. Setting the wakeup pin to this level will cause
* the wakeup from stop mode. The wakeup pin is active low by default.
*
* Parameters:
* polarity: Wakeup pin active level:
* Value Define Level
* 0 CY_PM_STOP_WAKEUP_ACTIVE_LOW Logical zero will wakeup the chip
* 1 CY_PM_STOP_WAKEUP_ACTIVE_HIGH Logical one will wakeup the chip
*
* Return:
* None
*
*******************************************************************************/
void CySysPmSetWakeupPolarity(uint32 polarity)
{
uint8 interruptState;
interruptState = CyEnterCriticalSection();
CY_PM_PWR_STOP_REG = (CY_PM_STOP_WAKEUP_ACTIVE_LOW != polarity) ?
(CY_PM_PWR_STOP_REG | CY_PM_PWR_STOP_POLARITY) :
(CY_PM_PWR_STOP_REG & (uint32) (~CY_PM_PWR_STOP_POLARITY));
CyExitCriticalSection(interruptState);
}
/*******************************************************************************
* Function Name: CySysPmGetResetReason
********************************************************************************
*
* Summary:
* Retrieves the last reset reason - transition from OFF/XRES/STOP/HIBERNATE to
* the RESET state. Note that waking up from STOP using XRES will be perceived
* as a general RESET.
*
* Parameters:
* None
*
* Return:
* Reset reason.
* CY_PM_RESET_REASON_UNKN - unknown
* CY_PM_RESET_REASON_XRES - transition from OFF/XRES to RESET
* CY_PM_RESET_REASON_WAKEUP_HIB - transition/wakeup from HIBERNATE to RESET
* CY_PM_RESET_REASON_WAKEUP_STOP - transition/wakeup from STOP to RESET
*
*******************************************************************************/
uint32 CySysPmGetResetReason(void)
{
uint32 reason = CY_PM_RESET_REASON_UNKN;
switch(CY_PM_PWR_STOP_REG & CY_PM_PWR_STOP_TOKEN_MASK)
{
/* Power up, XRES */
case CY_PM_PWR_STOP_TOKEN_XRES:
reason = CY_PM_RESET_REASON_XRES;
break;
/* Wakeup from Hibernate */
case CY_PM_PWR_STOP_TOKEN_HIB:
reason = CY_PM_RESET_REASON_WAKEUP_HIB;
break;
/* Wakeup from Stop (through WAKEUP pin assert) */
case CY_PM_PWR_STOP_TOKEN_STOP:
reason = CY_PM_RESET_REASON_WAKEUP_STOP;
break;
/* Unknown reason */
default:
break;
}
return (reason);
}
/*******************************************************************************
* Function Name: CySysPmFreezeIo
********************************************************************************
*
* Summary:
* Freezes IO-Cells directly to save the IO-Cell state on wake up from the
* Hibernate or Stop state. It is not required to call this function before
* entering the Stop mode, since CySysPmStop() function freezes IO-Cells
* implicitly.
*
* Parameters:
* None
*
* Return:
* None
*
*******************************************************************************/
void CySysPmFreezeIo(void)
{
uint8 interruptState;
interruptState = CyEnterCriticalSection();
/* Check FREEZE state to avoid recurrent IO-Cells freeze attempt,
* since the second call to this function will cause accidental switch
* to the STOP mode (the system will enter STOP mode immediately after
* writing to STOP bit since both UNLOCK and FREEZE have been set correctly
* in a previous call to this function).
*/
if (0u == (CY_PM_PWR_STOP_REG & CY_PM_PWR_STOP_FREEZE))
{
/* Preserve last reset reason and disable overrides the next freeze command by peripherals */
CY_PM_PWR_STOP_REG = CY_PM_PWR_STOP_STOP | CY_PM_PWR_STOP_FREEZE | CY_PM_PWR_STOP_UNLOCK |
(CY_PM_PWR_STOP_REG & (CY_PM_PWR_STOP_TOKEN_MASK | CY_PM_PWR_STOP_POLARITY));
/* If reading after writing, read this register three times to delay
* enough time for internal settling.
*/
(void) CY_PM_PWR_STOP_REG;
(void) CY_PM_PWR_STOP_REG;
/* Second write causes the freeze of IO-Cells to save IO-Cell state */
CY_PM_PWR_STOP_REG = CY_PM_PWR_STOP_REG;
}
CyExitCriticalSection(interruptState);
}
/*******************************************************************************
* Function Name: CySysPmUnfreezeIo
********************************************************************************
*
* Summary:
* The IO-Cells remain frozen after awake from Hibernate or Stop mode until
* the firmware unfreezes them after booting. The call of this function
* unfreezes IO-Cells explicitly.
*
* If the firmware intent is to retain the data value on the port, then the
* value must be read and re-written to the data register before calling this
* API. Furthermore, the drive mode must be re-programmed. If this is not done,
* the pin state will change to default state the moment the freeze is removed.
*
* This API is not available for PSoC 4000 family of devices.
*
* Parameters:
* None
*
* Return:
* None
*
*******************************************************************************/
void CySysPmUnfreezeIo(void)
{
uint8 interruptState;
interruptState = CyEnterCriticalSection();
/* Preserve last reset reason and wakeup polarity. Then, unfreeze I/O:
* write PWR_STOP.FREEZE=0, .UNLOCK=0x3A, .STOP=0, .TOKEN
*/
CY_PM_PWR_STOP_REG = CY_PM_PWR_STOP_UNLOCK |
(CY_PM_PWR_STOP_REG & (CY_PM_PWR_STOP_TOKEN_MASK | CY_PM_PWR_STOP_POLARITY));
/* If reading after writing, read this register three times to delay
* enough time for internal settling.
*/
(void) CY_PM_PWR_STOP_REG;
(void) CY_PM_PWR_STOP_REG;
/* Lock STOP mode: write PWR_STOP.FREEZE=0, UNLOCK=0x00, STOP=0, .TOKEN */
CY_PM_PWR_STOP_REG &= (CY_PM_PWR_STOP_TOKEN_MASK | CY_PM_PWR_STOP_POLARITY);
CyExitCriticalSection(interruptState);
}
#else
/*******************************************************************************
* Function Name: CySysPmSetWakeupHoldoff
********************************************************************************
*
* Summary:
* Sets the Deep Sleep wakeup time by scaling the hold-off to the HFCLK
* frequency.
*
* This function must be called before increasing HFCLK clock frequency. It can
* optionally be called after lowering HFCLK clock frequency in order to improve
* Deep Sleep wakeup time.
*
* It is functionally acceptable to leave the default hold-off setting, but
* Deep Sleep wakeup time may exceed the specification.
*
* This function is applicable only for the 4000 device family.
*
* Parameters:
* uint32 hfclkFrequencyMhz: The HFCLK frequency in MHz.
*
* Return:
* None
*
*******************************************************************************/
void CySysPmSetWakeupHoldoff(uint32 hfclkFrequencyMhz)
{
CY_PM_PWR_KEY_DELAY_REG = ((((uint32)(CY_PM_PWR_KEY_DELAY_REG_DEFAULT << 16u) /
CY_PM_PWR_KEY_DELAY_FREQ_DEFAULT) * hfclkFrequencyMhz) >> 16u) + 1u;
}
#endif /* (CY_IP_SRSSV2) */
/* [] END OF FILE */
| {
"content_hash": "c063817b7315a0f7898407e769c2bc19",
"timestamp": "",
"source": "github",
"line_count": 455,
"max_line_length": 116,
"avg_line_length": 37.23296703296703,
"alnum_prop": 0.5522696416976566,
"repo_name": "jrgdre/1Wire_3LED_PWM",
"id": "7b3aa98d2c544f6a545655ae33cf970752a91880",
"size": "17708",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "Cypress/CY8C4247LQI-BL483/PSoC_Creator3/HelloTLC59731.cydsn/codegentemp/cyPm.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "2698"
},
{
"name": "Assembly",
"bytes": "40744"
},
{
"name": "C",
"bytes": "1839293"
},
{
"name": "C++",
"bytes": "1104937"
},
{
"name": "Eagle",
"bytes": "173725"
},
{
"name": "HTML",
"bytes": "37650"
},
{
"name": "Makefile",
"bytes": "7031"
},
{
"name": "OpenEdge ABL",
"bytes": "15066"
},
{
"name": "PAWN",
"bytes": "915634"
},
{
"name": "Verilog",
"bytes": "4472"
}
],
"symlink_target": ""
} |
{% load prefixed_i18n admin_urls admin_static admin_modify %}
{% set_i18n_prefix 'mtr.sync' %}
<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
<fieldset class="module">
<h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}{% if object_id %}<a href="{% url 'admin:mtr_sync_settings_add' %}?action=export&model={{ app_label }}.{{ inline_admin_formset.formset.prefix|slice:':-1' }}&filter={{ opts.model_name }}_id{{ '='|urlencode }}{{ object_id }}&__use_as_params=true" style="background: rgb(153, 153, 153); padding: 0 5px; display:inline-block; margin: 0 5px; font-size: 10px; height: 16px; line-height: 16px; border-radius: 5px; color: white;">Export</a><a href="{% url 'admin:mtr_sync_settings_add' %}?action=import&model={{ app_label }}.{{ inline_admin_formset.formset.prefix|slice:':-1' }}&filter={{ opts.model_name }}_id{{ '='|urlencode }}{{ object_id }}&__use_as_params=true" style="background: rgb(153, 153, 153); padding: 0 5px; display:inline-block; margin: 0px; font-size: 10px; height: 16px; line-height: 16px; border-radius: 5px; color: white;">Import</a>{% endif %}</h2>
{{ inline_admin_formset.formset.non_form_errors }}
<table>
<thead><tr>
{% for field in inline_admin_formset.fields %}
{% if not field.widget.is_hidden %}
<th{% if forloop.first %} colspan="2"{% endif %}{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }}
{% if field.help_text %} <img src="{% static "admin/img/icon-unknown.gif" %}" class="help help-tooltip" width="10" height="10" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}" />{% endif %}
</th>
{% endif %}
{% endfor %}
{% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %}
</tr></thead>
<tbody>
{% for inline_admin_form in inline_admin_formset %}
{% if inline_admin_form.form.non_field_errors %}
<tr><td colspan="{{ inline_admin_form|cell_count }}">{{ inline_admin_form.form.non_field_errors }}</td></tr>
{% endif %}
<tr class="form-row {% cycle "row1" "row2" %} {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}{% if forloop.last %} empty-form{% endif %}"
id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
<td class="original">
{% if inline_admin_form.original or inline_admin_form.show_url %}<p>
{% if inline_admin_form.original %}
{{ inline_admin_form.original }}
{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="inlinechangelink">{% trans "Change" %}</a>{% endif %}
{% endif %}
{% if inline_admin_form.show_url %}<a href="{{ inline_admin_form.absolute_url }}">{% trans "View on site" %}</a>{% endif %}
</p>{% endif %}
{% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
{{ inline_admin_form.fk_field.field }}
{% spaceless %}
{% for fieldset in inline_admin_form %}
{% for line in fieldset %}
{% for field in line %}
{% if field.field.is_hidden %} {{ field.field }} {% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endspaceless %}
</td>
{% for fieldset in inline_admin_form %}
{% for line in fieldset %}
{% for field in line %}
{% if not field.field.is_hidden %}
<td{% if field.field.name %} class="field-{{ field.field.name }}"{% endif %}>
{% if field.is_readonly %}
<p>{{ field.contents }}</p>
{% else %}
{{ field.field.errors.as_ul }}
{{ field.field }}
{% endif %}
</td>
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
{% if inline_admin_formset.formset.can_delete %}
<td class="delete">{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</fieldset>
</div>
</div>
<script type="text/javascript">
(function($) {
$("#{{ inline_admin_formset.formset.prefix }}-group .tabular.inline-related tbody tr").tabularFormset({
prefix: "{{ inline_admin_formset.formset.prefix }}",
adminStaticPrefix: '{% static "admin/" %}',
addText: "{% blocktrans with inline_admin_formset.opts.verbose_name|capfirst as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}",
deleteText: "{% trans 'Remove' %}"
});
})(django.jQuery);
</script>
| {
"content_hash": "1c7197c3a6dc73656bf4dc43648f820d",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 951,
"avg_line_length": 60.64705882352941,
"alnum_prop": 0.5800193986420951,
"repo_name": "mtrgroup/django-mtr-sync",
"id": "89dc832697f66f11f22da5fbea54939f6d21b5be",
"size": "5155",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "mtr/sync/templates/themes/default/1.9/mtr/sync/admin/edit_inline/tabular.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "192118"
},
{
"name": "Python",
"bytes": "137393"
}
],
"symlink_target": ""
} |
@ECHO OFF
SET mypath=%~dp0
SET casper=%mypath%lib\casperjs\bin
SET phantom=%mypath%lib\phantomjs\bin
REM echo %mypath%
REM echo %casper%
REM echo %phantom%
SET PATH=%PATH%;%casper%;%phantom%
cls
echo %TIME%
echo === RUN ===
echo(
casperjs index.js
echo(
echo === END ===
echo %TIME% | {
"content_hash": "c448facd26cc946df3eb61f1d69e3f8c",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 37,
"avg_line_length": 15.25,
"alnum_prop": 0.6524590163934426,
"repo_name": "cloverink/farm",
"id": "3e10d0c1c07819e41f1befe8cbe55f6db1300ffa",
"size": "305",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "allrecipes/run.bat",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1601"
},
{
"name": "C#",
"bytes": "12208"
},
{
"name": "CoffeeScript",
"bytes": "44022"
},
{
"name": "HTML",
"bytes": "42196"
},
{
"name": "JavaScript",
"bytes": "1192580"
},
{
"name": "Makefile",
"bytes": "1430"
},
{
"name": "PHP",
"bytes": "3883369"
},
{
"name": "Python",
"bytes": "64618"
},
{
"name": "Ruby",
"bytes": "2440"
},
{
"name": "Shell",
"bytes": "2528"
}
],
"symlink_target": ""
} |
layout: post
title: Powershell equivalents of Unix commands
date: 2015-07-08
summary:
categories: [powershell, unix]
---
Windows happens. So do text files. Sometimes, they happen together.
(Put `Cygwin` down.)
### Encodings
Powershell, like the rest of Windows, thinks in UTF-16. One charming consequence of this is that passing an ASCII data file through a Powershell pipeline will double its size on disk. This is often not what you or your sysadmin wants, so instead of redirecting output to a file using `>`,
```posh
> cat data.csv > data_copy.csv
```
use the `out-file` cmdlet (`>` is just synctatic sugar for `out-file` anyway):
```posh
> cat data.csv | out-file data_copy.csv -encoding utf8
```
You can also use `-encoding ascii`.
### `$ $CMD --help`
```posh
> help $CMD
```
The command `help` is an alias for `get-help`. The "REMARKS" section at the bottom of the `help` output has good further pointers, like what command to use to see examples and more detailed information.
### `$ cheat`
(If you're not already using `cheat`, then let me introduce you to [sunshine and rainbows](https://github.com/chrisallenlane/cheat).)
```posh
> get-help $CMD -examples
```
Weirdly, `help $CMD -examples` is presented slightly differently; try both and see which output you prefer.
### `$ head`
```posh
> get-content $FILE -TotalCount 10
> cat $FILE -t 10
```
### `$ tail`
```posh
> get-content $FILE | select-object -last 10
> cat $FILE | select -l 10
```
### `$ grep`, vanilla
```posh
> select-string $PATTERN $FILE
> sls $PATTERN $FILE # sls is a defualt alias only in PowerShell 3.0 and later
```
`select-string` accepts perl regular expressions:
```posh
> (echo "<foo> <bar>" | select-string "<.*?>").matches | select-object -exp value
<foo>
```
You can also use the `-match` command to iterate regexes quickly:
```posh
> "foo bar" -match "b|c"
True
```
### `$ grep`, recursive
```posh
> get-childitem -include *.txt -recurse | select-string $PATTERN
> ls -i *.txt -r | sls $PATTERN
```
### `$ sed`
```posh
> get-content $FILE | % {$_ -replace "$PATTERN","$REPLACEMENT"}
```
You can capture back references with parens `()`, but to reference them it is best to use single quotes `'` around the second argument to `-replace`, otherwise the back references will be evaluated as Powershell variables:
```posh
> $1 = "NOPE"
> "bar" -replace "(bar)","foo $1"
foo NOPE
> "bar" -replace "(bar)",'foo $1'
foo bar
```
### `$ cut`
```posh
> echo 'fst_col,snd_col' | % {$_.split(':')[0]}
fst_col
```
### Further references
* [The kitchen sink](https://www.penflip.com/powershellorg/a-unix-persons-guide-to-powershell)
* [grep translations](https://communary.wordpress.com/2014/11/10/grep-the-powershell-way/)
| {
"content_hash": "29001e839aa74446c2ccee31c045c9b5",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 288,
"avg_line_length": 22.330645161290324,
"alnum_prop": 0.6699169375225713,
"repo_name": "asnr/asnr.github.io",
"id": "f773dc0cc721fa6ebc767e6f289d50fb5f0f1279",
"size": "2773",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2015-07-08-unix-on-powershell.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "24396"
},
{
"name": "HTML",
"bytes": "16816"
},
{
"name": "Ruby",
"bytes": "1844"
}
],
"symlink_target": ""
} |
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->
**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->
| {
"content_hash": "87590e9bd3c617adc92c1fc75f7b0768",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 101,
"avg_line_length": 34.88235294117647,
"alnum_prop": 0.7268128161888702,
"repo_name": "prescottprue/generator-react-firebase",
"id": "fdd12f306e3f8ccca14aef7f52b24236b053624a",
"size": "597",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "219"
},
{
"name": "HTML",
"bytes": "1812"
},
{
"name": "JavaScript",
"bytes": "238696"
},
{
"name": "SCSS",
"bytes": "124"
},
{
"name": "Shell",
"bytes": "125"
},
{
"name": "TypeScript",
"bytes": "5855"
}
],
"symlink_target": ""
} |
package org.apache.batik.gvt;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Area;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
/**
* A shape painter which consists of multiple shape painters.
*
* @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
* @version $Id: CompositeShapePainter.java 1372129 2012-08-12 15:31:50Z helder $
*/
public class CompositeShapePainter implements ShapePainter {
/**
* The shape associated with this painter
*/
protected Shape shape;
/**
* The enclosed <code>ShapePainter</code>s of this composite shape painter.
*/
protected ShapePainter [] painters;
/**
* The number of shape painter.
*/
protected int count;
/**
* Constructs a new empty <code>CompositeShapePainter</code>.
*/
public CompositeShapePainter(Shape shape) {
if (shape == null) {
throw new IllegalArgumentException();
}
this.shape = shape;
}
/**
* Adds the specified shape painter to the shape painter..
*
* @param shapePainter the shape painter to add
*/
public void addShapePainter(ShapePainter shapePainter) {
if (shapePainter == null) {
return;
}
if (shape != shapePainter.getShape()) {
shapePainter.setShape(shape);
}
if (painters == null) {
painters = new ShapePainter[2];
}
if (count == painters.length) {
ShapePainter [] newPainters = new ShapePainter[ count + count/2 + 1];
System.arraycopy(painters, 0, newPainters, 0, count);
painters = newPainters;
}
painters[count++] = shapePainter;
}
/**
* Sets to the specified index, the specified ShapePainter.
*
* @param index the index where to set the ShapePainter
* @param shapePainter the ShapePainter to set
*/
/* public void setShapePainter(int index, ShapePainter shapePainter) {
if (shapePainter == null) {
return;
}
if (this.shape != shapePainter.getShape()) {
shapePainter.setShape(shape);
}
if (painters == null || index >= painters.length) {
throw new IllegalArgumentException("Bad index: "+index);
}
painters[index] = shapePainter;
}*/
/**
* Returns the shape painter at the specified index.
*
* @param index the index of the shape painter to return
*/
public ShapePainter getShapePainter(int index) {
return painters[index];
}
/**
* Returns the number of shape painter of this composite shape painter.
*/
public int getShapePainterCount() {
return count;
}
/**
* Paints the specified shape using the specified Graphics2D.
*
* @param g2d the Graphics2D to use
*/
public void paint(Graphics2D g2d) {
if (painters != null) {
for (int i=0; i < count; ++i) {
painters[i].paint(g2d);
}
}
}
/**
* Returns the area painted by this shape painter.
*/
public Shape getPaintedArea(){
if (painters == null)
return null;
Area paintedArea = new Area();
for (int i=0; i < count; ++i) {
Shape s = painters[i].getPaintedArea();
if (s != null) {
paintedArea.add(new Area(s));
}
}
return paintedArea;
}
/**
* Returns the bounds of the area painted by this shape painter
*/
public Rectangle2D getPaintedBounds2D(){
if (painters == null)
return null;
Rectangle2D bounds = null;
for (int i=0; i < count; ++i) {
Rectangle2D pb = painters[i].getPaintedBounds2D();
if (pb == null) continue;
if (bounds == null) bounds = (Rectangle2D)pb.clone();
else bounds.add(pb);
}
return bounds;
}
/**
* Returns true if pt is in the area painted by this shape painter
*/
public boolean inPaintedArea(Point2D pt){
if (painters == null)
return false;
for (int i=0; i < count; ++i) {
if (painters[i].inPaintedArea(pt))
return true;
}
return false;
}
/**
* Returns the area covered by this shape painter (even if nothing
* is painted there).
*/
public Shape getSensitiveArea() {
if (painters == null)
return null;
Area paintedArea = new Area();
for (int i=0; i < count; ++i) {
Shape s = painters[i].getSensitiveArea();
if (s != null) {
paintedArea.add(new Area(s));
}
}
return paintedArea;
}
/**
* Returns the bounds of the area painted by this shape painter
*/
public Rectangle2D getSensitiveBounds2D() {
if (painters == null)
return null;
Rectangle2D bounds = null;
for (int i=0; i < count; ++i) {
Rectangle2D pb = painters[i].getSensitiveBounds2D();
if (pb == null) continue;
if (bounds == null) bounds = (Rectangle2D)pb.clone();
else bounds.add(pb);
}
return bounds;
}
/**
* Returns true if pt is in the area painted by this shape painter
*/
public boolean inSensitiveArea(Point2D pt){
if (painters == null)
return false;
for (int i=0; i < count; ++i) {
if (painters[i].inSensitiveArea(pt))
return true;
}
return false;
}
/**
* Sets the Shape this shape painter is associated with.
*
* @param shape new shape this painter should be associated with.
* Should not be null.
*/
public void setShape(Shape shape){
if (shape == null) {
throw new IllegalArgumentException();
}
if (painters != null) {
for (int i=0; i < count; ++i) {
painters[i].setShape(shape);
}
}
this.shape = shape;
}
/**
* Gets the Shape this shape painter is associated with.
*
* @return shape associated with this painter
*/
public Shape getShape(){
return shape;
}
}
| {
"content_hash": "384ea70d72013238cd20c42fdfaa0a1e",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 81,
"avg_line_length": 27.56223175965665,
"alnum_prop": 0.5468701339146683,
"repo_name": "ggeorg/WebXView",
"id": "b22f9b516dfe1b2372a65189806839f3bed1e5af",
"size": "7221",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "batik-1.8/sources/org/apache/batik/gvt/CompositeShapePainter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "165"
},
{
"name": "HTML",
"bytes": "10729"
},
{
"name": "Java",
"bytes": "11483426"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<root>
<metadata>
<gencode>11</gencode>
<genomes>
<genome>/tmp/tmplFZ5li/files/000/dataset_14.dat</genome>
</genomes>
<general>
<defaultLocation></defaultLocation>
<trackPadding>20</trackPadding>
<shareLink>true</shareLink>
<aboutDescription></aboutDescription>
<show_tracklist>true</show_tracklist>
<show_nav>true</show_nav>
<show_overview>true</show_overview>
<show_menu>true</show_menu>
<hideGenomeOptions>false</hideGenomeOptions>
</general>
</metadata>
<tracks>
<track cat="With canvas config" format="gene_calls" visibility="default_off">
<files>
<trackFile path="/tmp/tmplFZ5li/files/000/dataset_15.dat" ext="gff3" label="1.gff" />
</files>
<options>
<style>
<className>feature</className>
<description>note,description</description>
<label>name,id</label>
<height>100px</height>
</style>
<scaling>
<method>ignore</method>
<scheme>
<color>__auto__</color>
</scheme>
</scaling>
<menus>
</menus>
<gff>
<trackType>JBrowse/View/Track/CanvasFeatures</trackType>
<index>false</index>
</gff>
</options>
</track>
</tracks>
</root>
| {
"content_hash": "43184083a4ca98e7ff391809b344442c",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 99,
"avg_line_length": 33.26,
"alnum_prop": 0.46422128683102826,
"repo_name": "blankclemens/tools-iuc",
"id": "930b55afab632cb48ba3d410a69fb09dc8062008",
"size": "1663",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "tools/jbrowse/test-data/track_config/test.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "57633"
},
{
"name": "Mako",
"bytes": "2116"
},
{
"name": "Python",
"bytes": "289193"
},
{
"name": "R",
"bytes": "478"
},
{
"name": "Shell",
"bytes": "781"
}
],
"symlink_target": ""
} |
package org.apache.hadoop.fs.viewfs;
import java.io.DataOutputStream;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FileSystemTestHelper;
import org.apache.hadoop.fs.FsConstants;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.TestTrash;
import org.apache.hadoop.fs.Trash;
import org.apache.hadoop.fs.TrashPolicyDefault;
import org.apache.hadoop.fs.contract.ContractTestUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.*;
import static org.apache.hadoop.fs.viewfs.Constants.*;
import static org.junit.Assert.*;
public class TestViewFsTrash {
FileSystem fsTarget; // the target file system - the mount will point here
FileSystem fsView;
Configuration conf;
private FileSystemTestHelper fileSystemTestHelper;
@Before
public void setUp() throws Exception {
Configuration targetFSConf = new Configuration();
targetFSConf.setClass("fs.file.impl", TestTrash.TestLFS.class, FileSystem.class);
fsTarget = FileSystem.getLocal(targetFSConf);
fileSystemTestHelper = new FileSystemTestHelper(fsTarget.getHomeDirectory().toUri().getPath());
conf = ViewFileSystemTestSetup.createConfig();
fsView = ViewFileSystemTestSetup.setupForViewFileSystem(conf, fileSystemTestHelper, fsTarget);
conf.set("fs.defaultFS", FsConstants.VIEWFS_URI.toString());
/*
* Need to set the fs.file.impl to TestViewFsTrash.TestLFS. Otherwise, it will load
* LocalFileSystem implementation which uses System.getProperty("user.home") for homeDirectory.
*/
conf.setClass("fs.file.impl", TestTrash.TestLFS.class, FileSystem.class);
}
@After
public void tearDown() throws Exception {
ViewFileSystemTestSetup.tearDown(fileSystemTestHelper, fsTarget);
fsTarget.delete(new Path(fsTarget.getHomeDirectory(), ".Trash/Current"),
true);
}
@Test
public void testTrash() throws Exception {
TestTrash.trashShell(conf, fileSystemTestHelper.getTestRootPath(fsView),
fsView, new Path(fileSystemTestHelper.getTestRootPath(fsView), ".Trash/Current"));
}
@Test
public void testLocalizedTrashInMoveToAppropriateTrash() throws IOException {
Configuration conf2 = new Configuration(conf);
Path testFile = new Path("/data/testfile.txt");
// Enable moveToTrash and add a mount point for /data
conf2.setLong(FS_TRASH_INTERVAL_KEY, 1);
ConfigUtil.addLink(conf2, "/data", new Path(fileSystemTestHelper.getAbsoluteTestRootPath(fsTarget), "data").toUri());
// Default case. file should be moved to fsTarget.getTrashRoot()/resolvedPath
conf2.setBoolean(CONFIG_VIEWFS_TRASH_FORCE_INSIDE_MOUNT_POINT, false);
try (FileSystem fsView2 = FileSystem.get(conf2)) {
FileSystemTestHelper.createFile(fsView2, testFile);
Path resolvedFile = fsView2.resolvePath(testFile);
Trash.moveToAppropriateTrash(fsView2, testFile, conf2);
Trash trash = new Trash(fsTarget, conf2);
Path movedPath = Path.mergePaths(trash.getCurrentTrashDir(testFile), resolvedFile);
ContractTestUtils.assertPathExists(fsTarget, "File not in trash", movedPath);
}
// Turn on localized trash. File should be moved to viewfs:/data/.Trash/{user}/Current.
conf2.setBoolean(CONFIG_VIEWFS_TRASH_FORCE_INSIDE_MOUNT_POINT, true);
try (FileSystem fsView2 = FileSystem.get(conf2)) {
FileSystemTestHelper.createFile(fsView2, testFile);
Trash.moveToAppropriateTrash(fsView2, testFile, conf2);
Trash trash = new Trash(fsView2, conf2);
Path movedPath = Path.mergePaths(trash.getCurrentTrashDir(testFile), testFile);
ContractTestUtils.assertPathExists(fsView2, "File not in localized trash", movedPath);
}
}
}
| {
"content_hash": "8931a65fd195c1f23bddb89e41f59736",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 121,
"avg_line_length": 41.287234042553195,
"alnum_prop": 0.7562483895903118,
"repo_name": "wwjiang007/hadoop",
"id": "06cbdab8d210f454367d8921766caea283864808",
"size": "4687",
"binary": false,
"copies": "3",
"ref": "refs/heads/trunk",
"path": "hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsTrash.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "78535"
},
{
"name": "C",
"bytes": "2056400"
},
{
"name": "C++",
"bytes": "3158543"
},
{
"name": "CMake",
"bytes": "155815"
},
{
"name": "CSS",
"bytes": "93744"
},
{
"name": "Dockerfile",
"bytes": "4613"
},
{
"name": "HTML",
"bytes": "219491"
},
{
"name": "Handlebars",
"bytes": "207062"
},
{
"name": "Java",
"bytes": "99857858"
},
{
"name": "JavaScript",
"bytes": "1279860"
},
{
"name": "Python",
"bytes": "21600"
},
{
"name": "SCSS",
"bytes": "23607"
},
{
"name": "Shell",
"bytes": "536501"
},
{
"name": "TLA",
"bytes": "14997"
},
{
"name": "TSQL",
"bytes": "31503"
},
{
"name": "TeX",
"bytes": "19322"
},
{
"name": "XSLT",
"bytes": "18026"
}
],
"symlink_target": ""
} |
package com.asakusafw.lang.compiler.analyzer.model;
import java.lang.reflect.AnnotatedElement;
import java.util.Objects;
import com.asakusafw.lang.compiler.model.graph.Operator;
import com.asakusafw.lang.compiler.model.graph.Operator.OperatorKind;
/**
* Represents origin of operators.
* @since 0.3.0
*/
public class OperatorSource {
private final Operator.OperatorKind operatorKind;
private final AnnotatedElement origin;
/**
* Creates a new instance.
* @param operatorKind the analyzing operator kind
* @param origin the original element
*/
public OperatorSource(OperatorKind operatorKind, AnnotatedElement origin) {
Objects.requireNonNull(operatorKind);
Objects.requireNonNull(origin);
this.operatorKind = operatorKind;
this.origin = origin;
}
/**
* Returns the operator kind.
* @return the operator kind
*/
public Operator.OperatorKind getOperatorKind() {
return operatorKind;
}
/**
* Returns the original element.
* @return the original element
*/
public AnnotatedElement getOrigin() {
return origin;
}
}
| {
"content_hash": "410508daeacdd9109226193e87bbc979",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 79,
"avg_line_length": 24.76595744680851,
"alnum_prop": 0.6881443298969072,
"repo_name": "akirakw/asakusafw-compiler",
"id": "3e2a4b2b6a39e70fdfc5339d027658425cf8f060",
"size": "1776",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "compiler-project/analyzer/src/main/java/com/asakusafw/lang/compiler/analyzer/model/OperatorSource.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5186"
},
{
"name": "Java",
"bytes": "3295484"
},
{
"name": "Shell",
"bytes": "7112"
}
],
"symlink_target": ""
} |
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.01.16 at 12:57:08 PM IST
//
package org.akomantoso.schema.v3.csd13;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <extension base="{http://docs.oasis-open.org/legaldocml/ns/akn/3.0/CSD13}inline">
* <attGroup ref="{http://docs.oasis-open.org/legaldocml/ns/akn/3.0/CSD13}link"/>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "affectedDocument")
public class AffectedDocument
extends ComplexTypeInline
{
@XmlAttribute(name = "href", required = true)
@XmlSchemaType(name = "anyURI")
protected String href;
/**
* Gets the value of the href property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getHref() {
return href;
}
/**
* Sets the value of the href property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setHref(String value) {
this.href = value;
}
}
| {
"content_hash": "01f405cf1e6bf49d5c0e5fc6942d3413",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 122,
"avg_line_length": 26.43661971830986,
"alnum_prop": 0.6563665423548215,
"repo_name": "lewismc/akomantoso-lib",
"id": "4ff798e7c18fdafe97d34dbdbd30e94c8222c0d2",
"size": "1877",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/org/akomantoso/schema/v3/csd13/AffectedDocument.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "10761509"
},
{
"name": "Shell",
"bytes": "650"
}
],
"symlink_target": ""
} |
let Statment = require('../base').Statment;
let events = require('../../events');
let RuntimeError = require('../../../basics/errors').RuntimeError;
module.exports = Statment.extend('ACTION','UPDATE', {
}, {
$init(target, context){
this.target = target;
this.context = context;
},
async exec(eenv){
let statment = await this.target.__update__(eenv, null);
if (!this.target["#addressable"]){
statment = await statment.__solve__(eenv);
}
let updated = await statment.__update__(eenv, this.context);
await this.target.__assign__(
eenv,
updated
);
return null;
}
}, [
'no-context',
'only-exec',
'not-signable',
'not-encloseable'
]);
| {
"content_hash": "4a8f5af1055aa65d0b5c03840fb7dde1",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 66,
"avg_line_length": 22.233333333333334,
"alnum_prop": 0.6326836581709145,
"repo_name": "onzag/NotionScript",
"id": "621527f53a8c6d8ad9db861af10b130f7ee7e9c7",
"size": "667",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "eenv/statments/ACTION/UPDATE.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "141515"
},
{
"name": "Python",
"bytes": "10483"
}
],
"symlink_target": ""
} |
title: "Class 10: Atomic Design and HTML Wireframing"
date: 2016-11-01 12:00:00
description: "We'll also talk about wireframing templates with HTML, how the atomic design methodology helps create more consistent web design systems and work on your next project assignment in class. <i>Special Guest - ipsoCreative</i>"
assignment: <a href="../assignments/wireframes">HTML Content Wireframes</a> (due in two weeks) and <a href="../assignments/layout2">Boxes and Layout</a> (due in two weeks)
reading: <ul><li><i>Responsive Web Design</i> - Ch. 5 Becoming Responsive</li><li><a href="http://bradfrost.com/blog/post/html-wireframes/">HTML Wireframes by Brad Frost</a></li><li><a href="http://bradfrost.com/blog/post/atomic-web-design/">Atomic Web Design by Brad Frost</a></li><li><a href="http://daverupert.com/2013/04/responsive-deliverables/">Responsive Deliverables by Dave Rupert</a></li></ul>
due: <a href="../assignments/layout">Fonts and Media Queries</a>
part: "4"
layout: wide
semester: fall-2016
slides: "/class/slides/10/10-Slides-RWD.pdf"
status: blog-post-date--past
---
| {
"content_hash": "0718304878d4d6b90ff57ff1119a497b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 403,
"avg_line_length": 83.3076923076923,
"alnum_prop": 0.7423822714681441,
"repo_name": "KentStateWeb/rwd",
"id": "532b2395f21b6f8cf0a7e788b242b6a53ed17e65",
"size": "1087",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "_classes/fall-2016/10.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "72778"
},
{
"name": "HTML",
"bytes": "2054605"
},
{
"name": "JavaScript",
"bytes": "1216"
},
{
"name": "Ruby",
"bytes": "8180"
}
],
"symlink_target": ""
} |
@interface SparklerGenericVersionComparatorTest : SenTestCase {
}
- (void)testGenericVersionComparison;
- (void)testRevisionNumberComparison;
- (void)testPreReleaseVersionComparison;
@end
| {
"content_hash": "2e5f127306266850bb3d3262e7189c86",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 63,
"avg_line_length": 17.90909090909091,
"alnum_prop": 0.8020304568527918,
"repo_name": "eczarny/sparkler",
"id": "6c43bb5eb4ef0647cd54714ec3f27f06e532f315",
"size": "238",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Unit Tests/SparklerGenericVersionComparatorTest.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "88540"
}
],
"symlink_target": ""
} |
package com.mindoo.domino.jna.richtext.conversion;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Simple subclass of {@link AbstractMailMergeConversion} that uses a from/to
* map to find/replace matches
*
* @author Karsten Lehmann
*/
public class SimpleMailMergeConversion extends AbstractMailMergeConversion {
private Map<Pattern,String> m_fromPatternToString;
@Override
public void richtextNavigationStart() {
}
@Override
public void richtextNavigationEnd() {
}
/**
* Creates a new instance
*
* @param fromTo from/to map of search string and replacement
* @param ignoreCase true to ignore the case when searching
*/
public SimpleMailMergeConversion(Map<String,String> fromTo, boolean ignoreCase) {
m_fromPatternToString = new HashMap<Pattern,String>();
for (Entry<String,String> currEntry : fromTo.entrySet()) {
String currFrom = currEntry.getKey();
String currTo = currEntry.getValue();
String currFromPattern = Pattern.quote(currFrom);
Pattern pattern = ignoreCase ? Pattern.compile(currFromPattern, Pattern.CASE_INSENSITIVE) : Pattern.compile(currFromPattern);
m_fromPatternToString.put(pattern, currTo);
}
}
@Override
protected boolean containsMatch(String txt) {
for (Pattern currPattern : m_fromPatternToString.keySet()) {
if (currPattern.matcher(txt).find()) {
return true;
}
}
return false;
}
@Override
protected String replaceAllMatches(String txt) {
String currTxt = txt;
StringBuffer sb = new StringBuffer();
for (Entry<Pattern,String> currEntry : m_fromPatternToString.entrySet()) {
Pattern currPattern = currEntry.getKey();
String currTo = currEntry.getValue();
Matcher m = currPattern.matcher(currTxt);
while (m.find()) {
m.appendReplacement(sb, currTo);
}
m.appendTail(sb);
currTxt = sb.toString();
sb.setLength(0);
}
return currTxt;
}
}
| {
"content_hash": "d7b8b26fe478dab8a181f5f3c3856290",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 128,
"avg_line_length": 26.506666666666668,
"alnum_prop": 0.7243460764587525,
"repo_name": "klehmann/domino-jna",
"id": "0d2b25673a79d0e0227ade588665e538322a284c",
"size": "1988",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "domino-jna/src/main/java/com/mindoo/domino/jna/richtext/conversion/SimpleMailMergeConversion.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "4878523"
}
],
"symlink_target": ""
} |
package org.knowm.xchange.examples.bleutrade.account;
import java.io.IOException;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.bleutrade.service.BleutradeAccountServiceRaw;
import org.knowm.xchange.currency.Currency;
import org.knowm.xchange.examples.bleutrade.BleutradeDemoUtils;
import org.knowm.xchange.service.account.AccountService;
public class BleutradeAccountDemo {
public static void main(String[] args) throws IOException, InterruptedException {
Exchange bleutrade = BleutradeDemoUtils.getExchange();
AccountService accountService = bleutrade.getAccountService();
// generic(accountService);
raw((BleutradeAccountServiceRaw) accountService);
}
private static void generic(AccountService accountService) throws IOException, InterruptedException {
System.out.println(accountService.requestDepositAddress(Currency.BTC));
Thread.sleep(1000);
System.out.println(accountService.getAccountInfo());
Thread.sleep(1000);
}
private static void raw(BleutradeAccountServiceRaw accountService) throws IOException {
System.out.println(accountService.getBleutradeBalance("BTC"));
}
}
| {
"content_hash": "26f23ced2093d44835001651d2d0d03d",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 103,
"avg_line_length": 32.91428571428571,
"alnum_prop": 0.7977430555555556,
"repo_name": "jheusser/XChange",
"id": "9f7626c8bbed67142a44beb57907e92246675482",
"size": "1152",
"binary": false,
"copies": "6",
"ref": "refs/heads/develop",
"path": "xchange-examples/src/main/java/org/knowm/xchange/examples/bleutrade/account/BleutradeAccountDemo.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "4633820"
}
],
"symlink_target": ""
} |
package com.cardpay.pccredit.report.service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cardpay.pccredit.manager.service.AccountManagerParameterService;
import com.cardpay.pccredit.report.dao.StatisticalTableDao;
import com.cardpay.pccredit.report.dao.comdao.StatisticalTableCommDao;
import com.cardpay.pccredit.report.model.StatisticalTable;
import com.cardpay.pccredit.report.util.DateUtils;
import com.wicresoft.jrad.base.database.dao.common.CommonDao;
import com.wicresoft.util.date.DateHelper;
/**
*
* 描述 :客户经理每日统计信息
* @author 张石树
*
* 2014-12-8 下午5:55:24
*/
@Service
public class StatisticalTableScheduleService {
private Logger logger = Logger.getLogger(StatisticalTableScheduleService.class);
@Autowired
private StatisticalTableDao statisticalTableDao;
@Autowired
private StatisticalTableCommDao statisticalTableCommDao;
@Autowired
private AccountManagerParameterService accountManagerParameterService;
@Autowired
private CommonDao commonDao;
/**
* 统计客户经理每天的信息
* @param filter
* @return
*/
public void addStatisticalTable(){
Calendar calendar = Calendar.getInstance();
String createDateStr = DateHelper.getDateFormat(calendar.getTime(), "yyyy-MM-dd");
int year = calendar.get(Calendar.YEAR);
int yearDay = calendar.get(Calendar.DAY_OF_YEAR);
try {
//统计客户经理 发卡数、激活卡数、激活总额度、到卡数、授信总额度
//获取前一天
String fmt = "yyyy-MM-dd";
SimpleDateFormat sdf = new SimpleDateFormat(fmt);
Date date = new Date();
String dateStr = sdf.format(date);
//statisticalTableDao.statisticalTableInfo(DateUtils.getSpecifiedDayBefore(dateStr));
statisticalTableDao.statisticalTableInfo(dateStr);
//透支本金额度(单位:分) 透支总额度(单位:分) 日均透支本金(单位:分) 日均透支总额度(单位:分)
List<HashMap<String, Object>> list = statisticalTableCommDao.getManagerStatisticalData();
for (Iterator<HashMap<String, Object>> iterator = list.iterator(); iterator.hasNext();) {
HashMap<String, Object> map = (HashMap<String, Object>) iterator.next();
String managerId = (String) map.get("MANAGERID");
String productId = (String) map.get("PRODUCTID");
BigDecimal principalOverdraft = (BigDecimal) map.get("PRINCIPALOVERDRAFT");
BigDecimal totalAmountOverdraft = (BigDecimal) map.get("TOTALAMOUNTOVERDRAFT");
BigDecimal averagePrincipalOverdraft = principalOverdraft.divide(new BigDecimal(yearDay),2);
BigDecimal averageTotalAmountOverdraft = totalAmountOverdraft.divide(new BigDecimal(yearDay),2);
if(StringUtils.isNotEmpty(managerId)){
StatisticalTable statisticalTable = statisticalTableCommDao.getStatisticalTable(dateStr, managerId, productId);
if(statisticalTable != null){
statisticalTable.setOverdraftPrincipal(principalOverdraft.longValue() + "");
statisticalTable.setOverdraftAmount(totalAmountOverdraft.longValue() + "");
statisticalTable.setOverdraftPrincipalAverage(averagePrincipalOverdraft.longValue() + "");
statisticalTable.setOverdraftAmountAverage(averageTotalAmountOverdraft.longValue() + "");
statisticalTable.setBadOverdraftPrincipal("0");
statisticalTable.setRateOfPrincipal("00.00%");
commonDao.updateObject(statisticalTable);
}
}
/*if(StringUtils.isNotEmpty(managerId)){
StatisticalTable statisticalTable = statisticalTableCommDao.getStatisticalTable(createDateStr, managerId, productId);
if(statisticalTable != null){
statisticalTable.setOverdraftPrincipal(principalOverdraft.longValue() + "");
statisticalTable.setOverdraftAmount(totalAmountOverdraft.longValue() + "");
List<HashMap<String, Object>> tempList = statisticalTableCommDao.getManagerAverageDailyOverdraft(year, managerId);
if(tempList != null && tempList.size() > 0){
HashMap<String, Object> tempMap = tempList.get(0);
BigDecimal tempPrincipalOverdraft = (BigDecimal) tempMap.get("PRINCIPALOVERDRAFT");
BigDecimal tempTotalAmountOverdraft = (BigDecimal) tempMap.get("TOTALAMOUNTOVERDRAFT");
BigDecimal averagePrincipalOverdraft = tempPrincipalOverdraft.divide(new BigDecimal(yearDay));
BigDecimal averageTotalAmountOverdraft = tempTotalAmountOverdraft.divide(new BigDecimal(yearDay));
statisticalTable.setOverdraftPrincipalAverage(averagePrincipalOverdraft.longValue() + "");
statisticalTable.setOverdraftAmountAverage(averageTotalAmountOverdraft.longValue() + "");
commonDao.updateObject(statisticalTable);
}
}
}*/
}
//不良透支本金余额
List<HashMap<String, Object>> list2 = statisticalTableCommDao.getManagerStatisticalDataBuLiang();
for (Iterator<HashMap<String, Object>> iterator = list2.iterator(); iterator.hasNext();) {
HashMap<String, Object> map = (HashMap<String, Object>) iterator.next();
String managerId = (String) map.get("MANAGERID");
String productId = (String) map.get("PRODUCTID");
BigDecimal principalOverdraft = (BigDecimal) map.get("PRINCIPALOVERDRAFT");//不良透支本金
if(StringUtils.isNotEmpty(managerId)){
StatisticalTable statisticalTable = statisticalTableCommDao.getStatisticalTable(dateStr, managerId, productId);
if(statisticalTable != null){
statisticalTable.setBadOverdraftPrincipal(principalOverdraft.longValue() + "");
//不良率
BigDecimal tzbj = new BigDecimal(statisticalTable.getOverdraftPrincipal());//透支本金
statisticalTable.setRateOfPrincipal(principalOverdraft.divide(tzbj,2).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP)+"%");//两位小数
commonDao.updateObject(statisticalTable);
}
}
}
} catch (Exception e) {
e.printStackTrace();
logger.error("addStatisticalTable schedule error.", e);
}
}
}
| {
"content_hash": "a3e120cb8c29c53c0b78d3f68b5d0f63",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 155,
"avg_line_length": 46.34848484848485,
"alnum_prop": 0.743543641712978,
"repo_name": "wangxu2013/PCCREDIT",
"id": "6cc1244dd9c2012e42e2fefd8b22cea8aafc600a",
"size": "6376",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/java/com/cardpay/pccredit/report/service/StatisticalTableScheduleService.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "105232"
},
{
"name": "HTML",
"bytes": "2885558"
},
{
"name": "Java",
"bytes": "3697101"
},
{
"name": "JavaScript",
"bytes": "1048678"
},
{
"name": "PLSQL",
"bytes": "29784"
}
],
"symlink_target": ""
} |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['db_invalid_connection_str'] = 'Unable to determine the database settings based on the connection string you submitted.';
$lang['db_unable_to_connect'] = 'Unable to connect to your database server using the provided settings.';
$lang['db_unable_to_select'] = 'Unable to select the specified database: %s';
$lang['db_unable_to_create'] = 'Unable to create the specified database: %s';
$lang['db_invalid_query'] = 'The query you submitted is not valid.';
$lang['db_must_set_table'] = 'You must set the database table to be used with your query.';
$lang['db_must_use_set'] = 'You must use the "set" method to update an entry.';
$lang['db_must_use_index'] = 'You must specify an index to match on for batch updates.';
$lang['db_batch_missing_index'] = 'One or more rows submitted for batch updating is missing the specified index.';
$lang['db_must_use_where'] = 'Updates are not allowed unless they contain a "where" clause.';
$lang['db_del_must_use_where'] = 'Deletes are not allowed unless they contain a "where" or "like" clause.';
$lang['db_field_param_missing'] = 'To fetch fields requires the name of the table as a parameter.';
$lang['db_unsupported_function'] = 'This feature is not available for the database you are using.';
$lang['db_transaction_failure'] = 'Transaction failure: Rollback performed.';
$lang['db_unable_to_drop'] = 'Unable to drop the specified database.';
$lang['db_unsupported_feature'] = 'Unsupported feature of the database platform you are using.';
$lang['db_unsupported_compression'] = 'The file compression format you chose is not supported by your server.';
$lang['db_filepath_error'] = 'Unable to write data to the file path you have submitted.';
$lang['db_invalid_cache_path'] = 'The cache path you submitted is not valid or writable.';
$lang['db_table_name_required'] = 'A table name is required for that operation.';
$lang['db_column_name_required'] = 'A column name is required for that operation.';
$lang['db_column_definition_required'] = 'A column definition is required for that operation.';
$lang['db_unable_to_set_charset'] = 'Unable to set client connection character set: %s';
$lang['db_error_heading'] = 'A Database Error Occurred';
| {
"content_hash": "5e71e24396be7c6f7e380eb9813c502b",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 127,
"avg_line_length": 80.57142857142857,
"alnum_prop": 0.7291666666666666,
"repo_name": "flagholder/php_ci_test",
"id": "b9da89b14d15699f0fe29ef0221ece44404729f0",
"size": "3937",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "system/language/english/db_lang.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "39314"
},
{
"name": "C",
"bytes": "2283"
},
{
"name": "CSS",
"bytes": "298364"
},
{
"name": "HTML",
"bytes": "25778"
},
{
"name": "JavaScript",
"bytes": "11116"
},
{
"name": "Makefile",
"bytes": "467"
},
{
"name": "PHP",
"bytes": "2351549"
}
],
"symlink_target": ""
} |
using namespace uth;
Engine::Engine()
: m_running(false)
{ }
bool Engine::Init(const uth::WindowSettings &wsettings)
{
m_wsettings = wsettings;
return initialize();
}
void Engine::Update()
{
const float deltaTime = static_cast<float>(m_timer.DeltaTime());
uthInput.Update(deltaTime);
uthSceneM.Update(deltaTime);
if(m_wndw->processMessages())
{
Exit();
}
}
void Engine::Draw()
{
m_wndw->Clear(m_clearColor.x, m_clearColor.y, m_clearColor.z, m_clearColor.w);
uthSceneM.Draw();
m_wndw->swapBuffers();
}
void Engine::Exit()
{
m_running = false;
}
void Engine::SetClearColor(const pmath::Vec4& color)
{
m_clearColor = color;
}
void Engine::SetClearColor(float r, float g, float b, float a)
{
SetClearColor(pmath::Vec4(r, g, b, a));
}
Window& Engine::GetWindow()
{
return *m_wndw;
}
bool Engine::initialize()
{
m_wndw = new Window(m_wsettings);
uth::Graphics::SetBlendFunction(true, uth::SRC_ALPHA, uth::ONE_MINUS_SRC_ALPHA);
uthInput.SetWindow(m_wndw->m_windowHandle);
m_wndw->SetViewport(pmath::Rect(0, 0, m_wsettings.size.x, m_wsettings.size.y));
m_running = true;
return true;
}
const Timer& Engine::Timer() const
{
return m_timer;
}
const pmath::Vec2 Engine::GetWindowResolution() const
{
return m_wsettings.size;
}
const bool Engine::Running() const
{
return m_running;
}
void Engine::SetWindow(void* handle)
{
m_wndw = (Window*)handle;
} | {
"content_hash": "7de300a774bb3398779dabe4e4b9c603",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 83,
"avg_line_length": 17.4875,
"alnum_prop": 0.6854896354538956,
"repo_name": "Team-Innis/UtH-Engine",
"id": "925054f8b00d6f6ce942e165ecbf9c3da98ae361",
"size": "1545",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Engine/Engine.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3106335"
},
{
"name": "C++",
"bytes": "856486"
},
{
"name": "Java",
"bytes": "394"
},
{
"name": "Shell",
"bytes": "287"
}
],
"symlink_target": ""
} |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2016 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
from .tektronixMDO4000 import *
class tektronixMDO4054B(tektronixMDO4000):
"Tektronix MDO4054B IVI oscilloscope driver"
def __init__(self, *args, **kwargs):
self.__dict__.setdefault('_instrument_id', 'MDO4054B')
super(tektronixMDO4054B, self).__init__(*args, **kwargs)
self._analog_channel_count = 4
self._digital_channel_count = 16
self._channel_count = self._analog_channel_count + self._digital_channel_count
self._bandwidth = 500e6
self._init_channels()
| {
"content_hash": "d01ea40720a1dcb2fa15d06f722478ad",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 86,
"avg_line_length": 39.19047619047619,
"alnum_prop": 0.7545565006075334,
"repo_name": "Diti24/python-ivi",
"id": "13904508d6be7e8e0af2d6c949d5824e776dfef7",
"size": "1646",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ivi/tektronix/tektronixMDO4054B.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "1992462"
}
],
"symlink_target": ""
} |
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h2>Detalle de la competencia</h2>
</div>
</div>
<div class="container">
<div class="row" align="center">
<a href="<?= base_url('administrar_indicadores');?>">«Regresar</a>
<div class="col-md-12" align="center">
<div class="form-group">
<div align="center">
<div id="alert" style="display:none" class="alert alert-danger" role="alert" style="max-width:400px;">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
<label id="msg"></label>
</div>
<div id="alert_success" style="display:none" class="alert alert-success" role="alert" style="max-width:400px;">
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
<label id="msg_success"></label>
</div>
</div>
</div>
</div>
</div>
<form id="update" role="form" method="post" action="javascript:" class="form-signin">
<input type="hidden" id="id" value="<?= $competencia->id;?>">
<div class="row" align="center">
<div class="col-md-3">
<div class="form-group">
<label for="nombre">Nombre:</label>
<input name="nombre" type="text" class="form-control" style="max-width:300px; text-align:center;"
id="nombre" required value="<?= $competencia->nombre; ?>">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="indicador">Indicador:</label>
<select id="indicador" class="form-control" style="max-width:300px; text-align:center">
<?php foreach ($indicadores as $indicador) : ?>
<option value="<?= $indicador->id;?>" <?php if($indicador->id == $competencia->indicador) echo"selected";?>>
<?= $indicador->nombre;?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="descripcion">Descripción:</label>
<textarea id="descripcion" class="form-control" style="max-width:300px;text-align:center" rows="3"
required><?= $competencia->descripcion;?></textarea>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="resumen">Resumen:</label>
<textarea id="resumen" class="form-control" style="max-width:300px;text-align:center" rows="3"
required><?= $competencia->resumen;?></textarea>
</div>
</div>
</div>
<div style="height:60px" class="row" align="center">
<div class="col-md-12">
<button type="submit" class="btn btn-lg btn-primary btn-block" style="max-width:200px; text-align:center;">
Actualizar Datos</button>
<span style="float:right;">
<label onclick="$('#update').hide('slow');$('#comportamientos').show('slow');" style="cursor:pointer;">
Ver/Asignar Comportamientos</label>
</span>
</div>
</div>
</form>
<div id="comportamientos" style="display:none" class="row" align="center">
<div class="col-md-12">
<label>Comportamientos</label>
</div>
<div class="col-md-5">
<div class="panel panel-primary">
<div class="panel-heading">Comportamientos Asignados</div>
<div class="row">
<select id="quitar" name="quitar" class="form-control" style="max-width:450px">
<option selected disabled>-- Selecciona un comportamiento --</option>
<?php foreach($competencia->comportamientos as $comportamiento) : ?>
<option value="<?= $comportamiento->id;?>"><?= $comportamiento->descripcion;?></option>
<?php endforeach; ?>
</select>
</div>
<div align="center"><div id="cargando" style="display:none; color: green;">
<img src="<?= base_url('assets/images/loading.gif');?>"></div></div>
<div class="row" id="result"></div>
</div>
</div>
<div class="col-md-2">
<div class="form-group"> </div>
<div class="form-group">
<button type="button" id="btnQuitar" class="form-control" style="max-width:100px;" disabled>Quitar»</button>
</div>
<div class="form-group">
<button type="button" id="btnAgregar" class="form-control" style="max-width:100px;">«Agregar</button>
</div>
<div class="form-group"> </div>
</div>
<div class="col-md-5">
<div class="panel panel-primary" style="min-height:200px">
<div class="panel-heading">Asignar Comportamiento</div>
<div class="input-group" style="min-height:70px">
<span class="input-group-addon">Comportamiento</span>
</div>
<input id="comportamiento" type="text" class="form-control" value="" placeholder="Descripción">
<select id="posicion" name="posicion" multiple class="form-control"
style="overflow-y:auto;overflow-x:auto;min-height:130px;max-height:300px">
<option value="8">Analista</option>
<option value="7">Consultor</option>
<option value="6">Consultor Sr</option>
<option value="5">Gerente / Master</option>
<option value="4">Gerente Sr / Experto</option>
<option value="3">Director</option>
</select>
</div>
</div>
<div class="col-md-12">
<span style="float:right;">
<label onclick="$('#comportamientos').hide('slow');$('#update').show('slow');" style="cursor:pointer;">
Ver información general</label>
</span>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#btnAgregar').click(function() {
if($('#comportamiento').val().length > 0 && $('#posicion :selected').length > 0){
var comportamiento = $('#comportamiento').val();
var competencia = <?= $competencia->id;?>;
var selected = [];
$('#posicion :selected').each(function(i,select) {
selected[i] = $(select).val();
});
$.ajax({
url:'<?= base_url("competencia/add_comportamiento");?>',
data:{'competencia':competencia,'comportamiento':comportamiento,'selected':selected},
type:'POST',
success:function(data) {
var returnData = JSON.parse(data);
if(returnData['msg'] == "ok"){
$('#quitar').append($('<option>',{value:returnData['id']}).text(comportamiento));
$('#posicion :selected').each(function(i,select) {
$(select).removeAttr("selected");
});
$('#comportamiento').val("");
$('#alert_success').prop('display',true).show();
$('#msg_success').html(returnData['msg_success']);
setTimeout(function() {
$("#alert_success").fadeOut(1500);
},3000);
}else{
$('#alert').prop('display',true).show();
$('#msg').html(returnData['msg']);
setTimeout(function() {
$("#alert").fadeOut(1500);
},3000);
}
}
});
}
});
$('#btnQuitar').click(function() {
if($('#quitar :selected').length > 0){
var selected = [];
$('#quitar :selected').each(function(i,select) {
selected = $(select).val();
});
$.ajax({
url:'<?= base_url("competencia/del_comportamiento");?>',
data:{'selected':selected},
type:'POST',
success:function(data) {
console.log(data);
var returnData = JSON.parse(data);
if(returnData['msg'] == "ok"){
$('#quitar :selected').each(function(i,select) {
$('#quitar').find(select).remove();
});
$('#alert_success').prop('display',true).show();
$('#msg_success').html(returnData['msg_success']);
setTimeout(function() {
$("#alert_success").fadeOut(1500);
},3000);
}else{
$('#alert').prop('display',true).show();
$('#msg').html(returnData['msg']);
setTimeout(function() {
$("#alert").fadeOut(1500);
},3000);
}
}
});
}
});
$("#quitar").change(function() {
$('#btnQuitar').prop('disabled',false);
$("#quitar option:selected").each(function() {
comportamiento = $('#quitar').val();
});
$.ajax({
type: 'post',
url: "<?= base_url('competencia/load_posiciones_comportamiento');?>",
data: {comportamiento : comportamiento},
beforeSend: function (xhr) {
$('#result').hide();
$('#cargando').show();
},
success: function(data) {
$("#result").show().html(data);
$('#cargando').hide();
}
});
});
$('#update').submit(function(event){
id = $('#id').val();
nombre = $('#nombre').val();
$("#indicador option:selected").each(function() {
indicador = $('#indicador').val();
});
descripcion = $('#descripcion').val();
resumen = $('#resumen').val();
$.ajax({
url: '<?= base_url("competencia/update");?>',
type: 'post',
data: {'id':id,'nombre':nombre,'descripcion':descripcion,'indicador':indicador,'resumen':resumen},
success: function(data){
var returnData = JSON.parse(data);
console.log(returnData['msg']);
if(returnData['msg']=="ok")
window.document.location='<?= base_url("administrar_indicadores");?>';
else{
$('#alert').prop('display',true).show();
$('#msg').html(returnData['msg']);
setTimeout(function() {
$("#alert").fadeOut(1500);
},3000);
}
}
});
event.preventDefault();
});
});
</script> | {
"content_hash": "f74667fd2265d60f768559cbaf1ed853",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 117,
"avg_line_length": 36.744,
"alnum_prop": 0.5869801872414544,
"repo_name": "jesusadvanzer/advanzer",
"id": "5b93cb096d11cbfade53d59f5b55fc4388243066",
"size": "9189",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "application/views/competencia/detalle.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "707"
},
{
"name": "CSS",
"bytes": "67771"
},
{
"name": "HTML",
"bytes": "5372956"
},
{
"name": "JavaScript",
"bytes": "1777097"
},
{
"name": "PHP",
"bytes": "8386200"
}
],
"symlink_target": ""
} |
from threading import Event
import os
from sys import exc_info
import netrc
import errno
from offlineimap.repository.Base import BaseRepository
from offlineimap import folder, imaputil, imapserver, OfflineImapError
from offlineimap.folder.UIDMaps import MappedIMAPFolder
from offlineimap.threadutil import ExitNotifyThread
from offlineimap.utils.distro import get_os_sslcertfile, get_os_sslcertfile_searchpath
class IMAPRepository(BaseRepository):
def __init__(self, reposname, account):
"""Initialize an IMAPRepository object."""
BaseRepository.__init__(self, reposname, account)
# self.ui is being set by the BaseRepository
self._host = None
self._oauth2_request_url = None
self.imapserver = imapserver.IMAPServer(self)
self.folders = None
# Only set the newmail_hook in an IMAP repository.
if self.config.has_option(self.getsection(), 'newmail_hook'):
self.newmail_hook = self.localeval.eval(
self.getconf('newmail_hook'))
if self.getconf('sep', None):
self.ui.info("The 'sep' setting is being ignored for IMAP "
"repository '%s' (it's autodetected)"% self)
def startkeepalive(self):
keepalivetime = self.getkeepalive()
if not keepalivetime: return
self.kaevent = Event()
self.kathread = ExitNotifyThread(target = self.imapserver.keepalive,
name = "Keep alive " + self.getname(),
args = (keepalivetime, self.kaevent))
self.kathread.setDaemon(1)
self.kathread.start()
def stopkeepalive(self):
if not hasattr(self, 'kaevent'):
# Keepalive is not active.
return
self.kaevent.set()
del self.kathread
del self.kaevent
def holdordropconnections(self):
if not self.getholdconnectionopen():
self.dropconnections()
def dropconnections(self):
self.imapserver.close()
def getholdconnectionopen(self):
if self.getidlefolders():
return 1
return self.getconfboolean("holdconnectionopen", 0)
def getkeepalive(self):
num = self.getconfint("keepalive", 0)
if num == 0 and self.getidlefolders():
return 29*60
else:
return num
def getsep(self):
"""Return the folder separator for the IMAP repository
This requires that self.imapserver has been initialized with an
acquireconnection() or it will still be `None`"""
assert self.imapserver.delim != None, "'%s' " \
"repository called getsep() before the folder separator was " \
"queried from the server"% self
return self.imapserver.delim
def gethost(self):
"""Return the configured hostname to connect to
:returns: hostname as string or throws Exception"""
if self._host: # use cached value if possible
return self._host
# 1) check for remotehosteval setting
if self.config.has_option(self.getsection(), 'remotehosteval'):
host = self.getconf('remotehosteval')
try:
host = self.localeval.eval(host)
except Exception as e:
raise OfflineImapError("remotehosteval option for repository "
"'%s' failed:\n%s"% (self, e), OfflineImapError.ERROR.REPO), \
None, exc_info()[2]
if host:
self._host = host
return self._host
# 2) check for plain remotehost setting
host = self.getconf('remotehost', None)
if host != None:
self._host = host
return self._host
# no success
raise OfflineImapError("No remote host for repository "
"'%s' specified."% self, OfflineImapError.ERROR.REPO)
def get_remote_identity(self):
"""Remote identity is used for certain SASL mechanisms
(currently -- PLAIN) to inform server about the ID
we want to authorize as instead of our login name."""
return self.getconf('remote_identity', default=None)
def get_auth_mechanisms(self):
supported = ["GSSAPI", "XOAUTH2", "CRAM-MD5", "PLAIN", "LOGIN"]
# Mechanisms are ranged from the strongest to the
# weakest ones.
# TODO: we need DIGEST-MD5, it must come before CRAM-MD5
# TODO: due to the chosen-plaintext resistance.
default = ["GSSAPI", "XOAUTH2", "CRAM-MD5", "PLAIN", "LOGIN"]
mechs = self.getconflist('auth_mechanisms', r',\s*',
default)
for m in mechs:
if m not in supported:
raise OfflineImapError("Repository %s: "% self + \
"unknown authentication mechanism '%s'"% m,
OfflineImapError.ERROR.REPO)
self.ui.debug('imap', "Using authentication mechanisms %s" % mechs)
return mechs
def getuser(self):
user = None
localeval = self.localeval
if self.config.has_option(self.getsection(), 'remoteusereval'):
user = self.getconf('remoteusereval')
if user != None:
return localeval.eval(user)
if self.config.has_option(self.getsection(), 'remoteuser'):
user = self.getconf('remoteuser')
if user != None:
return user
try:
netrcentry = netrc.netrc().authenticators(self.gethost())
except IOError as inst:
if inst.errno != errno.ENOENT:
raise
else:
if netrcentry:
return netrcentry[0]
try:
netrcentry = netrc.netrc('/etc/netrc').authenticators(self.gethost())
except IOError as inst:
if inst.errno not in (errno.ENOENT, errno.EACCES):
raise
else:
if netrcentry:
return netrcentry[0]
def getport(self):
port = None
if self.config.has_option(self.getsection(), 'remoteporteval'):
port = self.getconf('remoteporteval')
if port != None:
return self.localeval.eval(port)
return self.getconfint('remoteport', None)
def getipv6(self):
return self.getconfboolean('ipv6', None)
def getssl(self):
return self.getconfboolean('ssl', 1)
def getsslclientcert(self):
xforms = [os.path.expanduser, os.path.expandvars, os.path.abspath]
return self.getconf_xform('sslclientcert', xforms, None)
def getsslclientkey(self):
xforms = [os.path.expanduser, os.path.expandvars, os.path.abspath]
return self.getconf_xform('sslclientkey', xforms, None)
def getsslcacertfile(self):
"""Determines CA bundle.
Returns path to the CA bundle. It is either explicitely specified
or requested via "OS-DEFAULT" value (and we will search known
locations for the current OS and distribution).
If search via "OS-DEFAULT" route yields nothing, we will throw an
exception to make our callers distinguish between not specified
value and non-existent default CA bundle.
It is also an error to specify non-existent file via configuration:
it will error out later, but, perhaps, with less verbose explanation,
so we will also throw an exception. It is consistent with
the above behaviour, so any explicitely-requested configuration
that doesn't result in an existing file will give an exception.
"""
xforms = [os.path.expanduser, os.path.expandvars, os.path.abspath]
cacertfile = self.getconf_xform('sslcacertfile', xforms, None)
if self.getconf('sslcacertfile', None) == "OS-DEFAULT":
cacertfile = get_os_sslcertfile()
if cacertfile == None:
searchpath = get_os_sslcertfile_searchpath()
if searchpath:
reason = "Default CA bundle was requested, "\
"but no existing locations available. "\
"Tried %s." % (", ".join(searchpath))
else:
reason = "Default CA bundle was requested, "\
"but OfflineIMAP doesn't know any for your "\
"current operating system."
raise OfflineImapError(reason, OfflineImapError.ERROR.REPO)
if cacertfile is None:
return None
if not os.path.isfile(cacertfile):
reason = "CA certfile for repository '%s' couldn't be found. "\
"No such file: '%s'" % (self.name, cacertfile)
raise OfflineImapError(reason, OfflineImapError.ERROR.REPO)
return cacertfile
def gettlslevel(self):
return self.getconf('tls_level', 'tls_compat')
def getsslversion(self):
return self.getconf('ssl_version', None)
def get_ssl_fingerprint(self):
"""Return array of possible certificate fingerprints.
Configuration item cert_fingerprint can contain multiple
comma-separated fingerprints in hex form."""
value = self.getconf('cert_fingerprint', "")
return [f.strip().lower() for f in value.split(',') if f]
def getoauth2_request_url(self):
if self._oauth2_request_url: # Use cached value if possible.
return self._oauth2_request_url
oauth2_request_url = self.getconf('oauth2_request_url', None)
if oauth2_request_url != None:
self._oauth2_request_url = oauth2_request_url
return self._oauth2_request_url
#raise OfflineImapError("No remote oauth2_request_url for repository "
#"'%s' specified."% self, OfflineImapError.ERROR.REPO)
def getoauth2_refresh_token(self):
return self.getconf('oauth2_refresh_token', None)
def getoauth2_access_token(self):
return self.getconf('oauth2_access_token', None)
def getoauth2_client_id(self):
return self.getconf('oauth2_client_id', None)
def getoauth2_client_secret(self):
return self.getconf('oauth2_client_secret', None)
def getpreauthtunnel(self):
return self.getconf('preauthtunnel', None)
def gettransporttunnel(self):
return self.getconf('transporttunnel', None)
def getreference(self):
return self.getconf('reference', '')
def getdecodefoldernames(self):
return self.getconfboolean('decodefoldernames', 0)
def getidlefolders(self):
localeval = self.localeval
return localeval.eval(self.getconf('idlefolders', '[]'))
def getmaxconnections(self):
num1 = len(self.getidlefolders())
num2 = self.getconfint('maxconnections', 1)
return max(num1, num2)
def getexpunge(self):
return self.getconfboolean('expunge', 1)
def getpassword(self):
"""Return the IMAP password for this repository.
It tries to get passwords in the following order:
1. evaluate Repository 'remotepasseval'
2. read password from Repository 'remotepass'
3. read password from file specified in Repository 'remotepassfile'
4. read password from ~/.netrc
5. read password from /etc/netrc
On success we return the password.
If all strategies fail we return None."""
# 1. evaluate Repository 'remotepasseval'
passwd = self.getconf('remotepasseval', None)
if passwd != None:
return self.localeval.eval(passwd)
# 2. read password from Repository 'remotepass'
password = self.getconf('remotepass', None)
if password != None:
return password
# 3. read password from file specified in Repository 'remotepassfile'
passfile = self.getconf('remotepassfile', None)
if passfile != None:
fd = open(os.path.expanduser(passfile))
password = fd.readline().strip()
fd.close()
return password
# 4. read password from ~/.netrc
try:
netrcentry = netrc.netrc().authenticators(self.gethost())
except IOError as inst:
if inst.errno != errno.ENOENT:
raise
else:
if netrcentry:
user = self.getuser()
if user == None or user == netrcentry[0]:
return netrcentry[2]
# 5. read password from /etc/netrc
try:
netrcentry = netrc.netrc('/etc/netrc').authenticators(self.gethost())
except IOError as inst:
if inst.errno not in (errno.ENOENT, errno.EACCES):
raise
else:
if netrcentry:
user = self.getuser()
if user == None or user == netrcentry[0]:
return netrcentry[2]
# no strategy yielded a password!
return None
def getfolder(self, foldername):
"""Return instance of OfflineIMAP representative folder."""
return self.getfoldertype()(self.imapserver, foldername, self)
def getfoldertype(self):
return folder.IMAP.IMAPFolder
def connect(self):
imapobj = self.imapserver.acquireconnection()
self.imapserver.releaseconnection(imapobj)
def forgetfolders(self):
self.folders = None
def getfolders(self):
"""Return a list of instances of OfflineIMAP representative folder."""
if self.folders != None:
return self.folders
retval = []
imapobj = self.imapserver.acquireconnection()
# check whether to list all folders, or subscribed only
listfunction = imapobj.list
if self.getconfboolean('subscribedonly', False):
listfunction = imapobj.lsub
try:
listresult = listfunction(directory = self.imapserver.reference)[1]
finally:
self.imapserver.releaseconnection(imapobj)
for s in listresult:
if s == None or \
(isinstance(s, basestring) and s == ''):
# Bug in imaplib: empty strings in results from
# literals. TODO: still relevant?
continue
flags, delim, name = imaputil.imapsplit(s)
flaglist = [x.lower() for x in imaputil.flagsplit(flags)]
if '\\noselect' in flaglist:
continue
foldername = imaputil.dequote(name)
retval.append(self.getfoldertype()(self.imapserver, foldername,
self))
# Add all folderincludes
if len(self.folderincludes):
imapobj = self.imapserver.acquireconnection()
try:
for foldername in self.folderincludes:
try:
imapobj.select(foldername, readonly = True)
except OfflineImapError as e:
# couldn't select this folderinclude, so ignore folder.
if e.severity > OfflineImapError.ERROR.FOLDER:
raise
self.ui.error(e, exc_info()[2],
'Invalid folderinclude:')
continue
retval.append(self.getfoldertype()(
self.imapserver, foldername, self))
finally:
self.imapserver.releaseconnection(imapobj)
if self.foldersort is None:
# default sorting by case insensitive transposed name
retval.sort(key=lambda x: str.lower(x.getvisiblename()))
else:
# do foldersort in a python3-compatible way
# http://bytes.com/topic/python/answers/844614-python-3-sorting-comparison-function
def cmp2key(mycmp):
"""Converts a cmp= function into a key= function
We need to keep cmp functions for backward compatibility"""
class K:
def __init__(self, obj, *args):
self.obj = obj
def __cmp__(self, other):
return mycmp(self.obj.getvisiblename(), other.obj.getvisiblename())
return K
retval.sort(key=cmp2key(self.foldersort))
self.folders = retval
return self.folders
def makefolder(self, foldername):
"""Create a folder on the IMAP server
This will not update the list cached in :meth:`getfolders`. You
will need to invoke :meth:`forgetfolders` to force new caching
when you are done creating folders yourself.
:param foldername: Full path of the folder to be created."""
if self.getreference():
foldername = self.getreference() + self.getsep() + foldername
if not foldername: # Create top level folder as folder separator
foldername = self.getsep()
self.ui.makefolder(self, foldername)
if self.account.dryrun:
return
imapobj = self.imapserver.acquireconnection()
try:
result = imapobj.create(foldername)
if result[0] != 'OK':
raise OfflineImapError("Folder '%s'[%s] could not be created. "
"Server responded: %s"% (foldername, self, str(result)),
OfflineImapError.ERROR.FOLDER)
finally:
self.imapserver.releaseconnection(imapobj)
class MappedIMAPRepository(IMAPRepository):
def getfoldertype(self):
return MappedIMAPFolder
| {
"content_hash": "040af6d6c6a9390032265b72b35c5b7b",
"timestamp": "",
"source": "github",
"line_count": 462,
"max_line_length": 95,
"avg_line_length": 38.18614718614719,
"alnum_prop": 0.593583493934928,
"repo_name": "frioux/offlineimap",
"id": "60d5a08f666eb345e6dcf63ca2d340f19c23c528",
"size": "18458",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "offlineimap/repository/IMAP.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "2022"
},
{
"name": "Python",
"bytes": "543162"
},
{
"name": "Shell",
"bytes": "12224"
}
],
"symlink_target": ""
} |
package org.brackit.server.store.index.bracket;
import org.brackit.server.node.DocID;
import org.brackit.server.node.XTCdeweyID;
import org.brackit.server.store.SearchMode;
/**
* @author Martin Hiller
*
*/
public enum NavigationMode {
NEXT_SIBLING(SearchMode.GREATEST_HAVING_PREFIX) {
@Override
public XTCdeweyID getSearchKey(XTCdeweyID referenceKey)
{
return referenceKey;
}
@Override
public boolean isAfterHighKey(XTCdeweyID referenceKey,
XTCdeweyID highKey)
{
return referenceKey.isPrefixOrGreater(highKey);
}
},
PREVIOUS_SIBLING(SearchMode.LESS) {
@Override
public XTCdeweyID getSearchKey(XTCdeweyID referenceKey)
{
return referenceKey;
}
@Override
public boolean isAfterHighKey(XTCdeweyID referenceKey,
XTCdeweyID highKey)
{
return (referenceKey.compareReduced(highKey) > 0);
}
},
FIRST_CHILD(SearchMode.GREATEST_HAVING_PREFIX) {
@Override
public XTCdeweyID getSearchKey(XTCdeweyID referenceKey)
{
return referenceKey.getAttributeRootID();
}
@Override
public boolean isAfterHighKey(XTCdeweyID referenceKey,
XTCdeweyID highKey)
{
// return true if referenceKey's attribute root is a prefix or greater than the highKey
return referenceKey.isPrefixOrGreater(1, highKey);
}
},
LAST_CHILD(SearchMode.GREATEST_HAVING_PREFIX) {
@Override
public XTCdeweyID getSearchKey(XTCdeweyID referenceKey)
{
return referenceKey;
}
@Override
public boolean isAfterHighKey(XTCdeweyID referenceKey,
XTCdeweyID highKey)
{
return referenceKey.isPrefixOrGreater(highKey);
}
},
PARENT(SearchMode.GREATER) {
@Override
public XTCdeweyID getSearchKey(XTCdeweyID referenceKey)
{
return referenceKey.getParent();
}
@Override
public boolean isAfterHighKey(XTCdeweyID referenceKey,
XTCdeweyID highKey)
{
return (referenceKey.compareParentTo(highKey) >= 0);
}
},
TO_INSERT_POS(SearchMode.GREATER) {
@Override
public XTCdeweyID getSearchKey(XTCdeweyID referenceKey)
{
return referenceKey;
}
@Override
public boolean isAfterHighKey(XTCdeweyID referenceKey,
XTCdeweyID highKey)
{
return (referenceKey.compareReduced(highKey) >= 0);
}
},
TO_KEY(SearchMode.GREATER) {
@Override
public XTCdeweyID getSearchKey(XTCdeweyID referenceKey)
{
return referenceKey;
}
@Override
public boolean isAfterHighKey(XTCdeweyID referenceKey,
XTCdeweyID highKey)
{
return (referenceKey.compareReduced(highKey) >= 0);
}
},
NEXT_ATTRIBUTE(SearchMode.GREATER) {
@Override
public XTCdeweyID getSearchKey(XTCdeweyID referenceKey)
{
return referenceKey;
}
@Override
public boolean isAfterHighKey(XTCdeweyID referenceKey,
XTCdeweyID highKey)
{
return (referenceKey.compareReduced(highKey) >= 0);
}
},
LAST(SearchMode.LAST) {
private final XTCdeweyID searchKey = new XTCdeweyID(new DocID(Integer.MAX_VALUE, 0));
@Override
public XTCdeweyID getSearchKey(XTCdeweyID referenceKey)
{
return searchKey;
}
@Override
public boolean isAfterHighKey(XTCdeweyID referenceKey,
XTCdeweyID highKey)
{
return (referenceKey.compareReduced(highKey) >= 0);
}
},
NEXT_DOCUMENT(SearchMode.GREATER) {
@Override
public XTCdeweyID getSearchKey(XTCdeweyID referenceKey)
{
return new XTCdeweyID(new DocID(referenceKey.docID.getCollectionID(), referenceKey.docID.getDocNumber() + 1));
}
@Override
public boolean isAfterHighKey(XTCdeweyID referenceKey,
XTCdeweyID highKey)
{
return referenceKey.docID.compareTo(highKey.docID) >= 0;
}
};
private SearchMode searchMode;
private NavigationMode(SearchMode searchMode) {
this.searchMode = searchMode;
}
public SearchMode getSearchMode() {
return searchMode;
}
public abstract XTCdeweyID getSearchKey(XTCdeweyID referenceKey);
/**
* This check utilizes the highkeys stored in the leaf pages.
* It returns true if the current leaf page can be skipped during this navigation operation.
* @param referenceKey the reference key of the current navigation operation
* @param highKey the current leaf page's highKey
* @return true if target node certainly lies in the next page(s)
*/
public abstract boolean isAfterHighKey(XTCdeweyID referenceKey, XTCdeweyID highKey);
}
| {
"content_hash": "3aefea1c2e47fa23e9a091f7b6c337e3",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 113,
"avg_line_length": 24.75977653631285,
"alnum_prop": 0.7157039711191335,
"repo_name": "x-clone/brackit.brackitdb",
"id": "42cabd7a165fbc1810cf96cc6216f477368f9ee8",
"size": "6088",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "brackitdb-server/src/main/java/org/brackit/server/store/index/bracket/NavigationMode.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "3513442"
}
],
"symlink_target": ""
} |
<?php
/**
* Abstract class for extension
*/
require_once 'Zend/View/Helper/FormElement.php';
/**
* Helper to generate a set of radio button elements
*
* @category Zend
* @package Zend_View
* @subpackage Helper
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_View_Helper_FormRadio extends Zend_View_Helper_FormElement
{
/**
* Input type to use
* @var string
*/
protected $_inputType = 'radio';
/**
* Whether or not this element represents an array collection by default
* @var bool
*/
protected $_isArray = false;
/**
* Generates a set of radio button elements.
*
* @access public
*
* @param string|array $name If a string, the element name. If an
* array, all other parameters are ignored, and the array elements
* are extracted in place of added parameters.
*
* @param mixed $value The radio value to mark as 'checked'.
*
* @param array $options An array of key-value pairs where the array
* key is the radio value, and the array value is the radio text.
*
* @param array|string $attribs Attributes added to each radio.
*
* @return string The radio buttons XHTML.
*/
public function formRadio($name, $value = null, $attribs = null,
$options = null, $listsep = "<br />\n")
{
$info = $this->_getInfo($name, $value, $attribs, $options, $listsep);
extract($info); // name, value, attribs, options, listsep, disable
// retrieve attributes for labels (prefixed with 'label_' or 'label')
$label_attribs = array();
foreach ($attribs as $key => $val) {
$tmp = false;
$keyLen = strlen($key);
if ((6 < $keyLen) && (substr($key, 0, 6) == 'label_')) {
$tmp = substr($key, 6);
} elseif ((5 < $keyLen) && (substr($key, 0, 5) == 'label')) {
$tmp = substr($key, 5);
}
if ($tmp) {
// make sure first char is lowercase
$tmp[0] = strtolower($tmp[0]);
$label_attribs[$tmp] = $val;
unset($attribs[$key]);
}
}
$labelPlacement = 'append';
foreach ($label_attribs as $key => $val) {
switch (strtolower($key)) {
case 'placement':
unset($label_attribs[$key]);
$val = strtolower($val);
if (in_array($val, array('prepend', 'append'))) {
$labelPlacement = $val;
}
break;
}
}
// the radio button values and labels
$options = (array) $options;
// build the element
$xhtml = '';
$list = array();
// should the name affect an array collection?
$name = $this->view->escape($name);
if ($this->_isArray && ('[]' != substr($name, -2))) {
$name .= '[]';
}
// ensure value is an array to allow matching multiple times
$value = (array) $value;
// Set up the filter - Alnum + hyphen + underscore
require_once 'Zend/Filter/PregReplace.php';
$pattern = @preg_match('/\pL/u', 'a')
? '/[^\p{L}\p{N}\-\_]/u' // Unicode
: '/[^a-zA-Z0-9\-\_]/'; // No Unicode
$filter = new Zend_Filter_PregReplace($pattern, "");
// add radio buttons to the list.
foreach ($options as $opt_value => $opt_label) {
// Should the label be escaped?
if ($escape) {
$opt_label = $this->view->escape($opt_label);
}
// is it disabled?
$disabled = '';
if (true === $disable) {
$disabled = ' disabled="disabled"';
} elseif (is_array($disable) && in_array($opt_value, $disable)) {
$disabled = ' disabled="disabled"';
}
// is it checked?
$checked = '';
if (in_array($opt_value, $value)) {
$checked = ' checked="checked"';
}
// generate ID
$optId = $id . '-' . $filter->filter($opt_value);
// Wrap the radios in labels
$radio = '<label'
. $this->_htmlAttribs($label_attribs) . '>'
. (('prepend' == $labelPlacement) ? $opt_label : '')
. '<input type="' . $this->_inputType . '"'
. ' name="' . $name . '"'
. ' id="' . $optId . '"'
. ' value="' . $this->view->escape($opt_value) . '"'
. $checked
. $disabled
. $this->_htmlAttribs($attribs)
. $this->getClosingBracket()
. (('append' == $labelPlacement) ? $opt_label : '')
. '</label>';
// add to the array of radio buttons
$list[] = $radio;
}
// XHTML or HTML for standard list separator?
if (!$this->_isXhtml() && false !== strpos($listsep, '<br />')) {
$listsep = str_replace('<br />', '<br>', $listsep);
}
// done!
$xhtml .= implode($listsep, $list);
return $xhtml;
}
}
| {
"content_hash": "aec70fa9651e6027454432c75927924a",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 87,
"avg_line_length": 32.55952380952381,
"alnum_prop": 0.4753199268738574,
"repo_name": "weierophinney/zf1",
"id": "941324258e4c724187d8d495de7199d543d38f7d",
"size": "6182",
"binary": false,
"copies": "52",
"ref": "refs/heads/master",
"path": "library/Zend/View/Helper/FormRadio.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "40638"
},
{
"name": "JavaScript",
"bytes": "30081"
},
{
"name": "PHP",
"bytes": "31409780"
},
{
"name": "PowerShell",
"bytes": "1028"
},
{
"name": "Puppet",
"bytes": "770"
},
{
"name": "Ruby",
"bytes": "10"
},
{
"name": "Shell",
"bytes": "10511"
},
{
"name": "TypeScript",
"bytes": "3445"
}
],
"symlink_target": ""
} |
module RSpec
module Mocks
module ArgumentMatchers
RSpec.describe ArrayIncludingMatcher do
it "describes itself properly" do
expect(ArrayIncludingMatcher.new([1, 2, 3]).description).to eq "array_including(1, 2, 3)"
end
it "describes passed matchers" do
description = array_including(fake_matcher(Object.new)).description
expect(description).to include(MatcherHelpers.fake_matcher_description)
end
context "passing" do
it "matches the same array" do
expect(array_including([1, 2, 3])).to be === [1, 2, 3]
end
it "matches the same array, specified without square brackets" do
expect(array_including(1, 2, 3)).to be === [1, 2, 3]
end
it "matches the same array, specified without square brackets" do
expect(array_including(1, 2, 3)).to be === [1, 2, 3]
end
it "matches the same array, which includes nested arrays" do
expect(array_including([1, 2], 3, 4)).to be === [[1, 2], 3, 4]
end
it "works with duplicates in expected" do
expect(array_including(1, 1, 2, 3)).to be === [1, 2, 3]
end
it "works with duplicates in actual" do
expect(array_including(1, 2, 3)).to be === [1, 1, 2, 3]
end
it "is composable with other matchers" do
klass = Class.new
dbl = double
expect(dbl).to receive(:a_message).with(3, array_including(instance_of(klass)))
dbl.a_message(3, [1, klass.new, 4])
end
# regression check
it "is composable when nested" do
expect(array_including(1, array_including(2, 3), 4)).to be === [1, [2, 3], 4]
expect([[1, 2], 3, 4]).to match array_including(array_including(1, 2), 3, 4)
expect([1,[1,2]]).to match array_including(1, array_including(1,2))
end
end
context "failing" do
it "fails when not all the entries in the expected are present" do
expect(array_including(1, 2, 3, 4, 5)).not_to be === [1, 2]
end
it "fails when passed a composed matcher is pased and not satisfied" do
with_unfulfilled_double do |dbl|
expect {
klass = Class.new
expect(dbl).to receive(:a_message).with(3, array_including(instance_of(klass)))
dbl.a_message(3, [1, 4])
}.to fail_with(/expected: \(3, array_including\(an_instance_of\(\)\)\)/)
end
end
end
end
end
end
end
| {
"content_hash": "ea2b1bccff32313ac260caaac76ccc62",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 99,
"avg_line_length": 36.41095890410959,
"alnum_prop": 0.5485327313769752,
"repo_name": "rspec/rspec-mocks",
"id": "219250ff9389c813469cb7b1352f5eaadbf20d60",
"size": "2658",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "spec/rspec/mocks/array_including_matcher_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Gherkin",
"bytes": "108114"
},
{
"name": "Ruby",
"bytes": "736885"
},
{
"name": "Shell",
"bytes": "16233"
}
],
"symlink_target": ""
} |
function test_dimmer_settings() {
$.fn.dimmer.settings.error.method = 'method';
$.fn.dimmer.settings.namespace = 'namespace';
$.fn.dimmer.settings.name = 'name';
$.fn.dimmer.settings.silent = false;
$.fn.dimmer.settings.debug = true;
$.fn.dimmer.settings.performance = true;
$.fn.dimmer.settings.verbose = true;
}
function test_dimmer() {
const selector = '.ui.dimmer';
$(selector).dimmer('add content', $()) === $();
$(selector).dimmer('show') === $();
$(selector).dimmer('hide') === $();
$(selector).dimmer('toggle') === $();
$(selector).dimmer('set opacity', 1) === $();
$(selector).dimmer('create') === $();
$(selector).dimmer('get duration') === 10;
$(selector).dimmer('get dimmer') === $();
$(selector).dimmer('has dimmer') === true;
$(selector).dimmer('is active') === true;
$(selector).dimmer('is animating') === true;
$(selector).dimmer('is dimmer') === true;
$(selector).dimmer('is dimmable') === true;
$(selector).dimmer('is disabled') === true;
$(selector).dimmer('is enabled') === true;
$(selector).dimmer('is page') === true;
$(selector).dimmer('is page dimmer') === true;
$(selector).dimmer('set active') === $();
$(selector).dimmer('set dimmable') === $();
$(selector).dimmer('set dimmed') === $();
$(selector).dimmer('set page dimmer') === $();
$(selector).dimmer('set disabled') === $();
$(selector).dimmer('destroy') === $();
$(selector).dimmer('setting', 'debug', undefined) === false;
$(selector).dimmer('setting', 'debug') === false;
$(selector).dimmer('setting', 'debug', true) === $();
$(selector).dimmer('setting', {
namespace: 'namespace',
name: 'name',
silent: false,
debug: true,
performance: true,
verbose: true
}) === $();
$(selector).dimmer({
opacity: 1,
variation: 'variation',
dimmerName: 'dimmerName',
closable: true,
on: 'click',
useCSS: true,
duration: {
show: 200,
hide: 300
},
transition: 'fade',
onShow() {
this === $();
},
onHide() {
this === $();
},
onChange() {
this === $();
},
selector: {
dimmable: '.dimmable',
dimmer: '.dimmer',
content: '.content'
},
template: {
dimmer() {
return $();
}
},
className: {
active: 'active',
dimmable: 'dimmable',
dimmed: 'dimmed',
disabled: 'disabled',
pageDimmer: 'pageDimmer',
hide: 'hide',
show: 'show',
transition: 'transition'
},
error: {
method: 'method'
}
}) === $();
$(selector).dimmer() === $();
}
import dimmer = require('semantic-ui-dimmer');
function test_module() {
$.fn.dimmer = dimmer;
}
| {
"content_hash": "80430d086d8d81dc27fb39a2655d953e",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 64,
"avg_line_length": 30.505050505050505,
"alnum_prop": 0.4867549668874172,
"repo_name": "GiedriusGrabauskas/DefinitelyTyped",
"id": "68aa418a7d54b928c1ca8179548a6a02ae0b470b",
"size": "3020",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "types/semantic-ui-dimmer/semantic-ui-dimmer-tests.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1193"
},
{
"name": "TypeScript",
"bytes": "25256981"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>amm11262: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.1 / amm11262 - 8.5.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
amm11262
<small>
8.5.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-10-01 04:55:28 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-01 04:55:28 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.7.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.08.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.08.1 Official release 4.08.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "matej.kosik@inria.fr"
homepage: "https://github.com/coq-contribs/amm11262"
license: "LGPL"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/AMM11262"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [ "keyword:american mathematical monthly problem 11262" "date:2007-04" ]
authors: [ "Tonny Hurkens (paper proof) <hurkens@sci.kun.nl>" "Milad Niqui (Coq files) <milad@cs.ru.nl>" ]
bug-reports: "https://github.com/coq-contribs/amm11262/issues"
dev-repo: "git+https://github.com/coq-contribs/amm11262.git"
synopsis: "Problem 11262 of The American Mathematical Monthly"
description: """
Formalisation of Tonny Hurkens' proof of the problem
11262 of The American Mathematical Monthly 113(10), Dec. 2006
(see the README files)"""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/amm11262/archive/v8.5.0.tar.gz"
checksum: "md5=8844a7a417070386a907b97cf71a413d"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-amm11262.8.5.0 coq.8.7.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1).
The following dependencies couldn't be met:
- coq-amm11262 -> coq < 8.6~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-amm11262.8.5.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "c0e8d715b62ec0f8dc3b74c076aa6e12",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 159,
"avg_line_length": 41.86060606060606,
"alnum_prop": 0.5400318517446069,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "fbb33b04f3f74eb39374e38e2160821d0e24de81",
"size": "6932",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.08.1-2.0.5/released/8.7.1/amm11262/8.5.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
namespace T8to10Matrix
{
using System;
using System.Text;
using System.Linq;
public class Matrix<T>
where T : IComparable
{
private int rows;
private int cols;
private T[,] matrix;
public Matrix(int rowCount, int colCount)
{
this.Rows = rowCount;
this.Cols = colCount;
this.matrix = new T[rowCount, colCount];
}
public T this[int row, int col]
{
get
{
if ((row < 0 || row >= this.Rows) ||
(col < 0 || col >= this.Cols))
{
throw new IndexOutOfRangeException();
}
return this.matrix[row, col];
}
set
{
if ((row < 0 || row >= this.Rows) ||
(col < 0 || col >= this.Cols))
{
throw new IndexOutOfRangeException();
}
this.matrix[row, col] = value;
}
}
public int Rows
{
get
{
return this.rows;
}
private set
{
if (value < 1)
{
throw new ArgumentOutOfRangeException("rows count", "The matrix must have at least one row.");
}
this.rows = value;
}
}
public int Cols
{
get
{
return this.cols;
}
private set
{
if (value < 1)
{
throw new ArgumentOutOfRangeException("columns count", "The matrix must have at least one column.");
}
this.cols = value;
}
}
public static Matrix<T> operator +(Matrix<T> a, Matrix<T> b)
{
if (a.Cols != b.Cols || a.Rows != b.Rows)
{
throw new Exception("Addition cannot be applied to matrices with different dimensions.");
}
Matrix<T> result = new Matrix<T>(a.Rows, a.Cols);
for (int row = 0; row < a.Rows; row++)
{
for (int col = 0; col < a.Cols; col++)
{
result[row, col] = (dynamic)a[row, col] + b[row, col];
}
}
return result;
}
public static Matrix<T> operator -(Matrix<T> a, Matrix<T> b)
{
if (a.Cols != b.Cols || a.Rows != b.Rows)
{
throw new Exception("Substraction cannot be applied to matrices with different dimensions.");
}
Matrix<T> result = new Matrix<T>(a.Rows, a.Cols);
for (int row = 0; row < a.Rows; row++)
{
for (int col = 0; col < a.Cols; col++)
{
result[row, col] = (dynamic)a[row, col] - b[row, col];
}
}
return result;
}
public static Matrix<T> operator *(Matrix<T> a, Matrix<T> b)
{
if (a.Cols != b.Rows)
{
throw new Exception("The matrices cannot be multiplied.");
}
Matrix<T> result = new Matrix<T>(a.Rows, b.Cols);
T temp;
for (int matrixRow = 0; matrixRow < result.Rows; matrixRow++)
{
for (int matrixCol = 0; matrixCol < result.Cols; matrixCol++)
{
temp = (dynamic)0;
for (int index = 0; index < result.Cols; index++)
{
temp += (dynamic)a[matrixRow, index] * b[index, matrixCol];
}
result[matrixRow, matrixCol] = (dynamic)temp;
}
}
return result;
}
private static bool OverrideBool(Matrix<T> matrix)
{
for (int row = 0; row < matrix.Rows; row++)
{
for (int col = 0; col < matrix.Cols; col++)
{
if (matrix[row, col] != (dynamic)0)
return true;
}
}
return false;
}
public static bool operator true(Matrix<T> matrix)
{
return OverrideBool(matrix);
}
public static bool operator false(Matrix<T> matrix)
{
return OverrideBool(matrix);
}
public override string ToString()
{
StringBuilder result = new StringBuilder();
for (int row = 0; row < this.Rows; row++)
{
for (int col = 0; col < this.Cols; col++)
{
result.Append(this.matrix[row, col] + "\t");
}
result.AppendLine();
}
return result.ToString();
}
}
} | {
"content_hash": "584edb340295553f8ff10dd6d04265c8",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 120,
"avg_line_length": 31.70700636942675,
"alnum_prop": 0.4085978304539976,
"repo_name": "studware/Ange-Git",
"id": "d0687f3102928fe6f81e37937c066f82f075f5b7",
"size": "4980",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "MyTelerikAcademyHomeWorks/OOP/HW2DefiningClassesPart2/T8to10Matrix/Matrix.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1833657"
},
{
"name": "CSS",
"bytes": "52022"
},
{
"name": "HTML",
"bytes": "48849"
},
{
"name": "JavaScript",
"bytes": "6247"
},
{
"name": "PLSQL",
"bytes": "6610"
},
{
"name": "PowerShell",
"bytes": "332"
},
{
"name": "XSLT",
"bytes": "2371"
}
],
"symlink_target": ""
} |
:: this script starts a las2peer node providing the example service of this project
:: pls execute it from the bin folder of your deployment by double-clicking on it
cd ..
set BASE=%CD%
set CLASSPATH="%BASE%/lib/*;"
java -cp %CLASSPATH% i5.las2peer.tools.L2pNodeLauncher -w -p 9011 uploadStartupDirectory('etc/startup') startService('i5.las2peer.services.idGeneratingPackage.IdGeneratingClass','IdGeneratingPass') startWebConnector interactive
pause
| {
"content_hash": "d338852f8298ec97dccfc4c526da2604",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 227,
"avg_line_length": 50.22222222222222,
"alnum_prop": 0.7964601769911505,
"repo_name": "rwth-acis/LAS2peer-IdGeneratingService",
"id": "d8fb1d39ecc219cb71d4c0672f9b35276cf0bc76",
"size": "452",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bin/start_network.bat",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1006"
},
{
"name": "Java",
"bytes": "15856"
},
{
"name": "Shell",
"bytes": "1146"
}
],
"symlink_target": ""
} |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".SegundaActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</RelativeLayout>
| {
"content_hash": "6e42afcfbce561be9347ad046777ea7a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 74,
"avg_line_length": 40.8125,
"alnum_prop": 0.7289433384379785,
"repo_name": "adrianosepe/dev-android-02-13",
"id": "7b07fc548901b0a761c57a80c7254ea0a84d39db",
"size": "653",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ProjetoTeste/res/layout/activity_segunda.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1"
},
{
"name": "C++",
"bytes": "1"
},
{
"name": "Java",
"bytes": "37942"
},
{
"name": "Logos",
"bytes": "336345"
}
],
"symlink_target": ""
} |
Cornell CSRVL
Cornell Robotics and Vision Laboratory
Welcome to the Web niche of the Cornell Robotics and Vision Laboratory.
cp: No match.
match.
rrently under development; please don your hard hat.
Questions and comments should be directed to
mdw@cs.cornell.edu. Thanks.
About the CSRVL
The Cornell Computer Science Robotics and Vision Laboratory is located
at Cornell University in Ithaca, N.Y. We have three main areas of
research:
Computer vision (Prof. Daniel Huttenlocher)
Multimedia applications of computer vision (Prof. Ramin Zabih)
Robotics,
including distributed manipulation and micro-electro mechanical systems (MEMS)
(Prof. Bruce Donald)
Here is a pictoral tour of the CSRVL.
Current Projects
The following projects are active at the CSRVL. They are supervised by
Ramin Zabih.
Automatic Detection and
Classification of Scene Breaks in Digital Video.
MPEG Browser, allowing
scene break and global motion-based queries.
Real-time ATM Video Source,
transmission of full-frame video over ATM for parallel computation on
platforms such as the Cornell/NYNET ATM Cluster.
A number of projects involving high-performance imaging applications.
These include parallel implementations in
Split-C for
U-Net and
symmetric multiprocessors.
We have a list of potential Master's
projects, maintained by
Justin Miller.
Most of our work has been done under Unix, but we are currently
considering a move to WindowsNT. There is a discussion of some of the
issues
here.
We are hopeful that this move will be supported by
Microsoft.
Selected Publications
The following is a list of selected papers of research done at the
CSRVL. Many of these papers are available via
anonymous FTP.
Many publications from the Cornell Robotics and Vision Laboratory are
available from the
Cornell CS Tech-Reports server. (See below.)
Only those papers not available from the CS-TR server
are listed here.
Program Mobile Robots in Scheme (B. Donald and J. Rees)
Proc. IEEE International Conference on Robotics and Automation
Nice, France (May, 1992), pp. 2681-2688.
On the Complexity of Computing the Homology Type of a Triangulation
(B. Donald and D. Chang),
Revised MS based on the paper IEEE Symposium on the Foundations of
Computer Science San Juan, (October 1991), pp. 650-661.
Information Invariants for Distributed Manipulation (B. Donald, J.
Jennings and D. Rus) in The First Workshop on the Algorithmic
Foundations of Robotics, A. K. Peters, Boston, MA. ed. R. Wilson and
J.-C.Latombe (1994).
Information Invariants in Robotics (B. Donald)
Revised MS based on a paper submitted to Artificial Intelligence.
Automatic Sensor Configuration for Task-Directed Planning (B. Donald,
A. Briggs), Proceedings 1994 IEEE International Conference on
Robotics and Automation, San Diego, CA (May 1994).
Sensorless Manipulation Using Massively Parallel Microfabricated Actuator
Arrays,
K.-F. Bhringer, B. R. Donald, R. Mihailovich, and N. C. MacDonald,
Proc. IEEE International Conference on Robotics and Automation,
San Diego, CA (May, 1994).
A Theory of Manipulation and Control for Microfabricated Actuator Arrays,
K.-F. Bhringer, B. R. Donald, R. Mihailovich, and N. C. MacDonald,
Proceedings of the IEEE Workshop on Micro Electro Mechanical Systems,
Oiso, Japan (January, 1994).
A Computational Approach to the Design of Micromechanical Hinged Structures
(extended abstract),
K.-F. Bhringer,
Proceedings of the ACM/SIGGRAPH Symposium on Solid Modeling and Applications
, Montral, Quebc, Canada (May, 1993).
Some other papers are listed
here.
Technical Reports by Author
These lists are generated dynamically by the Cornell CS-TR Server.
Here is the CS-TR server index,
where you can search for technical reports by author, title, and keyword.
Bhringer, Karl
Briggs, Amy
Brown, Russell
Donald, Bruce
Huttenlocher, Daniel
Jennings, Jim
Leventon, Michael
Rucklidge, William
Rus, Daniela
People at the CSRVL
Karl F. Bhringer
Scott Cytacki
Bruce Donald
(associate professor)
Pedro Felzenszwalb
Daniel
Huttenlocher (associate professor)
Ryan Lilien
Michel Maharbiz
Justin Miller
Greg Pass
Daniel Scharstein
Aaron Stump
Rob Szewczyk
Fernando "Joe" Viton
Justin Voskuhl
Ed Wayt
Matt Welsh
Greg Whelan
Ramin Zabih
(assistant professor)
<l | {
"content_hash": "fad461e8c5fe9df2f0f7635ab7fd13e1",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 79,
"avg_line_length": 23.97826086956522,
"alnum_prop": 0.7669990933816863,
"repo_name": "ML-SWAT/Web2KnowledgeBase",
"id": "bab811306dee689c390cbf6dc560b1b210785184",
"size": "4412",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "naive_bayes/non_course_train/untag_http:^^www.cs.cornell.edu^Info^Projects^csrvl^csrvl.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Groff",
"bytes": "641"
},
{
"name": "HTML",
"bytes": "34381871"
},
{
"name": "Perl",
"bytes": "14786"
},
{
"name": "Perl6",
"bytes": "18697"
},
{
"name": "Python",
"bytes": "10084"
}
],
"symlink_target": ""
} |
import './LayoutHeader.scss'
import { VNode } from 'vue'
import {
defineComponent,
ref
} from '@vue/composition-api'
import { typeUI, typeTheme } from '../mixin'
import Row from '@vue2do/component/module/Row'
import Col from '@vue2do/component/module/Col'
import Icon from '@vue2do/component/module/Icon'
import Input from '@vue2do/component/module/Input'
import Nav from '@vue2do/component/module/Nav'
import logoUrl from '../../../asset/img/favicon.png'
export default defineComponent({
name: 'LayoutHeader',
setup() {
const mobileMenuRef = ref<any>(null)
const sortIconDisplay = ref(false)
const menuOpt = ref([{
'name': '组件',
'route': '/component/start'
}, {
'name': '构建',
'route': '/build'
}, {
'name': '关于',
'route': '/about'
}])
function showMenu(): void {
sortIconDisplay.value = false
mobileMenuRef?.value?.show()
}
function hideMenu(): void {
sortIconDisplay.value = true
}
return (): VNode => (
<div class='header-layout-stage'>
<Row class='nav-box' justify='justify'>
<Col width='calc(100% - 400px)'>
<router-link to='/'>
<img class='logo-box' src={logoUrl} />
</router-link>
</Col>
<Col width='calc(400px)'>
<Row class='nav-menu-box' justify='justify'>
<Col span={3}>
<router-link to='/component/start'>组件</router-link>
</Col>
<Col span={3}>
<router-link to='/build'>构建</router-link>
</Col>
<Col span={3}>
<router-link to='/about'>关于</router-link>
</Col>
<Col span={3}>
<a href='//github.com/zen0822/vue2do'>
<Icon size='L' theme='grey' kind='github' />
</a>
</Col>
</Row>
</Col>
</Row>
<Row class='nav-box nav-box-mobile'>
<Col span={4}>
<div onClick={(): void => showMenu()}>
<Icon kind='sort' v-show={sortIconDisplay} />
</div>
</Col>
<Col class='z-css-text-center' span={4}>
<img class='logo-box' src={logoUrl} />
</Col>
<Col class='z-css-text-right' span={4}>
<div onClick={(): void => showMenu()}>
<Icon kind='search' />
</div>
</Col>
</Row>
<Nav
class='mobile-menu'
ref={mobileMenuRef}
{...{ on: { hide: hideMenu } }}
initOpt={menuOpt.value}
ui={typeUI.value}
theme={typeTheme.value}
>
<div class='menu-search' slot='end'>
<Input placeholder='search in vue2do' block>
<Icon slot='header' kind='search' size='xs' />
</Input>
</div>
</Nav>
</div>
)
}
})
| {
"content_hash": "9832ba4c2da604d04524f542aed2ad4c",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 67,
"avg_line_length": 28.794117647058822,
"alnum_prop": 0.4902962206332993,
"repo_name": "zen0822/vue2do",
"id": "4fbfc16f9d18ba453d05a14f276378b6134c7a17",
"size": "2961",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "app/doc/client/component/layout/LayoutHeader/LayoutHeader.tsx",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "196042"
},
{
"name": "JavaScript",
"bytes": "456051"
},
{
"name": "Pug",
"bytes": "85421"
},
{
"name": "SCSS",
"bytes": "145956"
},
{
"name": "Shell",
"bytes": "1732"
},
{
"name": "Smarty",
"bytes": "11601"
},
{
"name": "TypeScript",
"bytes": "133452"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "69aa97da141100877428947801f24042",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "e4707df3d7fb98254da65a544577a377dd9e9878",
"size": "174",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Burseraceae/Bursera/Bursera attenuata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#include <aws/backup/model/BackupRule.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Backup
{
namespace Model
{
BackupRule::BackupRule() :
m_ruleNameHasBeenSet(false),
m_targetBackupVaultNameHasBeenSet(false),
m_scheduleExpressionHasBeenSet(false),
m_startWindowMinutes(0),
m_startWindowMinutesHasBeenSet(false),
m_completionWindowMinutes(0),
m_completionWindowMinutesHasBeenSet(false),
m_lifecycleHasBeenSet(false),
m_recoveryPointTagsHasBeenSet(false),
m_ruleIdHasBeenSet(false),
m_copyActionsHasBeenSet(false)
{
}
BackupRule::BackupRule(JsonView jsonValue) :
m_ruleNameHasBeenSet(false),
m_targetBackupVaultNameHasBeenSet(false),
m_scheduleExpressionHasBeenSet(false),
m_startWindowMinutes(0),
m_startWindowMinutesHasBeenSet(false),
m_completionWindowMinutes(0),
m_completionWindowMinutesHasBeenSet(false),
m_lifecycleHasBeenSet(false),
m_recoveryPointTagsHasBeenSet(false),
m_ruleIdHasBeenSet(false),
m_copyActionsHasBeenSet(false)
{
*this = jsonValue;
}
BackupRule& BackupRule::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("RuleName"))
{
m_ruleName = jsonValue.GetString("RuleName");
m_ruleNameHasBeenSet = true;
}
if(jsonValue.ValueExists("TargetBackupVaultName"))
{
m_targetBackupVaultName = jsonValue.GetString("TargetBackupVaultName");
m_targetBackupVaultNameHasBeenSet = true;
}
if(jsonValue.ValueExists("ScheduleExpression"))
{
m_scheduleExpression = jsonValue.GetString("ScheduleExpression");
m_scheduleExpressionHasBeenSet = true;
}
if(jsonValue.ValueExists("StartWindowMinutes"))
{
m_startWindowMinutes = jsonValue.GetInt64("StartWindowMinutes");
m_startWindowMinutesHasBeenSet = true;
}
if(jsonValue.ValueExists("CompletionWindowMinutes"))
{
m_completionWindowMinutes = jsonValue.GetInt64("CompletionWindowMinutes");
m_completionWindowMinutesHasBeenSet = true;
}
if(jsonValue.ValueExists("Lifecycle"))
{
m_lifecycle = jsonValue.GetObject("Lifecycle");
m_lifecycleHasBeenSet = true;
}
if(jsonValue.ValueExists("RecoveryPointTags"))
{
Aws::Map<Aws::String, JsonView> recoveryPointTagsJsonMap = jsonValue.GetObject("RecoveryPointTags").GetAllObjects();
for(auto& recoveryPointTagsItem : recoveryPointTagsJsonMap)
{
m_recoveryPointTags[recoveryPointTagsItem.first] = recoveryPointTagsItem.second.AsString();
}
m_recoveryPointTagsHasBeenSet = true;
}
if(jsonValue.ValueExists("RuleId"))
{
m_ruleId = jsonValue.GetString("RuleId");
m_ruleIdHasBeenSet = true;
}
if(jsonValue.ValueExists("CopyActions"))
{
Array<JsonView> copyActionsJsonList = jsonValue.GetArray("CopyActions");
for(unsigned copyActionsIndex = 0; copyActionsIndex < copyActionsJsonList.GetLength(); ++copyActionsIndex)
{
m_copyActions.push_back(copyActionsJsonList[copyActionsIndex].AsObject());
}
m_copyActionsHasBeenSet = true;
}
return *this;
}
JsonValue BackupRule::Jsonize() const
{
JsonValue payload;
if(m_ruleNameHasBeenSet)
{
payload.WithString("RuleName", m_ruleName);
}
if(m_targetBackupVaultNameHasBeenSet)
{
payload.WithString("TargetBackupVaultName", m_targetBackupVaultName);
}
if(m_scheduleExpressionHasBeenSet)
{
payload.WithString("ScheduleExpression", m_scheduleExpression);
}
if(m_startWindowMinutesHasBeenSet)
{
payload.WithInt64("StartWindowMinutes", m_startWindowMinutes);
}
if(m_completionWindowMinutesHasBeenSet)
{
payload.WithInt64("CompletionWindowMinutes", m_completionWindowMinutes);
}
if(m_lifecycleHasBeenSet)
{
payload.WithObject("Lifecycle", m_lifecycle.Jsonize());
}
if(m_recoveryPointTagsHasBeenSet)
{
JsonValue recoveryPointTagsJsonMap;
for(auto& recoveryPointTagsItem : m_recoveryPointTags)
{
recoveryPointTagsJsonMap.WithString(recoveryPointTagsItem.first, recoveryPointTagsItem.second);
}
payload.WithObject("RecoveryPointTags", std::move(recoveryPointTagsJsonMap));
}
if(m_ruleIdHasBeenSet)
{
payload.WithString("RuleId", m_ruleId);
}
if(m_copyActionsHasBeenSet)
{
Array<JsonValue> copyActionsJsonList(m_copyActions.size());
for(unsigned copyActionsIndex = 0; copyActionsIndex < copyActionsJsonList.GetLength(); ++copyActionsIndex)
{
copyActionsJsonList[copyActionsIndex].AsObject(m_copyActions[copyActionsIndex].Jsonize());
}
payload.WithArray("CopyActions", std::move(copyActionsJsonList));
}
return payload;
}
} // namespace Model
} // namespace Backup
} // namespace Aws
| {
"content_hash": "543124fe7bfe873b3e8274daad1d8fd9",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 120,
"avg_line_length": 24.147959183673468,
"alnum_prop": 0.7377984365096133,
"repo_name": "jt70471/aws-sdk-cpp",
"id": "8df1c72b6d5cbb1f05fd0fe0f446ed340bf31765",
"size": "4852",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-backup/source/model/BackupRule.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "13452"
},
{
"name": "C++",
"bytes": "278594037"
},
{
"name": "CMake",
"bytes": "653931"
},
{
"name": "Dockerfile",
"bytes": "5555"
},
{
"name": "HTML",
"bytes": "4471"
},
{
"name": "Java",
"bytes": "302182"
},
{
"name": "Python",
"bytes": "110380"
},
{
"name": "Shell",
"bytes": "4674"
}
],
"symlink_target": ""
} |
<?php
namespace My;
use Exception;
class Route{
public static $routeList=[
];
public static function add( $routeString , $handle = '' ):RouteInstance
{
if( $routeString instanceof RouteInstance )
{
$route = $routeString;
}elseif(is_string( $routeString )){
$route = new RouteInstance($routeString , $handle);
}else{
throw new Exception(' Cant add route ');
}
self::$routeList[$route->getName()]=$route;
return $route;
}
public static function all():array
{
$routes = [];
foreach( self::$routeList as $val){
$routes[$val->url]=$val->handle;
}
return $routes;
}
public static function getRouteListByName( string $routeName ):RouteInstance
{
return self::$routeList[$routeName];
}
public static function has( string $routeName ):bool
{
return isset(self::$routeList[$routeName]) ? true : false;
}
public static function unsetRouteByName( string $routeName ):void
{
unset(self::$routeList[$routeName]);
}
}
class RouteInstance{
public $name='';
public $handle='';
public $url='';
function __construct($routeString , $handle )
{
$this->name = md5($routeString);
$this->handle = $handle;
$this->url = trim($routeString,'/');
}
public function getName():string
{
return $this->name;
}
public function name( string $routeName )
{
$route = Route::getRouteListByName($this->name);
Route::unsetRouteByName($this->name);
$route->name = $routeName ;
Route::add($route);
}
} | {
"content_hash": "4a93643ad64b250f5d15bd9fc8b07ae9",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 77,
"avg_line_length": 21.6056338028169,
"alnum_prop": 0.6284224250325945,
"repo_name": "fearlessforever/ci-laravel",
"id": "cd12650d593d912089eb7d10ae12d0da48ecbdc8",
"size": "1534",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "codeigniter/_prototype/_my/Route.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2739"
},
{
"name": "HTML",
"bytes": "18252"
},
{
"name": "Hack",
"bytes": "2336"
},
{
"name": "JavaScript",
"bytes": "84427"
},
{
"name": "PHP",
"bytes": "4806588"
}
],
"symlink_target": ""
} |
BSLS_IDENT_RCSID(bdlcc_queue_cpp,"$Id$ $CSID$")
// ----------------------------------------------------------------------------
// Copyright 2015 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------
| {
"content_hash": "661378ac98c3873a021abd7770492826",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 79,
"avg_line_length": 47.529411764705884,
"alnum_prop": 0.6051980198019802,
"repo_name": "idispatch/bde",
"id": "ab59f50e131527345d60079fe1d8064e0c584f85",
"size": "1279",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "groups/bdl/bdlcc/bdlcc_queue.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "147162"
},
{
"name": "C++",
"bytes": "80424920"
},
{
"name": "Objective-C",
"bytes": "86496"
},
{
"name": "Perl",
"bytes": "2008"
},
{
"name": "Python",
"bytes": "890"
}
],
"symlink_target": ""
} |
namespace boost { namespace mpl { namespace aux {
struct set_tag;
}}}
#endif // BOOST_MPL_SET_AUX_TAG_HPP_INCLUDED
| {
"content_hash": "d8931b9abacaaeef346873323e848b55",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 49,
"avg_line_length": 16.857142857142858,
"alnum_prop": 0.7033898305084746,
"repo_name": "Ezeer/VegaStrike_win32FR",
"id": "3ad3d4837f0d99d42dfeb9704733fe0bd8afbf8e",
"size": "642",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vegastrike/boost/1_45/boost/mpl/set/aux_/tag.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "4197693"
},
{
"name": "C++",
"bytes": "99169723"
},
{
"name": "Objective-C",
"bytes": "135840"
},
{
"name": "Perl",
"bytes": "21684"
},
{
"name": "Python",
"bytes": "186872"
},
{
"name": "Shell",
"bytes": "114240"
},
{
"name": "Standard ML",
"bytes": "2678"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>elpi: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.13.0 / elpi - 1.12.1</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
elpi
<small>
1.12.1
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-26 03:34:25 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-26 03:34:25 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.06.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.06.1 Official 4.06.1 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Enrico Tassi <enrico.tassi@inria.fr>"
authors: [ "Enrico Tassi" ]
license: "LGPL-2.1-or-later"
homepage: "https://github.com/LPCIC/coq-elpi"
bug-reports: "https://github.com/LPCIC/coq-elpi/issues"
dev-repo: "git+https://github.com/LPCIC/coq-elpi"
build: [ [ make "build" "COQBIN=%{bin}%/" "ELPIDIR=%{prefix}%/lib/elpi" "OCAMLWARN=" ]
[ make "test" "COQBIN=%{bin}%/" "ELPIDIR=%{prefix}%/lib/elpi" ] {with-test}
]
install: [ make "install" "COQBIN=%{bin}%/" "ELPIDIR=%{prefix}%/lib/elpi" ]
depends: [
"stdlib-shims"
"ocaml" {>= "4.07"}
"elpi" {>= "1.13.6" & < "1.14.0~"}
"coq" {>= "8.15" & < "8.16~" }
]
tags: [ "logpath:elpi" ]
synopsis: "Elpi extension language for Coq"
description: """
Coq-elpi provides a Coq plugin that embeds ELPI.
It also provides a way to embed Coq's terms into λProlog using
the Higher-Order Abstract Syntax approach
and a way to read terms back. In addition to that it exports to ELPI a
set of Coq's primitives, e.g. printing a message, accessing the
environment of theorems and data types, defining a new constant and so on.
For convenience it also provides a quotation and anti-quotation for Coq's
syntax in λProlog. E.g. `{{nat}}` is expanded to the type name of natural
numbers, or `{{A -> B}}` to the representation of a product by unfolding
the `->` notation. Finally it provides a way to define new vernacular commands
and
new tactics."""
url {
src: "https://github.com/LPCIC/coq-elpi/archive/v1.12.1.tar.gz"
checksum: "sha256=32eac6be5172eb945df6e80b1b6e0b784cbf1d7dca15ee780bb60716a0bb9ce5"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-elpi.1.12.1 coq.8.13.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.13.0).
The following dependencies couldn't be met:
- coq-elpi -> ocaml >= 4.07
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-elpi.1.12.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "1969465cc683a40dfc330e0873a2e458",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 159,
"avg_line_length": 43.51704545454545,
"alnum_prop": 0.5550332941637289,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "b41ac3b5f3b84f12ba73d20a68f63f865776edff",
"size": "7686",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.13.0/elpi/1.12.1.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
require 'rspec/its'
require 'collection_of'
class Widget
attr_accessor :name
def initialize(name = nil)
@name = name
end
end
class Wadget
attr_accessor :name
def initialize
@name = yield if block_given?
end
end
class SubWidget < Widget; end
describe Collection do
let(:w) { Widget.new }
describe '#initialize' do
context 'when using #new' do
subject { Collection.new(Widget, [w], allow_subclasses: true) }
it { is_expected.to be_a Collection }
it { is_expected.to eq([w]) }
its(:klass) { is_expected.to eq(Widget) }
its(:options) { is_expected.to eq(allow_subclasses: true) }
end
context 'when using the CollectionOf[] shorthand' do
subject { CollectionOf[Widget, [w], allow_subclasses: true] }
it { is_expected.to be_a Collection }
it { is_expected.to eq([w]) }
its(:klass) { is_expected.to eq(Widget) }
its(:options) { is_expected.to eq(allow_subclasses: true) }
end
context 'when using the Collection[] shorthand' do
subject { Collection[Widget, [w], allow_subclasses: true] }
it { is_expected.to be_a Collection }
it { is_expected.to eq([w]) }
its(:klass) { is_expected.to eq(Widget) }
its(:options) { is_expected.to eq(allow_subclasses: true) }
end
context 'when using Collection.of' do
subject { Collection.of(Widget, [w], allow_subclasses: true) }
it { is_expected.to be_a Collection }
it { is_expected.to eq([w]) }
its(:klass) { is_expected.to eq(Widget) }
its(:options) { is_expected.to eq(allow_subclasses: true) }
end
end
describe '#clone' do
let(:c) { described_class[Widget] }
let(:w1) { Widget.new(:one) }
let(:w2) { Widget.new(:two) }
before { c << w1 << w2 }
subject { c.clone }
it { is_expected.not_to eq(c) }
its(:first) { is_expected.to_not eq(c.first) }
its([1]) { is_expected.to_not eq(c.first) }
its('first.name') { is_expected.to eq(:one) }
end
describe '#[]' do
let(:w) { Widget.new('widgey') }
subject { described_class.new(Widget) }
context 'when the collection is empty' do
its([:foo]) { is_expected.to be_nil }
end
context 'when the collection is not empty' do
before { subject << w }
its([0]) { is_expected.to eq(w) }
its(['widgey']) { is_expected.to eq(w) }
its([:widgey]) { is_expected.to eq(w) }
its([1]) { is_expected.to be_nil }
its([:fake]) { is_expected.to be_nil }
end
end
describe '#new' do
subject { described_class[Widget] }
it 'creates a new Widget' do
expect(subject.new).to be_a Widget
end
it 'adds it to the collection' do
subject.new
expect(subject.count).to eq(1)
end
it 'adds the new item to the end of the collection' do
3.times { subject.new }
w = subject.new
expect(subject[3]).to eq(w)
end
it 'passes on any arguments' do
w = subject.new('Smith')
expect(w.name).to eq('Smith')
end
it 'passes on a given block' do
c = described_class[Wadget]
w = c.new { :test }
expect(w.name).to eq(:test)
end
end
describe '#<<' do
subject { described_class[Widget] }
it 'adds like types to the collection' do
expect { subject << w }.to_not raise_error
expect(subject.first).to eq(w)
end
it 'raises an error if trying to add a different type to the collection' do
w = Wadget.new
expect { subject << w }.to raise_error(ArgumentError, 'can only add Widget objects')
end
it 'adds subclasses' do
expect { subject << SubWidget.new }.to_not raise_error
end
it 'does not allow subclasses if allow_subclasses is false' do
c = described_class[Widget, allow_subclasses: false]
expect { c << SubWidget.new }.to raise_error(ArgumentError, 'can only add Widget objects')
end
end
describe '#keys' do
let(:w1) { Widget.new(:one) }
let(:w2) { Widget.new(:two) }
subject { described_class[Widget] }
before { subject << w1 << w2 }
its(:keys) { is_expected.to eq(%i[one two]) }
end
describe '#key?' do
let(:w1) { Widget.new(:one) }
subject { described_class[Widget] }
before { subject << w1 }
it { is_expected.to have_key(:one) }
it { is_expected.not_to have_key(:two) }
end
describe '#include?' do
let(:w1) { Widget.new(:one) }
let(:w2) { Widget.new(:one) }
subject { described_class[Widget] }
before { subject << w1 }
it { is_expected.to include w1 }
it { is_expected.to include :one }
it { is_expected.not_to include w2 }
it { is_expected.not_to include :two }
end
describe '#except' do
let(:c) { described_class[Widget] }
let(:w1) { Widget.new(:one) }
let(:w2) { Widget.new(:two) }
before { c << w1 << w2 }
context 'when an include item is specified' do
subject { c.except(:one) }
it { is_expected.to be_a described_class }
it { is_expected.to eq([w2]) }
end
context 'when all included items are specified' do
subject { c.except(:one, :two) }
it { is_expected.to be_a described_class }
it { is_expected.to be_empty }
end
context 'when no included items are specified' do
subject { c.except(:three) }
it { is_expected.to be_a described_class }
it { is_expected.to eq([w1, w2]) }
end
end
describe '#slice' do
let(:c) { described_class[Widget] }
let(:w1) { Widget.new(:one) }
let(:w2) { Widget.new(:two) }
before { c << w1 << w2 }
context 'when an include item is specified' do
subject { c.slice(:one) }
it { is_expected.to be_a described_class }
it { is_expected.to eq([w1]) }
end
context 'when all included items are specified' do
subject { c.slice(:one, :two) }
it { is_expected.to be_a described_class }
it { is_expected.to eq([w1, w2]) }
end
context 'when no included items are specified' do
subject { c.slice(:three) }
it { is_expected.to be_a described_class }
it { is_expected.to be_empty }
end
end
describe '#==' do
let(:w1) { Widget.new(:one) }
let(:w2) { Widget.new(:two) }
subject { described_class[Widget] }
before { subject << w1 << w2 }
it { is_expected.to eq([w1, w2]) }
it { is_expected.not_to eq([w1]) }
it { is_expected.not_to eq([w2]) }
it { is_expected.not_to eq([]) }
it { is_expected.to eq(described_class[Widget, [w1, w2]]) }
it { is_expected.not_to eq(described_class[Widget, [w1]]) }
it { is_expected.not_to eq(described_class[Widget, [w2]]) }
it { is_expected.not_to eq(described_class[Widget]) }
end
describe '#delete' do
let(:c) { described_class[Widget] }
let(:w1) { Widget.new(:one) }
let(:w2) { Widget.new(:two) }
subject { c }
before { c << w1 << w2 }
context 'when an included item is specified' do
before { c.delete(:one) }
it { is_expected.to eq([w2]) }
end
context 'when all included items are specified' do
before { c.delete(:one, :two) }
it { is_expected.to be_empty }
end
context 'when no included items are specified' do
before { c.delete(:three) }
it { is_expected.to eq([w1, w2]) }
end
end
end
| {
"content_hash": "48553853918ebc1704c938b0c0cbe72f",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 96,
"avg_line_length": 26.78021978021978,
"alnum_prop": 0.5940363835316647,
"repo_name": "dvandersluis/collection_of",
"id": "1406e2e76c207eeb1a729a314fbc496db4052272",
"size": "7311",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/collection_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "11780"
}
],
"symlink_target": ""
} |
var app = angular.module("phoneApp",[]);
var phoneAppStuff = {};
phoneAppStuff.controllers = {};
phoneAppStuff.controllers.AppCtrl = function($scope) {
this.sayHi = function() {
alert("Hi!!");
}
return $scope.AppCtrl = this;
};
phoneAppStuff.directives = {};
phoneAppStuff.directives.panel = function() {
return {
restrict: 'E'
}
}
app.directive(phoneAppStuff.directives);
app.controller(phoneAppStuff.controllers);
| {
"content_hash": "55e20e57152bdb55c1212ca36f70e6da",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 54,
"avg_line_length": 18.73913043478261,
"alnum_prop": 0.703016241299304,
"repo_name": "mloayzagahona/egg",
"id": "c67365d3eba7fdb9de4f2a62af53b7a1b6f054a1",
"size": "431",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/main10.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "10222"
},
{
"name": "Python",
"bytes": "522"
}
],
"symlink_target": ""
} |
#ifndef VPX_VP9_ENCODER_VP9_ENCODEMB_H_
#define VPX_VP9_ENCODER_VP9_ENCODEMB_H_
#include "./vpx_config.h"
#include "vp9/encoder/vp9_block.h"
#ifdef __cplusplus
extern "C" {
#endif
struct encode_b_args {
MACROBLOCK *x;
int enable_coeff_opt;
ENTROPY_CONTEXT *ta;
ENTROPY_CONTEXT *tl;
int8_t *skip;
#if CONFIG_MISMATCH_DEBUG
int mi_row;
int mi_col;
int output_enabled;
#endif
};
int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
int ctx);
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row, int mi_col,
int output_enabled);
void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize);
void vp9_xform_quant_fp(MACROBLOCK *x, int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
void vp9_xform_quant_dc(MACROBLOCK *x, int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
void vp9_xform_quant(MACROBLOCK *x, int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
void vp9_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
void vp9_encode_block_intra(int plane, int block, int row, int col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size, void *arg);
void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane,
int enable_optimize_b);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // VPX_VP9_ENCODER_VP9_ENCODEMB_H_
| {
"content_hash": "8ba02fe63a9b19461e4109e4a079c068",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 80,
"avg_line_length": 31.632653061224488,
"alnum_prop": 0.6425806451612903,
"repo_name": "ShiftMediaProject/libvpx",
"id": "1975ee73acd4bff627aacecc3fdc1a2e3fda0748",
"size": "1960",
"binary": false,
"copies": "17",
"ref": "refs/heads/master",
"path": "vp9/encoder/vp9_encodemb.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "937644"
},
{
"name": "Batchfile",
"bytes": "1691"
},
{
"name": "C",
"bytes": "12403187"
},
{
"name": "C++",
"bytes": "1402945"
},
{
"name": "Makefile",
"bytes": "207643"
},
{
"name": "Perl",
"bytes": "154915"
},
{
"name": "Processing",
"bytes": "26539"
},
{
"name": "Python",
"bytes": "64905"
},
{
"name": "Shell",
"bytes": "169489"
}
],
"symlink_target": ""
} |
@import SBObjectiveCWrapper;
@implementation ZNGLabelGridView
{
UIImage * xImage;
UIColor * moreButtonColor;
CGSize totalSize;
ZNGDashedBorderLabel * addLabelView;
NSArray<ZNGDashedBorderLabel *> * labelViews;
UILabel * moreLabel;
}
#pragma mark - Initialization
- (id) initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self != nil) {
[self commonInit];
}
return self;
}
- (id) initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self != nil) {
[self commonInit];
}
return self;
}
- (void) commonInit
{
totalSize = CGSizeZero;
// Defaults
_horizontalSpacing = 6.0;
_verticalSpacing = 6.0;
_font = [UIFont latoFontOfSize:13.0];
_labelBorderWidth = 2.0;
_labelTextInset = 6.0;
_labelCornerRadius = 14.0;
NSBundle * bundle = [NSBundle bundleForClass:[ZNGLabelGridView class]];
xImage = [UIImage imageNamed:@"deleteX" inBundle:bundle compatibleWithTraitCollection:nil];
moreButtonColor = [UIColor colorNamed:@"ZNGToolbarButton" inBundle:bundle compatibleWithTraitCollection:nil];
self.userInteractionEnabled = NO;
_labelIcon = [[UIImage imageNamed:@"smallTag" inBundle:bundle compatibleWithTraitCollection:nil] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
_groupIcon = [[UIImage imageNamed:@"smallStalker" inBundle:bundle compatibleWithTraitCollection:nil] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
#pragma mark - Setters
- (void) setDelegate:(id<ZNGLabelGridViewDelegate>)delegate
{
_delegate = delegate;
self.userInteractionEnabled = (delegate != nil);
}
- (void) setShowAddLabel:(BOOL)showAddLabel
{
_showAddLabel = showAddLabel;
[self createLabelViews];
}
- (void) setShowRemovalX:(BOOL)showRemovalX
{
_showRemovalX = showRemovalX;
[self createLabelViews];
}
- (void) setLabels:(NSArray<ZNGLabel *> *)labels
{
_labels = labels;
[self createLabelViews];
}
- (void) setGroups:(NSArray<ZNGContactGroup *> *)groups
{
_groups = groups;
[self createLabelViews];
}
- (void) setLabelIcon:(UIImage *)labelIcon
{
_labelIcon = labelIcon;
[self createLabelViews];
}
- (void) setGroupIcon:(UIImage *)groupIcon
{
_groupIcon = groupIcon;
[self createLabelViews];
}
- (void) setMaxRows:(NSUInteger)maxRows
{
_maxRows = maxRows;
[self createLabelViews];
}
- (void) setHorizontalSpacing:(CGFloat)horizontalSpacing
{
_horizontalSpacing = horizontalSpacing;
[self invalidateIntrinsicContentSize];
}
- (void) setVerticalSpacing:(CGFloat)verticalSpacing
{
_verticalSpacing = verticalSpacing;
[self invalidateIntrinsicContentSize];
}
- (void) setFont:(UIFont *)font
{
_font = font;
[self createLabelViews];
}
- (void) setLabelBorderWidth:(CGFloat)labelBorderWidth
{
_labelBorderWidth = labelBorderWidth;
[self createLabelViews];
}
- (void) setLabelTextInset:(CGFloat)labelTextInset
{
_labelTextInset = labelTextInset;
[self createLabelViews];
}
- (void) setLabelCornerRadius:(CGFloat)labelCornerRadius
{
_labelCornerRadius = labelCornerRadius;
[self createLabelViews];
}
#pragma mark - Touching
- (void) pressedAddLabel:(UITapGestureRecognizer *)tapper
{
[self.delegate labelGridPressedAddLabel:self];
}
- (void) tappedLabel:(UITapGestureRecognizer *)tapper
{
if (![tapper.view isKindOfClass:[ZNGDashedBorderLabel class]]) {
return;
}
ZNGDashedBorderLabel * labelView = (ZNGDashedBorderLabel *)tapper.view;
NSUInteger index = [labelViews indexOfObject:labelView];
if ((index != NSNotFound) && (index < [self.labels count])) {
ZNGLabel * label = self.labels[index];
[self.delegate labelGrid:self pressedRemoveLabel:label];
}
}
#pragma mark - Label setup
- (void) configureLabel:(ZNGDashedBorderLabel *)label
{
label.borderWidth = self.labelBorderWidth;
label.textInset = self.labelTextInset;
label.cornerRadius = self.labelCornerRadius;
label.font = self.font;
label.userInteractionEnabled = YES;
}
- (void) createLabelViews
{
NSMutableArray<ZNGDashedBorderLabel *> * newLabelViews = [[NSMutableArray alloc] initWithCapacity:[self.labels count]];
if (self.showAddLabel) {
if (addLabelView.superview == nil) {
// Create the add label view
addLabelView = [[ZNGDashedBorderLabel alloc] init];
[self configureLabel:addLabelView];
addLabelView.dashed = YES;
addLabelView.text = @" ADD TAG ";
addLabelView.textColor = [UIColor grayColor];
addLabelView.backgroundColor = [UIColor clearColor];
addLabelView.borderColor = [UIColor grayColor];
UITapGestureRecognizer * tapper = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(pressedAddLabel:)];
[addLabelView addGestureRecognizer:tapper];
[self addSubview:addLabelView];
}
} else {
[addLabelView removeFromSuperview];
addLabelView = nil;
}
for (ZNGLabel * label in self.labels) {
ZNGDashedBorderLabel * labelView = [[ZNGDashedBorderLabel alloc] init];
[self configureLabel:labelView];
labelView.text = label.displayName;
NSMutableAttributedString * text = [[NSMutableAttributedString alloc] initWithString:@" "];
if (self.labelIcon != nil) {
NSTextAttachment * iconAttachment = [[NSTextAttachment alloc] init];
iconAttachment.image = self.labelIcon;
// For < 10 pt fonts, we need to adjust the label icon down a bit farther. There is assuredly a more intelligent logic
// to this than adding 2.0 for small fonts, but this manual adjustment gets the job done.
// This probably has a lot to do with image size vs. font point size.
CGFloat imageDescender = (self.font.pointSize > 10.0) ? self.font.descender : self.font.descender - 2.0;
iconAttachment.bounds = CGRectMake(0.0, imageDescender, self.labelIcon.size.width, self.labelIcon.size.height);
NSAttributedString * iconString = [NSAttributedString attributedStringWithAttachment:iconAttachment];
[text appendAttributedString:iconString];
[text appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]];
}
NSAttributedString * labelAttributedText = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ ", [label.displayName uppercaseString] ?: @""]];
[text appendAttributedString:labelAttributedText];
if (self.showRemovalX) {
NSTextAttachment * imageAttachment = [[NSTextAttachment alloc] init];
imageAttachment.image = xImage;
imageAttachment.bounds = CGRectMake(0.0, 0.5, xImage.size.width, xImage.size.height);
NSAttributedString * imageAsText = [NSAttributedString attributedStringWithAttachment:imageAttachment];
NSAttributedString * oneSpaceString = [[NSAttributedString alloc] initWithString:@" "];
[text appendAttributedString:oneSpaceString];
[text appendAttributedString:imageAsText];
[text appendAttributedString:oneSpaceString];
}
UIColor * textColor = [label textUIColor];
labelView.font = self.font;
labelView.textColor = textColor;
labelView.borderColor = textColor;
labelView.backgroundColor = [label backgroundUIColor];
[text addAttribute:NSForegroundColorAttributeName value:textColor range:NSMakeRange(0, [text length])];
labelView.attributedText = text;
UITapGestureRecognizer * tapper = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tappedLabel:)];
[labelView addGestureRecognizer:tapper];
[newLabelViews addObject:labelView];
[self addSubview:labelView];
}
for (ZNGContactGroup * group in self.groups) {
ZNGDashedBorderLabel * groupView = [[ZNGDashedBorderLabel alloc] init];
[self configureLabel:groupView];
groupView.text = group.displayName;
NSMutableAttributedString * text = [[NSMutableAttributedString alloc] initWithString:@" "];
if (self.groupIcon != nil) {
NSTextAttachment * iconAttachment = [[NSTextAttachment alloc] init];
iconAttachment.image = self.groupIcon;
// For < 10 pt fonts, we need to adjust the label icon down a bit farther. There is assuredly a more intelligent logic
// to this than adding 2.0 for small fonts, but this manual adjustment gets the job done.
// This probably has a lot to do with image size vs. font point size.
CGFloat imageDescender = (self.font.pointSize > 10.0) ? self.font.descender : self.font.descender - 2.0;
iconAttachment.bounds = CGRectMake(0.0, imageDescender, self.groupIcon.size.width, self.groupIcon.size.height);
NSAttributedString * iconString = [NSAttributedString attributedStringWithAttachment:iconAttachment];
[text appendAttributedString:iconString];
[text appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]];
}
NSAttributedString * labelAttributedText = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ ", [group.displayName uppercaseString] ?: @""]];
[text appendAttributedString:labelAttributedText];
UIColor * textColor = group.textColor;
groupView.font = self.font;
groupView.textColor = textColor;
groupView.borderColor = textColor;
groupView.backgroundColor = group.backgroundColor;
if (textColor != nil) {
[text addAttribute:NSForegroundColorAttributeName value:textColor range:NSMakeRange(0, [text length])];
}
groupView.attributedText = text;
[newLabelViews addObject:groupView];
[self addSubview:groupView];
}
if ((self.maxRows > 0) && (moreLabel == nil)) {
moreLabel = [[UILabel alloc] init];
}
SBLogDebug(@"Replacing %llu existing labels with %llu labels.", (unsigned long long)[labelViews count], (unsigned long long)[newLabelViews count]);
for (ZNGDashedBorderLabel * label in labelViews) {
[label removeFromSuperview];
}
labelViews = newLabelViews;
SBLogDebug(@"%@ now has %llu subviews", [self class], (unsigned long long)[self.subviews count]);
[self layoutIfNeeded];
}
- (void) layoutSubviews
{
// Note that this method assumes that all labels are identical height
CGFloat currentX = 0.0;
CGFloat currentY = 0.0;
CGFloat widestWidth = 0.0;
NSUInteger rowIndex = 0;
NSUInteger overflowCount = 0;
UILabel * lastDisplayedLabel = nil;
if (addLabelView != nil) {
CGSize addLabelSize = [addLabelView intrinsicContentSize];
addLabelView.frame = CGRectMake(0.0, 0.0, addLabelSize.width, addLabelSize.height);
lastDisplayedLabel = addLabelView;
currentY = currentY + addLabelSize.height + self.verticalSpacing;
}
for (ZNGDashedBorderLabel * label in labelViews) {
CGSize labelSize = [label intrinsicContentSize];
// If we've already overflowed, we will not even check for remaining space; this label will already be skipped.
if ((currentX != 0) && (overflowCount == 0)) {
// Do we need to go down to the next row?
CGFloat remainingWidth = self.frame.size.width - currentX;
if (remainingWidth < labelSize.width) {
// We need to go to the next row
rowIndex++;
// .. but are we allowed to?
if ((self.maxRows == 0) || (rowIndex < self.maxRows)) {
currentY += labelSize.height + self.verticalSpacing;
rowIndex++;
currentX = 0.0;
} else {
NSUInteger currentIndex = [labelViews indexOfObject:label];
overflowCount = [labelViews count] - currentIndex;
}
}
}
if (overflowCount == 0) {
label.frame = CGRectMake(currentX, currentY, labelSize.width, labelSize.height);
if (label.superview == nil) {
[self addSubview:label];
}
lastDisplayedLabel = label;
currentX += labelSize.width + self.horizontalSpacing;
if (currentX > widestWidth) {
widestWidth = currentX;
}
} else {
[label removeFromSuperview];
}
}
if (overflowCount > 0) {
// We cannot fit all of our labels within our bounds. Add a "x more..." label and make room as necessary
CGFloat biggerSize = self.font.pointSize + 5.0;
moreLabel.font = [UIFont fontWithName:self.font.fontName size:biggerSize];
moreLabel.textColor = moreButtonColor;
moreLabel.backgroundColor = [UIColor clearColor];
CGSize moreLabelSize = [moreLabel intrinsicContentSize];
CGFloat downwardScooch = 0.0;
if (lastDisplayedLabel != nil) {
downwardScooch = lastDisplayedLabel.frame.size.height - moreLabelSize.height;
}
CGRect moreLabelFrame = CGRectMake(currentX + self.horizontalSpacing, currentY + downwardScooch, moreLabelSize.width, moreLabelSize.height);
if (moreLabel.superview == nil) {
[self addSubview:moreLabel];
}
// Loop through all labels on this same row, eliminating any that would push the "X more..." label off screen
for (NSInteger i = [labelViews count]-1; i >= 0; i--) {
ZNGDashedBorderLabel * label = labelViews[i];
if (label.superview == nil) {
continue;
}
CGFloat labelMinY = CGRectGetMinY(label.frame);
CGFloat labelMaxY = CGRectGetMaxY(label.frame);
CGFloat moreLabelMaxY = CGRectGetMaxY(moreLabel.frame);
CGFloat moreLabelMinY = CGRectGetMinY(moreLabel.frame);
if ((labelMinY > moreLabelMaxY) || (labelMaxY < moreLabelMinY)) {
// Not in the same row
continue;
}
CGFloat remainingRightSpace = self.bounds.size.width - CGRectGetMaxX(label.frame);
if (remainingRightSpace < (moreLabelSize.width + self.horizontalSpacing)) {
// This label would overlap our "X more..." label. Move our "X more" label into its place and remove this label from the view hierarchy.
moreLabelFrame = CGRectMake(label.frame.origin.x, moreLabelFrame.origin.y, moreLabelFrame.size.width, moreLabelFrame.size.height);
[label removeFromSuperview];
overflowCount++;
}
}
currentX = moreLabelFrame.origin.x + moreLabelFrame.size.width + self.horizontalSpacing;
if (currentX > widestWidth) {
widestWidth = currentX;
}
moreLabel.text = [NSString stringWithFormat:@"%llu more...", (unsigned long long)overflowCount];
moreLabel.frame = moreLabelFrame;
} else {
[moreLabel removeFromSuperview];
}
CGSize oldSize = totalSize;
if (lastDisplayedLabel == nil) {
totalSize = [super intrinsicContentSize];
} else {
totalSize = CGSizeMake(widestWidth - self.horizontalSpacing, lastDisplayedLabel.frame.origin.y + lastDisplayedLabel.frame.size.height);
}
if (!CGSizeEqualToSize(oldSize, totalSize)) {
[self invalidateIntrinsicContentSize];
}
}
#pragma mark - Sizing
- (CGSize) intrinsicContentSize
{
if (CGSizeEqualToSize(totalSize, CGSizeZero)) {
return [super intrinsicContentSize];
}
return totalSize;
}
- (CGSize) systemLayoutSizeFittingSize:(CGSize)targetSize withHorizontalFittingPriority:(UILayoutPriority)horizontalFittingPriority verticalFittingPriority:(UILayoutPriority)verticalFittingPriority
{
if (CGSizeEqualToSize(totalSize, CGSizeZero)) {
return [super systemLayoutSizeFittingSize:targetSize withHorizontalFittingPriority:horizontalFittingPriority verticalFittingPriority:verticalFittingPriority];
}
return totalSize;
}
@end
| {
"content_hash": "6267754979bcbe607c627ab087d082f0",
"timestamp": "",
"source": "github",
"line_count": 463,
"max_line_length": 197,
"avg_line_length": 36.31317494600432,
"alnum_prop": 0.6446202343424731,
"repo_name": "Zingle/ios-sdk",
"id": "0a11363667c785d141155868bb84bc22bcb85769",
"size": "17063",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "Pod/Classes/UI/Views/ZNGLabelGridView.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "33445"
},
{
"name": "Objective-C",
"bytes": "1449541"
},
{
"name": "Ruby",
"bytes": "3777"
},
{
"name": "Swift",
"bytes": "442"
}
],
"symlink_target": ""
} |
package org.jabref.gui.maintable.columns;
import java.io.IOException;
import java.util.Map;
import javafx.scene.Node;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.MenuItem;
import javafx.scene.control.Tooltip;
import javafx.scene.input.MouseButton;
import org.jabref.gui.DialogService;
import org.jabref.gui.StateManager;
import org.jabref.gui.desktop.JabRefDesktop;
import org.jabref.gui.icon.IconTheme;
import org.jabref.gui.maintable.BibEntryTableViewModel;
import org.jabref.gui.maintable.CellFactory;
import org.jabref.gui.maintable.ColumnPreferences;
import org.jabref.gui.maintable.MainTableColumnFactory;
import org.jabref.gui.maintable.MainTableColumnModel;
import org.jabref.gui.maintable.OpenUrlAction;
import org.jabref.gui.util.ControlHelper;
import org.jabref.gui.util.ValueTableCellFactory;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.field.Field;
import org.jabref.preferences.PreferencesService;
/**
* A clickable icons column for DOIs, URLs, URIs and EPrints.
*/
public class LinkedIdentifierColumn extends MainTableColumn<Map<Field, String>> {
private final BibDatabaseContext database;
private final CellFactory cellFactory;
private final DialogService dialogService;
private final PreferencesService preferences;
private final StateManager stateManager;
public LinkedIdentifierColumn(MainTableColumnModel model,
CellFactory cellFactory,
BibDatabaseContext database,
DialogService dialogService,
PreferencesService preferences,
StateManager stateManager) {
super(model);
this.database = database;
this.cellFactory = cellFactory;
this.dialogService = dialogService;
this.preferences = preferences;
this.stateManager = stateManager;
Node headerGraphic = IconTheme.JabRefIcons.WWW.getGraphicNode();
Tooltip.install(headerGraphic, new Tooltip(Localization.lang("Linked identifiers")));
this.setGraphic(headerGraphic);
this.getStyleClass().add(MainTableColumnFactory.STYLE_ICON_COLUMN);
MainTableColumnFactory.setExactWidth(this, ColumnPreferences.ICON_COLUMN_WIDTH);
this.setResizable(false);
this.setCellValueFactory(cellData -> cellData.getValue().getLinkedIdentifiers());
new ValueTableCellFactory<BibEntryTableViewModel, Map<Field, String>>()
.withGraphic(this::createIdentifierGraphic)
.withTooltip(this::createIdentifierTooltip)
.withMenu(this::createIdentifierMenu)
.withOnMouseClickedEvent((entry, linkedFiles) -> event -> {
if ((event.getButton() == MouseButton.PRIMARY)) {
new OpenUrlAction(dialogService, stateManager, preferences).execute();
}
})
.install(this);
}
private Node createIdentifierGraphic(Map<Field, String> values) {
if (values.size() > 1) {
return IconTheme.JabRefIcons.LINK_VARIANT.getGraphicNode();
} else if (values.size() == 1) {
return IconTheme.JabRefIcons.LINK.getGraphicNode();
} else {
return null;
}
}
private String createIdentifierTooltip(Map<Field, String> values) {
StringBuilder identifiers = new StringBuilder();
values.keySet().forEach(field -> identifiers.append(field.getDisplayName()).append(": ").append(values.get(field)).append("\n"));
return identifiers.toString();
}
private ContextMenu createIdentifierMenu(BibEntryTableViewModel entry, Map<Field, String> values) {
ContextMenu contextMenu = new ContextMenu();
if (values.size() <= 1) {
return null;
}
values.keySet().forEach(field -> {
MenuItem menuItem = new MenuItem(field.getDisplayName() + ": " +
ControlHelper.truncateString(values.get(field), -1, "...", ControlHelper.EllipsisPosition.CENTER),
cellFactory.getTableIcon(field));
menuItem.setOnAction(event -> {
try {
JabRefDesktop.openExternalViewer(database, values.get(field), field);
} catch (IOException e) {
dialogService.showErrorDialogAndWait(Localization.lang("Unable to open link."), e);
}
event.consume();
});
contextMenu.getItems().add(menuItem);
});
return contextMenu;
}
}
| {
"content_hash": "b737cb193634e26f9b254b39ec34abce",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 137,
"avg_line_length": 42.142857142857146,
"alnum_prop": 0.6616525423728814,
"repo_name": "sauliusg/jabref",
"id": "7b51e516723111de24cb2d0b42bee7a2a2d7fa71",
"size": "4720",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/jabref/gui/maintable/columns/LinkedIdentifierColumn.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ANTLR",
"bytes": "1751"
},
{
"name": "AppleScript",
"bytes": "1378"
},
{
"name": "Batchfile",
"bytes": "142"
},
{
"name": "CSS",
"bytes": "47179"
},
{
"name": "GAP",
"bytes": "1470"
},
{
"name": "Groovy",
"bytes": "4948"
},
{
"name": "Java",
"bytes": "7055949"
},
{
"name": "PowerShell",
"bytes": "1635"
},
{
"name": "Python",
"bytes": "8314"
},
{
"name": "Ruby",
"bytes": "19971"
},
{
"name": "Shell",
"bytes": "9434"
},
{
"name": "TeX",
"bytes": "403476"
},
{
"name": "XSLT",
"bytes": "2185"
}
],
"symlink_target": ""
} |
#ifndef __itkFEMLoadEdge_h
#define __itkFEMLoadEdge_h
#include "itkFEMLoadElementBase.h"
#include "vnl/vnl_matrix.h"
namespace itk {
namespace fem {
/**
* \class LoadEdge
* \brief A generic load that can be applied to an edge of the element.
*
* Can also be used to apply natural (Neumann) boundary condition on the
* edge of the element. In this case m_Edge defines the edge or surfance
* of the element on which the BC exists and matrix m_Force holds the actual
* prescribed values of the BC.
* \ingroup ITK-FEM
*/
class LoadEdge : public LoadElement
{
FEM_CLASS(LoadEdge,LoadElement)
public:
/**
* Read a Load object from input stream.
* We need arrays of elements and nodes to do that.
*/
virtual void Read( std::istream& f, void* info );
/**
* Write a Load object to the output stream
*/
virtual void Write( std::ostream& f ) const;
public:
/**
* Local number of the edge (face) of the element on which the load acts.
* Check the corresponding element class for more info on edge numbering.
*/
int m_Edge;
/**
* An edge force matrix. This matrix specifies nodal forces on all
* nodes within the edge or face on which the load acts. Each nodal
* force is decomposed into several components (check the documentation
* inside the element class). In case of 2D elements this components
* are normal (1st component) and tangential (2nd component) force
* acting on the edge of the element. A positive normal load acts in
* a direction INTO the element. A positive tangential load acts in
* an ANTICLOCKWISE direction with respect to the loaded elemenet.
* Each nodal force is stored in a column of the matrix. The number
* of columns in the Force matrix must correspond to the number of
* nodes that define the edge (face...). The force is interpolated
* over the entire edge (face) by using the shape functions of the
* element. Again check the documentation of the element class to which
* the force is applied.
*/
vnl_matrix<Float> m_Force;
};
FEM_CLASS_INIT(LoadEdge)
}} // end namespace itk::fem
#endif // #ifndef __itkFEMLoadEdge_h
| {
"content_hash": "226eea21e110713809a58081120c9354",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 32.014925373134325,
"alnum_prop": 0.7123543123543123,
"repo_name": "daviddoria/itkHoughTransform",
"id": "834100b054747c0c5bafab7e56955c0c142cfe26",
"size": "2920",
"binary": false,
"copies": "5",
"ref": "refs/heads/Hough",
"path": "Modules/Numerics/FEM/include/itkFEMLoadEdge.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "25063383"
},
{
"name": "C#",
"bytes": "1714"
},
{
"name": "C++",
"bytes": "17045419"
},
{
"name": "Common Lisp",
"bytes": "5433"
},
{
"name": "FORTRAN",
"bytes": "1720073"
},
{
"name": "Java",
"bytes": "59334"
},
{
"name": "Objective-C",
"bytes": "6591"
},
{
"name": "Perl",
"bytes": "17899"
},
{
"name": "Python",
"bytes": "891843"
},
{
"name": "Ruby",
"bytes": "296"
},
{
"name": "Shell",
"bytes": "33144"
},
{
"name": "Tcl",
"bytes": "133547"
}
],
"symlink_target": ""
} |
//
// WSAdapter.m
//
// Created by Csaba Tűz on 2014.02.22..
// Copyright (c) 2014 All rights reserved.
//
#import <SystemConfiguration/SystemConfiguration.h>
#import "WebServiceAdapter.h"
#import "WebServiceAdapter_internal.h"
#import "BaseWebServiceResource.h"
#import "LanguageManager.h"
static AFNetworkReachabilityStatus prevStatus;
@interface WebServiceAdapter()
@property (retain, nonatomic, readwrite) NSURL * baseURL;
@property (retain, nonatomic) NSOperationQueue * requestQueue;
@property (retain, nonatomic) NSDictionary* requestPathsDictionary;
@end
static BOOL alreadyAlerted = NO;
@implementation WebServiceAdapter
@synthesize httpClient;
@synthesize objectManager;
- (id)initWithBaseURL:(NSURL *)baseURL {
self = [super init];
if (self) {
NSAssert(baseURL != nil, @"Base URL must be provided for WebServiceAdapter");
self.baseURL = baseURL;
self.httpClient = [[AFHTTPClient alloc] initWithBaseURL:self.baseURL];
self.objectManager = [[RKObjectManager alloc] initWithHTTPClient:self.httpClient];
__weak WebServiceAdapter* weakSelf = self;
[self.objectManager.HTTPClient setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
@synchronized([WebServiceAdapter class])
{
if (!alreadyAlerted && status == AFNetworkReachabilityStatusNotReachable && prevStatus != status) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:ACLocalizedString(@"key_webServiceAlert_alert")
message:ACLocalizedString(@"key_webServiceAlert_networkError")
delegate:nil
cancelButtonTitle:ACLocalizedString(@"key_webServiceAlert_ok")
otherButtonTitles:nil];
[alert show];
[weakSelf.requestQueue cancelAllOperations];
alreadyAlerted = YES;
}
if (status != AFNetworkReachabilityStatusNotReachable)
{
alreadyAlerted = NO;
}
prevStatus = status;
}
}];
self.cookies = [NSMutableArray array];
self.requestQueue = [[NSOperationQueue alloc] init];
[self.requestQueue setMaxConcurrentOperationCount:NSOperationQueueDefaultMaxConcurrentOperationCount];
self.defaultRequestTimeout = 30;
}
return self;
}
- (void)setHTTPUsername:(NSString *)username andPassword:(NSString *)password
{
[self.httpClient setAuthorizationHeaderWithUsername:username password:password];
self.defaultCredential = [NSURLCredential credentialWithUser:username password:password persistence:NSURLCredentialPersistenceForSession];
[self.httpClient setDefaultCredential:self.defaultCredential];
}
- (void)setMaxConcurrent:(int)maxConcurrent
{
[self.requestQueue setMaxConcurrentOperationCount:maxConcurrent];
}
- (void)updateBaseURL:(NSURL *)newBaseURL
{
//NSAssert(newBaseURL != nil, @"Base URL must be provided for WebServiceAdapter");
self.baseURL = newBaseURL;
}
- (void)dealloc {
self.httpClient = nil;
self.objectManager = nil;
[self.requestQueue cancelAllOperations];
self.requestQueue = nil;
}
#pragma mark - Cookie handling
- (NSArray *)cookies
{
NSArray * cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
NSMutableArray * result = [NSMutableArray array];
for (NSHTTPCookie * cookie in cookies)
{
if ([cookie.domain isEqual:self.baseURL.host] && ([self.baseURL.path length] == 0 || [cookie.path hasPrefix:self.baseURL.path]))
{
[result addObject:cookie];
}
}
return result;
}
/*! Duplicates the received cookie, but rewrites the 'domain' property to the
* base URL of this WebServiceAdapter.
*/
- (NSHTTPCookie *)ownCookieFromCookie:(NSHTTPCookie *)source previousOwner:(WebServiceAdapter *)prevOwner
{
NSMutableDictionary *properties = [source.properties mutableCopy];
[properties setValue:self.baseURL.host forKey:NSHTTPCookieDomain];
if ([self.baseURL.scheme isEqualToString:@"https"])
{
[properties setValue:@"TRUE" forKey:NSHTTPCookieSecure];
}
else
{
[properties removeObjectForKey:NSHTTPCookieSecure];
}
if (prevOwner)
{
NSURL *prevBaseURL = prevOwner.baseURL;
NSString * currentPath = [source valueForKey:NSHTTPCookiePath];
NSString * prevPath = prevBaseURL.path;
if ([currentPath hasPrefix:prevPath])
{
NSString * newPath = [currentPath stringByReplacingCharactersInRange:NSMakeRange(0, [prevPath length]) withString:self.baseURL.path];
[properties setValue:newPath forKey:NSHTTPCookiePath];
}
}
return [NSHTTPCookie cookieWithProperties:properties];
}
- (void)addCookie:(NSHTTPCookie *)cookie previousOwner:(WebServiceAdapter *)prevOwner
{
NSHTTPCookie *ourCookie = [self ownCookieFromCookie:cookie previousOwner:prevOwner];
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:ourCookie];
}
- (void)removeCookie:(NSHTTPCookie *)cookie
{
[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];
}
- (void)clearCookies
{
for (NSHTTPCookie * cookie in [self cookies])
{
[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];
}
}
- (void)enqueueOperation:(NSOperation *)operation
{
[self.requestQueue addOperation:operation];
}
- (void)setRequestPaths:(NSDictionary *)requestPaths {
self.requestPathsDictionary = requestPaths;
}
- (NSString *)requestPathForKey:(NSString *)key {
return [self.requestPathsDictionary valueForKeyPath:key];
}
- (NSString *)requestErrorCodeForKey:(NSString *)key {
return [self.requestPathsDictionary valueForKeyPath:key];
}
@end
| {
"content_hash": "7a7ef5ccaaea57d5dfa7eee418a5eac0",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 145,
"avg_line_length": 33.16393442622951,
"alnum_prop": 0.6683143845773604,
"repo_name": "supersabbath/tmp",
"id": "537144fe422ccf9be5cc4fb3b334cbb11d1e2353",
"size": "6070",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "StarzPlayer/SabreTache/SabreTache-Core/WebServiceAdapter.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1454"
},
{
"name": "Objective-C",
"bytes": "657794"
},
{
"name": "Ruby",
"bytes": "1795"
}
],
"symlink_target": ""
} |
package builder
import (
"fmt"
"os"
"path/filepath"
"github.com/hyperhq/hyper/lib/docker/daemon"
"github.com/hyperhq/hyper/lib/docker/pkg/stringid"
"github.com/hyperhq/hyper/lib/docker/runconfig"
"github.com/hyperhq/hyper/utils"
"github.com/hyperhq/runv/lib/glog"
)
func fixPermissions(source, destination string, uid, gid int, destExisted bool) error {
// If the destination didn't already exist, or the destination isn't a
// directory, then we should Lchown the destination. Otherwise, we shouldn't
// Lchown the destination.
destStat, err := os.Stat(destination)
if err != nil {
// This should *never* be reached, because the destination must've already
// been created while untar-ing the context.
return err
}
doChownDestination := !destExisted || !destStat.IsDir()
// We Walk on the source rather than on the destination because we don't
// want to change permissions on things we haven't created or modified.
return filepath.Walk(source, func(fullpath string, info os.FileInfo, err error) error {
// Do not alter the walk root iff. it existed before, as it doesn't fall under
// the domain of "things we should chown".
if !doChownDestination && (source == fullpath) {
return nil
}
// Path is prefixed by source: substitute with destination instead.
cleaned, err := filepath.Rel(source, fullpath)
if err != nil {
return err
}
fullpath = filepath.Join(destination, cleaned)
return os.Lchown(fullpath, uid, gid)
})
}
func (b *Builder) create() (*daemon.Container, error) {
if b.image == "" && !b.noBaseImage {
return nil, fmt.Errorf("Please provide a source image with `from` prior to run")
}
b.Config.Image = b.image
config := *b.Config
// Create the Pod
podId := fmt.Sprintf("buildpod-%s", utils.RandStr(10, "alpha"))
podString, err := MakeBasicPod(podId, b.image, b.Config.Cmd.Slice())
if err != nil {
return nil, err
}
err = b.Hyperdaemon.CreatePod(podId, podString, config, false)
if err != nil {
return nil, err
}
// Get the container
var (
containerId = ""
c *daemon.Container
)
for _, i := range b.Hyperdaemon.PodList[podId].Containers {
containerId = i.Id
}
c, err = b.Daemon.Get(containerId)
if err != nil {
glog.Error(err.Error())
return nil, err
}
b.TmpContainers[c.ID] = struct{}{}
b.TmpPods[podId] = struct{}{}
fmt.Fprintf(b.OutStream, " ---> Running in %s\n", stringid.TruncateID(c.ID))
if config.Cmd.Len() > 0 {
// override the entry point that may have been picked up from the base image
s := config.Cmd.Slice()
c.Path = s[0]
c.Args = s[1:]
} else {
config.Cmd = runconfig.NewCommand()
}
return c, nil
}
| {
"content_hash": "e5ae92aa7f7e8504d0e1dc169c322ce5",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 88,
"avg_line_length": 28.516129032258064,
"alnum_prop": 0.6866515837104072,
"repo_name": "WIZARD-CXY/hyper",
"id": "d4462c360ccb09a647aeb96134f1c94d7475e588",
"size": "2652",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/docker/builder/internals_darwin.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "1780979"
},
{
"name": "HTML",
"bytes": "1172"
},
{
"name": "Perl",
"bytes": "3865"
},
{
"name": "Shell",
"bytes": "5446"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Aspose.ThreeD;
using Aspose.App.Api.Services;
using System.Runtime.Serialization;
using System.IO;
using System.Diagnostics;
using System.Security.Permissions;
using Aspose.App.Api.Utils;
using Microsoft.Extensions.Configuration;
namespace Aspose.App.Api.Controllers
{
[DataContract]
public class MeasurementInfo
{
[DataMember]
public int Successed { get; set; }
[DataMember]
public int Failed { get; set; }
[DataMember]
public OperationInfo[] ErrorOperations { get; set; }
[DataMember]
public OperationInfo[] ProlongOperations { get; set; }
[DataMember]
public OperationInfo[] ActiveOperations { get; set; }
[DataMember]
public OperationInfo LastOperation { get; set; }
[DataMember]
public Dictionary<string, int> Counters { get; set; }
}
[DataContract]
public class OperationInfo
{
[DataMember]
public DateTime StartTime { get; set; }
[DataMember]
public double Duration { get; set; }
[DataMember]
public OperationState State { get; set; }
[DataMember]
public string SessionId { get; set; }
[DataMember]
public string Operation { get; set; }
public OperationInfo()
{
}
public static OperationInfo From(AppOperation op)
{
if (op == null)
return null;
return new OperationInfo()
{
StartTime = op.Start,
Duration = op.Duration.TotalSeconds,
State = op.State,
SessionId = op.SessionId,
Operation = op.Operation.ToString()
};
}
}
[DataContract]
public class ServerInfo
{
[DataMember]
public DateTime BuiltTime { get; set; }
[DataMember]
public DateTime Aspose3DBuiltTime { get; set; }
[DataMember]
public string Uptime { get; set; }
[DataMember]
public DateTime StartupTime { get; set; }
[DataMember]
public DateTime ServerTime { get; set; }
[DataMember]
public double WorkingSet { get; set; }
[DataMember]
public OperationInfo[] ActiveTasks { get; set; }
}
[Route("api/state")]
[ApiController]
public class StateController : ControllerBase
{
private MeasurementService measurementService;
private string statsKey;
public StateController(MeasurementService measurementService,
IConfiguration configuration)
{
this.measurementService = measurementService;
statsKey = configuration["SystemConfig:StatsKey"];
}
[HttpGet]
public ActionResult<ServerInfo> GetServerInfo(string key)
{
if (string.Compare(key, statsKey) != 0)
return BadRequest();
var ret = new ServerInfo();
var file = new FileInfo(typeof(StateController).Assembly.Location);
ret.BuiltTime = file.LastWriteTime;
file = new FileInfo(typeof(Aspose.ThreeD.Scene).Assembly.Location);
ret.Aspose3DBuiltTime = file.LastWriteTime;
var process = Process.GetCurrentProcess();
ret.ServerTime = DateTime.Now;
ret.StartupTime = process.StartTime;
ret.Uptime = (ret.ServerTime - ret.StartupTime).ToString();
ret.WorkingSet = process.WorkingSet64 / 1024.0 / 1024.0;
List<OperationInfo> activeTasks = new List<OperationInfo>();
var measurements = measurementService.GetMeasurements();
foreach(var measurement in measurements)
{
var ops = measurement.GetActiveOperations();
for(int i = 0; i < ops.Length; i++)
{
activeTasks.Add(OperationInfo.From(ops[i]));
}
}
ret.ActiveTasks = activeTasks.ToArray();
return new ActionResult<ServerInfo>(ret);
}
ThreeDApp? ParseApp(string app)
{
if (app == null)
return null;
switch (app)
{
case "conversion":return ThreeDApp.Conversion;
case "repairing":return ThreeDApp.Repairing;
case "measurement":return ThreeDApp.Measurement;
case "viewer":return ThreeDApp.Viewer;
}
return null;
}
// GET api/values
[HttpGet("app/{appName}/measurement")]
public ActionResult<MeasurementInfo> GetMeasurement(string appName, string key)
{
if (string.Compare(key, statsKey) != 0)
return BadRequest();
var ret = new MeasurementInfo();
var app = ParseApp(appName);
if(app == null)
return NotFound();
var measurement = measurementService.GetMeasurement(app.Value);
if (measurement == null)
return NotFound();
var active = measurement.GetActiveOperations();
var error = measurement.GetErrorOperations();
ret.Successed = measurement.SuccessedOperations;
ret.Failed = measurement.FailedOperations;
ret.ActiveOperations = ToOperationInfos(active);
ret.ErrorOperations = ToOperationInfos(error);
ret.ProlongOperations = ToOperationInfos(measurement.GetProlongOperations());
ret.LastOperation = OperationInfo.From(measurement.LastOperation);
ret.Counters = new Dictionary<string, int>();
foreach(var kind in measurement.GetOperationKinds())
{
ret.Counters[kind.ToString()] = kind.Counter;
}
return new ActionResult<MeasurementInfo>(ret);
}
private OperationInfo[] ToOperationInfos(AppOperation[] ops)
{
var ret = new OperationInfo[ops.Length];
for(int i = 0; i <ret.Length; i++)
{
ret[i] = OperationInfo.From(ops[i]);
}
return ret;
}
}
}
| {
"content_hash": "094416831bb2f58dc5ddc8fbd66da060",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 89,
"avg_line_length": 33.8235294117647,
"alnum_prop": 0.5772332015810276,
"repo_name": "aspose-3d/Aspose.3D-for-.NET",
"id": "0d915016bf4656caac8b2a24a0a36b7714bd2d5a",
"size": "6327",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Demos/aspose3d/Aspose.App.Api/Controllers/StateController.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "81417"
},
{
"name": "GLSL",
"bytes": "2103"
},
{
"name": "Makefile",
"bytes": "390"
}
],
"symlink_target": ""
} |
package org.apache.catalina.ssi;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.TimeZone;
import javax.servlet.ServletContext;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import org.apache.tomcat.util.ExceptionUtils;
/**
* A HttpServletResponseWrapper, used from
* <code>SSIServletExternalResolver</code>
*
* @author Bip Thelin
* @author David Becker
*/
public class ResponseIncludeWrapper extends HttpServletResponseWrapper {
/**
* The names of some headers we want to capture.
*/
private static final String CONTENT_TYPE = "content-type";
private static final String LAST_MODIFIED = "last-modified";
private static final DateFormat RFC1123_FORMAT;
private static final String RFC1123_PATTERN = "EEE, dd MMM yyyy HH:mm:ss z";
protected long lastModified = -1;
private String contentType = null;
/**
* Our ServletOutputStream
*/
protected final ServletOutputStream captureServletOutputStream;
protected ServletOutputStream servletOutputStream;
protected PrintWriter printWriter;
private final ServletContext context;
private final HttpServletRequest request;
static {
RFC1123_FORMAT = new SimpleDateFormat(RFC1123_PATTERN, Locale.US);
RFC1123_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
}
/**
* Initialize our wrapper with the current HttpServletResponse and
* ServletOutputStream.
*
* @param context The servlet context
* @param request The HttpServletResponse to use
* @param response The response to use
* @param captureServletOutputStream The ServletOutputStream to use
*/
public ResponseIncludeWrapper(ServletContext context,
HttpServletRequest request, HttpServletResponse response,
ServletOutputStream captureServletOutputStream) {
super(response);
this.context = context;
this.request = request;
this.captureServletOutputStream = captureServletOutputStream;
}
/**
* Flush the servletOutputStream or printWriter ( only one will be non-null )
* This must be called after a requestDispatcher.include, since we can't
* assume that the included servlet flushed its stream.
*/
public void flushOutputStreamOrWriter() throws IOException {
if (servletOutputStream != null) {
servletOutputStream.flush();
}
if (printWriter != null) {
printWriter.flush();
}
}
/**
* Return a printwriter, throws and exception if a OutputStream already
* been returned.
*
* @return a PrintWriter object
* @exception java.io.IOException
* if the outputstream already been called
*/
@Override
public PrintWriter getWriter() throws java.io.IOException {
if (servletOutputStream == null) {
if (printWriter == null) {
setCharacterEncoding(getCharacterEncoding());
printWriter = new PrintWriter(
new OutputStreamWriter(captureServletOutputStream,
getCharacterEncoding()));
}
return printWriter;
}
throw new IllegalStateException();
}
/**
* Return a OutputStream, throws and exception if a printwriter already
* been returned.
*
* @return a OutputStream object
* @exception java.io.IOException
* if the printwriter already been called
*/
@Override
public ServletOutputStream getOutputStream() throws java.io.IOException {
if (printWriter == null) {
if (servletOutputStream == null) {
servletOutputStream = captureServletOutputStream;
}
return servletOutputStream;
}
throw new IllegalStateException();
}
/**
* Returns the value of the <code>last-modified</code> header field. The
* result is the number of milliseconds since January 1, 1970 GMT.
*
* @return the date the resource referenced by this
* <code>ResponseIncludeWrapper</code> was last modified, or -1 if not
* known.
*/
public long getLastModified() {
if (lastModified == -1) {
// javadocs say to return -1 if date not known, if you want another
// default, put it here
return -1;
}
return lastModified;
}
/**
* Returns the value of the <code>content-type</code> header field.
*
* @return the content type of the resource referenced by this
* <code>ResponseIncludeWrapper</code>, or <code>null</code> if not known.
*/
@Override
public String getContentType() {
if (contentType == null) {
String url = request.getRequestURI();
String mime = context.getMimeType(url);
if (mime != null) {
setContentType(mime);
} else {
// return a safe value
setContentType("application/x-octet-stream");
}
}
return contentType;
}
/**
* Sets the value of the <code>content-type</code> header field.
*
* @param mime a mime type
*/
@Override
public void setContentType(String mime) {
contentType = mime;
if (contentType != null) {
getResponse().setContentType(contentType);
}
}
@Override
public void addDateHeader(String name, long value) {
super.addDateHeader(name, value);
String lname = name.toLowerCase(Locale.ENGLISH);
if (lname.equals(LAST_MODIFIED)) {
lastModified = value;
}
}
@Override
public void addHeader(String name, String value) {
super.addHeader(name, value);
String lname = name.toLowerCase(Locale.ENGLISH);
if (lname.equals(LAST_MODIFIED)) {
try {
synchronized(RFC1123_FORMAT) {
lastModified = RFC1123_FORMAT.parse(value).getTime();
}
} catch (Throwable ignore) {
ExceptionUtils.handleThrowable(ignore);
}
} else if (lname.equals(CONTENT_TYPE)) {
contentType = value;
}
}
@Override
public void setDateHeader(String name, long value) {
super.setDateHeader(name, value);
String lname = name.toLowerCase(Locale.ENGLISH);
if (lname.equals(LAST_MODIFIED)) {
lastModified = value;
}
}
@Override
public void setHeader(String name, String value) {
super.setHeader(name, value);
String lname = name.toLowerCase(Locale.ENGLISH);
if (lname.equals(LAST_MODIFIED)) {
try {
synchronized(RFC1123_FORMAT) {
lastModified = RFC1123_FORMAT.parse(value).getTime();
}
} catch (Throwable ignore) {
ExceptionUtils.handleThrowable(ignore);
}
}
else if (lname.equals(CONTENT_TYPE))
{
contentType = value;
}
}
}
| {
"content_hash": "4ebb4b240afa4e00d49b9d5e9bbd2950",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 81,
"avg_line_length": 32.36286919831224,
"alnum_prop": 0.5986962190352021,
"repo_name": "wenzhucjy/tomcat_source",
"id": "ca850f7ea652d215836c70710b5fb56775e5aeac",
"size": "8487",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tomcat-8.0.9-sourcecode/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "143275"
},
{
"name": "CSS",
"bytes": "39160"
},
{
"name": "HTML",
"bytes": "4412404"
},
{
"name": "Java",
"bytes": "50487348"
},
{
"name": "NSIS",
"bytes": "78501"
},
{
"name": "Perl",
"bytes": "41995"
},
{
"name": "Shell",
"bytes": "237660"
},
{
"name": "XSLT",
"bytes": "104899"
}
],
"symlink_target": ""
} |
package com.oracle.ptsdemo.healthcare.view.bean;
import java.util.Date;
public class MedicationReport {
private String id;
private Date startDate;
private Date endDate;
private String name;
public MedicationReport(String id, Date startDate, Date endDate, String name) {
this.id = id;
this.startDate = startDate;
this.endDate = endDate;
this.name = name;
}
public MedicationReport(Long id, Date startDate, Date endDate, String name) {
this(String.valueOf(id), startDate, endDate, name);
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getStartDate() {
return startDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public Date getEndDate() {
return endDate;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
| {
"content_hash": "bad7aac706ee49cd1a55669d3c911a2e",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 83,
"avg_line_length": 20.509090909090908,
"alnum_prop": 0.6037234042553191,
"repo_name": "dushmis/Oracle-Cloud",
"id": "7be282f69e39d253b9aef5668fc4a7370127f4fa",
"size": "1128",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "PaaS-SaaS_HealthCareApp/DoctorPatientCRMExtension/HealthCare/HealthCareView/src/com/oracle/ptsdemo/healthcare/view/bean/MedicationReport.java",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "810"
},
{
"name": "C#",
"bytes": "2922162"
},
{
"name": "CSS",
"bytes": "405502"
},
{
"name": "HTML",
"bytes": "2487"
},
{
"name": "Java",
"bytes": "33061859"
},
{
"name": "JavaScript",
"bytes": "43011"
},
{
"name": "PLSQL",
"bytes": "48918"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_27) on Wed Nov 21 16:03:56 EST 2012 -->
<TITLE>
Uses of Package org.pentaho.di.trans.steps.edi2xml
</TITLE>
<META NAME="date" CONTENT="2012-11-21">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Package org.pentaho.di.trans.steps.edi2xml";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/pentaho/di/trans/steps/edi2xml/package-use.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Package<br>org.pentaho.di.trans.steps.edi2xml</B></H2>
</CENTER>
No usage of org.pentaho.di.trans.steps.edi2xml
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/pentaho/di/trans/steps/edi2xml/package-use.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
| {
"content_hash": "0aeaab66edf72b7dc18f82ee701effa7",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 162,
"avg_line_length": 39.548611111111114,
"alnum_prop": 0.6073748902546093,
"repo_name": "ColFusion/PentahoKettle",
"id": "cdaedfba9d6696fd1225e20422261363a2df605d",
"size": "5695",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "kettle-data-integration/docs/api/org/pentaho/di/trans/steps/edi2xml/package-use.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "21071"
},
{
"name": "Batchfile",
"bytes": "21366"
},
{
"name": "C",
"bytes": "7006"
},
{
"name": "CSS",
"bytes": "1952277"
},
{
"name": "Groff",
"bytes": "684"
},
{
"name": "Groovy",
"bytes": "33843"
},
{
"name": "HTML",
"bytes": "197173221"
},
{
"name": "Java",
"bytes": "3685348"
},
{
"name": "JavaScript",
"bytes": "31972698"
},
{
"name": "PHP",
"bytes": "224688"
},
{
"name": "Perl",
"bytes": "6881"
},
{
"name": "PigLatin",
"bytes": "7496"
},
{
"name": "Python",
"bytes": "109487"
},
{
"name": "Shell",
"bytes": "43881"
},
{
"name": "Smarty",
"bytes": "2952"
},
{
"name": "XQuery",
"bytes": "798"
},
{
"name": "XSLT",
"bytes": "562453"
}
],
"symlink_target": ""
} |
/**
*Backboen Model of the Test
*/
var Test = Backbone.Model.extend({
url: "",
/*
getQuestions: function(url){
this.url = url;
this.fetch({
success: function(collection, response){
console.log("success");
}
});
},
*/
});
| {
"content_hash": "464b53be3c818806e799710b309890db",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 43,
"avg_line_length": 12.5,
"alnum_prop": 0.52,
"repo_name": "kakadu-group/kakadu",
"id": "1e9581d05d7b88241b7d1c350121bf61a4b28d29",
"size": "275",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/tests/Jasmine/src/test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "196585"
},
{
"name": "JavaScript",
"bytes": "383487"
},
{
"name": "PHP",
"bytes": "4850451"
},
{
"name": "Perl",
"bytes": "36014"
},
{
"name": "Shell",
"bytes": "15"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.devopsguru.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.devopsguru.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* AccessDeniedException JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AccessDeniedExceptionUnmarshaller extends EnhancedJsonErrorUnmarshaller {
private AccessDeniedExceptionUnmarshaller() {
super(com.amazonaws.services.devopsguru.model.AccessDeniedException.class, "AccessDeniedException");
}
@Override
public com.amazonaws.services.devopsguru.model.AccessDeniedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {
com.amazonaws.services.devopsguru.model.AccessDeniedException accessDeniedException = new com.amazonaws.services.devopsguru.model.AccessDeniedException(
null);
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return accessDeniedException;
}
private static AccessDeniedExceptionUnmarshaller instance;
public static AccessDeniedExceptionUnmarshaller getInstance() {
if (instance == null)
instance = new AccessDeniedExceptionUnmarshaller();
return instance;
}
}
| {
"content_hash": "04c5fe6cd5644db04300dae1fdbf8187",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 160,
"avg_line_length": 36.03174603174603,
"alnum_prop": 0.6779735682819383,
"repo_name": "aws/aws-sdk-java",
"id": "91e4425bf08a386b2f2da63917a5600ed22c4e8a",
"size": "2850",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-devopsguru/src/main/java/com/amazonaws/services/devopsguru/model/transform/AccessDeniedExceptionUnmarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System.ComponentModel;
using System.Diagnostics;
using System.Windows.Forms;
using OpenLiveWriter.Localization.Bidi;
namespace OpenLiveWriter.Controls
{
public class ToolTip2 : ToolTip
{
public ToolTip2(IContainer container) : base(container)
{
if (BidiHelper.IsRightToLeft)
{
OwnerDraw = true;
Draw += ToolTip2_Draw;
}
}
public ToolTip2()
: base()
{
if (BidiHelper.IsRightToLeft)
{
OwnerDraw = true;
Draw += ToolTip2_Draw;
}
}
static void ToolTip2_Draw(object sender, DrawToolTipEventArgs e)
{
Debug.Assert(BidiHelper.IsRightToLeft, "Tooltip2 should only be ownerdraw when running RTL");
e.DrawBackground();
e.DrawBorder();
e.DrawText(TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.RightToLeft | TextFormatFlags.Right);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (OwnerDraw)
Draw -= ToolTip2_Draw;
}
}
}
| {
"content_hash": "417dd5cc5f83b66739cfe54ebe8018ae",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 119,
"avg_line_length": 27.454545454545453,
"alnum_prop": 0.5579470198675497,
"repo_name": "hashhar/OpenLiveWriter",
"id": "d6ba66d39451199b2d1291b2908f0b20d31cd908",
"size": "1349",
"binary": false,
"copies": "13",
"ref": "refs/heads/master",
"path": "src/managed/OpenLiveWriter.Controls/ToolTip2.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "4881"
},
{
"name": "C",
"bytes": "3246"
},
{
"name": "C#",
"bytes": "18377182"
},
{
"name": "C++",
"bytes": "48027"
},
{
"name": "CSS",
"bytes": "1124"
},
{
"name": "HTML",
"bytes": "47027"
},
{
"name": "JavaScript",
"bytes": "432"
},
{
"name": "PowerShell",
"bytes": "2485"
},
{
"name": "Smalltalk",
"bytes": "12290"
},
{
"name": "XSLT",
"bytes": "6823"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<!DOCTYPE sect2 SYSTEM "/src/Docs/DocBookManuals/docbookx.dtd">
<sect2>
<sect2info><date>Monday, April 19, 2004 13:14:25</date>
</sect2info>
<title>System.SetGroupDeviceUserConnectionParameters</title>
<para></para>
<bridgehead renderas="sect3">Remarks</bridgehead>
<para>This operator alters a mapping previously created by
<symbol>CreateGroupDeviceUser</symbol>. This only changes the connection
parameters used to connect to the specified device. This Operator can only be
used by the Admin users.</para>
<example>
<title>Example</title>
<programlisting>// assuming that the current user is an admin user
create device MSSQL reconciliation { mode = { command }, master = server }
class "Alphora.Dataphor.DAE.Device.MSSQL.MSSQLDevice.AlphoraMSSQLDevice";
{
"ServerName" = ".",
"DatebaseName" = "SP",
"IsCaseSensitive" = "true"
};
CreateGroupDeviceUser("Group1", "MSSQL", "SQLUser", "SQLPassword");
SetGroupDeviceUserConnectionParameters("Group1", "MSSQL", "IsCaseSensitive" = "false");</programlisting>
</example>
<formalpara>
<title>See Also</title>
<para>
<literallayout><ulink url="DUGSecurity.html">Security</ulink>
<ulink url="D4LGDevices.html">Devices</ulink>
<ulink url="DDGP2UserMapping.html">User Mapping</ulink>
<ulink url="SLRSystem.ChangeDeviceUserPassword.html">System.ChangeDeviceUserPassword</ulink>
<ulink url="SLRSystem.CreateDeviceUser.html">System.CreateDeviceUser</ulink>
<ulink url="SLRSystem.CreateDeviceUserWithEncryptedPassword.html">System.CreateDeviceUserWithEncryptedPassword</ulink>
<ulink url="SLRSystem.CreateGroupDeviceUser.html">System.CreateGroupDeviceUser</ulink>
<ulink url="SLRSystem.CreateGroupDeviceUserWithEncryptedPassword.html">System.CreateGroupDeviceUserWithEncryptedPassword</ulink>
<ulink url="SLRSystem.DeviceUserExists.html">System.DeviceUserExists</ulink>
<ulink url="SLRSystem.DropDeviceUser.html">System.DropDeviceUser</ulink>
<ulink url="SLRSystem.DropGroupDeviceUser.html">System.DropGroupDeviceUser</ulink>
<ulink url="SLRSystem.GroupDeviceUserExists.html">System.GroupDeviceUserExists</ulink>
<ulink url="SLRSystem.SetDeviceUserID.html">System.SetDeviceUserID</ulink>
<ulink url="SLRSystem.SetDeviceUserPassword.html">System.SetDeviceUserPassword</ulink>
<ulink url="SLRSystem.SetGroupDeviceUserID.html">System.SetGroupDeviceUserID</ulink>
<ulink url="SLRSystem.SetGroupDeviceUserPassword.html">System.SetGroupDeviceUserPassword</ulink>
</literallayout> </para>
</formalpara>
</sect2>
| {
"content_hash": "849e8eb4f736e5f13a5b8bef0d547f94",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 128,
"avg_line_length": 55.46808510638298,
"alnum_prop": 0.760644418872267,
"repo_name": "n8allan/Dataphor",
"id": "cf204903e809d12ee060450a33b04a88c5c2b160",
"size": "2607",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Documentation/DocBookManuals/OperatorDocs/System.SetGroupDeviceUserConnectionParameters.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "10945"
},
{
"name": "Batchfile",
"bytes": "3315"
},
{
"name": "C",
"bytes": "119340"
},
{
"name": "C#",
"bytes": "12557951"
},
{
"name": "C++",
"bytes": "12364"
},
{
"name": "CSS",
"bytes": "70313"
},
{
"name": "HTML",
"bytes": "17417"
},
{
"name": "JavaScript",
"bytes": "24437"
},
{
"name": "PLSQL",
"bytes": "10915"
},
{
"name": "PLpgSQL",
"bytes": "19912"
},
{
"name": "TypeScript",
"bytes": "1"
}
],
"symlink_target": ""
} |
RtlMtgCardBbCode
================
xenForo addon for M:TG-related custom BB Codes
Installation
-------------
- download the repository (or a tag) as a .zip (or tarball where available)
- unpack locally and place the following things in your xenForo installation's library (via SCP or ftp, etc):
- the contents of the upload directory
- Login to xenForo's admin panel
- Select "BB Code Manager" from the far left menu
- Click "Import New BB Code"
- Upload the XML files one at a time
- the XML files have the appropriate information, including help text and configuration
- These also setup buttons if you choose to use them
- If you want to setup buttons:
- click "Buttons Manager"
- Using the Buttons Visual Configuration Management, you can drag in the various buttons to where you want
- hit "Install Add-on" and xenForo will take it from there
Features
--------------
- [ci] tag for card images from gatherer.com
- [ci]your-card-name[/ci] is replaced with "http://gatherer.wizards.com/Handlers/Image.ashx?type=card&name=your-card-name" and is appropriately escaped
- [cubedeck] tag for a graphical layout of a deck using images
- [deck] tag for a textual layout of a deck with mouseover
- [c] mouseover card images
Changelog
--------------
- 0.2.0
-- refactor to instead provide button parsers for "BB Code Manager 1.3.4"
-- added cubedeck, deck, c tags
- 0.1.0
-- initial release, ci tag added as a completely standalone BB Code
| {
"content_hash": "e08e5e0091da97ecc889cfbe56c3f0b7",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 153,
"avg_line_length": 35.46341463414634,
"alnum_prop": 0.7235213204951857,
"repo_name": "riptidelab/RtlMtgCardBbCode",
"id": "3fc403d65b58be9a3d17e0e0ac346d2ae68b1a8a",
"size": "1454",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "10790"
}
],
"symlink_target": ""
} |
var odsstrexConfig = {
/*
* rest: odsstres-rest endpoint URL.
*/
rest: "/odsstrex-rest",
/*
* readonly: if true, modifications/additions are disabled
*/
readonly: true
};
| {
"content_hash": "84a181fabb94d93d13be585b4546f1f7",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 62,
"avg_line_length": 15.071428571428571,
"alnum_prop": 0.5639810426540285,
"repo_name": "carueda/odsstrex-ui",
"id": "b9d38ad4690ebdcdc392fe58a25dafe3c0c7c402",
"size": "211",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webapp/config.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "11234"
},
{
"name": "JavaScript",
"bytes": "132341"
},
{
"name": "Shell",
"bytes": "194"
}
],
"symlink_target": ""
} |
Store your entreprise crt in this directory to make them available to any collector.
Procedure:
1. Add your crt in this directory
2. Add a volume in your docker-compose.override.yml to mount the directory:
```
volumes:
- ./certs:/certs
```
3. Depending on the collector's environment, create a env variable named CACERTS that points to the local cacert
4. Reuse the script found in collectors/scm/bitbucket/docker/properties-builder.sh
| {
"content_hash": "f465dc50552176085c49c9e8414fcf73",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 112,
"avg_line_length": 41,
"alnum_prop": 0.7605321507760532,
"repo_name": "tabladrum/Hygieia",
"id": "8c0c51e8549f7cd52917d1a8cae2af706d72a8c7",
"size": "481",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "certs/readme.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "334858"
},
{
"name": "Dockerfile",
"bytes": "20720"
},
{
"name": "Gherkin",
"bytes": "18014"
},
{
"name": "HTML",
"bytes": "318018"
},
{
"name": "Java",
"bytes": "3732213"
},
{
"name": "JavaScript",
"bytes": "5232117"
},
{
"name": "Shell",
"bytes": "66660"
}
],
"symlink_target": ""
} |
#import "IDETestFailureBreakpoint.h"
@class NSImage;
@interface IDETestFailureBreakpoint (IDEBreakpointNavigatorSupport)
- (BOOL)shouldEditNewBreakpoints;
- (id)popUpEditorDisplayName;
@property(readonly) NSImage *navigableItem_image;
@end
| {
"content_hash": "caf261f588cc0f79e45a7e408aa40e0c",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 67,
"avg_line_length": 20.416666666666668,
"alnum_prop": 0.8204081632653061,
"repo_name": "liyong03/YLCleaner",
"id": "b9b6c7e6297a750c845a2530cc937e2b65a317e2",
"size": "385",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "YLCleaner/Xcode-RuntimeHeaders/DebuggerUI/IDETestFailureBreakpoint-IDEBreakpointNavigatorSupport.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "158958"
},
{
"name": "C++",
"bytes": "612673"
},
{
"name": "Objective-C",
"bytes": "10594281"
},
{
"name": "Ruby",
"bytes": "675"
}
],
"symlink_target": ""
} |
using System.Collections.Generic;
namespace ZptSharp.Dom
{
/// <summary>
/// Replaces the specified node with a collection of replacement nodes.
/// </summary>
public interface IReplacesNode
{
/// <summary>
/// <para>
/// Replace the specified node with a collection of replacements.
/// </para>
/// <para>
/// Note that this means that the current node will be detached/removed from its parent as a side-effect.
/// Further DOM manipulation should occur using the replacement nodes and not the replaced node.
/// </para>
/// </summary>
/// <param name="toReplace">The node to replace.</param>
/// <param name="replacements">The replacements.</param>
void Replace(INode toReplace, IList<INode> replacements);
}
}
| {
"content_hash": "b567890d461c1007ab1e6190ed9904dd",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 113,
"avg_line_length": 36.30434782608695,
"alnum_prop": 0.6191616766467066,
"repo_name": "csf-dev/ZPT-Sharp",
"id": "e998d9c75446939729f6bd2b5bec2f26b1e31465",
"size": "837",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ZptSharp.Abstractions/Dom/IReplacesNode.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AMPL",
"bytes": "4949"
},
{
"name": "Batchfile",
"bytes": "3142"
},
{
"name": "C#",
"bytes": "1670750"
},
{
"name": "HTML",
"bytes": "146448"
},
{
"name": "PowerShell",
"bytes": "2416"
}
],
"symlink_target": ""
} |
//
// HRTAppModule.h
// HRTAppModule
//
// Created by Hirat on 15/11/4.
// Copyright (c) 2015年 Hirat. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol HRTAppModule <NSObject>
@required
/// 通过这个 NavigationController弹出子视图
@property (nonatomic, strong) UINavigationController* navigationController;
/// 该模块对应的所有 route
@property(strong, nonatomic, readonly) NSMutableDictionary* routes;
/// 该模块对应的 rootViewController
@property(strong, nonatomic, readonly) UIViewController* rootViewController;
/**
* 单例
*
* @return 模块单例
*/
+ (instancetype)sharedInstance;
/**
* 将 url 与 UIViewController 关联起来
*
* @param route url
* @param controllerClass UIViewController 对应的 Class
*/
- (void)map:(NSString*)route toControllerClass:(Class)controllerClass;
/**
* url 对应的 UIViewController
*
* @param route url
*
* @return VC
*/
- (UIViewController*)viewControllerForRoute:(NSString*)route;
@end
| {
"content_hash": "3e27627873b7497266f6278471abb87a",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 76,
"avg_line_length": 18.93877551020408,
"alnum_prop": 0.7133620689655172,
"repo_name": "hirat/HRTAppModule",
"id": "45fca06fdd669b0e7417a90b63ac40331d8ba78e",
"size": "1012",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "HRTAppModule.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "1954"
},
{
"name": "Ruby",
"bytes": "389"
}
],
"symlink_target": ""
} |
namespace Glyph3
{
class PixelShaderDX11 : public ShaderDX11
{
public:
PixelShaderDX11( ID3D11PixelShader* pShader );
virtual ~PixelShaderDX11();
virtual ShaderType GetType();
protected:
ID3D11PixelShader* m_pPixelShader;
friend PixelStageDX11;
};
};
//--------------------------------------------------------------------------------
#endif // PixelShaderDX11_h
//--------------------------------------------------------------------------------
| {
"content_hash": "404b3733e61907cb86691fd050dfa979",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 82,
"avg_line_length": 23.3,
"alnum_prop": 0.47639484978540775,
"repo_name": "MIFOZ/Hieroglyph3-mirror",
"id": "47f160d67d847005e5f97dcfcbbee67ab73f6c7f",
"size": "1367",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Include/PixelShaderDX11.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "19376"
},
{
"name": "C#",
"bytes": "5274"
},
{
"name": "C++",
"bytes": "2230336"
},
{
"name": "Lua",
"bytes": "4359"
},
{
"name": "Objective-C",
"bytes": "173"
},
{
"name": "Shell",
"bytes": "2709"
},
{
"name": "Smalltalk",
"bytes": "934"
}
],
"symlink_target": ""
} |
package com.intellij.util;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.DifferenceFilter;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.JBIterable;
import com.intellij.util.containers.JBTreeTraverser;
import com.intellij.util.containers.Predicate;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.annotation.Annotation;
import java.lang.reflect.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Set;
public class ReflectionUtil {
private static final Logger LOG = Logger.getInstance("#com.intellij.util.ReflectionUtil");
private ReflectionUtil() { }
@Nullable
public static Type resolveVariable(@NotNull TypeVariable variable, @NotNull Class classType) {
return resolveVariable(variable, classType, true);
}
@Nullable
public static Type resolveVariable(@NotNull TypeVariable variable, @NotNull Class classType, boolean resolveInInterfacesOnly) {
final Class aClass = getRawType(classType);
int index = ArrayUtilRt.find(aClass.getTypeParameters(), variable);
if (index >= 0) {
return variable;
}
final Class[] classes = aClass.getInterfaces();
final Type[] genericInterfaces = aClass.getGenericInterfaces();
for (int i = 0; i <= classes.length; i++) {
Class anInterface;
if (i < classes.length) {
anInterface = classes[i];
}
else {
anInterface = aClass.getSuperclass();
if (resolveInInterfacesOnly || anInterface == null) {
continue;
}
}
final Type resolved = resolveVariable(variable, anInterface);
if (resolved instanceof Class || resolved instanceof ParameterizedType) {
return resolved;
}
if (resolved instanceof TypeVariable) {
final TypeVariable typeVariable = (TypeVariable)resolved;
index = ArrayUtilRt.find(anInterface.getTypeParameters(), typeVariable);
if (index < 0) {
LOG.error("Cannot resolve type variable:\n" + "typeVariable = " + typeVariable + "\n" + "genericDeclaration = " +
declarationToString(typeVariable.getGenericDeclaration()) + "\n" + "searching in " + declarationToString(anInterface));
}
final Type type = i < genericInterfaces.length ? genericInterfaces[i] : aClass.getGenericSuperclass();
if (type instanceof Class) {
return Object.class;
}
if (type instanceof ParameterizedType) {
return getActualTypeArguments((ParameterizedType)type)[index];
}
throw new AssertionError("Invalid type: " + type);
}
}
return null;
}
@NotNull
public static String declarationToString(@NotNull GenericDeclaration anInterface) {
return anInterface.toString() + Arrays.asList(anInterface.getTypeParameters()) + " loaded by " + ((Class)anInterface).getClassLoader();
}
@NotNull
public static Class<?> getRawType(@NotNull Type type) {
if (type instanceof Class) {
return (Class)type;
}
if (type instanceof ParameterizedType) {
return getRawType(((ParameterizedType)type).getRawType());
}
if (type instanceof GenericArrayType) {
//todo[peter] don't create new instance each time
return Array.newInstance(getRawType(((GenericArrayType)type).getGenericComponentType()), 0).getClass();
}
assert false : type;
return null;
}
@NotNull
public static Type[] getActualTypeArguments(@NotNull ParameterizedType parameterizedType) {
return parameterizedType.getActualTypeArguments();
}
@Nullable
public static Class<?> substituteGenericType(@NotNull Type genericType, @NotNull Type classType) {
if (genericType instanceof TypeVariable) {
final Class<?> aClass = getRawType(classType);
final Type type = resolveVariable((TypeVariable)genericType, aClass);
if (type instanceof Class) {
return (Class)type;
}
if (type instanceof ParameterizedType) {
return (Class<?>)((ParameterizedType)type).getRawType();
}
if (type instanceof TypeVariable && classType instanceof ParameterizedType) {
final int index = ArrayUtilRt.find(aClass.getTypeParameters(), type);
if (index >= 0) {
return getRawType(getActualTypeArguments((ParameterizedType)classType)[index]);
}
}
}
else {
return getRawType(genericType);
}
return null;
}
@NotNull
public static List<Field> collectFields(@NotNull Class clazz) {
List<Field> result = ContainerUtil.newArrayList();
for (Class c : classTraverser(clazz)) {
ContainerUtil.addAll(result, c.getDeclaredFields());
}
return result;
}
@NotNull
public static Field findField(@NotNull Class clazz, @Nullable final Class type, @NotNull final String name) throws NoSuchFieldException {
Field result = findFieldInHierarchy(clazz, new Condition<Field>() {
@Override
public boolean value(Field field) {
return name.equals(field.getName()) && (type == null || field.getType().equals(type));
}
});
if (result != null) return result;
throw new NoSuchFieldException("Class: " + clazz + " name: " + name + " type: " + type);
}
@NotNull
public static Field findAssignableField(@NotNull Class<?> clazz, @Nullable("null means any type") final Class<?> fieldType, @NotNull final String fieldName) throws NoSuchFieldException {
Field result = findFieldInHierarchy(clazz, new Condition<Field>() {
@Override
public boolean value(Field field) {
return fieldName.equals(field.getName()) && (fieldType == null || fieldType.isAssignableFrom(field.getType()));
}
});
if (result != null) return result;
throw new NoSuchFieldException("Class: " + clazz + " fieldName: " + fieldName + " fieldType: " + fieldType);
}
@Nullable
private static Field findFieldInHierarchy(@NotNull Class clazz, @NotNull Condition<? super Field> checker) {
for (Class c : classTraverser(clazz)) {
Field field = ContainerUtil.find(c.getDeclaredFields(), checker);
if (field != null) {
field.setAccessible(true);
return field;
}
}
return null;
}
public static void resetField(@NotNull Class clazz, @Nullable("null means of any type") Class type, @NotNull String name) {
try {
resetField(null, findField(clazz, type, name));
}
catch (NoSuchFieldException e) {
LOG.info(e);
}
}
public static void resetField(@NotNull Object object, @Nullable("null means any type") Class type, @NotNull String name) {
try {
resetField(object, findField(object.getClass(), type, name));
}
catch (NoSuchFieldException e) {
LOG.info(e);
}
}
public static void resetField(@NotNull Object object, @NotNull String name) {
try {
resetField(object, findField(object.getClass(), null, name));
}
catch (NoSuchFieldException e) {
LOG.info(e);
}
}
public static void resetField(@Nullable final Object object, @NotNull Field field) {
field.setAccessible(true);
Class<?> type = field.getType();
try {
if (type.isPrimitive()) {
if (boolean.class.equals(type)) {
field.set(object, Boolean.FALSE);
}
else if (int.class.equals(type)) {
field.set(object, 0);
}
else if (double.class.equals(type)) {
field.set(object, (double)0);
}
else if (float.class.equals(type)) {
field.set(object, (float)0);
}
}
else {
field.set(object, null);
}
}
catch (IllegalAccessException e) {
LOG.info(e);
}
}
@Nullable
public static Method findMethod(@NotNull Collection<Method> methods, @NonNls @NotNull String name, @NotNull Class... parameters) {
for (final Method method : methods) {
if (name.equals(method.getName()) && Arrays.equals(parameters, method.getParameterTypes())) {
method.setAccessible(true);
return method;
}
}
return null;
}
@Nullable
public static Method getMethod(@NotNull Class aClass, @NonNls @NotNull String name, @NotNull Class... parameters) {
return findMethod(getClassPublicMethods(aClass, false), name, parameters);
}
@Nullable
public static Method getDeclaredMethod(@NotNull Class aClass, @NonNls @NotNull String name, @NotNull Class... parameters) {
return findMethod(getClassDeclaredMethods(aClass, false), name, parameters);
}
@Nullable
public static Field getDeclaredField(@NotNull Class aClass, @NonNls @NotNull final String name) {
return findFieldInHierarchy(aClass, new Condition<Field>() {
@Override
public boolean value(Field field) {
return name.equals(field.getName());
}
});
}
@NotNull
public static List<Method> getClassPublicMethods(@NotNull Class aClass) {
return getClassPublicMethods(aClass, false);
}
@NotNull
public static List<Method> getClassPublicMethods(@NotNull Class aClass, boolean includeSynthetic) {
Method[] methods = aClass.getMethods();
return includeSynthetic ? Arrays.asList(methods) : filterRealMethods(methods);
}
@NotNull
public static List<Method> getClassDeclaredMethods(@NotNull Class aClass) {
return getClassDeclaredMethods(aClass, false);
}
@NotNull
public static List<Method> getClassDeclaredMethods(@NotNull Class aClass, boolean includeSynthetic) {
Method[] methods = aClass.getDeclaredMethods();
return includeSynthetic ? Arrays.asList(methods) : filterRealMethods(methods);
}
@NotNull
public static List<Field> getClassDeclaredFields(@NotNull Class aClass) {
Field[] fields = aClass.getDeclaredFields();
return Arrays.asList(fields);
}
@NotNull
private static List<Method> filterRealMethods(@NotNull Method[] methods) {
List<Method> result = ContainerUtil.newArrayList();
for (Method method : methods) {
if (!method.isSynthetic()) {
result.add(method);
}
}
return result;
}
@Nullable
public static Class getMethodDeclaringClass(@NotNull Class<?> instanceClass, @NonNls @NotNull String methodName, @NotNull Class... parameters) {
Method method = getMethod(instanceClass, methodName, parameters);
return method == null ? null : method.getDeclaringClass();
}
public static <T> T getField(@NotNull Class objectClass, @Nullable Object object, @Nullable("null means any type") Class<T> fieldType, @NotNull @NonNls String fieldName) {
try {
final Field field = findAssignableField(objectClass, fieldType, fieldName);
@SuppressWarnings("unchecked") T t = (T)field.get(object);
return t;
}
catch (NoSuchFieldException e) {
LOG.debug(e);
return null;
}
catch (IllegalAccessException e) {
LOG.debug(e);
return null;
}
}
public static <T> T getStaticFieldValue(@NotNull Class objectClass, @Nullable("null means any type") Class<T> fieldType, @NotNull @NonNls String fieldName) {
try {
final Field field = findAssignableField(objectClass, fieldType, fieldName);
if (!Modifier.isStatic(field.getModifiers())) {
throw new IllegalArgumentException("Field " + objectClass + "." + fieldName + " is not static");
}
@SuppressWarnings("unchecked") T t = (T)field.get(null);
return t;
}
catch (NoSuchFieldException e) {
LOG.debug(e);
return null;
}
catch (IllegalAccessException e) {
LOG.debug(e);
return null;
}
}
// returns true if value was set
public static <T> boolean setField(@NotNull Class objectClass,
Object object,
@Nullable("null means any type") Class<T> fieldType,
@NotNull @NonNls String fieldName,
T value) {
try {
final Field field = findAssignableField(objectClass, fieldType, fieldName);
field.set(object, value);
return true;
}
catch (NoSuchFieldException e) {
LOG.debug(e);
// this 'return' was moved into 'catch' block because otherwise reference to common super-class of these exceptions (ReflectiveOperationException)
// which doesn't exist in JDK 1.6 will be added to class-file during instrumentation
return false;
}
catch (IllegalAccessException e) {
LOG.debug(e);
return false;
}
}
public static Type resolveVariableInHierarchy(@NotNull TypeVariable variable, @NotNull Class aClass) {
Type type;
Class current = aClass;
while ((type = resolveVariable(variable, current, false)) == null) {
current = current.getSuperclass();
if (current == null) {
return null;
}
}
if (type instanceof TypeVariable) {
return resolveVariableInHierarchy((TypeVariable)type, aClass);
}
return type;
}
@NotNull
public static <T> Constructor<T> getDefaultConstructor(@NotNull Class<T> aClass) {
try {
final Constructor<T> constructor = aClass.getConstructor();
constructor.setAccessible(true);
return constructor;
}
catch (NoSuchMethodException e) {
throw new RuntimeException("No default constructor in " + aClass, e);
}
}
/**
* Like {@link Class#newInstance()} but also handles private classes
*/
@NotNull
public static <T> T newInstance(@NotNull Class<T> aClass) {
try {
Constructor<T> constructor = aClass.getDeclaredConstructor();
try {
constructor.setAccessible(true);
}
catch (SecurityException e) {
return aClass.newInstance();
}
return constructor.newInstance();
}
catch (Exception e) {
T t = createAsDataClass(aClass);
if (t != null) {
return t;
}
ExceptionUtil.rethrow(e);
}
// error will be thrown
return null;
}
@Nullable
private static <T> T createAsDataClass(@NotNull Class<T> aClass) {
// support Kotlin data classes - pass null as default value
for (Annotation annotation : aClass.getAnnotations()) {
String name = annotation.annotationType().getName();
if (!name.equals("kotlin.Metadata") && !name.equals("kotlin.jvm.internal.KotlinClass")) {
continue;
}
Constructor<?>[] constructors = aClass.getDeclaredConstructors();
Exception exception = null;
List<Constructor<?>> defaultCtors = new SmartList<Constructor<?>>();
ctorLoop:
for (Constructor<?> constructor : constructors) {
try {
try {
constructor.setAccessible(true);
}
catch (Throwable ignored) {
}
Class<?>[] parameterTypes = constructor.getParameterTypes();
for (Class<?> type : parameterTypes) {
if (type.getName().equals("kotlin.jvm.internal.DefaultConstructorMarker")) {
defaultCtors.add(constructor);
continue ctorLoop;
}
}
//noinspection unchecked
return (T)constructor.newInstance(new Object[parameterTypes.length]);
}
catch (Exception e) {
exception = e;
}
}
for (Constructor<?> constructor : defaultCtors) {
try {
try {
constructor.setAccessible(true);
}
catch (Throwable ignored) {
}
//noinspection unchecked
return (T)constructor.newInstance();
}
catch (Exception e) {
exception = e;
}
}
if (exception != null) {
ExceptionUtil.rethrow(exception);
}
}
return null;
}
@NotNull
public static <T> T createInstance(@NotNull Constructor<T> constructor, @NotNull Object... args) {
try {
return constructor.newInstance(args);
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
@Nullable
public static Class getGrandCallerClass() {
int stackFrameCount = 3;
return getCallerClass(stackFrameCount+1);
}
public static Class getCallerClass(int stackFrameCount) {
Class callerClass = findCallerClass(stackFrameCount);
for (int depth=stackFrameCount+1; callerClass != null && callerClass.getClassLoader() == null; depth++) { // looks like a system class
callerClass = findCallerClass(depth);
}
if (callerClass == null) {
callerClass = findCallerClass(stackFrameCount-1);
}
return callerClass;
}
public static void copyFields(@NotNull Field[] fields, @NotNull Object from, @NotNull Object to) {
copyFields(fields, from, to, null);
}
public static boolean copyFields(@NotNull Field[] fields, @NotNull Object from, @NotNull Object to, @Nullable DifferenceFilter diffFilter) {
Set<Field> sourceFields = ContainerUtil.newHashSet(from.getClass().getFields());
boolean valuesChanged = false;
for (Field field : fields) {
if (sourceFields.contains(field)) {
if (isPublic(field) && !isFinal(field)) {
try {
if (diffFilter == null || diffFilter.isAccept(field)) {
copyFieldValue(from, to, field);
valuesChanged = true;
}
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
}
}
return valuesChanged;
}
public static <T> boolean comparePublicNonFinalFields(@NotNull T first, @NotNull T second) {
return compareFields(first, second, new Predicate<Field>() {
@Override
public boolean apply(Field field) {
return isPublic(field) && !isFinal(field);
}
});
}
public static <T> boolean compareFields(@NotNull T defaultSettings, @NotNull T newSettings, @NotNull Predicate<? super Field> useField) {
Class<?> defaultClass = defaultSettings.getClass();
Field[] fields = defaultClass.getDeclaredFields();
if (defaultClass != newSettings.getClass()) {
fields = ArrayUtil.mergeArrays(fields, newSettings.getClass().getDeclaredFields());
}
for (Field field : fields) {
if (!useField.apply(field)) continue;
field.setAccessible(true);
try {
if (!Comparing.equal(field.get(newSettings), field.get(defaultSettings))) {
return false;
}
}
catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
return true;
}
public static void copyFieldValue(@NotNull Object from, @NotNull Object to, @NotNull Field field)
throws IllegalAccessException {
Class<?> fieldType = field.getType();
if (fieldType.isPrimitive() || fieldType.equals(String.class) || fieldType.isEnum()) {
field.set(to, field.get(from));
}
else {
throw new RuntimeException("Field '" + field.getName()+"' not copied: unsupported type: "+field.getType());
}
}
private static boolean isPublic(final Field field) {
return (field.getModifiers() & Modifier.PUBLIC) != 0;
}
private static boolean isFinal(final Field field) {
return (field.getModifiers() & Modifier.FINAL) != 0;
}
@NotNull
public static Class<?> forName(@NotNull String fqn) {
try {
return Class.forName(fqn);
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
@NotNull
public static Class<?> boxType(@NotNull Class<?> type) {
if (!type.isPrimitive()) return type;
if (type == boolean.class) return Boolean.class;
if (type == byte.class) return Byte.class;
if (type == short.class) return Short.class;
if (type == int.class) return Integer.class;
if (type == long.class) return Long.class;
if (type == float.class) return Float.class;
if (type == double.class) return Double.class;
if (type == char.class) return Character.class;
return type;
}
private static class MySecurityManager extends SecurityManager {
private static final MySecurityManager INSTANCE = new MySecurityManager();
public Class[] getStack() {
return getClassContext();
}
}
/**
* Returns the class this method was called 'framesToSkip' frames up the caller hierarchy.
*
* NOTE:
* <b>Extremely expensive!
* Please consider not using it.
* These aren't the droids you're looking for!</b>
*/
@Nullable
public static Class findCallerClass(int framesToSkip) {
try {
Class[] stack = MySecurityManager.INSTANCE.getStack();
int indexFromTop = 1 + framesToSkip;
return stack.length > indexFromTop ? stack[indexFromTop] : null;
}
catch (Exception e) {
LOG.warn(e);
return null;
}
}
public static boolean isAssignable(@NotNull Class<?> ancestor, @NotNull Class<?> descendant) {
return ancestor == descendant || ancestor.isAssignableFrom(descendant);
}
@NotNull
public static JBTreeTraverser<Class> classTraverser(@Nullable Class root) {
return CLASS_TRAVERSER.unique().withRoot(root);
}
private static final JBTreeTraverser<Class> CLASS_TRAVERSER = JBTreeTraverser.from(new Function<Class, Iterable<Class>>() {
@Override
public Iterable<Class> fun(Class aClass) {
return JBIterable.of(aClass.getSuperclass()).append(aClass.getInterfaces());
}
});
} | {
"content_hash": "2557837878ea3c3379265e26a2a2e89a",
"timestamp": "",
"source": "github",
"line_count": 646,
"max_line_length": 188,
"avg_line_length": 33.188854489164086,
"alnum_prop": 0.6541977611940298,
"repo_name": "mdanielwork/intellij-community",
"id": "0b003a33abf7313ba29b61b511307ea26d1f1bc3",
"size": "22040",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "platform/util/src/com/intellij/util/ReflectionUtil.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System;
namespace Azure.Messaging.EventGrid.SystemEvents
{
internal static partial class MediaJobErrorCategoryExtensions
{
public static string ToSerialString(this MediaJobErrorCategory value) => value switch
{
MediaJobErrorCategory.Service => "Service",
MediaJobErrorCategory.Download => "Download",
MediaJobErrorCategory.Upload => "Upload",
MediaJobErrorCategory.Configuration => "Configuration",
MediaJobErrorCategory.Content => "Content",
MediaJobErrorCategory.Account => "Account",
_ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobErrorCategory value.")
};
}
}
| {
"content_hash": "6e7402dc8f6d1847e529df961127f7af",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 116,
"avg_line_length": 40.333333333333336,
"alnum_prop": 0.6763085399449036,
"repo_name": "Azure/azure-sdk-for-net",
"id": "4194a07537fce8c9b252810f6d8e3b085d984283",
"size": "864",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobErrorCategory.Serialization.cs",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
const util = require('util');
const cluster = require('cluster');
const events = require("events");
const logger = require(__dirname + '/logger');
const core = require(__dirname + '/core');
const lib = require(__dirname + '/lib');
const metrics = require(__dirname + '/metrics');
const Client = require(__dirname + "/ipc/client");
// IPC communications between processes and support for caching and subscriptions via queues.
//
// The module is EventEmitter and emits messages received.
//
// Some drivers may support TTL so global `options.ttl` or local `options.ttl` can be used for `put/incr` operations and it will honored if it is suported.
//
// For caches that support maps, like Redis or Hazelcast the `options.mapName` can be used with get/put/incr/del to
// work with maps and individual keys inside maps.
//
// All methods use `options.queueName` or `options.cacheName` for non-default queue or cache.
// If it is an array then a client will be picked sequentially by maintaining internal sequence number.
//
// To specify a channel within a queue use the format `queueName#channelName`, for drivers that support multiple channels like NATS/Redis
// the channel will be used for another subscription within the same connection.
//
// For drivers (NATS) that support multiple consumers the full queue syntax is `queueName#channelName@groupName` or `queueName@groupName`,
// as well as the `groupName` property in the subscribe options.
//
// A special system queue can be configured and it will be used by all processes to listen for messages on the channel `bkjs:role`, where the role
// is the process role, the same messages that are processed by the server/worker message handlers like api:restart, config:init,....
// All instances will be listening and processing these messages at once, the most usefull use case is refreshing the DB config on demand or
// restarting without configuring any other means like SSH, keys....
//
function Ipc()
{
events.EventEmitter.call(this);
this.name = "ipc";
this.role = "";
this.msgs = {};
this._queue = [];
this._nameIndex = 0;
this.restarting = [];
this.modules = [];
this.clients = { "": new Client() };
this.ports = {};
// Use shared token buckets inside the server process, reuse the same object so we do not generate
// a lot of short lived objects, the whole operation including serialization from/to the cache is atomic.
this.tokenBucket = new metrics.TokenBucket();
this.lru = new lib.LRUCache();
this.roles = ["master","server"];
// Config params
this.configParams = { local: { _url: "local://" } };
this.args = [
{ name: "none", type: "bool", descr: "disable all IPC subsystems" },
{ name: "ping-interval", type: "int", min: 0, descr: "Interval for a worker keep-alive pings, if not received within this period it will be killed" },
{ name: "lru-max", type: "int", obj: "lru", descr: "Max number of items in the limiter LRU cache, this cache is managed by the master Web server process and available to all Web processes maintaining only one copy per machine" },
{ name: "system-queue", descr: "System queue name to send broadcast control messages, this is a PUB/SUB queue to process system messages like restart, re-init config,..." },
{ name: "(cache|queue)-?([a-z0-9]+)?$", obj: "configParams.$2", make: "_url", nocamel: 1, onupdate: function(v,o) {this.applyOptions(v,o)}, descr: "An URL that points to a cache/queue server in the format `PROTO://HOST[:PORT]?PARAMS`, multiple clients can be defined with unique names, all params starting with `bk-` will be copied into the options without the prefix and removed from the url, the rest of params will be left in the url, ex: -ipc-queue-redis redis://localhost?bk-count=3&bk-ttl=3000" },
{ name: "(cache|queue)(-([a-z0-9]+)?-?options)-(.+)$", obj: "configParams.$3", make: "$4", camel: '-', autotype: 1, onupdate: function(v,o) {this.applyOptions(v,o)}, descr: "Additional parameters for clients, specific to each implementation, ex: `-ipc-queue-options-count 10`" },
{ name: "(cache|queue)-([a-z0-9]*)-options$", obj: "configParams.$2", type: "map", merge: 1, maptype: "auto", onupdate: function(v,o) {this.applyOptions(v,o)}, descr: "Additional parameters for clients, specific to each implementation, ex: `-ipc-queue--options count:10,interval:100" },
];
}
util.inherits(Ipc, events.EventEmitter);
module.exports = new Ipc();
Ipc.prototype.applyOptions = function(val, options)
{
if (!options.obj) return;
logger.debug("applyOptions:", options.obj, options.name, "NEW:", options.context);
var d = lib.strSplit(options.obj, ".");
var client = d[0] == "configParams" && this.getClient(d[1]);
if (client?.queueName != (d[1] || "default")) return;
logger.debug("applyOptions:", client.queueName, options.obj, options.name, "OLD:", client.options);
if (options.name == "_url") client.url = val;
client.applyOptions(options.context);
}
Ipc.prototype.handleWorkerMessages = function(msg)
{
if (!msg) return;
logger.dev('handleWorkerMessages:', core.role, msg)
lib.runCallback(this.msgs, msg);
try {
switch (msg.__op || "") {
case "api:restart":
core.modules.api.shutdown(function() { process.exit(0); });
break;
case "worker:restart":
if (cluster.isWorker) core.runMethods("shutdownWorker", function() { process.exit(0); });
break;
case "queue:init":
this.initClients();
break;
case "queue:check":
this.checkClients();
break;
case "dns:init":
core.loadDnsConfig();
break;
case "config:init":
core.modules.db.initConfig();
break;
case "conf:init":
core.reloadConfig();
break;
case "msg:init":
core.modules.msg.init();
break;
case "columns:init":
core.modules.db.refreshColumns();
break;
case "repl:init":
if (msg.port) core.startRepl(msg.port, core.repl.bind);
break;
case "repl:shutdown":
if (core.repl.server) core.repl.server.end();
delete core.repl.server;
break;
}
this.emit(msg.__op, msg);
} catch (e) {
logger.error('handleWorkerMessages:', e.stack, msg);
}
}
// To be used in messages processing that came from the clients or other way
Ipc.prototype.handleServerMessages = function(worker, msg)
{
if (!msg) return false;
logger.dev('handleServerMessages:', core.role, msg);
try {
switch (msg.__op) {
case "api:restart":
// Start gracefull restart of all api workers, wait till a new worker starts and then send a signal to another in the list.
// This way we keep active processes responding to the requests while restarting
if (this.restarting.length) break;
for (const p in cluster.workers) this.restarting.push(cluster.workers[p].process.pid);
case "api:ready":
// Restart the next worker from the list
if (this.restarting.length) {
for (const p in cluster.workers) {
var idx = this.restarting.indexOf(cluster.workers[p].process.pid);
if (idx == -1) continue;
this.restarting.splice(idx, 1);
cluster.workers[p].send({ __op: "api:restart" });
break;
}
}
this.sendReplPort("web", worker);
break;
case "worker:ready":
this.sendReplPort("worker", worker);
break;
case "worker:restart":
for (const p in cluster.workers) cluster.workers[p].send(msg);
break;
case "worker:ping":
if (!cluster.workers[worker.id]) break;
cluster.workers[worker.id].pingTime = Date.now();
break;
case "cluster:disconnect":
if (!cluster.workers[worker.id]) break;
cluster.workers[worker.id].pingTime = -1;
break;
case "cluster:exit":
for (var p in this.ports) {
if (this.ports[p] == worker.process.pid) {
this.ports[p] = 0;
break;
}
}
if (!cluster.workers[worker.id]) break;
cluster.workers[worker.id].pingTime = -1;
break;
case "cluster:listen":
this.ports[msg.port] = worker.process.pid;
break;
case "queue:init":
this.initClients();
for (const p in cluster.workers) cluster.workers[p].send(msg);
break;
case "queue:check":
this.checkClients();
for (const p in cluster.workers) cluster.workers[p].send(msg);
break;
case "config:init":
core.modules.db.initConfig();
for (const p in cluster.workers) cluster.workers[p].send(msg);
break;
case "conf:init":
core.reloadConfig();
for (const p in cluster.workers) cluster.workers[p].send(msg);
break;
case "columns:init":
core.modules.db.refreshColumns();
for (const p in cluster.workers) cluster.workers[p].send(msg);
break;
case "dns:init":
core.loadDnsConfig();
for (const p in cluster.workers) cluster.workers[p].send(msg);
break;
case "msg:init":
for (const p in cluster.workers) cluster.workers[p].send(msg);
break;
case "ipc:limiter":
worker.send(this.localLimiter(msg));
break;
}
this.emit(msg.__op, msg, worker);
} catch (e) {
logger.error('handleServerMessages:', e.stack, msg);
}
}
// Send REPL port to a worker if needed
Ipc.prototype.sendReplPort = function(role, worker)
{
if (!worker || !worker.process) return;
var port = core.repl[role + "Port"];
if (!port) return;
var ports = Object.keys(this.ports).sort();
for (var i in ports) {
var diff = ports[i] - port;
if (diff > 0) break;
if (diff == 0) {
if (this.ports[port] == worker.process.pid) return;
if (!this.ports[port]) break;
port++;
}
}
this.ports[port] = worker.process.pid;
worker.send({ __op: "repl:init", port: port });
}
// Returns an IPC message object, `msg` must be an object if given.
Ipc.prototype.newMsg = function(op, msg, options)
{
if (op && op.__op) return op;
if (typeof op == "string" && op[0] == "{" && op[op.length-1] == "}") {
return lib.jsonParse(op, { datatype: "obj" });
}
if (typeof msg == "string") msg = lib.jsonParse(msg, { logger: "info" });
return lib.objExtend(msg, "__op", String(op));
}
// Wrapper around EventEmitter `emit` call to send unified IPC messages in the same format
Ipc.prototype.emitMsg = function(op, msg, options)
{
if (!op) return;
this.emit(op, this.newMsg(op, msg, options));
}
// Send a message to the master process via IPC messages, callback is used for commands that return value back
//
// - the `timeout` property can be used to specify a timeout for how long to wait the reply, if not given the default is used
// - the rest of the properties are optional and depend on the operation.
//
// If called inside the server, it process the message directly, reply is passed in the callback if given.
//
// Examples:
//
// ipc.sendMsg("op1", { data: "data" }, { timeout: 100 })
// ipc.sendMsg("op1", { name: "name", value: "data" }, function(data) { console.log(data); })
// ipc.sendMsg("op1", { 1: 1, 2: 2 }, { timeout: 100 })
// ipc.sendMsg("op1", { 1: 1, 2: 2 }, function(data) { console.log(data); })
// ipc.newMsg({ __op: "op1", name: "test" })
//
Ipc.prototype.sendMsg = function(op, msg, options, callback)
{
if (typeof options == "function") callback = options, options = null;
msg = this.newMsg(op, msg, options);
logger.dev("sendMsg:", msg);
if (!cluster.isWorker) {
if (this.role == "server") this.handleServerMessages({ send: lib.noop }, msg);
return typeof callback == "function" ? callback(msg) : null;
}
if (typeof callback == "function") {
msg.__res = true;
lib.deferCallback(this.msgs, msg, callback, options && options.timeout);
}
try { process.send(msg); } catch (e) { logger.error('send:', e, msg); }
}
// This function is called by a master server process to setup IPC channels and support for cache and messaging
Ipc.prototype.initServer = function()
{
if (this.none || this.__init) return;
this.__init = 1;
this.role = "server";
this.initClients();
cluster.on("exit", (worker, code, signal) => {
this.handleServerMessages(worker, this.newMsg("cluster:exit", { id: worker.id, pid: worker.process.pid, code: code || undefined, signal: signal || undefined }));
});
cluster.on("disconnect", (worker, code, signal) => {
this.handleServerMessages(worker, this.newMsg("cluster:disconnect", { id: worker.id, pid: worker.process.pid }));
});
cluster.on('listening', (worker, address) => {
this.handleServerMessages(worker, this.newMsg("cluster:listen", { id: worker.id, pid: worker.process.pid, port: address.port, address: address.address }));
});
// Handle messages from the workers
cluster.on('fork', (worker) => {
worker.pingTime = worker.startTime = Date.now();
worker.on('message', (msg) => {
this.handleServerMessages(worker, msg);
});
worker.on("error", (err) => {
logger.error("server:", worker.id, worker.process.pid, err);
});
});
// Subscribe to the system bus
this.subscribe(core.name + ":" + core.role, { queueName: this.systemQueue }, (msg) => {
this.handleServerMessages({ send: lib.noop }, this.newMsg(msg));
});
this._pingTimer = setInterval(() => {
if (this.pingInterval) {
var now = Date.now();
for (var i in cluster.workers) {
var w = cluster.workers[i];
var t = w.pingTime || 0;
if (t >= 0 && now - t > this.pingInterval) {
logger.error("initServer:", core.role, "dead worker detected", w.id, w.process.pid, "interval:", this.pingInterval, "last ping:", now - t, "started:", now - w.startTime);
try { process.kill(w.process.pid, now -t > this.pingInterval*2 ? "SIGKILL" : "SIGTERM"); } catch (e) {}
}
}
}
this.lru.clean();
}, this.pingInterval/2 || 60000);
logger.debug("initServer:", this.name, "started", core.role, cluster.isWorker ? cluster.worker.id : process.pid, "ping:", this.pingInterval, this.systemQueue);
}
// This function is called by a worker process to setup IPC channels and support for cache and messaging
Ipc.prototype.initWorker = function()
{
if (this.none || this.__init) return;
this.__init = 1;
this.role = "worker";
this.initClients();
// Handle messages from the master
process.on("message", this.handleWorkerMessages.bind(this));
// Subscribe to the system bus
this.subscribe(core.name + ":" + core.role, { queueName: this.systemQueue }, (msg) => {
this.handleWorkerMessages(this.newMsg(msg));
});
if (this.pingInterval > 0) {
setInterval(this.sendMsg.bind(this, "worker:ping"), Math.max(1000, this.pingInterval/5));
this.sendMsg("worker:ping");
}
logger.debug("initWorker:", this.name, "started", core.role, cluster.isWorker ? cluster.worker.id : process.pid, this.systemQueue);
}
// Return a new client for the given host or null if not supported
Ipc.prototype.createClient = function(url, options)
{
var client = null;
try {
for (const i in this.modules) {
client = this.modules[i].createClient(url, options);
if (client) {
if (!client.name) client.name = this.modules[i].name;
client.applyReservedOptions(options);
break;
}
}
} catch (e) {
logger.error("ipc.createClient:", url, options, e.stack);
}
return client;
}
// Return a cache or queue client by name if specified in the options or use default client which always exists,
// use `queueName` to specify a specific queue. If it is an array it will rotate items sequentially.
Ipc.prototype.getClient = Ipc.prototype.getQueue = function(options)
{
var client, name = Array.isArray(options) || typeof options == "string" ? options : options?.queueName || options?.cacheName;
if (name) {
if (Array.isArray(name)) {
if (name.length > 1) {
name = name[this._nameIndex++ % name.length];
if (this._nameIndex >= Number.MAX_SAFE_INTEGER) this._nameIndex = 0;
} else {
name = name[0];
}
}
if (typeof name == "string") {
var h = name.indexOf("#");
if (h > -1) name = name.substr(0, h);
}
client = this.clients[name];
}
return client || this.clients[""];
}
// Initialize a client for cache or queue purposes, previous client will be closed.
Ipc.prototype.initClients = function()
{
for (const name in this.configParams) {
var opts = this.configParams[name] || {};
var client = this.createClient(opts._url, opts);
if (client) {
try {
if (this.clients[name]) this.clients[name].close();
} catch (e) {
logger.error("ipc.initClient:", name, e.stack);
}
client.queueName = name || "default";
this.clients[name] = client;
}
}
}
// Initialize missing or new clients, existing clients stay the same
Ipc.prototype.checkClients = function(prefix)
{
for (const name in this.configParams) {
if (!this.clients[name]) {
var opts = this.configParams[name] || {};
var client = this.createClient(opts._url, opts);
if (client) {
client.queueName = name || "default";
this.clients[name] = client;
logger.info("ipc.checkClients:", name, client.name, "added");
}
}
}
}
// Returns the cache statistics, the format depends on the cache type used, for queues it returns a property 'queueCount' with currently
// visible messages in the queue, 'queueRunning' with currently in-flight messages
Ipc.prototype.stats = function(options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.stats:", options);
try {
this.getClient(options).stats(options || {}, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.stats:', e.stack);
if (typeof callback == "function") callback(e);
}
return this;
}
// Clear all or only items that match the given pattern
Ipc.prototype.clear = function(pattern, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.clear:", pattern, options);
try {
this.getClient(options).clear(typeof pattern == "string" && pattern, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.clear:', pattern, e.stack);
if (typeof callback == "function") callback(e);
}
return this;
}
// Retrieve an item from the cache by key.
//
// - `options.set` is given and no value exists in the cache it will be set as the initial value, still
// nothing will be returned to signify that a new value assigned.
// - `options.mapName` defines a map from which the key will be retrieved if the cache supports maps, to get the whole map
// the key must be set to *
// - `options.listName` defines a map from which to get items, if a key is given it will return 1 if it belongs to the list,
// if no key is provided it will return an array with 2 elements: [a random key, the length of the list], to get the whole list specify * as the key. Specifying
// `del` in the options will delete returned items from the list.
// - `options.ttl` can be used with lists with `del` and empty key, in such case all popped up keys will be saved in
// the cache with specified time to live, when being popped up every key is checked if it has been served already, i.e.
// it exists in the cache and not expired yet, such keys are ignored and only never seen keys are returned
// - `options.datatype` specifies that the returned value must be converted into the specified type using `lib.toValue`
//
// If the `key` is an array then it returns an array with values for each key, for non existent keys an empty
// string will be returned. For maps only if the `key` is * it will return the whole object, otherwise only value(s)
// are returned.
//
//
// Example
//
// ipc.get(["my:key1", "my:key2"], function(err, data) { console.log(data) });
// ipc.get("my:key", function(err, data) { console.log(data) });
// ipc.get("my:counter", { set: 10 }, function(err, data) { console.log(data) });
// ipc.get("*", { mapName: "my:map" }, function(err, data) { console.log(data) });
// ipc.get("key1", { mapName: "my:map" }, function(err, data) { console.log(data) });
// ipc.get(["key1", "key2"], { mapName: "my:map" }, function(err, data) { console.log(data) });
// ipc.get(["key1", "key2"], { listName: "my:list" }, function(err, data) { console.log(data) });
// ipc.get("", { listName: "my:list", del: 1 }, function(err, data) { console.log(data) });
// ipc.get("", { listName: "my:list", del: 1, ttl: 30000 }, function(err, data) { console.log(data) });
//
Ipc.prototype.get = function(key, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.get:", key, options);
try {
this.getClient(options).get(key, options || {}, (err, val) => {
if (!err && options && options.datatype) {
val = Array.isArray(val) ? val = val.map((x) => (lib.toValue(x, options.datatype))) : lib.toValue(val, options.datatype);
}
if (typeof callback == "function") callback(err, val);
});
} catch (e) {
logger.error('ipc.get:', key, e.stack);
if (typeof callback == "function") callback(e);
}
return this;
}
// Delete an item by key(s), if `key` is an array all keys will be deleted at once atomically if supported
// - `options.mapName` defines a map from which the counter will be deleted if the cache supports maps, to delete the whole map
// the key must be set to *
// - `options.listName` defines a list from which an item should be removed
//
// Example:
//
// ipc.del("my:key")
// ipc.del("key1", { mapName: "my:map" })
// ipc.del("*", { mapName: "my:map" })
// ipc.del("1", { listName: "my:list" })
//
Ipc.prototype.del = function(key, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.del:", key, options);
try {
this.getClient(options).del(key, options || {}, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.del:', key, e.stack);
if (typeof callback == "function") callback(e);
}
return this;
}
// Replace or put a new item in the cache.
// - `options.ttl` can be passed in milliseconds if the driver supports it
// - `options.mapName` defines a map where the counter will be stored if the cache supports maps, to store the whole map in one
// operation the `key` must be set to * and the `val` must be an object
// - `options.setmax` if not empty tell the driver to set this new number only if there is no existing
// value or it is less that the new number, only works for numeric values
// - `options.listName` defines a list where to add items, `val` can be a value or an array of values, `key` is ignored in this case
//
// Example:
//
// ipc.put("my:key", 2)
// ipc.put("my:key", 1, { setmax: 1 })
// ipc.put("key1", 1, { mapName: "my:map" })
// ipc.put("*", { key1: 1, key2: 2 }, { mapName: "my:map" })
// ipc.put("", [1,2,3], { listName: "my:list" })
//
Ipc.prototype.put = function(key, val, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.put:", key, val, options);
try {
this.getClient(options).put(key, val, options || {}, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.put:', key, e.stack);
if (typeof callback == "function") callback(e);
}
return this;
}
// Increase/decrease a counter in the cache by `val`, non existent items are treated as 0, if a callback is given an
// error and the new value will be returned.
// - `options.ttl` in milliseconds can be used if the driver supports it
// - `options.mapName` defines a map where the counter will be stored if the cache supports maps
//
// Example:
//
// ipc.incr("my:key", 1)
// ipc.incr("key1", 1, { mapName: "my:map" })
//
Ipc.prototype.incr = function(key, val, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.incr:", key, val, options);
try {
this.getClient(options).incr(key, lib.toNumber(val), options || {}, (err, val) => {
if (typeof callback == "function") callback(err, lib.toNumber(val));
});
} catch (e) {
logger.error('ipc.incr:', key, e.stack);
if (typeof callback == "function") callback(e);
}
return this;
}
// Subscribe to receive messages from the given channel, the callback will be called only on new message received.
// - `options.queueName` defines the queue, if not specified then it is sent to the default queue
//
// Example:
//
// ipc.subscribe("alerts", function(msg) {
// req.res.json(data);
// }, req);
//
Ipc.prototype.subscribe = function(channel, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.subscribe:", channel, options);
try {
this.getClient(options).subscribe(channel, options || {}, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.subscribe:', channel, options, e.stack);
}
return this;
}
// Close a subscription for the given channel, no more messages will be delivered.
// - `options.queueName` defines the queue, if not specified then it is sent to the default queue
//
Ipc.prototype.unsubscribe = function(channel, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.unsubscribe:", channel, options);
try {
this.getClient(options).unsubscribe(channel, options || {}, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.unsubscribe:', channel, e.stack);
}
return this;
}
// Publish an event to the channel to be delivered to all subscribers. If the `msg` is not a string it will be stringified.
// - `options.queueName` defines the queue, if not specified then it is sent to the default queue
//
Ipc.prototype.publish = function(channel, msg, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.publish:", channel, options);
try {
if (typeof msg != "string") msg = lib.stringify(msg);
this.getClient(options).publish(channel, msg, options || {}, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.publish:', channel, e.stack);
if (typeof callback == "function") callback(e);
}
return this;
}
// Send a message to a channel, this is high level routine that uses the corresponding queue, it uses eventually ipc.publish.
// If no client or queue is provided in the options it uses default `systemQueue`.
Ipc.prototype.broadcast = function(channel, msg, options, callback)
{
if (typeof options == "function") callback = options, options = null;
if (!options || !options.queueName) {
options = lib.objExtend(options, "queueName", this.systemQueue);
}
this.publish(channel, msg, options, callback);
}
// Send a broadcast to all server roles
Ipc.prototype.sendBroadcast = function(msg, options)
{
for (const role of this.roles) {
this.broadcast(core.name + ":" + role, msg, options);
}
}
// Listen for messages from the given queue, the callback will be called only on new message received.
// - `options.queueName` defines the queue, if not specified then it is sent to the default queue
//
// The callback accepts 2 arguments, a message and optional next callback, if it is provided it must be called at the end to confirm or reject the message processing.
// Only errors with code>=500 will result in rejection, not all drivers support the next callback if the underlying queue does not support message acknowledgement.
//
// Depending on the implementation, this can work as fan-out, delivering messages to all subscribed to the same channel or
// can implement job queue model where only one subscriber receives a message.
// For some cases like Redis this is the same as `subscribe`.
//
// For cases when the `next` callback is provided this means the queue implementation requires an acknowledgement of successful processing,
// returning an error with `err.status >= 500` will keep the message in the queue to be processed later. Special code `600` means to keep the job
// in the queue and report as warning in the log.
//
// Example:
//
// ipc.listen({ queueName: "jobs" }, function(msg, next) {
// req.res.json(data);
// if (next) next();
// }, req);
//
Ipc.prototype.subscribeQueue = function(options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.subscribeQueue:", options);
try {
this.getClient(options).subscribeQueue(options || {}, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.subscribeQueue:', options, e.stack);
}
return this;
}
// Stop listening for message, if no callback is provided all listeners for the key will be unsubscribed, otherwise only the specified listener.
// - `options.queueName` defines the queue, if not specified then it is sent to the default queue
//
// The callback will not be called.
//
// It keeps a count how many subscribe/unsubscribe calls been made and stops any internal listeners once nobody is
// subscribed. This is specific to a queue which relies on polling.
//
Ipc.prototype.unsubscribeQueue = function(options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.unsubscribeQueue:", options);
try {
this.getClient(options).unsubscribeQueue(options || {}, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.unsubscribeQueue:', options, e.stack);
}
return this;
}
// Submit a message to the queue, if the `msg` is not a string it will be stringified.
// - `options.queueName` defines the queue, if not specified then it is sent to the default queue
// - `options.stime` defines when the message should be processed, it will be held in the queue until the time comes
// - `options.etime` defines when the message expires, i.e. will be dropped if not executed before this time.
//
Ipc.prototype.publishQueue = function(msg, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.publishQueue:", options);
try {
if (typeof msg != "string") msg = lib.stringify(msg);
this.getClient(options).publishQueue(msg, options || {}, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.publishQueue:', e.stack);
if (typeof callback == "function") callback(e);
}
return this;
}
// Queue specific monitor services that must be run in the master process, this is intended to perform
// queue cleanup or dealing with stuck messages (Redis)
Ipc.prototype.monitorQueue = function(options)
{
logger.dev("ipc.monitorQueue:", options);
try {
this.getClient(options).monitorQueue(options || {});
} catch (e) {
logger.error('ipc.monitorQueue:', e.stack);
}
return this;
}
// Queue specific message deletion from the queue in case of abnormal shutdown or job running too long in order not to re-run it after the restart, this
// is for queues which require manual message deletion ofter execution(SQS). Each queue client must maintain the mapping or other means to identify messages,
// the options is the message passed to the listener
Ipc.prototype.unpublishQueue = function(msg, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.unpublishQueue:", msg, options);
try {
this.getClient(options).unpublishQueue(msg, options || {}, callback);
} catch (e) {
logger.error('ipc.unpublishQueue:', e.stack);
if (typeof callback == "function") callback(e);
}
return this;
}
// Check for rate limit using the default or specific queue, by default TokenBucket using local LRU cache is
// used unless a queue client provides its own implementation.
//
// The options must have the following properties:
// - name - unique id, can be IP address, account id, etc...
// - max - the maximum burst capacity
// - rate - the rate to refill tokens
// - interval - interval for the bucket refills, default 1000 ms
// - ttl - auto expire after specified ms since last use
// - reset - if true reset the token bucket if not consumed or the total reached this value if it is a number greater than 1
//
// The callback takes 2 arguments:
// - `delay` is a number of milliseconds till the bucket can be used again if not consumed, i.e. 0 means consumed.
// - `info` is an object with info about the state of the token bucket after the operation with properties: delay, count, total, elapsed
//
Ipc.prototype.limiter = function(options, callback)
{
logger.dev("limiter:", options);
if (typeof callback != "function") return;
if (!options) return callback(0, {});
options.rate = lib.toNumber(options.rate, { min: 0 });
if (!options.rate) return callback(0, {});
options.max = lib.toClamp(options.max, options.rate, options.max || options.rate);
options.interval = lib.toNumber(options.interval, { min: 0, zero: 1000 });
options.ttl = lib.toNumber(options.ttl, { min: 0 });
options.reset = lib.toNumber(options.reset, { min: 0 });
try {
this.getClient(options).limiter(options, callback);
} catch (e) {
logger.error('ipc.limiter:', e.stack);
callback(options.interval, {});
}
return this;
}
// Keep checking the limiter until it is clear to proceed with the operation, if there is no available tokens in the bucket
// it will wait and try again until the bucket is filled.
// To support the same interface and ability to abort the loop pass `options.retry` with a number of loops to run before exiting.
//
// The callback will receive the same arguments as `ipc.limiter``.
// `options.retries`` will be set to how many times it tried.
Ipc.prototype.checkLimiter = function(options, callback)
{
options._retries = lib.toNumber(options._retries) + 1;
this.limiter(options, (delay, info) => {
logger.debug("checkLimiter:", delay, options, info);
if (!delay || (options.retry && options._retries >= options.retry)) {
return callback(delay, info);
}
setTimeout(this.checkLimiter.bind(this, options, callback), delay);
});
}
// Uses msg.name as a key returns the same message with consumed set to 1 or 0
Ipc.prototype.localLimiter = function(msg)
{
var token = this.lru.get(msg.name);
this.tokenBucket.configure(token || msg);
// Reset the bucket if any number has been changed, now we have a new rate to check
if (!this.tokenBucket.equal(msg.rate, msg.max, msg.interval)) this.tokenBucket.configure(msg);
msg.consumed = this.tokenBucket.consume(msg.consume || 1);
msg.delay = msg.consumed ? 0 : this.tokenBucket.delay(msg.consume || 1);
msg.total = this.tokenBucket._total;
msg.count = this.tokenBucket._count;
msg.elapsed = this.tokenBucket._elapsed;
token = this.tokenBucket.toArray();
if ((msg.delay && msg.reset) || (msg.reset > 1 && msg.total >= msg.reset)) {
this.lru.del(msg.name);
} else {
this.lru.put(msg.name, token, msg.expire);
}
logger.debug("ipc:limiter:", msg, token);
return msg;
}
// Implementation of a lock with optional ttl, only one instance can lock it, can be for some period of time and will expire after timeout.
// A lock must be uniquely named and the ttl period is specified by `options.ttl` in milliseconds.
//
// This is intended to be used for background job processing or something similar when
// only one instance is needed to run. At the end of the processing `ipc.unlock` must be called to enable another instance immediately,
// otherwise it will be available after the ttl only.
//
// if `options.timeout` is given the function will keep trying to lock for the `timeout` milliseconds.
//
// if `options.set` is given it will unconditionally set the lock for the specified ttl, this is for cases when
// the lock must be active for longer because of the long running task
//
// The callback must be passed which will take an error and a boolean value, if true is returned it means the timer has been locked by the caller,
// otherwise it is already locked by other instance. In case of an error the lock is not supposed to be locked by the caller.
//
// Example:
//
// ipc.lock("my-lock", { ttl: 60000, timeout: 30000 }, function(err, locked) {
// if (locked) {
// ...
// ipc.unlock("my-lock");
// }
// });
//
Ipc.prototype.lock = function(name, options, callback)
{
if (typeof options == "function") callback = options, options = null;
logger.dev("ipc.lock:", name, options);
var self = this, locked = false, delay = 0, timeout = 0;
var started = Date.now();
options = options || {};
lib.doWhilst(
function(next) {
try {
self.getClient(options).lock(name, options, (err, val) => {
if (err) return next(err);
locked = lib.toBool(val);
setTimeout(next, delay);
});
} catch (e) {
next(e);
}
},
function() {
if (!delay) delay = lib.toNumber(options.delay);
if (!timeout) timeout = lib.toNumber(options.timeout);
return !locked && timeout > 0 && Date.now() - started < timeout;
},
function(err) {
if (err) logger.error('ipc.lock:', err.stack);
if (typeof callback == "function") callback(err, locked);
}, true);
return this;
}
// Unconditionally unlock the lock, any client can unlock any lock.
Ipc.prototype.unlock = function(name, options, callback)
{
logger.dev("ipc.unlock:", name, options);
try {
this.getClient(options).unlock(name, options || {}, typeof callback == "function" ? callback : undefined);
} catch (e) {
logger.error('ipc.unlock:', e.stack);
if (typeof callback == "function") callback(e);
}
return this;
}
require(__dirname + "/ipc/local")
require(__dirname + "/ipc/redis")
require(__dirname + "/ipc/sqs")
require(__dirname + "/ipc/nats")
| {
"content_hash": "2ef0ab038fc7db5d2172240a31deb825",
"timestamp": "",
"source": "github",
"line_count": 949,
"max_line_length": 511,
"avg_line_length": 42.43097997892519,
"alnum_prop": 0.629994784811384,
"repo_name": "vseryakov/backendjs",
"id": "f12829f043a38420c3621f81954fb6b1a607d51e",
"size": "40339",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/ipc.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "464769"
},
{
"name": "JavaScript",
"bytes": "2078814"
},
{
"name": "Shell",
"bytes": "104231"
}
],
"symlink_target": ""
} |
/*
* The IEEE hereby grants a general, royalty-free license to copy, distribute,
* display and make derivative works from this material, for all purposes,
* provided that any use of the material contains the following
* attribution: "Reprinted with permission from IEEE 1516.1(TM)-2010".
* Should you require additional information, contact the Manager, Standards
* Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org).
*/
package hla.rti1516e.exceptions;
/**
* Public exception class InvalidRangeBound
*/
public final class InvalidRangeBound extends RTIexception {
public InvalidRangeBound(String msg)
{
super(msg);
}
public InvalidRangeBound(String message, Throwable cause)
{
super(message, cause);
}
}
| {
"content_hash": "825fadbb53b247482f3fb7f88d04f0cc",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 29.46153846153846,
"alnum_prop": 0.7428198433420365,
"repo_name": "MSG134/IVCT",
"id": "67ca9dedfd1f52fad6a0f348b87402e1e4702d61",
"size": "766",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "IEEE1516e/src/main/java/hla/rti1516e/exceptions/InvalidRangeBound.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "551726"
}
],
"symlink_target": ""
} |
<?php
namespace yiiunit\framework\i18n;
use NumberFormatter;
use Yii;
use yii\i18n\Formatter;
use yiiunit\TestCase;
/**
* @group i18n
*/
class FormatterNumberTest extends TestCase
{
/**
* @var Formatter
*/
protected $formatter;
protected function setUp()
{
parent::setUp();
IntlTestHelper::setIntlStatus($this);
$this->mockApplication([
'timeZone' => 'UTC',
'language' => 'ru-RU',
]);
$this->formatter = new Formatter(['locale' => 'en-US']);
}
protected function tearDown()
{
parent::tearDown();
IntlTestHelper::resetIntlStatus();
$this->formatter = null;
}
/**
* Provides some configuration that should not affect Integer formatter.
*/
public function differentConfigProvider()
{
// make this test not break when intl is not installed
if (!extension_loaded('intl')) {
return [];
}
return [
[[
'numberFormatterOptions' => [
NumberFormatter::MIN_FRACTION_DIGITS => 2,
],
]],
[[
'numberFormatterOptions' => [
NumberFormatter::MAX_FRACTION_DIGITS => 2,
],
]],
[[
'numberFormatterOptions' => [
NumberFormatter::FRACTION_DIGITS => 2,
],
]],
[[
'numberFormatterOptions' => [
NumberFormatter::MIN_FRACTION_DIGITS => 2,
NumberFormatter::MAX_FRACTION_DIGITS => 4,
],
]],
];
}
/**
* @dataProvider differentConfigProvider
* @param array $config
*/
public function testIntlAsInteger($config)
{
// configure formatter with different configs that should not affect integer format
Yii::configure($this->formatter, $config);
$this->testAsInteger();
}
public function testAsInteger()
{
$this->assertSame('123', $this->formatter->asInteger(123));
$this->assertSame('123', $this->formatter->asInteger(123.00));
$this->assertSame('123', $this->formatter->asInteger(123.23));
$this->assertSame('123', $this->formatter->asInteger(123.53));
$this->assertSame('0', $this->formatter->asInteger(0));
$this->assertSame('-123', $this->formatter->asInteger(-123.23));
$this->assertSame('-123', $this->formatter->asInteger(-123.53));
$this->assertSame('123,456', $this->formatter->asInteger(123456));
$this->assertSame('123,456', $this->formatter->asInteger(123456.789));
// empty input
$this->assertSame('0', $this->formatter->asInteger(false));
$this->assertSame('0', $this->formatter->asInteger(''));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asInteger(null));
// string fallback
$this->assertSame('87,654,321,098,765,436', $this->formatter->asInteger('87654321098765436'));
$this->assertSame('95,836,208,451,783,051', $this->formatter->asInteger('95836208451783051.864'));
$this->formatter->thousandSeparator = '';
$this->assertSame('95836208451783051', $this->formatter->asInteger('95836208451783051.864'));
}
/**
* @see https://github.com/yiisoft/yii2/issues/16900
*/
public function testIntlAsIntegerOptions()
{
$this->formatter->numberFormatterTextOptions = [
\NumberFormatter::POSITIVE_PREFIX => '+',
];
$this->assertSame('+2', $this->formatter->asInteger(2));
$this->assertSame('+10', $this->formatter->asInteger(10));
$this->assertSame('+12', $this->formatter->asInteger(12));
$this->assertSame('+123', $this->formatter->asInteger(123));
$this->assertSame('+1,230', $this->formatter->asInteger(1230));
$this->assertSame('+123', $this->formatter->asInteger(123.23));
$this->assertSame('+123', $this->formatter->asInteger(123.53));
$this->assertSame('+0', $this->formatter->asInteger(0));
$this->assertSame('-123', $this->formatter->asInteger(-123.23));
$this->assertSame('-123', $this->formatter->asInteger(-123.53));
$this->assertSame('+123,456', $this->formatter->asInteger(123456));
$this->assertSame('+123,456', $this->formatter->asInteger(123456.789));
}
/**
* @expectedException \yii\base\InvalidParamException
*/
public function testAsIntegerException()
{
$this->formatter->asInteger('a');
}
/**
* @expectedException \yii\base\InvalidParamException
*/
public function testAsIntegerException2()
{
$this->formatter->asInteger('-123abc');
}
public function testIntlAsDecimal()
{
$value = 123.12;
$this->assertSame('123.12', $this->formatter->asDecimal($value, 2));
$this->assertSame('123.1', $this->formatter->asDecimal($value, 1));
$this->assertSame('123', $this->formatter->asDecimal($value, 0));
// power values
$this->assertSame('2,000', $this->formatter->asDecimal(2e3));
$this->assertSame('0', $this->formatter->asDecimal(1E-10));
$value = 123;
$this->assertSame('123', $this->formatter->asDecimal($value));
$this->assertSame('123.00', $this->formatter->asDecimal($value, 2));
$this->formatter->decimalSeparator = ',';
$this->formatter->thousandSeparator = '.';
$value = 123.12;
$this->assertSame('123,12', $this->formatter->asDecimal($value));
$this->assertSame('123,1', $this->formatter->asDecimal($value, 1));
$this->assertSame('123', $this->formatter->asDecimal($value, 0));
$value = 123123.123;
$this->assertSame('123.123', $this->formatter->asDecimal($value, 0));
$this->assertSame('123.123,12', $this->formatter->asDecimal($value, 2));
$this->formatter->thousandSeparator = '';
$this->assertSame('123123,1', $this->formatter->asDecimal($value, 1));
$this->formatter->thousandSeparator = ' ';
$this->assertSame('12 31 23,1', $this->formatter->asDecimal($value, 1, [\NumberFormatter::GROUPING_SIZE => 2]));
$value = 123123.123;
$this->formatter->decimalSeparator = ',';
$this->formatter->thousandSeparator = ' ';
$this->assertSame('123 123', $this->formatter->asDecimal($value, 0));
$this->assertSame('123 123,12', $this->formatter->asDecimal($value, 2));
$this->formatter->decimalSeparator = null;
$this->formatter->thousandSeparator = null;
$value = '-123456.123';
$this->assertSame('-123,456.123', $this->formatter->asDecimal($value));
// empty input
$this->assertSame('0', $this->formatter->asDecimal(false));
$this->assertSame('0', $this->formatter->asDecimal(''));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asDecimal(null));
// string fallback
$this->assertSame('87,654,321,098,765,436.00', $this->formatter->asDecimal('87654321098765436'));
$this->assertSame('95,836,208,451,783,051.86', $this->formatter->asDecimal('95836208451783051.864'));
$this->assertSame('95,836,208,451,783,052', $this->formatter->asDecimal('95836208451783051.864', 0));
$this->formatter->thousandSeparator = ' ';
$this->formatter->decimalSeparator = ',';
$this->assertSame('95 836 208 451 783 051,86', $this->formatter->asDecimal('95836208451783051.864'));
}
public function testAsDecimal()
{
$value = 123.12;
$this->assertSame('123.12', $this->formatter->asDecimal($value));
$this->assertSame('123.1', $this->formatter->asDecimal($value, 1));
$this->assertSame('123', $this->formatter->asDecimal($value, 0));
$value = 123;
$this->assertSame('123.00', $this->formatter->asDecimal($value));
$this->assertSame('123.00', $this->formatter->asDecimal('123.00'));
$this->assertSame('-123.00', $this->formatter->asDecimal('-123.00'));
$this->assertSame('123.00', $this->formatter->asDecimal('+123.00'));
$this->assertSame('10.00', $this->formatter->asDecimal('10.00'));
$this->assertSame('0.01', $this->formatter->asDecimal(0.01));
$this->assertSame('0.00', $this->formatter->asDecimal('0.00'));
$this->assertSame('0.01', $this->formatter->asDecimal('00000000000000.0100000000000'));
// power values
$this->assertSame('2,000.00', $this->formatter->asDecimal(2e3));
$this->assertSame('0.00', $this->formatter->asDecimal(1E-10));
$this->formatter->decimalSeparator = ',';
$this->formatter->thousandSeparator = '.';
$value = 123.12;
$this->assertSame('123,12', $this->formatter->asDecimal($value));
$this->assertSame('123,1', $this->formatter->asDecimal($value, 1));
$this->assertSame('123', $this->formatter->asDecimal($value, 0));
$value = 123123.123;
$this->assertSame('123.123,12', $this->formatter->asDecimal($value));
$value = 123123.123;
$this->assertSame('123.123,12', $this->formatter->asDecimal($value));
$this->assertSame('123.123,12', $this->formatter->asDecimal($value, 2));
$this->formatter->decimalSeparator = ',';
$this->formatter->thousandSeparator = ' ';
$this->assertSame('123 123,12', $this->formatter->asDecimal($value));
$this->assertSame('123 123,12', $this->formatter->asDecimal($value, 2));
$this->formatter->thousandSeparator = '';
$this->assertSame('123123,12', $this->formatter->asDecimal($value));
$this->assertSame('123123,12', $this->formatter->asDecimal($value, 2));
$this->formatter->decimalSeparator = null;
$this->formatter->thousandSeparator = null;
$value = '-123456.123';
$this->assertSame('-123,456.123', $this->formatter->asDecimal($value, 3));
// empty input
$this->assertSame('0.00', $this->formatter->asDecimal(false));
$this->assertSame('0.00', $this->formatter->asDecimal(''));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asDecimal(null));
// string fallback
$this->assertSame('87,654,321,098,765,436.00', $this->formatter->asDecimal('87654321098765436'));
$this->assertSame('95,836,208,451,783,051.86', $this->formatter->asDecimal('95836208451783051.864'));
$this->assertSame('95,836,208,451,783,052', $this->formatter->asDecimal('95836208451783051.864', 0));
$this->formatter->thousandSeparator = ' ';
$this->formatter->decimalSeparator = ',';
$this->assertSame('95 836 208 451 783 051,86', $this->formatter->asDecimal('95836208451783051.864'));
}
public function testIntlAsPercent()
{
$this->testAsPercent();
}
public function testAsPercent()
{
$this->assertSame('12,300%', $this->formatter->asPercent(123));
$this->assertSame('12,300%', $this->formatter->asPercent('123'));
$this->assertSame('12,300%', $this->formatter->asPercent('123.0'));
$this->assertSame('12%', $this->formatter->asPercent(0.1234));
$this->assertSame('12%', $this->formatter->asPercent('0.1234'));
$this->assertSame('-1%', $this->formatter->asPercent(-0.009343));
$this->assertSame('-1%', $this->formatter->asPercent('-0.009343'));
// empty input
$this->assertSame('0%', $this->formatter->asPercent(false));
$this->assertSame('0%', $this->formatter->asPercent(''));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asPercent(null));
// string fallback
$this->assertSame('8,765,432,109,876,543,600%', $this->formatter->asPercent('87654321098765436'));
$this->assertSame('9,583,620,845,178,305,186%', $this->formatter->asPercent('95836208451783051.864'));
$this->assertSame('9,583,620,845,178,305,133%', $this->formatter->asPercent('95836208451783051.328'));
$this->formatter->thousandSeparator = ' ';
$this->formatter->decimalSeparator = ',';
$this->assertSame('9 583 620 845 178 305 186,40%', $this->formatter->asPercent('95836208451783051.864', 2));
}
public function testIntlAsCurrency()
{
$this->formatter->locale = 'en-US';
$this->assertSame('$123.00', $this->formatter->asCurrency('123'));
$this->assertSame('$123.00', $this->formatter->asCurrency('123.00'));
$this->assertSame('$123.20', $this->formatter->asCurrency('123.20'));
$this->assertSame('$123,456.00', $this->formatter->asCurrency('123456'));
$this->assertSame('$0.00', $this->formatter->asCurrency('0'));
// power values
$this->assertSame('$0.00', $this->formatter->asCurrency(1E-10));
$this->formatter->locale = 'en-US';
$this->formatter->currencyCode = 'USD';
$this->assertSame('$123.00', $this->formatter->asCurrency('123'));
$this->assertSame('$123,456.00', $this->formatter->asCurrency('123456'));
$this->assertSame('$0.00', $this->formatter->asCurrency('0'));
// Starting from ICU 52.1, negative currency value will be formatted as -$123,456.12
// see: http://source.icu-project.org/repos/icu/icu/tags/release-52-1/source/data/locales/en.txt
//$value = '-123456.123';
//$this->assertSame("($123,456.12)", $this->formatter->asCurrency($value));
// "\xc2\xa0" is used as non-breaking space explicitly
$this->formatter->locale = 'de-DE';
$this->formatter->currencyCode = null;
$this->assertSame("123,00\xc2\xa0€", $this->formatter->asCurrency('123'));
$this->formatter->currencyCode = 'USD';
$this->assertSame("123,00\xc2\xa0$", $this->formatter->asCurrency('123'));
$this->formatter->currencyCode = 'EUR';
$this->assertSame("123,00\xc2\xa0€", $this->formatter->asCurrency('123'));
$this->formatter->locale = 'de-DE';
$this->formatter->currencyCode = null;
$this->assertSame("123,00\xc2\xa0€", $this->formatter->asCurrency('123', 'EUR'));
$this->assertSame("123,00\xc2\xa0$", $this->formatter->asCurrency('123', 'USD'));
$this->formatter->currencyCode = 'USD';
$this->assertSame("123,00\xc2\xa0€", $this->formatter->asCurrency('123', 'EUR'));
$this->assertSame("123,00\xc2\xa0$", $this->formatter->asCurrency('123', 'USD'));
$this->formatter->currencyCode = 'EUR';
$this->assertSame("123,00\xc2\xa0€", $this->formatter->asCurrency('123', 'EUR'));
$this->assertSame("123,00\xc2\xa0$", $this->formatter->asCurrency('123', 'USD'));
// default russian currency symbol
$this->formatter->locale = 'ru-RU';
$this->formatter->currencyCode = null;
$this->assertIsOneOf($this->formatter->asCurrency('123'), ["123,00\xc2\xa0₽", "123,00\xc2\xa0руб."]);
$this->formatter->currencyCode = 'RUB';
$this->assertIsOneOf($this->formatter->asCurrency('123'), ["123,00\xc2\xa0₽", "123,00\xc2\xa0руб."]);
// custom currency symbol
$this->formatter->currencyCode = null;
$this->formatter->numberFormatterSymbols = [
NumberFormatter::CURRENCY_SYMBOL => '₽',
];
$this->assertSame("123,00\xc2\xa0₽", $this->formatter->asCurrency('123'));
$this->formatter->numberFormatterSymbols = [
NumberFormatter::CURRENCY_SYMBOL => 'RUR',
];
$this->assertSame("123,00\xc2\xa0RUR", $this->formatter->asCurrency('123'));
/* See https://github.com/yiisoft/yii2/issues/13629
// setting the currency code overrides the symbol
$this->formatter->currencyCode = 'RUB';
$this->assertIsOneOf($this->formatter->asCurrency('123'), ["123,00\xc2\xa0₽", "123,00\xc2\xa0руб."]);
$this->formatter->numberFormatterSymbols = [NumberFormatter::CURRENCY_SYMBOL => '₽'];
$this->assertSame("123,00\xc2\xa0$", $this->formatter->asCurrency('123', 'USD'));
$this->formatter->numberFormatterSymbols = [NumberFormatter::CURRENCY_SYMBOL => '₽'];
$this->assertSame("123,00\xc2\xa0€", $this->formatter->asCurrency('123', 'EUR'));
*/
// custom separators
$this->formatter->locale = 'de-DE';
$this->formatter->currencyCode = null;
$this->formatter->numberFormatterSymbols = [];
$this->formatter->thousandSeparator = ' ';
$this->assertSame("123 456,00\xc2\xa0€", $this->formatter->asCurrency('123456', 'EUR'));
// empty input
$this->formatter->locale = 'de-DE';
$this->formatter->currencyCode = null;
$this->formatter->numberFormatterSymbols = [];
$this->formatter->thousandSeparator = null;
$this->assertSame("0,00\xc2\xa0€", $this->formatter->asCurrency(false));
$this->assertSame("0,00\xc2\xa0€", $this->formatter->asCurrency(''));
// decimal formatting
$this->formatter->locale = 'de-DE';
$this->assertSame("100\xc2\xa0$", \Yii::$app->formatter->asCurrency(100, 'USD', [
NumberFormatter::MAX_FRACTION_DIGITS => 0,
]));
$this->assertSame("100,00\xc2\xa0$", $this->formatter->asCurrency(100, 'USD', [
NumberFormatter::MAX_FRACTION_DIGITS => 2,
]));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asCurrency(null));
// string fallback
$this->assertSame('USD 87,654,321,098,765,436.00', $this->formatter->asCurrency('87654321098765436', 'USD'));
$this->assertSame('USD 95,836,208,451,783,051.86', $this->formatter->asCurrency('95836208451783051.864', 'USD'));
$this->formatter->thousandSeparator = ' ';
$this->formatter->decimalSeparator = ',';
$this->assertSame('USD 95 836 208 451 783 051,86', $this->formatter->asCurrency('95836208451783051.864', 'USD'));
// different currency decimal separator
$this->formatter->locale = 'ru-RU';
$this->assertIsOneOf($this->formatter->asCurrency('123'), ["123,00\xc2\xa0₽", "123,00\xc2\xa0руб."]);
$this->formatter->currencyDecimalSeparator = ',';
$this->assertIsOneOf($this->formatter->asCurrency('123'), ["123,00\xc2\xa0₽", "123,00\xc2\xa0руб."]);
$this->formatter->currencyDecimalSeparator = '.';
$this->assertIsOneOf($this->formatter->asCurrency('123'), ["123.00\xc2\xa0₽", "123.00\xc2\xa0руб."]);
}
/**
* @expectedException \yii\base\InvalidConfigException
*/
public function testAsCurrencyStringFallbackException()
{
$this->formatter->asCurrency('87654321098765436');
}
/**
* @see https://github.com/yiisoft/yii2/issues/12345
*/
public function testIntlCurrencyFraction()
{
$this->formatter->numberFormatterOptions = [
NumberFormatter::MIN_FRACTION_DIGITS => 0,
NumberFormatter::MAX_FRACTION_DIGITS => 0,
];
$this->formatter->locale = 'de-DE';
$this->formatter->currencyCode = null;
$this->assertSame("123\xc2\xa0€", $this->formatter->asCurrency('123'));
$this->assertSame("123\xc2\xa0€", $this->formatter->asCurrency('123.00'));
$this->assertSame("123\xc2\xa0€", $this->formatter->asCurrency('123', 'EUR'));
$this->formatter->currencyCode = 'USD';
$this->assertSame("123\xc2\xa0$", $this->formatter->asCurrency('123'));
$this->assertSame("123\xc2\xa0$", $this->formatter->asCurrency('123', 'USD'));
$this->assertSame("123\xc2\xa0€", $this->formatter->asCurrency('123', 'EUR'));
$this->formatter->currencyCode = 'EUR';
$this->assertSame("123\xc2\xa0€", $this->formatter->asCurrency('123'));
$this->assertSame("123\xc2\xa0$", $this->formatter->asCurrency('123', 'USD'));
$this->assertSame("123\xc2\xa0€", $this->formatter->asCurrency('123', 'EUR'));
$this->formatter->locale = 'ru-RU';
$this->formatter->currencyCode = null;
$this->assertIsOneOf($this->formatter->asCurrency('123'), ["123\xc2\xa0₽", "123\xc2\xa0руб."]);
$this->formatter->numberFormatterSymbols = [
NumberFormatter::CURRENCY_SYMBOL => '₽',
];
$this->assertSame("123\xc2\xa0₽", $this->formatter->asCurrency('123'));
$this->formatter->numberFormatterSymbols = [];
$this->formatter->currencyCode = 'RUB';
$this->assertIsOneOf($this->formatter->asCurrency('123'), ["123\xc2\xa0₽", "123\xc2\xa0руб."]);
}
/**
* @see https://github.com/yiisoft/yii2/pull/5261
*/
public function testIntlIssue5261()
{
$this->formatter->locale = 'en-US';
$this->formatter->numberFormatterOptions = [
\NumberFormatter::FRACTION_DIGITS => 0,
];
$this->formatter->numberFormatterTextOptions = [
\NumberFormatter::CURRENCY_CODE => 'EUR',
];
$this->assertSame('€100', $this->formatter->asCurrency(100, 'EUR'));
}
public function testAsCurrency()
{
$this->formatter->currencyCode = 'USD';
$this->assertSame('USD 123.00', $this->formatter->asCurrency('123'));
$this->assertSame('USD 123.00', $this->formatter->asCurrency('123.00'));
$this->assertSame('USD 0.00', $this->formatter->asCurrency('0'));
$this->assertSame('USD -123.45', $this->formatter->asCurrency('-123.45'));
$this->assertSame('USD -123.45', $this->formatter->asCurrency(-123.45));
// power values
$this->assertSame('USD 0.00', $this->formatter->asCurrency(1E-10));
$this->formatter->currencyCode = 'EUR';
$this->assertSame('EUR 123.00', $this->formatter->asCurrency('123'));
$this->assertSame('EUR 0.00', $this->formatter->asCurrency('0'));
$this->assertSame('EUR -123.45', $this->formatter->asCurrency('-123.45'));
$this->assertSame('EUR -123.45', $this->formatter->asCurrency(-123.45));
// empty input
$this->formatter->currencyCode = 'USD';
$this->formatter->numberFormatterSymbols = [];
$this->assertSame('USD 0.00', $this->formatter->asCurrency(false));
$this->assertSame('USD 0.00', $this->formatter->asCurrency(''));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asCurrency(null));
$this->assertSame('USD 876,543,210,987,654,367.00', $this->formatter->asCurrency('876543210987654367'));
// string fallback
$this->assertSame('USD 87,654,321,098,765,436.00', $this->formatter->asCurrency('87654321098765436', 'USD'));
$this->assertSame('USD 95,836,208,451,783,051.86', $this->formatter->asCurrency('95836208451783051.864', 'USD'));
$this->formatter->thousandSeparator = ' ';
$this->formatter->decimalSeparator = ',';
$this->assertSame('USD 95 836 208 451 783 051,86', $this->formatter->asCurrency('95836208451783051.864', 'USD'));
}
public function testIntlAsScientific()
{
// see https://github.com/yiisoft/yii2/issues/17708
$this->markTestSkipped('The test is unreliable since output depends on ICU version');
$this->assertSame('1.23E2', $this->formatter->asScientific('123'));
$this->assertSame('1.23456E5', $this->formatter->asScientific('123456'));
$this->assertSame('-1.23456123E5', $this->formatter->asScientific('-123456.123'));
// empty input
$this->assertSame('0E0', $this->formatter->asScientific(false));
$this->assertSame('0E0', $this->formatter->asScientific(''));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asScientific(null));
$this->assertSame('8.76543210987654E16', $this->formatter->asScientific('87654321098765436'));
}
public function testAsScientific()
{
$this->assertSame('1.23E+2', $this->formatter->asScientific('123', 2));
$this->assertSame('1.234560E+5', $this->formatter->asScientific('123456'));
$this->assertSame('-1.234561E+5', $this->formatter->asScientific('-123456.123'));
// empty input
$this->assertSame('0.000000E+0', $this->formatter->asScientific(false));
$this->assertSame('0.000000E+0', $this->formatter->asScientific(''));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asScientific(null));
$this->assertSame('8.765432E+16', $this->formatter->asScientific('87654321098765436'));
}
public function testIntlAsSpellout()
{
$this->assertSame('one hundred twenty-three', $this->formatter->asSpellout(123));
$this->formatter->locale = 'de_DE';
$this->assertSame('einhundertdreiundzwanzig', $this->formatter->asSpellout(123));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asSpellout(null));
}
public function testIntlAsOrdinal()
{
$this->assertSame('0th', $this->formatter->asOrdinal(0));
$this->assertSame('1st', $this->formatter->asOrdinal(1));
$this->assertSame('2nd', $this->formatter->asOrdinal(2));
$this->assertSame('3rd', $this->formatter->asOrdinal(3));
$this->assertSame('5th', $this->formatter->asOrdinal(5));
$this->formatter->locale = 'de_DE';
$this->assertSame('0.', $this->formatter->asOrdinal(0));
$this->assertSame('1.', $this->formatter->asOrdinal(1));
$this->assertSame('2.', $this->formatter->asOrdinal(2));
$this->assertSame('3.', $this->formatter->asOrdinal(3));
$this->assertSame('5.', $this->formatter->asOrdinal(5));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asOrdinal(null));
}
/**
* @see https://github.com/yiisoft/yii2/issues/14278
*/
public function testIntlAsOrdinalDate()
{
$f = $this->formatter;
$this->assertSame('15th', $f->asOrdinal($f->asDate('2017-05-15', 'php:j')));
$this->assertSame('1st', $f->asOrdinal($f->asDate('2017-05-01', 'php:j')));
$f->locale = 'de_DE';
$this->assertSame('15.', $f->asOrdinal($f->asDate('2017-05-15', 'php:j')));
$this->assertSame('1.', $f->asOrdinal($f->asDate('2017-05-01', 'php:j')));
}
public function testIntlAsShortSize()
{
$this->formatter->numberFormatterOptions = [
\NumberFormatter::MIN_FRACTION_DIGITS => 0,
\NumberFormatter::MAX_FRACTION_DIGITS => 2,
];
// tests for base 1000
$this->formatter->sizeFormatBase = 1000;
$this->assertSame('999 B', $this->formatter->asShortSize(999));
$this->assertSame('999 B', $this->formatter->asShortSize('999'));
$this->assertSame('1.05 MB', $this->formatter->asShortSize(1024 * 1024));
$this->assertSame('1 kB', $this->formatter->asShortSize(1000));
$this->assertSame('1.02 kB', $this->formatter->asShortSize(1023));
$this->assertNotEquals('3 PB', $this->formatter->asShortSize(3 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000)); // this is 3 EB not 3 PB
// string values
$this->assertSame('28.41 GB', $this->formatter->asShortSize(28406984038));
$this->assertSame('28.41 GB', $this->formatter->asShortSize((string) 28406984038));
$this->assertSame('56.81 GB', $this->formatter->asShortSize(28406984038 + 28406984038));
$this->assertSame('56.81 GB', $this->formatter->asShortSize((string) (28406984038 + 28406984038)));
// tests for base 1024
$this->formatter->sizeFormatBase = 1024;
$this->assertSame('1 KiB', $this->formatter->asShortSize(1024));
$this->assertSame('1 MiB', $this->formatter->asShortSize(1024 * 1024));
// https://github.com/yiisoft/yii2/issues/4960
$this->assertSame('1023 B', $this->formatter->asShortSize(1023));
$this->assertSame('5 GiB', $this->formatter->asShortSize(5 * 1024 * 1024 * 1024));
$this->assertNotEquals('5 PiB', $this->formatter->asShortSize(5 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024)); // this is 5 EiB not 5 PiB
//$this->assertSame("1 YiB", $this->formatter->asShortSize(pow(2, 80)));
$this->assertSame('2 GiB', $this->formatter->asShortSize(2147483647)); // round 1.999 up to 2
$this->formatter->decimalSeparator = ',';
$this->formatter->numberFormatterOptions = [];
$this->assertSame('1,001 KiB', $this->formatter->asShortSize(1025, 3));
// empty values
$this->assertSame('0 B', $this->formatter->asShortSize(0));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asShortSize(null));
}
public function testAsShortSize()
{
// tests for base 1000
$this->formatter->sizeFormatBase = 1000;
$this->assertSame('999 B', $this->formatter->asShortSize(999));
$this->assertSame('999 B', $this->formatter->asShortSize('999'));
$this->assertSame('1.05 MB', $this->formatter->asShortSize(1024 * 1024));
$this->assertSame('1.0486 MB', $this->formatter->asShortSize(1024 * 1024, 4));
$this->assertSame('1.00 kB', $this->formatter->asShortSize(1000));
$this->assertSame('1.02 kB', $this->formatter->asShortSize(1023));
$this->assertNotEquals('3 PB', $this->formatter->asShortSize(3 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000)); // this is 3 EB not 3 PB
// string values
$this->assertSame('28.41 GB', $this->formatter->asShortSize(28406984038));
$this->assertSame('28.41 GB', $this->formatter->asShortSize((string) 28406984038));
$this->assertSame('56.81 GB', $this->formatter->asShortSize(28406984038 + 28406984038));
$this->assertSame('56.81 GB', $this->formatter->asShortSize((string) (28406984038 + 28406984038)));
// tests for base 1024
$this->formatter->sizeFormatBase = 1024;
$this->assertSame('1.00 KiB', $this->formatter->asShortSize(1024));
$this->assertSame('1.00 MiB', $this->formatter->asShortSize(1024 * 1024));
// https://github.com/yiisoft/yii2/issues/4960
$this->assertSame('1023 B', $this->formatter->asShortSize(1023));
$this->assertSame('5.00 GiB', $this->formatter->asShortSize(5 * 1024 * 1024 * 1024));
$this->assertNotEquals('5.00 PiB', $this->formatter->asShortSize(5 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024)); // this is 5 EiB not 5 PiB
//$this->assertSame("1 YiB", $this->formatter->asShortSize(pow(2, 80)));
$this->assertSame('2.00 GiB', $this->formatter->asShortSize(2147483647)); // round 1.999 up to 2
$this->formatter->decimalSeparator = ',';
$this->assertSame('1,001 KiB', $this->formatter->asShortSize(1025, 3));
// empty values
$this->assertSame('0 B', $this->formatter->asShortSize(0));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asShortSize(null));
}
public function testIntlAsSize()
{
$this->formatter->numberFormatterOptions = [
\NumberFormatter::MIN_FRACTION_DIGITS => 0,
\NumberFormatter::MAX_FRACTION_DIGITS => 2,
];
// tests for base 1000
$this->formatter->sizeFormatBase = 1000;
$this->assertSame('999 bytes', $this->formatter->asSize(999));
$this->assertSame('999 bytes', $this->formatter->asSize('999'));
$this->assertSame('1.05 megabytes', $this->formatter->asSize(1024 * 1024));
$this->assertSame('1 kilobyte', $this->formatter->asSize(1000));
$this->assertSame('1.02 kilobytes', $this->formatter->asSize(1023));
$this->assertSame('3 gigabytes', $this->formatter->asSize(3 * 1000 * 1000 * 1000));
$this->assertNotEquals('3 PB', $this->formatter->asSize(3 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000)); // this is 3 EB not 3 PB
// tests for base 1024
$this->formatter->sizeFormatBase = 1024;
$this->assertSame('1 kibibyte', $this->formatter->asSize(1024));
$this->assertSame('1 mebibyte', $this->formatter->asSize(1024 * 1024));
$this->assertSame('1023 bytes', $this->formatter->asSize(1023));
$this->assertSame('5 gibibytes', $this->formatter->asSize(5 * 1024 * 1024 * 1024));
$this->assertNotEquals('5 pibibytes', $this->formatter->asSize(5 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024)); // this is 5 EiB not 5 PiB
$this->assertSame('2 gibibytes', $this->formatter->asSize(2147483647)); // round 1.999 up to 2
$this->formatter->decimalSeparator = ',';
$this->formatter->numberFormatterOptions = [];
$this->assertSame('1,001 kibibytes', $this->formatter->asSize(1025, 3));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asSize(null));
}
public function testIntlAsSizeNegative()
{
$this->formatter->numberFormatterOptions = [
\NumberFormatter::MIN_FRACTION_DIGITS => 0,
\NumberFormatter::MAX_FRACTION_DIGITS => 2,
];
// tests for base 1000
$this->formatter->sizeFormatBase = 1000;
$this->assertSame('-999 bytes', $this->formatter->asSize(-999));
$this->assertSame('-999 bytes', $this->formatter->asSize('-999'));
$this->assertSame('-1.05 megabytes', $this->formatter->asSize(-1024 * 1024));
$this->assertSame('-1 kilobyte', $this->formatter->asSize(-1000));
$this->assertSame('-1.02 kilobytes', $this->formatter->asSize(-1023));
$this->assertSame('-3 gigabytes', $this->formatter->asSize(-3 * 1000 * 1000 * 1000));
$this->assertNotEquals('3 PB', $this->formatter->asSize(-3 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000)); // this is 3 EB not 3 PB
// tests for base 1024
$this->formatter->sizeFormatBase = 1024;
$this->assertSame('-1 kibibyte', $this->formatter->asSize(-1024));
$this->assertSame('-1 mebibyte', $this->formatter->asSize(-1024 * 1024));
$this->assertSame('-1023 bytes', $this->formatter->asSize(-1023));
$this->assertSame('-5 gibibytes', $this->formatter->asSize(-5 * 1024 * 1024 * 1024));
$this->assertNotEquals('-5 pibibytes', $this->formatter->asSize(-5 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024)); // this is 5 EiB not 5 PiB
$this->assertSame('-2 gibibytes', $this->formatter->asSize(-2147483647)); // round 1.999 up to 2
$this->formatter->decimalSeparator = ',';
$this->formatter->numberFormatterOptions = [];
$this->assertSame('-1,001 kibibytes', $this->formatter->asSize(-1025, 3));
}
public function testAsSize()
{
// tests for base 1000
$this->formatter->sizeFormatBase = 1000;
$this->assertSame('999 bytes', $this->formatter->asSize(999));
$this->assertSame('999 bytes', $this->formatter->asSize('999'));
$this->assertSame('1.05 megabytes', $this->formatter->asSize(1024 * 1024));
$this->assertSame('1.0486 megabytes', $this->formatter->asSize(1024 * 1024, 4));
$this->assertSame('1.00 kilobyte', $this->formatter->asSize(1000));
$this->assertSame('1.02 kilobytes', $this->formatter->asSize(1023));
$this->assertSame('3.00 gigabytes', $this->formatter->asSize(3 * 1000 * 1000 * 1000));
$this->assertNotEquals('3 PB', $this->formatter->asSize(3 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000)); // this is 3 EB not 3 PB
// tests for base 1024
$this->formatter->sizeFormatBase = 1024;
$this->assertSame('1.00 kibibyte', $this->formatter->asSize(1024));
$this->assertSame('1.00 mebibyte', $this->formatter->asSize(1024 * 1024));
$this->assertSame('1023 bytes', $this->formatter->asSize(1023));
$this->assertSame('5.00 gibibytes', $this->formatter->asSize(5 * 1024 * 1024 * 1024));
$this->assertNotEquals('5.00 pibibytes', $this->formatter->asSize(5 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024)); // this is 5 EiB not 5 PiB
$this->assertSame('2.00 gibibytes', $this->formatter->asSize(2147483647)); // round 1.999 up to 2
$this->formatter->decimalSeparator = ',';
$this->formatter->numberFormatterOptions = [];
$this->assertSame('1,001 kibibytes', $this->formatter->asSize(1025, 3));
// null display
$this->assertSame($this->formatter->nullDisplay, $this->formatter->asSize(null));
}
public function testAsSizeNegative()
{
// tests for base 1000
$this->formatter->sizeFormatBase = 1000;
$this->assertSame('-999 bytes', $this->formatter->asSize(-999));
$this->assertSame('-999 bytes', $this->formatter->asSize('-999'));
$this->assertSame('-1.05 megabytes', $this->formatter->asSize(-1024 * 1024));
$this->assertSame('-1.0486 megabytes', $this->formatter->asSize(-1024 * 1024, 4));
$this->assertSame('-1.00 kilobyte', $this->formatter->asSize(-1000));
$this->assertSame('-1.02 kilobytes', $this->formatter->asSize(-1023));
$this->assertSame('-3.00 gigabytes', $this->formatter->asSize(-3 * 1000 * 1000 * 1000));
$this->assertNotEquals('3 PB', $this->formatter->asSize(-3 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000)); // this is 3 EB not 3 PB
// tests for base 1024
$this->formatter->sizeFormatBase = 1024;
$this->assertSame('-1.00 kibibyte', $this->formatter->asSize(-1024));
$this->assertSame('-1.00 mebibyte', $this->formatter->asSize(-1024 * 1024));
$this->assertSame('-1023 bytes', $this->formatter->asSize(-1023));
$this->assertSame('-5.00 gibibytes', $this->formatter->asSize(-5 * 1024 * 1024 * 1024));
$this->assertNotEquals('-5.00 pibibytes', $this->formatter->asSize(-5 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024)); // this is 5 EiB not 5 PiB
$this->assertSame('-2.00 gibibytes', $this->formatter->asSize(-2147483647)); // round 1.999 up to 2
$this->formatter->decimalSeparator = ',';
$this->formatter->numberFormatterOptions = [];
$this->assertSame('-1,001 kibibytes', $this->formatter->asSize(-1025, 3));
}
public function testIntlAsSizeConfiguration()
{
$this->assertSame('1023 bytes', $this->formatter->asSize(1023));
$this->assertSame('1023 B', $this->formatter->asShortSize(1023));
$this->formatter->thousandSeparator = '.';
$this->assertSame('1023 bytes', $this->formatter->asSize(1023));
$this->assertSame('1023 B', $this->formatter->asShortSize(1023));
}
/**
* @see https://github.com/yiisoft/yii2/issues/4960
*/
public function testAsSizeConfiguration()
{
$this->assertSame('1023 bytes', $this->formatter->asSize(1023));
$this->assertSame('1023 B', $this->formatter->asShortSize(1023));
$this->formatter->thousandSeparator = '.';
$this->assertSame('1023 bytes', $this->formatter->asSize(1023));
$this->assertSame('1023 B', $this->formatter->asShortSize(1023));
}
}
| {
"content_hash": "6d2b1cd1e4d1fddbe53c112a7e173ca5",
"timestamp": "",
"source": "github",
"line_count": 811,
"max_line_length": 149,
"avg_line_length": 48.464858199753394,
"alnum_prop": 0.6037654242462791,
"repo_name": "rob006/yii2-dev",
"id": "6d1b7b7fa30c140908c6efad02a9129fdc128854",
"size": "39533",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "tests/framework/i18n/FormatterNumberTest.php",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1085"
},
{
"name": "CSS",
"bytes": "20"
},
{
"name": "Dockerfile",
"bytes": "3197"
},
{
"name": "HTML",
"bytes": "13353"
},
{
"name": "Hack",
"bytes": "4107"
},
{
"name": "JavaScript",
"bytes": "275019"
},
{
"name": "PHP",
"bytes": "7048280"
},
{
"name": "PLSQL",
"bytes": "20402"
},
{
"name": "Ruby",
"bytes": "207"
},
{
"name": "Shell",
"bytes": "6705"
},
{
"name": "TSQL",
"bytes": "92787"
}
],
"symlink_target": ""
} |
package org.apache.hadoop.hbase.util;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.CompoundConfiguration;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
import org.apache.hadoop.hbase.regionserver.DefaultStoreEngine;
import org.apache.hadoop.hbase.regionserver.HStore;
import org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost;
import org.apache.hadoop.hbase.regionserver.RegionSplitPolicy;
import org.apache.hadoop.hbase.regionserver.compactions.ExploringCompactionPolicy;
import org.apache.hadoop.hbase.regionserver.compactions.FIFOCompactionPolicy;
import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos;
/**
* Only used for master to sanity check {@link org.apache.hadoop.hbase.client.TableDescriptor}.
*/
@InterfaceAudience.Private
public final class TableDescriptorChecker {
private static Logger LOG = LoggerFactory.getLogger(TableDescriptorChecker.class);
public static final String TABLE_SANITY_CHECKS = "hbase.table.sanity.checks";
public static final boolean DEFAULT_TABLE_SANITY_CHECKS = true;
// should we check the compression codec type at master side, default true, HBASE-6370
public static final String MASTER_CHECK_COMPRESSION = "hbase.master.check.compression";
public static final boolean DEFAULT_MASTER_CHECK_COMPRESSION = true;
// should we check encryption settings at master side, default true
public static final String MASTER_CHECK_ENCRYPTION = "hbase.master.check.encryption";
public static final boolean DEFAULT_MASTER_CHECK_ENCRYPTION = true;
private TableDescriptorChecker() {
}
/**
* Checks whether the table conforms to some sane limits, and configured values (compression, etc)
* work. Throws an exception if something is wrong.
*/
public static void sanityCheck(final Configuration c, final TableDescriptor td)
throws IOException {
CompoundConfiguration conf = new CompoundConfiguration().add(c).addBytesMap(td.getValues());
// Setting this to true logs the warning instead of throwing exception
boolean logWarn = false;
if (!conf.getBoolean(TABLE_SANITY_CHECKS, DEFAULT_TABLE_SANITY_CHECKS)) {
logWarn = true;
}
String tableVal = td.getValue(TABLE_SANITY_CHECKS);
if (tableVal != null && !Boolean.valueOf(tableVal)) {
logWarn = true;
}
// check max file size
long maxFileSizeLowerLimit = 2 * 1024 * 1024L; // 2M is the default lower limit
// if not set MAX_FILESIZE in TableDescriptor, and not set HREGION_MAX_FILESIZE in
// hbase-site.xml, use maxFileSizeLowerLimit instead to skip this check
long maxFileSize = td.getValue(TableDescriptorBuilder.MAX_FILESIZE) == null
? conf.getLong(HConstants.HREGION_MAX_FILESIZE, maxFileSizeLowerLimit)
: Long.parseLong(td.getValue(TableDescriptorBuilder.MAX_FILESIZE));
if (maxFileSize < conf.getLong("hbase.hregion.max.filesize.limit", maxFileSizeLowerLimit)) {
String message = "MAX_FILESIZE for table descriptor or " + "\"hbase.hregion.max.filesize\" ("
+ maxFileSize + ") is too small, which might cause over splitting into unmanageable "
+ "number of regions.";
warnOrThrowExceptionForFailure(logWarn, message, null);
}
// check flush size
long flushSizeLowerLimit = 1024 * 1024L; // 1M is the default lower limit
// if not set MEMSTORE_FLUSHSIZE in TableDescriptor, and not set HREGION_MEMSTORE_FLUSH_SIZE in
// hbase-site.xml, use flushSizeLowerLimit instead to skip this check
long flushSize = td.getValue(TableDescriptorBuilder.MEMSTORE_FLUSHSIZE) == null
? conf.getLong(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, flushSizeLowerLimit)
: Long.parseLong(td.getValue(TableDescriptorBuilder.MEMSTORE_FLUSHSIZE));
if (flushSize < conf.getLong("hbase.hregion.memstore.flush.size.limit", flushSizeLowerLimit)) {
String message =
"MEMSTORE_FLUSHSIZE for table descriptor or " + "\"hbase.hregion.memstore.flush.size\" ("
+ flushSize + ") is too small, which might cause" + " very frequent flushing.";
warnOrThrowExceptionForFailure(logWarn, message, null);
}
// check that coprocessors and other specified plugin classes can be loaded
try {
checkClassLoading(conf, td);
} catch (Exception ex) {
warnOrThrowExceptionForFailure(logWarn, ex.getMessage(), null);
}
if (conf.getBoolean(MASTER_CHECK_COMPRESSION, DEFAULT_MASTER_CHECK_COMPRESSION)) {
// check compression can be loaded
try {
checkCompression(td);
} catch (IOException e) {
warnOrThrowExceptionForFailure(logWarn, e.getMessage(), e);
}
}
if (conf.getBoolean(MASTER_CHECK_ENCRYPTION, DEFAULT_MASTER_CHECK_ENCRYPTION)) {
// check encryption can be loaded
try {
checkEncryption(conf, td);
} catch (IOException e) {
warnOrThrowExceptionForFailure(logWarn, e.getMessage(), e);
}
}
// Verify compaction policy
try {
checkCompactionPolicy(conf, td);
} catch (IOException e) {
warnOrThrowExceptionForFailure(false, e.getMessage(), e);
}
// check that we have at least 1 CF
if (td.getColumnFamilyCount() == 0) {
String message = "Table should have at least one column family.";
warnOrThrowExceptionForFailure(logWarn, message, null);
}
// check that we have minimum 1 region replicas
int regionReplicas = td.getRegionReplication();
if (regionReplicas < 1) {
String message = "Table region replication should be at least one.";
warnOrThrowExceptionForFailure(logWarn, message, null);
}
// Meta table shouldn't be set as read only, otherwise it will impact region assignments
if (td.isReadOnly() && TableName.isMetaTableName(td.getTableName())) {
warnOrThrowExceptionForFailure(false, "Meta table can't be set as read only.", null);
}
for (ColumnFamilyDescriptor hcd : td.getColumnFamilies()) {
if (hcd.getTimeToLive() <= 0) {
String message = "TTL for column family " + hcd.getNameAsString() + " must be positive.";
warnOrThrowExceptionForFailure(logWarn, message, null);
}
// check blockSize
if (hcd.getBlocksize() < 1024 || hcd.getBlocksize() > 16 * 1024 * 1024) {
String message = "Block size for column family " + hcd.getNameAsString()
+ " must be between 1K and 16MB.";
warnOrThrowExceptionForFailure(logWarn, message, null);
}
// check versions
if (hcd.getMinVersions() < 0) {
String message =
"Min versions for column family " + hcd.getNameAsString() + " must be positive.";
warnOrThrowExceptionForFailure(logWarn, message, null);
}
// max versions already being checked
// HBASE-13776 Setting illegal versions for ColumnFamilyDescriptor
// does not throw IllegalArgumentException
// check minVersions <= maxVerions
if (hcd.getMinVersions() > hcd.getMaxVersions()) {
String message = "Min versions for column family " + hcd.getNameAsString()
+ " must be less than the Max versions.";
warnOrThrowExceptionForFailure(logWarn, message, null);
}
// check replication scope
checkReplicationScope(hcd);
// check bloom filter type
checkBloomFilterType(hcd);
// check data replication factor, it can be 0(default value) when user has not explicitly
// set the value, in this case we use default replication factor set in the file system.
if (hcd.getDFSReplication() < 0) {
String message = "HFile Replication for column family " + hcd.getNameAsString()
+ " must be greater than zero.";
warnOrThrowExceptionForFailure(logWarn, message, null);
}
// check in-memory compaction
try {
hcd.getInMemoryCompaction();
} catch (IllegalArgumentException e) {
warnOrThrowExceptionForFailure(logWarn, e.getMessage(), e);
}
}
}
private static void checkReplicationScope(final ColumnFamilyDescriptor cfd) throws IOException {
// check replication scope
WALProtos.ScopeType scop = WALProtos.ScopeType.valueOf(cfd.getScope());
if (scop == null) {
String message = "Replication scope for column family " + cfd.getNameAsString() + " is "
+ cfd.getScope() + " which is invalid.";
LOG.error(message);
throw new DoNotRetryIOException(message);
}
}
private static void checkCompactionPolicy(Configuration conf, TableDescriptor td)
throws IOException {
// FIFO compaction has some requirements
// Actually FCP ignores periodic major compactions
String className = td.getValue(DefaultStoreEngine.DEFAULT_COMPACTION_POLICY_CLASS_KEY);
if (className == null) {
className = conf.get(DefaultStoreEngine.DEFAULT_COMPACTION_POLICY_CLASS_KEY,
ExploringCompactionPolicy.class.getName());
}
int blockingFileCount = HStore.DEFAULT_BLOCKING_STOREFILE_COUNT;
String sv = td.getValue(HStore.BLOCKING_STOREFILES_KEY);
if (sv != null) {
blockingFileCount = Integer.parseInt(sv);
} else {
blockingFileCount = conf.getInt(HStore.BLOCKING_STOREFILES_KEY, blockingFileCount);
}
for (ColumnFamilyDescriptor hcd : td.getColumnFamilies()) {
String compactionPolicy =
hcd.getConfigurationValue(DefaultStoreEngine.DEFAULT_COMPACTION_POLICY_CLASS_KEY);
if (compactionPolicy == null) {
compactionPolicy = className;
}
if (!compactionPolicy.equals(FIFOCompactionPolicy.class.getName())) {
continue;
}
// FIFOCompaction
String message = null;
// 1. Check TTL
if (hcd.getTimeToLive() == ColumnFamilyDescriptorBuilder.DEFAULT_TTL) {
message = "Default TTL is not supported for FIFO compaction";
throw new IOException(message);
}
// 2. Check min versions
if (hcd.getMinVersions() > 0) {
message = "MIN_VERSION > 0 is not supported for FIFO compaction";
throw new IOException(message);
}
// 3. blocking file count
sv = hcd.getConfigurationValue(HStore.BLOCKING_STOREFILES_KEY);
if (sv != null) {
blockingFileCount = Integer.parseInt(sv);
}
if (blockingFileCount < 1000) {
message =
"Blocking file count '" + HStore.BLOCKING_STOREFILES_KEY + "' " + blockingFileCount
+ " is below recommended minimum of 1000 for column family " + hcd.getNameAsString();
throw new IOException(message);
}
}
}
private static void checkBloomFilterType(ColumnFamilyDescriptor cfd) throws IOException {
Configuration conf = new CompoundConfiguration().addStringMap(cfd.getConfiguration());
try {
BloomFilterUtil.getBloomFilterParam(cfd.getBloomFilterType(), conf);
} catch (IllegalArgumentException e) {
throw new DoNotRetryIOException("Failed to get bloom filter param", e);
}
}
public static void checkCompression(final TableDescriptor td) throws IOException {
for (ColumnFamilyDescriptor cfd : td.getColumnFamilies()) {
CompressionTest.testCompression(cfd.getCompressionType());
CompressionTest.testCompression(cfd.getCompactionCompressionType());
CompressionTest.testCompression(cfd.getMajorCompactionCompressionType());
CompressionTest.testCompression(cfd.getMinorCompactionCompressionType());
}
}
public static void checkEncryption(final Configuration conf, final TableDescriptor td)
throws IOException {
for (ColumnFamilyDescriptor cfd : td.getColumnFamilies()) {
EncryptionTest.testEncryption(conf, cfd.getEncryptionType(), cfd.getEncryptionKey());
}
}
public static void checkClassLoading(final Configuration conf, final TableDescriptor td)
throws IOException {
RegionSplitPolicy.getSplitPolicyClass(td, conf);
RegionCoprocessorHost.testTableCoprocessorAttrs(conf, td);
}
// HBASE-13350 - Helper method to log warning on sanity check failures if checks disabled.
private static void warnOrThrowExceptionForFailure(boolean logWarn, String message,
Exception cause) throws IOException {
if (!logWarn) {
throw new DoNotRetryIOException(message + " Set " + TABLE_SANITY_CHECKS
+ " to false at conf or table descriptor if you want to bypass sanity checks", cause);
}
LOG.warn(message);
}
}
| {
"content_hash": "5301aa5c01ba76db8730d0cd1ee291e9",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 100,
"avg_line_length": 42.5,
"alnum_prop": 0.7100895987534086,
"repo_name": "apurtell/hbase",
"id": "6683b8734a88e10c04c5094ad63ced042244ba33",
"size": "13640",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/util/TableDescriptorChecker.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "26364"
},
{
"name": "C",
"bytes": "4041"
},
{
"name": "C++",
"bytes": "19726"
},
{
"name": "CMake",
"bytes": "1437"
},
{
"name": "CSS",
"bytes": "37520"
},
{
"name": "Dockerfile",
"bytes": "20607"
},
{
"name": "HTML",
"bytes": "18151"
},
{
"name": "Java",
"bytes": "40329989"
},
{
"name": "JavaScript",
"bytes": "9455"
},
{
"name": "Makefile",
"bytes": "1359"
},
{
"name": "PHP",
"bytes": "8385"
},
{
"name": "Perl",
"bytes": "383739"
},
{
"name": "Puppet",
"bytes": "1458"
},
{
"name": "Python",
"bytes": "135673"
},
{
"name": "Ruby",
"bytes": "781903"
},
{
"name": "Shell",
"bytes": "340180"
},
{
"name": "Thrift",
"bytes": "56798"
},
{
"name": "XSLT",
"bytes": "6764"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:layout_gravity="center_horizontal"
android:layout_margin="10dp"
android:longClickable="true"
style="@style/tw__TweetAvatar" />
<ListView android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="#e1e8ed"
android:dividerHeight="1dp"
android:drawSelectorOnTop="false"/>
<TextView android:id="@+id/test"
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="242dp"
android:gravity="center_horizontal|center_vertical"
android:text="No data"
android:layout_weight="0.75"
android:layout_marginBottom="50dp" />
</LinearLayout>
</ScrollView> | {
"content_hash": "1b721eba87aadcbfca71f9531c82c47f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 76,
"avg_line_length": 37.71052631578947,
"alnum_prop": 0.6113049546406141,
"repo_name": "mdamis/journal",
"id": "c1a69fc74b640efce720546d53df4724042f4286",
"size": "1433",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/fragment_twitter_user_info.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "190163"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>RKUtil (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RKUtil (POI API Documentation)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RKUtil.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/poi/hssf/util/PaneInformation.html" title="class in org.apache.poi.hssf.util"><span class="strong">PREV CLASS</span></a></li>
<li>NEXT CLASS</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/poi/hssf/util/RKUtil.html" target="_top">FRAMES</a></li>
<li><a href="RKUtil.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY: </li>
<li>NESTED | </li>
<li>FIELD | </li>
<li>CONSTR | </li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL: </li>
<li>FIELD | </li>
<li>CONSTR | </li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<p class="subTitle">org.apache.poi.hssf.util</p>
<h2 title="Class RKUtil" class="title">Class RKUtil</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.poi.hssf.util.RKUtil</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public final class <strong>RKUtil</strong>
extends java.lang.Object</pre>
<div class="block">Utility class for helping convert RK numbers.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/poi/hssf/record/MulRKRecord.html" title="class in org.apache.poi.hssf.record"><code>MulRKRecord</code></a>,
<a href="../../../../../org/apache/poi/hssf/record/RKRecord.html" title="class in org.apache.poi.hssf.record"><code>RKRecord</code></a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hssf/util/RKUtil.html#decodeNumber(int)">decodeNumber</a></strong>(int number)</code>
<div class="block">Do the dirty work of decoding; made a private static method to
facilitate testing the algorithm</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="decodeNumber(int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>decodeNumber</h4>
<pre>public static double decodeNumber(int number)</pre>
<div class="block">Do the dirty work of decoding; made a private static method to
facilitate testing the algorithm</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RKUtil.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/poi/hssf/util/PaneInformation.html" title="class in org.apache.poi.hssf.util"><span class="strong">PREV CLASS</span></a></li>
<li>NEXT CLASS</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/poi/hssf/util/RKUtil.html" target="_top">FRAMES</a></li>
<li><a href="RKUtil.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY: </li>
<li>NESTED | </li>
<li>FIELD | </li>
<li>CONSTR | </li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL: </li>
<li>FIELD | </li>
<li>CONSTR | </li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<i>Copyright 2016 The Apache Software Foundation or
its licensors, as applicable.</i>
</small></p>
</body>
</html>
| {
"content_hash": "d0d4a9a8cd4798bb6ab5a32a2b48b28a",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 197,
"avg_line_length": 32.52155172413793,
"alnum_prop": 0.6202783300198808,
"repo_name": "Aarhus-BSS/Aarhus-Research-Rebuilt",
"id": "c40551cf852c1db7120b44d867b5ea33b1fea8b5",
"size": "7545",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/poi-3.16-beta1/docs/apidocs/org/apache/poi/hssf/util/RKUtil.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "25053"
},
{
"name": "HTML",
"bytes": "99455840"
},
{
"name": "Java",
"bytes": "12711046"
},
{
"name": "Lua",
"bytes": "152042"
},
{
"name": "Python",
"bytes": "8613"
},
{
"name": "R",
"bytes": "20655"
},
{
"name": "Shell",
"bytes": "913"
}
],
"symlink_target": ""
} |
package org.apache.shardingsphere.sharding.rule.builder;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.SchemaRuleBuilder;
import org.apache.shardingsphere.sharding.algorithm.config.AlgorithmProvidedShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.spi.ordered.OrderedSPIRegistry;
import org.junit.Before;
import org.junit.Test;
import javax.sql.DataSource;
import java.util.Collections;
import java.util.Properties;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
public final class AlgorithmProvidedShardingRuleBuilderTest {
static {
ShardingSphereServiceLoader.register(SchemaRuleBuilder.class);
}
private AlgorithmProvidedShardingRuleConfiguration ruleConfig;
@SuppressWarnings("rawtypes")
private SchemaRuleBuilder builder;
@Before
public void setUp() {
ruleConfig = new AlgorithmProvidedShardingRuleConfiguration();
builder = OrderedSPIRegistry.getRegisteredServices(SchemaRuleBuilder.class, Collections.singletonList(ruleConfig)).get(ruleConfig);
}
@SuppressWarnings("unchecked")
@Test
public void assertBuild() {
assertThat(builder.build(ruleConfig, "test_schema",
Collections.singletonMap("name", mock(DataSource.class, RETURNS_DEEP_STUBS)), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ShardingRule.class));
}
@SuppressWarnings("unchecked")
@Test(expected = IllegalArgumentException.class)
public void assertBuildWithNullDataSourceMap() {
assertThat(builder.build(ruleConfig, "test_schema", null, Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ShardingRule.class));
}
@SuppressWarnings("unchecked")
@Test(expected = IllegalArgumentException.class)
public void assertBuildWithEmptyDataSourceMap() {
assertThat(builder.build(ruleConfig, "test_schema", Collections.emptyMap(), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ShardingRule.class));
}
}
| {
"content_hash": "abf1171b9bdd8e95fc4e8379dfec2def",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 199,
"avg_line_length": 41.775862068965516,
"alnum_prop": 0.775072224515064,
"repo_name": "apache/incubator-shardingsphere",
"id": "ea88046910f1c0f6286b3f2129ab943495b7c23a",
"size": "3224",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/builder/AlgorithmProvidedShardingRuleBuilderTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "269258"
},
{
"name": "Batchfile",
"bytes": "3280"
},
{
"name": "CSS",
"bytes": "2842"
},
{
"name": "Dockerfile",
"bytes": "1485"
},
{
"name": "HTML",
"bytes": "2146"
},
{
"name": "Java",
"bytes": "7542761"
},
{
"name": "JavaScript",
"bytes": "92884"
},
{
"name": "Shell",
"bytes": "9837"
},
{
"name": "TSQL",
"bytes": "68705"
},
{
"name": "Vue",
"bytes": "81855"
}
],
"symlink_target": ""
} |
itk_fetch_module(TotalVariation
"An ITK-based implementation of fast total variation methods used for image denoising,
image deconvolution, and other applications.
The class itkProxTVImageFilter wraps the third party library proxTV for 2D and 3D images.
Please refer to the documentation upstream for a detailed description:
https://github.com/albarji/proxTV
"
MODULE_COMPLIANCE_LEVEL 2
GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKTotalVariation.git
GIT_TAG fe6a530857bdb573ce8a138651b3f369a4110a3d
)
| {
"content_hash": "e0d7f9fe1a7443d76df6a3c1a32b4283",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 93,
"avg_line_length": 44.75,
"alnum_prop": 0.8305400372439479,
"repo_name": "thewtex/ITK",
"id": "446a28f3dab42d4cdfb808c28cad05192c64f2e7",
"size": "2916",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Modules/Remote/TotalVariation.remote.cmake",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "460926"
},
{
"name": "C++",
"bytes": "35341940"
},
{
"name": "CMake",
"bytes": "1649729"
},
{
"name": "CSS",
"bytes": "17428"
},
{
"name": "HTML",
"bytes": "8373"
},
{
"name": "JavaScript",
"bytes": "1522"
},
{
"name": "Objective-C++",
"bytes": "5647"
},
{
"name": "Perl",
"bytes": "6197"
},
{
"name": "Python",
"bytes": "678443"
},
{
"name": "SWIG",
"bytes": "53991"
},
{
"name": "Shell",
"bytes": "194950"
},
{
"name": "Tcl",
"bytes": "7953"
},
{
"name": "XSLT",
"bytes": "8640"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_editors"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/editors"
android:gravity="center_vertical"
android:paddingLeft="10dp"/>
<!--<com.facebook.drawee.view.SimpleDraweeView-->
<!--android:id="@+id/sdv_editor_1"-->
<!--android:layout_width="40dp"-->
<!--android:layout_height="40dp"-->
<!--android:visibility="invisible"-->
<!--android:layout_gravity="center_vertical"-->
<!--android:layout_marginLeft="10dp"-->
<!--app:roundAsCircle="true"/>-->
</LinearLayout> | {
"content_hash": "bb2bdf20f553adca3761cdfa0042bdde",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 72,
"avg_line_length": 37.2,
"alnum_prop": 0.6279569892473118,
"repo_name": "xroocky/ZhiHuRiBao",
"id": "b093c43214cb57792d355e2ba2d76004215269cd",
"size": "930",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/item_theme_editors.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "131127"
}
],
"symlink_target": ""
} |
angular.module('directives', []);
| {
"content_hash": "f7c5ca3fa5ca0f6e3f77cf74bf67274c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 33,
"avg_line_length": 34,
"alnum_prop": 0.6764705882352942,
"repo_name": "perrywoodin/drk-monitor",
"id": "0607b9082d11c69cdb8ea01fa9a415dc0f3eb5a5",
"size": "34",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/common/directives/directives.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "231165"
},
{
"name": "JavaScript",
"bytes": "35911"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
NUB Generator [autonym]
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "9d9c94c11a4fb2c486610ac7da37b3d0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 23,
"avg_line_length": 9.076923076923077,
"alnum_prop": 0.6779661016949152,
"repo_name": "mdoering/backbone",
"id": "ce5edaab32507a23372621ce767d0c0153ece380",
"size": "179",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Pteridaceae/Adiantum/Adiantum delicatulum/Adiantum delicatulum delicatulum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
// Copyright 2018 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.rules.cpp;
import com.google.auto.value.AutoValue;
import com.google.auto.value.extension.memoized.Memoized;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.collect.nestedset.Depset;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.concurrent.BlazeInterners;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.starlarkbuildapi.cpp.LibraryToLinkApi;
import javax.annotation.Nullable;
import net.starlark.java.eval.Dict;
import net.starlark.java.eval.EvalException;
import net.starlark.java.eval.Printer;
import net.starlark.java.eval.Sequence;
import net.starlark.java.eval.StarlarkList;
import net.starlark.java.eval.StarlarkThread;
/** Encapsulates information for linking a library. */
// The AutoValue implementation of this class already has a sizeable number of fields, meaning that
// instances have a surprising memory cost. We may benefit from having more specialized
// implementations similar to StaticOnlyLibraryToLink, for cases when certain fields are always
// null. Consider this before adding additional fields to this class. See b/181991741.
@Immutable
public abstract class LibraryToLink implements LibraryToLinkApi<Artifact, LtoBackendArtifacts> {
public static final Depset.ElementType TYPE = Depset.ElementType.of(LibraryToLink.class);
public static ImmutableList<Artifact> getDynamicLibrariesForRuntime(
boolean linkingStatically, Iterable<LibraryToLink> libraries) {
ImmutableList.Builder<Artifact> dynamicLibrariesForRuntimeBuilder = ImmutableList.builder();
for (LibraryToLink libraryToLink : libraries) {
Artifact artifact = libraryToLink.getDynamicLibraryForRuntimeOrNull(linkingStatically);
if (artifact != null) {
dynamicLibrariesForRuntimeBuilder.add(artifact);
}
}
return dynamicLibrariesForRuntimeBuilder.build();
}
public static ImmutableList<Artifact> getDynamicLibrariesForLinking(
NestedSet<LibraryToLink> libraries) {
ImmutableList.Builder<Artifact> dynamicLibrariesForLinkingBuilder = ImmutableList.builder();
for (LibraryToLink libraryToLink : libraries.toList()) {
if (libraryToLink.getInterfaceLibrary() != null) {
dynamicLibrariesForLinkingBuilder.add(libraryToLink.getInterfaceLibrary());
} else if (libraryToLink.getDynamicLibrary() != null) {
dynamicLibrariesForLinkingBuilder.add(libraryToLink.getDynamicLibrary());
}
}
return dynamicLibrariesForLinkingBuilder.build();
}
private LibraryToLink() {}
public abstract String getLibraryIdentifier();
@Nullable
public abstract ImmutableList<Artifact> getObjectFiles();
@Nullable
public abstract ImmutableMap<Artifact, LtoBackendArtifacts> getSharedNonLtoBackends();
@Nullable
public abstract LtoCompilationContext getLtoCompilationContext();
@Nullable
public abstract ImmutableList<Artifact> getPicObjectFiles();
@Nullable
public abstract ImmutableMap<Artifact, LtoBackendArtifacts> getPicSharedNonLtoBackends();
@Nullable
public abstract LtoCompilationContext getPicLtoCompilationContext();
public abstract AutoLibraryToLink.Builder toBuilder();
@Override
public final boolean isImmutable() {
return true; // immutable and Starlark-hashable
}
@Nullable
public final Artifact getDynamicLibraryForRuntimeOrNull(boolean linkingStatically) {
if (getDynamicLibrary() == null) {
return null;
}
if (linkingStatically && (getStaticLibrary() != null || getPicStaticLibrary() != null)) {
return null;
}
return getDynamicLibrary();
}
@Override
public final Sequence<Artifact> getObjectFilesForStarlark() {
ImmutableList<Artifact> objectFiles = getObjectFiles();
return objectFiles == null ? StarlarkList.empty() : StarlarkList.immutableCopyOf(objectFiles);
}
@Override
public final Sequence<Artifact> getLtoBitcodeFilesForStarlark() {
LtoCompilationContext ctx = getLtoCompilationContext();
return ctx == null ? StarlarkList.empty() : StarlarkList.immutableCopyOf(ctx.getBitcodeFiles());
}
@Override
public final boolean getMustKeepDebugForStarlark(StarlarkThread thread) throws EvalException {
CcModule.checkPrivateStarlarkificationAllowlist(thread);
return getMustKeepDebug();
}
@Override
public final Dict<Artifact, LtoBackendArtifacts> getSharedNonLtoBackendsForStarlark(
StarlarkThread thread) throws EvalException {
CcModule.checkPrivateStarlarkificationAllowlist(thread);
return Dict.immutableCopyOf(getSharedNonLtoBackends());
}
@Override
public final Sequence<Artifact> getPicObjectFilesForStarlark() {
ImmutableList<Artifact> objectFiles = getPicObjectFiles();
return objectFiles == null ? StarlarkList.empty() : StarlarkList.immutableCopyOf(objectFiles);
}
@Override
public final Sequence<Artifact> getPicLtoBitcodeFilesForStarlark() {
LtoCompilationContext ctx = getPicLtoCompilationContext();
return ctx == null ? StarlarkList.empty() : StarlarkList.immutableCopyOf(ctx.getBitcodeFiles());
}
@Override
public final Dict<Artifact, LtoBackendArtifacts> getPicSharedNonLtoBackendsForStarlark(
StarlarkThread thread) throws EvalException {
CcModule.checkPrivateStarlarkificationAllowlist(thread);
return Dict.immutableCopyOf(getPicSharedNonLtoBackends());
}
LinkerInputs.LibraryToLink getStaticLibraryToLink() {
return LinkerInputs.newInputLibrary(
Preconditions.checkNotNull(getStaticLibrary(), this),
getAlwayslink()
? ArtifactCategory.ALWAYSLINK_STATIC_LIBRARY
: ArtifactCategory.STATIC_LIBRARY,
getLibraryIdentifier(),
getObjectFiles(),
getLtoCompilationContext(),
getSharedNonLtoBackends(),
getMustKeepDebug(),
getDisableWholeArchive());
}
LinkerInputs.LibraryToLink getPicStaticLibraryToLink() {
return LinkerInputs.newInputLibrary(
Preconditions.checkNotNull(getPicStaticLibrary(), this),
getAlwayslink()
? ArtifactCategory.ALWAYSLINK_STATIC_LIBRARY
: ArtifactCategory.STATIC_LIBRARY,
getLibraryIdentifier(),
getPicObjectFiles(),
getPicLtoCompilationContext(),
getPicSharedNonLtoBackends(),
getMustKeepDebug(),
getDisableWholeArchive());
}
LinkerInputs.LibraryToLink getDynamicLibraryToLink() {
Artifact dynamicLibrary = Preconditions.checkNotNull(getDynamicLibrary(), this);
if (getResolvedSymlinkDynamicLibrary() != null) {
return LinkerInputs.solibLibraryToLink(
dynamicLibrary, getResolvedSymlinkDynamicLibrary(), getLibraryIdentifier());
}
return LinkerInputs.newInputLibrary(
dynamicLibrary,
ArtifactCategory.DYNAMIC_LIBRARY,
getLibraryIdentifier(),
/*objectFiles=*/ ImmutableSet.of(),
LtoCompilationContext.EMPTY,
/*sharedNonLtoBackends=*/ ImmutableMap.of(),
getMustKeepDebug(),
getDisableWholeArchive());
}
LinkerInputs.LibraryToLink getInterfaceLibraryToLink() {
Artifact interfaceLibrary = Preconditions.checkNotNull(getInterfaceLibrary(), this);
if (getResolvedSymlinkInterfaceLibrary() != null) {
return LinkerInputs.solibLibraryToLink(
interfaceLibrary, getResolvedSymlinkInterfaceLibrary(), getLibraryIdentifier());
}
return LinkerInputs.newInputLibrary(
interfaceLibrary,
ArtifactCategory.INTERFACE_LIBRARY,
getLibraryIdentifier(),
/*objectFiles=*/ ImmutableSet.of(),
LtoCompilationContext.EMPTY,
/*sharedNonLtoBackends=*/ ImmutableMap.of(),
getMustKeepDebug(),
getDisableWholeArchive());
}
// TODO(plf): This is just needed for Go, do not expose to Starlark and try to remove it. This was
// introduced to let a linker input declare that it needs debug info in the executable.
// Specifically, this was introduced for linking Go into a C++ binary when using the gccgo
// compiler.
abstract boolean getMustKeepDebug();
abstract boolean getDisableWholeArchive();
@Override
public final void debugPrint(Printer printer) {
printer.append("<LibraryToLink(");
printer.append(
Joiner.on(", ")
.skipNulls()
.join(
mapEntry("object", getObjectFiles()),
mapEntry("pic_objects", getPicObjectFiles()),
mapEntry("static_library", getStaticLibrary()),
mapEntry("pic_static_library", getPicStaticLibrary()),
mapEntry("dynamic_library", getDynamicLibrary()),
mapEntry("resolved_symlink_dynamic_library", getResolvedSymlinkDynamicLibrary()),
mapEntry("interface_library", getInterfaceLibrary()),
mapEntry(
"resolved_symlink_interface_library", getResolvedSymlinkInterfaceLibrary()),
mapEntry("alwayslink", getAlwayslink())));
printer.append(")>");
}
private static String mapEntry(String keyName, @Nullable Object value) {
return value == null ? null : keyName + "=" + value;
}
public static AutoLibraryToLink.Builder builder() {
return new AutoValue_LibraryToLink_AutoLibraryToLink.Builder()
.setMustKeepDebug(false)
.setAlwayslink(false)
.setDisableWholeArchive(false);
}
/**
* Creates a {@link LibraryToLink} that has only {@link #getStaticLibrary} and no other optional
* fields.
*/
public static LibraryToLink staticOnly(Artifact staticLibrary) {
return StaticOnlyLibraryToLink.cache.getUnchecked(staticLibrary);
}
/** Builder for {@link LibraryToLink}. */
public interface Builder {
AutoLibraryToLink.Builder setLibraryIdentifier(String libraryIdentifier);
AutoLibraryToLink.Builder setStaticLibrary(Artifact staticLibrary);
AutoLibraryToLink.Builder setObjectFiles(ImmutableList<Artifact> objectFiles);
AutoLibraryToLink.Builder setLtoCompilationContext(LtoCompilationContext ltoCompilationContext);
AutoLibraryToLink.Builder setSharedNonLtoBackends(
ImmutableMap<Artifact, LtoBackendArtifacts> sharedNonLtoBackends);
AutoLibraryToLink.Builder setPicStaticLibrary(Artifact picStaticLibrary);
AutoLibraryToLink.Builder setPicObjectFiles(ImmutableList<Artifact> picObjectFiles);
AutoLibraryToLink.Builder setPicLtoCompilationContext(
LtoCompilationContext picLtoCompilationContext);
AutoLibraryToLink.Builder setPicSharedNonLtoBackends(
ImmutableMap<Artifact, LtoBackendArtifacts> picSharedNonLtoBackends);
AutoLibraryToLink.Builder setDynamicLibrary(Artifact dynamicLibrary);
AutoLibraryToLink.Builder setResolvedSymlinkDynamicLibrary(
Artifact resolvedSymlinkDynamicLibrary);
AutoLibraryToLink.Builder setInterfaceLibrary(Artifact interfaceLibrary);
AutoLibraryToLink.Builder setResolvedSymlinkInterfaceLibrary(
Artifact resolvedSymlinkInterfaceLibrary);
AutoLibraryToLink.Builder setAlwayslink(boolean alwayslink);
AutoLibraryToLink.Builder setMustKeepDebug(boolean mustKeepDebug);
AutoLibraryToLink.Builder setDisableWholeArchive(boolean disableWholeArchive);
LibraryToLink build();
}
/** {@link AutoValue}-backed implementation. */
@AutoValue
abstract static class AutoLibraryToLink extends LibraryToLink {
@Nullable
@Override // Remove @StarlarkMethod.
public abstract Artifact getStaticLibrary();
@Nullable
@Override // Remove @StarlarkMethod.
public abstract Artifact getPicStaticLibrary();
@Nullable
@Override // Remove @StarlarkMethod.
public abstract Artifact getDynamicLibrary();
@Nullable
@Override // Remove @StarlarkMethod.
public abstract Artifact getResolvedSymlinkDynamicLibrary();
@Nullable
@Override // Remove @StarlarkMethod.
public abstract Artifact getInterfaceLibrary();
@Nullable
@Override // Remove @StarlarkMethod.
public abstract Artifact getResolvedSymlinkInterfaceLibrary();
@Override // Remove @StarlarkMethod.
public abstract boolean getAlwayslink();
@Memoized
@Override
LinkerInputs.LibraryToLink getStaticLibraryToLink() {
return super.getStaticLibraryToLink();
}
@Memoized
@Override
LinkerInputs.LibraryToLink getPicStaticLibraryToLink() {
return super.getPicStaticLibraryToLink();
}
@Memoized
@Override
LinkerInputs.LibraryToLink getDynamicLibraryToLink() {
return super.getDynamicLibraryToLink();
}
@Memoized
@Override
LinkerInputs.LibraryToLink getInterfaceLibraryToLink() {
return super.getInterfaceLibraryToLink();
}
@AutoValue.Builder
public abstract static class Builder implements LibraryToLink.Builder {
Builder() {}
abstract AutoLibraryToLink autoBuild();
@Override
public final LibraryToLink build() {
LibraryToLink result = autoBuild();
Preconditions.checkNotNull(result.getLibraryIdentifier(), result);
Preconditions.checkState(
(result.getObjectFiles() == null
&& result.getLtoCompilationContext() == null
&& result.getSharedNonLtoBackends() == null)
|| result.getStaticLibrary() != null,
result);
Preconditions.checkState(
(result.getPicObjectFiles() == null
&& result.getPicLtoCompilationContext() == null
&& result.getPicSharedNonLtoBackends() == null)
|| result.getPicStaticLibrary() != null,
result);
Preconditions.checkState(
result.getResolvedSymlinkDynamicLibrary() == null || result.getDynamicLibrary() != null,
result);
Preconditions.checkState(
result.getResolvedSymlinkInterfaceLibrary() == null
|| result.getResolvedSymlinkInterfaceLibrary() != null,
result);
Preconditions.checkState(
result.getStaticLibrary() != null
|| result.getPicStaticLibrary() != null
|| result.getDynamicLibrary() != null
|| result.getInterfaceLibrary() != null,
result);
// Static-only instances must always return StaticOnlyLibraryToLink to preserve equality.
if (result.getStaticLibrary() != null
&& !result.getAlwayslink()
&& !result.getMustKeepDebug()
&& !result.getDisableWholeArchive()
&& result.getPicStaticLibrary() == null
&& result.getDynamicLibrary() == null
&& result.getInterfaceLibrary() == null
&& result.getSharedNonLtoBackends() == null
&& result.getPicObjectFiles() == null
&& result.getPicLtoCompilationContext() == null) {
Artifact staticLibrary = result.getStaticLibrary();
String libraryIdentifier = result.getLibraryIdentifier();
// Try to reuse an existing instance if possible.
StaticOnlyLibraryToLink existing =
StaticOnlyLibraryToLink.cache.getIfPresent(staticLibrary);
if (existing != null && existing.getLibraryIdentifier().equals(libraryIdentifier)) {
return existing;
}
return new AutoValue_LibraryToLink_StaticOnlyLibraryToLink(
result.getLibraryIdentifier(), result.getStaticLibrary());
}
return result;
}
}
}
/**
* Specialized implementation for the case when only {@link #getStaticLibrary} is needed, to save
* memory compared to {@link AutoLibraryToLink}.
*/
@AutoValue
abstract static class StaticOnlyLibraryToLink extends LibraryToLink {
// Essentially an interner, but keyed on Artifact to defer creating the string identifier.
private static final LoadingCache<Artifact, StaticOnlyLibraryToLink> cache =
CacheBuilder.newBuilder()
.concurrencyLevel(BlazeInterners.concurrencyLevel())
// Needs to use weak keys for identity equality of the artifact. The artifact may not
// yet have its generating action key set, but Artifact#equals treats unset and set as
// equal. Reusing an artifact from a previous build is not safe - the generating
// action key's index may be stale (b/184948206).
.weakKeys()
.weakValues()
.build(
CacheLoader.from(
artifact ->
new AutoValue_LibraryToLink_StaticOnlyLibraryToLink(
CcLinkingOutputs.libraryIdentifierOf(artifact), artifact)));
@Override // Remove @Nullable.
public abstract Artifact getStaticLibrary();
@Nullable
@Override
public ImmutableList<Artifact> getObjectFiles() {
return null;
}
@Nullable
@Override
public ImmutableMap<Artifact, LtoBackendArtifacts> getSharedNonLtoBackends() {
return null;
}
@Nullable
@Override
public LtoCompilationContext getLtoCompilationContext() {
return null;
}
@Nullable
@Override
public ImmutableList<Artifact> getPicObjectFiles() {
return null;
}
@Nullable
@Override
public ImmutableMap<Artifact, LtoBackendArtifacts> getPicSharedNonLtoBackends() {
return null;
}
@Nullable
@Override
public LtoCompilationContext getPicLtoCompilationContext() {
return null;
}
@Nullable
@Override
public Artifact getPicStaticLibrary() {
return null;
}
@Nullable
@Override
public Artifact getDynamicLibrary() {
return null;
}
@Nullable
@Override
public Artifact getResolvedSymlinkDynamicLibrary() {
return null;
}
@Nullable
@Override
public Artifact getInterfaceLibrary() {
return null;
}
@Nullable
@Override
public Artifact getResolvedSymlinkInterfaceLibrary() {
return null;
}
@Override
public boolean getAlwayslink() {
return false;
}
@Override
public AutoLibraryToLink.Builder toBuilder() {
return builder()
.setStaticLibrary(getStaticLibrary())
.setLibraryIdentifier(getLibraryIdentifier());
}
@Override
boolean getMustKeepDebug() {
return false;
}
@Override
boolean getDisableWholeArchive() {
return false;
}
}
}
| {
"content_hash": "6bf893db9e64981d6909d887a025ee09",
"timestamp": "",
"source": "github",
"line_count": 548,
"max_line_length": 100,
"avg_line_length": 35.556569343065696,
"alnum_prop": 0.711367718758019,
"repo_name": "meteorcloudy/bazel",
"id": "4a86bd110af6f330155446f87664b76f00112335",
"size": "19485",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/LibraryToLink.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2997"
},
{
"name": "C",
"bytes": "26190"
},
{
"name": "C++",
"bytes": "1601514"
},
{
"name": "CSS",
"bytes": "685"
},
{
"name": "Dockerfile",
"bytes": "1197"
},
{
"name": "HTML",
"bytes": "490995"
},
{
"name": "Java",
"bytes": "39952960"
},
{
"name": "Makefile",
"bytes": "248"
},
{
"name": "Objective-C",
"bytes": "10818"
},
{
"name": "Objective-C++",
"bytes": "1043"
},
{
"name": "PowerShell",
"bytes": "15431"
},
{
"name": "Python",
"bytes": "3238336"
},
{
"name": "Ruby",
"bytes": "288"
},
{
"name": "SCSS",
"bytes": "12576"
},
{
"name": "Shell",
"bytes": "2466553"
},
{
"name": "Smarty",
"bytes": "27598"
},
{
"name": "Starlark",
"bytes": "43811"
}
],
"symlink_target": ""
} |
package com.thinkgem.jeesite.modules.pro.service;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.pro.entity.ProTapeEmpty;
import com.thinkgem.jeesite.modules.pro.dao.ProTapeEmptyDao;
/**
* 空白磁带Service
* @author lin
* @version 2016-05-18
*/
@Service
@Transactional(readOnly = true)
public class ProTapeEmptyService extends CrudService<ProTapeEmptyDao, ProTapeEmpty> {
public ProTapeEmpty get(String id) {
return super.get(id);
}
public List<ProTapeEmpty> findList(ProTapeEmpty proTapeEmpty) {
return super.findList(proTapeEmpty);
}
public Page<ProTapeEmpty> findPage(Page<ProTapeEmpty> page, ProTapeEmpty proTapeEmpty) {
return super.findPage(page, proTapeEmpty);
}
@Transactional(readOnly = false)
public void save(ProTapeEmpty proTapeEmpty) {
super.save(proTapeEmpty);
}
@Transactional(readOnly = false)
public void delete(ProTapeEmpty proTapeEmpty) {
super.delete(proTapeEmpty);
}
} | {
"content_hash": "1486be084948a5fd4bb70ca0b72a4b57",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 89,
"avg_line_length": 25.755555555555556,
"alnum_prop": 0.7860224331320104,
"repo_name": "vriche/procat",
"id": "7ce5c7c535cb67be4aed668b40e2767e3f6ad31a",
"size": "1283",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/thinkgem/jeesite/modules/pro/service/ProTapeEmptyService.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "5851"
},
{
"name": "ApacheConf",
"bytes": "768"
},
{
"name": "Batchfile",
"bytes": "7922"
},
{
"name": "CSS",
"bytes": "1311466"
},
{
"name": "HTML",
"bytes": "2893865"
},
{
"name": "Java",
"bytes": "1924014"
},
{
"name": "JavaScript",
"bytes": "9729012"
},
{
"name": "PHP",
"bytes": "8060"
},
{
"name": "PLSQL",
"bytes": "66373"
}
],
"symlink_target": ""
} |
package blackberry.pim.task;
import blackberry.core.FunctionSignature;
import blackberry.core.ScriptableFunctionBase;
import blackberry.identity.service.ServiceObject;
/**
* This class represents the constructor of a Task
*
* @author dmateescu
*/
public class TaskConstructor extends ScriptableFunctionBase {
public static final String NAME = "blackberry.pim.Task";
public static final String STATUS_LABEL_NOT_STARTED = "NOT_STARTED";
public static final String STATUS_LABEL_COMPLETED = "COMPLETED";
public static final String STATUS_LABEL_DEFERRED = "DEFERRED";
public static final String STATUS_LABEL_IN_PROGRESS = "IN_PROGRESS";
public static final String STATUS_LABEL_WAITING = "WAITING";
public static final int STATUS_VALUE_NOT_STARTED = 0;
public static final int STATUS_VALUE_IN_PROGRESS = 1;
public static final int STATUS_VALUE_COMPLETED = 2;
public static final int STATUS_VALUE_WAITING = 3;
public static final int STATUS_VALUE_DEFERRED = 4;
public static final String LABEL_PRIORITY_HIGH = "PRIORITY_HIGH";
public static final String LABEL_PRIORITY_NORMAL = "PRIORITY_NORMAL";
public static final String LABEL_PRIORITY_LOW = "PRIORITY_LOW";
public static final int VALUE_PRIORITY_HIGH = 0;
public static final int VALUE_PRIORITY_NORMAL = 1;
public static final int VALUE_PRIORITY_LOW = 2;
public static final int TODO_VALUE_PRIORITY_HIGH = 1;
public static final int TODO_VALUE_PRIORITY_NORMAL = 5;
public static final int TODO_VALUE_PRIORITY_LOW = 9;
private TaskFindScriptableFunction _find;
/**
* Default constructor of the TaskConstructor
*/
public TaskConstructor() {
_find = new TaskFindScriptableFunction();
}
/**
* @see net.rim.device.api.script.ScriptableFunction#construct(java.lang.Object, java.lang.Object[])
*/
public Object construct( final Object thiz, final Object[] args ) throws Exception {
if( args != null && args.length == 1 ) {
ServiceObject serviceObject = (ServiceObject) args[ 0 ];
return new TaskObject( serviceObject );
}
return new TaskObject();
}
/**
* @see net.rim.device.api.script.Scriptable#getField(java.lang.String)
*/
public Object getField( String name ) throws Exception {
if( name.equals( STATUS_LABEL_NOT_STARTED ) ) {
return new Integer( STATUS_VALUE_NOT_STARTED );
} else if( name.equals( STATUS_LABEL_COMPLETED ) ) {
return new Integer( STATUS_VALUE_COMPLETED );
} else if( name.equals( STATUS_LABEL_DEFERRED ) ) {
return new Integer( STATUS_VALUE_DEFERRED );
} else if( name.equals( STATUS_LABEL_IN_PROGRESS ) ) {
return new Integer( STATUS_VALUE_IN_PROGRESS );
} else if( name.equals( STATUS_LABEL_WAITING ) ) {
return new Integer( STATUS_VALUE_WAITING );
} else if( name.equals( LABEL_PRIORITY_HIGH ) ) {
return new Integer( VALUE_PRIORITY_HIGH );
} else if( name.equals( LABEL_PRIORITY_NORMAL ) ) {
return new Integer( VALUE_PRIORITY_NORMAL );
} else if( name.equals( LABEL_PRIORITY_LOW ) ) {
return new Integer( VALUE_PRIORITY_LOW );
} else if( name.equals( TaskFindScriptableFunction.NAME ) ) {
return _find;
}
return UNDEFINED;
}
/**
* This method converts a task priority into a todo priority
*
* @param priority
* the priority
* @return the todo priority
*/
public static int taskPriorityToTodoPriority( int priority ) {
switch( priority ) {
case VALUE_PRIORITY_HIGH:
return TODO_VALUE_PRIORITY_HIGH;
case VALUE_PRIORITY_NORMAL:
return TODO_VALUE_PRIORITY_NORMAL;
case VALUE_PRIORITY_LOW:
return TODO_VALUE_PRIORITY_LOW;
default:
return TODO_VALUE_PRIORITY_NORMAL;
}
}
/**
* This method converts a todo priority into a task priority
*
* @param priority
* the todo priority
* @return the priority
*/
public static int todoPriorityToTaskPriority( int priority ) {
switch( priority ) {
case 1:
case 2:
case 3:
return VALUE_PRIORITY_HIGH;
case 0:
case 4:
case 5:
case 6:
return VALUE_PRIORITY_NORMAL;
case 7:
case 8:
case 9:
return VALUE_PRIORITY_LOW;
default:
return VALUE_PRIORITY_NORMAL;
}
}
/**
* @see blackberry.core.ScriptableFunctionBase#getFunctionSignatures()
*/
protected FunctionSignature[] getFunctionSignatures() {
FunctionSignature fs = new FunctionSignature( 1 );
fs.addParam( ServiceObject.class, false );
return new FunctionSignature[] { fs };
}
/**
* @see blackberry.core.ScriptableFunctionBase#execute(java.lang.Object, java.lang.Object[])
*/
protected Object execute( Object thiz, Object[] args ) throws Exception {
return UNDEFINED;
}
}
| {
"content_hash": "0f086420c295f929cc583077f808fc7c",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 104,
"avg_line_length": 36.58108108108108,
"alnum_prop": 0.6067602512005911,
"repo_name": "marek/WebWorks",
"id": "6deb8fc05ac41904bcf3701883e949540921b634",
"size": "6025",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "api/pim/src/blackberry/pim/task/TaskConstructor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/*
Huerate - Mobile System for Customer Feedback Collection
Master Thesis at BUT FIT (http://www.fit.vutbr.cz), 2013
Available at http://huerate.cz
Author: Bc. Jakub Kadlubiec, xkadlu00@stud.fit.vutbr.cz or jakub.kadlubiec@gmail.com
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Net;
using System.Threading.Tasks;
using Huerate.Logging;
using Huerate.Services.Settings;
using SendGrid;
using System.Net.Mail;
using SendGrid.Transport;
namespace Huerate.Services.Email
{
internal class SendGridEmailSenderService : EmailSenderServiceBase
{
public SendGridEmailSenderService(ILogService logService, ISettingsService settingsService, IEmailTemplateService emailTemplateService) : base(logService, settingsService, emailTemplateService)
{
}
protected override Task<string> SendEmailInternalAsync(Email email)
{
var sendGridSettings = SettingsService.SendGridSettings;
var message = Mail.GetInstance();
message.AddTo(email.Receivers);
message.From = new MailAddress(sendGridSettings.FromAddress, sendGridSettings.FromName);
message.Subject = email.Subject;
message.Html = email.HtmlBody;
message.Text = email.PlainTextBody;
var credentials = new NetworkCredential(sendGridSettings.Username, sendGridSettings.Password);
var transportWeb = Web.GetInstance(credentials);
transportWeb.Deliver(message);
return Task.FromResult(sendGridSettings.FromAddress);
}
}
} | {
"content_hash": "740993c4f0da909b0b22aa3542deb7f3",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 201,
"avg_line_length": 33.673469387755105,
"alnum_prop": 0.7018181818181818,
"repo_name": "jakubka/Huerate",
"id": "47cc165edff622b8944b0a4fef347b8e8690155f",
"size": "1652",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Huerate.Services/Email/SendGridEmailSenderService.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "97"
},
{
"name": "C#",
"bytes": "440109"
},
{
"name": "CSS",
"bytes": "183881"
},
{
"name": "JavaScript",
"bytes": "211753"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>sudoku: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.8.1 / sudoku - 8.10.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
sudoku
<small>
8.10.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-04-08 16:37:15 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-04-08 16:37:15 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.8.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/ftp://ftp-sop.inria.fr/lemme/Laurent.Thery/Sudoku.zip"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Sudoku"]
depends: [
"ocaml"
"coq" {>= "8.10" & < "8.11~"}
]
tags: [
"keyword: sudoku"
"keyword: puzzles"
"keyword: Davis-Putnam"
"category: Miscellaneous/Logical Puzzles and Entertainment"
"date: 2006-02"
]
authors: [
"Laurent Théry <thery@sophia.inria.fr> [http://www-sop.inria.fr/lemme/personnel/Laurent.Thery/me.html]"
]
bug-reports: "https://github.com/coq-contribs/sudoku/issues"
dev-repo: "git+https://github.com/coq-contribs/sudoku.git"
synopsis: "A certified Sudoku solver"
description: """
A formalisation of Sudoku in Coq. It implements a naive
Davis-Putnam procedure to solve sudokus."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/sudoku/archive/v8.10.0.tar.gz"
checksum: "md5=2dd3436d8554551fc30c0b5607e02363"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-sudoku.8.10.0 coq.8.8.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.8.1).
The following dependencies couldn't be met:
- coq-sudoku -> coq >= 8.10
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-sudoku.8.10.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "20742311d8ad6a523bfaebcac4c3a27e",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 159,
"avg_line_length": 40.32947976878613,
"alnum_prop": 0.5429267593521571,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "1338fae4183ad910ac95e5aa01f8098b2164c350",
"size": "7003",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.8.1/sudoku/8.10.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
#pragma checksum "..\..\devMgrCtrl.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "E9699BFE2F07802E2BB5AC6D1B4EDE12"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.34209
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using stm32GateWayDebug;
namespace stm32GateWayDebug {
/// <summary>
/// devMgrCtrl
/// </summary>
public partial class devMgrCtrl : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 9 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Canvas cvsMain;
#line default
#line hidden
#line 22 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtState;
#line default
#line hidden
#line 23 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtProtocol;
#line default
#line hidden
#line 24 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtNetId;
#line default
#line hidden
#line 25 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtMac;
#line default
#line hidden
#line 26 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtIO;
#line default
#line hidden
#line 27 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtIOMode;
#line default
#line hidden
#line 28 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtCurSt;
#line default
#line hidden
#line 29 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtType;
#line default
#line hidden
#line 30 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox txtName;
#line default
#line hidden
#line 32 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Canvas cvsBox;
#line default
#line hidden
#line 33 "..\..\devMgrCtrl.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Canvas cvsPanel;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/stm32GateWayDebug;component/devmgrctrl.xaml", System.UriKind.Relative);
#line 1 "..\..\devMgrCtrl.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.cvsMain = ((System.Windows.Controls.Canvas)(target));
return;
case 2:
this.txtState = ((System.Windows.Controls.TextBox)(target));
return;
case 3:
this.txtProtocol = ((System.Windows.Controls.TextBox)(target));
return;
case 4:
this.txtNetId = ((System.Windows.Controls.TextBox)(target));
return;
case 5:
this.txtMac = ((System.Windows.Controls.TextBox)(target));
return;
case 6:
this.txtIO = ((System.Windows.Controls.TextBox)(target));
return;
case 7:
this.txtIOMode = ((System.Windows.Controls.TextBox)(target));
return;
case 8:
this.txtCurSt = ((System.Windows.Controls.TextBox)(target));
return;
case 9:
this.txtType = ((System.Windows.Controls.TextBox)(target));
return;
case 10:
this.txtName = ((System.Windows.Controls.TextBox)(target));
return;
case 11:
this.cvsBox = ((System.Windows.Controls.Canvas)(target));
#line 32 "..\..\devMgrCtrl.xaml"
this.cvsBox.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.cvsBox_MouseUp);
#line default
#line hidden
#line 32 "..\..\devMgrCtrl.xaml"
this.cvsBox.MouseMove += new System.Windows.Input.MouseEventHandler(this.cvsBox_MouseMove);
#line default
#line hidden
return;
case 12:
this.cvsPanel = ((System.Windows.Controls.Canvas)(target));
#line 33 "..\..\devMgrCtrl.xaml"
this.cvsPanel.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.cvsPanel_MouseDown);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}
| {
"content_hash": "fff03746976312d7b7587d728da3b864",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 141,
"avg_line_length": 38.46052631578947,
"alnum_prop": 0.5959630516592542,
"repo_name": "sdlylshl/Gateway",
"id": "03e22f64f8bfef54c1edb5e8901ab19ccaed2ef5",
"size": "8877",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Gateway_CS/stm32GateWayDebug/obj/Debug/devMgrCtrl.g.i.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "12765"
},
{
"name": "C",
"bytes": "353399"
},
{
"name": "C#",
"bytes": "307154"
},
{
"name": "C++",
"bytes": "25019"
},
{
"name": "Java",
"bytes": "258513"
}
],
"symlink_target": ""
} |
"""
The setup script for Flask-OpenAPI.
"""
from setuptools import find_packages
from setuptools import setup
with open('README.rst') as f:
readme = f.read()
setup(
name='Flask-OpenAPI',
version='0.1.0a1',
author='Remco Haszing',
author_email='remcohaszing@gmail.com',
description='Generate a swagger.json handler from a Flask app',
long_description=readme,
license='MIT',
packages=find_packages(),
install_requires=[
'flask ~= 0.11',
'jsonschema ~= 2.5',
'pyyaml ~= 3.11'
],
zip_safe=True)
| {
"content_hash": "5a80fa00ef7d00a77a6bc5b1a0d38572",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 67,
"avg_line_length": 21.037037037037038,
"alnum_prop": 0.6267605633802817,
"repo_name": "remcohaszing/flask-openapi",
"id": "92bdb0f3e0c26089c385e328328164a9628a6edf",
"size": "591",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "setup.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "36700"
}
],
"symlink_target": ""
} |
<form name="editForm" role="form" novalidate ng-submit="save()">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
ng-click="clear()">×</button>
<h4 class="modal-title" id="myAllocationLabel" translate="ontimeApp.allocation.home.createOrEditLabel">Create or edit a Allocation</h4>
</div>
<div class="modal-body">
<jh-alert-error></jh-alert-error>
<div class="form-group">
<label for="id" translate="global.field.id">ID</label>
<input type="text" class="form-control" id="id" name="id"
ng-model="allocation.id" readonly />
</div>
<div class="form-group">
<label class="control-label" translate="ontimeApp.allocation.fte" for="field_fte">Fte</label>
<input type="number" class="form-control" name="fte" id="field_fte"
ng-model="allocation.fte"
/>
</div>
<div class="form-group">
<label class="control-label" translate="ontimeApp.allocation.year" for="field_year">Year</label>
<input type="number" class="form-control" name="year" id="field_year"
ng-model="allocation.year"
/>
</div>
<div class="form-group">
<label class="control-label" translate="ontimeApp.allocation.month" for="field_month">Month</label>
<input type="number" class="form-control" name="month" id="field_month"
ng-model="allocation.month"
/>
</div>
<div class="form-group">
<label translate="ontimeApp.allocation.projectCountry" for="field_projectCountry">projectCountry</label>
<select class="form-control" id="field_projectCountry" name="projectCountry" ng-model="allocation.projectCountryId" ng-options="projectCountry.id as projectCountry.id for projectCountry in projectcountrys | orderBy:'id'">
<option value=""></option>
</select>
</div>
<div class="form-group">
<label translate="ontimeApp.allocation.employment" for="field_employment">employment</label>
<select class="form-control" id="field_employment" name="employment" ng-model="allocation.employmentId" ng-options="employment.id as employment.id for employment in employments | orderBy:'id'">
<option value=""></option>
</select>
</div>
<div class="form-group">
<label translate="ontimeApp.allocation.skill" for="field_skill">skill</label>
<select class="form-control" id="field_skill" name="skill" ng-model="allocation.skillId" ng-options="skill.id as skill.id for skill in skills | orderBy:'id'">
<option value=""></option>
</select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" ng-click="clear()">
<span class="glyphicon glyphicon-ban-circle"></span> <span translate="entity.action.cancel">Cancel</span>
</button>
<button type="submit" ng-disabled="editForm.$invalid || isSaving" class="btn btn-primary">
<span class="glyphicon glyphicon-save"></span> <span translate="entity.action.save">Save</span>
</button>
</div>
</form>
| {
"content_hash": "f344879b1fbeef8ac89d480ad20ce9ba",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 233,
"avg_line_length": 56.08196721311475,
"alnum_prop": 0.600701549254604,
"repo_name": "sandor-balazs/nosql-java",
"id": "f43dd6dfeafd7dbb06d03baba9f74cfde48bc42c",
"size": "3422",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "oracle/src/main/webapp/scripts/app/entities/allocation/allocation-dialog.html",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "96556"
},
{
"name": "CSS",
"bytes": "17016"
},
{
"name": "HTML",
"bytes": "968574"
},
{
"name": "Java",
"bytes": "2187353"
},
{
"name": "JavaScript",
"bytes": "1330402"
},
{
"name": "Scala",
"bytes": "241589"
}
],
"symlink_target": ""
} |
require 'set'
# This is the latest iteration of the gem dependency resolving algorithm. As of now,
# it can resolve (as a success or failure) any set of gem dependencies we throw at it
# in a reasonable amount of time. The most iterations I've seen it take is about 150.
# The actual implementation of the algorithm is not as good as it could be yet, but that
# can come later.
module Bundler
class Resolver
require 'bundler/vendored_molinillo'
class Molinillo::VersionConflict
def clean_req(req)
if req.to_s.include?(">= 0")
req.to_s.gsub(/ \(.*?\)$/, '')
else
req.to_s.gsub(/\, (runtime|development)\)$/, ')')
end
end
def message
conflicts.values.flatten.reduce('') do |o, conflict|
o << %(Bundler could not find compatible versions for gem "#{conflict.requirement.name}":\n)
if conflict.locked_requirement
o << %( In snapshot (#{Bundler.default_lockfile.basename}):\n)
o << %( #{clean_req conflict.locked_requirement}\n)
o << %(\n)
end
o << %( In Gemfile:\n)
o << conflict.requirement_trees.map do |tree|
t = ''
depth = 2
tree.each do |req|
t << ' ' * depth << %(#{clean_req req})
t << %( depends on) unless tree[-1] == req
t << %(\n)
depth += 1
end
t
end.join("\n")
if conflict.requirement.name == 'bundler'
o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
other_bundler_required = !conflict.requirement.requirement.satisfied_by?(Gem::Version.new Bundler::VERSION)
end
if conflict.requirement.name == "bundler" && other_bundler_required
o << "\n"
o << "This Gemfile requires a different version of Bundler.\n"
o << "Perhaps you need to update Bundler by running `gem install bundler`?\n"
end
if conflict.locked_requirement
o << "\n"
o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n)
o << %(the gems in your Gemfile, which may resolve the conflict.\n)
elsif !conflict.existing
if conflict.requirement_trees.first.size > 1
o << "Could not find gem '#{clean_req(conflict.requirement)}', which is required by "
o << "gem '#{clean_req(conflict.requirement_trees.first[-2])}', in any of the sources."
else
o << "Could not find gem '#{clean_req(conflict.requirement)} in any of the sources\n"
end
end
o
end
end
end
ALL = Bundler::Dependency::PLATFORM_MAP.values.uniq.freeze
class SpecGroup < Array
include GemHelpers
attr_reader :activated, :required_by
def initialize(a)
super
@required_by = []
@activated = []
@dependencies = nil
@specs = {}
ALL.each do |p|
@specs[p] = reverse.find { |s| s.match_platform(p) }
end
end
def initialize_copy(o)
super
@required_by = o.required_by.dup
@activated = o.activated.dup
end
def to_specs
specs = {}
@activated.each do |p|
if s = @specs[p]
platform = generic(Gem::Platform.new(s.platform))
next if specs[platform]
lazy_spec = LazySpecification.new(name, version, platform, source)
lazy_spec.dependencies.replace s.dependencies
specs[platform] = lazy_spec
end
end
specs.values
end
def activate_platform(platform)
unless @activated.include?(platform)
if for?(platform)
@activated << platform
return __dependencies[platform] || []
end
end
[]
end
def name
@name ||= first.name
end
def version
@version ||= first.version
end
def source
@source ||= first.source
end
def for?(platform)
@specs[platform]
end
def to_s
"#{name} (#{version})"
end
def dependencies_for_activated_platforms
@activated.map { |p| __dependencies[p] }.flatten
end
def platforms_for_dependency_named(dependency)
__dependencies.select { |p, deps| deps.map(&:name).include? dependency }.keys
end
private
def __dependencies
@dependencies ||= begin
dependencies = {}
ALL.each do |p|
if spec = @specs[p]
dependencies[p] = []
spec.dependencies.each do |dep|
next if dep.type == :development
dependencies[p] << DepProxy.new(dep, p)
end
end
end
dependencies
end
end
end
# Figures out the best possible configuration of gems that satisfies
# the list of passed dependencies and any child dependencies without
# causing any gem activation errors.
#
# ==== Parameters
# *dependencies<Gem::Dependency>:: The list of dependencies to resolve
#
# ==== Returns
# <GemBundle>,nil:: If the list of dependencies can be resolved, a
# collection of gemspecs is returned. Otherwise, nil is returned.
def self.resolve(requirements, index, source_requirements = {}, base = [])
base = SpecSet.new(base) unless base.is_a?(SpecSet)
resolver = new(index, source_requirements, base)
result = resolver.start(requirements)
SpecSet.new(result)
end
def initialize(index, source_requirements, base)
@index = index
@source_requirements = source_requirements
@base = base
@resolver = Molinillo::Resolver.new(self, self)
@search_for = {}
@base_dg = Molinillo::DependencyGraph.new
@base.each { |ls| @base_dg.add_root_vertex ls.name, Dependency.new(ls.name, ls.version) }
end
def start(requirements)
verify_gemfile_dependencies_are_found!(requirements)
dg = @resolver.resolve(requirements, @base_dg)
dg.map(&:payload).map(&:to_specs).flatten
rescue Molinillo::VersionConflict => e
raise VersionConflict.new(e.conflicts.keys.uniq, e.message)
rescue Molinillo::CircularDependencyError => e
names = e.dependencies.sort_by(&:name).map { |d| "gem '#{d.name}'"}
raise CyclicDependencyError, "Your bundle requires gems that depend" \
" on each other, creating an infinite loop. Please remove" \
" #{names.count > 1 ? 'either ' : '' }#{names.join(' or ')}" \
" and try again."
end
include Molinillo::UI
# Conveys debug information to the user.
#
# @param [Integer] depth the current depth of the resolution process.
# @return [void]
def debug(depth = 0)
if debug?
debug_info = yield
debug_info = debug_info.inspect unless debug_info.is_a?(String)
STDERR.puts debug_info.split("\n").map { |s| ' ' * depth + s }
end
end
def debug?
ENV['DEBUG_RESOLVER'] || ENV['DEBUG_RESOLVER_TREE']
end
def before_resolution
Bundler.ui.info 'Resolving dependencies...', false
end
def after_resolution
Bundler.ui.info ''
end
def indicate_progress
Bundler.ui.info '.', false
end
private
include Molinillo::SpecificationProvider
def dependencies_for(specification)
specification.dependencies_for_activated_platforms
end
def search_for(dependency)
platform = dependency.__platform
dependency = dependency.dep unless dependency.is_a? Gem::Dependency
search = @search_for[dependency] ||= begin
index = @source_requirements[dependency.name] || @index
results = index.search(dependency, @base[dependency.name])
if vertex = @base_dg.vertex_named(dependency.name)
locked_requirement = vertex.payload.requirement
end
if results.any?
version = results.first.version
nested = [[]]
results.each do |spec|
if spec.version != version
nested << []
version = spec.version
end
nested.last << spec
end
groups = nested.map { |a| SpecGroup.new(a) }
!locked_requirement ? groups : groups.select { |sg| locked_requirement.satisfied_by? sg.version }
else
[]
end
end
search.select { |sg| sg.for?(platform) }.each { |sg| sg.activate_platform(platform) }
end
def name_for(dependency)
dependency.name
end
def name_for_explicit_dependency_source
Bundler.default_gemfile.basename.to_s rescue 'Gemfile'
end
def name_for_locking_dependency_source
Bundler.default_lockfile.basename.to_s rescue 'Gemfile.lock'
end
def requirement_satisfied_by?(requirement, activated, spec)
requirement.matches_spec?(spec)
end
def sort_dependencies(dependencies, activated, conflicts)
dependencies.sort_by do |dependency|
name = name_for(dependency)
[
activated.vertex_named(name).payload ? 0 : 1,
amount_constrained(dependency),
conflicts[name] ? 0 : 1,
activated.vertex_named(name).payload ? 0 : search_for(dependency).count,
]
end
end
def amount_constrained(dependency)
@amount_constrained ||= {}
@amount_constrained[dependency.name] ||= begin
if base = @base[dependency.name] and !base.empty?
dependency.requirement.satisfied_by?(base.first.version) ? 0 : 1
else
base_dep = Dependency.new dependency.name, '>= 0.a'
all = search_for(DepProxy.new base_dep, dependency.__platform)
if all.size == 0
0
else
search_for(dependency).size.to_f / all.size.to_f
end
end
end
end
def verify_gemfile_dependencies_are_found!(requirements)
requirements.each do |requirement|
next if requirement.name == 'bundler'
if search_for(requirement).empty?
if base = @base[requirement.name] and !base.empty?
version = base.first.version
message = "You have requested:\n" \
" #{requirement.name} #{requirement.requirement}\n\n" \
"The bundle currently has #{requirement.name} locked at #{version}.\n" \
"Try running `bundle update #{requirement.name}`"
elsif requirement.source
name = requirement.name
versions = @source_requirements[name][name].map { |s| s.version }
message = "Could not find gem '#{requirement}' in #{requirement.source}.\n"
if versions.any?
message << "Source contains '#{name}' at: #{versions.join(', ')}"
else
message << "Source does not contain any versions of '#{requirement}'"
end
else
message = "Could not find gem '#{requirement}' in any of the gem sources " \
"listed in your Gemfile or available on this machine."
end
raise GemNotFound, message
end
end
end
end
end
| {
"content_hash": "9539b6a2662887b45f466755e3548ba2",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 119,
"avg_line_length": 32.319088319088316,
"alnum_prop": 0.5784555712270804,
"repo_name": "cstrahan/bundler",
"id": "e83a40ee2837bbcfb544d31e589d4e64fde504f0",
"size": "11344",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/bundler/resolver.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "828861"
},
{
"name": "Shell",
"bytes": "131"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{ page.title }}</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:400,700" type="text/css">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/css/syntax.css">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="{{ site.name }}" href="{{ site.url }}/feed.xml">
</head>
<body>
<header class="header">
<div class="header__inner">
<h1 class="header__title">
<a href="/">
<img alt="Avatar" class="header__logo" src="/img/avatar.jpg" width="44" height="44" />
{{ site.name }}
</a>
</h1>
<nav class="header__links">
<a class="header__link" href="/">blog</a>
<a class="header__link" href="/pomodoro">pomodoro</a>
<a class="header__link" href="/about">about</a>
<a class="header__link"
href="http://cloud.feedly.com/#subscription%2Ffeed%2Fhttp%3A%2F%2Fwww.rudeshko.com%2Ffeed.xml"
target="blank" title="read me in feedly">
<!--suppress CheckImageSize -->
<img src="/img/feedly.png" alt="read me in feedly" width="66" height="20">
</a>
<span class="header__link">
<a href="https://twitter.com/{{ site.contacts.twitter }}" class="twitter-follow-button" data-show-count="false">Follow @AntonRudeshko</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</span>
</nav>
</div>
</header>
<main class="site" role="main">
{{ content }}
</main>
<footer class="footer">
<address class="footer__contact">
<p>
Anton Rudeshko<br/>
Team Lead at <a target="_blank" href="http://www.yandex.ru">Yandex</a><br/>
<a href="mailto:{{ site.contacts.email }}">{{ site.contacts.email }}</a>
</p>
</address>
<address class="footer__contact">
<p>
<a href="https://github.com/{{ site.contacts.github }}">github.com/{{ site.contacts.github }}</a><br/>
<a href="https://twitter.com/{{ site.contacts.twitter }}">twitter.com/{{ site.contacts.twitter }}</a><br/>
<a href="https://plus.google.com/+{{ site.contacts.gplus }}/about?rel=author">google.com/+{{ site.contacts.gplus }}</a><br/>
</p>
</address>
<div class="footer__contact">
Built with
<a target="_blank" href="http://jekyllrb.com">Jekyll</a>,
<a target="_blank" href="http://daringfireball.net/projects/markdown/">Markdown</a>,
<a target="_blank" href="http://bem.info/">BEM</a> and love.
<br/>
Hosted on <a target="_blank" href="http://pages.github.com/">GitHub pages</a>.
<br />
Updated at {{ site.time | date: "%F %R" }}.
</div>
</footer>
<div class="right-side"></div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-30845013-4', 'rudeshko.com');
ga('send', 'pageview');
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.1.0/anchor.min.js"></script>
<script>
anchors.add('h2, h3, h4, h5, h6');
</script>
</body>
</html>
| {
"content_hash": "855ab49227f0f910b2b9821d0e557063",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 303,
"avg_line_length": 36.396039603960396,
"alnum_prop": 0.6164309031556039,
"repo_name": "anton-rudeshko/anton-rudeshko.github.io",
"id": "2c002bef72f5fef67508e7cde7beb30e83d93bb8",
"size": "3676",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_layouts/default.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8208"
},
{
"name": "HTML",
"bytes": "7536"
},
{
"name": "Ruby",
"bytes": "240"
}
],
"symlink_target": ""
} |
Template[getTemplate('postDownvote')].helpers({
downvoted: function(){
var user = Meteor.user();
if(!user) return false;
return _.include(this.downvoters, user._id);
},
oneBasedRank: function(){
if(typeof this.rank !== 'undefined')
return this.rank - 1;
}
});
Template[getTemplate('postDownvote')].events({
'click .downvote-link': function(e, instance){
var post = this;
e.preventDefault();
if(!Meteor.user()){
Router.go('atSignIn');
flashMessage(i18n.t("please_log_in_first"), "info");
}
Meteor.call('downvotePost', post, function(error, result){
trackEvent("post downvoted", {'_id': post._id});
});
}
}); | {
"content_hash": "448327ad75cdf3a2e9d418fe9e54bbac",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 62,
"avg_line_length": 26.307692307692307,
"alnum_prop": 0.6140350877192983,
"repo_name": "ISPOL/codebuddies-meteor",
"id": "f6679bd1fb1d13612049ed46308d8195bd71dbe6",
"size": "684",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/views/posts/modules/post_downvote.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "67137"
},
{
"name": "JavaScript",
"bytes": "273327"
}
],
"symlink_target": ""
} |
/// Copyright (c) 2012 Ecma International. All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms"). Any redistribution of this code must retain the above
/// copyright and this notice and otherwise comply with the Use Terms.
/**
* @path ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-7-b-3.js
* @description Array.prototype.some - deleted properties in step 2 are visible here
*/
function testcase() {
var accessed = false;
function callbackfn(val, idx, obj) {
accessed = true;
return idx === 2;
}
var arr = { 2: 6.99, 8: 19};
Object.defineProperty(arr, "length", {
get: function () {
delete arr[2];
return 10;
},
configurable: true
});
return !Array.prototype.some.call(arr, callbackfn) && accessed;
}
runTestCase(testcase);
| {
"content_hash": "ae23da4511ce2cdc4c9575005d1f04a2",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 84,
"avg_line_length": 35.166666666666664,
"alnum_prop": 0.5848341232227489,
"repo_name": "fdecampredon/jsx-typescript-old-version",
"id": "242420ecffc4d39e3ef684db7f8c1a68c91e7a6a",
"size": "1055",
"binary": false,
"copies": "5",
"ref": "refs/heads/jsx",
"path": "tests/Fidelity/test262/suite/ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-7-b-3.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Elixir",
"bytes": "3294"
},
{
"name": "JavaScript",
"bytes": "23705444"
},
{
"name": "Shell",
"bytes": "386"
},
{
"name": "TypeScript",
"bytes": "18404576"
}
],
"symlink_target": ""
} |
package com.amazonaws.apigatewaydemo.action;
import com.amazonaws.apigatewaydemo.configuration.DynamoDBConfiguration;
import com.amazonaws.apigatewaydemo.exception.BadRequestException;
import com.amazonaws.apigatewaydemo.exception.InternalErrorException;
import com.amazonaws.apigatewaydemo.model.DAOFactory;
import com.amazonaws.apigatewaydemo.model.action.ListPetsResponse;
import com.amazonaws.apigatewaydemo.model.pet.Pet;
import com.amazonaws.apigatewaydemo.model.pet.PetDAO;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.LambdaLogger;
import com.google.gson.JsonObject;
import java.util.List;
/**
* Action to return a list of pets from in the data store
* <p/>
* GET to /pets/
*/
public class ListPetsDemoAction extends AbstractDemoAction {
private static LambdaLogger logger;
public String handle(JsonObject request, Context lambdaContext) throws BadRequestException, InternalErrorException {
logger = lambdaContext.getLogger();
PetDAO dao = DAOFactory.getPetDAO();
List<Pet> pets = dao.getPets(DynamoDBConfiguration.SCAN_LIMIT);
ListPetsResponse output = new ListPetsResponse();
output.setCount(pets.size());
output.setPageLimit(DynamoDBConfiguration.SCAN_LIMIT);
output.setPets(pets);
return getGson().toJson(output);
}
}
| {
"content_hash": "dda9eb9947c9c6e872cc8ae2dfa9b6ae",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 120,
"avg_line_length": 35.205128205128204,
"alnum_prop": 0.7771303714493809,
"repo_name": "awslabs/api-gateway-secure-pet-store",
"id": "6f256961b070a3664af893ac7734dfced7ca3287",
"size": "1946",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/com/amazonaws/apigatewaydemo/action/ListPetsDemoAction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "76304"
},
{
"name": "Objective-C",
"bytes": "77427"
},
{
"name": "Ruby",
"bytes": "129"
}
],
"symlink_target": ""
} |
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
@import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css");
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
audio,
canvas,
progress,
video {
display: inline-block;
vertical-align: baseline;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden],
template {
display: none;
}
a {
background-color: transparent;
}
a:active,
a:hover {
outline: 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
mark {
background: #ff0;
color: #000;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
box-sizing: content-box;
height: 0;
}
pre {
overflow: auto;
}
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
button,
input,
optgroup,
select,
textarea {
color: inherit;
font: inherit;
margin: 0;
}
button {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
input {
line-height: normal;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
input[type="search"] {
-webkit-appearance: textfield;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
}
optgroup {
font-weight: bold;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
@media print {
*,
*:before,
*:after {
background: transparent !important;
color: #000 !important;
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
a[href^="#"]:after,
a[href^="javascript:"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
.navbar {
display: none;
}
.btn > .caret,
.dropup > .btn > .caret {
border-top-color: #000 !important;
}
.label {
border: 1px solid #000;
}
.table {
border-collapse: collapse !important;
}
.table td,
.table th {
background-color: #fff !important;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.glyphicon-asterisk:before {
content: "\002a";
}
.glyphicon-plus:before {
content: "\002b";
}
.glyphicon-euro:before,
.glyphicon-eur:before {
content: "\20ac";
}
.glyphicon-minus:before {
content: "\2212";
}
.glyphicon-cloud:before {
content: "\2601";
}
.glyphicon-envelope:before {
content: "\2709";
}
.glyphicon-pencil:before {
content: "\270f";
}
.glyphicon-glass:before {
content: "\e001";
}
.glyphicon-music:before {
content: "\e002";
}
.glyphicon-search:before {
content: "\e003";
}
.glyphicon-heart:before {
content: "\e005";
}
.glyphicon-star:before {
content: "\e006";
}
.glyphicon-star-empty:before {
content: "\e007";
}
.glyphicon-user:before {
content: "\e008";
}
.glyphicon-film:before {
content: "\e009";
}
.glyphicon-th-large:before {
content: "\e010";
}
.glyphicon-th:before {
content: "\e011";
}
.glyphicon-th-list:before {
content: "\e012";
}
.glyphicon-ok:before {
content: "\e013";
}
.glyphicon-remove:before {
content: "\e014";
}
.glyphicon-zoom-in:before {
content: "\e015";
}
.glyphicon-zoom-out:before {
content: "\e016";
}
.glyphicon-off:before {
content: "\e017";
}
.glyphicon-signal:before {
content: "\e018";
}
.glyphicon-cog:before {
content: "\e019";
}
.glyphicon-trash:before {
content: "\e020";
}
.glyphicon-home:before {
content: "\e021";
}
.glyphicon-file:before {
content: "\e022";
}
.glyphicon-time:before {
content: "\e023";
}
.glyphicon-road:before {
content: "\e024";
}
.glyphicon-download-alt:before {
content: "\e025";
}
.glyphicon-download:before {
content: "\e026";
}
.glyphicon-upload:before {
content: "\e027";
}
.glyphicon-inbox:before {
content: "\e028";
}
.glyphicon-play-circle:before {
content: "\e029";
}
.glyphicon-repeat:before {
content: "\e030";
}
.glyphicon-refresh:before {
content: "\e031";
}
.glyphicon-list-alt:before {
content: "\e032";
}
.glyphicon-lock:before {
content: "\e033";
}
.glyphicon-flag:before {
content: "\e034";
}
.glyphicon-headphones:before {
content: "\e035";
}
.glyphicon-volume-off:before {
content: "\e036";
}
.glyphicon-volume-down:before {
content: "\e037";
}
.glyphicon-volume-up:before {
content: "\e038";
}
.glyphicon-qrcode:before {
content: "\e039";
}
.glyphicon-barcode:before {
content: "\e040";
}
.glyphicon-tag:before {
content: "\e041";
}
.glyphicon-tags:before {
content: "\e042";
}
.glyphicon-book:before {
content: "\e043";
}
.glyphicon-bookmark:before {
content: "\e044";
}
.glyphicon-print:before {
content: "\e045";
}
.glyphicon-camera:before {
content: "\e046";
}
.glyphicon-font:before {
content: "\e047";
}
.glyphicon-bold:before {
content: "\e048";
}
.glyphicon-italic:before {
content: "\e049";
}
.glyphicon-text-height:before {
content: "\e050";
}
.glyphicon-text-width:before {
content: "\e051";
}
.glyphicon-align-left:before {
content: "\e052";
}
.glyphicon-align-center:before {
content: "\e053";
}
.glyphicon-align-right:before {
content: "\e054";
}
.glyphicon-align-justify:before {
content: "\e055";
}
.glyphicon-list:before {
content: "\e056";
}
.glyphicon-indent-left:before {
content: "\e057";
}
.glyphicon-indent-right:before {
content: "\e058";
}
.glyphicon-facetime-video:before {
content: "\e059";
}
.glyphicon-picture:before {
content: "\e060";
}
.glyphicon-map-marker:before {
content: "\e062";
}
.glyphicon-adjust:before {
content: "\e063";
}
.glyphicon-tint:before {
content: "\e064";
}
.glyphicon-edit:before {
content: "\e065";
}
.glyphicon-share:before {
content: "\e066";
}
.glyphicon-check:before {
content: "\e067";
}
.glyphicon-move:before {
content: "\e068";
}
.glyphicon-step-backward:before {
content: "\e069";
}
.glyphicon-fast-backward:before {
content: "\e070";
}
.glyphicon-backward:before {
content: "\e071";
}
.glyphicon-play:before {
content: "\e072";
}
.glyphicon-pause:before {
content: "\e073";
}
.glyphicon-stop:before {
content: "\e074";
}
.glyphicon-forward:before {
content: "\e075";
}
.glyphicon-fast-forward:before {
content: "\e076";
}
.glyphicon-step-forward:before {
content: "\e077";
}
.glyphicon-eject:before {
content: "\e078";
}
.glyphicon-chevron-left:before {
content: "\e079";
}
.glyphicon-chevron-right:before {
content: "\e080";
}
.glyphicon-plus-sign:before {
content: "\e081";
}
.glyphicon-minus-sign:before {
content: "\e082";
}
.glyphicon-remove-sign:before {
content: "\e083";
}
.glyphicon-ok-sign:before {
content: "\e084";
}
.glyphicon-question-sign:before {
content: "\e085";
}
.glyphicon-info-sign:before {
content: "\e086";
}
.glyphicon-screenshot:before {
content: "\e087";
}
.glyphicon-remove-circle:before {
content: "\e088";
}
.glyphicon-ok-circle:before {
content: "\e089";
}
.glyphicon-ban-circle:before {
content: "\e090";
}
.glyphicon-arrow-left:before {
content: "\e091";
}
.glyphicon-arrow-right:before {
content: "\e092";
}
.glyphicon-arrow-up:before {
content: "\e093";
}
.glyphicon-arrow-down:before {
content: "\e094";
}
.glyphicon-share-alt:before {
content: "\e095";
}
.glyphicon-resize-full:before {
content: "\e096";
}
.glyphicon-resize-small:before {
content: "\e097";
}
.glyphicon-exclamation-sign:before {
content: "\e101";
}
.glyphicon-gift:before {
content: "\e102";
}
.glyphicon-leaf:before {
content: "\e103";
}
.glyphicon-fire:before {
content: "\e104";
}
.glyphicon-eye-open:before {
content: "\e105";
}
.glyphicon-eye-close:before {
content: "\e106";
}
.glyphicon-warning-sign:before {
content: "\e107";
}
.glyphicon-plane:before {
content: "\e108";
}
.glyphicon-calendar:before {
content: "\e109";
}
.glyphicon-random:before {
content: "\e110";
}
.glyphicon-comment:before {
content: "\e111";
}
.glyphicon-magnet:before {
content: "\e112";
}
.glyphicon-chevron-up:before {
content: "\e113";
}
.glyphicon-chevron-down:before {
content: "\e114";
}
.glyphicon-retweet:before {
content: "\e115";
}
.glyphicon-shopping-cart:before {
content: "\e116";
}
.glyphicon-folder-close:before {
content: "\e117";
}
.glyphicon-folder-open:before {
content: "\e118";
}
.glyphicon-resize-vertical:before {
content: "\e119";
}
.glyphicon-resize-horizontal:before {
content: "\e120";
}
.glyphicon-hdd:before {
content: "\e121";
}
.glyphicon-bullhorn:before {
content: "\e122";
}
.glyphicon-bell:before {
content: "\e123";
}
.glyphicon-certificate:before {
content: "\e124";
}
.glyphicon-thumbs-up:before {
content: "\e125";
}
.glyphicon-thumbs-down:before {
content: "\e126";
}
.glyphicon-hand-right:before {
content: "\e127";
}
.glyphicon-hand-left:before {
content: "\e128";
}
.glyphicon-hand-up:before {
content: "\e129";
}
.glyphicon-hand-down:before {
content: "\e130";
}
.glyphicon-circle-arrow-right:before {
content: "\e131";
}
.glyphicon-circle-arrow-left:before {
content: "\e132";
}
.glyphicon-circle-arrow-up:before {
content: "\e133";
}
.glyphicon-circle-arrow-down:before {
content: "\e134";
}
.glyphicon-globe:before {
content: "\e135";
}
.glyphicon-wrench:before {
content: "\e136";
}
.glyphicon-tasks:before {
content: "\e137";
}
.glyphicon-filter:before {
content: "\e138";
}
.glyphicon-briefcase:before {
content: "\e139";
}
.glyphicon-fullscreen:before {
content: "\e140";
}
.glyphicon-dashboard:before {
content: "\e141";
}
.glyphicon-paperclip:before {
content: "\e142";
}
.glyphicon-heart-empty:before {
content: "\e143";
}
.glyphicon-link:before {
content: "\e144";
}
.glyphicon-phone:before {
content: "\e145";
}
.glyphicon-pushpin:before {
content: "\e146";
}
.glyphicon-usd:before {
content: "\e148";
}
.glyphicon-gbp:before {
content: "\e149";
}
.glyphicon-sort:before {
content: "\e150";
}
.glyphicon-sort-by-alphabet:before {
content: "\e151";
}
.glyphicon-sort-by-alphabet-alt:before {
content: "\e152";
}
.glyphicon-sort-by-order:before {
content: "\e153";
}
.glyphicon-sort-by-order-alt:before {
content: "\e154";
}
.glyphicon-sort-by-attributes:before {
content: "\e155";
}
.glyphicon-sort-by-attributes-alt:before {
content: "\e156";
}
.glyphicon-unchecked:before {
content: "\e157";
}
.glyphicon-expand:before {
content: "\e158";
}
.glyphicon-collapse-down:before {
content: "\e159";
}
.glyphicon-collapse-up:before {
content: "\e160";
}
.glyphicon-log-in:before {
content: "\e161";
}
.glyphicon-flash:before {
content: "\e162";
}
.glyphicon-log-out:before {
content: "\e163";
}
.glyphicon-new-window:before {
content: "\e164";
}
.glyphicon-record:before {
content: "\e165";
}
.glyphicon-save:before {
content: "\e166";
}
.glyphicon-open:before {
content: "\e167";
}
.glyphicon-saved:before {
content: "\e168";
}
.glyphicon-import:before {
content: "\e169";
}
.glyphicon-export:before {
content: "\e170";
}
.glyphicon-send:before {
content: "\e171";
}
.glyphicon-floppy-disk:before {
content: "\e172";
}
.glyphicon-floppy-saved:before {
content: "\e173";
}
.glyphicon-floppy-remove:before {
content: "\e174";
}
.glyphicon-floppy-save:before {
content: "\e175";
}
.glyphicon-floppy-open:before {
content: "\e176";
}
.glyphicon-credit-card:before {
content: "\e177";
}
.glyphicon-transfer:before {
content: "\e178";
}
.glyphicon-cutlery:before {
content: "\e179";
}
.glyphicon-header:before {
content: "\e180";
}
.glyphicon-compressed:before {
content: "\e181";
}
.glyphicon-earphone:before {
content: "\e182";
}
.glyphicon-phone-alt:before {
content: "\e183";
}
.glyphicon-tower:before {
content: "\e184";
}
.glyphicon-stats:before {
content: "\e185";
}
.glyphicon-sd-video:before {
content: "\e186";
}
.glyphicon-hd-video:before {
content: "\e187";
}
.glyphicon-subtitles:before {
content: "\e188";
}
.glyphicon-sound-stereo:before {
content: "\e189";
}
.glyphicon-sound-dolby:before {
content: "\e190";
}
.glyphicon-sound-5-1:before {
content: "\e191";
}
.glyphicon-sound-6-1:before {
content: "\e192";
}
.glyphicon-sound-7-1:before {
content: "\e193";
}
.glyphicon-copyright-mark:before {
content: "\e194";
}
.glyphicon-registration-mark:before {
content: "\e195";
}
.glyphicon-cloud-download:before {
content: "\e197";
}
.glyphicon-cloud-upload:before {
content: "\e198";
}
.glyphicon-tree-conifer:before {
content: "\e199";
}
.glyphicon-tree-deciduous:before {
content: "\e200";
}
.glyphicon-cd:before {
content: "\e201";
}
.glyphicon-save-file:before {
content: "\e202";
}
.glyphicon-open-file:before {
content: "\e203";
}
.glyphicon-level-up:before {
content: "\e204";
}
.glyphicon-copy:before {
content: "\e205";
}
.glyphicon-paste:before {
content: "\e206";
}
.glyphicon-alert:before {
content: "\e209";
}
.glyphicon-equalizer:before {
content: "\e210";
}
.glyphicon-king:before {
content: "\e211";
}
.glyphicon-queen:before {
content: "\e212";
}
.glyphicon-pawn:before {
content: "\e213";
}
.glyphicon-bishop:before {
content: "\e214";
}
.glyphicon-knight:before {
content: "\e215";
}
.glyphicon-baby-formula:before {
content: "\e216";
}
.glyphicon-tent:before {
content: "\26fa";
}
.glyphicon-blackboard:before {
content: "\e218";
}
.glyphicon-bed:before {
content: "\e219";
}
.glyphicon-apple:before {
content: "\f8ff";
}
.glyphicon-erase:before {
content: "\e221";
}
.glyphicon-hourglass:before {
content: "\231b";
}
.glyphicon-lamp:before {
content: "\e223";
}
.glyphicon-duplicate:before {
content: "\e224";
}
.glyphicon-piggy-bank:before {
content: "\e225";
}
.glyphicon-scissors:before {
content: "\e226";
}
.glyphicon-bitcoin:before {
content: "\e227";
}
.glyphicon-btc:before {
content: "\e227";
}
.glyphicon-xbt:before {
content: "\e227";
}
.glyphicon-yen:before {
content: "\00a5";
}
.glyphicon-jpy:before {
content: "\00a5";
}
.glyphicon-ruble:before {
content: "\20bd";
}
.glyphicon-rub:before {
content: "\20bd";
}
.glyphicon-scale:before {
content: "\e230";
}
.glyphicon-ice-lolly:before {
content: "\e231";
}
.glyphicon-ice-lolly-tasted:before {
content: "\e232";
}
.glyphicon-education:before {
content: "\e233";
}
.glyphicon-option-horizontal:before {
content: "\e234";
}
.glyphicon-option-vertical:before {
content: "\e235";
}
.glyphicon-menu-hamburger:before {
content: "\e236";
}
.glyphicon-modal-window:before {
content: "\e237";
}
.glyphicon-oil:before {
content: "\e238";
}
.glyphicon-grain:before {
content: "\e239";
}
.glyphicon-sunglasses:before {
content: "\e240";
}
.glyphicon-text-size:before {
content: "\e241";
}
.glyphicon-text-color:before {
content: "\e242";
}
.glyphicon-text-background:before {
content: "\e243";
}
.glyphicon-object-align-top:before {
content: "\e244";
}
.glyphicon-object-align-bottom:before {
content: "\e245";
}
.glyphicon-object-align-horizontal:before {
content: "\e246";
}
.glyphicon-object-align-left:before {
content: "\e247";
}
.glyphicon-object-align-vertical:before {
content: "\e248";
}
.glyphicon-object-align-right:before {
content: "\e249";
}
.glyphicon-triangle-right:before {
content: "\e250";
}
.glyphicon-triangle-left:before {
content: "\e251";
}
.glyphicon-triangle-bottom:before {
content: "\e252";
}
.glyphicon-triangle-top:before {
content: "\e253";
}
.glyphicon-console:before {
content: "\e254";
}
.glyphicon-superscript:before {
content: "\e255";
}
.glyphicon-subscript:before {
content: "\e256";
}
.glyphicon-menu-left:before {
content: "\e257";
}
.glyphicon-menu-right:before {
content: "\e258";
}
.glyphicon-menu-down:before {
content: "\e259";
}
.glyphicon-menu-up:before {
content: "\e260";
}
* {
box-sizing: border-box;
}
*:before,
*:after {
box-sizing: border-box;
}
html {
font-size: 10px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333333;
background-color: #fff;
}
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
a {
color: #337ab7;
text-decoration: none;
}
a:hover,
a:focus {
color: #23527c;
text-decoration: underline;
}
a:focus {
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
figure {
margin: 0;
}
img {
vertical-align: middle;
}
.img-responsive,
.thumbnail > img,
.thumbnail a > img,
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
max-width: 100%;
height: auto;
}
.img-rounded {
border-radius: 6px;
}
.img-thumbnail {
padding: 4px;
line-height: 1.42857143;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto;
}
.img-circle {
border-radius: 50%;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eeeeee;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.sr-only-focusable:active,
.sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
[role="button"] {
cursor: pointer;
}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
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 {
font-weight: normal;
line-height: 1;
color: #777777;
}
h1,
.h1,
h2,
.h2,
h3,
.h3 {
margin-top: 20px;
margin-bottom: 10px;
}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {
font-size: 65%;
}
h4,
.h4,
h5,
.h5,
h6,
.h6 {
margin-top: 10px;
margin-bottom: 10px;
}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {
font-size: 75%;
}
h1,
.h1 {
font-size: 36px;
}
h2,
.h2 {
font-size: 30px;
}
h3,
.h3 {
font-size: 24px;
}
h4,
.h4 {
font-size: 18px;
}
h5,
.h5 {
font-size: 14px;
}
h6,
.h6 {
font-size: 12px;
}
p {
margin: 0 0 10px;
}
.lead {
margin-bottom: 20px;
font-size: 16px;
font-weight: 300;
line-height: 1.4;
}
@media (min-width: 768px) {
.lead {
font-size: 21px;
}
}
small,
.small {
font-size: 85%;
}
mark,
.mark {
background-color: #fcf8e3;
padding: .2em;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
.text-justify {
text-align: justify;
}
.text-nowrap {
white-space: nowrap;
}
.text-lowercase {
text-transform: lowercase;
}
.text-uppercase {
text-transform: uppercase;
}
.text-capitalize {
text-transform: capitalize;
}
.text-muted {
color: #777777;
}
.text-primary {
color: #337ab7;
}
a.text-primary:hover,
a.text-primary:focus {
color: #286090;
}
.text-success {
color: #3c763d;
}
a.text-success:hover,
a.text-success:focus {
color: #2b542c;
}
.text-info {
color: #31708f;
}
a.text-info:hover,
a.text-info:focus {
color: #245269;
}
.text-warning {
color: #8a6d3b;
}
a.text-warning:hover,
a.text-warning:focus {
color: #66512c;
}
.text-danger {
color: #a94442;
}
a.text-danger:hover,
a.text-danger:focus {
color: #843534;
}
.bg-primary {
color: #fff;
background-color: #337ab7;
}
a.bg-primary:hover,
a.bg-primary:focus {
background-color: #286090;
}
.bg-success {
background-color: #dff0d8;
}
a.bg-success:hover,
a.bg-success:focus {
background-color: #c1e2b3;
}
.bg-info {
background-color: #d9edf7;
}
a.bg-info:hover,
a.bg-info:focus {
background-color: #afd9ee;
}
.bg-warning {
background-color: #fcf8e3;
}
a.bg-warning:hover,
a.bg-warning:focus {
background-color: #f7ecb5;
}
.bg-danger {
background-color: #f2dede;
}
a.bg-danger:hover,
a.bg-danger:focus {
background-color: #e4b9b9;
}
.page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eeeeee;
}
ul,
ol {
margin-top: 0;
margin-bottom: 10px;
}
ul ul,
ol ul,
ul ol,
ol ol {
margin-bottom: 0;
}
.list-unstyled {
padding-left: 0;
list-style: none;
}
.list-inline {
padding-left: 0;
list-style: none;
margin-left: -5px;
}
.list-inline > li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
dl {
margin-top: 0;
margin-bottom: 20px;
}
dt,
dd {
line-height: 1.42857143;
}
dt {
font-weight: bold;
}
dd {
margin-left: 0;
}
@media (min-width: 768px) {
.dl-horizontal dt {
float: left;
width: 160px;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dl-horizontal dd {
margin-left: 180px;
}
}
abbr[title],
abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #777777;
}
.initialism {
font-size: 90%;
text-transform: uppercase;
}
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eeeeee;
}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {
margin-bottom: 0;
}
blockquote footer,
blockquote small,
blockquote .small {
display: block;
font-size: 80%;
line-height: 1.42857143;
color: #777777;
}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {
content: '\2014 \00A0';
}
.blockquote-reverse,
blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
text-align: right;
}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {
content: '';
}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {
content: '\00A0 \2014';
}
address {
margin-bottom: 20px;
font-style: normal;
line-height: 1.42857143;
}
code,
kbd,
pre,
samp {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
border-radius: 4px;
}
kbd {
padding: 2px 4px;
font-size: 90%;
color: #fff;
background-color: #333;
border-radius: 3px;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}
kbd kbd {
padding: 0;
font-size: 100%;
font-weight: bold;
box-shadow: none;
}
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.42857143;
word-break: break-all;
word-wrap: break-word;
color: #333333;
background-color: #f5f5f5;
border: 1px solid #ccc;
border-radius: 4px;
}
pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0;
}
.pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
.container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
@media (min-width: 768px) {
.container {
width: 750px;
}
}
@media (min-width: 992px) {
.container {
width: 970px;
}
}
@media (min-width: 1200px) {
.container {
width: 1170px;
}
}
.container-fluid {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
.row {
margin-left: -15px;
margin-right: -15px;
}
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
float: left;
}
.col-xs-12 {
width: 100%;
}
.col-xs-11 {
width: 91.66666667%;
}
.col-xs-10 {
width: 83.33333333%;
}
.col-xs-9 {
width: 75%;
}
.col-xs-8 {
width: 66.66666667%;
}
.col-xs-7 {
width: 58.33333333%;
}
.col-xs-6 {
width: 50%;
}
.col-xs-5 {
width: 41.66666667%;
}
.col-xs-4 {
width: 33.33333333%;
}
.col-xs-3 {
width: 25%;
}
.col-xs-2 {
width: 16.66666667%;
}
.col-xs-1 {
width: 8.33333333%;
}
.col-xs-pull-12 {
right: 100%;
}
.col-xs-pull-11 {
right: 91.66666667%;
}
.col-xs-pull-10 {
right: 83.33333333%;
}
.col-xs-pull-9 {
right: 75%;
}
.col-xs-pull-8 {
right: 66.66666667%;
}
.col-xs-pull-7 {
right: 58.33333333%;
}
.col-xs-pull-6 {
right: 50%;
}
.col-xs-pull-5 {
right: 41.66666667%;
}
.col-xs-pull-4 {
right: 33.33333333%;
}
.col-xs-pull-3 {
right: 25%;
}
.col-xs-pull-2 {
right: 16.66666667%;
}
.col-xs-pull-1 {
right: 8.33333333%;
}
.col-xs-pull-0 {
right: auto;
}
.col-xs-push-12 {
left: 100%;
}
.col-xs-push-11 {
left: 91.66666667%;
}
.col-xs-push-10 {
left: 83.33333333%;
}
.col-xs-push-9 {
left: 75%;
}
.col-xs-push-8 {
left: 66.66666667%;
}
.col-xs-push-7 {
left: 58.33333333%;
}
.col-xs-push-6 {
left: 50%;
}
.col-xs-push-5 {
left: 41.66666667%;
}
.col-xs-push-4 {
left: 33.33333333%;
}
.col-xs-push-3 {
left: 25%;
}
.col-xs-push-2 {
left: 16.66666667%;
}
.col-xs-push-1 {
left: 8.33333333%;
}
.col-xs-push-0 {
left: auto;
}
.col-xs-offset-12 {
margin-left: 100%;
}
.col-xs-offset-11 {
margin-left: 91.66666667%;
}
.col-xs-offset-10 {
margin-left: 83.33333333%;
}
.col-xs-offset-9 {
margin-left: 75%;
}
.col-xs-offset-8 {
margin-left: 66.66666667%;
}
.col-xs-offset-7 {
margin-left: 58.33333333%;
}
.col-xs-offset-6 {
margin-left: 50%;
}
.col-xs-offset-5 {
margin-left: 41.66666667%;
}
.col-xs-offset-4 {
margin-left: 33.33333333%;
}
.col-xs-offset-3 {
margin-left: 25%;
}
.col-xs-offset-2 {
margin-left: 16.66666667%;
}
.col-xs-offset-1 {
margin-left: 8.33333333%;
}
.col-xs-offset-0 {
margin-left: 0%;
}
@media (min-width: 768px) {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666667%;
}
.col-sm-10 {
width: 83.33333333%;
}
.col-sm-9 {
width: 75%;
}
.col-sm-8 {
width: 66.66666667%;
}
.col-sm-7 {
width: 58.33333333%;
}
.col-sm-6 {
width: 50%;
}
.col-sm-5 {
width: 41.66666667%;
}
.col-sm-4 {
width: 33.33333333%;
}
.col-sm-3 {
width: 25%;
}
.col-sm-2 {
width: 16.66666667%;
}
.col-sm-1 {
width: 8.33333333%;
}
.col-sm-pull-12 {
right: 100%;
}
.col-sm-pull-11 {
right: 91.66666667%;
}
.col-sm-pull-10 {
right: 83.33333333%;
}
.col-sm-pull-9 {
right: 75%;
}
.col-sm-pull-8 {
right: 66.66666667%;
}
.col-sm-pull-7 {
right: 58.33333333%;
}
.col-sm-pull-6 {
right: 50%;
}
.col-sm-pull-5 {
right: 41.66666667%;
}
.col-sm-pull-4 {
right: 33.33333333%;
}
.col-sm-pull-3 {
right: 25%;
}
.col-sm-pull-2 {
right: 16.66666667%;
}
.col-sm-pull-1 {
right: 8.33333333%;
}
.col-sm-pull-0 {
right: auto;
}
.col-sm-push-12 {
left: 100%;
}
.col-sm-push-11 {
left: 91.66666667%;
}
.col-sm-push-10 {
left: 83.33333333%;
}
.col-sm-push-9 {
left: 75%;
}
.col-sm-push-8 {
left: 66.66666667%;
}
.col-sm-push-7 {
left: 58.33333333%;
}
.col-sm-push-6 {
left: 50%;
}
.col-sm-push-5 {
left: 41.66666667%;
}
.col-sm-push-4 {
left: 33.33333333%;
}
.col-sm-push-3 {
left: 25%;
}
.col-sm-push-2 {
left: 16.66666667%;
}
.col-sm-push-1 {
left: 8.33333333%;
}
.col-sm-push-0 {
left: auto;
}
.col-sm-offset-12 {
margin-left: 100%;
}
.col-sm-offset-11 {
margin-left: 91.66666667%;
}
.col-sm-offset-10 {
margin-left: 83.33333333%;
}
.col-sm-offset-9 {
margin-left: 75%;
}
.col-sm-offset-8 {
margin-left: 66.66666667%;
}
.col-sm-offset-7 {
margin-left: 58.33333333%;
}
.col-sm-offset-6 {
margin-left: 50%;
}
.col-sm-offset-5 {
margin-left: 41.66666667%;
}
.col-sm-offset-4 {
margin-left: 33.33333333%;
}
.col-sm-offset-3 {
margin-left: 25%;
}
.col-sm-offset-2 {
margin-left: 16.66666667%;
}
.col-sm-offset-1 {
margin-left: 8.33333333%;
}
.col-sm-offset-0 {
margin-left: 0%;
}
}
@media (min-width: 992px) {
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
float: left;
}
.col-md-12 {
width: 100%;
}
.col-md-11 {
width: 91.66666667%;
}
.col-md-10 {
width: 83.33333333%;
}
.col-md-9 {
width: 75%;
}
.col-md-8 {
width: 66.66666667%;
}
.col-md-7 {
width: 58.33333333%;
}
.col-md-6 {
width: 50%;
}
.col-md-5 {
width: 41.66666667%;
}
.col-md-4 {
width: 33.33333333%;
}
.col-md-3 {
width: 25%;
}
.col-md-2 {
width: 16.66666667%;
}
.col-md-1 {
width: 8.33333333%;
}
.col-md-pull-12 {
right: 100%;
}
.col-md-pull-11 {
right: 91.66666667%;
}
.col-md-pull-10 {
right: 83.33333333%;
}
.col-md-pull-9 {
right: 75%;
}
.col-md-pull-8 {
right: 66.66666667%;
}
.col-md-pull-7 {
right: 58.33333333%;
}
.col-md-pull-6 {
right: 50%;
}
.col-md-pull-5 {
right: 41.66666667%;
}
.col-md-pull-4 {
right: 33.33333333%;
}
.col-md-pull-3 {
right: 25%;
}
.col-md-pull-2 {
right: 16.66666667%;
}
.col-md-pull-1 {
right: 8.33333333%;
}
.col-md-pull-0 {
right: auto;
}
.col-md-push-12 {
left: 100%;
}
.col-md-push-11 {
left: 91.66666667%;
}
.col-md-push-10 {
left: 83.33333333%;
}
.col-md-push-9 {
left: 75%;
}
.col-md-push-8 {
left: 66.66666667%;
}
.col-md-push-7 {
left: 58.33333333%;
}
.col-md-push-6 {
left: 50%;
}
.col-md-push-5 {
left: 41.66666667%;
}
.col-md-push-4 {
left: 33.33333333%;
}
.col-md-push-3 {
left: 25%;
}
.col-md-push-2 {
left: 16.66666667%;
}
.col-md-push-1 {
left: 8.33333333%;
}
.col-md-push-0 {
left: auto;
}
.col-md-offset-12 {
margin-left: 100%;
}
.col-md-offset-11 {
margin-left: 91.66666667%;
}
.col-md-offset-10 {
margin-left: 83.33333333%;
}
.col-md-offset-9 {
margin-left: 75%;
}
.col-md-offset-8 {
margin-left: 66.66666667%;
}
.col-md-offset-7 {
margin-left: 58.33333333%;
}
.col-md-offset-6 {
margin-left: 50%;
}
.col-md-offset-5 {
margin-left: 41.66666667%;
}
.col-md-offset-4 {
margin-left: 33.33333333%;
}
.col-md-offset-3 {
margin-left: 25%;
}
.col-md-offset-2 {
margin-left: 16.66666667%;
}
.col-md-offset-1 {
margin-left: 8.33333333%;
}
.col-md-offset-0 {
margin-left: 0%;
}
}
@media (min-width: 1200px) {
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
float: left;
}
.col-lg-12 {
width: 100%;
}
.col-lg-11 {
width: 91.66666667%;
}
.col-lg-10 {
width: 83.33333333%;
}
.col-lg-9 {
width: 75%;
}
.col-lg-8 {
width: 66.66666667%;
}
.col-lg-7 {
width: 58.33333333%;
}
.col-lg-6 {
width: 50%;
}
.col-lg-5 {
width: 41.66666667%;
}
.col-lg-4 {
width: 33.33333333%;
}
.col-lg-3 {
width: 25%;
}
.col-lg-2 {
width: 16.66666667%;
}
.col-lg-1 {
width: 8.33333333%;
}
.col-lg-pull-12 {
right: 100%;
}
.col-lg-pull-11 {
right: 91.66666667%;
}
.col-lg-pull-10 {
right: 83.33333333%;
}
.col-lg-pull-9 {
right: 75%;
}
.col-lg-pull-8 {
right: 66.66666667%;
}
.col-lg-pull-7 {
right: 58.33333333%;
}
.col-lg-pull-6 {
right: 50%;
}
.col-lg-pull-5 {
right: 41.66666667%;
}
.col-lg-pull-4 {
right: 33.33333333%;
}
.col-lg-pull-3 {
right: 25%;
}
.col-lg-pull-2 {
right: 16.66666667%;
}
.col-lg-pull-1 {
right: 8.33333333%;
}
.col-lg-pull-0 {
right: auto;
}
.col-lg-push-12 {
left: 100%;
}
.col-lg-push-11 {
left: 91.66666667%;
}
.col-lg-push-10 {
left: 83.33333333%;
}
.col-lg-push-9 {
left: 75%;
}
.col-lg-push-8 {
left: 66.66666667%;
}
.col-lg-push-7 {
left: 58.33333333%;
}
.col-lg-push-6 {
left: 50%;
}
.col-lg-push-5 {
left: 41.66666667%;
}
.col-lg-push-4 {
left: 33.33333333%;
}
.col-lg-push-3 {
left: 25%;
}
.col-lg-push-2 {
left: 16.66666667%;
}
.col-lg-push-1 {
left: 8.33333333%;
}
.col-lg-push-0 {
left: auto;
}
.col-lg-offset-12 {
margin-left: 100%;
}
.col-lg-offset-11 {
margin-left: 91.66666667%;
}
.col-lg-offset-10 {
margin-left: 83.33333333%;
}
.col-lg-offset-9 {
margin-left: 75%;
}
.col-lg-offset-8 {
margin-left: 66.66666667%;
}
.col-lg-offset-7 {
margin-left: 58.33333333%;
}
.col-lg-offset-6 {
margin-left: 50%;
}
.col-lg-offset-5 {
margin-left: 41.66666667%;
}
.col-lg-offset-4 {
margin-left: 33.33333333%;
}
.col-lg-offset-3 {
margin-left: 25%;
}
.col-lg-offset-2 {
margin-left: 16.66666667%;
}
.col-lg-offset-1 {
margin-left: 8.33333333%;
}
.col-lg-offset-0 {
margin-left: 0%;
}
}
table {
background-color: transparent;
}
caption {
padding-top: 8px;
padding-bottom: 8px;
color: #777777;
text-align: left;
}
th {
text-align: left;
}
.table {
width: 100%;
max-width: 100%;
margin-bottom: 20px;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
padding: 8px;
line-height: 1.42857143;
vertical-align: top;
border-top: 1px solid #ddd;
}
.table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #ddd;
}
.table > caption + thead > tr:first-child > th,
.table > colgroup + thead > tr:first-child > th,
.table > thead:first-child > tr:first-child > th,
.table > caption + thead > tr:first-child > td,
.table > colgroup + thead > tr:first-child > td,
.table > thead:first-child > tr:first-child > td {
border-top: 0;
}
.table > tbody + tbody {
border-top: 2px solid #ddd;
}
.table .table {
background-color: #fff;
}
.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > tbody > tr > td,
.table-condensed > tfoot > tr > td {
padding: 5px;
}
.table-bordered {
border: 1px solid #ddd;
}
.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 #ddd;
}
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
.table-striped > tbody > tr:nth-of-type(odd) {
background-color: #f9f9f9;
}
.table-hover > tbody > tr:hover {
background-color: #f5f5f5;
}
table col[class*="col-"] {
position: static;
float: none;
display: table-column;
}
table td[class*="col-"],
table th[class*="col-"] {
position: static;
float: none;
display: table-cell;
}
.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: #f5f5f5;
}
.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: #e8e8e8;
}
.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: #dff0d8;
}
.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: #d0e9c6;
}
.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: #d9edf7;
}
.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: #c4e3f3;
}
.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: #fcf8e3;
}
.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: #faf2cc;
}
.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: #f2dede;
}
.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: #ebcccc;
}
.table-responsive {
overflow-x: auto;
min-height: 0.01%;
}
@media screen and (max-width: 767px) {
.table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
-ms-overflow-style: -ms-autohiding-scrollbar;
border: 1px solid #ddd;
}
.table-responsive > .table {
margin-bottom: 0;
}
.table-responsive > .table > thead > tr > th,
.table-responsive > .table > tbody > tr > th,
.table-responsive > .table > tfoot > tr > th,
.table-responsive > .table > thead > tr > td,
.table-responsive > .table > tbody > tr > td,
.table-responsive > .table > tfoot > tr > td {
white-space: nowrap;
}
.table-responsive > .table-bordered {
border: 0;
}
.table-responsive > .table-bordered > thead > tr > th:first-child,
.table-responsive > .table-bordered > tbody > tr > th:first-child,
.table-responsive > .table-bordered > tfoot > tr > th:first-child,
.table-responsive > .table-bordered > thead > tr > td:first-child,
.table-responsive > .table-bordered > tbody > tr > td:first-child,
.table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.table-responsive > .table-bordered > thead > tr > th:last-child,
.table-responsive > .table-bordered > tbody > tr > th:last-child,
.table-responsive > .table-bordered > tfoot > tr > th:last-child,
.table-responsive > .table-bordered > thead > tr > td:last-child,
.table-responsive > .table-bordered > tbody > tr > td:last-child,
.table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.table-responsive > .table-bordered > tbody > tr:last-child > th,
.table-responsive > .table-bordered > tfoot > tr:last-child > th,
.table-responsive > .table-bordered > tbody > tr:last-child > td,
.table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
}
fieldset {
padding: 0;
margin: 0;
border: 0;
min-width: 0;
}
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #333333;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
label {
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
font-weight: bold;
}
input[type="search"] {
box-sizing: border-box;
}
input[type="radio"],
input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
line-height: normal;
}
input[type="file"] {
display: block;
}
input[type="range"] {
display: block;
width: 100%;
}
select[multiple],
select[size] {
height: auto;
}
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
output {
display: block;
padding-top: 7px;
font-size: 14px;
line-height: 1.42857143;
color: #555555;
}
.form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.form-control::-moz-placeholder {
color: #999;
opacity: 1;
}
.form-control:-ms-input-placeholder {
color: #999;
}
.form-control::-webkit-input-placeholder {
color: #999;
}
.form-control::-ms-expand {
border: 0;
background-color: transparent;
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
background-color: #eeeeee;
opacity: 1;
}
.form-control[disabled],
fieldset[disabled] .form-control {
cursor: not-allowed;
}
textarea.form-control {
height: auto;
}
input[type="search"] {
-webkit-appearance: none;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control,
input[type="month"].form-control {
line-height: 34px;
}
input[type="date"].input-sm,
input[type="time"].input-sm,
input[type="datetime-local"].input-sm,
input[type="month"].input-sm,
.input-group-sm input[type="date"],
.input-group-sm input[type="time"],
.input-group-sm input[type="datetime-local"],
.input-group-sm input[type="month"] {
line-height: 30px;
}
input[type="date"].input-lg,
input[type="time"].input-lg,
input[type="datetime-local"].input-lg,
input[type="month"].input-lg,
.input-group-lg input[type="date"],
.input-group-lg input[type="time"],
.input-group-lg input[type="datetime-local"],
.input-group-lg input[type="month"] {
line-height: 46px;
}
}
.form-group {
margin-bottom: 15px;
}
.radio,
.checkbox {
position: relative;
display: block;
margin-top: 10px;
margin-bottom: 10px;
}
.radio label,
.checkbox label {
min-height: 20px;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
.radio input[type="radio"],
.radio-inline input[type="radio"],
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
position: absolute;
margin-left: -20px;
margin-top: 4px \9;
}
.radio + .radio,
.checkbox + .checkbox {
margin-top: -5px;
}
.radio-inline,
.checkbox-inline {
position: relative;
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
vertical-align: middle;
font-weight: normal;
cursor: pointer;
}
.radio-inline + .radio-inline,
.checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px;
}
input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"].disabled,
input[type="checkbox"].disabled,
fieldset[disabled] input[type="radio"],
fieldset[disabled] input[type="checkbox"] {
cursor: not-allowed;
}
.radio-inline.disabled,
.checkbox-inline.disabled,
fieldset[disabled] .radio-inline,
fieldset[disabled] .checkbox-inline {
cursor: not-allowed;
}
.radio.disabled label,
.checkbox.disabled label,
fieldset[disabled] .radio label,
fieldset[disabled] .checkbox label {
cursor: not-allowed;
}
.form-control-static {
padding-top: 7px;
padding-bottom: 7px;
margin-bottom: 0;
min-height: 34px;
}
.form-control-static.input-lg,
.form-control-static.input-sm {
padding-left: 0;
padding-right: 0;
}
.input-sm {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-sm {
height: 30px;
line-height: 30px;
}
textarea.input-sm,
select[multiple].input-sm {
height: auto;
}
.form-group-sm .form-control {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.form-group-sm select.form-control {
height: 30px;
line-height: 30px;
}
.form-group-sm textarea.form-control,
.form-group-sm select[multiple].form-control {
height: auto;
}
.form-group-sm .form-control-static {
height: 30px;
min-height: 32px;
padding: 6px 10px;
font-size: 12px;
line-height: 1.5;
}
.input-lg {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
select.input-lg {
height: 46px;
line-height: 46px;
}
textarea.input-lg,
select[multiple].input-lg {
height: auto;
}
.form-group-lg .form-control {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
.form-group-lg select.form-control {
height: 46px;
line-height: 46px;
}
.form-group-lg textarea.form-control,
.form-group-lg select[multiple].form-control {
height: auto;
}
.form-group-lg .form-control-static {
height: 46px;
min-height: 38px;
padding: 11px 16px;
font-size: 18px;
line-height: 1.3333333;
}
.has-feedback {
position: relative;
}
.has-feedback .form-control {
padding-right: 42.5px;
}
.form-control-feedback {
position: absolute;
top: 0;
right: 0;
z-index: 2;
display: block;
width: 34px;
height: 34px;
line-height: 34px;
text-align: center;
pointer-events: none;
}
.input-lg + .form-control-feedback,
.input-group-lg + .form-control-feedback,
.form-group-lg .form-control + .form-control-feedback {
width: 46px;
height: 46px;
line-height: 46px;
}
.input-sm + .form-control-feedback,
.input-group-sm + .form-control-feedback,
.form-group-sm .form-control + .form-control-feedback {
width: 30px;
height: 30px;
line-height: 30px;
}
.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: #3c763d;
}
.has-success .form-control {
border-color: #3c763d;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-success .form-control:focus {
border-color: #2b542c;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
}
.has-success .input-group-addon {
color: #3c763d;
border-color: #3c763d;
background-color: #dff0d8;
}
.has-success .form-control-feedback {
color: #3c763d;
}
.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: #8a6d3b;
}
.has-warning .form-control {
border-color: #8a6d3b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-warning .form-control:focus {
border-color: #66512c;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
}
.has-warning .input-group-addon {
color: #8a6d3b;
border-color: #8a6d3b;
background-color: #fcf8e3;
}
.has-warning .form-control-feedback {
color: #8a6d3b;
}
.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: #a94442;
}
.has-error .form-control {
border-color: #a94442;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-error .form-control:focus {
border-color: #843534;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
}
.has-error .input-group-addon {
color: #a94442;
border-color: #a94442;
background-color: #f2dede;
}
.has-error .form-control-feedback {
color: #a94442;
}
.has-feedback label ~ .form-control-feedback {
top: 25px;
}
.has-feedback label.sr-only ~ .form-control-feedback {
top: 0;
}
.help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #737373;
}
@media (min-width: 768px) {
.form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
.form-inline .form-control-static {
display: inline-block;
}
.form-inline .input-group {
display: inline-table;
vertical-align: middle;
}
.form-inline .input-group .input-group-addon,
.form-inline .input-group .input-group-btn,
.form-inline .input-group .form-control {
width: auto;
}
.form-inline .input-group > .form-control {
width: 100%;
}
.form-inline .control-label {
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio,
.form-inline .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio label,
.form-inline .checkbox label {
padding-left: 0;
}
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
position: relative;
margin-left: 0;
}
.form-inline .has-feedback .form-control-feedback {
top: 0;
}
}
.form-horizontal .radio,
.form-horizontal .checkbox,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
margin-top: 0;
margin-bottom: 0;
padding-top: 7px;
}
.form-horizontal .radio,
.form-horizontal .checkbox {
min-height: 27px;
}
.form-horizontal .form-group {
margin-left: -15px;
margin-right: -15px;
}
@media (min-width: 768px) {
.form-horizontal .control-label {
text-align: right;
margin-bottom: 0;
padding-top: 7px;
}
}
.form-horizontal .has-feedback .form-control-feedback {
right: 15px;
}
@media (min-width: 768px) {
.form-horizontal .form-group-lg .control-label {
padding-top: 11px;
font-size: 18px;
}
}
@media (min-width: 768px) {
.form-horizontal .form-group-sm .control-label {
padding-top: 6px;
font-size: 12px;
}
}
.btn {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.btn:focus,
.btn:active:focus,
.btn.active:focus,
.btn.focus,
.btn:active.focus,
.btn.active.focus {
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.btn:hover,
.btn:focus,
.btn.focus {
color: #333;
text-decoration: none;
}
.btn:active,
.btn.active {
outline: 0;
background-image: none;
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
cursor: not-allowed;
opacity: 0.65;
filter: alpha(opacity=65);
box-shadow: none;
}
a.btn.disabled,
fieldset[disabled] a.btn {
pointer-events: none;
}
.btn-default {
color: #333;
background-color: #fff;
border-color: #ccc;
}
.btn-default:focus,
.btn-default.focus {
color: #333;
background-color: #e6e6e6;
border-color: #8c8c8c;
}
.btn-default:hover {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
.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: #333;
background-color: #d4d4d4;
border-color: #8c8c8c;
}
.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: #fff;
border-color: #ccc;
}
.btn-default .badge {
color: #fff;
background-color: #333;
}
.btn-primary {
color: #fff;
background-color: #337ab7;
border-color: #2e6da4;
}
.btn-primary:focus,
.btn-primary.focus {
color: #fff;
background-color: #286090;
border-color: #122b40;
}
.btn-primary:hover {
color: #fff;
background-color: #286090;
border-color: #204d74;
}
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
color: #fff;
background-color: #286090;
border-color: #204d74;
}
.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: #204d74;
border-color: #122b40;
}
.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: #337ab7;
border-color: #2e6da4;
}
.btn-primary .badge {
color: #337ab7;
background-color: #fff;
}
.btn-success {
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success:focus,
.btn-success.focus {
color: #fff;
background-color: #449d44;
border-color: #255625;
}
.btn-success:hover {
color: #fff;
background-color: #449d44;
border-color: #398439;
}
.btn-success:active,
.btn-success.active,
.open > .dropdown-toggle.btn-success {
color: #fff;
background-color: #449d44;
border-color: #398439;
}
.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: #398439;
border-color: #255625;
}
.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: #5cb85c;
border-color: #4cae4c;
}
.btn-success .badge {
color: #5cb85c;
background-color: #fff;
}
.btn-info {
color: #fff;
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info:focus,
.btn-info.focus {
color: #fff;
background-color: #31b0d5;
border-color: #1b6d85;
}
.btn-info:hover {
color: #fff;
background-color: #31b0d5;
border-color: #269abc;
}
.btn-info:active,
.btn-info.active,
.open > .dropdown-toggle.btn-info {
color: #fff;
background-color: #31b0d5;
border-color: #269abc;
}
.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: #269abc;
border-color: #1b6d85;
}
.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: #5bc0de;
border-color: #46b8da;
}
.btn-info .badge {
color: #5bc0de;
background-color: #fff;
}
.btn-warning {
color: #fff;
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning:focus,
.btn-warning.focus {
color: #fff;
background-color: #ec971f;
border-color: #985f0d;
}
.btn-warning:hover {
color: #fff;
background-color: #ec971f;
border-color: #d58512;
}
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
color: #fff;
background-color: #ec971f;
border-color: #d58512;
}
.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: #d58512;
border-color: #985f0d;
}
.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: #f0ad4e;
border-color: #eea236;
}
.btn-warning .badge {
color: #f0ad4e;
background-color: #fff;
}
.btn-danger {
color: #fff;
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger:focus,
.btn-danger.focus {
color: #fff;
background-color: #c9302c;
border-color: #761c19;
}
.btn-danger:hover {
color: #fff;
background-color: #c9302c;
border-color: #ac2925;
}
.btn-danger:active,
.btn-danger.active,
.open > .dropdown-toggle.btn-danger {
color: #fff;
background-color: #c9302c;
border-color: #ac2925;
}
.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: #ac2925;
border-color: #761c19;
}
.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: #d9534f;
border-color: #d43f3a;
}
.btn-danger .badge {
color: #d9534f;
background-color: #fff;
}
.btn-link {
color: #337ab7;
font-weight: normal;
border-radius: 0;
}
.btn-link,
.btn-link:active,
.btn-link.active,
.btn-link[disabled],
fieldset[disabled] .btn-link {
background-color: transparent;
box-shadow: none;
}
.btn-link,
.btn-link:hover,
.btn-link:focus,
.btn-link:active {
border-color: transparent;
}
.btn-link:hover,
.btn-link:focus {
color: #23527c;
text-decoration: underline;
background-color: transparent;
}
.btn-link[disabled]:hover,
fieldset[disabled] .btn-link:hover,
.btn-link[disabled]:focus,
fieldset[disabled] .btn-link:focus {
color: #777777;
text-decoration: none;
}
.btn-lg,
.btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
.btn-sm,
.btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-xs,
.btn-group-xs > .btn {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-block {
display: block;
width: 100%;
}
.btn-block + .btn-block {
margin-top: 5px;
}
input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
width: 100%;
}
.fade {
opacity: 0;
transition: opacity 0.15s linear;
}
.fade.in {
opacity: 1;
}
.collapse {
display: none;
}
.collapse.in {
display: block;
}
tr.collapse.in {
display: table-row;
}
tbody.collapse.in {
display: table-row-group;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
transition-property: height, visibility;
transition-duration: 0.35s;
transition-timing-function: ease;
}
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px dashed;
border-top: 4px solid \9;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
}
.dropup,
.dropdown {
position: relative;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: 14px;
text-align: left;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
}
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.42857143;
color: #333333;
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #fff;
text-decoration: none;
outline: 0;
background-color: #337ab7;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
color: #777777;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
.open > .dropdown-menu {
display: block;
}
.open > a {
outline: 0;
}
.dropdown-menu-right {
left: auto;
right: 0;
}
.dropdown-menu-left {
left: 0;
right: auto;
}
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.42857143;
color: #777777;
white-space: nowrap;
}
.dropdown-backdrop {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 990;
}
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
border-top: 0;
border-bottom: 4px dashed;
border-bottom: 4px solid \9;
content: "";
}
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 2px;
}
@media (min-width: 768px) {
.navbar-right .dropdown-menu {
left: auto;
right: 0;
}
.navbar-right .dropdown-menu-left {
left: 0;
right: auto;
}
}
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle;
}
.btn-group > .btn,
.btn-group-vertical > .btn {
position: relative;
float: left;
}
.btn-group > .btn:hover,
.btn-group-vertical > .btn:hover,
.btn-group > .btn:focus,
.btn-group-vertical > .btn:focus,
.btn-group > .btn:active,
.btn-group-vertical > .btn:active,
.btn-group > .btn.active,
.btn-group-vertical > .btn.active {
z-index: 2;
}
.btn-group .btn + .btn,
.btn-group .btn + .btn-group,
.btn-group .btn-group + .btn,
.btn-group .btn-group + .btn-group {
margin-left: -1px;
}
.btn-toolbar {
margin-left: -5px;
}
.btn-toolbar .btn,
.btn-toolbar .btn-group,
.btn-toolbar .input-group {
float: left;
}
.btn-toolbar > .btn,
.btn-toolbar > .btn-group,
.btn-toolbar > .input-group {
margin-left: 5px;
}
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
.btn-group > .btn:first-child {
margin-left: 0;
}
.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.btn-group > .btn:last-child:not(:first-child),
.btn-group > .dropdown-toggle:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.btn-group > .btn-group {
float: left;
}
.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
.btn-group > .btn + .dropdown-toggle {
padding-left: 8px;
padding-right: 8px;
}
.btn-group > .btn-lg + .dropdown-toggle {
padding-left: 12px;
padding-right: 12px;
}
.btn-group.open .dropdown-toggle {
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn-group.open .dropdown-toggle.btn-link {
box-shadow: none;
}
.btn .caret {
margin-left: 0;
}
.btn-lg .caret {
border-width: 5px 5px 0;
border-bottom-width: 0;
}
.dropup .btn-lg .caret {
border-width: 0 5px 5px;
}
.btn-group-vertical > .btn,
.btn-group-vertical > .btn-group,
.btn-group-vertical > .btn-group > .btn {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.btn-group-vertical > .btn-group > .btn {
float: none;
}
.btn-group-vertical > .btn + .btn,
.btn-group-vertical > .btn + .btn-group,
.btn-group-vertical > .btn-group + .btn,
.btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0;
}
.btn-group-vertical > .btn:first-child:not(:last-child) {
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn:last-child:not(:first-child) {
border-top-right-radius: 0;
border-top-left-radius: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.btn-group-justified > .btn,
.btn-group-justified > .btn-group {
float: none;
display: table-cell;
width: 1%;
}
.btn-group-justified > .btn-group .btn {
width: 100%;
}
.btn-group-justified > .btn-group .dropdown-menu {
left: auto;
}
[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"] {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;
}
.input-group {
position: relative;
display: table;
border-collapse: separate;
}
.input-group[class*="col-"] {
float: none;
padding-left: 0;
padding-right: 0;
}
.input-group .form-control {
position: relative;
z-index: 2;
float: left;
width: 100%;
margin-bottom: 0;
}
.input-group .form-control:focus {
z-index: 3;
}
.input-group-lg > .form-control,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .btn {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
select.input-group-lg > .form-control,
select.input-group-lg > .input-group-addon,
select.input-group-lg > .input-group-btn > .btn {
height: 46px;
line-height: 46px;
}
textarea.input-group-lg > .form-control,
textarea.input-group-lg > .input-group-addon,
textarea.input-group-lg > .input-group-btn > .btn,
select[multiple].input-group-lg > .form-control,
select[multiple].input-group-lg > .input-group-addon,
select[multiple].input-group-lg > .input-group-btn > .btn {
height: auto;
}
.input-group-sm > .form-control,
.input-group-sm > .input-group-addon,
.input-group-sm > .input-group-btn > .btn {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-group-sm > .form-control,
select.input-group-sm > .input-group-addon,
select.input-group-sm > .input-group-btn > .btn {
height: 30px;
line-height: 30px;
}
textarea.input-group-sm > .form-control,
textarea.input-group-sm > .input-group-addon,
textarea.input-group-sm > .input-group-btn > .btn,
select[multiple].input-group-sm > .form-control,
select[multiple].input-group-sm > .input-group-addon,
select[multiple].input-group-sm > .input-group-btn > .btn {
height: auto;
}
.input-group-addon,
.input-group-btn,
.input-group .form-control {
display: table-cell;
}
.input-group-addon:not(:first-child):not(:last-child),
.input-group-btn:not(:first-child):not(:last-child),
.input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0;
}
.input-group-addon,
.input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle;
}
.input-group-addon {
padding: 6px 12px;
font-size: 14px;
font-weight: normal;
line-height: 1;
color: #555555;
text-align: center;
background-color: #eeeeee;
border: 1px solid #ccc;
border-radius: 4px;
}
.input-group-addon.input-sm {
padding: 5px 10px;
font-size: 12px;
border-radius: 3px;
}
.input-group-addon.input-lg {
padding: 10px 16px;
font-size: 18px;
border-radius: 6px;
}
.input-group-addon input[type="radio"],
.input-group-addon input[type="checkbox"] {
margin-top: 0;
}
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.input-group-addon:first-child {
border-right: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child),
.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.input-group-addon:last-child {
border-left: 0;
}
.input-group-btn {
position: relative;
font-size: 0;
white-space: nowrap;
}
.input-group-btn > .btn {
position: relative;
}
.input-group-btn > .btn + .btn {
margin-left: -1px;
}
.input-group-btn > .btn:hover,
.input-group-btn > .btn:focus,
.input-group-btn > .btn:active {
z-index: 2;
}
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group {
margin-right: -1px;
}
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group {
z-index: 2;
margin-left: -1px;
}
.nav {
margin-bottom: 0;
padding-left: 0;
list-style: none;
}
.nav > li {
position: relative;
display: block;
}
.nav > li > a {
position: relative;
display: block;
padding: 10px 15px;
}
.nav > li > a:hover,
.nav > li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.nav > li.disabled > a {
color: #777777;
}
.nav > li.disabled > a:hover,
.nav > li.disabled > a:focus {
color: #777777;
text-decoration: none;
background-color: transparent;
cursor: not-allowed;
}
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus {
background-color: #eeeeee;
border-color: #337ab7;
}
.nav .nav-divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.nav > li > a > img {
max-width: none;
}
.nav-tabs {
border-bottom: 1px solid #ddd;
}
.nav-tabs > li {
float: left;
margin-bottom: -1px;
}
.nav-tabs > li > a {
margin-right: 2px;
line-height: 1.42857143;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
}
.nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #ddd;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
color: #555555;
background-color: #fff;
border: 1px solid #ddd;
border-bottom-color: transparent;
cursor: default;
}
.nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.nav-tabs.nav-justified > li {
float: none;
}
.nav-tabs.nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
.nav-tabs.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs.nav-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border: 1px solid #ddd;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #ddd;
border-radius: 4px 4px 0 0;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border-bottom-color: #fff;
}
}
.nav-pills > li {
float: left;
}
.nav-pills > li > a {
border-radius: 4px;
}
.nav-pills > li + li {
margin-left: 2px;
}
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
color: #fff;
background-color: #337ab7;
}
.nav-stacked > li {
float: none;
}
.nav-stacked > li + li {
margin-top: 2px;
margin-left: 0;
}
.nav-justified {
width: 100%;
}
.nav-justified > li {
float: none;
}
.nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs-justified {
border-bottom: 0;
}
.nav-tabs-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border: 1px solid #ddd;
}
@media (min-width: 768px) {
.nav-tabs-justified > li > a {
border-bottom: 1px solid #ddd;
border-radius: 4px 4px 0 0;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border-bottom-color: #fff;
}
}
.tab-content > .tab-pane {
display: none;
}
.tab-content > .active {
display: block;
}
.nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.navbar {
position: relative;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent;
}
@media (min-width: 768px) {
.navbar {
border-radius: 4px;
}
}
@media (min-width: 768px) {
.navbar-header {
float: left;
}
}
.navbar-collapse {
overflow-x: visible;
padding-right: 15px;
padding-left: 15px;
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-webkit-overflow-scrolling: touch;
}
.navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
.navbar-collapse {
width: auto;
border-top: 0;
box-shadow: none;
}
.navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.navbar-collapse.in {
overflow-y: visible;
}
.navbar-fixed-top .navbar-collapse,
.navbar-static-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
padding-left: 0;
padding-right: 0;
}
}
.navbar-fixed-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
max-height: 340px;
}
@media (max-device-width: 480px) and (orientation: landscape) {
.navbar-fixed-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
max-height: 200px;
}
}
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: 0;
margin-left: 0;
}
}
.navbar-static-top {
z-index: 1000;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.navbar-static-top {
border-radius: 0;
}
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
}
@media (min-width: 768px) {
.navbar-fixed-top,
.navbar-fixed-bottom {
border-radius: 0;
}
}
.navbar-fixed-top {
top: 0;
border-width: 0 0 1px;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
border-width: 1px 0 0;
}
.navbar-brand {
float: left;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
height: 50px;
}
.navbar-brand:hover,
.navbar-brand:focus {
text-decoration: none;
}
.navbar-brand > img {
display: block;
}
@media (min-width: 768px) {
.navbar > .container .navbar-brand,
.navbar > .container-fluid .navbar-brand {
margin-left: -15px;
}
}
.navbar-toggle {
position: relative;
float: right;
margin-right: 15px;
padding: 9px 10px;
margin-top: 8px;
margin-bottom: 8px;
background-color: transparent;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.navbar-toggle:focus {
outline: 0;
}
.navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
}
.navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
@media (min-width: 768px) {
.navbar-toggle {
display: none;
}
}
.navbar-nav {
margin: 7.5px -15px;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
}
@media (max-width: 767px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none;
}
.navbar-nav .open .dropdown-menu > li > a,
.navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px;
}
.navbar-nav .open .dropdown-menu > li > a {
line-height: 20px;
}
.navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-nav .open .dropdown-menu > li > a:focus {
background-image: none;
}
}
@media (min-width: 768px) {
.navbar-nav {
float: left;
margin: 0;
}
.navbar-nav > li {
float: left;
}
.navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
}
.navbar-form {
margin-left: -15px;
margin-right: -15px;
padding: 10px 15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
margin-top: 8px;
margin-bottom: 8px;
}
@media (min-width: 768px) {
.navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
.navbar-form .form-control-static {
display: inline-block;
}
.navbar-form .input-group {
display: inline-table;
vertical-align: middle;
}
.navbar-form .input-group .input-group-addon,
.navbar-form .input-group .input-group-btn,
.navbar-form .input-group .form-control {
width: auto;
}
.navbar-form .input-group > .form-control {
width: 100%;
}
.navbar-form .control-label {
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .radio,
.navbar-form .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .radio label,
.navbar-form .checkbox label {
padding-left: 0;
}
.navbar-form .radio input[type="radio"],
.navbar-form .checkbox input[type="checkbox"] {
position: relative;
margin-left: 0;
}
.navbar-form .has-feedback .form-control-feedback {
top: 0;
}
}
@media (max-width: 767px) {
.navbar-form .form-group {
margin-bottom: 5px;
}
.navbar-form .form-group:last-child {
margin-bottom: 0;
}
}
@media (min-width: 768px) {
.navbar-form {
width: auto;
border: 0;
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
box-shadow: none;
}
}
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
margin-bottom: 0;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.navbar-btn {
margin-top: 8px;
margin-bottom: 8px;
}
.navbar-btn.btn-sm {
margin-top: 10px;
margin-bottom: 10px;
}
.navbar-btn.btn-xs {
margin-top: 14px;
margin-bottom: 14px;
}
.navbar-text {
margin-top: 15px;
margin-bottom: 15px;
}
@media (min-width: 768px) {
.navbar-text {
float: left;
margin-left: 15px;
margin-right: 15px;
}
}
@media (min-width: 768px) {
.navbar-left {
float: left !important;
}
.navbar-right {
float: right !important;
margin-right: -15px;
}
.navbar-right ~ .navbar-right {
margin-right: 0;
}
}
.navbar-default {
background-color: #f8f8f8;
border-color: #e7e7e7;
}
.navbar-default .navbar-brand {
color: #777;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #5e5e5e;
background-color: transparent;
}
.navbar-default .navbar-text {
color: #777;
}
.navbar-default .navbar-nav > li > a {
color: #777;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #333;
background-color: transparent;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav > .disabled > a,
.navbar-default .navbar-nav > .disabled > a:hover,
.navbar-default .navbar-nav > .disabled > a:focus {
color: #ccc;
background-color: transparent;
}
.navbar-default .navbar-toggle {
border-color: #ddd;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #ddd;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #888;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #e7e7e7;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
background-color: #e7e7e7;
color: #555;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #333;
background-color: transparent;
}
.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: #555;
background-color: #e7e7e7;
}
.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: #ccc;
background-color: transparent;
}
}
.navbar-default .navbar-link {
color: #777;
}
.navbar-default .navbar-link:hover {
color: #333;
}
.navbar-default .btn-link {
color: #777;
}
.navbar-default .btn-link:hover,
.navbar-default .btn-link:focus {
color: #333;
}
.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: #ccc;
}
.navbar-inverse {
background-color: #222;
border-color: #080808;
}
.navbar-inverse .navbar-brand {
color: #9d9d9d;
}
.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus {
color: #fff;
background-color: transparent;
}
.navbar-inverse .navbar-text {
color: #9d9d9d;
}
.navbar-inverse .navbar-nav > li > a {
color: #9d9d9d;
}
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
color: #fff;
background-color: transparent;
}
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
color: #fff;
background-color: #080808;
}
.navbar-inverse .navbar-nav > .disabled > a,
.navbar-inverse .navbar-nav > .disabled > a:hover,
.navbar-inverse .navbar-nav > .disabled > a:focus {
color: #444;
background-color: transparent;
}
.navbar-inverse .navbar-toggle {
border-color: #333;
}
.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
background-color: #333;
}
.navbar-inverse .navbar-toggle .icon-bar {
background-color: #fff;
}
.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
border-color: #101010;
}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
background-color: #080808;
color: #fff;
}
@media (max-width: 767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu .divider {
background-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #9d9d9d;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #fff;
background-color: transparent;
}
.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: #080808;
}
.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: #444;
background-color: transparent;
}
}
.navbar-inverse .navbar-link {
color: #9d9d9d;
}
.navbar-inverse .navbar-link:hover {
color: #fff;
}
.navbar-inverse .btn-link {
color: #9d9d9d;
}
.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: #444;
}
.breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;
}
.breadcrumb > li {
display: inline-block;
}
.breadcrumb > li + li:before {
content: "/\00a0";
padding: 0 5px;
color: #ccc;
}
.breadcrumb > .active {
color: #777777;
}
.pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
}
.pagination > li {
display: inline;
}
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
line-height: 1.42857143;
text-decoration: none;
color: #337ab7;
background-color: #fff;
border: 1px solid #ddd;
margin-left: -1px;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
}
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination > li > a:focus,
.pagination > li > span:focus {
z-index: 2;
color: #23527c;
background-color: #eeeeee;
border-color: #ddd;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
z-index: 3;
color: #fff;
background-color: #337ab7;
border-color: #337ab7;
cursor: default;
}
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
color: #777777;
background-color: #fff;
border-color: #ddd;
cursor: not-allowed;
}
.pagination-lg > li > a,
.pagination-lg > li > span {
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
}
.pagination-lg > li:first-child > a,
.pagination-lg > li:first-child > span {
border-bottom-left-radius: 6px;
border-top-left-radius: 6px;
}
.pagination-lg > li:last-child > a,
.pagination-lg > li:last-child > span {
border-bottom-right-radius: 6px;
border-top-right-radius: 6px;
}
.pagination-sm > li > a,
.pagination-sm > li > span {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
}
.pagination-sm > li:first-child > a,
.pagination-sm > li:first-child > span {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.pagination-sm > li:last-child > a,
.pagination-sm > li:last-child > span {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.pager {
padding-left: 0;
margin: 20px 0;
list-style: none;
text-align: center;
}
.pager li {
display: inline;
}
.pager li > a,
.pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 15px;
}
.pager li > a:hover,
.pager li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.pager .next > a,
.pager .next > span {
float: right;
}
.pager .previous > a,
.pager .previous > span {
float: left;
}
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
color: #777777;
background-color: #fff;
cursor: not-allowed;
}
.label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
a.label:hover,
a.label:focus {
color: #fff;
text-decoration: none;
cursor: pointer;
}
.label:empty {
display: none;
}
.btn .label {
position: relative;
top: -1px;
}
.label-default {
background-color: #777777;
}
.label-default[href]:hover,
.label-default[href]:focus {
background-color: #5e5e5e;
}
.label-primary {
background-color: #337ab7;
}
.label-primary[href]:hover,
.label-primary[href]:focus {
background-color: #286090;
}
.label-success {
background-color: #5cb85c;
}
.label-success[href]:hover,
.label-success[href]:focus {
background-color: #449d44;
}
.label-info {
background-color: #5bc0de;
}
.label-info[href]:hover,
.label-info[href]:focus {
background-color: #31b0d5;
}
.label-warning {
background-color: #f0ad4e;
}
.label-warning[href]:hover,
.label-warning[href]:focus {
background-color: #ec971f;
}
.label-danger {
background-color: #d9534f;
}
.label-danger[href]:hover,
.label-danger[href]:focus {
background-color: #c9302c;
}
.badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
color: #fff;
line-height: 1;
vertical-align: middle;
white-space: nowrap;
text-align: center;
background-color: #777777;
border-radius: 10px;
}
.badge:empty {
display: none;
}
.btn .badge {
position: relative;
top: -1px;
}
.btn-xs .badge,
.btn-group-xs > .btn .badge {
top: 0;
padding: 1px 5px;
}
a.badge:hover,
a.badge:focus {
color: #fff;
text-decoration: none;
cursor: pointer;
}
.list-group-item.active > .badge,
.nav-pills > .active > a > .badge {
color: #337ab7;
background-color: #fff;
}
.list-group-item > .badge {
float: right;
}
.list-group-item > .badge + .badge {
margin-right: 5px;
}
.nav-pills > li > a > .badge {
margin-left: 3px;
}
.jumbotron {
padding-top: 30px;
padding-bottom: 30px;
margin-bottom: 30px;
color: inherit;
background-color: #eeeeee;
}
.jumbotron h1,
.jumbotron .h1 {
color: inherit;
}
.jumbotron p {
margin-bottom: 15px;
font-size: 21px;
font-weight: 200;
}
.jumbotron > hr {
border-top-color: #d5d5d5;
}
.container .jumbotron,
.container-fluid .jumbotron {
border-radius: 6px;
padding-left: 15px;
padding-right: 15px;
}
.jumbotron .container {
max-width: 100%;
}
@media screen and (min-width: 768px) {
.jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .jumbotron,
.container-fluid .jumbotron {
padding-left: 60px;
padding-right: 60px;
}
.jumbotron h1,
.jumbotron .h1 {
font-size: 63px;
}
}
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
transition: border 0.2s ease-in-out;
}
.thumbnail > img,
.thumbnail a > img {
margin-left: auto;
margin-right: auto;
}
a.thumbnail:hover,
a.thumbnail:focus,
a.thumbnail.active {
border-color: #337ab7;
}
.thumbnail .caption {
padding: 9px;
color: #333333;
}
.alert {
padding: 19px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.alert h4 {
margin-top: 0;
color: inherit;
}
.alert .alert-link {
font-weight: bold;
}
.alert > p,
.alert > ul {
margin-bottom: 0;
}
.alert > p + p {
margin-top: 5px;
}
.alert-dismissable,
.alert-dismissible {
padding-right: 39px;
}
.alert-dismissable .close,
.alert-dismissible .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #3c763d;
}
.alert-success hr {
border-top-color: #c9e2b3;
}
.alert-success .alert-link {
color: #2b542c;
}
.alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #31708f;
}
.alert-info hr {
border-top-color: #a6e1ec;
}
.alert-info .alert-link {
color: #245269;
}
.alert-warning {
background-color: #fcf8e3;
border-color: #faebcc;
color: #8a6d3b;
}
.alert-warning hr {
border-top-color: #f7e1b5;
}
.alert-warning .alert-link {
color: #66512c;
}
.alert-danger {
background-color: #f2dede;
border-color: #ebccd1;
color: #a94442;
}
.alert-danger hr {
border-top-color: #e4b9c0;
}
.alert-danger .alert-link {
color: #843534;
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.progress {
overflow: hidden;
height: 20px;
margin-bottom: 20px;
background-color: #f5f5f5;
border-radius: 4px;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
.progress-bar {
float: left;
width: 0%;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #fff;
text-align: center;
background-color: #337ab7;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
transition: width 0.6s ease;
}
.progress-striped .progress-bar,
.progress-bar-striped {
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-size: 40px 40px;
}
.progress.active .progress-bar,
.progress-bar.active {
-webkit-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
.progress-bar-success {
background-color: #5cb85c;
}
.progress-striped .progress-bar-success {
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-info {
background-color: #5bc0de;
}
.progress-striped .progress-bar-info {
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-warning {
background-color: #f0ad4e;
}
.progress-striped .progress-bar-warning {
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-danger {
background-color: #d9534f;
}
.progress-striped .progress-bar-danger {
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.media {
margin-top: 15px;
}
.media:first-child {
margin-top: 0;
}
.media,
.media-body {
zoom: 1;
overflow: hidden;
}
.media-body {
width: 10000px;
}
.media-object {
display: block;
}
.media-object.img-thumbnail {
max-width: none;
}
.media-right,
.media > .pull-right {
padding-left: 10px;
}
.media-left,
.media > .pull-left {
padding-right: 10px;
}
.media-left,
.media-right,
.media-body {
display: table-cell;
vertical-align: top;
}
.media-middle {
vertical-align: middle;
}
.media-bottom {
vertical-align: bottom;
}
.media-heading {
margin-top: 0;
margin-bottom: 5px;
}
.media-list {
padding-left: 0;
list-style: none;
}
.list-group {
margin-bottom: 20px;
padding-left: 0;
}
.list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #fff;
border: 1px solid #ddd;
}
.list-group-item:first-child {
border-top-right-radius: 4px;
border-top-left-radius: 4px;
}
.list-group-item:last-child {
margin-bottom: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
a.list-group-item,
button.list-group-item {
color: #555;
}
a.list-group-item .list-group-item-heading,
button.list-group-item .list-group-item-heading {
color: #333;
}
a.list-group-item:hover,
button.list-group-item:hover,
a.list-group-item:focus,
button.list-group-item:focus {
text-decoration: none;
color: #555;
background-color: #f5f5f5;
}
button.list-group-item {
width: 100%;
text-align: left;
}
.list-group-item.disabled,
.list-group-item.disabled:hover,
.list-group-item.disabled:focus {
background-color: #eeeeee;
color: #777777;
cursor: not-allowed;
}
.list-group-item.disabled .list-group-item-heading,
.list-group-item.disabled:hover .list-group-item-heading,
.list-group-item.disabled:focus .list-group-item-heading {
color: inherit;
}
.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: #777777;
}
.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
z-index: 2;
color: #fff;
background-color: #337ab7;
border-color: #337ab7;
}
.list-group-item.active .list-group-item-heading,
.list-group-item.active:hover .list-group-item-heading,
.list-group-item.active:focus .list-group-item-heading,
.list-group-item.active .list-group-item-heading > small,
.list-group-item.active:hover .list-group-item-heading > small,
.list-group-item.active:focus .list-group-item-heading > small,
.list-group-item.active .list-group-item-heading > .small,
.list-group-item.active:hover .list-group-item-heading > .small,
.list-group-item.active:focus .list-group-item-heading > .small {
color: inherit;
}
.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: #c7ddef;
}
.list-group-item-success {
color: #3c763d;
background-color: #dff0d8;
}
a.list-group-item-success,
button.list-group-item-success {
color: #3c763d;
}
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: #3c763d;
background-color: #d0e9c6;
}
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: #3c763d;
border-color: #3c763d;
}
.list-group-item-info {
color: #31708f;
background-color: #d9edf7;
}
a.list-group-item-info,
button.list-group-item-info {
color: #31708f;
}
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: #31708f;
background-color: #c4e3f3;
}
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: #31708f;
border-color: #31708f;
}
.list-group-item-warning {
color: #8a6d3b;
background-color: #fcf8e3;
}
a.list-group-item-warning,
button.list-group-item-warning {
color: #8a6d3b;
}
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: #8a6d3b;
background-color: #faf2cc;
}
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: #8a6d3b;
border-color: #8a6d3b;
}
.list-group-item-danger {
color: #a94442;
background-color: #f2dede;
}
a.list-group-item-danger,
button.list-group-item-danger {
color: #a94442;
}
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: #a94442;
background-color: #ebcccc;
}
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: #a94442;
border-color: #a94442;
}
.list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}
.panel {
margin-bottom: 20px;
background-color: #fff;
border: 1px solid transparent;
border-radius: 4px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.panel-body {
padding: 15px;
}
.panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.panel-heading > .dropdown .dropdown-toggle {
color: inherit;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit;
}
.panel-title > a,
.panel-title > small,
.panel-title > .small,
.panel-title > small > a,
.panel-title > .small > a {
color: inherit;
}
.panel-footer {
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel > .list-group,
.panel > .panel-collapse > .list-group {
margin-bottom: 0;
}
.panel > .list-group .list-group-item,
.panel > .panel-collapse > .list-group .list-group-item {
border-width: 1px 0;
border-radius: 0;
}
.panel > .list-group:first-child .list-group-item:first-child,
.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
border-top: 0;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.panel > .list-group:last-child .list-group-item:last-child,
.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
border-bottom: 0;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0;
}
.list-group + .panel-footer {
border-top-width: 0;
}
.panel > .table,
.panel > .table-responsive > .table,
.panel > .panel-collapse > .table {
margin-bottom: 0;
}
.panel > .table caption,
.panel > .table-responsive > .table caption,
.panel > .panel-collapse > .table caption {
padding-left: 15px;
padding-right: 15px;
}
.panel > .table:first-child,
.panel > .table-responsive:first-child > .table:first-child {
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
border-top-left-radius: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
border-top-right-radius: 3px;
}
.panel > .table:last-child,
.panel > .table-responsive:last-child > .table:last-child {
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
border-bottom-left-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
border-bottom-right-radius: 3px;
}
.panel > .panel-body + .table,
.panel > .panel-body + .table-responsive,
.panel > .table + .panel-body,
.panel > .table-responsive + .panel-body {
border-top: 1px solid #ddd;
}
.panel > .table > tbody:first-child > tr:first-child th,
.panel > .table > tbody:first-child > tr:first-child td {
border-top: 0;
}
.panel > .table-bordered,
.panel > .table-responsive > .table-bordered {
border: 0;
}
.panel > .table-bordered > thead > tr > th:first-child,
.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
.panel > .table-bordered > tbody > tr > th:first-child,
.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
.panel > .table-bordered > tfoot > tr > th:first-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.panel > .table-bordered > thead > tr > td:first-child,
.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
.panel > .table-bordered > tbody > tr > td:first-child,
.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
.panel > .table-bordered > tfoot > tr > td:first-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.panel > .table-bordered > thead > tr > th:last-child,
.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
.panel > .table-bordered > tbody > tr > th:last-child,
.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
.panel > .table-bordered > tfoot > tr > th:last-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.panel > .table-bordered > thead > tr > td:last-child,
.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
.panel > .table-bordered > tbody > tr > td:last-child,
.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
.panel > .table-bordered > tfoot > tr > td:last-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.panel > .table-bordered > thead > tr:first-child > td,
.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
.panel > .table-bordered > tbody > tr:first-child > td,
.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
.panel > .table-bordered > thead > tr:first-child > th,
.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
.panel > .table-bordered > tbody > tr:first-child > th,
.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
border-bottom: 0;
}
.panel > .table-bordered > tbody > tr:last-child > td,
.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
.panel > .table-bordered > tfoot > tr:last-child > td,
.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
.panel > .table-bordered > tbody > tr:last-child > th,
.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
.panel > .table-bordered > tfoot > tr:last-child > th,
.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
border-bottom: 0;
}
.panel > .table-responsive {
border: 0;
margin-bottom: 0;
}
.panel-group {
margin-bottom: 20px;
}
.panel-group .panel {
margin-bottom: 0;
border-radius: 4px;
}
.panel-group .panel + .panel {
margin-top: 5px;
}
.panel-group .panel-heading {
border-bottom: 0;
}
.panel-group .panel-heading + .panel-collapse > .panel-body,
.panel-group .panel-heading + .panel-collapse > .list-group {
border-top: 1px solid #ddd;
}
.panel-group .panel-footer {
border-top: 0;
}
.panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #ddd;
}
.panel-default {
border-color: #ddd;
}
.panel-default > .panel-heading {
color: #333333;
background-color: #f5f5f5;
border-color: #ddd;
}
.panel-default > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #ddd;
}
.panel-default > .panel-heading .badge {
color: #f5f5f5;
background-color: #333333;
}
.panel-default > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #ddd;
}
.panel-primary {
border-color: #337ab7;
}
.panel-primary > .panel-heading {
color: #fff;
background-color: #337ab7;
border-color: #337ab7;
}
.panel-primary > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #337ab7;
}
.panel-primary > .panel-heading .badge {
color: #337ab7;
background-color: #fff;
}
.panel-primary > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #337ab7;
}
.panel-success {
border-color: #d6e9c6;
}
.panel-success > .panel-heading {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.panel-success > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #d6e9c6;
}
.panel-success > .panel-heading .badge {
color: #dff0d8;
background-color: #3c763d;
}
.panel-success > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #d6e9c6;
}
.panel-info {
border-color: #bce8f1;
}
.panel-info > .panel-heading {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;
}
.panel-info > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #bce8f1;
}
.panel-info > .panel-heading .badge {
color: #d9edf7;
background-color: #31708f;
}
.panel-info > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #bce8f1;
}
.panel-warning {
border-color: #faebcc;
}
.panel-warning > .panel-heading {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
.panel-warning > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #faebcc;
}
.panel-warning > .panel-heading .badge {
color: #fcf8e3;
background-color: #8a6d3b;
}
.panel-warning > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #faebcc;
}
.panel-danger {
border-color: #ebccd1;
}
.panel-danger > .panel-heading {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
.panel-danger > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #ebccd1;
}
.panel-danger > .panel-heading .badge {
color: #f2dede;
background-color: #a94442;
}
.panel-danger > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #ebccd1;
}
.embed-responsive {
position: relative;
display: block;
height: 0;
padding: 0;
overflow: hidden;
}
.embed-responsive .embed-responsive-item,
.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
position: absolute;
top: 0;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
border: 0;
}
.embed-responsive-16by9 {
padding-bottom: 56.25%;
}
.embed-responsive-4by3 {
padding-bottom: 75%;
}
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, 0.15);
}
.well-lg {
padding: 24px;
border-radius: 6px;
}
.well-sm {
padding: 9px;
border-radius: 3px;
}
.close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000;
text-shadow: 0 1px 0 #fff;
opacity: 0.2;
filter: alpha(opacity=20);
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
}
button.close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.modal-open {
overflow: hidden;
}
.modal {
display: none;
overflow: hidden;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
-webkit-overflow-scrolling: touch;
outline: 0;
}
.modal.fade .modal-dialog {
-webkit-transform: translate(0, -25%);
transform: translate(0, -25%);
transition: -webkit-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
}
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}
.modal-dialog {
position: relative;
width: auto;
margin: 10px;
}
.modal-content {
position: relative;
background-color: #fff;
border: 1px solid #999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
background-clip: padding-box;
outline: 0;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000;
}
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0);
}
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50);
}
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.42857143;
}
.modal-body {
position: relative;
padding: 15px;
}
.modal-footer {
padding: 15px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer .btn + .btn {
margin-left: 5px;
margin-bottom: 0;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
.modal-scrollbar-measure {
position: absolute;
top: -9999px;
width: 50px;
height: 50px;
overflow: scroll;
}
@media (min-width: 768px) {
.modal-dialog {
width: 600px;
margin: 30px auto;
}
.modal-content {
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
.modal-sm {
width: 300px;
}
}
@media (min-width: 992px) {
.modal-lg {
width: 900px;
}
}
.tooltip {
position: absolute;
z-index: 1070;
display: block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-style: normal;
font-weight: normal;
letter-spacing: normal;
line-break: auto;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
white-space: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
font-size: 12px;
opacity: 0;
filter: alpha(opacity=0);
}
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90);
}
.tooltip.top {
margin-top: -3px;
padding: 5px 0;
}
.tooltip.right {
margin-left: 3px;
padding: 0 5px;
}
.tooltip.bottom {
margin-top: 3px;
padding: 5px 0;
}
.tooltip.left {
margin-left: -3px;
padding: 0 5px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #fff;
text-align: center;
background-color: #000;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000;
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
right: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000;
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
left: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
right: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
left: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000;
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1060;
display: none;
max-width: 276px;
padding: 1px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-style: normal;
font-weight: normal;
letter-spacing: normal;
line-break: auto;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
white-space: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
font-size: 14px;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
margin: 0;
padding: 8px 14px;
font-size: 14px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0;
}
.popover-content {
padding: 9px 14px;
}
.popover > .arrow,
.popover > .arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.popover > .arrow {
border-width: 11px;
}
.popover > .arrow:after {
border-width: 10px;
content: "";
}
.popover.top > .arrow {
left: 50%;
margin-left: -11px;
border-bottom-width: 0;
border-top-color: #999999;
border-top-color: rgba(0, 0, 0, 0.25);
bottom: -11px;
}
.popover.top > .arrow:after {
content: " ";
bottom: 1px;
margin-left: -10px;
border-bottom-width: 0;
border-top-color: #fff;
}
.popover.right > .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-left-width: 0;
border-right-color: #999999;
border-right-color: rgba(0, 0, 0, 0.25);
}
.popover.right > .arrow:after {
content: " ";
left: 1px;
bottom: -10px;
border-left-width: 0;
border-right-color: #fff;
}
.popover.bottom > .arrow {
left: 50%;
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999999;
border-bottom-color: rgba(0, 0, 0, 0.25);
top: -11px;
}
.popover.bottom > .arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
border-top-width: 0;
border-bottom-color: #fff;
}
.popover.left > .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-right-width: 0;
border-left-color: #999999;
border-left-color: rgba(0, 0, 0, 0.25);
}
.popover.left > .arrow:after {
content: " ";
right: 1px;
border-right-width: 0;
border-left-color: #fff;
bottom: -10px;
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
overflow: hidden;
width: 100%;
}
.carousel-inner > .item {
display: none;
position: relative;
transition: 0.6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
line-height: 1;
}
@media all and (transform-3d), (-webkit-transform-3d) {
.carousel-inner > .item {
transition: -webkit-transform 0.6s ease-in-out;
transition: transform 0.6s ease-in-out;
transition: transform 0.6s ease-in-out, -webkit-transform 0.6s ease-in-out;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-perspective: 1000px;
perspective: 1000px;
}
.carousel-inner > .item.next,
.carousel-inner > .item.active.right {
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
left: 0;
}
.carousel-inner > .item.prev,
.carousel-inner > .item.active.left {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
left: 0;
}
.carousel-inner > .item.next.left,
.carousel-inner > .item.prev.right,
.carousel-inner > .item.active {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
left: 0;
}
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 15%;
opacity: 0.5;
filter: alpha(opacity=50);
font-size: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
background-color: rgba(0, 0, 0, 0);
}
.carousel-control.left {
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
}
.carousel-control.right {
left: auto;
right: 0;
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
}
.carousel-control:hover,
.carousel-control:focus {
outline: 0;
color: #fff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
margin-top: -10px;
z-index: 5;
display: inline-block;
}
.carousel-control .icon-prev,
.carousel-control .glyphicon-chevron-left {
left: 50%;
margin-left: -10px;
}
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-right {
right: 50%;
margin-right: -10px;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
line-height: 1;
font-family: serif;
}
.carousel-control .icon-prev:before {
content: '\2039';
}
.carousel-control .icon-next:before {
content: '\203a';
}
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
margin-left: -30%;
padding-left: 0;
list-style: none;
text-align: center;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
border: 1px solid #fff;
border-radius: 10px;
cursor: pointer;
background-color: #000 \9;
background-color: rgba(0, 0, 0, 0);
}
.carousel-indicators .active {
margin: 0;
width: 12px;
height: 12px;
background-color: #fff;
}
.carousel-caption {
position: absolute;
left: 15%;
right: 15%;
bottom: 20px;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-caption .btn {
text-shadow: none;
}
@media screen and (min-width: 768px) {
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -10px;
font-size: 30px;
}
.carousel-control .glyphicon-chevron-left,
.carousel-control .icon-prev {
margin-left: -10px;
}
.carousel-control .glyphicon-chevron-right,
.carousel-control .icon-next {
margin-right: -10px;
}
.carousel-caption {
left: 20%;
right: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}
}
.clearfix:before,
.clearfix:after,
.dl-horizontal dd:before,
.dl-horizontal dd:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after,
.form-horizontal .form-group:before,
.form-horizontal .form-group:after,
.btn-toolbar:before,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after,
.nav:before,
.nav:after,
.navbar:before,
.navbar:after,
.navbar-header:before,
.navbar-header:after,
.navbar-collapse:before,
.navbar-collapse:after,
.pager:before,
.pager:after,
.panel-body:before,
.panel-body:after,
.modal-header:before,
.modal-header:after,
.modal-footer:before,
.modal-footer:after {
content: " ";
display: table;
}
.clearfix:after,
.dl-horizontal dd:after,
.container:after,
.container-fluid:after,
.row:after,
.form-horizontal .form-group:after,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:after,
.nav:after,
.navbar:after,
.navbar-header:after,
.navbar-collapse:after,
.pager:after,
.panel-body:after,
.modal-header:after,
.modal-footer:after {
clear: both;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
}
.affix {
position: fixed;
}
@-ms-viewport {
width: device-width;
}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {
display: none !important;
}
.visible-xs-block,
.visible-xs-inline,
.visible-xs-inline-block,
.visible-sm-block,
.visible-sm-inline,
.visible-sm-inline-block,
.visible-md-block,
.visible-md-inline,
.visible-md-inline-block,
.visible-lg-block,
.visible-lg-inline,
.visible-lg-inline-block {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
}
table.visible-xs {
display: table !important;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
@media (max-width: 767px) {
.visible-xs-block {
display: block !important;
}
}
@media (max-width: 767px) {
.visible-xs-inline {
display: inline !important;
}
}
@media (max-width: 767px) {
.visible-xs-inline-block {
display: inline-block !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
table.visible-sm {
display: table !important;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-block {
display: block !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline {
display: inline !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline-block {
display: inline-block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
table.visible-md {
display: table !important;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-block {
display: block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline {
display: inline !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline-block {
display: inline-block !important;
}
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
table.visible-lg {
display: table !important;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-lg-block {
display: block !important;
}
}
@media (min-width: 1200px) {
.visible-lg-inline {
display: inline !important;
}
}
@media (min-width: 1200px) {
.visible-lg-inline-block {
display: inline-block !important;
}
}
@media (max-width: 767px) {
.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-lg {
display: none !important;
}
}
.visible-print {
display: none !important;
}
@media print {
.visible-print {
display: block !important;
}
table.visible-print {
display: table !important;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
}
.visible-print-block {
display: none !important;
}
@media print {
.visible-print-block {
display: block !important;
}
}
.visible-print-inline {
display: none !important;
}
@media print {
.visible-print-inline {
display: inline !important;
}
}
.visible-print-inline-block {
display: none !important;
}
@media print {
.visible-print-inline-block {
display: inline-block !important;
}
}
@media print {
.hidden-print {
display: none !important;
}
}
.hljs-keyword,
.hljs-attribute,
.hljs-selector-tag,
.hljs-meta-keyword,
.hljs-doctag,
.hljs-name {
font-weight: bold;
color: red;
}
.ace_editor {
height: 200px;
}
.myGrid {
width: 500px;
height: 250px;
}
.angular-google-map-container {
height: 400px;
}
.errorMessage {
min-height: 20px;
padding: 19px;
margin-bottom: 19px;
background: lightcoral;
color: white !important;
}
.successMessage {
min-height: 20px;
padding: 19px;
margin-bottom: 19px;
color: white;
background: lightgreen !Important;
}
.strike {
text-decoration: line-through;
}
.bold {
font-weight: bold;
}
.red {
color: red;
}
.has-error {
color: red;
background-color: yellow;
}
.orange {
color: orange;
}
.validation-success {
opacity: 1;
display: block;
position: absolute;
right: -7.2px;
bottom: -7.2px;
font-size: 28.8px;
width: 36px;
height: 36px;
line-height: 36px;
text-align: center;
border-radius: 36px;
color: #62b14c;
transition: all ease-out 0.32s;
}
.validation-success:after {
display: block;
content: '\e013';
font-family: 'Glyphicons Halflings';
}
.validation-success.ng-hide {
transition-delay: 0s;
transition: all ease-out 0.12s;
opacity: 0;
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
.ng-hide-remove li {
opacity: 0;
}
.validation {
color: #fff;
margin: 0;
position: relative;
font-size: 14px;
overflow: visible;
background: #c00640;
}
.validation ul {
display: block;
overflow: hidden;
}
.validation li {
display: block;
line-height: 1;
background: #c00640;
position: absolute;
right: -4px;
top: -20px !important;
text-align: center;
font-weight: bold;
padding: 2px 10px;
color: #fff;
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
transition: all ease-in 0.2s;
opacity: 1;
transition-delay: 0s;
}
.validation li.ng-enter {
opacity: 0;
top: 0;
}
.validation li.ng-leave {
transition: all ease-in 0s;
opacity: 0;
}
*:focus + .validation li {
background-color: #63bff8 !important;
}
input.ng-touched.ng-invalid:not(.ng-valid),
textarea.ng-touched.ng-invalid:not(.ng-valid),
select.ng-touched.ng-invalid:not(.ng-valid) {
border-color: #c00640;
}
input:focus,
input:focus.ng-touched.ng-invalid:not(.ng-valid),
textarea:focus,
textarea:focus.ng-touched.ng-invalid:not(.ng-valid),
select:focus,
select:focus.ng-touched.ng-invalid:not(.ng-valid) {
border-color: #63bff8;
}
input.ng-valid-required.ng-valid:not(.ng-invalid),
textarea.ng-valid-required.ng-valid:not(.ng-invalid),
select.ng-valid-required.ng-valid:not(.ng-invalid) {
border-color: #62b14c;
}
form[class*="ng-invalid"] button.btn {
background: #63bff8;
transition: none;
}
form button.btn {
transition: all ease-in 0.5s;
background: #62b14c;
}
#content-wrapper {
padding-left: 0;
margin-left: 0;
width: 100%;
height: auto;
}
@media only screen and (min-width: 561px) {
#page-wrapper.open {
padding-left: 120px;
}
}
@media only screen and (max-width: 560px) {
#page-wrapper.open {
padding-left: 120px;
}
}
#page-wrapper.open #sidebar-wrapper {
left: 150px;
}
/**
* Hamburg Menu
* When the class of 'hamburg' is applied to the body tag of the document,
* the sidebar changes it's style to attempt to mimic a menu on a phone app,
* where the content is overlaying the content, rather than push it.
*/
@media only screen and (max-width: 560px) {
body.hamburg #page-wrapper {
padding-left: 0;
}
body.hamburg #page-wrapper:not(.open) #sidebar-wrapper {
position: absolute;
}
body.hamburg #page-wrapper:not(.open) ul.sidebar .sidebar-title.separator {
display: none;
}
}
/**
* Header
*/
.row.header {
height: 60px;
background: #fff;
margin-bottom: 15px;
}
.row.header > div:last-child {
padding-right: 0;
}
.row.header .meta .page {
font-size: 17px;
padding-top: 11px;
}
.row.header .meta .breadcrumb-links {
font-size: 10px;
}
.row.header .meta div {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.row.header .login a {
padding: 18px;
display: block;
}
.row.header .user {
min-width: 130px;
}
.row.header .user > .item {
width: 65px;
height: 60px;
float: right;
display: inline-block;
text-align: center;
vertical-align: middle;
}
.row.header .user > .item a {
color: #919191;
display: block;
}
.row.header .user > .item i {
font-size: 20px;
line-height: 55px;
}
.row.header .user > .item img {
width: 40px;
height: 40px;
margin-top: 10px;
border-radius: 2px;
}
.row.header .user > .item ul.dropdown-menu {
border-radius: 2px;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}
.row.header .user > .item ul.dropdown-menu .dropdown-header {
text-align: center;
}
.row.header .user > .item ul.dropdown-menu li.link {
text-align: left;
}
.row.header .user > .item ul.dropdown-menu li.link a {
padding-left: 7px;
padding-right: 7px;
}
.row.header .user > .item ul.dropdown-menu:before {
position: absolute;
top: -7px;
right: 23px;
display: inline-block;
border-right: 7px solid transparent;
border-bottom: 7px solid rgba(0, 0, 0, 0.2);
border-left: 7px solid transparent;
content: '';
}
.row.header .user > .item ul.dropdown-menu:after {
position: absolute;
top: -6px;
right: 24px;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #ffffff;
border-left: 6px solid transparent;
content: '';
}
.loading {
width: 40px;
height: 40px;
position: relative;
margin: 100px auto;
}
.double-bounce1,
.double-bounce2 {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: #333;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
-webkit-animation: bounce 2s infinite ease-in-out;
animation: bounce 2s infinite ease-in-out;
}
.double-bounce2 {
-webkit-animation-delay: -1s;
animation-delay: -1s;
}
@-webkit-keyframes bounce {
0%,
100% {
-webkit-transform: scale(0);
}
50% {
-webkit-transform: scale(1);
}
}
@keyframes bounce {
0%,
100% {
transform: scale(0);
-webkit-transform: scale(0);
}
50% {
transform: scale(1);
-webkit-transform: scale(1);
}
}
/* Fonts */
@font-face {
font-family: "BentonSans", "Helvetica Neue", sans-serif;
src: url('build/fonts/montserrat-regular-webfont.eot');
src: url('../fonts/montserrat-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/montserrat-regular-webfont.woff') format('woff'), url('../fonts/montserrat-regular-webfont.ttf') format('truetype'), url('../fonts/montserrat-regular-webfont.svg#montserratregular') format('svg');
font-weight: normal;
font-style: normal;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
@font-face {
font-family: 'BentonSans';
src: url('../fonts/montserrat-regular-webfont.svg') format('svg');
}
select {
font-family: "BentonSans", "Helvetica Neue", sans-serif;
}
}
/* Base */
html {
overflow-y: scroll;
}
body {
background: #f3f3f3;
font-family: "BentonSans";
color: #333333 !important;
}
.row {
margin-left: 0 !important;
margin-right: 0 !important;
}
.row > div {
margin-bottom: 15px;
}
.alerts-container .alert:last-child {
margin-bottom: 0;
}
#page-wrapper {
padding-left: 0px;
height: 100%;
}
#sidebar-wrapper {
margin-left: -150px;
left: -30px;
width: 250px;
position: fixed;
height: 100%;
z-index: 999;
}
#page-wrapper,
#sidebar-wrapper {
transition: all .4s ease 0s;
}
.green {
background: #23ae89 !important;
}
.blue {
background: #2361ae !important;
}
.orange {
background: #d3a938 !important;
}
.red {
background: #ae2323 !important;
}
.form-group .help-block.form-group-inline-message {
padding-top: 5px;
}
div.input-mask {
padding-top: 7px;
}
/* #592727 RED */
/* #2f5927 GREEN */
/* #30426a BLUE (default)*/
/* Sidebar background color */
/* Sidebar header and footer color */
/* Sidebar title text colour */
/* Sidebar menu item hover color */
/**
* Sidebar
*/
#sidebar-wrapper {
background: #79589F;
}
ul.sidebar .sidebar-main a,
.sidebar-footer,
ul.sidebar .sidebar-list a:hover,
#page-wrapper:not(.open) ul.sidebar .sidebar-title.separator {
/* Sidebar header and footer color */
background: #79589F;
}
ul.sidebar {
position: absolute;
top: 0;
bottom: 0;
padding: 0;
margin: 0;
list-style: none;
text-indent: 20px;
overflow-x: hidden;
overflow-y: auto;
}
ul.sidebar li a {
color: #fff;
display: block;
float: left;
text-decoration: none;
width: 250px;
}
ul.sidebar .sidebar-main {
height: 65px;
}
ul.sidebar .sidebar-main a {
font-size: 18px;
line-height: 60px;
}
ul.sidebar .sidebar-main a:hover {
cursor: pointer;
}
ul.sidebar .sidebar-main .menu-icon {
float: right;
font-size: 18px;
padding-right: 28px;
line-height: 60px;
}
ul.sidebar .sidebar-title {
color: #738bc0;
font-size: 12px;
height: 35px;
line-height: 40px;
text-transform: uppercase;
transition: all .6s ease 0s;
}
ul.sidebar .sidebar-list {
height: 40px;
}
ul.sidebar .sidebar-list a {
text-indent: 25px;
font-size: 15px;
color: #b2bfdc;
line-height: 40px;
}
ul.sidebar .sidebar-list a:hover {
color: #fff;
border-left: 3px solid #e99d1a;
text-indent: 22px;
}
ul.sidebar .sidebar-list a:hover .menu-icon {
text-indent: 25px;
}
ul.sidebar .sidebar-list .menu-icon {
float: right;
padding-right: 29px;
line-height: 40px;
width: 70px;
}
#page-wrapper:not(.open) ul.sidebar {
bottom: 0;
}
#page-wrapper:not(.open) ul.sidebar .sidebar-title {
display: none;
height: 0px;
text-indent: -100px;
}
#page-wrapper:not(.open) ul.sidebar .sidebar-title.separator {
display: block;
height: 2px;
margin: 13px 0;
}
#page-wrapper:not(.open) ul.sidebar .sidebar-list a:hover span {
border-left: 3px solid #e99d1a;
text-indent: 22px;
}
#page-wrapper:not(.open) .sidebar-footer {
display: none;
}
.sidebar-footer {
position: absolute;
height: 40px;
bottom: 0;
width: 100%;
padding: 0;
margin: 0;
transition: all .6s ease 0s;
text-align: center;
}
.sidebar-footer div a {
color: #b2bfdc;
font-size: 12px;
line-height: 43px;
}
.sidebar-footer div a:hover {
color: #ffffff;
text-decoration: none;
}
/* #592727 RED */
/* #2f5927 GREEN */
/* #30426a BLUE (default)*/
/* Sidebar background color */
/* Sidebar header and footer color */
/* Sidebar title text colour */
/* Sidebar menu item hover color */
/**
* Widgets
*/
.widget {
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
background: #ffffff;
border: 1px solid transparent;
border-radius: 2px;
border-color: #e9e9e9;
}
.widget .widget-header .pagination,
.widget .widget-footer .pagination {
margin: 0;
}
.widget .widget-header {
color: #767676;
background-color: #f6f6f6;
padding: 10px 15px;
border-bottom: 1px solid #e9e9e9;
line-height: 30px;
}
.widget .widget-header i {
margin-right: 5px;
}
.widget .widget-body {
padding: 20px;
}
.widget .widget-body table thead {
background: #fafafa;
}
.widget .widget-body table thead * {
font-size: 14px !important;
}
.widget .widget-body table tbody * {
font-size: 13px !important;
}
.widget .widget-body .error {
color: #ff0000;
}
.widget .widget-body button {
margin-left: 5px;
}
.widget .widget-body div.alert {
margin-bottom: 10px;
}
.widget .widget-body.large {
height: 350px;
overflow-y: auto;
}
.widget .widget-body.medium {
height: 250px;
overflow-y: auto;
}
.widget .widget-body.small {
height: 150px;
overflow-y: auto;
}
.widget .widget-body.no-padding {
padding: 0;
}
.widget .widget-body.no-padding .error,
.widget .widget-body.no-padding .message {
padding: 20px;
}
.widget .widget-footer {
border-top: 1px solid #e9e9e9;
padding: 10px;
}
.widget .widget-icon {
background: #79589F;
width: 65px;
height: 65px;
border-radius: 50%;
text-align: center;
vertical-align: middle;
margin-right: 15px;
}
.widget .widget-icon i {
line-height: 66px;
color: #ffffff;
font-size: 30px;
}
.widget .widget-footer {
border-top: 1px solid #e9e9e9;
padding: 10px;
}
.widget .widget-title .pagination,
.widget .widget-footer .pagination {
margin: 0;
}
.widget .widget-content .title {
font-size: 28px;
display: block;
}
body {
font-family: "BentonSans", "Helvetica Neue", sans-serif !important;
}
| {
"content_hash": "788aaac9e4fccfae526f2931c006c64a",
"timestamp": "",
"source": "github",
"line_count": 7262,
"max_line_length": 540,
"avg_line_length": 20.902919305976315,
"alnum_prop": 0.6569563298352404,
"repo_name": "seamusjunior/my-angular-components",
"id": "9c8b77fe453b2de310dc8ceed3aaaa8754664050",
"size": "151965",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".tmp/styles.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "176043"
},
{
"name": "HTML",
"bytes": "69885"
},
{
"name": "JavaScript",
"bytes": "6827383"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<com.hencoder.hencoderpracticedraw4.practice.Practice02ClipPathView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"/> | {
"content_hash": "3dce94abeb101e7246ae69732f376e09",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 126,
"avg_line_length": 62,
"alnum_prop": 0.7701612903225806,
"repo_name": "Ztiany/Repository",
"id": "29117c42cd52366d918dffcd5111080f11d1cddd",
"size": "248",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Android/HenCoderPractice/PracticeDraw4/app/src/main/res/layout/practice_clip_path.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "38608"
},
{
"name": "C++",
"bytes": "52662"
},
{
"name": "CMake",
"bytes": "316"
},
{
"name": "CSS",
"bytes": "28"
},
{
"name": "Groovy",
"bytes": "151193"
},
{
"name": "HTML",
"bytes": "126611"
},
{
"name": "Java",
"bytes": "632743"
},
{
"name": "Kotlin",
"bytes": "81491"
},
{
"name": "Python",
"bytes": "16189"
}
],
"symlink_target": ""
} |
package org.gaurav.webapp.controller;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.gaurav.webapp.biz.DatabaseService;
import org.gaurav.webapp.biz.DeEncrypter;
public class SignUpServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String fName = request.getParameter("fName");
String lName = request.getParameter("lName");
String userName = request.getParameter("userName");
String password = request.getParameter("password");
String email = request.getParameter("email");
String phone = request.getParameter("phone");
String age = request.getParameter("age");
String address = request.getParameter("address");
String pincode = request.getParameter("pincode");
DeEncrypter encrypter= DeEncrypter.getInstance();
DatabaseService dbSvc = new DatabaseService();
PrintWriter out = response.getWriter();
String encryptedPass=encrypter.encrypt(password);
boolean flag = dbSvc.insertData(fName, lName, email, userName,
encryptedPass, phone, age, address, pincode);
if (flag) {
out.print("\n Record is inserted successfully!");
} else {
out.print("\n Record is not inserted, please check the log!");
}
}
}
| {
"content_hash": "877bd8650794783bb0c6c92d7e26ca27",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 71,
"avg_line_length": 32.54347826086956,
"alnum_prop": 0.7661990647962592,
"repo_name": "gauravkr4u/myrepo",
"id": "f32f27166743975c95d7757af8ad7c7710a40ac4",
"size": "1497",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WebApp/src/main/java/org/gaurav/webapp/controller/SignUpServlet.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "1940"
},
{
"name": "Java",
"bytes": "13610"
},
{
"name": "PLSQL",
"bytes": "1366"
}
],
"symlink_target": ""
} |
@extra:ParamConverter
=====================
Usage
-----
The ``@extra:ParamConverter`` annotation calls *converters* to convert request
parameters to objects. These objects are stored as request attributes and so
they can be injected as controller method arguments::
/**
* @extra:Route("/blog/:id")
* @extra:ParamConverter("post", class="SensioBlog:Post")
*/
public function showAction(Post $post)
{
}
Several things happens under the hood:
* The converter tries to get a ``SensioBlog:Post`` object from the request
attributes (request attributes comes from route placeholders -- here
``id``);
* If no ``Post`` object is found, a ``404`` Response is generated;
* If a ``Post`` object is found, a new ``post`` request attribute is defined
(accessible via ``$request->attributes->get('post')``);
* As for any other request attribute, it is automatically injected in the
controller when present in the method signature.
If you use type hinting as in the example above, you can even omit the
``@extra:ParamConverter`` annotation altogether::
// automatic with method signature
public function showAction(Post $post)
{
}
Built-in Converters
-------------------
The bundle has only one built-in converter, the Doctrine one.
Creating a Converter
--------------------
All converters must implement the
:class:`Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterInterface`::
namespace Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface;
use Symfony\Component\HttpFoundation\Request;
interface ParamConverterInterface
{
function apply(Request $request, ConfigurationInterface $configuration);
function supports(ConfigurationInterface $configuration);
}
The ``supports()`` method must return ``true`` when it is able to convert the
given configuration (a ``ParamConverter`` instance).
The ``ParamConverter`` instance has three information about the annotation:
* ``name``: The attribute name;
* ``class``: The attribute class name (can be any string representing a class
name);
* ``options``: An array of options
The ``apply()`` method is called whenever a configuration is supported. Based
on the request attributes, it should set an attribute named
``$configuration->getName()``, which stores an object of class
``$configuration->getClass()``.
.. tip::
Use the ``DoctrineConverter`` class as a template for your own converters.
| {
"content_hash": "50a5d1714f1792702e1c090103a862ea",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 97,
"avg_line_length": 31.8875,
"alnum_prop": 0.7185417483339867,
"repo_name": "orchestra-io/sample-symfony2",
"id": "4e321bace71402dafd3f5b503cbadaa17b3d997c",
"size": "2551",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "vendor/bundles/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/converters.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "42231"
},
{
"name": "Shell",
"bytes": "2330"
}
],
"symlink_target": ""
} |
import React from 'react';
import {IndexRoute, Route} from 'react-router';
// Layouts
import Page from './components/layout/page';
// Pages
import Home from './pages/home'
import About from './pages/about'
import NoMatch from './pages/no_match'
import FilterableTimetrackingTable from './pages/report'
// Routes
export const routes = (
<Route path="/" component={Page}>
<IndexRoute components={{pageContent: Home}}/>
<Route path="/about" components={{pageContent: About}}/>
<Route path="/report" components={{pageContent: FilterableTimetrackingTable}}/>
<Route path="*" components={{pageContent: NoMatch}}/>
</Route>
);
| {
"content_hash": "75e09ce425aa05e9e325df5dd54b6bb5",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 85,
"avg_line_length": 31.19047619047619,
"alnum_prop": 0.6900763358778625,
"repo_name": "AlbinOS/book-keeper-ui",
"id": "4595ba4afcdb8f9333a99cbf59d6e530d58145c2",
"size": "655",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/routes.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "57"
},
{
"name": "HTML",
"bytes": "628"
},
{
"name": "JavaScript",
"bytes": "7755"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.