text stringlengths 2 1.04M | meta dict |
|---|---|
import copy
import datetime
from django.conf import settings
from django.core.exceptions import FieldError
from django.db.backends import utils as backend_utils
from django.db.models import fields
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import refs_aggregate
from django.utils import timezone
from django.utils.functional import cached_property
class CombinableMixin(object):
"""
Provides the ability to combine one or two objects with
some connector. For example F('foo') + F('bar').
"""
# Arithmetic connectors
ADD = '+'
SUB = '-'
MUL = '*'
DIV = '/'
POW = '^'
# The following is a quoted % operator - it is quoted because it can be
# used in strings that also have parameter substitution.
MOD = '%%'
# Bitwise operators - note that these are generated by .bitand()
# and .bitor(), the '&' and '|' are reserved for boolean operator
# usage.
BITAND = '&'
BITOR = '|'
def _combine(self, other, connector, reversed, node=None):
if not hasattr(other, 'resolve_expression'):
# everything must be resolvable to an expression
if isinstance(other, datetime.timedelta):
other = DurationValue(other, output_field=fields.DurationField())
else:
other = Value(other)
if reversed:
return Expression(other, connector, self)
return Expression(self, connector, other)
#############
# OPERATORS #
#############
def __add__(self, other):
return self._combine(other, self.ADD, False)
def __sub__(self, other):
return self._combine(other, self.SUB, False)
def __mul__(self, other):
return self._combine(other, self.MUL, False)
def __truediv__(self, other):
return self._combine(other, self.DIV, False)
def __div__(self, other): # Python 2 compatibility
return type(self).__truediv__(self, other)
def __mod__(self, other):
return self._combine(other, self.MOD, False)
def __pow__(self, other):
return self._combine(other, self.POW, False)
def __and__(self, other):
raise NotImplementedError(
"Use .bitand() and .bitor() for bitwise logical operations."
)
def bitand(self, other):
return self._combine(other, self.BITAND, False)
def __or__(self, other):
raise NotImplementedError(
"Use .bitand() and .bitor() for bitwise logical operations."
)
def bitor(self, other):
return self._combine(other, self.BITOR, False)
def __radd__(self, other):
return self._combine(other, self.ADD, True)
def __rsub__(self, other):
return self._combine(other, self.SUB, True)
def __rmul__(self, other):
return self._combine(other, self.MUL, True)
def __rtruediv__(self, other):
return self._combine(other, self.DIV, True)
def __rdiv__(self, other): # Python 2 compatibility
return type(self).__rtruediv__(self, other)
def __rmod__(self, other):
return self._combine(other, self.MOD, True)
def __rpow__(self, other):
return self._combine(other, self.POW, True)
def __rand__(self, other):
raise NotImplementedError(
"Use .bitand() and .bitor() for bitwise logical operations."
)
def __ror__(self, other):
raise NotImplementedError(
"Use .bitand() and .bitor() for bitwise logical operations."
)
class ExpressionNode(CombinableMixin):
"""
Base class for all query expressions.
"""
# aggregate specific fields
is_summary = False
def get_db_converters(self, connection):
return [self.convert_value]
def __init__(self, output_field=None):
self._output_field = output_field
def get_source_expressions(self):
return []
def set_source_expressions(self, exprs):
assert len(exprs) == 0
def as_sql(self, compiler, connection):
"""
Responsible for returning a (sql, [params]) tuple to be included
in the current query.
Different backends can provide their own implementation, by
providing an `as_{vendor}` method and patching the Expression:
```
def override_as_sql(self, compiler, connection):
# custom logic
return super(ExpressionNode, self).as_sql(compiler, connection)
setattr(ExpressionNode, 'as_' + connection.vendor, override_as_sql)
```
Arguments:
* compiler: the query compiler responsible for generating the query.
Must have a compile method, returning a (sql, [params]) tuple.
Calling compiler(value) will return a quoted `value`.
* connection: the database connection used for the current query.
Returns: (sql, params)
Where `sql` is a string containing ordered sql parameters to be
replaced with the elements of the list `params`.
"""
raise NotImplementedError("Subclasses must implement as_sql()")
@cached_property
def contains_aggregate(self):
for expr in self.get_source_expressions():
if expr and expr.contains_aggregate:
return True
return False
def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False):
"""
Provides the chance to do any preprocessing or validation before being
added to the query.
Arguments:
* query: the backend query implementation
* allow_joins: boolean allowing or denying use of joins
in this query
* reuse: a set of reusable joins for multijoins
* summarize: a terminal aggregate clause
Returns: an ExpressionNode to be added to the query.
"""
c = self.copy()
c.is_summary = summarize
return c
def _prepare(self):
"""
Hook used by Field.get_prep_lookup() to do custom preparation.
"""
return self
@property
def field(self):
return self.output_field
@cached_property
def output_field(self):
"""
Returns the output type of this expressions.
"""
if self._output_field_or_none is None:
raise FieldError("Cannot resolve expression type, unknown output_field")
return self._output_field_or_none
@cached_property
def _output_field_or_none(self):
"""
Returns the output field of this expression, or None if no output type
can be resolved. Note that the 'output_field' property will raise
FieldError if no type can be resolved, but this attribute allows for
None values.
"""
if self._output_field is None:
self._resolve_output_field()
return self._output_field
def _resolve_output_field(self):
"""
Attempts to infer the output type of the expression. If the output
fields of all source fields match then we can simply infer the same
type here.
"""
if self._output_field is None:
sources = self.get_source_fields()
num_sources = len(sources)
if num_sources == 0:
self._output_field = None
else:
self._output_field = sources[0]
for source in sources:
if source is not None and not isinstance(self._output_field, source.__class__):
raise FieldError(
"Expression contains mixed types. You must set output_field")
def convert_value(self, value, connection):
"""
Expressions provide their own converters because users have the option
of manually specifying the output_field which may be a different type
from the one the database returns.
"""
field = self.output_field
internal_type = field.get_internal_type()
if value is None:
return value
elif internal_type == 'FloatField':
return float(value)
elif internal_type.endswith('IntegerField'):
return int(value)
elif internal_type == 'DecimalField':
return backend_utils.typecast_decimal(value)
return value
def get_lookup(self, lookup):
return self.output_field.get_lookup(lookup)
def get_transform(self, name):
return self.output_field.get_transform(name)
def relabeled_clone(self, change_map):
clone = self.copy()
clone.set_source_expressions(
[e.relabeled_clone(change_map) for e in self.get_source_expressions()])
return clone
def copy(self):
c = copy.copy(self)
c.copied = True
return c
def refs_aggregate(self, existing_aggregates):
"""
Does this expression contain a reference to some of the
existing aggregates? If so, returns the aggregate and also
the lookup parts that *weren't* found. So, if
exsiting_aggregates = {'max_id': Max('id')}
self.name = 'max_id'
queryset.filter(max_id__range=[10,100])
then this method will return Max('id') and those parts of the
name that weren't found. In this case `max_id` is found and the range
portion is returned as ('range',).
"""
for node in self.get_source_expressions():
agg, lookup = node.refs_aggregate(existing_aggregates)
if agg:
return agg, lookup
return False, ()
def refs_field(self, aggregate_types, field_types):
"""
Helper method for check_aggregate_support on backends
"""
return any(
node.refs_field(aggregate_types, field_types)
for node in self.get_source_expressions())
def prepare_database_save(self, field):
return self
def get_group_by_cols(self):
cols = []
for source in self.get_source_expressions():
cols.extend(source.get_group_by_cols())
return cols
def get_source_fields(self):
"""
Returns the underlying field types used by this
aggregate.
"""
return [e._output_field_or_none for e in self.get_source_expressions()]
class Expression(ExpressionNode):
def __init__(self, lhs, connector, rhs, output_field=None):
super(Expression, self).__init__(output_field=output_field)
self.connector = connector
self.lhs = lhs
self.rhs = rhs
def get_source_expressions(self):
return [self.lhs, self.rhs]
def set_source_expressions(self, exprs):
self.lhs, self.rhs = exprs
def as_sql(self, compiler, connection):
try:
lhs_output = self.lhs.output_field
except FieldError:
lhs_output = None
try:
rhs_output = self.rhs.output_field
except FieldError:
rhs_output = None
if (not connection.features.has_native_duration_field and
((lhs_output and lhs_output.get_internal_type() == 'DurationField')
or (rhs_output and rhs_output.get_internal_type() == 'DurationField'))):
return DurationExpression(self.lhs, self.connector, self.rhs).as_sql(compiler, connection)
expressions = []
expression_params = []
sql, params = compiler.compile(self.lhs)
expressions.append(sql)
expression_params.extend(params)
sql, params = compiler.compile(self.rhs)
expressions.append(sql)
expression_params.extend(params)
# order of precedence
expression_wrapper = '(%s)'
sql = connection.ops.combine_expression(self.connector, expressions)
return expression_wrapper % sql, expression_params
def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False):
c = self.copy()
c.is_summary = summarize
c.lhs = c.lhs.resolve_expression(query, allow_joins, reuse, summarize)
c.rhs = c.rhs.resolve_expression(query, allow_joins, reuse, summarize)
return c
class DurationExpression(Expression):
def compile(self, side, compiler, connection):
if not isinstance(side, DurationValue):
try:
output = side.output_field
except FieldError:
pass
if output.get_internal_type() == 'DurationField':
sql, params = compiler.compile(side)
return connection.ops.format_for_duration_arithmetic(sql), params
return compiler.compile(side)
def as_sql(self, compiler, connection):
expressions = []
expression_params = []
sql, params = self.compile(self.lhs, compiler, connection)
expressions.append(sql)
expression_params.extend(params)
sql, params = self.compile(self.rhs, compiler, connection)
expressions.append(sql)
expression_params.extend(params)
# order of precedence
expression_wrapper = '(%s)'
sql = connection.ops.combine_duration_expression(self.connector, expressions)
return expression_wrapper % sql, expression_params
class F(CombinableMixin):
"""
An object capable of resolving references to existing query objects.
"""
def __init__(self, name):
"""
Arguments:
* name: the name of the field this expression references
"""
self.name = name
def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False):
return query.resolve_ref(self.name, allow_joins, reuse, summarize)
def refs_aggregate(self, existing_aggregates):
return refs_aggregate(self.name.split(LOOKUP_SEP), existing_aggregates)
class Func(ExpressionNode):
"""
A SQL function call.
"""
function = None
template = '%(function)s(%(expressions)s)'
arg_joiner = ', '
def __init__(self, *expressions, **extra):
output_field = extra.pop('output_field', None)
super(Func, self).__init__(output_field=output_field)
self.source_expressions = self._parse_expressions(*expressions)
self.extra = extra
def get_source_expressions(self):
return self.source_expressions
def set_source_expressions(self, exprs):
self.source_expressions = exprs
def _parse_expressions(self, *expressions):
return [
arg if hasattr(arg, 'resolve_expression') else F(arg)
for arg in expressions
]
def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False):
c = self.copy()
c.is_summary = summarize
for pos, arg in enumerate(c.source_expressions):
c.source_expressions[pos] = arg.resolve_expression(query, allow_joins, reuse, summarize)
return c
def as_sql(self, compiler, connection, function=None, template=None):
sql_parts = []
params = []
for arg in self.source_expressions:
arg_sql, arg_params = compiler.compile(arg)
sql_parts.append(arg_sql)
params.extend(arg_params)
if function is None:
self.extra['function'] = self.extra.get('function', self.function)
else:
self.extra['function'] = function
self.extra['expressions'] = self.extra['field'] = self.arg_joiner.join(sql_parts)
template = template or self.extra.get('template', self.template)
return template % self.extra, params
def copy(self):
copy = super(Func, self).copy()
copy.source_expressions = self.source_expressions[:]
copy.extra = self.extra.copy()
return copy
class Value(ExpressionNode):
"""
Represents a wrapped value as a node within an expression
"""
def __init__(self, value, output_field=None):
"""
Arguments:
* value: the value this expression represents. The value will be
added into the sql parameter list and properly quoted.
* output_field: an instance of the model field type that this
expression will return, such as IntegerField() or CharField().
"""
super(Value, self).__init__(output_field=output_field)
self.value = value
def as_sql(self, compiler, connection):
return '%s', [self.value]
class DurationValue(Value):
def as_sql(self, compiler, connection):
if (connection.features.has_native_duration_field and
connection.features.driver_supports_timedelta_args):
return super(DurationValue, self).as_sql(compiler, connection)
return connection.ops.date_interval_sql(self.value)
class Col(ExpressionNode):
def __init__(self, alias, target, source=None):
if source is None:
source = target
super(Col, self).__init__(output_field=source)
self.alias, self.target = alias, target
def as_sql(self, compiler, connection):
qn = compiler.quote_name_unless_alias
return "%s.%s" % (qn(self.alias), qn(self.target.column)), []
def relabeled_clone(self, relabels):
return self.__class__(relabels.get(self.alias, self.alias), self.target, self.output_field)
def get_group_by_cols(self):
return [self]
class Ref(ExpressionNode):
"""
Reference to column alias of the query. For example, Ref('sum_cost') in
qs.annotate(sum_cost=Sum('cost')) query.
"""
def __init__(self, refs, source):
super(Ref, self).__init__()
self.source = source
self.refs = refs
def get_source_expressions(self):
return [self.source]
def set_source_expressions(self, exprs):
self.source, = exprs
def relabeled_clone(self, relabels):
return self
def as_sql(self, compiler, connection):
return "%s" % compiler.quote_name_unless_alias(self.refs), []
def get_group_by_cols(self):
return [self]
class Date(ExpressionNode):
"""
Add a date selection column.
"""
def __init__(self, lookup, lookup_type):
super(Date, self).__init__(output_field=fields.DateField())
self.lookup = lookup
self.col = None
self.lookup_type = lookup_type
def get_source_expressions(self):
return [self.col]
def set_source_expressions(self, exprs):
self.col, = exprs
def resolve_expression(self, query, allow_joins, reuse, summarize):
copy = self.copy()
copy.col = query.resolve_ref(self.lookup, allow_joins, reuse, summarize)
field = copy.col.output_field
assert isinstance(field, fields.DateField), "%r isn't a DateField." % field.name
if settings.USE_TZ:
assert not isinstance(field, fields.DateTimeField), (
"%r is a DateTimeField, not a DateField." % field.name
)
return copy
def as_sql(self, compiler, connection):
sql, params = self.col.as_sql(compiler, connection)
assert not(params)
return connection.ops.date_trunc_sql(self.lookup_type, sql), []
def copy(self):
copy = super(Date, self).copy()
copy.lookup = self.lookup
copy.lookup_type = self.lookup_type
return copy
def convert_value(self, value, connection):
if isinstance(value, datetime.datetime):
value = value.date()
return value
class DateTime(ExpressionNode):
"""
Add a datetime selection column.
"""
def __init__(self, lookup, lookup_type, tzinfo):
super(DateTime, self).__init__(output_field=fields.DateTimeField())
self.lookup = lookup
self.col = None
self.lookup_type = lookup_type
if tzinfo is None:
self.tzname = None
else:
self.tzname = timezone._get_timezone_name(tzinfo)
self.tzinfo = tzinfo
def get_source_expressions(self):
return [self.col]
def set_source_expressions(self, exprs):
self.col, = exprs
def resolve_expression(self, query, allow_joins, reuse, summarize):
copy = self.copy()
copy.col = query.resolve_ref(self.lookup, allow_joins, reuse, summarize)
field = copy.col.output_field
assert isinstance(field, fields.DateTimeField), (
"%r isn't a DateTimeField." % field.name
)
return copy
def as_sql(self, compiler, connection):
sql, params = self.col.as_sql(compiler, connection)
assert not(params)
return connection.ops.datetime_trunc_sql(self.lookup_type, sql, self.tzname)
def copy(self):
copy = super(DateTime, self).copy()
copy.lookup = self.lookup
copy.lookup_type = self.lookup_type
copy.tzname = self.tzname
return copy
def convert_value(self, value, connection):
if settings.USE_TZ:
if value is None:
raise ValueError(
"Database returned an invalid value in QuerySet.datetimes(). "
"Are time zone definitions for your database and pytz installed?"
)
value = value.replace(tzinfo=None)
value = timezone.make_aware(value, self.tzinfo)
return value
| {
"content_hash": "244007c0a21722f97baa5220f4de37d5",
"timestamp": "",
"source": "github",
"line_count": 636,
"max_line_length": 102,
"avg_line_length": 33.611635220125784,
"alnum_prop": 0.6109369883519671,
"repo_name": "edevil/django",
"id": "ac69307edc50010dea00f99b9feebe6820af57dd",
"size": "21377",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "django/db/models/expressions.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "53429"
},
{
"name": "JavaScript",
"bytes": "103687"
},
{
"name": "Makefile",
"bytes": "5765"
},
{
"name": "Python",
"bytes": "10540191"
},
{
"name": "Shell",
"bytes": "10452"
}
],
"symlink_target": ""
} |
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170618062058 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'sqlite', 'Migration can only be executed safely on \'sqlite\'.');
$this->addSql('CREATE TABLE video_links (id INTEGER NOT NULL, course_name VARCHAR(255) NOT NULL, video_name VARCHAR(255) NOT NULL, link VARCHAR(255) NOT NULL, downloaded BOOLEAN NOT NULL, PRIMARY KEY(id))');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'sqlite', 'Migration can only be executed safely on \'sqlite\'.');
$this->addSql('DROP TABLE video_links');
}
}
| {
"content_hash": "7b80d398c9a5cac49bbfa0ab7e621796",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 215,
"avg_line_length": 34.294117647058826,
"alnum_prop": 0.6698113207547169,
"repo_name": "seyfer/crv_video_crawler",
"id": "8b2edea702fcaf756745324e893839bdb80e7b4d",
"size": "1166",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/DoctrineMigrations/Version20170618062058.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3605"
},
{
"name": "HTML",
"bytes": "6226"
},
{
"name": "PHP",
"bytes": "104982"
}
],
"symlink_target": ""
} |
namespace IECore
{
/// The LuminanceOp calculates a primvar representing luminance.
/// \ingroup imageProcessingGroup
class IECORE_API LuminanceOp : public PrimitiveOp
{
public :
IE_CORE_DECLARERUNTIMETYPED( LuminanceOp, PrimitiveOp );
LuminanceOp();
virtual ~LuminanceOp();
StringParameter * colorPrimVarParameter();
const StringParameter * colorPrimVarParameter() const;
StringParameter * redPrimVarParameter();
const StringParameter * redPrimVarParameter() const;
StringParameter * greenPrimVarParameter();
const StringParameter * greenPrimVarParameter() const;
StringParameter * bluePrimVarParameter();
const StringParameter * bluePrimVarParameter() const;
Color3fParameter * weightsParameter();
const Color3fParameter * weightsParameter() const;
StringParameter * luminancePrimVarParameter();
const StringParameter * luminancePrimVarParameter() const;
BoolParameter * removeColorPrimVarsParameter();
const BoolParameter * removeColorPrimVarsParameter() const;
protected :
virtual void modifyPrimitive( Primitive * primitive, const CompoundObject * operands );
private :
template <typename T>
void calculate( const T *r, const T *g, const T *b, int steps[3], int size, T *y );
StringParameterPtr m_colorPrimVarParameter;
StringParameterPtr m_redPrimVarParameter;
StringParameterPtr m_greenPrimVarParameter;
StringParameterPtr m_bluePrimVarParameter;
Color3fParameterPtr m_weightsParameter;
BoolParameterPtr m_removeColorPrimVarsParameter;
StringParameterPtr m_luminancePrimVarParameter;
};
IE_CORE_DECLAREPTR( LuminanceOp );
} // namespace IECore
#endif // IECORE_LUMINANCEOP_H
| {
"content_hash": "c3e235057be6eae1ccd71ce2d34fcabc",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 89,
"avg_line_length": 27.65,
"alnum_prop": 0.7836045810729355,
"repo_name": "hradec/cortex",
"id": "492b6d0db4cb5caef2577d6c82f1caa9ea82b7c2",
"size": "3598",
"binary": false,
"copies": "3",
"ref": "refs/heads/testing",
"path": "include/IECore/LuminanceOp.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "70350"
},
{
"name": "C++",
"bytes": "11602345"
},
{
"name": "CMake",
"bytes": "14161"
},
{
"name": "GLSL",
"bytes": "31098"
},
{
"name": "Mathematica",
"bytes": "255937"
},
{
"name": "Objective-C",
"bytes": "21989"
},
{
"name": "Python",
"bytes": "5076729"
},
{
"name": "Slash",
"bytes": "8583"
},
{
"name": "Tcl",
"bytes": "1796"
}
],
"symlink_target": ""
} |
namespace Microsoft.Azure.Management.MySQL.FlexibleServers.Models
{
using Newtonsoft.Json;
using System.Linq;
/// <summary>
/// Delegated subnet arguments of a server
/// </summary>
public partial class DelegatedSubnetArguments
{
/// <summary>
/// Initializes a new instance of the DelegatedSubnetArguments class.
/// </summary>
public DelegatedSubnetArguments()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the DelegatedSubnetArguments class.
/// </summary>
/// <param name="subnetArmResourceId">delegated subnet arm resource
/// id.</param>
public DelegatedSubnetArguments(string subnetArmResourceId = default(string))
{
SubnetArmResourceId = subnetArmResourceId;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets delegated subnet arm resource id.
/// </summary>
[JsonProperty(PropertyName = "subnetArmResourceId")]
public string SubnetArmResourceId { get; set; }
}
}
| {
"content_hash": "55da45be874742fe2de42149cb0f2a42",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 90,
"avg_line_length": 30.571428571428573,
"alnum_prop": 0.6051401869158879,
"repo_name": "brjohnstmsft/azure-sdk-for-net",
"id": "c8f6b4e8480816d1d0aa0820e3736bfa18394cdd",
"size": "1637",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysqlflexibleservers/Generated/Models/DelegatedSubnetArguments.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "16774"
},
{
"name": "C#",
"bytes": "36517517"
},
{
"name": "HTML",
"bytes": "234899"
},
{
"name": "JavaScript",
"bytes": "7875"
},
{
"name": "PowerShell",
"bytes": "257257"
},
{
"name": "Shell",
"bytes": "13061"
},
{
"name": "Smarty",
"bytes": "11135"
},
{
"name": "TypeScript",
"bytes": "143209"
}
],
"symlink_target": ""
} |
<?php
/**
* Customize API: WP_Customize_Header_Image_Setting class
*
* @package WordPress
* @subpackage Customize
* @since 4.4.0
*/
/**
* A setting that is used to filter a value, but will not save the results.
*
* Results should be properly handled using another setting or callback.
*
* @since 3.4.0
*
* @see WP_Customize_Setting
*/
final class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {
public $id = 'header_image_data';
/**
* @since 3.4.0
*
* @global Custom_Image_Header $custom_image_header
*
* @param $value
*/
public function update( $value ) {
global $custom_image_header;
// If _custom_header_background_just_in_time() fails to initialize $custom_image_header when not is_admin().
if ( empty( $custom_image_header ) ) {
require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';
$args = get_theme_support( 'custom-header' );
$admin_head_callback = isset( $args[0]['admin-head-callback'] ) ? $args[0]['admin-head-callback'] : null;
$admin_preview_callback = isset( $args[0]['admin-preview-callback'] ) ? $args[0]['admin-preview-callback'] : null;
$custom_image_header = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback );
}
// If the value doesn't exist (removed or random),
// use the header_image value.
if ( ! $value ) {
$value = $this->manager->get_setting( 'header_image' )->post_value();
}
if ( is_array( $value ) && isset( $value['choice'] ) ) {
$custom_image_header->set_header_image( $value['choice'] );
} else {
$custom_image_header->set_header_image( $value );
}
}
}
| {
"content_hash": "1579b8242be5ecf971103fe5d755bae1",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 117,
"avg_line_length": 31.132075471698112,
"alnum_prop": 0.6484848484848484,
"repo_name": "mandino/www.bloggingshakespeare.com",
"id": "e8328a991dbdd7cd4d83d22ba9e1426ac3060509",
"size": "1650",
"binary": false,
"copies": "44",
"ref": "refs/heads/master",
"path": "wp-includes/customize/class-wp-customize-header-image-setting.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5211957"
},
{
"name": "CoffeeScript",
"bytes": "552"
},
{
"name": "HTML",
"bytes": "525757"
},
{
"name": "JavaScript",
"bytes": "6055696"
},
{
"name": "Modelica",
"bytes": "10338"
},
{
"name": "PHP",
"bytes": "44197755"
},
{
"name": "Perl",
"bytes": "2554"
},
{
"name": "Ruby",
"bytes": "3917"
},
{
"name": "Smarty",
"bytes": "27821"
},
{
"name": "XSLT",
"bytes": "34552"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
Index Fungorum
#### Published in
Syst. orb. veg. (Lundae) (1846)
#### Original name
Sphaeria turbinata Pers.
### Remarks
null | {
"content_hash": "1d3591078b721fe78c49f9e3bf152a14",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 11.923076923076923,
"alnum_prop": 0.6838709677419355,
"repo_name": "mdoering/backbone",
"id": "526252471f30cc78877342bedf45687f6a7d4cae",
"size": "203",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Eurotiomycetes/Mycocaliciales/Sphinctrinaceae/Sphinctrina/Sphinctrina turbinata/ Syn. Sphaeria turbinata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
get_ipython().magic('matplotlib inline')
import theano
floatX = theano.config.floatX
import pymc3 as pm
import theano.tensor as T
import sklearn
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('white')
from sklearn import datasets
from sklearn.preprocessing import scale
from sklearn.cross_validation import train_test_split
from sklearn.datasets import make_moons
# In[3]:
X, Y = make_moons(noise=0.2, random_state=0, n_samples=1000)
X = scale(X)
X = X.astype(floatX)
Y = Y.astype(floatX)
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=.5)
# In[4]:
fig, ax = plt.subplots()
ax.scatter(X[Y==0, 0], X[Y==0, 1], label='Class 0')
ax.scatter(X[Y==1, 0], X[Y==1, 1], color='r', label='Class 1')
sns.despine(); ax.legend()
ax.set(xlabel='X', ylabel='Y', title='Toy binary classification data set');
# ## Model specification
#
# A neural network is quite simple. The basic unit is a perceptron which is nothing more than logistic regression. We use many of these in parallel and then stack them up to get hidden layers. Here we will use 2 hidden layers with 5 neurons each which is sufficient for such a simple problem.
# In[5]:
# Trick: Turn inputs and outputs into shared variables.
# It's still the same thing, but we can later change the values of the shared variable
# (to switch in the test-data later) and pymc3 will just use the new data.
# Kind-of like a pointer we can redirect.
# For more info, see: http://deeplearning.net/software/theano/library/compile/shared.html
ann_input = theano.shared(X_train)
ann_output = theano.shared(Y_train)
n_hidden = 5
# Initialize random weights between each layer
init_1 = np.random.randn(X.shape[1], n_hidden).astype(floatX)
init_2 = np.random.randn(n_hidden, n_hidden).astype(floatX)
init_out = np.random.randn(n_hidden).astype(floatX)
with pm.Model() as neural_network:
# Weights from input to hidden layer
weights_in_1 = pm.Normal('w_in_1', 0, sd=1,
shape=(X.shape[1], n_hidden),
testval=init_1)
# Weights from 1st to 2nd layer
weights_1_2 = pm.Normal('w_1_2', 0, sd=1,
shape=(n_hidden, n_hidden),
testval=init_2)
# Weights from hidden layer to output
weights_2_out = pm.Normal('w_2_out', 0, sd=1,
shape=(n_hidden,),
testval=init_out)
# Build neural-network using tanh activation function
act_1 = pm.math.tanh(pm.math.dot(ann_input,
weights_in_1))
act_2 = pm.math.tanh(pm.math.dot(act_1,
weights_1_2))
act_out = pm.math.sigmoid(pm.math.dot(act_2,
weights_2_out))
# Binary classification -> Bernoulli likelihood
out = pm.Bernoulli('out',
act_out,
observed=ann_output)
# That’s not so bad. The Normal priors help regularize the weights. Usually we would add a constant b to the inputs but I omitted it here to keep the code cleaner.
# ## Variational Inference: Scaling model complexity
#
# We could now just run a MCMC sampler like `NUTS <http://pymc-devs.github.io/pymc3/api.html#nuts>`__ which works pretty well in this case but as I already mentioned, this will become very slow as we scale our model up to deeper architectures with more layers.
#
# Instead, we will use the brand-new ADVI variational inference algorithm which was recently added to PyMC3. This is much faster and will scale better. Note, that this is a mean-field approximation so we ignore correlations in the posterior.
# In[6]:
get_ipython().run_cell_magic('time', '', '\nwith neural_network:\n # Run ADVI which returns posterior means, standard deviations, and the evidence lower bound (ELBO)\n v_params = pm.variational.advi(n=50000)')
# < 20 seconds on my older laptop. That’s pretty good considering that NUTS is having a really hard time. Further below we make this even faster. To make it really fly, we probably want to run the Neural Network on the GPU.
#
# As samples are more convenient to work with, we can very quickly draw samples from the variational posterior using sample_vp() (this is just sampling from Normal distributions, so not at all the same like MCMC):
# In[9]:
get_ipython().run_cell_magic('time', '', '\nwith neural_network:\n trace = pm.variational.sample_vp(v_params, draws=5000)')
# Plotting the objective function (ELBO) we can see that the optimization slowly improves the fit over time.
#
#
# In[10]:
plt.plot(v_params.elbo_vals)
plt.ylabel('ELBO')
plt.xlabel('iteration')
# Now that we trained our model, lets predict on the hold-out set using a posterior predictive check (PPC). We use `sample_ppc() <http://pymc-devs.github.io/pymc3/api.html#pymc3.sampling.sample_ppc>`__ to generate new data (in this case class predictions) from the posterior (sampled from the variational estimation).
# In[11]:
# Replace shared variables with testing set
ann_input.set_value(X_test)
ann_output.set_value(Y_test)
# Creater posterior predictive samples
ppc = pm.sample_ppc(trace, model=neural_network, samples=500)
# Use probability of > 0.5 to assume prediction of class 1
pred = ppc['out'].mean(axis=0) > 0.5
# In[12]:
fig, ax = plt.subplots()
ax.scatter(X_test[pred==0, 0], X_test[pred==0, 1])
ax.scatter(X_test[pred==1, 0], X_test[pred==1, 1], color='r')
sns.despine()
ax.set(title='Predicted labels in testing set', xlabel='X', ylabel='Y');
# In[13]:
print('Accuracy = {}%'.format((Y_test == pred).mean() * 100))
# Hey, our neural network did all right!
#
# ## Lets look at what the classifier has learned
# For this, we evaluate the class probability predictions on a grid over the whole input space.
# In[14]:
grid = np.mgrid[-3:3:100j,-3:3:100j].astype(floatX)
grid_2d = grid.reshape(2, -1).T
dummy_out = np.ones(grid.shape[1], dtype=np.int8)
# In[15]:
ann_input.set_value(grid_2d)
ann_output.set_value(dummy_out)
# Creater posterior predictive samples
ppc = pm.sample_ppc(trace, model=neural_network, samples=500)
# ## Probability surface
#
#
# In[16]:
cmap = sns.diverging_palette(250, 12, s=85, l=25, as_cmap=True)
fig, ax = plt.subplots(figsize=(10, 6))
contour = ax.contourf(*grid, ppc['out'].mean(axis=0).reshape(100, 100), cmap=cmap)
ax.scatter(X_test[pred==0, 0], X_test[pred==0, 1])
ax.scatter(X_test[pred==1, 0], X_test[pred==1, 1], color='r')
cbar = plt.colorbar(contour, ax=ax)
_ = ax.set(xlim=(-3, 3), ylim=(-3, 3), xlabel='X', ylabel='Y');
cbar.ax.set_ylabel('Posterior predictive mean probability of class label = 0');
# ## Uncertainty in predicted value
# So far, everything I showed we could have done with a non-Bayesian Neural Network. The mean of the posterior predictive for each class-label should be identical to maximum likelihood predicted values. However, we can also look at the standard deviation of the posterior predictive to get a sense for the uncertainty in our predictions. Here is what that looks like:
# In[17]:
cmap = sns.cubehelix_palette(light=1, as_cmap=True)
fig, ax = plt.subplots(figsize=(10, 6))
contour = ax.contourf(*grid, ppc['out'].std(axis=0).reshape(100, 100), cmap=cmap)
ax.scatter(X_test[pred==0, 0], X_test[pred==0, 1])
ax.scatter(X_test[pred==1, 0], X_test[pred==1, 1], color='r')
cbar = plt.colorbar(contour, ax=ax)
_ = ax.set(xlim=(-3, 3), ylim=(-3, 3), xlabel='X', ylabel='Y');
cbar.ax.set_ylabel('Uncertainty (posterior predictive standard deviation)');
# We can see that very close to the decision boundary, our uncertainty as to which label to predict is highest. You can imagine that associating predictions with uncertainty is a critical property for many applications like health care. To further maximize accuracy, we might want to train the model primarily on samples from that high-uncertainty region.
# ## Mini-batch ADVI: Scaling data size
# So far, we have trained our model on all data at once. Obviously this won’t scale to something like ImageNet. Moreover, training on mini-batches of data (stochastic gradient descent) avoids local minima and can lead to faster convergence.
#
# Fortunately, ADVI can be run on mini-batches as well. It just requires some setting up:
# In[18]:
from six.moves import zip
# Set back to original data to retrain
ann_input.set_value(X_train)
ann_output.set_value(Y_train)
# Tensors and RV that will be using mini-batches
minibatch_tensors = [ann_input, ann_output]
minibatch_RVs = [out]
# Generator that returns mini-batches in each iteration
def create_minibatch(data):
rng = np.random.RandomState(0)
while True:
# Return random data samples of set size 100 each iteration
ixs = rng.randint(len(data), size=50)
yield data[ixs]
minibatches = zip(
create_minibatch(X_train),
create_minibatch(Y_train),
)
total_size = len(Y_train)
# While the above might look a bit daunting, I really like the design. Especially the fact that you define a generator allows for great flexibility. In principle, we could just pool from a database there and not have to keep all the data in RAM.
#
# Lets pass those to advi_minibatch():
# In[19]:
get_ipython().run_cell_magic('time', '', '\nwith neural_network:\n # Run advi_minibatch\n v_params = pm.variational.advi_minibatch(\n n=50000, minibatch_tensors=minibatch_tensors,\n minibatch_RVs=minibatch_RVs, minibatches=minibatches,\n total_size=total_size, learning_rate=1e-2, epsilon=1.0\n )')
# In[20]:
with neural_network:
trace = pm.variational.sample_vp(v_params, draws=5000)
# In[21]:
plt.plot(v_params.elbo_vals)
plt.ylabel('ELBO')
plt.xlabel('iteration')
sns.despine()
# As you can see, mini-batch ADVI’s running time is much lower. It also seems to converge faster.
#
# For fun, we can also look at the trace. The point is that we also get uncertainty of our Neural Network weights.
# In[22]:
pm.traceplot(trace);
# ## Summary
# Hopefully this blog post demonstrated a very powerful new inference algorithm available in PyMC3: ADVI. I also think bridging the gap between Probabilistic Programming and Deep Learning can open up many new avenues for innovation in this space, as discussed above. Specifically, a hierarchical neural network sounds pretty bad-ass. These are really exciting times.
# In[ ]:
| {
"content_hash": "05d9f72da8e78c938cdc078481811959",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 367,
"avg_line_length": 37.75,
"alnum_prop": 0.6990114214415971,
"repo_name": "balarsen/pymc_learning",
"id": "ae7bbae0260554fa6379ee5151fc387029011dea",
"size": "10717",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "BayesianNetwork/Neural Networks in PyMC3.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "HTML",
"bytes": "3143936"
},
{
"name": "Jupyter Notebook",
"bytes": "132018941"
},
{
"name": "Python",
"bytes": "26029"
}
],
"symlink_target": ""
} |
.class Landroid/widget/TableLayout$PassThroughHierarchyChangeListener;
.super Ljava/lang/Object;
.source "TableLayout.java"
# interfaces
.implements Landroid/view/ViewGroup$OnHierarchyChangeListener;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroid/widget/TableLayout;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x2
name = "PassThroughHierarchyChangeListener"
.end annotation
# instance fields
.field private mOnHierarchyChangeListener:Landroid/view/ViewGroup$OnHierarchyChangeListener;
.field final synthetic this$0:Landroid/widget/TableLayout;
# direct methods
.method private constructor <init>(Landroid/widget/TableLayout;)V
.locals 0
.parameter
.prologue
.line 760
iput-object p1, p0, Landroid/widget/TableLayout$PassThroughHierarchyChangeListener;->this$0:Landroid/widget/TableLayout;
invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method synthetic constructor <init>(Landroid/widget/TableLayout;Landroid/widget/TableLayout$1;)V
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
.line 760
invoke-direct {p0, p1}, Landroid/widget/TableLayout$PassThroughHierarchyChangeListener;-><init>(Landroid/widget/TableLayout;)V
return-void
.end method
.method static synthetic access$102(Landroid/widget/TableLayout$PassThroughHierarchyChangeListener;Landroid/view/ViewGroup$OnHierarchyChangeListener;)Landroid/view/ViewGroup$OnHierarchyChangeListener;
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
.line 760
iput-object p1, p0, Landroid/widget/TableLayout$PassThroughHierarchyChangeListener;->mOnHierarchyChangeListener:Landroid/view/ViewGroup$OnHierarchyChangeListener;
return-object p1
.end method
# virtual methods
.method public onChildViewAdded(Landroid/view/View;Landroid/view/View;)V
.locals 1
.parameter "parent"
.parameter "child"
.prologue
.line 768
iget-object v0, p0, Landroid/widget/TableLayout$PassThroughHierarchyChangeListener;->this$0:Landroid/widget/TableLayout;
#calls: Landroid/widget/TableLayout;->trackCollapsedColumns(Landroid/view/View;)V
invoke-static {v0, p2}, Landroid/widget/TableLayout;->access$200(Landroid/widget/TableLayout;Landroid/view/View;)V
.line 770
iget-object v0, p0, Landroid/widget/TableLayout$PassThroughHierarchyChangeListener;->mOnHierarchyChangeListener:Landroid/view/ViewGroup$OnHierarchyChangeListener;
if-eqz v0, :cond_0
.line 771
iget-object v0, p0, Landroid/widget/TableLayout$PassThroughHierarchyChangeListener;->mOnHierarchyChangeListener:Landroid/view/ViewGroup$OnHierarchyChangeListener;
invoke-interface {v0, p1, p2}, Landroid/view/ViewGroup$OnHierarchyChangeListener;->onChildViewAdded(Landroid/view/View;Landroid/view/View;)V
.line 773
:cond_0
return-void
.end method
.method public onChildViewRemoved(Landroid/view/View;Landroid/view/View;)V
.locals 1
.parameter "parent"
.parameter "child"
.prologue
.line 779
iget-object v0, p0, Landroid/widget/TableLayout$PassThroughHierarchyChangeListener;->mOnHierarchyChangeListener:Landroid/view/ViewGroup$OnHierarchyChangeListener;
if-eqz v0, :cond_0
.line 780
iget-object v0, p0, Landroid/widget/TableLayout$PassThroughHierarchyChangeListener;->mOnHierarchyChangeListener:Landroid/view/ViewGroup$OnHierarchyChangeListener;
invoke-interface {v0, p1, p2}, Landroid/view/ViewGroup$OnHierarchyChangeListener;->onChildViewRemoved(Landroid/view/View;Landroid/view/View;)V
.line 782
:cond_0
return-void
.end method
| {
"content_hash": "f1538d24bfb854c57d3887f9f70ed52f",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 200,
"avg_line_length": 32.8125,
"alnum_prop": 0.7768707482993197,
"repo_name": "baidurom/reference",
"id": "6892e78246bf8c553e292e1dda536cccbbb2b1e1",
"size": "3675",
"binary": false,
"copies": "3",
"ref": "refs/heads/coron-4.2",
"path": "aosp/framework.jar.out/smali/android/widget/TableLayout$PassThroughHierarchyChangeListener.smali",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
"""
api_model.py
The meta-model of the generated API.
Translation process converts the YANG model to classes defined in this module.
"""
from __future__ import absolute_import
from pyang.statements import TypeStatement
from pyang.types import UnionTypeSpec, PathTypeSpec
class Element(object):
"""
The Element class.
This is the super class of all modelled elements in the API.
:attribute:: owned_elements
list of `Element` owned by this element
:attribute:: owner
The owner of this `Element`.
:attribute:: comment
The comments associated with this element.
"""
def __init__(self):
self.owned_elements = []
self._owner = None
self.comment = None
self.revision = None
@property
def owner(self):
return self._owner
@owner.setter
def owner(self, owner):
self._owner = owner
class Deviation(Element):
def __init__(self, iskeyword):
Element.__init__(self)
self.name = None
self._stmt = None
self.d_type = None
self.d_target = None
self.iskeyword = iskeyword
@property
def stmt(self):
return self._stmt
@stmt.setter
def stmt(self, stmt):
self._stmt = stmt
self.name = stmt.arg
def qn(self):
names = []
stmt = self.d_target
while stmt.parent:
if stmt.keyword not in ('container', 'list', 'rpc'):
names.append(self.convert_prop_name(stmt))
else:
names.append(self.convert_owner_name(stmt))
stmt = stmt.parent
return '.'.join(reversed(names))
def convert_prop_name(self, stmt):
name = snake_case(stmt.arg)
if self.iskeyword(name) or self.iskeyword(name.lower()):
name = '%s_' % name
if name.startswith('_'):
name = '%s%s' % ('y', name)
return name
def convert_owner_name(self, stmt):
name = escape_name(stmt.arg)
if stmt.keyword == 'grouping':
name = '%sGrouping' % camel_case(name)
elif stmt.keyword == 'identity':
name = '%sIdentity' % camel_case(name)
elif stmt.keyword == 'rpc':
name = camel_case(name) + 'Rpc'
else:
name = camel_case(name)
if self.iskeyword(name) or self.iskeyword(name.lower()):
name = '%s_' % name
if name.startswith('_'):
name = '%s%s' % ('Y', name)
return name
def get_package(self):
if self.owner is None:
return None
if isinstance(self.owner, Package):
return self.owner
else:
if hasattr(self.owner, 'get_package'):
return self.owner.get_package()
class NamedElement(Element):
"""
An abstract element that may have a name
The name is used for identification of the named element
within the namespace that is defined or accessible
:attribute:: name
The name of the Element
"""
def __init__(self):
""" The name of the named element """
super().__init__()
self.name = None
def get_py_mod_name(self):
"""
Get the python module name that contains this
NamedElement.
"""
pkg = get_top_pkg(self)
if not pkg.bundle_name:
py_mod_name = 'ydk.models.%s' % pkg.name
else:
py_mod_name = 'ydk.models.%s.%s' % (pkg.bundle_name, pkg.name)
return py_mod_name
def get_cpp_header_name(self):
"""
Get the c++ header that contains this
NamedElement.
"""
pkg = get_top_pkg(self)
if pkg.curr_bundle_name == pkg.bundle_name:
cpp_header_name = '%s.hpp' % pkg.name
else:
cpp_header_name = 'ydk_%s/%s.hpp' % (pkg.bundle_name, pkg.name)
return cpp_header_name
def get_meta_py_mod_name(self):
"""
Get the python meta module that contains the meta model
information about this NamedElement.
"""
pkg = get_top_pkg(self)
if not pkg.bundle_name:
meta_py_mod_name = 'ydk.models._meta'
else:
meta_py_mod_name = 'ydk.models.%s._meta' % pkg.bundle_name
return meta_py_mod_name
def fqn(self):
''' get the Fully Qualified Name '''
names = []
element = self
while element is not None:
if isinstance(element, Deviation):
element = element.owner
names.append(element.name)
element = element.owner
return '.'.join(reversed(names))
def qn(self):
''' get the qualified name , name sans
package name '''
names = []
element = self
while element is not None and not isinstance(element, Package):
if isinstance(element, Deviation):
element = element.owner
names.append(element.name)
element = element.owner
return '.'.join(reversed(names))
def qualified_cpp_name(self):
''' get the C++ qualified name , name sans
package name '''
names = []
element = self
while element is not None and not isinstance(element, Package):
if isinstance(element, Deviation):
element = element.owner
names.append(element.name)
element = element.owner
return '::'.join(reversed(names))
def fully_qualified_cpp_name(self):
''' get the C++ qualified name '''
pkg = get_top_pkg(self)
names = []
element = self
while element is not None:
if isinstance(element, Deviation):
element = element.owner
names.append(element.name)
element = element.owner
return pkg.bundle_name + '::' + '::'.join(reversed(names))
def go_name(self):
stmt = self.stmt
if stmt is None:
raise Exception('element is not yet defined')
if hasattr(self, 'goName'):
return self.goName
stmt_name = escape_name(stmt.unclashed_arg if hasattr(stmt, 'unclashed_arg') else stmt.arg)
name = camel_case(stmt_name)
if stmt_name[-1] == '_':
name = '%s_' % name
if self.iskeyword(name):
name = 'Y%s' % name
self.goName = name
return self.goName
def qualified_go_name(self):
''' get the Go qualified name (sans package name) '''
if self.stmt.keyword == 'identity':
return self.go_name()
if hasattr(self, 'qualifiedGoName'):
return self.qualifiedGoName
names = []
element = self
while element is not None and not isinstance(element, Package):
if isinstance(element, Deviation):
element = element.owner
names.append(element.go_name())
element = element.owner
self.qualifiedGoName = '_'.join(reversed(names))
return self.qualifiedGoName
class Package(NamedElement):
"""
Represents a Package in the API
"""
def __init__(self, iskeyword):
super().__init__()
self._stmt = None
self._sub_name = ''
self._bundle_name = ''
self._curr_bundle_name = ''
self._augments_other = False
self.identity_subclasses = {}
self.iskeyword = iskeyword
self.version = '1'
def qn(self):
""" Return the qualified name """
return self.name
@property
def is_deviation(self):
return hasattr(self.stmt, 'is_deviation_module')
@property
def is_augment(self):
return hasattr(self.stmt, 'is_augmented_module')
@property
def augments_other(self):
return self._augments_other
@augments_other.setter
def augments_other(self, augments_other):
self._augments_other = augments_other
@property
def bundle_name(self):
return self._bundle_name
@bundle_name.setter
def bundle_name(self, bundle_name):
self._bundle_name = bundle_name
@property
def curr_bundle_name(self):
return self._curr_bundle_name
@curr_bundle_name.setter
def curr_bundle_name(self, curr_bundle_name):
self._curr_bundle_name = curr_bundle_name
@property
def sub_name(self):
if self.bundle_name != '':
sub = self.bundle_name
else:
py_mod_name = self.get_py_mod_name()
sub = py_mod_name[len('ydk.models.'): py_mod_name.rfind('.')]
return sub
@property
def stmt(self):
""" Return the `pyang.statements.Statement` associated
with this package. This is usually a module statement.
"""
return self._stmt
@stmt.setter
def stmt(self, stmt):
name = stmt.arg.replace('-', '_')
if self.iskeyword(name) or self.iskeyword(name.lower()):
name = '%s_' % name
if name[0] == '_':
name = 'y%s' % name
self.name = name
revision = stmt.search_one('revision')
if revision is not None:
self.revision = revision.arg
self._stmt = stmt
desc = stmt.search_one('description')
if desc is not None:
self.comment = desc.arg
if hasattr(stmt, 'i_version'):
self.version = stmt.i_version
def imported_types(self):
"""
Returns a list of all types imported by elements in
this package.
"""
imported_types = []
for clazz in [c for c in self.owned_elements if isinstance(c, Class)]:
imported_types.extend(clazz.imported_types())
return imported_types
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.name == other.name
else:
return False
__hash__ = NamedElement.__hash__
class DataType(NamedElement):
"""
Represents a DataType
"""
def __init__(self):
super().__init__()
class Class(NamedElement):
"""
Represents a Class in the api.
"""
def __init__(self, iskeyword):
super().__init__()
self._stmt = None
self._extends = []
self._module = None
self.iskeyword = iskeyword
@property
def extends(self):
""" Returns the immediate super classes of this class. """
if self.is_identity():
base = []
base_stmts = self.stmt.search('base')
for base_stmt in base_stmts:
if hasattr(base_stmt, 'i_identity'):
base_identity = base_stmt.i_identity
if hasattr(base_identity, 'i_class'):
base.append(base_identity.i_class)
return base
else:
return self._extends
def is_identity(self):
""" Returns True if this is a class for a YANG identity. """
return self._stmt.keyword == 'identity'
def is_grouping(self):
""" Returns True if this is a class for a YANG grouping. """
return self._stmt.keyword == 'grouping'
def is_rpc(self):
return self._stmt.keyword == 'rpc'
def all_owned_elements(self):
""" Returns all the owned_element of this class and its super classes."""
all_owned_elements = []
for super_class in self.extends:
all_owned_elements.extend(super_class.all_owned_elements())
all_owned_elements.extend(self.owned_elements)
return all_owned_elements
def properties(self):
""" Returns the properties defined by this class. """
return get_properties(self.owned_elements)
def get_package(self):
""" Returns the Package that contains this Class. """
if self.owner is None:
return None
if isinstance(self.owner, Package):
return self.owner
else:
if hasattr(self.owner, 'get_package'):
return self.owner.get_package()
def imported_types(self):
""" Returns all types that are referenced in this Class that are not
from the same package as this Class."""
imported_types = []
package = self.get_package()
# look at the super classes
for super_class in self.extends:
if super_class.get_package() != package:
if super_class not in imported_types:
imported_types.append(super_class)
for p in self.properties():
prop_types = [p.property_type]
if isinstance(p.property_type, UnionTypeSpec):
for child_type_stmt in p.property_type.types:
prop_types.extend(_get_union_types(child_type_stmt))
for prop_type in prop_types:
if isinstance(prop_type, Class) or isinstance(prop_type, Enum) or isinstance(prop_type, Bits):
if prop_type.get_package() != package:
if prop_type not in imported_types:
imported_types.append(prop_type)
# do this for nested classes too
for nested_class in [clazz for clazz in self.owned_elements if isinstance(clazz, Class)]:
imported_types.extend(
[c for c in nested_class.imported_types() if c not in imported_types])
return imported_types
def get_dependent_siblings(self):
''' This will return all types that are referenced by this Class
or nested Classes that are at the same level as this type within the package and are
used as super types .
This is useful to determine which type needs to be printed
before declaring this type in languages that do not support
forward referencing like Python '''
classes_at_same_level = []
classes_at_same_level.extend(
[c for c in self.owner.owned_elements if isinstance(c, Class) and c is not self])
dependent_siblings = []
package = self.get_package()
def _walk_supers(clazz):
for super_class in clazz.extends:
if super_class.get_package() == package and super_class in classes_at_same_level:
if super_class not in dependent_siblings:
dependent_siblings.append(super_class)
_walk_supers(super_class)
def _walk_nested_classes(clazz):
for nested_class in [c for c in clazz.owned_elements if isinstance(c, Class)]:
_walk_supers(nested_class)
_walk_nested_classes(nested_class)
_walk_supers(self)
_walk_nested_classes(self)
return dependent_siblings
def is_config(self):
"""
Returns True if an instance of this Class represents config data.
"""
if hasattr(self.stmt, 'i_config'):
return self.stmt.i_config
elif isinstance(self.owner, Class):
return self.owner.is_config
else:
return True
@property
def stmt(self):
"""
Returns the `pyang.statements.Statement` instance associated with this Class.
"""
return self._stmt
@property
def module(self):
"""
Returns the module `pyang.statements.Statement` that this Class was derived from.
"""
return self._module
@stmt.setter
def stmt(self, stmt):
name = escape_name(stmt.unclashed_arg if hasattr(stmt, 'unclashed_arg') else stmt.arg)
name = camel_case(name)
if self.iskeyword(name):
name = '_%s' % name
self.name = name
if self.name.startswith('_'):
self.name = '%s%s' % ('Y', name)
self._stmt = stmt
desc = stmt.search_one('description')
if desc is not None:
self.comment = desc.arg
if stmt.keyword == 'module':
self._module = stmt
else:
self._module = stmt.i_module
def get_key_props(self):
""" Returns a list of the properties of this class that are keys
of a YANG list. """
key_props = []
if self.stmt.keyword == 'list':
if hasattr(self.stmt, 'i_key'):
key_stmts = self.stmt.i_key
# do not use #properties here
for prop in [p for p in self.owned_elements if isinstance(p, Property)]:
if prop.stmt in key_stmts:
key_props.append(prop)
return key_props
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.fqn() == other.fqn()
else:
return False
@property
def owner(self):
return self._owner
@owner.setter
def owner(self, owner):
self._owner = owner
self.name = _modify_nested_container_with_same_name(self)
def set_owner(self, owner, language):
self._owner = owner
if language == 'cpp':
self.name = _modify_nested_container_with_same_name(self)
__hash__ = NamedElement.__hash__
class AnyXml(NamedElement):
"""
Represents an AnyXml element.
"""
def __init__(self):
super().__init__()
self._stmt = None
@property
def stmt(self):
""" Returns the `pyang.statements.Statement` instance associated with this AnyXml instance."""
return self._stmt
@stmt.setter
def stmt(self, stmt):
self.name = 'string'
self._stmt = stmt
desc = stmt.search_one('description')
if desc is not None:
self.comment = desc.arg
def properties(self):
return get_properties(self.owned_elements)
class Bits(DataType):
"""
A DataType representing the bits type in YANG.
"""
def __init__(self, iskeyword):
super().__init__()
self._stmt = None
self._dictionary = None
self._pos_map = None
self.iskeyword = iskeyword
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.fqn() == other.fqn()
else:
return False
def get_package(self):
""" Returns the Package for this DataType. """
if self.owner is None:
return None
if isinstance(self.owner, Package):
return self.owner
else:
return self.owner.get_package()
@property
def stmt(self):
return self._stmt
@stmt.setter
def stmt(self, stmt):
self._stmt = stmt
self._dictionary = {}
self._pos_map = {}
# the name of the enumeration is derived either from the typedef
# or the leaf under which it is defined
leaf_or_typedef = stmt
while leaf_or_typedef.parent and leaf_or_typedef.keyword not in ['leaf', 'leaf-list', 'typedef']:
leaf_or_typedef = leaf_or_typedef.parent
name = '%s' % camel_case(leaf_or_typedef.arg)
if self.iskeyword(name) or self.iskeyword(name.lower()):
name = '%s' % name
self.name = name
desc = stmt.search_one('description')
if desc is not None:
self.comment = desc.arg
else:
desc = leaf_or_typedef.search_one('description')
if desc is not None:
self.comment = desc.arg
for bit_stmt in stmt.search('bit'):
self._dictionary[bit_stmt.arg] = False
pos_stmt = bit_stmt.search_one('position')
if pos_stmt is not None:
self._pos_map[bit_stmt.arg] = pos_stmt.arg
__hash__ = DataType.__hash__
class Property(NamedElement):
""" Represents an attribute or reference of a Class.
"""
def __init__(self, iskeyword):
super().__init__()
self._stmt = None
self.is_static = False
self.featuring_classifiers = []
self.read_only = False
self.is_many = False
self.id = False
self._property_type = None
self.max_elements = None
self.min_elements = None
self.iskeyword = iskeyword
def is_key(self):
""" Returns True if this property represents a key of a YANG list."""
if isinstance(self.owner, Class):
return self in self.owner.get_key_props()
return False
@property
def stmt(self):
return self._stmt
@stmt.setter
def stmt(self, stmt):
self._stmt = stmt
# name = snake_case(stmt.arg)
name = snake_case(stmt.unclashed_arg if hasattr(stmt, 'unclashed_arg') else stmt.arg)
if self.iskeyword(name) or self.iskeyword(name.lower()):
name = '%s_' % name
self.name = name
if self.name.startswith('_'):
self.name = '%s%s' % ('y', name)
if stmt.keyword in ['leaf-list', 'list']:
self.is_many = True
desc = stmt.search_one('description')
if desc is not None:
self.comment = desc.arg
max_elem_stmt = stmt.search_one('max-elements')
min_elem_stmt = stmt.search_one('min-elements')
if max_elem_stmt:
self.max_elements = max_elem_stmt.arg
if min_elem_stmt:
self.min_elements = min_elem_stmt.arg
@property
def property_type(self):
""" Returns the type of this property. """
if self._property_type is not None:
return self._property_type
if self._stmt is None:
return None
if self._stmt.keyword in ['leaf', 'leaf-list']:
type_stmt = self._stmt.search_one('type')
return type_stmt.i_type_spec
else:
return None
@property_type.setter
def property_type(self, property_type):
self._property_type = property_type
class Enum(DataType):
""" Represents an enumeration. """
def __init__(self, iskeyword, typedef_stmt=None):
super().__init__()
self._stmt = None
self.literals = []
self.iskeyword = iskeyword
while typedef_stmt and typedef_stmt.keyword != 'typedef' and typedef_stmt.parent:
typedef_stmt = typedef_stmt.parent
self.typedef_stmt = typedef_stmt
def get_package(self):
""" Returns the Package that this enum is found in. """
if self.owner is None:
return None
if isinstance(self.owner, Package):
return self.owner
else:
return self.owner.get_package()
def go_name(self):
stmt = self.stmt
if stmt is None:
raise Exception('element is not yet defined')
if hasattr(self, 'goName'):
return self.goName
while stmt.parent and stmt.keyword not in ['leaf', 'leaf-list', 'typedef']:
stmt = stmt.parent
name = stmt.arg
if self.typedef_stmt:
name = self.typedef_stmt.arg
name = escape_name(stmt.unclashed_arg if hasattr(stmt, 'unclashed_arg') else name)
name = camel_case(name)
if self.iskeyword(name):
name = '%s%s' % ('Y', name)
suffix = '_' if self.name[-1] == '_' else ''
name = '%s%s' % (name, suffix)
self.goName = name
return self.goName
@property
def stmt(self):
return self._stmt
@stmt.setter
def stmt(self, stmt):
self._stmt = stmt
# the name of the numeration is derived either from the typedef
# or the leaf under which it is defined
leaf_or_typedef = stmt
while leaf_or_typedef.parent and leaf_or_typedef.keyword not in ['leaf', 'leaf-list', 'typedef']:
leaf_or_typedef = leaf_or_typedef.parent
name = leaf_or_typedef.arg
if self.typedef_stmt:
name = self.typedef_stmt.arg
name = camel_case(escape_name(name))
if self.iskeyword(name) or self.iskeyword(name.lower()):
name = '%s_' % name
if name[0] == '_':
name = 'Y%s' % name
self.name = name
desc = None
if self.typedef_stmt:
desc = self.typedef_stmt.search_one('description')
if desc is None:
desc = stmt.search_one('description')
if desc is None:
leaf_or_typedef.search_one('description')
if desc:
self.comment = desc.arg
else:
self.comment = ""
for enum_stmt in stmt.search('enum'):
literal = EnumLiteral(self.iskeyword)
literal.stmt = enum_stmt
self.literals.append(literal)
class EnumLiteral(NamedElement):
""" Represents an enumeration literal. """
def __init__(self, iskeyword):
super().__init__()
self._stmt = None
self.value = None
self.iskeyword = iskeyword
@property
def stmt(self):
return self._stmt
@stmt.setter
def stmt(self, stmt):
self._stmt = stmt
self.name = stmt.arg.replace('-', '_')
self.name = self.name.replace('+', '__PLUS__')
self.name = self.name.replace('/', '__FWD_SLASH__')
self.name = self.name.replace('\\', '__BACK_SLASH__')
self.name = self.name.replace('.', '__DOT__')
self.name = self.name.replace('*', '__STAR__')
self.name = self.name.replace('$', '__DOLLAR__')
self.name = self.name.replace('@', '__AT__')
self.name = self.name.replace('#', '__POUND__')
self.name = self.name.replace('^', '__CARET__')
self.name = self.name.replace('&', '__AMPERSAND__')
self.name = self.name.replace('(', '__LPAREN__')
self.name = self.name.replace(')', '__RPAREN__')
self.name = self.name.replace('=', '__EQUALS__')
self.name = self.name.replace('{', '__LCURLY__')
self.name = self.name.replace('}', '__RCURLY__')
self.name = self.name.replace("'", '__SQUOTE__')
self.name = self.name.replace('"', '__DQUOTE__')
self.name = self.name.replace('<', '__GREATER_THAN__')
self.name = self.name.replace('>', '__LESS_THAN__')
self.name = self.name.replace(',', '__COMMA__')
self.name = self.name.replace(':', '__COLON__')
self.name = self.name.replace('?', '__QUESTION__')
self.name = self.name.replace('!', '__BANG__')
self.name = self.name.replace(';', '__SEMICOLON__')
self.name = self.name.replace(' ', '_')
if self.iskeyword(self.name):
self.name += '_'
if self.name[0:1].isdigit():
self.name = 'Y_%s' % self.name
if self.name[0] == '_':
self.name = 'Y%s' % self.name
self.value = stmt.i_value
desc = stmt.search_one('description')
if desc is not None:
self.comment = desc.arg
def get_top_pkg(pkg):
"""
Get top level Package instance of current NamedElement instance.
"""
while pkg is not None and not isinstance(pkg, Package):
pkg = pkg.owner
return pkg
def get_properties(owned_elements):
""" get all properties from the owned_elements. """
props = []
all_props = []
all_props.extend([p for p in owned_elements if isinstance(p, Property)])
# first get the key properties
key_props = [p for p in all_props if p.is_key()]
props.extend(key_props)
non_key_props = [p for p in all_props if not p.is_key()]
props.extend(non_key_props)
return props
def _modify_nested_container_with_same_name(named_element):
if named_element.owner.name.rstrip('_') == named_element.name:
return '%s_' % named_element.owner.name
else:
return named_element.name
def snake_case(input_text):
s = input_text.replace('-', '_')
s = s.replace('.', '_')
return s.lower()
def get_property_name(element, iskeyword):
name = snake_case(element.stmt.unclashed_arg if hasattr(element.stmt, 'unclashed_arg') else element.stmt.arg)
if iskeyword(name) or iskeyword(name.lower()) or (
element.owner is not None and element.stmt.arg.lower() == element.owner.stmt.arg.lower()):
name = '%s_' % name
return name
# capitalized input will not affected
def camel_case(input_text):
def _capitalize(s):
if len(s) == 0 or s.startswith(s[0].upper()):
return s
ret = s[0].upper()
if len(s) > 1:
ret = '%s%s' % (ret, s[1:])
return ret
result = ''.join([_capitalize(word) for word in input_text.split('-')])
result = ''.join([_capitalize(word) for word in result.split('_')])
if input_text.startswith('_'):
result = '_' + result
return result
def camel_snake(input_text):
return '_'.join([word.title() for word in input_text.split('-')])
def escape_name(name):
name = name.replace('+', '__PLUS__')
name = name.replace('/', '__FWD_SLASH__')
name = name.replace('\\', '__BACK_SLASH__')
name = name.replace('.', '__DOT__')
name = name.replace('*', '__STAR__')
name = name.replace('$', '__DOLLAR__')
name = name.replace('@', '__AT__')
name = name.replace('#', '__POUND__')
name = name.replace('^', '__CARET__')
name = name.replace('&', '__AMPERSAND__')
name = name.replace('(', '__LPAREN__')
name = name.replace(')', '__RPAREN__')
name = name.replace('=', '__EQUALS__')
name = name.replace('{', '__LCURLY__')
name = name.replace('}', '__RCURLY__')
name = name.replace("'", '__SQUOTE__')
name = name.replace('"', '__DQUOTE__')
name = name.replace('<', '__GREATER_THAN__')
name = name.replace('>', '__LESS_THAN__')
name = name.replace(',', '__COMMA__')
name = name.replace(':', '__COLON__')
name = name.replace('?', '__QUESTION__')
name = name.replace('!', '__BANG__')
name = name.replace(';', '__SEMICOLON__')
return name
def _get_union_types(type_stmt):
from .builder import TypesExtractor
prop_type = TypesExtractor().get_property_type(type_stmt)
if isinstance(prop_type, TypeStatement):
prop_type = prop_type.i_type_spec
prop_type_specs = []
if isinstance(prop_type, UnionTypeSpec):
for child_type_stmt in prop_type.types:
prop_type_specs.extend(_get_union_types(child_type_stmt))
else:
prop_type_specs.append(prop_type)
return prop_type_specs
| {
"content_hash": "3e89b4b8c25fd841d2bbec271b2a03ac",
"timestamp": "",
"source": "github",
"line_count": 990,
"max_line_length": 113,
"avg_line_length": 30.830303030303032,
"alnum_prop": 0.5555664766398009,
"repo_name": "CiscoDevNet/ydk-gen",
"id": "6677891749f668d2eb0ec5edd8850630cccc5a6a",
"size": "31563",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ydkgen/api_model.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "21945"
},
{
"name": "C",
"bytes": "15875"
},
{
"name": "C++",
"bytes": "3529963"
},
{
"name": "CMake",
"bytes": "120070"
},
{
"name": "CSS",
"bytes": "134"
},
{
"name": "Dockerfile",
"bytes": "770"
},
{
"name": "Go",
"bytes": "566728"
},
{
"name": "Makefile",
"bytes": "960022"
},
{
"name": "Python",
"bytes": "1052712"
},
{
"name": "Ruby",
"bytes": "4023"
},
{
"name": "Shell",
"bytes": "153786"
}
],
"symlink_target": ""
} |
import {Component, Directive, View, Output, EventEmitter} from 'angular2/core';
import {
ComponentFixture,
afterEach,
AsyncTestCompleter,
TestComponentBuilder,
beforeEach,
ddescribe,
describe,
dispatchEvent,
fakeAsync,
tick,
expect,
it,
inject,
iit,
xit,
browserDetection
} from 'angular2/testing_internal';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {
Control,
ControlGroup,
ControlValueAccessor,
FORM_DIRECTIVES,
NG_VALIDATORS,
NG_ASYNC_VALIDATORS,
NgControl,
NgIf,
NgFor,
NgForm,
Validators,
Validator
} from 'angular2/common';
import {Provider, forwardRef, Input} from 'angular2/core';
import {By} from 'angular2/platform/browser';
import {ListWrapper} from 'angular2/src/facade/collection';
import {ObservableWrapper} from 'angular2/src/facade/async';
import {CONST_EXPR} from 'angular2/src/facade/lang';
import {PromiseWrapper} from "angular2/src/facade/promise";
export function main() {
describe("integration tests", () => {
it("should initialize DOM elements with the given form object",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"login": new Control("loginValue")});
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
expect(input.nativeElement.value).toEqual("loginValue");
async.done();
});
}));
it("should update the control group values on DOM change",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var form = new ControlGroup({"login": new Control("oldValue")});
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
input.nativeElement.value = "updatedValue";
dispatchEvent(input.nativeElement, "input");
expect(form.value).toEqual({"login": "updatedValue"});
async.done();
});
}));
it("should ignore the change event for <input type=text>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var form = new ControlGroup({"login": new Control("oldValue")});
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
input.nativeElement.value = "updatedValue";
ObservableWrapper.subscribe(form.valueChanges,
(value) => { throw 'Should not happen'; });
dispatchEvent(input.nativeElement, "change");
async.done();
});
}));
it("should emit ngSubmit event on submit",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var t = `<div>
<form [ngFormModel]="form" (ngSubmit)="name='updated'"></form>
<span>{{name}}</span>
</div>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.form = new ControlGroup({});
fixture.debugElement.componentInstance.name = 'old';
tick();
var form = fixture.debugElement.query(By.css("form"));
dispatchEvent(form.nativeElement, "submit");
tick();
expect(fixture.debugElement.componentInstance.name).toEqual('updated');
})));
it("should work with single controls",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var control = new Control("loginValue");
var t = `<div><input type="text" [ngFormControl]="form"></div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = control;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
expect(input.nativeElement.value).toEqual("loginValue");
input.nativeElement.value = "updatedValue";
dispatchEvent(input.nativeElement, "input");
expect(control.value).toEqual("updatedValue");
async.done();
});
}));
it("should update DOM elements when rebinding the control group",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"login": new Control("oldValue")});
fixture.detectChanges();
fixture.debugElement.componentInstance.form =
new ControlGroup({"login": new Control("newValue")});
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
expect(input.nativeElement.value).toEqual("newValue");
async.done();
});
}));
it("should update DOM elements when updating the value of a control",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var login = new Control("oldValue");
var form = new ControlGroup({"login": login});
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
login.updateValue("newValue");
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
expect(input.nativeElement.value).toEqual("newValue");
async.done();
});
}));
it("should mark controls as touched after interacting with the DOM control",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var login = new Control("oldValue");
var form = new ControlGroup({"login": login});
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var loginEl = fixture.debugElement.query(By.css("input"));
expect(login.touched).toBe(false);
dispatchEvent(loginEl.nativeElement, "blur");
expect(login.touched).toBe(true);
async.done();
});
}));
describe("different control types", () => {
it("should support <input type=text>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="text">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"text": new Control("old")});
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
expect(input.nativeElement.value).toEqual("old");
input.nativeElement.value = "new";
dispatchEvent(input.nativeElement, "input");
expect(fixture.debugElement.componentInstance.form.value).toEqual({"text": "new"});
async.done();
});
}));
it("should support <input> without type",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div [ngFormModel]="form">
<input ngControl="text">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"text": new Control("old")});
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
expect(input.nativeElement.value).toEqual("old");
input.nativeElement.value = "new";
dispatchEvent(input.nativeElement, "input");
expect(fixture.debugElement.componentInstance.form.value).toEqual({"text": "new"});
async.done();
});
}));
it("should support <textarea>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div [ngFormModel]="form">
<textarea ngControl="text"></textarea>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"text": new Control('old')});
fixture.detectChanges();
var textarea = fixture.debugElement.query(By.css("textarea"));
expect(textarea.nativeElement.value).toEqual("old");
textarea.nativeElement.value = "new";
dispatchEvent(textarea.nativeElement, "input");
expect(fixture.debugElement.componentInstance.form.value).toEqual({"text": 'new'});
async.done();
});
}));
it("should support <type=checkbox>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div [ngFormModel]="form">
<input type="checkbox" ngControl="checkbox">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"checkbox": new Control(true)});
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
expect(input.nativeElement.checked).toBe(true);
input.nativeElement.checked = false;
dispatchEvent(input.nativeElement, "change");
expect(fixture.debugElement.componentInstance.form.value).toEqual({"checkbox": false});
async.done();
});
}));
it("should support <type=number>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div [ngFormModel]="form">
<input type="number" ngControl="num">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"num": new Control(10)});
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
expect(input.nativeElement.value).toEqual("10");
input.nativeElement.value = "20";
dispatchEvent(input.nativeElement, "input");
expect(fixture.debugElement.componentInstance.form.value).toEqual({"num": 20});
async.done();
});
}));
it("should support <select>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div [ngFormModel]="form">
<select ngControl="city">
<option value="SF"></option>
<option value="NYC"></option>
</select>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"city": new Control("SF")});
fixture.detectChanges();
var select = fixture.debugElement.query(By.css("select"));
var sfOption = fixture.debugElement.query(By.css("option"));
expect(select.nativeElement.value).toEqual('SF');
expect(sfOption.nativeElement.selected).toBe(true);
select.nativeElement.value = 'NYC';
dispatchEvent(select.nativeElement, "input");
expect(fixture.debugElement.componentInstance.form.value).toEqual({"city": 'NYC'});
expect(sfOption.nativeElement.selected).toBe(false);
async.done();
});
}));
it("should support <select> with a dynamic list of options",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var t = `<div [ngFormModel]="form">
<select ngControl="city">
<option *ngFor="#c of data" [value]="c"></option>
</select>
</div>`;
var fixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(compFixture) => fixture = compFixture);
tick();
fixture.debugElement.componentInstance.form =
new ControlGroup({"city": new Control("NYC")});
fixture.debugElement.componentInstance.data = ['SF', 'NYC'];
fixture.detectChanges();
tick();
var select = fixture.debugElement.query(By.css('select'));
expect(select.nativeElement.value).toEqual('NYC');
})));
it("should support custom value accessors",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="name" wrapped-value>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"name": new Control("aa")});
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
expect(input.nativeElement.value).toEqual("!aa!");
input.nativeElement.value = "!bb!";
dispatchEvent(input.nativeElement, "input");
expect(fixture.debugElement.componentInstance.form.value).toEqual({"name": "bb"});
async.done();
});
}));
it("should support custom value accessors on non builtin input elements that fire a change event without a 'target' property",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div [ngFormModel]="form">
<my-input ngControl="name"></my-input>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"name": new Control("aa")});
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("my-input"));
expect(input.componentInstance.value).toEqual("!aa!");
input.componentInstance.value = "!bb!";
ObservableWrapper.subscribe(input.componentInstance.onInput, (value) => {
expect(fixture.debugElement.componentInstance.form.value).toEqual({"name": "bb"});
async.done();
});
input.componentInstance.dispatchChangeEvent();
});
}));
});
describe("validations", () => {
it("should use sync validators defined in html",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var form = new ControlGroup(
{"login": new Control(""), "min": new Control(""), "max": new Control("")});
var t = `<div [ngFormModel]="form" login-is-empty-validator>
<input type="text" ngControl="login" required>
<input type="text" ngControl="min" minlength="3">
<input type="text" ngControl="max" maxlength="3">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var required = fixture.debugElement.query(By.css("[required]"));
var minLength = fixture.debugElement.query(By.css("[minlength]"));
var maxLength = fixture.debugElement.query(By.css("[maxlength]"));
required.nativeElement.value = "";
minLength.nativeElement.value = "1";
maxLength.nativeElement.value = "1234";
dispatchEvent(required.nativeElement, "input");
dispatchEvent(minLength.nativeElement, "input");
dispatchEvent(maxLength.nativeElement, "input");
expect(form.hasError("required", ["login"])).toEqual(true);
expect(form.hasError("minlength", ["min"])).toEqual(true);
expect(form.hasError("maxlength", ["max"])).toEqual(true);
expect(form.hasError("loginIsEmpty")).toEqual(true);
required.nativeElement.value = "1";
minLength.nativeElement.value = "123";
maxLength.nativeElement.value = "123";
dispatchEvent(required.nativeElement, "input");
dispatchEvent(minLength.nativeElement, "input");
dispatchEvent(maxLength.nativeElement, "input");
expect(form.valid).toEqual(true);
async.done();
});
}));
it("should use async validators defined in the html",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var form = new ControlGroup({"login": new Control("")});
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login" uniq-login-validator="expected">
</div>`;
var rootTC;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((root) => rootTC = root);
tick();
rootTC.debugElement.componentInstance.form = form;
rootTC.detectChanges();
expect(form.pending).toEqual(true);
tick(100);
expect(form.hasError("uniqLogin", ["login"])).toEqual(true);
var input = rootTC.debugElement.query(By.css("input"));
input.nativeElement.value = "expected";
dispatchEvent(input.nativeElement, "input");
tick(100);
expect(form.valid).toEqual(true);
})));
it("should use sync validators defined in the model",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var form = new ControlGroup({"login": new Control("aa", Validators.required)});
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
expect(form.valid).toEqual(true);
var input = fixture.debugElement.query(By.css("input"));
input.nativeElement.value = "";
dispatchEvent(input.nativeElement, "input");
expect(form.valid).toEqual(false);
async.done();
});
}));
it("should use async validators defined in the model",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var control =
new Control("", Validators.required, uniqLoginAsyncValidator("expected"));
var form = new ControlGroup({"login": control});
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
var fixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((root) => fixture =
root);
tick();
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
expect(form.hasError("required", ["login"])).toEqual(true);
var input = fixture.debugElement.query(By.css("input"));
input.nativeElement.value = "wrong value";
dispatchEvent(input.nativeElement, "input");
expect(form.pending).toEqual(true);
tick();
expect(form.hasError("uniqLogin", ["login"])).toEqual(true);
input.nativeElement.value = "expected";
dispatchEvent(input.nativeElement, "input");
tick();
expect(form.valid).toEqual(true);
})));
});
describe("nested forms", () => {
it("should init DOM with the given form object",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var form =
new ControlGroup({"nested": new ControlGroup({"login": new Control("value")})});
var t = `<div [ngFormModel]="form">
<div ngControlGroup="nested">
<input type="text" ngControl="login">
</div>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
expect(input.nativeElement.value).toEqual("value");
async.done();
});
}));
it("should update the control group values on DOM change",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var form =
new ControlGroup({"nested": new ControlGroup({"login": new Control("value")})});
var t = `<div [ngFormModel]="form">
<div ngControlGroup="nested">
<input type="text" ngControl="login">
</div>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
input.nativeElement.value = "updatedValue";
dispatchEvent(input.nativeElement, "input");
expect(form.value).toEqual({"nested": {"login": "updatedValue"}});
async.done();
});
}));
});
it("should support ngModel for complex forms",
inject(
[TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var form = new ControlGroup({"name": new Control("")});
var t =
`<div [ngFormModel]="form"><input type="text" ngControl="name" [(ngModel)]="name"></div>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.name = 'oldValue';
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input")).nativeElement;
expect(input.value).toEqual("oldValue");
input.value = "updatedValue";
dispatchEvent(input, "input");
tick();
expect(fixture.debugElement.componentInstance.name).toEqual("updatedValue");
})));
it("should support ngModel for single fields",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var form = new Control("");
var t = `<div><input type="text" [ngFormControl]="form" [(ngModel)]="name"></div>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.form = form;
fixture.debugElement.componentInstance.name = "oldValue";
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input")).nativeElement;
expect(input.value).toEqual("oldValue");
input.value = "updatedValue";
dispatchEvent(input, "input");
tick();
expect(fixture.debugElement.componentInstance.name).toEqual("updatedValue");
})));
describe("template-driven forms", () => {
it("should add new controls and control groups",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var t = `<form>
<div ngControlGroup="user">
<input type="text" ngControl="login">
</div>
</form>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.name = null;
fixture.detectChanges();
var form = fixture.debugElement.componentViewChildren[0].inject(NgForm);
expect(form.controls['user']).not.toBeDefined();
tick();
expect(form.controls['user']).toBeDefined();
expect(form.controls['user'].controls['login']).toBeDefined();
})));
it("should emit ngSubmit event on submit",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var t = `<div><form (ngSubmit)="name='updated'"></form></div>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.name = 'old';
var form = fixture.debugElement.query(By.css("form"));
dispatchEvent(form.nativeElement, "submit");
tick();
expect(fixture.debugElement.componentInstance.name).toEqual("updated");
})));
it("should not create a template-driven form when ngNoForm is used",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<form ngNoForm>
</form>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.name = null;
fixture.detectChanges();
expect(fixture.debugElement.componentViewChildren.length).toEqual(0);
async.done();
});
}));
it("should remove controls",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var t = `<form>
<div *ngIf="name == 'show'">
<input type="text" ngControl="login">
</div>
</form>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.name = 'show';
fixture.detectChanges();
tick();
var form = fixture.debugElement.componentViewChildren[0].inject(NgForm);
expect(form.controls['login']).toBeDefined();
fixture.debugElement.componentInstance.name = 'hide';
fixture.detectChanges();
tick();
expect(form.controls['login']).not.toBeDefined();
})));
it("should remove control groups",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var t = `<form>
<div *ngIf="name=='show'" ngControlGroup="user">
<input type="text" ngControl="login">
</div>
</form>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.name = 'show';
fixture.detectChanges();
tick();
var form = fixture.debugElement.componentViewChildren[0].inject(NgForm);
expect(form.controls['user']).toBeDefined();
fixture.debugElement.componentInstance.name = 'hide';
fixture.detectChanges();
tick();
expect(form.controls['user']).not.toBeDefined();
})));
it("should support ngModel for complex forms",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var t = `<form>
<input type="text" ngControl="name" [(ngModel)]="name">
</form>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.name = "oldValue";
fixture.detectChanges();
tick();
var input = fixture.debugElement.query(By.css("input")).nativeElement;
expect(input.value).toEqual("oldValue");
input.value = "updatedValue";
dispatchEvent(input, "input");
tick();
expect(fixture.debugElement.componentInstance.name).toEqual("updatedValue");
})));
it("should support ngModel for single fields",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var t = `<div><input type="text" [(ngModel)]="name"></div>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.name = "oldValue";
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input")).nativeElement;
expect(input.value).toEqual("oldValue");
input.value = "updatedValue";
dispatchEvent(input, "input");
tick();
expect(fixture.debugElement.componentInstance.name).toEqual("updatedValue");
})));
});
describe("setting status classes", () => {
it("should work with single fields",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var form = new Control("", Validators.required);
var t = `<div><input type="text" [ngFormControl]="form"></div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input")).nativeElement;
expect(sortedClassList(input)).toEqual(['ng-invalid', 'ng-pristine', 'ng-untouched']);
dispatchEvent(input, "blur");
fixture.detectChanges();
expect(sortedClassList(input)).toEqual(["ng-invalid", "ng-pristine", "ng-touched"]);
input.value = "updatedValue";
dispatchEvent(input, "input");
fixture.detectChanges();
expect(sortedClassList(input)).toEqual(["ng-dirty", "ng-touched", "ng-valid"]);
async.done();
});
}));
it("should work with complex model-driven forms",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var form = new ControlGroup({"name": new Control("", Validators.required)});
var t = `<form [ngFormModel]="form"><input type="text" ngControl="name"></form>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input")).nativeElement;
expect(sortedClassList(input)).toEqual(["ng-invalid", "ng-pristine", "ng-untouched"]);
dispatchEvent(input, "blur");
fixture.detectChanges();
expect(sortedClassList(input)).toEqual(["ng-invalid", "ng-pristine", "ng-touched"]);
input.value = "updatedValue";
dispatchEvent(input, "input");
fixture.detectChanges();
expect(sortedClassList(input)).toEqual(["ng-dirty", "ng-touched", "ng-valid"]);
async.done();
});
}));
it("should work with ngModel",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div><input [(ngModel)]="name" required></div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
fixture.debugElement.componentInstance.name = "";
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input")).nativeElement;
expect(sortedClassList(input)).toEqual(["ng-invalid", "ng-pristine", "ng-untouched"]);
dispatchEvent(input, "blur");
fixture.detectChanges();
expect(sortedClassList(input)).toEqual(["ng-invalid", "ng-pristine", "ng-touched"]);
input.value = "updatedValue";
dispatchEvent(input, "input");
fixture.detectChanges();
expect(sortedClassList(input)).toEqual(["ng-dirty", "ng-touched", "ng-valid"]);
async.done();
});
}));
});
describe("ngModel corner cases", () => {
it("should not update the view when the value initially came from the view",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var form = new Control("");
var t =
`<div><input type="text" [ngFormControl]="form" [(ngModel)]="name"></div>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
// In Firefox, effective text selection in the real DOM requires an actual focus
// of the field. This is not an issue in a new HTML document.
if (browserDetection.isFirefox) {
var fakeDoc = DOM.createHtmlDocument();
DOM.appendChild(fakeDoc.body, fixture.debugElement.nativeElement);
}
var input = fixture.debugElement.query(By.css("input")).nativeElement;
input.value = "aa";
input.selectionStart = 1;
dispatchEvent(input, "input");
tick();
fixture.detectChanges();
// selection start has not changed because we did not reset the value
expect(input.selectionStart).toEqual(1);
})));
it("should update the view when the model is set back to what used to be in the view",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
var t = `<input type="text" [(ngModel)]="name">`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.debugElement.componentInstance.name = "";
fixture.detectChanges();
// Type "aa" into the input.
var input = fixture.debugElement.query(By.css("input")).nativeElement;
input.value = "aa";
input.selectionStart = 1;
dispatchEvent(input, "input");
tick();
fixture.detectChanges();
expect(fixture.debugElement.componentInstance.name).toEqual("aa");
// Programatically update the input value to be "bb".
fixture.debugElement.componentInstance.name = "bb";
tick();
fixture.detectChanges();
expect(input.value).toEqual("bb");
// Programatically set it back to "aa".
fixture.debugElement.componentInstance.name = "aa";
tick();
fixture.detectChanges();
expect(input.value).toEqual("aa");
})));
it("should not crash when validity is checked from a binding",
inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
// {{x.valid}} used to crash because valid() tried to read a property
// from form.control before it was set. This test verifies this bug is
// fixed.
var t = `<form><div ngControlGroup="x" #x="ngForm">
<input type="text" ngControl="test"></div>{{x.valid}}</form>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
(root) => { fixture = root; });
tick();
fixture.detectChanges();
})));
});
});
}
@Directive({
selector: '[wrapped-value]',
host: {'(input)': 'handleOnInput($event.target.value)', '[value]': 'value'}
})
class WrappedValue implements ControlValueAccessor {
value;
onChange: Function;
constructor(cd: NgControl) { cd.valueAccessor = this; }
writeValue(value) { this.value = `!${value}!`; }
registerOnChange(fn) { this.onChange = fn; }
registerOnTouched(fn) {}
handleOnInput(value) { this.onChange(value.substring(1, value.length - 1)); }
}
@Component({selector: "my-input", template: ''})
class MyInput implements ControlValueAccessor {
@Output('input') onInput: EventEmitter<any> = new EventEmitter();
value: string;
constructor(cd: NgControl) { cd.valueAccessor = this; }
writeValue(value) { this.value = `!${value}!`; }
registerOnChange(fn) { ObservableWrapper.subscribe(this.onInput, fn); }
registerOnTouched(fn) {}
dispatchChangeEvent() {
ObservableWrapper.callEmit(this.onInput, this.value.substring(1, this.value.length - 1));
}
}
function uniqLoginAsyncValidator(expectedValue: string) {
return (c) => {
var completer = PromiseWrapper.completer();
var res = (c.value == expectedValue) ? null : {"uniqLogin": true};
completer.resolve(res);
return completer.promise;
};
}
function loginIsEmptyGroupValidator(c: ControlGroup) {
return c.controls["login"].value == "" ? {"loginIsEmpty": true} : null;
}
@Directive({
selector: '[login-is-empty-validator]',
providers: [new Provider(NG_VALIDATORS, {useValue: loginIsEmptyGroupValidator, multi: true})]
})
class LoginIsEmptyValidator {
}
@Directive({
selector: '[uniq-login-validator]',
providers: [
new Provider(NG_ASYNC_VALIDATORS,
{useExisting: forwardRef(() => UniqLoginValidator), multi: true})
]
})
class UniqLoginValidator implements Validator {
@Input('uniq-login-validator') expected;
validate(c) { return uniqLoginAsyncValidator(this.expected)(c); }
}
@Component({
selector: "my-comp",
template: '',
directives: [
FORM_DIRECTIVES,
WrappedValue,
MyInput,
NgIf,
NgFor,
LoginIsEmptyValidator,
UniqLoginValidator
]
})
class MyComp {
form: any;
name: string;
data: any;
}
function sortedClassList(el) {
var l = DOM.classList(el);
ListWrapper.sort(l);
return l;
}
| {
"content_hash": "6d0c096d1f6852ceeba7f70eb09c03d1",
"timestamp": "",
"source": "github",
"line_count": 1073,
"max_line_length": 132,
"avg_line_length": 39.57688723205965,
"alnum_prop": 0.5568219281307399,
"repo_name": "willseeyou/angular",
"id": "a2d66e5a08ff8418f5e760921ca5b7903021eb5d",
"size": "42466",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "modules/angular2/test/common/forms/integration_spec.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "62917"
},
{
"name": "Dart",
"bytes": "650140"
},
{
"name": "HTML",
"bytes": "66778"
},
{
"name": "JavaScript",
"bytes": "91770"
},
{
"name": "Protocol Buffer",
"bytes": "4818"
},
{
"name": "Python",
"bytes": "3535"
},
{
"name": "Shell",
"bytes": "28008"
},
{
"name": "TypeScript",
"bytes": "3333848"
}
],
"symlink_target": ""
} |
<?php
namespace Ortofit\Bundle\BackOfficeFrontBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('ortofit_back_office_front');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}
}
| {
"content_hash": "580e303f3f9417b0fb9d0ee5461768c5",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 131,
"avg_line_length": 31.379310344827587,
"alnum_prop": 0.7230769230769231,
"repo_name": "rsmakota/ortofit_backoffice",
"id": "0c623463bc14326ac13248ea3f90226e02ece3f9",
"size": "910",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Ortofit/Bundle/BackOfficeFrontBundle/DependencyInjection/Configuration.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "281981"
},
{
"name": "HTML",
"bytes": "1851866"
},
{
"name": "JavaScript",
"bytes": "2182712"
},
{
"name": "PHP",
"bytes": "484614"
},
{
"name": "Shell",
"bytes": "104"
}
],
"symlink_target": ""
} |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.analytics.synapse.artifacts.models;
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
/**
* Information about a SparkConfiguration created at the workspace level.
*
* <p>SparkConfiguration Artifact information.
*/
@Fluent
public final class SparkConfiguration {
/*
* Description about the SparkConfiguration.
*/
@JsonProperty(value = "description")
private String description;
/*
* SparkConfiguration configs.
*/
@JsonProperty(value = "configs", required = true)
private Map<String, String> configs;
/*
* Annotations for SparkConfiguration.
*/
@JsonProperty(value = "annotations")
private List<String> annotations;
/*
* additional Notes.
*/
@JsonProperty(value = "notes")
private String notes;
/*
* The identity that created the resource.
*/
@JsonProperty(value = "createdBy")
private String createdBy;
/*
* The timestamp of resource creation.
*/
@JsonProperty(value = "created")
private OffsetDateTime created;
/*
* SparkConfiguration configMergeRule.
*/
@JsonProperty(value = "configMergeRule")
private Map<String, String> configMergeRule;
/**
* Get the description property: Description about the SparkConfiguration.
*
* @return the description value.
*/
public String getDescription() {
return this.description;
}
/**
* Set the description property: Description about the SparkConfiguration.
*
* @param description the description value to set.
* @return the SparkConfiguration object itself.
*/
public SparkConfiguration setDescription(String description) {
this.description = description;
return this;
}
/**
* Get the configs property: SparkConfiguration configs.
*
* @return the configs value.
*/
public Map<String, String> getConfigs() {
return this.configs;
}
/**
* Set the configs property: SparkConfiguration configs.
*
* @param configs the configs value to set.
* @return the SparkConfiguration object itself.
*/
public SparkConfiguration setConfigs(Map<String, String> configs) {
this.configs = configs;
return this;
}
/**
* Get the annotations property: Annotations for SparkConfiguration.
*
* @return the annotations value.
*/
public List<String> getAnnotations() {
return this.annotations;
}
/**
* Set the annotations property: Annotations for SparkConfiguration.
*
* @param annotations the annotations value to set.
* @return the SparkConfiguration object itself.
*/
public SparkConfiguration setAnnotations(List<String> annotations) {
this.annotations = annotations;
return this;
}
/**
* Get the notes property: additional Notes.
*
* @return the notes value.
*/
public String getNotes() {
return this.notes;
}
/**
* Set the notes property: additional Notes.
*
* @param notes the notes value to set.
* @return the SparkConfiguration object itself.
*/
public SparkConfiguration setNotes(String notes) {
this.notes = notes;
return this;
}
/**
* Get the createdBy property: The identity that created the resource.
*
* @return the createdBy value.
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* Set the createdBy property: The identity that created the resource.
*
* @param createdBy the createdBy value to set.
* @return the SparkConfiguration object itself.
*/
public SparkConfiguration setCreatedBy(String createdBy) {
this.createdBy = createdBy;
return this;
}
/**
* Get the created property: The timestamp of resource creation.
*
* @return the created value.
*/
public OffsetDateTime getCreated() {
return this.created;
}
/**
* Set the created property: The timestamp of resource creation.
*
* @param created the created value to set.
* @return the SparkConfiguration object itself.
*/
public SparkConfiguration setCreated(OffsetDateTime created) {
this.created = created;
return this;
}
/**
* Get the configMergeRule property: SparkConfiguration configMergeRule.
*
* @return the configMergeRule value.
*/
public Map<String, String> getConfigMergeRule() {
return this.configMergeRule;
}
/**
* Set the configMergeRule property: SparkConfiguration configMergeRule.
*
* @param configMergeRule the configMergeRule value to set.
* @return the SparkConfiguration object itself.
*/
public SparkConfiguration setConfigMergeRule(Map<String, String> configMergeRule) {
this.configMergeRule = configMergeRule;
return this;
}
}
| {
"content_hash": "267858deba2d5bd11cacce53b8aae4a5",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 87,
"avg_line_length": 26.27363184079602,
"alnum_prop": 0.6470365461086915,
"repo_name": "Azure/azure-sdk-for-java",
"id": "87b31c023858df529a7d569992fe177c33d7d937",
"size": "5281",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/synapse/azure-analytics-synapse-artifacts/src/main/java/com/azure/analytics/synapse/artifacts/models/SparkConfiguration.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "8762"
},
{
"name": "Bicep",
"bytes": "15055"
},
{
"name": "CSS",
"bytes": "7676"
},
{
"name": "Dockerfile",
"bytes": "2028"
},
{
"name": "Groovy",
"bytes": "3237482"
},
{
"name": "HTML",
"bytes": "42090"
},
{
"name": "Java",
"bytes": "432409546"
},
{
"name": "JavaScript",
"bytes": "36557"
},
{
"name": "Jupyter Notebook",
"bytes": "95868"
},
{
"name": "PowerShell",
"bytes": "737517"
},
{
"name": "Python",
"bytes": "240542"
},
{
"name": "Scala",
"bytes": "1143898"
},
{
"name": "Shell",
"bytes": "18488"
},
{
"name": "XSLT",
"bytes": "755"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
NUB Generator [autonym]
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "f48e8c81bd8731bd6628e1ed68ad250a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 23,
"avg_line_length": 9.076923076923077,
"alnum_prop": 0.6779661016949152,
"repo_name": "mdoering/backbone",
"id": "0080fa40b521fb13f23036f154cdca3790bcd82a",
"size": "184",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/incertae sedis/Helichrysum panormitanum/Helichrysum panormitanum panormitanum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package me.kafeitu.activiti.chapter2;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class VerySimpleLeaveProcessTest {
@Test
public void testStartProcess() throws Exception {
// 创建流程引擎,使用内存数据库
ProcessEngine processEngine = ProcessEngineConfiguration
.createStandaloneInMemProcessEngineConfiguration()
.buildProcessEngine();
// 部署流程定义文件
RepositoryService repositoryService = processEngine.getRepositoryService();
String processFileName = "me/kafeitu/activiti/helloworld/sayhelloleave.bpmn";
repositoryService.createDeployment().addClasspathResource(processFileName)
.deploy();
// 验证已部署流程定义
ProcessDefinition processDefinition = repositoryService
.createProcessDefinitionQuery().singleResult();
assertEquals("leavesayhello", processDefinition.getKey());
// 启动流程并返回流程实例
RuntimeService runtimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService
.startProcessInstanceByKey("leavesayhello");
assertNotNull(processInstance);
System.out.println("pid=" + processInstance.getId() + ", pdid="
+ processInstance.getProcessDefinitionId());
}
} | {
"content_hash": "a0e7e65b7fd49bc064ccf58d0997d978",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 85,
"avg_line_length": 39.73809523809524,
"alnum_prop": 0.7291791491911325,
"repo_name": "kutala/activiti-in-action-codes",
"id": "fdd37b8356e10dbf8c184a8a70a7b2875e034ca4",
"size": "1753",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "bpmn20-example/src/test/java/me/kafeitu/activiti/chapter2/VerySimpleLeaveProcessTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "203"
},
{
"name": "CSS",
"bytes": "486062"
},
{
"name": "HTML",
"bytes": "1053569"
},
{
"name": "Java",
"bytes": "2984007"
},
{
"name": "JavaScript",
"bytes": "2735849"
},
{
"name": "Shell",
"bytes": "109"
}
],
"symlink_target": ""
} |
Difficulty: Medium
https://leetcode.com/problems/one-edit-distance/
Given two strings s and t, determine if they are both one edit distance apart.
**Note:**
There are 3 possiblities to satisify one edit distance apart:
1. Insert a character into s to get t
2. Delete a character from s to get t
3. Replace a character of s to get t
**Example 1:**
```
Input: s = "ab", t = "acb"
Output: true
Explanation: We can insert 'c' into s to get t.
```
**Example 2:**
```
Input: s = "cab", t = "ad"
Output: false
Explanation: We cannot get t from s by only one step.
```
**Example 3:**
```
Input: s = "1203", t = "1213"
Output: true
Explanation: We can replace '0' with '1' to get t.
```
| {
"content_hash": "3d7c19264c14abbf9782f5e4d6f44c12",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 78,
"avg_line_length": 20.205882352941178,
"alnum_prop": 0.6681222707423581,
"repo_name": "jiadaizhao/LeetCode",
"id": "a389d1b7a56d00b872c03ec246f35c0126f76df0",
"size": "713",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "0101-0200/0161-One Edit Distance/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "1140864"
},
{
"name": "Java",
"bytes": "34062"
},
{
"name": "Python",
"bytes": "758800"
},
{
"name": "Shell",
"bytes": "698"
},
{
"name": "TSQL",
"bytes": "774"
}
],
"symlink_target": ""
} |
package io.datalayer.algorithm.sort;
import io.datalayer.algorithm.list.ListSorter;
import io.datalayer.algorithm.sort.bubble.BubblesortListSorter;
import io.datalayer.algorithm.sort.insertion.InsertionSortListSorter;
import io.datalayer.algorithm.sort.merge.MergesortListSorter;
import io.datalayer.algorithm.sort.quick.QuicksortListSorter;
import io.datalayer.algorithm.sort.selection.SelectionSortListSorter;
import io.datalayer.algorithm.sort.shell.ShellsortListSorter;
import io.datalayer.data.comparator.CallCountingComparator;
import io.datalayer.data.comparator.NaturalComparator;
import io.datalayer.data.list.ArrayList;
import io.datalayer.data.list.List;
import junit.framework.TestCase;
/**
* A test case to drive the various {@link ListSorter} implementations
* in order to compare their efficiency.
*
*/
public class ListSorterCallCountingTest extends TestCase {
private static final int TEST_SIZE = 1000;
private final List _sortedArrayList = new ArrayList(TEST_SIZE);
private final List _reverseArrayList = new ArrayList(TEST_SIZE);
private final List _randomArrayList = new ArrayList(TEST_SIZE);
private CallCountingComparator _comparator;
protected void setUp() throws Exception {
super.setUp();
_comparator = new CallCountingComparator(NaturalComparator.INSTANCE);
for (int i = 1; i < TEST_SIZE; ++i) {
_sortedArrayList.add(new Integer(i));
}
for (int i = TEST_SIZE; i > 0; --i) {
_reverseArrayList.add(new Integer(i));
}
for (int i = 1; i < TEST_SIZE; ++i) {
_randomArrayList.add(new Integer((int)(TEST_SIZE * Math.random())));
}
}
public void testWorstCaseBubblesort() {
new BubblesortListSorter(_comparator).sort(_reverseArrayList);
reportCalls();
}
public void testWorstCaseSelectionSort() {
new SelectionSortListSorter(_comparator).sort(_reverseArrayList);
reportCalls();
}
public void testWorstCaseInsertionSort() {
new InsertionSortListSorter(_comparator).sort(_reverseArrayList);
reportCalls();
}
public void testWorstCaseShellsort() {
new ShellsortListSorter(_comparator).sort(_reverseArrayList);
reportCalls();
}
public void testWorstCaseQuicksort() {
new QuicksortListSorter(_comparator).sort(_reverseArrayList);
reportCalls();
}
public void testWorstCaseMergesort() {
new MergesortListSorter(_comparator).sort(_reverseArrayList);
reportCalls();
}
public void testBestCaseBubblesort() {
new BubblesortListSorter(_comparator).sort(_sortedArrayList);
reportCalls();
}
public void testBestCaseSelectionSort() {
new SelectionSortListSorter(_comparator).sort(_sortedArrayList);
reportCalls();
}
public void testBestCaseInsertionSort() {
new InsertionSortListSorter(_comparator).sort(_sortedArrayList);
reportCalls();
}
public void testBestCaseShellsort() {
new ShellsortListSorter(_comparator).sort(_sortedArrayList);
reportCalls();
}
public void testBestCaseQuicksort() {
new QuicksortListSorter(_comparator).sort(_sortedArrayList);
reportCalls();
}
public void testBestCaseMergesort() {
new MergesortListSorter(_comparator).sort(_sortedArrayList);
reportCalls();
}
public void testAverageCaseBubblesort() {
new BubblesortListSorter(_comparator).sort(_randomArrayList);
reportCalls();
}
public void testAverageCaseSelectionSort() {
new SelectionSortListSorter(_comparator).sort(_randomArrayList);
reportCalls();
}
public void testAverageCaseInsertionSort() {
new InsertionSortListSorter(_comparator).sort(_randomArrayList);
reportCalls();
}
public void testAverageCaseShellsort() {
new ShellsortListSorter(_comparator).sort(_randomArrayList);
reportCalls();
}
public void testAverageCaseQuicksort() {
new QuicksortListSorter(_comparator).sort(_randomArrayList);
reportCalls();
}
public void testAverageCaseMergeSort() {
new MergesortListSorter(_comparator).sort(_randomArrayList);
reportCalls();
}
private void reportCalls() {
System.out.println(getName() + ": " + _comparator.getCallCount() + " calls");
}
}
| {
"content_hash": "cc4e1c214c6281ea5a267828f079c1e6",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 85,
"avg_line_length": 31.51063829787234,
"alnum_prop": 0.6896241278415485,
"repo_name": "echalkpad/t4f-data",
"id": "3b27bae96394ce4bd81471b8ddcd0ded3ab0fe87",
"size": "5631",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "algorithm/src/test/java/io/datalayer/algorithm/sort/ListSorterCallCountingTest.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "21510"
},
{
"name": "C",
"bytes": "4224"
},
{
"name": "C++",
"bytes": "11388421"
},
{
"name": "CSS",
"bytes": "38929"
},
{
"name": "Clojure",
"bytes": "13986"
},
{
"name": "Emacs Lisp",
"bytes": "15596"
},
{
"name": "Erlang",
"bytes": "11979"
},
{
"name": "Java",
"bytes": "9263765"
},
{
"name": "JavaScript",
"bytes": "386783"
},
{
"name": "Makefile",
"bytes": "423433"
},
{
"name": "PHP",
"bytes": "7959"
},
{
"name": "Perl",
"bytes": "62480"
},
{
"name": "PigLatin",
"bytes": "4125"
},
{
"name": "Prolog",
"bytes": "8643"
},
{
"name": "Python",
"bytes": "1435440"
},
{
"name": "R",
"bytes": "120761"
},
{
"name": "Ruby",
"bytes": "17850"
},
{
"name": "Scala",
"bytes": "444582"
},
{
"name": "Shell",
"bytes": "3247622"
},
{
"name": "TeX",
"bytes": "10853"
},
{
"name": "Thrift",
"bytes": "5968"
},
{
"name": "VimL",
"bytes": "7505"
},
{
"name": "Visual Basic",
"bytes": "1223"
},
{
"name": "XSLT",
"bytes": "19271"
}
],
"symlink_target": ""
} |
/*
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
* \brief Common definitions and declarations for the library USB Audio 1.0 Class driver.
*
* Common definitions and declarations for the library USB Audio 1.0 Class driver.
*
* \note This file should not be included directly. It is automatically included as needed by the USB module driver
* dispatch header located in LUFA/Drivers/USB.h.
*/
/** \ingroup Group_USBClassAudio
* \defgroup Group_USBClassAudioCommon Common Class Definitions
*
* \section Sec_ModDescription Module Description
* Constants, Types and Enum definitions that are common to both Device and Host modes for the USB
* Audio 1.0 Class.
*
* @{
*/
#ifndef _AUDIO_CLASS_COMMON_H_
#define _AUDIO_CLASS_COMMON_H_
/* Includes: */
#include "../../Core/StdDescriptors.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_AUDIO_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Macros: */
/** \name Audio Channel Masks */
//@{
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_LEFT_FRONT (1 << 0)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_RIGHT_FRONT (1 << 1)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_CENTER_FRONT (1 << 2)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_LOW_FREQ_ENHANCE (1 << 3)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_LEFT_SURROUND (1 << 4)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_RIGHT_SURROUND (1 << 5)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_LEFT_OF_CENTER (1 << 6)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_RIGHT_OF_CENTER (1 << 7)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_SURROUND (1 << 8)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_SIDE_LEFT (1 << 9)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_SIDE_RIGHT (1 << 10)
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_CHANNEL_TOP (1 << 11)
//@}
/** \name Audio Feature Masks */
//@{
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_MUTE (1 << 0)
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_VOLUME (1 << 1)
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_BASS (1 << 2)
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_MID (1 << 3)
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_TREBLE (1 << 4)
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_GRAPHIC_EQUALIZER (1 << 5)
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_AUTOMATIC_GAIN (1 << 6)
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_DELAY (1 << 7)
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_BASS_BOOST (1 << 8)
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define AUDIO_FEATURE_BASS_LOUDNESS (1 << 9)
//@}
/** \name Audio Terminal Types */
//@{
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_UNDEFINED 0x0100
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_STREAMING 0x0101
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_VENDOR 0x01FF
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_UNDEFINED 0x0200
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_MIC 0x0201
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_DESKTOP_MIC 0x0202
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_PERSONAL_MIC 0x0203
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_OMNIDIR_MIC 0x0204
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_MIC_ARRAY 0x0205
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_PROCESSING_MIC 0x0206
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_IN_OUT_UNDEFINED 0x0300
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_SPEAKER 0x0301
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_HEADPHONES 0x0302
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_HEAD_MOUNTED 0x0303
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_DESKTOP 0x0304
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_ROOM 0x0305
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_COMMUNICATION 0x0306
/** Terminal type constant for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define AUDIO_TERMINAL_OUT_LOWFREQ 0x0307
//@}
/** Convenience macro to fill a 24-bit \ref USB_Audio_SampleFreq_t structure with the given sample rate as a 24-bit number.
*
* \param[in] freq Required audio sampling frequency in HZ
*/
#define AUDIO_SAMPLE_FREQ(freq) {.Byte1 = ((uint32_t)freq & 0xFF), .Byte2 = (((uint32_t)freq >> 8) & 0xFF), .Byte3 = (((uint32_t)freq >> 16) & 0xFF)}
/** Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint
* accepts only filled endpoint packets of audio samples.
*/
#define AUDIO_EP_FULL_PACKETS_ONLY (1 << 7)
/** Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint
* will accept partially filled endpoint packets of audio samples.
*/
#define AUDIO_EP_ACCEPTS_SMALL_PACKETS (0 << 7)
/** Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint
* allows for sampling frequency adjustments to be made via control requests directed at the endpoint.
*/
#define AUDIO_EP_SAMPLE_FREQ_CONTROL (1 << 0)
/** Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint
* allows for pitch adjustments to be made via control requests directed at the endpoint.
*/
#define AUDIO_EP_PITCH_CONTROL (1 << 1)
/* Enums: */
/** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Audio
* device class.
*/
enum Audio_Descriptor_ClassSubclassProtocol_t
{
AUDIO_CSCP_AudioClass = 0x01, /**< Descriptor Class value indicating that the device or
* interface belongs to the USB Audio 1.0 class.
*/
AUDIO_CSCP_ControlSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or
* interface belongs to the Audio Control subclass.
*/
AUDIO_CSCP_ControlProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or
* interface belongs to the Audio Control protocol.
*/
AUDIO_CSCP_AudioStreamingSubclass = 0x02, /**< Descriptor Subclass value indicating that the device or
* interface belongs to the MIDI Streaming subclass.
*/
AUDIO_CSCP_MIDIStreamingSubclass = 0x03, /**< Descriptor Subclass value indicating that the device or
* interface belongs to the Audio streaming subclass.
*/
AUDIO_CSCP_StreamingProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or
* interface belongs to the Streaming Audio protocol.
*/
};
/** Audio class specific interface description subtypes, for the Audio Control interface. */
enum Audio_CSInterface_AC_SubTypes_t
{
AUDIO_DSUBTYPE_CSInterface_Header = 0x01, /**< Audio class specific control interface header. */
AUDIO_DSUBTYPE_CSInterface_InputTerminal = 0x02, /**< Audio class specific control interface Input Terminal. */
AUDIO_DSUBTYPE_CSInterface_OutputTerminal = 0x03, /**< Audio class specific control interface Output Terminal. */
AUDIO_DSUBTYPE_CSInterface_Mixer = 0x04, /**< Audio class specific control interface Mixer Unit. */
AUDIO_DSUBTYPE_CSInterface_Selector = 0x05, /**< Audio class specific control interface Selector Unit. */
AUDIO_DSUBTYPE_CSInterface_Feature = 0x06, /**< Audio class specific control interface Feature Unit. */
AUDIO_DSUBTYPE_CSInterface_Processing = 0x07, /**< Audio class specific control interface Processing Unit. */
AUDIO_DSUBTYPE_CSInterface_Extension = 0x08, /**< Audio class specific control interface Extension Unit. */
};
/** Audio class specific interface description subtypes, for the Audio Streaming interface. */
enum Audio_CSInterface_AS_SubTypes_t
{
AUDIO_DSUBTYPE_CSInterface_General = 0x01, /**< Audio class specific streaming interface general descriptor. */
AUDIO_DSUBTYPE_CSInterface_FormatType = 0x02, /**< Audio class specific streaming interface format type descriptor. */
AUDIO_DSUBTYPE_CSInterface_FormatSpecific = 0x03, /**< Audio class specific streaming interface format information descriptor. */
};
/** Audio class specific endpoint description subtypes, for the Audio Streaming interface. */
enum Audio_CSEndpoint_SubTypes_t
{
AUDIO_DSUBTYPE_CSEndpoint_General = 0x01, /**< Audio class specific endpoint general descriptor. */
};
/** Enum for the Audio class specific control requests that can be issued by the USB bus host. */
enum Audio_ClassRequests_t
{
AUDIO_REQ_SetCurrent = 0x01, /**< Audio class-specific request to set the current value of a parameter within the device. */
AUDIO_REQ_SetMinimum = 0x02, /**< Audio class-specific request to set the minimum value of a parameter within the device. */
AUDIO_REQ_SetMaximum = 0x03, /**< Audio class-specific request to set the maximum value of a parameter within the device. */
AUDIO_REQ_SetResolution = 0x04, /**< Audio class-specific request to set the resolution value of a parameter within the device. */
AUDIO_REQ_SetMemory = 0x05, /**< Audio class-specific request to set the memory value of a parameter within the device. */
AUDIO_REQ_GetCurrent = 0x81, /**< Audio class-specific request to get the current value of a parameter within the device. */
AUDIO_REQ_GetMinimum = 0x82, /**< Audio class-specific request to get the minimum value of a parameter within the device. */
AUDIO_REQ_GetMaximum = 0x83, /**< Audio class-specific request to get the maximum value of a parameter within the device. */
AUDIO_REQ_GetResolution = 0x84, /**< Audio class-specific request to get the resolution value of a parameter within the device. */
AUDIO_REQ_GetMemory = 0x85, /**< Audio class-specific request to get the memory value of a parameter within the device. */
AUDIO_REQ_GetStatus = 0xFF, /**< Audio class-specific request to get the device status. */
};
/** Enum for Audio class specific Endpoint control modifiers which can be set and retrieved by a USB host, if the corresponding
* endpoint control is indicated to be supported in the Endpoint's Audio-class specific endpoint descriptor.
*/
enum Audio_EndpointControls_t
{
AUDIO_EPCONTROL_SamplingFreq = 0x01, /**< Sampling frequency adjustment of the endpoint. */
AUDIO_EPCONTROL_Pitch = 0x02, /**< Pitch adjustment of the endpoint. */
};
/* Type Defines: */
/** \brief Audio class-specific Input Terminal Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific input terminal descriptor. This indicates to the host that the device
* contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example,
* a USB endpoint). See the USB Audio specification for more details.
*
* \see \ref USB_Audio_StdDescriptor_InputTerminal_t for the version of this type with standard element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_InputTerminal.
*/
uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
uint16_t TerminalType; /**< Type of terminal, a \c TERMINAL_* mask. */
uint8_t AssociatedOutputTerminal; /**< ID of associated output terminal, for physically grouped terminals
* such as the speaker and microphone of a phone handset.
*/
uint8_t TotalChannels; /**< Total number of separate audio channels within this interface (right, left, etc.) */
uint16_t ChannelConfig; /**< \c CHANNEL_* masks indicating what channel layout is supported by this terminal. */
uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device. */
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
} ATTR_PACKED USB_Audio_Descriptor_InputTerminal_t;
/** \brief Audio class-specific Input Terminal Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific input terminal descriptor. This indicates to the host that the device
* contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example,
* a USB endpoint). See the USB Audio specification for more details.
*
* \see \ref USB_Audio_Descriptor_InputTerminal_t for the version of this type with non-standard LUFA specific
* element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_InputTerminal.
*/
uint8_t bTerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
uint16_t wTerminalType; /**< Type of terminal, a \c TERMINAL_* mask. */
uint8_t bAssocTerminal; /**< ID of associated output terminal, for physically grouped terminals
* such as the speaker and microphone of a phone handset.
*/
uint8_t bNrChannels; /**< Total number of separate audio channels within this interface (right, left, etc.) */
uint16_t wChannelConfig; /**< \c CHANNEL_* masks indicating what channel layout is supported by this terminal. */
uint8_t iChannelNames; /**< Index of a string descriptor describing this channel within the device. */
uint8_t iTerminal; /**< Index of a string descriptor describing this descriptor within the device. */
} ATTR_PACKED USB_Audio_StdDescriptor_InputTerminal_t;
/** \brief Audio class-specific Output Terminal Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific output terminal descriptor. This indicates to the host that the device
* contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example,
* a USB endpoint). See the USB Audio specification for more details.
*
* \see \ref USB_Audio_StdDescriptor_OutputTerminal_t for the version of this type with standard element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_OutputTerminal.
*/
uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
uint16_t TerminalType; /**< Type of terminal, a \c TERMINAL_* mask. */
uint8_t AssociatedInputTerminal; /**< ID of associated input terminal, for physically grouped terminals
* such as the speaker and microphone of a phone handset.
*/
uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from. */
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
} ATTR_PACKED USB_Audio_Descriptor_OutputTerminal_t;
/** \brief Audio class-specific Output Terminal Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific output terminal descriptor. This indicates to the host that the device
* contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example,
* a USB endpoint). See the USB Audio specification for more details.
*
* \see \ref USB_Audio_Descriptor_OutputTerminal_t for the version of this type with non-standard LUFA specific
* element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_OutputTerminal.
*/
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AC_SubTypes_t enum.
*/
uint8_t bTerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
uint16_t wTerminalType; /**< Type of terminal, a \c TERMINAL_* mask. */
uint8_t bAssocTerminal; /**< ID of associated input terminal, for physically grouped terminals
* such as the speaker and microphone of a phone handset.
*/
uint8_t bSourceID; /**< ID value of the unit this terminal's audio is sourced from. */
uint8_t iTerminal; /**< Index of a string descriptor describing this descriptor within the device. */
} ATTR_PACKED USB_Audio_StdDescriptor_OutputTerminal_t;
/** \brief Audio class-specific Interface Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
* supply extra information about the audio device's layout to the host. See the USB Audio specification for more
* details.
*
* \see \ref USB_Audio_StdDescriptor_Interface_AC_t for the version of this type with standard element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
uint16_t ACSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
uint16_t TotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
uint8_t InCollection; /**< Total number of Audio Streaming interfaces linked to this Audio Control interface (must be 1). */
uint8_t InterfaceNumber; /**< Interface number of the associated Audio Streaming interface. */
} ATTR_PACKED USB_Audio_Descriptor_Interface_AC_t;
/** \brief Audio class-specific Interface Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
* supply extra information about the audio device's layout to the host. See the USB Audio specification for more
* details.
*
* \see \ref USB_Audio_Descriptor_Interface_AC_t for the version of this type with non-standard LUFA specific
* element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubtype;/**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
uint16_t bcdADC; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
uint16_t wTotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
uint8_t bInCollection; /**< Total number of Audio Streaming interfaces linked to this Audio Control interface (must be 1). */
uint8_t bInterfaceNumbers; /**< Interface number of the associated Audio Streaming interface. */
} ATTR_PACKED USB_Audio_StdDescriptor_Interface_AC_t;
/** \brief Audio class-specific Feature Unit Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific Feature Unit descriptor. This indicates to the host what features
* are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
* specification for more details.
*
* \see \ref USB_Audio_StdDescriptor_FeatureUnit_t for the version of this type with standard element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_Feature.
*/
uint8_t UnitID; /**< ID value of this feature unit - must be a unique value within the device. */
uint8_t SourceID; /**< Source ID value of the audio source input into this feature unit. */
uint8_t ControlSize; /**< Size of each element in the \c ChannelControls array. */
uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
} ATTR_PACKED USB_Audio_Descriptor_FeatureUnit_t;
/** \brief Audio class-specific Feature Unit Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific Feature Unit descriptor. This indicates to the host what features
* are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
* specification for more details.
*
* \see \ref USB_Audio_Descriptor_FeatureUnit_t for the version of this type with non-standard LUFA specific
* element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_Feature.
*/
uint8_t bUnitID; /**< ID value of this feature unit - must be a unique value within the device. */
uint8_t bSourceID; /**< Source ID value of the audio source input into this feature unit. */
uint8_t bControlSize; /**< Size of each element in the \c ChannelControls array. */
uint8_t bmaControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
uint8_t iFeature; /**< Index of a string descriptor describing this descriptor within the device. */
} ATTR_PACKED USB_Audio_StdDescriptor_FeatureUnit_t;
/** \brief Audio class-specific Streaming Audio Interface Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific streaming interface descriptor. This indicates to the host
* how audio streams within the device are formatted. See the USB Audio specification for more details.
*
* \see \ref USB_Audio_StdDescriptor_Interface_AS_t for the version of this type with standard element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
uint8_t TerminalLink; /**< ID value of the output terminal this descriptor is describing. */
uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output. */
uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification. */
} ATTR_PACKED USB_Audio_Descriptor_Interface_AS_t;
/** \brief Audio class-specific Streaming Audio Interface Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific streaming interface descriptor. This indicates to the host
* how audio streams within the device are formatted. See the USB Audio specification for more details.
*
* \see \ref USB_Audio_Descriptor_Interface_AS_t for the version of this type with non-standard LUFA specific
* element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
uint8_t bTerminalLink; /**< ID value of the output terminal this descriptor is describing. */
uint8_t bDelay; /**< Delay in frames resulting from the complete sample processing from input to output. */
uint16_t wFormatTag; /**< Format of the audio stream, see Audio Device Formats specification. */
} ATTR_PACKED USB_Audio_StdDescriptor_Interface_AS_t;
/** \brief Audio class-specific Format Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific audio format descriptor. This is used to give the host full details
* about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
* in the device's audio streams. See the USB Audio specification for more details.
*
* \attention This descriptor <b>must</b> be followed by one or more \ref USB_Audio_SampleFreq_t elements containing
* the continuous or discrete sample frequencies.
*
* \see \ref USB_Audio_StdDescriptor_Format_t for the version of this type with standard element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_FormatType.
*/
uint8_t FormatType; /**< Format of the audio stream, see Audio Device Formats specification. */
uint8_t Channels; /**< Total number of discrete channels in the stream. */
uint8_t SubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */
uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream. */
uint8_t TotalDiscreteSampleRates; /**< Total number of discrete sample frequencies supported by the device. When
* zero, this must be followed by the lower and upper continuous sampling
* frequencies supported by the device; otherwise, this must be followed
* by the given number of discrete sampling frequencies supported.
*/
} ATTR_PACKED USB_Audio_Descriptor_Format_t;
/** \brief 24-Bit Audio Frequency Structure.
*
* Type define for a 24bit audio sample frequency structure. As GCC does not contain a built in 24-bit datatype,
* this this structure is used to build up the value instead. Fill this structure with the \ref AUDIO_SAMPLE_FREQ() macro.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
uint8_t Byte1; /**< Lowest 8 bits of the 24-bit value. */
uint8_t Byte2; /**< Middle 8 bits of the 24-bit value. */
uint8_t Byte3; /**< Upper 8 bits of the 24-bit value. */
} ATTR_PACKED USB_Audio_SampleFreq_t;
/** \brief Audio class-specific Format Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific audio format descriptor. This is used to give the host full details
* about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
* in the device's audio streams. See the USB Audio specification for more details.
*
* \attention This descriptor <b>must</b> be followed by one or more 24-bit integer elements containing the continuous
* or discrete sample frequencies.
*
* \see \ref USB_Audio_Descriptor_Format_t for the version of this type with non-standard LUFA specific
* element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_FormatType.
*/
uint8_t bDescriptorSubtype;/**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
uint8_t bFormatType; /**< Format of the audio stream, see Audio Device Formats specification. */
uint8_t bNrChannels; /**< Total number of discrete channels in the stream. */
uint8_t bSubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */
uint8_t bBitResolution; /**< Bits of resolution of each channel's samples in the stream. */
uint8_t bSampleFrequencyType; /**< Total number of sample frequencies supported by the device. When
* zero, this must be followed by the lower and upper continuous sampling
* frequencies supported by the device; otherwise, this must be followed
* by the given number of discrete sampling frequencies supported.
*/
} ATTR_PACKED USB_Audio_StdDescriptor_Format_t;
/** \brief Audio class-specific Streaming Endpoint Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific endpoint descriptor. This contains a regular endpoint
* descriptor with a few Audio-class-specific extensions. See the USB Audio specification for more details.
*
* \see \ref USB_Audio_StdDescriptor_StreamEndpoint_Std_t for the version of this type with standard element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
USB_Descriptor_Endpoint_t Endpoint; /**< Standard endpoint descriptor describing the audio endpoint. */
uint8_t Refresh; /**< Always set to zero for Audio class devices. */
uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronization information to, if needed (zero otherwise). */
} ATTR_PACKED USB_Audio_Descriptor_StreamEndpoint_Std_t;
/** \brief Audio class-specific Streaming Endpoint Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific endpoint descriptor. This contains a regular endpoint
* descriptor with a few Audio-class-specific extensions. See the USB Audio specification for more details.
*
* \see \ref USB_Audio_Descriptor_StreamEndpoint_Std_t for the version of this type with non-standard LUFA specific
* element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a
* value given by the specific class.
*/
uint8_t bEndpointAddress; /**< Logical address of the endpoint within the device for the current
* configuration, including direction mask.
*/
uint8_t bmAttributes; /**< Endpoint attributes, comprised of a mask of the endpoint type (\c EP_TYPE_*)
* and attributes (\c ENDPOINT_ATTR_*) masks.
*/
uint16_t wMaxPacketSize; /**< Size of the endpoint bank, in bytes. This indicates the maximum packet size
* that the endpoint can receive at a time.
*/
uint8_t bInterval; /**< Polling interval in milliseconds for the endpoint if it is an INTERRUPT or
* ISOCHRONOUS type.
*/
uint8_t bRefresh; /**< Always set to zero for Audio class devices. */
uint8_t bSynchAddress; /**< Endpoint address to send synchronization information to, if needed (zero otherwise). */
} ATTR_PACKED USB_Audio_StdDescriptor_StreamEndpoint_Std_t;
/** \brief Audio class-specific Extended Endpoint Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific extended endpoint descriptor. This contains extra information
* on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio
* class-specific extended endpoint descriptor. See the USB Audio specification for more details.
*
* \see \ref USB_Audio_StdDescriptor_StreamEndpoint_Spc_t for the version of this type with standard element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSEndpoint_SubTypes_t enum.
*/
uint8_t Attributes; /**< Audio class-specific endpoint attributes, such as \ref AUDIO_EP_FULL_PACKETS_ONLY. */
uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification. */
uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry. */
} ATTR_PACKED USB_Audio_Descriptor_StreamEndpoint_Spc_t;
/** \brief Audio class-specific Extended Endpoint Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific extended endpoint descriptor. This contains extra information
* on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio
* class-specific extended endpoint descriptor. See the USB Audio specification for more details.
*
* \see \ref USB_Audio_Descriptor_StreamEndpoint_Spc_t for the version of this type with non-standard LUFA specific
* element names.
*
* \note Regardless of CPU architecture, these values should be stored as little endian.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSEndpoint_SubTypes_t enum.
*/
uint8_t bmAttributes; /**< Audio class-specific endpoint attributes, such as \ref AUDIO_EP_FULL_PACKETS_ONLY. */
uint8_t bLockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification. */
uint16_t wLockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry. */
} ATTR_PACKED USB_Audio_StdDescriptor_StreamEndpoint_Spc_t;
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */
| {
"content_hash": "b9fed31c47d9ea85b1154cf06002dd97",
"timestamp": "",
"source": "github",
"line_count": 768,
"max_line_length": 161,
"avg_line_length": 58.467447916666664,
"alnum_prop": 0.6650335166915351,
"repo_name": "satlab/bluebox",
"id": "e97e7c9d622b54446ce8cb6f910e324c506387b6",
"size": "45041",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "software/firmware/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "738508"
},
{
"name": "C++",
"bytes": "496300"
},
{
"name": "CSS",
"bytes": "1566"
},
{
"name": "Objective-C",
"bytes": "6801"
}
],
"symlink_target": ""
} |
package com.microsoft.bingads.v12.campaignmanagement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DynamicSearchAd complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="DynamicSearchAd">
* <complexContent>
* <extension base="{https://bingads.microsoft.com/CampaignManagement/v12}Ad">
* <sequence>
* <element name="Path1" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="Path2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="Text" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DynamicSearchAd", propOrder = {
"path1",
"path2",
"text"
})
public class DynamicSearchAd
extends Ad
{
@XmlElement(name = "Path1", nillable = true)
protected String path1;
@XmlElement(name = "Path2", nillable = true)
protected String path2;
@XmlElement(name = "Text", nillable = true)
protected String text;
/**
* Gets the value of the path1 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPath1() {
return path1;
}
/**
* Sets the value of the path1 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPath1(String value) {
this.path1 = value;
}
/**
* Gets the value of the path2 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPath2() {
return path2;
}
/**
* Sets the value of the path2 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPath2(String value) {
this.path2 = value;
}
/**
* Gets the value of the text property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getText() {
return text;
}
/**
* Sets the value of the text property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setText(String value) {
this.text = value;
}
}
| {
"content_hash": "0e0ae84d340a606137358405e7f7cc9c",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 99,
"avg_line_length": 22.841666666666665,
"alnum_prop": 0.565487048522437,
"repo_name": "bing-ads-sdk/BingAds-Java-SDK",
"id": "775ebb81d98a79c02b562d2558381993d8ab322a",
"size": "2741",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "proxies/com/microsoft/bingads/v12/campaignmanagement/DynamicSearchAd.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2059"
},
{
"name": "Java",
"bytes": "9842387"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "8a578f76244eb14682c7857df5a29c41",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "44c27bc49ee9e89f0ddcc5e5c3c2d8e5fda9afd2",
"size": "190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/incertae sedis/Jacobaea maritima/ Syn. Senecio bicolor bicolor/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
cp ./podiobooks-centos-base/epel.repo /etc/yum.repos.d/epel.repo
cp ./podiobooks-centos-base/postgresql.repo /etc/yum.repos.d/postgresql.repo
cp ./podiobooks-centos-base/CentOS-fasttrack.repo /etc/yum.repos.d/CentOS-fasttrack.repo
# Update centos
yum update -y --nogpgcheck && yum upgrade -y --nogpgcheck
# Install compiler
yum install -y gcc
# Install Sudo
yum install -y sudo
# Install & Upgrade pip
yum install -y --nogpgcheck python-pip
pip install --upgrade pip
# Install Postgres Client
yum install -y --disablerepo=* --enablerepo=postgresql postgresql-devel
ln -s /usr/pgsql-9.3/bin/pg_config /usr/local/bin/pg_config
# Install git
yum install -y git
# Install supervisor
pip install supervisor
# Create podiobooks user
useradd -u 451 podiobooks -c "Podiobooks User"
echo 'podiobooks ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Create Podiobooks Directory
mkdir /opt/podiobooks
mkdir /opt/podiobooks/data
## Postgres
# Install Prereqs
yum install -y libxslt uuid
# Install PostgreSQL
yum install -y postgresql-server postgresql-libs postgresql-contrib postgresql-devel --disablerepo=* --enablerepo=postgresql
# Add Postgres User to podiobooks Group
usermod -G podiobooks postgres
# Add postgres init file
cp podiobooks-db/postgres-initial-setup.sh /opt/podiobooks/postgres-initial-setup.sh
chown postgres.postgres /opt/podiobooks/postgres-initial-setup.sh
# Set up DNS aliases
echo "127.0.0.1 db" >> /etc/cloud/templates/hosts.redhat.tmpl
echo "127.0.0.1 db" >> /etc/hosts
## Redis
yum install -y --nogpgcheck redis
# Add redis User to podiobooks Group
usermod -G podiobooks redis
# Copy redis config for local editing
cp /etc/redis.conf /opt/podiobooks/data/redis.conf
# Set up DNS aliases
echo "127.0.0.1 redis" >> /etc/cloud/templates/hosts.redhat.tmpl
echo "127.0.0.1 redis" >> /etc/hosts
# Start Redis
systemctl start redis
## Varnish
yum update -y --nogpgcheck && yum upgrade -y --nogpgcheck
# Install Varnish
rpm --nosignature -i https://repo.varnish-cache.org/redhat/varnish-4.1.el7.rpm
yum install -y --nogpgcheck varnish
# Add Vanish User to podiobooks Group
usermod -G podiobooks varnish
## Web
# Install Development Tools & OpenSSL
yum install -y python-devel libxml2-devel pcre-devel jansson-devel libcap-devel uuid-devel sqlite-devel \
openldap-devel libyaml-devel make openssl-devel openssl
# Install Pillow Pre-Requisites
yum install -y libjpeg libjpeg-devel zlib zlib-devel libtiff libtiff-devel libfreetype libfreetype-devel \
littlecms littlecms-devel libwebp libwebp-devel openjpeg openjpeg-devel
# Install Python 2.7.10
yum install -y wget \
&& wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz \
&& tar -xf Python-2.7.10.tgz \
&& cd Python-2.7.10 \
&& ./configure --prefix /usr/local \
&& make altinstall
# Install pip
wget https://bootstrap.pypa.io/get-pip.py \
&& /usr/local/bin/python2.7 ./get-pip.py
# Install virtualenv
/usr/local/bin/pip install virtualenv
# Add nginx official repository
cp ./podiobooks-web/nginx.repo /etc/yum.repos.d/nginx.repo
# Install nginx
yum install -y --disablerepo=* --enablerepo=nginx nginx
# Add nginx to user group
usermod -G podiobooks nginx
# Add Supervisor Config File
cp ./podiobooks-web/supervisord.conf /opt/podiobooks/supervisord.conf
# Add Supervisor Stat
# Add initial setup file
cp ./podiobooks-web/podiobooks-initial-setup.sh /opt/podiobooks/podiobooks-initial-setup.sh
# Final Permissions Check
chown -R podiobooks.podiobooks /opt/podiobooks
chmod -R g+rwx /opt/podiobooks
# Run su - postgres
# Run /opt/podiobooks/postgres-initial-setup.sh
# Run /usr/pgsql-9.3/bin/postgres -D /opt/podiobooks/data/db/ > /opt/podiobooks/data/db/postgres.log 2>&1 &
# Run exit;su - podiobooks
# Run /opt/podiobooks/podiobooks-initial-setup.sh
# A) Make note of the SSH key you saw output from step 4.
# E) Go to GitHub.com/podiobooks in your web browser
# F) Log in as podiobooks
# G) Go to settings
# H) Go to SSH Keys
# I) Add Key
# J) Name it "Docker <x>"
# K) Paste in the ssh key you copied.
# L) Save
# Run /opt/podiobooks/data/podiobooks/devscripts/docker/podiobooks_get_alldata.sh
# Run /opt/podiobooks/data/podiobooks/devscripts/docker/podiobooks_get_dep.sh
# Run supervisord -c /opt/podiobooks/data/supervisord.conf | {
"content_hash": "c2fa3902f1ca2baff59cd96bd6a2d8ca",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 124,
"avg_line_length": 29.23972602739726,
"alnum_prop": 0.7531037713750293,
"repo_name": "podiobooks/podiobooks_docker",
"id": "0940e91bc37a5e06afd39bb21cb546f20e00c62f",
"size": "4569",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "non-docker-install.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Shell",
"bytes": "13385"
}
],
"symlink_target": ""
} |
import urllib
from time import time
from unittest import main, TestCase
from test.unit import FakeLogger
from copy import deepcopy
import mock
from swift.common import internal_client
from swift.obj import expirer
def not_random():
return 0.5
last_not_sleep = 0
def not_sleep(seconds):
global last_not_sleep
last_not_sleep = seconds
class TestObjectExpirer(TestCase):
maxDiff = None
def setUp(self):
global not_sleep
self.old_loadapp = internal_client.loadapp
self.old_sleep = internal_client.sleep
internal_client.loadapp = lambda x: None
internal_client.sleep = not_sleep
def teardown(self):
internal_client.sleep = self.old_sleep
internal_client.loadapp = self.loadapp
def test_get_process_values_from_kwargs(self):
x = expirer.ObjectExpirer({})
vals = {
'processes': 5,
'process': 1,
}
self.assertEqual((5, 1), x.get_process_values(vals))
def test_get_process_values_from_config(self):
vals = {
'processes': 5,
'process': 1,
}
x = expirer.ObjectExpirer(vals)
self.assertEqual((5, 1), x.get_process_values({}))
def test_get_process_values_negative_process(self):
vals = {
'processes': 5,
'process': -1,
}
# from config
x = expirer.ObjectExpirer(vals)
self.assertRaises(ValueError, x.get_process_values, {})
# from kwargs
x = expirer.ObjectExpirer({})
self.assertRaises(ValueError, x.get_process_values, vals)
def test_get_process_values_negative_processes(self):
vals = {
'processes': -5,
'process': 1,
}
# from config
x = expirer.ObjectExpirer(vals)
self.assertRaises(ValueError, x.get_process_values, {})
# from kwargs
x = expirer.ObjectExpirer({})
self.assertRaises(ValueError, x.get_process_values, vals)
def test_get_process_values_process_greater_than_processes(self):
vals = {
'processes': 5,
'process': 7,
}
# from config
x = expirer.ObjectExpirer(vals)
self.assertRaises(ValueError, x.get_process_values, {})
# from kwargs
x = expirer.ObjectExpirer({})
self.assertRaises(ValueError, x.get_process_values, vals)
def test_init_concurrency_too_small(self):
conf = {
'concurrency': 0,
}
self.assertRaises(ValueError, expirer.ObjectExpirer, conf)
conf = {
'concurrency': -1,
}
self.assertRaises(ValueError, expirer.ObjectExpirer, conf)
def test_process_based_concurrency(self):
class ObjectExpirer(expirer.ObjectExpirer):
def __init__(self, conf):
super(ObjectExpirer, self).__init__(conf)
self.processes = 3
self.deleted_objects = {}
def delete_object(self, actual_obj, timestamp, container, obj):
if container not in self.deleted_objects:
self.deleted_objects[container] = set()
self.deleted_objects[container].add(obj)
class InternalClient(object):
def __init__(self, containers):
self.containers = containers
def get_account_info(self, *a, **kw):
return len(self.containers.keys()), \
sum([len(self.containers[x]) for x in self.containers])
def iter_containers(self, *a, **kw):
return [{'name': x} for x in self.containers.keys()]
def iter_objects(self, account, container):
return [{'name': x} for x in self.containers[container]]
def delete_container(*a, **kw):
pass
containers = {
0: set('1-one 2-two 3-three'.split()),
1: set('2-two 3-three 4-four'.split()),
2: set('5-five 6-six'.split()),
3: set('7-seven'.split()),
}
x = ObjectExpirer({})
x.swift = InternalClient(containers)
deleted_objects = {}
for i in xrange(0, 3):
x.process = i
x.run_once()
self.assertNotEqual(deleted_objects, x.deleted_objects)
deleted_objects = deepcopy(x.deleted_objects)
self.assertEqual(containers, deleted_objects)
def test_delete_object(self):
class InternalClient(object):
def __init__(self, test, account, container, obj):
self.test = test
self.account = account
self.container = container
self.obj = obj
self.delete_object_called = False
def delete_object(self, account, container, obj):
self.test.assertEqual(self.account, account)
self.test.assertEqual(self.container, container)
self.test.assertEqual(self.obj, obj)
self.delete_object_called = True
class DeleteActualObject(object):
def __init__(self, test, actual_obj, timestamp):
self.test = test
self.actual_obj = actual_obj
self.timestamp = timestamp
self.called = False
def __call__(self, actual_obj, timestamp):
self.test.assertEqual(self.actual_obj, actual_obj)
self.test.assertEqual(self.timestamp, timestamp)
self.called = True
container = 'container'
obj = 'obj'
actual_obj = 'actual_obj'
timestamp = 'timestamp'
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
x.swift = \
InternalClient(self, x.expiring_objects_account, container, obj)
x.delete_actual_object = \
DeleteActualObject(self, actual_obj, timestamp)
x.delete_object(actual_obj, timestamp, container, obj)
self.assertTrue(x.swift.delete_object_called)
self.assertTrue(x.delete_actual_object.called)
def test_report(self):
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
x.report()
self.assertEqual(x.logger.log_dict['info'], [])
x.logger._clear()
x.report(final=True)
self.assertTrue('completed' in x.logger.log_dict['info'][-1][0][0],
x.logger.log_dict['info'])
self.assertTrue('so far' not in x.logger.log_dict['info'][-1][0][0],
x.logger.log_dict['info'])
x.logger._clear()
x.report_last_time = time() - x.report_interval
x.report()
self.assertTrue('completed' not in x.logger.log_dict['info'][-1][0][0],
x.logger.log_dict['info'])
self.assertTrue('so far' in x.logger.log_dict['info'][-1][0][0],
x.logger.log_dict['info'])
def test_run_once_nothing_to_do(self):
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
x.swift = 'throw error because a string does not have needed methods'
x.run_once()
self.assertEqual(x.logger.log_dict['exception'],
[(("Unhandled exception",), {},
"'str' object has no attribute "
"'get_account_info'")])
def test_run_once_calls_report(self):
class InternalClient(object):
def get_account_info(*a, **kw):
return 1, 2
def iter_containers(*a, **kw):
return []
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
x.swift = InternalClient()
x.run_once()
self.assertEqual(
x.logger.log_dict['info'],
[(('Pass beginning; 1 possible containers; '
'2 possible objects',), {}),
(('Pass completed in 0s; 0 objects expired',), {})])
def test_container_timestamp_break(self):
class InternalClient(object):
def __init__(self, containers):
self.containers = containers
def get_account_info(*a, **kw):
return 1, 2
def iter_containers(self, *a, **kw):
return self.containers
def iter_objects(*a, **kw):
raise Exception('This should not have been called')
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
x.swift = InternalClient([{'name': str(int(time() + 86400))}])
x.run_once()
for exccall in x.logger.log_dict['exception']:
self.assertTrue(
'This should not have been called' not in exccall[0][0])
self.assertEqual(
x.logger.log_dict['info'],
[(('Pass beginning; 1 possible containers; '
'2 possible objects',), {}),
(('Pass completed in 0s; 0 objects expired',), {})])
# Reverse test to be sure it still would blow up the way expected.
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
x.swift = InternalClient([{'name': str(int(time() - 86400))}])
x.run_once()
self.assertEqual(
x.logger.log_dict['exception'],
[(('Unhandled exception',), {},
str(Exception('This should not have been called')))])
def test_object_timestamp_break(self):
class InternalClient(object):
def __init__(self, containers, objects):
self.containers = containers
self.objects = objects
def get_account_info(*a, **kw):
return 1, 2
def iter_containers(self, *a, **kw):
return self.containers
def delete_container(*a, **kw):
pass
def iter_objects(self, *a, **kw):
return self.objects
def should_not_be_called(*a, **kw):
raise Exception('This should not have been called')
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
x.swift = InternalClient(
[{'name': str(int(time() - 86400))}],
[{'name': '%d-actual-obj' % int(time() + 86400)}])
x.run_once()
for exccall in x.logger.log_dict['exception']:
self.assertTrue(
'This should not have been called' not in exccall[0][0])
self.assertEqual(
x.logger.log_dict['info'],
[(('Pass beginning; 1 possible containers; '
'2 possible objects',), {}),
(('Pass completed in 0s; 0 objects expired',), {})])
# Reverse test to be sure it still would blow up the way expected.
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
ts = int(time() - 86400)
x.swift = InternalClient(
[{'name': str(int(time() - 86400))}],
[{'name': '%d-actual-obj' % ts}])
x.delete_actual_object = should_not_be_called
x.run_once()
excswhiledeleting = []
for exccall in x.logger.log_dict['exception']:
if exccall[0][0].startswith('Exception while deleting '):
excswhiledeleting.append(exccall[0][0])
self.assertEqual(
excswhiledeleting,
['Exception while deleting object %d %d-actual-obj '
'This should not have been called' % (ts, ts)])
def test_failed_delete_keeps_entry(self):
class InternalClient(object):
def __init__(self, containers, objects):
self.containers = containers
self.objects = objects
def get_account_info(*a, **kw):
return 1, 2
def iter_containers(self, *a, **kw):
return self.containers
def delete_container(*a, **kw):
pass
def delete_object(*a, **kw):
raise Exception('This should not have been called')
def iter_objects(self, *a, **kw):
return self.objects
def deliberately_blow_up(actual_obj, timestamp):
raise Exception('failed to delete actual object')
def should_not_get_called(container, obj):
raise Exception('This should not have been called')
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
x.iter_containers = lambda: [str(int(time() - 86400))]
ts = int(time() - 86400)
x.delete_actual_object = deliberately_blow_up
x.swift = InternalClient(
[{'name': str(int(time() - 86400))}],
[{'name': '%d-actual-obj' % ts}])
x.run_once()
excswhiledeleting = []
for exccall in x.logger.log_dict['exception']:
if exccall[0][0].startswith('Exception while deleting '):
excswhiledeleting.append(exccall[0][0])
self.assertEqual(
excswhiledeleting,
['Exception while deleting object %d %d-actual-obj '
'failed to delete actual object' % (ts, ts)])
self.assertEqual(
x.logger.log_dict['info'],
[(('Pass beginning; 1 possible containers; '
'2 possible objects',), {}),
(('Pass completed in 0s; 0 objects expired',), {})])
# Reverse test to be sure it still would blow up the way expected.
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
ts = int(time() - 86400)
x.delete_actual_object = lambda o, t: None
x.swift = InternalClient(
[{'name': str(int(time() - 86400))}],
[{'name': '%d-actual-obj' % ts}])
x.run_once()
excswhiledeleting = []
for exccall in x.logger.log_dict['exception']:
if exccall[0][0].startswith('Exception while deleting '):
excswhiledeleting.append(exccall[0][0])
self.assertEqual(
excswhiledeleting,
['Exception while deleting object %d %d-actual-obj This should '
'not have been called' % (ts, ts)])
def test_success_gets_counted(self):
class InternalClient(object):
def __init__(self, containers, objects):
self.containers = containers
self.objects = objects
def get_account_info(*a, **kw):
return 1, 2
def iter_containers(self, *a, **kw):
return self.containers
def delete_container(*a, **kw):
pass
def delete_object(*a, **kw):
pass
def iter_objects(self, *a, **kw):
return self.objects
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
x.delete_actual_object = lambda o, t: None
self.assertEqual(x.report_objects, 0)
x.swift = InternalClient(
[{'name': str(int(time() - 86400))}],
[{'name': '%d-actual-obj' % int(time() - 86400)}])
x.run_once()
self.assertEqual(x.report_objects, 1)
self.assertEqual(
x.logger.log_dict['info'],
[(('Pass beginning; 1 possible containers; '
'2 possible objects',), {}),
(('Pass completed in 0s; 1 objects expired',), {})])
def test_delete_actual_object_does_not_get_unicode(self):
class InternalClient(object):
def __init__(self, containers, objects):
self.containers = containers
self.objects = objects
def get_account_info(*a, **kw):
return 1, 2
def iter_containers(self, *a, **kw):
return self.containers
def delete_container(*a, **kw):
pass
def delete_object(*a, **kw):
pass
def iter_objects(self, *a, **kw):
return self.objects
got_unicode = [False]
def delete_actual_object_test_for_unicode(actual_obj, timestamp):
if isinstance(actual_obj, unicode):
got_unicode[0] = True
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
x.delete_actual_object = delete_actual_object_test_for_unicode
self.assertEqual(x.report_objects, 0)
x.swift = InternalClient(
[{'name': str(int(time() - 86400))}],
[{'name': u'%d-actual-obj' % int(time() - 86400)}])
x.run_once()
self.assertEqual(x.report_objects, 1)
self.assertEqual(
x.logger.log_dict['info'],
[(('Pass beginning; 1 possible containers; '
'2 possible objects',), {}),
(('Pass completed in 0s; 1 objects expired',), {})])
self.assertFalse(got_unicode[0])
def test_failed_delete_continues_on(self):
class InternalClient(object):
def __init__(self, containers, objects):
self.containers = containers
self.objects = objects
def get_account_info(*a, **kw):
return 1, 2
def iter_containers(self, *a, **kw):
return self.containers
def delete_container(*a, **kw):
raise Exception('failed to delete container')
def delete_object(*a, **kw):
pass
def iter_objects(self, *a, **kw):
return self.objects
def fail_delete_actual_object(actual_obj, timestamp):
raise Exception('failed to delete actual object')
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
cts = int(time() - 86400)
ots = int(time() - 86400)
containers = [
{'name': str(cts)},
{'name': str(cts + 1)},
]
objects = [
{'name': '%d-actual-obj' % ots},
{'name': '%d-next-obj' % ots}
]
x.swift = InternalClient(containers, objects)
x.delete_actual_object = fail_delete_actual_object
x.run_once()
excswhiledeleting = []
for exccall in x.logger.log_dict['exception']:
if exccall[0][0].startswith('Exception while deleting '):
excswhiledeleting.append(exccall[0][0])
self.assertEqual(sorted(excswhiledeleting), sorted([
'Exception while deleting object %d %d-actual-obj failed to '
'delete actual object' % (cts, ots),
'Exception while deleting object %d %d-next-obj failed to '
'delete actual object' % (cts, ots),
'Exception while deleting object %d %d-actual-obj failed to '
'delete actual object' % (cts + 1, ots),
'Exception while deleting object %d %d-next-obj failed to '
'delete actual object' % (cts + 1, ots),
'Exception while deleting container %d failed to delete '
'container' % (cts,),
'Exception while deleting container %d failed to delete '
'container' % (cts + 1,)]))
self.assertEqual(
x.logger.log_dict['info'],
[(('Pass beginning; 1 possible containers; '
'2 possible objects',), {}),
(('Pass completed in 0s; 0 objects expired',), {})])
def test_run_forever_initial_sleep_random(self):
global last_not_sleep
def raise_system_exit():
raise SystemExit('test_run_forever')
interval = 1234
x = expirer.ObjectExpirer({'__file__': 'unit_test',
'interval': interval})
orig_random = expirer.random
orig_sleep = expirer.sleep
try:
expirer.random = not_random
expirer.sleep = not_sleep
x.run_once = raise_system_exit
x.run_forever()
except SystemExit as err:
pass
finally:
expirer.random = orig_random
expirer.sleep = orig_sleep
self.assertEqual(str(err), 'test_run_forever')
self.assertEqual(last_not_sleep, 0.5 * interval)
def test_run_forever_catches_usual_exceptions(self):
raises = [0]
def raise_exceptions():
raises[0] += 1
if raises[0] < 2:
raise Exception('exception %d' % raises[0])
raise SystemExit('exiting exception %d' % raises[0])
x = expirer.ObjectExpirer({})
x.logger = FakeLogger()
orig_sleep = expirer.sleep
try:
expirer.sleep = not_sleep
x.run_once = raise_exceptions
x.run_forever()
except SystemExit as err:
pass
finally:
expirer.sleep = orig_sleep
self.assertEqual(str(err), 'exiting exception 2')
self.assertEqual(x.logger.log_dict['exception'],
[(('Unhandled exception',), {},
'exception 1')])
def test_delete_actual_object(self):
got_env = [None]
def fake_app(env, start_response):
got_env[0] = env
start_response('204 No Content', [('Content-Length', '0')])
return []
internal_client.loadapp = lambda x: fake_app
x = expirer.ObjectExpirer({})
ts = '1234'
x.delete_actual_object('/path/to/object', ts)
self.assertEqual(got_env[0]['HTTP_X_IF_DELETE_AT'], ts)
def test_delete_actual_object_nourlquoting(self):
# delete_actual_object should not do its own url quoting because
# internal client's make_request handles that.
got_env = [None]
def fake_app(env, start_response):
got_env[0] = env
start_response('204 No Content', [('Content-Length', '0')])
return []
internal_client.loadapp = lambda x: fake_app
x = expirer.ObjectExpirer({})
ts = '1234'
x.delete_actual_object('/path/to/object name', ts)
self.assertEqual(got_env[0]['HTTP_X_IF_DELETE_AT'], ts)
self.assertEqual(got_env[0]['PATH_INFO'], '/v1/path/to/object name')
def test_delete_actual_object_handles_404(self):
def fake_app(env, start_response):
start_response('404 Not Found', [('Content-Length', '0')])
return []
internal_client.loadapp = lambda x: fake_app
x = expirer.ObjectExpirer({})
x.delete_actual_object('/path/to/object', '1234')
def test_delete_actual_object_handles_412(self):
def fake_app(env, start_response):
start_response('412 Precondition Failed',
[('Content-Length', '0')])
return []
internal_client.loadapp = lambda x: fake_app
x = expirer.ObjectExpirer({})
x.delete_actual_object('/path/to/object', '1234')
def test_delete_actual_object_does_not_handle_odd_stuff(self):
def fake_app(env, start_response):
start_response(
'503 Internal Server Error',
[('Content-Length', '0')])
return []
internal_client.loadapp = lambda x: fake_app
x = expirer.ObjectExpirer({})
exc = None
try:
x.delete_actual_object('/path/to/object', '1234')
except Exception as err:
exc = err
finally:
pass
self.assertEqual(503, exc.resp.status_int)
def test_delete_actual_object_quotes(self):
name = 'this name should get quoted'
timestamp = '1366063156.863045'
x = expirer.ObjectExpirer({})
x.swift.make_request = mock.MagicMock()
x.delete_actual_object(name, timestamp)
x.swift.make_request.assert_called_once()
self.assertEqual(x.swift.make_request.call_args[0][1],
'/v1/' + urllib.quote(name))
if __name__ == '__main__':
main()
| {
"content_hash": "0c9b4d9c8ed9e1371bde23a596e68b65",
"timestamp": "",
"source": "github",
"line_count": 686,
"max_line_length": 79,
"avg_line_length": 34.72886297376093,
"alnum_prop": 0.5393720617864338,
"repo_name": "lielongxingkong/windchimes",
"id": "493de0ff2455e2944f449080b9d3425311670475",
"size": "24414",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "test/unit/obj/test_expirer.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "15048"
},
{
"name": "Python",
"bytes": "3535857"
},
{
"name": "Shell",
"bytes": "5547"
}
],
"symlink_target": ""
} |
## About
Simple jQuery 3 plugin to enable autocomplete suggestions for inputs. Uses a JSON-based API as the datasource. Works with either plain HTML or Bootstrap form controls.

[DEMO](https://tihauan.github.io/jquery-autolist/demo/demo.html)
## Usage example
``` html
<label>GitHub repository search
<input type="text" list="projects" name="project" value="">
<datalist id="projects"></datalist>
</label>
<script>
/* global $ */
$(document).ready(function() {
$("input[name='project']").autolist("https://api.github.com/search/repositories", {
getItems: function (response) { return response.items; },
getName: function (item) { return item.full_name; }
});
});
</script>
```
The datalist must exist and must be linked to the input field.
## Options
``` javascript
$("input[name='project']").autolist("https://api.github.com/search/repositories", {
query: "q",
minLength: 3,
delay: 500,
trimValue: true,
getItems: function (response) { return response.items; },
getName: function (item) { return item.full_name; }
})
```
Name | Required | Default | Description
---- | -------- | ------- | -----------
url | X | | JSON API endpoint (without the query).
q | | "q" | The query part of the JSON API call (ex. example.com/list?q=test).
minLength | | 3 | Minimum length of the query (no suggestions will be provided if the input text is shorter).
delay | | 500 | How long to wait between input change and autocomplete list refresh. Shorter intervals mean quicker response but more API calls.
trimValue | | true | Trim the input value (don't query with start/end spaces).
getItems | | (r) ⇒ r | Function to get the autocomplete items from the API result object.
getName | | (i) ⇒ i | Function to get the name that will be displayed from an item.
## Changelog
### Version 1.0.0/1.0.1 - 2016/11/16
* initial release | {
"content_hash": "0910b85d6f71496abacfd8c7e92eabcf",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 167,
"avg_line_length": 40.19230769230769,
"alnum_prop": 0.645933014354067,
"repo_name": "Tihauan/jquery-autolist",
"id": "9153eddd344daa25f35a846a1c8785652b19d4c7",
"size": "2094",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "readme.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1403"
},
{
"name": "JavaScript",
"bytes": "3805"
}
],
"symlink_target": ""
} |
cask :v1 => 'mesasqlite' do
version '4.0.8'
sha256 '16741eb458127db0ce72e71824ddf938ee7b30a8b6ea4bc0e82357aab5b3359b'
url "http://www.desertsandsoftware.com/DEMOS/MesaSQLite#{version.gsub('.','')}.zip"
homepage 'http://www.desertsandsoftware.com/wordpress/?page_id=17'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
app 'MesaSQLite.app'
end
| {
"content_hash": "13ab039e5026c95091480e42f0339379",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 115,
"avg_line_length": 42.2,
"alnum_prop": 0.7535545023696683,
"repo_name": "donbobka/homebrew-cask",
"id": "57e8459113f809ba775208179b20587d26244900",
"size": "422",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Casks/mesasqlite.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Ruby",
"bytes": "1351365"
},
{
"name": "Shell",
"bytes": "57683"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "c219646dd2c33cdbec4a04a8cf4f63aa",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "cef1ddee9355801aea9b3288849cb63897cc5237",
"size": "206",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Solanales/Solanaceae/Solanum/Solanum tuberosum/ Syn. Solanum andigena brevicalyx/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "2061411e4ff58b07b54fc1c81274de85",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "93adf2f967116bc9acd8f8f31931d6c9d764cdd1",
"size": "184",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Apiaceae/Torilis/Torilis nodosa/ Syn. Caucalis nodosa/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/*
* 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.facebook.presto.sql.planner;
import com.facebook.presto.spi.connector.ConnectorPartitioningHandle;
import com.facebook.presto.spi.connector.ConnectorTransactionHandle;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
public class PartitioningHandle
{
private final Optional<String> connectorId;
private final Optional<ConnectorTransactionHandle> transactionHandle;
private final ConnectorPartitioningHandle connectorHandle;
@JsonCreator
public PartitioningHandle(
@JsonProperty("connectorId") Optional<String> connectorId,
@JsonProperty("transactionHandle") Optional<ConnectorTransactionHandle> transactionHandle,
@JsonProperty("connectorHandle") ConnectorPartitioningHandle connectorHandle)
{
this.connectorId = requireNonNull(connectorId, "connectorId is null");
this.transactionHandle = requireNonNull(transactionHandle, "transactionHandle is null");
checkArgument(!connectorId.isPresent() || transactionHandle.isPresent(), "transactionHandle is required when connectorId is present");
this.connectorHandle = requireNonNull(connectorHandle, "connectorHandle is null");
}
@JsonProperty
public Optional<String> getConnectorId()
{
return connectorId;
}
@JsonProperty
public Optional<ConnectorTransactionHandle> getTransactionHandle()
{
return transactionHandle;
}
@JsonProperty
public ConnectorPartitioningHandle getConnectorHandle()
{
return connectorHandle;
}
public boolean isSingleNode()
{
return connectorHandle.isSingleNode();
}
public boolean isCoordinatorOnly()
{
return connectorHandle.isCoordinatorOnly();
}
@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PartitioningHandle that = (PartitioningHandle) o;
// Currently, custom partitioning can not be equal since it will result
// in plans containing multiple table scans, which is not supported.
// TODO remove then when collocated plans are supported
if (connectorId.isPresent() || that.connectorId.isPresent()) {
return false;
}
return Objects.equals(connectorId, that.connectorId) &&
Objects.equals(transactionHandle, that.transactionHandle) &&
Objects.equals(connectorHandle, that.connectorHandle);
}
@Override
public int hashCode()
{
return Objects.hash(connectorId, transactionHandle, connectorHandle);
}
@Override
public String toString()
{
if (connectorId.isPresent()) {
return connectorId.get() + ":" + connectorHandle;
}
return connectorHandle.toString();
}
}
| {
"content_hash": "610ff5d38f343d01e1547879a4dce4a9",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 142,
"avg_line_length": 33.56363636363636,
"alnum_prop": 0.6996208017334777,
"repo_name": "mpilman/presto",
"id": "5316b6e4ed50a1f1f2f3829f49e2ef9ce45736a8",
"size": "3692",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "presto-main/src/main/java/com/facebook/presto/sql/planner/PartitioningHandle.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "22552"
},
{
"name": "HTML",
"bytes": "65192"
},
{
"name": "Java",
"bytes": "14814535"
},
{
"name": "JavaScript",
"bytes": "4863"
},
{
"name": "Kotlin",
"bytes": "33068"
},
{
"name": "Makefile",
"bytes": "6819"
},
{
"name": "PLSQL",
"bytes": "6538"
},
{
"name": "Python",
"bytes": "4479"
},
{
"name": "SQLPL",
"bytes": "6363"
},
{
"name": "Shell",
"bytes": "9520"
}
],
"symlink_target": ""
} |
from django.conf.urls import include, url
from django.conf import settings
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtaildocs import urls as wagtaildocs_urls
from wagtail.wagtailcore import urls as wagtail_urls
urlpatterns = [
url(r'^django-admin/', include(admin.site.urls)),
url(r'^admin/', include(wagtailadmin_urls)),
url(r'^documents/', include(wagtaildocs_urls)),
url(r'^search/$', '{{ cookiecutter.repo_name }}.search.views.search', name='search'),
]
if settings.DEBUG:
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
# Serve static and media files from development server
urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# Add views for testing 404 and 500 templates
urlpatterns += [
url(r'^test404/$', TemplateView.as_view(template_name='404.html')),
url(r'^test500/$', TemplateView.as_view(template_name='500.html')),
]
urlpatterns += [
url(r'', include(wagtail_urls)),
]
| {
"content_hash": "e99bb67ef170abe541d1847fbc84aa80",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 89,
"avg_line_length": 31.025641025641026,
"alnum_prop": 0.7206611570247934,
"repo_name": "RocketPod/wagtail-cookiecutter",
"id": "2c5850b2b058ad04f53e509a6f4f8f62d6093719",
"size": "1210",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/urls.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "5120"
},
{
"name": "CSS",
"bytes": "414"
},
{
"name": "HTML",
"bytes": "4530"
},
{
"name": "Makefile",
"bytes": "5612"
},
{
"name": "Python",
"bytes": "25024"
},
{
"name": "Ruby",
"bytes": "1225"
}
],
"symlink_target": ""
} |
@class PURLog;
@class PUROutput;
typedef void(^PURLogStoreRetrieveCompletionBlock)(NSArray *logs);
@interface PURLogStore : NSObject
+ (instancetype)defaultLogStore;
- (instancetype)initWithDatabasePath:(NSString *)databasePath;
- (BOOL)prepare;
- (void)retrieveLogsForPattern:(NSString *)pattern output:(PUROutput *)output completion:(PURLogStoreRetrieveCompletionBlock)completion;
- (void)addLog:(PURLog *)log fromOutput:(PUROutput *)output;
- (void)addLogs:(NSArray *)logs fromOutput:(PUROutput *)output;
- (void)removeLogs:(NSArray *)logs fromOutput:(PUROutput *)output;
- (void)clearAll;
- (void)reduceStoredLogsWithLimit:(NSInteger)limit fromOutput:(PUROutput *)output;
@end
| {
"content_hash": "77c458f00fb43b61ccd25ccfb44a8659",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 136,
"avg_line_length": 32.76190476190476,
"alnum_prop": 0.7834302325581395,
"repo_name": "86/puree-ios",
"id": "ff91b9e9e73ec71003aa7b84345de4c09b89e0a9",
"size": "861",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Pod/Classes/PURLogStore.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "35494"
},
{
"name": "Ruby",
"bytes": "718"
},
{
"name": "Swift",
"bytes": "22356"
}
],
"symlink_target": ""
} |
<!--
Copyright 2005-2008 Adobe Systems Incorporated
Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
or a copy at http://stlab.adobe.com/licenses.html)
Some files are held under additional license.
Please see "http://stlab.adobe.com/licenses.html" for more information.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<TITLE>Adobe Software Technology Lab: result_type< F > Struct Template Reference</TITLE>
<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
<LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
<LINK REL="alternate" TITLE="stlab.adobe.com RSS" HREF="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1" TYPE="application/rss+xml"/>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
</head>
<body>
<div id='content'>
<table><tr>
<td colspan='5'>
<div id='opensource_banner'>
<table style='width: 100%; padding: 5px;'><tr>
<td align='left'>
<a href='index.html' style='border: none'><img src='stlab2007.jpg' alt="stlab.adobe.com"/></a>
</td>
<td align='right'>
<a href='http://www.adobe.com' style='border: none'><img src='adobe_hlogo.gif' alt="Adobe Systems Incorporated"/></a>
</td>
</tr></table>
</div>
</td></tr><tr>
<td valign="top">
<div id='navtable' height='100%'>
<div style='margin: 5px'>
<h4>Documentation</h4>
<a href="group__asl__overview.html">Overview</a><br/>
<a href="asl_readme.html">Building ASL</a><br/>
<a href="asl_toc.html">Documentation</a><br/>
<a href="http://stlab.adobe.com/wiki/index.php/Supplementary_ASL_Documentation">Library Wiki Docs</a><br/>
<a href="asl_indices.html">Indices</a><br/>
<a href="http://stlab.adobe.com/perforce/">Browse Perforce</a><br/>
<h4>More Info</h4>
<a href="asl_release_notes.html">Release Notes</a><br/>
<a href="http://stlab.adobe.com/wiki/">Wiki</a><br/>
<a href="asl_search.html">Site Search</a><br/>
<a href="licenses.html">License</a><br/>
<a href="success_stories.html">Success Stories</a><br/>
<a href="asl_contributors.html">Contributors</a><br/>
<h4>Media</h4>
<a href="http://sourceforge.net/project/showfiles.php?group_id=132417&package_id=145420">Download</a><br/>
<a href="asl_download_perforce.html">Perforce Depots</a><br/>
<h4>Support</h4>
<a href="http://sourceforge.net/projects/adobe-source/">ASL SourceForge Home</a><br/>
<a href="http://sourceforge.net/mail/?group_id=132417">Mailing Lists</a><br/>
<a href="http://sourceforge.net/forum/?group_id=132417">Discussion Forums</a><br/>
<a href="http://sourceforge.net/tracker/?atid=724218&group_id=132417&func=browse">Report Bugs</a><br/>
<a href="http://sourceforge.net/tracker/?atid=724221&group_id=132417&func=browse">Suggest Features</a><br/>
<a href="asl_contributing.html">Contribute to ASL</a><br/>
<h4>RSS</h4>
<a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417">Short-text news</a><br/>
<a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1">Full-text news</a><br/>
<a href="http://sourceforge.net/export/rss2_projfiles.php?group_id=132417">File releases</a><br/>
<h4>Other Adobe Projects</h4>
<a href="http://sourceforge.net/adobe/">Open @ Adobe</a><br/>
<a href="http://opensource.adobe.com/">Adobe Open Source</a><br/>
<a href="http://labs.adobe.com/">Adobe Labs</a><br/>
<a href="http://stlab.adobe.com/amg/">Adobe Media Gallery</a><br/>
<a href="http://stlab.adobe.com/performance/">C++ Benchmarks</a><br/>
<h4>Other Resources</h4>
<a href="http://boost.org">Boost</a><br/>
<a href="http://www.riaforge.com/">RIAForge</a><br/>
<a href="http://www.sgi.com/tech/stl">SGI STL</a><br/>
</div>
</div>
</td>
<td id='maintable' width="100%" valign="top">
<!-- End Header -->
<!-- Generated by Doxygen 1.7.2 -->
<div class="navpath">
<ul>
<li><a class="el" href="namespaceadobe.html">adobe</a> </li>
<li><a class="el" href="namespaceadobe_1_1arg__stream.html">arg_stream</a> </li>
<li><a class="el" href="structadobe_1_1arg__stream_1_1result__type.html">result_type</a> </li>
</ul>
</div>
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> </div>
<div class="headertitle">
<h1>result_type< F > Struct Template Reference<br/>
<small>
[<a class="el" href="group__arg__stream.html">arg_stream</a>]</small>
</h1> </div>
</div>
<div class="contents">
<!-- doxytag: class="adobe::arg_stream::result_type" -->
<p><a class="el" href="structadobe_1_1arg__stream_1_1result__type.html#ae0b00406cc4a73ddfdaf8f4f015e7129">result_type<F>::type</a> is the return type of the function f.
<a href="#_details">More...</a></p>
<p><code>#include <<a class="el" href="arg__stream_8hpp_source.html">arg_stream.hpp</a>></code></p>
<p><a href="structadobe_1_1arg__stream_1_1result__type-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <br class="typebreak"/>
boost::function_types::result_type<br class="typebreak"/>
< typename <a class="el" href="structadobe_1_1arg__stream_1_1signature.html">signature</a>< F ><br class="typebreak"/>
::<a class="el" href="structadobe_1_1arg__stream_1_1result__type.html#ae0b00406cc4a73ddfdaf8f4f015e7129">type</a> >::<a class="el" href="structadobe_1_1arg__stream_1_1result__type.html#ae0b00406cc4a73ddfdaf8f4f015e7129">type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structadobe_1_1arg__stream_1_1result__type.html#ae0b00406cc4a73ddfdaf8f4f015e7129">type</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<typename F><br/>
struct adobe::arg_stream::result_type< F ></h3>
<dl class="user"><dt><b>Template Parameters:</b></dt><dd><ul>
<li><code>F</code> models callable_object </li>
</ul>
</dd></dl>
<p>Definition at line <a class="el" href="arg__stream_8hpp_source.html#l00240">240</a> of file <a class="el" href="arg__stream_8hpp_source.html">arg_stream.hpp</a>.</p>
<hr/><h2>Member Typedef Documentation</h2>
<a class="anchor" id="ae0b00406cc4a73ddfdaf8f4f015e7129"></a><!-- doxytag: member="adobe::arg_stream::result_type::type" ref="ae0b00406cc4a73ddfdaf8f4f015e7129" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef boost::function_types::result_type<typename <a class="el" href="structadobe_1_1arg__stream_1_1signature.html">signature</a><F>::<a class="el" href="structadobe_1_1arg__stream_1_1result__type.html#ae0b00406cc4a73ddfdaf8f4f015e7129">type</a>>::<a class="el" href="structadobe_1_1arg__stream_1_1result__type.html#ae0b00406cc4a73ddfdaf8f4f015e7129">type</a> <a class="el" href="structadobe_1_1arg__stream_1_1result__type.html#ae0b00406cc4a73ddfdaf8f4f015e7129">type</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="arg__stream_8hpp_source.html#l00242">242</a> of file <a class="el" href="arg__stream_8hpp_source.html">arg_stream.hpp</a>.</p>
</div>
</div>
</div>
<!-- Begin Footer -->
</td></tr>
</table>
</div> <!-- content -->
<div class='footerdiv'>
<div id='footersub'>
<ul>
<li><a href="http://www.adobe.com/go/gftray_foot_aboutadobe">Company</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_privacy_security">Online Privacy Policy</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_terms">Terms of Use</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_contact_adobe">Contact Us</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_accessibility">Accessibility</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_report_piracy">Report Piracy</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_permissions_trademarks">Permissions & Trademarks</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_product_license_agreements">Product License Agreements</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_feedback">Send Feedback</a></li>
</ul>
<div>
<p>Copyright © 2006-2007 Adobe Systems Incorporated.</p>
<p>Use of this website signifies your agreement to the <a href="http://www.adobe.com/go/gftray_foot_terms">Terms of Use</a> and <a href="http://www.adobe.com/go/gftray_foot_privacy_security">Online Privacy Policy</a>.</p>
<p>Search powered by <a href="http://www.google.com/" target="new">Google</a></p>
</div>
</div>
</div>
<script type="text/javascript">
_uacct = "UA-396569-1";
urchinTracker();
</script>
</body>
</html>
| {
"content_hash": "ed7a27c32ca22df74ce4bf47ced6cc51",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 520,
"avg_line_length": 51.2972972972973,
"alnum_prop": 0.6449947312961012,
"repo_name": "brycelelbach/asl",
"id": "b6dc79a5973521306f5d159826877045ef5f8f0f",
"size": "9490",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "documentation/html/structadobe_1_1arg__stream_1_1result__type.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "1846467"
},
{
"name": "Perl",
"bytes": "167978"
},
{
"name": "Shell",
"bytes": "3594"
}
],
"symlink_target": ""
} |
using UnityEngine;
using System.Collections;
namespace Boardgame
{
public class BattleTheatre : MonoBehaviour
{
void Test()
{
/*
int attackSum;
while (attackSum > 0)
{
var defender = defenders.dequeue();
int defenseRoll = Dice.SumRoll(defender.defence);
attackSum -= defenseRoll;
if (attackSum > 0)
defender.kill();
}
*/
}
}
}
| {
"content_hash": "c1b4b895068a5bed77a5274be41510ea",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 65,
"avg_line_length": 20.92,
"alnum_prop": 0.4569789674952199,
"repo_name": "local-minimum/suffertheking",
"id": "61dbe35c14b4118afc30b6551d51b0438336f5f0",
"size": "525",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Assets/Scripts/BattleTheatre.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "85467"
}
],
"symlink_target": ""
} |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Microsoft.CodeAnalysis.Text;
namespace Microsoft.CodeAnalysis.ConvertNumericLiteral
{
internal abstract class AbstractConvertNumericLiteralCodeRefactoringProvider<TNumericLiteralExpression> : CodeRefactoringProvider where TNumericLiteralExpression : SyntaxNode
{
protected abstract (string hexPrefix, string binaryPrefix) GetNumericLiteralPrefixes();
public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
{
var (document, textSpan, cancellationToken) = context;
var numericToken = await GetNumericTokenAsync(context).ConfigureAwait(false);
if (numericToken == default || numericToken.ContainsDiagnostics)
{
return;
}
var syntaxNode = numericToken.Parent;
var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
var symbol = semanticModel.GetTypeInfo(syntaxNode, cancellationToken).Type;
if (symbol == null)
{
return;
}
if (!IsIntegral(symbol.SpecialType))
{
return;
}
var valueOpt = semanticModel.GetConstantValue(syntaxNode);
if (!valueOpt.HasValue)
{
return;
}
var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
var value = IntegerUtilities.ToInt64(valueOpt.Value);
var numericText = numericToken.ToString();
var (hexPrefix, binaryPrefix) = GetNumericLiteralPrefixes();
var (prefix, number, suffix) = GetNumericLiteralParts(numericText, hexPrefix, binaryPrefix);
var kind = string.IsNullOrEmpty(prefix) ? NumericKind.Decimal
: prefix.Equals(hexPrefix, StringComparison.OrdinalIgnoreCase) ? NumericKind.Hexadecimal
: prefix.Equals(binaryPrefix, StringComparison.OrdinalIgnoreCase) ? NumericKind.Binary
: NumericKind.Unknown;
if (kind == NumericKind.Unknown)
{
return;
}
if (kind != NumericKind.Decimal)
{
RegisterRefactoringWithResult(value.ToString(), FeaturesResources.Convert_to_decimal);
}
if (kind != NumericKind.Binary)
{
RegisterRefactoringWithResult(binaryPrefix + Convert.ToString(value, 2), FeaturesResources.Convert_to_binary);
}
if (kind != NumericKind.Hexadecimal)
{
RegisterRefactoringWithResult(hexPrefix + value.ToString("X"), FeaturesResources.Convert_to_hex);
}
const string DigitSeparator = "_";
if (numericText.Contains(DigitSeparator))
{
RegisterRefactoringWithResult(prefix + number.Replace(DigitSeparator, string.Empty), FeaturesResources.Remove_separators);
}
else
{
switch (kind)
{
case NumericKind.Decimal when number.Length > 3:
RegisterRefactoringWithResult(AddSeparators(number, 3), FeaturesResources.Separate_thousands);
break;
case NumericKind.Hexadecimal when number.Length > 4:
RegisterRefactoringWithResult(hexPrefix + AddSeparators(number, 4), FeaturesResources.Separate_words);
break;
case NumericKind.Binary when number.Length > 4:
RegisterRefactoringWithResult(binaryPrefix + AddSeparators(number, 4), FeaturesResources.Separate_nibbles);
break;
}
}
void RegisterRefactoringWithResult(string text, string title)
{
context.RegisterRefactoring(new MyCodeAction(title, c =>
{
var generator = SyntaxGenerator.GetGenerator(document);
var updatedToken = generator.NumericLiteralToken(text + suffix, (ulong)value)
.WithTriviaFrom(numericToken);
var updatedRoot = root.ReplaceToken(numericToken, updatedToken);
return Task.FromResult(document.WithSyntaxRoot(updatedRoot));
}));
}
}
internal virtual async Task<SyntaxToken> GetNumericTokenAsync(CodeRefactoringContext context)
{
var syntaxFacts = context.Document.GetLanguageService<ISyntaxFactsService>();
var literalNode = await context.TryGetRelevantNodeAsync<TNumericLiteralExpression>().ConfigureAwait(false);
var numericLiteralExpressionNode = syntaxFacts.IsNumericLiteralExpression(literalNode)
? literalNode
: null;
return numericLiteralExpressionNode != null
? numericLiteralExpressionNode.GetFirstToken() // We know that TNumericLiteralExpression has always only one token: NumericLiteralToken
: default;
}
private static (string prefix, string number, string suffix) GetNumericLiteralParts(string numericText, string hexPrefix, string binaryPrefix)
{
// Match literal text and extract out base prefix, type suffix and the number itself.
var groups = Regex.Match(numericText, $"({hexPrefix}|{binaryPrefix})?([_0-9a-f]+)(.*)", RegexOptions.IgnoreCase).Groups;
return (prefix: groups[1].Value, number: groups[2].Value, suffix: groups[3].Value);
}
private static string AddSeparators(string numericText, int interval)
{
// Insert digit separators in the given interval.
var result = Regex.Replace(numericText, $"(.{{{interval}}})", "_$1", RegexOptions.RightToLeft);
// Fix for the case "0x_1111" that is not supported yet.
return result[0] == '_' ? result.Substring(1) : result;
}
private static bool IsIntegral(SpecialType specialType)
{
switch (specialType)
{
case SpecialType.System_Byte:
case SpecialType.System_SByte:
case SpecialType.System_Int16:
case SpecialType.System_UInt16:
case SpecialType.System_Int32:
case SpecialType.System_UInt32:
case SpecialType.System_Int64:
case SpecialType.System_UInt64:
return true;
default:
return false;
}
}
private enum NumericKind { Unknown, Decimal, Binary, Hexadecimal }
private sealed class MyCodeAction : CodeAction.DocumentChangeAction
{
public MyCodeAction(string title, Func<CancellationToken, Task<Document>> createChangedDocument) : base(title, createChangedDocument)
{
}
}
}
}
| {
"content_hash": "3374188de114edf22420ec82e50bab34",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 178,
"avg_line_length": 43.5632183908046,
"alnum_prop": 0.6191292875989446,
"repo_name": "nguerrera/roslyn",
"id": "8f67bb218478e82629266ceac12a801117957cbf",
"size": "7582",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Features/Core/Portable/ConvertNumericLiteral/AbstractConvertNumericLiteralCodeRefactoringProvider.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "1C Enterprise",
"bytes": "289100"
},
{
"name": "Batchfile",
"bytes": "8757"
},
{
"name": "C#",
"bytes": "122747926"
},
{
"name": "C++",
"bytes": "5392"
},
{
"name": "CMake",
"bytes": "9153"
},
{
"name": "Dockerfile",
"bytes": "2102"
},
{
"name": "F#",
"bytes": "508"
},
{
"name": "PowerShell",
"bytes": "217803"
},
{
"name": "Rich Text Format",
"bytes": "14887"
},
{
"name": "Shell",
"bytes": "83770"
},
{
"name": "Smalltalk",
"bytes": "622"
},
{
"name": "Visual Basic",
"bytes": "70046841"
}
],
"symlink_target": ""
} |
<?php
namespace emilkm\tests\asset\value;
/**
* @author Emil Malinov
* @package efxphp
* @subpackage tests
*/
class VoLt32
{
public $property1 = 1;
public $property2 = 'b';
}
| {
"content_hash": "64b66aee8c0812480bb1b3ade19234d3",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 35,
"avg_line_length": 13.733333333333333,
"alnum_prop": 0.587378640776699,
"repo_name": "emilkm/amfext",
"id": "1fe0cf5267fc96b421928a1ac34718fe740abee3",
"size": "454",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/asset/value/VoLt32.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "127975"
},
{
"name": "JavaScript",
"bytes": "189"
},
{
"name": "M4",
"bytes": "293"
},
{
"name": "PHP",
"bytes": "154091"
},
{
"name": "Shell",
"bytes": "9295"
}
],
"symlink_target": ""
} |
namespace nvbio {
namespace bowtie2 {
namespace cuda {
// alloc enough storage for max_size hits
//
inline
uint64 ReadHitsIndex::resize(const uint32 max_size, const bool do_alloc)
{
const uint32 n = 2u*max_size;
if (do_alloc) m_links.resize( n );
return n * sizeof(uint32);
}
// setup the number of input reads
//
inline
void ReadHitsIndex::setup(const uint32 n_hits_per_read, const uint32 in_reads)
{
m_mode = n_hits_per_read > 1 ?
MultipleHitsPerRead :
SingleHitPerRead;
m_stride = in_reads;
if (n_hits_per_read == 1)
{
// fill the links structure
thrust::fill(
m_links.begin(),
m_links.begin() + in_reads,
uint32(1u) );
// fill the links structure
thrust::copy(
thrust::make_counting_iterator(0u),
thrust::make_counting_iterator(in_reads),
m_links.begin() + in_reads );
}
}
// return a view of the data structure
//
inline
ReadHitsIndexDeviceView ReadHitsIndex::device_view()
{
return ReadHitsIndexDeviceView(
nvbio::device_view( m_links ),
m_stride );
}
// setup all queues
//
inline
uint64 HitQueues::resize(const uint32 size, const bool do_alloc)
{
uint64 bytes = 0;
if (do_alloc) read_id.resize( size ); bytes += size * sizeof(uint32);
if (do_alloc) seed.resize( size ); bytes += size * sizeof(packed_seed);
if (do_alloc) ssa.resize( size ); bytes += size * sizeof(uint32);
if (do_alloc) loc.resize( size ); bytes += size * sizeof(uint32);
if (do_alloc) score.resize( size ); bytes += size * sizeof(int32);
if (do_alloc) sink.resize( size ); bytes += size * sizeof(uint32);
if (do_alloc) opposite_loc.resize( size ); bytes += size * sizeof(uint32);
if (do_alloc) opposite_score.resize( size ); bytes += size * sizeof(int32);
if (do_alloc) opposite_sink.resize( size ); bytes += size * sizeof(uint32);
if (do_alloc) opposite_score2.resize( size ); bytes += size * sizeof(int32);
if (do_alloc) opposite_sink2.resize( size ); bytes += size * sizeof(uint32);
return bytes;
}
// return a view of the data structure
//
inline
HitQueuesDeviceView HitQueues::device_view()
{
return HitQueuesDeviceView(
nvbio::device_view( read_id ),
nvbio::device_view( seed ),
nvbio::device_view( ssa ),
nvbio::device_view( loc ),
nvbio::device_view( score ),
nvbio::device_view( sink ),
nvbio::device_view( opposite_loc ),
nvbio::device_view( opposite_score ),
nvbio::device_view( opposite_sink ),
nvbio::device_view( opposite_score2 ),
nvbio::device_view( opposite_sink2 ) );
}
// constructor
//
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
HitQueuesDeviceView::HitQueuesDeviceView(
index_storage_type _read_id, // hit -> read mapping
seed_storage_type _seed, // hit info
ssa_storage_type _ssa, // hit ssa info
loc_storage_type _loc, // hit locations
score_storage_type _score, // hit scores
sink_storage_type _sink, // hit sinks
loc_storage_type _opposite_loc, // hit locations, opposite mate
score_storage_type _opposite_score, // hit scores, opposite mate
sink_storage_type _opposite_sink, // hit sinks, opposite mate
score_storage_type _opposite_score2, // hit scores, opposite mate
sink_storage_type _opposite_sink2) : // hit sinks, opposite mate
read_id( _read_id ),
seed( _seed ),
ssa( _ssa ),
loc( _loc ),
score( _score ),
sink( _sink ),
opposite_loc( _opposite_loc ),
opposite_score( _opposite_score ),
opposite_sink( _opposite_sink ),
opposite_score2( _opposite_score2 ),
opposite_sink2( _opposite_sink2 )
{}
// resize
//
inline
uint64 ScoringQueues::resize(const uint32 n_reads, const uint32 n_hits, const bool do_alloc)
{
uint64 bytes = 0;
bytes += active_reads.resize_arena( n_reads, do_alloc );
bytes += hits.resize( n_hits, do_alloc );
bytes += hits_index.resize( n_hits, do_alloc );
return bytes;
}
// return a reference to a given hit
//
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
HitReference<HitQueuesDeviceView> HitQueuesDeviceView::operator[] (const uint32 i)
{
return HitReference<HitQueuesDeviceView>( *this, i );
}
// return a reference to a given hit
//
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
HitReference<HitQueuesDeviceView> HitQueuesDeviceView::operator[] (const uint32 i) const
{
return HitReference<HitQueuesDeviceView>( *const_cast<HitQueuesDeviceView*>( this ), i );
}
// constructor
//
// \param hits hits container
// \param hit_index index of this hit
#pragma hd_warning_disable
template <typename HitQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
HitReference<HitQueuesType>::HitReference(HitQueuesType& hits, const uint32 hit_index) :
read_id ( hits.read_id[ hit_index ] ),
seed ( hits.seed[ hit_index ] ),
ssa ( hits.ssa[ hit_index ] ),
loc ( hits.loc[ hit_index ] ),
score ( hits.score[ hit_index ] ),
sink ( hits.sink[ hit_index ] ),
opposite_loc ( hits.opposite_loc[ hit_index ] ),
opposite_score ( hits.opposite_score[ hit_index ] ),
opposite_sink ( hits.opposite_sink[ hit_index ] ),
opposite_score2 ( hits.opposite_score2[ hit_index ] ),
opposite_sink2 ( hits.opposite_sink2[ hit_index ] )
{}
// return a view of the data structure
//
inline
ScoringQueuesDeviceView ScoringQueues::device_view()
{
return ScoringQueuesDeviceView(
nvbio::device_view( active_reads ),
nvbio::device_view( hits ),
nvbio::device_view( hits_index ),
nvbio::device_view( hits_pool ) );
}
// constructor
//
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
ScoringQueuesDeviceView::ScoringQueuesDeviceView(
active_reads_storage_type _active_reads, // set of active reads
hits_storage_type _hits, // nested sequence of read hits
read_hits_index_type _hits_index, // read -> hits mapping
pool_type _hits_pool) : // pool counter
active_reads ( _active_reads ),
hits ( _hits ),
hits_index ( _hits_index ),
hits_pool ( _hits_pool )
{}
// constructor
//
// \param index read -> hits index
// \param hits hits container
// \param read_index index of this read
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
ReadHitsReference<ScoringQueuesType>::ReadHitsReference(ScoringQueuesType& queues, const uint32 read_index) :
m_queues( queues ),
m_read_index( read_index )
{}
// size of the hits vector
//
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
uint32 ReadHitsReference<ScoringQueuesType>::size() const
{
return m_queues.hits_index.hit_count( m_read_index );
}
// return the i-th element
//
#pragma hd_warning_disable
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
typename ReadHitsReference<ScoringQueuesType>::reference
ReadHitsReference<ScoringQueuesType>::operator[] (const uint32 i) const
{
const uint32 hit_index = m_queues.hits_index( m_read_index, i );
return m_queues.hits[ hit_index ];
}
// return the slot where the i-th element is stored
//
#pragma hd_warning_disable
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
uint32
ReadHitsReference<ScoringQueuesType>::slot(const uint32 i) const
{
return m_queues.hits_index( m_read_index, i );
}
// bind this read to its new output location
//
// \param read_index output index of this read
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
void ReadHitsReference<ScoringQueuesType>::bind(const uint32 read_index)
{
m_read_index = read_index;
}
// access the packed_read info in the selected queue
//
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
packed_read ReadHitsReference<ScoringQueuesType>::read_info() const
{
return m_queues.active_reads.in_queue[ m_read_index ];
}
// constructor
//
// \param index read -> hits index
// \param hits hits container
// \param read_index index of this read
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
ReadHitsBinder<ScoringQueuesType>::ReadHitsBinder(ScoringQueuesType& queues, const uint32 read_index) :
m_queues( queues ),
m_read_index( read_index )
{}
// bind this read to its new output location
//
// \param read_index output index of this read
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
void ReadHitsBinder<ScoringQueuesType>::bind(const uint32 read_index)
{
m_read_index = read_index;
}
// resize the hits vector
//
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
void ReadHitsBinder<ScoringQueuesType>::resize(const uint32 size)
{
m_queues.hits_index.set_hit_count( m_read_index, size );
}
// size of the hits vector
//
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
uint32 ReadHitsBinder<ScoringQueuesType>::size() const
{
return m_queues.hits_index.hit_count( m_read_index );
}
// return the i-th element
//
#pragma hd_warning_disable
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
typename ReadHitsBinder<ScoringQueuesType>::reference
ReadHitsBinder<ScoringQueuesType>::operator[] (const uint32 i) const
{
const uint32 hit_index = m_queues.hits_index( m_read_index, i );
return m_queues.hits[ hit_index ];
}
// access the packed_read info in the selected queue
//
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
packed_read ReadHitsBinder<ScoringQueuesType>::read_info() const
{
return m_queues.active_reads.out_queue[ m_read_index ];
}
// set the packed_read info
//
// \param read_index output index of this read
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
void ReadHitsBinder<ScoringQueuesType>::set_read_info(const packed_read info)
{
m_queues.active_reads.out_queue[ m_read_index ] = info;
}
// bind the i-th hit to a given location
//
// \param i index of the hit to bind relative to this read
// \param slot address of the bound hit in the HitQueues
template <typename ScoringQueuesType>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE
void ReadHitsBinder<ScoringQueuesType>::bind_hit(const uint32 i, const uint32 slot)
{
m_queues.hits_index( m_read_index, i ) = slot;
}
} // namespace cuda
} // namespace bowtie2
} // namespace nvbio
| {
"content_hash": "690fdd124ca2e93a620ff3a3aba756ba",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 109,
"avg_line_length": 31.421511627906977,
"alnum_prop": 0.6650939032287908,
"repo_name": "kimrutherford/nvbio",
"id": "6ea83de702c910c208a226f041e15cf9fb0479dd",
"size": "12400",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "nvBowtie/bowtie2/cuda/scoring_queues_inl.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "1954907"
},
{
"name": "C++",
"bytes": "4691483"
},
{
"name": "CMake",
"bytes": "28412"
},
{
"name": "CSS",
"bytes": "8196"
},
{
"name": "Cuda",
"bytes": "3330740"
},
{
"name": "DIGITAL Command Language",
"bytes": "26402"
},
{
"name": "Groff",
"bytes": "15599"
},
{
"name": "HTML",
"bytes": "2497"
},
{
"name": "Makefile",
"bytes": "38913"
},
{
"name": "Perl",
"bytes": "3895"
}
],
"symlink_target": ""
} |
<?php namespace Tuurbo\AmazonPayment\Exceptions;
use Exception;
class InvalidDataException extends Exception {}
| {
"content_hash": "e032e14c1ce96d90a32d69486d411dcb",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 48,
"avg_line_length": 22.8,
"alnum_prop": 0.8245614035087719,
"repo_name": "tuurbo/amazon-payment",
"id": "a11f8304ba483b0543aed5250ea05844c5169751",
"size": "114",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Exceptions/InvalidDataException.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "19736"
}
],
"symlink_target": ""
} |
/*
* User: anna
* Date: 29-Jan-2007
*/
package com.intellij.codeInspection.ui.actions;
import com.intellij.codeInspection.*;
import com.intellij.codeInspection.ex.GlobalInspectionContextImpl;
import com.intellij.codeInspection.ex.InspectionManagerEx;
import com.intellij.codeInspection.ex.InspectionToolWrapper;
import com.intellij.codeInspection.reference.RefElement;
import com.intellij.codeInspection.reference.RefEntity;
import com.intellij.codeInspection.ui.InspectionTreeNode;
import com.intellij.codeInspection.ui.ProblemDescriptionNode;
import com.intellij.codeInspection.ui.RefElementNode;
import com.intellij.openapi.actionSystem.ActionGroup;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiManager;
import com.intellij.psi.util.PsiModificationTracker;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.containers.HashSet;
import com.intellij.util.ui.tree.TreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import java.util.Set;
public class SuppressActionWrapper extends ActionGroup {
private final Project myProject;
private final InspectionManagerEx myManager;
private final Set<InspectionTreeNode> myNodesToSuppress = new HashSet<InspectionTreeNode>();
private final InspectionToolWrapper myToolWrapper;
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.actions.SuppressActionWrapper");
public SuppressActionWrapper(@NotNull final Project project,
@NotNull final InspectionToolWrapper toolWrapper,
@NotNull final TreePath[] paths) {
super(InspectionsBundle.message("suppress.inspection.problem"), false);
myProject = project;
myManager = (InspectionManagerEx)InspectionManager.getInstance(myProject);
for (TreePath path : paths) {
final Object node = path.getLastPathComponent();
if (!(node instanceof TreeNode)) continue;
TreeUtil.traverse((TreeNode)node, new TreeUtil.Traverse() {
@Override
public boolean accept(final Object node) { //fetch leaves
final InspectionTreeNode n = (InspectionTreeNode)node;
if (n.isLeaf()) {
myNodesToSuppress.add(n);
}
return true;
}
});
}
myToolWrapper = toolWrapper;
}
@Override
@NotNull
public SuppressTreeAction[] getChildren(@Nullable final AnActionEvent e) {
final SuppressIntentionAction[] suppressActions = InspectionManagerEx.getSuppressActions(myToolWrapper.getTool());
if (suppressActions == null || suppressActions.length == 0) return new SuppressTreeAction[0];
final SuppressTreeAction[] actions = new SuppressTreeAction[suppressActions.length];
for (int i = 0; i < suppressActions.length; i++) {
final SuppressIntentionAction suppressAction = suppressActions[i];
actions[i] = new SuppressTreeAction(suppressAction);
}
return actions;
}
private boolean suppress(final PsiElement element, final SuppressIntentionAction action) {
final PsiModificationTracker tracker = PsiManager.getInstance(myProject).getModificationTracker();
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
try {
final long startModificationCount = tracker.getModificationCount();
if (action.isAvailable(myProject, null, element)) {
action.invoke(myProject, null, element);
}
if (startModificationCount != tracker.getModificationCount()) {
final Set<GlobalInspectionContextImpl> globalInspectionContexts = myManager.getRunningContexts();
for (GlobalInspectionContextImpl context : globalInspectionContexts) {
context.ignoreElement(myToolWrapper.getTool(), element);
}
}
}
catch (IncorrectOperationException e1) {
LOG.error(e1);
}
}
});
return true;
}
@Override
public void update(final AnActionEvent e) {
super.update(e);
e.getPresentation().setEnabled(InspectionManagerEx.getSuppressActions(myToolWrapper.getTool()) != null);
}
private static Pair<PsiElement, CommonProblemDescriptor> getContentToSuppress(InspectionTreeNode node) {
RefElement refElement = null;
CommonProblemDescriptor descriptor = null;
if (node instanceof RefElementNode) {
final RefElementNode elementNode = (RefElementNode)node;
final RefEntity element = elementNode.getElement();
refElement = element instanceof RefElement ? (RefElement)element : null;
descriptor = elementNode.getProblem();
}
else if (node instanceof ProblemDescriptionNode) {
final ProblemDescriptionNode descriptionNode = (ProblemDescriptionNode)node;
final RefEntity element = descriptionNode.getElement();
refElement = element instanceof RefElement ? (RefElement)element : null;
descriptor = descriptionNode.getDescriptor();
}
PsiElement element = descriptor instanceof ProblemDescriptor ? ((ProblemDescriptor)descriptor).getPsiElement() : refElement != null ? refElement.getElement() : null;
return Pair.create(element, descriptor);
}
public class SuppressTreeAction extends AnAction {
private final SuppressIntentionAction mySuppressAction;
public SuppressTreeAction(final SuppressIntentionAction suppressAction) {
super(suppressAction.getText());
mySuppressAction = suppressAction;
}
@Override
public void actionPerformed(final AnActionEvent e) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
CommandProcessor.getInstance().executeCommand(myProject, new Runnable() {
@Override
public void run() {
for (InspectionTreeNode node : myNodesToSuppress) {
final Pair<PsiElement, CommonProblemDescriptor> content = getContentToSuppress(node);
if (content.first == null) break;
final PsiElement element = content.first;
if (!suppress(element, mySuppressAction)) break;
}
final Set<GlobalInspectionContextImpl> globalInspectionContexts = myManager.getRunningContexts();
for (GlobalInspectionContextImpl context : globalInspectionContexts) {
context.refreshViews();
}
CommandProcessor.getInstance().markCurrentCommandAsGlobal(myProject);
}
}, getTemplatePresentation().getText(), null);
}
});
}
@Override
public void update(final AnActionEvent e) {
super.update(e);
if (!isAvailable()) e.getPresentation().setVisible(false);
}
public boolean isAvailable() {
for (InspectionTreeNode node : myNodesToSuppress) {
final Pair<PsiElement, CommonProblemDescriptor> content = getContentToSuppress(node);
if (content.first == null) continue;
final PsiElement element = content.first;
if (mySuppressAction.isAvailable(myProject, null, element)) {
return true;
}
}
return false;
}
}
}
| {
"content_hash": "08c1b2c95886e26bf88e3c1af2d8360c",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 169,
"avg_line_length": 42.322404371584696,
"alnum_prop": 0.7172369270497095,
"repo_name": "IllusionRom-deprecated/android_platform_tools_idea",
"id": "ac801b70588de3034062f95fd3d1574ac2e9e1d4",
"size": "7745",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "platform/lang-impl/src/com/intellij/codeInspection/ui/actions/SuppressActionWrapper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "177802"
},
{
"name": "C#",
"bytes": "390"
},
{
"name": "C++",
"bytes": "78894"
},
{
"name": "CSS",
"bytes": "102018"
},
{
"name": "Erlang",
"bytes": "10"
},
{
"name": "Groovy",
"bytes": "1906667"
},
{
"name": "J",
"bytes": "5050"
},
{
"name": "Java",
"bytes": "128322265"
},
{
"name": "JavaScript",
"bytes": "123045"
},
{
"name": "Objective-C",
"bytes": "22558"
},
{
"name": "Perl",
"bytes": "6549"
},
{
"name": "Python",
"bytes": "17760420"
},
{
"name": "Ruby",
"bytes": "1213"
},
{
"name": "Shell",
"bytes": "76554"
},
{
"name": "TeX",
"bytes": "60798"
},
{
"name": "XSLT",
"bytes": "113531"
}
],
"symlink_target": ""
} |
Part 07: Structure inspection
=============================
Especially with larger directory structures one can get confused of how the
directory tree looks like. vfsStream provides a simple utility method to inspect
the directory structure: vfsStream::inspect(). As first parameter it expects a
vfsStreamVisitor - for simplicity and most use cases the vfsStreamPrintVisitor
should be sufficient. It prints out the directory structure, defaulting to
STDOUT, but can be changed to write to another stream (yes, even to a vfs://
stream ;-)).
vfsStream also provides the vfsStreamStructureVisitor which creates a structure
which can be used for vfsStream::create(). This way you can make sure the
overall structure after an operation like unlink() or rename() is still correct
without having to test a bunch of directories and files for existance.
If none of the delivered visitor implementations fit one can create another
implementation of the vfsStreamVisitor interface, best by extending from
vfsStreamAbstractVisitor which delivers a default implementation for the
vfsStreamVisitor::visit() method.
* Previous: [Part 06: Other setup possibilities](https://github.com/bovigo/vfs-stream-examples/tree/master/src/part06)
| {
"content_hash": "c9c95e6f6f9a4351ae3d8fbdfaab7044",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 118,
"avg_line_length": 55.63636363636363,
"alnum_prop": 0.7949346405228758,
"repo_name": "mikey179/vfsStream-examples",
"id": "dc02ea4b2fbb832d84709938004eac04f6220626",
"size": "1224",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/part07/README.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "18559"
}
],
"symlink_target": ""
} |
require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/fixtures/common'
require File.dirname(__FILE__) + '/shared/new'
describe "Exception.exception" do
it_behaves_like(:exception_new, :exception)
end
describe "Exception" do
it "is a Class" do
Exception.should be_kind_of(Class)
end
it "is a superclass of NoMemoryError" do
Exception.should be_ancestor_of(NoMemoryError)
end
it "is a superclass of ScriptError" do
Exception.should be_ancestor_of(ScriptError)
end
it "is a superclass of SignalException" do
Exception.should be_ancestor_of(SignalException)
end
it "is a superclass of Interrupt" do
SignalException.should be_ancestor_of(Interrupt)
end
it "is a superclass of StandardError" do
Exception.should be_ancestor_of(StandardError)
end
it "is a superclass of SystemExit" do
Exception.should be_ancestor_of(SystemExit)
end
it "is a superclass of SystemStackError" do
Exception.should be_ancestor_of(SystemStackError)
end
ruby_version_is "1.9" do
it "is a superclass of SecurityError" do
Exception.should be_ancestor_of(SecurityError)
end
it "is a superclass of EncodingError" do
Exception.should be_ancestor_of(EncodingError)
end
end
end
describe "Exception#exception" do
it "returns self when passed no argument" do
e = RuntimeError.new
e.should == e.exception
end
it "returns self when passed self as an argument" do
e = RuntimeError.new
e.should == e.exception(e)
end
it "returns an exception of the same class as self with the message given as argument" do
e = RuntimeError.new
e2 = e.exception(:message)
e2.should be_an_instance_of(RuntimeError)
e2.message.should == :message
end
end
| {
"content_hash": "f040258a83af18b02cdd787546416de6",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 91,
"avg_line_length": 25.211267605633804,
"alnum_prop": 0.7078212290502793,
"repo_name": "benbc/rubyspec",
"id": "78a89275f9c07dbdce4b52e2da5b22e61f6183b3",
"size": "1790",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/exception/exception_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "34284"
},
{
"name": "Ruby",
"bytes": "3896390"
}
],
"symlink_target": ""
} |
namespace sandbox {
namespace {
#if defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)
// This is true for Mips O32 ABI.
static_assert(MIN_SYSCALL == __NR_Linux, "min syscall number should be 4000");
#elif defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)
// This is true for MIPS N64 ABI.
static_assert(MIN_SYSCALL == __NR_Linux, "min syscall number should be 5000");
#else
// This true for supported architectures (Intel and ARM EABI).
static_assert(MIN_SYSCALL == 0u,
"min syscall should always be zero");
#endif
// SyscallRange represents an inclusive range of system call numbers.
struct SyscallRange {
uint32_t first;
uint32_t last;
};
const SyscallRange kValidSyscallRanges[] = {
// First we iterate up to MAX_PUBLIC_SYSCALL, which is equal to MAX_SYSCALL
// on Intel architectures, but leaves room for private syscalls on ARM.
{MIN_SYSCALL, MAX_PUBLIC_SYSCALL},
#if defined(__arm__)
// ARM EABI includes "ARM private" system calls starting at
// MIN_PRIVATE_SYSCALL, and a "ghost syscall private to the kernel" at
// MIN_GHOST_SYSCALL.
{MIN_PRIVATE_SYSCALL, MAX_PRIVATE_SYSCALL},
{MIN_GHOST_SYSCALL, MAX_SYSCALL},
#endif
};
} // namespace
SyscallSet::Iterator SyscallSet::begin() const {
return Iterator(set_, false);
}
SyscallSet::Iterator SyscallSet::end() const {
return Iterator(set_, true);
}
bool SyscallSet::IsValid(uint32_t num) {
for (const SyscallRange& range : kValidSyscallRanges) {
if (num >= range.first && num <= range.last) {
return true;
}
}
return false;
}
bool operator==(const SyscallSet& lhs, const SyscallSet& rhs) {
return (lhs.set_ == rhs.set_);
}
SyscallSet::Iterator::Iterator(Set set, bool done)
: set_(set), done_(done), num_(0) {
// If the set doesn't contain 0, we need to skip to the next element.
if (!done && set_ == (IsValid(num_) ? Set::INVALID_ONLY : Set::VALID_ONLY)) {
++*this;
}
}
uint32_t SyscallSet::Iterator::operator*() const {
DCHECK(!done_);
return num_;
}
SyscallSet::Iterator& SyscallSet::Iterator::operator++() {
DCHECK(!done_);
num_ = NextSyscall();
if (num_ == 0) {
done_ = true;
}
return *this;
}
// NextSyscall returns the next system call in the iterated system
// call set after |num_|, or 0 if no such system call exists.
uint32_t SyscallSet::Iterator::NextSyscall() const {
const bool want_valid = (set_ != Set::INVALID_ONLY);
const bool want_invalid = (set_ != Set::VALID_ONLY);
for (const SyscallRange& range : kValidSyscallRanges) {
if (want_invalid && range.first > 0 && num_ < range.first - 1) {
// Even when iterating invalid syscalls, we only include the end points;
// so skip directly to just before the next (valid) range.
return range.first - 1;
}
if (want_valid && num_ < range.first) {
return range.first;
}
if (want_valid && num_ < range.last) {
return num_ + 1;
}
if (want_invalid && num_ <= range.last) {
return range.last + 1;
}
}
if (want_invalid) {
// BPF programs only ever operate on unsigned quantities. So,
// that's how we iterate; we return values from
// 0..0xFFFFFFFFu. But there are places, where the kernel might
// interpret system call numbers as signed quantities, so the
// boundaries between signed and unsigned values are potential
// problem cases. We want to explicitly return these values from
// our iterator.
if (num_ < 0x7FFFFFFFu)
return 0x7FFFFFFFu;
if (num_ < 0x80000000u)
return 0x80000000u;
if (num_ < 0xFFFFFFFFu)
return 0xFFFFFFFFu;
}
return 0;
}
bool operator==(const SyscallSet::Iterator& lhs,
const SyscallSet::Iterator& rhs) {
DCHECK(lhs.set_ == rhs.set_);
return (lhs.done_ == rhs.done_) && (lhs.num_ == rhs.num_);
}
bool operator!=(const SyscallSet::Iterator& lhs,
const SyscallSet::Iterator& rhs) {
return !(lhs == rhs);
}
} // namespace sandbox
| {
"content_hash": "a5fe2b9385a13bac2c7d7e5db2d59efa",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 79,
"avg_line_length": 29.138686131386862,
"alnum_prop": 0.654308617234469,
"repo_name": "ric2b/Vivaldi-browser",
"id": "6e31765060e06358b72095a2aed6a69c2e3569fb",
"size": "4344",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "chromium/sandbox/linux/bpf_dsl/syscall_set.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
.. confval:: panic_on_snap_error
If there is an error while reading the snapshot file
(at server start), abort.
Type: boolean |br|
Default: true |br|
Dynamic: no |br|
.. confval:: panic_on_wal_error
If there is an error while reading a write-ahead log
file (at server start or to relay to a replica), abort.
Type: boolean |br|
Default: true |br|
Dynamic: yes |br|
.. confval:: rows_per_wal
How many log records to store in a single write-ahead log file.
When this limit is reached, Tarantool creates another WAL file
named :samp:`{<first-lsn-in-wal>}.xlog`. This can be useful for
simple rsync-based backups.
Type: integer |br|
Default: 500000 |br|
Dynamic: no |br|
.. confval:: snap_io_rate_limit
Reduce the throttling effect of :func:`box.snapshot` on
INSERT/UPDATE/DELETE performance by setting a limit on how many
megabytes per second it can write to disk. The same can be
achieved by splitting :confval:`wal_dir` and :confval:`snap_dir`
locations and moving snapshots to a separate disk.
Type: float |br|
Default: null |br|
Dynamic: **yes** |br|
.. confval:: wal_mode
Specify fiber-WAL-disk synchronization mode as:
* ``none``: write-ahead log is not maintained;
* ``write``: fibers wait for their data to be written to
the write-ahead log (no :manpage:`fsync(2)`);
* ``fsync``: fibers wait for their data, :manpage:`fsync(2)`
follows each :manpage:`write(2)`;
Type: string |br|
Default: "write" |br|
Dynamic: **yes** |br|
.. confval:: wal_dir_rescan_delay
Number of seconds between periodic scans of the write-ahead-log
file directory, when checking for changes to write-ahead-log
files for the sake of replication or local hot standby.
Type: float |br|
Default: 2 |br|
Dynamic: no |br|
| {
"content_hash": "12512979d7b1720dcd7b55aa987d3e3e",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 68,
"avg_line_length": 29.296875,
"alnum_prop": 0.6634666666666666,
"repo_name": "condor-the-bird/tarantool",
"id": "fdb89e747d02ffaeecdc0d598afe08893e9a35a0",
"size": "1875",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "doc/sphinx/book/configuration/cfg-binary_logging_snapshots.rst",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "1101655"
},
{
"name": "C++",
"bytes": "1073124"
},
{
"name": "CMake",
"bytes": "84183"
},
{
"name": "Lua",
"bytes": "584346"
},
{
"name": "Makefile",
"bytes": "1554"
},
{
"name": "Python",
"bytes": "60124"
},
{
"name": "Ragel in Ruby Host",
"bytes": "6423"
},
{
"name": "Ruby",
"bytes": "2775"
},
{
"name": "Shell",
"bytes": "3656"
}
],
"symlink_target": ""
} |
set -e
# Set up the sandbox
cabal sandbox init
cabal sandbox add-source dna/cupti
cabal sandbox add-source dna/linux-perf-stat
cabal sandbox add-source dna/core
cabal sandbox add-source dna/flow
cabal sandbox add-source kernel/oskar
# Install dependencies into sandbox
cabal install --only-dependencies
# Create link to where binaries reside
ln -s .cabal-sandbox/bin .
| {
"content_hash": "41e690757bfc96b8e5e686b2c29f4814",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 44,
"avg_line_length": 26.5,
"alnum_prop": 0.7978436657681941,
"repo_name": "SKA-ScienceDataProcessor/RC",
"id": "4012bf42ece5f9789c0b24d51edf9e5f8f1a8c68",
"size": "382",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "MS6/boot.sh",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "455166"
},
{
"name": "C++",
"bytes": "633090"
},
{
"name": "CMake",
"bytes": "59"
},
{
"name": "Cuda",
"bytes": "172460"
},
{
"name": "HTML",
"bytes": "150482"
},
{
"name": "Haskell",
"bytes": "2019655"
},
{
"name": "LLVM",
"bytes": "1392"
},
{
"name": "Lua",
"bytes": "308"
},
{
"name": "Makefile",
"bytes": "14306"
},
{
"name": "Python",
"bytes": "143022"
},
{
"name": "Rouge",
"bytes": "25704"
},
{
"name": "Shell",
"bytes": "79093"
},
{
"name": "Terra",
"bytes": "2139"
}
],
"symlink_target": ""
} |
use crate::error::{ExecutionError, Result};
use crate::execution::physical_plan::common::RecordBatchIterator;
use crate::execution::physical_plan::ExecutionPlan;
use crate::execution::physical_plan::{BatchIterator, Partition};
use arrow::array::ArrayRef;
use arrow::compute::array_ops::limit;
use arrow::datatypes::Schema;
use arrow::record_batch::RecordBatch;
use std::sync::{Arc, Mutex};
use std::thread;
use std::thread::JoinHandle;
/// Limit execution plan
pub struct LimitExec {
/// Input schema
schema: Arc<Schema>,
/// Input partitions
partitions: Vec<Arc<dyn Partition>>,
/// Maximum number of rows to return
limit: usize,
}
impl LimitExec {
/// Create a new MergeExec
pub fn new(
schema: Arc<Schema>,
partitions: Vec<Arc<dyn Partition>>,
limit: usize,
) -> Self {
LimitExec {
schema,
partitions,
limit,
}
}
}
impl ExecutionPlan for LimitExec {
fn schema(&self) -> Arc<Schema> {
self.schema.clone()
}
fn partitions(&self) -> Result<Vec<Arc<dyn Partition>>> {
Ok(vec![Arc::new(LimitPartition {
schema: self.schema.clone(),
partitions: self.partitions.clone(),
limit: self.limit,
})])
}
}
struct LimitPartition {
/// Input schema
schema: Arc<Schema>,
/// Input partitions
partitions: Vec<Arc<dyn Partition>>,
/// Maximum number of rows to return
limit: usize,
}
impl Partition for LimitPartition {
fn execute(&self) -> Result<Arc<Mutex<dyn BatchIterator>>> {
// collect up to "limit" rows on each partition
let threads: Vec<JoinHandle<Result<Vec<RecordBatch>>>> = self
.partitions
.iter()
.map(|p| {
let p = p.clone();
let limit = self.limit;
thread::spawn(move || {
let it = p.execute()?;
collect_with_limit(it, limit)
})
})
.collect();
// combine the results from each thread, up to the limit
let mut combined_results: Vec<Arc<RecordBatch>> = vec![];
let mut count = 0;
for thread in threads {
let join = thread.join().expect("Failed to join thread");
let result = join?;
for batch in result {
let capacity = self.limit - count;
if batch.num_rows() <= capacity {
count += batch.num_rows();
combined_results.push(Arc::new(batch.clone()))
} else {
let batch = truncate_batch(&batch, capacity)?;
count += batch.num_rows();
combined_results.push(Arc::new(batch.clone()))
}
if count == self.limit {
break;
}
}
}
Ok(Arc::new(Mutex::new(RecordBatchIterator::new(
self.schema.clone(),
combined_results,
))))
}
}
/// Truncate a RecordBatch to maximum of n rows
pub fn truncate_batch(batch: &RecordBatch, n: usize) -> Result<RecordBatch> {
let limited_columns: Result<Vec<ArrayRef>> = (0..batch.num_columns())
.map(|i| match limit(batch.column(i), n) {
Ok(result) => Ok(result),
Err(error) => Err(ExecutionError::from(error)),
})
.collect();
Ok(RecordBatch::try_new(
batch.schema().clone(),
limited_columns?,
)?)
}
/// Create a vector of record batches from an iterator
fn collect_with_limit(
it: Arc<Mutex<dyn BatchIterator>>,
limit: usize,
) -> Result<Vec<RecordBatch>> {
let mut count = 0;
let mut it = it.lock().unwrap();
let mut results: Vec<RecordBatch> = vec![];
loop {
match it.next() {
Ok(Some(batch)) => {
let capacity = limit - count;
if batch.num_rows() <= capacity {
count += batch.num_rows();
results.push(batch);
} else {
let batch = truncate_batch(&batch, capacity)?;
count += batch.num_rows();
results.push(batch);
}
if count == limit {
return Ok(results);
}
}
Ok(None) => {
// end of result set
return Ok(results);
}
Err(e) => return Err(e),
}
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::execution::physical_plan::common;
use crate::execution::physical_plan::csv::CsvExec;
use crate::test;
#[test]
fn limit() -> Result<()> {
let schema = test::aggr_test_schema();
let num_partitions = 4;
let path =
test::create_partitioned_csv("aggregate_test_100.csv", num_partitions)?;
let csv = CsvExec::try_new(&path, schema.clone(), true, None, 1024)?;
// input should have 4 partitions
let input = csv.partitions()?;
assert_eq!(input.len(), num_partitions);
let limit = LimitExec::new(schema.clone(), input, 7);
let partitions = limit.partitions()?;
// the result should contain 4 batches (one per input partition)
let iter = partitions[0].execute()?;
let batches = common::collect(iter)?;
// there should be a total of 100 rows
let row_count: usize = batches.iter().map(|batch| batch.num_rows()).sum();
assert_eq!(row_count, 7);
Ok(())
}
}
| {
"content_hash": "5e0a3112809528921ba94be042a73644",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 84,
"avg_line_length": 29.746031746031747,
"alnum_prop": 0.5273923870508715,
"repo_name": "renesugar/arrow",
"id": "87e77f97743b6f226889576f206074135f0c735f",
"size": "6452",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rust/datafusion/src/execution/physical_plan/limit.rs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "73655"
},
{
"name": "Awk",
"bytes": "3683"
},
{
"name": "Batchfile",
"bytes": "34928"
},
{
"name": "C",
"bytes": "428011"
},
{
"name": "C#",
"bytes": "517100"
},
{
"name": "C++",
"bytes": "10120156"
},
{
"name": "CMake",
"bytes": "450430"
},
{
"name": "Dockerfile",
"bytes": "54234"
},
{
"name": "Emacs Lisp",
"bytes": "1825"
},
{
"name": "FreeMarker",
"bytes": "2271"
},
{
"name": "Go",
"bytes": "838776"
},
{
"name": "HTML",
"bytes": "3427"
},
{
"name": "Java",
"bytes": "3527648"
},
{
"name": "JavaScript",
"bytes": "102332"
},
{
"name": "Lua",
"bytes": "8771"
},
{
"name": "M4",
"bytes": "9093"
},
{
"name": "MATLAB",
"bytes": "36600"
},
{
"name": "Makefile",
"bytes": "49970"
},
{
"name": "Meson",
"bytes": "39653"
},
{
"name": "Objective-C",
"bytes": "12125"
},
{
"name": "PLpgSQL",
"bytes": "56995"
},
{
"name": "Perl",
"bytes": "3799"
},
{
"name": "Python",
"bytes": "2152367"
},
{
"name": "R",
"bytes": "272554"
},
{
"name": "Ruby",
"bytes": "862884"
},
{
"name": "Rust",
"bytes": "2208433"
},
{
"name": "Shell",
"bytes": "376434"
},
{
"name": "TSQL",
"bytes": "29787"
},
{
"name": "Thrift",
"bytes": "138360"
},
{
"name": "TypeScript",
"bytes": "1157378"
}
],
"symlink_target": ""
} |
interface IConnectionProvider {
getActiveConnection(): Rx.Observable<IConnection>;
dispose(): void;
} | {
"content_hash": "0c5a96b50fe4458053ca8229cfed7e7a",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 54,
"avg_line_length": 27.75,
"alnum_prop": 0.7297297297297297,
"repo_name": "jorik041/ReactiveTrader",
"id": "db2cc5e849f178a8b58394b982143a2a9a503631",
"size": "113",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "src/Adaptive.ReactiveTrader.Web/Client/Transport/IConnectionProvider.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "14189"
},
{
"name": "Batchfile",
"bytes": "1136"
},
{
"name": "C#",
"bytes": "497458"
},
{
"name": "CSS",
"bytes": "2681"
},
{
"name": "HTML",
"bytes": "53452"
},
{
"name": "JavaScript",
"bytes": "64267"
},
{
"name": "TypeScript",
"bytes": "70391"
}
],
"symlink_target": ""
} |
/**
* JobErrorReason.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.adwords.axis.v201601.cm;
public class JobErrorReason implements java.io.Serializable {
private java.lang.String _value_;
private static java.util.HashMap _table_ = new java.util.HashMap();
// Constructor
protected JobErrorReason(java.lang.String value) {
_value_ = value;
_table_.put(_value_,this);
}
public static final java.lang.String _DUPLICATE_JOB_KEY_FOR_CUSTOMER = "DUPLICATE_JOB_KEY_FOR_CUSTOMER";
public static final java.lang.String _JOB_TYPE_NOT_SUPPORTED = "JOB_TYPE_NOT_SUPPORTED";
public static final java.lang.String _PREREQUISITE_JOB_FAILED = "PREREQUISITE_JOB_FAILED";
public static final java.lang.String _SELECTOR_CANNOT_USE_BOTH_JOB_IDS_AND_JOB_KEYS = "SELECTOR_CANNOT_USE_BOTH_JOB_IDS_AND_JOB_KEYS";
public static final java.lang.String _TOO_LATE_TO_CANCEL_JOB = "TOO_LATE_TO_CANCEL_JOB";
public static final java.lang.String _TOO_MANY_PREREQUISITE_JOBS = "TOO_MANY_PREREQUISITE_JOBS";
public static final java.lang.String _TOO_MANY_JOBS_IN_QUEUE = "TOO_MANY_JOBS_IN_QUEUE";
public static final java.lang.String _USER_CANCELED_JOB = "USER_CANCELED_JOB";
public static final java.lang.String _WORKFLOW_FAILURE = "WORKFLOW_FAILURE";
public static final java.lang.String _UNKNOWN = "UNKNOWN";
public static final JobErrorReason DUPLICATE_JOB_KEY_FOR_CUSTOMER = new JobErrorReason(_DUPLICATE_JOB_KEY_FOR_CUSTOMER);
public static final JobErrorReason JOB_TYPE_NOT_SUPPORTED = new JobErrorReason(_JOB_TYPE_NOT_SUPPORTED);
public static final JobErrorReason PREREQUISITE_JOB_FAILED = new JobErrorReason(_PREREQUISITE_JOB_FAILED);
public static final JobErrorReason SELECTOR_CANNOT_USE_BOTH_JOB_IDS_AND_JOB_KEYS = new JobErrorReason(_SELECTOR_CANNOT_USE_BOTH_JOB_IDS_AND_JOB_KEYS);
public static final JobErrorReason TOO_LATE_TO_CANCEL_JOB = new JobErrorReason(_TOO_LATE_TO_CANCEL_JOB);
public static final JobErrorReason TOO_MANY_PREREQUISITE_JOBS = new JobErrorReason(_TOO_MANY_PREREQUISITE_JOBS);
public static final JobErrorReason TOO_MANY_JOBS_IN_QUEUE = new JobErrorReason(_TOO_MANY_JOBS_IN_QUEUE);
public static final JobErrorReason USER_CANCELED_JOB = new JobErrorReason(_USER_CANCELED_JOB);
public static final JobErrorReason WORKFLOW_FAILURE = new JobErrorReason(_WORKFLOW_FAILURE);
public static final JobErrorReason UNKNOWN = new JobErrorReason(_UNKNOWN);
public java.lang.String getValue() { return _value_;}
public static JobErrorReason fromValue(java.lang.String value)
throws java.lang.IllegalArgumentException {
JobErrorReason enumeration = (JobErrorReason)
_table_.get(value);
if (enumeration==null) throw new java.lang.IllegalArgumentException();
return enumeration;
}
public static JobErrorReason fromString(java.lang.String value)
throws java.lang.IllegalArgumentException {
return fromValue(value);
}
public boolean equals(java.lang.Object obj) {return (obj == this);}
public int hashCode() { return toString().hashCode();}
public java.lang.String toString() { return _value_;}
public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);}
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumSerializer(
_javaType, _xmlType);
}
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumDeserializer(
_javaType, _xmlType);
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(JobErrorReason.class);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "JobError.Reason"));
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
}
| {
"content_hash": "2fa84687a862ae914827fc2676d6c15e",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 154,
"avg_line_length": 52.46511627906977,
"alnum_prop": 0.7138741134751773,
"repo_name": "gawkermedia/googleads-java-lib",
"id": "4656c65818187a4438d5a2280dfdb7ad0d725333",
"size": "4512",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201601/cm/JobErrorReason.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "107468648"
}
],
"symlink_target": ""
} |
/*
This module implements a structure I've called "arena". An arena is a data
container composed of a set of pages. The arena grows automatically when
needed by adding new pages to hold new data. Arenas can be saved and loaded
from files.
*/
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
#include <time.h>
#include <yara/arena.h>
#include <yara/mem.h>
#include <yara/error.h>
#include <yara/limits.h>
#include <yara/hash.h>
#pragma pack(push)
#pragma pack(1)
typedef struct _ARENA_FILE_HEADER
{
char magic[4];
uint32_t size;
uint32_t version;
} ARENA_FILE_HEADER;
#pragma pack(pop)
#define free_space(page) \
((page)->size - (page)->used)
//
// _yr_arena_new_page
//
// Creates a new arena page of a given size
//
// Args:
// size_t size - Size of the page
//
// Returns:
// A pointer to the newly created YR_ARENA_PAGE structure
//
static YR_ARENA_PAGE* _yr_arena_new_page(
size_t size)
{
YR_ARENA_PAGE* new_page;
new_page = (YR_ARENA_PAGE*) yr_malloc(sizeof(YR_ARENA_PAGE));
if (new_page == NULL)
return NULL;
new_page->address = (uint8_t*) yr_malloc(size);
if (new_page->address == NULL)
{
yr_free(new_page);
return NULL;
}
new_page->size = size;
new_page->used = 0;
new_page->next = NULL;
new_page->prev = NULL;
new_page->reloc_list_head = NULL;
new_page->reloc_list_tail = NULL;
return new_page;
}
//
// _yr_arena_page_for_address
//
// Returns the page within the arena where an address reside.
//
// Args:
// YR_ARENA* arena - Pointer to the arena
// void* address - Address to be located
//
// Returns:
// A pointer the corresponding YR_ARENA_PAGE structure where the address
// resides.
//
static YR_ARENA_PAGE* _yr_arena_page_for_address(
YR_ARENA* arena,
void* address)
{
YR_ARENA_PAGE* page;
// Most of the times this function is called with an address within
// the current page, let's check the current page first to avoid
// looping through the page list.
page = arena->current_page;
if (page != NULL &&
(uint8_t*) address >= page->address &&
(uint8_t*) address < page->address + page->used)
return page;
page = arena->page_list_head;
while (page != NULL)
{
if ((uint8_t*) address >= page->address &&
(uint8_t*) address < page->address + page->used)
return page;
page = page->next;
}
return NULL;
}
//
// _yr_arena_make_relocatable
//
// Tells the arena that certain addresses contains a relocatable pointer.
//
// Args:
// YR_ARENA* arena - Pointer the arena
// void* address - Base address
// va_list offsets - List of offsets relative to base address
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
static int _yr_arena_make_relocatable(
YR_ARENA* arena,
void* base,
va_list offsets)
{
YR_RELOC* reloc;
YR_ARENA_PAGE* page;
size_t offset;
size_t base_offset;
int result = ERROR_SUCCESS;
page = _yr_arena_page_for_address(arena, base);
assert(page != NULL);
base_offset = (uint8_t*) base - page->address;
offset = va_arg(offsets, size_t);
while (offset != -1)
{
assert(page->used >= sizeof(int64_t));
assert(base_offset + offset <= page->used - sizeof(int64_t));
reloc = (YR_RELOC*) yr_malloc(sizeof(YR_RELOC));
if (reloc == NULL)
return ERROR_INSUFFICIENT_MEMORY;
reloc->offset = (uint32_t) (base_offset + offset);
reloc->next = NULL;
if (page->reloc_list_head == NULL)
page->reloc_list_head = reloc;
if (page->reloc_list_tail != NULL)
page->reloc_list_tail->next = reloc;
page->reloc_list_tail = reloc;
offset = va_arg(offsets, size_t);
}
return result;
}
//
// yr_arena_create
//
// Creates a new arena.
//
// Args:
// size_t initial_size - Initial size
// int flags - Flags
// YR_ARENA** arena - Address where a pointer to the new arena will be
// written to.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_create(
size_t initial_size,
int flags,
YR_ARENA** arena)
{
YR_ARENA* new_arena;
YR_ARENA_PAGE* new_page;
*arena = NULL;
new_arena = (YR_ARENA*) yr_malloc(sizeof(YR_ARENA));
if (new_arena == NULL)
return ERROR_INSUFFICIENT_MEMORY;
new_page = _yr_arena_new_page(initial_size);
if (new_page == NULL)
{
yr_free(new_arena);
return ERROR_INSUFFICIENT_MEMORY;
}
new_arena->page_list_head = new_page;
new_arena->current_page = new_page;
new_arena->flags = flags | ARENA_FLAGS_COALESCED;
*arena = new_arena;
return ERROR_SUCCESS;
}
//
// yr_arena_destroy
//
// Destroys an arena releasing its resource.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
void yr_arena_destroy(
YR_ARENA* arena)
{
YR_RELOC* reloc;
YR_RELOC* next_reloc;
YR_ARENA_PAGE* page;
YR_ARENA_PAGE* next_page;
if (arena == NULL)
return;
page = arena->page_list_head;
while(page != NULL)
{
next_page = page->next;
reloc = page->reloc_list_head;
while (reloc != NULL)
{
next_reloc = reloc->next;
yr_free(reloc);
reloc = next_reloc;
}
yr_free(page->address);
yr_free(page);
page = next_page;
}
yr_free(arena);
}
//
// yr_arena_base_address
//
// Returns the base address for the arena.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
//
// Returns:
// A pointer to the arena's data. NULL if no data has been written to
// the arena yet.
//
void* yr_arena_base_address(
YR_ARENA* arena)
{
if (arena->page_list_head->used == 0)
return NULL;
return arena->page_list_head->address;
}
//
// yr_arena_next_address
//
// Given an address and an offset, returns the address where
// address + offset resides. The arena is a collection of non-contiguous
// regions of memory (pages), if address is pointing at the end of a page,
// address + offset could cross the page boundary and point at somewhere
// within the next page, this function handles these situations. It works
// also with negative offsets.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
// void* address - Base address.
// int offset - Offset.
//
// Returns:
// A pointer
//
void* yr_arena_next_address(
YR_ARENA* arena,
void* address,
size_t offset)
{
YR_ARENA_PAGE* page;
page = _yr_arena_page_for_address(arena, address);
assert(page != NULL);
if ((uint8_t*) address + offset >= page->address &&
(uint8_t*) address + offset < page->address + page->used)
{
return (uint8_t*) address + offset;
}
if (offset > 0)
{
offset -= page->address + page->used - (uint8_t*) address;
page = page->next;
while (page != NULL)
{
if (offset < page->used)
return page->address + offset;
offset -= page->used;
page = page->next;
}
}
else
{
offset += page->used;
page = page->prev;
while (page != NULL)
{
if (offset < page->used)
return page->address + page->used + offset;
offset += page->used;
page = page->prev;
}
}
return NULL;
}
//
// yr_arena_coalesce
//
// Coalesce the arena into a single page. This is a required step before
// saving the arena to a file.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_coalesce(
YR_ARENA* arena)
{
YR_ARENA_PAGE* page;
YR_ARENA_PAGE* big_page;
YR_ARENA_PAGE* next_page;
YR_RELOC* reloc;
uint8_t** reloc_address;
uint8_t* reloc_target;
size_t total_size = 0;
page = arena->page_list_head;
while(page != NULL)
{
total_size += page->used;
page = page->next;
}
// Create a new page that will contain the entire arena.
big_page = _yr_arena_new_page(total_size);
if (big_page == NULL)
return ERROR_INSUFFICIENT_MEMORY;
// Copy data from current pages to the big page and adjust relocs.
page = arena->page_list_head;
while (page != NULL)
{
page->new_address = big_page->address + big_page->used;
memcpy(page->new_address, page->address, page->used);
reloc = page->reloc_list_head;
while (reloc != NULL)
{
reloc->offset += (uint32_t) big_page->used;
reloc = reloc->next;
}
if (big_page->reloc_list_head == NULL)
big_page->reloc_list_head = page->reloc_list_head;
if (big_page->reloc_list_tail != NULL)
big_page->reloc_list_tail->next = page->reloc_list_head;
if (page->reloc_list_tail != NULL)
big_page->reloc_list_tail = page->reloc_list_tail;
big_page->used += page->used;
page = page->next;
}
// Relocate pointers.
reloc = big_page->reloc_list_head;
while (reloc != NULL)
{
reloc_address = (uint8_t**) (big_page->address + reloc->offset);
reloc_target = *reloc_address;
if (reloc_target != NULL)
{
page = _yr_arena_page_for_address(arena, reloc_target);
assert(page != NULL);
*reloc_address = page->new_address + (reloc_target - page->address);
}
reloc = reloc->next;
}
// Release current pages.
page = arena->page_list_head;
while(page != NULL)
{
next_page = page->next;
yr_free(page->address);
yr_free(page);
page = next_page;
}
arena->page_list_head = big_page;
arena->current_page = big_page;
arena->flags |= ARENA_FLAGS_COALESCED;
return ERROR_SUCCESS;
}
//
// yr_arena_reserve_memory
//
// Ensures that the arena have enough contiguous memory for future allocations.
// if the available space in the current page is lower than "size", a new page
// is allocated.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
// size_t size - Size of the region to be reserved.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_reserve_memory(
YR_ARENA* arena,
size_t size)
{
YR_ARENA_PAGE* new_page;
size_t new_page_size;
uint8_t* new_page_address;
if (size > free_space(arena->current_page))
{
if (arena->flags & ARENA_FLAGS_FIXED_SIZE)
return ERROR_INSUFFICIENT_MEMORY;
// Requested space is bigger than current page's empty space,
// lets calculate the size for a new page.
new_page_size = arena->current_page->size * 2;
while (new_page_size < size)
new_page_size *= 2;
if (arena->current_page->used == 0)
{
// Current page is not used at all, it can be reallocated.
new_page_address = (uint8_t*) yr_realloc(
arena->current_page->address,
new_page_size);
if (new_page_address == NULL)
return ERROR_INSUFFICIENT_MEMORY;
arena->current_page->address = new_page_address;
arena->current_page->size = new_page_size;
}
else
{
new_page = _yr_arena_new_page(new_page_size);
if (new_page == NULL)
return ERROR_INSUFFICIENT_MEMORY;
new_page->prev = arena->current_page;
arena->current_page->next = new_page;
arena->current_page = new_page;
arena->flags &= ~ARENA_FLAGS_COALESCED;
}
}
return ERROR_SUCCESS;
}
//
// yr_arena_allocate_memory
//
// Allocates memory within the arena.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
// size_t size - Size of the region to be allocated.
// void** allocated_memory - Address of a pointer to newly allocated
// region.
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_allocate_memory(
YR_ARENA* arena,
size_t size,
void** allocated_memory)
{
FAIL_ON_ERROR(yr_arena_reserve_memory(arena, size));
*allocated_memory = arena->current_page->address + \
arena->current_page->used;
arena->current_page->used += size;
return ERROR_SUCCESS;
}
//
// yr_arena_allocate_struct
//
// Allocates a structure within the arena. This function is similar to
// yr_arena_allocate_memory but additionally receives a variable-length
// list of offsets within the structure where pointers reside. This allows
// the arena to keep track of pointers that must be adjusted when memory
// is relocated. This is an example on how to invoke this function:
//
// yr_arena_allocate_struct(
// arena,
// sizeof(MY_STRUCTURE),
// (void**) &my_structure_ptr,
// offsetof(MY_STRUCTURE, field_1),
// offsetof(MY_STRUCTURE, field_2),
// ..
// offsetof(MY_STRUCTURE, field_N),
// EOL);
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
// size_t size - Size of the region to be allocated.
// void** allocated_memory - Address of a pointer to newly allocated
// region.
// ... - Variable number of offsets relative to the
// beginning of the struct. Offsets are of type
// size_t.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_allocate_struct(
YR_ARENA* arena,
size_t size,
void** allocated_memory,
...)
{
int result;
va_list offsets;
va_start(offsets, allocated_memory);
result = yr_arena_allocate_memory(arena, size, allocated_memory);
if (result == ERROR_SUCCESS)
result = _yr_arena_make_relocatable(arena, *allocated_memory, offsets);
va_end(offsets);
if (result == ERROR_SUCCESS)
memset(*allocated_memory, 0, size);
return result;
}
//
// yr_arena_make_relocatable
//
// Tells the arena that certain addresses contains a relocatable pointer.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
// void* base - Address within the arena.
// ... - Variable number of size_t arguments with offsets
// relative to base.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_make_relocatable(
YR_ARENA* arena,
void* base,
...)
{
int result;
va_list offsets;
va_start(offsets, base);
result = _yr_arena_make_relocatable(arena, base, offsets);
va_end(offsets);
return result;
}
//
// yr_arena_write_data
//
// Writes data to the arena.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
// void* data - Pointer to data to be written.
// size_t size - Size of data.
// void** written_data - Address where a pointer to the written data will
// be returned.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_write_data(
YR_ARENA* arena,
const void* data,
size_t size,
void** written_data)
{
void* output;
int result;
if (size > free_space(arena->current_page))
{
result = yr_arena_allocate_memory(arena, size, &output);
if (result != ERROR_SUCCESS)
return result;
}
else
{
output = arena->current_page->address + arena->current_page->used;
arena->current_page->used += size;
}
memcpy(output, data, size);
if (written_data != NULL)
*written_data = output;
return ERROR_SUCCESS;
}
//
// yr_arena_write_string
//
// Writes string to the arena.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
// const char* string - Pointer to string to be written.
// char** written_string - Address where a pointer to the written data will
// be returned.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_write_string(
YR_ARENA* arena,
const char* string,
char** written_string)
{
return yr_arena_write_data(
arena,
(void*) string,
strlen(string) + 1,
(void**) written_string);
}
//
// yr_arena_append
//
// Appends source_arena to target_arena. This operation destroys source_arena,
// after returning any pointer to source_arena is no longer valid. The data
// from source_arena is guaranteed to be aligned to a 16 bytes boundary when
// written to the source_arena
//
// Args:
// YR_ARENA* target_arena - Pointer to target the arena.
// YR_ARENA* source_arena - Pointer to source arena.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_append(
YR_ARENA* target_arena,
YR_ARENA* source_arena)
{
uint8_t padding_data[15];
size_t padding_size = 16 - target_arena->current_page->used % 16;
if (padding_size < 16)
{
memset(&padding_data, 0xCC, padding_size);
FAIL_ON_ERROR(yr_arena_write_data(
target_arena,
padding_data,
padding_size,
NULL));
}
target_arena->current_page->next = source_arena->page_list_head;
source_arena->page_list_head->prev = target_arena->current_page;
target_arena->current_page = source_arena->current_page;
yr_free(source_arena);
return ERROR_SUCCESS;
}
//
// yr_arena_duplicate
//
// Duplicates the arena, making an exact copy. This function requires the
// arena to be coalesced.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
// YR_ARENA** duplicated - Address where a pointer to the new arena arena
// will be returned.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_duplicate(
YR_ARENA* arena,
YR_ARENA** duplicated)
{
YR_RELOC* reloc;
YR_RELOC* new_reloc;
YR_ARENA_PAGE* page;
YR_ARENA_PAGE* new_page;
YR_ARENA* new_arena;
uint8_t** reloc_address;
uint8_t* reloc_target;
// Only coalesced arenas can be duplicated.
assert(arena->flags & ARENA_FLAGS_COALESCED);
page = arena->page_list_head;
FAIL_ON_ERROR(yr_arena_create(page->size, arena->flags, &new_arena));
new_page = new_arena->current_page;
new_page->used = page->used;
memcpy(new_page->address, page->address, page->size);
reloc = page->reloc_list_head;
while (reloc != NULL)
{
new_reloc = (YR_RELOC*) yr_malloc(sizeof(YR_RELOC));
if (new_reloc == NULL)
{
yr_arena_destroy(new_arena);
return ERROR_INSUFFICIENT_MEMORY;
}
new_reloc->offset = reloc->offset;
new_reloc->next = NULL;
if (new_page->reloc_list_head == NULL)
new_page->reloc_list_head = new_reloc;
if (new_page->reloc_list_tail != NULL)
new_page->reloc_list_tail->next = new_reloc;
new_page->reloc_list_tail = new_reloc;
reloc_address = (uint8_t**) (new_page->address + new_reloc->offset);
reloc_target = *reloc_address;
if (reloc_target != NULL)
{
assert(reloc_target >= page->address);
assert(reloc_target < page->address + page->used);
*reloc_address = reloc_target - \
page->address + \
new_page->address;
}
reloc = reloc->next;
}
*duplicated = new_arena;
return ERROR_SUCCESS;
}
//
// yr_arena_load_stream
//
// Loads an arena from a stream.
//
// Args:
// YR_STREAM* stream - Pointer to stream object
// YR_ARENA** - Address where a pointer to the loaded arena
// will be returned
//
// Returns:
// ERROR_SUCCESS if successful, appropriate error code otherwise.
//
int yr_arena_load_stream(
YR_STREAM* stream,
YR_ARENA** arena)
{
YR_ARENA_PAGE* page;
YR_ARENA* new_arena;
ARENA_FILE_HEADER header;
uint32_t real_hash;
uint32_t file_hash;
uint32_t reloc_offset;
uint8_t** reloc_address;
uint8_t* reloc_target;
int result;
if (yr_stream_read(&header, sizeof(header), 1, stream) != 1)
return ERROR_INVALID_FILE;
if (header.magic[0] != 'Y' ||
header.magic[1] != 'A' ||
header.magic[2] != 'R' ||
header.magic[3] != 'A')
{
return ERROR_INVALID_FILE;
}
if (header.size < 2048) // compiled rules are always larger than 2KB
return ERROR_CORRUPT_FILE;
if (header.version != ARENA_FILE_VERSION)
return ERROR_UNSUPPORTED_FILE_VERSION;
real_hash = yr_hash(0, &header, sizeof(header));
result = yr_arena_create(header.size, 0, &new_arena);
if (result != ERROR_SUCCESS)
return result;
page = new_arena->current_page;
if (yr_stream_read(page->address, header.size, 1, stream) != 1)
{
yr_arena_destroy(new_arena);
return ERROR_CORRUPT_FILE;
}
page->used = header.size;
real_hash = yr_hash(real_hash, page->address, page->used);
if (yr_stream_read(&reloc_offset, sizeof(reloc_offset), 1, stream) != 1)
{
yr_arena_destroy(new_arena);
return ERROR_CORRUPT_FILE;
}
while (reloc_offset != 0xFFFFFFFF)
{
if (reloc_offset > header.size - sizeof(uint8_t*))
{
yr_arena_destroy(new_arena);
return ERROR_CORRUPT_FILE;
}
yr_arena_make_relocatable(new_arena, page->address, reloc_offset, EOL);
reloc_address = (uint8_t**) (page->address + reloc_offset);
reloc_target = *reloc_address;
if (reloc_target != (uint8_t*) (size_t) 0xFFFABADA)
*reloc_address += (size_t) page->address;
else
*reloc_address = 0;
if (yr_stream_read(&reloc_offset, sizeof(reloc_offset), 1, stream) != 1)
{
yr_arena_destroy(new_arena);
return ERROR_CORRUPT_FILE;
}
}
if (yr_stream_read(&file_hash, sizeof(file_hash), 1, stream) != 1)
{
yr_arena_destroy(new_arena);
return ERROR_CORRUPT_FILE;
}
if (file_hash != real_hash)
{
yr_arena_destroy(new_arena);
return ERROR_CORRUPT_FILE;
}
*arena = new_arena;
return ERROR_SUCCESS;
}
//
// yr_arena_save_stream
//
// Saves the arena into a stream. If the file exists its overwritten. This
// function requires the arena to be coalesced.
//
// Args:
// YR_ARENA* arena - Pointer to the arena.
// YR_STREAM* stream - Pointer to stream object.
//
// Returns:
// ERROR_SUCCESS if succeed or the corresponding error code otherwise.
//
int yr_arena_save_stream(
YR_ARENA* arena,
YR_STREAM* stream)
{
YR_ARENA_PAGE* page;
YR_RELOC* reloc;
ARENA_FILE_HEADER header;
uint32_t end_marker = 0xFFFFFFFF;
uint32_t file_hash;
uint8_t** reloc_address;
uint8_t* reloc_target;
// Only coalesced arenas can be saved.
assert(arena->flags & ARENA_FLAGS_COALESCED);
page = arena->page_list_head;
reloc = page->reloc_list_head;
// Convert pointers to offsets before saving.
while (reloc != NULL)
{
reloc_address = (uint8_t**) (page->address + reloc->offset);
reloc_target = *reloc_address;
if (reloc_target != NULL)
{
assert(reloc_target >= page->address);
assert(reloc_target < page->address + page->used);
*reloc_address = (uint8_t*) (*reloc_address - page->address);
}
else
{
*reloc_address = (uint8_t*) (size_t) 0xFFFABADA;
}
reloc = reloc->next;
}
assert(page->size < 0x80000000); // 2GB
header.magic[0] = 'Y';
header.magic[1] = 'A';
header.magic[2] = 'R';
header.magic[3] = 'A';
header.size = (int32_t) page->size;
header.version = ARENA_FILE_VERSION;
yr_stream_write(&header, sizeof(header), 1, stream);
yr_stream_write(page->address, header.size, 1, stream);
file_hash = yr_hash(0, &header, sizeof(header));
file_hash = yr_hash(file_hash, page->address, page->used);
reloc = page->reloc_list_head;
// Convert offsets back to pointers.
while (reloc != NULL)
{
yr_stream_write(&reloc->offset, sizeof(reloc->offset), 1, stream);
reloc_address = (uint8_t**) (page->address + reloc->offset);
reloc_target = *reloc_address;
if (reloc_target != (void*) (size_t) 0xFFFABADA)
*reloc_address += (size_t) page->address;
else
*reloc_address = 0;
reloc = reloc->next;
}
yr_stream_write(&end_marker, sizeof(end_marker), 1, stream);
yr_stream_write(&file_hash, sizeof(file_hash), 1, stream);
return ERROR_SUCCESS;
}
| {
"content_hash": "7aaf4c448589e6201f59084e63dcbf98",
"timestamp": "",
"source": "github",
"line_count": 1080,
"max_line_length": 79,
"avg_line_length": 22.35,
"alnum_prop": 0.6188996602866849,
"repo_name": "rednaga/yara",
"id": "3f37bc5d7bed6bd0d7be6628456fc726667004ec",
"size": "25631",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "libyara/arena.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "1586961"
},
{
"name": "C++",
"bytes": "16161"
},
{
"name": "Lex",
"bytes": "37009"
},
{
"name": "M4",
"bytes": "21048"
},
{
"name": "Makefile",
"bytes": "4374"
},
{
"name": "Roff",
"bytes": "4862"
},
{
"name": "Shell",
"bytes": "80"
},
{
"name": "Yacc",
"bytes": "74410"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<title>Request Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/Request" class="dashAnchor"></a>
<a title="Request Class Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
Alamofire 5.4.0 Docs
</a>
(97% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
<p class="header-col header-col--secondary">
<a class="header-link" href="https://github.com/Alamofire/Alamofire">
<img class="header-icon" src="../img/gh.png"/>
View on GitHub
</a>
</p>
<p class="header-col header-col--secondary">
<a class="header-link" href="dash-feed://https%3A%2F%2Falamofire.github.io%2FAlamofire%2Fdocsets%2FAlamofire.xml">
<img class="header-icon" src="../img/dash.png"/>
Install in Dash
</a>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">Alamofire Reference</a>
<img class="carat" src="../img/carat.png" />
Request Class Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/Adapter.html">Adapter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/AlamofireNotifications.html">AlamofireNotifications</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/AuthenticationInterceptor.html">AuthenticationInterceptor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/AuthenticationInterceptor/RefreshWindow.html">– RefreshWindow</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ClosureEventMonitor.html">ClosureEventMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CompositeEventMonitor.html">CompositeEventMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/CompositeTrustEvaluator.html">CompositeTrustEvaluator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ConnectionLostRetryPolicy.html">ConnectionLostRetryPolicy</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DataRequest.html">DataRequest</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DataResponseSerializer.html">DataResponseSerializer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DataStreamRequest.html">DataStreamRequest</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DataStreamRequest/Stream.html">– Stream</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DataStreamRequest/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DataStreamRequest/Completion.html">– Completion</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DataStreamRequest/CancellationToken.html">– CancellationToken</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DecodableResponseSerializer.html">DecodableResponseSerializer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DefaultTrustEvaluator.html">DefaultTrustEvaluator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DisabledTrustEvaluator.html">DisabledTrustEvaluator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DownloadRequest.html">DownloadRequest</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DownloadRequest/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DownloadRequest/Downloadable.html">– Downloadable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/Interceptor.html">Interceptor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/JSONParameterEncoder.html">JSONParameterEncoder</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/JSONResponseSerializer.html">JSONResponseSerializer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/MultipartFormData.html">MultipartFormData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/NetworkReachabilityManager.html">NetworkReachabilityManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/NetworkReachabilityManager/NetworkReachabilityStatus.html">– NetworkReachabilityStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/PinnedCertificatesTrustEvaluator.html">PinnedCertificatesTrustEvaluator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/PublicKeysTrustEvaluator.html">PublicKeysTrustEvaluator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/Request.html">Request</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/Request/State.html">– State</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/Retrier.html">Retrier</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/RetryPolicy.html">RetryPolicy</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/RevocationTrustEvaluator.html">RevocationTrustEvaluator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/RevocationTrustEvaluator/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/ServerTrustManager.html">ServerTrustManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/Session.html">Session</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SessionDelegate.html">SessionDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/StringResponseSerializer.html">StringResponseSerializer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/URLEncodedFormEncoder.html">URLEncodedFormEncoder</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/URLEncodedFormEncoder/ArrayEncoding.html">– ArrayEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/URLEncodedFormEncoder/BoolEncoding.html">– BoolEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/URLEncodedFormEncoder/DataEncoding.html">– DataEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/URLEncodedFormEncoder/DateEncoding.html">– DateEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/URLEncodedFormEncoder/KeyEncoding.html">– KeyEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/URLEncodedFormEncoder/SpaceEncoding.html">– SpaceEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/URLEncodedFormEncoder/Error.html">– Error</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/URLEncodedFormParameterEncoder.html">URLEncodedFormParameterEncoder</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/URLEncodedFormParameterEncoder/Destination.html">– Destination</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/UploadRequest.html">UploadRequest</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/UploadRequest/Uploadable.html">– Uploadable</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global%20Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global%20Variables.html#/s:9Alamofire2AFAA7SessionCvp">AF</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/AFError.html">AFError</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/AFError/MultipartEncodingFailureReason.html">– MultipartEncodingFailureReason</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/AFError/ParameterEncodingFailureReason.html">– ParameterEncodingFailureReason</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/AFError/ParameterEncoderFailureReason.html">– ParameterEncoderFailureReason</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/AFError/ResponseValidationFailureReason.html">– ResponseValidationFailureReason</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/AFError/ResponseSerializationFailureReason.html">– ResponseSerializationFailureReason</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/AFError/ServerTrustFailureReason.html">– ServerTrustFailureReason</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/AFError/URLRequestValidationFailureReason.html">– URLRequestValidationFailureReason</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/AuthenticationError.html">AuthenticationError</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/RetryResult.html">RetryResult</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Array.html">Array</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions.html#/c:objc(cs)NSBundle">Bundle</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/CharacterSet.html">CharacterSet</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Error.html">Error</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/HTTPURLResponse.html">HTTPURLResponse</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions.html#/s:10Foundation11JSONDecoderC">JSONDecoder</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Notification.html">Notification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions.html#/c:@T@OSStatus">OSStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions.html#/s:10Foundation19PropertyListDecoderC">PropertyListDecoder</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions.html#/c:@T@SecCertificateRef">SecCertificate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions.html#/c:@T@SecPolicyRef">SecPolicy</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions.html#/c:@T@SecTrustRef">SecTrust</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions.html#/c:@E@SecTrustResultType">SecTrustResultType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/String.html">String</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/URL.html">URL</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/URLComponents.html">URLComponents</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/URLRequest.html">URLRequest</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/URLSessionConfiguration.html">URLSessionConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/AlamofireExtended.html">AlamofireExtended</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/AuthenticationCredential.html">AuthenticationCredential</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/Authenticator.html">Authenticator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/CachedResponseHandler.html">CachedResponseHandler</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/DataDecoder.html">DataDecoder</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/DataPreprocessor.html">DataPreprocessor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/DataResponseSerializerProtocol.html">DataResponseSerializerProtocol</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/DataStreamSerializer.html">DataStreamSerializer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/DownloadResponseSerializerProtocol.html">DownloadResponseSerializerProtocol</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/EmptyResponse.html">EmptyResponse</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/EventMonitor.html">EventMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/ParameterEncoder.html">ParameterEncoder</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/ParameterEncoding.html">ParameterEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/RedirectHandler.html">RedirectHandler</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/RequestAdapter.html">RequestAdapter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/RequestDelegate.html">RequestDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/RequestInterceptor.html">RequestInterceptor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/RequestRetrier.html">RequestRetrier</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/ResponseSerializer.html">ResponseSerializer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/ServerTrustEvaluating.html">ServerTrustEvaluating</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/URLConvertible.html">URLConvertible</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/URLRequestConvertible.html">URLRequestConvertible</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:9Alamofire17UploadConvertibleP">UploadConvertible</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/UploadableConvertible.html">UploadableConvertible</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/AlamofireExtension.html">AlamofireExtension</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/DataResponse.html">DataResponse</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/DataResponsePublisher.html">DataResponsePublisher</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/DataStreamPublisher.html">DataStreamPublisher</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/DecodableStreamSerializer.html">DecodableStreamSerializer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/DownloadResponse.html">DownloadResponse</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/DownloadResponsePublisher.html">DownloadResponsePublisher</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Empty.html">Empty</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/GoogleXSSIPreprocessor.html">GoogleXSSIPreprocessor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/HTTPHeader.html">HTTPHeader</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/HTTPHeaders.html">HTTPHeaders</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/HTTPMethod.html">HTTPMethod</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/JSONEncoding.html">JSONEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/PassthroughPreprocessor.html">PassthroughPreprocessor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/PassthroughStreamSerializer.html">PassthroughStreamSerializer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Redirector.html">Redirector</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Redirector/Behavior.html">– Behavior</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/ResponseCacher.html">ResponseCacher</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/ResponseCacher/Behavior.html">– Behavior</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/StringStreamSerializer.html">StringStreamSerializer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/URLEncoding.html">URLEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/URLEncoding/Destination.html">– Destination</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/URLEncoding/ArrayEncoding.html">– ArrayEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/URLEncoding/BoolEncoding.html">– BoolEncoding</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/URLResponseSerializer.html">URLResponseSerializer</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:9Alamofire14AFDataResponsea">AFDataResponse</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:9Alamofire18AFDownloadResponsea">AFDownloadResponse</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:9Alamofire8AFResulta">AFResult</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:9Alamofire12AdaptHandlera">AdaptHandler</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:9Alamofire17DisabledEvaluatora">DisabledEvaluator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:9Alamofire10Parametersa">Parameters</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:9Alamofire12RetryHandlera">RetryHandler</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content top-matter">
<h1>Request</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">Request</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Request</span><span class="p">:</span> <span class="kt">Equatable</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Request</span><span class="p">:</span> <span class="kt">Hashable</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Request</span><span class="p">:</span> <span class="kt">CustomStringConvertible</span></code></pre>
</div>
</div>
<p><code>Request</code> is the common superclass of all Alamofire request types and provides common state, delegate, and callback
handling.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC5StateO"></a>
<a name="//apple_ref/swift/Enum/State" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC5StateO">State</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>State of the <code><a href="../Classes/Request.html">Request</a></code>, with managed transitions between states set when calling <code><a href="../Classes/Request.html#/s:9Alamofire7RequestC6resumeACXDyF">resume()</a></code>, <code><a href="../Classes/Request.html#/s:9Alamofire7RequestC7suspendACXDyF">suspend()</a></code>, or
<code><a href="../Classes/Request.html#/s:9Alamofire7RequestC6cancelACXDyF">cancel()</a></code> on the <code><a href="../Classes/Request.html">Request</a></code>.</p>
<a href="../Classes/Request/State.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">State</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Initial%20State"></a>
<a name="//apple_ref/swift/Section/Initial State" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Initial%20State"></a>
<h3 class="section-name"><p>Initial State</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC2id10Foundation4UUIDVvp"></a>
<a name="//apple_ref/swift/Property/id" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC2id10Foundation4UUIDVvp">id</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>UUID</code> providing a unique identifier for the <code>Request</code>, used in the <code>Hashable</code> and <code>Equatable</code> conformances.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">id</span><span class="p">:</span> <span class="kt">UUID</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC15underlyingQueueSo17OS_dispatch_queueCvp"></a>
<a name="//apple_ref/swift/Property/underlyingQueue" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC15underlyingQueueSo17OS_dispatch_queueCvp">underlyingQueue</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The serial queue for all internal async actions.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">underlyingQueue</span><span class="p">:</span> <span class="kt">DispatchQueue</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC18serializationQueueSo17OS_dispatch_queueCvp"></a>
<a name="//apple_ref/swift/Property/serializationQueue" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC18serializationQueueSo17OS_dispatch_queueCvp">serializationQueue</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The queue used for all serialization actions. By default it’s a serial queue that targets <code><a href="../Classes/Request.html#/s:9Alamofire7RequestC15underlyingQueueSo17OS_dispatch_queueCvp">underlyingQueue</a></code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">serializationQueue</span><span class="p">:</span> <span class="kt">DispatchQueue</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC12eventMonitorAA05EventD0_pSgvp"></a>
<a name="//apple_ref/swift/Property/eventMonitor" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC12eventMonitorAA05EventD0_pSgvp">eventMonitor</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code><a href="../Protocols/EventMonitor.html">EventMonitor</a></code> used for event callbacks.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">eventMonitor</span><span class="p">:</span> <span class="kt"><a href="../Protocols/EventMonitor.html">EventMonitor</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC11interceptorAA0B11Interceptor_pSgvp"></a>
<a name="//apple_ref/swift/Property/interceptor" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC11interceptorAA0B11Interceptor_pSgvp">interceptor</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The <code>Request</code>‘s interceptor.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">interceptor</span><span class="p">:</span> <span class="kt"><a href="../Protocols/RequestInterceptor.html">RequestInterceptor</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC8delegateAA0B8Delegate_pSgvp"></a>
<a name="//apple_ref/swift/Property/delegate" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC8delegateAA0B8Delegate_pSgvp">delegate</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The <code>Request</code>‘s delegate.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="k">weak</span> <span class="k">var</span> <span class="nv">delegate</span><span class="p">:</span> <span class="kt"><a href="../Protocols/RequestDelegate.html">RequestDelegate</a></span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Mutable%20State"></a>
<a name="//apple_ref/swift/Section/Mutable State" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Mutable%20State"></a>
<h3 class="section-name"><p>Mutable State</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC5stateAC5StateOvp"></a>
<a name="//apple_ref/swift/Property/state" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC5stateAC5StateOvp">state</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code><a href="../Classes/Request/State.html">State</a></code> of the <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">state</span><span class="p">:</span> <span class="kt"><a href="../Classes/Request/State.html">State</a></span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC13isInitializedSbvp"></a>
<a name="//apple_ref/swift/Property/isInitialized" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC13isInitializedSbvp">isInitialized</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Returns whether <code><a href="../Classes/Request.html#/s:9Alamofire7RequestC5stateAC5StateOvp">state</a></code> is <code>.initialized</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isInitialized</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC9isResumedSbvp"></a>
<a name="//apple_ref/swift/Property/isResumed" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC9isResumedSbvp">isResumed</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Returns whether <code>state is</code>.resumed`.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isResumed</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC11isSuspendedSbvp"></a>
<a name="//apple_ref/swift/Property/isSuspended" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC11isSuspendedSbvp">isSuspended</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Returns whether <code><a href="../Classes/Request.html#/s:9Alamofire7RequestC5stateAC5StateOvp">state</a></code> is <code>.suspended</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isSuspended</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC11isCancelledSbvp"></a>
<a name="//apple_ref/swift/Property/isCancelled" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC11isCancelledSbvp">isCancelled</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Returns whether <code><a href="../Classes/Request.html#/s:9Alamofire7RequestC5stateAC5StateOvp">state</a></code> is <code>.cancelled</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isCancelled</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC10isFinishedSbvp"></a>
<a name="//apple_ref/swift/Property/isFinished" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC10isFinishedSbvp">isFinished</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Returns whether <code><a href="../Classes/Request.html#/s:9Alamofire7RequestC5stateAC5StateOvp">state</a></code> is <code>.finished</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isFinished</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Progress"></a>
<a name="//apple_ref/swift/Section/Progress" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Progress"></a>
<h3 class="section-name"><p>Progress</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC15ProgressHandlera"></a>
<a name="//apple_ref/swift/Alias/ProgressHandler" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC15ProgressHandlera">ProgressHandler</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Closure type executed when monitoring the upload or download progress of a request.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">ProgressHandler</span> <span class="o">=</span> <span class="p">(</span><span class="kt">Progress</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC14uploadProgressSo10NSProgressCvp"></a>
<a name="//apple_ref/swift/Property/uploadProgress" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC14uploadProgressSo10NSProgressCvp">uploadProgress</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>Progress</code> of the upload of the body of the executed <code>URLRequest</code>. Reset to <code>0</code> if the <code>Request</code> is retried.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">uploadProgress</span><span class="p">:</span> <span class="kt">Progress</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC16downloadProgressSo10NSProgressCvp"></a>
<a name="//apple_ref/swift/Property/downloadProgress" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC16downloadProgressSo10NSProgressCvp">downloadProgress</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>Progress</code> of the download of any response data. Reset to <code>0</code> if the <code>Request</code> is retried.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">downloadProgress</span><span class="p">:</span> <span class="kt">Progress</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Redirect%20Handling"></a>
<a name="//apple_ref/swift/Section/Redirect Handling" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Redirect%20Handling"></a>
<h3 class="section-name"><p>Redirect Handling</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC15redirectHandlerAA08RedirectD0_pSgvp"></a>
<a name="//apple_ref/swift/Property/redirectHandler" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC15redirectHandlerAA08RedirectD0_pSgvp">redirectHandler</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code><a href="../Protocols/RedirectHandler.html">RedirectHandler</a></code> set on the instance.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="k">var</span> <span class="nv">redirectHandler</span><span class="p">:</span> <span class="kt"><a href="../Protocols/RedirectHandler.html">RedirectHandler</a></span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Cached%20Response%20Handling"></a>
<a name="//apple_ref/swift/Section/Cached Response Handling" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Cached%20Response%20Handling"></a>
<h3 class="section-name"><p>Cached Response Handling</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC21cachedResponseHandlerAA06CacheddE0_pSgvp"></a>
<a name="//apple_ref/swift/Property/cachedResponseHandler" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC21cachedResponseHandlerAA06CacheddE0_pSgvp">cachedResponseHandler</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code><a href="../Protocols/CachedResponseHandler.html">CachedResponseHandler</a></code> set on the instance.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="k">var</span> <span class="nv">cachedResponseHandler</span><span class="p">:</span> <span class="kt"><a href="../Protocols/CachedResponseHandler.html">CachedResponseHandler</a></span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/URLCredential"></a>
<a name="//apple_ref/swift/Section/URLCredential" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/URLCredential"></a>
<h3 class="section-name"><p>URLCredential</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC10credentialSo15NSURLCredentialCSgvp"></a>
<a name="//apple_ref/swift/Property/credential" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC10credentialSo15NSURLCredentialCSgvp">credential</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>URLCredential</code> used for authentication challenges. Created by calling one of the <code>authenticate</code> methods.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="k">var</span> <span class="nv">credential</span><span class="p">:</span> <span class="kt">URLCredential</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/URLRequests"></a>
<a name="//apple_ref/swift/Section/URLRequests" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/URLRequests"></a>
<h3 class="section-name"><p>URLRequests</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC8requestsSay10Foundation10URLRequestVGvp"></a>
<a name="//apple_ref/swift/Property/requests" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC8requestsSay10Foundation10URLRequestVGvp">requests</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>All <code>URLRequests</code> created on behalf of the <code>Request</code>, including original and adapted requests.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">requests</span><span class="p">:</span> <span class="p">[</span><span class="kt">URLRequest</span><span class="p">]</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC05firstB010Foundation10URLRequestVSgvp"></a>
<a name="//apple_ref/swift/Property/firstRequest" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC05firstB010Foundation10URLRequestVSgvp">firstRequest</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>First <code>URLRequest</code> created on behalf of the <code>Request</code>. May not be the first one actually executed.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">firstRequest</span><span class="p">:</span> <span class="kt">URLRequest</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC04lastB010Foundation10URLRequestVSgvp"></a>
<a name="//apple_ref/swift/Property/lastRequest" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC04lastB010Foundation10URLRequestVSgvp">lastRequest</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Last <code>URLRequest</code> created on behalf of the <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">lastRequest</span><span class="p">:</span> <span class="kt">URLRequest</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC7request10Foundation10URLRequestVSgvp"></a>
<a name="//apple_ref/swift/Property/request" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC7request10Foundation10URLRequestVSgvp">request</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Current <code>URLRequest</code> created on behalf of the <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">request</span><span class="p">:</span> <span class="kt">URLRequest</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC17performedRequestsSay10Foundation10URLRequestVGvp"></a>
<a name="//apple_ref/swift/Property/performedRequests" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC17performedRequestsSay10Foundation10URLRequestVGvp">performedRequests</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>URLRequest</code>s from all of the <code>URLSessionTask</code>s executed on behalf of the <code>Request</code>. May be different from
<code><a href="../Classes/Request.html#/s:9Alamofire7RequestC8requestsSay10Foundation10URLRequestVGvp">requests</a></code> due to <code>URLSession</code> manipulation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">performedRequests</span><span class="p">:</span> <span class="p">[</span><span class="kt">URLRequest</span><span class="p">]</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/HTTPURLResponse"></a>
<a name="//apple_ref/swift/Section/HTTPURLResponse" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/HTTPURLResponse"></a>
<h3 class="section-name"><p>HTTPURLResponse</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC8responseSo17NSHTTPURLResponseCSgvp"></a>
<a name="//apple_ref/swift/Property/response" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC8responseSo17NSHTTPURLResponseCSgvp">response</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>HTTPURLResponse</code> received from the server, if any. If the <code>Request</code> was retried, this is the response of the
last <code>URLSessionTask</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">response</span><span class="p">:</span> <span class="kt">HTTPURLResponse</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Tasks"></a>
<a name="//apple_ref/swift/Section/Tasks" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Tasks"></a>
<h3 class="section-name"><p>Tasks</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC5tasksSaySo16NSURLSessionTaskCGvp"></a>
<a name="//apple_ref/swift/Property/tasks" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC5tasksSaySo16NSURLSessionTaskCGvp">tasks</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>All <code>URLSessionTask</code>s created on behalf of the <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">tasks</span><span class="p">:</span> <span class="p">[</span><span class="kt">URLSessionTask</span><span class="p">]</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC9firstTaskSo012NSURLSessionD0CSgvp"></a>
<a name="//apple_ref/swift/Property/firstTask" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC9firstTaskSo012NSURLSessionD0CSgvp">firstTask</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>First <code>URLSessionTask</code> created on behalf of the <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">firstTask</span><span class="p">:</span> <span class="kt">URLSessionTask</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC8lastTaskSo012NSURLSessionD0CSgvp"></a>
<a name="//apple_ref/swift/Property/lastTask" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC8lastTaskSo012NSURLSessionD0CSgvp">lastTask</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Last <code>URLSessionTask</code> crated on behalf of the <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">lastTask</span><span class="p">:</span> <span class="kt">URLSessionTask</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC4taskSo16NSURLSessionTaskCSgvp"></a>
<a name="//apple_ref/swift/Property/task" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC4taskSo16NSURLSessionTaskCSgvp">task</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Current <code>URLSessionTask</code> created on behalf of the <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">task</span><span class="p">:</span> <span class="kt">URLSessionTask</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Metrics"></a>
<a name="//apple_ref/swift/Section/Metrics" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Metrics"></a>
<h3 class="section-name"><p>Metrics</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC10allMetricsSaySo016NSURLSessionTaskD0CGvp"></a>
<a name="//apple_ref/swift/Property/allMetrics" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC10allMetricsSaySo016NSURLSessionTaskD0CGvp">allMetrics</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>All <code>URLSessionTaskMetrics</code> gathered on behalf of the <code>Request</code>. Should correspond to the <code><a href="../Classes/Request.html#/s:9Alamofire7RequestC5tasksSaySo16NSURLSessionTaskCGvp">tasks</a></code> created.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">allMetrics</span><span class="p">:</span> <span class="p">[</span><span class="kt">URLSessionTaskMetrics</span><span class="p">]</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC12firstMetricsSo016NSURLSessionTaskD0CSgvp"></a>
<a name="//apple_ref/swift/Property/firstMetrics" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC12firstMetricsSo016NSURLSessionTaskD0CSgvp">firstMetrics</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>First <code>URLSessionTaskMetrics</code> gathered on behalf of the <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">firstMetrics</span><span class="p">:</span> <span class="kt">URLSessionTaskMetrics</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC11lastMetricsSo016NSURLSessionTaskD0CSgvp"></a>
<a name="//apple_ref/swift/Property/lastMetrics" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC11lastMetricsSo016NSURLSessionTaskD0CSgvp">lastMetrics</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Last <code>URLSessionTaskMetrics</code> gathered on behalf of the <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">lastMetrics</span><span class="p">:</span> <span class="kt">URLSessionTaskMetrics</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC7metricsSo23NSURLSessionTaskMetricsCSgvp"></a>
<a name="//apple_ref/swift/Property/metrics" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC7metricsSo23NSURLSessionTaskMetricsCSgvp">metrics</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Current <code>URLSessionTaskMetrics</code> gathered on behalf of the <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">metrics</span><span class="p">:</span> <span class="kt">URLSessionTaskMetrics</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Retry%20Count"></a>
<a name="//apple_ref/swift/Section/Retry Count" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Retry%20Count"></a>
<h3 class="section-name"><p>Retry Count</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC10retryCountSivp"></a>
<a name="//apple_ref/swift/Property/retryCount" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC10retryCountSivp">retryCount</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Number of times the <code>Request</code> has been retried.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">retryCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Error"></a>
<a name="//apple_ref/swift/Section/Error" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Error"></a>
<h3 class="section-name"><p>Error</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC5errorAA7AFErrorOSgvp"></a>
<a name="//apple_ref/swift/Property/error" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC5errorAA7AFErrorOSgvp">error</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>Error</code> returned from Alamofire internally, from the network request directly, or any validators executed.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">fileprivate</span><span class="p">(</span><span class="k">set</span><span class="p">)</span> <span class="k">var</span> <span class="nv">error</span><span class="p">:</span> <span class="kt"><a href="../Enums/AFError.html">AFError</a></span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/State"></a>
<a name="//apple_ref/swift/Section/State" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/State"></a>
<h3 class="section-name"><p>State</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC6cancelACXDyF"></a>
<a name="//apple_ref/swift/Method/cancel()" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC6cancelACXDyF">cancel()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Cancels the instance. Once cancelled, a <code>Request</code> can no longer be resumed or suspended.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">cancel</span><span class="p">()</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC7suspendACXDyF"></a>
<a name="//apple_ref/swift/Method/suspend()" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC7suspendACXDyF">suspend()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Suspends the instance.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">suspend</span><span class="p">()</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC6resumeACXDyF"></a>
<a name="//apple_ref/swift/Method/resume()" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC6resumeACXDyF">resume()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Resumes the instance.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">resume</span><span class="p">()</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Closure%20API"></a>
<a name="//apple_ref/swift/Section/Closure API" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Closure%20API"></a>
<h3 class="section-name"><p>Closure API</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC12authenticate8username8password11persistenceACXDSS_SSSo26NSURLCredentialPersistenceVtF"></a>
<a name="//apple_ref/swift/Method/authenticate(username:password:persistence:)" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC12authenticate8username8password11persistenceACXDSS_SSSo26NSURLCredentialPersistenceVtF">authenticate(username:<wbr>password:<wbr>persistence:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Associates a credential using the provided values with the instance.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">authenticate</span><span class="p">(</span><span class="nv">username</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">password</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">persistence</span><span class="p">:</span> <span class="kt">URLCredential</span><span class="o">.</span><span class="kt">Persistence</span> <span class="o">=</span> <span class="o">.</span><span class="n">forSession</span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>username</em>
</code>
</td>
<td>
<div>
<p>The username.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>password</em>
</code>
</td>
<td>
<div>
<p>The password.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>persistence</em>
</code>
</td>
<td>
<div>
<p>The <code>URLCredential.Persistence</code> for the created <code>URLCredential</code>. <code>.forSession</code> by default.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC12authenticate4withACXDSo15NSURLCredentialC_tF"></a>
<a name="//apple_ref/swift/Method/authenticate(with:)" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC12authenticate4withACXDSo15NSURLCredentialC_tF">authenticate(with:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Associates the provided credential with the instance.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">authenticate</span><span class="p">(</span><span class="n">with</span> <span class="nv">credential</span><span class="p">:</span> <span class="kt">URLCredential</span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>credential</em>
</code>
</td>
<td>
<div>
<p>The <code>URLCredential</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC16downloadProgress5queue7closureACXDSo012OS_dispatch_E0C_ySo10NSProgressCctF"></a>
<a name="//apple_ref/swift/Method/downloadProgress(queue:closure:)" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC16downloadProgress5queue7closureACXDSo012OS_dispatch_E0C_ySo10NSProgressCctF">downloadProgress(queue:<wbr>closure:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets a closure to be called periodically during the lifecycle of the instance as data is read from the server.</p>
<div class="aside aside-note">
<p class="aside-title">Note</p>
<p>Only the last closure provided is used.</p>
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">downloadProgress</span><span class="p">(</span><span class="nv">queue</span><span class="p">:</span> <span class="kt">DispatchQueue</span> <span class="o">=</span> <span class="o">.</span><span class="n">main</span><span class="p">,</span> <span class="nv">closure</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../Classes/Request.html#/s:9Alamofire7RequestC15ProgressHandlera">ProgressHandler</a></span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>queue</em>
</code>
</td>
<td>
<div>
<p>The <code>DispatchQueue</code> to execute the closure on. <code>.main</code> by default.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>closure</em>
</code>
</td>
<td>
<div>
<p>The closure to be executed periodically as data is read from the server.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC14uploadProgress5queue7closureACXDSo012OS_dispatch_E0C_ySo10NSProgressCctF"></a>
<a name="//apple_ref/swift/Method/uploadProgress(queue:closure:)" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC14uploadProgress5queue7closureACXDSo012OS_dispatch_E0C_ySo10NSProgressCctF">uploadProgress(queue:<wbr>closure:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets a closure to be called periodically during the lifecycle of the instance as data is sent to the server.</p>
<div class="aside aside-note">
<p class="aside-title">Note</p>
<p>Only the last closure provided is used.</p>
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">uploadProgress</span><span class="p">(</span><span class="nv">queue</span><span class="p">:</span> <span class="kt">DispatchQueue</span> <span class="o">=</span> <span class="o">.</span><span class="n">main</span><span class="p">,</span> <span class="nv">closure</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../Classes/Request.html#/s:9Alamofire7RequestC15ProgressHandlera">ProgressHandler</a></span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>queue</em>
</code>
</td>
<td>
<div>
<p>The <code>DispatchQueue</code> to execute the closure on. <code>.main</code> by default.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>closure</em>
</code>
</td>
<td>
<div>
<p>The closure to be executed periodically as data is sent to the server.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Redirects"></a>
<a name="//apple_ref/swift/Section/Redirects" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Redirects"></a>
<h3 class="section-name"><p>Redirects</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC8redirect5usingACXDAA15RedirectHandler_p_tF"></a>
<a name="//apple_ref/swift/Method/redirect(using:)" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC8redirect5usingACXDAA15RedirectHandler_p_tF">redirect(using:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the redirect handler for the instance which will be used if a redirect response is encountered.</p>
<div class="aside aside-note">
<p class="aside-title">Note</p>
<p>Attempting to set the redirect handler more than once is a logic error and will crash.</p>
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">redirect</span><span class="p">(</span><span class="n">using</span> <span class="nv">handler</span><span class="p">:</span> <span class="kt"><a href="../Protocols/RedirectHandler.html">RedirectHandler</a></span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>handler</em>
</code>
</td>
<td>
<div>
<p>The <code><a href="../Protocols/RedirectHandler.html">RedirectHandler</a></code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Cached%20Responses"></a>
<a name="//apple_ref/swift/Section/Cached Responses" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Cached%20Responses"></a>
<h3 class="section-name"><p>Cached Responses</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC13cacheResponse5usingACXDAA06CachedD7Handler_p_tF"></a>
<a name="//apple_ref/swift/Method/cacheResponse(using:)" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC13cacheResponse5usingACXDAA06CachedD7Handler_p_tF">cacheResponse(using:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets the cached response handler for the <code>Request</code> which will be used when attempting to cache a response.</p>
<div class="aside aside-note">
<p class="aside-title">Note</p>
<p>Attempting to set the cache handler more than once is a logic error and will crash.</p>
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">cacheResponse</span><span class="p">(</span><span class="n">using</span> <span class="nv">handler</span><span class="p">:</span> <span class="kt"><a href="../Protocols/CachedResponseHandler.html">CachedResponseHandler</a></span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>handler</em>
</code>
</td>
<td>
<div>
<p>The <code><a href="../Protocols/CachedResponseHandler.html">CachedResponseHandler</a></code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Lifetime%20APIs"></a>
<a name="//apple_ref/swift/Section/Lifetime APIs" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Lifetime%20APIs"></a>
<h3 class="section-name"><p>Lifetime APIs</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC15cURLDescription2on7callingACXDSo17OS_dispatch_queueC_ySSctF"></a>
<a name="//apple_ref/swift/Method/cURLDescription(on:calling:)" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC15cURLDescription2on7callingACXDSo17OS_dispatch_queueC_ySSctF">cURLDescription(on:<wbr>calling:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets a handler to be called when the cURL description of the request is available.</p>
<div class="aside aside-note">
<p class="aside-title">Note</p>
<p>When waiting for a <code>Request</code>‘s <code>URLRequest</code> to be created, only the last <code>handler</code> will be called.</p>
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">cURLDescription</span><span class="p">(</span><span class="n">on</span> <span class="nv">queue</span><span class="p">:</span> <span class="kt">DispatchQueue</span><span class="p">,</span> <span class="n">calling</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>queue</em>
</code>
</td>
<td>
<div>
<p><code>DispatchQueue</code> on which <code>handler</code> will be called.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>handler</em>
</code>
</td>
<td>
<div>
<p>Closure to be called when the cURL description is available.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC15cURLDescription7callingACXDySSc_tF"></a>
<a name="//apple_ref/swift/Method/cURLDescription(calling:)" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC15cURLDescription7callingACXDySSc_tF">cURLDescription(calling:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets a handler to be called when the cURL description of the request is available.</p>
<div class="aside aside-note">
<p class="aside-title">Note</p>
<p>When waiting for a <code>Request</code>‘s <code>URLRequest</code> to be created, only the last <code>handler</code> will be called.</p>
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">cURLDescription</span><span class="p">(</span><span class="n">calling</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>handler</em>
</code>
</td>
<td>
<div>
<p>Closure to be called when the cURL description is available. Called on the instance’s
<code><a href="../Classes/Request.html#/s:9Alamofire7RequestC15underlyingQueueSo17OS_dispatch_queueCvp">underlyingQueue</a></code> by default.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC20onURLRequestCreation0C07performACXDSo17OS_dispatch_queueC_y10Foundation0D0VctF"></a>
<a name="//apple_ref/swift/Method/onURLRequestCreation(on:perform:)" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC20onURLRequestCreation0C07performACXDSo17OS_dispatch_queueC_y10Foundation0D0VctF">onURLRequestCreation(on:<wbr>perform:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets a closure to called whenever Alamofire creates a <code>URLRequest</code> for this instance.</p>
<div class="aside aside-note">
<p class="aside-title">Note</p>
<p>This closure will be called multiple times if the instance adapts incoming <code>URLRequest</code>s or is retried.</p>
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">onURLRequestCreation</span><span class="p">(</span><span class="n">on</span> <span class="nv">queue</span><span class="p">:</span> <span class="kt">DispatchQueue</span> <span class="o">=</span> <span class="o">.</span><span class="n">main</span><span class="p">,</span> <span class="n">perform</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">URLRequest</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>queue</em>
</code>
</td>
<td>
<div>
<p><code>DispatchQueue</code> on which <code>handler</code> will be called. <code>.main</code> by default.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>handler</em>
</code>
</td>
<td>
<div>
<p>Closure to be called when a <code>URLRequest</code> is available.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC24onURLSessionTaskCreation0C07performACXDSo17OS_dispatch_queueC_ySo012NSURLSessionE0CctF"></a>
<a name="//apple_ref/swift/Method/onURLSessionTaskCreation(on:perform:)" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC24onURLSessionTaskCreation0C07performACXDSo17OS_dispatch_queueC_ySo012NSURLSessionE0CctF">onURLSessionTaskCreation(on:<wbr>perform:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets a closure to be called whenever the instance creates a <code>URLSessionTask</code>.</p>
<div class="aside aside-note">
<p class="aside-title">Note</p>
<p>This API should only be used to provide <code>URLSessionTask</code>s to existing API, like <code>NSFileProvider</code>. It
<strong>SHOULD NOT</strong> be used to interact with tasks directly, as that may be break Alamofire features.
Additionally, this closure may be called multiple times if the instance is retried.</p>
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">@discardableResult</span>
<span class="kd">public</span> <span class="kd">func</span> <span class="nf">onURLSessionTaskCreation</span><span class="p">(</span><span class="n">on</span> <span class="nv">queue</span><span class="p">:</span> <span class="kt">DispatchQueue</span> <span class="o">=</span> <span class="o">.</span><span class="n">main</span><span class="p">,</span> <span class="n">perform</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">URLSessionTask</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>queue</em>
</code>
</td>
<td>
<div>
<p><code>DispatchQueue</code> on which <code>handler</code> will be called. <code>.main</code> by default.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>handler</em>
</code>
</td>
<td>
<div>
<p>Closure to be called when the <code>URLSessionTask</code> is available.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The instance.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC21didResumeNotificationSo18NSNotificationNameavpZ"></a>
<a name="//apple_ref/swift/Variable/didResumeNotification" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC21didResumeNotificationSo18NSNotificationNameavpZ">didResumeNotification</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Posted when a <code>Request</code> is resumed. The <code>Notification</code> contains the resumed <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">didResumeNotification</span><span class="p">:</span> <span class="kt">Notification</span><span class="o">.</span><span class="kt">Name</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC22didSuspendNotificationSo18NSNotificationNameavpZ"></a>
<a name="//apple_ref/swift/Variable/didSuspendNotification" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC22didSuspendNotificationSo18NSNotificationNameavpZ">didSuspendNotification</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Posted when a <code>Request</code> is suspended. The <code>Notification</code> contains the suspended <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">didSuspendNotification</span><span class="p">:</span> <span class="kt">Notification</span><span class="o">.</span><span class="kt">Name</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC21didCancelNotificationSo18NSNotificationNameavpZ"></a>
<a name="//apple_ref/swift/Variable/didCancelNotification" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC21didCancelNotificationSo18NSNotificationNameavpZ">didCancelNotification</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Posted when a <code>Request</code> is cancelled. The <code>Notification</code> contains the cancelled <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">didCancelNotification</span><span class="p">:</span> <span class="kt">Notification</span><span class="o">.</span><span class="kt">Name</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC21didFinishNotificationSo18NSNotificationNameavpZ"></a>
<a name="//apple_ref/swift/Variable/didFinishNotification" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC21didFinishNotificationSo18NSNotificationNameavpZ">didFinishNotification</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Posted when a <code>Request</code> is finished. The <code>Notification</code> contains the completed <code>Request</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">didFinishNotification</span><span class="p">:</span> <span class="kt">Notification</span><span class="o">.</span><span class="kt">Name</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC25didResumeTaskNotificationSo18NSNotificationNameavpZ"></a>
<a name="//apple_ref/swift/Variable/didResumeTaskNotification" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC25didResumeTaskNotificationSo18NSNotificationNameavpZ">didResumeTaskNotification</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Posted when a <code>URLSessionTask</code> is resumed. The <code>Notification</code> contains the <code>Request</code> associated with the <code>URLSessionTask</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">didResumeTaskNotification</span><span class="p">:</span> <span class="kt">Notification</span><span class="o">.</span><span class="kt">Name</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC26didSuspendTaskNotificationSo18NSNotificationNameavpZ"></a>
<a name="//apple_ref/swift/Variable/didSuspendTaskNotification" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC26didSuspendTaskNotificationSo18NSNotificationNameavpZ">didSuspendTaskNotification</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Posted when a <code>URLSessionTask</code> is suspended. The <code>Notification</code> contains the <code>Request</code> associated with the <code>URLSessionTask</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">didSuspendTaskNotification</span><span class="p">:</span> <span class="kt">Notification</span><span class="o">.</span><span class="kt">Name</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC25didCancelTaskNotificationSo18NSNotificationNameavpZ"></a>
<a name="//apple_ref/swift/Variable/didCancelTaskNotification" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC25didCancelTaskNotificationSo18NSNotificationNameavpZ">didCancelTaskNotification</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Posted when a <code>URLSessionTask</code> is cancelled. The <code>Notification</code> contains the <code>Request</code> associated with the <code>URLSessionTask</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">didCancelTaskNotification</span><span class="p">:</span> <span class="kt">Notification</span><span class="o">.</span><span class="kt">Name</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC27didCompleteTaskNotificationSo18NSNotificationNameavpZ"></a>
<a name="//apple_ref/swift/Variable/didCompleteTaskNotification" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC27didCompleteTaskNotificationSo18NSNotificationNameavpZ">didCompleteTaskNotification</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Posted when a <code>URLSessionTask</code> is completed. The <code>Notification</code> contains the <code>Request</code> associated with the <code>URLSessionTask</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">didCompleteTaskNotification</span><span class="p">:</span> <span class="kt">Notification</span><span class="o">.</span><span class="kt">Name</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Protocol%20Conformances"></a>
<a name="//apple_ref/swift/Section/Protocol Conformances" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Protocol%20Conformances"></a>
<h3 class="section-name"><p>Protocol Conformances</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:SQ2eeoiySbx_xtFZ"></a>
<a name="//apple_ref/swift/Method/==(_:_:)" class="dashAnchor"></a>
<a class="token" href="#/s:SQ2eeoiySbx_xtFZ">==(_:<wbr>_:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">==</span> <span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="kt">Request</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt">Request</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:SH4hash4intoys6HasherVz_tF"></a>
<a name="//apple_ref/swift/Method/hash(into:)" class="dashAnchor"></a>
<a class="token" href="#/s:SH4hash4intoys6HasherVz_tF">hash(into:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">hash</span><span class="p">(</span><span class="n">into</span> <span class="nv">hasher</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">Hasher</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC11descriptionSSvp"></a>
<a name="//apple_ref/swift/Property/description" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC11descriptionSSvp">description</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A textual representation of this instance, including the <code><a href="../Structs/HTTPMethod.html">HTTPMethod</a></code> and <code>URL</code> if the <code>URLRequest</code> has been
created, as well as the response status code, if a response has been received.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">description</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC15cURLDescriptionSSyF"></a>
<a name="//apple_ref/swift/Method/cURLDescription()" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC15cURLDescriptionSSyF">cURLDescription()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>cURL representation of the instance.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">cURLDescription</span><span class="p">()</span> <span class="o">-></span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>The cURL equivalent of the instance.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Helper%20Types"></a>
<a name="//apple_ref/swift/Section/Helper Types" class="dashAnchor"></a>
<div class="section-name-container">
<a class="section-name-link" href="#/Helper%20Types"></a>
<h3 class="section-name"><p>Helper Types</p>
</h3>
</div>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:9Alamofire7RequestC16ValidationResulta"></a>
<a name="//apple_ref/swift/Alias/ValidationResult" class="dashAnchor"></a>
<a class="token" href="#/s:9Alamofire7RequestC16ValidationResulta">ValidationResult</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to represent whether a validation succeeded or failed.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">ValidationResult</span> <span class="o">=</span> <span class="kt">Result</span><span class="o"><</span><span class="kt">Void</span><span class="p">,</span> <span class="kt">Error</span><span class="o">></span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>© 2020 <a class="link" href="http://alamofire.org/" target="_blank" rel="external">Alamofire Software Foundation</a>. All rights reserved. (Last updated: 2020-12-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>
| {
"content_hash": "6517a636e1e2eb0e3f7b8a7f60303a91",
"timestamp": "",
"source": "github",
"line_count": 2825,
"max_line_length": 710,
"avg_line_length": 53.97982300884956,
"alnum_prop": 0.4613982281153889,
"repo_name": "antigp/Alamofire",
"id": "b9ef48437b8ac14ddb44742655fe1bf6b19b48c2",
"size": "152559",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/docsets/Alamofire.docset/Contents/Resources/Documents/Classes/Request.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "1297"
},
{
"name": "Ruby",
"bytes": "517"
},
{
"name": "Swift",
"bytes": "131789"
}
],
"symlink_target": ""
} |
function method() {
(function removeListeners() {
log(removeListeners);
})();
} | {
"content_hash": "26f07cd6d3063505a28c7cd1d80e6939",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 31,
"avg_line_length": 17.4,
"alnum_prop": 0.632183908045977,
"repo_name": "babel/babili",
"id": "1e0e7342cf0e08783e8c9a8e79173fda7f673f7c",
"size": "87",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/babel-plugin-minify-dead-code-elimination/__tests__/fixtures/fn-expr-name/expected.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "412124"
},
{
"name": "Python",
"bytes": "25156"
},
{
"name": "Shell",
"bytes": "1097"
}
],
"symlink_target": ""
} |
<?php
namespace SlaxWeb\View\Tests\Unit;
use SlaxWeb\View\Base;
use SlaxWeb\View\AbstractLoader;
use SlaxWeb\Config\Container as Config;
use Symfony\Component\HttpFoundation\Response;
class BaseTest extends \PHPUnit_Framework_TestCase
{
/**
* Config
*
* @var \SlaxWeb\Config\Container_mock
*/
protected $config = null;
/**
* Loader
*
* @var \SlaxWeb\View\AbstractLoader
*/
protected $loader = null;
/**
* Response
*
* @var \Symfony\Component\HttpFoundation\Response
*/
protected $response = null;
/**
* Prepare tests
*
* Prepare Base View class Dependency mocks.
*
* @return void
*/
protected function setUp()
{
$this->config = $this->getMockBuilder(Config::class)
->disableOriginalConstructor()
->setMethods(["offsetGet"])
->getMock();
$this->loader = $this->createMock(AbstractLoader::class);
$this->response = $this->createMock(Response::class);
}
protected function tearDown()
{
}
/**
* Test Template File Set
*
* Ensure that the Base View indeed does set the template file name if it was
* not set before hand, and the configuration permits it.
*
* @return void
*/
public function testTemplateFileSet()
{
$this->config->expects($this->exactly(6))
->method("offsetGet")
->withConsecutive(
// base view auto-sets template name
["view.baseDir"],
["view.autoTplName"],
["view.classNamespace"],
// config does not allow automatical setting of template name
["view.baseDir"],
["view.autoTplName"],
// template name already set
["view.baseDir"]
)->will(
$this->onConsecutiveCalls(
// base view auto-sets template name
"viewDir",
true,
"",
// config does not allow automatical setting of template name
"viewDir",
false,
// template name already set
"viewDir"
)
);
$base = $this->getMockBuilder(Base::class)
->disableOriginalConstructor()
->setMethods()
->setMockClassName("BaseViewMock")
->getMockForAbstractClass();
// base view auto-sets template name
$base->__construct($this->config, $this->loader, $this->response);
$this->assertEquals("BaseViewMock", $base->template);
// config does not allow automatical setting of template name
$base->template = "";
$base->__construct($this->config, $this->loader, $this->response);
$this->assertEquals("", $base->template);
// template name already set
$base->template = "PreSetTemplateName";
$base->__construct($this->config, $this->loader, $this->response);
$this->assertEquals("PreSetTemplateName", $base->template);
}
/**
* Test templates rendering
*
* Ensures that the templates are properly rendered, and the subviews and layout
* are properly rendered and all is properly set in the view data for the main
* view template rendering.
*
* @return void
*/
public function testRendering()
{
$this->loader->expects($this->exactly(1))
->method("setTemplate")
->with("PreSetTemplateName");
$this->loader->expects($this->exactly(1))
->method("render")
->with(
["foo" => "bar", "subview_testSub" => "Sub view"],
AbstractLoader::TPL_RETURN,
AbstractLoader::TPL_CACHE_VARS
)->willReturn("Main view");
$this->config->expects($this->any())
->method("offsetGet")
->with("view.baseDir")
->willReturn("viewDir");
$this->response->expects($this->exactly(1))
->method("setContent")
->with("Previous responseRendered template");
$this->response->expects($this->exactly(1))
->method("getContent")
->willReturn("Previous response");
$base = $this->getMockBuilder(Base::class)
->disableOriginalConstructor()
->setMethods()
->setMockClassName("BaseViewMock")
->getMockForAbstractClass();
$base->template = "PreSetTemplateName";
$base->__construct($this->config, $this->loader, $this->response);
// add a subview
$subView = $this->getMockBuilder(Base::class)
->disableOriginalConstructor()
->setMethods(["render"])
->setMockClassName("TestSubView")
->getMockForAbstractClass();
$subView->expects($this->exactly(1))
->method("render")
->willReturn("Sub view");
$base->addSubView("testSub", $subView);
// set layout
$layoutView = $this->getMockBuilder(Base::class)
->disableOriginalConstructor()
->setMethods(["render"])
->setMockClassName("TestLayoutView")
->getMockForAbstractClass();
$layoutView->expects($this->exactly(1))
->method("render")
->with(["foo" => "bar", "subview_testSub" => "Sub view", "mainView" => "Main view"])
->willReturn("Rendered template");
$base->setLayout($layoutView);
$this->assertTrue($base->render(["foo" => "bar"]));
}
/**
* Test template return
*
* Ensure that the template in fact is returned when requested so.
*
* @return void
*/
public function testTplReturn()
{
$this->loader->expects($this->exactly(1))
->method("render")
->with([], AbstractLoader::TPL_RETURN, AbstractLoader::TPL_CACHE_VARS)
->willReturn("Main view");
$this->config->expects($this->any())
->method("offsetGet")
->with("view.baseDir")
->willReturn("viewDir");
$base = $this->getMockBuilder(Base::class)
->disableOriginalConstructor()
->setMethods()
->setMockClassName("BaseViewMock")
->getMockForAbstractClass();
$base->template = "PreSetTemplateName";
$base->__construct($this->config, $this->loader, $this->response);
$this->assertEquals("Main view", $base->render([], AbstractLoader::TPL_RETURN));
}
public function testSubViewsAndTemplates()
{
$subViews = [
"subview_view" => "Sub View",
"subview_tpl" => "Sub Template"
];
$this->loader->expects($this->exactly(2))
->method("render")
->withConsecutive(
[
["subview_view" => "Sub View", "subview_tpl" => ""],
AbstractLoader::TPL_RETURN,
AbstractLoader::TPL_CACHE_VARS
],
[$subViews, AbstractLoader::TPL_RETURN, AbstractLoader::TPL_CACHE_VARS]
)->will($this->onConsecutiveCalls("Sub Template", "Main View"));
$this->loader->expects($this->exactly(2))
->method("setTemplate")
->withConsecutive(
["Template"],
["PreSetTemplateName"]
);
$view = $this->getMockBuilder(Base::class)
->disableOriginalConstructor()
->setMethods(["render"])
->getMockForAbstractClass();
$view->expects($this->once())
->method("render")
->with(["subview_view" => ""], AbstractLoader::TPL_RETURN)
->willReturn("Sub View");
$this->config->expects($this->any())
->method("offsetGet")
->with("view.baseDir")
->willReturn("viewDir");
$base = $this->getMockBuilder(Base::class)
->disableOriginalConstructor()
->setMethods()
->setMockClassName("BaseViewMock")
->getMockForAbstractClass();
$base->template = "PreSetTemplateName";
$base->__construct($this->config, $this->loader, $this->response);
$base->addSubView("view", $view);
$base->addSubTemplate("tpl", "Template");
$base->render([], AbstractLoader::TPL_RETURN);
}
}
| {
"content_hash": "f072bbf77cf5874538e32c7f538a90db",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 96,
"avg_line_length": 31.9812734082397,
"alnum_prop": 0.5339032673615177,
"repo_name": "SlaxWeb/View",
"id": "25bc67d0be843769fde0f083605582df7c7ecd2d",
"size": "8903",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/unit/BaseTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "108839"
}
],
"symlink_target": ""
} |
namespace base {
class SequencedTaskRunner;
}
namespace extensions {
// Cache .crx files in some local dir for future use. Cache keeps only latest
// version of the extensions. Only one instance of LocalExtensionCache can work
// with the same directory. But LocalExtensionCache instance can be shared
// between multiple clients. Public interface can be used only from UI thread.
class LocalExtensionCache {
public:
// Callback invoked on UI thread when PutExtension is completed.
using PutExtensionCallback =
base::OnceCallback<void(const base::FilePath& file_path,
bool file_ownership_passed)>;
// |cache_dir| - directory that will be used for caching CRX files.
// |max_cache_size| - maximum disk space that cache can use, 0 means no limit.
// |max_cache_age| - maximum age that unused item can be kept in cache, 0 age
// means that all unused cache items will be removed on Shutdown.
// All file I/O is done via the |backend_task_runner|.
LocalExtensionCache(
const base::FilePath& cache_dir,
uint64_t max_cache_size,
const base::TimeDelta& max_cache_age,
const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner);
LocalExtensionCache(const LocalExtensionCache&) = delete;
LocalExtensionCache& operator=(const LocalExtensionCache&) = delete;
~LocalExtensionCache();
// Name of flag file that indicates that cache is ready (import finished).
static const char kCacheReadyFlagFileName[];
// Initialize cache. If |wait_for_cache_initialization| is |true|, the cache
// contents will not be read until a flag file appears in the cache directory,
// signaling that the cache is ready. The |callback| is called when cache is
// ready and cache dir content was already checked.
void Init(bool wait_for_cache_initialization, base::OnceClosure callback);
// Shut down the cache. The |callback| will be invoked when the cache has shut
// down completely and there are no more pending file I/O operations.
void Shutdown(base::OnceClosure callback);
// If extension with |id| and |expected_hash| exists in the cache (or there
// is an extension with the same |id|, but without expected hash sum),
// returns |true|, |file_path| and |version| for the found extension.
// If |file_path| was requested, then extension will be marked as used with
// current timestamp.
bool GetExtension(const std::string& id,
const std::string& expected_hash,
base::FilePath* file_path,
std::string* version);
// Returns |true| if there is a file with |id| and |expected_hash| in the
// cache, and its hash sum is actually empty. After removing it from cache and
// re-downloading, the new entry will have some non-empty hash sum.
bool ShouldRetryDownload(const std::string& id,
const std::string& expected_hash);
// Put extension with |id|, |version| and |expected_hash| into local cache.
// Older version in the cache will be deleted on next run so it can be safely
// used. Extension will be marked as used with current timestamp. The file
// will be available via GetExtension when |callback| is called. PutExtension
// may get ownership of |file_path| or return it back via |callback|.
void PutExtension(const std::string& id,
const std::string& expected_hash,
const base::FilePath& file_path,
const std::string& version,
PutExtensionCallback callback);
// Remove extension with |id| and |expected_hash| from local cache,
// corresponding crx file will be removed from disk too. If |expected_hash| is
// empty, all files corresponding to that |id| will be removed.
bool RemoveExtension(const std::string& id, const std::string& expected_hash);
// Return cache statistics. Returns |false| if cache is not ready.
bool GetStatistics(uint64_t* cache_size, size_t* extensions_count);
// Outputs properly formatted extension file name, as it will be stored in
// cache. If |expected_hash| is empty, it will be <id>-<version>.crx,
// otherwise the name format is <id>-<version>-<hash>.crx.
static std::string ExtensionFileName(const std::string& id,
const std::string& version,
const std::string& expected_hash);
bool is_ready() const { return state_ == kReady; }
bool is_uninitialized() const { return state_ == kUninitialized; }
bool is_shutdown() const { return state_ == kShutdown; }
// For tests only!
void SetCacheStatusPollingDelayForTests(const base::TimeDelta& delay);
private:
struct CacheItemInfo {
// TODO(https://crbug.com/1076376): Change |version| from std::string to
// base::Version.
std::string version;
std::string expected_hash;
base::Time last_used;
uint64_t size;
base::FilePath file_path;
CacheItemInfo(const std::string& version,
const std::string& expected_hash,
const base::Time& last_used,
uint64_t size,
const base::FilePath& file_path);
CacheItemInfo(const CacheItemInfo& other);
~CacheItemInfo();
};
typedef std::multimap<std::string, CacheItemInfo> CacheMap;
typedef std::pair<CacheMap::iterator, CacheMap::iterator> CacheHit;
enum State {
kUninitialized,
kWaitInitialization,
kReady,
kShutdown
};
// Helper function that searches the cache map for an extension with the
// specified |id| and |expected_hash|. If there is an extension with empty
// hash in the map, it will be returned. If |expected_hash| is empty, returns
// the first extension with the same |id|.
static CacheMap::iterator FindExtension(CacheMap& cache,
const std::string& id,
const std::string& expected_hash);
// Helper function that compares a cache entry (typically returned from
// FindExtension) with an incoming |version| and |expected_hash|. Comparison
// is based on the version number (newer is better) and hash sum (it is
// better to have a file with an expected hash sum than without it).
// Return value of this function is |true| if we already have a 'better'
// entry in cache (considering both version number and hash sum), and the
// value of |compare| is set to the version number comparison result (as
// returned by Version::CompareTo).
static bool NewerOrSame(const CacheMap::iterator& entry,
const std::string& version,
const std::string& expected_hash,
int* compare);
// Helper function that checks if there is already a newer version of the
// extension we want to add to the cache, or if there is already a file with a
// hash sum (and we are trying to add one without it), or vice versa. Keeps
// the invariant of having only one version of each extension, and either only
// unhashed (single) or only hashed (multiple) variants of that version.
// |delete_files| specifies if this function is called on startup (in which
// case we will clean up files we don't need), or on extension install.
// Returns cache.end() if the extension is already cached, or an iterator to
// the inserted cache entry otherwise.
static CacheMap::iterator InsertCacheEntry(CacheMap& cache,
const std::string& id,
const CacheItemInfo& info,
const bool delete_files);
// Remove extension at a specified iterator. This is necessary because
// removing an extension by |id| and |expected_hash| taken by reference from
// an iterator leads to use-after-free. On the other hand, when passing the
// iterator itself we avoid lookup as such, at all.
// For external calls from RemoveExtension without expected hash we will
// ignore the hash in iterator by setting |match_hash| to false.
bool RemoveExtensionAt(const CacheMap::iterator& it, bool match_hash);
// Sends BackendCheckCacheStatus task on backend thread.
void CheckCacheStatus(base::OnceClosure callback);
// Checks whether a flag file exists in the |cache_dir|, indicating that the
// cache is ready. This method is invoked via the |backend_task_runner_| and
// posts its result back to the |local_cache| on the UI thread.
static void BackendCheckCacheStatus(
base::WeakPtr<LocalExtensionCache> local_cache,
const base::FilePath& cache_dir,
base::OnceClosure callback);
// Invoked on the UI thread after checking whether the cache is ready. If the
// cache is not ready yet, posts a delayed task that will repeat the check,
// thus polling for cache readiness.
void OnCacheStatusChecked(bool ready, base::OnceClosure callback);
// Checks the cache contents. This is a helper that invokes the actual check
// by posting to the |backend_task_runner_|.
void CheckCacheContents(base::OnceClosure callback);
// Checks the cache contents. This method is invoked via the
// |backend_task_runner_| and posts back a list of cache entries to the
// |local_cache| on the UI thread.
static void BackendCheckCacheContents(
base::WeakPtr<LocalExtensionCache> local_cache,
const base::FilePath& cache_dir,
base::OnceClosure callback);
// Helper for BackendCheckCacheContents() that updates |cache_content|.
static void BackendCheckCacheContentsInternal(
const base::FilePath& cache_dir,
CacheMap* cache_content);
// Invoked when the cache content on disk has been checked. |cache_content|
// contains all the currently valid crx files in the cache.
void OnCacheContentsChecked(std::unique_ptr<CacheMap> cache_content,
base::OnceClosure callback);
// Update timestamp for the file to mark it as "used". This method is invoked
// via the |backend_task_runner_|.
static void BackendMarkFileUsed(const base::FilePath& file_path,
const base::Time& time);
// Installs the downloaded crx file at |path| in the |cache_dir|. This method
// is invoked via the |backend_task_runner_|.
static void BackendInstallCacheEntry(
base::WeakPtr<LocalExtensionCache> local_cache,
const base::FilePath& cache_dir,
const std::string& id,
const std::string& expected_hash,
const base::FilePath& file_path,
const std::string& version,
PutExtensionCallback callback);
// Invoked on the UI thread when a new entry has been installed in the cache.
void OnCacheEntryInstalled(const std::string& id,
const CacheItemInfo& info,
bool was_error,
PutExtensionCallback callback);
// Remove cached crx files(all versions) under |cached_dir| for extension with
// |id|. This method is invoked via the |backend_task_runner_|.
static void BackendRemoveCacheEntry(const base::FilePath& cache_dir,
const std::string& expected_hash,
const std::string& id);
// Compare two cache items returns true if first item is older.
static bool CompareCacheItemsAge(const CacheMap::iterator& lhs,
const CacheMap::iterator& rhs);
// Calculate which files need to be deleted and schedule files deletion.
void CleanUp();
// Path to the directory where the extension cache is stored.
base::FilePath cache_dir_;
// Maximum size of cache dir on disk.
uint64_t max_cache_size_;
// Minimal age of unused item in cache, items prior to this age will be
// deleted on shutdown.
base::Time min_cache_age_;
// Task runner for executing file I/O tasks.
scoped_refptr<base::SequencedTaskRunner> backend_task_runner_;
// Track state of the instance.
State state_;
// This contains info about all cached extensions.
CacheMap cached_extensions_;
// Delay between polling cache status.
base::TimeDelta cache_status_polling_delay_;
// Weak factory for callbacks from the backend and delayed tasks.
base::WeakPtrFactory<LocalExtensionCache> weak_ptr_factory_{this};
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_UPDATER_LOCAL_EXTENSION_CACHE_H_
| {
"content_hash": "b6d406f2840017ab7c1e522d3f6fde6e",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 80,
"avg_line_length": 46.406716417910445,
"alnum_prop": 0.6791830827369945,
"repo_name": "ric2b/Vivaldi-browser",
"id": "c3fd3b25c566cc83c3ae2b3a0b784a0c1f6185c1",
"size": "12963",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "chromium/chrome/browser/extensions/updater/local_extension_cache.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>gaia-hydras: 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.12.0 / gaia-hydras - 0.6</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
gaia-hydras
<small>
0.6
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-10-04 03:37:53 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-04 03:37:53 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
coq 8.12.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.11.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.11.2 Official release 4.11.2
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/coq-community/hydra-battles"
dev-repo: "git+https://github.com/coq-community/hydra-battles.git"
bug-reports: "https://github.com/coq-community/hydra-battles/issues"
license: "MIT"
synopsis: "Bridge in Coq between Gaia and Hydra battles"
description: """
The Gaia and Hydra battles projects develop different implementations
of ordinals and other mathematical concepts in Coq. This development bridges
similar concepts in the two projects."""
build: ["dune" "build" "-p" name "-j" jobs]
depends: [
"dune" {>= "2.5"}
"coq" {>= "8.14" & < "8.16~"}
"coq-hydra-battles" {= version}
"coq-mathcomp-ssreflect" {>= "1.12.0" & < "1.15~"}
"coq-mathcomp-zify"
"coq-gaia" {>= "1.12" & < "1.14~"}
]
tags: [
"category:Mathematics/Logic/Foundations"
"keyword:ordinals"
"logpath:gaia_hydras"
"date:2022-02-17"
]
authors: [
"Pierre Castéran"
]
url {
src: "https://github.com/coq-community/hydra-battles/archive/v0.6.tar.gz"
checksum: "sha512=a7e5e16506ad4eb2b5968d6bffbc1dacb297a304c7e8bbbd2ec4d2488d2090573288bdcd0e17fa05b605925b71c3ece5e46e91134d98f47248ef173c92dc8ed7"
}
</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-gaia-hydras.0.6 coq.8.12.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.12.0).
The following dependencies couldn't be met:
- coq-gaia-hydras -> coq-hydra-battles = 0.6 -> coq >= 8.13
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-gaia-hydras.0.6</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": "e9a644ded97adebb4baf8b0e26961293",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 159,
"avg_line_length": 41.38953488372093,
"alnum_prop": 0.5523247647141453,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "4b28d9256f8759553edcf919b7faf29be95fcb5e",
"size": "7145",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.11.2-2.0.7/released/8.12.0/gaia-hydras/0.6.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
using namespace WebKit;
namespace {
static const int kVideoCaptureWidth = 352;
static const int kVideoCaptureHeight = 288;
static const int kVideoCaptureFrameDurationMs = 33;
bool IsMockMediaStreamWithVideo(const WebURL& url) {
#if ENABLE_WEBRTC
WebMediaStream descriptor(
WebMediaStreamRegistry::lookupMediaStreamDescriptor(url));
if (descriptor.isNull())
return false;
WebVector<WebMediaStreamTrack> videoSources;
descriptor.videoSources(videoSources);
return videoSources.size() > 0;
#else
return false;
#endif
}
} // namespace
namespace webkit_glue {
WebKit::WebMediaPlayer* CreateMediaPlayer(
WebFrame* frame,
const WebURL& url,
WebMediaPlayerClient* client,
webkit_media::MediaStreamClient* media_stream_client) {
if (media_stream_client && media_stream_client->IsMediaStream(url)) {
return new webkit_media::WebMediaPlayerMS(
frame,
client,
base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(),
media_stream_client,
new media::MediaLog());
}
#if defined(OS_ANDROID)
return NULL;
#else
webkit_media::WebMediaPlayerParams params(
NULL, NULL, new media::MediaLog());
return new webkit_media::WebMediaPlayerImpl(
frame,
client,
base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(),
params);
#endif
}
TestMediaStreamClient::TestMediaStreamClient() {}
TestMediaStreamClient::~TestMediaStreamClient() {}
bool TestMediaStreamClient::IsMediaStream(const GURL& url) {
return IsMockMediaStreamWithVideo(url);
}
scoped_refptr<webkit_media::VideoFrameProvider>
TestMediaStreamClient::GetVideoFrameProvider(
const GURL& url,
const base::Closure& error_cb,
const webkit_media::VideoFrameProvider::RepaintCB& repaint_cb) {
if (!IsMockMediaStreamWithVideo(url))
return NULL;
return new webkit_media::SimpleVideoFrameProvider(
gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight),
base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs),
error_cb,
repaint_cb);
}
scoped_refptr<webkit_media::MediaStreamAudioRenderer>
TestMediaStreamClient::GetAudioRenderer(const GURL& url) {
return NULL;
}
} // namespace webkit_glue
| {
"content_hash": "df5857f6155c9275246f2f7bad093653",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 71,
"avg_line_length": 26.841463414634145,
"alnum_prop": 0.7387551113130395,
"repo_name": "loopCM/chromium",
"id": "c3e8b917508f7b9e22d554b2a2f8ed5e5ea13aea",
"size": "3091",
"binary": false,
"copies": "3",
"ref": "refs/heads/trunk",
"path": "webkit/mocks/test_media_stream_client.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
"""backend URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'profiles', views.ProfileViewSet, base_name='profiles')
urlpatterns = [
url(r'^', include(router.urls)),
]
| {
"content_hash": "2c4d23afa08dd19fb872d2d54ae24033",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 34.65384615384615,
"alnum_prop": 0.7114317425083241,
"repo_name": "stphivos/django-angular2-fullstack-devops",
"id": "8b58d4bf4069ce4dfab3bf5882e0904d24439a4a",
"size": "901",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "backend/api/urls.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1959"
},
{
"name": "HCL",
"bytes": "17373"
},
{
"name": "HTML",
"bytes": "3640"
},
{
"name": "JavaScript",
"bytes": "7882"
},
{
"name": "Python",
"bytes": "15835"
},
{
"name": "Shell",
"bytes": "17894"
},
{
"name": "TypeScript",
"bytes": "62594"
}
],
"symlink_target": ""
} |
@import UIKit;
@class TRWeatherController;
@interface TRWeatherViewController : UIViewController
@property (nonatomic) TRWeatherController *controller;
@end
| {
"content_hash": "2eb0a459a118e443a64a74ba959cace3",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 54,
"avg_line_length": 17.88888888888889,
"alnum_prop": 0.8198757763975155,
"repo_name": "thoughtbot/Tropos",
"id": "b1cf624a84ef8003e911d286853a9e779ef880ee",
"size": "161",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Sources/Tropos/ViewControllers/TRWeatherViewController.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "82320"
},
{
"name": "Ruby",
"bytes": "2599"
},
{
"name": "Shell",
"bytes": "2036"
},
{
"name": "Swift",
"bytes": "84660"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using AsyncGenerator.TestCases;
namespace AsyncGenerator.Tests.NewTypes.Input
{
public abstract class InternalReaderWithToken
{
public virtual bool Read()
{
SimpleFile.Read();
return true;
}
public virtual async Task<bool> ReadAsync(CancellationToken cancellationToken)
{
await SimpleFile.ReadAsync(cancellationToken);
return true;
}
}
public class NestedDerivedAsyncWithToken
{
public void Write()
{
SimpleFile.Write("");
}
public class Nested : InternalReaderWithToken
{
public override bool Read()
{
return false;
}
}
public class Nested2 : ExternalReaderWithToken
{
public override bool Read()
{
return false;
}
}
public class NestedBaseCall : InternalReaderWithToken
{
public override bool Read()
{
base.Read();
return false;
}
}
public class Nested2BaseCall : ExternalReaderWithToken
{
public override bool Read()
{
base.Read();
return false;
}
}
}
}
| {
"content_hash": "6906df3683728ea1f8c28b954820a9d4",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 80,
"avg_line_length": 16.83582089552239,
"alnum_prop": 0.6959219858156028,
"repo_name": "maca88/AsyncGenerator",
"id": "5c81de87301e41b971b3f4dc2f46caab8c75947c",
"size": "1130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/AsyncGenerator.Tests/NewTypes/Input/NestedDerivedAsyncWithToken.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1258098"
}
],
"symlink_target": ""
} |
from gerencianet import Gerencianet
from ...credentials import credentials
gn = Gerencianet(credentials.CREDENTIALS)
body = {
'items': [{
'name': "Product 1",
'value': 1100,
'amount': 2
}],
'shippings': [{
'name': "Default Shipping Cost",
'value': 100
}]
}
response = gn.create_charge(body=body)
print(response)
| {
"content_hash": "f70cac1c786bfb27b4d6160c6b2af2f4",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 41,
"avg_line_length": 18.65,
"alnum_prop": 0.5871313672922251,
"repo_name": "gerencianet/gn-api-sdk-python",
"id": "53b40aed4d829a9a24224d0b5f3e430655b90f44",
"size": "392",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/default/charge/create_charge.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "25401"
}
],
"symlink_target": ""
} |
package scc
import (
"fmt"
"golang.org/x/net/context"
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode/shim"
"github.com/hyperledger/fabric/core/common/ccprovider"
"github.com/hyperledger/fabric/core/container/inproccontroller"
"github.com/hyperledger/fabric/core/peer"
"github.com/spf13/viper"
pb "github.com/hyperledger/fabric/protos/peer"
)
var sysccLogger = flogging.MustGetLogger("sccapi")
// SystemChaincode defines the metadata needed to initialize system chaincode
// when the fabric comes up. SystemChaincodes are installed by adding an
// entry in importsysccs.go
type SystemChaincode struct {
//Unique name of the system chaincode
Name string
//Path to the system chaincode; currently not used
Path string
//InitArgs initialization arguments to startup the system chaincode
InitArgs [][]byte
// Chaincode is the actual chaincode object
Chaincode shim.Chaincode
// InvokableExternal keeps track of whether
// this system chaincode can be invoked
// through a proposal sent to this peer
InvokableExternal bool
// InvokableCC2CC keeps track of whether
// this system chaincode can be invoked
// by way of a chaincode-to-chaincode
// invocation
InvokableCC2CC bool
// Enabled a convenient switch to enable/disable system chaincode without
// having to remove entry from importsysccs.go
Enabled bool
}
// registerSysCC registers the given system chaincode with the peer
func registerSysCC(syscc *SystemChaincode) (bool, error) {
if !syscc.Enabled || !isWhitelisted(syscc) {
sysccLogger.Info(fmt.Sprintf("system chaincode (%s,%s,%t) disabled", syscc.Name, syscc.Path, syscc.Enabled))
return false, nil
}
err := inproccontroller.Register(syscc.Path, syscc.Chaincode)
if err != nil {
//if the type is registered, the instance may not be... keep going
if _, ok := err.(inproccontroller.SysCCRegisteredErr); !ok {
errStr := fmt.Sprintf("could not register (%s,%v): %s", syscc.Path, syscc, err)
sysccLogger.Error(errStr)
return false, fmt.Errorf(errStr)
}
}
sysccLogger.Infof("system chaincode %s(%s) registered", syscc.Name, syscc.Path)
return true, err
}
// deploySysCC deploys the given system chaincode on a chain
func deploySysCC(chainID string, syscc *SystemChaincode) error {
if !syscc.Enabled || !isWhitelisted(syscc) {
sysccLogger.Info(fmt.Sprintf("system chaincode (%s,%s) disabled", syscc.Name, syscc.Path))
return nil
}
var err error
ccprov := ccprovider.GetChaincodeProvider()
txid := util.GenerateUUID()
ctxt := context.Background()
if chainID != "" {
lgr := peer.GetLedger(chainID)
if lgr == nil {
panic(fmt.Sprintf("syschain %s start up failure - unexpected nil ledger for channel %s", syscc.Name, chainID))
}
//init can do GetState (and other Get's) even if Puts cannot be
//be handled. Need ledger for this
ctxt2, txsim, err := ccprov.GetContext(lgr, txid)
if err != nil {
return err
}
ctxt = ctxt2
defer txsim.Done()
}
chaincodeID := &pb.ChaincodeID{Path: syscc.Path, Name: syscc.Name}
spec := &pb.ChaincodeSpec{Type: pb.ChaincodeSpec_Type(pb.ChaincodeSpec_Type_value["GOLANG"]), ChaincodeId: chaincodeID, Input: &pb.ChaincodeInput{Args: syscc.InitArgs}}
// First build and get the deployment spec
chaincodeDeploymentSpec, err := buildSysCC(ctxt, spec)
if err != nil {
sysccLogger.Error(fmt.Sprintf("Error deploying chaincode spec: %v\n\n error: %s", spec, err))
return err
}
version := util.GetSysCCVersion()
cccid := ccprov.GetCCContext(chainID, chaincodeDeploymentSpec.ChaincodeSpec.ChaincodeId.Name, version, txid, true, nil, nil)
_, _, err = ccprov.ExecuteWithErrorFilter(ctxt, cccid, chaincodeDeploymentSpec)
sysccLogger.Infof("system chaincode %s/%s(%s) deployed", syscc.Name, chainID, syscc.Path)
return err
}
// DeDeploySysCC stops the system chaincode and deregisters it from inproccontroller
func DeDeploySysCC(chainID string, syscc *SystemChaincode) error {
chaincodeID := &pb.ChaincodeID{Path: syscc.Path, Name: syscc.Name}
spec := &pb.ChaincodeSpec{Type: pb.ChaincodeSpec_Type(pb.ChaincodeSpec_Type_value["GOLANG"]), ChaincodeId: chaincodeID, Input: &pb.ChaincodeInput{Args: syscc.InitArgs}}
ctx := context.Background()
// First build and get the deployment spec
chaincodeDeploymentSpec, err := buildSysCC(ctx, spec)
if err != nil {
sysccLogger.Error(fmt.Sprintf("Error deploying chaincode spec: %v\n\n error: %s", spec, err))
return err
}
ccprov := ccprovider.GetChaincodeProvider()
version := util.GetSysCCVersion()
cccid := ccprov.GetCCContext(chainID, syscc.Name, version, "", true, nil, nil)
err = ccprov.Stop(ctx, cccid, chaincodeDeploymentSpec)
return err
}
// buildLocal builds a given chaincode code
func buildSysCC(context context.Context, spec *pb.ChaincodeSpec) (*pb.ChaincodeDeploymentSpec, error) {
var codePackageBytes []byte
chaincodeDeploymentSpec := &pb.ChaincodeDeploymentSpec{ExecEnv: pb.ChaincodeDeploymentSpec_SYSTEM, ChaincodeSpec: spec, CodePackage: codePackageBytes}
return chaincodeDeploymentSpec, nil
}
func isWhitelisted(syscc *SystemChaincode) bool {
chaincodes := viper.GetStringMapString("chaincode.system")
val, ok := chaincodes[syscc.Name]
enabled := val == "enable" || val == "true" || val == "yes"
return ok && enabled
}
| {
"content_hash": "b2d8b0e52f520a1e77b1a6085691f1b4",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 169,
"avg_line_length": 31.86904761904762,
"alnum_prop": 0.7443033246171087,
"repo_name": "lukehuangch/fabric",
"id": "12dc892641f4c6f0c1c49294757278f22c28fe3c",
"size": "5929",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "core/scc/sysccapi.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "937"
},
{
"name": "Gherkin",
"bytes": "43102"
},
{
"name": "Go",
"bytes": "5077668"
},
{
"name": "HTML",
"bytes": "11100"
},
{
"name": "Java",
"bytes": "100958"
},
{
"name": "JavaScript",
"bytes": "116066"
},
{
"name": "Makefile",
"bytes": "21590"
},
{
"name": "Protocol Buffer",
"bytes": "102982"
},
{
"name": "Python",
"bytes": "288066"
},
{
"name": "Ruby",
"bytes": "3701"
},
{
"name": "Shell",
"bytes": "136545"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<updates>
<update from="lzap+pub@redhat.com" status="stable" type="security" version="1">
<id>RHEA-2010:0001</id>
<title>Empty errata</title>
<release>1</release>
<issued date="2010-01-01 01:01:01"/>
<description>Empty errata</description>
</update>
<update from="lzap+pub@redhat.com" status="stable" type="security" version="1">
<id>RHEA-2010:0002</id>
<title>One package errata</title>
<release>1</release>
<issued date="2010-01-01 01:01:01"/>
<description>One package errata</description>
<pkglist>
<collection short="">
<name>1</name>
<package arch="noarch" name="elephant" release="0.8" src="http://www.fedoraproject.org" version="0.3">
<filename>elephant-0.3-0.8.noarch.rpm</filename>
</package>
</collection>
</pkglist>
</update>
</updates>
| {
"content_hash": "48b067a015604945d1474c458c3225c0",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 108,
"avg_line_length": 31.884615384615383,
"alnum_prop": 0.6598311218335344,
"repo_name": "ehelms/runcible",
"id": "d5ba85c912e8482b493aefc2d66361e0a0a17c20",
"size": "829",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "test/fixtures/repositories/zoo5/updateinfo.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "172562"
}
],
"symlink_target": ""
} |
package edu.atilim.acma.metrics;
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import org.junit.Test;
import edu.atilim.acma.design.Design;
import edu.atilim.acma.design.Type;
public class InheritanceMetricsTests {
private static Design design;
@BeforeClass
public static void createDesign() {
design = new Design();
Type t1 = design.create("Test1", Type.class);
Type t2 = design.create("Test2", Type.class);
Type t3 = design.create("Test3", Type.class);
Type t4 = design.create("Test4", Type.class);
Type i1 = design.create("Testi", Type.class);
t2.setSuperType(t1);
t3.setSuperType(t1);
t4.setSuperType(t2);
i1.setInterface(true);
t1.addInterface(i1);
}
@Test
public void testInterfacesMetrics() {
MetricTable mt = design.getMetrics();
assertEquals(1.0, mt.get("Test1", "iFImpl"), 0.1);
assertEquals(0.0, mt.get("Test2", "iFImpl"), 0.1);
assertEquals(2.0, mt.get("Test1", "NOC"), 0.1);
assertEquals(1.0, mt.get("Test2", "NOC"), 0.1);
assertEquals(0.0, mt.get("Test3", "NOC"), 0.1);
}
@Test
public void testNumberOfDesc() {
MetricTable mt = design.getMetrics();
assertEquals(3.0, mt.get("Test1", "NumDesc"), 0.1);
assertEquals(1.0, mt.get("Test2", "NumDesc"), 0.1);
assertEquals(0.0, mt.get("Test3", "NumDesc"), 0.1);
}
@Test
public void testNumberOfAnc() {
MetricTable mt = design.getMetrics();
assertEquals(0.0, mt.get("Test1", "NumAnc"), 0.1);
assertEquals(1.0, mt.get("Test2", "NumAnc"), 0.1);
assertEquals(1.0, mt.get("Test3", "NumAnc"), 0.1);
assertEquals(2.0, mt.get("Test4", "NumAnc"), 0.1);
}
}
| {
"content_hash": "ce9192c49aa3712caca88c3f38bbe26a",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 53,
"avg_line_length": 26.14516129032258,
"alnum_prop": 0.6600863664404688,
"repo_name": "eknkc/a-cma",
"id": "7e0206135f33e7c31cf420d1b13b8bd520f9787f",
"size": "1621",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "a-cma/test/edu/atilim/acma/metrics/InheritanceMetricsTests.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2530"
},
{
"name": "Java",
"bytes": "427876"
},
{
"name": "JavaScript",
"bytes": "2457"
},
{
"name": "PHP",
"bytes": "47516"
},
{
"name": "Shell",
"bytes": "143"
}
],
"symlink_target": ""
} |
Repositório da pagina https://informaticos.net.br
| {
"content_hash": "7662a0813c0ca6baa7d32b35498392dd",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 49,
"avg_line_length": 50,
"alnum_prop": 0.82,
"repo_name": "DougKrioK/landingPage-sistemaEventos",
"id": "4a0dafe9c6860a62787113fa86c7f195ccd5aac3",
"size": "80",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "51"
},
{
"name": "CSS",
"bytes": "2436"
},
{
"name": "HTML",
"bytes": "23567"
},
{
"name": "JavaScript",
"bytes": "3445"
},
{
"name": "PHP",
"bytes": "420734"
}
],
"symlink_target": ""
} |
title: Data Package v1 Specifications. What has Changed and how to Upgrade
date: 2017-10-11
authors: ['mikanebu']
---
This post walks you through the major changes in the Data Package v1 specs compared to pre-v1. It covers changes in the full suite of Data Package specifications including Data Resources and Table Schema. It is particularly valuable if:
* you were using Data Packages pre v1 and want to know how to upgrade your datasets
* if you are implementing Data Package related tooling and want to know how to upgrade your tools or want to support or auto-upgrade pre-v1 Data Packages for backwards compatibility
It also includes a script we have created (in JavaScript) that we've been using ourselves to automate upgrades of the [Core Data][core-data].
## The Changes
Two major changes in v1 were presentational:
* Creating Data Resource as a separate spec from Data Package. This did not change anything substantive in terms of how data packages worked but is important presentationally. In parallel, we also split out a Tabular Data Resource from the Tabular Data Package.
* Renaming JSON Table Schema to just Table Schema
In addition, there were a fair number of substantive changes. We summarize these in the sections below. For more detailed info see the [current specifications][specs] and [the old site containing the pre spec v1 specifications][prev1].
### Table Schema
Link to spec: https://specs.frictionlessdata.io/table-schema/
<table class="table table-striped table-bordered">
<thead>
<th>Property</th>
<th>Pre v1</th>
<th>v1 Spec</th>
<th>Notes</th>
<th>Issue</th>
</thead>
<tbody>
<tr>
<td>id/name</td>
<td>id</td>
<td>name</td>
<td>Renamed id to name to be consistent across specs</td>
<td></td>
</tr>
<tr>
<td>type/number</td>
<td>format: currency</td>
<td>format: currency - removed
format: bareNumber
format: decimalChar and groupChar</td>
<td></td>
<td><a href="https://github.com/frictionlessdata/specs/issues/509">#509</a> <a href="https://github.com/frictionlessdata/specs/issues/246">#246</a></td>
</tr>
<tr>
<td>type/integer</td>
<td>No additional properties</td>
<td>Additional properties: bareNumber</td>
<td></td>
<td><a href="https://github.com/frictionlessdata/specs/issues/509">#509</a></td>
</tr>
<tr>
<td>type/boolean</td>
<td>true: [yes, y, true, t, 1],false: [no, n, false, f, 0]</td>
<td>true: [ true, True, TRUE, 1],false: [false, False, FALSE, 0]</td>
<td></td>
<td><a href="https://github.com/frictionlessdata/specs/issues/415">#415</a></td>
</tr>
<tr>
<td>type/year + yearmonth</td>
<td></td>
<td>year and yearmonth NB: these were temporarily gyear and gyearmonth</td>
<td></td>
<td><a href="https://github.com/frictionlessdata/specs/issues/346">#346</a></td>
</tr>
<tr>
<td>type/duration</td>
<td></td>
<td>duration</td>
<td></td>
<td><a href="https://github.com/frictionlessdata/specs/issues/210">#210</a></td>
</tr>
<tr>
<td>type/rdfType</td>
<td></td>
<td>rdfType</td>
<td>Support rich "semantic web" types for fields</td>
<td><a href="https://github.com/frictionlessdata/specs/issues/217">#217</a></td>
</tr>
<tr>
<td>type/null</td>
<td></td>
<td>removed (see missingValue)</td>
<td></td>
<td><a href="https://github.com/frictionlessdata/specs/issues/262">#262</a></td>
</tr>
<tr>
<td>missingValues</td>
<td></td>
<td>missingValues</td>
<td>Missing values support did not exist pre v1.</td>
<td><a href="https://github.com/frictionlessdata/specs/issues/97">#97</a></td>
</tr>
</tbody>
</table>
### Data Resource
Link to spec: https://specs.frictionlessdata.io/data-resource/
*Note: Data Resource did not exist as a separate spec pre-v1 so strictly we are comparing the Data Resource section of the old Data Package spec with the new Data Resource spec.*
<table class="table table-striped table-bordered">
<thead>
<th>Property</th>
<th>Pre v1</th>
<th>v1 Spec</th>
<th>Notes</th>
<th>Issue</th>
</thead>
<tbody>
<tr>
<td>path</td>
<td>path and url</td>
<td>path only</td>
<td>url merged into path and path can now be a url or local path</td>
<td><a href="https://github.com/frictionlessdata/specs/issues/250">#250</a></td>
</tr>
<tr>
<td>path</td>
<td>string</td>
<td>string or array</td>
<td>path can be an array to support a single resource split across multiple files</td>
<td><a href="https://github.com/frictionlessdata/specs/issues/228">#228</a></td>
</tr>
<tr>
<td>name</td>
<td>recommended</td>
<td>required</td>
<td>Made name required to enable access to resources by name consistently across tools</td>
<td></td>
</tr>
<tr>
<td>profile</td>
<td></td>
<td>recommended</td>
<td>See profiles discussion</td>
<td></td>
</tr>
<tr>
<td>sources, licenses ...</td>
<td></td>
<td></td>
<td>Inherited metadata from Data Package like sources or licenses upgraded inline with changes in Data Package</td>
<td></td>
</tr>
</tbody>
</table>
### Tabular Data Resource
Link to spec: https://specs.frictionlessdata.io/data-resource/
Just as Data Resource split out from Data Package so Tabular Data Resource split out from the old Tabular Data Package spec.
There were no significant changes here beyond those in Data Resource.
### Data Package
Link to spec: https://specs.frictionlessdata.io/data-package/
<table class="table table-striped table-bordered">
<thead>
<th>Property</th>
<th>Pre v1</th>
<th>v1 Spec</th>
<th>Notes</th>
<th>Issue</th>
</thead>
<tbody>
<tr>
<td>name</td>
<td>required</td>
<td>recommended</td>
<td>Unique names are not essential to any part of the present tooling so we have have moved to recommended.</td>
<td><a href="https://github.com/frictionlessdata/specs/issues/237">#237</a></td>
</tr>
<tr>
<td>id</td>
<td></td>
<td>id property-globally unique</td>
<td>Globally unique id property</td>
<td><a href="https://github.com/frictionlessdata/specs/issues/237">#237</a></td>
</tr>
<tr>
<td>licenses</td>
<td>license - object or string. The object structure must contain a type property and a url property linking to the actual text
</td>
<td>licenses - is an array. Each item in the array is a License. Each must be an object. The object must contain a name property and/or a path property. It may contain a title property.</td>
<td></td>
<td></td>
</tr>
<tr>
<td>author</td>
<td>author</td>
<td>author is removed in favour of contributors</td>
<td></td>
<td></td>
</tr>
<tr>
<td>contributor</td>
<td>name, email, web properties with name required</td>
<td>title property required with roles, role property values must be one of - author, publisher, maintainer, wrangler, and contributor. Defaults to contributor.</td>
<td></td>
<td></td>
</tr>
<tr>
<td>sources</td>
<td>name, web and email and none required</td>
<td>title, path and email and title is required</td>
<td></td>
<td></td>
</tr>
<tr>
<td>resources</td>
<td></td>
<td>resources array is required</td>
<td></td>
<td><a href="https://github.com/frictionlessdata/specs/issues/434">#434</a></td>
</tr>
<tr>
<td>dataDependencies</td>
<td>dataDependencies</td>
<td></td>
<td>Moved to a pattern until we have greater clarity on need.</td>
<td><a href="https://github.com/frictionlessdata/specs/issues/341">#341</a></td>
</tr>
</tbody>
</table>
### Tabular Data Package
Link to spec: https://specs.frictionlessdata.io/tabular-data-package/
Tabular Data Package is unchanged.
### Profiles
Profiles arrived in v1:
http://specs.frictionlessdata.io/profiles/
Profiles are the first step on supporting a rich ecosystem of "micro-schemas" for data. They provide a very simple way to quickly state that your data follows a specific structure and/or schema. From the docs:
> Different kinds of data need different formats for their data and metadata. To support these different data and metadata formats we need to extend and specialise the generic Data Package. These specialized types of Data Package (or Data Resource) are termed profiles.
>
> For example, there is a Tabular Data Package profile that specializes Data Packages specifically for tabular data. And there is a "Fiscal" Data Package profile designed for government financial data that includes requirements that certain columns are present in the data e.g. Amount or Date and that they contain data of certain types.
We think profiles are an easy, lightweight way to starting adding more structure to your data.
Profiles can be specified on both resources and packages.
[core-data]: https://github.com/datahq/datapackage-normalize-js
[specs]: https://specs.frictionlessdata.io/
[prev1]: https://pre-v1.frictionlessdata.io/
[normalization]: https://github.com/datahq/datapackage-normalize-js
[ghrepo]: https://github.com/frictionlessdata/specs/
## Automate upgrading your descriptor according to the spec v1
We have created a [data package normalization script][norm-script] that you can use to automate the process of upgrading a `datapackage.json` or Table Schema from pre-v1 to v1.
The script enables you to automate updating your `datapackage.json` for the following properties: `path`, `contributors`, `resources`, `sources` and `licenses`.
[norm-script]: https://github.com/datahq/datapackage-normalize-js
This is a simple script that you can download directly from here:
https://raw.githubusercontent.com/datahq/datapackage-normalize-js/master/normalize.js
e.g. using wget:
```bash
wget https://raw.githubusercontent.com/datahq/datapackage-normalize-js/master/normalize.js
```
```bash
# path (optional) is the path to datapackage.json
# if not provided looks in current directory
normalize.js [path]
# prints out updated datapackage.json
```
You can also use as a library:
```bash
# install it from npm
npm install datapackage-normalize
```
so you can use it in your javascript:
```javascript
const normalize = require('datapackage-normalize')
const path = 'path/to/datapackage.json'
normalize(path)
```
## Conclusion
The above summarizes the main changes for v1 of Data Package suite of specs and instructions on how to upgrade.
If you want to see specification for more details, please visit [Data Package specifications][specs]. You can also visit the [Frictionless Data initiative for more information about Data Packages][fd].
[fd]: http://frictionlessdata.io/
| {
"content_hash": "726c553bd874165506418214cacb49d3",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 337,
"avg_line_length": 31.914826498422713,
"alnum_prop": 0.7317386577048532,
"repo_name": "datahq/frontend",
"id": "b7e39f9abf447720dac0fb9cda7b3ba6511acfc0",
"size": "10121",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "blog/2017-10-11-upgrade-to-data-package-specs-v1.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "358436"
},
{
"name": "Dockerfile",
"bytes": "582"
},
{
"name": "HTML",
"bytes": "234108"
},
{
"name": "JavaScript",
"bytes": "137381"
}
],
"symlink_target": ""
} |
package com.twitter.finagle.toggle
import com.twitter.util.{Return, Throw, Try}
import org.scalacheck.Arbitrary.arbitrary
import org.scalatest.FunSuite
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import scala.collection.JavaConverters._
class JsonToggleMapTest extends FunSuite with ScalaCheckDrivenPropertyChecks {
import JsonToggleMap.{DescriptionIgnored, DescriptionRequired}
private def assertParseFails(input: String): Unit = {
assertParseFails(input, DescriptionIgnored)
assertParseFails(input, DescriptionRequired)
}
private def assertParseFails(
input: String,
descriptionMode: JsonToggleMap.DescriptionMode
): Unit =
JsonToggleMap.parse(input, descriptionMode) match {
case Return(_) => fail(s"Parsing should not succeed for $input")
case Throw(_) => // expected
}
test("parse invalid JSON string with no toggles") {
assertParseFails("{ }")
}
test("parse invalid JSON string with no id") {
assertParseFails("""
|{"toggles": [
| { "description": "Dude, where's my id?",
| "fraction": 0.0
| }
| ]
|}""".stripMargin)
}
test("parse invalid JSON string with duplicate ids") {
assertParseFails("""
|{"toggles": [
| { "id": "com.twitter.duplicate",
| "description": "cannot have duplicate ids even if other fields differ",
| "fraction": 0.0
| },
| { "id": "com.twitter.duplicate",
| "description": "this is a duplicate",
| "fraction": 1.0
| }
| ]
|}""".stripMargin)
}
test("parse invalid JSON string with empty description") {
assertParseFails(
"""
|{"toggles": [
| { "id": "com.twitter.EmptyDescription",
| "description": " ",
| "fraction": 0.0
| }
| ]
|}""".stripMargin,
DescriptionRequired
)
}
private val jsonWithNoDescription = """
|{"toggles": [
| { "id": "com.twitter.NoDescription",
| "fraction": 0.0
| }
| ]
|}""".stripMargin
test("parse JSON string with no description and is required") {
assertParseFails(jsonWithNoDescription, DescriptionRequired)
}
test("parse JSON string with no description and is ignored") {
JsonToggleMap.parse(jsonWithNoDescription, DescriptionIgnored) match {
case Throw(t) =>
fail(t)
case Return(tm) =>
assert(tm.iterator.size == 1)
}
}
test("parse invalid JSON string with invalid fraction") {
assertParseFails("""
|{"toggles": [
| { "id": "com.twitter.BadFraction",
| "description": "fractions should be 0-1",
| "fraction": 1.1
| }
| ]
|}""".stripMargin)
}
test("parse invalid JSON string with no fraction") {
assertParseFails("""
|{"toggles": [
| { "id": "com.twitter.NoFraction",
| "description": "fractions must be present"
| }
| ]
|}""".stripMargin)
}
// NOTE: this input should match what's in the resources file for
// com/twitter/toggles/com.twitter.finagle.toggle.tests.Valid.json
private val validInput = """
|{
| "toggles": [
| {
| "id": "com.twitter.off",
| "description": "Always disabled, yo.",
| "fraction": 0.0
| },
| {
| "id": "com.twitter.on",
| "description": "Always enabled, dawg.",
| "fraction": 1.0,
| "comment": "Look, I'm on!"
| }
| ]
|}""".stripMargin
private def validateParsedJson(toggleMap: Try[ToggleMap]): Unit = {
toggleMap match {
case Throw(t) =>
fail(t)
case Return(map) =>
assert(map.iterator.size == 2)
assert(map.iterator.exists(_.id == "com.twitter.off"))
assert(map.iterator.exists(_.id == "com.twitter.on"))
val on = map("com.twitter.on")
val off = map("com.twitter.off")
val doestExist = map("com.twitter.lolcat")
forAll(arbitrary[Int]) { i =>
assert(on.isDefinedAt(i))
assert(on(i))
assert(off.isDefinedAt(i))
assert(!off(i))
assert(!doestExist.isDefinedAt(i))
}
}
}
test("parse valid JSON String") {
validateParsedJson(JsonToggleMap.parse(validInput, DescriptionIgnored))
validateParsedJson(JsonToggleMap.parse(validInput, DescriptionRequired))
}
test("parse valid JSON String with empty toggles") {
val in = """
|{
| "toggles": [ ]
|}""".stripMargin
JsonToggleMap.parse(in, DescriptionRequired) match {
case Throw(t) =>
fail(t)
case Return(map) =>
assert(0 == map.iterator.size)
}
}
test("parse valid JSON resource file") {
val rscs = getClass.getClassLoader
.getResources(
"com/twitter/toggles/configs/com.twitter.finagle.toggle.tests.Valid.json"
)
.asScala
.toSeq
assert(1 == rscs.size)
validateParsedJson(JsonToggleMap.parse(rscs.head, DescriptionIgnored))
validateParsedJson(JsonToggleMap.parse(rscs.head, DescriptionRequired))
}
test("parse invalid JSON resource file") {
// this json file is missing an "id" on a toggle definition and therefore
// should fail to parse.
val rscs = getClass.getClassLoader
.getResources(
"com/twitter/toggles/configs/com.twitter.finagle.toggle.tests.Invalid.json"
)
.asScala
.toSeq
assert(1 == rscs.size)
JsonToggleMap.parse(rscs.head, DescriptionIgnored) match {
case Return(_) => fail(s"Parsing should not succeed")
case Throw(_) => // expected
}
}
}
| {
"content_hash": "bc8dcd840fea3f5a1d97ec0936659a16",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 84,
"avg_line_length": 28.572139303482587,
"alnum_prop": 0.5874978234372279,
"repo_name": "luciferous/finagle",
"id": "f2ed3c2641718542845863f19bde2a013c7c440f",
"size": "5743",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "finagle-toggle/src/test/scala/com/twitter/finagle/toggle/JsonToggleMapTest.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "6402"
},
{
"name": "Java",
"bytes": "225049"
},
{
"name": "Lua",
"bytes": "15246"
},
{
"name": "Python",
"bytes": "64535"
},
{
"name": "R",
"bytes": "4245"
},
{
"name": "Ruby",
"bytes": "25330"
},
{
"name": "Scala",
"bytes": "6272080"
},
{
"name": "Shell",
"bytes": "5977"
},
{
"name": "TSQL",
"bytes": "349"
},
{
"name": "Thrift",
"bytes": "20186"
}
],
"symlink_target": ""
} |
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#include <sstream>
#include <limits>
#include "ifcpp/model/AttributeObject.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/model/BuildingGuid.h"
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include "ifcpp/IFC4/include/IfcGloballyUniqueId.h"
#include "ifcpp/IFC4/include/IfcIdentifier.h"
#include "ifcpp/IFC4/include/IfcLabel.h"
#include "ifcpp/IFC4/include/IfcOwnerHistory.h"
#include "ifcpp/IFC4/include/IfcPropertySetTemplate.h"
#include "ifcpp/IFC4/include/IfcPropertySetTemplateTypeEnum.h"
#include "ifcpp/IFC4/include/IfcPropertyTemplate.h"
#include "ifcpp/IFC4/include/IfcRelAssociates.h"
#include "ifcpp/IFC4/include/IfcRelDeclares.h"
#include "ifcpp/IFC4/include/IfcRelDefinesByTemplate.h"
#include "ifcpp/IFC4/include/IfcText.h"
// ENTITY IfcPropertySetTemplate
IfcPropertySetTemplate::IfcPropertySetTemplate( int id ) { m_entity_id = id; }
shared_ptr<BuildingObject> IfcPropertySetTemplate::getDeepCopy( BuildingCopyOptions& options )
{
shared_ptr<IfcPropertySetTemplate> copy_self( new IfcPropertySetTemplate() );
if( m_GlobalId )
{
if( options.create_new_IfcGloballyUniqueId ) { copy_self->m_GlobalId = make_shared<IfcGloballyUniqueId>( createBase64Uuid_wstr().data() ); }
else { copy_self->m_GlobalId = dynamic_pointer_cast<IfcGloballyUniqueId>( m_GlobalId->getDeepCopy(options) ); }
}
if( m_OwnerHistory )
{
if( options.shallow_copy_IfcOwnerHistory ) { copy_self->m_OwnerHistory = m_OwnerHistory; }
else { copy_self->m_OwnerHistory = dynamic_pointer_cast<IfcOwnerHistory>( m_OwnerHistory->getDeepCopy(options) ); }
}
if( m_Name ) { copy_self->m_Name = dynamic_pointer_cast<IfcLabel>( m_Name->getDeepCopy(options) ); }
if( m_Description ) { copy_self->m_Description = dynamic_pointer_cast<IfcText>( m_Description->getDeepCopy(options) ); }
if( m_TemplateType ) { copy_self->m_TemplateType = dynamic_pointer_cast<IfcPropertySetTemplateTypeEnum>( m_TemplateType->getDeepCopy(options) ); }
if( m_ApplicableEntity ) { copy_self->m_ApplicableEntity = dynamic_pointer_cast<IfcIdentifier>( m_ApplicableEntity->getDeepCopy(options) ); }
for( size_t ii=0; ii<m_HasPropertyTemplates.size(); ++ii )
{
auto item_ii = m_HasPropertyTemplates[ii];
if( item_ii )
{
copy_self->m_HasPropertyTemplates.emplace_back( dynamic_pointer_cast<IfcPropertyTemplate>(item_ii->getDeepCopy(options) ) );
}
}
return copy_self;
}
void IfcPropertySetTemplate::getStepLine( std::stringstream& stream ) const
{
stream << "#" << m_entity_id << "= IFCPROPERTYSETTEMPLATE" << "(";
if( m_GlobalId ) { m_GlobalId->getStepParameter( stream ); } else { stream << "$"; }
stream << ",";
if( m_OwnerHistory ) { stream << "#" << m_OwnerHistory->m_entity_id; } else { stream << "$"; }
stream << ",";
if( m_Name ) { m_Name->getStepParameter( stream ); } else { stream << "$"; }
stream << ",";
if( m_Description ) { m_Description->getStepParameter( stream ); } else { stream << "$"; }
stream << ",";
if( m_TemplateType ) { m_TemplateType->getStepParameter( stream ); } else { stream << "$"; }
stream << ",";
if( m_ApplicableEntity ) { m_ApplicableEntity->getStepParameter( stream ); } else { stream << "$"; }
stream << ",";
writeEntityList( stream, m_HasPropertyTemplates );
stream << ");";
}
void IfcPropertySetTemplate::getStepParameter( std::stringstream& stream, bool /*is_select_type*/ ) const { stream << "#" << m_entity_id; }
const std::wstring IfcPropertySetTemplate::toString() const { return L"IfcPropertySetTemplate"; }
void IfcPropertySetTemplate::readStepArguments( const std::vector<std::wstring>& args, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
const size_t num_args = args.size();
if( num_args != 7 ){ std::stringstream err; err << "Wrong parameter count for entity IfcPropertySetTemplate, expecting 7, having " << num_args << ". Entity ID: " << m_entity_id << std::endl; throw BuildingException( err.str().c_str() ); }
m_GlobalId = IfcGloballyUniqueId::createObjectFromSTEP( args[0], map );
readEntityReference( args[1], m_OwnerHistory, map );
m_Name = IfcLabel::createObjectFromSTEP( args[2], map );
m_Description = IfcText::createObjectFromSTEP( args[3], map );
m_TemplateType = IfcPropertySetTemplateTypeEnum::createObjectFromSTEP( args[4], map );
m_ApplicableEntity = IfcIdentifier::createObjectFromSTEP( args[5], map );
readEntityReferenceList( args[6], m_HasPropertyTemplates, map );
}
void IfcPropertySetTemplate::getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const
{
IfcPropertyTemplateDefinition::getAttributes( vec_attributes );
vec_attributes.emplace_back( std::make_pair( "TemplateType", m_TemplateType ) );
vec_attributes.emplace_back( std::make_pair( "ApplicableEntity", m_ApplicableEntity ) );
if( !m_HasPropertyTemplates.empty() )
{
shared_ptr<AttributeObjectVector> HasPropertyTemplates_vec_object( new AttributeObjectVector() );
std::copy( m_HasPropertyTemplates.begin(), m_HasPropertyTemplates.end(), std::back_inserter( HasPropertyTemplates_vec_object->m_vec ) );
vec_attributes.emplace_back( std::make_pair( "HasPropertyTemplates", HasPropertyTemplates_vec_object ) );
}
}
void IfcPropertySetTemplate::getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes_inverse ) const
{
IfcPropertyTemplateDefinition::getAttributesInverse( vec_attributes_inverse );
if( !m_Defines_inverse.empty() )
{
shared_ptr<AttributeObjectVector> Defines_inverse_vec_obj( new AttributeObjectVector() );
for( size_t i=0; i<m_Defines_inverse.size(); ++i )
{
if( !m_Defines_inverse[i].expired() )
{
Defines_inverse_vec_obj->m_vec.emplace_back( shared_ptr<IfcRelDefinesByTemplate>( m_Defines_inverse[i] ) );
}
}
vec_attributes_inverse.emplace_back( std::make_pair( "Defines_inverse", Defines_inverse_vec_obj ) );
}
}
void IfcPropertySetTemplate::setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self_entity )
{
IfcPropertyTemplateDefinition::setInverseCounterparts( ptr_self_entity );
shared_ptr<IfcPropertySetTemplate> ptr_self = dynamic_pointer_cast<IfcPropertySetTemplate>( ptr_self_entity );
if( !ptr_self ) { throw BuildingException( "IfcPropertySetTemplate::setInverseCounterparts: type mismatch" ); }
for( size_t i=0; i<m_HasPropertyTemplates.size(); ++i )
{
if( m_HasPropertyTemplates[i] )
{
m_HasPropertyTemplates[i]->m_PartOfPsetTemplate_inverse.emplace_back( ptr_self );
}
}
}
void IfcPropertySetTemplate::unlinkFromInverseCounterparts()
{
IfcPropertyTemplateDefinition::unlinkFromInverseCounterparts();
for( size_t i=0; i<m_HasPropertyTemplates.size(); ++i )
{
if( m_HasPropertyTemplates[i] )
{
std::vector<weak_ptr<IfcPropertySetTemplate> >& PartOfPsetTemplate_inverse = m_HasPropertyTemplates[i]->m_PartOfPsetTemplate_inverse;
for( auto it_PartOfPsetTemplate_inverse = PartOfPsetTemplate_inverse.begin(); it_PartOfPsetTemplate_inverse != PartOfPsetTemplate_inverse.end(); )
{
weak_ptr<IfcPropertySetTemplate> self_candidate_weak = *it_PartOfPsetTemplate_inverse;
if( self_candidate_weak.expired() )
{
++it_PartOfPsetTemplate_inverse;
continue;
}
shared_ptr<IfcPropertySetTemplate> self_candidate( *it_PartOfPsetTemplate_inverse );
if( self_candidate.get() == this )
{
it_PartOfPsetTemplate_inverse= PartOfPsetTemplate_inverse.erase( it_PartOfPsetTemplate_inverse );
}
else
{
++it_PartOfPsetTemplate_inverse;
}
}
}
}
}
| {
"content_hash": "597f1e6aa07321d21ec495a5ab4ce861",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 239,
"avg_line_length": 50.625,
"alnum_prop": 0.7172189733593243,
"repo_name": "berndhahnebach/IfcPlusPlus",
"id": "b75e08cc8a5f0a3c76f09c29ab8754cbb839d4d5",
"size": "7695",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "IfcPlusPlus/src/ifcpp/IFC4/lib/IfcPropertySetTemplate.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1370"
},
{
"name": "C",
"bytes": "4453"
},
{
"name": "C++",
"bytes": "11543025"
},
{
"name": "CMake",
"bytes": "12189"
},
{
"name": "CSS",
"bytes": "4880"
},
{
"name": "Makefile",
"bytes": "2305"
},
{
"name": "Objective-C",
"bytes": "92"
}
],
"symlink_target": ""
} |
package br.eti.kinoshita.testlinkjavaapi.testsuite;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import br.eti.kinoshita.testlinkjavaapi.BaseTest;
import br.eti.kinoshita.testlinkjavaapi.model.TestSuite;
import br.eti.kinoshita.testlinkjavaapi.util.TestLinkAPIException;
/**
* @author Bruno P. Kinoshita - http://www.kinoshita.eti.br
* @since
*/
public class TestGetFirstLevelTestSuiteForTestProject extends BaseTest {
@DataProvider(name = "validTestProjects")
public Object[][] createData() {
return new Object[][] { { 1 } };
}
@Test(dataProvider = "validTestProjects")
public void testGetFirstLevelTestSuitesForTestProject(Integer testProjectId) {
this.loadXMLRPCMockData("tl.createTestSuite.xml");
TestSuite[] testSuites = null;
try {
testSuites = api
.getFirstLevelTestSuitesForTestProject(testProjectId);
} catch (TestLinkAPIException e) {
Assert.fail(e.getMessage(), e);
}
Assert.assertNotNull(testSuites);
Assert.assertTrue(testSuites.length > 0);
}
}
| {
"content_hash": "631cfd4f3e48a91f223ec05a2eb08fed",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 82,
"avg_line_length": 26.390243902439025,
"alnum_prop": 0.7523105360443623,
"repo_name": "hpmtissera/testlink-java-api-master",
"id": "7ca9ad9f03c3a83162f3a313fe02ddec0ca55fa3",
"size": "2233",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/br/eti/kinoshita/testlinkjavaapi/testsuite/TestGetFirstLevelTestSuiteForTestProject.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "414291"
},
{
"name": "PHP",
"bytes": "64911"
}
],
"symlink_target": ""
} |
<?php
namespace Hubzero\Form\Fields;
use Hubzero\Html\Builder\Select as Dropdown;
use App;
/**
* Supports an HTML select list of files
*/
class Filelist extends Select
{
/**
* The form field type.
*
* @var string
*/
public $type = 'Filelist';
/**
* Method to get the list of files for the field options.
* Specify the target directory with a directory attribute
* Attributes allow an exclude mask and stripping of extensions from file name.
* Default attribute may optionally be set to null (no file) or -1 (use a default).
*
* @return array The field option objects.
*/
protected function getOptions()
{
// Initialize variables.
$options = array();
// Initialize some field attributes.
$filter = (string) $this->element['filter'];
$exclude = (string) $this->element['exclude'];
$stripExt = (string) $this->element['stripext'];
$hideNone = (string) $this->element['hide_none'];
$hideDefault = (string) $this->element['hide_default'];
// Get the path in which to search for file options.
$path = (string) $this->element['directory'];
if (!is_dir($path))
{
$path = PATH_ROOT . '/' . $path;
}
// Prepend some default options based on field attributes.
if (!$hideNone)
{
$options[] = Dropdown::option('-1', App::get('filesystem')->alt('JOPTION_DO_NOT_USE', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)));
}
if (!$hideDefault)
{
$options[] = Dropdown::option('', App::get('filesystem')->alt('JOPTION_USE_DEFAULT', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)));
}
// Get a list of files in the search path with the given filter.
$files = App::get('filesystem')->files($path, $filter);
// Build the options list from the list of files.
if (is_array($files))
{
foreach ($files as $file)
{
// Check to see if the file is in the exclude mask.
if ($exclude)
{
if (preg_match(chr(1) . $exclude . chr(1), $file))
{
continue;
}
}
// If the extension is to be stripped, do it.
if ($stripExt)
{
$file = App::get('filesystem')->name($file);
}
$options[] = Dropdown::option($file, $file);
}
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
}
| {
"content_hash": "77b1d811ebd5182018b81620322570a3",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 148,
"avg_line_length": 25.47252747252747,
"alnum_prop": 0.6220880069025022,
"repo_name": "zooley/framework",
"id": "0301f8ca6fbe72c01b538e26c412416ecf65f01b",
"size": "2464",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Form/Fields/Filelist.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "3002510"
}
],
"symlink_target": ""
} |
void Hooks_Handlers_Init(void);
void Hooks_Handlers_Commit(void);
| {
"content_hash": "579e961413ffe8293d597904fc610725",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 33,
"avg_line_length": 33,
"alnum_prop": 0.7878787878787878,
"repo_name": "SilverIce/JContainers",
"id": "3a0fdfe99315cf65451d37a9cbc24f641fdbd4ed",
"size": "80",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "dep/skse/skse/Hooks_Handlers.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "218230"
},
{
"name": "Batchfile",
"bytes": "26020"
},
{
"name": "C",
"bytes": "2296023"
},
{
"name": "C++",
"bytes": "47518731"
},
{
"name": "CMake",
"bytes": "12647"
},
{
"name": "CSS",
"bytes": "2521"
},
{
"name": "HTML",
"bytes": "98074"
},
{
"name": "Lua",
"bytes": "29693"
},
{
"name": "M4",
"bytes": "19951"
},
{
"name": "Makefile",
"bytes": "895877"
},
{
"name": "Objective-C",
"bytes": "3908"
},
{
"name": "Papyrus",
"bytes": "64719"
},
{
"name": "Perl",
"bytes": "7850"
},
{
"name": "Python",
"bytes": "795259"
},
{
"name": "Shell",
"bytes": "297931"
},
{
"name": "XSLT",
"bytes": "759"
},
{
"name": "Yacc",
"bytes": "19623"
}
],
"symlink_target": ""
} |
<configuration scan="true">
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date{ISO8601} [%.20thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="File" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>io.motown.ocpp.v15.soap.log</file>
<append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>io.motown.ocpp.v15.soap.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%date{ISO8601} [%.20thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.axonframework" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="Console"/>
<appender-ref ref="File"/>
</root>
</configuration> | {
"content_hash": "af10c341b95c12b4d54f6eeb0bfcca92",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 89,
"avg_line_length": 41.91304347826087,
"alnum_prop": 0.6172199170124482,
"repo_name": "pqtoan/motown",
"id": "12dce8c416a3138a6588af3cd7a5292bb93f78aa",
"size": "964",
"binary": false,
"copies": "6",
"ref": "refs/heads/develop",
"path": "samples/configuration-distributed/incoming-datatransfer-handling/src/main/resources/logback-test.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2376474"
}
],
"symlink_target": ""
} |
package org.switchyard.quickstarts.camel.jaxb;
import javax.xml.bind.JAXBContext;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.converter.jaxb.JaxbDataFormat;
import org.switchyard.common.camel.SwitchYardMessage;
/**
* Greeting service implementation.
*/
public class GreetingServiceRoute extends RouteBuilder {
@Override
public void configure() throws Exception {
JaxbDataFormat jxb = new JaxbDataFormat(JAXBContext.newInstance("org.switchyard.quickstarts.camel.jaxb"));
from("switchyard://GreetingService")
.convertBodyTo(String.class)
.unmarshal(jxb)
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
GreetingRequest rq = exchange.getIn().getBody(GreetingRequest.class);
GreetingResponse rp = new GreetingResponse("Ola " + rq.getName() + "!");
SwitchYardMessage out = new SwitchYardMessage();
out.setBody(rp);
exchange.setOut(out);
}
})
.marshal(jxb)
.convertBodyTo(String.class);
}
}
| {
"content_hash": "b372a8ae9a202a042656eb57d7db6641",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 114,
"avg_line_length": 33.76315789473684,
"alnum_prop": 0.6375681995323461,
"repo_name": "bfitzpat/switchyard",
"id": "1e922863ff866e3e6f96e4f47dadf4e0d2f5ba83",
"size": "2080",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "quickstarts/camel-jaxb/src/main/java/org/switchyard/quickstarts/camel/jaxb/GreetingServiceRoute.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1428"
},
{
"name": "Clojure",
"bytes": "239"
},
{
"name": "HTML",
"bytes": "12878"
},
{
"name": "Java",
"bytes": "9851089"
},
{
"name": "Ruby",
"bytes": "1772"
},
{
"name": "XSLT",
"bytes": "84991"
}
],
"symlink_target": ""
} |
// Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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.
namespace Burrows.Serialization
{
using System;
using System.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
public class JsonContractResolver :
CamelCasePropertyNamesContractResolver
{
protected override JsonDictionaryContract CreateDictionaryContract(Type objectType)
{
JsonDictionaryContract contract = base.CreateDictionaryContract(objectType);
// don't camel-case the key names of a dictionary
contract.PropertyNameResolver = x => x;
return contract;
}
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
{
JsonProperty property = base.CreateProperty(member, memberSerialization);
if (!property.Writable)
{
var propertyInfo = member as PropertyInfo;
if (propertyInfo != null)
{
if (propertyInfo.GetSetMethod(true) != null)
property.Writable = true;
}
}
return property;
}
}
} | {
"content_hash": "ad5ede42220714a6fc99bcd90de88163",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 114,
"avg_line_length": 37.08,
"alnum_prop": 0.6353829557713053,
"repo_name": "eswann/Burrows",
"id": "aa1800250aa82304205512d10d33d15a1a561f44",
"size": "1856",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Burrows/Serialization/JsonContractResolver.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "2611502"
},
{
"name": "PowerShell",
"bytes": "33044"
},
{
"name": "Shell",
"bytes": "1538"
}
],
"symlink_target": ""
} |
import sys
from eventlet import event
from eventlet import greenthread
from dragon.openstack.common.gettextutils import _ # noqa
from dragon.openstack.common import log as logging
from dragon.openstack.common import timeutils
LOG = logging.getLogger(__name__)
class LoopingCallDone(Exception):
"""Exception to break out and stop a LoopingCall.
The poll-function passed to LoopingCall can raise this exception to
break out of the loop normally. This is somewhat analogous to
StopIteration.
An optional return-value can be included as the argument to the exception;
this return-value will be returned by LoopingCall.wait()
"""
def __init__(self, retvalue=True):
""":param retvalue: Value that LoopingCall.wait() should return."""
self.retvalue = retvalue
class LoopingCallBase(object):
def __init__(self, f=None, *args, **kw):
self.args = args
self.kw = kw
self.f = f
self._running = False
self.done = None
def stop(self):
self._running = False
def wait(self):
return self.done.wait()
class FixedIntervalLoopingCall(LoopingCallBase):
"""A fixed interval looping call."""
def start(self, interval, initial_delay=None):
self._running = True
done = event.Event()
def _inner():
if initial_delay:
greenthread.sleep(initial_delay)
try:
while self._running:
start = timeutils.utcnow()
self.f(*self.args, **self.kw)
end = timeutils.utcnow()
if not self._running:
break
delay = interval - timeutils.delta_seconds(start, end)
if delay <= 0:
LOG.warn(_('task run outlasted interval by %s sec') %
-delay)
greenthread.sleep(delay if delay > 0 else 0)
except LoopingCallDone as e:
self.stop()
done.send(e.retvalue)
except Exception:
LOG.exception(_('in fixed duration looping call'))
done.send_exception(*sys.exc_info())
return
else:
done.send(True)
self.done = done
greenthread.spawn_n(_inner)
return self.done
# TODO(mikal): this class name is deprecated in Havana and should be removed
# in the I release
LoopingCall = FixedIntervalLoopingCall
class DynamicLoopingCall(LoopingCallBase):
"""A looping call which sleeps until the next known event.
The function called should return how long to sleep for before being
called again.
"""
def start(self, initial_delay=None, periodic_interval_max=None):
self._running = True
done = event.Event()
def _inner():
if initial_delay:
greenthread.sleep(initial_delay)
try:
while self._running:
idle = self.f(*self.args, **self.kw)
if not self._running:
break
if periodic_interval_max is not None:
idle = min(idle, periodic_interval_max)
LOG.debug(_('Dynamic looping call sleeping for %.02f '
'seconds'), idle)
greenthread.sleep(idle)
except LoopingCallDone as e:
self.stop()
done.send(e.retvalue)
except Exception:
LOG.exception(_('in dynamic looping call'))
done.send_exception(*sys.exc_info())
return
else:
done.send(True)
self.done = done
greenthread.spawn(_inner)
return self.done
| {
"content_hash": "42fe69d369b83ec709abdc23d877f8da",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 78,
"avg_line_length": 30.140625,
"alnum_prop": 0.5544323483670296,
"repo_name": "os-cloud-storage/openstack-workload-disaster-recovery",
"id": "9c51513246b8179fb4332d3a8676103328ce93cb",
"size": "4673",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dragon/openstack/common/loopingcall.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "4930"
},
{
"name": "Python",
"bytes": "758400"
},
{
"name": "Shell",
"bytes": "24692"
}
],
"symlink_target": ""
} |
<?php
namespace Zend\Feed\Writer\Exception;
/**
* Feed exceptions
*
* Interface to represent exceptions that occur during Feed operations.
*/
interface ExceptionInterface
{
}
| {
"content_hash": "4722b757083410b11e184fc9be1ab456",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 71,
"avg_line_length": 15,
"alnum_prop": 0.6923076923076923,
"repo_name": "stromengine/10001",
"id": "e4d847b3b5b5e0a49acc965da5c6fb4a6b208525",
"size": "503",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "vendor/zendframework/zendframework/library/Zend/Feed/Writer/Exception/ExceptionInterface.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "1454"
},
{
"name": "CSS",
"bytes": "1365"
},
{
"name": "Gettext Catalog",
"bytes": "106424"
},
{
"name": "HTML",
"bytes": "14011"
},
{
"name": "JavaScript",
"bytes": "134327"
},
{
"name": "PHP",
"bytes": "54827"
}
],
"symlink_target": ""
} |
from __future__ import unicode_literals
from builtins import str
import datetime, json, logging, os
from jsonpath_rw import jsonpath, parse
from jsonpath_rw.lexer import JsonPathLexerError
from scrapy import signals
from scrapy.exceptions import CloseSpider
from scrapy.http import Request
from pydispatch import dispatcher
from dynamic_scraper.spiders.django_base_spider import DjangoBaseSpider
from dynamic_scraper.models import ScraperElem
from dynamic_scraper.utils.scheduler import Scheduler
class DjangoChecker(DjangoBaseSpider):
name = "django_checker"
mandatory_vars = ['ref_object', 'scraper',]
def __init__(self, *args, **kwargs):
super(DjangoChecker, self).__init__(self, *args, **kwargs)
@classmethod
def from_crawler(cls, crawler, *args, **kwargs):
spider = cls(*args, **kwargs)
spider._set_crawler(crawler)
spider._set_config(**kwargs)
spider._check_checker_config()
spider._set_request_kwargs()
spider._set_meta_splash_args()
spider.scheduler = Scheduler(spider.scraper.scraped_obj_class.checker_scheduler_conf)
dispatcher.connect(spider.response_received, signal=signals.response_received)
msg = "Checker for " + spider.ref_object.__class__.__name__ + " \"" + str(spider.ref_object) + "\" (" + str(spider.ref_object.pk) + ") initialized."
spider.log(msg, logging.INFO)
return spider
def output_usage_help(self):
out = (
'',
'DDS Usage',
'=========',
' scrapy crawl [scrapy_options] CHECKERNAME -a id=REF_OBJECT_ID [dds_options]',
'',
'Options',
'-------',
'-a do_action=(yes|no) Delete on checker success, default: no (Test Mode)',
'-L LOG_LEVEL (scrapy option) Setting the log level for both Scrapy and DDS',
'-a run_type=(TASK|SHELL) Simulate task based checker run, default: SHELL',
'-a output_response_body=(yes|no) Output response body content for debugging',
'',
)
for out_str in out:
self.dds_logger.info(out_str)
def _set_config(self, **kwargs):
log_msg = ""
#output_response_body
if 'output_response_body' in kwargs and kwargs['output_response_body'] == 'yes':
self.conf['OUTPUT_RESPONSE_BODY'] = True
if len(log_msg) > 0:
log_msg += ", "
log_msg += "output_response_body " + str(self.conf['OUTPUT_RESPONSE_BODY'])
else:
self.conf['OUTPUT_RESPONSE_BODY'] = False
super(DjangoChecker, self)._set_config(log_msg, **kwargs)
def _check_checker_config(self):
if self.scraper.checker_set.count() == 0:
msg = '{cs}No checkers defined for scraper.{ce}'.format(
cs=self.bcolors["INFO"], ce=self.bcolors["ENDC"])
self.dds_logger.warning(msg)
self.output_usage_help()
raise CloseSpider(msg)
def _del_ref_object(self):
if self.action_successful:
self.log("Item already deleted, skipping.", logging.INFO)
return
from scrapy.utils.project import get_project_settings
settings = get_project_settings()
try:
img_elem = self.scraper.get_image_elem()
if hasattr(self.ref_object, img_elem.scraped_obj_attr.name):
img_name = getattr(self.ref_object, img_elem.scraped_obj_attr.name)
thumb_paths = []
if settings.get('IMAGES_THUMBS') and len(settings.get('IMAGES_THUMBS')) > 0:
for key in settings.get('IMAGES_THUMBS').keys():
thumb_paths.append(('thumbnail, {k}'.format(k=key), os.path.join(settings.get('IMAGES_STORE'), 'thumbs', key, img_name),))
del_paths = []
if self.conf['IMAGES_STORE_FORMAT'] == 'FLAT':
del_paths.append(('original, flat path', os.path.join(settings.get('IMAGES_STORE'), img_name),))
if self.conf['IMAGES_STORE_FORMAT'] == 'ALL':
del_paths.append(('original, full/ path', os.path.join(settings.get('IMAGES_STORE'), 'full' , img_name),))
del_paths += thumb_paths
if self.conf['IMAGES_STORE_FORMAT'] == 'THUMBS':
del_paths += thumb_paths
for path in del_paths:
if os.access(path[1], os.F_OK):
try:
os.unlink(path[1])
self.log("Associated image ({n}, {p}) deleted.".format(n=img_name, p=path[0]), logging.INFO)
except Exception:
self.log("Associated image ({n}, {p}) could not be deleted!".format(n=img_name, p=path[0]), logging.ERROR)
else:
self.log("Associated image ({n}, {p}) could not be found!".format(n=img_name, p=path[0]), logging.WARNING)
except ScraperElem.DoesNotExist:
pass
self.ref_object.delete()
self.scraper.last_checker_delete = datetime.datetime.now()
self.scraper.save()
self.action_successful = True
self.log("{cs}Item deleted.{ce}".format(
cs=self.bcolors["ERROR"], ce=self.bcolors["ENDC"]), logging.INFO)
def start_requests(self):
for checker in self.scraper.checker_set.all():
url = getattr(self.ref_object, checker.scraped_obj_attr.name)
rpt = self.scraper.get_rpt_for_scraped_obj_attr(checker.scraped_obj_attr)
kwargs = self.dp_request_kwargs[rpt.page_type].copy()
if 'meta' not in kwargs:
kwargs['meta'] = {}
kwargs['meta']['checker'] = checker
kwargs['meta']['rpt'] = rpt
self._set_meta_splash_args()
if url:
if rpt.request_type == 'R':
yield Request(url, callback=self.parse, method=rpt.method, dont_filter=True, **kwargs)
else:
yield FormRequest(url, callback=self.parse, method=rpt.method, formdata=self.dp_form_data[rpt.page_type], dont_filter=True, **kwargs)
def response_received(self, **kwargs):
checker = kwargs['response'].request.meta['checker']
rpt = kwargs['response'].request.meta['rpt']
# 404 test
if kwargs['response'].status == 404:
if self.scheduler_runtime.num_zero_actions == 0:
self.log("{cs}Checker test returned second 404 ({c}). Delete reason.{ce}".format(
c=str(checker), cs=self.bcolors["ERROR"], ce=self.bcolors["ENDC"]), logging.INFO)
if self.conf['DO_ACTION']:
self._del_ref_object()
else:
self.log("{cs}Checker test returned first 404 ({c}).{ce}".format(
str(checker), cs=self.bcolors["ERROR"], ce=self.bcolors["ENDC"]), logging.INFO)
self.action_successful = True
def parse(self, response):
# x_path test
checker = response.request.meta['checker']
rpt = response.request.meta['rpt']
if self.conf['OUTPUT_RESPONSE_BODY']:
self.log("Response body ({url})\n\n***** RP_START *****\n{resp_body}\n***** RP_END *****\n\n".format(
url=response.url,
resp_body=response.body.decode('utf-8')), logging.INFO)
if checker.checker_type == '4':
self.log("{cs}No 404 result ({c} checker type).{ce}".format(
c=str(checker), cs=self.bcolors["OK"], ce=self.bcolors["ENDC"]), logging.INFO)
if self.conf['DO_ACTION']:
self.dds_logger.info("{cs}Item kept.{ce}".format(
cs=self.bcolors["OK"], ce=self.bcolors["ENDC"]))
return
if rpt.content_type == 'J':
json_resp = json.loads(response.body_as_unicode())
try:
jsonpath_expr = parse(checker.checker_x_path)
except JsonPathLexerError:
msg = "Invalid checker JSONPath ({c})!".format(c=str(checker))
self.dds_logger.error(msg)
raise CloseSpider()
test_select = [match.value for match in jsonpath_expr.find(json_resp)]
#self.log(unicode(test_select), logging.INFO)
else:
try:
test_select = response.xpath(checker.checker_x_path).extract()
except ValueError:
self.log("Invalid checker XPath ({c})!".format(c=str(checker)), logging.ERROR)
return
if len(test_select) > 0 and checker.checker_x_path_result == '':
self.log("{cs}Elements for XPath found on page (no result string defined) ({c}). Delete reason.{ce}".format(
c=str(checker), cs=self.bcolors["ERROR"], ce=self.bcolors["ENDC"]), logging.INFO)
if self.conf['DO_ACTION']:
self._del_ref_object()
return
elif len(test_select) > 0 and test_select[0] == checker.checker_x_path_result:
self.log("{cs}XPath result string '{s}' found on page ({c}). Delete reason.{ce}".format(
s=checker.checker_x_path_result, c=str(checker), cs=self.bcolors["ERROR"], ce=self.bcolors["ENDC"]), logging.INFO)
if self.conf['DO_ACTION']:
self._del_ref_object()
return
else:
self.log("{cs}XPath result string not found ({c}).{ce}".format(
c=str(checker), cs=self.bcolors["OK"], ce=self.bcolors["ENDC"]), logging.INFO)
if self.conf['DO_ACTION']:
self.dds_logger.info("{cs}Item kept.{ce}".format(
cs=self.bcolors["OK"], ce=self.bcolors["ENDC"]))
return
| {
"content_hash": "84cf62b267962fd57d228f649a21f91a",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 156,
"avg_line_length": 45.03603603603604,
"alnum_prop": 0.5524104820964193,
"repo_name": "holgerd77/django-dynamic-scraper",
"id": "f86de816984df8ef01b153d4020d9ce3092c40f6",
"size": "10025",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "dynamic_scraper/spiders/django_checker.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "HTML",
"bytes": "9012"
},
{
"name": "JavaScript",
"bytes": "1698"
},
{
"name": "Python",
"bytes": "312719"
},
{
"name": "Shell",
"bytes": "6984"
}
],
"symlink_target": ""
} |
function truncate(str, len) {
len = len || 30;
if (str.length > len && str.length > 0) {
var new_str = str + " ";
new_str = str.substr (0, len);
new_str = str.substr (0, new_str.lastIndexOf(" "));
new_str = (new_str.length > 0) ? new_str : str.substr (0, len);
return new Handlebars.SafeString ( new_str +'...' );
}
return str;
}
Handlebars.registerHelper('truncate', truncate);
Handlebars.registerHelper('urlHref', function(value) {
if (value.url) {
return value.url;
}
else {
return '#' + value.id;
}
});
Handlebars.registerHelper('urlClass', function(value) {
if (value.url) {
return "text-primary";
}
});
Handlebars.registerHelper('group', function(context, n, options) {
var result = "";
if (context && context.length > 0) {
var subcontext = [];
for (var i = 0; i < context.length; ++i) {
if (i > 0 && i % n == 0) {
result += options.fn(subcontext);
subcontext = [];
}
subcontext.push(context[i]);
}
result += options.fn(subcontext);
}
return result;
});
// vim: sts=2 sw=2:
| {
"content_hash": "86b72d0481e02de2d053db3abc095189",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 67,
"avg_line_length": 21.173076923076923,
"alnum_prop": 0.5703905540417802,
"repo_name": "rlipscombe/bookymark",
"id": "8593c737dd7d84d76d26460aac92d942e2540c51",
"size": "1101",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/helpers.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "32"
},
{
"name": "HTML",
"bytes": "1212"
},
{
"name": "JavaScript",
"bytes": "4011"
},
{
"name": "Makefile",
"bytes": "281"
}
],
"symlink_target": ""
} |
from ibis.common import RelationError, ExpressionError
from ibis.expr.window import window
import ibis.expr.types as ir
import ibis.expr.operations as ops
import ibis.util as util
# ---------------------------------------------------------------------
# Some expression metaprogramming / graph transformations to support
# compilation later
def sub_for(expr, substitutions):
helper = _Substitutor(expr, substitutions)
return helper.get_result()
class _Substitutor(object):
def __init__(self, expr, substitutions, sub_memo=None):
self.expr = expr
self.substitutions = substitutions
self._id_to_expr = {}
for k, v in substitutions:
self._id_to_expr[self._key(k)] = v
self.sub_memo = sub_memo or {}
self.unchanged = True
def get_result(self):
expr = self.expr
node = expr.op()
if getattr(node, 'blocking', False):
return expr
subbed_args = []
for arg in node.args:
if isinstance(arg, (tuple, list)):
subbed_arg = [self._sub_arg(x) for x in arg]
else:
subbed_arg = self._sub_arg(arg)
subbed_args.append(subbed_arg)
# Do not modify unnecessarily
if self.unchanged:
return expr
subbed_node = type(node)(*subbed_args)
if isinstance(expr, ir.ValueExpr):
result = expr._factory(subbed_node, name=expr._name)
else:
result = expr._factory(subbed_node)
return result
def _sub_arg(self, arg):
if isinstance(arg, ir.Expr):
subbed_arg = self.sub(arg)
if subbed_arg is not arg:
self.unchanged = False
else:
# a string or some other thing
subbed_arg = arg
return subbed_arg
def _key(self, expr):
return repr(expr.op())
def sub(self, expr):
key = self._key(expr)
if key in self.sub_memo:
return self.sub_memo[key]
if key in self._id_to_expr:
return self._id_to_expr[key]
result = self._sub(expr)
self.sub_memo[key] = result
return result
def _sub(self, expr):
helper = _Substitutor(expr, self.substitutions,
sub_memo=self.sub_memo)
return helper.get_result()
def substitute_parents(expr, lift_memo=None, past_projection=True):
rewriter = ExprSimplifier(expr, lift_memo=lift_memo,
block_projection=not past_projection)
return rewriter.get_result()
class ExprSimplifier(object):
"""
Rewrite the input expression by replacing any table expressions part of a
"commutative table operation unit" (for lack of scientific term, a set of
operations that can be written down in any order and still yield the same
semantic result)
"""
def __init__(self, expr, lift_memo=None, block_projection=False):
self.expr = expr
self.lift_memo = lift_memo or {}
self.block_projection = block_projection
def get_result(self):
expr = self.expr
node = expr.op()
if isinstance(node, ir.Literal):
return expr
# For table column references, in the event that we're on top of a
# projection, we need to check whether the ref comes from the base
# table schema or is a derived field. If we've projected out of
# something other than a physical table, then lifting should not occur
if isinstance(node, ops.TableColumn):
result = self._lift_TableColumn(expr, block=self.block_projection)
if result is not expr:
return result
# Temporary hacks around issues addressed in #109
elif isinstance(node, ops.Projection):
return self._lift_Projection(expr, block=self.block_projection)
elif isinstance(node, ops.Aggregation):
return self._lift_Aggregation(expr, block=self.block_projection)
unchanged = True
lifted_args = []
for arg in node.args:
lifted_arg, unch_arg = self._lift_arg(arg)
lifted_args.append(lifted_arg)
unchanged = unchanged and unch_arg
# Do not modify unnecessarily
if unchanged:
return expr
lifted_node = type(node)(*lifted_args)
if isinstance(expr, ir.ValueExpr):
result = expr._factory(lifted_node, name=expr._name)
else:
result = expr._factory(lifted_node)
return result
def _lift_arg(self, arg, block=None):
unchanged = [True]
def _lift(x):
if isinstance(x, ir.Expr):
lifted_arg = self.lift(x, block=block)
if lifted_arg is not x:
unchanged[0] = False
else:
# a string or some other thing
lifted_arg = x
return lifted_arg
if arg is None:
return arg, True
if isinstance(arg, (tuple, list)):
result = [_lift(x) for x in arg]
else:
result = _lift(arg)
return result, unchanged[0]
def lift(self, expr, block=None):
# This use of id() is OK since only for memoization
key = id(expr.op()), block
if key in self.lift_memo:
return self.lift_memo[key]
op = expr.op()
if isinstance(op, (ops.ValueNode, ops.ArrayNode)):
return self._sub(expr, block=block)
elif isinstance(op, ops.Filter):
result = self.lift(op.table, block=block)
elif isinstance(op, ops.Projection):
result = self._lift_Projection(expr, block=block)
elif isinstance(op, ops.Join):
result = self._lift_Join(expr, block=block)
elif isinstance(op, (ops.TableNode, ir.HasSchema)):
return expr
else:
raise NotImplementedError
# If we get here, time to record the modified expression in our memo to
# avoid excessive graph-walking
self.lift_memo[key] = result
return result
def _lift_TableColumn(self, expr, block=None):
node = expr.op()
tnode = node.table.op()
root = _base_table(tnode)
result = expr
if isinstance(root, ops.Projection):
can_lift = False
for val in root.selections:
if (isinstance(val.op(), ops.PhysicalTable) and
node.name in val.schema()):
can_lift = True
lifted_root = self.lift(val)
elif (isinstance(val.op(), ops.TableColumn) and
val.op().name == val.get_name() and
node.name == val.get_name()):
can_lift = True
lifted_root = self.lift(val.op().table)
# XXX
# can_lift = False
# HACK: If we've projected a join, do not lift the children
# TODO: what about limits and other things?
# if isinstance(root.table.op(), Join):
# can_lift = False
if can_lift and not block:
lifted_node = ops.TableColumn(node.name, lifted_root)
result = expr._factory(lifted_node, name=expr._name)
return result
def _lift_Aggregation(self, expr, block=None):
if block is None:
block = self.block_projection
op = expr.op()
lifted_table = self.lift(op.table, block=True)
unch = lifted_table is op.table
lifted_aggs, unch1 = self._lift_arg(op.agg_exprs, block=True)
lifted_by, unch2 = self._lift_arg(op.by, block=True)
lifted_having, unch3 = self._lift_arg(op.having, block=True)
unchanged = unch and unch1 and unch2 and unch3
if not unchanged:
lifted_op = ops.Aggregation(lifted_table, lifted_aggs,
by=lifted_by, having=lifted_having)
result = ir.TableExpr(lifted_op)
else:
result = expr
return result
def _lift_Projection(self, expr, block=None):
if block is None:
block = self.block_projection
op = expr.op()
if block:
lifted_table = op.table
unch = True
else:
lifted_table, unch = self._lift_arg(op.table, block=True)
lifted_selections, unch_sel = self._lift_arg(op.selections, block=True)
unchanged = unch and unch_sel
if not unchanged:
lifted_projection = ops.Projection(lifted_table, lifted_selections)
result = ir.TableExpr(lifted_projection)
else:
result = expr
return result
def _lift_Join(self, expr, block=None):
op = expr.op()
left_lifted = self.lift(op.left, block=block)
right_lifted = self.lift(op.right, block=block)
unchanged = (left_lifted is op.left and
right_lifted is op.right)
# Fix predicates
lifted_preds = []
for x in op.predicates:
subbed = self._sub(x, block=True)
if subbed is not x:
unchanged = False
lifted_preds.append(subbed)
if not unchanged:
lifted_join = type(op)(left_lifted, right_lifted, lifted_preds)
result = ir.TableExpr(lifted_join)
else:
result = expr
return result
def _sub(self, expr, block=None):
# catchall recursive rewriter
if block is None:
block = self.block_projection
helper = ExprSimplifier(expr, lift_memo=self.lift_memo,
block_projection=block)
return helper.get_result()
def _base_table(table_node):
# Find the aggregate or projection root. Not proud of this
if isinstance(table_node, ir.BlockingTableNode):
return table_node
else:
return _base_table(table_node.table.op())
def apply_filter(expr, predicates):
# This will attempt predicate pushdown in the cases where we can do it
# easily and safely
op = expr.op()
if isinstance(op, ops.Filter):
# Potential fusion opportunity. The predicates may need to be rewritten
# in terms of the child table. This prevents the broken ref issue
# (described in more detail in #59)
predicates = [sub_for(x, [(expr, op.table)]) for x in predicates]
return ops.Filter(op.table, op.predicates + predicates)
elif isinstance(op, (ops.Projection, ops.Aggregation)):
# if any of the filter predicates have the parent expression among
# their roots, then pushdown (at least of that predicate) is not
# possible
# It's not unusual for the filter to reference the projection
# itself. If a predicate can be pushed down, in this case we must
# rewrite replacing the table refs with the roots internal to the
# projection we are referencing
#
# If the filter references any new or derived aliases in the
#
# in pseudocode
# c = Projection(Join(a, b, jpreds), ppreds)
# filter_pred = c.field1 == c.field2
# Filter(c, [filter_pred])
#
# Assuming that the fields referenced by the filter predicate originate
# below the projection, we need to rewrite the predicate referencing
# the parent tables in the join being projected
# TODO: is partial pushdown (one or more, but not all of the passed
# predicates) something we should consider doing? Could be reasonable
# if isinstance(op, ops.Projection):
# else:
# # Aggregation
# can_pushdown = op.table.is_an
can_pushdown = _can_pushdown(op, predicates)
if can_pushdown:
predicates = [substitute_parents(x) for x in predicates]
# this will further fuse, if possible
filtered = op.table.filter(predicates)
result = op.substitute_table(filtered)
else:
result = ops.Filter(expr, predicates)
else:
result = ops.Filter(expr, predicates)
return result
def _can_pushdown(op, predicates):
# Per issues discussed in #173
#
# The only case in which pushdown is possible is that all table columns
# referenced must meet all of the following (not that onerous in practice)
# criteria
#
# 1) Is a table column, not any other kind of expression
# 2) Is unaliased. So, if you project t3.foo AS bar, then filter on bar,
# this cannot be pushed down (until we implement alias rewriting if
# necessary)
# 3) Appears in the selections in the projection (either is part of one of
# the entire tables or a single column selection)
can_pushdown = True
for pred in predicates:
validator = _PushdownValidate(op, pred)
predicate_is_valid = validator.get_result()
can_pushdown = can_pushdown and predicate_is_valid
return can_pushdown
class _PushdownValidate(object):
def __init__(self, parent, predicate):
self.parent = parent
self.pred = predicate
self.validator = ExprValidator([self.parent.table])
self.valid = True
def get_result(self):
self._walk(self.pred)
return self.valid
def _walk(self, expr):
node = expr.op()
if isinstance(node, ops.TableColumn):
is_valid = self._validate_column(expr)
self.valid = self.valid and is_valid
for arg in node.flat_args():
if isinstance(arg, ir.ValueExpr):
self._walk(arg)
# Skip other types of exprs
def _validate_column(self, expr):
if isinstance(self.parent, ops.Projection):
return self._validate_projection(expr)
else:
validator = ExprValidator([self.parent.table])
return validator.validate(expr)
def _validate_projection(self, expr):
is_valid = False
node = expr.op()
# Has a different alias, invalid
if _is_aliased(expr):
return False
for val in self.parent.selections:
if (isinstance(val.op(), ops.PhysicalTable) and
node.name in val.schema()):
is_valid = True
elif (isinstance(val.op(), ops.TableColumn) and
node.name == val.get_name() and
not _is_aliased(val)):
# Aliased table columns are no good
col_table = val.op().table.op()
lifted_node = substitute_parents(expr).op()
is_valid = (col_table.is_ancestor(node.table) or
col_table.is_ancestor(lifted_node.table))
# is_valid = True
return is_valid
def _is_aliased(col_expr):
return col_expr.op().name != col_expr.get_name()
def windowize_function(expr, w=None):
def _check_window(x):
# Hmm
arg, window = x.op().args
if isinstance(arg.op(), ops.RowNumber):
if len(window._order_by) == 0:
raise ExpressionError('RowNumber requires explicit '
'window sort')
return x
def _windowize(x, w):
if not isinstance(x.op(), ops.WindowOp):
walked = _walk(x, w)
else:
window_arg, window_w = x.op().args
walked_child = _walk(window_arg, w)
if walked_child is not window_arg:
walked = x._factory(ops.WindowOp(walked_child, window_w),
name=x._name)
else:
walked = x
op = walked.op()
if isinstance(op, (ops.AnalyticOp, ops.Reduction)):
if w is None:
w = window()
return _check_window(walked.over(w))
elif isinstance(op, ops.WindowOp):
if w is not None:
return _check_window(walked.over(w))
else:
return _check_window(walked)
else:
return walked
def _walk(x, w):
op = x.op()
unchanged = True
windowed_args = []
for arg in op.args:
if not isinstance(arg, ir.Expr):
windowed_args.append(arg)
continue
new_arg = _windowize(arg, w)
unchanged = unchanged and arg is new_arg
windowed_args.append(new_arg)
if not unchanged:
new_op = type(op)(*windowed_args)
return x._factory(new_op, name=x._name)
else:
return x
return _windowize(expr, w)
class Projector(object):
"""
Analysis and validation of projection operation, taking advantage of
"projection fusion" opportunities where they exist, i.e. combining
compatible projections together rather than nesting them. Translation /
evaluation later will not attempt to do any further fusion /
simplification.
"""
def __init__(self, parent, proj_exprs):
self.parent = parent
node = self.parent.op()
if isinstance(node, ops.Projection):
roots = [node]
else:
roots = node.root_tables()
self.parent_roots = roots
clean_exprs = []
validator = ExprValidator([parent])
for expr in proj_exprs:
# Perform substitution only if we share common roots
if validator.shares_some_roots(expr):
expr = substitute_parents(expr, past_projection=False)
expr = windowize_function(expr)
clean_exprs.append(expr)
self.clean_exprs = clean_exprs
def get_result(self):
roots = self.parent_roots
if len(roots) == 1 and isinstance(roots[0], ops.Projection):
fused_op = self._check_fusion(roots[0])
if fused_op is not None:
return fused_op
return ops.Projection(self.parent, self.clean_exprs)
def _check_fusion(self, root):
roots = root.table._root_tables()
validator = ExprValidator([root.table])
fused_exprs = []
can_fuse = False
for val in self.clean_exprs:
# XXX
lifted_val = substitute_parents(val)
# a * projection
if (isinstance(val, ir.TableExpr) and
(self.parent.op().is_ancestor(val) or
# gross we share the same table root. Better way to
# detect?
len(roots) == 1 and val._root_tables()[0] is roots[0])):
can_fuse = True
fused_exprs.extend(root.selections)
elif validator.validate(lifted_val):
fused_exprs.append(lifted_val)
elif not validator.validate(val):
can_fuse = False
break
else:
fused_exprs.append(val)
if can_fuse:
return ops.Projection(root.table, fused_exprs)
else:
return None
class ExprValidator(object):
def __init__(self, exprs):
self.parent_exprs = exprs
self.roots = []
for expr in self.parent_exprs:
self.roots.extend(expr._root_tables())
def has_common_roots(self, expr):
return self.validate(expr)
def validate(self, expr):
op = expr.op()
if isinstance(op, ops.TableColumn):
if self._among_roots(op.table.op()):
return True
elif isinstance(op, ops.Projection):
if self._among_roots(op):
return True
expr_roots = expr._root_tables()
for root in expr_roots:
if not self._among_roots(root):
return False
return True
def _among_roots(self, node):
for root in self.roots:
if root.is_ancestor(node):
return True
return False
def shares_some_roots(self, expr):
expr_roots = expr._root_tables()
return any(self._among_roots(root)
for root in expr_roots)
def validate_all(self, exprs):
for expr in exprs:
self.assert_valid(expr)
def assert_valid(self, expr):
if not self.validate(expr):
msg = self._error_message(expr)
raise RelationError(msg)
def _error_message(self, expr):
return ('The expression %s does not fully originate from '
'dependencies of the table expression.' % repr(expr))
class FilterValidator(ExprValidator):
"""
Filters need not necessarily originate fully from the ancestors of the
table being filtered. The key cases for this are
- Scalar reductions involving some other tables
- Array expressions involving other tables only (mapping to "uncorrelated
subqueries" in SQL-land)
- Reductions or array expressions like the above, but containing some
predicate with a record-specific interdependency ("correlated subqueries"
in SQL)
"""
def validate(self, expr):
op = expr.op()
is_valid = True
if isinstance(op, ops.Contains):
value_valid = ExprValidator.validate(self, op.value)
is_valid = value_valid
else:
roots_valid = []
for arg in op.flat_args():
if isinstance(arg, ir.ScalarExpr):
# arg_valid = True
pass
elif isinstance(arg, ir.ArrayExpr):
roots_valid.append(self.shares_some_roots(arg))
elif isinstance(arg, ir.Expr):
raise NotImplementedError
else:
# arg_valid = True
pass
is_valid = any(roots_valid)
return is_valid
def find_base_table(expr):
if isinstance(expr, ir.TableExpr):
return expr
for arg in expr.op().flat_args():
if isinstance(arg, ir.Expr):
r = find_base_table(arg)
if isinstance(r, ir.TableExpr):
return r
def find_source_table(expr):
# A more complex version of _find_base_table.
# TODO: Revisit/refactor this all at some point
node = expr.op()
# First table expression observed for each argument that the expr
# depends on
first_tables = []
def push_first(arg):
if not isinstance(arg, ir.Expr):
return
if isinstance(arg, ir.TableExpr):
first_tables.append(arg)
else:
collect(arg.op())
def collect(node):
for arg in node.flat_args():
push_first(arg)
collect(node)
options = util.unique_by_key(first_tables, id)
if len(options) > 1:
raise NotImplementedError
return options[0]
def unwrap_ands(expr):
out_exprs = []
def walk(expr):
op = expr.op()
if isinstance(op, ops.Comparison):
out_exprs.append(expr)
elif isinstance(op, ops.And):
walk(op.left)
walk(op.right)
else:
raise Exception('Invalid predicate: {0!s}'
.format(expr._repr()))
walk(expr)
return out_exprs
def find_backend(expr):
from ibis.client import Client
backends = []
def walk(expr):
node = expr.op()
for arg in node.flat_args():
if isinstance(arg, Client):
backends.append(arg)
elif isinstance(arg, ir.Expr):
walk(arg)
walk(expr)
backends = util.unique_by_key(backends, id)
if len(backends) > 1:
raise ValueError('Multiple backends found')
return backends[0]
| {
"content_hash": "f76ef3d9442f123bb3e364ae296ed8a0",
"timestamp": "",
"source": "github",
"line_count": 781,
"max_line_length": 79,
"avg_line_length": 30.52368758002561,
"alnum_prop": 0.5653341163639415,
"repo_name": "shaunstanislaus/ibis",
"id": "d7471e2dfd17fd4baf948af0087d84a635dfd3cb",
"size": "24413",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "ibis/expr/analysis.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "3684"
},
{
"name": "Makefile",
"bytes": "42"
},
{
"name": "Python",
"bytes": "766938"
},
{
"name": "Shell",
"bytes": "2116"
}
],
"symlink_target": ""
} |
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
/* private library and arch headers */
#include "pfmlib_priv.h"
#include "pfmlib_s390x_priv.h"
#include "pfmlib_perf_event_priv.h"
int pfm_s390x_get_perf_encoding(void *this, pfmlib_event_desc_t *e)
{
pfmlib_pmu_t *pmu = this;
struct perf_event_attr *attr = e->os_data;
int rc;
if (!pmu->get_event_encoding[PFM_OS_NONE])
return PFM_ERR_NOTSUPP;
/* set up raw pmu event encoding */
rc = pmu->get_event_encoding[PFM_OS_NONE](this, e);
if (rc == PFM_SUCCESS) {
/* currently use raw events only */
attr->type = PERF_TYPE_RAW;
attr->config = e->codes[0];
}
return rc;
}
| {
"content_hash": "55408235702cb8f3a9b7befe51639afe",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 67,
"avg_line_length": 21.733333333333334,
"alnum_prop": 0.6656441717791411,
"repo_name": "yqzhang/FinerProfiler",
"id": "fb7589212c3d9e59733a67014106bf8dac864525",
"size": "1868",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "lib/pfmlib_s390x_perf_event.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3344035"
},
{
"name": "C++",
"bytes": "458"
},
{
"name": "Objective-C",
"bytes": "219303"
},
{
"name": "Python",
"bytes": "10607"
}
],
"symlink_target": ""
} |
<?php
namespace Octo;
use b8;
use b8\View;
use Octo\Template;
/**
* Class Form
* @package Octo
*/
class Form extends b8\Form
{
/**
* Get the view for the form
*
* @param $view
* @return View|null|Template
*/
public function getView($view)
{
if (Template::exists('Form/' . $view)) {
$view = Template::getPublicTemplate('Form/' . $view);
return $view;
}
return new View($view, B8_PATH . 'Form/View/');
}
/**
* Get the correct field class for the form
*
* @param $type
* @return null|string
*/
public static function getFieldClass($type)
{
$config = b8\Config::getInstance();
$try = '\\' . $config->get('site.namespace') . '\\Form\\Element\\' . $type;
if (class_exists($try)) {
return $try;
}
$try = '\\Octo\\Form\\Element\\' . $type;
if (class_exists($try)) {
return $try;
}
$try = '\\b8\\Form\\Element\\' . $type;
if (class_exists($try)) {
return $try;
}
return null;
}
}
| {
"content_hash": "39e83ee89880537d6e743086211c2b03",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 83,
"avg_line_length": 18.688524590163933,
"alnum_prop": 0.4842105263157895,
"repo_name": "wouteradem/octo",
"id": "bc4aaed0d9cb608f64ff9bc93e25ed75af63d783",
"size": "1140",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Octo/Form.php",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "88165"
},
{
"name": "Cucumber",
"bytes": "363"
},
{
"name": "HTML",
"bytes": "42244"
},
{
"name": "JavaScript",
"bytes": "449627"
},
{
"name": "PHP",
"bytes": "230916"
}
],
"symlink_target": ""
} |
using base::UserMetricsAction;
using content::RenderViewHost;
using content::WebContents;
FullscreenController::FullscreenController(Browser* browser)
: browser_(browser),
window_(browser->window()),
profile_(browser->profile()),
fullscreened_tab_(NULL),
state_prior_to_tab_fullscreen_(STATE_INVALID),
tab_fullscreen_accepted_(false),
toggled_into_fullscreen_(false),
mouse_lock_tab_(NULL),
mouse_lock_state_(MOUSELOCK_NOT_REQUESTED),
reentrant_window_state_change_call_check_(false),
is_privileged_fullscreen_for_testing_(false),
ptr_factory_(this) {
DCHECK(window_);
DCHECK(profile_);
}
FullscreenController::~FullscreenController() {
}
bool FullscreenController::IsFullscreenForBrowser() const {
return window_->IsFullscreen() && !IsFullscreenCausedByTab();
}
void FullscreenController::ToggleBrowserFullscreenMode() {
extension_caused_fullscreen_ = GURL();
ToggleFullscreenModeInternal(BROWSER);
}
void FullscreenController::ToggleBrowserFullscreenModeWithExtension(
const GURL& extension_url) {
// |extension_caused_fullscreen_| will be reset if this causes fullscreen to
// exit.
extension_caused_fullscreen_ = extension_url;
ToggleFullscreenModeInternal(BROWSER);
}
bool FullscreenController::IsWindowFullscreenForTabOrPending() const {
return fullscreened_tab_ != NULL;
}
bool FullscreenController::IsFullscreenForTabOrPending(
const WebContents* web_contents) const {
if (web_contents == fullscreened_tab_) {
DCHECK(web_contents == browser_->tab_strip_model()->GetActiveWebContents());
DCHECK(!IsFullscreenWithinTabPossible() ||
web_contents->GetCapturerCount() == 0);
return true;
}
return IsFullscreenForCapturedTab(web_contents);
}
bool FullscreenController::IsFullscreenCausedByTab() const {
return state_prior_to_tab_fullscreen_ == STATE_NORMAL;
}
void FullscreenController::ToggleFullscreenModeForTab(WebContents* web_contents,
bool enter_fullscreen) {
if (MaybeToggleFullscreenForCapturedTab(web_contents, enter_fullscreen)) {
// During tab capture of fullscreen-within-tab views, the browser window
// fullscreen state is unchanged, so return now.
return;
}
if (fullscreened_tab_) {
if (web_contents != fullscreened_tab_)
return;
} else if (
web_contents != browser_->tab_strip_model()->GetActiveWebContents()) {
return;
}
if (IsWindowFullscreenForTabOrPending() == enter_fullscreen)
return;
#if defined(OS_WIN)
// For now, avoid breaking when initiating full screen tab mode while in
// a metro snap.
// TODO(robertshield): Find a way to reconcile tab-initiated fullscreen
// modes with metro snap.
if (IsInMetroSnapMode())
return;
#endif
bool in_browser_or_tab_fullscreen_mode = window_->IsFullscreen();
bool window_is_fullscreen_with_chrome = false;
#if defined(OS_MACOSX)
window_is_fullscreen_with_chrome = window_->IsFullscreenWithChrome();
#endif
if (enter_fullscreen) {
SetFullscreenedTab(web_contents);
if (!in_browser_or_tab_fullscreen_mode) {
state_prior_to_tab_fullscreen_ = STATE_NORMAL;
ToggleFullscreenModeInternal(TAB);
} else if (window_is_fullscreen_with_chrome) {
#if defined(OS_MACOSX)
state_prior_to_tab_fullscreen_ = STATE_BROWSER_FULLSCREEN_WITH_CHROME;
EnterFullscreenModeInternal(TAB);
#else
NOTREACHED();
#endif
} else {
state_prior_to_tab_fullscreen_ = STATE_BROWSER_FULLSCREEN_NO_CHROME;
// We need to update the fullscreen exit bubble, e.g., going from browser
// fullscreen to tab fullscreen will need to show different content.
const GURL& url = web_contents->GetURL();
if (!tab_fullscreen_accepted_) {
tab_fullscreen_accepted_ =
GetFullscreenSetting(url) == CONTENT_SETTING_ALLOW;
}
UpdateFullscreenExitBubbleContent();
// This is only a change between Browser and Tab fullscreen. We generate
// a fullscreen notification now because there is no window change.
PostFullscreenChangeNotification(true);
}
} else {
if (in_browser_or_tab_fullscreen_mode) {
if (IsFullscreenCausedByTab()) {
ToggleFullscreenModeInternal(TAB);
} else {
#if defined(OS_MACOSX)
if (state_prior_to_tab_fullscreen_ ==
STATE_BROWSER_FULLSCREEN_WITH_CHROME) {
EnterFullscreenModeInternal(BROWSER_WITH_CHROME);
} else {
// Clear the bubble URL, which forces the Mac UI to redraw.
UpdateFullscreenExitBubbleContent();
}
#endif
// If currently there is a tab in "tab fullscreen" mode and fullscreen
// was not caused by it (i.e., previously it was in "browser fullscreen"
// mode), we need to switch back to "browser fullscreen" mode. In this
// case, all we have to do is notifying the tab that it has exited "tab
// fullscreen" mode.
NotifyTabOfExitIfNecessary();
// This is only a change between Browser and Tab fullscreen. We generate
// a fullscreen notification now because there is no window change.
PostFullscreenChangeNotification(true);
}
}
}
}
bool FullscreenController::IsInMetroSnapMode() {
#if defined(OS_WIN)
return window_->IsInMetroSnapMode();
#else
return false;
#endif
}
#if defined(OS_WIN)
void FullscreenController::SetMetroSnapMode(bool enable) {
reentrant_window_state_change_call_check_ = false;
toggled_into_fullscreen_ = false;
window_->SetMetroSnapMode(enable);
// FullscreenController unit tests for metro snap assume that on Windows calls
// to WindowFullscreenStateChanged are reentrant. If that assumption is
// invalidated, the tests must be updated to maintain coverage.
CHECK(reentrant_window_state_change_call_check_);
}
#endif // defined(OS_WIN)
#if defined(OS_MACOSX)
void FullscreenController::ToggleBrowserFullscreenWithChrome() {
// This method cannot be called if simplified fullscreen is enabled.
const CommandLine* command_line = CommandLine::ForCurrentProcess();
DCHECK(!command_line->HasSwitch(switches::kEnableSimplifiedFullscreen));
ToggleFullscreenModeInternal(BROWSER_WITH_CHROME);
}
#endif
bool FullscreenController::IsMouseLockRequested() const {
return mouse_lock_state_ == MOUSELOCK_REQUESTED;
}
bool FullscreenController::IsMouseLocked() const {
return mouse_lock_state_ == MOUSELOCK_ACCEPTED ||
mouse_lock_state_ == MOUSELOCK_ACCEPTED_SILENTLY;
}
void FullscreenController::RequestToLockMouse(WebContents* web_contents,
bool user_gesture,
bool last_unlocked_by_target) {
DCHECK(!IsMouseLocked());
NotifyMouseLockChange();
// Must have a user gesture to prevent misbehaving sites from constantly
// re-locking the mouse. Exceptions are when the page has unlocked
// (i.e. not the user), or if we're in tab fullscreen (user gesture required
// for that)
if (!last_unlocked_by_target && !user_gesture &&
!IsFullscreenForTabOrPending(web_contents)) {
web_contents->GotResponseToLockMouseRequest(false);
return;
}
SetMouseLockTab(web_contents);
FullscreenExitBubbleType bubble_type = GetFullscreenExitBubbleType();
switch (GetMouseLockSetting(web_contents->GetURL())) {
case CONTENT_SETTING_ALLOW:
// If bubble already displaying buttons we must not lock the mouse yet,
// or it would prevent pressing those buttons. Instead, merge the request.
if (!IsPrivilegedFullscreenForTab() &&
fullscreen_bubble::ShowButtonsForType(bubble_type)) {
mouse_lock_state_ = MOUSELOCK_REQUESTED;
} else {
// Lock mouse.
if (web_contents->GotResponseToLockMouseRequest(true)) {
if (last_unlocked_by_target) {
mouse_lock_state_ = MOUSELOCK_ACCEPTED_SILENTLY;
} else {
mouse_lock_state_ = MOUSELOCK_ACCEPTED;
}
} else {
SetMouseLockTab(NULL);
mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED;
}
}
break;
case CONTENT_SETTING_BLOCK:
web_contents->GotResponseToLockMouseRequest(false);
SetMouseLockTab(NULL);
mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED;
break;
case CONTENT_SETTING_ASK:
mouse_lock_state_ = MOUSELOCK_REQUESTED;
break;
default:
NOTREACHED();
}
UpdateFullscreenExitBubbleContent();
}
void FullscreenController::OnTabDeactivated(WebContents* web_contents) {
if (web_contents == fullscreened_tab_ || web_contents == mouse_lock_tab_)
ExitTabFullscreenOrMouseLockIfNecessary();
}
void FullscreenController::OnTabDetachedFromView(WebContents* old_contents) {
if (!IsFullscreenForCapturedTab(old_contents))
return;
// A fullscreen-within-tab view undergoing screen capture has been detached
// and is no longer visible to the user. Set it to exactly the WebContents'
// preferred size. See 'FullscreenWithinTab Note'.
//
// When the user later selects the tab to show |old_contents| again, UI code
// elsewhere (e.g., views::WebView) will resize the view to fit within the
// browser window once again.
// If the view has been detached from the browser window (e.g., to drag a tab
// off into a new browser window), return immediately to avoid an unnecessary
// resize.
if (!old_contents->GetDelegate())
return;
// Do nothing if tab capture ended after toggling fullscreen, or a preferred
// size was never specified by the capturer.
if (old_contents->GetCapturerCount() == 0 ||
old_contents->GetPreferredSize().IsEmpty()) {
return;
}
content::RenderWidgetHostView* const current_fs_view =
old_contents->GetFullscreenRenderWidgetHostView();
if (current_fs_view)
current_fs_view->SetSize(old_contents->GetPreferredSize());
apps::ResizeWebContents(old_contents, old_contents->GetPreferredSize());
}
void FullscreenController::OnTabClosing(WebContents* web_contents) {
if (IsFullscreenForCapturedTab(web_contents)) {
RenderViewHost* const rvh = web_contents->GetRenderViewHost();
if (rvh)
rvh->ExitFullscreen();
} else if (web_contents == fullscreened_tab_ ||
web_contents == mouse_lock_tab_) {
ExitTabFullscreenOrMouseLockIfNecessary();
// The call to exit fullscreen may result in asynchronous notification of
// fullscreen state change (e.g., on Linux). We don't want to rely on it
// to call NotifyTabOfExitIfNecessary(), because at that point
// |fullscreened_tab_| may not be valid. Instead, we call it here to clean
// up tab fullscreen related state.
NotifyTabOfExitIfNecessary();
}
}
void FullscreenController::WindowFullscreenStateChanged() {
reentrant_window_state_change_call_check_ = true;
bool exiting_fullscreen = !window_->IsFullscreen();
PostFullscreenChangeNotification(!exiting_fullscreen);
if (exiting_fullscreen) {
toggled_into_fullscreen_ = false;
extension_caused_fullscreen_ = GURL();
NotifyTabOfExitIfNecessary();
}
if (exiting_fullscreen) {
window_->GetDownloadShelf()->Unhide();
} else {
window_->GetDownloadShelf()->Hide();
if (window_->GetStatusBubble())
window_->GetStatusBubble()->Hide();
}
}
bool FullscreenController::HandleUserPressedEscape() {
WebContents* const active_web_contents =
browser_->tab_strip_model()->GetActiveWebContents();
if (IsFullscreenForCapturedTab(active_web_contents)) {
RenderViewHost* const rvh = active_web_contents->GetRenderViewHost();
if (rvh)
rvh->ExitFullscreen();
return true;
} else if (IsWindowFullscreenForTabOrPending() ||
IsMouseLocked() || IsMouseLockRequested()) {
ExitTabFullscreenOrMouseLockIfNecessary();
return true;
}
return false;
}
void FullscreenController::ExitTabOrBrowserFullscreenToPreviousState() {
if (IsWindowFullscreenForTabOrPending())
ExitTabFullscreenOrMouseLockIfNecessary();
else if (IsFullscreenForBrowser())
ExitFullscreenModeInternal();
}
void FullscreenController::OnAcceptFullscreenPermission() {
FullscreenExitBubbleType bubble_type = GetFullscreenExitBubbleType();
bool mouse_lock = false;
bool fullscreen = false;
fullscreen_bubble::PermissionRequestedByType(bubble_type, &fullscreen,
&mouse_lock);
DCHECK(!(fullscreen && tab_fullscreen_accepted_));
DCHECK(!(mouse_lock && IsMouseLocked()));
HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap();
GURL url = GetFullscreenExitBubbleURL();
ContentSettingsPattern pattern = ContentSettingsPattern::FromURL(url);
if (mouse_lock && !IsMouseLocked()) {
DCHECK(IsMouseLockRequested());
// TODO(markusheintz): We should allow patterns for all possible URLs here.
if (pattern.IsValid()) {
settings_map->SetContentSetting(
pattern, ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string(),
CONTENT_SETTING_ALLOW);
}
if (mouse_lock_tab_ &&
mouse_lock_tab_->GotResponseToLockMouseRequest(true)) {
mouse_lock_state_ = MOUSELOCK_ACCEPTED;
} else {
mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED;
SetMouseLockTab(NULL);
}
NotifyMouseLockChange();
}
if (fullscreen && !tab_fullscreen_accepted_) {
DCHECK(fullscreened_tab_);
if (pattern.IsValid()) {
settings_map->SetContentSetting(
pattern, ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string(),
CONTENT_SETTING_ALLOW);
}
tab_fullscreen_accepted_ = true;
}
UpdateFullscreenExitBubbleContent();
}
void FullscreenController::OnDenyFullscreenPermission() {
if (!fullscreened_tab_ && !mouse_lock_tab_)
return;
if (IsMouseLockRequested()) {
mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED;
if (mouse_lock_tab_)
mouse_lock_tab_->GotResponseToLockMouseRequest(false);
SetMouseLockTab(NULL);
NotifyMouseLockChange();
// UpdateFullscreenExitBubbleContent() must be called, but to avoid
// duplicate calls we do so only if not adjusting the fullscreen state
// below, which also calls UpdateFullscreenExitBubbleContent().
if (!IsWindowFullscreenForTabOrPending())
UpdateFullscreenExitBubbleContent();
}
if (IsWindowFullscreenForTabOrPending())
ExitTabFullscreenOrMouseLockIfNecessary();
}
void FullscreenController::LostMouseLock() {
mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED;
SetMouseLockTab(NULL);
NotifyMouseLockChange();
UpdateFullscreenExitBubbleContent();
}
void FullscreenController::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK_EQ(content::NOTIFICATION_NAV_ENTRY_COMMITTED, type);
if (content::Details<content::LoadCommittedDetails>(details)->
is_navigation_to_different_page())
ExitTabFullscreenOrMouseLockIfNecessary();
}
GURL FullscreenController::GetFullscreenExitBubbleURL() const {
if (fullscreened_tab_)
return fullscreened_tab_->GetURL();
if (mouse_lock_tab_)
return mouse_lock_tab_->GetURL();
return extension_caused_fullscreen_;
}
FullscreenExitBubbleType FullscreenController::GetFullscreenExitBubbleType()
const {
// In kiosk and exclusive app mode we always want to be fullscreen and do not
// want to show exit instructions for browser mode fullscreen.
bool app_mode = false;
#if !defined(OS_MACOSX) // App mode (kiosk) is not available on Mac yet.
app_mode = chrome::IsRunningInAppMode();
#endif
if (mouse_lock_state_ == MOUSELOCK_ACCEPTED_SILENTLY)
return FEB_TYPE_NONE;
if (!fullscreened_tab_) {
if (IsMouseLocked())
return FEB_TYPE_MOUSELOCK_EXIT_INSTRUCTION;
if (IsMouseLockRequested())
return FEB_TYPE_MOUSELOCK_BUTTONS;
if (!extension_caused_fullscreen_.is_empty())
return FEB_TYPE_BROWSER_EXTENSION_FULLSCREEN_EXIT_INSTRUCTION;
if (toggled_into_fullscreen_ && !app_mode)
return FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION;
return FEB_TYPE_NONE;
}
if (tab_fullscreen_accepted_) {
if (IsPrivilegedFullscreenForTab())
return FEB_TYPE_NONE;
if (IsMouseLocked())
return FEB_TYPE_FULLSCREEN_MOUSELOCK_EXIT_INSTRUCTION;
if (IsMouseLockRequested())
return FEB_TYPE_MOUSELOCK_BUTTONS;
return FEB_TYPE_FULLSCREEN_EXIT_INSTRUCTION;
}
if (IsMouseLockRequested())
return FEB_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS;
return FEB_TYPE_FULLSCREEN_BUTTONS;
}
void FullscreenController::UpdateNotificationRegistrations() {
if (fullscreened_tab_ && mouse_lock_tab_)
DCHECK(fullscreened_tab_ == mouse_lock_tab_);
WebContents* tab = fullscreened_tab_ ? fullscreened_tab_ : mouse_lock_tab_;
if (tab && registrar_.IsEmpty()) {
registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::Source<content::NavigationController>(&tab->GetController()));
} else if (!tab && !registrar_.IsEmpty()) {
registrar_.RemoveAll();
}
}
void FullscreenController::PostFullscreenChangeNotification(
bool is_fullscreen) {
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&FullscreenController::NotifyFullscreenChange,
ptr_factory_.GetWeakPtr(),
is_fullscreen));
}
void FullscreenController::NotifyFullscreenChange(bool is_fullscreen) {
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_FULLSCREEN_CHANGED,
content::Source<FullscreenController>(this),
content::Details<bool>(&is_fullscreen));
}
void FullscreenController::NotifyTabOfExitIfNecessary() {
if (fullscreened_tab_) {
RenderViewHost* rvh = fullscreened_tab_->GetRenderViewHost();
SetFullscreenedTab(NULL);
state_prior_to_tab_fullscreen_ = STATE_INVALID;
tab_fullscreen_accepted_ = false;
if (rvh)
rvh->ExitFullscreen();
}
if (mouse_lock_tab_) {
if (IsMouseLockRequested()) {
mouse_lock_tab_->GotResponseToLockMouseRequest(false);
NotifyMouseLockChange();
} else {
UnlockMouse();
}
SetMouseLockTab(NULL);
mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED;
}
UpdateFullscreenExitBubbleContent();
}
void FullscreenController::NotifyMouseLockChange() {
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
content::Source<FullscreenController>(this),
content::NotificationService::NoDetails());
}
void FullscreenController::ToggleFullscreenModeInternal(
FullscreenInternalOption option) {
#if defined(OS_WIN)
// When in Metro snap mode, toggling in and out of fullscreen is prevented.
if (IsInMetroSnapMode())
return;
#endif
bool enter_fullscreen = !window_->IsFullscreen();
#if defined(OS_MACOSX)
// When a Mac user requests a toggle they may be toggling between
// FullscreenWithoutChrome and FullscreenWithChrome.
if (!IsWindowFullscreenForTabOrPending()) {
if (option == BROWSER_WITH_CHROME)
enter_fullscreen |= window_->IsFullscreenWithoutChrome();
else
enter_fullscreen |= window_->IsFullscreenWithChrome();
}
#endif
// In kiosk mode, we always want to be fullscreen. When the browser first
// starts we're not yet fullscreen, so let the initial toggle go through.
if (chrome::IsRunningInAppMode() && window_->IsFullscreen())
return;
#if !defined(OS_MACOSX)
// Do not enter fullscreen mode if disallowed by pref. This prevents the user
// from manually entering fullscreen mode and also disables kiosk mode on
// desktop platforms.
if (enter_fullscreen &&
!profile_->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) {
return;
}
#endif
if (enter_fullscreen)
EnterFullscreenModeInternal(option);
else
ExitFullscreenModeInternal();
}
void FullscreenController::EnterFullscreenModeInternal(
FullscreenInternalOption option) {
toggled_into_fullscreen_ = true;
GURL url;
if (option == TAB) {
url = browser_->tab_strip_model()->GetActiveWebContents()->GetURL();
tab_fullscreen_accepted_ =
GetFullscreenSetting(url) == CONTENT_SETTING_ALLOW;
} else {
if (!extension_caused_fullscreen_.is_empty())
url = extension_caused_fullscreen_;
}
if (option == BROWSER)
content::RecordAction(UserMetricsAction("ToggleFullscreen"));
// TODO(scheib): Record metrics for WITH_CHROME, without counting transitions
// from tab fullscreen out to browser with chrome.
#if defined(OS_MACOSX)
if (option == BROWSER_WITH_CHROME) {
CHECK(chrome::mac::SupportsSystemFullscreen());
window_->EnterFullscreenWithChrome();
} else {
#else
{
#endif
window_->EnterFullscreen(url, GetFullscreenExitBubbleType());
}
UpdateFullscreenExitBubbleContent();
// Once the window has become fullscreen it'll call back to
// WindowFullscreenStateChanged(). We don't do this immediately as
// BrowserWindow::EnterFullscreen() asks for bookmark_bar_state_, so we let
// the BrowserWindow invoke WindowFullscreenStateChanged when appropriate.
}
void FullscreenController::ExitFullscreenModeInternal() {
toggled_into_fullscreen_ = false;
#if defined(OS_MACOSX)
// Mac windows report a state change instantly, and so we must also clear
// state_prior_to_tab_fullscreen_ to match them else other logic using
// state_prior_to_tab_fullscreen_ will be incorrect.
NotifyTabOfExitIfNecessary();
#endif
window_->ExitFullscreen();
extension_caused_fullscreen_ = GURL();
UpdateFullscreenExitBubbleContent();
}
void FullscreenController::SetFullscreenedTab(WebContents* tab) {
fullscreened_tab_ = tab;
UpdateNotificationRegistrations();
}
void FullscreenController::SetMouseLockTab(WebContents* tab) {
mouse_lock_tab_ = tab;
UpdateNotificationRegistrations();
}
void FullscreenController::ExitTabFullscreenOrMouseLockIfNecessary() {
if (IsWindowFullscreenForTabOrPending())
ToggleFullscreenModeForTab(fullscreened_tab_, false);
else
NotifyTabOfExitIfNecessary();
}
void FullscreenController::UpdateFullscreenExitBubbleContent() {
GURL url = GetFullscreenExitBubbleURL();
FullscreenExitBubbleType bubble_type = GetFullscreenExitBubbleType();
// If bubble displays buttons, unlock mouse to allow pressing them.
if (fullscreen_bubble::ShowButtonsForType(bubble_type) && IsMouseLocked())
UnlockMouse();
window_->UpdateFullscreenExitBubbleContent(url, bubble_type);
}
ContentSetting
FullscreenController::GetFullscreenSetting(const GURL& url) const {
if (IsPrivilegedFullscreenForTab() || url.SchemeIsFile())
return CONTENT_SETTING_ALLOW;
return profile_->GetHostContentSettingsMap()->GetContentSetting(url, url,
CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string());
}
ContentSetting
FullscreenController::GetMouseLockSetting(const GURL& url) const {
if (IsPrivilegedFullscreenForTab() || url.SchemeIsFile())
return CONTENT_SETTING_ALLOW;
HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap();
return settings_map->GetContentSetting(url, url,
CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string());
}
bool FullscreenController::IsPrivilegedFullscreenForTab() const {
const bool embedded_widget_present =
fullscreened_tab_ &&
fullscreened_tab_->GetFullscreenRenderWidgetHostView() &&
IsFullscreenWithinTabPossible();
return embedded_widget_present || is_privileged_fullscreen_for_testing_;
}
void FullscreenController::SetPrivilegedFullscreenForTesting(
bool is_privileged) {
is_privileged_fullscreen_for_testing_ = is_privileged;
}
bool FullscreenController::IsFullscreenWithinTabPossible() const {
return implicit_cast<const content::WebContentsDelegate*>(browser_)->
EmbedsFullscreenWidget();
}
bool FullscreenController::MaybeToggleFullscreenForCapturedTab(
WebContents* web_contents, bool enter_fullscreen) {
if (!IsFullscreenWithinTabPossible())
return false;
if (enter_fullscreen) {
if (web_contents->GetCapturerCount() > 0) {
FullscreenWithinTabHelper::CreateForWebContents(web_contents);
FullscreenWithinTabHelper::FromWebContents(web_contents)->
SetIsFullscreenForCapturedTab(true);
return true;
}
} else {
if (IsFullscreenForCapturedTab(web_contents)) {
FullscreenWithinTabHelper::RemoveForWebContents(web_contents);
return true;
}
}
return false;
}
bool FullscreenController::IsFullscreenForCapturedTab(
const WebContents* web_contents) const {
// Note: On Mac, some of the OnTabXXX() methods get called with a NULL value
// for web_contents. Check for that here.
const FullscreenWithinTabHelper* const helper = web_contents ?
FullscreenWithinTabHelper::FromWebContents(web_contents) : NULL;
if (helper && helper->is_fullscreen_for_captured_tab()) {
DCHECK(IsFullscreenWithinTabPossible());
DCHECK_NE(fullscreened_tab_, web_contents);
return true;
}
return false;
}
void FullscreenController::UnlockMouse() {
if (!mouse_lock_tab_)
return;
content::RenderWidgetHostView* mouse_lock_view =
(fullscreened_tab_ == mouse_lock_tab_ && IsPrivilegedFullscreenForTab()) ?
mouse_lock_tab_->GetFullscreenRenderWidgetHostView() : NULL;
if (!mouse_lock_view) {
RenderViewHost* const rvh = mouse_lock_tab_->GetRenderViewHost();
if (rvh)
mouse_lock_view = rvh->GetView();
}
if (mouse_lock_view)
mouse_lock_view->UnlockMouse();
}
| {
"content_hash": "a17b9f68fe6acd65a2922729477867b1",
"timestamp": "",
"source": "github",
"line_count": 740,
"max_line_length": 80,
"avg_line_length": 34.50405405405405,
"alnum_prop": 0.7120980691653938,
"repo_name": "patrickm/chromium.src",
"id": "a99b0e3643a0794f5e4abb72f98f6dbec46832ac",
"size": "27130",
"binary": false,
"copies": "1",
"ref": "refs/heads/nw",
"path": "chrome/browser/ui/fullscreen/fullscreen_controller.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "853"
},
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "52960"
},
{
"name": "Awk",
"bytes": "8660"
},
{
"name": "C",
"bytes": "40737238"
},
{
"name": "C#",
"bytes": "1132"
},
{
"name": "C++",
"bytes": "207930633"
},
{
"name": "CSS",
"bytes": "939170"
},
{
"name": "Java",
"bytes": "5844934"
},
{
"name": "JavaScript",
"bytes": "17837835"
},
{
"name": "Mercury",
"bytes": "10533"
},
{
"name": "Objective-C",
"bytes": "886228"
},
{
"name": "Objective-C++",
"bytes": "6667789"
},
{
"name": "PHP",
"bytes": "97817"
},
{
"name": "Perl",
"bytes": "672770"
},
{
"name": "Python",
"bytes": "10857933"
},
{
"name": "Rebol",
"bytes": "262"
},
{
"name": "Shell",
"bytes": "1326032"
},
{
"name": "Tcl",
"bytes": "277091"
},
{
"name": "XSLT",
"bytes": "13493"
},
{
"name": "nesC",
"bytes": "15206"
}
],
"symlink_target": ""
} |
using System;
using System.Threading.Tasks;
using Microsoft.ServiceBus.Messaging;
namespace Nimbus.Infrastructure.MessageSendersAndReceivers
{
internal interface INimbusMessageReceiver : IDisposable
{
Task Start(Func<BrokeredMessage, Task> callback);
Task Stop();
}
} | {
"content_hash": "1310a891f8d18cb192df5a3947aa4f08",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 59,
"avg_line_length": 24.75,
"alnum_prop": 0.7474747474747475,
"repo_name": "sbalkum/Nimbus",
"id": "10576089615d491dd9750823be13234220b00b36",
"size": "299",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "src/Nimbus/Infrastructure/MessageSendersAndReceivers/INimbusMessageReceiver.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "106"
},
{
"name": "C#",
"bytes": "822915"
},
{
"name": "CSS",
"bytes": "685"
},
{
"name": "HTML",
"bytes": "5125"
},
{
"name": "JavaScript",
"bytes": "21032"
},
{
"name": "PowerShell",
"bytes": "21631"
}
],
"symlink_target": ""
} |
//// [privacyLocalInternalReferenceImportWithoutExport.ts]
// private elements
module m_private {
export class c_private {
}
export enum e_private {
Happy,
Grumpy
}
export function f_private() {
return new c_private();
}
export var v_private = new c_private();
export interface i_private {
}
export module mi_private {
export class c {
}
}
export module mu_private {
export interface i {
}
}
}
// Public elements
export module m_public {
export class c_public {
}
export enum e_public {
Happy,
Grumpy
}
export function f_public() {
return new c_public();
}
export var v_public = 10;
export interface i_public {
}
export module mi_public {
export class c {
}
}
export module mu_public {
export interface i {
}
}
}
export module import_public {
// No Privacy errors - importing private elements
import im_private_c_private = m_private.c_private;
import im_private_e_private = m_private.e_private;
import im_private_f_private = m_private.f_private;
import im_private_v_private = m_private.v_private;
import im_private_i_private = m_private.i_private;
import im_private_mi_private = m_private.mi_private;
import im_private_mu_private = m_private.mu_private;
// Usage of above decls
var privateUse_im_private_c_private = new im_private_c_private();
export var publicUse_im_private_c_private = new im_private_c_private();
var privateUse_im_private_e_private = im_private_e_private.Happy;
export var publicUse_im_private_e_private = im_private_e_private.Grumpy;
var privateUse_im_private_f_private = im_private_f_private();
export var publicUse_im_private_f_private = im_private_f_private();
var privateUse_im_private_v_private = im_private_v_private;
export var publicUse_im_private_v_private = im_private_v_private;
var privateUse_im_private_i_private: im_private_i_private;
export var publicUse_im_private_i_private: im_private_i_private;
var privateUse_im_private_mi_private = new im_private_mi_private.c();
export var publicUse_im_private_mi_private = new im_private_mi_private.c();
var privateUse_im_private_mu_private: im_private_mu_private.i;
export var publicUse_im_private_mu_private: im_private_mu_private.i;
// No Privacy errors - importing public elements
import im_private_c_public = m_public.c_public;
import im_private_e_public = m_public.e_public;
import im_private_f_public = m_public.f_public;
import im_private_v_public = m_public.v_public;
import im_private_i_public = m_public.i_public;
import im_private_mi_public = m_public.mi_public;
import im_private_mu_public = m_public.mu_public;
// Usage of above decls
var privateUse_im_private_c_public = new im_private_c_public();
export var publicUse_im_private_c_public = new im_private_c_public();
var privateUse_im_private_e_public = im_private_e_public.Happy;
export var publicUse_im_private_e_public = im_private_e_public.Grumpy;
var privateUse_im_private_f_public = im_private_f_public();
export var publicUse_im_private_f_public = im_private_f_public();
var privateUse_im_private_v_public = im_private_v_public;
export var publicUse_im_private_v_public = im_private_v_public;
var privateUse_im_private_i_public: im_private_i_public;
export var publicUse_im_private_i_public: im_private_i_public;
var privateUse_im_private_mi_public = new im_private_mi_public.c();
export var publicUse_im_private_mi_public = new im_private_mi_public.c();
var privateUse_im_private_mu_public: im_private_mu_public.i;
export var publicUse_im_private_mu_public: im_private_mu_public.i;
}
module import_private {
// No Privacy errors - importing private elements
import im_private_c_private = m_private.c_private;
import im_private_e_private = m_private.e_private;
import im_private_f_private = m_private.f_private;
import im_private_v_private = m_private.v_private;
import im_private_i_private = m_private.i_private;
import im_private_mi_private = m_private.mi_private;
import im_private_mu_private = m_private.mu_private;
// Usage of above decls
var privateUse_im_private_c_private = new im_private_c_private();
export var publicUse_im_private_c_private = new im_private_c_private();
var privateUse_im_private_e_private = im_private_e_private.Happy;
export var publicUse_im_private_e_private = im_private_e_private.Grumpy;
var privateUse_im_private_f_private = im_private_f_private();
export var publicUse_im_private_f_private = im_private_f_private();
var privateUse_im_private_v_private = im_private_v_private;
export var publicUse_im_private_v_private = im_private_v_private;
var privateUse_im_private_i_private: im_private_i_private;
export var publicUse_im_private_i_private: im_private_i_private;
var privateUse_im_private_mi_private = new im_private_mi_private.c();
export var publicUse_im_private_mi_private = new im_private_mi_private.c();
var privateUse_im_private_mu_private: im_private_mu_private.i;
export var publicUse_im_private_mu_private: im_private_mu_private.i;
// No privacy Error - importing public elements
import im_private_c_public = m_public.c_public;
import im_private_e_public = m_public.e_public;
import im_private_f_public = m_public.f_public;
import im_private_v_public = m_public.v_public;
import im_private_i_public = m_public.i_public;
import im_private_mi_public = m_public.mi_public;
import im_private_mu_public = m_public.mu_public;
// Usage of above decls
var privateUse_im_private_c_public = new im_private_c_public();
export var publicUse_im_private_c_public = new im_private_c_public();
var privateUse_im_private_e_public = im_private_e_public.Happy;
export var publicUse_im_private_e_public = im_private_e_public.Grumpy;
var privateUse_im_private_f_public = im_private_f_public();
export var publicUse_im_private_f_public = im_private_f_public();
var privateUse_im_private_v_public = im_private_v_public;
export var publicUse_im_private_v_public = im_private_v_public;
var privateUse_im_private_i_public: im_private_i_public;
export var publicUse_im_private_i_public: im_private_i_public;
var privateUse_im_private_mi_public = new im_private_mi_public.c();
export var publicUse_im_private_mi_public = new im_private_mi_public.c();
var privateUse_im_private_mu_public: im_private_mu_public.i;
export var publicUse_im_private_mu_public: im_private_mu_public.i;
}
//// [privacyLocalInternalReferenceImportWithoutExport.js]
define(["require", "exports"], function (require, exports) {
"use strict";
exports.__esModule = true;
// private elements
var m_private;
(function (m_private) {
var c_private = /** @class */ (function () {
function c_private() {
}
return c_private;
}());
m_private.c_private = c_private;
var e_private;
(function (e_private) {
e_private[e_private["Happy"] = 0] = "Happy";
e_private[e_private["Grumpy"] = 1] = "Grumpy";
})(e_private = m_private.e_private || (m_private.e_private = {}));
function f_private() {
return new c_private();
}
m_private.f_private = f_private;
m_private.v_private = new c_private();
var mi_private;
(function (mi_private) {
var c = /** @class */ (function () {
function c() {
}
return c;
}());
mi_private.c = c;
})(mi_private = m_private.mi_private || (m_private.mi_private = {}));
})(m_private || (m_private = {}));
// Public elements
var m_public;
(function (m_public) {
var c_public = /** @class */ (function () {
function c_public() {
}
return c_public;
}());
m_public.c_public = c_public;
var e_public;
(function (e_public) {
e_public[e_public["Happy"] = 0] = "Happy";
e_public[e_public["Grumpy"] = 1] = "Grumpy";
})(e_public = m_public.e_public || (m_public.e_public = {}));
function f_public() {
return new c_public();
}
m_public.f_public = f_public;
m_public.v_public = 10;
var mi_public;
(function (mi_public) {
var c = /** @class */ (function () {
function c() {
}
return c;
}());
mi_public.c = c;
})(mi_public = m_public.mi_public || (m_public.mi_public = {}));
})(m_public = exports.m_public || (exports.m_public = {}));
var import_public;
(function (import_public) {
// No Privacy errors - importing private elements
var im_private_c_private = m_private.c_private;
var im_private_e_private = m_private.e_private;
var im_private_f_private = m_private.f_private;
var im_private_v_private = m_private.v_private;
var im_private_mi_private = m_private.mi_private;
// Usage of above decls
var privateUse_im_private_c_private = new im_private_c_private();
import_public.publicUse_im_private_c_private = new im_private_c_private();
var privateUse_im_private_e_private = im_private_e_private.Happy;
import_public.publicUse_im_private_e_private = im_private_e_private.Grumpy;
var privateUse_im_private_f_private = im_private_f_private();
import_public.publicUse_im_private_f_private = im_private_f_private();
var privateUse_im_private_v_private = im_private_v_private;
import_public.publicUse_im_private_v_private = im_private_v_private;
var privateUse_im_private_i_private;
var privateUse_im_private_mi_private = new im_private_mi_private.c();
import_public.publicUse_im_private_mi_private = new im_private_mi_private.c();
var privateUse_im_private_mu_private;
// No Privacy errors - importing public elements
var im_private_c_public = m_public.c_public;
var im_private_e_public = m_public.e_public;
var im_private_f_public = m_public.f_public;
var im_private_v_public = m_public.v_public;
var im_private_mi_public = m_public.mi_public;
// Usage of above decls
var privateUse_im_private_c_public = new im_private_c_public();
import_public.publicUse_im_private_c_public = new im_private_c_public();
var privateUse_im_private_e_public = im_private_e_public.Happy;
import_public.publicUse_im_private_e_public = im_private_e_public.Grumpy;
var privateUse_im_private_f_public = im_private_f_public();
import_public.publicUse_im_private_f_public = im_private_f_public();
var privateUse_im_private_v_public = im_private_v_public;
import_public.publicUse_im_private_v_public = im_private_v_public;
var privateUse_im_private_i_public;
var privateUse_im_private_mi_public = new im_private_mi_public.c();
import_public.publicUse_im_private_mi_public = new im_private_mi_public.c();
var privateUse_im_private_mu_public;
})(import_public = exports.import_public || (exports.import_public = {}));
var import_private;
(function (import_private) {
// No Privacy errors - importing private elements
var im_private_c_private = m_private.c_private;
var im_private_e_private = m_private.e_private;
var im_private_f_private = m_private.f_private;
var im_private_v_private = m_private.v_private;
var im_private_mi_private = m_private.mi_private;
// Usage of above decls
var privateUse_im_private_c_private = new im_private_c_private();
import_private.publicUse_im_private_c_private = new im_private_c_private();
var privateUse_im_private_e_private = im_private_e_private.Happy;
import_private.publicUse_im_private_e_private = im_private_e_private.Grumpy;
var privateUse_im_private_f_private = im_private_f_private();
import_private.publicUse_im_private_f_private = im_private_f_private();
var privateUse_im_private_v_private = im_private_v_private;
import_private.publicUse_im_private_v_private = im_private_v_private;
var privateUse_im_private_i_private;
var privateUse_im_private_mi_private = new im_private_mi_private.c();
import_private.publicUse_im_private_mi_private = new im_private_mi_private.c();
var privateUse_im_private_mu_private;
// No privacy Error - importing public elements
var im_private_c_public = m_public.c_public;
var im_private_e_public = m_public.e_public;
var im_private_f_public = m_public.f_public;
var im_private_v_public = m_public.v_public;
var im_private_mi_public = m_public.mi_public;
// Usage of above decls
var privateUse_im_private_c_public = new im_private_c_public();
import_private.publicUse_im_private_c_public = new im_private_c_public();
var privateUse_im_private_e_public = im_private_e_public.Happy;
import_private.publicUse_im_private_e_public = im_private_e_public.Grumpy;
var privateUse_im_private_f_public = im_private_f_public();
import_private.publicUse_im_private_f_public = im_private_f_public();
var privateUse_im_private_v_public = im_private_v_public;
import_private.publicUse_im_private_v_public = im_private_v_public;
var privateUse_im_private_i_public;
var privateUse_im_private_mi_public = new im_private_mi_public.c();
import_private.publicUse_im_private_mi_public = new im_private_mi_public.c();
var privateUse_im_private_mu_public;
})(import_private || (import_private = {}));
});
//// [privacyLocalInternalReferenceImportWithoutExport.d.ts]
module m_private {
class c_private {
}
enum e_private {
Happy = 0,
Grumpy = 1
}
function f_private(): c_private;
var v_private: c_private;
interface i_private {
}
module mi_private {
class c {
}
}
module mu_private {
interface i {
}
}
}
export declare module m_public {
class c_public {
}
enum e_public {
Happy = 0,
Grumpy = 1
}
function f_public(): c_public;
var v_public: number;
interface i_public {
}
module mi_public {
class c {
}
}
module mu_public {
interface i {
}
}
}
export declare module import_public {
import im_private_c_private = m_private.c_private;
import im_private_e_private = m_private.e_private;
import im_private_i_private = m_private.i_private;
import im_private_mi_private = m_private.mi_private;
import im_private_mu_private = m_private.mu_private;
var publicUse_im_private_c_private: im_private_c_private;
var publicUse_im_private_e_private: im_private_e_private;
var publicUse_im_private_f_private: im_private_c_private;
var publicUse_im_private_v_private: im_private_c_private;
var publicUse_im_private_i_private: im_private_i_private;
var publicUse_im_private_mi_private: im_private_mi_private.c;
var publicUse_im_private_mu_private: im_private_mu_private.i;
import im_private_c_public = m_public.c_public;
import im_private_e_public = m_public.e_public;
import im_private_i_public = m_public.i_public;
import im_private_mi_public = m_public.mi_public;
import im_private_mu_public = m_public.mu_public;
var publicUse_im_private_c_public: im_private_c_public;
var publicUse_im_private_e_public: im_private_e_public;
var publicUse_im_private_f_public: im_private_c_public;
var publicUse_im_private_v_public: number;
var publicUse_im_private_i_public: im_private_i_public;
var publicUse_im_private_mi_public: im_private_mi_public.c;
var publicUse_im_private_mu_public: im_private_mu_public.i;
}
export {};
//// [DtsFileErrors]
tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.d.ts(1,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file.
==== tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.d.ts (1 errors) ====
module m_private {
~~~~~~
!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file.
class c_private {
}
enum e_private {
Happy = 0,
Grumpy = 1
}
function f_private(): c_private;
var v_private: c_private;
interface i_private {
}
module mi_private {
class c {
}
}
module mu_private {
interface i {
}
}
}
export declare module m_public {
class c_public {
}
enum e_public {
Happy = 0,
Grumpy = 1
}
function f_public(): c_public;
var v_public: number;
interface i_public {
}
module mi_public {
class c {
}
}
module mu_public {
interface i {
}
}
}
export declare module import_public {
import im_private_c_private = m_private.c_private;
import im_private_e_private = m_private.e_private;
import im_private_i_private = m_private.i_private;
import im_private_mi_private = m_private.mi_private;
import im_private_mu_private = m_private.mu_private;
var publicUse_im_private_c_private: im_private_c_private;
var publicUse_im_private_e_private: im_private_e_private;
var publicUse_im_private_f_private: im_private_c_private;
var publicUse_im_private_v_private: im_private_c_private;
var publicUse_im_private_i_private: im_private_i_private;
var publicUse_im_private_mi_private: im_private_mi_private.c;
var publicUse_im_private_mu_private: im_private_mu_private.i;
import im_private_c_public = m_public.c_public;
import im_private_e_public = m_public.e_public;
import im_private_i_public = m_public.i_public;
import im_private_mi_public = m_public.mi_public;
import im_private_mu_public = m_public.mu_public;
var publicUse_im_private_c_public: im_private_c_public;
var publicUse_im_private_e_public: im_private_e_public;
var publicUse_im_private_f_public: im_private_c_public;
var publicUse_im_private_v_public: number;
var publicUse_im_private_i_public: im_private_i_public;
var publicUse_im_private_mi_public: im_private_mi_public.c;
var publicUse_im_private_mu_public: im_private_mu_public.i;
}
export {};
| {
"content_hash": "b283275b6902a3ba1472cfee78d81789",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 172,
"avg_line_length": 43.125,
"alnum_prop": 0.6332298136645963,
"repo_name": "domchen/typescript-plus",
"id": "73266bc1d024ca3954e51f76e05c8195ae89d6d0",
"size": "19320",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AppleScript",
"bytes": "2214"
},
{
"name": "Batchfile",
"bytes": "232"
},
{
"name": "CSS",
"bytes": "253383"
},
{
"name": "CoffeeScript",
"bytes": "1712"
},
{
"name": "HTML",
"bytes": "67580"
},
{
"name": "Java",
"bytes": "1341"
},
{
"name": "JavaScript",
"bytes": "2877732"
},
{
"name": "Objective-C",
"bytes": "4435"
},
{
"name": "PowerShell",
"bytes": "2855"
},
{
"name": "Python",
"bytes": "1742"
},
{
"name": "Shell",
"bytes": "35045"
},
{
"name": "TypeScript",
"bytes": "71259278"
},
{
"name": "Vue",
"bytes": "4750"
},
{
"name": "WebAssembly",
"bytes": "219"
}
],
"symlink_target": ""
} |
package org.pentaho.di.trans.ael.websocket;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.pentaho.di.core.KettleClientEnvironment;
import org.pentaho.di.core.Props;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.logging.KettleLogStore;
import org.pentaho.di.core.logging.LogChannelInterface;
import org.pentaho.di.core.logging.LogChannelInterfaceFactory;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.pentaho.di.core.plugins.StepPluginType;
import org.pentaho.di.engine.api.remote.StopMessage;
import org.pentaho.di.junit.rules.RestorePDIEngineEnvironment;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.di.trans.step.StepMetaDataCombi;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class TransWebSocketEngineAdapterTest {
@ClassRule public static RestorePDIEngineEnvironment env = new RestorePDIEngineEnvironment();
private LogChannelInterfaceFactory logChannelFactory = mock( LogChannelInterfaceFactory.class );
private LogChannelInterface logChannel = mock( LogChannelInterface.class );
@BeforeClass
public static void init() throws Exception {
KettleClientEnvironment.init();
PluginRegistry.addPluginType( StepPluginType.getInstance() );
PluginRegistry.init();
if ( !Props.isInitialized() ) {
Props.init( 0 );
}
}
@Before
public void setUp() throws Exception {
KettleLogStore.setLogChannelInterfaceFactory( logChannelFactory );
when( logChannelFactory.create( any(), any() ) ).thenReturn( logChannel );
}
@Test
public void testOpsIncludeSubTrans() throws Exception {
TransMeta transMeta = new TransMeta( getClass().getResource( "grid-to-subtrans.ktr" ).getPath() );
TransWebSocketEngineAdapter adapter =
new TransWebSocketEngineAdapter( transMeta, "", "", false );
adapter.prepareExecution( new String[]{} );
List<StepMetaDataCombi> steps = adapter.getSteps();
steps.sort( Comparator.comparing( s -> s.stepname ) );
assertEquals( 2, steps.size() );
assertEquals( 0, steps.get( 0 ).step.subStatuses().size() );
assertEquals( 2, steps.get( 1 ).step.subStatuses().size() );
}
@Test
public void testSafeStopStaysRunningUntilStopped() throws Exception {
TransMeta transMeta = new TransMeta( getClass().getResource( "grid-to-subtrans.ktr" ).getPath() );
DaemonMessagesClientEndpoint daemonEndpoint = mock( DaemonMessagesClientEndpoint.class );
CountDownLatch latch = new CountDownLatch( 1 );
TransWebSocketEngineAdapter adapter =
new TransWebSocketEngineAdapter( transMeta, "", "", false ) {
@Override DaemonMessagesClientEndpoint getDaemonEndpoint() throws KettleException {
return daemonEndpoint;
}
@Override public void waitUntilFinished() {
try {
latch.await( 5, TimeUnit.SECONDS );
} catch ( InterruptedException e ) {
fail( e.getMessage() );
}
}
};
adapter.prepareExecution( new String[]{} );
adapter.getSteps().stream().map( stepMetaDataCombi -> stepMetaDataCombi.step )
.forEach( step -> step.setRunning( true ) );
adapter.safeStop();
StopMessage.builder()
.reasonPhrase( "User Request" )
.safeStop( true )
.build();
verify( daemonEndpoint ).sendMessage( argThat( matchesSafeStop() ) );
List<StepMetaDataCombi> steps = adapter.getSteps();
steps.stream().map( s -> s.step ).forEach( step -> assertEquals( "Halting", step.getStatus().getDescription() ) );
latch.countDown();
}
private Matcher<StopMessage> matchesSafeStop() {
return new BaseMatcher<StopMessage>() {
@Override public boolean matches( Object o ) {
return ((StopMessage) o).isSafeStop();
}
@Override public void describeTo( Description description ) {
}
};
}
}
| {
"content_hash": "d652dae76fee90634eee1ef752f7778e",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 118,
"avg_line_length": 38.06956521739131,
"alnum_prop": 0.7275011420740064,
"repo_name": "lgrill-pentaho/pentaho-kettle",
"id": "0eaf7065dcda4cdfa17c19f40507a43706c60e92",
"size": "5309",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "engine/src/test/java/org/pentaho/di/trans/ael/websocket/TransWebSocketEngineAdapterTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "41477"
},
{
"name": "CSS",
"bytes": "50137"
},
{
"name": "GAP",
"bytes": "4005"
},
{
"name": "HTML",
"bytes": "57257"
},
{
"name": "Java",
"bytes": "42923919"
},
{
"name": "JavaScript",
"bytes": "366761"
},
{
"name": "Shell",
"bytes": "45854"
}
],
"symlink_target": ""
} |
using System.Collections.Generic;
using SilverlightMappingToolBasic.UI.Extensions.Security;
namespace SilverlightMappingToolBasic.UI.SuperGraph.Controller
{
public interface ISuperGraphNodeBatchOperations
{
void CommitLocations(IEnumerable<ViewModel.Node> nodesToBeCommitted);
void CommitCollapseStates(IEnumerable<ViewModel.Node> pendingVisibilityNodes, IEnumerable<ViewModel.Node> pendingCollapseStateNodes, PermissionLevel group);
}
}
| {
"content_hash": "36bc08954e047f5791c54c9eb9239776",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 164,
"avg_line_length": 42.54545454545455,
"alnum_prop": 0.8205128205128205,
"repo_name": "chris-tomich/Glyma",
"id": "a59afe9fcb882bf23538813efc98a26340562d40",
"size": "470",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Glyma.SharePoint/SilverlightMappingToolBasic/UI/SuperGraph/Controller/ISuperGraphNodeBatchOperations.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "55793"
},
{
"name": "C#",
"bytes": "7119388"
},
{
"name": "CSS",
"bytes": "54246"
},
{
"name": "Cucumber",
"bytes": "12623"
},
{
"name": "HTML",
"bytes": "45304"
},
{
"name": "JavaScript",
"bytes": "291703"
},
{
"name": "PLpgSQL",
"bytes": "28266"
},
{
"name": "PowerShell",
"bytes": "789"
},
{
"name": "TypeScript",
"bytes": "414928"
},
{
"name": "XSLT",
"bytes": "47044"
}
],
"symlink_target": ""
} |
typedef NS_ENUM(NSUInteger, GridTheme) {
GridThemeLight = 1,
GridThemeDark,
};
#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_GRID_GRID_GRID_THEME_H_
| {
"content_hash": "39f8c1ce2ff142339001709333995292",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 73,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.7278481012658228,
"repo_name": "nwjs/chromium.src",
"id": "0944b55456096e8ee49d39d1ea6e1ca0aea30cb2",
"size": "487",
"binary": false,
"copies": "7",
"ref": "refs/heads/nw70",
"path": "ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_theme.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package demo.solstice;
import java.awt.Color;
import edu.turtlekit2.kernel.agents.Turtle;
@SuppressWarnings("serial")
public class Ant4 extends Turtle
{
double quantity = 50;
public Ant4()
{
super("searchForFood");
randomHeading();
}
@Override
public void setup() {
super.setup();
emit("nestScent", 500);
}
public String searchForFood()
{
double foodQuantity = smell("food");
if (foodQuantity > 0){
emit("food", -10);
turnLeft(180);
quantity = 50;
setColor(Color.YELLOW);
emit("foodScent", 200);
return("returnToNest");
}
else{
double foodScent = smell("foodScent");
if(smell("foodScent") <= 3)
wiggle();
else{
setHeading(getDirectionOfMaxInMyDirection("foodScent"));
if(foodScent > smellNextPatch("foodScent"))
wiggle();
else
fd(1);
}
if(quantity>0)
emit("nestScent", quantity--);
if(getPatchColor().equals(Color.RED))
emit("nestScent", 100);
return ("searchForFood");
}
}
public String returnToNest()
{
if (getPatchColor().equals(Color.red)){
setColor(Color.RED);
randomHeading();
quantity=50;
emit("nestScent", 500);
return("searchForFood");
}
else{
double nestScent = smell("nestScent");
if(nestScent <= 1)
wiggle();
else {
setHeading(getDirectionOfMaxInMyDirection("nestScent"));
if(nestScent > smellNextPatch("nestScent"))
wiggle();
else
fd(1);
}
if(quantity>0)
emit("foodScent", quantity--);
return("returnToNest");
}
}
}
| {
"content_hash": "e639030eee6806b61842934cbf036d7d",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 60,
"avg_line_length": 19.202380952380953,
"alnum_prop": 0.5957842529448233,
"repo_name": "slvrgauthier/archives",
"id": "96fe057e2c1156264cf790b169ee0b0dcd49c032",
"size": "2449",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Fac/Master/IN207/Warbot/src/demo/solstice/Ant4.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Arduino",
"bytes": "16532"
},
{
"name": "Bison",
"bytes": "2613"
},
{
"name": "C",
"bytes": "545947"
},
{
"name": "C++",
"bytes": "7373831"
},
{
"name": "CSS",
"bytes": "13822"
},
{
"name": "Eagle",
"bytes": "2204"
},
{
"name": "Gnuplot",
"bytes": "313"
},
{
"name": "HTML",
"bytes": "6509789"
},
{
"name": "Java",
"bytes": "870423"
},
{
"name": "JavaScript",
"bytes": "54438"
},
{
"name": "Makefile",
"bytes": "9082"
},
{
"name": "NetLogo",
"bytes": "106645"
},
{
"name": "NewLisp",
"bytes": "411"
},
{
"name": "PHP",
"bytes": "52799"
},
{
"name": "PostScript",
"bytes": "789175"
},
{
"name": "Prolog",
"bytes": "2935"
},
{
"name": "Python",
"bytes": "19006"
},
{
"name": "Shell",
"bytes": "7989"
},
{
"name": "TeX",
"bytes": "6452"
}
],
"symlink_target": ""
} |
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, 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:0 0
}
a:active, a:hover {
outline:0
}
b, strong {
font-weight:700
}
dfn {
font-style:italic
}
h1 {
margin:.67em 0
}
mark {
background:#ff0;
color:#000
}
sub, sup {
font-size:75%;
line-height:0;
position:relative;
vertical-align:baseline
}
sup {
top:-.5em
}
sub {
bottom:-.25em
}
img {
border:0
}
svg:not(:root) {
overflow:hidden
}
hr {
-moz-box-sizing:content-box;
box-sizing:content-box;
height:0
}
pre {
overflow:auto
}
code, kbd, pre, samp {
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[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-search-cancel-button, input[type=search]::-webkit-search-decoration {
-webkit-appearance:none
}
textarea {
overflow:auto
}
optgroup {
font-weight:700
}
table {
border-collapse:collapse;
border-spacing:0
}
td, th {
padding:0
}
@media print {
* {
text-shadow:none!important;
color:#000!important;
background:transparent!important;
box-shadow:none!important
}
a, a:visited {
text-decoration:underline
}
a[href]:after {
content:" (" attr(href)")"
}
abbr[title]:after {
content:" (" attr(title)")"
}
a[href^="javascript:"]:after, a[href^="#"]:after {
content:""
}
blockquote, pre {
border:1px solid #999;
page-break-inside:avoid
}
thead {
display:table-header-group
}
img, tr {
page-break-inside:avoid
}
img {
max-width:100%!important
}
h2, h3, p {
orphans:3;
widows:3
}
h2, h3 {
page-break-after:avoid
}
select {
background:#fff!important
}
.navbar {
display:none
}
.table td, .table th {
background-color:#fff!important
}
.btn>.caret, .dropup>.btn>.caret {
border-top-color:#000!important
}
.label {
border:1px solid #000
}
.table {
border-collapse:collapse!important
}
.table-bordered td, .table-bordered th {
border:1px solid #ddd!important
}
}
*, :after, :before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box
}
html {
font-size:62.5%;
-webkit-tap-highlight-color:transparent
}
body {
font-family:Lato, "Helvetica Neue", Arial, sans-serif;
font-size:14px;
line-height:1.42857;
color:#767676;
background-color:#f3f3f3
}
button, input, select, textarea {
font-family:inherit;
font-size:inherit;
line-height:inherit
}
a {
color:#333;
text-decoration:none
}
a:focus, a:hover {
color:#0d0d0d;
text-decoration:underline
}
a:focus {
outline:thin dotted;
outline:5px auto -webkit-focus-ring-color;
outline-offset:-2px
}
figure {
margin:0
}
img {
vertical-align:middle
}
.img-responsive {
display:block;
max-width:100%;
height:auto
}
.img-rounded {
border-radius:6px
}
.img-thumbnail {
padding:4px;
line-height:1.42857;
background-color:#f3f3f3;
border:1px solid #ddd;
border-radius:4px;
-webkit-transition:all .2s ease-in-out;
transition:all .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 #eee
}
.sr-only {
position:absolute;
width:1px;
height:1px;
margin:-1px;
padding:0;
overflow:hidden;
clip:rect(0, 0, 0, 0);
border:0
}
.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, .h1 small, .h2 .small, .h2 small, .h3 .small, .h3 small, .h4 .small, .h4 small, .h5 .small, .h5 small, .h6 .small, .h6 small, h1 .small, h1 small, h2 .small, h2 small, h3 .small, h3 small, h4 .small, h4 small, h5 .small, h5 small, h6 .small, h6 small {
font-weight:400;
line-height:1;
color:#999
}
.h1, .h2, .h3, h1, h2, 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, .h5, .h6, h4, h5, 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:200;
line-height:1.4
}
@media (min-width:768px) {
.lead {
font-size:21px
}
}
.small, small {
font-size:85%
}
cite {
font-style:normal
}
.text-left {
text-align:left
}
.text-right {
text-align:right
}
.text-center {
text-align:center
}
.text-justify {
text-align:justify
}
.text-muted {
color:#999
}
.text-primary {
color:#8E44AD
}
a.text-primary:hover {
color:#314200
}
.text-success {
color:#687F42
}
a.text-success:hover {
color:#4d5d31
}
.text-info {
color:#3B799A
}
a.text-info:hover {
color:#2d5c75
}
.text-warning {
color:#9A7E26
}
a.text-warning:hover {
color:#715d1c
}
.text-danger {
color:#A1513C
}
a.text-danger:hover {
color:#7c3e2e
}
.bg-primary {
color:#fff;
background-color:#8E44AD
}
a.bg-primary:hover {
background-color:#314200
}
.bg-success {
background-color:#F0FBE3
}
a.bg-success:hover {
background-color:#d8f5b6
}
.bg-info {
background-color:#E6F5FD
}
a.bg-info:hover {
background-color:#b7e2f9
}
.bg-warning {
background-color:#FFFAED
}
a.bg-warning:hover {
background-color:#ffecba
}
.bg-danger {
background-color:#FBE9E6
}
a.bg-danger:hover {
background-color:#f4c2ba
}
.page-header {
padding-bottom:9px;
margin:40px 0 20px;
border-bottom:1px solid #eee
}
ol, ul {
margin-top:0;
margin-bottom:10px
}
ol ol, ol ul, ul ol, ul ul {
margin-bottom:0
}
.list-inline, .list-unstyled {
padding-left:0;
list-style:none
}
.list-inline {
margin-left:-5px
}
.list-inline>li {
display:inline-block;
padding-left:5px;
padding-right:5px
}
dl {
margin-top:0;
margin-bottom:20px
}
dd, dt {
line-height:1.42857
}
dt {
font-weight:700
}
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
}
.dl-horizontal dd:after, .dl-horizontal dd:before {
content:" ";
display:table
}
.dl-horizontal dd:after {
clear:both
}
}
abbr[data-original-title], abbr[title] {
cursor:help;
border-bottom:1px dotted #999
}
.initialism {
font-size:90%;
text-transform:uppercase
}
blockquote {
padding:10px 20px;
margin:0 0 20px;
font-size:17.5px;
border-left:5px solid #eee
}
blockquote ol:last-child, blockquote p:last-child, blockquote ul:last-child {
margin-bottom:0
}
blockquote .small, blockquote footer, blockquote small {
display:block;
font-size:80%;
line-height:1.42857;
color:#999
}
blockquote .small:before, blockquote footer:before, blockquote small:before {
content:'\2014 \00A0'
}
.blockquote-reverse, blockquote.pull-right {
padding-right:15px;
padding-left:0;
border-right:5px solid #eee;
border-left:0;
text-align:right
}
.blockquote-reverse .small:before, .blockquote-reverse footer:before, .blockquote-reverse small:before, blockquote.pull-right .small:before, blockquote.pull-right footer:before, blockquote.pull-right small:before {
content:''
}
.blockquote-reverse .small:after, .blockquote-reverse footer:after, .blockquote-reverse small:after, blockquote.pull-right .small:after, blockquote.pull-right footer:after, blockquote.pull-right small:after {
content:'\00A0 \2014'
}
blockquote:after, blockquote:before {
content:""
}
address {
margin-bottom:20px;
font-style:normal;
line-height:1.42857
}
code, kbd, pre, samp {
font-family:Menlo, Monaco, Consolas, "Courier New", monospace
}
code {
padding:2px 4px;
font-size:90%;
color:#c7254e;
background-color:#f9f2f4;
white-space:nowrap;
border-radius:4px
}
kbd {
padding:2px 4px;
font-size:90%;
color:#fff;
background-color:#333;
border-radius:2px;
box-shadow:inset 0 -1px 0 rgba(0, 0, 0, .25)
}
pre {
display:block;
padding:9.5px;
margin:0 0 10px;
font-size:13px;
line-height:1.42857;
word-break:break-all;
word-wrap:break-word;
color:#333;
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
}
.container:after, .container:before {
content:" ";
display:table
}
.container:after {
clear:both
}
@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
}
.container-fluid:after, .container-fluid:before {
content:" ";
display:table
}
.container-fluid:after {
clear:both
}
.row {
margin-left:-15px;
margin-right:-15px
}
.row:after, .row:before {
content:" ";
display:table
}
.row:after {
clear:both
}
.col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .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-md-1, .col-md-10, .col-md-11, .col-md-12, .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-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .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-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .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-xsm-1, .col-xsm-10, .col-xsm-11, .col-xsm-12, .col-xsm-2, .col-xsm-3, .col-xsm-4, .col-xsm-5, .col-xsm-6, .col-xsm-7, .col-xsm-8, .col-xsm-9 {
position:relative;
min-height:1px;
padding-left:15px;
padding-right:15px
}
.col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 {
float:left
}
.col-xs-1 {
width:8.33333%
}
.col-xs-2 {
width:16.66667%
}
.col-xs-3 {
width:25%
}
.col-xs-4 {
width:33.33333%
}
.col-xs-5 {
width:41.66667%
}
.col-xs-6 {
width:50%
}
.col-xs-7 {
width:58.33333%
}
.col-xs-8 {
width:66.66667%
}
.col-xs-9 {
width:75%
}
.col-xs-10 {
width:83.33333%
}
.col-xs-11 {
width:91.66667%
}
.col-xs-12 {
width:100%
}
.col-xs-pull-0 {
right:0
}
.col-xs-pull-1 {
right:8.33333%
}
.col-xs-pull-2 {
right:16.66667%
}
.col-xs-pull-3 {
right:25%
}
.col-xs-pull-4 {
right:33.33333%
}
.col-xs-pull-5 {
right:41.66667%
}
.col-xs-pull-6 {
right:50%
}
.col-xs-pull-7 {
right:58.33333%
}
.col-xs-pull-8 {
right:66.66667%
}
.col-xs-pull-9 {
right:75%
}
.col-xs-pull-10 {
right:83.33333%
}
.col-xs-pull-11 {
right:91.66667%
}
.col-xs-pull-12 {
right:100%
}
.col-xs-push-0 {
left:0
}
.col-xs-push-1 {
left:8.33333%
}
.col-xs-push-2 {
left:16.66667%
}
.col-xs-push-3 {
left:25%
}
.col-xs-push-4 {
left:33.33333%
}
.col-xs-push-5 {
left:41.66667%
}
.col-xs-push-6 {
left:50%
}
.col-xs-push-7 {
left:58.33333%
}
.col-xs-push-8 {
left:66.66667%
}
.col-xs-push-9 {
left:75%
}
.col-xs-push-10 {
left:83.33333%
}
.col-xs-push-11 {
left:91.66667%
}
.col-xs-push-12 {
left:100%
}
.col-xs-offset-0 {
margin-left:0
}
.col-xs-offset-1 {
margin-left:8.33333%
}
.col-xs-offset-2 {
margin-left:16.66667%
}
.col-xs-offset-3 {
margin-left:25%
}
.col-xs-offset-4 {
margin-left:33.33333%
}
.col-xs-offset-5 {
margin-left:41.66667%
}
.col-xs-offset-6 {
margin-left:50%
}
.col-xs-offset-7 {
margin-left:58.33333%
}
.col-xs-offset-8 {
margin-left:66.66667%
}
.col-xs-offset-9 {
margin-left:75%
}
.col-xs-offset-10 {
margin-left:83.33333%
}
.col-xs-offset-11 {
margin-left:91.66667%
}
.col-xs-offset-12 {
margin-left:100%
}
@media (min-width:480px) {
.col-xsm-1, .col-xsm-10, .col-xsm-11, .col-xsm-12, .col-xsm-2, .col-xsm-3, .col-xsm-4, .col-xsm-5, .col-xsm-6, .col-xsm-7, .col-xsm-8, .col-xsm-9 {
float:left
}
.col-xsm-1 {
width:8.33333%
}
.col-xsm-2 {
width:16.66667%
}
.col-xsm-3 {
width:25%
}
.col-xsm-4 {
width:33.33333%
}
.col-xsm-5 {
width:41.66667%
}
.col-xsm-6 {
width:50%
}
.col-xsm-7 {
width:58.33333%
}
.col-xsm-8 {
width:66.66667%
}
.col-xsm-9 {
width:75%
}
.col-xsm-10 {
width:83.33333%
}
.col-xsm-11 {
width:91.66667%
}
.col-xsm-12 {
width:100%
}
.col-xsm-pull-0 {
right:0
}
.col-xsm-pull-1 {
right:8.33333%
}
.col-xsm-pull-2 {
right:16.66667%
}
.col-xsm-pull-3 {
right:25%
}
.col-xsm-pull-4 {
right:33.33333%
}
.col-xsm-pull-5 {
right:41.66667%
}
.col-xsm-pull-6 {
right:50%
}
.col-xsm-pull-7 {
right:58.33333%
}
.col-xsm-pull-8 {
right:66.66667%
}
.col-xsm-pull-9 {
right:75%
}
.col-xsm-pull-10 {
right:83.33333%
}
.col-xsm-pull-11 {
right:91.66667%
}
.col-xsm-pull-12 {
right:100%
}
.col-xsm-push-0 {
left:0
}
.col-xsm-push-1 {
left:8.33333%
}
.col-xsm-push-2 {
left:16.66667%
}
.col-xsm-push-3 {
left:25%
}
.col-xsm-push-4 {
left:33.33333%
}
.col-xsm-push-5 {
left:41.66667%
}
.col-xsm-push-6 {
left:50%
}
.col-xsm-push-7 {
left:58.33333%
}
.col-xsm-push-8 {
left:66.66667%
}
.col-xsm-push-9 {
left:75%
}
.col-xsm-push-10 {
left:83.33333%
}
.col-xsm-push-11 {
left:91.66667%
}
.col-xsm-push-12 {
left:100%
}
.col-xsm-offset-0 {
margin-left:0
}
.col-xsm-offset-1 {
margin-left:8.33333%
}
.col-xsm-offset-2 {
margin-left:16.66667%
}
.col-xsm-offset-3 {
margin-left:25%
}
.col-xsm-offset-4 {
margin-left:33.33333%
}
.col-xsm-offset-5 {
margin-left:41.66667%
}
.col-xsm-offset-6 {
margin-left:50%
}
.col-xsm-offset-7 {
margin-left:58.33333%
}
.col-xsm-offset-8 {
margin-left:66.66667%
}
.col-xsm-offset-9 {
margin-left:75%
}
.col-xsm-offset-10 {
margin-left:83.33333%
}
.col-xsm-offset-11 {
margin-left:91.66667%
}
.col-xsm-offset-12 {
margin-left:100%
}
}
@media (min-width:768px) {
.col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9 {
float:left
}
.col-sm-1 {
width:8.33333%
}
.col-sm-2 {
width:16.66667%
}
.col-sm-3 {
width:25%
}
.col-sm-4 {
width:33.33333%
}
.col-sm-5 {
width:41.66667%
}
.col-sm-6 {
width:50%
}
.col-sm-7 {
width:58.33333%
}
.col-sm-8 {
width:66.66667%
}
.col-sm-9 {
width:75%
}
.col-sm-10 {
width:83.33333%
}
.col-sm-11 {
width:91.66667%
}
.col-sm-12 {
width:100%
}
.col-sm-pull-0 {
right:0
}
.col-sm-pull-1 {
right:8.33333%
}
.col-sm-pull-2 {
right:16.66667%
}
.col-sm-pull-3 {
right:25%
}
.col-sm-pull-4 {
right:33.33333%
}
.col-sm-pull-5 {
right:41.66667%
}
.col-sm-pull-6 {
right:50%
}
.col-sm-pull-7 {
right:58.33333%
}
.col-sm-pull-8 {
right:66.66667%
}
.col-sm-pull-9 {
right:75%
}
.col-sm-pull-10 {
right:83.33333%
}
.col-sm-pull-11 {
right:91.66667%
}
.col-sm-pull-12 {
right:100%
}
.col-sm-push-0 {
left:0
}
.col-sm-push-1 {
left:8.33333%
}
.col-sm-push-2 {
left:16.66667%
}
.col-sm-push-3 {
left:25%
}
.col-sm-push-4 {
left:33.33333%
}
.col-sm-push-5 {
left:41.66667%
}
.col-sm-push-6 {
left:50%
}
.col-sm-push-7 {
left:58.33333%
}
.col-sm-push-8 {
left:66.66667%
}
.col-sm-push-9 {
left:75%
}
.col-sm-push-10 {
left:83.33333%
}
.col-sm-push-11 {
left:91.66667%
}
.col-sm-push-12 {
left:100%
}
.col-sm-offset-0 {
margin-left:0
}
.col-sm-offset-1 {
margin-left:8.33333%
}
.col-sm-offset-2 {
margin-left:16.66667%
}
.col-sm-offset-3 {
margin-left:25%
}
.col-sm-offset-4 {
margin-left:33.33333%
}
.col-sm-offset-5 {
margin-left:41.66667%
}
.col-sm-offset-6 {
margin-left:50%
}
.col-sm-offset-7 {
margin-left:58.33333%
}
.col-sm-offset-8 {
margin-left:66.66667%
}
.col-sm-offset-9 {
margin-left:75%
}
.col-sm-offset-10 {
margin-left:83.33333%
}
.col-sm-offset-11 {
margin-left:91.66667%
}
.col-sm-offset-12 {
margin-left:100%
}
}
@media (min-width:992px) {
.col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9 {
float:left
}
.col-md-1 {
width:8.33333%
}
.col-md-2 {
width:16.66667%
}
.col-md-3 {
width:25%
}
.col-md-4 {
width:33.33333%
}
.col-md-5 {
width:41.66667%
}
.col-md-6 {
width:50%
}
.col-md-7 {
width:58.33333%
}
.col-md-8 {
width:66.66667%
}
.col-md-9 {
width:75%
}
.col-md-10 {
width:83.33333%
}
.col-md-11 {
width:91.66667%
}
.col-md-12 {
width:100%
}
.col-md-pull-0 {
right:0
}
.col-md-pull-1 {
right:8.33333%
}
.col-md-pull-2 {
right:16.66667%
}
.col-md-pull-3 {
right:25%
}
.col-md-pull-4 {
right:33.33333%
}
.col-md-pull-5 {
right:41.66667%
}
.col-md-pull-6 {
right:50%
}
.col-md-pull-7 {
right:58.33333%
}
.col-md-pull-8 {
right:66.66667%
}
.col-md-pull-9 {
right:75%
}
.col-md-pull-10 {
right:83.33333%
}
.col-md-pull-11 {
right:91.66667%
}
.col-md-pull-12 {
right:100%
}
.col-md-push-0 {
left:0
}
.col-md-push-1 {
left:8.33333%
}
.col-md-push-2 {
left:16.66667%
}
.col-md-push-3 {
left:25%
}
.col-md-push-4 {
left:33.33333%
}
.col-md-push-5 {
left:41.66667%
}
.col-md-push-6 {
left:50%
}
.col-md-push-7 {
left:58.33333%
}
.col-md-push-8 {
left:66.66667%
}
.col-md-push-9 {
left:75%
}
.col-md-push-10 {
left:83.33333%
}
.col-md-push-11 {
left:91.66667%
}
.col-md-push-12 {
left:100%
}
.col-md-offset-0 {
margin-left:0
}
.col-md-offset-1 {
margin-left:8.33333%
}
.col-md-offset-2 {
margin-left:16.66667%
}
.col-md-offset-3 {
margin-left:25%
}
.col-md-offset-4 {
margin-left:33.33333%
}
.col-md-offset-5 {
margin-left:41.66667%
}
.col-md-offset-6 {
margin-left:50%
}
.col-md-offset-7 {
margin-left:58.33333%
}
.col-md-offset-8 {
margin-left:66.66667%
}
.col-md-offset-9 {
margin-left:75%
}
.col-md-offset-10 {
margin-left:83.33333%
}
.col-md-offset-11 {
margin-left:91.66667%
}
.col-md-offset-12 {
margin-left:100%
}
}
@media (min-width:1200px) {
.col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9 {
float:left
}
.col-lg-1 {
width:8.33333%
}
.col-lg-2 {
width:16.66667%
}
.col-lg-3 {
width:25%
}
.col-lg-4 {
width:33.33333%
}
.col-lg-5 {
width:41.66667%
}
.col-lg-6 {
width:50%
}
.col-lg-7 {
width:58.33333%
}
.col-lg-8 {
width:66.66667%
}
.col-lg-9 {
width:75%
}
.col-lg-10 {
width:83.33333%
}
.col-lg-11 {
width:91.66667%
}
.col-lg-12 {
width:100%
}
.col-lg-pull-0 {
right:0
}
.col-lg-pull-1 {
right:8.33333%
}
.col-lg-pull-2 {
right:16.66667%
}
.col-lg-pull-3 {
right:25%
}
.col-lg-pull-4 {
right:33.33333%
}
.col-lg-pull-5 {
right:41.66667%
}
.col-lg-pull-6 {
right:50%
}
.col-lg-pull-7 {
right:58.33333%
}
.col-lg-pull-8 {
right:66.66667%
}
.col-lg-pull-9 {
right:75%
}
.col-lg-pull-10 {
right:83.33333%
}
.col-lg-pull-11 {
right:91.66667%
}
.col-lg-pull-12 {
right:100%
}
.col-lg-push-0 {
left:0
}
.col-lg-push-1 {
left:8.33333%
}
.col-lg-push-2 {
left:16.66667%
}
.col-lg-push-3 {
left:25%
}
.col-lg-push-4 {
left:33.33333%
}
.col-lg-push-5 {
left:41.66667%
}
.col-lg-push-6 {
left:50%
}
.col-lg-push-7 {
left:58.33333%
}
.col-lg-push-8 {
left:66.66667%
}
.col-lg-push-9 {
left:75%
}
.col-lg-push-10 {
left:83.33333%
}
.col-lg-push-11 {
left:91.66667%
}
.col-lg-push-12 {
left:100%
}
.col-lg-offset-0 {
margin-left:0
}
.col-lg-offset-1 {
margin-left:8.33333%
}
.col-lg-offset-2 {
margin-left:16.66667%
}
.col-lg-offset-3 {
margin-left:25%
}
.col-lg-offset-4 {
margin-left:33.33333%
}
.col-lg-offset-5 {
margin-left:41.66667%
}
.col-lg-offset-6 {
margin-left:50%
}
.col-lg-offset-7 {
margin-left:58.33333%
}
.col-lg-offset-8 {
margin-left:66.66667%
}
.col-lg-offset-9 {
margin-left:75%
}
.col-lg-offset-10 {
margin-left:83.33333%
}
.col-lg-offset-11 {
margin-left:91.66667%
}
.col-lg-offset-12 {
margin-left:100%
}
}
table {
max-width:100%;
background-color:transparent
}
th {
text-align:left
}
.table {
width:100%;
margin-bottom:20px
}
.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
padding:10px;
line-height:1.42857;
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>td, .table>caption+thead>tr:first-child>th, .table>colgroup+thead>tr:first-child>td, .table>colgroup+thead>tr:first-child>th, .table>thead:first-child>tr:first-child>td, .table>thead:first-child>tr:first-child>th {
border-top:0
}
.table>tbody+tbody {
border-top:2px solid #ddd
}
.table .table {
background-color:#f3f3f3
}
.table-condensed>tbody>tr>td, .table-condensed>tbody>tr>th, .table-condensed>tfoot>tr>td, .table-condensed>tfoot>tr>th, .table-condensed>thead>tr>td, .table-condensed>thead>tr>th {
padding:5px
}
.table-bordered, .table-bordered>tbody>tr>td, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>td, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>thead>tr>th {
border:1px solid #ddd
}
.table-bordered>thead>tr>td, .table-bordered>thead>tr>th {
border-bottom-width:2px
}
.table-striped>tbody>tr:nth-child(odd)>td, .table-striped>tbody>tr:nth-child(odd)>th {
background-color:#f9f9f9
}
.table-hover>tbody>tr:hover>td, .table-hover>tbody>tr:hover>th {
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>tbody>tr.active>td, .table>tbody>tr.active>th, .table>tbody>tr>td.active, .table>tbody>tr>th.active, .table>tfoot>tr.active>td, .table>tfoot>tr.active>th, .table>tfoot>tr>td.active, .table>tfoot>tr>th.active, .table>thead>tr.active>td, .table>thead>tr.active>th, .table>thead>tr>td.active, .table>thead>tr>th.active {
background-color:#f5f5f5
}
.table-hover>tbody>tr.active:hover>td, .table-hover>tbody>tr.active:hover>th, .table-hover>tbody>tr>td.active:hover, .table-hover>tbody>tr>th.active:hover {
background-color:#e8e8e8
}
.table>tbody>tr.success>td, .table>tbody>tr.success>th, .table>tbody>tr>td.success, .table>tbody>tr>th.success, .table>tfoot>tr.success>td, .table>tfoot>tr.success>th, .table>tfoot>tr>td.success, .table>tfoot>tr>th.success, .table>thead>tr.success>td, .table>thead>tr.success>th, .table>thead>tr>td.success, .table>thead>tr>th.success {
background-color:#F0FBE3
}
.table-hover>tbody>tr.success:hover>td, .table-hover>tbody>tr.success:hover>th, .table-hover>tbody>tr>td.success:hover, .table-hover>tbody>tr>th.success:hover {
background-color:#e4f8cd
}
.table>tbody>tr.info>td, .table>tbody>tr.info>th, .table>tbody>tr>td.info, .table>tbody>tr>th.info, .table>tfoot>tr.info>td, .table>tfoot>tr.info>th, .table>tfoot>tr>td.info, .table>tfoot>tr>th.info, .table>thead>tr.info>td, .table>thead>tr.info>th, .table>thead>tr>td.info, .table>thead>tr>th.info {
background-color:#E6F5FD
}
.table-hover>tbody>tr.info:hover>td, .table-hover>tbody>tr.info:hover>th, .table-hover>tbody>tr>td.info:hover, .table-hover>tbody>tr>th.info:hover {
background-color:#ceecfb
}
.table>tbody>tr.warning>td, .table>tbody>tr.warning>th, .table>tbody>tr>td.warning, .table>tbody>tr>th.warning, .table>tfoot>tr.warning>td, .table>tfoot>tr.warning>th, .table>tfoot>tr>td.warning, .table>tfoot>tr>th.warning, .table>thead>tr.warning>td, .table>thead>tr.warning>th, .table>thead>tr>td.warning, .table>thead>tr>th.warning {
background-color:#FFFAED
}
.table-hover>tbody>tr.warning:hover>td, .table-hover>tbody>tr.warning:hover>th, .table-hover>tbody>tr>td.warning:hover, .table-hover>tbody>tr>th.warning:hover {
background-color:#fff3d4
}
.table>tbody>tr.danger>td, .table>tbody>tr.danger>th, .table>tbody>tr>td.danger, .table>tbody>tr>th.danger, .table>tfoot>tr.danger>td, .table>tfoot>tr.danger>th, .table>tfoot>tr>td.danger, .table>tfoot>tr>th.danger, .table>thead>tr.danger>td, .table>thead>tr.danger>th, .table>thead>tr>td.danger, .table>thead>tr>th.danger {
background-color:#FBE9E6
}
.table-hover>tbody>tr.danger:hover>td, .table-hover>tbody>tr.danger:hover>th, .table-hover>tbody>tr>td.danger:hover, .table-hover>tbody>tr>th.danger:hover {
background-color:#f7d6d0
}
@media (max-width:767px) {
.table-responsive {
width:100%;
margin-bottom:15px;
overflow-y:hidden;
overflow-x:scroll;
-ms-overflow-style:-ms-autohiding-scrollbar;
border:1px solid #ddd;
-webkit-overflow-scrolling:touch
}
.table-responsive>.table {
margin-bottom:0
}
.table-responsive>.table>tbody>tr>td, .table-responsive>.table>tbody>tr>th, .table-responsive>.table>tfoot>tr>td, .table-responsive>.table>tfoot>tr>th, .table-responsive>.table>thead>tr>td, .table-responsive>.table>thead>tr>th {
white-space:nowrap
}
.table-responsive>.table-bordered {
border:0
}
.table-responsive>.table-bordered>tbody>tr>td:first-child, .table-responsive>.table-bordered>tbody>tr>th:first-child, .table-responsive>.table-bordered>tfoot>tr>td:first-child, .table-responsive>.table-bordered>tfoot>tr>th:first-child, .table-responsive>.table-bordered>thead>tr>td:first-child, .table-responsive>.table-bordered>thead>tr>th:first-child {
border-left:0
}
.table-responsive>.table-bordered>tbody>tr>td:last-child, .table-responsive>.table-bordered>tbody>tr>th:last-child, .table-responsive>.table-bordered>tfoot>tr>td:last-child, .table-responsive>.table-bordered>tfoot>tr>th:last-child, .table-responsive>.table-bordered>thead>tr>td:last-child, .table-responsive>.table-bordered>thead>tr>th:last-child {
border-right:0
}
.table-responsive>.table-bordered>tbody>tr:last-child>td, .table-responsive>.table-bordered>tbody>tr:last-child>th, .table-responsive>.table-bordered>tfoot>tr:last-child>td, .table-responsive>.table-bordered>tfoot>tr:last-child>th {
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:#333;
border:0;
border-bottom:1px solid #e5e5e5
}
label {
display:inline-block;
margin-bottom:5px;
font-weight:700
}
input[type=search] {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box
}
input[type=checkbox], input[type=radio] {
margin:4px 0 0;
line-height:normal
}
input[type=file] {
display:block
}
input[type=range] {
display:block;
width:100%
}
select[multiple], select[size] {
height:auto
}
input[type=checkbox]:focus, input[type=file]:focus, input[type=radio]:focus {
outline:thin dotted;
outline:5px auto -webkit-focus-ring-color;
outline-offset:-2px
}
output {
display:block;
padding-top:7px;
font-size:14px;
line-height:1.42857;
color:#767676
}
.form-control {
display:block;
width:100%;
height:34px;
padding:6px 12px;
font-size:14px;
line-height:1.42857;
color:#767676;
background-color:#fff;
background-image:none;
border:1px solid #CBD5DD;
border-radius:4px;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s
}
.form-control:focus {
border-color:#66afe9;
outline:0;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .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[disabled], .form-control[readonly], fieldset[disabled] .form-control {
cursor:not-allowed;
background-color:#eee;
opacity:1
}
textarea.form-control {
height:auto
}
input[type=search] {
-webkit-appearance:none
}
input[type=date] {
line-height:34px
}
.form-group {
margin-bottom:15px
}
.checkbox, .radio {
display:block;
min-height:20px;
margin-top:10px;
margin-bottom:10px;
padding-left:20px
}
.checkbox label, .radio label {
display:inline;
font-weight:400;
cursor:pointer
}
.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] {
float:left;
margin-left:-20px
}
.checkbox+.checkbox, .radio+.radio {
margin-top:-5px
}
.checkbox-inline, .radio-inline {
display:inline-block;
padding-left:20px;
margin-bottom:0;
vertical-align:middle;
font-weight:400;
cursor:pointer
}
.checkbox-inline+.checkbox-inline, .radio-inline+.radio-inline {
margin-top:0;
margin-left:10px
}
.checkbox-inline[disabled], .checkbox[disabled], .radio-inline[disabled], .radio[disabled], fieldset[disabled] .checkbox, fieldset[disabled] .checkbox-inline, fieldset[disabled] .radio, fieldset[disabled] .radio-inline, fieldset[disabled] input[type=checkbox], fieldset[disabled] input[type=radio], input[type=checkbox][disabled], input[type=radio][disabled] {
cursor:not-allowed
}
.input-group-sm>.form-control, .input-group-sm>.input-group-addon, .input-group-sm>.input-group-btn>.btn, .input-sm {
height:30px;
padding:5px 10px;
font-size:12px;
line-height:1.5;
border-radius:2px
}
.input-group-sm>.input-group-btn>select.btn, .input-group-sm>select.form-control, .input-group-sm>select.input-group-addon, select.input-sm {
height:30px;
line-height:30px
}
.input-group-sm>.input-group-btn>select[multiple].btn, .input-group-sm>.input-group-btn>textarea.btn, .input-group-sm>select[multiple].form-control, .input-group-sm>select[multiple].input-group-addon, .input-group-sm>textarea.form-control, .input-group-sm>textarea.input-group-addon, select[multiple].input-sm, textarea.input-sm {
height:auto
}
.input-group-lg>.form-control, .input-group-lg>.input-group-addon, .input-group-lg>.input-group-btn>.btn, .input-lg {
height:46px;
padding:10px 16px;
font-size:18px;
line-height:1.33;
border-radius:6px
}
.input-group-lg>.input-group-btn>select.btn, .input-group-lg>select.form-control, .input-group-lg>select.input-group-addon, select.input-lg {
height:46px;
line-height:46px
}
.input-group-lg>.input-group-btn>select[multiple].btn, .input-group-lg>.input-group-btn>textarea.btn, .input-group-lg>select[multiple].form-control, .input-group-lg>select[multiple].input-group-addon, .input-group-lg>textarea.form-control, .input-group-lg>textarea.input-group-addon, select[multiple].input-lg, textarea.input-lg {
height:auto
}
.has-feedback {
position:relative
}
.has-feedback .form-control {
padding-right:42.5px
}
.has-feedback .form-control-feedback {
position:absolute;
top:25px;
right:0;
display:block;
width:34px;
height:34px;
line-height:34px;
text-align:center
}
.has-success .checkbox, .has-success .checkbox-inline, .has-success .control-label, .has-success .help-block, .has-success .radio, .has-success .radio-inline {
color:#687F42
}
.has-success .form-control {
border-color:#687F42;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075)
}
.has-success .form-control:focus {
border-color:#4d5d31;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #9cb572;
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #9cb572
}
.has-success .input-group-addon {
color:#687F42;
border-color:#687F42;
background-color:#F0FBE3
}
.has-success .form-control-feedback {
color:#687F42
}
.has-warning .checkbox, .has-warning .checkbox-inline, .has-warning .control-label, .has-warning .help-block, .has-warning .radio, .has-warning .radio-inline {
color:#9A7E26
}
.has-warning .form-control {
border-color:#9A7E26;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075)
}
.has-warning .form-control:focus {
border-color:#715d1c;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #d4b552;
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #d4b552
}
.has-warning .input-group-addon {
color:#9A7E26;
border-color:#9A7E26;
background-color:#FFFAED
}
.has-warning .form-control-feedback {
color:#9A7E26
}
.has-error .checkbox, .has-error .checkbox-inline, .has-error .control-label, .has-error .help-block, .has-error .radio, .has-error .radio-inline {
color:#A1513C
}
.has-error .form-control {
border-color:#A1513C;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075)
}
.has-error .form-control:focus {
border-color:#7c3e2e;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #cc8977;
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #cc8977
}
.has-error .input-group-addon {
color:#A1513C;
border-color:#A1513C;
background-color:#FBE9E6
}
.has-error .form-control-feedback {
color:#A1513C
}
.form-control-static {
margin-bottom:0
}
.help-block {
display:block;
margin-top:5px;
margin-bottom:10px;
color:#b6b6b6
}
@media (min-width:768px) {
.form-inline .form-group, .navbar-form .form-group {
display:inline-block;
margin-bottom:0;
vertical-align:middle
}
.form-inline .form-control, .navbar-form .form-control {
display:inline-block;
width:auto;
vertical-align:middle
}
.form-inline .input-group>.form-control, .navbar-form .input-group>.form-control {
width:100%
}
.form-inline .control-label, .navbar-form .control-label {
margin-bottom:0;
vertical-align:middle
}
.form-inline .checkbox, .form-inline .radio, .navbar-form .checkbox, .navbar-form .radio {
display:inline-block;
margin-top:0;
margin-bottom:0;
padding-left:0;
vertical-align:middle
}
.form-inline .checkbox input[type=checkbox], .form-inline .radio input[type=radio], .navbar-form .checkbox input[type=checkbox], .navbar-form .radio input[type=radio] {
float:none;
margin-left:0
}
.form-inline .has-feedback .form-control-feedback, .navbar-form .has-feedback .form-control-feedback {
top:0
}
}
.form-horizontal .checkbox, .form-horizontal .checkbox-inline, .form-horizontal .control-label, .form-horizontal .radio, .form-horizontal .radio-inline {
margin-top:0;
margin-bottom:0;
padding-top:7px
}
.form-horizontal .checkbox, .form-horizontal .radio {
min-height:27px
}
.form-horizontal .form-group {
margin-left:-15px;
margin-right:-15px
}
.form-horizontal .form-group:after, .form-horizontal .form-group:before {
content:" ";
display:table
}
.form-horizontal .form-group:after {
clear:both
}
.form-horizontal .form-control-static {
padding-top:7px
}
@media (min-width:768px) {
.form-horizontal .control-label {
text-align:right
}
}
.form-horizontal .has-feedback .form-control-feedback {
top:0;
right:15px
}
.btn {
display:inline-block;
margin-bottom:0;
font-weight:400;
text-align:center;
vertical-align:middle;
cursor:pointer;
background-image:none;
border:1px solid transparent;
white-space:nowrap;
padding:6px 12px;
font-size:14px;
line-height:1.42857;
border-radius:4px;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none
}
.btn.active:focus, .btn:active:focus, .btn:focus {
outline:thin dotted;
outline:5px auto -webkit-focus-ring-color;
outline-offset:-2px
}
.btn:focus, .btn:hover {
color:#767676;
text-decoration:none
}
.btn.active, .btn:active {
outline:0;
background-image:none;
-webkit-box-shadow:inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow:inset 0 3px 5px rgba(0, 0, 0, .125)
}
.btn.disabled, .btn[disabled], fieldset[disabled] .btn {
cursor:not-allowed;
pointer-events:none;
opacity:.65;
filter:alpha(opacity=65);
-webkit-box-shadow:none;
box-shadow:none
}
.btn-default {
color:#767676;
background-color:#fafafa;
border-color:#ededed
}
.btn-default.active, .btn-default:active, .btn-default:focus, .btn-default:hover, .open .btn-default.dropdown-toggle {
color:#767676;
background-color:#e6e6e6;
border-color:#cfcfcf
}
.btn-default.active, .btn-default:active, .open .btn-default.dropdown-toggle {
background-image:none
}
.btn-default.disabled, .btn-default.disabled.active, .btn-default.disabled:active, .btn-default.disabled:focus, .btn-default.disabled:hover, .btn-default[disabled], .btn-default[disabled].active, .btn-default[disabled]:active, .btn-default[disabled]:focus, .btn-default[disabled]:hover, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default.active, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:hover {
background-color:#fafafa;
border-color:#ededed
}
.btn-default .badge {
color:#fafafa;
background-color:#767676
}
.btn-primary {
color:#fff;
background-color:#8E44AD;
border-color:#8E44AD
}
.btn-primary.active, .btn-primary:active, .btn-primary:focus, .btn-primary:hover, .open .btn-primary.dropdown-toggle {
color:#fff;
background-color:#6D3485;
border-color:#6D3485
}
.btn-primary.active, .btn-primary:active, .open .btn-primary.dropdown-toggle {
background-image:none
}
.btn-primary.disabled, .btn-primary.disabled.active, .btn-primary.disabled:active, .btn-primary.disabled:focus, .btn-primary.disabled:hover, .btn-primary[disabled], .btn-primary[disabled].active, .btn-primary[disabled]:active, .btn-primary[disabled]:focus, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-primary.active, fieldset[disabled] .btn-primary:active, fieldset[disabled] .btn-primary:focus, fieldset[disabled] .btn-primary:hover {
background-color:#8E44AD;
border-color:#8E44AD
}
.btn-primary .badge {
color:#8E44AD;
background-color:#fff
}
.btn-success {
color:#fff;
background-color:#2ECC71;
border-color:#2ECC71
}
.btn-success.active, .btn-success:active, .btn-success:focus, .btn-success:hover, .open .btn-success.dropdown-toggle {
color:#fff;
background-color:#27AE60;
border-color:#27AE60
}
.btn-success.active, .btn-success:active, .open .btn-success.dropdown-toggle {
background-image:none
}
.btn-success.disabled, .btn-success.disabled.active, .btn-success.disabled:active, .btn-success.disabled:focus, .btn-success.disabled:hover, .btn-success[disabled], .btn-success[disabled].active, .btn-success[disabled]:active, .btn-success[disabled]:focus, .btn-success[disabled]:hover, fieldset[disabled] .btn-success, fieldset[disabled] .btn-success.active, fieldset[disabled] .btn-success:active, fieldset[disabled] .btn-success:focus, fieldset[disabled] .btn-success:hover {
background-color:#27AE60;
border-color:#75a101
}
.btn-success .badge {
color:#27AE60;
background-color:#fff
}
.btn-info {
color:#fff;
background-color:#3498DB;
border-color:#3498DB
}
.btn-info.active, .btn-info:active, .btn-info:focus, .btn-info:hover, .open .btn-info.dropdown-toggle {
color:#fff;
background-color:#2980B9;
border-color:#2980B9
}
.btn-info.active, .btn-info:active, .open .btn-info.dropdown-toggle {
background-image:none
}
.btn-info.disabled, .btn-info.disabled.active, .btn-info.disabled:active, .btn-info.disabled:focus, .btn-info.disabled:hover, .btn-info[disabled], .btn-info[disabled].active, .btn-info[disabled]:active, .btn-info[disabled]:focus, .btn-info[disabled]:hover, fieldset[disabled] .btn-info, fieldset[disabled] .btn-info.active, fieldset[disabled] .btn-info:active, fieldset[disabled] .btn-info:focus, fieldset[disabled] .btn-info:hover {
background-color:#2980B9;
border-color:#c0c73c
}
.btn-info .badge {
color:#2980B9;
background-color:#fff
}
.btn-warning {
color:#fff;
background-color:#FAC552;
border-color:#f9bd39
}
.btn-warning.active, .btn-warning:active, .btn-warning:focus, .btn-warning:hover, .open .btn-warning.dropdown-toggle {
color:#fff;
background-color:#E67E22;
border-color:#E67E22
}
.btn-warning.active, .btn-warning:active, .open .btn-warning.dropdown-toggle {
background-image:none
}
.btn-warning.disabled, .btn-warning.disabled.active, .btn-warning.disabled:active, .btn-warning.disabled:focus, .btn-warning.disabled:hover, .btn-warning[disabled], .btn-warning[disabled].active, .btn-warning[disabled]:active, .btn-warning[disabled]:focus, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning, fieldset[disabled] .btn-warning.active, fieldset[disabled] .btn-warning:active, fieldset[disabled] .btn-warning:focus, fieldset[disabled] .btn-warning:hover {
background-color:#FAC552;
border-color:#f9bd39
}
.btn-warning .badge {
color:#FAC552;
background-color:#fff
}
.btn-danger {
color:#fff;
background-color:#E9422E;
border-color:#e52e18
}
.btn-danger.active, .btn-danger:active, .btn-danger:focus, .btn-danger:hover, .open .btn-danger.dropdown-toggle {
color:#fff;
background-color:#d82b17;
border-color:#ae2312
}
.btn-danger.active, .btn-danger:active, .open .btn-danger.dropdown-toggle {
background-image:none
}
.btn-danger.disabled, .btn-danger.disabled.active, .btn-danger.disabled:active, .btn-danger.disabled:focus, .btn-danger.disabled:hover, .btn-danger[disabled], .btn-danger[disabled].active, .btn-danger[disabled]:active, .btn-danger[disabled]:focus, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger, fieldset[disabled] .btn-danger.active, fieldset[disabled] .btn-danger:active, fieldset[disabled] .btn-danger:focus, fieldset[disabled] .btn-danger:hover {
background-color:#E9422E;
border-color:#e52e18
}
.btn-danger .badge {
color:#E9422E;
background-color:#fff
}
.btn-link {
color:#333;
font-weight:400;
cursor:pointer;
border-radius:0
}
.btn-link, .btn-link:active, .btn-link[disabled], fieldset[disabled] .btn-link {
background-color:transparent;
-webkit-box-shadow:none;
box-shadow:none
}
.btn-link, .btn-link:active, .btn-link:focus, .btn-link:hover {
border-color:transparent
}
.btn-link:focus, .btn-link:hover {
color:#0d0d0d;
text-decoration:underline;
background-color:transparent
}
.btn-link[disabled]:focus, .btn-link[disabled]:hover, fieldset[disabled] .btn-link:focus, fieldset[disabled] .btn-link:hover {
color:#999;
text-decoration:none
}
.btn-group-lg>.btn, .btn-lg {
padding:10px 16px;
font-size:18px;
line-height:1.33;
border-radius:6px
}
.btn-group-sm>.btn, .btn-sm {
padding:5px 10px;
font-size:12px;
line-height:1.5;
border-radius:2px
}
.btn-group-xs>.btn, .btn-xs {
padding:1px 5px;
font-size:12px;
line-height:1.5;
border-radius:2px
}
.btn-block {
display:block;
width:100%;
padding-left:0;
padding-right:0
}
.btn-block+.btn-block {
margin-top:5px
}
input[type=button].btn-block, input[type=reset].btn-block, input[type=submit].btn-block {
width:100%
}
.fade {
opacity:0;
-webkit-transition:opacity .15s linear;
transition:opacity .15s linear
}
.fade.in {
opacity:1
}
.collapse {
display:none
}
.collapse.in {
display:block
}
.collapsing {
position:relative;
height:0;
overflow:hidden;
-webkit-transition:height .35s ease;
transition:height .35s ease
}
@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.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:400;
line-height:1;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale
}
.glyphicon-asterisk:before {
content:"\2a"
}
.glyphicon-plus:before {
content:"\2b"
}
.glyphicon-euro: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"
}
.caret {
display:inline-block;
width:0;
height:0;
margin-left:2px;
vertical-align:middle;
border-top:4px solid;
border-right:4px solid transparent;
border-left:4px solid transparent
}
.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;
background-color:#fff;
border:1px solid #ccc;
border:1px solid rgba(0, 0, 0, .15);
border-radius:4px;
-webkit-box-shadow:0 6px 12px rgba(0, 0, 0, .175);
box-shadow:0 6px 12px rgba(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:400;
line-height:1.42857;
color:#333;
white-space:nowrap
}
.dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover {
text-decoration:none;
color:#fff;
background-color:#8E44AD
}
.dropdown-menu>.active>a, .dropdown-menu>.active>a:focus, .dropdown-menu>.active>a:hover {
color:#fff;
text-decoration:none;
outline:0;
background-color:#8E44AD
}
.dropdown-menu>.disabled>a, .dropdown-menu>.disabled>a:focus, .dropdown-menu>.disabled>a:hover {
color:#999
}
.dropdown-menu>.disabled>a:focus, .dropdown-menu>.disabled>a:hover {
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.42857;
color:#999
}
.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 solid;
content:""
}
.dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu {
top:auto;
bottom:100%;
margin-bottom:1px
}
@media (min-width:768px) {
.navbar-right .dropdown-menu {
right:0;
left:auto
}
.navbar-right .dropdown-menu-left {
left:0;
right:auto
}
}
.btn-group, .btn-group-vertical {
position:relative;
display:inline-block;
vertical-align:middle
}
.btn-group-vertical>.btn, .btn-group>.btn {
position:relative;
float:left
}
.btn-group-vertical>.btn.active, .btn-group-vertical>.btn:active, .btn-group-vertical>.btn:focus, .btn-group-vertical>.btn:hover, .btn-group>.btn.active, .btn-group>.btn:active, .btn-group>.btn:focus, .btn-group>.btn:hover {
z-index:2
}
.btn-group-vertical>.btn:focus, .btn-group>.btn:focus {
outline:0
}
.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:after, .btn-toolbar:before {
content:" ";
display:table
}
.btn-toolbar:after {
clear:both
}
.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>.btn:last-child, .btn-group>.btn-group:first-child>.dropdown-toggle {
border-bottom-right-radius:0;
border-top-right-radius:0
}
.btn-group>.btn-group:last-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-lg.btn-group>.btn+.dropdown-toggle, .btn-group>.btn-lg+.dropdown-toggle {
padding-left:12px;
padding-right:12px
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow:inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow:inset 0 3px 5px rgba(0, 0, 0, .125)
}
.btn-group.open .dropdown-toggle.btn-link {
-webkit-box-shadow:none;
box-shadow:none
}
.btn .caret {
margin-left:0
}
.btn-group-lg>.btn .caret, .btn-lg .caret {
border-width:5px 5px 0;
border-bottom-width:0
}
.dropup .btn-group-lg>.btn .caret, .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:after, .btn-group-vertical>.btn-group:before {
content:" ";
display:table
}
.btn-group-vertical>.btn-group:after {
clear:both
}
.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-bottom-right-radius:0;
border-bottom-left-radius:0
}
.btn-group-vertical>.btn:last-child:not(:first-child) {
border-bottom-left-radius:4px;
border-top-right-radius:0;
border-top-left-radius:0
}
.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%
}
[data-toggle=buttons]>.btn>input[type=checkbox], [data-toggle=buttons]>.btn>input[type=radio] {
display: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, .input-group-addon, .input-group-btn {
display:table-cell
}
.input-group .form-control:not(:first-child):not(:last-child), .input-group-addon:not(:first-child):not(:last-child), .input-group-btn: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:400;
line-height:1;
color:#767676;
text-align:center;
background-color:#eee;
border:1px solid #CBD5DD;
border-radius:4px
}
.input-group-addon.input-sm, .input-group-sm>.input-group-addon, .input-group-sm>.input-group-btn>.input-group-addon.btn {
padding:5px 10px;
font-size:12px;
border-radius:2px
}
.input-group-addon.input-lg, .input-group-lg>.input-group-addon, .input-group-lg>.input-group-btn>.input-group-addon.btn {
padding:10px 16px;
font-size:18px;
border-radius:6px
}
.input-group-addon input[type=checkbox], .input-group-addon input[type=radio] {
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-group:not(:last-child)>.btn, .input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle) {
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:first-child>.btn-group:not(:first-child)>.btn, .input-group-btn:first-child>.btn:not(:first-child), .input-group-btn:last-child>.btn, .input-group-btn:last-child>.btn-group>.btn, .input-group-btn:last-child>.dropdown-toggle {
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:active, .input-group-btn>.btn:focus, .input-group-btn>.btn:hover {
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 {
margin-left:-1px
}
.nav {
margin-bottom:0;
padding-left:0;
list-style:none
}
.nav:after, .nav:before {
content:" ";
display:table
}
.nav:after {
clear:both
}
.nav>li {
position:relative;
display:block
}
.nav>li>a {
position:relative;
display:block;
padding:10px 15px
}
.nav>li>a:focus, .nav>li>a:hover {
text-decoration:none;
background-color:#eee
}
.nav>li.disabled>a {
color:#999
}
.nav>li.disabled>a:focus, .nav>li.disabled>a:hover {
color:#999;
text-decoration:none;
background-color:transparent;
cursor:not-allowed
}
.nav .open>a, .nav .open>a:focus, .nav .open>a:hover {
background-color:#eee;
border-color:#333
}
.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.42857;
border:1px solid transparent;
border-radius:4px 4px 0 0
}
.nav-tabs>li>a:hover {
border-color:#eee #eee #ddd
}
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover {
color:#555;
background-color:#f3f3f3;
border:1px solid #ddd;
border-bottom-color:transparent;
cursor:default
}
.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:focus, .nav-pills>li.active>a:hover {
color:#fff;
background-color:#8E44AD
}
.nav-stacked>li {
float:none
}
.nav-stacked>li+li {
margin-top:2px;
margin-left:0
}
.nav-justified, .nav-tabs.nav-justified {
width:100%
}
.nav-justified>li, .nav-tabs.nav-justified>li {
float:none
}
.nav-justified>li>a, .nav-tabs.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, .nav-tabs.nav-justified>li {
display:table-cell;
width:1%
}
.nav-justified>li>a, .nav-tabs.nav-justified>li>a {
margin-bottom:0
}
}
.nav-tabs-justified, .nav-tabs.nav-justified {
border-bottom:0
}
.nav-tabs-justified>li>a, .nav-tabs.nav-justified>li>a {
margin-right:0;
border-radius:4px
}
.nav-tabs-justified>.active>a, .nav-tabs-justified>.active>a:focus, .nav-tabs-justified>.active>a:hover, .nav-tabs.nav-justified>.active>a, .nav-tabs.nav-justified>.active>a:focus, .nav-tabs.nav-justified>.active>a:hover {
border:1px solid #ddd
}
@media (min-width:768px) {
.nav-tabs-justified>li>a, .nav-tabs.nav-justified>li>a {
border-bottom:1px solid #ddd;
border-radius:4px 4px 0 0
}
.nav-tabs-justified>.active>a, .nav-tabs-justified>.active>a:focus, .nav-tabs-justified>.active>a:hover, .nav-tabs.nav-justified>.active>a, .nav-tabs.nav-justified>.active>a:focus, .nav-tabs.nav-justified>.active>a:hover {
border-bottom-color:#f3f3f3
}
}
.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
}
.navbar:after, .navbar:before {
content:" ";
display:table
}
.navbar:after {
clear:both
}
@media (min-width:768px) {
.navbar {
border-radius:4px
}
}
.navbar-header:after, .navbar-header:before {
content:" ";
display:table
}
.navbar-header:after {
clear:both
}
@media (min-width:768px) {
.navbar-header {
float:left
}
}
.navbar-collapse {
max-height:340px;
overflow-x:visible;
padding-right:15px;
padding-left:15px;
border-top:1px solid transparent;
box-shadow:inset 0 1px 0 rgba(255, 255, 255, .1);
-webkit-overflow-scrolling:touch
}
.navbar-collapse:after, .navbar-collapse:before {
content:" ";
display:table
}
.navbar-collapse:after {
clear:both
}
.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-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse {
padding-left:0;
padding-right:0
}
}
.container-fluid>.navbar-collapse, .container-fluid>.navbar-header, .container>.navbar-collapse, .container>.navbar-header {
margin-right:-15px;
margin-left:-15px
}
@media (min-width:768px) {
.container-fluid>.navbar-collapse, .container-fluid>.navbar-header, .container>.navbar-collapse, .container>.navbar-header {
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-bottom, .navbar-fixed-top {
position:fixed;
right:0;
left:0;
z-index:1030
}
@media (min-width:768px) {
.navbar-fixed-bottom, .navbar-fixed-top {
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;
font-size:18px;
line-height:20px;
height:50px
}
.navbar-brand:focus, .navbar-brand:hover {
text-decoration:none
}
@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 .dropdown-header, .navbar-nav .open .dropdown-menu>li>a {
padding:5px 15px 5px 25px
}
.navbar-nav .open .dropdown-menu>li>a {
line-height:20px
}
.navbar-nav .open .dropdown-menu>li>a:focus, .navbar-nav .open .dropdown-menu>li>a:hover {
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-nav.navbar-right:last-child {
margin-right:-15px
}
}
@media (min-width:768px) {
.navbar-left {
float:left!important
}
.navbar-right {
float:right!important
}
}
.navbar-form {
margin-left:-15px;
margin-right:-15px;
padding:10px 15px;
border-top:1px solid transparent;
border-bottom:1px solid transparent;
-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
box-shadow:inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
margin-top:8px;
margin-bottom:8px
}
@media (max-width:767px) {
.navbar-form .form-group {
margin-bottom:5px
}
}
@media (min-width:768px) {
.navbar-form {
width:auto;
border:0;
margin-left:0;
margin-right:0;
padding-top:0;
padding-bottom:0;
-webkit-box-shadow:none;
box-shadow:none
}
.navbar-form.navbar-right:last-child {
margin-right:-15px
}
}
.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 {
border-bottom-right-radius:0;
border-bottom-left-radius:0
}
.navbar-btn {
margin-top:8px;
margin-bottom:8px
}
.btn-group-sm>.navbar-btn.btn, .navbar-btn.btn-sm {
margin-top:10px;
margin-bottom:10px
}
.btn-group-xs>.navbar-btn.btn, .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
}
.navbar-text.navbar-right:last-child {
margin-right:0
}
}
.navbar-default {
background-color:#f8f8f8;
border-color:#e7e7e7
}
.navbar-default .navbar-brand {
color:#777
}
.navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover {
color:#5e5e5e;
background-color:transparent
}
.navbar-default .navbar-nav>li>a, .navbar-default .navbar-text {
color:#777
}
.navbar-default .navbar-nav>li>a:focus, .navbar-default .navbar-nav>li>a:hover {
color:#333;
background-color:transparent
}
.navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:focus, .navbar-default .navbar-nav>.active>a:hover {
color:#555;
background-color:#e7e7e7
}
.navbar-default .navbar-nav>.disabled>a, .navbar-default .navbar-nav>.disabled>a:focus, .navbar-default .navbar-nav>.disabled>a:hover {
color:#ccc;
background-color:transparent
}
.navbar-default .navbar-toggle {
border-color:#ddd
}
.navbar-default .navbar-toggle:focus, .navbar-default .navbar-toggle:hover {
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:focus, .navbar-default .navbar-nav>.open>a:hover {
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:focus, .navbar-default .navbar-nav .open .dropdown-menu>li>a:hover {
color:#333;
background-color:transparent
}
.navbar-default .navbar-nav .open .dropdown-menu>.active>a, .navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus, .navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover {
color:#555;
background-color:#e7e7e7
}
.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a, .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus, .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover {
color:#ccc;
background-color:transparent
}
}
.navbar-default .navbar-link {
color:#777
}
.navbar-default .navbar-link:hover {
color:#333
}
.navbar-inverse {
background-color:#222;
border-color:#090909
}
.navbar-inverse .navbar-brand {
color:#999
}
.navbar-inverse .navbar-brand:focus, .navbar-inverse .navbar-brand:hover {
color:#fff;
background-color:transparent
}
.navbar-inverse .navbar-nav>li>a, .navbar-inverse .navbar-text {
color:#999
}
.navbar-inverse .navbar-nav>li>a:focus, .navbar-inverse .navbar-nav>li>a:hover {
color:#fff;
background-color:transparent
}
.navbar-inverse .navbar-nav>.active>a, .navbar-inverse .navbar-nav>.active>a:focus, .navbar-inverse .navbar-nav>.active>a:hover {
color:#fff;
background-color:#090909
}
.navbar-inverse .navbar-nav>.disabled>a, .navbar-inverse .navbar-nav>.disabled>a:focus, .navbar-inverse .navbar-nav>.disabled>a:hover {
color:#444;
background-color:transparent
}
.navbar-inverse .navbar-toggle {
border-color:#333
}
.navbar-inverse .navbar-toggle:focus, .navbar-inverse .navbar-toggle:hover {
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:focus, .navbar-inverse .navbar-nav>.open>a:hover {
background-color:#090909;
color:#fff
}
@media (max-width:767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header {
border-color:#090909
}
.navbar-inverse .navbar-nav .open .dropdown-menu .divider {
background-color:#090909
}
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a {
color:#999
}
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover {
color:#fff;
background-color:transparent
}
.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a, .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover {
color:#fff;
background-color:#090909
}
.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a, .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover {
color:#444;
background-color:transparent
}
}
.navbar-inverse .navbar-link {
color:#999
}
.navbar-inverse .navbar-link:hover {
color:#fff
}
.breadcrumb {
padding:8px 15px;
margin-bottom:20px;
list-style:none;
background-color:#f6f6f6;
border-radius:4px
}
.breadcrumb>li {
display:inline-block
}
.breadcrumb>li+li:before {
content:"/ ";
padding:0 5px;
color:#e9e9e9
}
.breadcrumb>.active {
color:#999
}
.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.42857;
text-decoration:none;
color:#333;
background-color:#f6f6f6;
border:1px solid #f6f6f6;
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:focus, .pagination>li>a:hover, .pagination>li>span:focus, .pagination>li>span:hover {
color:#8E44AD;
background-color:#fff;
border-color:#8E44AD
}
.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover {
z-index:2;
color:#fff;
background-color:#8E44AD;
border-color:#8E44AD;
cursor:default
}
.pagination>.disabled>a, .pagination>.disabled>a:focus, .pagination>.disabled>a:hover, .pagination>.disabled>span, .pagination>.disabled>span:focus, .pagination>.disabled>span:hover {
color:#999;
background-color:#f6f6f6;
border-color:#f6f6f6;
cursor:not-allowed
}
.pagination-lg>li>a, .pagination-lg>li>span {
padding:10px 16px;
font-size:18px
}
.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
}
.pagination-sm>li:first-child>a, .pagination-sm>li:first-child>span {
border-bottom-left-radius:2px;
border-top-left-radius:2px
}
.pagination-sm>li:last-child>a, .pagination-sm>li:last-child>span {
border-bottom-right-radius:2px;
border-top-right-radius:2px
}
.pager {
padding-left:0;
margin:20px 0;
list-style:none;
text-align:center
}
.pager:after, .pager:before {
content:" ";
display:table
}
.pager:after {
clear:both
}
.pager li {
display:inline
}
.pager li>a, .pager li>span {
display:inline-block;
padding:5px 14px;
background-color:#f6f6f6;
border:1px solid #f6f6f6;
border-radius:15px
}
.pager li>a:focus, .pager li>a:hover {
text-decoration:none;
background-color:#fff
}
.pager .next>a, .pager .next>span {
float:right
}
.pager .previous>a, .pager .previous>span {
float:left
}
.pager .disabled>a, .pager .disabled>a:focus, .pager .disabled>a:hover, .pager .disabled>span {
color:#999;
background-color:#f6f6f6;
cursor:not-allowed
}
.label {
display:inline;
padding:.2em .6em .3em;
font-size:75%;
font-weight:700;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius:4px
}
.label[href]:focus, .label[href]:hover {
color:#fff;
text-decoration:none;
cursor:pointer
}
.label:empty {
display:none
}
.btn .label {
position:relative;
top:-1px
}
.label-default {
background-color:#999
}
.label-default[href]:focus, .label-default[href]:hover {
background-color:gray
}
.label-primary {
background-color:#8E44AD
}
.label-primary[href]:focus, .label-primary[href]:hover {
background-color:#314200
}
.label-success {
background-color:#27AE60
}
.label-success[href]:focus, .label-success[href]:hover {
background-color:#628701
}
.label-info {
background-color:#2980B9
}
.label-info[href]:focus, .label-info[href]:hover {
background-color:#afb634
}
.label-warning {
background-color:#FAC552
}
.label-warning[href]:focus, .label-warning[href]:hover {
background-color:#f9b420
}
.label-danger {
background-color:#E9422E
}
.label-danger[href]:focus, .label-danger[href]:hover {
background-color:#ce2916
}
.badge {
display:inline-block;
min-width:10px;
padding:3px 7px;
font-size:12px;
font-weight:700;
color:#fff;
line-height:1;
vertical-align:baseline;
white-space:nowrap;
text-align:center;
background-color:#999;
border-radius:10px
}
.badge:empty {
display:none
}
.btn .badge {
position:relative;
top:-1px
}
.btn-group-xs>.btn .badge, .btn-xs .badge {
top:0;
padding:1px 5px
}
a.badge:focus, a.badge:hover {
color:#fff;
text-decoration:none;
cursor:pointer
}
.nav-pills>.active>a>.badge, a.list-group-item.active>.badge {
color:#333;
background-color:#fff
}
.nav-pills>li>a>.badge {
margin-left:3px
}
.jumbotron {
padding:30px;
margin-bottom:30px;
color:inherit;
background-color:#eee
}
.jumbotron .h1, .jumbotron h1 {
color:inherit
}
.jumbotron p {
margin-bottom:15px;
font-size:21px;
font-weight:200
}
.container .jumbotron {
border-radius:6px
}
.jumbotron .container {
max-width:100%
}
@media screen and (min-width:768px) {
.jumbotron {
padding-top:48px;
padding-bottom:48px
}
.container .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.42857;
background-color:#f3f3f3;
border:1px solid #ddd;
border-radius:4px;
-webkit-transition:all .2s ease-in-out;
transition:all .2s ease-in-out
}
.thumbnail a>img, .thumbnail>img {
display:block;
max-width:100%;
height:auto;
margin-left:auto;
margin-right:auto
}
.thumbnail .caption {
padding:9px;
color:#767676
}
a.thumbnail.active, a.thumbnail:focus, a.thumbnail:hover {
border-color:#333
}
.alert {
padding:15px;
margin-bottom:20px;
border:1px solid transparent;
border-radius:4px
}
.alert h4 {
margin-top:0;
color:inherit
}
.alert .alert-link {
font-weight:700
}
.alert>p, .alert>ul {
margin-bottom:0
}
.alert>p+p {
margin-top:5px
}
.alert-dismissable {
padding-right:35px
}
.alert-dismissable .close {
position:relative;
top:-2px;
right:-21px;
color:inherit
}
.alert-success {
background-color:#F0FBE3;
border-color:#ebf8cd;
color:#687F42
}
.alert-success hr {
border-top-color:#e2f5b6
}
.alert-success .alert-link {
color:#4d5d31
}
.alert-info {
background-color:#E6F5FD;
border-color:#c5f1fa;
color:#3B799A
}
.alert-info hr {
border-top-color:#adebf8
}
.alert-info .alert-link {
color:#2d5c75
}
.alert-warning {
background-color:#FFFAED;
border-color:#ffecd4;
color:#9A7E26
}
.alert-warning hr {
border-top-color:#ffe0ba
}
.alert-warning .alert-link {
color:#715d1c
}
.alert-danger {
background-color:#FBE9E6;
border-color:#f7d0d1;
color:#A1513C
}
.alert-danger hr {
border-top-color:#f4babb
}
.alert-danger .alert-link {
color:#7c3e2e
}
@-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;
-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, .1);
box-shadow:inset 0 1px 2px rgba(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:#8E44AD;
-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, .15);
box-shadow:inset 0 -1px 0 rgba(0, 0, 0, .15);
-webkit-transition:width .6s ease;
transition:width .6s ease
}
.progress-striped .progress-bar {
background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-image:linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-size:40px 40px
}
.progress.active .progress-bar {
-webkit-animation:progress-bar-stripes 2s linear infinite;
animation:progress-bar-stripes 2s linear infinite
}
.progress-bar-success {
background-color:#27AE60
}
.progress-striped .progress-bar-success {
background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-image:linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent)
}
.progress-bar-info {
background-color:#2980B9
}
.progress-striped .progress-bar-info {
background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-image:linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent)
}
.progress-bar-warning {
background-color:#FAC552
}
.progress-striped .progress-bar-warning {
background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-image:linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent)
}
.progress-bar-danger {
background-color:#E9422E
}
.progress-striped .progress-bar-danger {
background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-image:linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent)
}
.media, .media-body {
overflow:hidden;
zoom:1
}
.media, .media .media {
margin-top:15px
}
.media:first-child {
margin-top:0
}
.media-object {
display:block
}
.media-heading {
margin:0 0 5px
}
.media>.pull-left {
margin-right:10px
}
.media>.pull-right {
margin-left:10px
}
.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
}
.list-group-item>.badge {
float:right
}
.list-group-item>.badge+.badge {
margin-right:5px
}
a.list-group-item {
color:#555
}
a.list-group-item .list-group-item-heading {
color:#333
}
a.list-group-item:focus, a.list-group-item:hover {
text-decoration:none;
background-color:#f5f5f5
}
a.list-group-item.active, a.list-group-item.active:focus, a.list-group-item.active:hover {
z-index:2;
color:#fff;
background-color:#8E44AD;
border-color:#8E44AD
}
a.list-group-item.active .list-group-item-heading, a.list-group-item.active:focus .list-group-item-heading, a.list-group-item.active:hover .list-group-item-heading {
color:inherit
}
a.list-group-item.active .list-group-item-text, a.list-group-item.active:focus .list-group-item-text, a.list-group-item.active:hover .list-group-item-text {
color:#cdff42
}
.list-group-item-success {
color:#687F42;
background-color:#F0FBE3
}
a.list-group-item-success {
color:#687F42
}
a.list-group-item-success .list-group-item-heading {
color:inherit
}
a.list-group-item-success:focus, a.list-group-item-success:hover {
color:#687F42;
background-color:#e4f8cd
}
a.list-group-item-success.active, a.list-group-item-success.active:focus, a.list-group-item-success.active:hover {
color:#fff;
background-color:#687F42;
border-color:#687F42
}
.list-group-item-info {
color:#3B799A;
background-color:#E6F5FD
}
a.list-group-item-info {
color:#3B799A
}
a.list-group-item-info .list-group-item-heading {
color:inherit
}
a.list-group-item-info:focus, a.list-group-item-info:hover {
color:#3B799A;
background-color:#ceecfb
}
a.list-group-item-info.active, a.list-group-item-info.active:focus, a.list-group-item-info.active:hover {
color:#fff;
background-color:#3B799A;
border-color:#3B799A
}
.list-group-item-warning {
color:#9A7E26;
background-color:#FFFAED
}
a.list-group-item-warning {
color:#9A7E26
}
a.list-group-item-warning .list-group-item-heading {
color:inherit
}
a.list-group-item-warning:focus, a.list-group-item-warning:hover {
color:#9A7E26;
background-color:#fff3d4
}
a.list-group-item-warning.active, a.list-group-item-warning.active:focus, a.list-group-item-warning.active:hover {
color:#fff;
background-color:#9A7E26;
border-color:#9A7E26
}
.list-group-item-danger {
color:#A1513C;
background-color:#FBE9E6
}
a.list-group-item-danger {
color:#A1513C
}
a.list-group-item-danger .list-group-item-heading {
color:inherit
}
a.list-group-item-danger:focus, a.list-group-item-danger:hover {
color:#A1513C;
background-color:#f7d6d0
}
a.list-group-item-danger.active, a.list-group-item-danger.active:focus, a.list-group-item-danger.active:hover {
color:#fff;
background-color:#A1513C;
border-color:#A1513C
}
.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;
-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, .05);
box-shadow:0 1px 1px rgba(0, 0, 0, .05)
}
.panel-body {
padding:15px
}
.panel-body:after, .panel-body:before {
content:" ";
display:table
}
.panel-body:after {
clear:both
}
.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 {
color:inherit
}
.panel-footer {
padding:10px 15px;
background-color:#fafafa;
border-top:1px solid #e9e9e9;
border-bottom-right-radius:3px;
border-bottom-left-radius:3px
}
.panel>.list-group {
margin-bottom:0
}
.panel>.list-group .list-group-item {
border-width:1px 0;
border-radius:0
}
.panel>.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 {
border-bottom:0;
border-bottom-right-radius:3px;
border-bottom-left-radius:3px
}
.panel-heading+.list-group .list-group-item:first-child {
border-top-width:0
}
.panel>.table, .panel>.table-responsive>.table {
margin-bottom:0
}
.panel>.table-responsive:first-child>.table:first-child, .panel>.table:first-child {
border-top-right-radius:3px;
border-top-left-radius:3px
}
.panel>.table-responsive:first-child>.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 th:first-child, .panel>.table-responsive:first-child>.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 th:first-child, .panel>.table:first-child>tbody:first-child>tr:first-child td:first-child, .panel>.table:first-child>tbody:first-child>tr:first-child th:first-child, .panel>.table:first-child>thead:first-child>tr:first-child td:first-child, .panel>.table:first-child>thead:first-child>tr:first-child th:first-child {
border-top-left-radius:3px
}
.panel>.table-responsive:first-child>.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 th:last-child, .panel>.table-responsive:first-child>.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 th:last-child, .panel>.table:first-child>tbody:first-child>tr:first-child td:last-child, .panel>.table:first-child>tbody:first-child>tr:first-child th:last-child, .panel>.table:first-child>thead:first-child>tr:first-child td:last-child, .panel>.table:first-child>thead:first-child>tr:first-child th:last-child {
border-top-right-radius:3px
}
.panel>.table-responsive:last-child>.table:last-child, .panel>.table:last-child {
border-bottom-right-radius:3px;
border-bottom-left-radius:3px
}
.panel>.table-responsive:last-child>.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 th:first-child, .panel>.table-responsive:last-child>.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 th:first-child, .panel>.table:last-child>tbody:last-child>tr:last-child td:first-child, .panel>.table:last-child>tbody:last-child>tr:last-child th:first-child, .panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child, .panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child {
border-bottom-left-radius:3px
}
.panel>.table-responsive:last-child>.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 th:last-child, .panel>.table-responsive:last-child>.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 th:last-child, .panel>.table:last-child>tbody:last-child>tr:last-child td:last-child, .panel>.table:last-child>tbody:last-child>tr:last-child th:last-child, .panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child, .panel>.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 {
border-top:1px solid #ddd
}
.panel>.table>tbody:first-child>tr:first-child td, .panel>.table>tbody:first-child>tr:first-child th {
border-top:0
}
.panel>.table-bordered, .panel>.table-responsive>.table-bordered {
border:0
}
.panel>.table-bordered>tbody>tr>td:first-child, .panel>.table-bordered>tbody>tr>th:first-child, .panel>.table-bordered>tfoot>tr>td:first-child, .panel>.table-bordered>tfoot>tr>th:first-child, .panel>.table-bordered>thead>tr>td:first-child, .panel>.table-bordered>thead>tr>th:first-child, .panel>.table-responsive>.table-bordered>tbody>tr>td:first-child, .panel>.table-responsive>.table-bordered>tbody>tr>th:first-child, .panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child, .panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child, .panel>.table-responsive>.table-bordered>thead>tr>td:first-child, .panel>.table-responsive>.table-bordered>thead>tr>th:first-child {
border-left:0
}
.panel>.table-bordered>tbody>tr>td:last-child, .panel>.table-bordered>tbody>tr>th:last-child, .panel>.table-bordered>tfoot>tr>td:last-child, .panel>.table-bordered>tfoot>tr>th:last-child, .panel>.table-bordered>thead>tr>td:last-child, .panel>.table-bordered>thead>tr>th:last-child, .panel>.table-responsive>.table-bordered>tbody>tr>td:last-child, .panel>.table-responsive>.table-bordered>tbody>tr>th:last-child, .panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child, .panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child, .panel>.table-responsive>.table-bordered>thead>tr>td:last-child, .panel>.table-responsive>.table-bordered>thead>tr>th:last-child {
border-right:0
}
.panel>.table-bordered>tbody>tr:first-child>td, .panel>.table-bordered>tbody>tr:first-child>th, .panel>.table-bordered>tbody>tr:last-child>td, .panel>.table-bordered>tbody>tr:last-child>th, .panel>.table-bordered>tfoot>tr:last-child>td, .panel>.table-bordered>tfoot>tr:last-child>th, .panel>.table-bordered>thead>tr:first-child>td, .panel>.table-bordered>thead>tr:first-child>th, .panel>.table-responsive>.table-bordered>tbody>tr:first-child>td, .panel>.table-responsive>.table-bordered>tbody>tr:first-child>th, .panel>.table-responsive>.table-bordered>tbody>tr:last-child>td, .panel>.table-responsive>.table-bordered>tbody>tr:last-child>th, .panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td, .panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th, .panel>.table-responsive>.table-bordered>thead>tr:first-child>td, .panel>.table-responsive>.table-bordered>thead>tr:first-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;
overflow:hidden
}
.panel-group .panel+.panel {
margin-top:5px
}
.panel-group .panel-heading {
border-bottom:0
}
.panel-group .panel-heading+.panel-collapse .panel-body {
border-top:1px solid #e9e9e9
}
.panel-group .panel-footer {
border-top:0
}
.panel-group .panel-footer+.panel-collapse .panel-body {
border-bottom:1px solid #e9e9e9
}
.panel-default {
border-color:#e9e9e9
}
.panel-default>.panel-heading {
color:#767676;
background-color:#f6f6f6;
border-color:#e9e9e9
}
.panel-default>.panel-heading+.panel-collapse .panel-body {
border-top-color:#e9e9e9
}
.panel-default>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#e9e9e9
}
.panel-primary {
border-color:#8E44AD
}
.panel-primary>.panel-heading {
color:#fff;
background-color:#8E44AD;
border-color:#8E44AD
}
.panel-primary>.panel-heading+.panel-collapse .panel-body {
border-top-color:#8E44AD
}
.panel-primary>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#8E44AD
}
.panel-success {
border-color:#ebf8cd
}
.panel-success>.panel-heading {
color:#687F42;
background-color:#F0FBE3;
border-color:#ebf8cd
}
.panel-success>.panel-heading+.panel-collapse .panel-body {
border-top-color:#ebf8cd
}
.panel-success>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#ebf8cd
}
.panel-info {
border-color:#c5f1fa
}
.panel-info>.panel-heading {
color:#3B799A;
background-color:#E6F5FD;
border-color:#c5f1fa
}
.panel-info>.panel-heading+.panel-collapse .panel-body {
border-top-color:#c5f1fa
}
.panel-info>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#c5f1fa
}
.panel-warning {
border-color:#ffecd4
}
.panel-warning>.panel-heading {
color:#9A7E26;
background-color:#FFFAED;
border-color:#ffecd4
}
.panel-warning>.panel-heading+.panel-collapse .panel-body {
border-top-color:#ffecd4
}
.panel-warning>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#ffecd4
}
.panel-danger {
border-color:#f7d0d1
}
.panel-danger>.panel-heading {
color:#A1513C;
background-color:#FBE9E6;
border-color:#f7d0d1
}
.panel-danger>.panel-heading+.panel-collapse .panel-body {
border-top-color:#f7d0d1
}
.panel-danger>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#f7d0d1
}
.well {
min-height:20px;
padding:19px;
margin-bottom:20px;
background-color:#f5f5f5;
border:1px solid #e3e3e3;
border-radius:4px;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .05);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .05)
}
.well blockquote {
border-color:#ddd;
border-color:rgba(0, 0, 0, .15)
}
.well-lg {
padding:24px;
border-radius:6px
}
.well-sm {
padding:9px;
border-radius:2px
}
.close {
float:right;
font-size:21px;
font-weight:700;
line-height:1;
color:#000;
text-shadow:0 1px 0 #fff;
opacity:.2;
filter:alpha(opacity=20)
}
.close:focus, .close:hover {
color:#000;
text-decoration:none;
cursor:pointer;
opacity:.5;
filter:alpha(opacity=50)
}
button.close {
padding:0;
cursor:pointer;
background:0 0;
border:0;
-webkit-appearance:none
}
.modal-open {
overflow:hidden
}
.modal {
display:none;
overflow:auto;
overflow-y:scroll;
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%);
-ms-transform:translate(0, -25%);
transform:translate(0, -25%);
-webkit-transition:-webkit-transform .3s ease-out;
-moz-transition:-moz-transform .3s ease-out;
-o-transition:-o-transform .3s ease-out;
transition:transform .3s ease-out
}
.modal.in .modal-dialog {
-webkit-transform:translate(0, 0);
-ms-transform:translate(0, 0);
transform:translate(0, 0)
}
.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, .2);
border-radius:6px;
-webkit-box-shadow:0 3px 9px rgba(0, 0, 0, .5);
box-shadow:0 3px 9px rgba(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:.5;
filter:alpha(opacity=50)
}
.modal-header {
padding:15px;
border-bottom:1px solid #e5e5e5;
min-height:16.43px
}
.modal-header .close {
margin-top:-2px
}
.modal-title {
margin:0;
line-height:1.42857
}
.modal-body {
position:relative;
padding:20px
}
.modal-footer {
margin-top:15px;
padding:19px 20px 20px;
text-align:right;
border-top:1px solid #e5e5e5
}
.modal-footer:after, .modal-footer:before {
content:" ";
display:table
}
.modal-footer:after {
clear:both
}
.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
}
@media (min-width:768px) {
.modal-dialog {
width:600px;
margin:30px auto
}
.modal-content {
-webkit-box-shadow:0 5px 15px rgba(0, 0, 0, .5);
box-shadow:0 5px 15px rgba(0, 0, 0, .5)
}
.modal-sm {
width:300px
}
}
@media (min-width:992px) {
.modal-lg {
width:900px
}
}
.tooltip {
position:absolute;
z-index:1030;
display:block;
visibility:visible;
font-size:12px;
line-height:1.4;
opacity:0;
filter:alpha(opacity=0)
}
.tooltip.in {
opacity:.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;
text-decoration:none;
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;
left:5px;
border-width:5px 5px 0;
border-top-color:#000
}
.tooltip.top-right .tooltip-arrow {
bottom:0;
right: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;
left:5px;
border-width:0 5px 5px;
border-bottom-color:#000
}
.tooltip.bottom-right .tooltip-arrow {
top:0;
right:5px;
border-width:0 5px 5px;
border-bottom-color:#000
}
.popover {
position:absolute;
top:0;
left:0;
z-index:1010;
display:none;
max-width:276px;
padding:1px;
text-align:left;
background-color:#242633;
background-clip:padding-box;
border:1px solid #242633;
border:1px solid #242633;
border-radius:6px;
-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, .2);
box-shadow:0 5px 10px rgba(0, 0, 0, .2);
white-space:normal
}
.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;
font-weight:400;
line-height:18px;
background-color:#242633;
border-bottom:1px solid #191b24;
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:#242633;
border-top-color:#242633;
bottom:-11px
}
.popover.top>.arrow:after {
content:" ";
bottom:1px;
margin-left:-10px;
border-bottom-width:0;
border-top-color:#242633
}
.popover.right>.arrow {
top:50%;
left:-11px;
margin-top:-11px;
border-left-width:0;
border-right-color:#242633;
border-right-color:#242633
}
.popover.right>.arrow:after {
content:" ";
left:1px;
bottom:-10px;
border-left-width:0;
border-right-color:#242633
}
.popover.bottom>.arrow {
left:50%;
margin-left:-11px;
border-top-width:0;
border-bottom-color:#242633;
border-bottom-color:#242633;
top:-11px
}
.popover.bottom>.arrow:after {
content:" ";
top:1px;
margin-left:-10px;
border-top-width:0;
border-bottom-color:#242633
}
.popover.left>.arrow {
top:50%;
right:-11px;
margin-top:-11px;
border-right-width:0;
border-left-color:#242633;
border-left-color:#242633
}
.popover.left>.arrow:after {
content:" ";
right:1px;
border-right-width:0;
border-left-color:#242633;
bottom:-10px
}
.carousel {
position:relative
}
.carousel-inner {
position:relative;
overflow:hidden;
width:100%
}
.carousel-inner>.item {
display:none;
position:relative;
-webkit-transition:.6s ease-in-out left;
transition:.6s ease-in-out left
}
.carousel-inner>.item>a>img, .carousel-inner>.item>img {
display:block;
max-width:100%;
height:auto;
line-height:1
}
.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:.5;
filter:alpha(opacity=50);
font-size:20px;
color:#fff;
text-align:center;
text-shadow:0 1px 2px rgba(0, 0, 0, .6)
}
.carousel-control.left {
background-image:-webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, .5)0), color-stop(rgba(0, 0, 0, .0001)100%));
background-image:linear-gradient(to right, rgba(0, 0, 0, .5)0, rgba(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:-webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, .0001)0), color-stop(rgba(0, 0, 0, .5)100%));
background-image:linear-gradient(to right, rgba(0, 0, 0, .0001)0, rgba(0, 0, 0, .5)100%);
background-repeat:repeat-x;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)
}
.carousel-control:focus, .carousel-control:hover {
outline:0;
color:#fff;
text-decoration:none;
opacity:.9;
filter:alpha(opacity=90)
}
.carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next, .carousel-control .icon-prev {
position:absolute;
top:50%;
z-index:5;
display:inline-block
}
.carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev {
left:50%
}
.carousel-control .glyphicon-chevron-right, .carousel-control .icon-next {
right:50%
}
.carousel-control .icon-next, .carousel-control .icon-prev {
width:20px;
height:20px;
margin-top:-10px;
margin-left:-10px;
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:transparent
}
.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, .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-next, .carousel-control .icon-prev {
width:30px;
height:30px;
margin-top:-15px;
margin-left:-15px;
font-size:30px
}
.carousel-caption {
left:20%;
right:20%;
padding-bottom:30px
}
.carousel-indicators {
bottom:20px
}
}
.clearfix:after, .clearfix:before {
content:" ";
display:table
}
.clearfix: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;
visibility:hidden!important
}
.affix {
position:fixed
}
@-ms-viewport {
width:device-width
}
.visible-lg, .visible-md, .visible-print, .visible-sm, .visible-xs {
display:none!important
}
@media (max-width:767px) {
.visible-xs {
display:block!important
}
table.visible-xs {
display:table
}
tr.visible-xs {
display:table-row!important
}
td.visible-xs, th.visible-xs {
display:table-cell!important
}
}
@media (min-width:768px) and (max-width:991px) {
.visible-sm {
display:block!important
}
table.visible-sm {
display:table
}
tr.visible-sm {
display:table-row!important
}
td.visible-sm, th.visible-sm {
display:table-cell!important
}
}
@media (min-width:992px) and (max-width:1199px) {
.visible-md {
display:block!important
}
table.visible-md {
display:table
}
tr.visible-md {
display:table-row!important
}
td.visible-md, th.visible-md {
display:table-cell!important
}
}
@media (min-width:1200px) {
.visible-lg {
display:block!important
}
table.visible-lg {
display:table
}
tr.visible-lg {
display:table-row!important
}
td.visible-lg, th.visible-lg {
display:table-cell!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
}
}
@media print {
.visible-print {
display:block!important
}
table.visible-print {
display:table
}
tr.visible-print {
display:table-row!important
}
td.visible-print, th.visible-print {
display:table-cell!important
}
}
@media print {
.hidden-print {
display:none!important
}
}
@font-face {
font-family:FontAwesome;
src:url(../fonts/fontawesome-webfont.eot?v=4.2.0);
src:url(../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0) format("embedded-opentype"), url(../fonts/fontawesome-webfont.woff?v=4.2.0) format("woff"), url(../fonts/fontawesome-webfont.ttf?v=4.2.0) format("truetype"), url(../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular) format("svg");
font-weight:400;
font-style:normal
}
.fa {
display:inline-block;
font:normal normal normal 14px/1 FontAwesome;
font-size:inherit;
text-rendering:auto;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale
}
.fa-lg {
font-size:1.33333em;
line-height:.75em;
vertical-align:-15%
}
.fa-2x {
font-size:2em
}
.fa-3x {
font-size:3em
}
.fa-4x {
font-size:4em
}
.fa-5x {
font-size:5em
}
.fa-fw {
width:1.28571em;
text-align:center
}
.fa-ul {
padding-left:0;
margin-left:2.14286em;
list-style-type:none
}
.fa-ul>li {
position:relative
}
.fa-li {
position:absolute;
left:-2.14286em;
width:2.14286em;
top:.14286em;
text-align:center
}
.fa-li.fa-lg {
left:-1.85714em
}
.fa-border {
padding:.2em .25em .15em;
border:solid .08em #eee;
border-radius:.1em
}
.pull-right {
float:right
}
.pull-left {
float:left
}
.fa.pull-left {
margin-right:.3em
}
.fa.pull-right {
margin-left:.3em
}
.fa-spin {
-webkit-animation:fa-spin 2s infinite linear;
animation:fa-spin 2s infinite linear
}
@-webkit-keyframes fa-spin {
0% {
-webkit-transform:rotate(0deg);
transform:rotate(0deg)
}
100% {
-webkit-transform:rotate(359deg);
transform:rotate(359deg)
}
}
@keyframes fa-spin {
0% {
-webkit-transform:rotate(0deg);
transform:rotate(0deg)
}
100% {
-webkit-transform:rotate(359deg);
transform:rotate(359deg)
}
}
.fa-rotate-90 {
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
-webkit-transform:rotate(90deg);
-ms-transform:rotate(90deg);
transform:rotate(90deg)
}
.fa-rotate-180 {
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
-webkit-transform:rotate(180deg);
-ms-transform:rotate(180deg);
transform:rotate(180deg)
}
.fa-rotate-270 {
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
-webkit-transform:rotate(270deg);
-ms-transform:rotate(270deg);
transform:rotate(270deg)
}
.fa-flip-horizontal {
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);
-webkit-transform:scale(-1, 1);
-ms-transform:scale(-1, 1);
transform:scale(-1, 1)
}
.fa-flip-vertical {
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
-webkit-transform:scale(1, -1);
-ms-transform:scale(1, -1);
transform:scale(1, -1)
}
:root .fa-flip-horizontal, :root .fa-flip-vertical, :root .fa-rotate-180, :root .fa-rotate-270, :root .fa-rotate-90 {
filter:none
}
.fa-stack {
position:relative;
display:inline-block;
width:2em;
height:2em;
line-height:2em;
vertical-align:middle
}
.fa-stack-1x, .fa-stack-2x {
position:absolute;
left:0;
width:100%;
text-align:center
}
.fa-stack-1x {
line-height:inherit
}
.fa-stack-2x {
font-size:2em
}
.fa-inverse {
color:#fff
}
.fa-glass:before {
content:""
}
.fa-music:before {
content:""
}
.fa-search:before {
content:""
}
.fa-envelope-o:before {
content:""
}
.fa-heart:before {
content:""
}
.fa-star:before {
content:""
}
.fa-star-o:before {
content:""
}
.fa-user:before {
content:""
}
.fa-film:before {
content:""
}
.fa-th-large:before {
content:""
}
.fa-th:before {
content:""
}
.fa-th-list:before {
content:""
}
.fa-check:before {
content:""
}
.fa-close:before, .fa-remove:before, .fa-times:before {
content:""
}
.fa-search-plus:before {
content:""
}
.fa-search-minus:before {
content:""
}
.fa-power-off:before {
content:""
}
.fa-signal:before {
content:""
}
.fa-cog:before, .fa-gear:before {
content:""
}
.fa-trash-o:before {
content:""
}
.fa-home:before {
content:""
}
.fa-file-o:before {
content:""
}
.fa-clock-o:before {
content:""
}
.fa-road:before {
content:""
}
.fa-download:before {
content:""
}
.fa-arrow-circle-o-down:before {
content:""
}
.fa-arrow-circle-o-up:before {
content:""
}
.fa-inbox:before {
content:""
}
.fa-play-circle-o:before {
content:""
}
.fa-repeat:before, .fa-rotate-right:before {
content:""
}
.fa-refresh:before {
content:""
}
.fa-list-alt:before {
content:""
}
.fa-lock:before {
content:""
}
.fa-flag:before {
content:""
}
.fa-headphones:before {
content:""
}
.fa-volume-off:before {
content:""
}
.fa-volume-down:before {
content:""
}
.fa-volume-up:before {
content:""
}
.fa-qrcode:before {
content:""
}
.fa-barcode:before {
content:""
}
.fa-tag:before {
content:""
}
.fa-tags:before {
content:""
}
.fa-book:before {
content:""
}
.fa-bookmark:before {
content:""
}
.fa-print:before {
content:""
}
.fa-camera:before {
content:""
}
.fa-font:before {
content:""
}
.fa-bold:before {
content:""
}
.fa-italic:before {
content:""
}
.fa-text-height:before {
content:""
}
.fa-text-width:before {
content:""
}
.fa-align-left:before {
content:""
}
.fa-align-center:before {
content:""
}
.fa-align-right:before {
content:""
}
.fa-align-justify:before {
content:""
}
.fa-list:before {
content:""
}
.fa-dedent:before, .fa-outdent:before {
content:""
}
.fa-indent:before {
content:""
}
.fa-video-camera:before {
content:""
}
.fa-image:before, .fa-photo:before, .fa-picture-o:before {
content:""
}
.fa-pencil:before {
content:""
}
.fa-map-marker:before {
content:""
}
.fa-adjust:before {
content:""
}
.fa-tint:before {
content:""
}
.fa-edit:before, .fa-pencil-square-o:before {
content:""
}
.fa-share-square-o:before {
content:""
}
.fa-check-square-o:before {
content:""
}
.fa-arrows:before {
content:""
}
.fa-step-backward:before {
content:""
}
.fa-fast-backward:before {
content:""
}
.fa-backward:before {
content:""
}
.fa-play:before {
content:""
}
.fa-pause:before {
content:""
}
.fa-stop:before {
content:""
}
.fa-forward:before {
content:""
}
.fa-fast-forward:before {
content:""
}
.fa-step-forward:before {
content:""
}
.fa-eject:before {
content:""
}
.fa-chevron-left:before {
content:""
}
.fa-chevron-right:before {
content:""
}
.fa-plus-circle:before {
content:""
}
.fa-minus-circle:before {
content:""
}
.fa-times-circle:before {
content:""
}
.fa-check-circle:before {
content:""
}
.fa-question-circle:before {
content:""
}
.fa-info-circle:before {
content:""
}
.fa-crosshairs:before {
content:""
}
.fa-times-circle-o:before {
content:""
}
.fa-check-circle-o:before {
content:""
}
.fa-ban:before {
content:""
}
.fa-arrow-left:before {
content:""
}
.fa-arrow-right:before {
content:""
}
.fa-arrow-up:before {
content:""
}
.fa-arrow-down:before {
content:""
}
.fa-mail-forward:before, .fa-share:before {
content:""
}
.fa-expand:before {
content:""
}
.fa-compress:before {
content:""
}
.fa-plus:before {
content:""
}
.fa-minus:before {
content:""
}
.fa-asterisk:before {
content:""
}
.fa-exclamation-circle:before {
content:""
}
.fa-gift:before {
content:""
}
.fa-leaf:before {
content:""
}
.fa-fire:before {
content:""
}
.fa-eye:before {
content:""
}
.fa-eye-slash:before {
content:""
}
.fa-exclamation-triangle:before, .fa-warning:before {
content:""
}
.fa-plane:before {
content:""
}
.fa-calendar:before {
content:""
}
.fa-random:before {
content:""
}
.fa-comment:before {
content:""
}
.fa-magnet:before {
content:""
}
.fa-chevron-up:before {
content:""
}
.fa-chevron-down:before {
content:""
}
.fa-retweet:before {
content:""
}
.fa-shopping-cart:before {
content:""
}
.fa-folder:before {
content:""
}
.fa-folder-open:before {
content:""
}
.fa-arrows-v:before {
content:""
}
.fa-arrows-h:before {
content:""
}
.fa-bar-chart-o:before, .fa-bar-chart:before {
content:""
}
.fa-twitter-square:before {
content:""
}
.fa-facebook-square:before {
content:""
}
.fa-camera-retro:before {
content:""
}
.fa-key:before {
content:""
}
.fa-cogs:before, .fa-gears:before {
content:""
}
.fa-comments:before {
content:""
}
.fa-thumbs-o-up:before {
content:""
}
.fa-thumbs-o-down:before {
content:""
}
.fa-star-half:before {
content:""
}
.fa-heart-o:before {
content:""
}
.fa-sign-out:before {
content:""
}
.fa-linkedin-square:before {
content:""
}
.fa-thumb-tack:before {
content:""
}
.fa-external-link:before {
content:""
}
.fa-sign-in:before {
content:""
}
.fa-trophy:before {
content:""
}
.fa-github-square:before {
content:""
}
.fa-upload:before {
content:""
}
.fa-lemon-o:before {
content:""
}
.fa-phone:before {
content:""
}
.fa-square-o:before {
content:""
}
.fa-bookmark-o:before {
content:""
}
.fa-phone-square:before {
content:""
}
.fa-twitter:before {
content:""
}
.fa-facebook:before {
content:""
}
.fa-github:before {
content:""
}
.fa-unlock:before {
content:""
}
.fa-credit-card:before {
content:""
}
.fa-rss:before {
content:""
}
.fa-hdd-o:before {
content:""
}
.fa-bullhorn:before {
content:""
}
.fa-bell:before {
content:""
}
.fa-certificate:before {
content:""
}
.fa-hand-o-right:before {
content:""
}
.fa-hand-o-left:before {
content:""
}
.fa-hand-o-up:before {
content:""
}
.fa-hand-o-down:before {
content:""
}
.fa-arrow-circle-left:before {
content:""
}
.fa-arrow-circle-right:before {
content:""
}
.fa-arrow-circle-up:before {
content:""
}
.fa-arrow-circle-down:before {
content:""
}
.fa-globe:before {
content:""
}
.fa-wrench:before {
content:""
}
.fa-tasks:before {
content:""
}
.fa-filter:before {
content:""
}
.fa-briefcase:before {
content:""
}
.fa-arrows-alt:before {
content:""
}
.fa-group:before, .fa-users:before {
content:""
}
.fa-chain:before, .fa-link:before {
content:""
}
.fa-cloud:before {
content:""
}
.fa-flask:before {
content:""
}
.fa-cut:before, .fa-scissors:before {
content:""
}
.fa-copy:before, .fa-files-o:before {
content:""
}
.fa-paperclip:before {
content:""
}
.fa-floppy-o:before, .fa-save:before {
content:""
}
.fa-square:before {
content:""
}
.fa-bars:before, .fa-navicon:before, .fa-reorder:before {
content:""
}
.fa-list-ul:before {
content:""
}
.fa-list-ol:before {
content:""
}
.fa-strikethrough:before {
content:""
}
.fa-underline:before {
content:""
}
.fa-table:before {
content:""
}
.fa-magic:before {
content:""
}
.fa-truck:before {
content:""
}
.fa-pinterest:before {
content:""
}
.fa-pinterest-square:before {
content:""
}
.fa-google-plus-square:before {
content:""
}
.fa-google-plus:before {
content:""
}
.fa-money:before {
content:""
}
.fa-caret-down:before {
content:""
}
.fa-caret-up:before {
content:""
}
.fa-caret-left:before {
content:""
}
.fa-caret-right:before {
content:""
}
.fa-columns:before {
content:""
}
.fa-sort:before, .fa-unsorted:before {
content:""
}
.fa-sort-desc:before, .fa-sort-down:before {
content:""
}
.fa-sort-asc:before, .fa-sort-up:before {
content:""
}
.fa-envelope:before {
content:""
}
.fa-linkedin:before {
content:""
}
.fa-rotate-left:before, .fa-undo:before {
content:""
}
.fa-gavel:before, .fa-legal:before {
content:""
}
.fa-dashboard:before, .fa-tachometer:before {
content:""
}
.fa-comment-o:before {
content:""
}
.fa-comments-o:before {
content:""
}
.fa-bolt:before, .fa-flash:before {
content:""
}
.fa-sitemap:before {
content:""
}
.fa-umbrella:before {
content:""
}
.fa-clipboard:before, .fa-paste:before {
content:""
}
.fa-lightbulb-o:before {
content:""
}
.fa-exchange:before {
content:""
}
.fa-cloud-download:before {
content:""
}
.fa-cloud-upload:before {
content:""
}
.fa-user-md:before {
content:""
}
.fa-stethoscope:before {
content:""
}
.fa-suitcase:before {
content:""
}
.fa-bell-o:before {
content:""
}
.fa-coffee:before {
content:""
}
.fa-cutlery:before {
content:""
}
.fa-file-text-o:before {
content:""
}
.fa-building-o:before {
content:""
}
.fa-hospital-o:before {
content:""
}
.fa-ambulance:before {
content:""
}
.fa-medkit:before {
content:""
}
.fa-fighter-jet:before {
content:""
}
.fa-beer:before {
content:""
}
.fa-h-square:before {
content:""
}
.fa-plus-square:before {
content:""
}
.fa-angle-double-left:before {
content:""
}
.fa-angle-double-right:before {
content:""
}
.fa-angle-double-up:before {
content:""
}
.fa-angle-double-down:before {
content:""
}
.fa-angle-left:before {
content:""
}
.fa-angle-right:before {
content:""
}
.fa-angle-up:before {
content:""
}
.fa-angle-down:before {
content:""
}
.fa-desktop:before {
content:""
}
.fa-laptop:before {
content:""
}
.fa-tablet:before {
content:""
}
.fa-mobile-phone:before, .fa-mobile:before {
content:""
}
.fa-circle-o:before {
content:""
}
.fa-quote-left:before {
content:""
}
.fa-quote-right:before {
content:""
}
.fa-spinner:before {
content:""
}
.fa-circle:before {
content:""
}
.fa-mail-reply:before, .fa-reply:before {
content:""
}
.fa-github-alt:before {
content:""
}
.fa-folder-o:before {
content:""
}
.fa-folder-open-o:before {
content:""
}
.fa-smile-o:before {
content:""
}
.fa-frown-o:before {
content:""
}
.fa-meh-o:before {
content:""
}
.fa-gamepad:before {
content:""
}
.fa-keyboard-o:before {
content:""
}
.fa-flag-o:before {
content:""
}
.fa-flag-checkered:before {
content:""
}
.fa-terminal:before {
content:""
}
.fa-code:before {
content:""
}
.fa-mail-reply-all:before, .fa-reply-all:before {
content:""
}
.fa-star-half-empty:before, .fa-star-half-full:before, .fa-star-half-o:before {
content:""
}
.fa-location-arrow:before {
content:""
}
.fa-crop:before {
content:""
}
.fa-code-fork:before {
content:""
}
.fa-chain-broken:before, .fa-unlink:before {
content:""
}
.fa-question:before {
content:""
}
.fa-info:before {
content:""
}
.fa-exclamation:before {
content:""
}
.fa-superscript:before {
content:""
}
.fa-subscript:before {
content:""
}
.fa-eraser:before {
content:""
}
.fa-puzzle-piece:before {
content:""
}
.fa-microphone:before {
content:""
}
.fa-microphone-slash:before {
content:""
}
.fa-shield:before {
content:""
}
.fa-calendar-o:before {
content:""
}
.fa-fire-extinguisher:before {
content:""
}
.fa-rocket:before {
content:""
}
.fa-maxcdn:before {
content:""
}
.fa-chevron-circle-left:before {
content:""
}
.fa-chevron-circle-right:before {
content:""
}
.fa-chevron-circle-up:before {
content:""
}
.fa-chevron-circle-down:before {
content:""
}
.fa-html5:before {
content:""
}
.fa-css3:before {
content:""
}
.fa-anchor:before {
content:""
}
.fa-unlock-alt:before {
content:""
}
.fa-bullseye:before {
content:""
}
.fa-ellipsis-h:before {
content:""
}
.fa-ellipsis-v:before {
content:""
}
.fa-rss-square:before {
content:""
}
.fa-play-circle:before {
content:""
}
.fa-ticket:before {
content:""
}
.fa-minus-square:before {
content:""
}
.fa-minus-square-o:before {
content:""
}
.fa-level-up:before {
content:""
}
.fa-level-down:before {
content:""
}
.fa-check-square:before {
content:""
}
.fa-pencil-square:before {
content:""
}
.fa-external-link-square:before {
content:""
}
.fa-share-square:before {
content:""
}
.fa-compass:before {
content:""
}
.fa-caret-square-o-down:before, .fa-toggle-down:before {
content:""
}
.fa-caret-square-o-up:before, .fa-toggle-up:before {
content:""
}
.fa-caret-square-o-right:before, .fa-toggle-right:before {
content:""
}
.fa-eur:before, .fa-euro:before {
content:""
}
.fa-gbp:before {
content:""
}
.fa-dollar:before, .fa-usd:before {
content:""
}
.fa-inr:before, .fa-rupee:before {
content:""
}
.fa-cny:before, .fa-jpy:before, .fa-rmb:before, .fa-yen:before {
content:""
}
.fa-rouble:before, .fa-rub:before, .fa-ruble:before {
content:""
}
.fa-krw:before, .fa-won:before {
content:""
}
.fa-bitcoin:before, .fa-btc:before {
content:""
}
.fa-file:before {
content:""
}
.fa-file-text:before {
content:""
}
.fa-sort-alpha-asc:before {
content:""
}
.fa-sort-alpha-desc:before {
content:""
}
.fa-sort-amount-asc:before {
content:""
}
.fa-sort-amount-desc:before {
content:""
}
.fa-sort-numeric-asc:before {
content:""
}
.fa-sort-numeric-desc:before {
content:""
}
.fa-thumbs-up:before {
content:""
}
.fa-thumbs-down:before {
content:""
}
.fa-youtube-square:before {
content:""
}
.fa-youtube:before {
content:""
}
.fa-xing:before {
content:""
}
.fa-xing-square:before {
content:""
}
.fa-youtube-play:before {
content:""
}
.fa-dropbox:before {
content:""
}
.fa-stack-overflow:before {
content:""
}
.fa-instagram:before {
content:""
}
.fa-flickr:before {
content:""
}
.fa-adn:before {
content:""
}
.fa-bitbucket:before {
content:""
}
.fa-bitbucket-square:before {
content:""
}
.fa-tumblr:before {
content:""
}
.fa-tumblr-square:before {
content:""
}
.fa-long-arrow-down:before {
content:""
}
.fa-long-arrow-up:before {
content:""
}
.fa-long-arrow-left:before {
content:""
}
.fa-long-arrow-right:before {
content:""
}
.fa-apple:before {
content:""
}
.fa-windows:before {
content:""
}
.fa-android:before {
content:""
}
.fa-linux:before {
content:""
}
.fa-dribbble:before {
content:""
}
.fa-skype:before {
content:""
}
.fa-foursquare:before {
content:""
}
.fa-trello:before {
content:""
}
.fa-female:before {
content:""
}
.fa-male:before {
content:""
}
.fa-gittip:before {
content:""
}
.fa-sun-o:before {
content:""
}
.fa-moon-o:before {
content:""
}
.fa-archive:before {
content:""
}
.fa-bug:before {
content:""
}
.fa-vk:before {
content:""
}
.fa-weibo:before {
content:""
}
.fa-renren:before {
content:""
}
.fa-pagelines:before {
content:""
}
.fa-stack-exchange:before {
content:""
}
.fa-arrow-circle-o-right:before {
content:""
}
.fa-arrow-circle-o-left:before {
content:""
}
.fa-caret-square-o-left:before, .fa-toggle-left:before {
content:""
}
.fa-dot-circle-o:before {
content:""
}
.fa-wheelchair:before {
content:""
}
.fa-vimeo-square:before {
content:""
}
.fa-try:before, .fa-turkish-lira:before {
content:""
}
.fa-plus-square-o:before {
content:""
}
.fa-space-shuttle:before {
content:""
}
.fa-slack:before {
content:""
}
.fa-envelope-square:before {
content:""
}
.fa-wordpress:before {
content:""
}
.fa-openid:before {
content:""
}
.fa-bank:before, .fa-institution:before, .fa-university:before {
content:""
}
.fa-graduation-cap:before, .fa-mortar-board:before {
content:""
}
.fa-yahoo:before {
content:""
}
.fa-google:before {
content:""
}
.fa-reddit:before {
content:""
}
.fa-reddit-square:before {
content:""
}
.fa-stumbleupon-circle:before {
content:""
}
.fa-stumbleupon:before {
content:""
}
.fa-delicious:before {
content:""
}
.fa-digg:before {
content:""
}
.fa-pied-piper:before {
content:""
}
.fa-pied-piper-alt:before {
content:""
}
.fa-drupal:before {
content:""
}
.fa-joomla:before {
content:""
}
.fa-language:before {
content:""
}
.fa-fax:before {
content:""
}
.fa-building:before {
content:""
}
.fa-child:before {
content:""
}
.fa-paw:before {
content:""
}
.fa-spoon:before {
content:""
}
.fa-cube:before {
content:""
}
.fa-cubes:before {
content:""
}
.fa-behance:before {
content:""
}
.fa-behance-square:before {
content:""
}
.fa-steam:before {
content:""
}
.fa-steam-square:before {
content:""
}
.fa-recycle:before {
content:""
}
.fa-automobile:before, .fa-car:before {
content:""
}
.fa-cab:before, .fa-taxi:before {
content:""
}
.fa-tree:before {
content:""
}
.fa-spotify:before {
content:""
}
.fa-deviantart:before {
content:""
}
.fa-soundcloud:before {
content:""
}
.fa-database:before {
content:""
}
.fa-file-pdf-o:before {
content:""
}
.fa-file-word-o:before {
content:""
}
.fa-file-excel-o:before {
content:""
}
.fa-file-powerpoint-o:before {
content:""
}
.fa-file-image-o:before, .fa-file-photo-o:before, .fa-file-picture-o:before {
content:""
}
.fa-file-archive-o:before, .fa-file-zip-o:before {
content:""
}
.fa-file-audio-o:before, .fa-file-sound-o:before {
content:""
}
.fa-file-movie-o:before, .fa-file-video-o:before {
content:""
}
.fa-file-code-o:before {
content:""
}
.fa-vine:before {
content:""
}
.fa-codepen:before {
content:""
}
.fa-jsfiddle:before {
content:""
}
.fa-life-bouy:before, .fa-life-buoy:before, .fa-life-ring:before, .fa-life-saver:before, .fa-support:before {
content:""
}
.fa-circle-o-notch:before {
content:""
}
.fa-ra:before, .fa-rebel:before {
content:""
}
.fa-empire:before, .fa-ge:before {
content:""
}
.fa-git-square:before {
content:""
}
.fa-git:before {
content:""
}
.fa-hacker-news:before {
content:""
}
.fa-tencent-weibo:before {
content:""
}
.fa-qq:before {
content:""
}
.fa-wechat:before, .fa-weixin:before {
content:""
}
.fa-paper-plane:before, .fa-send:before {
content:""
}
.fa-paper-plane-o:before, .fa-send-o:before {
content:""
}
.fa-history:before {
content:""
}
.fa-circle-thin:before {
content:""
}
.fa-header:before {
content:""
}
.fa-paragraph:before {
content:""
}
.fa-sliders:before {
content:""
}
.fa-share-alt:before {
content:""
}
.fa-share-alt-square:before {
content:""
}
.fa-bomb:before {
content:""
}
.fa-futbol-o:before, .fa-soccer-ball-o:before {
content:""
}
.fa-tty:before {
content:""
}
.fa-binoculars:before {
content:""
}
.fa-plug:before {
content:""
}
.fa-slideshare:before {
content:""
}
.fa-twitch:before {
content:""
}
.fa-yelp:before {
content:""
}
.fa-newspaper-o:before {
content:""
}
.fa-wifi:before {
content:""
}
.fa-calculator:before {
content:""
}
.fa-paypal:before {
content:""
}
.fa-google-wallet:before {
content:""
}
.fa-cc-visa:before {
content:""
}
.fa-cc-mastercard:before {
content:""
}
.fa-cc-discover:before {
content:""
}
.fa-cc-amex:before {
content:""
}
.fa-cc-paypal:before {
content:""
}
.fa-cc-stripe:before {
content:""
}
.fa-bell-slash:before {
content:""
}
.fa-bell-slash-o:before {
content:""
}
.fa-trash:before {
content:""
}
.fa-copyright:before {
content:""
}
.fa-at:before {
content:""
}
.fa-eyedropper:before {
content:""
}
.fa-paint-brush:before {
content:""
}
.fa-birthday-cake:before {
content:""
}
.fa-area-chart:before {
content:""
}
.fa-pie-chart:before {
content:""
}
.fa-line-chart:before {
content:""
}
.fa-lastfm:before {
content:""
}
.fa-lastfm-square:before {
content:""
}
.fa-toggle-off:before {
content:""
}
.fa-toggle-on:before {
content:""
}
.fa-bicycle:before {
content:""
}
.fa-bus:before {
content:""
}
.fa-ioxhost:before {
content:""
}
.fa-angellist:before {
content:""
}
.fa-cc:before {
content:""
}
.fa-ils:before, .fa-shekel:before, .fa-sheqel:before {
content:""
}
.fa-meanpath:before {
content:""
}
.slider {
display:inline-block;
vertical-align:middle;
position:relative
}
.slider.slider-horizontal {
width:100%!important;
height:4px
}
.slider.slider-horizontal .slider-track {
height:2px;
width:100%;
margin-top:-1px;
top:50%;
left:0
}
.slider.slider-horizontal .slider-selection {
height:100%;
top:0;
bottom:0
}
.slider.slider-horizontal .slider-handle {
margin-left:-15px;
margin-top:-15px
}
.slider.slider-horizontal .slider-handle.triangle {
border-width:0 2px 2px;
width:0;
height:0;
border-bottom-color:#0480be;
margin-top:0
}
.slider.slider-vertical {
height:210px;
width:4px
}
.slider.slider-vertical .slider-track {
width:2px;
height:100%;
margin-left:-1px;
left:50%;
top:0
}
.slider.slider-vertical .slider-selection {
width:100%;
left:0;
top:0;
bottom:0
}
.slider.slider-vertical .slider-handle {
margin-left:-15px;
margin-top:-15px
}
.slider.slider-vertical .slider-handle.triangle {
border-width:2px 0 2px 2px;
width:1px;
height:1px;
border-left-color:#0480be;
margin-left:0
}
.slider.slider-disabled .slider-handle {
pointer-events:none;
background-color:#f5f5f5
}
.slider.slider-disabled .slider-track {
opacity:.65;
cursor:not-allowed
}
.slider input {
display:none
}
.slider .tooltip-inner {
white-space:nowrap
}
.slider-track {
position:absolute;
cursor:pointer;
background-color:#eee;
box-shadow:inset 0 1px 2px rgba(0, 0, 0, .1);
border-radius:4px
}
.slider-selection {
position:absolute;
background-color:#8E44AD;
box-shadow:inset 0 -1px 0 rgba(0, 0, 0, .15);
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
border-radius:4px
}
.slider-handle {
position:absolute;
width:30px;
height:30px;
background-color:#fff;
box-shadow:1px 1px 2px rgba(0, 0, 0, .2);
border:1px solid rgba(0, 0, 0, .1)
}
.slider-handle.round {
border-radius:50%
}
.slider-handle.triangle {
background:transparent none
}
table.responsive {
border:1px solid #ddd
}
@media only screen and (max-width:767px) {
table.responsive {
margin-bottom:0
}
.pinned {
position:absolute;
left:0;
top:0;
background:#fff;
width:35%;
overflow:hidden;
overflow-x:scroll;
border-right:1px solid #ccc;
border-left:1px solid #ccc
}
.pinned table {
border-top:1px solid #ddd;
border-bottom:1px solid #ddd;
border-right:none;
border-left:none;
width:100%
}
.pinned table td, .pinned table th {
white-space:nowrap
}
.pinned td:last-child {
border-bottom:0
}
div.table-wrapper {
position:relative;
margin-bottom:20px;
overflow:hidden;
border-right:1px solid #ccc
}
div.table-wrapper div.scrollable {
margin-left:35%;
overflow:scroll;
overflow-y:hidden
}
table.responsive td, table.responsive th {
position:relative;
white-space:nowrap;
overflow:hidden
}
table.responsive td:first-child, table.responsive th:first-child, table.responsive.pinned td {
display:none
}
}
.easypiechart {
display:inline-block;
position:relative;
width:180px;
height:180px;
text-align:center;
margin:5px auto
}
.easypiechart canvas {
position:absolute;
top:0;
left:0
}
.easypiechart .pie-percent {
display:inline-block;
line-height:180px;
font-size:40px;
font-weight:300;
color:#333
}
.easypiechart .pie-percent:after {
content:'%';
margin-left:.1em;
font-size:.6em
}
.easypiechart.easypiechart-sm {
width:120px;
height:120px
}
.easypiechart.easypiechart-sm .pie-percent {
font-size:28px;
line-height:120px
}
.toast-title {
font-weight:700
}
.toast-message {
-ms-word-wrap:break-word;
word-wrap:break-word
}
.toast-message a, .toast-message label {
color:#fff
}
.toast-message a:hover {
color:#ccc;
text-decoration:none
}
.toast-close-button {
position:relative;
right:-.3em;
top:-.3em;
float:right;
font-size:20px;
font-weight:700;
color:#fff;
-webkit-text-shadow:0 1px 0 #fff;
text-shadow:0 1px 0 #fff;
opacity:.8;
-ms-filter:alpha(Opacity=80);
filter:alpha(opacity=80)
}
.toast-close-button:focus, .toast-close-button:hover {
color:#000;
text-decoration:none;
cursor:pointer;
opacity:.4;
-ms-filter:alpha(Opacity=40);
filter:alpha(opacity=40)
}
button.toast-close-button {
padding:0;
cursor:pointer;
background:0 0;
border:0;
-webkit-appearance:none
}
.toast-top-full-width {
top:0;
right:0;
width:100%
}
.toast-bottom-full-width {
bottom:0;
right:0;
width:100%
}
.toast-top-left {
top:12px;
left:12px
}
.toast-top-right {
top:12px;
right:12px
}
.toast-bottom-right {
right:12px;
bottom:12px
}
.toast-bottom-left {
bottom:12px;
left:12px
}
#toast-container {
position:fixed;
z-index:999999
}
#toast-container * {
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
box-sizing:border-box
}
#toast-container>div {
margin:0 0 6px;
padding:15px 15px 15px 50px;
width:300px;
border-radius:4px;
background-position:15px center;
background-repeat:no-repeat;
-moz-box-shadow:0 0 12px #999;
-webkit-box-shadow:0 0 12px #999;
box-shadow:0 0 12px #999;
color:#fff;
opacity:.8;
-ms-filter:alpha(Opacity=80);
filter:alpha(opacity=80)
}
#toast-container>:hover {
-moz-box-shadow:0 0 12px #000;
-webkit-box-shadow:0 0 12px #000;
box-shadow:0 0 12px #000;
opacity:1;
-ms-filter:alpha(Opacity=100);
filter:alpha(opacity=100);
cursor:pointer
}
#toast-container>.toast-info {
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=)!important
}
#toast-container>.toast-error {
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=)!important
}
#toast-container>.toast-success {
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==)!important
}
#toast-container>.toast-warning {
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=)!important
}
#toast-container.toast-bottom-full-width>div, #toast-container.toast-top-full-width>div {
width:96%;
margin:auto
}
.toast {
background-color:#333
}
.toast-success {
background-color:#27AE60
}
.toast-error {
background-color:#d82b17
}
.toast-info {
background-color:#3498DB
}
.toast-warning {
background-color:#E67E22
}
@media all and (max-width:240px) {
#toast-container>div {
padding:8px 8px 8px 50px;
width:11em
}
#toast-container .toast-close-button {
right:-.2em;
top:-.2em
}
}
@media all and (min-width:241px) and (max-width:480px) {
#toast-container>div {
padding:8px 8px 8px 50px;
width:18em
}
#toast-container .toast-close-button {
right:-.2em;
top:-.2em
}
}
@media all and (min-width:481px) and (max-width:768px) {
#toast-container>div {
padding:15px 15px 15px 50px;
width:25em
}
}
.jqstooltip {
-webkit-box-sizing:content-box;
-moz-box-sizing:content-box;
box-sizing:content-box
}
.tabcontrol, .wizard {
display:block;
width:100%;
overflow:hidden
}
.tabcontrol a, .wizard a {
outline:0
}
.tabcontrol ul, .wizard ul {
list-style:none!important;
padding:0;
margin:0
}
.tabcontrol ul>li, .wizard ul>li {
display:block;
padding:0
}
.tabcontrol>.content>.title, .tabcontrol>.steps .current-info, .wizard>.content>.title, .wizard>.steps .current-info {
position:absolute;
left:-999em
}
.wizard>.steps {
position:relative;
display:block;
width:100%
}
.wizard>.steps>ul>li {
width:100%
}
@media (min-width:600px) {
.wizard>.steps>ul>li {
width:25%
}
}
.wizard.vertical>.steps {
display:block;
width:100%
}
@media (min-width:600px) {
.wizard.vertical>.steps {
display:inline;
float:left;
width:30%
}
}
.wizard.vertical>.steps>ul>li {
float:none;
width:100%
}
.wizard.vertical>.content {
width:100%
}
@media (min-width:600px) {
.wizard.vertical>.content {
display:inline;
float:left;
margin:0 2.5% .5em;
width:65%
}
}
.wizard>.steps .number {
font-size:1.429em
}
.wizard>.actions>ul>li, .wizard>.steps>ul>li {
float:left
}
.wizard>.steps a, .wizard>.steps a:active, .wizard>.steps a:hover {
display:block;
width:auto;
margin:0 .5em .5em;
padding:1em;
text-decoration:none;
border-radius:4px
}
.wizard>.steps .disabled a, .wizard>.steps .disabled a:active, .wizard>.steps .disabled a:hover {
background:#eee;
color:#aaa;
cursor:default
}
.wizard>.steps .current a, .wizard>.steps .current a:active, .wizard>.steps .current a:hover {
background:#8E44AD;
color:#fff;
cursor:default
}
.wizard>.steps .done a, .wizard>.steps .done a:active, .wizard>.steps .done a:hover {
background:#8E44AD;
color:#fff;
opacity:.6
}
.wizard>.steps .error a, .wizard>.steps .error a:active, .wizard>.steps .error a:hover {
background:#E9422E;
color:#fff
}
.wizard>.content {
background-color:#eee;
display:block;
margin:.5em;
min-height:25em;
overflow:hidden;
position:relative;
width:auto;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px
}
.wizard>.content>.body {
float:left;
position:absolute;
width:95%;
height:95%;
padding:2.5%
}
.wizard>.content>.body ul {
list-style:disc!important
}
.wizard>.content>.body ul>li {
display:list-item
}
.wizard>.content>.body>iframe {
border:0 none;
width:100%;
height:100%
}
.wizard>.content>.body input {
display:block;
border:1px solid #ccc
}
.wizard>.content>.body input[type=checkbox] {
display:inline-block
}
.wizard>.content>.body input.error {
background:#fbe3e4;
border:1px solid #fbc2c4;
color:#8a1f11
}
.wizard>.content>.body label {
display:inline-block;
margin-bottom:.5em
}
.wizard>.content>.body label.error {
color:#8a1f11;
display:inline-block;
margin-left:1.5em
}
.wizard>.actions {
position:relative;
display:block;
text-align:right;
width:100%
}
.wizard.vertical>.actions {
display:inline;
float:right;
margin:0 2.5%;
width:95%
}
.wizard>.actions>ul {
display:inline-block;
text-align:right
}
.wizard>.actions>ul>li {
margin:0 .5em
}
.wizard.vertical>.actions>ul>li {
margin:0 0 0 1em
}
.wizard>.actions a, .wizard>.actions a:active, .wizard>.actions a:hover {
background:#8E44AD;
color:#fff;
display:block;
padding:.5em 1em;
text-decoration:none;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px
}
.wizard>.actions .disabled a, .wizard>.actions .disabled a:active, .wizard>.actions .disabled a:hover {
background:#eee;
color:#aaa
}
.tabcontrol>.steps {
position:relative;
display:block;
width:100%
}
.tabcontrol>.steps>ul {
position:relative;
margin:6px 0 0;
top:1px;
z-index:1
}
.tabcontrol>.steps>ul>li {
float:left;
margin:5px 2px 0 0;
padding:1px;
-webkit-border-top-left-radius:4px;
-webkit-border-top-right-radius:4px;
-moz-border-radius-topleft:4px;
-moz-border-radius-topright:4px;
border-top-left-radius:4px;
border-top-right-radius:4px
}
.tabcontrol>.steps>ul>li:hover {
background:#edecec;
border:1px solid #bbb;
padding:0
}
.tabcontrol>.steps>ul>li.current {
background:#fff;
border:1px solid #bbb;
border-bottom:0 none;
padding:0 0 1px;
margin-top:0
}
.tabcontrol>.steps>ul>li>a {
color:#5f5f5f;
display:inline-block;
border:0 none;
margin:0;
padding:10px 30px;
text-decoration:none
}
.tabcontrol>.steps>ul>li>a:hover {
text-decoration:none
}
.tabcontrol>.steps>ul>li.current>a {
padding:15px 30px 10px
}
.tabcontrol>.content {
position:relative;
display:inline-block;
width:100%;
height:35em;
overflow:hidden;
border-top:1px solid #bbb;
padding-top:20px
}
.tabcontrol>.content>.body {
float:left;
position:absolute;
width:95%;
height:95%;
padding:2.5%
}
.tabcontrol>.content>.body ul {
list-style:disc!important
}
.tabcontrol>.content>.body ul>li {
display:list-item
}
.angular-ui-tree {
position:relative;
display:block;
margin:0;
padding:0;
font-size:13px;
line-height:20px;
list-style:none
}
.angular-ui-tree-placeholder {
border:1px dashed #e9e9e9;
background-color:#E6F5FD;
border-radius:4px
}
.angular-ui-tree-handle {
position:relative;
display:block;
margin:5px 0;
padding:10px;
text-decoration:none;
border:1px solid #e9e9e9;
background:#fff;
cursor:move;
border-radius:4px
}
.angular-ui-tree-handle:hover .angular-ui-tree-icon-action {
display:inline
}
.angular-ui-tree-icon:hover {
cursor:pointer
}
.angular-ui-tree-icon-collapse {
display:block;
position:relative;
cursor:pointer;
float:left;
width:25px;
height:40px;
margin:-10px 0 0 -10px;
padding:0;
text-indent:100%;
white-space:nowrap;
overflow:hidden;
border:0;
background:0 0;
font-size:12px;
line-height:40px;
text-align:center;
font-weight:700
}
.angular-ui-tree-icon-collapse:before {
content:'+';
display:block;
position:absolute;
width:100%;
text-align:center;
text-indent:0
}
.angular-ui-tree-icon-collapse.uncollapsed:before {
content:'-'
}
.angular-ui-tree-icon-action {
margin-left:7px;
display:none;
color:#999;
-webkit-transform:scale(1);
-moz-transform:scale(1);
-ms-transform:scale(1);
-o-transform:scale(1);
transform:scale(1);
-webkit-transition:all .2s ease-in-out;
-moz-transition:all .2s ease-in-out;
transition:all .2s ease-in-out
}
.angular-ui-tree-icon-action:hover {
-webkit-transform:scale(1.3);
-moz-transform:scale(1.3);
-ms-transform:scale(1.3);
-o-transform:scale(1.3);
transform:scale(1.3);
color:#767676
}
.angular-ui-tree-empty {
border:1px dashed #bbb;
min-height:100px;
background-color:#fff;
background-size:60px 60px;
background-position:0 0, 30px 30px
}
.angular-ui-tree-nodes {
display:block;
position:relative;
margin:0;
padding:0;
list-style:none
}
.angular-ui-tree-nodes .angular-ui-tree-nodes {
padding-left:30px
}
.angular-ui-tree-node, .angular-ui-tree-placeholder {
display:block;
position:relative;
margin:0;
padding:0;
min-height:20px;
line-height:20px
}
.angular-ui-tree-hidden {
display:none
}
.angular-ui-tree-drag {
position:absolute;
pointer-events:none;
z-index:999;
opacity:.8
}
.morris-hover {
z-index:1;
position:absolute
}
.morris-hover.morris-default-style {
border-radius:4px;
padding:6px;
color:#666;
background:rgba(255, 255, 255, .8);
border:solid 2px rgba(230, 230, 230, .8);
font-size:12px;
text-align:center
}
.morris-hover.morris-default-style .morris-hover-row-label {
font-weight:700;
margin:.25em 0
}
.morris-hover.morris-default-style .morris-hover-point {
white-space:nowrap;
margin:.1em 0
}
.jqvmap-label {
position:absolute;
display:none;
border-radius:2px;
background:#242633;
color:#fff;
font-size:smaller;
padding:3px
}
.jqvmap-zoomin, .jqvmap-zoomout {
position:absolute;
left:10px;
border-radius:2px;
background:#242633;
padding:3px;
color:#fff;
cursor:pointer;
line-height:10px;
text-align:center
}
.jqvmap-zoomin {
top:10px
}
.jqvmap-zoomout {
top:30px
}
.jqvmap-region {
cursor:pointer
}
.jqvmap-ajax_response {
width:100%;
height:500px
}
.ui-tags-input .host {
position:relative;
margin:5px 0
}
.ui-tags-input .host:active {
outline:0
}
.ui-tags-input .tags {
overflow:hidden;
word-wrap:break-word;
cursor:text;
display:block;
width:100%;
min-height:34px;
padding:6px 12px;
font-size:14px;
line-height:1.42857;
color:#767676;
background-color:#fff;
background-image:none;
border:1px solid #CBD5DD;
border-radius:4px
}
.ui-tags-input .tags.focused {
outline:0
}
.ui-tags-input .tags .tag-list {
margin:0;
padding:0;
list-style-type:none
}
.ui-tags-input .tags .tag-item {
display:inline-block;
float:left;
margin:2px;
padding:6px 8px;
border-radius:4px;
background-color:#8E44AD;
color:#fff
}
.ui-tags-input .tags .tag-item .remove-button {
margin:0 0 0 5px;
padding:0;
border:none;
background:0 0;
cursor:pointer;
vertical-align:middle;
color:#eee;
text-decoration:none
}
.ui-tags-input .tags .tag-item .remove-button:active {
color:#E9422E
}
.ui-tags-input .tags .input {
border:0;
outline:0;
margin:2px;
padding:0;
padding-left:5px;
float:left;
line-height:30px;
height:30px
}
.ui-tags-input .tags .input.invalid-tag {
color:#E9422E
}
.ui-tags-input .tags .input::-ms-clear {
display:none
}
.ui-tags-input .autocomplete {
margin-top:5px;
position:absolute;
padding:5px 0;
z-index:999;
width:100%;
background-color:#fff;
border:1px solid rgba(0, 0, 0, .2)
}
.ui-tags-input .autocomplete .suggestion-list {
margin:0;
padding:0;
list-style-type:none
}
.ui-tags-input .autocomplete .suggestion-item {
overflow:hidden;
padding:5px 10px;
cursor:pointer;
white-space:nowrap;
text-overflow:ellipsis;
color:#242633;
background-color:#fff
}
.ui-tags-input .autocomplete .suggestion-item.selected, .ui-tags-input .autocomplete .suggestion-item.selected em {
color:#fff;
background-color:#0097cf
}
.ui-tags-input .autocomplete .suggestion-item em {
color:#242633;
background-color:#fff
}
.introjs-helperLayer, .introjs-overlay {
display:none
}
@media (min-width:768px) {
.introjs-helperLayer, .introjs-overlay {
display:block
}
}
.introjs-overlay {
position:absolute;
z-index:999999;
opacity:0;
background:-moz-radial-gradient(center, ellipse cover, rgba(0, 0, 0, .6)0, rgba(0, 0, 0, .9)100%);
background:-webkit-gradient(radial, center center, 0, center center, 100%, color-stop(0%, rgba(0, 0, 0, .6)), color-stop(100%, rgba(0, 0, 0, .9)));
background:-webkit-radial-gradient(center, ellipse cover, rgba(0, 0, 0, .6)0, rgba(0, 0, 0, .9)100%);
background:-o-radial-gradient(center, ellipse cover, rgba(0, 0, 0, .6)0, rgba(0, 0, 0, .9)100%);
background:-ms-radial-gradient(center, ellipse cover, rgba(0, 0, 0, .6)0, rgba(0, 0, 0, .9)100%);
background:radial, ellipse cover center, rgba(0, 0, 0, .6)0, rgba(0, 0, 0, .9)100%;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#66000000', endColorstr='#e6000000', GradientType=1);
-ms-filter:"alpha(Opacity=50)";
filter:alpha(opacity=50);
-webkit-transition:all .3s ease-out;
-moz-transition:all .3s ease-out;
transition:all .3s ease-out
}
.introjs-fixParent {
z-index:auto!important;
opacity:1!important
}
.introjs-showElement {
z-index:9999999!important
}
.introjs-relativePosition {
position:relative
}
.introjs-helperLayer {
position:absolute;
z-index:9999998;
background:no;
border:2px solid #f5f5f5;
border-radius:4px;
box-shadow:0 2px 15px rgba(0, 0, 0, .4);
-webkit-transition:all .3s ease-out;
-moz-transition:all .3s ease-out;
transition:all .3s ease-out
}
.introjs-helperNumberLayer {
display:none;
position:absolute;
top:-10px;
left:-10px;
z-index:9999999999!important;
padding:2px;
font-size:13px;
color:#fff;
text-align:center;
text-shadow:1px 1px 1px rgba(0, 0, 0, .3);
background:#E9422E;
width:20px;
height:20px;
line-height:18px;
border-radius:50%;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3019', endColorstr='#cf0404', GradientType=0);
filter:progid:DXImageTransform.Microsoft.Shadow(direction=135, strength=2, color=ff0000);
box-shadow:0 2px 5px rgba(0, 0, 0, .4)
}
.introjs-arrow {
border:5px solid #fff;
content:'';
position:absolute
}
.introjs-arrow.top {
top:-10px;
border-top-color:transparent;
border-right-color:transparent;
border-bottom-color:#fff;
border-left-color:transparent
}
.introjs-arrow.right {
right:-10px;
top:10px;
border-top-color:transparent;
border-right-color:transparent;
border-bottom-color:transparent;
border-left-color:#fff
}
.introjs-arrow.bottom {
bottom:-10px;
border-top-color:#fff;
border-right-color:transparent;
border-bottom-color:transparent;
border-left-color:transparent
}
.introjs-arrow.left {
left:-10px;
top:10px;
border-top-color:transparent;
border-right-color:#fff;
border-bottom-color:transparent;
border-left-color:transparent
}
.introjs-tooltip {
position:absolute;
padding:10px;
background-color:#fff;
min-width:200px;
max-width:300px;
border-radius:3px;
box-shadow:0 1px 10px rgba(0, 0, 0, .4);
-webkit-transition:opacity .1s ease-out;
-moz-transition:opacity .1s ease-out;
transition:opacity .1s ease-out
}
.introjs-tooltipbuttons {
text-align:right
}
.introjs-button {
position:relative;
overflow:visible;
display:inline-block;
padding:.3em .8em;
border:1px solid #d4d4d4;
margin:0;
text-decoration:none;
text-shadow:1px 1px 0 #fff;
font:11px/normal sans-serif;
color:#333;
white-space:nowrap;
cursor:pointer;
outline:0;
background-color:#ececec;
-webkit-background-clip:padding;
-moz-background-clip:padding;
-o-background-clip:padding-box;
border-radius:.2em;
zoom:1;
*display:inline;
margin-top:10px
}
.introjs-button:hover {
border-color:#bcbcbc;
text-decoration:none;
box-shadow:0 1px 1px #e3e3e3
}
.introjs-button:active, .introjs-button:focus {
background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ececec), to(#f4f4f4));
background-image:-moz-linear-gradient(#ececec, #f4f4f4);
background-image:-o-linear-gradient(#ececec, #f4f4f4);
background-image:linear, false, #ececec, #f4f4f4
}
.introjs-button::-moz-focus-inner {
padding:0;
border:0
}
.introjs-skipbutton {
margin-right:5px;
color:#7a7a7a
}
.introjs-prevbutton {
border-radius:.2em 0 0 .2em;
border-right:none
}
.introjs-nextbutton {
border-radius:0 .2em .2em 0
}
.introjs-disabled, .introjs-disabled:focus, .introjs-disabled:hover {
color:#9a9a9a;
border-color:#d4d4d4;
box-shadow:none;
cursor:default;
background-color:#f4f4f4;
background-image:none;
text-decoration:none
}
.introjs-bullets {
text-align:center
}
.introjs-bullets ul {
clear:both;
margin:15px auto 0;
padding:0;
display:inline-block
}
.introjs-bullets ul li {
list-style:none;
float:left;
margin:0 2px
}
.introjs-bullets ul li a {
display:block;
width:6px;
height:6px;
background:#ccc;
border-radius:10px;
text-decoration:none
}
.introjs-bullets ul li a.active, .introjs-bullets ul li a:hover {
background:#999
}
.introjsFloatingElement {
position:absolute;
height:0;
width:0;
left:50%;
top:50%
}
.non-display {
display:none
}
.page {
padding:15px
}
.page-form-ele h3 {
margin:0
}
.page-err {
position:relative;
width:100%;
height:100%
}
.page-err .err-container {
padding:45px 10px 0
}
@media (min-width:768px) {
.page-err .err-container {
padding:100px 0 0
}
}
.page-err .err {
margin:auto;
width:300px;
height:300px;
border-radius:50%;
border:2px solid #8E44AD;
padding:28px
}
.page-err .err .err-inner {
width:240px;
height:240px;
padding:30px 0;
border-radius:50%;
background-color:#8E44AD;
color:#fafafa
}
.page-err .err h1 {
margin:0;
color:#fafafa;
font-size:100px;
line-height:120px
}
.page-err .err h2 {
margin:0;
font-weight:300;
font-size:28px
}
.page-err .err-mss {
margin:50px 0 20px;
font-size:22px;
font-weight:700
}
.page-err .err-body {
padding:20px 10px
}
.page-err .btn-goback {
color:#fff;
background-color:transparent;
border-color:#fff
}
.open .page-err .btn-goback.btn-info.dropdown-toggle, .page-err .btn-goback.btn-info.active, .page-err .btn-goback.btn-info:active, .page-err .btn-goback.btn-info:focus, .page-err .btn-goback.btn-info:hover {
color:#ccd364
}
.open .page-err .btn-goback.dropdown-toggle, .page-err .btn-goback.active, .page-err .btn-goback:active, .page-err .btn-goback:focus, .page-err .btn-goback:hover {
color:#698f00;
background-color:#fff
}
.page-err .footer {
position:absolute;
bottom:20px;
width:100%
}
.body-lock #content {
background:url(../images/background/3.jpg) no-repeat center center fixed;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size:cover
}
.page-lock .lock-centered {
position:absolute;
top:50%;
left:0;
right:0;
margin-top:-65px
}
@media screen and (min-width:768px) {
.page-lock .lock-centered {
margin-top:-75px
}
}
.page-lock .lock-container {
position:relative;
max-width:420px;
margin:0 auto
}
.page-lock .lock-box {
position:absolute;
left:0;
right:0
}
.page-lock .lock-box .lock-user {
background:#fff;
width:50%;
float:left;
height:50px;
line-height:50px;
margin-top:50px;
padding:0 20px;
border-top-left-radius:4px;
border-bottom-left-radius:4px;
color:#8E44AD
}
.page-lock .lock-box .lock-img img {
position:absolute;
border-radius:50%;
left:40%;
width:80px;
height:80px;
border:6px solid #fff;
background:#fff
}
@media screen and (min-width:768px) {
.page-lock .lock-box .lock-img img {
left:33%;
width:150px;
height:150px;
border:10px solid #fff
}
}
.page-lock .lock-box .lock-pwd {
background:#fff;
width:50%;
float:right;
height:50px;
line-height:50px;
padding:0 0 0 50px;
margin-top:50px;
border-top-right-radius:4px;
border-bottom-right-radius:4px;
color:#8E44AD
}
@media screen and (min-width:768px) {
.page-lock .lock-box .lock-pwd {
padding:0 0 0 80px
}
}
.page-lock .lock-box .lock-pwd input {
width:80%;
height:50px;
color:#555;
border:0
}
.page-lock .lock-box .lock-pwd .btn-submit {
position:absolute;
top:50%;
right:20px
}
.page-tasks .task-list .view {
display:block
}
.page-tasks .task-list .edit, .page-tasks .task-list li.editing .view {
display:none
}
.page-tasks .task-list li.editing .edit {
display:block
}
.page-tasks .add-task {
position:relative
}
.page-tasks .add-task input {
height:44px;
padding:6px 12px 6px 40px
}
.page-tasks .add-task a.submit-button {
position:absolute;
top:12px;
left:12px;
color:#999
}
.page-tasks label {
font-weight:400
}
.page-tasks .filters {
margin:15px 0
}
.page-tasks .nav-tabs>li.active>a, .page-tasks .nav-tabs>li.active>a:focus, .page-tasks .nav-tabs>li.active>a:hover {
background-color:#f9f9f9
}
.page-tasks .task-list .view {
position:relative;
margin-bottom:10px;
padding:0 12px 0 40px;
border-radius:4px;
background-color:#fff;
box-shadow:0 0 1px rgba(0, 0, 0, .2)
}
.page-tasks .task-list .view:hover .glyphicon-pencil, .page-tasks .task-list .view:hover .glyphicon-remove {
display:block
}
.page-tasks .task-list .view input[type=checkbox] {
position:absolute;
top:11px;
left:16px
}
.page-tasks .task-list .view label {
line-height:20px;
margin:0;
width:100%;
padding:12px 0
}
.page-tasks .task-list .view .glyphicon-pencil, .page-tasks .task-list .view .glyphicon-remove {
display:none;
position:absolute;
top:14px;
color:#999;
-webkit-transition:all .2s ease-in-out;
-moz-transition:all .2s ease-in-out;
transition:all .2s ease-in-out
}
.page-tasks .task-list .view .glyphicon-pencil:hover, .page-tasks .task-list .view .glyphicon-remove:hover {
cursor:pointer;
color:#333;
-webkit-transform:scale(1.3);
-moz-transform:scale(1.3);
-ms-transform:scale(1.3);
-o-transform:scale(1.3);
transform:scale(1.3)
}
.page-tasks .task-list .view .glyphicon-pencil {
right:40px
}
.page-tasks .task-list .view .glyphicon-remove {
right:16px
}
.page-tasks .task-list .completed .view label {
color:#999;
text-decoration:line-through
}
.page-tasks .task-list input.edit {
margin-bottom:10px;
height:44px;
padding:6px 12px 6px 40px
}
.page-tasks .task-footer {
margin:15px 0;
border-top:4px double #e2e2e2;
padding:12px
}
.page-tasks .task-footer .list-inline>li {
float:left;
width:30%
}
.page-tasks .task-footer .list-inline>li.first-item {
width:40%
}
.page-tasks .task-footer .clear-completed {
color:#999;
border-radius:4px;
-webkit-transition:color, .2s ease-in-out;
-moz-transition:color, .2s ease-in-out;
transition:color, .2s ease-in-out
}
.page-tasks .task-footer .clear-completed:hover {
cursor:pointer;
color:#767676
}
.page-tasks .tips h3 {
margin-top:0
}
.page-forgot .signin-header, .page-signin .signin-header, .page-signup .signin-header {
margin-top:50px
}
@media (min-width:768px) {
.page-forgot .signin-header, .page-signin .signin-header, .page-signup .signin-header {
margin-top:150px
}
}
.page-forgot .logo, .page-signin .logo, .page-signup .logo {
font-size:26px;
font-weight:400;
text-transform:uppercase
}
.page-forgot .logo a:hover, .page-signin .logo a:hover, .page-signup .logo a:hover {
text-decoration:none
}
.page-forgot .info, .page-signin .info, .page-signup .info {
padding:20px 0 0;
max-width:420px;
margin:0 auto 20px
}
.page-forgot .info h2, .page-signin .info h2, .page-signup .info h2 {
font-size:18px;
color:#242633
}
.page-forgot .signin-body, .page-forgot .signup-body, .page-signin .signin-body, .page-signin .signup-body, .page-signup .signin-body, .page-signup .signup-body {
padding:20px 10px
}
.page-forgot .form-container, .page-signin .form-container, .page-signup .form-container {
max-width:420px;
margin:10px auto
}
.page-forgot .form-group, .page-signin .form-group, .page-signup .form-group {
position:relative
}
.page-forgot .form-group .btn-icon-lined, .page-signin .form-group .btn-icon-lined, .page-signup .form-group .btn-icon-lined {
position:absolute;
top:8px;
left:8px
}
.page-forgot .form-group .input-lg, .page-signin .form-group .input-lg, .page-signup .form-group .input-lg {
padding:10px 30px
}
.page-profile img.media-object {
border-radius:4px
}
.page-icons .bs-glyphicons {
overflow:hidden
}
.page-icons .bs-glyphicons li {
float:left;
width:25%;
height:115px;
padding:10px;
font-size:10px;
line-height:1.4;
text-align:center;
border:1px solid #f9f9f9
}
.page-icons .bs-glyphicons .glyphicon {
margin-top:5px;
margin-bottom:10px;
font-size:24px
}
.page-icons .bs-glyphicons .glyphicon-class {
display:block;
text-align:center;
word-wrap:break-word
}
.page-icons .bs-glyphicons-list {
padding-left:0;
list-style:none
}
.page-invoice .invoice-wrapper {
padding:0 0 30px;
background-color:#fff
}
.invoice-inner {
padding:15px 15px 30px;
background-color:#fff
}
.invoice-inner .invoice-sum li {
margin-bottom:5px;
padding:10px;
background-color:#f9f9f9;
border-radius:4px
}
.invoice-inner .table .bg-dark>th, .invoice-inner .table.table-bordered {
border:0
}
.weather-icon-list {
text-align:center
}
.weather-icon-list .example {
text-align:center;
margin:10px 3px
}
.weather-icon-list .example .icon {
font-size:24px
}
.bs-glyphicons {
padding-left:0;
padding-bottom:1px;
margin-bottom:20px;
list-style:none;
overflow:hidden
}
.bs-glyphicons .glyphicon {
margin-top:5px;
margin-bottom:10px;
font-size:24px
}
.bs-glyphicons .glyphicon-class {
display:block;
text-align:center
}
.bs-glyphicons li {
float:left;
width:25%;
height:115px;
padding:10px;
margin:0 -1px -1px 0;
font-size:12px;
line-height:1.4;
text-align:center;
border:1px solid #ddd
}
@media (min-width:768px) {
.bs-glyphicons li {
width:12.5%
}
}
.page-grid .grid-structure .row {
margin-top:10px
}
.page-grid .grid-structure .row .widget-container {
margin-top:5px;
background:#eee;
padding:10px 15px 12px;
min-height:0;
border-radius:4px
}
.page-form-ele .list-checkbox-radio li:nth-child(even) {
margin-bottom:20px
}
.page-form-ele .list-checkbox-radio li>div {
float:left;
margin-right:10px
}
.demoslider-container {
max-width:600px;
margin:auto
}
.layout-boxed>.header-container .top-header, .layout-boxed>.main-container {
max-width:1200px;
margin:0 auto
}
html {
position:relative;
min-height:100%
}
.app {
position:static;
min-height:100%
}
.app>.header-container.header-fixed {
position:fixed;
right:0;
left:0;
z-index:10
}
.app>.header-container.header-fixed+.main-container {
padding-top:120px
}
@media (min-width:768px) {
.app>.header-container.header-fixed+.main-container {
padding-top:60px
}
}
.app>.main-container {
position:static
}
.app>.main-container:before {
content:" ";
line-height:0;
z-index:-2;
position:absolute;
display:block;
width:100%;
max-width:inherit;
top:0;
bottom:0;
background-color:#f9f9f9;
box-shadow:0 0 2px rgba(0, 0, 0, .2)
}
.app>.main-container>.nav-container {
display:none;
z-index:9;
position:static;
float:left;
width:276px;
border-width:0 1px 0 0;
border-style:solid;
border-color:#dbdbdb
}
@media (min-width:768px) {
.app>.main-container>.nav-container {
display:block;
z-index:9
}
}
.app>.main-container>.nav-container:before {
z-index:-1;
content:" ";
line-height:0;
position:absolute;
display:block;
top:0;
bottom:0;
width:inherit;
background-color:inherit;
border-width:inherit;
border-style:inherit;
border-color:inherit
}
.app>.main-container>.nav-container.nav-fixed {
position:fixed;
top:120px;
bottom:0;
float:none
}
@media (min-width:768px) {
.app>.main-container>.nav-container.nav-fixed {
top:60px
}
}
.app>.main-container>.content-container {
overflow:hidden;
min-height:100%;
margin-left:0
}
@media (min-width:768px) {
.app>.main-container>.content-container {
margin-left:276px
}
}
@media (min-width:768px) {
.app>.main-container>.nav-container.nav-horizontal {
z-index:9;
border-width:0 0 1px;
border-style:solid;
border-color:#d4d4d4
}
.app>.main-container>.nav-container.nav-horizontal:before {
border:0
}
.app>.main-container>.nav-container.nav-horizontal.nav-fixed {
border-width:0 1px 1px 0;
left:0;
right:0;
bottom:auto
}
.app>.main-container>.nav-container.nav-horizontal.nav-fixed #nav {
text-align:center
}
.app>.main-container>.nav-container.nav-horizontal.nav-fixed #nav>li {
display:inline-block;
float:none
}
.app>.main-container>.nav-container.nav-horizontal.nav-fixed #nav>li>a {
padding:15px 28px
}
.app>.main-container>.nav-container.nav-horizontal.nav-fixed+.content-container {
margin:80px 0 0
}
}
@media print {
.no-print {
display:none
}
}
#nav-container ul {
padding-left:0;
list-style:none
}
#nav-container>.nav-wrapper {
position:relative;
width:100%;
height:100%
}
.nav-vertical .nav>li {
border-bottom:1px solid rgba(255, 255, 255, .05)
}
.nav-vertical .nav>li.open>a {
background-color:#e7e7e7;
color:#8E44AD
}
.nav-vertical .nav>li.open>.fa {
color:#8E44AD
}
.nav-container {
background-color:#f4f4f4
}
.nav-container .nav {
margin:0;
padding:0;
-webkit-overflow-scrolling:touch;
-webkit-overflow-scrolling:-blackberry-touch
}
.nav-container .nav>li>a>.nav-icon, .nav-container .nav>li>a>i {
display:inline-block;
margin-right:10px;
width:20px;
line-height:1;
text-align:center;
font-size:16px;
-webkit-transition:all .2s ease-in-out;
-moz-transition:all .2s ease-in-out;
transition:all .2s ease-in-out
}
.nav-container .nav a {
font-size:13px;
color:#767676;
-webkit-transition:all .2s ease-in-out;
-moz-transition:all .2s ease-in-out;
transition:all .2s ease-in-out
}
.nav-container .nav a:hover {
text-decoration:none
}
.nav-container .nav>li {
position:relative;
margin:0;
text-align:left;
font-weight:700;
-webkit-transition:all .2s ease-in-out;
-moz-transition:all .2s ease-in-out;
transition:all .2s ease-in-out
}
.nav-container .nav>li:hover>a {
background-color:#e7e7e7;
color:#8E44AD
}
.nav-container .nav>li:hover>.fa {
color:#8E44AD
}
.nav-container .nav>li.active>a {
background-color:#e7e7e7;
color:#8E44AD
}
.nav-container .nav>li.active>.fa {
color:#8E44AD
}
.nav-container .nav>li:first-child>a {
border-top:0
}
.nav-container .nav>li>a {
position:relative;
display:block;
padding:15px;
-webkit-transition:all .2s ease-in-out;
-moz-transition:all .2s ease-in-out;
transition:all .2s ease-in-out
}
.nav-container .nav>li>a .badge {
position:absolute;
top:16px;
right:5px
}
.nav-container .nav>li>.icon-has-ul-h {
display:none
}
.nav-container .nav>li>.icon-has-ul {
position:absolute;
top:18px;
right:15px
}
.nav-container .nav ul {
background-color:#e7e7e7;
display:none
}
.nav-container .nav ul a {
font-size:13px
}
.nav-container .nav ul li {
position:relative;
padding:0
}
.nav-container .nav ul li.active>a, .nav-container .nav ul li:hover>a {
color:#8E44AD
}
.nav-container .nav ul li.active>a {
border-left:2px solid #8E44AD;
background-color:#dbdbdb
}
.nav-container .nav ul li:last-child>a {
border-bottom:0
}
.nav-container .nav ul li>a {
position:relative;
display:block;
padding:13px 0 13px 25px;
-webkit-transition:all .2s ease-in-out;
-moz-transition:all .2s ease-in-out;
transition:all .2s ease-in-out
}
.nav-container .nav ul li>a:first-child {
border-top:none
}
.nav-container .nav ul li>a i.fa-angle-right {
margin-right:25px
}
.nav-container .nav ul li>a>.badge {
position:absolute;
right:5px;
top:12px
}
@media (max-width:767px) {
.on-canvas #header {
position:fixed;
right:0;
left:0;
z-index:12
}
.on-canvas #nav-container {
display:block;
position:fixed;
top:120px;
bottom:0;
float:none
}
.on-canvas .main-container {
overflow:hidden
}
.on-canvas .main-container #content {
margin-left:220px;
margin-right:-220px
}
}
@media (max-width:767px) {
.nav-horizontal .nav>li.open>a {
background-color:#e7e7e7;
color:#8E44AD
}
.nav-horizontal .nav>li.open>.fa {
color:#8E44AD
}
}
@media (min-width:768px) {
.main-container>.nav-container.nav-horizontal {
float:none;
width:auto
}
.main-container>.nav-container.nav-horizontal+.content-container {
margin-left:0
}
.nav-horizontal {
background-color:#eee
}
.nav-horizontal .slimScrollDiv {
overflow:visible!important;
height:auto!important
}
.nav-horizontal .slimScrollDiv .slimScrollBar, .nav-horizontal .slimScrollDiv .slimScrollRail {
display:none!important
}
.nav-horizontal .nav {
overflow:visible!important
}
.nav-horizontal .nav>li {
position:relative;
float:left
}
.nav-horizontal .nav>li:hover>a {
background-color:#e1e1e1;
color:#767676
}
.nav-horizontal .nav>li:hover>.fa {
color:#767676
}
.nav-horizontal .nav>li.active>a {
background-color:#e1e1e1;
color:#8E44AD
}
.nav-horizontal .nav>li.active>.fa {
color:#8E44AD
}
.nav-horizontal .nav>li>a {
padding:15px 30px;
text-align:center;
font-weight:400
}
.nav-horizontal .nav>li>a>.fa {
margin:0;
font-size:26px;
line-height:1
}
.nav-horizontal .nav>li>a span {
margin:0;
display:block;
font-size:12px
}
.nav-horizontal .nav>li>a .badge {
top:15px
}
.nav-horizontal .nav>li>.icon-has-ul-h {
display:block;
position:absolute;
bottom:16px;
right:10px
}
.nav-horizontal .nav>li>.icon-has-ul {
display:none
}
.nav-horizontal .nav>li:hover>ul {
display:block!important
}
.nav-horizontal .nav>li>ul {
z-index:9;
position:absolute;
left:0;
top:100%;
min-width:100%;
width:auto;
background-color:#e1e1e1
}
.nav-horizontal .nav>li>ul li {
white-space:nowrap
}
.nav-horizontal .nav>li>ul li.active>a, .nav-horizontal .nav>li>ul li:hover>a {
color:#8E44AD
}
.nav-horizontal .nav>li>ul li.active>a {
border-left:2px solid #8E44AD;
background-color:#d4d4d4
}
.nav-horizontal .nav>li>ul li>a {
padding:13px 40px 13px 20px
}
}
@media (min-width:768px) {
.app.nav-collapsed-min .slimScrollDiv {
overflow:visible!important;
height:auto!important
}
.app.nav-collapsed-min .slimScrollDiv .slimScrollBar, .app.nav-collapsed-min .slimScrollDiv .slimScrollRail {
display:none!important
}
.app.nav-collapsed-min #nav-container {
width:60px
}
.app.nav-collapsed-min #content {
margin-left:60px
}
.app.nav-collapsed-min #nav, .app.nav-collapsed-min #nav-wrapper {
overflow:visible!important
}
.app.nav-collapsed-min #nav>li>a {
padding:15px;
text-align:center
}
.app.nav-collapsed-min #nav>li>a>i {
margin:0;
font-size:20px
}
.app.nav-collapsed-min #nav>li .icon-has-ul, .app.nav-collapsed-min #nav>li>a>span {
display:none
}
.app.nav-collapsed-min #nav>li>ul {
z-index:9;
position:absolute;
left:100%;
top:0;
width:220px;
border-top-right-radius:4px;
border-bottom-right-radius:4px;
box-shadow:1px 1px 3px rgba(0, 0, 0, .2)
}
.app.nav-collapsed-min #nav>li.open>ul, .app.nav-collapsed-min #nav>li:hover>ul {
display:block!important
}
.app.nav-collapsed-min .nav-horizontal#nav-container {
width:auto
}
.app.nav-collapsed-min .nav-horizontal+#content {
margin:0
}
.app.nav-collapsed-min .nav-horizontal.nav-fixed+#content {
margin:50px 0 0
}
.app.nav-collapsed-min .nav-horizontal #nav>li>.fa {
display:none
}
.app.nav-collapsed-min .nav-horizontal #nav>li>ul {
left:0;
top:100%
}
}
.header-container {
background-color:#fff;
box-shadow:0 1px 2px rgba(0, 0, 0, .15)
}
.header-container>.top-header a {
color:#767676
}
.header-container>.top-header a:hover {
text-decoration:none
}
.header-container>.top-header .dropdown-menu a {
color:#767676
}
.header-container>.top-header .hidden-mobile {
display:none
}
@media (min-width:480px) {
.header-container>.top-header .hidden-mobile {
display:inline
}
}
.header-container>.top-header .logo {
position:absolute;
width:100%;
height:60px;
background-color:#8E44AD;
color:#fafafa;
line-height:60px;
text-align:center
}
@media (min-width:768px) {
.header-container>.top-header .logo {
display:inline-block;
width:220px;
border-right:1px solid rgba(255, 255, 255, .1)
}
}
.header-container>.top-header .logo>a {
font-size:24px;
vertical-align:middle;
color:#fafafa
}
.header-container>.top-header .logo>a .logo-icon {
color:#a1db00;
margin-right:12px
}
.header-container>.top-header .menu-button {
display:block;
position:absolute;
top:13px;
right:20px;
width:46px;
padding:10px 12px;
border-radius:4px
}
.header-container>.top-header .menu-button:hover {
cursor:pointer;
background-color:#314200
}
.header-container>.top-header .menu-button .icon-bar {
display:block;
width:22px;
height:2px;
border-radius:1px;
background-color:#fff
}
.header-container>.top-header .menu-button .icon-bar+.icon-bar {
margin-top:4px
}
@media (min-width:768px) {
.header-container>.top-header .menu-button {
display:none
}
}
.header-container>.top-header .admin-options {
z-index:20;
line-height:20px
}
.header-container>.top-header .dropdown-menu.panel {
padding:0;
white-space:nowrap
}
.header-container>.top-header .dropdown-menu.panel .list-group-item, .header-container>.top-header .dropdown-menu.panel .panel-footer, .header-container>.top-header .dropdown-menu.panel .panel-heading {
padding:10px 15px
}
.header-container>.top-header .dropdown-menu.panel .list-group-item>a {
display:block
}
.header-container>.top-header .dropdown-menu.panel .media .media-body {
padding-right:75px
}
.header-container>.top-header .top-nav {
width:100%;
height:60px;
padding:60px 0 0
}
@media (min-width:768px) {
.header-container>.top-header .top-nav {
padding:0 0 0 220px
}
}
.header-container>.top-header .top-nav>ul {
margin-bottom:0
}
.header-container>.top-header .top-nav .nav-left, .header-container>.top-header .top-nav .nav-right {
font-size:18px;
line-height:22px
}
.header-container>.top-header .top-nav .nav-left>li, .header-container>.top-header .top-nav .nav-right>li {
float:left
}
.header-container>.top-header .top-nav .nav-left>li.nav-profile>a, .header-container>.top-header .top-nav .nav-right>li.nav-profile>a {
padding:15px
}
.header-container>.top-header .top-nav .nav-left>li.nav-profile .hidden-xs, .header-container>.top-header .top-nav .nav-right>li.nav-profile .hidden-xs {
padding-right:8px
}
.header-container>.top-header .top-nav .nav-left>li.nav-profile i, .header-container>.top-header .top-nav .nav-right>li.nav-profile i {
width:18px;
font-size:16px;
margin-right:5px
}
.header-container>.top-header .top-nav .nav-left>li>.toggle-min, .header-container>.top-header .top-nav .nav-right>li>.toggle-min {
display:none
}
@media (min-width:768px) {
.header-container>.top-header .top-nav .nav-left>li>.toggle-min, .header-container>.top-header .top-nav .nav-right>li>.toggle-min {
display:block
}
}
.header-container>.top-header .top-nav .nav-left>li a:focus, .header-container>.top-header .top-nav .nav-left>li a:hover, .header-container>.top-header .top-nav .nav-right>li a:focus, .header-container>.top-header .top-nav .nav-right>li a:hover {
text-decoration:none
}
.header-container>.top-header .top-nav .nav-left>li>.btn-group>a, .header-container>.top-header .top-nav .nav-left>li>a, .header-container>.top-header .top-nav .nav-right>li>.btn-group>a, .header-container>.top-header .top-nav .nav-right>li>a {
position:relative;
display:block;
height:60px;
padding:19px 16px
}
@media (min-width:768px) {
.header-container>.top-header .top-nav .nav-left>li>.btn-group>a, .header-container>.top-header .top-nav .nav-left>li>a, .header-container>.top-header .top-nav .nav-right>li>.btn-group>a, .header-container>.top-header .top-nav .nav-right>li>a {
padding:19px 20px
}
}
.header-container>.top-header .top-nav .nav-left>li>.btn-group>a .badge, .header-container>.top-header .top-nav .nav-left>li>a .badge, .header-container>.top-header .top-nav .nav-right>li>.btn-group>a .badge, .header-container>.top-header .top-nav .nav-right>li>a .badge {
position:absolute;
top:6px;
right:3px
}
@media (min-width:768px) {
.header-container>.top-header .top-nav .nav-left>li>.btn-group>a .badge, .header-container>.top-header .top-nav .nav-left>li>a .badge, .header-container>.top-header .top-nav .nav-right>li>.btn-group>a .badge, .header-container>.top-header .top-nav .nav-right>li>a .badge {
background-color:transparent;
color:#767676
}
}
.header-container>.top-header .top-nav .nav-left>li ul.dropdown-menu a:hover, .header-container>.top-header .top-nav .nav-right>li ul.dropdown-menu a:hover {
background-color:#8E44AD;
color:#fff
}
.header-container>.top-header .top-nav .nav-left>li ul.dropdown-menu .glyphicon, .header-container>.top-header .top-nav .nav-right>li ul.dropdown-menu .glyphicon {
margin-right:10px
}
.header-container>.top-header .top-nav .nav-left .search-box, .header-container>.top-header .top-nav .nav-right .search-box {
max-width:180px;
padding:13px 0
}
.header-container>.top-header .top-nav .nav-left .search-box .input-group-addon, .header-container>.top-header .top-nav .nav-right .search-box .input-group-addon {
padding:6px 0 6px 12px;
border:none;
background-color:transparent
}
.header-container>.top-header .top-nav .nav-left .search-box .form-control, .header-container>.top-header .top-nav .nav-right .search-box .form-control {
border:none
}
.header-container>.top-header .top-nav .nav-left {
float:left;
padding:0
}
.header-container>.top-header .top-nav .nav-left>li {
border-right:1px solid #e9e9e9
}
.header-container>.top-header .top-nav .nav-right {
padding:0
}
.header-container>.top-header .top-nav .nav-right>li>a {
text-align:center;
border-left:1px solid #e9e9e9
}
.header-container>.top-header .top-nav .nav-right>li:last-child {
border-right:1px solid #e9e9e9
}
.header-container>.top-header .top-nav .nav-right>li:last-child .dropdown-menu.pull-right {
right:10px
}
.header-container>.top-header .langs .active-flag .flag {
margin-top:0
}
.header-container>.top-header .langs .list-langs a {
position:relative;
padding:8px 20px 8px 57px
}
.header-container>.top-header .langs .list-langs a .flag {
position:absolute;
top:7px;
left:15px
}
.body-wide #header, .body-wide #nav-container {
display:none
}
.body-wide>.main-container {
width:100%;
max-width:100%;
margin:0;
padding:0
}
.body-wide #content {
z-index:2;
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
margin:0
}
.body-wide .introjs-helperLayer, .body-wide .introjs-overlay {
display:none
}
.search-toolbar {
padding:10px 0
}
.search-toolbar p {
margin:0
}
.search-toolbar .va-middle {
margin-top:7px;
margin-bottom:7px
}
.search-toolbar .nav-chart-icon {
vertical-align:middle
}
.search-toolbar .btn-group+.btn-group {
margin-left:5px
}
.search-list .va-middle {
vertical-align:middle
}
.input-group-btn:last-child>.btn:not(:last-child) {
border-bottom-right-radius:0;
border-top-right-radius:0
}
.search-grid {
white-space:nowrap;
overflow:hidden;
position:relative
}
.search-grid .btn-group {
position:absolute;
right:15px;
top:15px
}
.search-grid .btn-group, .search-list .btn-group {
visibility:hidden
}
.search-grid:hover, .search-list:hover {
background-color:#f5f5f5
}
.search-grid:hover .btn-group, .search-list:hover .btn-group {
visibility:visible
}
body {
text-rendering:optimizeLegibility!important;
-webkit-font-smoothing:antialiased!important;
-moz-osx-font-smoothing:grayscale!important
}
::selection {
background:#8E44AD;
color:#fff
}
::-moz-selection {
background:#8E44AD;
color:#fff
}
span.block {
display:block
}
.no-margin {
margin:0
}
.no-border {
border:0
}
a.bg-primary, a.bg-primary:hover {
background-color:#8E44AD;
color:#fff
}
a.bg-success, a.bg-success:hover {
background-color:#27AE60;
color:#fff
}
a.bg-info, a.bg-info:hover {
background-color:#3498DB;
color:#fff
}
a.bg-warning, a.bg-warning:hover {
background-color:#FAC552;
color:#fff
}
a.bg-danger, a.bg-danger:hover {
background-color:#E9422E;
color:#fff
}
a.bg-orange, a.bg-orange:hover {
background-color:#EF9549;
color:#fff
}
.bg-primary {
background-color:#8E44AD;
color:#fff
}
.bg-primary-light {
background-color:#40DEC8;
color:#fff
}
.bg-success {
background-color:#27AE60;
color:#fff
}
.bg-info {
background-color:#3498DB;
color:#fff
}
.bg-warning {
background-color:#FAC552;
color:#fff
}
.bg-danger {
background-color:#E9422E;
color:#fff
}
.bg-orange {
background-color:#EF9549;
color:#fff
}
.bg-violet {
background-color:#669;
color:#fff
}
.bg-dark {
background-color:#242633;
color:#fff
}
.bg-bright {
background-color:#fafafa;
color:#767676
}
.bg-reverse {
background-color:#fff;
color:#767676
}
.bg-facebook {
background-color:#335397;
color:#fff
}
.bg-twitter {
background-color:#00c7f7;
color:#fff
}
.bg-google-plus {
background-color:#df4a32;
color:#fff
}
.page-container {
max-width:1170px;
margin:auto
}
.blockquote-colored {
border-left:5px solid #8E44AD
}
.blockquote-colored.pull-right {
border-right:5px solid #8E44AD;
border-left:0
}
.gradient-text {
font-size:150px;
font-weight:300;
color:#8E44AD;
background:-webkit-linear-gradient(92deg, #fb83fa, #00aced);
-webkit-background-clip:text;
-webkit-text-fill-color:transparent
}
.text-small {
font-size:12px
}
.text-normal {
font-size:14px
}
.text-huge {
font-size:72px
}
.text-large {
font-size:50px
}
.size-h1 {
font-size:36px
}
.size-h2 {
font-size:30px
}
.size-h3 {
font-size:24px
}
.size-h4 {
font-size:18px
}
.text-thin {
font-weight:300
}
.text-ultralight {
font-weight:100
}
.color-primary {
color:#8E44AD
}
.color-success {
color:#27AE60
}
.color-info {
color:#3498DB
}
.color-info-alt {
color:#669
}
.color-warning {
color:#FAC552
}
.color-danger {
color:#E9422E
}
.color-dark {
color:#242633
}
.color-reverse {
color:#fff
}
.color-gray-darker {
color:#222
}
.color-gray-dark {
color:#333
}
.color-gray {
color:#555
}
.color-gray-light {
color:#999
}
.color-gray-lighter {
color:#eee
}
.dropcap, .dropcap-circle, .dropcap-square {
display:block;
float:left;
font-weight:400;
line-height:36px;
margin-right:6px;
text-shadow:none
}
.dropcap {
font-size:3.1em
}
.dropcap-circle, .dropcap-square {
background-color:#eee;
color:#767676;
width:36px;
text-align:center
}
.dropcap-square {
border-radius:4px;
font-size:2.3em
}
.dropcap-circle {
border-radius:50%;
font-size:1.78em
}
.dropcap.colored {
color:#8E44AD
}
.dropcap-circle.colored, .dropcap-square.colored {
background-color:#8E44AD;
color:#fff
}
.highlight {
background-color:#8E44AD;
color:#fff;
border-radius:4px;
padding:2px 5px
}
.divider {
display:block;
height:10px
}
.divider-sm {
height:15px
}
.divider-md {
height:20px
}
.divider-lg {
height:30px
}
.divider-xl {
height:50px
}
.space {
display:inline;
padding:5px
}
.space-md {
padding:15px
}
.space-lg {
padding:25px
}
.table-dynamic .table-filters {
margin:10px 0;
padding:8px
}
.table-dynamic .filter-result-info {
padding:7px
}
.table-dynamic .table-bordered {
border-top:1px solid #ddd;
border-bottom:1px solid #ddd
}
.table-dynamic .table-bordered thead th {
position:relative;
padding:0
}
.table-dynamic .table-bordered thead th>.th {
position:relative;
padding:8px 20px 8px 8px
}
.table-dynamic .table-bordered thead th .glyphicon-chevron-down, .table-dynamic .table-bordered thead th .glyphicon-chevron-up {
position:absolute;
color:#999
}
.table-dynamic .table-bordered thead th .glyphicon-chevron-down:hover, .table-dynamic .table-bordered thead th .glyphicon-chevron-up:hover {
color:#8E44AD;
cursor:pointer
}
.table-dynamic .table-bordered thead th .glyphicon-chevron-down.active, .table-dynamic .table-bordered thead th .glyphicon-chevron-up.active {
color:#8E44AD
}
.table-dynamic .table-bordered thead th .fa-angle-down, .table-dynamic .table-bordered thead th .fa-angle-up {
position:absolute;
color:#999;
font-size:16px;
font-weight:700
}
.table-dynamic .table-bordered thead th .fa-angle-down:hover, .table-dynamic .table-bordered thead th .fa-angle-up:hover {
color:#8E44AD;
cursor:pointer
}
.table-dynamic .table-bordered thead th .fa-angle-down.active, .table-dynamic .table-bordered thead th .fa-angle-up.active {
color:#8E44AD
}
.table-dynamic .table-bordered thead th .fa-angle-up, .table-dynamic .table-bordered thead th .glyphicon-chevron-up {
top:4px;
right:5px
}
.table-dynamic .table-bordered thead th .fa-angle-down {
top:18px;
right:5px
}
.table-dynamic .table-bordered thead th .glyphicon-chevron-down {
top:18px;
right:6px
}
.table-dynamic .table-footer {
margin:10px 0;
padding:8px
}
.table-dynamic .page-num-info span {
padding:6px
}
.table-dynamic .pagination-container ul {
margin:0
}
.table-dynamic .pagination-container ul li:hover {
cursor:pointer
}
@media only screen and (max-width:800px) {
.table-flip-scroll .cf:after {
visibility:hidden;
display:block;
font-size:0;
content:" ";
clear:both;
height:0
}
.table-flip-scroll * html .cf, .table-flip-scroll :first-child+html .cf {
zoom:1
}
.table-flip-scroll table {
border-collapse:collapse;
border-spacing:0
}
.table-flip-scroll td, .table-flip-scroll th {
margin:0;
vertical-align:top
}
.table-flip-scroll table {
display:block;
position:relative;
width:100%
}
.table-flip-scroll thead {
display:block;
float:left
}
.table-flip-scroll tbody {
display:block;
width:auto;
position:relative;
overflow-x:auto;
white-space:nowrap
}
.table-flip-scroll thead tr {
display:block
}
.table-flip-scroll .table>thead>tr>th:first-child {
border-top:1px solid #ddd
}
.table-flip-scroll th {
display:block;
text-align:right
}
.table-flip-scroll tbody tr {
display:inline-block;
vertical-align:top
}
.table-flip-scroll td {
display:block;
min-height:1.25em;
text-align:left
}
.table-flip-scroll th {
border-bottom:0;
border-left:0
}
.table-flip-scroll td {
border-left:0;
border-right:0;
border-bottom:0
}
.table-flip-scroll tbody tr {
border-left:1px solid #babcbf
}
.table-flip-scroll td:last-child, .table-flip-scroll th:last-child {
border-bottom:1px solid #babcbf
}
}
.ui-radio {
position:relative;
margin:0 20px 10px;
font-size:14px;
line-height:20px;
height:20px
}
.ui-radio input[type=radio]+span:hover {
cursor:pointer
}
.ui-radio input[type=radio]:disabled+span:hover {
cursor:not-allowed
}
.ui-radio input[type=radio] {
display:none
}
.ui-radio input[type=radio]+span {
padding-left:10px;
font-weight:400
}
.ui-radio input[type=radio]+span:before {
content:"";
width:20px;
height:20px;
display:inline-block;
vertical-align:middle;
position:absolute;
left:-20px;
top:0;
background:#fff;
border-radius:50%;
border:1px solid #ccc
}
.ui-radio input[type=radio]:disabled+span:before {
opacity:.65;
border:1px solid #ccc;
cursor:no-drop
}
.ui-radio input[type=radio]:checked+span:after {
content:"";
width:8px;
height:8px;
position:absolute;
top:6px;
left:-14px;
background-color:#8E44AD;
border-radius:50%;
display:block
}
.ui-radio input[type=radio]:disabled:checked+span:after {
opacity:.65;
cursor:no-drop;
background-color:#ccc
}
.ui-checkbox {
position:relative;
margin:0 20px 10px
}
.ui-checkbox input[type=checkbox]+span:hover {
cursor:pointer
}
.ui-checkbox input[type=checkbox]:disabled+span:hover {
cursor:not-allowed
}
.ui-checkbox input[type=checkbox] {
display:none
}
.ui-checkbox input[type=checkbox]+span {
font-weight:400
}
.ui-checkbox input[type=checkbox]+span:before {
content:"";
width:18px;
height:18px;
display:inline-block;
vertical-align:middle;
margin-right:10px;
margin-left:-20px;
background-color:transparent;
border-radius:2px;
border:1px solid #ccc
}
.ui-checkbox input[type=checkbox]:disabled+span:before {
opacity:.65;
border:1px solid #ccc;
cursor:no-drop
}
.ui-checkbox input[type=checkbox]:checked+span:before {
background-color:#8E44AD;
border:1px solid #8E44AD
}
.ui-checkbox input[type=checkbox]:checked+span:after {
content:"";
width:8px;
height:8px;
position:absolute;
top:7px;
left:-15px;
background:url(img/checkmark.png) no-repeat center center;
background-size:14px 14px;
display:block
}
.ui-checkbox input[type=checkbox]:disabled:checked+span:before {
opacity:.65;
background-color:#ccc;
border:1px solid #ccc
}
.ui-checkbox input[type=checkbox]:disabled:checked+span:after {
opacity:.65;
cursor:no-drop;
background:url(img/checkmark.png) no-repeat center center
}
.ui-editor .btn-toolbar {
margin-bottom:10px
}
.ui-editor .btn-toolbar .btn {
font-size:12px
}
.ui-editor .btn-toolbar .btn-group {
margin:5px
}
.ui-editor .btn-toolbar .btn-default {
background-color:#fff;
color:#767676
}
.ui-editor #taHtmlElement, .ui-editor #taTextElement {
overflow:auto;
min-height:300px
}
.ui-datepicker table {
margin:0 5px
}
.ui-datepicker table td, .ui-datepicker table th, .ui-timepicker td {
padding:1px
}
.ui-rating:hover {
cursor:pointer
}
.ui-rating .fa {
display:inline-block;
font-family:FontAwesome;
font-style:normal;
font-weight:400;
line-height:1;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale;
margin-right:5px
}
.ui-rating .fa.fa-star {
color:#40DEC8
}
.ui-rating.ui-rating-success .fa.fa-star {
color:#27AE60
}
.ui-rating.ui-rating-info .fa.fa-star {
color:#3498DB
}
.ui-rating.ui-rating-warning .fa.fa-star {
color:#FAC552
}
.ui-rating.ui-rating-danger .fa.fa-star {
color:#E9422E
}
.form-control {
border-width:1px;
box-shadow:none
}
.form-control:focus {
border-color:#8E44AD;
box-shadow:none
}
.form-group .col-sm-10 {
position:relative
}
.form-group .col-sm-10 .icon {
position:absolute;
right:25px;
top:10px
}
.input-round {
border-radius:25px
}
input.input-primary, input.input-primary:focus {
border-color:#8E44AD
}
input.input-info, input.input-info:focus {
border-color:#3498DB
}
input.input-success, input.input-success:focus {
border-color:#27AE60
}
input.input-warning, input.input-warning:focus {
border-color:#FAC552
}
input.input-danger, input.input-danger:focus {
border-color:#E9422E
}
.drop-box {
width:100%;
height:100px;
background:#F8F8F8;
border:2px dashed #DDD;
text-align:center;
padding-top:35px;
border-radius:4px
}
.ui-select {
position:relative;
display:inline-block;
overflow:hidden;
margin:0 0 2px 1.2%;
width:auto;
height:auto;
border:1px solid #CBD5DD;
border-radius:4px
}
.ui-select>select {
z-index:99;
display:block;
position:relative;
padding:10px 15px 10px 10px;
min-width:200px;
width:120%;
border:none;
outline:0;
background:0 0;
text-transform:uppercase;
font-size:11px;
font-weight:700;
text-indent:.01px;
text-overflow:'';
cursor:pointer;
-webkit-appearance:none;
-moz-appearance:none
}
.ui-select select::-ms-expand {
display:none
}
.ui-select:after {
z-index:0;
content:"";
position:absolute;
right:8%;
top:50%;
color:#CBD5DD;
width:0;
margin-top:-3px;
height:0;
border-top:6px solid;
border-right:6px solid transparent;
border-left:6px solid transparent
}
.ui-spinner {
max-width:200px
}
.ui-spinner .input-group-btn.btn-group-vertical>.btn {
height:17px;
margin:0;
padding:0 6px;
text-align:center
}
.ui-spinner .input-group-btn.btn-group-vertical>.btn:first-child {
border-radius:0 4px 0 0!important
}
.ui-spinner .input-group-btn.btn-group-vertical>.btn:last-child {
border-radius:0 0 4px
}
.ui-spinner .input-group-btn.btn-group-vertical>.btn i {
display:block;
margin-top:-2px
}
.switch input {
display:none
}
.switch i {
display:inline-block;
cursor:pointer;
padding-right:25px;
transition:all ease .2s;
-webkit-transition:all ease .2s;
border-radius:30px;
box-shadow:inset 0 0 1px rgba(0, 0, 0, .5)
}
.switch i:before {
display:block;
content:'';
width:30px;
height:30px;
border-radius:30px;
background:#fff;
box-shadow:0 1px 2px rgba(0, 0, 0, .5)
}
.switch :checked+i {
padding-right:0;
padding-left:25px;
box-shadow:inset 0 0 1px rgba(0, 0, 0, .5), inset 0 0 50px #8E44AD
}
.switch.switch-success :checked+i {
box-shadow:inset 0 0 1px rgba(0, 0, 0, .5), inset 0 0 50px #27AE60
}
.switch.switch-info :checked+i {
box-shadow:inset 0 0 1px rgba(0, 0, 0, .5), inset 0 0 50px #3498DB
}
.switch.switch-warning :checked+i {
box-shadow:inset 0 0 1px rgba(0, 0, 0, .5), inset 0 0 50px #FAC552
}
.switch.switch-danger :checked+i {
box-shadow:inset 0 0 1px rgba(0, 0, 0, .5), inset 0 0 50px #E9422E
}
.form-validation .ng-valid.ng-dirty {
border-color:#27AE60
}
.form-validation .ng-invalid.ng-dirty {
border-color:#E9422E
}
.btn-info-alt {
color:#fff;
background-color:#669;
border-color:#5c5c8a
}
.btn-info-alt.active, .btn-info-alt:active, .btn-info-alt:focus, .btn-info-alt:hover, .open .btn-info-alt.dropdown-toggle {
color:#fff;
background-color:#565681;
border-color:#434365
}
.btn-info-alt.active, .btn-info-alt:active, .open .btn-info-alt.dropdown-toggle {
background-image:none
}
.btn-info-alt.disabled, .btn-info-alt.disabled.active, .btn-info-alt.disabled:active, .btn-info-alt.disabled:focus, .btn-info-alt.disabled:hover, .btn-info-alt[disabled], .btn-info-alt[disabled].active, .btn-info-alt[disabled]:active, .btn-info-alt[disabled]:focus, .btn-info-alt[disabled]:hover, fieldset[disabled] .btn-info-alt, fieldset[disabled] .btn-info-alt.active, fieldset[disabled] .btn-info-alt:active, fieldset[disabled] .btn-info-alt:focus, fieldset[disabled] .btn-info-alt:hover {
background-color:#669;
border-color:#5c5c8a
}
.btn-info-alt .badge {
color:#669;
background-color:#fff
}
.btn-dark {
color:#fff;
background-color:#242633;
border-color:#191b24
}
.btn-dark.active, .btn-dark:active, .btn-dark:focus, .btn-dark:hover, .open .btn-dark.dropdown-toggle {
color:#fff;
background-color:#13141b;
border-color:#000
}
.btn-dark.active, .btn-dark:active, .open .btn-dark.dropdown-toggle {
background-image:none
}
.btn-dark.disabled, .btn-dark.disabled.active, .btn-dark.disabled:active, .btn-dark.disabled:focus, .btn-dark.disabled:hover, .btn-dark[disabled], .btn-dark[disabled].active, .btn-dark[disabled]:active, .btn-dark[disabled]:focus, .btn-dark[disabled]:hover, fieldset[disabled] .btn-dark, fieldset[disabled] .btn-dark.active, fieldset[disabled] .btn-dark:active, fieldset[disabled] .btn-dark:focus, fieldset[disabled] .btn-dark:hover {
background-color:#242633;
border-color:#191b24
}
.btn-dark .badge {
color:#242633;
background-color:#fff
}
.btn-line-default {
color:#767676;
background-color:transparent;
border-color:#ededed
}
.btn-line-default.active, .btn-line-default:active, .btn-line-default:focus, .btn-line-default:hover, .open .btn-line-default.dropdown-toggle {
color:#767676;
background-color:#fafafa
}
.btn-line-primary {
color:#767676;
background-color:transparent;
border-color:#1e390e
}
.btn-line-primary.active, .btn-line-primary:active, .btn-line-primary:focus, .btn-line-primary:hover, .open .btn-line-primary.dropdown-toggle {
color:#fff;
background-color:#8E44AD
}
.btn-line-success {
color:#767676;
background-color:transparent;
border-color:#36a97f
}
.btn-line-success.active, .btn-line-success:active, .btn-line-success:focus, .btn-line-success:hover, .open .btn-line-success.dropdown-toggle {
color:#fff;
background-color:#27AE60
}
.btn-line-info {
color:#767676;
background-color:transparent;
border-color:#25a4be
}
.btn-line-info.active, .btn-line-info:active, .btn-line-info:focus, .btn-line-info:hover, .open .btn-line-info.dropdown-toggle {
color:#fff;
background-color:#3498DB
}
.btn-line-warning {
color:#767676;
background-color:transparent;
border-color:#f9bd39
}
.btn-line-warning.active, .btn-line-warning:active, .btn-line-warning:focus, .btn-line-warning:hover, .open .btn-line-warning.dropdown-toggle {
color:#fff;
background-color:#FAC552
}
.btn-line-danger {
color:#767676;
background-color:transparent;
border-color:#e52e18
}
.btn-line-danger.active, .btn-line-danger:active, .btn-line-danger:focus, .btn-line-danger:hover, .open .btn-line-danger.dropdown-toggle {
color:#fff;
background-color:#E9422E
}
.btn-line-dark {
color:#767676;
background-color:transparent;
border-color:#191b24
}
.btn-line-dark.active, .btn-line-dark:active, .btn-line-dark:focus, .btn-line-dark:hover, .open .btn-line-dark.dropdown-toggle {
color:#fff;
background-color:#242633
}
.btn-direction {
position:relative;
border:0;
line-height:20px
}
.btn-left {
border-top-left-radius:0;
border-bottom-left-radius:0
}
.btn-left:before {
content:" ";
line-height:0;
position:absolute;
top:0;
left:-26px;
border:16px solid transparent;
border-right:10px solid #fafafa
}
.btn-left:hover:before {
border-right:10px solid #e6e6e6
}
.btn-left.btn-primary:before {
border-right:10px solid #8E44AD
}
.btn-left.btn-primary:hover:before {
border-right:10px solid #182d0b
}
.btn-left.btn-success:before {
border-right:10px solid #27AE60
}
.btn-left.btn-success:hover:before {
border-right:10px solid #329d76
}
.btn-left.btn-info:before {
border-right:10px solid #3498DB
}
.btn-left.btn-info:hover:before {
border-right:10px solid #2299b1
}
.btn-left.btn-warning:before {
border-right:10px solid #FAC552
}
.btn-left.btn-warning:hover:before {
border-right:10px solid #E67E22
}
.btn-left.btn-danger:before {
border-right:10px solid #E9422E
}
.btn-left.btn-danger:hover:before {
border-right:10px solid #d82b17
}
.btn-right {
border-top-right-radius:0;
border-bottom-right-radius:0
}
.btn-right:before {
content:" ";
line-height:0;
position:absolute;
top:0;
right:-26px;
border:16px solid transparent;
border-left:10px solid #fafafa
}
.btn-right:hover:before {
border-left:10px solid #e6e6e6
}
.btn-right.btn-primary:before {
border-left:10px solid #8E44AD
}
.btn-right.btn-primary:hover:before {
border-left:10px solid #182d0b
}
.btn-right.btn-success:before {
border-left:10px solid #27AE60
}
.btn-right.btn-success:hover:before {
border-left:10px solid #329d76
}
.btn-right.btn-info:before {
border-left:10px solid #3498DB
}
.btn-right.btn-info:hover:before {
border-left:10px solid #2299b1
}
.btn-right.btn-warning:before {
border-left:10px solid #FAC552
}
.btn-right.btn-warning:hover:before {
border-left:10px solid #E67E22
}
.btn-right.btn-danger:before {
border-left:10px solid #E9422E
}
.btn-right.btn-danger:hover:before {
border-left:10px solid #d82b17
}
.btn-up:before {
content:" ";
line-height:0;
position:absolute;
top:-16px;
left:50%;
margin-left:-8px;
border:8px solid transparent;
border-bottom:8px solid #fafafa
}
.btn-up:hover:before {
border-bottom:8px solid #e6e6e6
}
.btn-up.btn-primary:before {
border-bottom:8px solid #8E44AD
}
.btn-up.btn-primary:hover:before {
border-bottom:8px solid #182d0b
}
.btn-up.btn-success:before {
border-bottom:8px solid #27AE60
}
.btn-up.btn-success:hover:before {
border-bottom:8px solid #329d76
}
.btn-up.btn-info:before {
border-bottom:8px solid #3498DB
}
.btn-up.btn-info:hover:before {
border-bottom:8px solid #2299b1
}
.btn-up.btn-warning:before {
border-bottom:8px solid #FAC552
}
.btn-up.btn-warning:hover:before {
border-bottom:8px solid #E67E22
}
.btn-up.btn-danger:before {
border-bottom:8px solid #E9422E
}
.btn-up.btn-danger:hover:before {
border-bottom:8px solid #d82b17
}
.btn-down:before {
content:" ";
line-height:0;
position:absolute;
bottom:-16px;
left:50%;
margin-left:-8px;
border:8px solid transparent;
border-top:8px solid #fafafa
}
.btn-down:hover:before {
border-top:8px solid #e6e6e6
}
.btn-down.btn-primary:before {
border-top:8px solid #8E44AD
}
.btn-down.btn-primary:hover:before {
border-top:8px solid #182d0b
}
.btn-down.btn-success:before {
border-top:8px solid #27AE60
}
.btn-down.btn-success:hover:before {
border-top:8px solid #329d76
}
.btn-down.btn-info:before {
border-top:8px solid #3498DB
}
.btn-down.btn-info:hover:before {
border-top:8px solid #2299b1
}
.btn-down.btn-warning:before {
border-top:8px solid #FAC552
}
.btn-down.btn-warning:hover:before {
border-top:8px solid #E67E22
}
.btn-down.btn-danger:before {
border-top:8px solid #E9422E
}
.btn-down.btn-danger:hover:before {
border-top:8px solid #d82b17
}
.btn-w-xs {
min-width:80px
}
.btn-w-sm {
min-width:100px
}
.btn-w-md {
min-width:120px
}
.btn-w-lg {
min-width:150px
}
.btn-round {
border-radius:2em
}
.btn-gap {
margin:5px
}
.btn-gap-h {
margin:0 5px
}
.btn-gap-v {
margin:0 0 5px
}
.btn-icon {
display:inline-block;
text-align:center;
border-radius:4px;
height:35px;
width:35px;
line-height:35px
}
.btn-icon.btn-icon-lined {
line-height:31px
}
.btn-icon:hover {
color:#fff
}
.btn-icon-lined {
display:inline-block;
text-align:center;
border-radius:4px;
background-color:#fff;
border:2px solid #767676;
color:#767676;
height:35px;
width:35px;
line-height:35px
}
.btn-icon-lined.btn-icon-lined {
line-height:31px
}
.btn-icon-lined:hover {
background-color:#fff;
color:#fff
}
.btn-icon-lined.btn-default-light, .btn-icon-lined.btn-default-light:hover {
color:#bbb;
border:2px solid #bbb
}
.btn-icon-lined.btn-default, .btn-icon-lined.btn-default:hover {
color:#999;
border:2px solid #999
}
.btn-icon-lined.btn-primary {
color:#8E44AD;
border:2px solid #8E44AD
}
.btn-icon-lined.btn-success {
color:#27AE60;
border:2px solid #27AE60
}
.btn-icon-lined.btn-info {
color:#3498DB;
border:2px solid #3498DB
}
.btn-icon-lined.btn-warning {
color:#FAC552;
border:2px solid #FAC552
}
.btn-icon-lined.btn-danger {
color:#E9422E;
border:2px solid #E9422E
}
.btn-icon-round {
border-radius:50%
}
.btn-icon-sm {
height:30px;
width:30px;
line-height:30px
}
.btn-icon-sm.btn-icon-lined {
line-height:26px
}
.btn-icon-md {
height:45px;
width:45px;
line-height:45px
}
.btn-icon-md.btn-icon-lined {
line-height:41px
}
.btn-icon-lg {
height:65px;
width:65px;
line-height:65px
}
.btn-icon-lg.btn-icon-lined {
line-height:61px
}
.btn-icon-lg-alt {
height:70px;
width:70px;
line-height:70px
}
.btn-icon-lg-alt.btn-icon-lined {
line-height:66px
}
.btn-icon-xl {
height:80px;
width:80px;
line-height:80px
}
.btn-icon-xl.btn-icon-lined {
line-height:76px
}
.btn-twitter {
color:#fff;
background-color:#00c7f7;
border-color:#00c7f7
}
.btn-twitter:hover {
color:#fff;
background-color:#00a6ce;
border-color:#0096ba
}
.btn-facebook {
color:#fff;
background-color:#335397;
border-color:#335397
}
.btn-facebook:hover {
color:#fff;
background-color:#294279;
border-color:#243a69
}
.btn-google-plus, .btn-gplus {
color:#fff;
background-color:#dd4a38;
border-color:#dd4a38
}
.btn-google-plus:hover, .btn-gplus:hover {
color:#fff;
background-color:#ca3522;
border-color:#b8301f
}
.btn-instagram {
color:#fff;
background-color:#82685A;
border-color:#82685A
}
.btn-instagram:hover {
color:#fff;
background-color:#6a5549;
border-color:#5e4b41
}
.btn-vimeo {
color:#fff;
background-color:#63879C;
border-color:#63879C
}
.btn-vimeo:hover {
color:#fff;
background-color:#537183;
border-color:#4b6777
}
.btn-flickr {
color:#fff;
background-color:#0061DB;
border-color:#0061DB
}
.btn-flickr:hover {
color:#fff;
background-color:#004fb2;
border-color:#00469e
}
.btn-github {
color:#fff;
background-color:#3B3B3B;
border-color:#3B3B3B
}
.btn-github:hover {
color:#fff;
background-color:#272727;
border-color:#1c1c1c
}
.btn-pinterest {
color:#fff;
background-color:#D73532;
border-color:#D73532
}
.btn-pinterest:hover {
color:#fff;
background-color:#bc2725;
border-color:#ab2421
}
.btn-tumblr {
color:#fff;
background-color:#586980;
border-color:#586980
}
.btn-tumblr:hover {
color:#fff;
background-color:#475568;
border-color:#3f4b5c
}
.btn-linkedin {
color:#fff;
background-color:#018FAF;
border-color:#018FAF
}
.btn-linkedin:hover {
color:#fff;
background-color:#016e86;
border-color:#015d72
}
.btn-dribbble {
color:#fff;
background-color:#EA73A0;
border-color:#EA73A0
}
.btn-dribbble:hover {
color:#fff;
background-color:#e55088;
border-color:#e23e7c
}
.btn-stumbleupon {
color:#fff;
background-color:#EA4B24;
border-color:#EA4B24
}
.btn-stumbleupon:hover {
color:#fff;
background-color:#d13914;
border-color:#bf3412
}
.btn-lastfm {
color:#fff;
background-color:#B80638;
border-color:#B80638
}
.btn-lastfm:hover {
color:#fff;
background-color:#90052c;
border-color:#7d0426
}
.btn-evernote {
color:#fff;
background-color:#3BAB27;
border-color:#3BAB27
}
.btn-evernote:hover {
color:#fff;
background-color:#308a1f;
border-color:#2a791c
}
.btn-skype {
color:#fff;
background-color:#00B0F6;
border-color:#00B0F6
}
.btn-skype:hover {
color:#fff;
background-color:#0093cd;
border-color:#0084b9
}
.btn-soundcloud {
color:#fff;
background-color:#06f;
border-color:#06f
}
.btn-soundcloud:hover {
color:#fff;
background-color:#0056d6;
border-color:#004ec2
}
.btn-behance {
color:#fff;
background-color:#B80638;
border-color:#B80638
}
.btn-behance:hover {
color:#fff;
background-color:#90052c;
border-color:#7d0426
}
.btn-rss {
color:#fff;
background-color:#F79638;
border-color:#F79638
}
.btn-rss:hover {
color:#fff;
background-color:#f58111;
border-color:#e87709
}
.btn-youtube {
color:#fff;
background-color:#CC181E;
border-color:#CC181E
}
.btn-youtube:hover {
color:#fff;
background-color:#a71419;
border-color:#951216
}
.btn-metro {
position:relative;
padding:0;
border:0;
width:180px;
height:180px;
font-size:21px;
text-align:center
}
.btn-metro i {
font-size:48px;
line-height:180px
}
.btn-metro span {
position:absolute;
left:15px;
bottom:15px
}
.content-container.ng-leave {
z-index:9999
}
.content-container.ng-enter {
z-index:8888
}
@-webkit-keyframes fade-up-enter {
0% {
opacity:0;
-webkit-transform:translateY(20px);
-moz-transform:translateY(20px);
-ms-transform:translateY(20px);
-o-transform:translateY(20px);
transform:translateY(20px)
}
100% {
opacity:1;
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
}
@-moz-keyframes fade-up-enter {
0% {
opacity:0;
-webkit-transform:translateY(20px);
-moz-transform:translateY(20px);
-ms-transform:translateY(20px);
-o-transform:translateY(20px);
transform:translateY(20px)
}
100% {
opacity:1;
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
}
@keyframes fade-up-enter {
0% {
opacity:0;
-webkit-transform:translateY(20px);
-moz-transform:translateY(20px);
-ms-transform:translateY(20px);
-o-transform:translateY(20px);
transform:translateY(20px)
}
100% {
opacity:1;
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
}
@-webkit-keyframes fade-up-leave {
0% {
opacity:1;
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
100% {
opacity:0;
-webkit-transform:translateY(-20px);
-moz-transform:translateY(-20px);
-ms-transform:translateY(-20px);
-o-transform:translateY(-20px);
transform:translateY(-20px)
}
}
@-moz-keyframes fade-up-leave {
0% {
opacity:1;
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
100% {
opacity:0;
-webkit-transform:translateY(-20px);
-moz-transform:translateY(-20px);
-ms-transform:translateY(-20px);
-o-transform:translateY(-20px);
transform:translateY(-20px)
}
}
@keyframes fade-up-leave {
0% {
opacity:1;
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
100% {
opacity:0;
-webkit-transform:translateY(-20px);
-moz-transform:translateY(-20px);
-ms-transform:translateY(-20px);
-o-transform:translateY(-20px);
transform:translateY(-20px)
}
}
.animate-fade-up.ng-enter {
-webkit-animation:.35s fade-up-enter;
-moz-animation:.35s fade-up-enter;
animation:.35s fade-up-enter
}
@-webkit-keyframes animate-flip-y-enter {
0% {
-webkit-transform:perspective(3000px) rotateY(90deg);
-moz-transform:perspective(3000px) rotateY(90deg);
-ms-transform:perspective(3000px) rotateY(90deg);
-o-transform:perspective(3000px) rotateY(90deg);
transform:perspective(3000px) rotateY(90deg);
opacity:0
}
100% {
-webkit-transform:perspective(3000px) rotateY(0deg);
-moz-transform:perspective(3000px) rotateY(0deg);
-ms-transform:perspective(3000px) rotateY(0deg);
-o-transform:perspective(3000px) rotateY(0deg);
transform:perspective(3000px) rotateY(0deg);
opacity:1
}
}
@-moz-keyframes animate-flip-y-enter {
0% {
-webkit-transform:perspective(3000px) rotateY(90deg);
-moz-transform:perspective(3000px) rotateY(90deg);
-ms-transform:perspective(3000px) rotateY(90deg);
-o-transform:perspective(3000px) rotateY(90deg);
transform:perspective(3000px) rotateY(90deg);
opacity:0
}
100% {
-webkit-transform:perspective(3000px) rotateY(0deg);
-moz-transform:perspective(3000px) rotateY(0deg);
-ms-transform:perspective(3000px) rotateY(0deg);
-o-transform:perspective(3000px) rotateY(0deg);
transform:perspective(3000px) rotateY(0deg);
opacity:1
}
}
@keyframes animate-flip-y-enter {
0% {
-webkit-transform:perspective(3000px) rotateY(90deg);
-moz-transform:perspective(3000px) rotateY(90deg);
-ms-transform:perspective(3000px) rotateY(90deg);
-o-transform:perspective(3000px) rotateY(90deg);
transform:perspective(3000px) rotateY(90deg);
opacity:0
}
100% {
-webkit-transform:perspective(3000px) rotateY(0deg);
-moz-transform:perspective(3000px) rotateY(0deg);
-ms-transform:perspective(3000px) rotateY(0deg);
-o-transform:perspective(3000px) rotateY(0deg);
transform:perspective(3000px) rotateY(0deg);
opacity:1
}
}
@-webkit-keyframes animate-flip-y-leave {
0% {
-webkit-transform:perspective(3000px) rotateY(0deg);
-moz-transform:perspective(3000px) rotateY(0deg);
-ms-transform:perspective(3000px) rotateY(0deg);
-o-transform:perspective(3000px) rotateY(0deg);
transform:perspective(3000px) rotateY(0deg);
opacity:1
}
100% {
-webkit-transform:perspective(3000px) rotateY(-90deg);
-moz-transform:perspective(3000px) rotateY(-90deg);
-ms-transform:perspective(3000px) rotateY(-90deg);
-o-transform:perspective(3000px) rotateY(-90deg);
transform:perspective(3000px) rotateY(-90deg);
opacity:0
}
}
@-moz-keyframes animate-flip-y-leave {
0% {
-webkit-transform:perspective(3000px) rotateY(0deg);
-moz-transform:perspective(3000px) rotateY(0deg);
-ms-transform:perspective(3000px) rotateY(0deg);
-o-transform:perspective(3000px) rotateY(0deg);
transform:perspective(3000px) rotateY(0deg);
opacity:1
}
100% {
-webkit-transform:perspective(3000px) rotateY(-90deg);
-moz-transform:perspective(3000px) rotateY(-90deg);
-ms-transform:perspective(3000px) rotateY(-90deg);
-o-transform:perspective(3000px) rotateY(-90deg);
transform:perspective(3000px) rotateY(-90deg);
opacity:0
}
}
@keyframes animate-flip-y-leave {
0% {
-webkit-transform:perspective(3000px) rotateY(0deg);
-moz-transform:perspective(3000px) rotateY(0deg);
-ms-transform:perspective(3000px) rotateY(0deg);
-o-transform:perspective(3000px) rotateY(0deg);
transform:perspective(3000px) rotateY(0deg);
opacity:1
}
100% {
-webkit-transform:perspective(3000px) rotateY(-90deg);
-moz-transform:perspective(3000px) rotateY(-90deg);
-ms-transform:perspective(3000px) rotateY(-90deg);
-o-transform:perspective(3000px) rotateY(-90deg);
transform:perspective(3000px) rotateY(-90deg);
opacity:0
}
}
.animate-flip-y.ng-enter {
-webkit-animation:.35s animate-flip-y-enter ease-in-out;
-moz-animation:.35s animate-flip-y-enter ease-in-out;
animation:.35s animate-flip-y-enter ease-in-out
}
@-webkit-keyframes slideInDown {
0% {
opacity:0;
-webkit-transform:translateY(-2000px);
-moz-transform:translateY(-2000px);
-ms-transform:translateY(-2000px);
-o-transform:translateY(-2000px);
transform:translateY(-2000px)
}
100% {
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
}
@-moz-keyframes slideInDown {
0% {
opacity:0;
-webkit-transform:translateY(-2000px);
-moz-transform:translateY(-2000px);
-ms-transform:translateY(-2000px);
-o-transform:translateY(-2000px);
transform:translateY(-2000px)
}
100% {
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
}
@keyframes slideInDown {
0% {
opacity:0;
-webkit-transform:translateY(-2000px);
-moz-transform:translateY(-2000px);
-ms-transform:translateY(-2000px);
-o-transform:translateY(-2000px);
transform:translateY(-2000px)
}
100% {
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
}
@-webkit-keyframes slideOutUp {
0% {
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
100% {
opacity:0;
-webkit-transform:translateY(-2000px);
-moz-transform:translateY(-2000px);
-ms-transform:translateY(-2000px);
-o-transform:translateY(-2000px);
transform:translateY(-2000px)
}
}
@-moz-keyframes slideOutUp {
0% {
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
100% {
opacity:0;
-webkit-transform:translateY(-2000px);
-moz-transform:translateY(-2000px);
-ms-transform:translateY(-2000px);
-o-transform:translateY(-2000px);
transform:translateY(-2000px)
}
}
@keyframes slideOutUp {
0% {
-webkit-transform:translateY(0);
-moz-transform:translateY(0);
-ms-transform:translateY(0);
-o-transform:translateY(0);
transform:translateY(0)
}
100% {
opacity:0;
-webkit-transform:translateY(-2000px);
-moz-transform:translateY(-2000px);
-ms-transform:translateY(-2000px);
-o-transform:translateY(-2000px);
transform:translateY(-2000px)
}
}
.animate-vertical-slide.ng-hide-add {
-webkit-animation:.35s slideOutUp ease-in-out;
-moz-animation:.35s slideOutUp ease-in-out;
animation:.35s slideOutUp ease-in-out
}
.animate-vertical-slide.ng-hide-remove {
-webkit-animation:.35s .35s slideInDown ease-in-out;
-moz-animation:.35s .35s slideInDown ease-in-out;
animation:.35s .35s slideInDown ease-in-out
}
@-webkit-keyframes slideOutUp {
0% {
opacity:0;
-webkit-transform:scale(0.95);
-moz-transform:scale(0.95);
-ms-transform:scale(0.95);
-o-transform:scale(0.95);
transform:scale(0.95)
}
100% {
opacity:1;
-webkit-transform:scale(1);
-moz-transform:scale(1);
-ms-transform:scale(1);
-o-transform:scale(1);
transform:scale(1)
}
}
@-moz-keyframes slideOutUp {
0% {
opacity:0;
-webkit-transform:scale(0.95);
-moz-transform:scale(0.95);
-ms-transform:scale(0.95);
-o-transform:scale(0.95);
transform:scale(0.95)
}
100% {
opacity:1;
-webkit-transform:scale(1);
-moz-transform:scale(1);
-ms-transform:scale(1);
-o-transform:scale(1);
transform:scale(1)
}
}
@keyframes slideOutUp {
0% {
opacity:0;
-webkit-transform:scale(0.95);
-moz-transform:scale(0.95);
-ms-transform:scale(0.95);
-o-transform:scale(0.95);
transform:scale(0.95)
}
100% {
opacity:1;
-webkit-transform:scale(1);
-moz-transform:scale(1);
-ms-transform:scale(1);
-o-transform:scale(1);
transform:scale(1)
}
}
.ainmate-scale-up.ng-enter {
-webkit-animation:.35s slideOutUp ease-in-out;
-moz-animation:.35s slideOutUp ease-in-out;
animation:.35s slideOutUp ease-in-out
}
@-webkit-keyframes slideInRight {
0% {
opacity:0;
-webkit-transform:translateX(25px);
-moz-transform:translateX(25px);
-ms-transform:translateX(25px);
-o-transform:translateX(25px);
transform:translateX(25px)
}
100% {
opacity:1;
-webkit-transform:translateX(0);
-moz-transform:translateX(0);
-ms-transform:translateX(0);
-o-transform:translateX(0);
transform:translateX(0)
}
}
@-moz-keyframes slideInRight {
0% {
opacity:0;
-webkit-transform:translateX(25px);
-moz-transform:translateX(25px);
-ms-transform:translateX(25px);
-o-transform:translateX(25px);
transform:translateX(25px)
}
100% {
opacity:1;
-webkit-transform:translateX(0);
-moz-transform:translateX(0);
-ms-transform:translateX(0);
-o-transform:translateX(0);
transform:translateX(0)
}
}
@keyframes slideInRight {
0% {
opacity:0;
-webkit-transform:translateX(25px);
-moz-transform:translateX(25px);
-ms-transform:translateX(25px);
-o-transform:translateX(25px);
transform:translateX(25px)
}
100% {
opacity:1;
-webkit-transform:translateX(0);
-moz-transform:translateX(0);
-ms-transform:translateX(0);
-o-transform:translateX(0);
transform:translateX(0)
}
}
.ainmate-slide-in-right.ng-enter {
-webkit-animation:.35s slideInRight ease-in-out;
-moz-animation:.35s slideInRight ease-in-out;
animation:.35s slideInRight ease-in-out
}
.badge-primary {
background-color:#8E44AD
}
.badge-success {
background-color:#27AE60
}
.badge-info {
background-color:#3498DB
}
.badge-warning {
background-color:#FAC552
}
.badge-danger {
background-color:#E9422E
}
.breadcrumb a {
color:#767676
}
.breadcrumb a:hover {
text-decoration:none
}
.breadcrumb-alt {
overflow:hidden;
list-style:none;
margin:0 0 20px;
padding:0;
width:100%
}
.breadcrumb-alt>li {
float:left;
margin:0 25px 0 0
}
.breadcrumb-alt>li>a {
position:relative;
float:left;
background-color:#eee;
color:#767676;
font-size:12px;
padding:10px
}
.breadcrumb-alt>li>a:before {
position:absolute;
top:50%;
left:-1em;
margin-top:-1.6em;
border-color:#eee #eee #eee transparent;
border-style:solid;
border-width:1.5em 0 1.7em 1em;
content:""
}
.breadcrumb-alt>li>a:after {
position:absolute;
top:50%;
right:-1em;
margin-top:-1.5em;
border-bottom:1.5em solid transparent;
border-left:1em solid #eee;
border-top:1.5em solid transparent;
content:""
}
.breadcrumb-alt>li>a.active, .breadcrumb-alt>li>a:hover {
text-decoration:none;
background-color:#8E44AD;
color:#fff
}
.breadcrumb-alt>li>a.active:before, .breadcrumb-alt>li>a:hover:before {
border-color:#8E44AD #8E44AD #8E44AD transparent
}
.breadcrumb-alt>li>a.active:after, .breadcrumb-alt>li>a:hover:after {
border-left:1em solid #8E44AD
}
.ui-bullet {
overflow:auto
}
.ui-bullet .btn-icon {
float:left;
font-size:26px
}
.ui-bullet .ui-bullet-content {
margin-left:75px;
margin-bottom:2em
}
.ui-bullet h3 {
display:inline-block;
border-bottom:1px solid rgba(118, 118, 118, .2);
font-size:24px;
margin:.5em 0 .6em
}
.callout {
margin:20px 0;
padding:20px;
border-left:3px solid #eee
}
.callout h4 {
margin-top:0;
margin-bottom:5px
}
.callout p:last-child {
margin-bottom:0
}
.callout-success {
background-color:#f3faf3;
border-color:#27AE60
}
.callout-success h4 {
color:#27AE60
}
.callout-info {
background-color:#f4f8fa;
border-color:#3498DB
}
.callout-info h4 {
color:#3498DB
}
.callout-warning {
background-color:#fcf8f2;
border-color:#FAC552
}
.callout-warning h4 {
color:#FAC552
}
.callout-danger {
background-color:#fdf7f7;
border-color:#E9422E
}
.callout-danger h4 {
color:#E9422E
}
.dropdown-menu {
box-shadow:none
}
.dropdown-menu.dropdown-dark {
background-color:#242633
}
.dropdown-menu.dropdown-dark.with-arrow:after {
border-bottom:7px solid #242633
}
.dropdown-menu.dropdown-dark>li>a {
color:#999
}
.dropdown-menu.with-arrow {
margin-top:0
}
.dropdown-menu.with-arrow:before {
content:" ";
position:absolute;
left:12px;
top:-16px;
border:8px solid transparent;
border-bottom:8px solid rgba(0, 0, 0, .15)
}
.dropdown-menu.with-arrow:after {
content:" ";
position:absolute;
left:13px;
top:-14px;
border:7px solid transparent;
border-bottom:7px solid #fff
}
.dropdown-menu.with-arrow.pull-right {
margin-top:0
}
.dropdown-menu.with-arrow.pull-right:before {
left:auto;
right:12px
}
.dropdown-menu.with-arrow.pull-right:after {
left:auto;
right:13px
}
.dropdown-menu.with-arrow.panel {
border:0;
box-shadow:0 1px 3px rgba(0, 0, 0, .2)
}
.dropdown-menu.with-arrow.panel-default:before {
border-bottom:8px solid #e9e9e9
}
.dropdown-menu.with-arrow.panel-default:after {
border-bottom:7px solid #f6f6f6
}
.dropdown-menu.with-arrow.panel-dark:before {
border-bottom:8px solid #242633
}
.dropdown-menu.with-arrow.panel-dark:after {
border-bottom:7px solid #242633
}
.dropdown-menu.with-arrow.panel-primary:before {
border-bottom:8px solid #8E44AD
}
.dropdown-menu.with-arrow.panel-primary:after {
border-bottom:7px solid #8E44AD
}
.dropdown-menu.with-arrow.panel-success:before {
border-bottom:8px solid #ebf8cd
}
.dropdown-menu.with-arrow.panel-success:after {
border-bottom:7px solid #F0FBE3
}
.dropdown-menu.with-arrow.panel-info:before {
border-bottom:8px solid #c5f1fa
}
.dropdown-menu.with-arrow.panel-info:after {
border-bottom:7px solid #E6F5FD
}
.dropdown-menu.with-arrow.panel-warning:before {
border-bottom:8px solid #ffecd4
}
.dropdown-menu.with-arrow.panel-warning:after {
border-bottom:7px solid #FFFAED
}
.dropdown-menu.with-arrow.panel-danger:before {
border-bottom:8px solid #f7d0d1
}
.dropdown-menu.with-arrow.panel-danger:after {
border-bottom:7px solid #FBE9E6
}
img.img30_30 {
width:30px;
height:30px
}
img.img64_64 {
width:64px;
height:64px
}
img.img80_80 {
width:80px;
height:80px
}
.label {
padding:.5em .8em
}
.label-info-alt {
background:#669
}
.list-group-item {
padding:15px;
border:1px solid #f3f3f3
}
.list-info li {
padding:10px;
border-bottom:1px solid #eee
}
.list-info li:last-child {
border-bottom:none
}
.list-info li .icon {
margin-right:10px;
color:#8E44AD
}
.list-info li label {
width:100px
}
.mail-categories .list-group .list-group-item {
padding:0
}
.mail-categories .list-group .list-group-item.active>a {
border-left:3px solid #8E44AD;
color:#8E44AD;
background-color:#fafafa
}
.mail-categories .list-group .list-group-item>a {
display:block;
padding:15px;
text-decoration:none;
-webkit-transition:all .25s ease-in-out;
-moz-transition:all .25s ease-in-out;
transition:all .25s ease-in-out
}
.mail-categories .list-group .list-group-item>a:hover {
border-left:3px solid #8E44AD;
color:#8E44AD;
background-color:#fafafa
}
.mail-categories .list-group .list-group-item>a>i {
font-size:16px;
width:18px;
margin-right:5px
}
.mail-categories .list-group .list-group-item>a>i.fa-circle {
font-size:14px
}
.mail-container .mail-options {
padding:12px
}
.mail-container .table {
margin-bottom:0;
border-top:1px solid #ddd
}
.mail-container .table tr:hover {
cursor:pointer
}
.mail-container .table tr>td {
padding:12px
}
.mail-container .table tr>td>.fa-star {
color:#ccc
}
.mail-container .table tr>td>.fa-star.active {
color:#E9422E
}
.mail-container .table label.ui-checkbox {
margin-bottom:0
}
.mail-container .table .mail-unread {
font-weight:700;
color:#333
}
.mail-container .table .mail-hightlight td {
background-color:#FFFAED
}
.mail-container .mail-header {
padding:15px 0
}
.mail-container .mail-header h3 {
margin-top:0
}
.mail-container .mail-info {
padding:10px 15px;
border-top:1px solid #f1f1f1;
border-bottom:1px solid #f1f1f1
}
.mail-container .mail-info .col-md-4, .mail-container .mail-info .col-md-8 {
padding:0
}
.mail-container .mail-attachments, .mail-container .mail-content {
padding:15px 0;
border-bottom:1px solid #f1f1f1
}
.mail-container .mail-attachments .list-attachs img {
max-width:200px;
max-height:200px
}
.mail-container .mail-actions {
margin-top:10px
}
.mail-compose .form-group>input, .mail-compose .form-group>input:focus {
border:none
}
.mail-compose .mail-actions {
margin-top:10px
}
.nav-boxed {
box-shadow:0 0 2px rgba(0, 0, 0, .2);
background-color:#fff;
border-radius:4px
}
.nav-boxed.nav-justified>li>a {
margin:0
}
.nav-boxed>li>a {
display:block;
padding:10px 5px;
border-left:0;
border-top:1px solid #f3f3f3
}
@media (min-width:768px) {
.nav-boxed>li>a {
border-top:0;
border-left:1px solid #f3f3f3
}
}
.nav-boxed>li>a>i {
display:block;
width:40px;
height:40px;
line-height:40px;
margin:0 auto 2px;
font-size:30px
}
.nav-boxed>li:first-child>a {
border-left:none;
border-top:0
}
@media (min-width:768px) {
.nav-boxed>li:first-child>a {
border-left:1px solid #f3f3f3
}
}
.panel {
box-shadow:0 0 3px rgba(0, 0, 0, .1)
}
.panel .panel-heading {
text-transform:uppercase
}
.panel .panel-title {
font-size:14px
}
.panel-dark {
border-color:#242633
}
.panel-dark>.panel-heading {
color:#fff;
background-color:#242633;
border-color:#242633
}
.panel-dark>.panel-heading+.panel-collapse .panel-body {
border-top-color:#242633
}
.panel-dark>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#242633
}
.panel-box {
display:table;
table-layout:fixed;
width:100%;
height:100%;
text-align:center;
border:none
}
.panel-box .panel-item {
display:table-cell;
padding:30px;
width:1%;
vertical-align:top;
border-radius:0
}
.panel-box .panel-left {
border-top-left-radius:4px;
border-bottom-left-radius:4px
}
.panel-box .panel-right {
border-top-right-radius:4px;
border-bottom-right-radius:4px
}
.panel-box.info-box i {
line-height:70px
}
.panel-box .panel-bottom, .panel-box .panel-top {
display:block
}
.panel-box .panel-top {
padding:30px 20px;
border-top-left-radius:4px;
border-top-right-radius:4px
}
.panel-box .panel-bottom {
padding:10px;
border-bottom-left-radius:4px;
border-bottom-right-radius:4px
}
.panel-box .panel-bottom p {
margin:0
}
.panel-box .list-justified-container {
padding:15px 0
}
.panel-box ul.list-justified {
display:table;
width:100%;
list-style:none;
padding:0
}
.panel-box ul.list-justified>li {
float:none;
display:table-cell;
padding:10px;
width:1%;
border-right:1px solid #eee
}
.panel-box ul.list-justified>li:last-child {
border:none
}
.panel-box ul.list-justified>li p {
margin:0
}
.panel-box .panel-icon, .panel-box .panel-img {
display:block;
margin:-75px auto 0;
border-radius:50%;
border:10px solid #fff;
width:150px;
height:150px;
line-height:80px;
text-align:center;
font-size:58px;
text-shadow:-6px 8px 5px rgba(0, 0, 0, .3)
}
.panel-box .panel-icon {
padding:28px 35px 35px
}
.panel-box .panel-img {
padding:0
}
.panel-box .panel-img img {
width:100%;
max-width:100%
}
.mini-box {
min-height:120px;
padding:25px
}
.mini-box .box-icon {
display:block;
float:left;
margin:0 15px 10px 0;
width:70px;
height:70px;
line-height:70px;
vertical-align:middle;
text-align:center;
font-size:35px;
border-radius:4px
}
.mini-box .box-icon.rounded {
border-radius:50%
}
.mini-box .btn-icon-lined {
float:left;
margin:0 15px 10px 0;
font-size:32px
}
.mini-box .box-info p {
margin:0
}
.panel-profile {
border:none
}
.panel-profile .profile {
margin:5px 15px 5px 5px;
border-radius:50%;
padding:5px;
border:1px solid rgba(0, 0, 0, .2)
}
.panel-profile .profile img {
border-radius:50%
}
.panel-profile .list-group>li>i {
margin-right:10px;
font-size:16px;
color:#999;
table-layout:fixed
}
.panel-profile .list-justified-container {
padding:15px 0
}
.panel-profile ul.list-justified {
display:table;
width:100%;
list-style:none;
padding:0
}
.panel-profile ul.list-justified>li {
float:none;
display:table-cell;
padding:10px;
width:1%;
border-right:1px solid #eee
}
.panel-profile ul.list-justified>li:last-child {
border:none
}
.panel-profile ul.list-justified>li p {
margin:0
}
.popover-title {
padding:8px 14px 0;
color:#aaa;
font-weight:700;
border-bottom:none
}
.popover-content {
color:#fafafa
}
.pricing-table {
margin-bottom:20px;
text-align:center;
background-color:#fcfcfc;
color:#767676;
border-radius:6px;
box-shadow:0 0 3px rgba(0, 0, 0, .2)
}
.pricing-table>header {
display:block;
margin:0;
padding:30px 40px;
font-size:22px;
line-height:1;
font-weight:700;
text-transform:uppercase
}
.pricing-table .pricing-price {
padding:14px;
font-size:18px;
color:#fff;
background-color:#ccc;
border-bottom:3px solid #b8b8b8
}
.pricing-table .pricing-body>ul {
margin:0;
padding:0;
list-style:none;
font-size:16px
}
.pricing-table .pricing-body>ul>li {
padding:12px;
border-bottom:1px solid rgba(0, 0, 0, .05);
background-color:#f9f9f9
}
.pricing-table .pricing-body>ul>li:nth-child(odd) {
background-color:#eee
}
.pricing-table .pricing-body>ul>li strong {
color:#242633
}
.pricing-table>footer {
padding:30px 40px
}
.pricing-table>footer>a {
display:block;
margin:0;
font-size:16px
}
.pricing-table.pricing-table-dark .pricing-price {
background-color:#242633;
border-bottom:3px solid #13141b
}
.pricing-table.pricing-table-primary .pricing-price {
background-color:#8E44AD;
border-bottom:3px solid #182d0b
}
.pricing-table.pricing-table-success .pricing-price {
background-color:#27AE60;
border-bottom:3px solid #329d76
}
.pricing-table.pricing-table-info .pricing-price {
background-color:#3498DB;
border-bottom:3px solid #2299b1
}
.pricing-table.pricing-table-warning .pricing-price {
background-color:#FAC552;
border-bottom:3px solid #E67E22
}
.pricing-table.pricing-table-danger .pricing-price {
background-color:#E9422E;
border-bottom:3px solid #d82b17
}
.ui-ribbon-container {
position:relative
}
.ui-ribbon-container .ui-ribbon-wrapper {
position:absolute;
overflow:hidden;
width:85px;
height:88px;
top:-3px;
right:-3px
}
.ui-ribbon-container .ui-ribbon {
position:relative;
display:block;
text-align:center;
font-size:15px;
font-weight:700;
color:#fff;
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
-ms-transform:rotate(45deg);
-o-transform:rotate(45deg);
transform:rotate(45deg);
padding:7px 0;
left:-5px;
top:15px;
width:120px;
line-height:20px;
background-color:#555;
box-shadow:0 0 3px rgba(0, 0, 0, .3)
}
.ui-ribbon-container .ui-ribbon:after, .ui-ribbon-container .ui-ribbon:before {
position:absolute;
content:" ";
line-height:0;
border-top:2px solid #555;
border-left:2px solid transparent;
border-right:2px solid transparent;
bottom:-2px
}
.ui-ribbon-container .ui-ribbon:before {
left:0;
bottom:-1px
}
.ui-ribbon-container .ui-ribbon:after {
right:0
}
.ui-ribbon-container.ui-ribbon-primary .ui-ribbon {
background-color:#8E44AD
}
.ui-ribbon-container.ui-ribbon-primary .ui-ribbon:after, .ui-ribbon-container.ui-ribbon-primary .ui-ribbon:before {
border-top:2px solid #8E44AD
}
.ui-ribbon-container.ui-ribbon-success .ui-ribbon {
background-color:#27AE60
}
.ui-ribbon-container.ui-ribbon-success .ui-ribbon:after, .ui-ribbon-container.ui-ribbon-success .ui-ribbon:before {
border-top:2px solid #27AE60
}
.ui-ribbon-container.ui-ribbon-info .ui-ribbon {
background-color:#3498DB
}
.ui-ribbon-container.ui-ribbon-info .ui-ribbon:after, .ui-ribbon-container.ui-ribbon-info .ui-ribbon:before {
border-top:2px solid #3498DB
}
.ui-ribbon-container.ui-ribbon-warning .ui-ribbon {
background-color:#FAC552
}
.ui-ribbon-container.ui-ribbon-warning .ui-ribbon:after, .ui-ribbon-container.ui-ribbon-warning .ui-ribbon:before {
border-top:2px solid #FAC552
}
.ui-ribbon-container.ui-ribbon-danger .ui-ribbon {
background-color:#E9422E
}
.ui-ribbon-container.ui-ribbon-danger .ui-ribbon:after, .ui-ribbon-container.ui-ribbon-danger .ui-ribbon:before {
border-top:2px solid #E9422E
}
.flags-american, .flags-china, .flags-france, .flags-germany, .flags-italy, .flags-japan, .flags-korea, .flags-portugal, .flags-russia, .flags-spain, .flags-sprite {
background-image:url(ui/images/flags-s9e6bfd0b60.png);
background-repeat:no-repeat
}
.flags-american {
background-position:0 0;
height:21px;
width:32px
}
.flags-china {
background-position:0 -21px;
height:21px;
width:32px
}
.flags-france {
background-position:0 -42px;
height:21px;
width:32px
}
.flags-germany {
background-position:0 -63px;
height:21px;
width:32px
}
.flags-italy {
background-position:0 -84px;
height:21px;
width:32px
}
.flags-japan {
background-position:0 -105px;
height:21px;
width:32px
}
.flags-korea {
background-position:0 -126px;
height:21px;
width:32px
}
.flags-portugal {
background-position:0 -147px;
height:21px;
width:32px
}
.flags-russia {
background-position:0 -168px;
height:21px;
width:32px
}
.flags-spain {
background-position:0 -189px;
height:21px;
width:32px
}
.ui-timline-container {
padding:15px
}
.ui-timline-left .ui-timeline:before {
left:0
}
@media (min-width:768px) {
.ui-timline-left .ui-timeline .tl-item:before {
display:none
}
}
@media (min-width:768px) {
.ui-timline-left .ui-timeline .tl-item .tl-caption {
margin-left:-55px
}
}
@media (min-width:768px) {
.ui-timline-left .ui-timeline .tl-item .tl-body .tl-time {
left:auto;
right:15px;
color:#999
}
}
.ui-timeline {
display:table;
position:relative;
table-layout:fixed;
width:100%;
border-spacing:0;
border-collapse:collapse
}
.ui-timeline:before {
background-color:#d5d5d5;
bottom:0;
content:"";
position:absolute;
left:0;
top:30px;
width:1px;
z-index:0
}
@media (min-width:768px) {
.ui-timeline:before {
left:50%
}
}
.ui-timeline .tl-item {
display:table-row;
margin-bottom:5px
}
.ui-timeline .tl-item:before {
display:none;
content:""
}
@media (min-width:768px) {
.ui-timeline .tl-item:before {
display:block;
width:50%
}
}
.ui-timeline .tl-item .tl-caption {
width:150px;
margin-left:-55px
}
@media (min-width:768px) {
.ui-timeline .tl-item .tl-caption {
margin-left:-110px
}
}
@media (min-width:768px) {
.ui-timeline .tl-item.alt {
text-align:right
}
.ui-timeline .tl-item.alt:before {
display:none
}
.ui-timeline .tl-item.alt:after {
content:"";
display:block;
width:50%
}
.ui-timeline .tl-item.alt .tl-body .tl-entry {
margin:0 35px 15px 0
}
.ui-timeline .tl-item.alt .tl-body .tl-time {
right:-220px;
left:auto;
text-align:left
}
.ui-timeline .tl-item.alt .tl-body .tl-icon {
right:-53px;
left:auto
}
.ui-timeline .tl-item.alt .tl-body .tl-content:after {
right:-16px;
left:auto;
border:8px solid transparent;
border-left:8px solid #fff
}
}
.ui-timeline .tl-item .tl-body {
display:table-cell;
width:50%;
vertical-align:top
}
.ui-timeline .tl-item .tl-body .tl-entry {
position:relative;
margin:0 0 15px 36px
}
.ui-timeline .tl-item .tl-body .tl-time {
z-index:1;
position:absolute;
left:auto;
right:15px;
top:5px;
width:150px;
color:#999;
line-height:35px;
text-align:right
}
@media (min-width:768px) {
.ui-timeline .tl-item .tl-body .tl-time {
left:-220px;
right:auto;
color:#767676
}
}
.ui-timeline .tl-item .tl-body .tl-icon {
position:absolute;
left:-53px;
top:5px
}
.ui-timeline .tl-item .tl-body .tl-content {
position:relative;
padding:15px;
border-radius:4px;
background-color:#fff
}
.ui-timeline .tl-item .tl-body .tl-content:after {
content:" ";
line-height:0;
position:absolute;
left:-16px;
top:15px;
border:8px solid transparent;
border-right:8px solid #fff
}
.tooltip-inner {
padding:.85em
}
.ui-accordion .panel-group .panel-heading+.panel-collapse .panel-body {
border-top:1px solid #e9e9e9
}
.ui-accordion .panel {
border:1px solid #e9e9e9
}
.ui-accordion .panel-heading {
padding:0;
background-color:#f6f6f6
}
.ui-accordion .panel-heading .panel-title>a {
display:block;
padding:15px;
font-size:14px
}
.ui-accordion .panel-heading .panel-title>a:hover {
cursor:pointer;
text-decoration:none
}
.ui-accordion-success .panel {
border:1px solid #27AE60
}
.ui-accordion-success .panel-heading {
background-color:#27AE60;
color:#fff
}
.ui-accordion-info .panel {
border:1px solid #3498DB
}
.ui-accordion-info .panel-heading {
background-color:#3498DB;
color:#fff
}
.ui-accordion-warning .panel {
border:1px solid #FAC552
}
.ui-accordion-warning .panel-heading {
background-color:#FAC552;
color:#fff
}
.ui-accordion-danger .panel {
border:1px solid #E9422E
}
.ui-accordion-danger .panel-heading {
background-color:#E9422E;
color:#fff
}
.ui-accordion-dark .panel {
border:1px solid #242633
}
.ui-accordion-dark .panel-heading {
background-color:#242633;
color:#fff
}
.pagination-lg>li span, .pagination-lg>li>a {
line-height:26px;
padding:10px 18px
}
.pagination>li:first-child>a, .pagination>li:first-child>span, .pagination>li:last-child>a, .pagination>li:last-child>span {
border-radius:24px
}
.pagination>li>a {
border-radius:24px;
cursor:pointer
}
.pagination>li>a, .pagination>li>span {
margin-left:3px
}
.progress {
box-shadow:none;
background-color:#f6f6f6
}
.progress-rounded {
border-radius:50px
}
.progress-bar {
box-shadow:none
}
.progressbar-xs {
height:10px
}
.progressbar-sm {
height:15px
}
.ui-tab-container .ui-tab .nav-tabs {
margin-bottom:0
}
.ui-tab-container .nav-tabs {
background-color:transparent;
border-bottom:0
}
.ui-tab-container .nav-tabs.nav-justified {
border-bottom:0
}
.ui-tab-container .nav-tabs.nav-justified>li>a {
border-bottom-color:transparent
}
.ui-tab-container .nav-tabs>li {
margin-bottom:-2px;
margin-top:4px
}
.ui-tab-container .nav-tabs>li.active {
margin-top:0
}
.ui-tab-container .nav-tabs>li.active>a {
color:#767676;
padding:12px 22px;
border:1px solid #e9e9e9;
border-bottom:0;
box-shadow:0 -1px 1px rgba(0, 0, 0, .1);
background-color:#fff
}
.ui-tab-container .nav-tabs>li.active>a:hover {
border:1px solid #e9e9e9;
border-bottom:0;
background-color:#fff
}
.ui-tab-container .nav-tabs>li>a {
margin-right:3px;
padding:10px 22px;
border:none;
color:#fafafa;
background-color:#8E44AD
}
.ui-tab-container .nav-tabs>li>a:hover {
background-color:#254611;
border:none
}
.ui-tab-container .tab-content {
padding:15px;
border:1px solid #e9e9e9;
box-shadow:0 1px 1px rgba(0, 0, 0, .1);
background-color:#fff;
border-radius:4px
}
.ui-tab-container.ui-tab-dark .nav-tabs>li.active {
margin-top:0
}
.ui-tab-container.ui-tab-dark .nav-tabs>li.active>a, .ui-tab-container.ui-tab-dark .nav-tabs>li.active>a:hover {
background-color:#fff
}
.ui-tab-container.ui-tab-dark .nav-tabs>li>a {
background-color:#242633
}
.ui-tab-container.ui-tab-dark .nav-tabs>li>a:hover {
background-color:#20222d
}
.ui-tab-container.ui-tab-success .nav-tabs>li.active {
margin-top:0
}
.ui-tab-container.ui-tab-success .nav-tabs>li.active>a, .ui-tab-container.ui-tab-success .nav-tabs>li.active>a:hover {
background-color:#fff
}
.ui-tab-container.ui-tab-success .nav-tabs>li>a {
background-color:#27AE60
}
.ui-tab-container.ui-tab-success .nav-tabs>li>a:hover {
background-color:#3ab487
}
.ui-tab-container.ui-tab-info .nav-tabs>li.active {
margin-top:0
}
.ui-tab-container.ui-tab-info .nav-tabs>li.active>a, .ui-tab-container.ui-tab-info .nav-tabs>li.active>a:hover {
background-color:#fff
}
.ui-tab-container.ui-tab-info .nav-tabs>li>a {
background-color:#3498DB
}
.ui-tab-container.ui-tab-info .nav-tabs>li>a:hover {
background-color:#27b0ca
}
.ui-tab-container.ui-tab-warning .nav-tabs>li.active {
margin-top:0
}
.ui-tab-container.ui-tab-warning .nav-tabs>li.active>a, .ui-tab-container.ui-tab-warning .nav-tabs>li.active>a:hover {
background-color:#fff
}
.ui-tab-container.ui-tab-warning .nav-tabs>li>a {
background-color:#FAC552
}
.ui-tab-container.ui-tab-warning .nav-tabs>li>a:hover {
background-color:#fac248
}
.ui-tab-container.ui-tab-danger .nav-tabs>li.active {
margin-top:0
}
.ui-tab-container.ui-tab-danger .nav-tabs>li.active>a, .ui-tab-container.ui-tab-danger .nav-tabs>li.active>a:hover {
background-color:#fff
}
.ui-tab-container.ui-tab-danger .nav-tabs>li>a {
background-color:#E9422E
}
.ui-tab-container.ui-tab-danger .nav-tabs>li>a:hover {
background-color:#e83a25
}
.ui-tab .nav-tabs {
margin-bottom:15px
}
.ui-tab .nav-tabs.nav-justified>li.active>a {
border-bottom-color:transparent
}
.ui-tab .nav-tabs>li.active>a {
background-color:#fff
}
.ui-tab .nav-tabs a:hover {
cursor:pointer
} | {
"content_hash": "ce9b96b0f0ace6f68356a03b44ccbf31",
"timestamp": "",
"source": "github",
"line_count": 11809,
"max_line_length": 904,
"avg_line_length": 22.703954610889998,
"alnum_prop": 0.6444495003934937,
"repo_name": "BeardandFedora/dotcom",
"id": "7f0d259d84fd23776aa158d4fef62d507479e6ce",
"size": "269070",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hopstack/styles/main.css",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "279719"
},
{
"name": "HTML",
"bytes": "1029754"
},
{
"name": "JavaScript",
"bytes": "96483"
}
],
"symlink_target": ""
} |
namespace SIM.Tool.Windows.Dialogs
{
using System;
using System.Data.SqlClient;
using System.Windows;
using System.Windows.Input;
using SIM.Tool.Base;
using Sitecore.Diagnostics.Base;
using JetBrains.Annotations;
using SIM.Extensions;
#region
#endregion
public partial class ConnectionStringDialog
{
#region Constructors
public ConnectionStringDialog()
{
InitializeComponent();
}
#endregion
#region Methods
private void CancelChanges([CanBeNull] object sender, [CanBeNull] RoutedEventArgs e)
{
Close();
}
private void SaveChanges([CanBeNull] object sender, [CanBeNull] RoutedEventArgs e)
{
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder
{
DataSource = dataSource.Text
};
if (useSqlServerLogin.IsChecked == true)
{
builder.UserID = userId.Text;
builder.Password = password.Text;
}
else
{
builder.IntegratedSecurity = true;
}
var value = builder.ToString();
/* hack for settings dialog */
SettingsDialog owner = Owner as SettingsDialog;
if (owner != null)
{
WindowHelper.SetTextboxTextValue(owner.ConnectionString, value, owner.DoneButton);
}
DataContext = value;
DialogResult = true;
Close();
}
private void WindowContentRendered([CanBeNull] object sender, [CanBeNull] EventArgs e)
{
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(DataContext as string);
dataSource.Text = builder.DataSource.EmptyToNull() ?? ".\\SQLEXPRESS";
userId.Text = builder.UserID.EmptyToNull() ?? "sa";
password.Text = builder.Password.EmptyToNull() ?? "12345";
useSqlServerLogin.IsChecked = !builder.IntegratedSecurity;
}
private void WindowKeyUp([NotNull] object sender, [NotNull] KeyEventArgs e)
{
Assert.ArgumentNotNull(sender, nameof(sender));
Assert.ArgumentNotNull(e, nameof(e));
if (e.Key == Key.Escape)
{
if (e.Handled)
{
return;
}
e.Handled = true;
Close();
}
}
#endregion
}
} | {
"content_hash": "138674e0f9c44b2d9ecef7a79ef158e0",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 97,
"avg_line_length": 23.56989247311828,
"alnum_prop": 0.6405109489051095,
"repo_name": "Sitecore/Sitecore-Instance-Manager",
"id": "affd35c35fa26c0383ca6e3ecfe2f2d55e0b7218",
"size": "2194",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "src/SIM.Tool.Windows/Dialogs/ConnectionStringDialog.xaml.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1782278"
},
{
"name": "PowerShell",
"bytes": "15781"
},
{
"name": "Smalltalk",
"bytes": "79327"
}
],
"symlink_target": ""
} |
#ifndef TSL_ROBIN_GROWTH_POLICY_H
#define TSL_ROBIN_GROWTH_POLICY_H
#include <algorithm>
#include <array>
#include <climits>
#include <cmath>
#include <cstddef>
#include <iterator>
#include <limits>
#include <ratio>
#include <stdexcept>
#ifdef __EXCEPTIONS
# define THROW(_e, _m) throw _e(_m)
#else
# include <stdio.h>
# ifndef NDEBUG
# define THROW(_e, _m) do { fprintf(stderr, _m); std::terminate(); } while(0)
# else
# define THROW(_e, _m) std::terminate()
# endif
#endif
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
#if __has_builtin(__builtin_expect)
# define TSL_LIKELY( exp ) (__builtin_expect( !!(exp), true ))
#else
# define TSL_LIKELY( exp ) (exp)
#endif
namespace tsl {
namespace rh {
/**
* Grow the hash table by a factor of GrowthFactor keeping the bucket count to a power of two. It allows
* the table to use a mask operation instead of a modulo operation to map a hash to a bucket.
*
* GrowthFactor must be a power of two >= 2.
*/
template<std::size_t GrowthFactor>
class power_of_two_growth_policy {
public:
/**
* Called on the hash table creation and on rehash. The number of buckets for the table is passed in parameter.
* This number is a minimum, the policy may update this value with a higher value if needed (but not lower).
*/
power_of_two_growth_policy(std::size_t& min_bucket_count_in_out) {
if(min_bucket_count_in_out > max_bucket_count()) {
THROW(std::length_error, "The hash table exceeds its maxmimum size.");
}
static_assert(MIN_BUCKETS_SIZE > 0, "MIN_BUCKETS_SIZE must be > 0.");
const std::size_t min_bucket_count = MIN_BUCKETS_SIZE;
min_bucket_count_in_out = std::max(min_bucket_count, min_bucket_count_in_out);
min_bucket_count_in_out = round_up_to_power_of_two(min_bucket_count_in_out);
m_mask = min_bucket_count_in_out - 1;
}
/**
* Return the bucket [0, bucket_count()) to which the hash belongs.
*/
std::size_t bucket_for_hash(std::size_t hash) const noexcept {
return hash & m_mask;
}
/**
* Return the bucket count to use when the bucket array grows on rehash.
*/
std::size_t next_bucket_count() const {
if((m_mask + 1) > max_bucket_count() / GrowthFactor) {
THROW(std::length_error, "The hash table exceeds its maxmimum size.");
}
return (m_mask + 1) * GrowthFactor;
}
/**
* Return the maximum number of buckets supported by the policy.
*/
std::size_t max_bucket_count() const {
// Largest power of two.
return (std::numeric_limits<std::size_t>::max() / 2) + 1;
}
private:
static std::size_t round_up_to_power_of_two(std::size_t value) {
if(is_power_of_two(value)) {
return value;
}
if(value == 0) {
return 1;
}
--value;
for(std::size_t i = 1; i < sizeof(std::size_t) * CHAR_BIT; i *= 2) {
value |= value >> i;
}
return value + 1;
}
static constexpr bool is_power_of_two(std::size_t value) {
return value != 0 && (value & (value - 1)) == 0;
}
protected:
static const std::size_t MIN_BUCKETS_SIZE = 2;
static_assert(is_power_of_two(GrowthFactor) && GrowthFactor >= 2, "GrowthFactor must be a power of two >= 2.");
std::size_t m_mask;
};
/**
* Grow the hash table by GrowthFactor::num / GrowthFactor::den and use a modulo to map a hash
* to a bucket. Slower but it can be usefull if you want a slower growth.
*/
template<class GrowthFactor = std::ratio<3, 2>>
class mod_growth_policy {
public:
mod_growth_policy(std::size_t& min_bucket_count_in_out) {
if(min_bucket_count_in_out > max_bucket_count()) {
THROW(std::length_error, "The hash table exceeds its maxmimum size.");
}
static_assert(MIN_BUCKETS_SIZE > 0, "MIN_BUCKETS_SIZE must be > 0.");
const std::size_t min_bucket_count = MIN_BUCKETS_SIZE;
min_bucket_count_in_out = std::max(min_bucket_count, min_bucket_count_in_out);
m_bucket_count = min_bucket_count_in_out;
}
std::size_t bucket_for_hash(std::size_t hash) const noexcept {
return hash % m_bucket_count;
}
std::size_t next_bucket_count() const {
if(m_bucket_count == max_bucket_count()) {
THROW(std::length_error, "The hash table exceeds its maxmimum size.");
}
const double next_bucket_count = std::ceil(double(m_bucket_count) * REHASH_SIZE_MULTIPLICATION_FACTOR);
if(!std::isnormal(next_bucket_count)) {
THROW(std::length_error, "The hash table exceeds its maxmimum size.");
}
if(next_bucket_count > double(max_bucket_count())) {
return max_bucket_count();
}
else {
return std::size_t(next_bucket_count);
}
}
std::size_t max_bucket_count() const {
return MAX_BUCKET_COUNT;
}
private:
static const std::size_t MIN_BUCKETS_SIZE = 2;
static constexpr double REHASH_SIZE_MULTIPLICATION_FACTOR = 1.0 * GrowthFactor::num / GrowthFactor::den;
static const std::size_t MAX_BUCKET_COUNT =
std::size_t(double(
std::numeric_limits<std::size_t>::max() / REHASH_SIZE_MULTIPLICATION_FACTOR
));
static_assert(REHASH_SIZE_MULTIPLICATION_FACTOR >= 1.1, "Growth factor should be >= 1.1.");
std::size_t m_bucket_count;
};
namespace detail {
static constexpr const std::array<std::size_t, 39> PRIMES = {{
5ul, 17ul, 29ul, 37ul, 53ul, 67ul, 79ul, 97ul, 131ul, 193ul, 257ul, 389ul, 521ul, 769ul, 1031ul, 1543ul, 2053ul,
3079ul, 6151ul, 12289ul, 24593ul, 49157ul, 98317ul, 196613ul, 393241ul, 786433ul, 1572869ul, 3145739ul,
6291469ul, 12582917ul, 25165843ul, 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
1610612741ul, 3221225473ul, 4294967291ul
}};
template<unsigned int IPrime>
static constexpr std::size_t mod(std::size_t hash) { return hash % PRIMES[IPrime]; }
// MOD_PRIME[iprime](hash) returns hash % PRIMES[iprime]. This table allows for faster modulo as the
// compiler can optimize the modulo code better with a constant known at the compilation.
static constexpr const std::array<std::size_t(*)(std::size_t), 39> MOD_PRIME = {{
&mod<0>, &mod<1>, &mod<2>, &mod<3>, &mod<4>, &mod<5>, &mod<6>, &mod<7>, &mod<8>, &mod<9>, &mod<10>,
&mod<11>, &mod<12>, &mod<13>, &mod<14>, &mod<15>, &mod<16>, &mod<17>, &mod<18>, &mod<19>, &mod<20>,
&mod<21>, &mod<22>, &mod<23>, &mod<24>, &mod<25>, &mod<26>, &mod<27>, &mod<28>, &mod<29>, &mod<30>,
&mod<31>, &mod<32>, &mod<33>, &mod<34>, &mod<35>, &mod<36>, &mod<37> , &mod<38>
}};
}
/**
* Grow the hash table by using prime numbers as bucket count. Slower than tsl::rh::power_of_two_growth_policy in
* general but will probably distribute the values around better in the buckets with a poor hash function.
*
* To allow the compiler to optimize the modulo operation, a lookup table is used with constant primes numbers.
*
* With a switch the code would look like:
* \code
* switch(iprime) { // iprime is the current prime of the hash table
* case 0: hash % 5ul;
* break;
* case 1: hash % 17ul;
* break;
* case 2: hash % 29ul;
* break;
* ...
* }
* \endcode
*
* Due to the constant variable in the modulo the compiler is able to optimize the operation
* by a series of multiplications, substractions and shifts.
*
* The 'hash % 5' could become something like 'hash - (hash * 0xCCCCCCCD) >> 34) * 5' in a 64 bits environement.
*/
class prime_growth_policy {
public:
prime_growth_policy(std::size_t& min_bucket_count_in_out) {
auto it_prime = std::lower_bound(detail::PRIMES.begin(),
detail::PRIMES.end(), min_bucket_count_in_out);
if(it_prime == detail::PRIMES.end()) {
THROW(std::length_error, "The hash table exceeds its maxmimum size.");
}
m_iprime = static_cast<unsigned int>(std::distance(detail::PRIMES.begin(), it_prime));
min_bucket_count_in_out = *it_prime;
}
std::size_t bucket_for_hash(std::size_t hash) const noexcept {
return detail::MOD_PRIME[m_iprime](hash);
}
std::size_t next_bucket_count() const {
if(m_iprime + 1 >= detail::PRIMES.size()) {
THROW(std::length_error, "The hash table exceeds its maxmimum size.");
}
return detail::PRIMES[m_iprime + 1];
}
std::size_t max_bucket_count() const {
return detail::PRIMES.back();
}
private:
unsigned int m_iprime;
static_assert(std::numeric_limits<decltype(m_iprime)>::max() >= detail::PRIMES.size(),
"The type of m_iprime is not big enough.");
};
}
}
#endif
| {
"content_hash": "1784cd0239c35c4b66d7b2eec49cbebd",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 117,
"avg_line_length": 33.865671641791046,
"alnum_prop": 0.6007051564565888,
"repo_name": "google/filament",
"id": "daf6bf5636be7cbf03f108531ec6c70061e9f5c7",
"size": "10209",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "third_party/robin-map/tsl/robin_growth_policy.h",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "2833995"
},
{
"name": "Batchfile",
"bytes": "4607"
},
{
"name": "C",
"bytes": "2796377"
},
{
"name": "C#",
"bytes": "1099"
},
{
"name": "C++",
"bytes": "7044879"
},
{
"name": "CMake",
"bytes": "209759"
},
{
"name": "CSS",
"bytes": "17232"
},
{
"name": "Dockerfile",
"bytes": "2404"
},
{
"name": "F#",
"bytes": "710"
},
{
"name": "GLSL",
"bytes": "223763"
},
{
"name": "Go",
"bytes": "61019"
},
{
"name": "Groovy",
"bytes": "11811"
},
{
"name": "HTML",
"bytes": "80095"
},
{
"name": "Java",
"bytes": "780083"
},
{
"name": "JavaScript",
"bytes": "90947"
},
{
"name": "Kotlin",
"bytes": "345783"
},
{
"name": "Objective-C",
"bytes": "55990"
},
{
"name": "Objective-C++",
"bytes": "314291"
},
{
"name": "Python",
"bytes": "76565"
},
{
"name": "RenderScript",
"bytes": "1769"
},
{
"name": "Ruby",
"bytes": "4436"
},
{
"name": "Shell",
"bytes": "76965"
},
{
"name": "TypeScript",
"bytes": "3293"
}
],
"symlink_target": ""
} |
import uuid
import random
from django.test import TestCase, Client
from main.models import Question_option
class TestSesson(TestCase):
fixtures = ['basic_setup.json']
def setUp(self):
# Create our client, login and select a course
self.client = Client()
self.client.post('/login/', {'username': 'tutor1', 'password': '1234'})
self.client.post('/tutor/select_course/', {'course': 1}, follow=True)
# If no name is specified, an error should be displayed
def test_session_create_missing_name(self):
response = self.client.post('/tutor/sessions/new/', {'session-title': ''})
self.assertContains(response, 'You must specify a title for this session')
# Add a session and then check it appears in the list of sessions
def test_session_create(self):
session_name = uuid.uuid4() # Get a random session name
response = self.client.post('/tutor/sessions/new/', {'session-title': session_name}, follow=True)
self.assertContains(response, session_name)
# Attempt to add a question with no body to this session
def test_session_add_question_no_name(self):
response = self.client.post('/tutor/sessions/2/questions/add/', {'question': '', 'max-options': 0})
self.assertContains(response, 'Your question must have a body')
# Add a random question and ensure it is recalled properly
def test_session_add_question(self):
question_data = {}
# Give the question a random name
question_data['question'] = uuid.uuid4()
question_data['max-options'] = 10
# Loop and add 10 options to the question
for i in range(1,question_data['max-options']):
question_data['option-body[{0}]'.format(i)] = uuid.uuid4()
# Only set option correct if a random variable is true, this similates checkboxes
if (random.getrandbits(1)):
question_data['option-correct[{0}]'.format(i)] = True
response = self.client.post('/tutor/sessions/2/questions/add/', question_data, follow=True)
self.assertContains(response, question_data['question'])
# We know that the name has saved correctly, now check that the options were correctly saved
for i in range(1,question_data['max-options']):
# Check if option i exists
correct = bool('option-correct[{0}]'.format(i) in question_data)
option_body = question_data['option-body[{0}]'.format(i)]
self.assertTrue(Question_option.objects.filter(correct=correct, body=option_body).exists())
# Attempt to add a question where the "max-options" hidden input is missing
def test_session_add_question_missing_max_options(self):
question_data = {
'question': 'foo',
'option-body[0]': 'bar'
}
response = self.client.post('/tutor/sessions/2/questions/add/', question_data, follow=True)
self.assertContains(response, '"max-options" option was missing from your request')
# Attempt to load the edit page for a question in a course that the tutor is not assigned to teach
def test_session_view_unassigned_question(self):
response = self.client.get('/tutor/sessions/3/questions/edit/4/')
self.assertContains(response, 'The session specified could not be found')
# Attempt to load the edit page for a question that does not exist anywhere in the system
def test_session_view_non_existant_question(self):
response = self.client.get('/tutor/sessions/1/questions/edit/999/')
self.assertContains(response, 'The question specified could not be found')
# Attempt to load the edit page for a session in a course that the tutor is not assigned to teach
def test_session_view_unassigned_session(self):
response = self.client.get('/tutor/sessions/3/questions/edit/4/')
self.assertContains(response, 'The session specified could not be found') | {
"content_hash": "a726fb88722fc6b9670237c56f06836e",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 107,
"avg_line_length": 48.5609756097561,
"alnum_prop": 0.6685082872928176,
"repo_name": "camerongray1515/SELP-Audience-Response-System",
"id": "ce618a80dc7e0d0dc86227ec8df3dfe4b78de720",
"size": "3982",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "flash_response/main/tests/test_session.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "45465"
},
{
"name": "JavaScript",
"bytes": "102863"
},
{
"name": "Python",
"bytes": "47390"
},
{
"name": "TeX",
"bytes": "25505"
}
],
"symlink_target": ""
} |
var expect = require("chai").expect;
module.exports = function (helpers) {
var component = helpers.mount(require.resolve("./index"), {});
component.getComponent("ok").emitPressEvent();
expect(component.pressEvent[0].type).to.equal("ok");
expect(component.pressEvent[1].component).to.equal(
component.getComponent("ok")
);
component.getComponent("cancel").emitPressEvent();
expect(component.pressEvent[0].type).to.equal("cancel");
expect(component.pressEvent[1].component).to.equal(
component.getComponent("cancel")
);
};
| {
"content_hash": "fad58e17b87c3f7f47a2bd3d064d2480",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 64,
"avg_line_length": 29.05263157894737,
"alnum_prop": 0.7083333333333334,
"repo_name": "marko-js/marko",
"id": "e10aca29fe75bbb46910ba41f56d29557d849181",
"size": "552",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "packages/marko/test/components-browser/fixtures/event-handler-custom-args/test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "271490"
},
{
"name": "JavaScript",
"bytes": "891371"
},
{
"name": "Marko",
"bytes": "178043"
}
],
"symlink_target": ""
} |
@interface ViewController : UIViewController<UINavigationControllerDelegate, UIImagePickerControllerDelegate, UICollectionViewDelegate, UICollectionViewDataSource>
FOUNDATION_EXPORT NSString *const kTemplateFolderName;
@end
| {
"content_hash": "5b67e1a1c469a0f522cecb7f3f739846",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 163,
"avg_line_length": 45.2,
"alnum_prop": 0.8893805309734514,
"repo_name": "quangtqag/BlendModes",
"id": "57b34da11294f454d7b51c4cf5d4406c1385a3d4",
"size": "389",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "BlendModes/ViewController.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "20250"
}
],
"symlink_target": ""
} |
package org.wikipedia.test;
import android.content.Intent;
import android.test.ActivityUnitTestCase;
import com.github.kevinsawicki.http.HttpRequest;
import org.wikipedia.PageTitle;
import org.wikipedia.Site;
import org.wikipedia.WikipediaApp;
import org.wikipedia.editing.DoEditTask;
import org.wikipedia.editing.EditTokenStorage;
import org.wikipedia.editing.EditingException;
import org.wikipedia.editing.EditingResult;
import org.wikipedia.editing.FetchSectionWikitextTask;
import org.wikipedia.login.LoginResult;
import org.wikipedia.login.LoginTask;
import org.wikipedia.login.User;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
public class DoEditTaskTests extends ActivityUnitTestCase<TestDummyActivity> {
private static final int TASK_COMPLETION_TIMEOUT = 20000;
private static final int SECTION_ID = 3;
public DoEditTaskTests() {
super(TestDummyActivity.class);
}
public void testEdit() throws Throwable {
startActivity(new Intent(), null, null);
final CountDownLatch completionLatch = new CountDownLatch(1);
runTestOnUiThread(new Runnable() {
@Override
public void run() {
doSave(completionLatch);
}
});
assertTrue(completionLatch.await(TASK_COMPLETION_TIMEOUT, TimeUnit.MILLISECONDS));
}
private void doSave(final CountDownLatch completionLatch) {
final PageTitle title = new PageTitle(null, "Test_page_for_app_testing/Section1", new Site("test.wikipedia.org"));
final String wikitext = "== Section 2 ==\n\nEditing section INSERT RANDOM & HERE test at " + System.currentTimeMillis();
final WikipediaApp app = (WikipediaApp) getInstrumentation().getTargetContext().getApplicationContext();
app.getEditTokenStorage().get(title.getSite(), new EditTokenStorage.TokenRetreivedCallback() {
@Override
public void onTokenRetreived(String token) {
new DoEditTask(getInstrumentation().getTargetContext(), title, wikitext, SECTION_ID, token, "") {
@Override
public void onFinish(EditingResult result) {
assertNotNull(result);
assertEquals("Success", result.getResult());
new FetchSectionWikitextTask(getInstrumentation().getTargetContext(), title, SECTION_ID) {
@Override
public void onFinish(String result) {
assertNotNull(result);
assertEquals(wikitext, result);
completionLatch.countDown();
}
}.execute();
}
@Override
public void onCatch(Throwable caught) {
// borrowed mainly from EditSectionActivity:
final WikipediaApp app = WikipediaApp.getInstance();
if (caught instanceof EditingException) {
EditingException ee = (EditingException) caught;
if (app.getUserInfoStorage().isLoggedIn() && ee.getCode().equals("badtoken")) {
// looks like our session expired.
app.getEditTokenStorage().clearAllTokens();
app.getCookieManager().clearAllCookies();
User user = app.getUserInfoStorage().getUser();
new LoginTask(app, app.getPrimarySite(), user.getUsername(), user.getPassword()) {
@Override
public void onFinish(LoginResult result) {
assertEquals("Login failed!", "Success", result.getCode());
try {
doSave(completionLatch);
} catch (Throwable throwable) {
fail("Retry failed: " + throwable.getMessage());
}
}
}.execute();
return;
}
}
if (!(caught instanceof HttpRequest.HttpRequestException)) {
throw new RuntimeException(caught);
}
}
}.execute();
}
});
}
}
| {
"content_hash": "1c255b040b3e5f1a79888483f8d72e06",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 128,
"avg_line_length": 47.734693877551024,
"alnum_prop": 0.5414707139803335,
"repo_name": "creaITve/apps-android-tbrc-works",
"id": "ef4a0a067f8959972049c253594bde1b5017f064",
"size": "4678",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "wikipedia-it/src/main/java/org/wikipedia/test/DoEditTaskTests.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "84467"
},
{
"name": "Java",
"bytes": "685091"
},
{
"name": "JavaScript",
"bytes": "98370"
},
{
"name": "Python",
"bytes": "26196"
},
{
"name": "Shell",
"bytes": "2801"
}
],
"symlink_target": ""
} |
package org.apache.tinkerpop.gremlin.process.traversal.step.map;
import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
import org.apache.tinkerpop.gremlin.FeatureRequirement;
import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.List;
import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.junit.Assert.*;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
@RunWith(GremlinProcessRunner.class)
public abstract class AddVertexTest extends AbstractGremlinTest {
public abstract Traversal<Vertex, Vertex> get_g_VX1X_addVXanimalX_propertyXage_selectXaX_byXageXX_propertyXname_puppyX(final Object v1Id);
public abstract Traversal<Vertex, Vertex> get_g_V_addVXanimalX_propertyXage_0X();
public abstract Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXname_stephenX();
public abstract Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXname_stephenX_propertyXname_stephenmX();
public abstract Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenmX();
public abstract Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenm_since_2010X();
public abstract Traversal<Vertex, Vertex> get_g_V_hasXname_markoX_propertyXfriendWeight_outEXknowsX_weight_sum__acl_privateX();
public abstract Traversal<Vertex, Vertex> get_g_addVXanimalX_propertyXname_mateoX_propertyXname_gateoX_propertyXname_cateoX_propertyXage_5X();
public abstract Traversal<Vertex, Vertex> get_g_V_addVXanimalX_propertyXname_valuesXnameXX_propertyXname_an_animalX_propertyXvaluesXnameX_labelX();
// 3.0.0 DEPRECATIONS
@Deprecated
public abstract Traversal<Vertex, Vertex> get_g_V_addVXlabel_animal_age_0X();
@Deprecated
public abstract Traversal<Vertex, Vertex> get_g_addVXlabel_person_name_stephenX();
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
public void g_V_addVXanimalX_propertyXage_selectXaX_byXageXX_propertyXname_puppyX() {
final Traversal<Vertex, Vertex> traversal = get_g_VX1X_addVXanimalX_propertyXage_selectXaX_byXageXX_propertyXname_puppyX(convertToVertexId(graph, "marko"));
printTraversalForm(traversal);
final Vertex vertex = traversal.next();
assertEquals("animal", vertex.label());
assertEquals(29, vertex.<Integer>value("age").intValue());
assertEquals("puppy", vertex.<String>value("name"));
assertFalse(traversal.hasNext());
assertEquals(7, IteratorUtils.count(g.V()));
}
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
public void g_V_addVXanimalX_propertyXage_0X() {
final Traversal<Vertex, Vertex> traversal = get_g_V_addVXanimalX_propertyXage_0X();
printTraversalForm(traversal);
int count = 0;
while (traversal.hasNext()) {
final Vertex vertex = traversal.next();
assertEquals("animal", vertex.label());
assertEquals(0, vertex.<Integer>value("age").intValue());
count++;
}
assertEquals(6, count);
assertEquals(12, IteratorUtils.count(g.V()));
}
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
public void g_addVXpersonX_propertyXname_stephenX() {
final Traversal<Vertex, Vertex> traversal = get_g_addVXpersonX_propertyXname_stephenX();
printTraversalForm(traversal);
final Vertex stephen = traversal.next();
assertFalse(traversal.hasNext());
assertEquals("person", stephen.label());
assertEquals("stephen", stephen.value("name"));
assertEquals(1, IteratorUtils.count(stephen.properties()));
assertEquals(7, IteratorUtils.count(g.V()));
}
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
public void g_addVXpersonX_propertyXname_stephenX_propertyXname_stephenmX() {
final Traversal<Vertex, Vertex> traversal = get_g_addVXpersonX_propertyXname_stephenX_propertyXname_stephenmX();
printTraversalForm(traversal);
final Vertex stephen = traversal.next();
assertFalse(traversal.hasNext());
assertEquals("person", stephen.label());
assertThat((List<String>) IteratorUtils.asList(stephen.values("name")), containsInAnyOrder("stephen", "stephenm"));
assertEquals(2, IteratorUtils.count(stephen.properties()));
assertEquals(7, IteratorUtils.count(g.V()));
}
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
public void g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenmX() {
final Traversal<Vertex, Vertex> traversal = get_g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenmX();
printTraversalForm(traversal);
final Vertex stephen = traversal.next();
assertFalse(traversal.hasNext());
assertEquals("person", stephen.label());
assertEquals("stephenm", stephen.value("name"));
assertEquals(1, IteratorUtils.count(stephen.properties()));
assertEquals(7, IteratorUtils.count(g.V()));
}
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
public void g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenm_since_2010X() {
final Traversal<Vertex, Vertex> traversal = get_g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenm_since_2010X();
printTraversalForm(traversal);
final Vertex stephen = traversal.next();
assertFalse(traversal.hasNext());
assertEquals("person", stephen.label());
assertEquals("stephenm", stephen.value("name"));
assertEquals(2010, Integer.parseInt(stephen.property("name").value("since").toString()));
assertEquals(1, IteratorUtils.count(stephen.property("name").properties()));
assertEquals(1, IteratorUtils.count(stephen.properties()));
assertEquals(7, IteratorUtils.count(g.V()));
}
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
public void g_V_hasXname_markoX_addVXmetaPersonX_propertyXname_nameX_propertyXfriendWeight_outEXknowsX_weight_sum__acl_privateX() {
final Traversal<Vertex, Vertex> traversal = get_g_V_hasXname_markoX_propertyXfriendWeight_outEXknowsX_weight_sum__acl_privateX();
printTraversalForm(traversal);
final Vertex marko = traversal.next();
assertFalse(traversal.hasNext());
assertEquals("person", marko.label());
assertEquals("marko", marko.value("name"));
assertEquals(1.5, marko.value("friendWeight"), 0.01);
assertEquals("private", marko.property("friendWeight").value("acl"));
assertEquals(3, IteratorUtils.count(marko.properties()));
assertEquals(1, IteratorUtils.count(marko.property("friendWeight").properties()));
}
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
public void g_addVXanimalX_propertyXname_mateoX_propertyXname_gateoX_propertyXname_cateoX_propertyXage_5X() {
final Traversal<Vertex, Vertex> traversal = get_g_addVXanimalX_propertyXname_mateoX_propertyXname_gateoX_propertyXname_cateoX_propertyXage_5X();
printTraversalForm(traversal);
final Vertex mateo = traversal.next();
assertFalse(traversal.hasNext());
assertEquals("animal", mateo.label());
assertEquals(3, IteratorUtils.count(mateo.properties("name")));
mateo.values("name").forEachRemaining(name -> {
assertTrue(name.equals("mateo") || name.equals("cateo") || name.equals("gateo"));
});
assertEquals(5, ((Integer) mateo.value("age")).intValue());
}
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
public void g_V_addVXanimalX_propertyXname_valuesXnameXX_propertyXname_an_animalX_propertyXvaluesXnameX_labelX() {
final Traversal<Vertex, Vertex> traversal = get_g_V_addVXanimalX_propertyXname_valuesXnameXX_propertyXname_an_animalX_propertyXvaluesXnameX_labelX();
printTraversalForm(traversal);
while (traversal.hasNext()) {
final Vertex vertex = traversal.next();
assertEquals("animal", vertex.label());
assertEquals(2, IteratorUtils.count(vertex.properties("name")));
List<String> names = IteratorUtils.asList(vertex.values("name"));
assertEquals(2, names.size());
assertTrue(names.contains("an animal"));
assertTrue(names.contains("marko") || names.contains("vadas") || names.contains("josh") || names.contains("lop") || names.contains("ripple") || names.contains("peter"));
if (names.contains("marko")) {
assertEquals("person", vertex.value("marko"));
} else if (names.contains("vadas")) {
assertEquals("person", vertex.value("vadas"));
} else if (names.contains("josh")) {
assertEquals("person", vertex.value("josh"));
} else if (names.contains("ripple")) {
assertEquals("software", vertex.value("ripple"));
} else if (names.contains("lop")) {
assertEquals("software", vertex.value("lop"));
} else if (names.contains("peter")) {
assertEquals("person", vertex.value("peter"));
} else {
throw new IllegalStateException("This state should not have been reached");
}
}
}
/////
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
public void g_V_addVXlabel_animal_age_0X() {
final Traversal<Vertex, Vertex> traversal = get_g_V_addVXlabel_animal_age_0X();
printTraversalForm(traversal);
int count = 0;
while (traversal.hasNext()) {
final Vertex vertex = traversal.next();
assertEquals("animal", vertex.label());
assertEquals(0, vertex.<Integer>value("age").intValue());
count++;
}
assertEquals(6, count);
assertEquals(12, IteratorUtils.count(g.V()));
}
@Test
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
public void g_addVXlabel_person_name_stephenX() {
final Traversal<Vertex, Vertex> traversal = get_g_addVXlabel_person_name_stephenX();
printTraversalForm(traversal);
final Vertex stephen = traversal.next();
assertFalse(traversal.hasNext());
assertEquals("person", stephen.label());
assertEquals("stephen", stephen.value("name"));
assertEquals(1, IteratorUtils.count(stephen.properties()));
assertEquals(7, IteratorUtils.count(g.V()));
}
public static class Traversals extends AddVertexTest {
@Override
public Traversal<Vertex, Vertex> get_g_VX1X_addVXanimalX_propertyXage_selectXaX_byXageXX_propertyXname_puppyX(final Object v1Id) {
return g.V(v1Id).as("a").addV("animal").property("age", __.select("a").by("age")).property("name", "puppy");
}
@Override
public Traversal<Vertex, Vertex> get_g_V_addVXanimalX_propertyXage_0X() {
return g.V().addV("animal").property("age", 0);
}
@Override
public Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXname_stephenX() {
return g.addV("person").property("name", "stephen");
}
@Override
public Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXname_stephenX_propertyXname_stephenmX() {
return g.addV("person").property("name", "stephen").property("name", "stephenm");
}
@Override
public Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenmX() {
return g.addV("person").property(VertexProperty.Cardinality.single, "name", "stephen").property(VertexProperty.Cardinality.single, "name", "stephenm");
}
@Override
public Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenm_since_2010X() {
return g.addV("person").property(VertexProperty.Cardinality.single, "name", "stephen").property(VertexProperty.Cardinality.single, "name", "stephenm", "since", 2010);
}
@Override
public Traversal<Vertex, Vertex> get_g_V_hasXname_markoX_propertyXfriendWeight_outEXknowsX_weight_sum__acl_privateX() {
return g.V().has("name", "marko").property("friendWeight", __.outE("knows").values("weight").sum(), "acl", "private");
}
@Override
public Traversal<Vertex, Vertex> get_g_addVXanimalX_propertyXname_mateoX_propertyXname_gateoX_propertyXname_cateoX_propertyXage_5X() {
return g.addV("animal").property("name", "mateo").property("name", "gateo").property("name", "cateo").property("age", 5);
}
@Override
public Traversal<Vertex, Vertex> get_g_V_addVXanimalX_propertyXname_valuesXnameXX_propertyXname_an_animalX_propertyXvaluesXnameX_labelX() {
return g.V().addV("animal").property("name", __.values("name")).property("name", "an animal").property(__.values("name"), __.label());
}
@Override
public Traversal<Vertex, Vertex> get_g_V_addVXlabel_animal_age_0X() {
return g.V().addV(T.label, "animal", "age", 0);
}
@Override
public Traversal<Vertex, Vertex> get_g_addVXlabel_person_name_stephenX() {
return g.addV(T.label, "person", "name", "stephen");
}
}
} | {
"content_hash": "26ad16b8b72f327baba9237b8c5d5808",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 181,
"avg_line_length": 55.46394984326019,
"alnum_prop": 0.7110156559091166,
"repo_name": "BrynCooke/incubator-tinkerpop",
"id": "0186fa6fd8ff705144eca98a90f307d7dc9ae54b",
"size": "18498",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "1114"
},
{
"name": "Batchfile",
"bytes": "3975"
},
{
"name": "Groovy",
"bytes": "434916"
},
{
"name": "Java",
"bytes": "8000067"
},
{
"name": "Python",
"bytes": "337498"
},
{
"name": "Shell",
"bytes": "38026"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="rectangle" >
<solid android:color="@color/actionbar_bottom_divider" />
</shape>
</item>
<item android:bottom="2dp">
<shape
android:shape="rectangle" >
<solid android:color="@color/accent_1" />
</shape>
</item>
</layer-list> | {
"content_hash": "b44395ba4f4d87b354e0040524d7355c",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 71,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.551948051948052,
"repo_name": "akavrt/worko",
"id": "aa414230133ab3366ce528ef94c21348c3c891ad",
"size": "462",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/drawable/actionbar_background.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "988"
},
{
"name": "Java",
"bytes": "96715"
},
{
"name": "Shell",
"bytes": "2404"
}
],
"symlink_target": ""
} |
// TODO: Migrate to GCD sockets (GCDAsyncSocket). This will resolve a number of really ugly issues:
// * Lower thread counts
// * Explicit synchronization (no more conditions, flags, or race conditons!)
// * Maybe even synchronize with the context itself (when TIMOB-6990 complete)
#ifdef USE_TI_NETWORKSOCKET
#import <Foundation/Foundation.h>
#import "TiStreamProxy.h"
#import "AsyncSocket.h"
#import "TiNetworkSocketProxy.h"
// Used to determine the type of processing
typedef enum {
TO_BUFFER = 1,
TO_STREAM,
TO_CALLBACK,
} ReadDestination;
@interface TiNetworkSocketTCPProxy : TiStreamProxy<AsyncSocketDelegate, TiStreamInternal> {
AsyncSocket* socket;
SocketState internalState;
NSCondition* listening;
NSThread* socketThread;
// We have to have an explicit "host" property because of some 'fun' undocumented KVO
// behavior - it turns out that KVO 'getters' also look for '-(type)_key' signature
// selectors. TiProxy has a '_host' function.
NSString* host;
// We offer synchronous I/O. The underlying socket implementation is asynchronous.
// So we need to ensure our own synchronicity by signaling a condition when operations
// complete.
NSCondition* ioCondition;
NSUInteger readDataLength;
NSError* socketError;
// In order to put the accepted socket on the right run loop, and make sure it's constructed
// properly, we need THESE as well...
NSMutableDictionary* acceptArgs;
NSRunLoop* acceptRunLoop;
BOOL accepting;
// And, last but not least, in order to make sure that socket run loops are configured AND ACTIVE before performing any work on them,
// we need to be able to signal that they're
NSCondition* readyCondition;
BOOL socketReady;
// Information used to hash callbacks and asynch ops to tags.
int asynchTagCount;
NSMutableDictionary* operationInfo;
KrollCallback* connected;
KrollCallback* accepted;
KrollCallback* closed;
KrollCallback* error;
}
// Properties:
// -- Stored on TiProxy dynprops --
// int port
// ----
@property (nonatomic, readwrite, retain) NSString* host;
@property (nonatomic, readonly) NSNumber* state; // Req's local processing
@property (nonatomic, readwrite, retain) KrollCallback* connected;
@property (nonatomic, readwrite, retain) KrollCallback* accepted;
@property (nonatomic, readwrite, retain) KrollCallback* closed;
@property (nonatomic, readwrite, retain) KrollCallback* error;
// Public API
-(void)connect:(id)_void;
-(void)listen:(id)arg; // arg[0]: int maxAcceptQueueSize : queue size
-(void)accept:(id)arg; // arg[0]: Object params : callbacks for created socket
-(void)close:(id)_void;
@end
#endif | {
"content_hash": "5fac326bdf658701db84b9727f00dfde",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 137,
"avg_line_length": 35.4025974025974,
"alnum_prop": 0.7226705796038151,
"repo_name": "knightapplicationsystems/GDS-Core",
"id": "a990049a0eba7a82b2144f8c605645168bc05665",
"size": "3039",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build/iphone/Classes/TiNetworkSocketTCPProxy.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "144143"
},
{
"name": "C++",
"bytes": "52728"
},
{
"name": "D",
"bytes": "860598"
},
{
"name": "JavaScript",
"bytes": "109050"
},
{
"name": "Matlab",
"bytes": "1933"
},
{
"name": "Objective-C",
"bytes": "3577024"
},
{
"name": "Shell",
"bytes": "336"
}
],
"symlink_target": ""
} |
<?php
/**
* HybridAuth
* https://hybridauth.sourceforge.net | https://github.com/hybridauth/hybridauth
* (c) 2009-2015, HybridAuth authors | https://hybridauth.sourceforge.net/licenses.html
*/
// ------------------------------------------------------------------------
// HybridAuth End Point
// ------------------------------------------------------------------------
require_once( "Hybrid/Auth.php" );
require_once( "Hybrid/Endpoint.php" );
Hybrid_Endpoint::process();
| {
"content_hash": "5c4d8f586c0dae37ca60df063895c238",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 86,
"avg_line_length": 32.6,
"alnum_prop": 0.4785276073619632,
"repo_name": "maukoese/jabali",
"id": "18b566c6129f41bfd6e8b5bd6e8c476bec6266e9",
"size": "489",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/lib/hybridauth/index.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "963502"
},
{
"name": "HTML",
"bytes": "245118"
},
{
"name": "JavaScript",
"bytes": "1245681"
},
{
"name": "PHP",
"bytes": "1147806"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>three-gap: 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 / extra-dev</a></li>
<li class="active"><a href="">8.11.dev / three-gap - 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>
three-gap
<small>
8.5.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2020-08-11 05:14:42 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-08-11 05:14:42 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-m4 1 Virtual package relying on m4
coq 8.11.dev Formal proof management system
num 1.3 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.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "matej.kosik@inria.fr"
homepage: "https://github.com/coq-contribs/three-gap"
license: "LGPL 2"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/ThreeGap"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [ "keyword:real numbers" "keyword:steinhaus" "keyword:three gap theorem" "category:Mathematics/Geometry/General" "category:Mathematics/Arithmetic and Number Theory/Miscellaneous" ]
authors: [ "Micaela Mayero <>" ]
bug-reports: "https://github.com/coq-contribs/three-gap/issues"
dev-repo: "git+https://github.com/coq-contribs/three-gap.git"
synopsis: "A Proof of the Three Gap Theorem (Steinhaus Conjecture)"
description: "This proof uses the real numbers. It is a classical proof."
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/three-gap/archive/v8.5.0.tar.gz"
checksum: "md5=b3f0b1bb82477724df852543d847f1a9"
}
</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-three-gap.8.5.0 coq.8.11.dev</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.11.dev).
The following dependencies couldn't be met:
- coq-three-gap -> coq < 8.6~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
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-three-gap.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": "18f404f060343d0f9fe141b8e381f9e5",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 236,
"avg_line_length": 42.31901840490798,
"alnum_prop": 0.5423311104668019,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "09c08fd02702eb6e73f09139cabcc1b68fe5c06e",
"size": "6923",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.08.1-2.0.5/extra-dev/8.11.dev/three-gap/8.5.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<?php
namespace PivotTable;
class PivotTable
{
private $heading_all = 'All';
private $heading_total = 'Total';
public function __construct($settings = array())
{
if ($settings) {
if (isset($settings['heading_all'])) {
$this->heading_all = $settings['heading_all'];
}
if (isset($settings['heading_total'])) {
$this->heading_total = $settings['heading_total'];
}
}
}
public function summarize(
$results_data,
$pivot_columns_data,
$pivot_row,
$pivot_column,
$summation_columns
) {
$data = array();
$pivot_column_name=array_keys($pivot_column)[0];
if ($pivot_columns_data && is_array($pivot_columns_data)) {
$initialized_columns_values = array();
$initialized_columns_totals = array();
foreach ($pivot_columns_data as $row) {
// This could become a configurable option, blank or 0 for empty cell value
$initialized_columns_values[$row[$pivot_column_name]] = '';
$initialized_columns_totals[$row[$pivot_column_name]] = 0;
}
} else {
throw new \Exception('No pivot column results');
} // if $pivot_columns_data
$initialized_summation_columns=array();
$initialized_summation_column_totals=array();
$summation_columns_totals = array();
$cnt_column = array_keys($summation_columns);
for ($i=0; $i < count(array_keys($summation_columns)); $i++) {
$initialized_summation_columns[] = $initialized_columns_values;
$initialized_summation_column_totals[] = 0;
$summation_columns_totals[] = $initialized_columns_totals;
}
// Create Initial Header Rows
// First Row is the pivot column values names
// Second Row is the summation columns per pivot column value
$row_headings_data = array();
$row_headings_summmation_names = array();
foreach (array_values($pivot_row) as $pivot_row_heading) {
$row_headings_data[] = $pivot_row_heading;
$row_headings_summation_names[] = '';
}
foreach ($initialized_columns_values as $c => $n) {
for ($i=0; $i < count(array_keys($summation_columns)); $i++) {
$row_headings_data[] = $c;
$row_headings_summation_names[] = $summation_columns[$cnt_column[$i]];
}
}
for ($i=0; $i < count(array_keys($summation_columns)); $i++) {
$row_headings_data[] = $this->heading_total;
$row_headings_summation_names[] = $summation_columns[$cnt_column[$i]];
}
$data[] = $row_headings_data;
$data[] = $row_headings_summation_names;
if ($results_data && is_array($results_data)) {
// Per row variables
$row_pivot = '';
$row_columns = $initialized_summation_columns;
$row_totals = $initialized_summation_column_totals;
foreach ($results_data as $r) {
$current_pivot='';
foreach (array_keys($pivot_row) as $pivot_row_column) {
$current_pivot .= $r[$pivot_row_column] . "\t";
}
if ($row_pivot != $current_pivot) { // A change in the pivot column
if ($row_pivot != '') { // i.e. not first time in this loop
$row_data = array();
$row_data[] = $row_pivot;
foreach (array_keys($row_columns[0]) as $k) {
for ($i=0; $i < count(array_keys($summation_columns)); $i++) {
$row_data[] = $row_columns[$i][$k];
}
}
for ($i=0; $i < count(array_keys($row_totals)); $i++) {
$row_data[] = $row_totals[$i];
}
$data[] = $row_data;
} // $row_pivot != ''
$row_pivot = $current_pivot;
$row_columns = $initialized_summation_columns;
$row_totals = $initialized_summation_column_totals;
} // != $current_pivot
for ($i=0; $i < count(array_keys($summation_columns)); $i++) {
$row_columns[$i][$r[$pivot_column_name]] = $r[$cnt_column[$i]];
$row_totals[$i] += $r[$cnt_column[$i]];
$summation_columns_totals[$i][$r[$pivot_column_name]] += $r[$cnt_column[$i]];
}
} // while
if (isset($current_pivot)) {
$row_data = array();
$row_data[] = $row_pivot;
foreach (array_keys($row_columns[0]) as $k) {
for ($i=0; $i < count(array_keys($summation_columns)); $i++) {
$row_data[] = $row_columns[$i][$k];
}
}
for ($i=0; $i < count(array_keys($row_totals)); $i++) {
$row_data[] = $row_totals[$i];
}
$data[] = $row_data;
} // Cater for empty result set
} // if $results_data
$row_data = array();
$row_data[] = $this->heading_all;
$row_totals = $initialized_summation_column_totals;
foreach (array_keys($summation_columns_totals[0]) as $k) {
for ($i=0; $i < count(array_keys($summation_columns)); $i++) {
$row_data[] = $summation_columns_totals[$i][$k];
$row_totals[$i] += $summation_columns_totals[$i][$k];
}
}
for ($i=0; $i < count(array_keys($row_totals)); $i++) {
$row_data[] = $row_totals[$i];
}
$data[] = $row_data;
return $data;
}
public function render($data, $decorator, $summation_column_count)
{
$table_class = (isset($decorator['table']) ? $decorator['table'] : '');
$pivot_row_class = (isset($decorator['pivot_row']) ? $decorator['pivot_row'] : 'text-left');
$total_row_class = (isset($decorator['total_row']) ? $decorator['total_row'] : 'info');
$column_class = (isset($decorator['column']) ? $decorator['column'] : 'text-center');
$output = '<table class="'. $table_class .'">';
$first_heading_row = true;
$extra = '';
foreach ($data as $r) {
// Keep a copy of the first heading line for later
if ($first_heading_row) {
$first_heading_row = false;
$heading = true;
$headerline = $r;
}
if ($r[0] == $this->heading_all) {
$extra = ' class="'.$total_row_class.'"';
$heading = true;
}
$output .= '<tr'.$extra.'>';
$extra = '';
$l = count($r) - $summation_column_count;
$p = 0;
foreach ($r as $n => $v) {
$el = $heading ? 'h' : 'd';
$p++;
// Change element and select style for rirst column of row information
if ($p == 1) { // First Column
$extra = ' class="'.$pivot_row_class.'"';
$el = 'h';
} elseif ($p > $l) { // Last Column
$extra = ' class="'. $total_row_class.'"';
$el = 'h';
} elseif (!$heading) {
$extra = !empty($column_class) ? ' class="'. $column_class.'"' : '';
$el = 'd';
}
$output .= '<t'.$el.$extra.'>'.$v.'</t'.$el.'>';
$extra = '';
}
$heading = false;
$output .= '</tr>';
} // foreach
// If there are more than 15 lines of output, repeat the heading line at bottom of table
if (isset($headerline) && count($data) > 15) {
$output .= '<tr>';
$el = 'h';
foreach ($headerline as $n => $v) {
$output .= '<t'.$el.$extra.'>'.$v.'</t'.$el.'>';
}
$output .= '</tr>';
}
$output .= '</table>';
return $output;
}
}
| {
"content_hash": "996f8a33f03be1e8523e44e76d0c2e02",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 100,
"avg_line_length": 39.92344497607655,
"alnum_prop": 0.4557766059443912,
"repo_name": "ronaldbradford/PivotTable",
"id": "40f94ce65bc8091641b93979c2cbf7f8823055b7",
"size": "8344",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/PivotTable.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "18103"
},
{
"name": "PHP",
"bytes": "19286"
},
{
"name": "Shell",
"bytes": "561"
}
],
"symlink_target": ""
} |
module Spree
module Api
class CountriesController < Spree::Api::BaseController
skip_before_action :authenticate_user
def index
@countries = Country.
accessible_by(current_ability, :read).
ransack(params[:q]).
result.
order('name ASC')
country = Country.order("updated_at ASC").last
if stale?(country)
@countries = paginate(@countries)
respond_with(@countries)
end
end
def show
@country = Country.accessible_by(current_ability, :read).find(params[:id])
respond_with(@country)
end
end
end
end
| {
"content_hash": "41d36cdb218ba8bf268f572fe3da0d6f",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 82,
"avg_line_length": 23.88888888888889,
"alnum_prop": 0.586046511627907,
"repo_name": "Arpsara/solidus",
"id": "f0857d546d51582dab78d2ec7d440cb6b57106fe",
"size": "645",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "api/app/controllers/spree/api/countries_controller.rb",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "133108"
},
{
"name": "CoffeeScript",
"bytes": "48438"
},
{
"name": "HTML",
"bytes": "463016"
},
{
"name": "JavaScript",
"bytes": "46189"
},
{
"name": "Ruby",
"bytes": "2833451"
},
{
"name": "Shell",
"bytes": "2371"
}
],
"symlink_target": ""
} |
#nullable enable
using System;
using System.Diagnostics.CodeAnalysis;
using Avalonia.Controls.Platform;
using Avalonia.Platform;
using CoreGraphics;
using ObjCRuntime;
using UIKit;
namespace Avalonia.iOS
{
internal class NativeControlHostImpl : INativeControlHostImpl
{
private readonly AvaloniaView _avaloniaView;
public NativeControlHostImpl(AvaloniaView avaloniaView)
{
_avaloniaView = avaloniaView;
}
public INativeControlHostDestroyableControlHandle CreateDefaultChild(IPlatformHandle parent)
{
return new UIViewControlHandle(new UIView());
}
public INativeControlHostControlTopLevelAttachment CreateNewAttachment(Func<IPlatformHandle, IPlatformHandle> create)
{
var parent = new UIViewControlHandle(_avaloniaView);
NativeControlAttachment? attachment = null;
try
{
var child = create(parent);
// It has to be assigned to the variable before property setter is called so we dispose it on exception
#pragma warning disable IDE0017 // Simplify object initialization
attachment = new NativeControlAttachment(child);
#pragma warning restore IDE0017 // Simplify object initialization
attachment.AttachedTo = this;
return attachment;
}
catch
{
attachment?.Dispose();
throw;
}
}
public INativeControlHostControlTopLevelAttachment CreateNewAttachment(IPlatformHandle handle)
{
return new NativeControlAttachment(handle)
{
AttachedTo = this
};
}
public bool IsCompatibleWith(IPlatformHandle handle) => handle.HandleDescriptor == UIViewControlHandle.UIViewDescriptor;
private class ViewHolder : UIView
{
public ViewHolder(IntPtr handle) : base(new NativeHandle(handle))
{
}
}
private class NativeControlAttachment : INativeControlHostControlTopLevelAttachment
{
// ReSharper disable once NotAccessedField.Local (keep GC reference)
private IPlatformHandle? _child;
private UIView? _view;
private NativeControlHostImpl? _attachedTo;
public NativeControlAttachment(IPlatformHandle child)
{
_child = child;
_view = (child as UIViewControlHandle)?.View ?? new ViewHolder(child.Handle);
}
[MemberNotNull(nameof(_view))]
private void CheckDisposed()
{
if (_view == null)
throw new ObjectDisposedException(nameof(NativeControlAttachment));
}
public void Dispose()
{
_view?.RemoveFromSuperview();
_child = null;
_attachedTo = null;
_view?.Dispose();
_view = null;
}
public INativeControlHostImpl? AttachedTo
{
get => _attachedTo;
set
{
CheckDisposed();
_attachedTo = (NativeControlHostImpl?)value;
if (_attachedTo == null)
{
_view.RemoveFromSuperview();
}
else
{
_attachedTo._avaloniaView.AddSubview(_view);
}
}
}
public bool IsCompatibleWith(INativeControlHostImpl host) => host is NativeControlHostImpl;
public void HideWithSize(Size size)
{
CheckDisposed();
if (_attachedTo == null)
return;
_view.Hidden = true;
_view.Frame = new CGRect(0d, 0d, Math.Max(1d, size.Width), Math.Max(1d, size.Height));
}
public void ShowInBounds(Rect bounds)
{
CheckDisposed();
if (_attachedTo == null)
throw new InvalidOperationException("The control isn't currently attached to a toplevel");
_view.Frame = new CGRect(bounds.X, bounds.Y, Math.Max(1d, bounds.Width), Math.Max(1d, bounds.Height));
_view.Hidden = false;
}
}
}
public class UIViewControlHandle : INativeControlHostDestroyableControlHandle
{
internal const string UIViewDescriptor = "UIView";
public UIViewControlHandle(UIView view)
{
View = view;
}
public UIView View { get; }
public string HandleDescriptor => UIViewDescriptor;
IntPtr IPlatformHandle.Handle => View.Handle.Handle;
public void Destroy()
{
View.Dispose();
}
}
}
| {
"content_hash": "1b821acb1f8a2dcafc883cdfbe8a3e73",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 128,
"avg_line_length": 31.6125,
"alnum_prop": 0.5432977461447213,
"repo_name": "grokys/Perspex",
"id": "f752936dc8eacb39eb9374425359f29faa7cd77b",
"size": "5060",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/iOS/Avalonia.iOS/NativeControlHostImpl.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "2856452"
},
{
"name": "PowerShell",
"bytes": "5337"
},
{
"name": "Shell",
"bytes": "198"
},
{
"name": "Smalltalk",
"bytes": "48808"
}
],
"symlink_target": ""
} |
package net.protyposis.android.spectaculum.gles.flowabs;
import android.opengl.GLES20;
import net.protyposis.android.spectaculum.gles.GLUtils;
import net.protyposis.android.spectaculum.gles.Texture2D;
/**
* Created by maguggen on 18.07.2014.
*/
public class OrientationAlignedBilateralFilterShaderProgram extends FlowabsShaderProgram {
protected int mTextureHandle2;
protected int mPassHandle;
protected int mSigmaDHandle;
protected int mSigmaRHandle;
public OrientationAlignedBilateralFilterShaderProgram() {
super("bf_fs.glsl");
mTextureHandle = GLES20.glGetUniformLocation(mProgramHandle, "img");
GLUtils.checkError("glGetUniformLocation img");
mTextureHandle2 = GLES20.glGetUniformLocation(mProgramHandle, "tfm");
GLUtils.checkError("glGetUniformLocation tfm");
mPassHandle = GLES20.glGetUniformLocation(mProgramHandle, "pass");
GLUtils.checkError("glGetUniformLocation pass");
mSigmaDHandle = GLES20.glGetUniformLocation(mProgramHandle, "sigma_d");
GLUtils.checkError("glGetUniformLocation sigma_d");
mSigmaRHandle = GLES20.glGetUniformLocation(mProgramHandle, "sigma_r");
GLUtils.checkError("glGetUniformLocation sigma_r");
use();
setPass(0);
setSigmaD(3.0f);
setSigmaR(4.25f);
}
@Override
public void setTexture(Texture2D texture) {
throw new RuntimeException("not supported!!!");
}
public void setTexture(Texture2D img, Texture2D tfm) {
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, img.getHandle());
GLES20.glUniform1i(mTextureHandle, 0); // bind texture unit 0 to the uniform
GLES20.glActiveTexture(GLES20.GL_TEXTURE1);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, tfm.getHandle());
GLES20.glUniform1i(mTextureHandle2, 1); // bind texture unit 1 to the uniform
GLES20.glUniformMatrix4fv(mSTMatrixHandle, 1, false, img.getTransformMatrix(), 0);
}
public void setPass(int pass) {
if(pass != 0 && pass != 1) {
throw new RuntimeException("pass must be 0 or 1");
}
GLES20.glUniform1i(mPassHandle, pass);
}
public void setSigmaD(float sigmaD) {
GLES20.glUniform1f(mSigmaDHandle, sigmaD);
}
public void setSigmaR(float sigmaR) {
GLES20.glUniform1f(mSigmaRHandle, sigmaR);
}
}
| {
"content_hash": "5ce0e23a955377a183656b65cd8eef25",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 90,
"avg_line_length": 33.45205479452055,
"alnum_prop": 0.6957411957411958,
"repo_name": "protyposis/Spectaculum",
"id": "4c458879ea066ce43d0f24b7f04d752d1351a8a0",
"size": "3255",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Spectaculum-Effect-FlowAbs/src/main/java/net/protyposis/android/spectaculum/gles/flowabs/OrientationAlignedBilateralFilterShaderProgram.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "598"
},
{
"name": "GLSL",
"bytes": "43877"
},
{
"name": "HTML",
"bytes": "6418"
},
{
"name": "Java",
"bytes": "381813"
}
],
"symlink_target": ""
} |
<?php
namespace AppBundle\Form\Type {
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class m_employeeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
//$builder->add('name','text',array('required'=> true, 'empty_data' => null,'label'=>false,'attr'=>array('class'=>'input','placeholder'=>'test')))
// ->add('lastname',TextType::class,array('required'=> true, 'empty_data' => null,'label'=>false,'attr'=>array('class'=>'input','placeholder'=>'test')));
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => m_employee::class,
'required' => true,
));
}
}
}
| {
"content_hash": "0cc961658b81adf0a43db936e2e251b8",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 173,
"avg_line_length": 27.529411764705884,
"alnum_prop": 0.5950854700854701,
"repo_name": "artitsiriroop/taxfileIntage",
"id": "4488bbbe9e8af47ecb63de442bf3f784c65448fe",
"size": "936",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/AppBundle/Form/Type/m_employeeType.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "9312"
},
{
"name": "Batchfile",
"bytes": "921"
},
{
"name": "CSS",
"bytes": "528983"
},
{
"name": "HTML",
"bytes": "12491454"
},
{
"name": "JavaScript",
"bytes": "3846275"
},
{
"name": "Makefile",
"bytes": "7338"
},
{
"name": "PHP",
"bytes": "692408"
},
{
"name": "Shell",
"bytes": "1842"
},
{
"name": "TypeScript",
"bytes": "4696"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Input Output</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Multiprecision">
<link rel="up" href="../tut.html" title="Tutorial">
<link rel="prev" href="limits/how_to_tell.html" title="How to Determine the Kind of a Number From std::numeric_limits">
<link rel="next" href="hash.html" title="Hash Function Support">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="limits/how_to_tell.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="hash.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_multiprecision.tut.input_output"></a><a class="link" href="input_output.html" title="Input Output">Input Output</a>
</h3></div></div></div>
<h5>
<a name="boost_multiprecision.tut.input_output.h0"></a>
<span class="phrase"><a name="boost_multiprecision.tut.input_output.loopback_testing"></a></span><a class="link" href="input_output.html#boost_multiprecision.tut.input_output.loopback_testing">Loopback
testing</a>
</h5>
<p>
<span class="emphasis"><em>Loopback</em></span> or <span class="emphasis"><em>round-tripping</em></span> refers
to writing out a value as a decimal digit string using <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">iostream</span></code>,
usually to a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">stringstream</span></code>, and then reading the string
back in to another value, and confirming that the two values are identical.
A trivial example using <code class="computeroutput"><span class="keyword">float</span></code>
is:
</p>
<pre class="programlisting"><span class="keyword">float</span> <span class="identifier">write</span><span class="special">;</span> <span class="comment">// Value to round-trip.</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">stringstream</span> <span class="identifier">ss</span><span class="special">;</span> <span class="comment">// Read and write std::stringstream.</span>
<span class="identifier">ss</span><span class="special">.</span><span class="identifier">precision</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">max_digits10</span><span class="special">);</span> <span class="comment">// Ensure all potentially significant bits are output.</span>
<span class="identifier">ss</span><span class="special">.</span><span class="identifier">flags</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">fmtflags</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">scientific</span><span class="special">));</span> <span class="comment">// Use scientific format.</span>
<span class="identifier">ss</span> <span class="special"><<</span> <span class="identifier">write</span><span class="special">;</span> <span class="comment">// Output to string.</span>
<span class="keyword">float</span> <span class="identifier">read</span><span class="special">;</span> <span class="comment">// Expected.</span>
<span class="identifier">ss</span> <span class="special">>></span> <span class="identifier">read</span><span class="special">;</span> <span class="comment">// Read decimal digits string from stringstream.</span>
<span class="identifier">BOOST_CHECK_EQUAL</span><span class="special">(</span><span class="identifier">write</span><span class="special">,</span> <span class="identifier">read</span><span class="special">);</span> <span class="comment">// Should be the same.</span>
</pre>
<p>
and this can be run in a loop for all possible values of a 32-bit float.
For other floating-point types <code class="computeroutput"><span class="identifier">T</span></code>,
including built-in <code class="computeroutput"><span class="keyword">double</span></code>, it
takes far too long to test all values, so a reasonable test strategy is to
use a large number of random values.
</p>
<pre class="programlisting"><span class="identifier">T</span> <span class="identifier">write</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">stringstream</span> <span class="identifier">ss</span><span class="special">;</span>
<span class="identifier">ss</span><span class="special">.</span><span class="identifier">precision</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">max_digits10</span><span class="special">);</span> <span class="comment">// Ensure all potentially significant bits are output.</span>
<span class="identifier">ss</span><span class="special">.</span><span class="identifier">flags</span><span class="special">(</span><span class="identifier">f</span><span class="special">);</span> <span class="comment">// Changed from default iostream format flags if desired.</span>
<span class="identifier">ss</span> <span class="special"><<</span> <span class="identifier">write</span><span class="special">;</span> <span class="comment">// Output to stringstream.</span>
<span class="identifier">T</span> <span class="identifier">read</span><span class="special">;</span>
<span class="identifier">ss</span> <span class="special">>></span> <span class="identifier">read</span><span class="special">;</span> <span class="comment">// Get read using operator>> from stringstream.</span>
<span class="identifier">BOOST_CHECK_EQUAL</span><span class="special">(</span><span class="identifier">read</span><span class="special">,</span> <span class="identifier">write</span><span class="special">);</span>
<span class="identifier">read</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">T</span><span class="special">>(</span><span class="identifier">ss</span><span class="special">.</span><span class="identifier">str</span><span class="special">());</span> <span class="comment">// Get read by converting from decimal digits string representation of write.</span>
<span class="identifier">BOOST_CHECK_EQUAL</span><span class="special">(</span><span class="identifier">read</span><span class="special">,</span> <span class="identifier">write</span><span class="special">);</span>
<span class="identifier">read</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">T</span><span class="special">>(</span><span class="identifier">write</span><span class="special">.</span><span class="identifier">str</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="identifier">f</span><span class="special">));</span> <span class="comment">// Get read using format specified when written.</span>
<span class="identifier">BOOST_CHECK_EQUAL</span><span class="special">(</span><span class="identifier">read</span><span class="special">,</span> <span class="identifier">write</span><span class="special">);</span>
</pre>
<p>
The test at <a href="../../../../test/test_cpp_bin_float_io.cpp" target="_top">test_cpp_bin_float_io.cpp</a>
allows any floating-point type to be <span class="emphasis"><em>round_tripped</em></span> using
a wide range of fairly random values. It also includes tests compared a collection
of <a href="../../../../test/string_data.ipp" target="_top">stringdata</a> test cases
in a file.
</p>
<h5>
<a name="boost_multiprecision.tut.input_output.h1"></a>
<span class="phrase"><a name="boost_multiprecision.tut.input_output.comparing_with_output_using_buil"></a></span><a class="link" href="input_output.html#boost_multiprecision.tut.input_output.comparing_with_output_using_buil">Comparing
with output using Built-in types</a>
</h5>
<p>
One can make some comparisons with the output of
</p>
<pre class="programlisting"><span class="special"><</span><span class="identifier">number</span><span class="special"><</span><span class="identifier">cpp_bin_float</span><span class="special"><</span><span class="number">53</span><span class="special">,</span> <span class="identifier">digit_count_2</span><span class="special">></span> <span class="special">></span>
</pre>
<p>
which has the same number of significant bits (53) as 64-bit double precision
floating-point.
</p>
<p>
However, although most outputs are identical, there are differences on some
platforms caused by the implementation-dependent behaviours allowed by the
C99 specification <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf" target="_top">C99
ISO/IEC 9899:TC2</a>, incorporated by C++.
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="emphasis"><em>"For e, E, f, F, g, and G conversions, if the number of
significant decimal digits is at most DECIMAL_DIG, then the result should
be correctly rounded. If the number of significant decimal digits is more
than DECIMAL_DIG but the source value is exactly representable with DECIMAL_DIG
digits, then the result should be an exact representation with trailing
zeros. Otherwise, the source value is bounded by two adjacent decimal strings
L < U, both having DECIMAL_DIG significant digits; the value of the
resultant decimal string D should satisfy L<= D <= U, with the extra
stipulation that the error should have a correct sign for the current rounding
direction."</em></span>
</p></blockquote></div>
<p>
So not only is correct rounding for the full number of digits not required,
but even if the <span class="bold"><strong>optional</strong></span> recommended practice
is followed, then the value of these last few digits is unspecified as long
as the value is within certain bounds.
</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>
Do not expect the output from different platforms to be <span class="bold"><strong>identical</strong></span>,
but <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code>, <code class="computeroutput"><span class="identifier">cpp_bin_float</span></code> (and other backends) outputs
should be correctly rounded to the number of digits requested by the set
precision and format.
</p></td></tr>
</table></div>
<h5>
<a name="boost_multiprecision.tut.input_output.h2"></a>
<span class="phrase"><a name="boost_multiprecision.tut.input_output.macro_boost_mp_min_exponent_digi"></a></span><a class="link" href="input_output.html#boost_multiprecision.tut.input_output.macro_boost_mp_min_exponent_digi">Macro
BOOST_MP_MIN_EXPONENT_DIGITS</a>
</h5>
<p>
<a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf" target="_top">C99
Standard</a> for format specifiers, 7.19.6 Formatted input/output functions
requires:
</p>
<p>
"The exponent always contains at least two digits, and only as many
more digits as necessary to represent the exponent."
</p>
<p>
So to conform to the C99 standard (incorporated by C++)
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_MP_MIN_EXPONENT_DIGITS</span> <span class="number">2</span>
</pre>
<p>
Confusingly, Microsoft (and MinGW) do not conform to this standard and provide
<span class="bold"><strong>at least three digits</strong></span>, for example <code class="computeroutput"><span class="number">1e+001</span></code>. So if you want the output to match
that from built-in floating-point types on compilers that use Microsofts
runtime then use:
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_MP_MIN_EXPONENT_DIGITS</span> <span class="number">3</span>
</pre>
<p>
Also useful to get the minimum exponent field width is
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_MP_MIN_EXPONENT_DIGITS</span> <span class="number">1</span>
</pre>
<p>
producing a compact output like <code class="computeroutput"><span class="number">2e+4</span></code>,
useful when conserving space is important.
</p>
<p>
Larger values are also supported, for example, value 4 for <code class="computeroutput"><span class="number">2e+0004</span></code> which may be useful to ensure that
columns line up.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2013 John Maddock and Christopher Kormanyos<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="limits/how_to_tell.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="hash.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "264c448ec6611cdbcf6ea3f06b500e3d",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 604,
"avg_line_length": 85.98918918918919,
"alnum_prop": 0.6752577319587629,
"repo_name": "c72578/poedit",
"id": "da23c8a1a3ac74969b617c7685329f363581cd89",
"size": "15908",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "deps/boost/libs/multiprecision/doc/html/boost_multiprecision/tut/input_output.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "23633"
},
{
"name": "C++",
"bytes": "1088488"
},
{
"name": "Inno Setup",
"bytes": "11765"
},
{
"name": "M4",
"bytes": "104132"
},
{
"name": "Makefile",
"bytes": "9152"
},
{
"name": "Objective-C",
"bytes": "26402"
},
{
"name": "Objective-C++",
"bytes": "13730"
},
{
"name": "Python",
"bytes": "3081"
},
{
"name": "Ruby",
"bytes": "261"
},
{
"name": "Shell",
"bytes": "10717"
},
{
"name": "sed",
"bytes": "557"
}
],
"symlink_target": ""
} |
<!--
~ Copyright 2010 Red Hat, Inc.
~
~ Red Hat licenses this file to you under the Apache License, version
~ 2.0 (the "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
~ implied. See the License for the specific language governing
~ permissions and limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.fusesource.fmc</groupId>
<artifactId>fmc-project</artifactId>
<version>1.0.0.redhat-379</version>
</parent>
<groupId>org.fusesource.fmc</groupId>
<artifactId>fmc-webui-branding-example</artifactId>
<name>[TODO]${project.artifactId}</name>
<description>FMC :: Frontend Branding Example</description>
<packaging>pom</packaging>
<modules>
<module>fmc-webui-branding</module>
<module>fmc-webui-branding-bundle</module>
</modules>
</project>
| {
"content_hash": "4d8cbe14290aac33c4a3cd77637e6a59",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 201,
"avg_line_length": 37.351351351351354,
"alnum_prop": 0.7120115774240231,
"repo_name": "alexeev/jboss-fuse-mirror",
"id": "65fac0e5ed660e532a2fc81b550ea74e1e7e5e74",
"size": "1382",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sandbox/fmc/fmc-webui-branding-example/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "313969"
},
{
"name": "CoffeeScript",
"bytes": "278706"
},
{
"name": "Java",
"bytes": "8498768"
},
{
"name": "JavaScript",
"bytes": "2483260"
},
{
"name": "Kotlin",
"bytes": "14282"
},
{
"name": "Scala",
"bytes": "484151"
},
{
"name": "Shell",
"bytes": "11547"
},
{
"name": "XSLT",
"bytes": "26098"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.