code stringlengths 3 1.01M | repo_name stringlengths 5 116 | path stringlengths 3 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 3 1.01M |
|---|---|---|---|---|---|
package my;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class MyServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// your logic here
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// your logic here
}
} | mhcxp/Karaf-Tutorial | voting/voting-ui2/src/main/java/my/MyServlet.java | Java | apache-2.0 | 568 |
// Copyright 2015 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.bazel.rules.workspace;
import static com.google.devtools.build.lib.packages.Attribute.attr;
import static com.google.devtools.build.lib.syntax.Type.BOOLEAN;
import static com.google.devtools.build.lib.syntax.Type.STRING;
import com.google.devtools.build.lib.analysis.RuleDefinition;
import com.google.devtools.build.lib.analysis.RuleDefinitionEnvironment;
import com.google.devtools.build.lib.packages.RuleClass;
import com.google.devtools.build.lib.rules.repository.WorkspaceBaseRule;
import com.google.devtools.build.lib.rules.repository.WorkspaceConfiguredTargetFactory;
/**
* Rule definition for the git_repository rule.
*/
public class GitRepositoryRule implements RuleDefinition {
public static final String NAME = "git_repository";
@Override
public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment environment) {
return builder
/* <!-- #BLAZE_RULE(git_repository).ATTRIBUTE(remote) -->
The URI of the remote Git repository.
${SYNOPSIS}
<p>This must be a HTTP URL. There is currently no support for authentication.</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("remote", STRING).mandatory())
/* <!-- #BLAZE_RULE(git_repository).ATTRIBUTE(commit) -->
The commit hash to check out in the repository.
${SYNOPSIS}
<p>Note that one of either <code>commit</code> or <code>tag</code> must be defined.</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("commit", STRING))
/* <!-- #BLAZE_RULE(git_repository).ATTRIBUTE(tag) -->
The Git tag to check out in the repository.
${SYNOPSIS}
<p>Note that one of either <code>commit</code> or <code>tag</code> must be defined.</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("tag", STRING))
/* <!-- #BLAZE_RULE(git_repository).ATTRIBUTE(init_submodules) -->
Whether to clone submodules in the repository.
${SYNOPSIS}
<p>Currently, only cloning the top-level submodules is supported</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("init_submodules", BOOLEAN).value(false))
.setWorkspaceOnly()
.build();
}
@Override
public Metadata getMetadata() {
return RuleDefinition.Metadata.builder()
.name(GitRepositoryRule.NAME)
.type(RuleClass.Builder.RuleClassType.WORKSPACE)
.ancestors(WorkspaceBaseRule.class)
.factoryClass(WorkspaceConfiguredTargetFactory.class)
.build();
}
}
/*<!-- #BLAZE_RULE (NAME = git_repository, TYPE = OTHER, FAMILY = Workspace)[GENERIC_RULE] -->
${ATTRIBUTE_SIGNATURE}
<p>Clones a Git repository, checks out the specified tag, or commit, and makes its targets
available for binding.</p>
${ATTRIBUTE_DEFINITION}
<h4 id="git_repository_examples">Examples</h4>
<p>Suppose the current repository contains the source code for a chat program, rooted at the
directory <i>~/chat-app</i>. It needs to depend on an SSL library which is available in the
remote Git repository <i>http://example.com/openssl/openssl.git</i>. The chat app depends
on version 1.0.2 of the SSL library, which is tagged by the v1.0.2 Git tag.<p>
<p>This Git repository contains the following directory structure:</p>
<pre class="code">
WORKSPACE
src/
BUILD
openssl.cc
openssl.h
</pre>
<p><i>src/BUILD</i> contains the following target definition:</p>
<pre class="code">
cc_library(
name = "openssl-lib",
srcs = ["openssl.cc"],
hdrs = ["openssl.h"],
)
</pre>
<p>Targets in the <i>~/chat-app</i> repository can depend on this target if the following lines are
added to <i>~/chat-app/WORKSPACE</i>:</p>
<pre class="code">
git_repository(
name = "my-ssl",
remote = "http://example.com/openssl/openssl.git",
tag = "v1.0.2",
)
</pre>
<p>Then targets would specify <code>@my-ssl//src:openssl-lib</code> as a dependency.</p>
<!-- #END_BLAZE_RULE -->*/
| hhclam/bazel | src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/GitRepositoryRule.java | Java | apache-2.0 | 4,589 |
import Component from '@ember/component';
import layout from './template';
import { inject as service } from '@ember/service';
import { get, computed } from '@ember/object';
import C from 'ui/utils/constants';
const headers = [
{
name: 'state',
sort: ['sortState', 'displayName'],
searchField: 'displayState',
translationKey: 'generic.state',
width: 120,
},
{
name: 'scope',
sort: ['clusterId', 'projectId'],
searchField: ['clusterId', 'projectId'],
translationKey: 'generic.scope',
width: 120,
},
{
name: 'name',
sort: ['displayName', 'id'],
searchField: 'displayName',
translationKey: 'generic.name',
width: 250,
},
{
name: 'url',
sort: ['url', 'displayName'],
translationKey: 'catalogSettings.more.url.label',
},
{
name: 'branch',
sort: ['branch', 'displayName'],
translationKey: 'catalogSettings.more.branch.label',
width: 120,
},
];
export default Component.extend({
globalStore: service(),
settings: service(),
layout,
headers,
tagName: null,
catalogs: null,
mode: 'global',
sortBy: 'name',
descending: false,
paging: true,
rightActions: true,
library: computed('catalogs.@each.name', function() {
return get(this, 'catalogs').findBy('name', C.CATALOG.LIBRARY_KEY);
}),
helm3Stable: computed('catalogs.@each.name', function() {
return get(this, 'catalogs').findBy('name', C.CATALOG.HELM_3_LIBRARY_KEY)
}),
helmStable: computed('catalogs.@each.name', function() {
return get(this, 'catalogs').findBy('name', C.CATALOG.HELM_STABLE_KEY)
}),
helmIncubator: computed('catalogs.@each.name', function() {
return get(this, 'catalogs').findBy('name', C.CATALOG.HELM_INCUBATOR_KEY)
}),
alibabaAppHub: computed('catalogs.@each.name', function() {
return get(this, 'catalogs').findBy('name', C.CATALOG.ALIBABA_APP_HUB_KEY)
}),
rows: computed('alibabaAppHub', 'catalogs.@each.{id,name,url}', 'helm3Stable', 'helmIncubator', 'helmStable', 'library', 'mode', function() {
const out = get(this, 'catalogs').slice();
if ( get(this, 'mode') === 'global' ) {
if ( !this.library ) {
out.push(get(this, 'globalStore').createRecord({
type: 'catalog',
name: C.CATALOG.LIBRARY_KEY,
url: C.CATALOG.LIBRARY_VALUE,
branch: C.CATALOG.DEFAULT_BRANCH,
kind: 'helm',
}));
}
if ( !this.helmStable ) {
out.push(get(this, 'globalStore').createRecord({
type: 'catalog',
name: C.CATALOG.HELM_STABLE_KEY,
url: C.CATALOG.HELM_STABLE_VALUE,
branch: C.CATALOG.DEFAULT_BRANCH,
kind: 'helm',
}));
}
if ( !this.helmIncubator ) {
out.push(get(this, 'globalStore').createRecord({
type: 'catalog',
name: C.CATALOG.HELM_INCUBATOR_KEY,
url: C.CATALOG.HELM_INCUBATOR_VALUE,
branch: C.CATALOG.DEFAULT_BRANCH,
kind: 'helm',
}));
}
if ( !this.alibabaAppHub ) {
out.push(get(this, 'globalStore').createRecord({
type: 'catalog',
name: C.CATALOG.ALIBABA_APP_HUB_KEY,
url: C.CATALOG.ALIBABA_APP_HUB_VALUE,
branch: C.CATALOG.DEFAULT_BRANCH,
kind: 'helm',
}));
}
if ( !this.helm3Stable ) {
out.push(get(this, 'globalStore').createRecord({
type: 'catalog',
name: C.CATALOG.HELM_3_LIBRARY_KEY,
url: C.CATALOG.HELM_3_LIBRARY_VALUE,
branch: C.CATALOG.DEFAULT_BRANCH,
kind: 'helm',
}));
}
}
return out;
})
});
| westlywright/ui | lib/shared/addon/components/custom-catalog/component.js | JavaScript | apache-2.0 | 3,874 |
package test.github1490;
import org.testng.Assert;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;
public class TwoFactoriesShareSameDataProviderSampleTwo {
private final String cookieName;
private final int count;
@TestInfo(name = "nibbler")
@Factory(dataProvider = "cookie-master", dataProviderClass = DataProviderHouse.class)
public TwoFactoriesShareSameDataProviderSampleTwo(String cookieName, int count) {
this.cookieName = cookieName;
this.count = count;
}
@Test
public void testHowMuchMasterShifuAte() {
Assert.assertEquals("marie-gold", cookieName);
Assert.assertTrue(count < 100);
}
}
| krmahadevan/testng | testng-core/src/test/java/test/github1490/TwoFactoriesShareSameDataProviderSampleTwo.java | Java | apache-2.0 | 659 |
package provision
import (
"errors"
"github.com/docker/machine/drivers"
"github.com/docker/machine/libmachine/provision/pkgaction"
"github.com/docker/machine/log"
"github.com/docker/machine/state"
"github.com/docker/machine/utils"
)
var (
ErrUnknownDriver = errors.New("unknown driver")
)
func init() {
Register("boot2docker", &RegisteredProvisioner{
New: NewBoot2DockerProvisioner,
})
}
func NewBoot2DockerProvisioner(d drivers.Driver) Provisioner {
g := GenericProvisioner{
DockerOptionsDir: "/etc/docker",
DaemonOptionsFile: "/etc/systemd/system/docker.service",
OsReleaseId: "docker",
Packages: []string{},
Driver: d,
}
p := &Boot2DockerProvisioner{
DebianProvisioner{
GenericProvisioner: g,
},
}
return p
}
type Boot2DockerProvisioner struct {
DebianProvisioner
}
func (provisioner *Boot2DockerProvisioner) upgradeIso() error {
log.Info("Stopping machine to do the upgrade...")
if err := provisioner.Driver.Stop(); err != nil {
return err
}
if err := utils.WaitFor(drivers.MachineInState(provisioner.Driver, state.Stopped)); err != nil {
return err
}
machineName := provisioner.GetDriver().GetMachineName()
log.Infof("Upgrading machine %s...", machineName)
isoFilename := ""
switch provisioner.GetDriver().DriverName() {
case "virtualbox":
isoFilename = "boot2docker-virtualbox.iso"
case "vmwarefusion", "vmwarevsphere":
isoFilename = "boot2docker-vmware.iso"
case "hyper-v":
isoFilename = "boot2docker-hyperv.iso"
default:
return ErrUnknownDriver
}
b2dutils := utils.NewB2dUtils("", "", isoFilename)
// Usually we call this implicitly, but call it here explicitly to get
// the latest boot2docker ISO.
if err := b2dutils.DownloadLatestBoot2Docker(); err != nil {
return err
}
// Copy the latest version of boot2docker ISO to the machine's directory
if err := b2dutils.CopyIsoToMachineDir("", machineName); err != nil {
return err
}
if err := provisioner.Driver.Start(); err != nil {
return err
}
return utils.WaitFor(drivers.MachineInState(provisioner.Driver, state.Running))
}
func (provisioner *Boot2DockerProvisioner) Package(name string, action pkgaction.PackageAction) error {
if name == "docker" && action == pkgaction.Upgrade {
if err := provisioner.upgradeIso(); err != nil {
return err
}
}
return nil
}
| rdgreis/machine | libmachine/provision/boot2docker.go | GO | apache-2.0 | 2,359 |
#!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""This code example gets all first party audience segments.
To create first party audience segments, run create_audience_segments.py.
"""
# Import appropriate modules from the client library.
from googleads import dfp
def main(client):
# Initialize client object.
client = dfp.DfpClient.LoadFromStorage()
# Initialize appropriate service.
audience_segment_service = client.GetService(
'AudienceSegmentService', version='v201505')
# Create statement object to only select first party audience segments.
values = [{
'key': 'type',
'value': {
'xsi_type': 'TextValue',
'value': 'FIRST_PARTY'
}
}]
query = 'WHERE Type = :type'
statement = dfp.FilterStatement(query, values)
# Get audience segments by statement.
while True:
response = audience_segment_service.getAudienceSegmentsByStatement(
statement.ToStatement())
if 'results' in response:
segments = response['results']
for segment in segments:
print ('Audience segment with id \'%s\' and name \'%s\' of size '
'%s was found. ' %
(segment['id'], segment['name'], segment['size']))
statement.offset += dfp.SUGGESTED_PAGE_LIMIT
else:
break
print '\nNumber of results found: %s' % response['totalResultSetSize']
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client)
| wubr2000/googleads-python-lib | examples/dfp/v201505/audience_segment_service/get_first_party_audience_segments.py | Python | apache-2.0 | 2,062 |
<?php
/**
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
* The Apereo Foundation 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.
*/
require_once(dirname(__FILE__) . "/config.php");
global $xerte_toolkits_site;
$extraparams = "";
if (isset($_REQUEST['LinkID']))
{
$extraparams .= "&LinkID=" . $_REQUEST['LinkID'];
}
if (isset($_REQUEST['Page']))
{
$extraparams .= "&Page=" . $_REQUEST['Page'];
}
header("Location: " . $xerte_toolkits_site->site_url . "play.php?engine=html5&template_id=" . $_REQUEST['template_id'] . $extraparams); | thexerteproject/xerteonlinetoolkits | play_html5.php | PHP | apache-2.0 | 1,217 |
/*
* Copyright 2018-present Open Networking Foundation
*
* 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.
*/
// CHECKSTYLE:OFF
package org.onosproject.netconf.rpc;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlElementRefs;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
/**
* <p>Java class for errorInfoType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="errorInfoType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <choice>
* <element name="session-id" type="{urn:ietf:params:xml:ns:netconf:base:1.0}SessionIdOrZero"/>
* <sequence maxOccurs="unbounded" minOccurs="0">
* <sequence>
* <element name="bad-attribute" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
* <element name="bad-element" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
* <element name="ok-element" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
* <element name="err-element" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
* <element name="noop-element" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
* <element name="bad-namespace" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </sequence>
* </choice>
* <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "errorInfoType", propOrder = {
"sessionId",
"badAttributeAndBadElementAndOkElement",
"any"
})
public class ErrorInfoType {
@XmlElement(name = "session-id")
@XmlSchemaType(name = "unsignedInt")
protected Long sessionId;
@XmlElementRefs({
@XmlElementRef(name = "bad-attribute", namespace = "urn:ietf:params:xml:ns:netconf:base:1.0", type = JAXBElement.class, required = false),
@XmlElementRef(name = "bad-element", namespace = "urn:ietf:params:xml:ns:netconf:base:1.0", type = JAXBElement.class, required = false),
@XmlElementRef(name = "ok-element", namespace = "urn:ietf:params:xml:ns:netconf:base:1.0", type = JAXBElement.class, required = false),
@XmlElementRef(name = "err-element", namespace = "urn:ietf:params:xml:ns:netconf:base:1.0", type = JAXBElement.class, required = false),
@XmlElementRef(name = "noop-element", namespace = "urn:ietf:params:xml:ns:netconf:base:1.0", type = JAXBElement.class, required = false),
@XmlElementRef(name = "bad-namespace", namespace = "urn:ietf:params:xml:ns:netconf:base:1.0", type = JAXBElement.class, required = false)
})
protected List<JAXBElement<? extends Serializable>> badAttributeAndBadElementAndOkElement;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the sessionId property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getSessionId() {
return sessionId;
}
/**
* Sets the value of the sessionId property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setSessionId(Long value) {
this.sessionId = value;
}
/**
* Gets the value of the badAttributeAndBadElementAndOkElement property.
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the
* badAttributeAndBadElementAndOkElement property.
* </p>
* For example, to add a new item, do as follows:
* <pre>
* getBadAttributeAndBadElementAndOkElement().add(newItem);
* </pre>
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link QName }{@code >}
* {@link JAXBElement }{@code <}{@link QName }{@code >}
* {@link JAXBElement }{@code <}{@link QName }{@code >}
* {@link JAXBElement }{@code <}{@link QName }{@code >}
* {@link JAXBElement }{@code <}{@link QName }{@code >}
* {@link JAXBElement }{@code <}{@link String }{@code >}
* </p>
* @return list of properties
*/
public List<JAXBElement<? extends Serializable>> getBadAttributeAndBadElementAndOkElement() {
if (badAttributeAndBadElementAndOkElement == null) {
badAttributeAndBadElementAndOkElement = new ArrayList<JAXBElement<? extends Serializable>>();
}
return this.badAttributeAndBadElementAndOkElement;
}
/**
* Gets the value of the any property.
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
* </p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
* </p>
* @return list of properties
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}
| gkatsikas/onos | protocols/netconf/api/src/main/java/org/onosproject/netconf/rpc/ErrorInfoType.java | Java | apache-2.0 | 6,843 |
package mil.nga.giat.geowave.analytic.extract;
import com.vividsolutions.jts.geom.Geometry;
/**
* Strategy to extract a representative dimensions and Geometry for an Object
*
* @param <T>
*/
public interface DimensionExtractor<T>
{
/**
*
* @param anObject
* --
*/
public double[] getDimensions(
T anObject );
/**
*
* @return Dimension names in the same order as dimentions returns from the
* {@link DimensionExtractor#getDimensions(Object)}
*/
public String[] getDimensionNames();
/**
*
* @param anObject
* -- an object with Geospatial properties
* @return A Point that must have the SRID set for a valid CRS.
*/
public Geometry getGeometry(
T anObject );
/**
* @param An
* assigned group ID, if one exists. null, otherwisw. --
*/
public String getGroupID(
T anObject );
}
| mses-bly/geowave | analytics/api/src/main/java/mil/nga/giat/geowave/analytic/extract/DimensionExtractor.java | Java | apache-2.0 | 877 |
package org.apache.thrift.transport;
import org.apache.thrift.TConfiguration;
import java.nio.BufferOverflowException;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
/**
* ByteBuffer-backed implementation of TTransport.
*/
public final class TByteBuffer extends TEndpointTransport {
private final ByteBuffer byteBuffer;
/**
* Creates a new TByteBuffer wrapping a given NIO ByteBuffer.
*/
public TByteBuffer(ByteBuffer byteBuffer) throws TTransportException {
super(new TConfiguration());
this.byteBuffer = byteBuffer;
updateKnownMessageSize(byteBuffer.capacity());
}
@Override
public boolean isOpen() {
return true;
}
@Override
public void open() {
}
@Override
public void close() {
}
@Override
public int read(byte[] buf, int off, int len) throws TTransportException {
//
checkReadBytesAvailable(len);
final int n = Math.min(byteBuffer.remaining(), len);
if (n > 0) {
try {
byteBuffer.get(buf, off, n);
} catch (BufferUnderflowException e) {
throw new TTransportException("Unexpected end of input buffer", e);
}
}
return n;
}
@Override
public void write(byte[] buf, int off, int len) throws TTransportException {
try {
byteBuffer.put(buf, off, len);
} catch (BufferOverflowException e) {
throw new TTransportException("Not enough room in output buffer", e);
}
}
/**
* Get the underlying NIO ByteBuffer.
*/
public ByteBuffer getByteBuffer() {
return byteBuffer;
}
/**
* Convenience method to call clear() on the underlying NIO ByteBuffer.
*/
public TByteBuffer clear() {
byteBuffer.clear();
return this;
}
/**
* Convenience method to call flip() on the underlying NIO ByteBuffer.
*/
public TByteBuffer flip() {
byteBuffer.flip();
return this;
}
/**
* Convenience method to convert the underlying NIO ByteBuffer to a
* plain old byte array.
*/
public byte[] toByteArray() {
final byte[] data = new byte[byteBuffer.remaining()];
byteBuffer.slice().get(data);
return data;
}
}
| dcelasun/thrift | lib/java/src/org/apache/thrift/transport/TByteBuffer.java | Java | apache-2.0 | 2,140 |
export function cloneComplexInteractors(json) {
// We'll need collections of our interactions and interactors for later..
const interactions = json.data.filter(function (interaction) {
return interaction.object === "interaction";
});
const instanceCount = new Map();
// Loop through our interactions
interactions.forEach(function (interaction) {
// Get a collection of participants where the stoichiometry is greater than one.
const complexesToClone = interaction.participants.filter(function (participant) {
if (participant.interactorRef.indexOf("complex") !== -1) {
return participant;
}
});
// Loop through our participants that need expanding
complexesToClone.forEach(function (participantComplex) {
// Do we have an interactor? TODO: Will this affect complexes?
const foundInteractor = findFirstObjWithAttr(interactions, "id", participantComplex.interactorRef);
// If we found an interactor then we need to clone it.
if (foundInteractor) {
let count = instanceCount.get(participantComplex.interactorRef);
if (count) {
count = count + 1;
} else {
count = 1;
}
instanceCount.set(participantComplex.interactorRef, count);
let i = count;
if (i > 1) {
participantComplex.interactorRef = participantComplex.interactorRef + "_" + i;
// update features of complex
if (participantComplex.features) {
participantComplex.features.forEach(function (feature) {
feature.copiedfrom = feature.id;
// feature.id = feature.id + "_" + i;
// Also, adjust our sequence data
feature.sequenceData.forEach(function (sequenceData) {
sequenceData.participantRef = sequenceData.participantRef + "_" + i;
//~ sequenceData.interactorRef = clonedInteractor.id;
});
});
}
const clonedInteractor = JSON.parse(JSON.stringify(foundInteractor));
clonedInteractor.id = clonedInteractor.id + "_" + i;
json.data.push(clonedInteractor);
for (let participant of clonedInteractor.participants) {
/********** PARTICIPANTS **********/
const clonedParticipant = participant;//JSON.parse(JSON.stringify(participant));
clonedParticipant.id = clonedParticipant.id + "_" + i;
// We need to relink to our binding site IDs:
if (clonedParticipant.features) {
clonedParticipant.features.forEach(function (feature) {
// feature.copiedfrom = feature.id;
feature.id = feature.id + "_" + i;
// Also, adjust our sequence data
feature.sequenceData.forEach(function (sequenceData) {
sequenceData.participantRef = clonedParticipant.id;
//~ sequenceData.interactorRef = clonedInteractor.id;
});
const lnCount = feature.linkedFeatures.length;
for (let ln = 0; ln < lnCount; ln++){
// console.log(linkedFeature);
feature.linkedFeatures[ln] = feature.linkedFeatures[ln] + "_" + i;
}
});
}
}
}
}
});
});
return json;
}
// Returns the first object in an array that has an attribute with a matching value.
function findFirstObjWithAttr(collection, attribute, value) {
for (let i = 0; i < collection.length; i += 1) {
if (collection[i][attribute] === value) {
return collection[i];
}
}
} | colin-combe/ComplexViewer | src/js/clone-complex-interactors.js | JavaScript | apache-2.0 | 4,371 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.
*/
/**
* @author Alexander Y. Kleymenov
*/
package org.apache.harmony.security.provider.cert;
import java.security.AccessController;
import java.security.Provider;
import org.apache.harmony.security.internal.nls.Messages;
/**
* Master class (provider) for X509 Certificate Factory
* Implementation.
*/
public final class DRLCertFactory extends Provider {
/**
* @serial
*/
private static final long serialVersionUID = -7269650779605195879L;
/**
* Constructs the instance of the certificate factory provider.
*/
public DRLCertFactory() {
// specification of the provider name, version, and description.
// security.151=Certificate Factory supports CRLs and Certificates in (PEM) ASN.1 DER encoded form, and Certification Paths in PkiPath and PKCS7 formats.
super("DRLCertFactory", 1.0, Messages.getString("security.151")); //$NON-NLS-1$ //$NON-NLS-2$
AccessController.doPrivileged(new java.security.PrivilegedAction<Void>() {
public Void run() {
// register the service
put("CertificateFactory.X509", //$NON-NLS-1$
"org.apache.harmony.security.provider.cert.X509CertFactoryImpl"); //$NON-NLS-1$
// mapping the alias
put("Alg.Alias.CertificateFactory.X.509", "X509"); //$NON-NLS-1$ //$NON-NLS-2$
return null;
}
});
}
}
| nextopio/nextop-client | org.apache-jarjar/src/main/java/org/apache/harmony/security/provider/cert/DRLCertFactory.java | Java | apache-2.0 | 2,263 |
/**
* Copyright 2019 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* @fileoverview
* This script runs the bundle size check and single pass test.
* This is run during the CI stage = test; job = dist tests.
*/
const colors = require('ansi-colors');
const {
downloadDistOutput,
printChangeSummary,
startTimer,
stopTimer,
timedExecOrDie: timedExecOrDieBase} = require('./utils');
const {determineBuildTargets} = require('./build-targets');
const {isTravisPullRequestBuild} = require('../travis');
const FILENAME = 'dist-tests.js';
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie =
(cmd, unusedFileName) => timedExecOrDieBase(cmd, FILENAME);
function runSinglePassTest_() {
timedExecOrDie('gulp clean');
timedExecOrDie('gulp update-packages');
timedExecOrDie('gulp dist --fortesting --single_pass --pseudo_names');
timedExecOrDie('gulp test --integration ' +
'--nobuild --compiled --single_pass --headless');
}
function main() {
const startTime = startTimer(FILENAME, FILENAME);
const buildTargets = determineBuildTargets();
if (!isTravisPullRequestBuild()) {
timedExecOrDie('gulp update-packages');
downloadDistOutput(FILENAME);
timedExecOrDie('gulp bundle-size --on_push_build');
runSinglePassTest_();
} else {
printChangeSummary(FILENAME);
let ranTests = false;
if (buildTargets.has('RUNTIME')) {
timedExecOrDie('gulp update-packages');
timedExecOrDie('gulp dist --fortesting --noextensions');
timedExecOrDie('gulp bundle-size --on_pr_build');
ranTests = true;
} else {
timedExecOrDie('gulp bundle-size --on_skipped_build');
}
if (buildTargets.has('RUNTIME') ||
buildTargets.has('BUILD_SYSTEM') ||
buildTargets.has('INTEGRATION_TEST')) {
runSinglePassTest_();
ranTests = true;
}
if (!ranTests) {
console.log(`${FILELOGPREFIX} Skipping ` +
colors.cyan('Dist, Bundle Size, Single Pass Tests ') +
'because this commit does not affect the runtime, build system, ' +
'or integration test files.');
}
}
stopTimer(FILENAME, FILENAME, startTime);
}
main();
| techhtml/amphtml | build-system/pr-check/dist-tests.js | JavaScript | apache-2.0 | 2,766 |
/**
* Autogenerated by Thrift Compiler (0.14.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hive.service.rpc.thrift;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)")
@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TPrimitiveTypeEntry implements org.apache.thrift.TBase<TPrimitiveTypeEntry, TPrimitiveTypeEntry._Fields>, java.io.Serializable, Cloneable, Comparable<TPrimitiveTypeEntry> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPrimitiveTypeEntry");
private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField TYPE_QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("typeQualifiers", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TPrimitiveTypeEntryStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TPrimitiveTypeEntryTupleSchemeFactory();
private @org.apache.thrift.annotation.Nullable TTypeId type; // required
private @org.apache.thrift.annotation.Nullable TTypeQualifiers typeQualifiers; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
*
* @see TTypeId
*/
TYPE((short)1, "type"),
TYPE_QUALIFIERS((short)2, "typeQualifiers");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // TYPE
return TYPE;
case 2: // TYPE_QUALIFIERS
return TYPE_QUALIFIERS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.TYPE_QUALIFIERS};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTypeId.class)));
tmpMap.put(_Fields.TYPE_QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("typeQualifiers", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifiers.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPrimitiveTypeEntry.class, metaDataMap);
}
public TPrimitiveTypeEntry() {
}
public TPrimitiveTypeEntry(
TTypeId type)
{
this();
this.type = type;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TPrimitiveTypeEntry(TPrimitiveTypeEntry other) {
if (other.isSetType()) {
this.type = other.type;
}
if (other.isSetTypeQualifiers()) {
this.typeQualifiers = new TTypeQualifiers(other.typeQualifiers);
}
}
public TPrimitiveTypeEntry deepCopy() {
return new TPrimitiveTypeEntry(this);
}
@Override
public void clear() {
this.type = null;
this.typeQualifiers = null;
}
/**
*
* @see TTypeId
*/
@org.apache.thrift.annotation.Nullable
public TTypeId getType() {
return this.type;
}
/**
*
* @see TTypeId
*/
public void setType(@org.apache.thrift.annotation.Nullable TTypeId type) {
this.type = type;
}
public void unsetType() {
this.type = null;
}
/** Returns true if field type is set (has been assigned a value) and false otherwise */
public boolean isSetType() {
return this.type != null;
}
public void setTypeIsSet(boolean value) {
if (!value) {
this.type = null;
}
}
@org.apache.thrift.annotation.Nullable
public TTypeQualifiers getTypeQualifiers() {
return this.typeQualifiers;
}
public void setTypeQualifiers(@org.apache.thrift.annotation.Nullable TTypeQualifiers typeQualifiers) {
this.typeQualifiers = typeQualifiers;
}
public void unsetTypeQualifiers() {
this.typeQualifiers = null;
}
/** Returns true if field typeQualifiers is set (has been assigned a value) and false otherwise */
public boolean isSetTypeQualifiers() {
return this.typeQualifiers != null;
}
public void setTypeQualifiersIsSet(boolean value) {
if (!value) {
this.typeQualifiers = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case TYPE:
if (value == null) {
unsetType();
} else {
setType((TTypeId)value);
}
break;
case TYPE_QUALIFIERS:
if (value == null) {
unsetTypeQualifiers();
} else {
setTypeQualifiers((TTypeQualifiers)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case TYPE:
return getType();
case TYPE_QUALIFIERS:
return getTypeQualifiers();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case TYPE:
return isSetType();
case TYPE_QUALIFIERS:
return isSetTypeQualifiers();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TPrimitiveTypeEntry)
return this.equals((TPrimitiveTypeEntry)that);
return false;
}
public boolean equals(TPrimitiveTypeEntry that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_type = true && this.isSetType();
boolean that_present_type = true && that.isSetType();
if (this_present_type || that_present_type) {
if (!(this_present_type && that_present_type))
return false;
if (!this.type.equals(that.type))
return false;
}
boolean this_present_typeQualifiers = true && this.isSetTypeQualifiers();
boolean that_present_typeQualifiers = true && that.isSetTypeQualifiers();
if (this_present_typeQualifiers || that_present_typeQualifiers) {
if (!(this_present_typeQualifiers && that_present_typeQualifiers))
return false;
if (!this.typeQualifiers.equals(that.typeQualifiers))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287);
if (isSetType())
hashCode = hashCode * 8191 + type.getValue();
hashCode = hashCode * 8191 + ((isSetTypeQualifiers()) ? 131071 : 524287);
if (isSetTypeQualifiers())
hashCode = hashCode * 8191 + typeQualifiers.hashCode();
return hashCode;
}
@Override
public int compareTo(TPrimitiveTypeEntry other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetType(), other.isSetType());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetType()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetTypeQualifiers(), other.isSetTypeQualifiers());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTypeQualifiers()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeQualifiers, other.typeQualifiers);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("TPrimitiveTypeEntry(");
boolean first = true;
sb.append("type:");
if (this.type == null) {
sb.append("null");
} else {
sb.append(this.type);
}
first = false;
if (isSetTypeQualifiers()) {
if (!first) sb.append(", ");
sb.append("typeQualifiers:");
if (this.typeQualifiers == null) {
sb.append("null");
} else {
sb.append(this.typeQualifiers);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (!isSetType()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString());
}
// check for sub-struct validity
if (typeQualifiers != null) {
typeQualifiers.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class TPrimitiveTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TPrimitiveTypeEntryStandardScheme getScheme() {
return new TPrimitiveTypeEntryStandardScheme();
}
}
private static class TPrimitiveTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme<TPrimitiveTypeEntry> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.type = org.apache.hive.service.rpc.thrift.TTypeId.findByValue(iprot.readI32());
struct.setTypeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // TYPE_QUALIFIERS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.typeQualifiers = new TTypeQualifiers();
struct.typeQualifiers.read(iprot);
struct.setTypeQualifiersIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.type != null) {
oprot.writeFieldBegin(TYPE_FIELD_DESC);
oprot.writeI32(struct.type.getValue());
oprot.writeFieldEnd();
}
if (struct.typeQualifiers != null) {
if (struct.isSetTypeQualifiers()) {
oprot.writeFieldBegin(TYPE_QUALIFIERS_FIELD_DESC);
struct.typeQualifiers.write(oprot);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TPrimitiveTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TPrimitiveTypeEntryTupleScheme getScheme() {
return new TPrimitiveTypeEntryTupleScheme();
}
}
private static class TPrimitiveTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme<TPrimitiveTypeEntry> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeI32(struct.type.getValue());
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetTypeQualifiers()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetTypeQualifiers()) {
struct.typeQualifiers.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.type = org.apache.hive.service.rpc.thrift.TTypeId.findByValue(iprot.readI32());
struct.setTypeIsSet(true);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.typeQualifiers = new TTypeQualifiers();
struct.typeQualifiers.read(iprot);
struct.setTypeQualifiersIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
| lirui-apache/hive | service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TPrimitiveTypeEntry.java | Java | apache-2.0 | 16,407 |
# Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import re
import subprocess
from mock import Mock, MagicMock, patch
import pexpect
from trove.common import exception
from trove.common import utils
from trove.guestagent import pkg
from trove.tests.unittests import trove_testtools
"""
Unit tests for the classes and functions in pkg.py.
"""
class PkgDEBInstallTestCase(trove_testtools.TestCase):
def setUp(self):
super(PkgDEBInstallTestCase, self).setUp()
self.pkg = pkg.DebianPackagerMixin()
self.pkg_fix = self.pkg._fix
self.pkg_fix_package_selections = self.pkg._fix_package_selections
p0 = patch('pexpect.spawn')
p0.start()
self.addCleanup(p0.stop)
p1 = patch('trove.common.utils.execute')
p1.start()
self.addCleanup(p1.stop)
self.pkg._fix = Mock(return_value=None)
self.pkg._fix_package_selections = Mock(return_value=None)
self.pkgName = 'packageName'
def tearDown(self):
super(PkgDEBInstallTestCase, self).tearDown()
self.pkg._fix = self.pkg_fix
self.pkg._fix_package_selections = self.pkg_fix_package_selections
def test_pkg_is_installed_no_packages(self):
packages = []
self.assertTrue(self.pkg.pkg_is_installed(packages))
def test_pkg_is_installed_yes(self):
packages = ["package1=1.0", "package2"]
self.pkg.pkg_version = MagicMock(side_effect=["1.0", "2.0"])
self.assertTrue(self.pkg.pkg_is_installed(packages))
def test_pkg_is_installed_no(self):
packages = ["package1=1.0", "package2", "package3=3.1"]
self.pkg.pkg_version = MagicMock(side_effect=["1.0", "2.0", "3.0"])
self.assertFalse(self.pkg.pkg_is_installed(packages))
def test_success_install(self):
# test
pexpect.spawn.return_value.expect.return_value = 7
pexpect.spawn.return_value.match = False
self.assertTrue(self.pkg.pkg_install(self.pkgName, {}, 5000) is None)
def test_success_install_with_config_opts(self):
# test
config_opts = {'option': 'some_opt'}
pexpect.spawn.return_value.expect.return_value = 7
pexpect.spawn.return_value.match = False
self.assertTrue(
self.pkg.pkg_install(self.pkgName, config_opts, 5000) is None)
def test_permission_error(self):
# test
pexpect.spawn.return_value.expect.return_value = 0
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgPermissionError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_package_not_found_1(self):
# test
pexpect.spawn.return_value.expect.return_value = 1
pexpect.spawn.return_value.match = re.match('(.*)', self.pkgName)
# test and verify
self.assertRaises(pkg.PkgNotFoundError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_package_not_found_2(self):
# test
pexpect.spawn.return_value.expect.return_value = 2
pexpect.spawn.return_value.match = re.match('(.*)', self.pkgName)
# test and verify
self.assertRaises(pkg.PkgNotFoundError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_run_DPKG_bad_State(self):
# test _fix method is called and PackageStateError is thrown
pexpect.spawn.return_value.expect.return_value = 4
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgPackageStateError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
self.assertTrue(self.pkg._fix.called)
def test_admin_lock_error(self):
# test 'Unable to lock the administration directory' error
pexpect.spawn.return_value.expect.return_value = 5
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgAdminLockError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_package_broken_error(self):
pexpect.spawn.return_value.expect.return_value = 6
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgBrokenError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_timeout_error(self):
# test timeout error
pexpect.spawn.return_value.expect.side_effect = (
pexpect.TIMEOUT('timeout error'))
# test and verify
self.assertRaises(pkg.PkgTimeout, self.pkg.pkg_install,
self.pkgName, {}, 5000)
class PkgDEBRemoveTestCase(trove_testtools.TestCase):
def setUp(self):
super(PkgDEBRemoveTestCase, self).setUp()
self.pkg = pkg.DebianPackagerMixin()
self.pkg_version = self.pkg.pkg_version
self.pkg_install = self.pkg._install
self.pkg_fix = self.pkg._fix
p0 = patch('pexpect.spawn')
p0.start()
self.addCleanup(p0.stop)
p1 = patch('trove.common.utils.execute')
p1.start()
self.addCleanup(p1.stop)
self.pkg.pkg_version = Mock(return_value="OK")
self.pkg._install = Mock(return_value=None)
self.pkg._fix = Mock(return_value=None)
self.pkgName = 'packageName'
def tearDown(self):
super(PkgDEBRemoveTestCase, self).tearDown()
self.pkg.pkg_version = self.pkg_version
self.pkg._install = self.pkg_install
self.pkg._fix = self.pkg_fix
def test_remove_no_pkg_version(self):
# test
pexpect.spawn.return_value.expect.return_value = 6
pexpect.spawn.return_value.match = False
with patch.object(self.pkg, 'pkg_version', return_value=None):
self.assertTrue(self.pkg.pkg_remove(self.pkgName, 5000) is None)
def test_success_remove(self):
# test
pexpect.spawn.return_value.expect.return_value = 6
pexpect.spawn.return_value.match = False
self.assertTrue(self.pkg.pkg_remove(self.pkgName, 5000) is None)
def test_permission_error(self):
# test
pexpect.spawn.return_value.expect.return_value = 0
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgPermissionError, self.pkg.pkg_remove,
self.pkgName, 5000)
def test_package_not_found(self):
# test
pexpect.spawn.return_value.expect.return_value = 1
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgNotFoundError, self.pkg.pkg_remove,
self.pkgName, 5000)
def test_package_reinstall_first_1(self):
# test
pexpect.spawn.return_value.expect.return_value = 2
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgPackageStateError, self.pkg.pkg_remove,
self.pkgName, 5000)
self.assertTrue(self.pkg._install.called)
self.assertFalse(self.pkg._fix.called)
def test_package_reinstall_first_2(self):
# test
pexpect.spawn.return_value.expect.return_value = 3
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgPackageStateError, self.pkg.pkg_remove,
self.pkgName, 5000)
self.assertTrue(self.pkg._install.called)
self.assertFalse(self.pkg._fix.called)
def test_package_DPKG_first(self):
# test
pexpect.spawn.return_value.expect.return_value = 4
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgPackageStateError, self.pkg.pkg_remove,
self.pkgName, 5000)
self.assertFalse(self.pkg._install.called)
self.assertTrue(self.pkg._fix.called)
def test_admin_lock_error(self):
# test 'Unable to lock the administration directory' error
pexpect.spawn.return_value.expect.return_value = 5
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgAdminLockError, self.pkg.pkg_remove,
self.pkgName, 5000)
def test_timeout_error(self):
# test timeout error
pexpect.spawn.return_value.expect.side_effect = (
pexpect.TIMEOUT('timeout error'))
# test and verify
self.assertRaises(pkg.PkgTimeout, self.pkg.pkg_remove,
self.pkgName, 5000)
@patch.object(subprocess, 'call')
def test_timeout_error_with_exception(self, mock_call):
# test timeout error
pexpect.spawn.return_value.expect.side_effect = (
pexpect.TIMEOUT('timeout error'))
pexpect.spawn.return_value.close.side_effect = (
pexpect.ExceptionPexpect('error'))
# test and verify
self.assertRaises(pkg.PkgTimeout, self.pkg.pkg_remove,
self.pkgName, 5000)
self.assertEqual(1, mock_call.call_count)
class PkgDEBVersionTestCase(trove_testtools.TestCase):
def setUp(self):
super(PkgDEBVersionTestCase, self).setUp()
self.pkgName = 'mysql-server-5.5'
self.pkgVersion = '5.5.28-0'
self.getoutput = pkg.getoutput
def tearDown(self):
super(PkgDEBVersionTestCase, self).tearDown()
pkg.getoutput = self.getoutput
def test_version_success(self):
cmd_out = "%s:\n Installed: %s\n" % (self.pkgName, self.pkgVersion)
pkg.getoutput = Mock(return_value=cmd_out)
version = pkg.DebianPackagerMixin().pkg_version(self.pkgName)
self.assertTrue(version)
self.assertEqual(self.pkgVersion, version)
def test_version_unknown_package(self):
cmd_out = "N: Unable to locate package %s" % self.pkgName
pkg.getoutput = Mock(return_value=cmd_out)
self.assertFalse(pkg.DebianPackagerMixin().pkg_version(self.pkgName))
def test_version_no_version(self):
cmd_out = "%s:\n Installed: %s\n" % (self.pkgName, "(none)")
pkg.getoutput = Mock(return_value=cmd_out)
self.assertFalse(pkg.DebianPackagerMixin().pkg_version(self.pkgName))
class PkgRPMVersionTestCase(trove_testtools.TestCase):
def setUp(self):
super(PkgRPMVersionTestCase, self).setUp()
self.pkgName = 'python-requests'
self.pkgVersion = '0.14.2-1.el6'
self.getoutput = pkg.getoutput
def tearDown(self):
super(PkgRPMVersionTestCase, self).tearDown()
pkg.getoutput = self.getoutput
@patch('trove.guestagent.pkg.LOG')
def test_version_no_output(self, mock_logging):
cmd_out = ''
pkg.getoutput = Mock(return_value=cmd_out)
self.assertIsNone(pkg.RedhatPackagerMixin().pkg_version(self.pkgName))
def test_version_success(self):
cmd_out = self.pkgVersion
pkg.getoutput = Mock(return_value=cmd_out)
version = pkg.RedhatPackagerMixin().pkg_version(self.pkgName)
self.assertTrue(version)
self.assertEqual(self.pkgVersion, version)
class PkgRPMInstallTestCase(trove_testtools.TestCase):
def setUp(self):
super(PkgRPMInstallTestCase, self).setUp()
self.pkg = pkg.RedhatPackagerMixin()
self.getoutput = pkg.getoutput
self.pkgName = 'packageName'
p0 = patch('pexpect.spawn')
p0.start()
self.addCleanup(p0.stop)
p1 = patch('trove.common.utils.execute')
p1.start()
self.addCleanup(p1.stop)
def tearDown(self):
super(PkgRPMInstallTestCase, self).tearDown()
pkg.getoutput = self.getoutput
def test_pkg_is_installed_no_packages(self):
packages = []
self.assertTrue(self.pkg.pkg_is_installed(packages))
def test_pkg_is_installed_yes(self):
packages = ["package1=1.0", "package2"]
with patch.object(pkg, 'getoutput', MagicMock(
return_value="package1=1.0\n" "package2=2.0")):
self.assertTrue(self.pkg.pkg_is_installed(packages))
def test_pkg_is_installed_no(self):
packages = ["package1=1.0", "package2", "package3=3.0"]
with patch.object(pkg, 'getoutput', MagicMock(
return_value="package1=1.0\n" "package2=2.0")):
self.assertFalse(self.pkg.pkg_is_installed(packages))
def test_permission_error(self):
# test
pexpect.spawn.return_value.expect.return_value = 0
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgPermissionError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_package_not_found(self):
# test
pexpect.spawn.return_value.expect.return_value = 1
pexpect.spawn.return_value.match = re.match('(.*)', self.pkgName)
# test and verify
self.assertRaises(pkg.PkgNotFoundError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_package_conflict_remove(self):
# test
pexpect.spawn.return_value.expect.return_value = 2
pexpect.spawn.return_value.match = re.match('(.*)', self.pkgName)
self.pkg._rpm_remove_nodeps = Mock()
# test and verify
self.pkg._install(self.pkgName, 5000)
self.assertTrue(self.pkg._rpm_remove_nodeps.called)
def test_package_conflict_remove_install(self):
with patch.object(self.pkg, '_install', side_effect=[3, 3, 0]):
self.assertTrue(
self.pkg.pkg_install(self.pkgName, {}, 5000) is None)
self.assertEqual(3, self.pkg._install.call_count)
@patch.object(utils, 'execute')
def test__rpm_remove_nodeps(self, mock_execute):
self.pkg._rpm_remove_nodeps(self.pkgName)
mock_execute.assert_called_with('rpm', '-e', '--nodeps', self.pkgName,
run_as_root=True, root_helper='sudo')
def test_package_scriptlet_error(self):
# test
pexpect.spawn.return_value.expect.return_value = 5
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgScriptletError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_package_http_error(self):
# test
pexpect.spawn.return_value.expect.return_value = 6
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgDownloadError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_package_nomirrors_error(self):
# test
pexpect.spawn.return_value.expect.return_value = 7
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgDownloadError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_package_sign_error(self):
# test
pexpect.spawn.return_value.expect.return_value = 8
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgSignError, self.pkg.pkg_install,
self.pkgName, {}, 5000)
def test_package_already_installed(self):
# test
pexpect.spawn.return_value.expect.return_value = 9
pexpect.spawn.return_value.match = False
# test and verify
self.assertTrue(self.pkg.pkg_install(self.pkgName, {}, 5000) is None)
def test_package_success_updated(self):
# test
pexpect.spawn.return_value.expect.return_value = 10
pexpect.spawn.return_value.match = False
# test and verify
self.assertTrue(self.pkg.pkg_install(self.pkgName, {}, 5000) is None)
def test_package_success_installed(self):
# test
pexpect.spawn.return_value.expect.return_value = 11
pexpect.spawn.return_value.match = False
# test and verify
self.assertTrue(self.pkg.pkg_install(self.pkgName, {}, 5000) is None)
def test_timeout_error(self):
# test timeout error
pexpect.spawn.return_value.expect.side_effect = (
pexpect.TIMEOUT('timeout error'))
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgTimeout, self.pkg.pkg_install,
self.pkgName, {}, 5000)
class PkgRPMRemoveTestCase(trove_testtools.TestCase):
def setUp(self):
super(PkgRPMRemoveTestCase, self).setUp()
self.pkg = pkg.RedhatPackagerMixin()
self.pkg_version = self.pkg.pkg_version
self.pkg_install = self.pkg._install
p0 = patch('pexpect.spawn')
p0.start()
self.addCleanup(p0.stop)
p1 = patch('trove.common.utils.execute')
p1.start()
self.addCleanup(p1.stop)
self.pkg.pkg_version = Mock(return_value="OK")
self.pkg._install = Mock(return_value=None)
self.pkgName = 'packageName'
def tearDown(self):
super(PkgRPMRemoveTestCase, self).tearDown()
self.pkg.pkg_version = self.pkg_version
self.pkg._install = self.pkg_install
def test_permission_error(self):
# test
pexpect.spawn.return_value.expect.return_value = 0
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgPermissionError, self.pkg.pkg_remove,
self.pkgName, 5000)
def test_package_not_found(self):
# test
pexpect.spawn.return_value.expect.return_value = 1
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgNotFoundError, self.pkg.pkg_remove,
self.pkgName, 5000)
def test_remove_no_pkg_version(self):
# test
pexpect.spawn.return_value.expect.return_value = 2
pexpect.spawn.return_value.match = False
with patch.object(self.pkg, 'pkg_version', return_value=None):
self.assertTrue(self.pkg.pkg_remove(self.pkgName, 5000) is None)
def test_success_remove(self):
# test
pexpect.spawn.return_value.expect.return_value = 2
pexpect.spawn.return_value.match = False
self.assertTrue(self.pkg.pkg_remove(self.pkgName, 5000) is None)
def test_timeout_error(self):
# test timeout error
pexpect.spawn.return_value.expect.side_effect = (
pexpect.TIMEOUT('timeout error'))
pexpect.spawn.return_value.match = False
# test and verify
self.assertRaises(pkg.PkgTimeout, self.pkg.pkg_remove,
self.pkgName, 5000)
class PkgDEBFixPackageSelections(trove_testtools.TestCase):
def setUp(self):
super(PkgDEBFixPackageSelections, self).setUp()
self.pkg = pkg.DebianPackagerMixin()
self.getoutput = pkg.getoutput
def tearDown(self):
super(PkgDEBFixPackageSelections, self).tearDown()
pkg.getoutput = self.getoutput
@patch.object(os, 'remove')
@patch.object(pkg, 'NamedTemporaryFile')
@patch.object(utils, 'execute')
def test__fix_package_selections(self, mock_execute, mock_temp_file,
mock_remove):
packages = ["package1"]
config_opts = {'option': 'some_opt'}
pkg.getoutput = Mock(
return_value="* package1/option: some_opt")
self.pkg._fix_package_selections(packages, config_opts)
self.assertEqual(2, mock_execute.call_count)
self.assertEqual(1, mock_remove.call_count)
@patch.object(os, 'remove')
@patch.object(pkg, 'NamedTemporaryFile')
@patch.object(utils, 'execute',
side_effect=exception.ProcessExecutionError)
def test_fail__fix_package_selections(self, mock_execute, mock_temp_file,
mock_remove):
packages = ["package1"]
config_opts = {'option': 'some_opt'}
pkg.getoutput = Mock(
return_value="* package1/option: some_opt")
self.assertRaises(pkg.PkgConfigureError,
self.pkg._fix_package_selections,
packages, config_opts)
self.assertEqual(1, mock_remove.call_count)
@patch.object(utils, 'execute')
def test__fix(self, mock_execute):
self.pkg._fix(30)
mock_execute.assert_called_with('dpkg', '--configure', '-a',
run_as_root=True, root_helper='sudo')
| mmasaki/trove | trove/tests/unittests/guestagent/test_pkg.py | Python | apache-2.0 | 21,209 |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/quic/quic_clock.h"
#include "base/time.h"
namespace net {
QuicClock::QuicClock() {
}
QuicClock::~QuicClock() {}
QuicTime QuicClock::ApproximateNow() const {
// Chrome does not have a distinct notion of ApproximateNow().
return Now();
}
QuicTime QuicClock::Now() const {
return QuicTime(base::TimeTicks::Now());
}
QuicTime::Delta QuicClock::NowAsDeltaSinceUnixEpoch() const {
return QuicTime::Delta(base::Time::Now() - base::Time::UnixEpoch());
}
} // namespace net
| plxaye/chromium | src/net/quic/quic_clock.cc | C++ | apache-2.0 | 666 |
## Ansible 2.x Order of Variable Precedence
* role defaults
* inventory INI or script group vars
* inventory group_vars/all
* playbook group_vars/all
* inventory group_vars/*
* playbook group_vars/*
* inventory INI or script host vars
* inventory host_vars/*
* playbook host_vars/*
* host facts
* play vars
* play vars_prompt
* play vars_files
* role vars (defined in role/vars/main.yml)
* block vars (only for tasks in block)
* task vars (only for the task)
* role (and include_role) params
* include params
* include_vars
* set_facts / registered vars
* extra vars (always win precedence)
| mcgonagle/ansible_SP | docs/PRECEDENCE.md | Markdown | apache-2.0 | 592 |
//
// FLEXKeychainQuery.h
//
// Derived from:
// SSKeychainQuery.h in SSKeychain
// Created by Caleb Davenport on 3/19/13.
// Copyright (c) 2010-2014 Sam Soffes. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Security/Security.h>
#if __IPHONE_7_0 || __MAC_10_9
// Keychain synchronization available at compile time
#define FLEXKEYCHAIN_SYNCHRONIZATION_AVAILABLE 1
#endif
#if __IPHONE_3_0 || __MAC_10_9
// Keychain access group available at compile time
#define FLEXKEYCHAIN_ACCESS_GROUP_AVAILABLE 1
#endif
#ifdef FLEXKEYCHAIN_SYNCHRONIZATION_AVAILABLE
typedef NS_ENUM(NSUInteger, FLEXKeychainQuerySynchronizationMode) {
FLEXKeychainQuerySynchronizationModeAny,
FLEXKeychainQuerySynchronizationModeNo,
FLEXKeychainQuerySynchronizationModeYes
};
#endif
/// Simple interface for querying or modifying keychain items.
@interface FLEXKeychainQuery : NSObject
/// kSecAttrAccount
@property (nonatomic, copy) NSString *account;
/// kSecAttrService
@property (nonatomic, copy) NSString *service;
/// kSecAttrLabel
@property (nonatomic, copy) NSString *label;
#ifdef FLEXKEYCHAIN_ACCESS_GROUP_AVAILABLE
/// kSecAttrAccessGroup (only used on iOS)
@property (nonatomic, copy) NSString *accessGroup;
#endif
#ifdef FLEXKEYCHAIN_SYNCHRONIZATION_AVAILABLE
/// kSecAttrSynchronizable
@property (nonatomic) FLEXKeychainQuerySynchronizationMode synchronizationMode;
#endif
/// Root storage for password information
@property (nonatomic, copy) NSData *passwordData;
/// This property automatically transitions between an object and the value of
/// `passwordData` using NSKeyedArchiver and NSKeyedUnarchiver.
@property (nonatomic, copy) id<NSCoding> passwordObject;
/// Convenience accessor for setting and getting a password string. Passes through
/// to `passwordData` using UTF-8 string encoding.
@property (nonatomic, copy) NSString *password;
#pragma mark Saving & Deleting
/// Save the receiver's attributes as a keychain item. Existing items with the
/// given account, service, and access group will first be deleted.
///
/// @param error Populated should an error occur.
/// @return `YES` if saving was successful, `NO` otherwise.
- (BOOL)save:(NSError **)error;
/// Delete keychain items that match the given account, service, and access group.
///
/// @param error Populated should an error occur.
/// @return `YES` if saving was successful, `NO` otherwise.
- (BOOL)deleteItem:(NSError **)error;
#pragma mark Fetching
/// Fetch all keychain items that match the given account, service, and access
/// group. The values of `password` and `passwordData` are ignored when fetching.
///
/// @param error Populated should an error occur.
/// @return An array of dictionaries that represent all matching keychain items,
/// or `nil` should an error occur. The order of the items is not determined.
- (NSArray<NSDictionary<NSString *, id> *> *)fetchAll:(NSError **)error;
/// Fetch the keychain item that matches the given account, service, and access
/// group. The `password` and `passwordData` properties will be populated unless
/// an error occurs. The values of `password` and `passwordData` are ignored when
/// fetching.
///
/// @param error Populated should an error occur.
/// @return `YES` if fetching was successful, `NO` otherwise.
- (BOOL)fetch:(NSError **)error;
#pragma mark Synchronization Status
#ifdef FLEXKEYCHAIN_SYNCHRONIZATION_AVAILABLE
/// Returns a boolean indicating if keychain synchronization is available on the device at runtime.
/// The #define FLEXKEYCHAIN_SYNCHRONIZATION_AVAILABLE is only for compile time.
/// If you are checking for the presence of synchronization, you should use this method.
///
/// @return A value indicating if keychain synchronization is available
+ (BOOL)isSynchronizationAvailable;
#endif
@end
| raymondshadow/SwiftDemo | SwiftApp/Pods/FLEX/Classes/GlobalStateExplorers/Keychain/FLEXKeychainQuery.h | C | apache-2.0 | 3,801 |
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-linux see joyent/libuv#1189
// ignore-android needs extra network permissions
// ignore-openbsd system ulimit (Too many open files)
// ignore-bitrig system ulimit (Too many open files)
// exec-env:RUST_LOG=debug
#![feature(rustc_private, libc, old_io, io, std_misc)]
#![allow(deprecated, unused_must_use)]
#[macro_use]
extern crate log;
extern crate libc;
use std::sync::mpsc::channel;
use std::old_io::net::tcp::{TcpListener, TcpStream};
use std::old_io::{Acceptor, Listener, Reader, Writer};
use std::thread::{self, Builder};
use std::time::Duration;
fn main() {
// This test has a chance to time out, try to not let it time out
thread::spawn(move|| -> () {
use std::old_io::timer;
timer::sleep(Duration::milliseconds(30 * 1000));
println!("timed out!");
unsafe { libc::exit(1) }
});
let (tx, rx) = channel();
thread::spawn(move || -> () {
let mut listener = TcpListener::bind("127.0.0.1:0").unwrap();
tx.send(listener.socket_name().unwrap()).unwrap();
let mut acceptor = listener.listen();
loop {
let mut stream = match acceptor.accept() {
Ok(stream) => stream,
Err(error) => {
debug!("accept panicked: {}", error);
continue;
}
};
stream.read_byte();
stream.write(&[2]);
}
});
let addr = rx.recv().unwrap();
let (tx, rx) = channel();
for _ in 0..1000 {
let tx = tx.clone();
Builder::new().stack_size(64 * 1024).spawn(move|| {
match TcpStream::connect(addr) {
Ok(stream) => {
let mut stream = stream;
stream.write(&[1]);
let mut buf = [0];
stream.read(&mut buf);
},
Err(e) => debug!("{}", e)
}
tx.send(()).unwrap();
});
}
// Wait for all clients to exit, but don't wait for the server to exit. The
// server just runs infinitely.
drop(tx);
for _ in 0..1000 {
rx.recv().unwrap();
}
unsafe { libc::exit(0) }
}
| avdi/rust | src/test/run-pass/tcp-stress.rs | Rust | apache-2.0 | 2,667 |
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_COMPILER_XLA_SERVICE_CPU_IR_EMITTER_H_
#define TENSORFLOW_COMPILER_XLA_SERVICE_CPU_IR_EMITTER_H_
#include <stddef.h>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "absl/container/flat_hash_map.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "llvm/ADT/Triple.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Value.h"
#include "llvm/Target/TargetMachine.h"
#include "mlir/IR/MLIRContext.h" // from @llvm-project
#include "tensorflow/compiler/xla/service/buffer_assignment.h"
#include "tensorflow/compiler/xla/service/cpu/ir_function.h"
#include "tensorflow/compiler/xla/service/cpu/target_machine_features.h"
#include "tensorflow/compiler/xla/service/dfs_hlo_visitor_with_default.h"
#include "tensorflow/compiler/xla/service/hlo_computation.h"
#include "tensorflow/compiler/xla/service/hlo_instruction.h"
#include "tensorflow/compiler/xla/service/hlo_instructions.h"
#include "tensorflow/compiler/xla/service/hlo_module_config.h"
#include "tensorflow/compiler/xla/service/llvm_ir/alias_analysis.h"
#include "tensorflow/compiler/xla/service/llvm_ir/ir_array.h"
#include "tensorflow/compiler/xla/service/llvm_ir/ir_builder_mixin.h"
#include "tensorflow/compiler/xla/service/llvm_ir/llvm_util.h"
#include "tensorflow/compiler/xla/service/llvm_ir/loop_emitter.h"
#include "tensorflow/compiler/xla/service/name_uniquer.h"
#include "tensorflow/compiler/xla/statusor.h"
#include "tensorflow/compiler/xla/types.h"
#include "tensorflow/compiler/xla/xla_data.pb.h"
#include "tensorflow/core/platform/macros.h"
#include "tensorflow/core/platform/types.h"
namespace xla {
namespace cpu {
// This class is the top-level API for the XLA HLO --> LLVM IR compiler. It
// implements the DfsHloVisitor interface and emits HLO computations as LLVM IR
// functions.
class IrEmitter : public DfsHloVisitorWithDefault,
public IrBuilderMixin<IrEmitter> {
friend class CpuElementalIrEmitter;
public:
using GeneratorForOperandIrArrays =
std::function<std::vector<llvm_ir::IrArray>()>;
// Create a new LLVM IR emitter.
//
// hlo_module: the HLO module we are emitting IR for.
// assignment: a BufferAssignment from which we know which buffers are used by
// the HLO nodes.
// mlir_context: the MLIR context used for IR emission.
// llvm_module: the LLVM module to emit IR into. It's built using the LLVM
// context inside of mlir_context.
// instruction_to_profile_idx: the mapping from HLO instructions to their
// index in the profiling array.
// computation_to_profile_idx: the mapping from HLO computations to their
// index in the profiling array.
// emit_code_for_msan: whether emitted code should be compatible with msan.
IrEmitter(mlir::MLIRContext* mlir_context, const HloModule& hlo_module,
const BufferAssignment& assignment, llvm::Module* llvm_module,
std::unordered_map<const HloInstruction*, int64>
instruction_to_profile_idx,
std::unordered_map<const HloComputation*, int64>
computation_to_profile_idx,
const TargetMachineFeatures* target_machine,
bool emit_code_for_msan);
~IrEmitter() override;
// Emit and return the given HLO computation as an LLVM IR
// function.
//
// function_name_prefix is the desired name of the function. If the name is
// not unique among already emitted functions then a suffix is appended to
// make the name unique.
//
// 'is_top_level_computation' has the following meanings for each CPU backend:
// *) sequential: indicates that this is the entry computation of the HLO
// module.
// *) parallel: indices that this is the callee of a kCall HLO in the entry
// computation of the HLO module.
//
// If 'instruction_order' is not NULL, then the HLO instructions are emitted
// in the given order. In this case, 'instruction_order' must be a
// topological sort of the set of nodes accessible from the root of the
// computation.
StatusOr<llvm::Function*> EmitComputation(
HloComputation* computation, const string& function_name_prefix,
bool is_top_level_computation,
absl::Span<HloInstruction* const> instruction_order);
llvm::IRBuilder<>* b() { return &b_; }
// builder() is for IrBuilderMixin.
llvm::IRBuilder<>* builder() { return &b_; }
// Emit an LLVM global variable for every constant buffer allocation.
Status EmitConstantGlobals();
// Emit code to emit the element at `index` for a convolution instruction.
StatusOr<llvm::Value*> EmitElementalConvolution(
const HloConvolutionInstruction* convolution,
const llvm_ir::ElementGenerator& input_generator,
const llvm_ir::ElementGenerator& kernel_generator,
const llvm_ir::IrArray::Index& index);
protected:
//
// The following methods implement the DfsHloVisitor interface.
//
// Default action which emits code for most operations. Operations which are
// special in some way are handled explicitly in HandleFoo methods.
Status DefaultAction(HloInstruction* hlo) override;
Status HandleAllToAll(HloInstruction* instruction) override;
Status HandleBitcast(HloInstruction* bitcast) override;
Status HandleConstant(HloInstruction* constant) override;
Status HandleCopy(HloInstruction* copy) override;
Status HandleGetTupleElement(HloInstruction* get_tuple_element) override;
Status HandleSelect(HloInstruction* select) override;
Status HandleTupleSelect(HloInstruction* tuple_select) override;
Status HandleDot(HloInstruction* dot) override;
Status HandleConvolution(HloInstruction* convolution) override;
Status HandleFft(HloInstruction* fft) override;
Status HandleAllReduce(HloInstruction* crs) override;
Status HandleCollectivePermute(HloInstruction* crs) override;
Status HandleInfeed(HloInstruction* infeed) override;
Status HandleOutfeed(HloInstruction* outfeed) override;
Status HandleSort(HloInstruction* sort) override;
Status HandleParameter(HloInstruction* parameter) override;
Status HandleReduce(HloInstruction* reduce) override;
Status HandleReduceWindow(HloInstruction* reduce_window) override;
Status HandleSelectAndScatter(HloInstruction* select_and_scatter) override;
Status HandleSend(HloInstruction* send) override;
Status HandleSendDone(HloInstruction* send_done) override;
Status HandleSlice(HloInstruction* slice) override;
Status HandleDynamicSlice(HloInstruction* dynamic_slice) override;
Status HandleDynamicUpdateSlice(
HloInstruction* dynamic_update_slice) override;
Status HandleRecv(HloInstruction* recv) override;
Status HandleRecvDone(HloInstruction* recv_done) override;
Status HandlePad(HloInstruction* pad) override;
Status HandleTuple(HloInstruction* tuple) override;
Status HandleFusion(HloInstruction* fusion) override;
Status HandleCall(HloInstruction* call) override;
Status HandleCustomCall(HloInstruction* custom_call) override;
Status HandleWhile(HloInstruction* xla_while) override;
Status HandleConcatenate(HloInstruction* concatenate) override;
Status HandleConditional(HloInstruction* conditional) override;
Status HandleScatter(HloInstruction* scatter) override;
Status HandleAfterAll(HloInstruction* after_all) override;
Status HandleAddDependency(HloInstruction* add_dependency) override;
Status HandleReplicaId(HloInstruction* hlo) override;
Status HandleRng(HloInstruction* rng) override;
Status HandleRngGetAndUpdateState(HloInstruction* rng_state) override;
Status FinishVisit(HloInstruction* root) override;
Status Preprocess(HloInstruction* hlo) override;
Status Postprocess(HloInstruction* hlo) override;
// A convenient helper for calling BufferAssignment::GetUniqueSlice.
BufferAllocation::Slice GetAllocationSlice(
const HloInstruction& hlo, const ShapeIndex& index = {}) const {
return assignment_.GetUniqueSlice(&hlo, index).ConsumeValueOrDie();
}
private:
Status HandleSliceToDynamic(HloInstruction* hlo);
Status HandlePadToStatic(HloInstruction* hlo);
Status HandleTopK(HloInstruction* hlo);
Status HandleAllReduceSingleReplica(HloInstruction* crs);
Status HandleAllReduceMultipleReplica(HloInstruction* crs);
// Private helper to initialize an IR function for the computation.
void InitializeIrFunction(const string& function_name);
// Emits the copying epilogue for the function,
// where it copies the returned value to the reserved alloca.
// This is only necessary for thread-local functions.
// Note that since the call graph is flattened, if the same function is
// called in both thread-local and non-thread-local it would be codegen'd
// twice, and we would know whether it's thread-local at codegen time.
void EmitThreadLocalFunctionEpilogue(HloComputation* computation);
// Convenience functions to generate a GEP into the profile counter parameter
// which would correspond to the index for a given HLO instruction or
// computation.
llvm::Value* GetProfileCounterFor(const HloInstruction& instruction);
llvm::Value* GetProfileCounterFor(const HloComputation& computation);
// Helper function template for the implementation of the above two functions.
template <typename T>
llvm::Value* GetProfileCounterCommon(
const T& hlo,
const std::unordered_map<const T*, int64>& profile_index_map);
// Gets the IR Value emitted previously for the given hlo.
//
// Prefer calling GetIrArrayFor if the value you're reading is a buffer,
// because GetIrArrayFor annotates buffer's loads/stores with noalias
// metadata.
//
// Make sure to call this only when you're certain a value *was* emitted - if
// not found, this will log a fatal error.
llvm::Value* GetEmittedValueFor(const HloInstruction* hlo);
// Gets an IrArray representing the given hlo.
llvm_ir::IrArray GetIrArrayFor(const HloInstruction* hlo);
// Gets a list of IrArrays, one for each of hlo's operands.
std::vector<llvm_ir::IrArray> GetIrArraysForOperandsOf(
const HloInstruction* hlo);
GeneratorForOperandIrArrays GetGeneratorForOperandIrArrays(
HloInstruction* unnested_hlo) {
return [=]() { return GetIrArraysForOperandsOf(unnested_hlo); };
}
// Augments IrArray with aliasing information.
void AddAliasingInformationToIrArray(const HloInstruction& hlo,
llvm_ir::IrArray* array) {
alias_analysis_.AddAliasingInformationToIrArray(hlo, array);
}
// Convenience function to get the IR type matching the given shape.
llvm::Type* IrShapeType(const Shape& shape);
// Get the llvm::Value* that represents the "prof_counters" argument of the
// computation function being emitted by this emitter.
llvm::Value* GetProfileCountersArgument();
// Get the xla::ExecutableRunOptions that represents the "run_options"
// argument of the computation function being emitted by this emitter.
llvm::Value* GetExecutableRunOptionsArgument();
// Get the llvm::Value* that represents the "buffer_table" argument of the
// computation function being emitted by this emitter.
llvm::Value* GetBufferTableArgument();
// Helper for EmitBufferPointer.
llvm::Value* EmitGlobalBufferPointer(const BufferAllocation::Slice& slice,
const Shape& target_shape);
// Helper for EmitBufferPointer.
llvm::Value* EmitThreadLocalBufferPointer(
const BufferAllocation::Slice& slice, const Shape& target_shape);
// Emits code that computes the address of the given buffer allocation slice.
llvm::Value* EmitBufferPointer(const BufferAllocation::Slice& slice,
const Shape& target_shape);
// Emits a call to a thread local function (e.g. to the computation nested
// within a reduce or a map). Thread local callees (by definition) only write
// to and read from thread local allocations.
// Supports only functions returning scalars or tuples of scalars.
//
// `parameters` holds the *scalar values* that need to be passed to the
// callee. The return value is the scalar returned by the callee.
std::vector<llvm::Value*> EmitThreadLocalCall(
const HloComputation& callee, absl::Span<llvm::Value* const> parameters,
absl::string_view name);
// Similar to EmitThreadLocal, yet assumes that the function returns a scalar.
llvm::Value* EmitScalarReturningThreadLocalCall(
const HloComputation& callee, absl::Span<llvm::Value* const> parameters,
absl::string_view name);
// Emits a call to a "global" function (e.g. to the computation nested within
// a kWhile or a kCall). Buffer assignment unabiguously assigns buffers to
// the parameters and return values for these computations so there is no need
// to explicitly pass parameters or return results.
void EmitGlobalCall(const HloComputation& callee, absl::string_view name);
// Returns the buffer to which a global call to `callee` would have written
// its result.
llvm::Value* GetBufferForGlobalCallReturnValue(const HloComputation& callee);
// Verifies that the element types of all of the given operand instructions
// match and are of one of the given supported types.
Status ElementTypesSameAndSupported(
const HloInstruction& instruction,
absl::Span<const HloInstruction* const> operands,
absl::Span<const PrimitiveType> supported_types);
// Emit IR to perform a computation for every element in the given target op.
// This produces a series of nested loops (one for each dimension of the op's
// shape). The body of the inner-most loop is provided by the body_emitter
// function.
//
// desc is an optional human-readable string that's added to the loop name in
// IR. Regardless of whether desc is provided, target_op->name() is included
// in the loop name.
//
// TODO(jingyue): target_op should be a `const HloInstruction*`.
Status EmitTargetElementLoop(
HloInstruction* target_op,
const llvm_ir::ElementGenerator& element_generator);
Status EmitTargetElementLoop(
HloInstruction* target_op, absl::string_view desc,
const llvm_ir::ElementGenerator& element_generator);
// Emits a memcpy from the source instruction's result value to the
// destination's. Both source and destination must have an entry in the
// emitted_value_ table.
Status EmitMemcpy(const HloInstruction& source,
const HloInstruction& destination);
// Emits IR to compute the target address of the buffer for the given op.
// After calling this function, you can get a pointer to this buffer by
// calling GetIrArrayForOp or GetEmittedValueFor.
Status EmitTargetAddressForOp(const HloInstruction* op);
// Structurizes "array_elements" into an MD array that represents "shape".
// This is a recursive function, and "dimension_index" indicates the index of
// the current dimension that the function is considering (0 means the
// most-minor dimension).
llvm::Constant* CreateInitializerForConstantArray(
const std::vector<llvm::Constant*>& array_elements, const Shape& shape,
int64 dimension_index);
// Tries to codegen a reduction operation using vectorized instructions.
// Returns true if successful, and false on failure. On failure, sets
// "failure_reason" to a string describing why it could not vectorize the
// reduction.
//
// TODO(sanjoy): Some of the things we do here can be abstracted out into
// concepts that generalize over other vectorizable operations. We should
// consider pulling out these abstractions into a VectorizingIrEmitter or
// something similar.
StatusOr<bool> EmitVectorizedReduce(HloInstruction* reduce,
HloInstruction* arg,
HloInstruction* init_value,
absl::Span<const int64> dimensions,
HloComputation* function,
string* failure_reason);
// We'd like to keep one or two one cache-line's worth of data in registers
// without generating IR with illegal (e.g. excessively large or
// non-power-of-two) vector types. We do this by introducing a layer of
// abstraction: we introduce a high level vector-like concept called a
// "sharded vector" that models data parallelism, and is mapped to a sequence
// scalar and vector llvm::Value s.
//
// For example, we can represent 29 f32 elements by a sharded vector mapped to
// a sequence of LLVM values of types [<16 x f32>, <8 x f32>, <4 x f32>, f32].
// Note that the last element is scalar.
//
// There is no requirement on the ordering or the uniqueness of the elements
// mapped to sharded vectors -- we allow repeated elements, and we allow
// elements to appear in any order.
using ShardedVector = std::vector<llvm::Value*>;
// A sharded vector type is the element-wise llvm::Type's of some
// ShardedVector.
using ShardedVectorType = std::vector<llvm::Type*>;
// Create a sharded vector type corresponding to a "element_count" long
// sequence of "element_type" values.
ShardedVectorType CreateShardedVectorType(PrimitiveType element_type,
unsigned element_count);
// Emit LLVM IR to store the sharded vector "value_to_store" to
// "store_address".
void EmitShardedVectorStore(llvm::Value* store_address,
const ShardedVector& value_to_store,
const int alignment,
const llvm_ir::IrArray& containing_array);
using ReductionGenerator = std ::function<llvm::Value*(
llvm::IRBuilder<>*, llvm::Value*, llvm::Value*)>;
// Tries to match the reduction function "function" to a known reduction
// pattern. Returns a non-null ReductionGenerator on a successful match,
// which can be used to generate the LLVM IR corresponding to said reduction.
// On failure, this stores a reason string into "failure_reason".
ReductionGenerator MatchReductionGenerator(HloComputation* function,
string* failure_reason) const;
// Emits the inner loop nest that runs the reduction. Helper function for
// EmitVectorizedReduce.
StatusOr<ShardedVector> EmitInnerLoopForVectorizedReduction(
const ReductionGenerator& reduction_generator,
const llvm_ir::IrArray::Index& output_index,
const ShardedVectorType& accumulator_type, HloInstruction* init_value,
HloInstruction* arg, absl::Span<const int64> dimensions,
unsigned element_alignment);
// Tries to emit a fast concatenate operation using memcpy. Returns true if
// successful, and false on failure. On failure, sets "failure_reason" to a
// string describing why it could not emit a fast concatenate.
StatusOr<bool> EmitFastConcatenate(HloInstruction* concatenate,
absl::Span<HloInstruction* const> operands,
string* failure_reason);
// Emits LLVM IR to transfer "element_count" elements of type "primitive_type"
// from the address "source" to the address "target".
void EmitTransferElements(llvm::Value* target, llvm::Value* source,
int64 element_count, PrimitiveType primitive_type,
const llvm_ir::IrArray& target_array,
const llvm_ir::IrArray& source_array);
// Emits printing during the execution.
llvm::Value* EmitPrintf(absl::string_view fmt,
absl::Span<llvm::Value* const> arguments);
// Emits a call to a non-variadic function `func_name` with arguments
// `arguments` assuming C calling convention.
llvm::Value* EmitCallToFunc(
std::string func_name, const std::vector<llvm::Value*>& arguments,
llvm::Type* return_type, bool does_not_throw = true,
bool only_accesses_arg_memory = false,
bool only_accesses_inaccessible_mem_or_arg_mem = false);
// Assignment of the buffers needed by the computation and their shape
// information.
const BufferAssignment& assignment_;
// The LLVM module into which IR will be emitted.
llvm::Module* module_;
// The target architecture.
llvm::Triple::ArchType arch_type_;
// Used to produce unique names for generated functions.
NameUniquer name_uniquer_;
// Map containing all previously emitted computations.
std::map<const HloComputation*, llvm::Function*> emitted_functions_;
// Map containing all previously emitted thread-local temporary buffers.
std::map<std::pair<llvm::Function*, BufferAllocation::Slice>, llvm::Value*>
thread_local_buffers_;
// The following fields track the IR emission state. According to LLVM memory
// management rules, their memory is owned by the module (Note that IrFunction
// creates the encapsulated llvm::Function s.t. it is added to the llvm
// module's function list).
std::unique_ptr<IrFunction> compute_function_;
llvm::IRBuilder<> b_;
mlir::MLIRContext* mlir_context_;
// The buffer allocation slice for the root of the computation being compiled.
// Only relevant for thread local computations.
BufferAllocation::Slice computation_root_allocation_;
// Maps the buffer allocation slices for the parameters to the computation
// being compiled to their parameter numbers. Only relevant for thread local
// computations.
absl::flat_hash_map<BufferAllocation::Index, int64>
computation_parameter_allocations_;
// Maps HLO instructions to their index into the profile counter array.
const std::unordered_map<const HloInstruction*, int64>
instruction_to_profile_idx_;
// Maps HLO computations to their index into the profile counter array.
const std::unordered_map<const HloComputation*, int64>
computation_to_profile_idx_;
// Maps HLOs to Values emitted for them.
absl::flat_hash_map<const HloInstruction*, llvm::Value*> emitted_value_;
llvm_ir::AliasAnalysis alias_analysis_;
// The number of root instruction outer dimensions used in parallel loop
// emission (ParallelLoopEmitter).
int64 num_dynamic_loop_bounds_ = 0;
// Returns whether the given instruction should be emitted as a parallel loop.
bool ShouldEmitParallelLoopFor(const HloInstruction& op) const {
// Emit parallel loop for root instruction if dynamic outer-dimension loop
// bounds were specified.
return num_dynamic_loop_bounds_ > 0 &&
op.parent()->root_instruction() == &op;
}
// This struct contains all the state needed to emit instructions for
// profiling a computation.
class ProfilingState {
public:
ProfilingState() : use_rdtscp_(false) {}
explicit ProfilingState(bool use_rdtscp) : use_rdtscp_(use_rdtscp) {}
// Record the cycle counter before an HLO executes.
void RecordCycleStart(llvm::IRBuilder<>* b, HloInstruction* hlo);
// Record the number of cycles it took for an HLO to execute.
void RecordCycleDelta(llvm::IRBuilder<>* b, HloInstruction* hlo,
llvm::Value* prof_counter);
// Record the number of cycles it took for the entire computation to
// execute.
void RecordCompleteComputation(llvm::IRBuilder<>* b,
llvm::Value* prof_counter);
// Convenience function to generate a call to an intrinsic which reads the
// CPU cycle counter.
llvm::Value* ReadCycleCounter(llvm::IRBuilder<>* b);
// Store the cycle counter delta to the per-HLO profile counter.
void UpdateProfileCounter(llvm::IRBuilder<>* b, llvm::Value* prof_counter,
llvm::Value* cycle_end, llvm::Value* cycle_start);
private:
// Should we use the x86-specific rdtscp or the generic readcyclecounter
// intrinsic?
bool use_rdtscp_;
// The first read cycle counter in the program.
llvm::Value* first_read_cycle_start_ = nullptr;
// The last read cycle counter in the program.
llvm::Value* last_read_cycle_end_ = nullptr;
// Maps HLOs to the value the cycle counter contained right before the HLO
// began to execute.
std::unordered_map<const HloInstruction*, llvm::Value*> cycle_starts_;
};
ProfilingState profiling_state_;
class TracingState {
public:
TracingState() : enabled_(false) {}
void set_enabled(bool value) { enabled_ = value; }
void EmitTracingStart(llvm::IRBuilder<>* b, HloInstruction* hlo,
llvm::Value* run_options);
void EmitTracingEnd(llvm::IRBuilder<>* b, HloInstruction* hlo,
llvm::Value* run_options);
private:
bool enabled_;
// Maps from HLO to the activity id returned by xprof::TraceMe.
std::unordered_map<const HloInstruction*, llvm::Value*> activity_ids_;
};
TracingState tracing_state_;
// Given a load instruction and a shape or buffer size, annotate the load's
// result with the alignment required by the shape or size.
void AttachAlignmentMetadataForLoad(llvm::LoadInst* load, const Shape& shape);
void AttachAlignmentMetadataForLoad(llvm::LoadInst* load, int64 buffer_size);
// Given a load instruction and a shape or buffer size, annotate the load's
// result with the dereferenceable bytes required by the shape / buffer size.
void AttachDereferenceableMetadataForLoad(llvm::LoadInst* load,
const Shape& shape);
void AttachDereferenceableMetadataForLoad(llvm::LoadInst* load,
int64 buffer_size);
// Calculate the alignment of a buffer allocated for a given shape.
int MinimumAlignmentForShape(const Shape& shape);
// Calculate the alignment of a buffer allocated for a given primitive type.
int MinimumAlignmentForPrimitiveType(PrimitiveType primitive_type);
// Returns the number of bytes within the shape.
int64 ByteSizeOf(const Shape& shape) const;
enum class XfeedKind {
kInfeed,
kOutfeed,
};
// Emit IR to transfer between a {infeed,outfeed} buffer and an in-program
// address.
Status EmitXfeedTransfer(XfeedKind kind, const Shape& shape,
llvm::Value* program_buffer_address);
// Returns a ConstExpr bitcast.
llvm::Constant* EmitGlobalForLiteral(const Literal& literal);
const HloModuleConfig& hlo_module_config_;
bool is_top_level_computation_;
const TargetMachineFeatures& target_machine_features_;
struct LiteralPtrHashFunctor {
size_t operator()(const Literal* literal) const { return literal->Hash(); }
};
struct LiteralPtrEqualityFunctor {
bool operator()(const Literal* lhs, const Literal* rhs) const {
return *lhs == *rhs;
}
};
absl::flat_hash_map<const Literal*, llvm::Constant*, LiteralPtrHashFunctor,
LiteralPtrEqualityFunctor>
emitted_literals_;
absl::flat_hash_map<BufferAllocation::Index, llvm::Constant*>
constant_buffer_to_global_;
std::vector<const HloComputation*> thread_local_computations_;
std::vector<const HloComputation*> global_computations_;
bool emit_code_for_msan_;
TF_DISALLOW_COPY_AND_ASSIGN(IrEmitter);
};
} // namespace cpu
} // namespace xla
#endif // TENSORFLOW_COMPILER_XLA_SERVICE_CPU_IR_EMITTER_H_
| karllessard/tensorflow | tensorflow/compiler/xla/service/cpu/ir_emitter.h | C | apache-2.0 | 28,122 |
/*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_PROCESSING_BEAMFORMER_COVARIANCE_MATRIX_GENERATOR_H_
#define MODULES_AUDIO_PROCESSING_BEAMFORMER_COVARIANCE_MATRIX_GENERATOR_H_
#include "modules/audio_processing/beamformer/complex_matrix.h"
#include "modules/audio_processing/beamformer/array_util.h"
namespace webrtc {
// Helper class for Beamformer in charge of generating covariance matrices. For
// each function, the passed-in ComplexMatrix is expected to be of size
// |num_input_channels| x |num_input_channels|.
class CovarianceMatrixGenerator {
public:
// A uniform covariance matrix with a gap at the target location. WARNING:
// The target angle is assumed to be 0.
static void UniformCovarianceMatrix(float wave_number,
const std::vector<Point>& geometry,
ComplexMatrix<float>* mat);
// The covariance matrix of a source at the given angle.
static void AngledCovarianceMatrix(float sound_speed,
float angle,
size_t frequency_bin,
size_t fft_size,
size_t num_freq_bins,
int sample_rate,
const std::vector<Point>& geometry,
ComplexMatrix<float>* mat);
// Calculates phase shifts that, when applied to a multichannel signal and
// added together, cause constructive interferernce for sources located at
// the given angle.
static void PhaseAlignmentMasks(size_t frequency_bin,
size_t fft_size,
int sample_rate,
float sound_speed,
const std::vector<Point>& geometry,
float angle,
ComplexMatrix<float>* mat);
};
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_BEAMFORMER_BF_HELPERS_H_
| wangcy6/storm_app | frame/c++/webrtc-master/modules/audio_processing/beamformer/covariance_matrix_generator.h | C | apache-2.0 | 2,455 |
package org.ovirt.engine.core.common.backendinterfaces;
import org.ovirt.engine.core.common.action.*;
public interface IUserHandler {
VdcReturnValueBase Login(LoginUserParameters parameters);
VdcReturnValueBase Logoff(LogoutUserParameters parameters);
}
| derekhiggins/ovirt-engine | backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/backendinterfaces/IUserHandler.java | Java | apache-2.0 | 265 |
/*-
*
* * Copyright 2015 Skymind,Inc.
* *
* * 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 org.nd4j.linalg.api.buffer;
import lombok.NonNull;
import org.bytedeco.javacpp.Pointer;
import org.bytedeco.javacpp.indexer.FloatIndexer;
import org.bytedeco.javacpp.indexer.Indexer;
import org.nd4j.linalg.api.complex.IComplexDouble;
import org.nd4j.linalg.api.complex.IComplexFloat;
import org.nd4j.linalg.api.memory.MemoryWorkspace;
import java.nio.ByteBuffer;
/**
* Data buffer for floats
*
* @author Adam Gibson
*/
public class FloatBuffer extends BaseDataBuffer {
/**
* Meant for creating another view of a buffer
*
* @param pointer the underlying buffer to create a view from
* @param indexer the indexer for the pointer
* @param length the length of the view
*/
public FloatBuffer(Pointer pointer, Indexer indexer, long length) {
super(pointer, indexer, length);
}
/**
* Create a float buffer with the given length
* @param length the float buffer with the given length
*/
public FloatBuffer(long length) {
super(length);
}
public FloatBuffer(long length, boolean initialize) {
super(length, initialize);
}
public FloatBuffer(long length, boolean initialize, MemoryWorkspace workspace) {
super(length, initialize, workspace);
}
public FloatBuffer(int length, int elementSize) {
super(length, elementSize);
}
public FloatBuffer(int length, int elementSize, long offset) {
super(length, elementSize, offset);
}
/**
* Initialize the opType of this buffer
*/
@Override
protected void initTypeAndSize() {
type = Type.FLOAT;
elementSize = 4;
}
public FloatBuffer(DataBuffer underlyingBuffer, long length, long offset) {
super(underlyingBuffer, length, offset);
}
public FloatBuffer(float[] data) {
this(data, true);
}
public FloatBuffer(float[] data, MemoryWorkspace workspace) {
this(data, true, workspace);
}
public FloatBuffer(int[] data) {
this(data, true);
}
public FloatBuffer(double[] data) {
this(data, true);
}
public FloatBuffer(int[] data, boolean copyOnOps) {
super(data, copyOnOps);
}
public FloatBuffer(int[] data, boolean copy, long offset) {
super(data, copy, offset);
}
public FloatBuffer(double[] data, boolean copyOnOps) {
super(data, copyOnOps);
}
public FloatBuffer(double[] data, boolean copy, long offset) {
super(data, copy, offset);
}
public FloatBuffer(ByteBuffer buffer, int length) {
super(buffer, length);
}
public FloatBuffer(ByteBuffer buffer, int length, long offset) {
super(buffer, length, offset);
}
public FloatBuffer(byte[] data, int length) {
super(data, length);
}
@Override
public IComplexFloat getComplexFloat(long i) {
return null;
}
@Override
public IComplexDouble getComplexDouble(long i) {
return null;
}
public FloatBuffer(float[] floats, boolean copy) {
super(floats, copy);
}
public FloatBuffer(float[] floats, boolean copy, MemoryWorkspace workspace) {
super(floats, copy, workspace);
}
public FloatBuffer(float[] data, boolean copy, long offset) {
super(data, copy, offset);
}
public FloatBuffer(float[] data, boolean copy, long offset, MemoryWorkspace workspace) {
super(data, copy, offset, workspace);
}
@Override
protected DataBuffer create(long length) {
return new FloatBuffer(length);
}
@Override
public DataBuffer create(double[] data) {
return new FloatBuffer(data);
}
@Override
public DataBuffer create(float[] data) {
return new FloatBuffer(data);
}
@Override
public DataBuffer create(int[] data) {
return new FloatBuffer(data);
}
}
| ambraspace/nd4j | nd4j-buffer/src/main/java/org/nd4j/linalg/api/buffer/FloatBuffer.java | Java | apache-2.0 | 4,585 |
<!DOCTYPE html>
<!--[if IE 9]><html class="ie9"><![endif]-->
<!--[if gt IE 9]><!-->
<html>
<!--<![endif]-->
<head>
<title>Data Tables - PatternFly</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../dist/img/favicon.ico">
<!-- iPad retina icon -->
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../dist/img/apple-touch-icon-precomposed-152.png">
<!-- iPad retina icon (iOS < 7) -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../dist/img/apple-touch-icon-precomposed-144.png">
<!-- iPad non-retina icon -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="../dist/img/apple-touch-icon-precomposed-76.png">
<!-- iPad non-retina icon (iOS < 7) -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../dist/img/apple-touch-icon-precomposed-72.png">
<!-- iPhone 6 Plus icon -->
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="../dist/img/apple-touch-icon-precomposed-180.png">
<!-- iPhone retina icon (iOS < 7) -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../dist/img/apple-touch-icon-precomposed-114.png">
<!-- iPhone non-retina icon (iOS < 7) -->
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="../dist/img/apple-touch-icon-precomposed-57.png">
<link href="../dist/css/patternfly.min.css" rel="stylesheet" media="screen, print">
<link href="../dist/css/patternfly-additions.min.css" rel="stylesheet" media="screen, print">
<link href="tests.css" rel="stylesheet" media="screen, print">
<script src="../components/jquery/dist/jquery.min.js"></script>
<script src="../components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="../components/datatables/media/js/jquery.dataTables.js"></script>
<script src="../dist/js/patternfly.min.js"></script>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>Data Tables</h1>
</div>
<div class="alert alert-warning">
<span class="pficon pficon-warning-triangle-o"></span>
These examples are included for development testing purposes. For official documentation, see <a href="https://www.patternfly.org" class="alert-link">https://www.patternfly.org</a>, <a href="http://getbootstrap.com" class="alert-link">http://getbootstrap.com</a>, and <a href="http://datatables.net" class="alert-link">http://datatables.net</a>.
</div>
<hr>
<table class="datatable table table-striped table-bordered">
<thead>
<tr>
<th>Rendering engine</th>
<th>Browser</th>
<th>Platform(s)</th>
<th>Engine version</th>
<th>CSS grade</th>
</tr>
</thead>
<tbody>
<tr>
<td>Trident</td>
<td>
Internet
Explorer
4.0
</td>
<td>Win 95+</td>
<td>4</td>
<td>X</td>
</tr>
<tr>
<td>Trident</td>
<td>Internet
Explorer 5.0</td>
<td>Win 95+</td>
<td>5</td>
<td>C</td>
</tr>
<tr>
<td>Trident</td>
<td>Internet
Explorer 5.5</td>
<td>Win 95+</td>
<td>5.5</td>
<td>A</td>
</tr>
<tr>
<td>Trident</td>
<td>Internet
Explorer 6</td>
<td>Win 98+</td>
<td>6</td>
<td>A</td>
</tr>
<tr>
<td>Trident</td>
<td>Internet Explorer 7</td>
<td>Win XP SP2+</td>
<td>7</td>
<td>A</td>
</tr>
<tr>
<td>Trident</td>
<td>AOL browser (AOL desktop)</td>
<td>Win XP</td>
<td>6</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Firefox 1.0</td>
<td>Win 98+ / OSX.2+</td>
<td>1.7</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Firefox 1.5</td>
<td>Win 98+ / OSX.2+</td>
<td>1.8</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Firefox 2.0</td>
<td>Win 98+ / OSX.2+</td>
<td>1.8</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Firefox 3.0</td>
<td>Win 2k+ / OSX.3+</td>
<td>1.9</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Camino 1.0</td>
<td>OSX.2+</td>
<td>1.8</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Camino 1.5</td>
<td>OSX.3+</td>
<td>1.8</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Netscape 7.2</td>
<td>Win 95+ / Mac OS 8.6-9.2</td>
<td>1.7</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Netscape Browser 8</td>
<td>Win 98SE+</td>
<td>1.7</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Netscape Navigator 9</td>
<td>Win 98+ / OSX.2+</td>
<td>1.8</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Mozilla 1.0</td>
<td>Win 95+ / OSX.1+</td>
<td>1</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Mozilla 1.1</td>
<td>Win 95+ / OSX.1+</td>
<td>1.1</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Mozilla 1.2</td>
<td>Win 95+ / OSX.1+</td>
<td>1.2</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Mozilla 1.3</td>
<td>Win 95+ / OSX.1+</td>
<td>1.3</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Mozilla 1.4</td>
<td>Win 95+ / OSX.1+</td>
<td>1.4</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Mozilla 1.5</td>
<td>Win 95+ / OSX.1+</td>
<td>1.5</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Mozilla 1.6</td>
<td>Win 95+ / OSX.1+</td>
<td>1.6</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Mozilla 1.7</td>
<td>Win 98+ / OSX.1+</td>
<td>1.7</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Mozilla 1.8</td>
<td>Win 98+ / OSX.1+</td>
<td>1.8</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Seamonkey 1.1</td>
<td>Win 98+ / OSX.2+</td>
<td>1.8</td>
<td>A</td>
</tr>
<tr>
<td>Gecko</td>
<td>Epiphany 2.20</td>
<td>Gnome</td>
<td>1.8</td>
<td>A</td>
</tr>
<tr>
<td>Webkit</td>
<td>Safari 1.2</td>
<td>OSX.3</td>
<td>125.5</td>
<td>A</td>
</tr>
<tr>
<td>Webkit</td>
<td>Safari 1.3</td>
<td>OSX.3</td>
<td>312.8</td>
<td>A</td>
</tr>
<tr>
<td>Webkit</td>
<td>Safari 2.0</td>
<td>OSX.4+</td>
<td>419.3</td>
<td>A</td>
</tr>
<tr>
<td>Webkit</td>
<td>Safari 3.0</td>
<td>OSX.4+</td>
<td>522.1</td>
<td>A</td>
</tr>
<tr>
<td>Webkit</td>
<td>OmniWeb 5.5</td>
<td>OSX.4+</td>
<td>420</td>
<td>A</td>
</tr>
<tr>
<td>Webkit</td>
<td>iPod Touch / iPhone</td>
<td>iPod</td>
<td>420.1</td>
<td>A</td>
</tr>
<tr>
<td>Webkit</td>
<td>S60</td>
<td>S60</td>
<td>413</td>
<td>A</td>
</tr>
<tr>
<td>Presto</td>
<td>Opera 7.0</td>
<td>Win 95+ / OSX.1+</td>
<td>-</td>
<td>A</td>
</tr>
<tr>
<td>Presto</td>
<td>Opera 7.5</td>
<td>Win 95+ / OSX.2+</td>
<td>-</td>
<td>A</td>
</tr>
<tr>
<td>Presto</td>
<td>Opera 8.0</td>
<td>Win 95+ / OSX.2+</td>
<td>-</td>
<td>A</td>
</tr>
<tr>
<td>Presto</td>
<td>Opera 8.5</td>
<td>Win 95+ / OSX.2+</td>
<td>-</td>
<td>A</td>
</tr>
<tr>
<td>Presto</td>
<td>Opera 9.0</td>
<td>Win 95+ / OSX.3+</td>
<td>-</td>
<td>A</td>
</tr>
<tr>
<td>Presto</td>
<td>Opera 9.2</td>
<td>Win 88+ / OSX.3+</td>
<td>-</td>
<td>A</td>
</tr>
<tr>
<td>Presto</td>
<td>Opera 9.5</td>
<td>Win 88+ / OSX.3+</td>
<td>-</td>
<td>A</td>
</tr>
<tr>
<td>Presto</td>
<td>Opera for Wii</td>
<td>Wii</td>
<td>-</td>
<td>A</td>
</tr>
<tr>
<td>Presto</td>
<td>Nokia N800</td>
<td>N800</td>
<td>-</td>
<td>A</td>
</tr>
<tr>
<td>Presto</td>
<td>Nintendo DS browser</td>
<td>Nintendo DS</td>
<td>8.5</td>
<td>C/A<sup>1</sup></td>
</tr>
<tr>
<td>KHTML</td>
<td>Konqureror 3.1</td>
<td>KDE 3.1</td>
<td>3.1</td>
<td>C</td>
</tr>
<tr>
<td>KHTML</td>
<td>Konqureror 3.3</td>
<td>KDE 3.3</td>
<td>3.3</td>
<td>A</td>
</tr>
<tr>
<td>KHTML</td>
<td>Konqureror 3.5</td>
<td>KDE 3.5</td>
<td>3.5</td>
<td>A</td>
</tr>
<tr>
<td>Tasman</td>
<td>Internet Explorer 4.5</td>
<td>Mac OS 8-9</td>
<td>-</td>
<td>X</td>
</tr>
<tr>
<td>Tasman</td>
<td>Internet Explorer 5.1</td>
<td>Mac OS 7.6-9</td>
<td>1</td>
<td>C</td>
</tr>
<tr>
<td>Tasman</td>
<td>Internet Explorer 5.2</td>
<td>Mac OS 8-X</td>
<td>1</td>
<td>C</td>
</tr>
<tr>
<td>Misc</td>
<td>NetFront 3.1</td>
<td>Embedded devices</td>
<td>-</td>
<td>C</td>
</tr>
<tr>
<td>Misc</td>
<td>NetFront 3.4</td>
<td>Embedded devices</td>
<td>-</td>
<td>A</td>
</tr>
<tr>
<td>Misc</td>
<td>Dillo 0.8</td>
<td>Embedded devices</td>
<td>-</td>
<td>X</td>
</tr>
<tr>
<td>Misc</td>
<td>Links</td>
<td>Text only</td>
<td>-</td>
<td>X</td>
</tr>
<tr>
<td>Misc</td>
<td>Lynx</td>
<td>Text only</td>
<td>-</td>
<td>X</td>
</tr>
<tr>
<td>Misc</td>
<td>IE Mobile</td>
<td>Windows Mobile 6</td>
<td>-</td>
<td>C</td>
</tr>
<tr>
<td>Misc</td>
<td>PSP browser</td>
<td>PSP</td>
<td>-</td>
<td>C</td>
</tr>
<tr>
<td>Other browsers</td>
<td>All others</td>
<td>-</td>
<td>-</td>
<td>U</td>
</tr>
</tbody>
</table>
<script>
// Initialize Datatables
$(document).ready(function() {
$('.datatable').dataTable();
});
</script>
</div><!-- /container -->
</body>
</html> | achampong/patternfly | tests/datatables.html | HTML | apache-2.0 | 10,577 |
// bslma_managedptr.h -*-C++-*-
#ifndef INCLUDED_BSLMA_MANAGEDPTR
#define INCLUDED_BSLMA_MANAGEDPTR
#ifndef INCLUDED_BSLS_IDENT
#include <bsls_ident.h>
#endif
BSLS_IDENT("$Id$ $CSID$")
//@PURPOSE: Provide a managed pointer class.
//
//@CLASSES:
// bslma::ManagedPtr: proctor for automatic memory management
// bslma::ManagedPtrUtil: Namespace for deleter for stack-allocated objects
//
//@SEE_ALSO: bslmf_ispolymporphic
//
//@DESCRIPTION: This component provides a proctor, 'bslma::ManagedPtr', similar
// to 'bsl::auto_ptr', that supports user-specified deleters. The proctor is
// responsible for the automatic destruction of the object referenced by the
// managed pointer. As a "smart pointer", this object offers an interface
// similar to a native pointer, supporting dereference operators (*, ->),
// (in)equality comparison and testing as if it were a boolean value. However,
// like 'bsl::auto_ptr' it has unusual "copy-semantics" that transfer ownership
// of the managed object, rather than making a copy. It should be noted that
// this signature does not satisfy the requirements for an element-type stored
// in any of the standard library containers. Note that this component will
// fail to compile when instantiated for a class that gives a false-positive
// for the type trait 'bslmf::IsPolymorphic'. See the 'bslmf_ispolymporphic'
// component for more details.
//
///Factories
///---------
// An object that will be managed by a 'ManagedPtr' object is typically
// dynamically allocated and destroyed by a factory. For the purposes of this,
// component, a factory is any class that provides a 'deleteObject' function
// taking a single argument of the (pointer) type of the managed pointer.
// E.g., 'bslma::Allocator' is a commonly used factory, and the currently
// installed default allocator is the factory that is assumed to be used if
// neither a factory nor deleter (see below) are specified when supplying a
// pointer to be managed.
//
///Deleters
///--------
// When a managed pointer is destroyed, the managed object is destroyed using
// the user supplied "deleter". A deleter is simply a function that is invoked
// with two 'void *' arguments: a pointer to the object to be destroyed, and a
// pointer to a 'cookie' that is supplied at the same time as the 'deleter' and
// managed object.
//..
// typedef void (*DeleterFunc)(void *managedObject, void *cookie);
//..
// The meaning of the 'cookie' depends on the specific deleter. Typically a
// deleter function will accept the two 'void *' pointers and internally cast
// them to the appropriate types for pointers to the managed object and
// 'cookie'. Note that there are no methods taking just a deleter, as the user
// must always supply a 'cookie' to be passed when the deleter is actually
// invoked.
//
//
///Aliasing
///--------
// In a managed pointer, the pointer value (the value returned by the 'get'
// method) and the pointer to the managed object need not have the same value.
// The 'loadAlias' method allows a managed pointer to be created as an "alias"
// to another managed pointer (possibly of a different type), which we'll call
// the "original" managed pointer. When 'get' is invoked on the alias, the
// aliased pointer value is returned, but when the managed pointer is
// destroyed, the original managed object will be passed to the deleter. (See
// also the documentation of the 'alias' constructor or of the 'loadAlias'
// method.)
//
///Exception Safety
///----------------
// The principal usage of a managed pointer is to guarantee that a local object
// will be deallocated properly should an operation throw after its allocation.
// In this, it is very similar to 'bsl::auto_ptr'. It is required for the
// proper functioning of this component that a deleter does not throw at
// invocation (upon destruction or re-assignment of the managed pointer).
//
///Type Casting
///------------
// 'ManagedPtr' objects can be implicitly and explicitly cast to different
// types in the same way that native pointers can.
//
///Explicit Casting
/// - - - - - - - -
// Through "aliasing", a managed pointer of any type can be explicitly cast to
// a managed pointer of any other type using any legal cast expression. See
// example 4 on 'type casting' below for more details.
//
///Implicit Casting
/// - - - - - - - -
// As with native pointers, a managed pointer of the type 'B' that is derived
// from the type 'A', can be directly assigned to a 'ManagedPtr' of 'A'.
// Likewise a managed pointer of type 'B' can be directly assigned to a
// 'ManagedPtr' of 'const B'. However, the rules for construction are a little
// more subtle, and apply when passing a 'bslma::ManagedPtr' by value into a
// function, or returning as the result of a function.
//..
// class A {};
//
// class B : public A {};
//
// void test()
// {
// B *b_p = 0;
// A *a_p = b_p;
//
// bslma::ManagedPtr<B> b_mp1;
// bslma::ManagedPtr<A> a_mp1(b_mp1); // direct-initialization is valid
// bslma::ManagedPtr<A> a_mp2 = b_mp1; // copy-initialization should fail
//}
//..
// Note that 'std::auto_ptr' has the same restriction, and this failure will
// occur only on compilers that strictly conform to the C++ standard, such as
// recent gcc compilers or (in this case) IBM xlC.
//
///Usage
///-----
// In this section we show intended usage of this component.
//
///Example 1: Implementing a Protocol
/// - - - - - - - - - - - - - - - - -
// We demonstrate using 'ManagedPtr' to configure and return a managed object
// implementing an abstract protocol.
//
// First we define our protocol, 'Shape', a type of object that knows how to
// compute its 'area'. Note that for expository reasons only, we do *nor* give
// 'Shape' a virtual destructor.
//..
// struct Shape {
// virtual double area() const = 0;
// // Return the 'area' of this shape.
// };
//..
// Then we define a couple of classes that implement the 'Shape' protocol, a
// 'Circle' and a 'Square'.
//..
// class Circle : public Shape {
// private:
// // DATA
// double d_radius;
//
// public:
// // CREATORS
// explicit Circle(double radius);
// // Create a 'Circle' object having the specified 'radius'.
//
// // ACCESSORS
// virtual double area() const;
// // Return the area of this Circle, given by the formula pi*r*r.
// };
//
// class Square : public Shape {
// private:
// // DATA
// double d_sideLength;
//
// public:
// // CREATORS
// explicit Square(double side);
// // Create a 'Square' having sides of length 'side'.
//
// // ACCESSORS
// virtual double area() const;
// // Return the area of this Square, given by the formula side*side
// };
//..
// Next we implement the methods for 'Circle' and 'Square'.
//..
// Circle::Circle(double radius)
// : d_radius(radius)
// {
// }
//
// double Circle::area() const {
// return 3.141592653589793238462 * d_radius * d_radius;
// }
//
// Square::Square(double side)
// : d_sideLength(side)
// {
// }
//
// double Square::area() const {
// return d_sideLength * d_sideLength;
// }
//..
// Then we define an enumeration that lists each implementation of the 'Shape'
// protocol.
//..
// struct Shapes {
// enum VALUES { SHAPE_CIRCLE, SHAPE_SQUARE };
// };
//..
// Now we can define a function that will return a 'Circle' object or a
// 'Square' object according to the specified 'kind' parameter, and having its
// 'dimension' specified by the caller.
//..
// bslma::ManagedPtr<Shape> makeShape(Shapes::VALUES kind, double dimension)
// {
// bslma::Allocator *alloc = bslma::Default::defaultAllocator();
// bslma::ManagedPtr<Shape> result;
// switch (kind) {
// case Shapes::SHAPE_CIRCLE : {
// Circle *circ = new(*alloc)Circle(dimension);
// result.load(circ);
// break;
// }
// case Shapes::SHAPE_SQUARE : {
// Square *sqr = new(*alloc)Square(dimension);
// result.load(sqr);
// break;
// }
// };
// return result;
// }
//..
// Then, we can use our function to create shapes of different kinds, and check
// that they report the correct area. Note that are using a radius of '1.0'
// for the 'Circle' and integral side-length for the 'Square' to support an
// accurate 'operator==' with floating-point quantities. Also note that,
// despite the destructor for 'Shape' being non-virtual, the correct destructor
// for the appropriate concrete 'Shape' type is called. This is because the
// destructor is captured when the 'ManagedPtr' constructor is called, and has
// access to the complete type of each shape object.
//..
// void testShapes()
// {
// bslma::ManagedPtr<Shape> shape = makeShape(Shapes::SHAPE_CIRCLE, 1.0);
// assert(0 != shape);
// assert(3.141592653589793238462 == shape->area());
//
// shape = makeShape(Shapes::SHAPE_SQUARE, 2.0);
// assert(0 != shape);
// assert(4.0 == shape->area());
// }
//..
// Next, we observe that as we are creating objects dynamically, we should pass
// an allocator to the 'makeShape' function, rather than simply accepting the
// default allocator each time. Note that when we do this, we pass the user's
// allocator to the 'ManagedPtr' object as the "factory".
//..
// bslma::ManagedPtr<Shape> makeShape(Shapes::VALUES kind,
// double dimension,
// bslma::Allocator *allocator)
// {
// bslma::Allocator *alloc = bslma::Default::allocator(allocator);
// bslma::ManagedPtr<Shape> result;
// switch (kind) {
// case Shapes::SHAPE_CIRCLE : {
// Circle *circ = new(*alloc)Circle(dimension);
// result.load(circ, alloc);
// break;
// }
// case Shapes::SHAPE_SQUARE : {
// Square *sqr = new(*alloc)Square(dimension);
// result.load(sqr, alloc);
// break;
// }
// };
// return result;
// }
//..
// Finally we repeat the earlier test, additionally passing a test allocator:
//..
// void testShapesToo()
// {
// bslma::TestAllocator ta("object");
//
// bslma::ManagedPtr<Shape> shape =
// makeShape(Shapes::SHAPE_CIRCLE, 1.0, &ta);
// assert(0 != shape);
// assert(3.141592653589793238462 == shape->area());
//
// shape = makeShape(Shapes::SHAPE_SQUARE, 3.0, &ta);
// assert(0 != shape);
// assert(9.0 == shape->area());
// }
//..
//
///Example 2: Aliasing
///- - - - - - - - - -
// Suppose that we wish to give access to an item in a temporary array via a
// pointer which we'll call the "finger". The finger is the only pointer to
// the array or any part of the array, but the entire array must be valid until
// the finger is destroyed, at which time the entire array must be deleted. We
// handle this situation by first creating a managed pointer to the entire
// array, then creating an alias of that pointer for the finger. The finger
// takes ownership of the array instance, and when the finger is destroyed, it
// is the array's address, rather than the finger, that is passed to the
// deleter.
//
// First, let's say our array stores data acquired from a ticker plant
// accessible by a global 'getQuote' function:
//..
// struct Ticker {
//
// static double getQuote() // From ticker plant. Simulated here
// {
// static const double QUOTES[] = {
// 7.25, 12.25, 11.40, 12.00, 15.50, 16.25, 18.75, 20.25, 19.25, 21.00
// };
// static const int NUM_QUOTES = sizeof(QUOTES) / sizeof(QUOTES[0]);
// static int index = 0;
//
// double ret = QUOTES[index];
// index = (index + 1) % NUM_QUOTES;
// return ret;
// }
// };
//..
// Then, we want to find the first quote larger than a specified threshold, but
// would also like to keep the earlier and later quotes for possible
// examination. Our 'getFirstQuoteLargerThan' function must allocate memory
// for an array of quotes (the threshold and its neighbors). It thus returns a
// managed pointer to the desired value:
//..
// const double END_QUOTE = -1;
//
// bslma::ManagedPtr<double>
// getFirstQuoteLargerThan(double threshold, bslma::Allocator *allocator)
// {
// assert(END_QUOTE < 0 && 0 <= threshold);
//..
// Next, we allocate our array with extra room to mark the beginning and end
// with a special 'END_QUOTE' value:
//..
// const int MAX_QUOTES = 100;
// int numBytes = (MAX_QUOTES + 2) * sizeof(double);
// double *quotes = (double*) allocator->allocate(numBytes);
// quotes[0] = quotes[MAX_QUOTES + 1] = END_QUOTE;
//..
// Then, we create a managed pointer to the entire array:
//..
// bslma::ManagedPtr<double> managedQuotes(quotes, allocator);
//..
// Next, we read quotes until the array is full, keeping track of the first
// quote that exceeds the threshold.
//..
// double *finger = 0;
//
// for (int i = 1; i <= MAX_QUOTES; ++i) {
// double quote = Ticker::getQuote();
// quotes[i] = quote;
// if (!finger && quote > threshold) {
// finger = "es[i];
// }
// }
//..
// Now, we use the alias constructor to create a managed pointer that points to
// the desired value (the finger) but manages the entire array:
//..
// return bslma::ManagedPtr<double>(managedQuotes, finger);
// }
//..
// Then, our main program calls 'getFirstQuoteLargerThan' like this:
//..
// int aliasExample()
// {
// bslma::TestAllocator ta;
// bslma::ManagedPtr<double> result = getFirstQuoteLargerThan(16.00, &ta);
// assert(*result > 16.00);
// assert(1 == ta.numBlocksInUse());
// if (g_verbose) bsl::cout << "Found quote: " << *result << bsl::endl;
//..
// Next, We also print the preceding 5 quotes in last-to-first order:
//..
// if (g_verbose) bsl::cout << "Preceded by:";
// int i;
// for (i = -1; i >= -5; --i) {
// double quote = result.get()[i];
// if (END_QUOTE == quote) {
// break;
// }
// assert(quote < *result);
// if (g_verbose) bsl::cout << ' ' << quote;
// }
// if (g_verbose) bsl::cout << bsl::endl;
//..
// Then, to move the finger, e.g., to the last position printed, one must be
// careful to retain the ownership of the entire array. Using the statement
// 'result.load(result.get()-i)' would be an error, because it would first
// compute the pointer value 'result.get()-i' of the argument, then release the
// entire array before starting to manage what has now become an invalid
// pointer. Instead, 'result' must retain its ownership to the entire array,
// which can be attained by:
//..
// result.loadAlias(result, result.get()-i);
//..
// Finally, if we reset the result pointer, the entire array is deallocated:
//..
// result.reset();
// assert(0 == ta.numBlocksInUse());
// assert(0 == ta.numBytesInUse());
//
// return 0;
// }
//..
//
///Example 3: Dynamic Objects and Factories
/// - - - - - - - - - - - - - - - - - - - -
// Suppose we want to track the number of objects currently managed by
// 'ManagedPtr' objects.
//
// First we define a factory type, that holds an allocator and a usage-counter.
// Note that such a type cannot sensibly be copied, as the notion 'count'
// becomes confused.
//..
// class CountedFactory {
// // DATA
// int d_count;
// bslma::Allocator *d_allocator_p;
//
// // NOT IMPLEMENTED
// CountedFactory(const CountedFactory&);
// CountedFactory& operator=(const CountedFactory&);
//
// public:
// // CREATORS
// explicit CountedFactory(bslma::Allocator *alloc = 0);
// // Create a 'CountedFactory' object which uses the supplied
// // allocator 'alloc'.
//
// ~CountedFactory();
// // Destroy this object.
//..
// Next, we provide the 'createObject' and 'deleteObject' functions that are
// standard for factory objects. Note that the 'deleteObject' function
// signature has the form required by 'bslma::ManagedPtr' for a factory.
//..
// // MANIPULATORS
// template <class TYPE>
// TYPE *createObject();
// // Return a pointer to a newly allocated object of type 'TYPE'
// // created using its default constructor. Memory for the object
// // is supplied by the allocator supplied to this factory's
// // constructor, and the count of valid object is incremented.
//
// template <class TYPE>
// void deleteObject(const TYPE *target);
// // Destroy the object pointed to by 'target' and reclaim the
// // memory. Decrement the count of currently valid objects.
//..
// Then, we round out the class with the ability to query the 'count' of
// currently allocated objects.
//..
// // ACCESSORS
// int count() const;
// // Return the number of currently valid objects allocated by this
// // factory.
// };
//..
// Next, we define the operations declared by the class.
//..
// CountedFactory::CountedFactory(bslma::Allocator *alloc)
// : d_count(0)
// , d_allocator_p(bslma::Default::allocator(alloc))
// {
// }
//
// CountedFactory::~CountedFactory()
// {
// assert(0 == d_count);
// }
//
// template <class TYPE>
// TYPE *CountedFactory::createObject()
// {
// TYPE *result = new(*d_allocator_p)TYPE;
// ++d_count;
// return result;
// }
//
// template <class TYPE>
// void CountedFactory::deleteObject(const TYPE *object)
// {
// d_allocator_p->deleteObject(object);
// --d_count;
// }
//
// inline
// int CountedFactory::count() const
// {
// return d_count;
// }
//..
// Then, we can create a test function to illustrate how such a factory would
// be used with 'ManagedPtr'.
//..
// void testCountedFactory()
// {
//..
// Next, we declare a test allocator, and an object of our 'CountedFactory'
// type using that allocator.
//..
// bslma::TestAllocator ta;
// CountedFactory cf(&ta);
//..
// Then, we open a new local scope and declare an array of managed pointers.
// We need a local scope in order to observe the behavior of the destructors at
// end of the scope, and use an array as an easy way to count more than one
// object.
//..
// {
// bslma::ManagedPtr<int> pData[4];
//..
// Next, we load each managed pointer in the array with a new 'int' using our
// factory 'cf' and assert that the factory 'count' is correct after each new
// 'int' is created.
//..
// int i = 0;
// while (i != 4) {
// pData[i++].load(cf.createObject<int>(), &cf);
// assert(cf.count() == i);
// }
//..
// Then, we 'reset' the contents of a single managed pointer in the array, and
// assert that the factory 'count' is appropriately reduced.
//..
// pData[1].reset();
// assert(3 == cf.count());
//..
// Next, we 'load' a managed pointer with another new 'int' value, again using
// 'cf' as the factory, and assert that the 'count' of valid objects remains
// the same (destroy one object and add another).
//..
// pData[2].load(cf.createObject<int>(), &cf);
// assert(3 == cf.count());
// }
//..
// Finally, we allow the array of managed pointers to go out of scope and
// confirm that when all managed objects are destroyed, the factory 'count'
// falls to zero, and does not overshoot.
//..
// assert(0 == cf.count());
// }
//..
//
///Example 4: Type Casting
///- - - - - - - - - - - -
// 'ManagedPtr' objects can be implicitly and explicitly cast to different
// types in the same way that native pointers can.
//
///Implicit Conversion
/// - - - - - - -
// As with native pointers, a pointer of the type 'B' that is publicly derived
// from the type 'A', can be directly assigned a 'ManagedPtr' of 'A'.
//
// First, consider the following code snippets:
//..
// void implicitCastingExample()
// {
//..
// If the statements:
//..
// bslma::TestAllocator localDefaultTa;
// bslma::TestAllocator localTa;
//
// bslma::DefaultAllocatorGuard guard(&localDefaultTa);
//
// int numdels = 0;
//
// {
// B *b_p = 0;
// A *a_p = b_p;
//..
// are legal expressions, then the statements
//..
// bslma::ManagedPtr<A> a_mp1;
// bslma::ManagedPtr<B> b_mp1;
//
// assert(!a_mp1 && !b_mp1);
//
// a_mp1 = b_mp1; // conversion assignment of nil ptr to nil
// assert(!a_mp1 && !b_mp1);
//
// B *b_p2 = new (localDefaultTa) B(&numdels);
// bslma::ManagedPtr<B> b_mp2(b_p2); // default allocator
// assert(!a_mp1 && b_mp2);
//
// a_mp1 = b_mp2; // conversion assignment of nonnil ptr to nil
// assert(a_mp1 && !b_mp2);
//
// B *b_p3 = new (localTa) B(&numdels);
// bslma::ManagedPtr<B> b_mp3(b_p3, &localTa);
// assert(a_mp1 && b_mp3);
//
// a_mp1 = b_mp3; // conversion assignment of nonnil to nonnil
// assert(a_mp1 && !b_mp3);
//
// a_mp1 = b_mp3; // conversion assignment of nil to nonnil
// assert(!a_mp1 && !b_mp3);
//
// // constructor conversion init with nil
// bslma::ManagedPtr<A> a_mp4(b_mp3, b_mp3.get());
// assert(!a_mp4 && !b_mp3);
//
// // constructor conversion init with nonnil
// B *p_b5 = new (localTa) B(&numdels);
// bslma::ManagedPtr<B> b_mp5(p_b5, &localTa);
// bslma::ManagedPtr<A> a_mp5(b_mp5, b_mp5.get());
// assert(a_mp5 && !b_mp5);
// assert(a_mp5.get() == p_b5);
//
// // constructor conversion init with nonnil
// B *p_b6 = new (localTa) B(&numdels);
// bslma::ManagedPtr<B> b_mp6(p_b6, &localTa);
// bslma::ManagedPtr<A> a_mp6(b_mp6);
// assert(a_mp6 && !b_mp6);
// assert(a_mp6.get() == p_b6);
//
// struct S {
// int d_i[10];
// };
//
// assert(200 == numdels);
// }
//
// assert(400 == numdels);
// } // implicitCastingExample()
//..
//
///Explicit Conversion
/// - - - - - - -
// Through "aliasing", a managed pointer of any type can be explicitly
// converted to a managed pointer of any other type using any legal cast
// expression. For example, to static-cast a managed pointer of type A to a
// managed pointer of type B, one can simply do the following:
//..
// void explicitCastingExample() {
//
// bslma::ManagedPtr<A> a_mp;
// bslma::ManagedPtr<B> b_mp1(a_mp, static_cast<B*>(a_mp.get()));
//..
// or even use the less safe "C"-style casts:
//..
// // bslma::ManagedPtr<A> a_mp;
// bslma::ManagedPtr<B> b_mp2(a_mp, (B*)(a_mp.get()));
//
// } // explicitCastingExample()
//..
// Note that when using dynamic cast, if the cast fails, the target managed
// pointer will be reset to an unset state, and the source will not be
// modified. Consider for example the following snippet of code:
//..
// void processPolymorphicObject(bslma::ManagedPtr<A> aPtr,
// bool *castSucceeded)
// {
// bslma::ManagedPtr<B> bPtr(aPtr, dynamic_cast<B*>(aPtr.get()));
// if (bPtr) {
// assert(!aPtr);
// *castSucceeded = true;
// }
// else {
// assert(aPtr);
// *castSucceeded = false;
// }
// }
//..
// If the value of 'aPtr' can be dynamically cast to 'B*' then ownership is
// transferred to 'bPtr', otherwise 'aPtr' is to be modified. As previously
// stated, the managed object will be destroyed correctly regardless of how it
// is cast.
#ifndef INCLUDED_BSLSCM_VERSION
#include <bslscm_version.h>
#endif
#ifndef INCLUDED_BSLMA_ALLOCATOR
#include <bslma_allocator.h>
#endif
#ifndef INCLUDED_BSLMA_DEFAULT
#include <bslma_default.h>
#endif
#ifndef INCLUDED_BSLMA_MANAGEDPTR_FACTORYDELETER
#include <bslma_managedptr_factorydeleter.h>
#endif
#ifndef INCLUDED_BSLMA_MANAGEDPTR_MEMBERS
#include <bslma_managedptr_members.h>
#endif
#ifndef INCLUDED_BSLMA_MANAGEDPTR_PAIRPROXY
#include <bslma_managedptr_pairproxy.h>
#endif
#ifndef INCLUDED_BSLMA_MANAGEDPTRDELETER
#include <bslma_managedptrdeleter.h>
#endif
#ifndef INCLUDED_BSLMF_ADDREFERENCE
#include <bslmf_addreference.h>
#endif
#ifndef INCLUDED_BSLMF_ASSERT
#include <bslmf_assert.h>
#endif
#ifndef INCLUDED_BSLMF_HASPOINTERSEMANTICS
#include <bslmf_haspointersemantics.h>
#endif
#ifndef INCLUDED_BSLMF_IF
#include <bslmf_if.h>
#endif
#ifndef INCLUDED_BSLMF_ISBITWISEMOVEABLE
#include <bslmf_isbitwisemoveable.h>
#endif
#ifndef INCLUDED_BSLMF_ISCONVERTIBLE
#include <bslmf_isconvertible.h>
#endif
#ifndef INCLUDED_BSLMF_ISVOID
#include <bslmf_isvoid.h>
#endif
#ifndef INCLUDED_BSLS_ASSERT
#include <bsls_assert.h>
#endif
#ifndef INCLUDED_BSLS_NULLPTR
#include <bsls_nullptr.h>
#endif
#ifndef INCLUDED_BSLS_UNSPECIFIEDBOOL
#include <bsls_unspecifiedbool.h>
#endif
namespace BloombergLP {
namespace bslma {
// ============================
// private class ManagedPtr_Ref
// ============================
template <class TARGET_TYPE>
class ManagedPtr_Ref {
// This struct holds a managed pointer reference, returned by the implicit
// conversion operator in the class 'ManagedPtr'. This struct is used to
// allow the construction of managed pointers from temporary managed
// pointer objects, since temporaries cannot bind to the reference to a
// modifiable object used in the "copy constructor" and "copy assignment
// operator" for 'ManagedPtr'. Note that while no members or methods of
// this class template depend on the specified 'TARGET_TYPE', it is
// important to carry this type into conversions to support passing
// ownership of 'ManagedPtr_Members' pointers when assigning or
// constructing 'ManagedPtr' objects.
ManagedPtr_Members *d_base_p; // non-null pointer to the managed state of
// a 'ManagedPtr' object.
TARGET_TYPE *d_cast_p; // safely-cast pointer to the referenced
// object.
public:
// CREATORS
ManagedPtr_Ref(ManagedPtr_Members *base, TARGET_TYPE *target);
// Create a 'ManagedPtr_Ref' object having the specified 'base' value
// for its 'base' attribute, and the specified 'target' for its
// 'target' attribute. Note that 'target' (but not 'base') may be
// null.
//! ManagedPtr_Ref(const ManagedPtr_Ref& original) = default;
// Create a 'ManagedPtr_Ref' object having the same 'd_base_p' value as
// the specified 'original'. Note that this trivial constructor's
// definition is compiler generated.
~ManagedPtr_Ref();
// Destroy this object. Note that the referenced managed object is
// *not* destroyed.
//! ManagedPtr_Ref& operator=(const ManagedPtr_Ref& original) = default;
// Create a 'ManagedPtr_Ref' object having the same 'd_base_p' as the
// specified 'original'. Note that this trivial copy-assignment
// operator's definition is compiler generated.
// ACCESSORS
ManagedPtr_Members *base() const;
// Return a pointer to the managed state of a 'ManagedPtr' object.
TARGET_TYPE *target() const;
// Return a pointer to the referenced object.
};
// ================
// class ManagedPtr
// ================
template <class TARGET_TYPE>
class ManagedPtr {
// This class is a "smart pointer" that refers to a *target* object
// accessed via a pointer to the specified parameter type, 'TARGET_TYPE',
// and that supports sole ownership of a *managed* object that is
// potentially of a different type, and may be an entirely different object
// from the target object. A managed pointer ensures that the object it
// manages is destroyed when the managed pointer is destroyed (or
// re-assigned), using the "deleter" supplied along with the managed
// object. The target object referenced by a managed pointer may be
// accessed using either the '->' operator, or the dereference operator
// (operator '*'). The specified 'TARGET_TYPE' may be 'const'-qualified,
// but may not be 'volatile'-qualified, nor may it be a reference type.
//
// A managed pointer may be *empty*, in which case it neither refers to a
// target object nor owns a managed object. An empty managed pointer is
// the equivalent of a null pointer: Such a managed pointer is not
// de-referenceable, and tests as 'false' in boolean expressions.
//
// A managed pointer for which the managed object is not the same object as
// the target is said to *alias* the managed object (see the section
// "Aliasing" in the component-level documentation).
public:
// INTERFACE TYPES
typedef ManagedPtrDeleter::Deleter DeleterFunc;
// Alias for a function-pointer type for functions used to destroy the
// object managed by a 'ManagedPtr' object.
private:
// PRIVATE TYPES
typedef typename bsls::UnspecifiedBool<ManagedPtr>::BoolType BoolType;
// 'BoolType' is an alias for an unspecified type that is implicitly
// convertible to 'bool', but will not promote to 'int'. This (opaque)
// type can be used as an "unspecified boolean type" for converting a
// managed pointer to 'bool' in contexts such as 'if (mp) { ... }'
// without actually having a conversion to 'bool' or being less-than
// comparable (either of which would also enable undesirable implicit
// comparisons of managed pointers to 'int' and less-than comparisons).
// DATA
ManagedPtr_Members d_members; // state managed by this object
// PRIVATE CLASS METHODS
static void *stripBasePointerType(TARGET_TYPE *ptr);
// Return the value of the specified 'ptr' as a 'void *', after
// stripping all 'const' and 'volatile' qualifiers from 'TARGET_TYPE'.
// This function avoids accidental type-safety errors when performing
// the necessary sequence of casts. Note that calling this function
// implies a conversion of the calling pointer to 'TARGET_TYPE *',
// which, in rare cases, may involve some adjustment of the pointer
// value, e.g., in the case of multiple inheritance where 'TARGET_TYPE'
// is not a left-most base of the complete object type.
template <class MANAGED_TYPE>
static void *stripCompletePointerType(MANAGED_TYPE *ptr);
// Return the value of the specified 'ptr' as a 'void *', after
// stripping all 'const' and 'volatile' qualifiers from 'TARGET_TYPE'.
// This function avoids accidental type-safety errors when performing
// the necessary sequence of casts.
// PRIVATE MANIPULATORS
template <class MANAGED_TYPE>
void loadImp(MANAGED_TYPE *ptr, void *cookie, DeleterFunc deleter);
// Destroy the currently managed object, if any. Then, set the target
// object of this managed pointer to be that referenced by the
// specified 'ptr', take ownership of '*ptr' as the currently managed
// object, and set a deleter that will invoke the specified 'deleter'
// with the address of the currently managed object, and with the
// specified 'cookie' (that the deleter can use for its own purposes),
// unless '0 == ptr', in which case reset this managed pointer as
// empty. The behavior is undefined if 'ptr' is already managed by
// another object, or if '0 == deleter && 0 != ptr'.
private:
// NOT IMPLEMENTED
template <class MANAGED_TYPE>
ManagedPtr(MANAGED_TYPE *, bsl::nullptr_t);
// It is never defined behavior to pass a null pointer literal as a
// factory, unless the specified 'ptr' is also a null pointer literal.
private:
// NOT IMPLEMENTED
template <class MANAGED_TYPE, class COOKIE_TYPE>
ManagedPtr(MANAGED_TYPE *, COOKIE_TYPE *, bsl::nullptr_t);
// It is never defined behavior to pass a null literal as a deleter,
// unless the 'object' pointer is also a null pointer literal.
private:
// NOT IMPLEMENTED
template <class MANAGED_TYPE>
void load(MANAGED_TYPE *, bsl::nullptr_t, bsl::nullptr_t);
template <class COOKIE_TYPE>
void load(TARGET_TYPE *, COOKIE_TYPE *, bsl::nullptr_t);
// It is never defined behavior to pass a null literal as a deleter,
// unless the 'object' pointer is also a null pointer literal.
private:
// NOT IMPLEMENTED
void operator==(const ManagedPtr&) const;
void operator!=(const ManagedPtr&) const;
// These two operator overloads are declared as 'private' but never
// defined in order to eliminate accidental equality comparisons that
// would occur through the implicit conversion to 'BoolType'. Note
// that the return type of 'void' is chosen as it will often produce a
// clearer error message than relying on the 'private' control failure.
// Note that these private operators will not be needed with C++11,
// where an 'explicit operator bool()' conversion operator would be
// preferred.
// FRIENDS
template <class ALIASED_TYPE>
friend class ManagedPtr; // required only for alias support
public:
// CREATORS
explicit ManagedPtr(bsl::nullptr_t = 0, bsl::nullptr_t = 0);
// Create an empty managed pointer. Note that this constructor is
// necessary to match null-pointer literal arguments, in order to break
// ambiguities and provide valid type deduction with the other
// constructor templates in this class.
template <class MANAGED_TYPE>
explicit ManagedPtr(MANAGED_TYPE *ptr);
// Create a managed pointer having a target object referenced by the
// specified 'ptr', owning the managed object '*ptr', and having a
// deleter that uses the currently installed default allocator to
// destroy the managed object when invoked (e.g., when this managed
// pointer object is destroyed), unless '0 == ptr', in which case
// create an empty managed pointer. The deleter will invoke the
// destructor of 'MANAGED_TYPE' rather than the destructor of
// 'TARGET_TYPE'. This constructor will not compile unless
// 'MANAGED_TYPE *' is convertible to 'TARGET_TYPE *'. The behavior is
// undefined unless the managed object (if any) can be destroyed by the
// currently installed default allocator, or if the the lifetime of the
// managed object is already managed by another object. Note that this
// behavior allows 'ManagedPtr' to be defined for 'void' pointers, and
// to call the correct destructor for the managed object, even if the
// destructor for 'TARGET_TYPE' is not declared as 'virtual'.
ManagedPtr(ManagedPtr& original);
// Create a managed pointer having the same target object as the
// specified 'original', and transfer the ownership of the object
// managed by the 'original' (if any) to this managed pointer, then
// reset 'original' as empty.
ManagedPtr(ManagedPtr_Ref<TARGET_TYPE> ref); // IMPLICIT
// Create a managed pointer having the same target object as the
// managed pointer referenced by the specified 'ref', and transfer
// ownership of the managed object owned by the managed pointer
// referenced by 'ref', then reset the managed pointer referenced by
// 'ref' as empty. This constructor is used to create a managed
// pointer from a managed pointer rvalue, or from a managed pointer to
// a "compatible" type, where "compatible" means a built-in conversion
// from 'COMPATIBLE_TYPE *' to 'TARGET_TYPE *' is defined, e.g.,
// 'derived *' -> 'base *', 'int *' -> 'const int *', or
// 'anyType *' -> 'void *'.
template <class ALIASED_TYPE>
ManagedPtr(ManagedPtr<ALIASED_TYPE>& alias, TARGET_TYPE *ptr);
// Create a managed pointer that takes ownership of the object managed
// by the specified 'alias', but which uses the specified 'ptr' to
// refer to its target object, unless '0 == ptr', in which case create
// an empty managed pointer. Reset 'alias' as empty if ownership of
// its managed object is transferred. The behavior is undefined if
// 'alias' is empty, but '0 != ptr'. Note that destroying or
// re-assigning a managed pointer created with this constructor will
// destroy the object originally managed by 'alias' (unless 'release'
// is called first); the destructor for '*ptr' is not called directly.
template <class MANAGED_TYPE, class FACTORY_TYPE>
ManagedPtr(MANAGED_TYPE *ptr, FACTORY_TYPE *factory);
// Create a managed pointer having a target object referenced by the
// specified 'ptr', owning the managed object '*ptr', and having a
// deleter that will call 'factory->deleteObject(ptr)' to destroy the
// managed object when invoked (e.g., when this managed pointer object
// is destroyed), unless '0 == ptr', in which case create an empty
// managed pointer. The deleter will invoke the destructor of
// 'MANAGED_TYPE' rather than the destructor of 'TARGET_TYPE'. This
// constructor will not compile unless 'MANAGED_TYPE *' is convertible
// to 'TARGET_TYPE *'. The behavior is undefined unless the managed
// object (if any) can be destroyed by the specified 'factory', or if
// '0 == factory && 0 != ptr', or if the the lifetime of the managed
// object is already managed by another object. Note that
// 'bslma::Allocator', and any class publicly and unambiguously derived
// from 'bslma::Allocator', meets the requirements for 'FACTORY_TYPE'.
template <class FACTORY_TYPE>
ManagedPtr(bsl::nullptr_t, FACTORY_TYPE *factory);
// Create an empty managed pointer. Note that the specified 'factory'
// is ignored, as an empty managed pointer does not call its deleter.
ManagedPtr(TARGET_TYPE *ptr, void *cookie, DeleterFunc deleter);
// Create a managed pointer having a target object referenced by the
// specified 'ptr', owning the managed object '*ptr', and having a
// deleter that will invoke the specified 'deleter' with the address of
// the currently managed object, and with the specified 'cookie' (that
// the deleter can use for its own purposes), unless '0 == ptr', in
// which case create an empty managed pointer. This constructor will
// not compile unless 'MANAGED_TYPE*' is convertible to 'TARGET_TYPE*'.
// The deleter will invoke the destructor of 'MANAGED_TYPE' rather than
// the destructor of 'TARGET_TYPE'. The behavior is undefined if 'ptr'
// is already managed by another object, or if
// '0 == deleter && 0 != ptr'. Note that this declaration is required
// only because the deprecated overloads create an ambiguity in this
// case. It should be removed when the deprecated overloads are
// removed.
template <class MANAGED_TYPE>
ManagedPtr(MANAGED_TYPE *ptr, void *cookie, DeleterFunc deleter);
// Create a managed pointer having a target object referenced by the
// specified 'ptr', owning the managed object '*ptr', and having a
// deleter that will invoke the specified 'deleter' with the address of
// the currently managed object, and with the specified 'cookie' (that
// the deleter can use for its own purposes), unless '0 == ptr', in
// which case create an empty managed pointer. This constructor will
// not compile unless 'MANAGED_TYPE*' is convertible to 'TARGET_TYPE*'.
// The deleter will invoke the destructor of 'MANAGED_TYPE' rather than
// the destructor of 'TARGET_TYPE'. The behavior is undefined if 'ptr'
// is already managed by another object, or if
// '0 == deleter && 0 != ptr'.
~ManagedPtr();
// Destroy this managed pointer object. Destroy the object managed by
// this managed pointer by invoking the user-supplied deleter, unless
// this managed pointer is empty, in which case the deleter will *not*
// be called.
// MANIPULATORS
ManagedPtr& operator=(ManagedPtr& rhs);
// If this object and the specified 'rhs' manage the same object,
// return a reference to this managed pointer; otherwise destroy the
// manged object owned by this managed pointer, then transfer ownership
// of the managed object owned by 'rhs', and set this managed pointer
// to point to the target object currently referenced by 'rhs', then
// reset 'rhs' as empty, and return a reference to this managed
// pointer.
ManagedPtr& operator=(ManagedPtr_Ref<TARGET_TYPE> ref);
// If this object and the managed pointer reference by the specified
// 'ref' manage the same object, return a reference to this managed
// pointer; otherwise destroy the manged object owned by this managed
// pointer, then transfer ownership of the managed object owned by the
// managed pointer referenced by 'ref', and set this managed pointer to
// point to the target object currently referenced the managed pointer
// referenced by 'ref'; then reset the managed pointer referenced by
// 'ref' as empty, and return a reference to this managed pointer.
// This operator is (implicitly) used to assign from a managed pointer
// rvalue, or from a managed pointer to a "compatible" type, where
// "compatible" means a built-in conversion from 'MANAGED_TYPE *' to
// 'TARGET_TYPE *' is defined, e.g., 'derived *' -> 'base *',
// 'T *' -> 'const T *', or 'T *' -> 'void *'.
ManagedPtr& operator=(bsl::nullptr_t);
// Destroy the current managed object (if any) and reset this managed
// pointer as empty.
template <class REFERENCED_TYPE>
operator ManagedPtr_Ref<REFERENCED_TYPE>();
// Return a managed pointer reference, referring to this object. Note
// that this conversion operator is used implicitly to allow the
// construction of managed pointers from rvalues because temporaries
// cannot be passed by references offering modifiable access.
void clear();
// [!DEPRECATED!] Use 'reset' instead.
//
// Destroy the current managed object (if any) and reset this managed
// pointer as empty.
template <class MANAGED_TYPE>
void load(MANAGED_TYPE *ptr);
// Destroy the currently managed object, if any. Then, set the target
// object of this managed pointer to be that referenced by the
// specified 'ptr', take ownership of '*ptr' as the currently managed
// object, and set a deleter that uses the currently installed default
// allocator to destroy the managed object when invoked (e.g., when
// this managed pointer object is destroyed), unless '0 == ptr', in
// which case reset this managed pointer as empty. The deleter will
// invoke the destructor of 'MANAGED_TYPE' rather than the destructor
// of 'TARGET_TYPE'. This function will not compile unless
// 'MANAGED_TYPE *' is convertible to 'TARGET_TYPE *'. The behavior is
// undefined unless the managed object (if any) can be destroyed by the
// currently installed default allocator, or if the the lifetime of the
// managed object is already managed by another object.
template <class MANAGED_TYPE, class FACTORY_TYPE>
void load(MANAGED_TYPE *ptr, FACTORY_TYPE *factory);
// Destroy the currently managed object, if any. Then, set the target
// object of this managed pointer to be that referenced by the
// specified 'ptr', take ownership of '*ptr' as the currently managed
// object, and set a deleter that calls 'factory->deleteObject(ptr)' to
// destroy the managed object when invoked (e.g., when this managed
// pointer object is destroyed), unless '0 == ptr', in which case reset
// this managed pointer as empty. The deleter will invoke the
// destructor of 'MANAGED_TYPE' rather than the destructor of
// 'TARGET_TYPE'. This function will not compile unless
// 'MANAGED_TYPE *' is convertible to 'TARGET_TYPE *'. The behavior is
// undefined unless the managed object (if any) can be destroyed by the
// specified 'factory', or if '0 == factory && 0 != ptr', or if the
// the lifetime of the managed object is already managed by another
// object. Note that 'bslma::Allocator', and any class publicly and
// unambiguously derived from 'bslma::Allocator', meets the
// requirements for 'FACTORY_TYPE'.
template <class MANAGED_TYPE>
void load(MANAGED_TYPE *ptr, void *cookie, DeleterFunc deleter);
// Destroy the currently managed object, if any. Then, set the target
// object of this managed pointer to be that referenced by the
// specified 'ptr', take ownership of '*ptr' as the currently managed
// object, and set a deleter that will invoke the specified 'deleter'
// with the address of the currently managed object, and with the
// specified 'cookie' (that the deleter can use for its own purposes),
// unless '0 == ptr', in which case reset this managed pointer as
// empty. The behavior is undefined if 'ptr' is already managed by
// another object, or if '0 == deleter && 0 != ptr'. Note that GCC 3.4
// and earlier versions have a bug in template type deduction/overload
// resolution that causes ambiguities if this signature is available.
// This function will be restored on that platform once the deprecated
// signatures are finally removed.
void load(bsl::nullptr_t = 0, void *cookie = 0, DeleterFunc deleter = 0);
// Destroy the current managed object (if any) and reset this managed
// pointer as empty. Note that the optionally specified 'cookie' and
// 'deleter' will be ignored, as empty managed pointers do not invoke a
// deleter.
template <class ALIASED_TYPE>
void loadAlias(ManagedPtr<ALIASED_TYPE>& alias, TARGET_TYPE *ptr);
// If the specified 'alias' manages the same object as this managed
// pointer, set the target object of this managed pointer to be that
// referenced by the specified 'ptr'; otherwise, destroy the currently
// managed object (if any), and if 'alias' is empty, reset this managed
// pointer as empty, otherwise transfer ownership (and the deleter) of
// the object managed by 'alias', and set the target object of this
// managed pointer to be that referenced by 'ptr'. The behavior is
// undefined if '0 == ptr' and 'alias' is not empty, or if '0 != ptr'
// and 'alias' is empty, or if 'ptr' is already managed by a managed
// pointer other than 'alias'. Note that this establishes a managed
// pointer where 'ptr' aliases 'alias'. The managed object for 'alias'
// will ultimately be destroyed, and the destructor for 'ptr' is not
// called directly.
ManagedPtr_PairProxy<TARGET_TYPE, ManagedPtrDeleter> release();
// Return a raw pointer to the current target object (if any) and the
// deleter for the currently managed object, and reset this managed
// pointer as empty. It is undefined behavior to run the returned
// deleter unless the returned pointer to target object is not null.
TARGET_TYPE *release(ManagedPtrDeleter *deleter);
// Load the specified 'deleter' for the currently managed object and
// reset this managed pointer as empty. Return a raw pointer to the
// target object (if any) managed by this pointer. It is undefined
// behavior to run the returned deleter unless the returned pointer to
// target object is not null.
void reset();
// Destroy the current managed object (if any) and reset this managed
// pointer as empty.
void swap(ManagedPtr& other);
// Exchange the value and ownership of this managed pointer with the
// specified 'other' managed pointer.
// ACCESSORS
operator BoolType() const;
// Return a value of "unspecified bool" type that evaluates to 'false'
// if this managed pointer is empty, and 'true' otherwise. Note that
// this conversion operator allows a managed pointer to be used within
// a conditional context, such as within an 'if' or 'while' statement,
// but does *not* allow managed pointers to be compared (e.g., via '<'
// or '>'). Note that a superior solution is available in C++11 using
// the 'explicit operator bool()' syntax, that removes the need for a
// special boolean-like type and private equality-comparison operators.
typename bslmf::AddReference<TARGET_TYPE>::Type operator*() const;
// Return a reference to the target object. The behavior is undefined
// if this managed pointer is empty, or if 'TARGET_TYPE' is 'void' or
// 'const void'.
TARGET_TYPE *operator->() const;
// Return the address of the target object, or 0 if this managed
// pointer is empty.
const ManagedPtrDeleter& deleter() const;
// Return a reference to the non-modifiable deleter information
// associated with this managed pointer. Behavior is undefined if this
// managed pointer is empty.
TARGET_TYPE *get() const;
// Return the address of the target object, or 0 if this managed
// pointer is empty.
TARGET_TYPE *ptr() const;
// [!DEPRECATED!]: Use 'get' instead.
//
// Return the address of the target object, or 0 if this managed
// pointer is empty.
};
template <class TARGET_TYPE>
void swap(ManagedPtr<TARGET_TYPE>& a, ManagedPtr<TARGET_TYPE>& b);
// Efficiently exchange the values of the specified 'a' and 'b' objects.
// This function provides the no-throw exception-safety guarantee.
// =====================
// struct ManagedPtrUtil
// =====================
struct ManagedPtrUtil {
// This utility class provides a general no-op deleter, which is useful
// when creating managed pointers to stack-allocated objects.
// CLASS METHODS
static void noOpDeleter(void *, void *);
// Deleter function that does nothing.
};
// ===========================
// struct ManagedPtrNilDeleter
// ===========================
template <class TARGET_TYPE>
struct ManagedPtrNilDeleter {
// [!DEPRECATED!]: Use 'ManagedPtrUtil::noOpDeleter' instead.
//
// This utility class provides a general no-op deleter, which is useful
// when creating managed pointers to stack-allocated objects. Note that
// the non-template class 'ManagedPtrUtil' should be used in preference to
// this deprecated class, avoiding both template bloat and undefined
// behavior.
// CLASS METHODS
static void deleter(void *, void *);
// Deleter function that does nothing.
};
// ===========================================
// private class ManagedPtr_FactoryDeleterType
// ===========================================
template <class TARGET_TYPE, class FACTORY_TYPE>
struct ManagedPtr_FactoryDeleterType
: bslmf::If<bsl::is_convertible<FACTORY_TYPE*, Allocator*>::value,
ManagedPtr_FactoryDeleter<TARGET_TYPE, Allocator>,
ManagedPtr_FactoryDeleter<TARGET_TYPE, FACTORY_TYPE> > {
// This metafunction class-template provides a means to compute the
// preferred deleter function for a factory class for those methods of
// 'ManagedPtr' that supply only a factory, and no additional deleter
// function. The intent is to use a common deleter function for all
// allocators that implement the 'bslma::Allocator' protocol, rather than
// create a special deleter function based on the complete type of each
// allocator, each doing the same thing (invoking the virtual function
// 'deleteObject').
};
// ========================================
// private struct ManagedPtr_DefaultDeleter
// ========================================
template <class MANAGED_TYPE>
struct ManagedPtr_DefaultDeleter {
// This 'struct' provides a function-like managed pointer deleter that
// invokes 'delete' with the passed pointer.
// CLASS METHODS
static void deleter(void *ptr, void *);
// Cast the specified 'ptr' to (template parameter) type
// 'MANAGED_TYPE *', and then call 'delete' with the cast pointer.
};
// =================================
// private struct ManagedPtr_ImpUtil
// =================================
struct ManagedPtr_ImpUtil {
// This 'struct' provides a namespace for non-generic implementation
// utilities shared by all instantiations of the 'ManagedPtr' template.
static void checkDefaultAllocatorIsNewDeleteAllocator();
// If the currently installed default allocator is not the NewDelete
// allocator singleton then, if this is the first such occurrence since
// the current task was started, write a message to the console warning
// about a pending change of behavior in the next BDE release.
};
// ============================================================================
// INLINE FUNCTION AND FUNCTION TEMPLATE DEFINITIONS
// ============================================================================
// ----------------------------
// private class ManagedPtr_Ref
// ----------------------------
// CREATOR
template <class TARGET_TYPE>
inline
ManagedPtr_Ref<TARGET_TYPE>::ManagedPtr_Ref(ManagedPtr_Members *base,
TARGET_TYPE *target)
: d_base_p(base)
, d_cast_p(target)
{
BSLS_ASSERT_SAFE(0 != base);
}
template <class TARGET_TYPE>
inline
ManagedPtr_Ref<TARGET_TYPE>::~ManagedPtr_Ref()
{
BSLS_ASSERT_SAFE(0 != d_base_p);
}
// ACCESSORS
template <class TARGET_TYPE>
inline
ManagedPtr_Members *ManagedPtr_Ref<TARGET_TYPE>::base() const
{
return d_base_p;
}
template <class TARGET_TYPE>
inline
TARGET_TYPE *ManagedPtr_Ref<TARGET_TYPE>::target() const
{
return d_cast_p;
}
// ----------------
// class ManagedPtr
// ----------------
template <class TARGET_TYPE>
class ManagedPtr<volatile TARGET_TYPE>;
// This specialization is declared but not defined, in order to provide an
// early compile-fail check to catch misuse of managed pointer to volatile
// types, which is explicitly called out as not supported in the primary
// class template contract.
template <class TARGET_TYPE>
class ManagedPtr<TARGET_TYPE &>;
// This specialization is declared but not defined, in order to provide an
// early compile-fail check to catch misuse of managed pointer to reference
// types, which is explicitly called out as not supported in the primary
// class template contract.
template <class TARGET_TYPE>
inline
void *ManagedPtr<TARGET_TYPE>::stripBasePointerType(TARGET_TYPE *ptr)
{
return const_cast<void*>(static_cast<const void*>(ptr));
}
template <class TARGET_TYPE>
template <class MANAGED_TYPE>
inline
void *
ManagedPtr<TARGET_TYPE>::stripCompletePointerType(MANAGED_TYPE *ptr)
{
return const_cast<void*>(static_cast<const void*>(ptr));
}
// CREATORS
template <class TARGET_TYPE>
inline
ManagedPtr<TARGET_TYPE>::ManagedPtr(bsl::nullptr_t, bsl::nullptr_t)
: d_members()
{
}
template <class TARGET_TYPE>
template <class FACTORY_TYPE>
inline
ManagedPtr<TARGET_TYPE>::ManagedPtr(bsl::nullptr_t, FACTORY_TYPE *)
: d_members()
{
}
template <class TARGET_TYPE>
template <class MANAGED_TYPE>
inline
ManagedPtr<TARGET_TYPE>::ManagedPtr(MANAGED_TYPE *ptr)
: d_members(stripCompletePointerType(ptr),
0,
&ManagedPtr_DefaultDeleter<MANAGED_TYPE>::deleter,
stripBasePointerType(ptr))
{
BSLMF_ASSERT((bsl::is_convertible<MANAGED_TYPE *, TARGET_TYPE *>::VALUE));
}
template <class TARGET_TYPE>
inline
ManagedPtr<TARGET_TYPE>::ManagedPtr(ManagedPtr_Ref<TARGET_TYPE> ref)
: d_members(*ref.base())
{
d_members.setAliasPtr(stripBasePointerType(ref.target()));
}
template <class TARGET_TYPE>
inline
ManagedPtr<TARGET_TYPE>::ManagedPtr(ManagedPtr& original)
: d_members(original.d_members)
{
}
template <class TARGET_TYPE>
template <class ALIASED_TYPE>
inline
ManagedPtr<TARGET_TYPE>::ManagedPtr(ManagedPtr<ALIASED_TYPE>& alias,
TARGET_TYPE *ptr)
: d_members()
{
BSLS_ASSERT_SAFE(0 != alias.ptr() || 0 == ptr);
if (0 != ptr) {
d_members.move(&alias.d_members);
d_members.setAliasPtr(stripBasePointerType(ptr));
}
}
template <class TARGET_TYPE>
template <class MANAGED_TYPE, class FACTORY_TYPE>
inline
ManagedPtr<TARGET_TYPE>::ManagedPtr(MANAGED_TYPE *ptr, FACTORY_TYPE *factory)
: d_members(stripCompletePointerType(ptr),
factory,
&ManagedPtr_FactoryDeleterType<MANAGED_TYPE,
FACTORY_TYPE>::Type::deleter,
stripBasePointerType(ptr))
{
BSLMF_ASSERT((bsl::is_convertible<MANAGED_TYPE *, TARGET_TYPE *>::value));
BSLS_ASSERT_SAFE(0 != factory || 0 == ptr);
}
template <class TARGET_TYPE>
inline
ManagedPtr<TARGET_TYPE>::ManagedPtr(TARGET_TYPE *ptr,
void *cookie,
DeleterFunc deleter)
: d_members(stripBasePointerType(ptr), cookie, deleter)
{
BSLS_ASSERT_SAFE(0 != deleter || 0 == ptr);
}
template <class TARGET_TYPE>
template <class MANAGED_TYPE>
inline
ManagedPtr<TARGET_TYPE>::ManagedPtr(MANAGED_TYPE *ptr,
void *cookie,
DeleterFunc deleter)
: d_members(stripCompletePointerType(ptr),
cookie,
deleter,
stripBasePointerType(ptr))
{
BSLMF_ASSERT((bsl::is_convertible<MANAGED_TYPE *, TARGET_TYPE *>::value));
BSLS_ASSERT_SAFE(0 != deleter || 0 == ptr);
}
template <class TARGET_TYPE>
inline
ManagedPtr<TARGET_TYPE>::~ManagedPtr()
{
d_members.runDeleter();
}
// PRIVATE MANIPULATORS
template <class TARGET_TYPE>
template <class MANAGED_TYPE>
inline
void ManagedPtr<TARGET_TYPE>::loadImp(MANAGED_TYPE *ptr,
void *cookie,
DeleterFunc deleter)
{
BSLMF_ASSERT((bsl::is_convertible<MANAGED_TYPE *, TARGET_TYPE *>::value));
BSLS_ASSERT_SAFE(0 != deleter || 0 == ptr);
d_members.runDeleter();
d_members.set(stripCompletePointerType(ptr), cookie, deleter);
d_members.setAliasPtr(stripBasePointerType(ptr));
}
// MANIPULATORS
template <class TARGET_TYPE>
inline
void ManagedPtr<TARGET_TYPE>::clear()
{
reset();
}
template <class TARGET_TYPE>
template <class MANAGED_TYPE>
inline
void ManagedPtr<TARGET_TYPE>::load(MANAGED_TYPE *ptr,
void *cookie,
DeleterFunc deleter)
{
BSLMF_ASSERT((bsl::is_convertible<MANAGED_TYPE *, TARGET_TYPE *>::value));
BSLS_ASSERT_SAFE(0 != deleter || 0 == ptr);
this->loadImp(ptr, cookie, deleter);
}
template <class TARGET_TYPE>
template <class MANAGED_TYPE>
inline
void ManagedPtr<TARGET_TYPE>::load(MANAGED_TYPE *ptr)
{
BSLMF_ASSERT((bsl::is_convertible<MANAGED_TYPE *, TARGET_TYPE *>::value));
typedef ManagedPtr_FactoryDeleter<MANAGED_TYPE, Allocator> DeleterFactory;
this->loadImp(ptr,
static_cast<void *>(Default::allocator()),
&DeleterFactory::deleter);
}
template <class TARGET_TYPE>
template <class MANAGED_TYPE, class FACTORY_TYPE>
inline
void ManagedPtr<TARGET_TYPE>::load(MANAGED_TYPE *ptr, FACTORY_TYPE *factory)
{
BSLMF_ASSERT((bsl::is_convertible<MANAGED_TYPE *, TARGET_TYPE *>::value));
BSLS_ASSERT_SAFE(0 != factory || 0 == ptr);
typedef typename
ManagedPtr_FactoryDeleterType<MANAGED_TYPE, FACTORY_TYPE>::Type
DeleterFactory;
this->loadImp(ptr, static_cast<void *>(factory), &DeleterFactory::deleter);
}
template <class TARGET_TYPE>
inline
void ManagedPtr<TARGET_TYPE>::load(bsl::nullptr_t, void *, DeleterFunc)
{
this->clear();
}
template <class TARGET_TYPE>
template <class ALIASED_TYPE>
void ManagedPtr<TARGET_TYPE>::loadAlias(ManagedPtr<ALIASED_TYPE>& alias,
TARGET_TYPE *ptr)
{
BSLS_ASSERT_SAFE((0 == ptr && 0 == alias.ptr())
||(0 != ptr && 0 != alias.ptr()));
if (ptr && alias.d_members.pointer()) {
d_members.moveAssign(&alias.d_members);
d_members.setAliasPtr(stripBasePointerType(ptr));
}
else {
d_members.runDeleter();
d_members.clear();
}
}
template <class TARGET_TYPE>
ManagedPtr_PairProxy<TARGET_TYPE, ManagedPtrDeleter>
ManagedPtr<TARGET_TYPE>::release()
{
typedef ManagedPtr_PairProxy<TARGET_TYPE, ManagedPtrDeleter> ResultType;
TARGET_TYPE *p = ptr();
// It is undefined behavior to call d_members.deleter() if 'p' is null.
if (p) {
ResultType result = { p, d_members.deleter() };
d_members.clear();
return result; // RETURN
}
ResultType result = { p, ManagedPtrDeleter() };
return result;
}
template <class TARGET_TYPE>
TARGET_TYPE *ManagedPtr<TARGET_TYPE>::release(ManagedPtrDeleter *deleter)
{
BSLS_ASSERT_SAFE(deleter);
TARGET_TYPE *result = ptr();
if (result) {
// undefined behavior to call d_members.deleter() if 'result' is null.
*deleter = d_members.deleter();
d_members.clear();
}
return result;
}
template <class TARGET_TYPE>
inline
void ManagedPtr<TARGET_TYPE>::reset()
{
d_members.runDeleter();
d_members.clear();
}
template <class TARGET_TYPE>
inline
void ManagedPtr<TARGET_TYPE>::swap(ManagedPtr& other)
{
d_members.swap(other.d_members);
}
template <class TARGET_TYPE>
inline
ManagedPtr<TARGET_TYPE>&
ManagedPtr<TARGET_TYPE>::operator=(ManagedPtr& rhs)
{
d_members.moveAssign(&rhs.d_members);
return *this;
}
template <class TARGET_TYPE>
inline
ManagedPtr<TARGET_TYPE>&
ManagedPtr<TARGET_TYPE>::operator=(ManagedPtr_Ref<TARGET_TYPE> ref)
{
d_members.moveAssign(ref.base());
d_members.setAliasPtr(stripBasePointerType(ref.target()));
return *this;
}
template <class TARGET_TYPE>
inline
ManagedPtr<TARGET_TYPE>&
ManagedPtr<TARGET_TYPE>::operator=(bsl::nullptr_t)
{
this->clear();
return *this;
}
template <class TARGET_TYPE>
template <class REFERENCED_TYPE>
inline
ManagedPtr<TARGET_TYPE>::operator ManagedPtr_Ref<REFERENCED_TYPE>()
{
BSLMF_ASSERT((bsl::is_convertible<TARGET_TYPE *,
REFERENCED_TYPE *>::VALUE));
return ManagedPtr_Ref<REFERENCED_TYPE>(&d_members,
static_cast<REFERENCED_TYPE *>(
static_cast<TARGET_TYPE *>(d_members.pointer())));
}
// ACCESSORS
template <class TARGET_TYPE>
inline
#if defined(BSLS_PLATFORM_CMP_IBM)
ManagedPtr<TARGET_TYPE>::operator typename ManagedPtr::BoolType() const
#else
ManagedPtr<TARGET_TYPE>::operator BoolType() const
#endif
{
return d_members.pointer()
? bsls::UnspecifiedBool<ManagedPtr>::trueValue()
: bsls::UnspecifiedBool<ManagedPtr>::falseValue();
}
template <class TARGET_TYPE>
inline
typename bslmf::AddReference<TARGET_TYPE>::Type
ManagedPtr<TARGET_TYPE>::operator*() const
{
BSLS_ASSERT_SAFE(d_members.pointer());
return *static_cast<TARGET_TYPE*>(d_members.pointer());
}
template <class TARGET_TYPE>
inline
TARGET_TYPE *ManagedPtr<TARGET_TYPE>::operator->() const
{
return static_cast<TARGET_TYPE*>(d_members.pointer());
}
template <class TARGET_TYPE>
inline
const ManagedPtrDeleter& ManagedPtr<TARGET_TYPE>::deleter() const
{
BSLS_ASSERT_SAFE(d_members.pointer());
return d_members.deleter();
}
template <class TARGET_TYPE>
inline
TARGET_TYPE *ManagedPtr<TARGET_TYPE>::get() const
{
return static_cast<TARGET_TYPE*>(d_members.pointer());
}
template <class TARGET_TYPE>
inline
TARGET_TYPE *ManagedPtr<TARGET_TYPE>::ptr() const
{
return get();
}
template <class TARGET_TYPE>
inline
void swap(ManagedPtr<TARGET_TYPE>& a, ManagedPtr<TARGET_TYPE>& b)
{
a.swap(b);
}
// --------------------------
// class ManagedPtrNilDeleter
// --------------------------
template <class TARGET_TYPE>
inline
void ManagedPtrNilDeleter<TARGET_TYPE>::deleter(void *, void *)
{
}
// ----------------------------------------
// private struct ManagedPtr_DefaultDeleter
// ----------------------------------------
// ACCESSORS
template <class MANAGED_TYPE>
inline
void ManagedPtr_DefaultDeleter<MANAGED_TYPE>::deleter(void *ptr, void *)
{
delete reinterpret_cast<MANAGED_TYPE *>(ptr);
}
} // close package namespace
// ============================================================================
// TYPE TRAITS
// ============================================================================
namespace bslmf {
template <class TARGET_TYPE>
struct HasPointerSemantics<bslma::ManagedPtr<TARGET_TYPE> >
: bsl::true_type {};
template <class TARGET_TYPE>
struct IsBitwiseMoveable<bslma::ManagedPtr<TARGET_TYPE> > : bsl::true_type {};
} // close namespace bslmf
} // close enterprise namespace
#endif
// ----------------------------------------------------------------------------
// Copyright 2013 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------
| mversche/bde | groups/bsl/bslma/bslma_managedptr.h | C | apache-2.0 | 67,701 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
*/
package org.apache.bookkeeper.common.collections;
import static org.junit.Assert.assertEquals;
import org.apache.bookkeeper.common.collections.RecyclableArrayList.Recycler;
import org.junit.Test;
/**
* Unit test of {@link RecyclableArrayList}.
*/
public class RecyclableArrayListTest {
private final Recycler<Integer> recycler;
public RecyclableArrayListTest() {
this.recycler = new Recycler<>();
}
@Test
public void testRecycle() {
RecyclableArrayList<Integer> array = recycler.newInstance();
for (int i = 0; i < 5; i++) {
array.add(i);
}
assertEquals(5, array.size());
array.recycle();
assertEquals(0, array.size());
}
}
| sijie/bookkeeper | bookkeeper-common/src/test/java/org/apache/bookkeeper/common/collections/RecyclableArrayListTest.java | Java | apache-2.0 | 1,532 |
/*
* Copyright 2017 StreamSets Inc.
*
* 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.streamsets.pipeline.stage.origin.mqtt;
import com.google.common.collect.ImmutableList;
import com.streamsets.pipeline.api.Record;
import com.streamsets.pipeline.api.StageException;
import com.streamsets.pipeline.config.DataFormat;
import com.streamsets.pipeline.lib.mqtt.Errors;
import com.streamsets.pipeline.lib.mqtt.MqttClientConfigBean;
import com.streamsets.pipeline.sdk.PushSourceRunner;
import com.streamsets.pipeline.sdk.StageRunner;
import com.streamsets.pipeline.stage.origin.lib.DataParserFormatConfig;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
public class TestMqttClientSource {
@Test
public void testSource() throws Exception {
MqttClientConfigBean commonConf = new MqttClientConfigBean();
commonConf.brokerUrl = "tcp://localhost:1833";
commonConf.clientId = UUID.randomUUID().toString();
MqttClientSourceConfigBean subscriberConf = new MqttClientSourceConfigBean();
subscriberConf.topicFilters = ImmutableList.of("sample/topic");
subscriberConf.dataFormat = DataFormat.JSON;
subscriberConf.dataFormatConfig = new DataParserFormatConfig();
MqttClientSource source = new MqttClientSource(commonConf, subscriberConf);
PushSourceRunner runner = new PushSourceRunner
.Builder(MqttClientDSource.class, source)
.addOutputLane("a").build();
runner.runInit();
try {
List<Record> records = new ArrayList<>();
runner.runProduce(Collections.<String, String>emptyMap(), 1, new PushSourceRunner.Callback() {
@Override
public void processBatch(StageRunner.Output output) {
records.clear();
records.addAll(output.getRecords().get("a"));
runner.setStop();
}
});
runner.waitOnProduce();
} catch (Exception ex) {
Assert.assertNotNull(ex.getCause());
Assert.assertNotNull(ex.getCause().getCause());
StageException stageException = (StageException) ex.getCause().getCause();
Assert.assertNotNull(stageException.getErrorCode());
Assert.assertEquals(stageException.getErrorCode(), Errors.MQTT_04);
} finally {
runner.runDestroy();
}
}
}
| rockmkd/datacollector | basic-lib/src/test/java/com/streamsets/pipeline/stage/origin/mqtt/TestMqttClientSource.java | Java | apache-2.0 | 2,850 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_45) on Tue Nov 12 20:31:45 CET 2013 -->
<title>Server</title>
<meta name="date" content="2013-11-12">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Server";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Server.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/esotericsoftware/kryonet/Serialization.html" title="interface in com.esotericsoftware.kryonet"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/esotericsoftware/kryonet/Server.html" target="_top">Frames</a></li>
<li><a href="Server.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.esotericsoftware.kryonet</div>
<h2 title="Class Server" class="title">Class Server</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.esotericsoftware.kryonet.Server</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a>, java.lang.Runnable</dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">Server</span>
extends java.lang.Object
implements <a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></pre>
<div class="block">Manages TCP and optionally UDP connections from many <a href="../../../com/esotericsoftware/kryonet/Client.html" title="class in com.esotericsoftware.kryonet"><code>Clients</code></a>.</div>
<dl><dt><span class="strong">Author:</span></dt>
<dd>Nathan Sweet <misc@n4te.com></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#Server()">Server</a></strong>()</code>
<div class="block">Creates a Server with a write buffer size of 16384 and an object buffer size of 2048.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#Server(int, int)">Server</a></strong>(int writeBufferSize,
int objectBufferSize)</code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#Server(int, int, com.esotericsoftware.kryonet.Serialization)">Server</a></strong>(int writeBufferSize,
int objectBufferSize,
<a href="../../../com/esotericsoftware/kryonet/Serialization.html" title="interface in com.esotericsoftware.kryonet">Serialization</a> serialization)</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#addListener(com.esotericsoftware.kryonet.Listener)">addListener</a></strong>(<a href="../../../com/esotericsoftware/kryonet/Listener.html" title="class in com.esotericsoftware.kryonet">Listener</a> listener)</code>
<div class="block">If the listener already exists, it is not added again.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#bind(java.net.InetSocketAddress, java.net.InetSocketAddress)">bind</a></strong>(java.net.InetSocketAddress tcpPort,
java.net.InetSocketAddress udpPort)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#bind(int)">bind</a></strong>(int tcpPort)</code>
<div class="block">Opens a TCP only server.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#bind(int, int)">bind</a></strong>(int tcpPort,
int udpPort)</code>
<div class="block">Opens a TCP and UDP server.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#close()">close</a></strong>()</code>
<div class="block">Closes all open connections and the server port(s).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../com/esotericsoftware/kryonet/Connection.html" title="class in com.esotericsoftware.kryonet">Connection</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#getConnections()">getConnections</a></strong>()</code>
<div class="block">Returns the current connections.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../com/esotericsoftware/kryo/Kryo.html" title="class in com.esotericsoftware.kryo">Kryo</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#getKryo()">getKryo</a></strong>()</code>
<div class="block">Gets the Kryo instance that will be used to serialize and deserialize objects.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../com/esotericsoftware/kryonet/Serialization.html" title="interface in com.esotericsoftware.kryonet">Serialization</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#getSerialization()">getSerialization</a></strong>()</code>
<div class="block">Gets the serialization instance that will be used to serialize and deserialize objects.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.Thread</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#getUpdateThread()">getUpdateThread</a></strong>()</code>
<div class="block">Returns the last thread that called <a href="../../../com/esotericsoftware/kryonet/EndPoint.html#update(int)"><code>EndPoint.update(int)</code></a> for this end point.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#removeListener(com.esotericsoftware.kryonet.Listener)">removeListener</a></strong>(<a href="../../../com/esotericsoftware/kryonet/Listener.html" title="class in com.esotericsoftware.kryonet">Listener</a> listener)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#run()">run</a></strong>()</code>
<div class="block">Continually updates this end point until <a href="../../../com/esotericsoftware/kryonet/EndPoint.html#stop()"><code>EndPoint.stop()</code></a> is called.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#sendToAllExceptTCP(int, java.lang.Object)">sendToAllExceptTCP</a></strong>(int connectionID,
java.lang.Object object)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#sendToAllExceptUDP(int, java.lang.Object)">sendToAllExceptUDP</a></strong>(int connectionID,
java.lang.Object object)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#sendToAllTCP(java.lang.Object)">sendToAllTCP</a></strong>(java.lang.Object object)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#sendToAllUDP(java.lang.Object)">sendToAllUDP</a></strong>(java.lang.Object object)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#sendToTCP(int, java.lang.Object)">sendToTCP</a></strong>(int connectionID,
java.lang.Object object)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#sendToUDP(int, java.lang.Object)">sendToUDP</a></strong>(int connectionID,
java.lang.Object object)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#start()">start</a></strong>()</code>
<div class="block">Starts a new thread that calls <a href="../../../com/esotericsoftware/kryonet/EndPoint.html#run()"><code>EndPoint.run()</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#stop()">stop</a></strong>()</code>
<div class="block">Closes this end point and causes <a href="../../../com/esotericsoftware/kryonet/EndPoint.html#run()"><code>EndPoint.run()</code></a> to return.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/esotericsoftware/kryonet/Server.html#update(int)">update</a></strong>(int timeout)</code>
<div class="block">Accepts any new connections and reads or writes any pending data for the current connections.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Server()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Server</h4>
<pre>public Server()</pre>
<div class="block">Creates a Server with a write buffer size of 16384 and an object buffer size of 2048.</div>
</li>
</ul>
<a name="Server(int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Server</h4>
<pre>public Server(int writeBufferSize,
int objectBufferSize)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>writeBufferSize</code> - One buffer of this size is allocated for each connected client. Objects are serialized to the write
buffer where the bytes are queued until they can be written to the TCP socket.
<p>
Normally the socket is writable and the bytes are written immediately. If the socket cannot be written to and
enough serialized objects are queued to overflow the buffer, then the connection will be closed.
<p>
The write buffer should be sized at least as large as the largest object that will be sent, plus some head room to
allow for some serialized objects to be queued in case the buffer is temporarily not writable. The amount of head
room needed is dependent upon the size of objects being sent and how often they are sent.</dd><dd><code>objectBufferSize</code> - One (using only TCP) or three (using both TCP and UDP) buffers of this size are allocated. These
buffers are used to hold the bytes for a single object graph until it can be sent over the network or
deserialized.
<p>
The object buffers should be sized at least as large as the largest object that will be sent or received.</dd></dl>
</li>
</ul>
<a name="Server(int, int, com.esotericsoftware.kryonet.Serialization)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Server</h4>
<pre>public Server(int writeBufferSize,
int objectBufferSize,
<a href="../../../com/esotericsoftware/kryonet/Serialization.html" title="interface in com.esotericsoftware.kryonet">Serialization</a> serialization)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getSerialization()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSerialization</h4>
<pre>public <a href="../../../com/esotericsoftware/kryonet/Serialization.html" title="interface in com.esotericsoftware.kryonet">Serialization</a> getSerialization()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#getSerialization()">EndPoint</a></code></strong></div>
<div class="block">Gets the serialization instance that will be used to serialize and deserialize objects.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#getSerialization()">getSerialization</a></code> in interface <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></code></dd>
</dl>
</li>
</ul>
<a name="getKryo()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getKryo</h4>
<pre>public <a href="../../../com/esotericsoftware/kryo/Kryo.html" title="class in com.esotericsoftware.kryo">Kryo</a> getKryo()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#getKryo()">EndPoint</a></code></strong></div>
<div class="block">Gets the Kryo instance that will be used to serialize and deserialize objects. This is only valid if
<a href="../../../com/esotericsoftware/kryonet/KryoSerialization.html" title="class in com.esotericsoftware.kryonet"><code>KryoSerialization</code></a> is being used, which is the default.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#getKryo()">getKryo</a></code> in interface <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></code></dd>
</dl>
</li>
</ul>
<a name="bind(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bind</h4>
<pre>public void bind(int tcpPort)
throws java.io.IOException</pre>
<div class="block">Opens a TCP only server.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if the server could not be opened.</dd></dl>
</li>
</ul>
<a name="bind(int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bind</h4>
<pre>public void bind(int tcpPort,
int udpPort)
throws java.io.IOException</pre>
<div class="block">Opens a TCP and UDP server.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if the server could not be opened.</dd></dl>
</li>
</ul>
<a name="bind(java.net.InetSocketAddress, java.net.InetSocketAddress)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bind</h4>
<pre>public void bind(java.net.InetSocketAddress tcpPort,
java.net.InetSocketAddress udpPort)
throws java.io.IOException</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>udpPort</code> - May be null.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
<a name="update(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public void update(int timeout)
throws java.io.IOException</pre>
<div class="block">Accepts any new connections and reads or writes any pending data for the current connections.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#update(int)">update</a></code> in interface <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>timeout</code> - Wait for up to the specified milliseconds for a connection to be ready to process. May be zero to return
immediately if there are no connections to process.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../com/esotericsoftware/kryonet/Client.html#update(int)"><code>Client.update(int)</code></a>,
<a href="../../../com/esotericsoftware/kryonet/Server.html#update(int)"><code>update(int)</code></a></dd></dl>
</li>
</ul>
<a name="run()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>run</h4>
<pre>public void run()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#run()">EndPoint</a></code></strong></div>
<div class="block">Continually updates this end point until <a href="../../../com/esotericsoftware/kryonet/EndPoint.html#stop()"><code>EndPoint.stop()</code></a> is called.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#run()">run</a></code> in interface <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></code></dd>
<dt><strong>Specified by:</strong></dt>
<dd><code>run</code> in interface <code>java.lang.Runnable</code></dd>
</dl>
</li>
</ul>
<a name="start()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>start</h4>
<pre>public void start()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#start()">EndPoint</a></code></strong></div>
<div class="block">Starts a new thread that calls <a href="../../../com/esotericsoftware/kryonet/EndPoint.html#run()"><code>EndPoint.run()</code></a>.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#start()">start</a></code> in interface <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></code></dd>
</dl>
</li>
</ul>
<a name="stop()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stop</h4>
<pre>public void stop()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#stop()">EndPoint</a></code></strong></div>
<div class="block">Closes this end point and causes <a href="../../../com/esotericsoftware/kryonet/EndPoint.html#run()"><code>EndPoint.run()</code></a> to return.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#stop()">stop</a></code> in interface <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></code></dd>
</dl>
</li>
</ul>
<a name="sendToAllTCP(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendToAllTCP</h4>
<pre>public void sendToAllTCP(java.lang.Object object)</pre>
</li>
</ul>
<a name="sendToAllExceptTCP(int, java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendToAllExceptTCP</h4>
<pre>public void sendToAllExceptTCP(int connectionID,
java.lang.Object object)</pre>
</li>
</ul>
<a name="sendToTCP(int, java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendToTCP</h4>
<pre>public void sendToTCP(int connectionID,
java.lang.Object object)</pre>
</li>
</ul>
<a name="sendToAllUDP(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendToAllUDP</h4>
<pre>public void sendToAllUDP(java.lang.Object object)</pre>
</li>
</ul>
<a name="sendToAllExceptUDP(int, java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendToAllExceptUDP</h4>
<pre>public void sendToAllExceptUDP(int connectionID,
java.lang.Object object)</pre>
</li>
</ul>
<a name="sendToUDP(int, java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendToUDP</h4>
<pre>public void sendToUDP(int connectionID,
java.lang.Object object)</pre>
</li>
</ul>
<a name="addListener(com.esotericsoftware.kryonet.Listener)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addListener</h4>
<pre>public void addListener(<a href="../../../com/esotericsoftware/kryonet/Listener.html" title="class in com.esotericsoftware.kryonet">Listener</a> listener)</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#addListener(com.esotericsoftware.kryonet.Listener)">EndPoint</a></code></strong></div>
<div class="block">If the listener already exists, it is not added again.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#addListener(com.esotericsoftware.kryonet.Listener)">addListener</a></code> in interface <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></code></dd>
</dl>
</li>
</ul>
<a name="removeListener(com.esotericsoftware.kryonet.Listener)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeListener</h4>
<pre>public void removeListener(<a href="../../../com/esotericsoftware/kryonet/Listener.html" title="class in com.esotericsoftware.kryonet">Listener</a> listener)</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#removeListener(com.esotericsoftware.kryonet.Listener)">removeListener</a></code> in interface <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></code></dd>
</dl>
</li>
</ul>
<a name="close()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>public void close()</pre>
<div class="block">Closes all open connections and the server port(s).</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#close()">close</a></code> in interface <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></code></dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../com/esotericsoftware/kryonet/Client.html" title="class in com.esotericsoftware.kryonet"><code>Client</code></a>,
<a href="../../../com/esotericsoftware/kryonet/Server.html" title="class in com.esotericsoftware.kryonet"><code>Server</code></a></dd></dl>
</li>
</ul>
<a name="getUpdateThread()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUpdateThread</h4>
<pre>public java.lang.Thread getUpdateThread()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#getUpdateThread()">EndPoint</a></code></strong></div>
<div class="block">Returns the last thread that called <a href="../../../com/esotericsoftware/kryonet/EndPoint.html#update(int)"><code>EndPoint.update(int)</code></a> for this end point. This can be useful to detect when long running
code will be run on the update thread.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html#getUpdateThread()">getUpdateThread</a></code> in interface <code><a href="../../../com/esotericsoftware/kryonet/EndPoint.html" title="interface in com.esotericsoftware.kryonet">EndPoint</a></code></dd>
</dl>
</li>
</ul>
<a name="getConnections()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getConnections</h4>
<pre>public <a href="../../../com/esotericsoftware/kryonet/Connection.html" title="class in com.esotericsoftware.kryonet">Connection</a>[] getConnections()</pre>
<div class="block">Returns the current connections. The array returned should not be modified.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Server.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/esotericsoftware/kryonet/Serialization.html" title="interface in com.esotericsoftware.kryonet"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/esotericsoftware/kryonet/Server.html" target="_top">Frames</a></li>
<li><a href="Server.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| frankdavid/diss | lib/kryo/javadoc/com/esotericsoftware/kryonet/Server.html | HTML | apache-2.0 | 30,550 |
#pragma once
#include <Register/Utility.hpp>
namespace Kvasir {
//Universal serial bus full-speed device interface
namespace UsbEp0r{ ///<endpoint 0 register
using Addr = Register::Address<0x40005c00,0xffff0000,0x00000000,unsigned>;
///Endpoint address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> ea{};
///Status bits, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,4),Register::ReadWriteAccess,unsigned> statTx{};
///Data Toggle, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> dtogTx{};
///Correct Transfer for transmission
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ctrTx{};
///Endpoint kind
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> epKind{};
///Endpoint type
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,9),Register::ReadWriteAccess,unsigned> epType{};
///Setup transaction completed
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> setup{};
///Status bits, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,12),Register::ReadWriteAccess,unsigned> statRx{};
///Data Toggle, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> dtogRx{};
///Correct transfer for reception
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> ctrRx{};
}
namespace UsbEp1r{ ///<endpoint 1 register
using Addr = Register::Address<0x40005c04,0xffff0000,0x00000000,unsigned>;
///Endpoint address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> ea{};
///Status bits, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,4),Register::ReadWriteAccess,unsigned> statTx{};
///Data Toggle, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> dtogTx{};
///Correct Transfer for transmission
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ctrTx{};
///Endpoint kind
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> epKind{};
///Endpoint type
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,9),Register::ReadWriteAccess,unsigned> epType{};
///Setup transaction completed
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> setup{};
///Status bits, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,12),Register::ReadWriteAccess,unsigned> statRx{};
///Data Toggle, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> dtogRx{};
///Correct transfer for reception
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> ctrRx{};
}
namespace UsbEp2r{ ///<endpoint 2 register
using Addr = Register::Address<0x40005c08,0xffff0000,0x00000000,unsigned>;
///Endpoint address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> ea{};
///Status bits, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,4),Register::ReadWriteAccess,unsigned> statTx{};
///Data Toggle, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> dtogTx{};
///Correct Transfer for transmission
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ctrTx{};
///Endpoint kind
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> epKind{};
///Endpoint type
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,9),Register::ReadWriteAccess,unsigned> epType{};
///Setup transaction completed
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> setup{};
///Status bits, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,12),Register::ReadWriteAccess,unsigned> statRx{};
///Data Toggle, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> dtogRx{};
///Correct transfer for reception
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> ctrRx{};
}
namespace UsbEp3r{ ///<endpoint 3 register
using Addr = Register::Address<0x40005c0c,0xffff0000,0x00000000,unsigned>;
///Endpoint address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> ea{};
///Status bits, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,4),Register::ReadWriteAccess,unsigned> statTx{};
///Data Toggle, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> dtogTx{};
///Correct Transfer for transmission
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ctrTx{};
///Endpoint kind
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> epKind{};
///Endpoint type
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,9),Register::ReadWriteAccess,unsigned> epType{};
///Setup transaction completed
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> setup{};
///Status bits, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,12),Register::ReadWriteAccess,unsigned> statRx{};
///Data Toggle, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> dtogRx{};
///Correct transfer for reception
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> ctrRx{};
}
namespace UsbEp4r{ ///<endpoint 4 register
using Addr = Register::Address<0x40005c10,0xffff0000,0x00000000,unsigned>;
///Endpoint address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> ea{};
///Status bits, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,4),Register::ReadWriteAccess,unsigned> statTx{};
///Data Toggle, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> dtogTx{};
///Correct Transfer for transmission
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ctrTx{};
///Endpoint kind
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> epKind{};
///Endpoint type
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,9),Register::ReadWriteAccess,unsigned> epType{};
///Setup transaction completed
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> setup{};
///Status bits, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,12),Register::ReadWriteAccess,unsigned> statRx{};
///Data Toggle, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> dtogRx{};
///Correct transfer for reception
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> ctrRx{};
}
namespace UsbEp5r{ ///<endpoint 5 register
using Addr = Register::Address<0x40005c14,0xffff0000,0x00000000,unsigned>;
///Endpoint address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> ea{};
///Status bits, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,4),Register::ReadWriteAccess,unsigned> statTx{};
///Data Toggle, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> dtogTx{};
///Correct Transfer for transmission
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ctrTx{};
///Endpoint kind
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> epKind{};
///Endpoint type
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,9),Register::ReadWriteAccess,unsigned> epType{};
///Setup transaction completed
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> setup{};
///Status bits, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,12),Register::ReadWriteAccess,unsigned> statRx{};
///Data Toggle, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> dtogRx{};
///Correct transfer for reception
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> ctrRx{};
}
namespace UsbEp6r{ ///<endpoint 6 register
using Addr = Register::Address<0x40005c18,0xffff0000,0x00000000,unsigned>;
///Endpoint address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> ea{};
///Status bits, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,4),Register::ReadWriteAccess,unsigned> statTx{};
///Data Toggle, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> dtogTx{};
///Correct Transfer for transmission
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ctrTx{};
///Endpoint kind
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> epKind{};
///Endpoint type
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,9),Register::ReadWriteAccess,unsigned> epType{};
///Setup transaction completed
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> setup{};
///Status bits, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,12),Register::ReadWriteAccess,unsigned> statRx{};
///Data Toggle, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> dtogRx{};
///Correct transfer for reception
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> ctrRx{};
}
namespace UsbEp7r{ ///<endpoint 7 register
using Addr = Register::Address<0x40005c1c,0xffff0000,0x00000000,unsigned>;
///Endpoint address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> ea{};
///Status bits, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,4),Register::ReadWriteAccess,unsigned> statTx{};
///Data Toggle, for transmission transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> dtogTx{};
///Correct Transfer for transmission
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ctrTx{};
///Endpoint kind
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> epKind{};
///Endpoint type
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,9),Register::ReadWriteAccess,unsigned> epType{};
///Setup transaction completed
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> setup{};
///Status bits, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,12),Register::ReadWriteAccess,unsigned> statRx{};
///Data Toggle, for reception transfers
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> dtogRx{};
///Correct transfer for reception
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> ctrRx{};
}
namespace UsbCntr{ ///<control register
using Addr = Register::Address<0x40005c40,0xffff0040,0x00000000,unsigned>;
///Force USB Reset
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> fres{};
///Power down
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> pdwn{};
///Low-power mode
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> lpmode{};
///Force suspend
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> fsusp{};
///Resume request
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> resume{};
///LPM L1 Resume request
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,unsigned> l1resume{};
///LPM L1 state request interrupt mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> l1reqm{};
///Expected start of frame interrupt mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> esofm{};
///Start of frame interrupt mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,unsigned> sofm{};
///USB reset interrupt mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,unsigned> resetm{};
///Suspend mode interrupt mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> suspm{};
///Wakeup interrupt mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,unsigned> wkupm{};
///Error interrupt mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,unsigned> errm{};
///Packet memory area over / underrun interrupt mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> pmaovrm{};
///Correct transfer interrupt mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> ctrm{};
}
namespace UsbIstr{ ///<interrupt status register
using Addr = Register::Address<0x40005c44,0xffff0060,0x00000000,unsigned>;
///Endpoint Identifier
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> epId{};
///Direction of transaction
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> dir{};
///LPM L1 state request
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> l1req{};
///Expected start frame
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> esof{};
///start of frame
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,unsigned> sof{};
///reset request
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,unsigned> reset{};
///Suspend mode request
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> susp{};
///Wakeup
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,unsigned> wkup{};
///Error
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,unsigned> err{};
///Packet memory area over / underrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> pmaovr{};
///Correct transfer
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> ctr{};
}
namespace UsbFnr{ ///<frame number register
using Addr = Register::Address<0x40005c48,0xffff0000,0x00000000,unsigned>;
///Frame number
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,0),Register::ReadWriteAccess,unsigned> fn{};
///Lost SOF
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,11),Register::ReadWriteAccess,unsigned> lsof{};
///Locked
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,unsigned> lck{};
///Receive data - line status
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> rxdm{};
///Receive data + line status
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> rxdp{};
}
namespace UsbDaddr{ ///<device address
using Addr = Register::Address<0x40005c4c,0xffffff00,0x00000000,unsigned>;
///Device address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,0),Register::ReadWriteAccess,unsigned> add{};
///Enable function
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ef{};
}
namespace UsbBtable{ ///<Buffer table address
using Addr = Register::Address<0x40005c50,0xffff0007,0x00000000,unsigned>;
///Buffer table
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,3),Register::ReadWriteAccess,unsigned> btable{};
}
namespace UsbLpmcsr{ ///<LPM control and status register
using Addr = Register::Address<0x40005c54,0xffffff04,0x00000000,unsigned>;
///LPM support enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> lpmen{};
///LPM Token acknowledge enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> lpmack{};
///bRemoteWake value
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> remwake{};
///BESL value
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,4),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> besl{};
}
namespace UsbBcdr{ ///<Battery charging detector
using Addr = Register::Address<0x40005c58,0xffff7f00,0x00000000,unsigned>;
///Battery charging detector (BCD) enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> bcden{};
///Data contact detection (DCD) mode enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> dcden{};
///Primary detection (PD) mode enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> pden{};
///Secondary detection (SD) mode enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> sden{};
///Data contact detection (DCD) status
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> dcdet{};
///Primary detection (PD) status
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> pdet{};
///Secondary detection (SD) status
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> sdet{};
///DM pull-up detection status
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> ps2det{};
///DP pull-up control
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> dppu{};
}
}
| porkybrain/Kvasir | Lib/Chip/Unknown/STMicro/STM32F091x/USB.hpp | C++ | apache-2.0 | 24,466 |
/*
* Copyright 2012 Vaadin Ltd.
*
* 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.vaadin.tests.applicationcontext;
import com.vaadin.server.Page;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinService;
import com.vaadin.server.VaadinSession;
import com.vaadin.tests.components.AbstractTestUIWithLog;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.UI;
public class CloseUI extends AbstractTestUIWithLog {
private static final String OLD_HASH_PARAM = "oldHash";
private static final String OLD_SESSION_ID_PARAM = "oldSessionId";
@Override
protected void setup(VaadinRequest request) {
System.out.println("UI " + getUIId() + " inited");
final int sessionHash = getSession().hashCode();
final String sessionId = request.getWrappedSession().getId();
log("Current session hashcode: " + sessionHash);
log("Current WrappedSession id: " + sessionId);
// Log previous values to make it easier to see what has changed
String oldHashValue = request.getParameter(OLD_HASH_PARAM);
if (oldHashValue != null) {
log("Old session hashcode: " + oldHashValue);
log("Same hash as current? "
+ oldHashValue.equals(Integer.toString(sessionHash)));
}
String oldSessionId = request.getParameter(OLD_SESSION_ID_PARAM);
if (oldSessionId != null) {
log("Old WrappedSession id: " + oldSessionId);
log("Same WrappedSession id? " + oldSessionId.equals(sessionId));
}
addButton("Log 'hello'", new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
log("Hello");
}
});
addButton("Close UI", new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
close();
}
});
addButton("Close UI (background)", new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
new UIRunSafelyThread(CloseUI.this) {
@Override
protected void runSafely() {
close();
}
}.start();
}
});
addButton("Close UI and redirect to /statictestfiles/static.html",
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
getPage().setLocation("/statictestfiles/static.html");
close();
}
});
addButton(
"Close UI and redirect to /statictestfiles/static.html (background)",
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
new UIRunSafelyThread(CloseUI.this) {
@Override
protected void runSafely() {
getPage().setLocation(
"/statictestfiles/static.html");
close();
}
}.start();
}
});
}
@Override
protected String getTestDescription() {
return "Test for closing the session and redirecting the user";
}
@Override
protected Integer getTicketNumber() {
return Integer.valueOf(9859);
}
@Override
public void detach() {
super.detach();
log("Detach of " + this + " (" + getUIId() + ")");
boolean correctUI = (UI.getCurrent() == this);
boolean correctPage = (Page.getCurrent() == getPage());
boolean correctVaadinSession = (VaadinSession
.getCurrent() == getSession());
boolean correctVaadinService = (VaadinService
.getCurrent() == getSession().getService());
log("UI.current correct in detach: " + correctUI);
log("Page.current correct in detach: " + correctPage);
log("VaadinSession.current correct in detach: " + correctVaadinSession);
log("VaadinService.current correct in detach: " + correctVaadinService);
}
}
| peterl1084/framework | uitest/src/main/java/com/vaadin/tests/applicationcontext/CloseUI.java | Java | apache-2.0 | 4,933 |
/*
* fnv1a.c : routines to create checksums derived from FNV-1a
*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
* ====================================================================
*/
#define APR_WANT_BYTEFUNC
#include <assert.h>
#include <apr.h>
#include "private/svn_subr_private.h"
#include "fnv1a.h"
/**
* See http://www.isthe.com/chongo/tech/comp/fnv/ for more info on FNV-1
*/
/* FNV-1 32 bit constants taken from
* http://www.isthe.com/chongo/tech/comp/fnv/
*/
#define FNV1_PRIME_32 0x01000193
#define FNV1_BASE_32 2166136261U
/* FNV-1a core implementation returning a 32 bit checksum over the first
* LEN bytes in INPUT. HASH is the checksum over preceding data (if any).
*/
static apr_uint32_t
fnv1a_32(apr_uint32_t hash, const void *input, apr_size_t len)
{
const unsigned char *data = input;
const unsigned char *end = data + len;
for (; data != end; ++data)
{
hash ^= *data;
hash *= FNV1_PRIME_32;
}
return hash;
}
/* Number of interleaved FVN-1a checksums we calculate for the modified
* checksum algorithm.
*/
enum { SCALING = 4 };
/* FNV-1a core implementation updating 4 interleaved checksums in HASHES
* over the first LEN bytes in INPUT. This will only process multiples
* of 4 and return the number of bytes processed. LEN - ReturnValue < 4.
*/
static apr_size_t
fnv1a_32x4(apr_uint32_t hashes[SCALING], const void *input, apr_size_t len)
{
/* calculate SCALING interleaved FNV-1a hashes while the input
is large enough */
const unsigned char *data = input;
const unsigned char *end = data + len;
for (; data + SCALING <= end; data += SCALING)
{
hashes[0] ^= data[0];
hashes[0] *= FNV1_PRIME_32;
hashes[1] ^= data[1];
hashes[1] *= FNV1_PRIME_32;
hashes[2] ^= data[2];
hashes[2] *= FNV1_PRIME_32;
hashes[3] ^= data[3];
hashes[3] *= FNV1_PRIME_32;
}
return data - (const unsigned char *)input;
}
/* Combine interleaved HASHES plus LEN bytes from INPUT into a single
* 32 bit hash value and return that. LEN must be < 4.
*/
static apr_uint32_t
finalize_fnv1a_32x4(apr_uint32_t hashes[SCALING],
const void *input,
apr_size_t len)
{
char final_data[sizeof(apr_uint32_t) * SCALING + SCALING - 1];
apr_size_t i;
assert(len < SCALING);
for (i = 0; i < SCALING; ++i)
hashes[i] = htonl(hashes[i]);
/* run FNV-1a over the interleaved checksums plus the remaining
(odd-lotted) input data */
memcpy(final_data, hashes, sizeof(apr_uint32_t) * SCALING);
if (len)
memcpy(final_data + sizeof(apr_uint32_t) * SCALING, input, len);
return fnv1a_32(FNV1_BASE_32,
final_data,
sizeof(apr_uint32_t) * SCALING + len);
}
apr_uint32_t
svn__fnv1a_32(const void *input, apr_size_t len)
{
return fnv1a_32(FNV1_BASE_32, input, len);
}
apr_uint32_t
svn__fnv1a_32x4(const void *input, apr_size_t len)
{
apr_uint32_t hashes[SCALING]
= { FNV1_BASE_32, FNV1_BASE_32, FNV1_BASE_32, FNV1_BASE_32 };
apr_size_t processed = fnv1a_32x4(hashes, input, len);
return finalize_fnv1a_32x4(hashes,
(const char *)input + processed,
len - processed);
}
void
svn__fnv1a_32x4_raw(apr_uint32_t hashes[4],
const void *input,
apr_size_t len)
{
apr_size_t processed;
apr_size_t i;
for (i = 0; i < SCALING; ++i)
hashes[i] = FNV1_BASE_32;
/* Process full 16 byte chunks. */
processed = fnv1a_32x4(hashes, input, len);
/* Fold the remainder (if any) into the first hash. */
hashes[0] = fnv1a_32(hashes[0], (const char *)input + processed,
len - processed);
}
struct svn_fnv1a_32__context_t
{
apr_uint32_t hash;
};
svn_fnv1a_32__context_t *
svn_fnv1a_32__context_create(apr_pool_t *pool)
{
svn_fnv1a_32__context_t *context = apr_palloc(pool, sizeof(*context));
context->hash = FNV1_BASE_32;
return context;
}
void
svn_fnv1a_32__context_reset(svn_fnv1a_32__context_t *context)
{
context->hash = FNV1_BASE_32;
}
void
svn_fnv1a_32__update(svn_fnv1a_32__context_t *context,
const void *data,
apr_size_t len)
{
context->hash = fnv1a_32(context->hash, data, len);
}
apr_uint32_t
svn_fnv1a_32__finalize(svn_fnv1a_32__context_t *context)
{
return context->hash;
}
struct svn_fnv1a_32x4__context_t
{
apr_uint32_t hashes[SCALING];
apr_size_t buffered;
char buffer[SCALING];
};
svn_fnv1a_32x4__context_t *
svn_fnv1a_32x4__context_create(apr_pool_t *pool)
{
svn_fnv1a_32x4__context_t *context = apr_palloc(pool, sizeof(*context));
context->hashes[0] = FNV1_BASE_32;
context->hashes[1] = FNV1_BASE_32;
context->hashes[2] = FNV1_BASE_32;
context->hashes[3] = FNV1_BASE_32;
context->buffered = 0;
return context;
}
void
svn_fnv1a_32x4__context_reset(svn_fnv1a_32x4__context_t *context)
{
context->hashes[0] = FNV1_BASE_32;
context->hashes[1] = FNV1_BASE_32;
context->hashes[2] = FNV1_BASE_32;
context->hashes[3] = FNV1_BASE_32;
context->buffered = 0;
}
void
svn_fnv1a_32x4__update(svn_fnv1a_32x4__context_t *context,
const void *data,
apr_size_t len)
{
apr_size_t processed;
if (context->buffered)
{
apr_size_t to_copy = SCALING - context->buffered;
if (to_copy > len)
{
memcpy(context->buffer + context->buffered, data, len);
context->buffered += len;
return;
}
memcpy(context->buffer + context->buffered, data, to_copy);
data = (const char *)data + to_copy;
len -= to_copy;
fnv1a_32x4(context->hashes, context->buffer, SCALING);
context->buffered = 0;
}
processed = fnv1a_32x4(context->hashes, data, len);
if (processed != len)
{
context->buffered = len - processed;
memcpy(context->buffer,
(const char*)data + processed,
len - processed);
}
}
apr_uint32_t
svn_fnv1a_32x4__finalize(svn_fnv1a_32x4__context_t *context)
{
return finalize_fnv1a_32x4(context->hashes,
context->buffer,
context->buffered);
}
| YueLinHo/Subversion | subversion/libsvn_subr/fnv1a.c | C | apache-2.0 | 7,083 |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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.buck.rules.macros;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.facebook.buck.core.cell.nameresolver.CellNameResolver;
import com.facebook.buck.core.exceptions.HumanReadableException;
import com.facebook.buck.core.macros.MacroException;
import com.facebook.buck.core.model.BuildTarget;
import com.facebook.buck.core.rules.ActionGraphBuilder;
import com.facebook.buck.core.util.immutables.BuckStyleValue;
import com.facebook.buck.rules.args.Arg;
import com.facebook.buck.rules.args.CompositeArg;
import com.facebook.buck.rules.args.SanitizedArg;
import com.facebook.buck.rules.args.StringArg;
import com.facebook.buck.rules.args.WriteToFileArg;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.hash.Hasher;
import com.google.common.hash.Hashing;
import java.util.HashMap;
import java.util.Optional;
import java.util.function.Function;
import org.immutables.value.Value;
/**
* Converts a {@link StringWithMacros} into an {@link Arg}. Performs conversion eagerly, and meant
* as a replacement for the lazy {@link Arg}.
*
* <p>As this holds a reference to an {@link ActionGraphBuilder}, instances of this object should
* not be capture by anything in the action graph.
*/
@BuckStyleValue
public abstract class StringWithMacrosConverter {
public abstract BuildTarget getBuildTarget();
protected abstract CellNameResolver getCellNameResolver();
public abstract ActionGraphBuilder getActionGraphBuilder();
public abstract ImmutableList<MacroExpander<? extends Macro, ?>> getExpanders();
public abstract Optional<Function<String, String>> getSanitizer();
public static StringWithMacrosConverter of(
BuildTarget buildTarget,
CellNameResolver cellNameResolver,
ActionGraphBuilder actionGraphBuilder,
ImmutableList<MacroExpander<? extends Macro, ?>> expanders) {
return of(
buildTarget,
cellNameResolver,
actionGraphBuilder,
expanders,
Optional.empty(),
new HashMap<>());
}
public static StringWithMacrosConverter of(
BuildTarget buildTarget,
CellNameResolver cellNameResolver,
ActionGraphBuilder actionGraphBuilder,
ImmutableList<MacroExpander<? extends Macro, ?>> expanders,
Optional<Function<String, String>> sanitizer) {
return of(
buildTarget, cellNameResolver, actionGraphBuilder, expanders, sanitizer, new HashMap<>());
}
@SuppressWarnings("PMD.LooseCoupling")
public static StringWithMacrosConverter of(
BuildTarget buildTarget,
CellNameResolver cellNameResolver,
ActionGraphBuilder actionGraphBuilder,
ImmutableList<MacroExpander<? extends Macro, ?>> expanders,
Optional<Function<String, String>> sanitizer,
HashMap<Macro, Object> precomputedWorkCache) {
return ImmutableStringWithMacrosConverter.of(
buildTarget,
cellNameResolver,
actionGraphBuilder,
expanders,
sanitizer,
precomputedWorkCache);
}
@Value.Auxiliary
@SuppressWarnings("PMD.LooseCoupling")
public abstract HashMap<Macro, Object> getPrecomputedWorkCache();
@Value.Derived
public ImmutableMap<Class<? extends Macro>, MacroExpander<? extends Macro, ?>>
getClassExpanders() {
ImmutableMap.Builder<Class<? extends Macro>, MacroExpander<? extends Macro, ?>> builder =
ImmutableMap.builder();
for (MacroExpander<? extends Macro, ?> expander : getExpanders()) {
builder.put(expander.getInputClass(), expander);
}
return builder.build();
}
@SuppressWarnings("unchecked")
private <M extends Macro, P> MacroExpander<M, P> getExpander(M macro) throws MacroException {
MacroExpander<M, P> expander =
(MacroExpander<M, P>) getClassExpanders().get(macro.getMacroClass());
if (expander == null) {
throw new MacroException(String.format("unexpected macro %s", macro.getMacroClass()));
}
return expander;
}
@SuppressWarnings("unchecked")
private <T extends Macro, P> Arg expand(T macro) throws MacroException {
MacroExpander<T, P> expander = getExpander(macro);
// Calculate precomputed work.
P precomputedWork = (P) getPrecomputedWorkCache().get(macro);
if (precomputedWork == null) {
precomputedWork =
expander.precomputeWorkFrom(
getBuildTarget(), getCellNameResolver(), getActionGraphBuilder(), macro);
getPrecomputedWorkCache().put(macro, precomputedWork);
}
return expander.expandFrom(getBuildTarget(), getActionGraphBuilder(), macro, precomputedWork);
}
/**
* Expand the input given for the this macro to some string, which is intended to be written to a
* file.
*/
private Arg expand(MacroContainer macroContainer) throws MacroException {
Arg arg = expand(macroContainer.getMacro());
// If specified, wrap this macro's output in a `WriteToFileArg`.
if (macroContainer.isOutputToFile()) {
// "prefix" should give a stable name, so that the same delegate with the same input can
// output the same file. We won't optimise for this case, since it's actually unlikely to
// happen within a single run, but using a random name would cause 'buck-out' to expand in an
// uncontrolled manner.
Hasher hasher = Hashing.sha256().newHasher();
hasher.putString(macroContainer.getMacro().getMacroClass().getName(), UTF_8);
hasher.putInt(macroContainer.getMacro().hashCode());
String prefix = hasher.hash().toString();
arg = new WriteToFileArg(getBuildTarget(), prefix, arg);
}
return arg;
}
private Arg transformString(String str) {
return getSanitizer()
.<Arg>map(sanitizer -> SanitizedArg.create(sanitizer, str))
.orElseGet(() -> StringArg.of(str));
}
private Arg transformMacro(MacroContainer macroContainer) {
try {
return expand(macroContainer);
} catch (MacroException e) {
throw new HumanReadableException(e, "%s: %s", getBuildTarget(), e.getMessage());
}
}
public Arg convert(StringWithMacros val) {
if (val.getParts().size() == 0) {
return StringArg.of("");
}
if (val.getParts().size() == 1) {
return val.getParts().get(0).transform(this::transformString, this::transformMacro);
}
return CompositeArg.of(val.map(this::transformString, this::transformMacro));
}
}
| facebook/buck | src/com/facebook/buck/rules/macros/StringWithMacrosConverter.java | Java | apache-2.0 | 7,028 |
/**
******************************************************************************
* @file stm32l4xx_hal_uart.h
* @author MCD Application Team
* @version V1.6.0
* @date 28-October-2016
* @brief Header file of UART HAL module.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32L4xx_HAL_UART_H
#define __STM32L4xx_HAL_UART_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32l4xx_hal_def.h"
/** @addtogroup STM32L4xx_HAL_Driver
* @{
*/
/** @addtogroup UART
* @{
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup UART_Exported_Types UART Exported Types
* @{
*/
/**
* @brief UART Init Structure definition
*/
typedef struct
{
uint32_t BaudRate; /*!< This member configures the UART communication baud rate.
The baud rate register is computed using the following formula:
- If oversampling is 16 or in LIN mode,
Baud Rate Register = ((PCLKx) / ((huart->Init.BaudRate)))
- If oversampling is 8,
Baud Rate Register[15:4] = ((2 * PCLKx) / ((huart->Init.BaudRate)))[15:4]
Baud Rate Register[3] = 0
Baud Rate Register[2:0] = (((2 * PCLKx) / ((huart->Init.BaudRate)))[3:0]) >> 1 */
uint32_t WordLength; /*!< Specifies the number of data bits transmitted or received in a frame.
This parameter can be a value of @ref UARTEx_Word_Length. */
uint32_t StopBits; /*!< Specifies the number of stop bits transmitted.
This parameter can be a value of @ref UART_Stop_Bits. */
uint32_t Parity; /*!< Specifies the parity mode.
This parameter can be a value of @ref UART_Parity
@note When parity is enabled, the computed parity is inserted
at the MSB position of the transmitted data (9th bit when
the word length is set to 9 data bits; 8th bit when the
word length is set to 8 data bits). */
uint32_t Mode; /*!< Specifies whether the Receive or Transmit mode is enabled or disabled.
This parameter can be a value of @ref UART_Mode. */
uint32_t HwFlowCtl; /*!< Specifies whether the hardware flow control mode is enabled
or disabled.
This parameter can be a value of @ref UART_Hardware_Flow_Control. */
uint32_t OverSampling; /*!< Specifies whether the Over sampling 8 is enabled or disabled, to achieve higher speed (up to f_PCLK/8).
This parameter can be a value of @ref UART_Over_Sampling. */
uint32_t OneBitSampling; /*!< Specifies whether a single sample or three samples' majority vote is selected.
Selecting the single sample method increases the receiver tolerance to clock
deviations. This parameter can be a value of @ref UART_OneBit_Sampling. */
}UART_InitTypeDef;
/**
* @brief UART Advanced Features initalization structure definition
*/
typedef struct
{
uint32_t AdvFeatureInit; /*!< Specifies which advanced UART features is initialized. Several
Advanced Features may be initialized at the same time .
This parameter can be a value of @ref UART_Advanced_Features_Initialization_Type. */
uint32_t TxPinLevelInvert; /*!< Specifies whether the TX pin active level is inverted.
This parameter can be a value of @ref UART_Tx_Inv. */
uint32_t RxPinLevelInvert; /*!< Specifies whether the RX pin active level is inverted.
This parameter can be a value of @ref UART_Rx_Inv. */
uint32_t DataInvert; /*!< Specifies whether data are inverted (positive/direct logic
vs negative/inverted logic).
This parameter can be a value of @ref UART_Data_Inv. */
uint32_t Swap; /*!< Specifies whether TX and RX pins are swapped.
This parameter can be a value of @ref UART_Rx_Tx_Swap. */
uint32_t OverrunDisable; /*!< Specifies whether the reception overrun detection is disabled.
This parameter can be a value of @ref UART_Overrun_Disable. */
uint32_t DMADisableonRxError; /*!< Specifies whether the DMA is disabled in case of reception error.
This parameter can be a value of @ref UART_DMA_Disable_on_Rx_Error. */
uint32_t AutoBaudRateEnable; /*!< Specifies whether auto Baud rate detection is enabled.
This parameter can be a value of @ref UART_AutoBaudRate_Enable */
uint32_t AutoBaudRateMode; /*!< If auto Baud rate detection is enabled, specifies how the rate
detection is carried out.
This parameter can be a value of @ref UART_AutoBaud_Rate_Mode. */
uint32_t MSBFirst; /*!< Specifies whether MSB is sent first on UART line.
This parameter can be a value of @ref UART_MSB_First. */
} UART_AdvFeatureInitTypeDef;
/**
* @brief HAL UART State structures definition
* @note HAL UART State value is a combination of 2 different substates: gState and RxState.
* - gState contains UART state information related to global Handle management
* and also information related to Tx operations.
* gState value coding follow below described bitmap :
* b7-b6 Error information
* 00 : No Error
* 01 : (Not Used)
* 10 : Timeout
* 11 : Error
* b5 IP initilisation status
* 0 : Reset (IP not initialized)
* 1 : Init done (IP not initialized. HAL UART Init function already called)
* b4-b3 (not used)
* xx : Should be set to 00
* b2 Intrinsic process state
* 0 : Ready
* 1 : Busy (IP busy with some configuration or internal operations)
* b1 (not used)
* x : Should be set to 0
* b0 Tx state
* 0 : Ready (no Tx operation ongoing)
* 1 : Busy (Tx operation ongoing)
* - RxState contains information related to Rx operations.
* RxState value coding follow below described bitmap :
* b7-b6 (not used)
* xx : Should be set to 00
* b5 IP initilisation status
* 0 : Reset (IP not initialized)
* 1 : Init done (IP not initialized)
* b4-b2 (not used)
* xxx : Should be set to 000
* b1 Rx state
* 0 : Ready (no Rx operation ongoing)
* 1 : Busy (Rx operation ongoing)
* b0 (not used)
* x : Should be set to 0.
*/
typedef enum
{
HAL_UART_STATE_RESET = 0x00U, /*!< Peripheral is not initialized
Value is allowed for gState and RxState */
HAL_UART_STATE_READY = 0x20U, /*!< Peripheral Initialized and ready for use
Value is allowed for gState and RxState */
HAL_UART_STATE_BUSY = 0x24U, /*!< an internal process is ongoing
Value is allowed for gState only */
HAL_UART_STATE_BUSY_TX = 0x21U, /*!< Data Transmission process is ongoing
Value is allowed for gState only */
HAL_UART_STATE_BUSY_RX = 0x22U, /*!< Data Reception process is ongoing
Value is allowed for RxState only */
HAL_UART_STATE_BUSY_TX_RX = 0x23U, /*!< Data Transmission and Reception process is ongoing
Not to be used for neither gState nor RxState.
Value is result of combination (Or) between gState and RxState values */
HAL_UART_STATE_TIMEOUT = 0xA0U, /*!< Timeout state
Value is allowed for gState only */
HAL_UART_STATE_ERROR = 0xE0U /*!< Error
Value is allowed for gState only */
}HAL_UART_StateTypeDef;
/**
* @brief HAL UART Error Code structure definition
*/
typedef enum
{
HAL_UART_ERROR_NONE = 0x00, /*!< No error */
HAL_UART_ERROR_PE = 0x01, /*!< Parity error */
HAL_UART_ERROR_NE = 0x02, /*!< Noise error */
HAL_UART_ERROR_FE = 0x04, /*!< frame error */
HAL_UART_ERROR_ORE = 0x08, /*!< Overrun error */
HAL_UART_ERROR_DMA = 0x10, /*!< DMA transfer error */
HAL_UART_ERROR_BUSY = 0x20 /*!< Busy Error */
}HAL_UART_ErrorTypeDef;
/**
* @brief UART clock sources definition
*/
typedef enum
{
UART_CLOCKSOURCE_PCLK1 = 0x00, /*!< PCLK1 clock source */
UART_CLOCKSOURCE_PCLK2 = 0x01, /*!< PCLK2 clock source */
UART_CLOCKSOURCE_HSI = 0x02, /*!< HSI clock source */
UART_CLOCKSOURCE_SYSCLK = 0x04, /*!< SYSCLK clock source */
UART_CLOCKSOURCE_LSE = 0x08, /*!< LSE clock source */
UART_CLOCKSOURCE_UNDEFINED = 0x10 /*!< Undefined clock source */
}UART_ClockSourceTypeDef;
/**
* @brief UART handle Structure definition
*/
typedef struct
{
USART_TypeDef *Instance; /*!< UART registers base address */
UART_InitTypeDef Init; /*!< UART communication parameters */
UART_AdvFeatureInitTypeDef AdvancedInit; /*!< UART Advanced Features initialization parameters */
uint8_t *pTxBuffPtr; /*!< Pointer to UART Tx transfer Buffer */
uint16_t TxXferSize; /*!< UART Tx Transfer size */
__IO uint16_t TxXferCount; /*!< UART Tx Transfer Counter */
uint8_t *pRxBuffPtr; /*!< Pointer to UART Rx transfer Buffer */
uint16_t RxXferSize; /*!< UART Rx Transfer size */
__IO uint16_t RxXferCount; /*!< UART Rx Transfer Counter */
uint16_t Mask; /*!< UART Rx RDR register mask */
DMA_HandleTypeDef *hdmatx; /*!< UART Tx DMA Handle parameters */
DMA_HandleTypeDef *hdmarx; /*!< UART Rx DMA Handle parameters */
HAL_LockTypeDef Lock; /*!< Locking object */
__IO HAL_UART_StateTypeDef gState; /*!< UART state information related to global Handle management
and also related to Tx operations.
This parameter can be a value of @ref HAL_UART_StateTypeDef */
__IO HAL_UART_StateTypeDef RxState; /*!< UART state information related to Rx operations.
This parameter can be a value of @ref HAL_UART_StateTypeDef */
__IO uint32_t ErrorCode; /*!< UART Error code */
}UART_HandleTypeDef;
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup UART_Exported_Constants UART Exported Constants
* @{
*/
/** @defgroup UART_Stop_Bits UART Number of Stop Bits
* @{
*/
#define UART_STOPBITS_0_5 USART_CR2_STOP_0 /*!< UART frame with 0.5 stop bit */
#define UART_STOPBITS_1 ((uint32_t)0x00000000) /*!< UART frame with 1 stop bit */
#define UART_STOPBITS_1_5 (USART_CR2_STOP_0 | USART_CR2_STOP_1) /*!< UART frame with 1.5 stop bits */
#define UART_STOPBITS_2 USART_CR2_STOP_1 /*!< UART frame with 2 stop bits */
/**
* @}
*/
/** @defgroup UART_Parity UART Parity
* @{
*/
#define UART_PARITY_NONE ((uint32_t)0x00000000) /*!< No parity */
#define UART_PARITY_EVEN ((uint32_t)USART_CR1_PCE) /*!< Even parity */
#define UART_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS)) /*!< Odd parity */
/**
* @}
*/
/** @defgroup UART_Hardware_Flow_Control UART Hardware Flow Control
* @{
*/
#define UART_HWCONTROL_NONE ((uint32_t)0x00000000) /*!< No hardware control */
#define UART_HWCONTROL_RTS ((uint32_t)USART_CR3_RTSE) /*!< Request To Send */
#define UART_HWCONTROL_CTS ((uint32_t)USART_CR3_CTSE) /*!< Clear To Send */
#define UART_HWCONTROL_RTS_CTS ((uint32_t)(USART_CR3_RTSE | USART_CR3_CTSE)) /*!< Request and Clear To Send */
/**
* @}
*/
/** @defgroup UART_Mode UART Transfer Mode
* @{
*/
#define UART_MODE_RX ((uint32_t)USART_CR1_RE) /*!< RX mode */
#define UART_MODE_TX ((uint32_t)USART_CR1_TE) /*!< TX mode */
#define UART_MODE_TX_RX ((uint32_t)(USART_CR1_TE |USART_CR1_RE)) /*!< RX and TX mode */
/**
* @}
*/
/** @defgroup UART_State UART State
* @{
*/
#define UART_STATE_DISABLE ((uint32_t)0x00000000) /*!< UART disabled */
#define UART_STATE_ENABLE ((uint32_t)USART_CR1_UE) /*!< UART enabled */
/**
* @}
*/
/** @defgroup UART_Over_Sampling UART Over Sampling
* @{
*/
#define UART_OVERSAMPLING_16 ((uint32_t)0x00000000) /*!< Oversampling by 16 */
#define UART_OVERSAMPLING_8 ((uint32_t)USART_CR1_OVER8) /*!< Oversampling by 8 */
/**
* @}
*/
/** @defgroup UART_OneBit_Sampling UART One Bit Sampling Method
* @{
*/
#define UART_ONE_BIT_SAMPLE_DISABLE ((uint32_t)0x00000000) /*!< One-bit sampling disable */
#define UART_ONE_BIT_SAMPLE_ENABLE ((uint32_t)USART_CR3_ONEBIT) /*!< One-bit sampling enable */
/**
* @}
*/
/** @defgroup UART_AutoBaud_Rate_Mode UART Advanced Feature AutoBaud Rate Mode
* @{
*/
#define UART_ADVFEATURE_AUTOBAUDRATE_ONSTARTBIT ((uint32_t)0x00000000) /*!< Auto Baud rate detection on start bit */
#define UART_ADVFEATURE_AUTOBAUDRATE_ONFALLINGEDGE ((uint32_t)USART_CR2_ABRMODE_0) /*!< Auto Baud rate detection on falling edge */
#define UART_ADVFEATURE_AUTOBAUDRATE_ON0X7FFRAME ((uint32_t)USART_CR2_ABRMODE_1) /*!< Auto Baud rate detection on 0x7F frame detection */
#define UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME ((uint32_t)USART_CR2_ABRMODE) /*!< Auto Baud rate detection on 0x55 frame detection */
/**
* @}
*/
/** @defgroup UART_Receiver_TimeOut UART Receiver TimeOut
* @{
*/
#define UART_RECEIVER_TIMEOUT_DISABLE ((uint32_t)0x00000000) /*!< UART receiver timeout disable */
#define UART_RECEIVER_TIMEOUT_ENABLE ((uint32_t)USART_CR2_RTOEN) /*!< UART receiver timeout enable */
/**
* @}
*/
/** @defgroup UART_LIN UART Local Interconnection Network mode
* @{
*/
#define UART_LIN_DISABLE ((uint32_t)0x00000000) /*!< Local Interconnect Network disable */
#define UART_LIN_ENABLE ((uint32_t)USART_CR2_LINEN) /*!< Local Interconnect Network enable */
/**
* @}
*/
/** @defgroup UART_LIN_Break_Detection UART LIN Break Detection
* @{
*/
#define UART_LINBREAKDETECTLENGTH_10B ((uint32_t)0x00000000) /*!< LIN 10-bit break detection length */
#define UART_LINBREAKDETECTLENGTH_11B ((uint32_t)USART_CR2_LBDL) /*!< LIN 11-bit break detection length */
/**
* @}
*/
/** @defgroup UART_DMA_Tx UART DMA Tx
* @{
*/
#define UART_DMA_TX_DISABLE ((uint32_t)0x00000000) /*!< UART DMA TX disabled */
#define UART_DMA_TX_ENABLE ((uint32_t)USART_CR3_DMAT) /*!< UART DMA TX enabled */
/**
* @}
*/
/** @defgroup UART_DMA_Rx UART DMA Rx
* @{
*/
#define UART_DMA_RX_DISABLE ((uint32_t)0x00000000) /*!< UART DMA RX disabled */
#define UART_DMA_RX_ENABLE ((uint32_t)USART_CR3_DMAR) /*!< UART DMA RX enabled */
/**
* @}
*/
/** @defgroup UART_Half_Duplex_Selection UART Half Duplex Selection
* @{
*/
#define UART_HALF_DUPLEX_DISABLE ((uint32_t)0x00000000) /*!< UART half-duplex disabled */
#define UART_HALF_DUPLEX_ENABLE ((uint32_t)USART_CR3_HDSEL) /*!< UART half-duplex enabled */
/**
* @}
*/
/** @defgroup UART_WakeUp_Methods UART WakeUp Methods
* @{
*/
#define UART_WAKEUPMETHOD_IDLELINE ((uint32_t)0x00000000) /*!< UART wake-up on idle line */
#define UART_WAKEUPMETHOD_ADDRESSMARK ((uint32_t)USART_CR1_WAKE) /*!< UART wake-up on address mark */
/**
* @}
*/
/** @defgroup UART_Request_Parameters UART Request Parameters
* @{
*/
#define UART_AUTOBAUD_REQUEST ((uint32_t)USART_RQR_ABRRQ) /*!< Auto-Baud Rate Request */
#define UART_SENDBREAK_REQUEST ((uint32_t)USART_RQR_SBKRQ) /*!< Send Break Request */
#define UART_MUTE_MODE_REQUEST ((uint32_t)USART_RQR_MMRQ) /*!< Mute Mode Request */
#define UART_RXDATA_FLUSH_REQUEST ((uint32_t)USART_RQR_RXFRQ) /*!< Receive Data flush Request */
#define UART_TXDATA_FLUSH_REQUEST ((uint32_t)USART_RQR_TXFRQ) /*!< Transmit data flush Request */
/**
* @}
*/
/** @defgroup UART_Advanced_Features_Initialization_Type UART Advanced Feature Initialization Type
* @{
*/
#define UART_ADVFEATURE_NO_INIT ((uint32_t)0x00000000) /*!< No advanced feature initialization */
#define UART_ADVFEATURE_TXINVERT_INIT ((uint32_t)0x00000001) /*!< TX pin active level inversion */
#define UART_ADVFEATURE_RXINVERT_INIT ((uint32_t)0x00000002) /*!< RX pin active level inversion */
#define UART_ADVFEATURE_DATAINVERT_INIT ((uint32_t)0x00000004) /*!< Binary data inversion */
#define UART_ADVFEATURE_SWAP_INIT ((uint32_t)0x00000008) /*!< TX/RX pins swap */
#define UART_ADVFEATURE_RXOVERRUNDISABLE_INIT ((uint32_t)0x00000010) /*!< RX overrun disable */
#define UART_ADVFEATURE_DMADISABLEONERROR_INIT ((uint32_t)0x00000020) /*!< DMA disable on Reception Error */
#define UART_ADVFEATURE_AUTOBAUDRATE_INIT ((uint32_t)0x00000040) /*!< Auto Baud rate detection initialization */
#define UART_ADVFEATURE_MSBFIRST_INIT ((uint32_t)0x00000080) /*!< Most significant bit sent/received first */
/**
* @}
*/
/** @defgroup UART_Tx_Inv UART Advanced Feature TX Pin Active Level Inversion
* @{
*/
#define UART_ADVFEATURE_TXINV_DISABLE ((uint32_t)0x00000000) /*!< TX pin active level inversion disable */
#define UART_ADVFEATURE_TXINV_ENABLE ((uint32_t)USART_CR2_TXINV) /*!< TX pin active level inversion enable */
/**
* @}
*/
/** @defgroup UART_Rx_Inv UART Advanced Feature RX Pin Active Level Inversion
* @{
*/
#define UART_ADVFEATURE_RXINV_DISABLE ((uint32_t)0x00000000) /*!< RX pin active level inversion disable */
#define UART_ADVFEATURE_RXINV_ENABLE ((uint32_t)USART_CR2_RXINV) /*!< RX pin active level inversion enable */
/**
* @}
*/
/** @defgroup UART_Data_Inv UART Advanced Feature Binary Data Inversion
* @{
*/
#define UART_ADVFEATURE_DATAINV_DISABLE ((uint32_t)0x00000000) /*!< Binary data inversion disable */
#define UART_ADVFEATURE_DATAINV_ENABLE ((uint32_t)USART_CR2_DATAINV) /*!< Binary data inversion enable */
/**
* @}
*/
/** @defgroup UART_Rx_Tx_Swap UART Advanced Feature RX TX Pins Swap
* @{
*/
#define UART_ADVFEATURE_SWAP_DISABLE ((uint32_t)0x00000000) /*!< TX/RX pins swap disable */
#define UART_ADVFEATURE_SWAP_ENABLE ((uint32_t)USART_CR2_SWAP) /*!< TX/RX pins swap enable */
/**
* @}
*/
/** @defgroup UART_Overrun_Disable UART Advanced Feature Overrun Disable
* @{
*/
#define UART_ADVFEATURE_OVERRUN_ENABLE ((uint32_t)0x00000000) /*!< RX overrun enable */
#define UART_ADVFEATURE_OVERRUN_DISABLE ((uint32_t)USART_CR3_OVRDIS) /*!< RX overrun disable */
/**
* @}
*/
/** @defgroup UART_AutoBaudRate_Enable UART Advanced Feature Auto BaudRate Enable
* @{
*/
#define UART_ADVFEATURE_AUTOBAUDRATE_DISABLE ((uint32_t)0x00000000) /*!< RX Auto Baud rate detection enable */
#define UART_ADVFEATURE_AUTOBAUDRATE_ENABLE ((uint32_t)USART_CR2_ABREN) /*!< RX Auto Baud rate detection disable */
/**
* @}
*/
/** @defgroup UART_DMA_Disable_on_Rx_Error UART Advanced Feature DMA Disable On Rx Error
* @{
*/
#define UART_ADVFEATURE_DMA_ENABLEONRXERROR ((uint32_t)0x00000000) /*!< DMA enable on Reception Error */
#define UART_ADVFEATURE_DMA_DISABLEONRXERROR ((uint32_t)USART_CR3_DDRE) /*!< DMA disable on Reception Error */
/**
* @}
*/
/** @defgroup UART_MSB_First UART Advanced Feature MSB First
* @{
*/
#define UART_ADVFEATURE_MSBFIRST_DISABLE ((uint32_t)0x00000000) /*!< Most significant bit sent/received first disable */
#define UART_ADVFEATURE_MSBFIRST_ENABLE ((uint32_t)USART_CR2_MSBFIRST) /*!< Most significant bit sent/received first enable */
/**
* @}
*/
/** @defgroup UART_Stop_Mode_Enable UART Advanced Feature Stop Mode Enable
* @{
*/
#define UART_ADVFEATURE_STOPMODE_DISABLE ((uint32_t)0x00000000) /*!< UART stop mode disable */
#define UART_ADVFEATURE_STOPMODE_ENABLE ((uint32_t)USART_CR1_UESM) /*!< UART stop mode enable */
/**
* @}
*/
/** @defgroup UART_Mute_Mode UART Advanced Feature Mute Mode Enable
* @{
*/
#define UART_ADVFEATURE_MUTEMODE_DISABLE ((uint32_t)0x00000000) /*!< UART mute mode disable */
#define UART_ADVFEATURE_MUTEMODE_ENABLE ((uint32_t)USART_CR1_MME) /*!< UART mute mode enable */
/**
* @}
*/
/** @defgroup UART_CR2_ADDRESS_LSB_POS UART Address-matching LSB Position In CR2 Register
* @{
*/
#define UART_CR2_ADDRESS_LSB_POS ((uint32_t) 24) /*!< UART address-matching LSB position in CR2 register */
/**
* @}
*/
/** @defgroup UART_WakeUp_from_Stop_Selection UART WakeUp From Stop Selection
* @{
*/
#define UART_WAKEUP_ON_ADDRESS ((uint32_t)0x00000000) /*!< UART wake-up on address */
#define UART_WAKEUP_ON_STARTBIT ((uint32_t)USART_CR3_WUS_1) /*!< UART wake-up on start bit */
#define UART_WAKEUP_ON_READDATA_NONEMPTY ((uint32_t)USART_CR3_WUS) /*!< UART wake-up on receive data register not empty */
/**
* @}
*/
/** @defgroup UART_DriverEnable_Polarity UART DriverEnable Polarity
* @{
*/
#define UART_DE_POLARITY_HIGH ((uint32_t)0x00000000) /*!< Driver enable signal is active high */
#define UART_DE_POLARITY_LOW ((uint32_t)USART_CR3_DEP) /*!< Driver enable signal is active low */
/**
* @}
*/
/** @defgroup UART_CR1_DEAT_ADDRESS_LSB_POS UART Driver Enable Assertion Time LSB Position In CR1 Register
* @{
*/
#define UART_CR1_DEAT_ADDRESS_LSB_POS ((uint32_t) 21) /*!< UART Driver Enable assertion time LSB position in CR1 register */
/**
* @}
*/
/** @defgroup UART_CR1_DEDT_ADDRESS_LSB_POS UART Driver Enable DeAssertion Time LSB Position In CR1 Register
* @{
*/
#define UART_CR1_DEDT_ADDRESS_LSB_POS ((uint32_t) 16) /*!< UART Driver Enable de-assertion time LSB position in CR1 register */
/**
* @}
*/
/** @defgroup UART_Interruption_Mask UART Interruptions Flag Mask
* @{
*/
#define UART_IT_MASK ((uint32_t)0x001F) /*!< UART interruptions flags mask */
/**
* @}
*/
/** @defgroup UART_TimeOut_Value UART polling-based communications time-out value
* @{
*/
#define HAL_UART_TIMEOUT_VALUE 0x1FFFFFF /*!< UART polling-based communications time-out value */
/**
* @}
*/
/** @defgroup UART_Flags UART Status Flags
* Elements values convention: 0xXXXX
* - 0xXXXX : Flag mask in the ISR register
* @{
*/
#define UART_FLAG_REACK ((uint32_t)0x00400000) /*!< UART receive enable acknowledge flag */
#define UART_FLAG_TEACK ((uint32_t)0x00200000) /*!< UART transmit enable acknowledge flag */
#define UART_FLAG_WUF ((uint32_t)0x00100000) /*!< UART wake-up from stop mode flag */
#define UART_FLAG_RWU ((uint32_t)0x00080000) /*!< UART receiver wake-up from mute mode flag */
#define UART_FLAG_SBKF ((uint32_t)0x00040000) /*!< UART send break flag */
#define UART_FLAG_CMF ((uint32_t)0x00020000) /*!< UART character match flag */
#define UART_FLAG_BUSY ((uint32_t)0x00010000) /*!< UART busy flag */
#define UART_FLAG_ABRF ((uint32_t)0x00008000) /*!< UART auto Baud rate flag */
#define UART_FLAG_ABRE ((uint32_t)0x00004000) /*!< UART auto Baud rate error */
#define UART_FLAG_EOBF ((uint32_t)0x00001000) /*!< UART end of block flag */
#define UART_FLAG_RTOF ((uint32_t)0x00000800) /*!< UART receiver timeout flag */
#define UART_FLAG_CTS ((uint32_t)0x00000400) /*!< UART clear to send flag */
#define UART_FLAG_CTSIF ((uint32_t)0x00000200) /*!< UART clear to send interrupt flag */
#define UART_FLAG_LBDF ((uint32_t)0x00000100) /*!< UART LIN break detection flag */
#define UART_FLAG_TXE ((uint32_t)0x00000080) /*!< UART transmit data register empty */
#define UART_FLAG_TC ((uint32_t)0x00000040) /*!< UART transmission complete */
#define UART_FLAG_RXNE ((uint32_t)0x00000020) /*!< UART read data register not empty */
#define UART_FLAG_IDLE ((uint32_t)0x00000010) /*!< UART idle flag */
#define UART_FLAG_ORE ((uint32_t)0x00000008) /*!< UART overrun error */
#define UART_FLAG_NE ((uint32_t)0x00000004) /*!< UART noise error */
#define UART_FLAG_FE ((uint32_t)0x00000002) /*!< UART frame error */
#define UART_FLAG_PE ((uint32_t)0x00000001) /*!< UART parity error */
/**
* @}
*/
/** @defgroup UART_Interrupt_definition UART Interrupts Definition
* Elements values convention: 000ZZZZZ0XXYYYYYb
* - YYYYY : Interrupt source position in the XX register (5bits)
* - XX : Interrupt source register (2bits)
* - 01: CR1 register
* - 10: CR2 register
* - 11: CR3 register
* - ZZZZZ : Flag position in the ISR register(5bits)
* @{
*/
#define UART_IT_PE ((uint32_t)0x0028) /*!< UART parity error interruption */
#define UART_IT_TXE ((uint32_t)0x0727) /*!< UART transmit data register empty interruption */
#define UART_IT_TC ((uint32_t)0x0626) /*!< UART transmission complete interruption */
#define UART_IT_RXNE ((uint32_t)0x0525) /*!< UART read data register not empty interruption */
#define UART_IT_IDLE ((uint32_t)0x0424) /*!< UART idle interruption */
#define UART_IT_LBD ((uint32_t)0x0846) /*!< UART LIN break detection interruption */
#define UART_IT_CTS ((uint32_t)0x096A) /*!< UART CTS interruption */
#define UART_IT_CM ((uint32_t)0x112E) /*!< UART character match interruption */
#define UART_IT_WUF ((uint32_t)0x1476) /*!< UART wake-up from stop mode interruption */
#define UART_IT_ERR ((uint32_t)0x0060) /*!< UART error interruption */
#define UART_IT_ORE ((uint32_t)0x0300) /*!< UART overrun error interruption */
#define UART_IT_NE ((uint32_t)0x0200) /*!< UART noise error interruption */
#define UART_IT_FE ((uint32_t)0x0100) /*!< UART frame error interruption */
/**
* @}
*/
/** @defgroup UART_IT_CLEAR_Flags UART Interruption Clear Flags
* @{
*/
#define UART_CLEAR_PEF USART_ICR_PECF /*!< Parity Error Clear Flag */
#define UART_CLEAR_FEF USART_ICR_FECF /*!< Framing Error Clear Flag */
#define UART_CLEAR_NEF USART_ICR_NCF /*!< Noise detected Clear Flag */
#define UART_CLEAR_OREF USART_ICR_ORECF /*!< Overrun Error Clear Flag */
#define UART_CLEAR_IDLEF USART_ICR_IDLECF /*!< IDLE line detected Clear Flag */
#define UART_CLEAR_TCF USART_ICR_TCCF /*!< Transmission Complete Clear Flag */
#define UART_CLEAR_LBDF USART_ICR_LBDCF /*!< LIN Break Detection Clear Flag */
#define UART_CLEAR_CTSF USART_ICR_CTSCF /*!< CTS Interrupt Clear Flag */
#define UART_CLEAR_RTOF USART_ICR_RTOCF /*!< Receiver Time Out Clear Flag */
#define UART_CLEAR_EOBF USART_ICR_EOBCF /*!< End Of Block Clear Flag */
#define UART_CLEAR_CMF USART_ICR_CMCF /*!< Character Match Clear Flag */
#define UART_CLEAR_WUF USART_ICR_WUCF /*!< Wake Up from stop mode Clear Flag */
/**
* @}
*/
/**
* @}
*/
/* Exported macros -----------------------------------------------------------*/
/** @defgroup UART_Exported_Macros UART Exported Macros
* @{
*/
/** @brief Reset UART handle states.
* @param __HANDLE__: UART handle.
* @retval None
*/
#define __HAL_UART_RESET_HANDLE_STATE(__HANDLE__) do{ \
(__HANDLE__)->gState = HAL_UART_STATE_RESET; \
(__HANDLE__)->RxState = HAL_UART_STATE_RESET; \
} while(0)
/** @brief Flush the UART Data registers.
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_FLUSH_DRREGISTER(__HANDLE__) \
do{ \
SET_BIT((__HANDLE__)->Instance->RQR, UART_RXDATA_FLUSH_REQUEST); \
SET_BIT((__HANDLE__)->Instance->RQR, UART_TXDATA_FLUSH_REQUEST); \
} while(0)
/** @brief Clear the specified UART pending flag.
* @param __HANDLE__: specifies the UART Handle.
* @param __FLAG__: specifies the flag to check.
* This parameter can be any combination of the following values:
* @arg @ref UART_CLEAR_PEF Parity Error Clear Flag
* @arg @ref UART_CLEAR_FEF Framing Error Clear Flag
* @arg @ref UART_CLEAR_NEF Noise detected Clear Flag
* @arg @ref UART_CLEAR_OREF Overrun Error Clear Flag
* @arg @ref UART_CLEAR_IDLEF IDLE line detected Clear Flag
* @arg @ref UART_CLEAR_TCF Transmission Complete Clear Flag
* @arg @ref UART_CLEAR_LBDF LIN Break Detection Clear Flag
* @arg @ref UART_CLEAR_CTSF CTS Interrupt Clear Flag
* @arg @ref UART_CLEAR_RTOF Receiver Time Out Clear Flag
* @arg @ref UART_CLEAR_EOBF End Of Block Clear Flag
* @arg @ref UART_CLEAR_CMF Character Match Clear Flag
* @arg @ref UART_CLEAR_WUF Wake Up from stop mode Clear Flag
* @retval None
*/
#define __HAL_UART_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
/** @brief Clear the UART PE pending flag.
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_CLEAR_PEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_PEF)
/** @brief Clear the UART FE pending flag.
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_CLEAR_FEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_FEF)
/** @brief Clear the UART NE pending flag.
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_CLEAR_NEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_NEF)
/** @brief Clear the UART ORE pending flag.
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_CLEAR_OREFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_OREF)
/** @brief Clear the UART IDLE pending flag.
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_CLEAR_IDLEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_IDLEF)
/** @brief Check whether the specified UART flag is set or not.
* @param __HANDLE__: specifies the UART Handle.
* @param __FLAG__: specifies the flag to check.
* This parameter can be one of the following values:
* @arg @ref UART_FLAG_REACK Receive enable acknowledge flag
* @arg @ref UART_FLAG_TEACK Transmit enable acknowledge flag
* @arg @ref UART_FLAG_WUF Wake up from stop mode flag
* @arg @ref UART_FLAG_RWU Receiver wake up flag (if the UART in mute mode)
* @arg @ref UART_FLAG_SBKF Send Break flag
* @arg @ref UART_FLAG_CMF Character match flag
* @arg @ref UART_FLAG_BUSY Busy flag
* @arg @ref UART_FLAG_ABRF Auto Baud rate detection flag
* @arg @ref UART_FLAG_ABRE Auto Baud rate detection error flag
* @arg @ref UART_FLAG_EOBF End of block flag
* @arg @ref UART_FLAG_RTOF Receiver timeout flag
* @arg @ref UART_FLAG_CTS CTS Change flag
* @arg @ref UART_FLAG_LBDF LIN Break detection flag
* @arg @ref UART_FLAG_TXE Transmit data register empty flag
* @arg @ref UART_FLAG_TC Transmission Complete flag
* @arg @ref UART_FLAG_RXNE Receive data register not empty flag
* @arg @ref UART_FLAG_IDLE Idle Line detection flag
* @arg @ref UART_FLAG_ORE Overrun Error flag
* @arg @ref UART_FLAG_NE Noise Error flag
* @arg @ref UART_FLAG_FE Framing Error flag
* @arg @ref UART_FLAG_PE Parity Error flag
* @retval The new state of __FLAG__ (TRUE or FALSE).
*/
#define __HAL_UART_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__))
/** @brief Enable the specified UART interrupt.
* @param __HANDLE__: specifies the UART Handle.
* @param __INTERRUPT__: specifies the UART interrupt source to enable.
* This parameter can be one of the following values:
* @arg @ref UART_IT_WUF Wakeup from stop mode interrupt
* @arg @ref UART_IT_CM Character match interrupt
* @arg @ref UART_IT_CTS CTS change interrupt
* @arg @ref UART_IT_LBD LIN Break detection interrupt
* @arg @ref UART_IT_TXE Transmit Data Register empty interrupt
* @arg @ref UART_IT_TC Transmission complete interrupt
* @arg @ref UART_IT_RXNE Receive Data register not empty interrupt
* @arg @ref UART_IT_IDLE Idle line detection interrupt
* @arg @ref UART_IT_PE Parity Error interrupt
* @arg @ref UART_IT_ERR Error interrupt (Frame error, noise error, overrun error)
* @retval None
*/
#define __HAL_UART_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((((uint8_t)(__INTERRUPT__)) >> 5U) == 1)? ((__HANDLE__)->Instance->CR1 |= (1U << ((__INTERRUPT__) & UART_IT_MASK))): \
((((uint8_t)(__INTERRUPT__)) >> 5U) == 2)? ((__HANDLE__)->Instance->CR2 |= (1U << ((__INTERRUPT__) & UART_IT_MASK))): \
((__HANDLE__)->Instance->CR3 |= (1U << ((__INTERRUPT__) & UART_IT_MASK))))
/** @brief Disable the specified UART interrupt.
* @param __HANDLE__: specifies the UART Handle.
* @param __INTERRUPT__: specifies the UART interrupt source to disable.
* This parameter can be one of the following values:
* @arg @ref UART_IT_WUF Wakeup from stop mode interrupt
* @arg @ref UART_IT_CM Character match interrupt
* @arg @ref UART_IT_CTS CTS change interrupt
* @arg @ref UART_IT_LBD LIN Break detection interrupt
* @arg @ref UART_IT_TXE Transmit Data Register empty interrupt
* @arg @ref UART_IT_TC Transmission complete interrupt
* @arg @ref UART_IT_RXNE Receive Data register not empty interrupt
* @arg @ref UART_IT_IDLE Idle line detection interrupt
* @arg @ref UART_IT_PE Parity Error interrupt
* @arg @ref UART_IT_ERR Error interrupt (Frame error, noise error, overrun error)
* @retval None
*/
#define __HAL_UART_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((((uint8_t)(__INTERRUPT__)) >> 5U) == 1)? ((__HANDLE__)->Instance->CR1 &= ~ (1U << ((__INTERRUPT__) & UART_IT_MASK))): \
((((uint8_t)(__INTERRUPT__)) >> 5U) == 2)? ((__HANDLE__)->Instance->CR2 &= ~ (1U << ((__INTERRUPT__) & UART_IT_MASK))): \
((__HANDLE__)->Instance->CR3 &= ~ (1U << ((__INTERRUPT__) & UART_IT_MASK))))
/** @brief Check whether the specified UART interrupt has occurred or not.
* @param __HANDLE__: specifies the UART Handle.
* @param __IT__: specifies the UART interrupt to check.
* This parameter can be one of the following values:
* @arg @ref UART_IT_WUF Wakeup from stop mode interrupt
* @arg @ref UART_IT_CM Character match interrupt
* @arg @ref UART_IT_CTS CTS change interrupt
* @arg @ref UART_IT_LBD LIN Break detection interrupt
* @arg @ref UART_IT_TXE Transmit Data Register empty interrupt
* @arg @ref UART_IT_TC Transmission complete interrupt
* @arg @ref UART_IT_RXNE Receive Data register not empty interrupt
* @arg @ref UART_IT_IDLE Idle line detection interrupt
* @arg @ref UART_IT_ORE Overrun Error interrupt
* @arg @ref UART_IT_NE Noise Error interrupt
* @arg @ref UART_IT_FE Framing Error interrupt
* @arg @ref UART_IT_PE Parity Error interrupt
* @retval The new state of __IT__ (TRUE or FALSE).
*/
#define __HAL_UART_GET_IT(__HANDLE__, __IT__) ((__HANDLE__)->Instance->ISR & ((uint32_t)1 << ((__IT__)>> 0x08)))
/** @brief Check whether the specified UART interrupt source is enabled or not.
* @param __HANDLE__: specifies the UART Handle.
* @param __IT__: specifies the UART interrupt source to check.
* This parameter can be one of the following values:
* @arg @ref UART_IT_WUF Wakeup from stop mode interrupt
* @arg @ref UART_IT_CM Character match interrupt
* @arg @ref UART_IT_CTS CTS change interrupt
* @arg @ref UART_IT_LBD LIN Break detection interrupt
* @arg @ref UART_IT_TXE Transmit Data Register empty interrupt
* @arg @ref UART_IT_TC Transmission complete interrupt
* @arg @ref UART_IT_RXNE Receive Data register not empty interrupt
* @arg @ref UART_IT_IDLE Idle line detection interrupt
* @arg @ref UART_IT_ERR Error interrupt (Frame error, noise error, overrun error)
* @arg @ref UART_IT_PE Parity Error interrupt
* @retval The new state of __IT__ (TRUE or FALSE).
*/
#define __HAL_UART_GET_IT_SOURCE(__HANDLE__, __IT__) ((((((uint8_t)(__IT__)) >> 5U) == 1)? (__HANDLE__)->Instance->CR1:(((((uint8_t)(__IT__)) >> 5U) == 2)? \
(__HANDLE__)->Instance->CR2 : (__HANDLE__)->Instance->CR3)) & ((uint32_t)1 << (((uint16_t)(__IT__)) & UART_IT_MASK)))
/** @brief Clear the specified UART ISR flag, in setting the proper ICR register flag.
* @param __HANDLE__: specifies the UART Handle.
* @param __IT_CLEAR__: specifies the interrupt clear register flag that needs to be set
* to clear the corresponding interrupt
* This parameter can be one of the following values:
* @arg @ref UART_CLEAR_PEF Parity Error Clear Flag
* @arg @ref UART_CLEAR_FEF Framing Error Clear Flag
* @arg @ref UART_CLEAR_NEF Noise detected Clear Flag
* @arg @ref UART_CLEAR_OREF Overrun Error Clear Flag
* @arg @ref UART_CLEAR_IDLEF IDLE line detected Clear Flag
* @arg @ref UART_CLEAR_TCF Transmission Complete Clear Flag
* @arg @ref UART_CLEAR_LBDF LIN Break Detection Clear Flag
* @arg @ref UART_CLEAR_CTSF CTS Interrupt Clear Flag
* @arg @ref UART_CLEAR_RTOF Receiver Time Out Clear Flag
* @arg @ref UART_CLEAR_EOBF End Of Block Clear Flag
* @arg @ref UART_CLEAR_CMF Character Match Clear Flag
* @arg @ref UART_CLEAR_WUF Wake Up from stop mode Clear Flag
* @retval None
*/
#define __HAL_UART_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->ICR = (uint32_t)(__IT_CLEAR__))
/** @brief Set a specific UART request flag.
* @param __HANDLE__: specifies the UART Handle.
* @param __REQ__: specifies the request flag to set
* This parameter can be one of the following values:
* @arg @ref UART_AUTOBAUD_REQUEST Auto-Baud Rate Request
* @arg @ref UART_SENDBREAK_REQUEST Send Break Request
* @arg @ref UART_MUTE_MODE_REQUEST Mute Mode Request
* @arg @ref UART_RXDATA_FLUSH_REQUEST Receive Data flush Request
* @arg @ref UART_TXDATA_FLUSH_REQUEST Transmit data flush Request
* @retval None
*/
#define __HAL_UART_SEND_REQ(__HANDLE__, __REQ__) ((__HANDLE__)->Instance->RQR |= (uint32_t)(__REQ__))
/** @brief Enable the UART one bit sample method.
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_ONE_BIT_SAMPLE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT)
/** @brief Disable the UART one bit sample method.
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_ONE_BIT_SAMPLE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3 &= (uint32_t)~((uint32_t)USART_CR3_ONEBIT))
/** @brief Enable UART.
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE)
/** @brief Disable UART.
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE)
/** @brief Enable CTS flow control.
* @note This macro allows to enable CTS hardware flow control for a given UART instance,
* without need to call HAL_UART_Init() function.
* As involving direct access to UART registers, usage of this macro should be fully endorsed by user.
* @note As macro is expected to be used for modifying CTS Hw flow control feature activation, without need
* for USART instance Deinit/Init, following conditions for macro call should be fulfilled :
* - UART instance should have already been initialised (through call of HAL_UART_Init() )
* - macro could only be called when corresponding UART instance is disabled (i.e. __HAL_UART_DISABLE(__HANDLE__))
* and should be followed by an Enable macro (i.e. __HAL_UART_ENABLE(__HANDLE__)).
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_HWCONTROL_CTS_ENABLE(__HANDLE__) \
do{ \
SET_BIT((__HANDLE__)->Instance->CR3, USART_CR3_CTSE); \
(__HANDLE__)->Init.HwFlowCtl |= USART_CR3_CTSE; \
} while(0)
/** @brief Disable CTS flow control.
* @note This macro allows to disable CTS hardware flow control for a given UART instance,
* without need to call HAL_UART_Init() function.
* As involving direct access to UART registers, usage of this macro should be fully endorsed by user.
* @note As macro is expected to be used for modifying CTS Hw flow control feature activation, without need
* for USART instance Deinit/Init, following conditions for macro call should be fulfilled :
* - UART instance should have already been initialised (through call of HAL_UART_Init() )
* - macro could only be called when corresponding UART instance is disabled (i.e. __HAL_UART_DISABLE(__HANDLE__))
* and should be followed by an Enable macro (i.e. __HAL_UART_ENABLE(__HANDLE__)).
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_HWCONTROL_CTS_DISABLE(__HANDLE__) \
do{ \
CLEAR_BIT((__HANDLE__)->Instance->CR3, USART_CR3_CTSE); \
(__HANDLE__)->Init.HwFlowCtl &= ~(USART_CR3_CTSE); \
} while(0)
/** @brief Enable RTS flow control.
* @note This macro allows to enable RTS hardware flow control for a given UART instance,
* without need to call HAL_UART_Init() function.
* As involving direct access to UART registers, usage of this macro should be fully endorsed by user.
* @note As macro is expected to be used for modifying RTS Hw flow control feature activation, without need
* for USART instance Deinit/Init, following conditions for macro call should be fulfilled :
* - UART instance should have already been initialised (through call of HAL_UART_Init() )
* - macro could only be called when corresponding UART instance is disabled (i.e. __HAL_UART_DISABLE(__HANDLE__))
* and should be followed by an Enable macro (i.e. __HAL_UART_ENABLE(__HANDLE__)).
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_HWCONTROL_RTS_ENABLE(__HANDLE__) \
do{ \
SET_BIT((__HANDLE__)->Instance->CR3, USART_CR3_RTSE); \
(__HANDLE__)->Init.HwFlowCtl |= USART_CR3_RTSE; \
} while(0)
/** @brief Disable RTS flow control.
* @note This macro allows to disable RTS hardware flow control for a given UART instance,
* without need to call HAL_UART_Init() function.
* As involving direct access to UART registers, usage of this macro should be fully endorsed by user.
* @note As macro is expected to be used for modifying RTS Hw flow control feature activation, without need
* for USART instance Deinit/Init, following conditions for macro call should be fulfilled :
* - UART instance should have already been initialised (through call of HAL_UART_Init() )
* - macro could only be called when corresponding UART instance is disabled (i.e. __HAL_UART_DISABLE(__HANDLE__))
* and should be followed by an Enable macro (i.e. __HAL_UART_ENABLE(__HANDLE__)).
* @param __HANDLE__: specifies the UART Handle.
* @retval None
*/
#define __HAL_UART_HWCONTROL_RTS_DISABLE(__HANDLE__) \
do{ \
CLEAR_BIT((__HANDLE__)->Instance->CR3, USART_CR3_RTSE);\
(__HANDLE__)->Init.HwFlowCtl &= ~(USART_CR3_RTSE); \
} while(0)
/**
* @}
*/
/* Private macros --------------------------------------------------------*/
/** @defgroup UART_Private_Macros UART Private Macros
* @{
*/
/** @brief BRR division operation to set BRR register with LPUART.
* @param __PCLK__: LPUART clock.
* @param __BAUD__: Baud rate set by the user.
* @retval Division result
*/
#define UART_DIV_LPUART(__PCLK__, __BAUD__) ((((uint64_t)(__PCLK__)*256) + ((__BAUD__)/2)) / (__BAUD__))
/** @brief BRR division operation to set BRR register in 8-bit oversampling mode.
* @param __PCLK__: UART clock.
* @param __BAUD__: Baud rate set by the user.
* @retval Division result
*/
#define UART_DIV_SAMPLING8(__PCLK__, __BAUD__) ((((__PCLK__)*2) + ((__BAUD__)/2)) / (__BAUD__))
/** @brief BRR division operation to set BRR register in 16-bit oversampling mode.
* @param __PCLK__: UART clock.
* @param __BAUD__: Baud rate set by the user.
* @retval Division result
*/
#define UART_DIV_SAMPLING16(__PCLK__, __BAUD__) (((__PCLK__) + ((__BAUD__)/2)) / (__BAUD__))
/** @brief Check whether or not UART instance is Low Power UART.
* @param __HANDLE__: specifies the UART Handle.
* @retval SET (instance is LPUART) or RESET (instance isn't LPUART)
*/
#define UART_INSTANCE_LOWPOWER(__HANDLE__) (((__HANDLE__)->Instance == LPUART1) ? SET : RESET )
/** @brief Check UART Baud rate.
* @param __BAUDRATE__: Baudrate specified by the user.
* The maximum Baud Rate is derived from the maximum clock on L4 (i.e. 80 MHz)
* divided by the smallest oversampling used on the USART (i.e. 8)
* @retval SET (__BAUDRATE__ is valid) or RESET (__BAUDRATE__ is invalid)
*/
#define IS_UART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) < 10000001)
/** @brief Check UART assertion time.
* @param __TIME__: 5-bit value assertion time.
* @retval Test result (TRUE or FALSE).
*/
#define IS_UART_ASSERTIONTIME(__TIME__) ((__TIME__) <= 0x1F)
/** @brief Check UART deassertion time.
* @param __TIME__: 5-bit value deassertion time.
* @retval Test result (TRUE or FALSE).
*/
#define IS_UART_DEASSERTIONTIME(__TIME__) ((__TIME__) <= 0x1F)
/**
* @brief Ensure that UART frame number of stop bits is valid.
* @param __STOPBITS__: UART frame number of stop bits.
* @retval SET (__STOPBITS__ is valid) or RESET (__STOPBITS__ is invalid)
*/
#define IS_UART_STOPBITS(__STOPBITS__) (((__STOPBITS__) == UART_STOPBITS_0_5) || \
((__STOPBITS__) == UART_STOPBITS_1) || \
((__STOPBITS__) == UART_STOPBITS_1_5) || \
((__STOPBITS__) == UART_STOPBITS_2))
/**
* @brief Ensure that LPUART frame number of stop bits is valid.
* @param __STOPBITS__: LPUART frame number of stop bits.
* @retval SET (__STOPBITS__ is valid) or RESET (__STOPBITS__ is invalid)
*/
#define IS_LPUART_STOPBITS(__STOPBITS__) (((__STOPBITS__) == UART_STOPBITS_1) || \
((__STOPBITS__) == UART_STOPBITS_2))
/**
* @brief Ensure that UART frame parity is valid.
* @param __PARITY__: UART frame parity.
* @retval SET (__PARITY__ is valid) or RESET (__PARITY__ is invalid)
*/
#define IS_UART_PARITY(__PARITY__) (((__PARITY__) == UART_PARITY_NONE) || \
((__PARITY__) == UART_PARITY_EVEN) || \
((__PARITY__) == UART_PARITY_ODD))
/**
* @brief Ensure that UART hardware flow control is valid.
* @param __CONTROL__: UART hardware flow control.
* @retval SET (__CONTROL__ is valid) or RESET (__CONTROL__ is invalid)
*/
#define IS_UART_HARDWARE_FLOW_CONTROL(__CONTROL__)\
(((__CONTROL__) == UART_HWCONTROL_NONE) || \
((__CONTROL__) == UART_HWCONTROL_RTS) || \
((__CONTROL__) == UART_HWCONTROL_CTS) || \
((__CONTROL__) == UART_HWCONTROL_RTS_CTS))
/**
* @brief Ensure that UART communication mode is valid.
* @param __MODE__: UART communication mode.
* @retval SET (__MODE__ is valid) or RESET (__MODE__ is invalid)
*/
#define IS_UART_MODE(__MODE__) ((((__MODE__) & (~((uint32_t)(UART_MODE_TX_RX)))) == (uint32_t)0x00) && ((__MODE__) != (uint32_t)0x00))
/**
* @brief Ensure that UART state is valid.
* @param __STATE__: UART state.
* @retval SET (__STATE__ is valid) or RESET (__STATE__ is invalid)
*/
#define IS_UART_STATE(__STATE__) (((__STATE__) == UART_STATE_DISABLE) || \
((__STATE__) == UART_STATE_ENABLE))
/**
* @brief Ensure that UART oversampling is valid.
* @param __SAMPLING__: UART oversampling.
* @retval SET (__SAMPLING__ is valid) or RESET (__SAMPLING__ is invalid)
*/
#define IS_UART_OVERSAMPLING(__SAMPLING__) (((__SAMPLING__) == UART_OVERSAMPLING_16) || \
((__SAMPLING__) == UART_OVERSAMPLING_8))
/**
* @brief Ensure that UART frame sampling is valid.
* @param __ONEBIT__: UART frame sampling.
* @retval SET (__ONEBIT__ is valid) or RESET (__ONEBIT__ is invalid)
*/
#define IS_UART_ONE_BIT_SAMPLE(__ONEBIT__) (((__ONEBIT__) == UART_ONE_BIT_SAMPLE_DISABLE) || \
((__ONEBIT__) == UART_ONE_BIT_SAMPLE_ENABLE))
/**
* @brief Ensure that UART auto Baud rate detection mode is valid.
* @param __MODE__: UART auto Baud rate detection mode.
* @retval SET (__MODE__ is valid) or RESET (__MODE__ is invalid)
*/
#define IS_UART_ADVFEATURE_AUTOBAUDRATEMODE(__MODE__) (((__MODE__) == UART_ADVFEATURE_AUTOBAUDRATE_ONSTARTBIT) || \
((__MODE__) == UART_ADVFEATURE_AUTOBAUDRATE_ONFALLINGEDGE) || \
((__MODE__) == UART_ADVFEATURE_AUTOBAUDRATE_ON0X7FFRAME) || \
((__MODE__) == UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME))
/**
* @brief Ensure that UART receiver timeout setting is valid.
* @param __TIMEOUT__: UART receiver timeout setting.
* @retval SET (__TIMEOUT__ is valid) or RESET (__TIMEOUT__ is invalid)
*/
#define IS_UART_RECEIVER_TIMEOUT(__TIMEOUT__) (((__TIMEOUT__) == UART_RECEIVER_TIMEOUT_DISABLE) || \
((__TIMEOUT__) == UART_RECEIVER_TIMEOUT_ENABLE))
/**
* @brief Ensure that UART LIN state is valid.
* @param __LIN__: UART LIN state.
* @retval SET (__LIN__ is valid) or RESET (__LIN__ is invalid)
*/
#define IS_UART_LIN(__LIN__) (((__LIN__) == UART_LIN_DISABLE) || \
((__LIN__) == UART_LIN_ENABLE))
/**
* @brief Ensure that UART LIN break detection length is valid.
* @param __LENGTH__: UART LIN break detection length.
* @retval SET (__LENGTH__ is valid) or RESET (__LENGTH__ is invalid)
*/
#define IS_UART_LIN_BREAK_DETECT_LENGTH(__LENGTH__) (((__LENGTH__) == UART_LINBREAKDETECTLENGTH_10B) || \
((__LENGTH__) == UART_LINBREAKDETECTLENGTH_11B))
/**
* @brief Ensure that UART DMA TX state is valid.
* @param __DMATX__: UART DMA TX state.
* @retval SET (__DMATX__ is valid) or RESET (__DMATX__ is invalid)
*/
#define IS_UART_DMA_TX(__DMATX__) (((__DMATX__) == UART_DMA_TX_DISABLE) || \
((__DMATX__) == UART_DMA_TX_ENABLE))
/**
* @brief Ensure that UART DMA RX state is valid.
* @param __DMARX__: UART DMA RX state.
* @retval SET (__DMARX__ is valid) or RESET (__DMARX__ is invalid)
*/
#define IS_UART_DMA_RX(__DMARX__) (((__DMARX__) == UART_DMA_RX_DISABLE) || \
((__DMARX__) == UART_DMA_RX_ENABLE))
/**
* @brief Ensure that UART half-duplex state is valid.
* @param __HDSEL__: UART half-duplex state.
* @retval SET (__HDSEL__ is valid) or RESET (__HDSEL__ is invalid)
*/
#define IS_UART_HALF_DUPLEX(__HDSEL__) (((__HDSEL__) == UART_HALF_DUPLEX_DISABLE) || \
((__HDSEL__) == UART_HALF_DUPLEX_ENABLE))
/**
* @brief Ensure that UART wake-up method is valid.
* @param __WAKEUP__: UART wake-up method .
* @retval SET (__WAKEUP__ is valid) or RESET (__WAKEUP__ is invalid)
*/
#define IS_UART_WAKEUPMETHOD(__WAKEUP__) (((__WAKEUP__) == UART_WAKEUPMETHOD_IDLELINE) || \
((__WAKEUP__) == UART_WAKEUPMETHOD_ADDRESSMARK))
/**
* @brief Ensure that UART request parameter is valid.
* @param __PARAM__: UART request parameter.
* @retval SET (__PARAM__ is valid) or RESET (__PARAM__ is invalid)
*/
#define IS_UART_REQUEST_PARAMETER(__PARAM__) (((__PARAM__) == UART_AUTOBAUD_REQUEST) || \
((__PARAM__) == UART_SENDBREAK_REQUEST) || \
((__PARAM__) == UART_MUTE_MODE_REQUEST) || \
((__PARAM__) == UART_RXDATA_FLUSH_REQUEST) || \
((__PARAM__) == UART_TXDATA_FLUSH_REQUEST))
/**
* @brief Ensure that UART advanced features initialization is valid.
* @param __INIT__: UART advanced features initialization.
* @retval SET (__INIT__ is valid) or RESET (__INIT__ is invalid)
*/
#define IS_UART_ADVFEATURE_INIT(__INIT__) ((__INIT__) <= (UART_ADVFEATURE_NO_INIT | \
UART_ADVFEATURE_TXINVERT_INIT | \
UART_ADVFEATURE_RXINVERT_INIT | \
UART_ADVFEATURE_DATAINVERT_INIT | \
UART_ADVFEATURE_SWAP_INIT | \
UART_ADVFEATURE_RXOVERRUNDISABLE_INIT | \
UART_ADVFEATURE_DMADISABLEONERROR_INIT | \
UART_ADVFEATURE_AUTOBAUDRATE_INIT | \
UART_ADVFEATURE_MSBFIRST_INIT))
/**
* @brief Ensure that UART frame TX inversion setting is valid.
* @param __TXINV__: UART frame TX inversion setting.
* @retval SET (__TXINV__ is valid) or RESET (__TXINV__ is invalid)
*/
#define IS_UART_ADVFEATURE_TXINV(__TXINV__) (((__TXINV__) == UART_ADVFEATURE_TXINV_DISABLE) || \
((__TXINV__) == UART_ADVFEATURE_TXINV_ENABLE))
/**
* @brief Ensure that UART frame RX inversion setting is valid.
* @param __RXINV__: UART frame RX inversion setting.
* @retval SET (__RXINV__ is valid) or RESET (__RXINV__ is invalid)
*/
#define IS_UART_ADVFEATURE_RXINV(__RXINV__) (((__RXINV__) == UART_ADVFEATURE_RXINV_DISABLE) || \
((__RXINV__) == UART_ADVFEATURE_RXINV_ENABLE))
/**
* @brief Ensure that UART frame data inversion setting is valid.
* @param __DATAINV__: UART frame data inversion setting.
* @retval SET (__DATAINV__ is valid) or RESET (__DATAINV__ is invalid)
*/
#define IS_UART_ADVFEATURE_DATAINV(__DATAINV__) (((__DATAINV__) == UART_ADVFEATURE_DATAINV_DISABLE) || \
((__DATAINV__) == UART_ADVFEATURE_DATAINV_ENABLE))
/**
* @brief Ensure that UART frame RX/TX pins swap setting is valid.
* @param __SWAP__: UART frame RX/TX pins swap setting.
* @retval SET (__SWAP__ is valid) or RESET (__SWAP__ is invalid)
*/
#define IS_UART_ADVFEATURE_SWAP(__SWAP__) (((__SWAP__) == UART_ADVFEATURE_SWAP_DISABLE) || \
((__SWAP__) == UART_ADVFEATURE_SWAP_ENABLE))
/**
* @brief Ensure that UART frame overrun setting is valid.
* @param __OVERRUN__: UART frame overrun setting.
* @retval SET (__OVERRUN__ is valid) or RESET (__OVERRUN__ is invalid)
*/
#define IS_UART_OVERRUN(__OVERRUN__) (((__OVERRUN__) == UART_ADVFEATURE_OVERRUN_ENABLE) || \
((__OVERRUN__) == UART_ADVFEATURE_OVERRUN_DISABLE))
/**
* @brief Ensure that UART auto Baud rate state is valid.
* @param __AUTOBAUDRATE__: UART auto Baud rate state.
* @retval SET (__AUTOBAUDRATE__ is valid) or RESET (__AUTOBAUDRATE__ is invalid)
*/
#define IS_UART_ADVFEATURE_AUTOBAUDRATE(__AUTOBAUDRATE__) (((__AUTOBAUDRATE__) == UART_ADVFEATURE_AUTOBAUDRATE_DISABLE) || \
((__AUTOBAUDRATE__) == UART_ADVFEATURE_AUTOBAUDRATE_ENABLE))
/**
* @brief Ensure that UART DMA enabling or disabling on error setting is valid.
* @param __DMA__: UART DMA enabling or disabling on error setting.
* @retval SET (__DMA__ is valid) or RESET (__DMA__ is invalid)
*/
#define IS_UART_ADVFEATURE_DMAONRXERROR(__DMA__) (((__DMA__) == UART_ADVFEATURE_DMA_ENABLEONRXERROR) || \
((__DMA__) == UART_ADVFEATURE_DMA_DISABLEONRXERROR))
/**
* @brief Ensure that UART frame MSB first setting is valid.
* @param __MSBFIRST__: UART frame MSB first setting.
* @retval SET (__MSBFIRST__ is valid) or RESET (__MSBFIRST__ is invalid)
*/
#define IS_UART_ADVFEATURE_MSBFIRST(__MSBFIRST__) (((__MSBFIRST__) == UART_ADVFEATURE_MSBFIRST_DISABLE) || \
((__MSBFIRST__) == UART_ADVFEATURE_MSBFIRST_ENABLE))
/**
* @brief Ensure that UART stop mode state is valid.
* @param __STOPMODE__: UART stop mode state.
* @retval SET (__STOPMODE__ is valid) or RESET (__STOPMODE__ is invalid)
*/
#define IS_UART_ADVFEATURE_STOPMODE(__STOPMODE__) (((__STOPMODE__) == UART_ADVFEATURE_STOPMODE_DISABLE) || \
((__STOPMODE__) == UART_ADVFEATURE_STOPMODE_ENABLE))
/**
* @brief Ensure that UART mute mode state is valid.
* @param __MUTE__: UART mute mode state.
* @retval SET (__MUTE__ is valid) or RESET (__MUTE__ is invalid)
*/
#define IS_UART_MUTE_MODE(__MUTE__) (((__MUTE__) == UART_ADVFEATURE_MUTEMODE_DISABLE) || \
((__MUTE__) == UART_ADVFEATURE_MUTEMODE_ENABLE))
/**
* @brief Ensure that UART wake-up selection is valid.
* @param __WAKE__: UART wake-up selection.
* @retval SET (__WAKE__ is valid) or RESET (__WAKE__ is invalid)
*/
#define IS_UART_WAKEUP_SELECTION(__WAKE__) (((__WAKE__) == UART_WAKEUP_ON_ADDRESS) || \
((__WAKE__) == UART_WAKEUP_ON_STARTBIT) || \
((__WAKE__) == UART_WAKEUP_ON_READDATA_NONEMPTY))
/**
* @brief Ensure that UART driver enable polarity is valid.
* @param __POLARITY__: UART driver enable polarity.
* @retval SET (__POLARITY__ is valid) or RESET (__POLARITY__ is invalid)
*/
#define IS_UART_DE_POLARITY(__POLARITY__) (((__POLARITY__) == UART_DE_POLARITY_HIGH) || \
((__POLARITY__) == UART_DE_POLARITY_LOW))
/**
* @}
*/
/* Include UART HAL Extended module */
#include "stm32l4xx_hal_uart_ex.h"
/* Exported functions --------------------------------------------------------*/
/** @addtogroup UART_Exported_Functions UART Exported Functions
* @{
*/
/** @addtogroup UART_Exported_Functions_Group1 Initialization and de-initialization functions
* @{
*/
/* Initialization and de-initialization functions ****************************/
HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_HalfDuplex_Init(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_LIN_Init(UART_HandleTypeDef *huart, uint32_t BreakDetectLength);
HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethod);
HAL_StatusTypeDef HAL_UART_DeInit (UART_HandleTypeDef *huart);
void HAL_UART_MspInit(UART_HandleTypeDef *huart);
void HAL_UART_MspDeInit(UART_HandleTypeDef *huart);
/**
* @}
*/
/** @addtogroup UART_Exported_Functions_Group2 IO operation functions
* @{
*/
/* IO operation functions *****************************************************/
HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_UART_Transmit_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_UART_Transmit_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_UART_Receive_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_UART_DMAPause(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_UART_DMAResume(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_UART_DMAStop(UART_HandleTypeDef *huart);
/* Transfer Abort functions */
HAL_StatusTypeDef HAL_UART_Abort(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_UART_AbortTransmit(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_UART_AbortReceive(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_UART_Abort_IT(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_UART_AbortTransmit_IT(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_UART_AbortReceive_IT(UART_HandleTypeDef *huart);
void HAL_UART_IRQHandler(UART_HandleTypeDef *huart);
void HAL_UART_TxHalfCpltCallback(UART_HandleTypeDef *huart);
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart);
void HAL_UART_RxHalfCpltCallback(UART_HandleTypeDef *huart);
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart);
void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart);
void HAL_UART_AbortCpltCallback (UART_HandleTypeDef *huart);
void HAL_UART_AbortTransmitCpltCallback (UART_HandleTypeDef *huart);
void HAL_UART_AbortReceiveCpltCallback (UART_HandleTypeDef *huart);
/**
* @}
*/
/** @addtogroup UART_Exported_Functions_Group3 Peripheral Control functions
* @{
*/
/* Peripheral Control functions ************************************************/
HAL_StatusTypeDef HAL_LIN_SendBreak(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_MultiProcessor_EnableMuteMode(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_MultiProcessor_DisableMuteMode(UART_HandleTypeDef *huart);
void HAL_MultiProcessor_EnterMuteMode(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_HalfDuplex_EnableTransmitter(UART_HandleTypeDef *huart);
HAL_StatusTypeDef HAL_HalfDuplex_EnableReceiver(UART_HandleTypeDef *huart);
/**
* @}
*/
/** @addtogroup UART_Exported_Functions_Group4 Peripheral State and Error functions
* @{
*/
/* Peripheral State and Errors functions **************************************************/
HAL_UART_StateTypeDef HAL_UART_GetState(UART_HandleTypeDef *huart);
uint32_t HAL_UART_GetError(UART_HandleTypeDef *huart);
/**
* @}
*/
/**
* @}
*/
/* Private functions -----------------------------------------------------------*/
/** @addtogroup UART_Private_Functions UART Private Functions
* @{
*/
HAL_StatusTypeDef UART_SetConfig(UART_HandleTypeDef *huart);
HAL_StatusTypeDef UART_CheckIdleState(UART_HandleTypeDef *huart);
HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Tickstart, uint32_t Timeout);
void UART_AdvFeatureConfig(UART_HandleTypeDef *huart);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32L4xx_HAL_UART_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| approximator/SimpleSINS | firmware/cube/Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_uart.h | C | apache-2.0 | 72,598 |
using System.Collections.Generic;
using System.IO;
namespace Lucene.Net.Util
{
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.
*/
/// <summary>
/// A simple iterator interface for <seealso cref="BytesRef"/> iteration.
/// </summary>
public interface BytesRefIterator
{
/// <summary>
/// Increments the iteration to the next <seealso cref="BytesRef"/> in the iterator.
/// Returns the resulting <seealso cref="BytesRef"/> or <code>null</code> if the end of
/// the iterator is reached. The returned BytesRef may be re-used across calls
/// to next. After this method returns null, do not call it again: the results
/// are undefined.
/// </summary>
/// <returns> the next <seealso cref="BytesRef"/> in the iterator or <code>null</code> if
/// the end of the iterator is reached. </returns>
/// <exception cref="IOException"> If there is a low-level I/O error. </exception>
BytesRef Next();
/// <summary>
/// Return the <seealso cref="BytesRef"/> Comparator used to sort terms provided by the
/// iterator. this may return null if there are no items or the iterator is not
/// sorted. Callers may invoke this method many times, so it's best to cache a
/// single instance & reuse it.
/// </summary>
IComparer<BytesRef> Comparator { get; }
}
public class EmptyBytesRefIterator : BytesRefIterator
{
public static readonly BytesRefIterator Instance = new EmptyBytesRefIterator();
public BytesRef Next()
{
return null;
}
public IComparer<BytesRef> Comparator
{
get { return null; }
}
}
} | jpsullivan/lucenenet | src/Lucene.Net.Core/Util/BytesRefIterator.cs | C# | apache-2.0 | 2,570 |
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#pragma once
#include <aws/ssm/SSM_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace SSM
{
namespace Model
{
enum class MaintenanceWindowExecutionStatus
{
NOT_SET,
PENDING,
IN_PROGRESS,
SUCCESS,
FAILED,
TIMED_OUT,
CANCELLING,
CANCELLED,
SKIPPED_OVERLAPPING
};
namespace MaintenanceWindowExecutionStatusMapper
{
AWS_SSM_API MaintenanceWindowExecutionStatus GetMaintenanceWindowExecutionStatusForName(const Aws::String& name);
AWS_SSM_API Aws::String GetNameForMaintenanceWindowExecutionStatus(MaintenanceWindowExecutionStatus value);
} // namespace MaintenanceWindowExecutionStatusMapper
} // namespace Model
} // namespace SSM
} // namespace Aws
| chiaming0914/awe-cpp-sdk | aws-cpp-sdk-ssm/include/aws/ssm/model/MaintenanceWindowExecutionStatus.h | C | apache-2.0 | 1,303 |
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.2
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.badlogic.gdx.physics.bullet.extras;
import com.badlogic.gdx.physics.bullet.BulletBase;
import com.badlogic.gdx.physics.bullet.linearmath.*;
import com.badlogic.gdx.physics.bullet.collision.*;
import com.badlogic.gdx.physics.bullet.dynamics.*;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Matrix3;
import com.badlogic.gdx.math.Matrix4;
public class btWorldImporter extends BulletBase {
private long swigCPtr;
protected btWorldImporter(final String className, long cPtr, boolean cMemoryOwn) {
super(className, cPtr, cMemoryOwn);
swigCPtr = cPtr;
}
/** Construct a new btWorldImporter, normally you should not need this constructor it's intended for low-level usage. */
public btWorldImporter(long cPtr, boolean cMemoryOwn) {
this("btWorldImporter", cPtr, cMemoryOwn);
construct();
}
@Override
protected void reset(long cPtr, boolean cMemoryOwn) {
if (!destroyed)
destroy();
super.reset(swigCPtr = cPtr, cMemoryOwn);
}
public static long getCPtr(btWorldImporter obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
@Override
protected void finalize() throws Throwable {
if (!destroyed)
destroy();
super.finalize();
}
@Override protected synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
ExtrasJNI.delete_btWorldImporter(swigCPtr);
}
swigCPtr = 0;
}
super.delete();
}
public btWorldImporter(btDynamicsWorld world) {
this(ExtrasJNI.new_btWorldImporter(btDynamicsWorld.getCPtr(world), world), true);
}
public void deleteAllData() {
ExtrasJNI.btWorldImporter_deleteAllData(swigCPtr, this);
}
public void setVerboseMode(int verboseMode) {
ExtrasJNI.btWorldImporter_setVerboseMode(swigCPtr, this, verboseMode);
}
public int getVerboseMode() {
return ExtrasJNI.btWorldImporter_getVerboseMode(swigCPtr, this);
}
public int getNumCollisionShapes() {
return ExtrasJNI.btWorldImporter_getNumCollisionShapes(swigCPtr, this);
}
public btCollisionShape getCollisionShapeByIndex(int index) {
long cPtr = ExtrasJNI.btWorldImporter_getCollisionShapeByIndex(swigCPtr, this, index);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public int getNumRigidBodies() {
return ExtrasJNI.btWorldImporter_getNumRigidBodies(swigCPtr, this);
}
public btCollisionObject getRigidBodyByIndex(int index) {
return btCollisionObject.getInstance(ExtrasJNI.btWorldImporter_getRigidBodyByIndex(swigCPtr, this, index), false);
}
public int getNumConstraints() {
return ExtrasJNI.btWorldImporter_getNumConstraints(swigCPtr, this);
}
public btTypedConstraint getConstraintByIndex(int index) {
long cPtr = ExtrasJNI.btWorldImporter_getConstraintByIndex(swigCPtr, this, index);
return (cPtr == 0) ? null : new btTypedConstraint(cPtr, false);
}
public int getNumBvhs() {
return ExtrasJNI.btWorldImporter_getNumBvhs(swigCPtr, this);
}
public btOptimizedBvh getBvhByIndex(int index) {
long cPtr = ExtrasJNI.btWorldImporter_getBvhByIndex(swigCPtr, this, index);
return (cPtr == 0) ? null : new btOptimizedBvh(cPtr, false);
}
public int getNumTriangleInfoMaps() {
return ExtrasJNI.btWorldImporter_getNumTriangleInfoMaps(swigCPtr, this);
}
public btTriangleInfoMap getTriangleInfoMapByIndex(int index) {
long cPtr = ExtrasJNI.btWorldImporter_getTriangleInfoMapByIndex(swigCPtr, this, index);
return (cPtr == 0) ? null : new btTriangleInfoMap(cPtr, false);
}
public btCollisionShape getCollisionShapeByName(String name) {
long cPtr = ExtrasJNI.btWorldImporter_getCollisionShapeByName(swigCPtr, this, name);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public btRigidBody getRigidBodyByName(String name) {
long cPtr = ExtrasJNI.btWorldImporter_getRigidBodyByName(swigCPtr, this, name);
return (cPtr == 0) ? null : new btRigidBody(cPtr, false);
}
public btTypedConstraint getConstraintByName(String name) {
long cPtr = ExtrasJNI.btWorldImporter_getConstraintByName(swigCPtr, this, name);
return (cPtr == 0) ? null : new btTypedConstraint(cPtr, false);
}
public String getNameForPointer(long ptr) {
return ExtrasJNI.btWorldImporter_getNameForPointer__SWIG_0(swigCPtr, this, ptr);
}
public void setDynamicsWorldInfo(Vector3 gravity, btContactSolverInfo solverInfo) {
ExtrasJNI.btWorldImporter_setDynamicsWorldInfo(swigCPtr, this, gravity, btContactSolverInfo.getCPtr(solverInfo), solverInfo);
}
public btRigidBody createRigidBody(boolean isDynamic, float mass, Matrix4 startTransform, btCollisionShape shape, String bodyName) {
long cPtr = ExtrasJNI.btWorldImporter_createRigidBody(swigCPtr, this, isDynamic, mass, startTransform, btCollisionShape.getCPtr(shape), shape, bodyName);
return (cPtr == 0) ? null : new btRigidBody(cPtr, false);
}
public btCollisionObject createCollisionObject(Matrix4 startTransform, btCollisionShape shape, String bodyName) {
return btCollisionObject.getInstance(ExtrasJNI.btWorldImporter_createCollisionObject(swigCPtr, this, startTransform, btCollisionShape.getCPtr(shape), shape, bodyName), false);
}
public btCollisionShape createPlaneShape(Vector3 planeNormal, float planeConstant) {
long cPtr = ExtrasJNI.btWorldImporter_createPlaneShape(swigCPtr, this, planeNormal, planeConstant);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public btCollisionShape createBoxShape(Vector3 halfExtents) {
long cPtr = ExtrasJNI.btWorldImporter_createBoxShape(swigCPtr, this, halfExtents);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public btCollisionShape createSphereShape(float radius) {
long cPtr = ExtrasJNI.btWorldImporter_createSphereShape(swigCPtr, this, radius);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public btCollisionShape createCapsuleShapeX(float radius, float height) {
long cPtr = ExtrasJNI.btWorldImporter_createCapsuleShapeX(swigCPtr, this, radius, height);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public btCollisionShape createCapsuleShapeY(float radius, float height) {
long cPtr = ExtrasJNI.btWorldImporter_createCapsuleShapeY(swigCPtr, this, radius, height);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public btCollisionShape createCapsuleShapeZ(float radius, float height) {
long cPtr = ExtrasJNI.btWorldImporter_createCapsuleShapeZ(swigCPtr, this, radius, height);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public btCollisionShape createCylinderShapeX(float radius, float height) {
long cPtr = ExtrasJNI.btWorldImporter_createCylinderShapeX(swigCPtr, this, radius, height);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public btCollisionShape createCylinderShapeY(float radius, float height) {
long cPtr = ExtrasJNI.btWorldImporter_createCylinderShapeY(swigCPtr, this, radius, height);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public btCollisionShape createCylinderShapeZ(float radius, float height) {
long cPtr = ExtrasJNI.btWorldImporter_createCylinderShapeZ(swigCPtr, this, radius, height);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public btTriangleIndexVertexArray createTriangleMeshContainer() {
long cPtr = ExtrasJNI.btWorldImporter_createTriangleMeshContainer(swigCPtr, this);
return (cPtr == 0) ? null : new btTriangleIndexVertexArray(cPtr, false);
}
public btBvhTriangleMeshShape createBvhTriangleMeshShape(btStridingMeshInterface trimesh, btOptimizedBvh bvh) {
long cPtr = ExtrasJNI.btWorldImporter_createBvhTriangleMeshShape(swigCPtr, this, btStridingMeshInterface.getCPtr(trimesh), trimesh, btOptimizedBvh.getCPtr(bvh), bvh);
return (cPtr == 0) ? null : new btBvhTriangleMeshShape(cPtr, false);
}
public btCollisionShape createConvexTriangleMeshShape(btStridingMeshInterface trimesh) {
long cPtr = ExtrasJNI.btWorldImporter_createConvexTriangleMeshShape(swigCPtr, this, btStridingMeshInterface.getCPtr(trimesh), trimesh);
return (cPtr == 0) ? null : btCollisionShape.newDerivedObject(cPtr, false);
}
public SWIGTYPE_p_btGImpactMeshShape createGimpactShape(btStridingMeshInterface trimesh) {
long cPtr = ExtrasJNI.btWorldImporter_createGimpactShape(swigCPtr, this, btStridingMeshInterface.getCPtr(trimesh), trimesh);
return (cPtr == 0) ? null : new SWIGTYPE_p_btGImpactMeshShape(cPtr, false);
}
public btStridingMeshInterfaceData createStridingMeshInterfaceData(btStridingMeshInterfaceData interfaceData) {
long cPtr = ExtrasJNI.btWorldImporter_createStridingMeshInterfaceData(swigCPtr, this, btStridingMeshInterfaceData.getCPtr(interfaceData), interfaceData);
return (cPtr == 0) ? null : new btStridingMeshInterfaceData(cPtr, false);
}
public btConvexHullShape createConvexHullShape() {
long cPtr = ExtrasJNI.btWorldImporter_createConvexHullShape(swigCPtr, this);
return (cPtr == 0) ? null : new btConvexHullShape(cPtr, false);
}
public btCompoundShape createCompoundShape() {
long cPtr = ExtrasJNI.btWorldImporter_createCompoundShape(swigCPtr, this);
return (cPtr == 0) ? null : new btCompoundShape(cPtr, false);
}
public btScaledBvhTriangleMeshShape createScaledTrangleMeshShape(btBvhTriangleMeshShape meshShape, Vector3 localScalingbtBvhTriangleMeshShape) {
long cPtr = ExtrasJNI.btWorldImporter_createScaledTrangleMeshShape(swigCPtr, this, btBvhTriangleMeshShape.getCPtr(meshShape), meshShape, localScalingbtBvhTriangleMeshShape);
return (cPtr == 0) ? null : new btScaledBvhTriangleMeshShape(cPtr, false);
}
public btMultiSphereShape createMultiSphereShape(btVector3 positions, java.nio.FloatBuffer radi, int numSpheres) {
assert radi.isDirect() : "Buffer must be allocated direct.";
{
long cPtr = ExtrasJNI.btWorldImporter_createMultiSphereShape(swigCPtr, this, btVector3.getCPtr(positions), positions, radi, numSpheres);
return (cPtr == 0) ? null : new btMultiSphereShape(cPtr, false);
}
}
public btTriangleIndexVertexArray createMeshInterface(btStridingMeshInterfaceData meshData) {
long cPtr = ExtrasJNI.btWorldImporter_createMeshInterface(swigCPtr, this, btStridingMeshInterfaceData.getCPtr(meshData), meshData);
return (cPtr == 0) ? null : new btTriangleIndexVertexArray(cPtr, false);
}
public btOptimizedBvh createOptimizedBvh() {
long cPtr = ExtrasJNI.btWorldImporter_createOptimizedBvh(swigCPtr, this);
return (cPtr == 0) ? null : new btOptimizedBvh(cPtr, false);
}
public btTriangleInfoMap createTriangleInfoMap() {
long cPtr = ExtrasJNI.btWorldImporter_createTriangleInfoMap(swigCPtr, this);
return (cPtr == 0) ? null : new btTriangleInfoMap(cPtr, false);
}
public btPoint2PointConstraint createPoint2PointConstraint(btRigidBody rbA, btRigidBody rbB, Vector3 pivotInA, Vector3 pivotInB) {
long cPtr = ExtrasJNI.btWorldImporter_createPoint2PointConstraint__SWIG_0(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, pivotInA, pivotInB);
return (cPtr == 0) ? null : new btPoint2PointConstraint(cPtr, false);
}
public btPoint2PointConstraint createPoint2PointConstraint(btRigidBody rbA, Vector3 pivotInA) {
long cPtr = ExtrasJNI.btWorldImporter_createPoint2PointConstraint__SWIG_1(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, pivotInA);
return (cPtr == 0) ? null : new btPoint2PointConstraint(cPtr, false);
}
public btHingeConstraint createHingeConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 rbAFrame, Matrix4 rbBFrame, boolean useReferenceFrameA) {
long cPtr = ExtrasJNI.btWorldImporter_createHingeConstraint__SWIG_0(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, rbAFrame, rbBFrame, useReferenceFrameA);
return (cPtr == 0) ? null : new btHingeConstraint(cPtr, false);
}
public btHingeConstraint createHingeConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 rbAFrame, Matrix4 rbBFrame) {
long cPtr = ExtrasJNI.btWorldImporter_createHingeConstraint__SWIG_1(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, rbAFrame, rbBFrame);
return (cPtr == 0) ? null : new btHingeConstraint(cPtr, false);
}
public btHingeConstraint createHingeConstraint(btRigidBody rbA, Matrix4 rbAFrame, boolean useReferenceFrameA) {
long cPtr = ExtrasJNI.btWorldImporter_createHingeConstraint__SWIG_2(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, rbAFrame, useReferenceFrameA);
return (cPtr == 0) ? null : new btHingeConstraint(cPtr, false);
}
public btHingeConstraint createHingeConstraint(btRigidBody rbA, Matrix4 rbAFrame) {
long cPtr = ExtrasJNI.btWorldImporter_createHingeConstraint__SWIG_3(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, rbAFrame);
return (cPtr == 0) ? null : new btHingeConstraint(cPtr, false);
}
public btConeTwistConstraint createConeTwistConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 rbAFrame, Matrix4 rbBFrame) {
long cPtr = ExtrasJNI.btWorldImporter_createConeTwistConstraint__SWIG_0(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, rbAFrame, rbBFrame);
return (cPtr == 0) ? null : new btConeTwistConstraint(cPtr, false);
}
public btConeTwistConstraint createConeTwistConstraint(btRigidBody rbA, Matrix4 rbAFrame) {
long cPtr = ExtrasJNI.btWorldImporter_createConeTwistConstraint__SWIG_1(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, rbAFrame);
return (cPtr == 0) ? null : new btConeTwistConstraint(cPtr, false);
}
public btGeneric6DofConstraint createGeneric6DofConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 frameInA, Matrix4 frameInB, boolean useLinearReferenceFrameA) {
long cPtr = ExtrasJNI.btWorldImporter_createGeneric6DofConstraint__SWIG_0(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, frameInA, frameInB, useLinearReferenceFrameA);
return (cPtr == 0) ? null : new btGeneric6DofConstraint(cPtr, false);
}
public btGeneric6DofConstraint createGeneric6DofConstraint(btRigidBody rbB, Matrix4 frameInB, boolean useLinearReferenceFrameB) {
long cPtr = ExtrasJNI.btWorldImporter_createGeneric6DofConstraint__SWIG_1(swigCPtr, this, btRigidBody.getCPtr(rbB), rbB, frameInB, useLinearReferenceFrameB);
return (cPtr == 0) ? null : new btGeneric6DofConstraint(cPtr, false);
}
public btGeneric6DofSpringConstraint createGeneric6DofSpringConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 frameInA, Matrix4 frameInB, boolean useLinearReferenceFrameA) {
long cPtr = ExtrasJNI.btWorldImporter_createGeneric6DofSpringConstraint(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, frameInA, frameInB, useLinearReferenceFrameA);
return (cPtr == 0) ? null : new btGeneric6DofSpringConstraint(cPtr, false);
}
public btSliderConstraint createSliderConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 frameInA, Matrix4 frameInB, boolean useLinearReferenceFrameA) {
long cPtr = ExtrasJNI.btWorldImporter_createSliderConstraint__SWIG_0(swigCPtr, this, btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, frameInA, frameInB, useLinearReferenceFrameA);
return (cPtr == 0) ? null : new btSliderConstraint(cPtr, false);
}
public btSliderConstraint createSliderConstraint(btRigidBody rbB, Matrix4 frameInB, boolean useLinearReferenceFrameA) {
long cPtr = ExtrasJNI.btWorldImporter_createSliderConstraint__SWIG_1(swigCPtr, this, btRigidBody.getCPtr(rbB), rbB, frameInB, useLinearReferenceFrameA);
return (cPtr == 0) ? null : new btSliderConstraint(cPtr, false);
}
}
| jiachenning/libgdx | extensions/gdx-bullet/jni/swig-src/extras/com/badlogic/gdx/physics/bullet/extras/btWorldImporter.java | Java | apache-2.0 | 16,282 |
\set ON_ERROR_STOP true
TRUNCATE failed_events;
UPDATE person_address
SET value = concat('address1-', person_id)
FROM address_part
WHERE part_name = 'level1' AND person_address.address_part_id = address_part.id
AND person_address.value IS NOT NULL;
UPDATE patient_identity
SET identity_data = concat('PRIMARYRELATIVE-', patient_id)
FROM patient_identity_type
WHERE patient_identity_type.id = patient_identity.identity_type_id
AND patient_identity_type.identity_type = 'PRIMARYRELATIVE';
UPDATE system_user
SET login_name = concat('user-', login_user.id)
FROM login_user
WHERE login_user.login_name = system_user.login_name AND system_user.login_name NOT IN ('admin');
UPDATE login_user
SET login_name = concat('user-', id)
WHERE login_name NOT IN ('admin');
-- Set every one's password as adminADMIN!
UPDATE login_user
SET password = 'n2OrWHXVm/BQsgd1YZJoCA==';
UPDATE system_user
SET login_name = concat('userwologin-', id)
WHERE login_name NOT IN (Select login_name from login_user);
UPDATE system_user
SET first_name = login_name,
last_name = login_name; | Bhamni/utilities | deprecated/scripts/bahmni-tools/anonymise/deidentify_openelis.sql | SQL | apache-2.0 | 1,069 |
import { EventEmitter, OnInit, TemplateRef, OnChanges, SimpleChanges } from '@angular/core';
import { NgbRatingConfig } from './rating-config';
/**
* Context for the custom star display template
*/
export interface StarTemplateContext {
/**
* Star fill percentage. An integer value between 0 and 100
*/
fill: number;
}
/**
* Rating directive that will take care of visualising a star rating bar.
*/
export declare class NgbRating implements OnInit, OnChanges {
private _oldRate;
range: number[];
/**
* Maximal rating that can be given using this widget.
*/
max: number;
/**
* Current rating. Can be a decimal value like 3.75
*/
rate: number;
/**
* A flag indicating if rating can be updated.
*/
readonly: boolean;
/**
* A template to override star display.
* Alternatively put a <template> as the only child of <ngb-rating> element
*/
starTemplate: TemplateRef<StarTemplateContext>;
/**
* An event fired when a user is hovering over a given rating.
* Event's payload equals to the rating being hovered over.
*/
hover: EventEmitter<number>;
/**
* An event fired when a user stops hovering over a given rating.
* Event's payload equals to the rating of the last item being hovered over.
*/
leave: EventEmitter<number>;
/**
* An event fired when a user selects a new rating.
* Event's payload equals to the newly selected rating.
*/
rateChange: EventEmitter<number>;
constructor(config: NgbRatingConfig);
ariaValueText(): string;
enter(value: number): void;
handleKeyDown(event: KeyboardEvent): void;
getFillValue(index: number): number;
ngOnChanges(changes: SimpleChanges): void;
ngOnInit(): void;
reset(): void;
update(value: number): void;
}
| TanHaoran/Report | node_modules/@ng-bootstrap/ng-bootstrap/rating/rating.d.ts | TypeScript | apache-2.0 | 1,854 |
<!DOCTYPE html >
<html>
<head>
<title>Remove - org.widok.BufSet.Delta.Remove</title>
<meta name="description" content="Remove - org.widok.BufSet.Delta.Remove" />
<meta name="keywords" content="Remove org.widok.BufSet.Delta.Remove" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript" src="../../lib/jquery.js" id="jquery-js"></script>
<script type="text/javascript" src="../../lib/jquery-ui.js"></script>
<script type="text/javascript" src="../../lib/template.js"></script>
<script type="text/javascript" src="../../lib/tools.tooltip.js"></script>
<script type="text/javascript">
if(top === self) {
var url = '../../index.html';
var hash = 'org.widok.BufSet$$Delta$$Remove';
var anchor = window.location.hash;
var anchor_opt = '';
if (anchor.length >= 1)
anchor_opt = '@' + anchor.substring(1);
window.location.href = url + '#' + hash + anchor_opt;
}
</script>
</head>
<body class="type">
<div id="definition">
<img src="../../lib/class_big.png" />
<p id="owner"><a href="../package.html" class="extype" name="org">org</a>.<a href="package.html" class="extype" name="org.widok">widok</a>.<a href="BufSet$.html" class="extype" name="org.widok.BufSet">BufSet</a>.<a href="BufSet$$Delta$.html" class="extype" name="org.widok.BufSet.Delta">Delta</a></p>
<h1>Remove</h1><h3><span class="morelinks"><div>Related Doc:
<a href="BufSet$$Delta$.html" class="extype" name="org.widok.BufSet.Delta">package Delta</a>
</div></span></h3><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">case class</span>
</span>
<span class="symbol">
<span class="name">Remove</span><span class="tparams">[<span name="T">T</span>]</span><span class="params">(<span name="value">value: <span class="extype" name="org.widok.BufSet.Delta.Remove.T">T</span></span>)</span><span class="result"> extends <a href="BufSet$$Delta.html" class="extype" name="org.widok.BufSet.Delta">Delta</a>[<span class="extype" name="org.widok.BufSet.Delta.Remove.T">T</span>] with <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Product" class="extype" target="_top">Product</a> with <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Serializable" class="extype" target="_top">Serializable</a></span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="toggleContainer block">
<span class="toggle">Linear Supertypes</span>
<div class="superTypes hiddenContent"><a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Serializable" class="extype" target="_top">Serializable</a>, <span class="extype" name="java.io.Serializable">Serializable</span>, <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Product" class="extype" target="_top">Product</a>, <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Equals" class="extype" target="_top">Equals</a>, <a href="BufSet$$Delta.html" class="extype" name="org.widok.BufSet.Delta">Delta</a>[<span class="extype" name="org.widok.BufSet.Delta.Remove.T">T</span>], <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.AnyRef" class="extype" target="_top">AnyRef</a>, <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Any" class="extype" target="_top">Any</a></div>
</div></div>
<div id="mbrsel">
<div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div>
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By inheritance</span></li>
</ol>
</div>
<div id="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="org.widok.BufSet.Delta.Remove"><span>Remove</span></li><li class="in" name="scala.Serializable"><span>Serializable</span></li><li class="in" name="java.io.Serializable"><span>Serializable</span></li><li class="in" name="scala.Product"><span>Product</span></li><li class="in" name="scala.Equals"><span>Equals</span></li><li class="in" name="org.widok.BufSet.Delta"><span>Delta</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div id="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show all</span></li>
</ol>
<a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
<div id="template">
<div id="allMembers">
<div id="constructors" class="members">
<h3>Instance Constructors</h3>
<ol><li name="org.widok.BufSet.Delta.Remove#<init>" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="<init>(value:T):org.widok.BufSet.Delta.Remove[T]"></a>
<a id="<init>:Remove[T]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">new</span>
</span>
<span class="symbol">
<span class="name">Remove</span><span class="params">(<span name="value">value: <span class="extype" name="org.widok.BufSet.Delta.Remove.T">T</span></span>)</span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@<init>(value:T):org.widok.BufSet.Delta.Remove[T]" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
</li></ol>
</div>
<div id="values" class="values members">
<h3>Value Members</h3>
<ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:Any):Boolean"></a>
<a id="!=(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Any" class="extype" target="_top">Any</a></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Boolean" class="extype" target="_top">Boolean</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@!=(x$1:Any):Boolean" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="##():Int"></a>
<a id="##():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Int" class="extype" target="_top">Int</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@##():Int" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:Any):Boolean"></a>
<a id="==(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Any" class="extype" target="_top">Any</a></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Boolean" class="extype" target="_top">Boolean</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@==(x$1:Any):Boolean" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="asInstanceOf[T0]:T0"></a>
<a id="asInstanceOf[T0]:T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@asInstanceOf[T0]:T0" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clone():Object"></a>
<a id="clone():AnyRef"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.AnyRef" class="extype" target="_top">AnyRef</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@clone():Object" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="eq(x$1:AnyRef):Boolean"></a>
<a id="eq(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.AnyRef" class="extype" target="_top">AnyRef</a></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Boolean" class="extype" target="_top">Boolean</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@eq(x$1:AnyRef):Boolean" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="finalize():Unit"></a>
<a id="finalize():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Unit" class="extype" target="_top">Unit</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@finalize():Unit" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="symbol">classOf[java.lang.Throwable]</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="getClass():Class[_]"></a>
<a id="getClass():Class[_]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@getClass():Class[_]" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isInstanceOf[T0]:Boolean"></a>
<a id="isInstanceOf[T0]:Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Boolean" class="extype" target="_top">Boolean</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@isInstanceOf[T0]:Boolean" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ne(x$1:AnyRef):Boolean"></a>
<a id="ne(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.AnyRef" class="extype" target="_top">AnyRef</a></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Boolean" class="extype" target="_top">Boolean</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@ne(x$1:AnyRef):Boolean" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notify():Unit"></a>
<a id="notify():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Unit" class="extype" target="_top">Unit</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@notify():Unit" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notifyAll():Unit"></a>
<a id="notifyAll():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Unit" class="extype" target="_top">Unit</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@notifyAll():Unit" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="synchronized[T0](x$1:=>T0):T0"></a>
<a id="synchronized[T0](⇒T0):T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@synchronized[T0](x$1:=>T0):T0" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="org.widok.BufSet.Delta.Remove#value" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="value:T"></a>
<a id="value:T"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">value</span><span class="result">: <span class="extype" name="org.widok.BufSet.Delta.Remove.T">T</span></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@value:T" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait():Unit"></a>
<a id="wait():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Unit" class="extype" target="_top">Unit</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@wait():Unit" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long,x$2:Int):Unit"></a>
<a id="wait(Long,Int):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Long" class="extype" target="_top">Long</a></span>, <span name="arg1">arg1: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Int" class="extype" target="_top">Int</a></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Unit" class="extype" target="_top">Unit</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@wait(x$1:Long,x$2:Int):Unit" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long):Unit"></a>
<a id="wait(Long):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Long" class="extype" target="_top">Long</a></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Unit" class="extype" target="_top">Unit</a></span>
</span>
</h4><span class="permalink">
<a href="../../index.html#org.widok.BufSet$$Delta$$Remove@wait(x$1:Long):Unit" title="Permalink" target="_top">
<img src="../../lib/permalink.png" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li></ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scala.Serializable">
<h3>Inherited from <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Serializable" class="extype" target="_top">Serializable</a></h3>
</div><div class="parent" name="java.io.Serializable">
<h3>Inherited from <span class="extype" name="java.io.Serializable">Serializable</span></h3>
</div><div class="parent" name="scala.Product">
<h3>Inherited from <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Product" class="extype" target="_top">Product</a></h3>
</div><div class="parent" name="scala.Equals">
<h3>Inherited from <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Equals" class="extype" target="_top">Equals</a></h3>
</div><div class="parent" name="org.widok.BufSet.Delta">
<h3>Inherited from <a href="BufSet$$Delta.html" class="extype" name="org.widok.BufSet.Delta">Delta</a>[<span class="extype" name="org.widok.BufSet.Delta.Remove.T">T</span>]</h3>
</div><div class="parent" name="scala.AnyRef">
<h3>Inherited from <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.AnyRef" class="extype" target="_top">AnyRef</a></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <a href="http://www.scala-lang.org/api/2.11.6/index.html#scala.Any" class="extype" target="_top">Any</a></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
</body>
</html> | widok/widok.github.io | api/v0.2.1/jvm/org/widok/BufSet$$Delta$$Remove.html | HTML | apache-2.0 | 27,189 |
# ADO.NET
Implementation of the ADO.NET interfaces and common abstract classes present in the `System.Data` namespace of the
.NET Framework: `IDbConnection`, `IDbCommand`, and `IDbDataAdapter`.
It allows users to interact with a Cassandra cluster using a common .NET data access pattern.
ADO.NET design limits how you can interact with Cassandra clusters (sync only, open / close pattern), for that reason
**it is recommended that you use the [Core component](../core) of the driver instead**.
## Example
```csharp
var connection = new CqlConnection(connectionString);
connection.Open();
try
{
var command = connection.CreateCommand();
command.CommandText = "UPDATE tbl SET val = 'z' WHERE id = 1";
command.ExecuteNonQuery();
}
finally
{
connection.Close();
}
``` | mintsoft/csharp-driver | doc/features/components/adonet/README.md | Markdown | apache-2.0 | 782 |
/*=========================================================================
* Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
* This product is protected by U.S. and international copyright
* and intellectual property laws. Pivotal products are covered by
* one or more patents listed at http://www.pivotal.io/patents.
*=========================================================================
*/
package com.gemstone.gemfire.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
import java.util.UUID;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import com.gemstone.gemfire.cache.EntryEvent;
import com.gemstone.gemfire.internal.cache.lru.EnableLRU;
import com.gemstone.gemfire.internal.cache.persistence.DiskRecoveryStore;
import com.gemstone.gemfire.internal.InternalStatisticsDisabledException;
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
import com.gemstone.gemfire.internal.cache.versions.VersionSource;
import com.gemstone.gemfire.internal.cache.versions.VersionStamp;
import com.gemstone.gemfire.internal.cache.versions.VersionTag;
import com.gemstone.gemfire.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
// disk: DISK
// lru: LRU
// stats: STATS
// versioned: VERSIONED
// One of the following key macros must be defined:
// key object: KEY_OBJECT
// key int: KEY_INT
// key long: KEY_LONG
// key uuid: KEY_UUID
// key string1: KEY_STRING1
// key string2: KEY_STRING2
/**
* Do not modify this class. It was generated.
* Instead modify LeafRegionEntry.cpp and then run
* bin/generateRegionEntryClasses.sh from the directory
* that contains your build.xml.
*/
public class VersionedStatsDiskRegionEntryHeapUUIDKey extends VersionedStatsDiskRegionEntryHeap {
public VersionedStatsDiskRegionEntryHeapUUIDKey (RegionEntryContext context, UUID key, Object value
) {
super(context,
(value instanceof RecoveredEntry ? null : value)
);
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
initialize(context, value);
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
private static final AtomicLongFieldUpdater<VersionedStatsDiskRegionEntryHeapUUIDKey> lastModifiedUpdater
= AtomicLongFieldUpdater.newUpdater(VersionedStatsDiskRegionEntryHeapUUIDKey.class, "lastModified");
private volatile Object value;
protected final Object areGetValue() {
return this.value;
}
protected void areSetValue(Object v) {
this.value = v;
}
protected long getlastModifiedField() {
return lastModifiedUpdater.get(this);
}
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
/**
* @see HashEntry#getEntryHash()
*/
public final int getEntryHash() {
return this.hash;
}
protected void setEntryHash(int v) {
this.hash = v;
}
/**
* @see HashEntry#getNextEntry()
*/
public final HashEntry<Object, Object> getNextEntry() {
return this.next;
}
/**
* @see HashEntry#setNextEntry
*/
public final void setNextEntry(final HashEntry<Object, Object> n) {
this.next = n;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
// disk code
protected void initialize(RegionEntryContext context, Object value) {
diskInitialize(context, value);
}
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
private void diskInitialize(RegionEntryContext context, Object value) {
DiskRecoveryStore drs = (DiskRecoveryStore)context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
//get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
/**
* DiskId
*
* @since 5.1
*/
protected DiskId id;//= new DiskId();
public DiskId getDiskId() {
return this.id;
}
@Override
void setDiskId(RegionEntry old) {
this.id = ((AbstractDiskRegionEntry)old).getDiskId();
}
// // inlining DiskId
// // always have these fields
// /**
// * id consists of
// * most significant
// * 1 byte = users bits
// * 2-8 bytes = oplog id
// * least significant.
// *
// * The highest bit in the oplog id part is set to 1 if the oplog id
// * is negative.
// * @todo this field could be an int for an overflow only region
// */
// private long id;
// /**
// * Length of the bytes on disk.
// * This is always set. If the value is invalid then it will be set to 0.
// * The most significant bit is used by overflow to mark it as needing to be written.
// */
// protected int valueLength = 0;
// // have intOffset or longOffset
// // intOffset
// /**
// * The position in the oplog (the oplog offset) where this entry's value is
// * stored
// */
// private volatile int offsetInOplog;
// // longOffset
// /**
// * The position in the oplog (the oplog offset) where this entry's value is
// * stored
// */
// private volatile long offsetInOplog;
// // have overflowOnly or persistence
// // overflowOnly
// // no fields
// // persistent
// /** unique entry identifier * */
// private long keyId;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
// stats code
@Override
public final void updateStatsForGet(boolean hit, long time)
{
setLastAccessed(time);
if (hit) {
incrementHitCount();
} else {
incrementMissCount();
}
}
@Override
protected final void setLastModified(long lastModified) {
_setLastModified(lastModified);
if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastModified);
}
}
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
private static final AtomicIntegerFieldUpdater<VersionedStatsDiskRegionEntryHeapUUIDKey> hitCountUpdater
= AtomicIntegerFieldUpdater.newUpdater(VersionedStatsDiskRegionEntryHeapUUIDKey.class, "hitCount");
private static final AtomicIntegerFieldUpdater<VersionedStatsDiskRegionEntryHeapUUIDKey> missCountUpdater
= AtomicIntegerFieldUpdater.newUpdater(VersionedStatsDiskRegionEntryHeapUUIDKey.class, "missCount");
@Override
public final long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
@Override
public final long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
@Override
public final long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
@Override
public final void resetCounts() throws InternalStatisticsDisabledException {
hitCountUpdater.set(this,0);
missCountUpdater.set(this,0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
@Override
public final void txDidDestroy(long currTime) {
setLastModified(currTime);
setLastAccessed(currTime);
this.hitCount = 0;
this.missCount = 0;
}
@Override
public boolean hasStats() {
return true;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
private short regionVersionHighBytes;
private int regionVersionLowBytes;
private byte entryVersionHighByte;
private byte distributedSystemId;
public int getEntryVersion() {
return ((entryVersionHighByte << 16) & 0xFF0000) | (entryVersionLowBytes & 0xFFFF);
}
public long getRegionVersion() {
return (((long)regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
}
public long getVersionTimeStamp() {
return getLastModified();
}
public void setVersionTimeStamp(long time) {
setLastModified(time);
}
public VersionSource getMemberID() {
return this.memberID;
}
public int getDistributedSystemId() {
return this.distributedSystemId;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
public void setVersions(VersionTag tag) {
this.memberID = tag.getMemberID();
int eVersion = tag.getEntryVersion();
this.entryVersionLowBytes = (short)(eVersion & 0xffff);
this.entryVersionHighByte = (byte)((eVersion & 0xff0000) >> 16);
this.regionVersionHighBytes = tag.getRegionVersionHighBytes();
this.regionVersionLowBytes = tag.getRegionVersionLowBytes();
if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) {
if (getVersionTimeStamp() <= tag.getVersionTimeStamp()) {
setVersionTimeStamp(tag.getVersionTimeStamp());
} else {
tag.setVersionTimeStamp(getVersionTimeStamp());
}
} else {
setVersionTimeStamp(tag.getVersionTimeStamp());
}
this.distributedSystemId = (byte)(tag.getDistributedSystemId() & 0xff);
}
public void setMemberID(VersionSource memberID) {
this.memberID = memberID;
}
@Override
public VersionStamp getVersionStamp() {
return this;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
tag.setRegionVersion(this.regionVersionHighBytes, this.regionVersionLowBytes);
tag.setVersionTimeStamp(getVersionTimeStamp());
tag.setDistributedSystemId(this.distributedSystemId);
return tag;
}
public void processVersionTag(LocalRegion r, VersionTag tag,
boolean isTombstoneFromGII, boolean hasDelta,
VersionSource thisVM, InternalDistributedMember sender, boolean checkForConflicts) {
basicProcessVersionTag(r, tag, isTombstoneFromGII, hasDelta, thisVM, sender, checkForConflicts);
}
@Override
public void processVersionTag(EntryEvent cacheEvent) {
// this keeps Eclipse happy. without it the sender chain becomes confused
// while browsing this code
super.processVersionTag(cacheEvent);
}
/** get rvv internal high byte. Used by region entries for transferring to storage */
public short getRegionVersionHighBytes() {
return this.regionVersionHighBytes;
}
/** get rvv internal low bytes. Used by region entries for transferring to storage */
public int getRegionVersionLowBytes() {
return this.regionVersionLowBytes;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
// key code
private final long keyMostSigBits;
private final long keyLeastSigBits;
@Override
public final Object getKey() {
return new UUID(this.keyMostSigBits, this.keyLeastSigBits);
}
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof UUID) {
UUID uuid = (UUID)k;
return uuid.getLeastSignificantBits() == this.keyLeastSigBits && uuid.getMostSignificantBits() == this.keyMostSigBits;
}
return false;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
| ameybarve15/incubator-geode | gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/VersionedStatsDiskRegionEntryHeapUUIDKey.java | Java | apache-2.0 | 11,929 |
# -*- coding: utf-8 -*-
"""
sphinx.environment.managers.indexentries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index entries manager for sphinx.environment.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import bisect
import unicodedata
import string
from itertools import groupby
from six import text_type
from sphinx import addnodes
from sphinx.util import iteritems, split_index_msg, split_into
from sphinx.locale import _
from sphinx.environment.managers import EnvironmentManager
class IndexEntries(EnvironmentManager):
name = 'indices'
def __init__(self, env):
super(IndexEntries, self).__init__(env)
self.data = env.indexentries
def clear_doc(self, docname):
self.data.pop(docname, None)
def merge_other(self, docnames, other):
for docname in docnames:
self.data[docname] = other.indexentries[docname]
def process_doc(self, docname, doctree):
entries = self.data[docname] = []
for node in doctree.traverse(addnodes.index):
try:
for entry in node['entries']:
split_index_msg(entry[0], entry[1])
except ValueError as exc:
self.env.warn_node(exc, node)
node.parent.remove(node)
else:
for entry in node['entries']:
if len(entry) == 5:
# Since 1.4: new index structure including index_key (5th column)
entries.append(entry)
else:
entries.append(entry + (None,))
def create_index(self, builder, group_entries=True,
_fixre=re.compile(r'(.*) ([(][^()]*[)])')):
"""Create the real index from the collected index entries."""
from sphinx.environment import NoUri
new = {}
def add_entry(word, subword, main, link=True, dic=new, key=None):
# Force the word to be unicode if it's a ASCII bytestring.
# This will solve problems with unicode normalization later.
# For instance the RFC role will add bytestrings at the moment
word = text_type(word)
entry = dic.get(word)
if not entry:
dic[word] = entry = [[], {}, key]
if subword:
add_entry(subword, '', main, link=link, dic=entry[1], key=key)
elif link:
try:
uri = builder.get_relative_uri('genindex', fn) + '#' + tid
except NoUri:
pass
else:
# maintain links in sorted/deterministic order
bisect.insort(entry[0], (main, uri))
for fn, entries in iteritems(self.data):
# new entry types must be listed in directives/other.py!
for type, value, tid, main, index_key in entries:
try:
if type == 'single':
try:
entry, subentry = split_into(2, 'single', value)
except ValueError:
entry, = split_into(1, 'single', value)
subentry = ''
add_entry(entry, subentry, main, key=index_key)
elif type == 'pair':
first, second = split_into(2, 'pair', value)
add_entry(first, second, main, key=index_key)
add_entry(second, first, main, key=index_key)
elif type == 'triple':
first, second, third = split_into(3, 'triple', value)
add_entry(first, second + ' ' + third, main, key=index_key)
add_entry(second, third + ', ' + first, main, key=index_key)
add_entry(third, first + ' ' + second, main, key=index_key)
elif type == 'see':
first, second = split_into(2, 'see', value)
add_entry(first, _('see %s') % second, None,
link=False, key=index_key)
elif type == 'seealso':
first, second = split_into(2, 'see', value)
add_entry(first, _('see also %s') % second, None,
link=False, key=index_key)
else:
self.env.warn(fn, 'unknown index entry type %r' % type)
except ValueError as err:
self.env.warn(fn, str(err))
# sort the index entries; put all symbols at the front, even those
# following the letters in ASCII, this is where the chr(127) comes from
def keyfunc(entry, lcletters=string.ascii_lowercase + '_'):
key, (void, void, category_key) = entry
if category_key:
# using specified category key to sort
key = category_key
lckey = unicodedata.normalize('NFD', key.lower())
if lckey[0:1] in lcletters:
lckey = chr(127) + lckey
# ensure a determinstic order *within* letters by also sorting on
# the entry itself
return (lckey, entry[0])
newlist = sorted(new.items(), key=keyfunc)
if group_entries:
# fixup entries: transform
# func() (in module foo)
# func() (in module bar)
# into
# func()
# (in module foo)
# (in module bar)
oldkey = ''
oldsubitems = None
i = 0
while i < len(newlist):
key, (targets, subitems, _key) = newlist[i]
# cannot move if it has subitems; structure gets too complex
if not subitems:
m = _fixre.match(key)
if m:
if oldkey == m.group(1):
# prefixes match: add entry as subitem of the
# previous entry
oldsubitems.setdefault(m.group(2), [[], {}, _key])[0].\
extend(targets)
del newlist[i]
continue
oldkey = m.group(1)
else:
oldkey = key
oldsubitems = subitems
i += 1
# group the entries by letter
def keyfunc2(item, letters=string.ascii_uppercase + '_'):
# hack: mutating the subitems dicts to a list in the keyfunc
k, v = item
v[1] = sorted((si, se) for (si, (se, void, void)) in iteritems(v[1]))
if v[2] is None:
# now calculate the key
letter = unicodedata.normalize('NFD', k[0])[0].upper()
if letter in letters:
return letter
else:
# get all other symbols under one heading
return _('Symbols')
else:
return v[2]
return [(key_, list(group))
for (key_, group) in groupby(newlist, keyfunc2)]
| axbaretto/beam | sdks/python/.tox/docs/lib/python2.7/site-packages/sphinx/environment/managers/indexentries.py | Python | apache-2.0 | 7,329 |
using System.Collections.Generic;
using MiscUtil.Collections;
namespace MiscUtil.Text {
/// <summary>
/// Utility class providing a number of singleton instances of
/// Range<char> to indicate the various ranges of unicode characters,
/// as documented at http://msdn.microsoft.com/en-us/library/20bw873z.aspx.
/// Note that this does not indicate the Unicode category of a character,
/// merely which range it's in.
/// TODO: Work out how to include names. Can't derive from Range[char].
/// </summary>
public static class UnicodeRange {
static readonly List<Range<char>> allRanges = new List<Range<char>>();
private static Range<char> CreateRange(char from,char to)
{
// TODO: Check for overlaps
Range<char> ret = new Range<char>(from, to);
allRanges.Add(ret);
return ret;
}
static readonly Range<char> basicLatin = CreateRange('\u0000', '\u007f');
static readonly Range<char> latin1Supplement = CreateRange('\u0080', '\u00ff');
static readonly Range<char> latinExtendedA = CreateRange('\u0100', '\u017f');
static readonly Range<char> latinExtendedB = CreateRange('\u0180', '\u024f');
static readonly Range<char> ipaExtensions = CreateRange('\u0250', '\u02af');
static readonly Range<char> spacingModifierLetters = CreateRange('\u02b0', '\u02ff');
static readonly Range<char> combiningDiacriticalMarks = CreateRange('\u0300', '\u036f');
static readonly Range<char> greekAndCoptic = CreateRange('\u0370', '\u03ff');
static readonly Range<char> cyrillic = CreateRange('\u0400', '\u04ff');
static readonly Range<char> cyrillicSupplement = CreateRange('\u0500', '\u052f');
static readonly Range<char> armenian = CreateRange('\u0530', '\u058f');
static readonly Range<char> hebrew = CreateRange('\u0590', '\u05FF');
static readonly Range<char> arabic = CreateRange('\u0600', '\u06ff');
static readonly Range<char> syriac = CreateRange('\u0700', '\u074f');
static readonly Range<char> thaana = CreateRange('\u0780', '\u07bf');
static readonly Range<char> devangari = CreateRange('\u0900', '\u097f');
static readonly Range<char> bengali = CreateRange('\u0980', '\u09ff');
static readonly Range<char> gurmukhi = CreateRange('\u0a00', '\u0a7f');
static readonly Range<char> gujarati = CreateRange('\u0a80', '\u0aff');
static readonly Range<char> oriya = CreateRange('\u0b00', '\u0b7f');
static readonly Range<char> tamil = CreateRange('\u0b80', '\u0bff');
static readonly Range<char> telugu = CreateRange('\u0c00', '\u0c7f');
static readonly Range<char> kannada = CreateRange('\u0c80', '\u0cff');
static readonly Range<char> malayalam = CreateRange('\u0d00', '\u0d7f');
static readonly Range<char> sinhala = CreateRange('\u0d80', '\u0dff');
static readonly Range<char> thai = CreateRange('\u0e00', '\u0e7f');
static readonly Range<char> lao = CreateRange('\u0e80', '\u0eff');
static readonly Range<char> tibetan = CreateRange('\u0f00', '\u0fff');
static readonly Range<char> myanmar = CreateRange('\u1000', '\u109f');
static readonly Range<char> georgian = CreateRange('\u10a0', '\u10ff');
static readonly Range<char> hangulJamo = CreateRange('\u1100', '\u11ff');
static readonly Range<char> ethiopic = CreateRange('\u1200', '\u137f');
static readonly Range<char> cherokee = CreateRange('\u13a0', '\u13ff');
static readonly Range<char> unifiedCanadianAboriginalSyllabics = CreateRange('\u1400', '\u167f');
static readonly Range<char> ogham = CreateRange('\u1680', '\u169f');
static readonly Range<char> runic = CreateRange('\u16a0', '\u16ff');
static readonly Range<char> tagalog = CreateRange('\u1700', '\u171f');
static readonly Range<char> hanunoo = CreateRange('\u1720', '\u173f');
static readonly Range<char> buhid = CreateRange('\u1740', '\u175f');
static readonly Range<char> tagbanwa = CreateRange('\u1760', '\u177f');
static readonly Range<char> khmer = CreateRange('\u1780', '\u17ff');
static readonly Range<char> mongolian = CreateRange('\u1800', '\u18af');
static readonly Range<char> limbu = CreateRange('\u1900', '\u194f');
static readonly Range<char> taiLe = CreateRange('\u1950', '\u197f');
static readonly Range<char> khmerSymbols = CreateRange('\u19e0', '\u19ff');
static readonly Range<char> phoneticExtensions = CreateRange('\u1d00', '\u1d7f');
static readonly Range<char> latinExtendedAdditional = CreateRange('\u1e00', '\u1eff');
static readonly Range<char> greekExtended = CreateRange('\u1f00', '\u1fff');
static readonly Range<char> generalPunctuation = CreateRange('\u2000', '\u206f');
static readonly Range<char> superscriptsandSubscripts = CreateRange('\u2070', '\u209f');
static readonly Range<char> currencySymbols = CreateRange('\u20a0', '\u20cf');
static readonly Range<char> combiningDiacriticalMarksforSymbols = CreateRange('\u20d0', '\u20ff');
static readonly Range<char> letterlikeSymbols = CreateRange('\u2100', '\u214f');
static readonly Range<char> numberForms = CreateRange('\u2150', '\u218f');
static readonly Range<char> arrows = CreateRange('\u2190', '\u21ff');
static readonly Range<char> mathematicalOperators = CreateRange('\u2200', '\u22ff');
static readonly Range<char> miscellaneousTechnical = CreateRange('\u2300', '\u23ff');
static readonly Range<char> controlPictures = CreateRange('\u2400', '\u243f');
static readonly Range<char> opticalCharacterRecognition = CreateRange('\u2440', '\u245f');
static readonly Range<char> enclosedAlphanumerics = CreateRange('\u2460', '\u24ff');
static readonly Range<char> boxDrawing = CreateRange('\u2500', '\u257f');
static readonly Range<char> blockElements = CreateRange('\u2580', '\u259f');
static readonly Range<char> geometricShapes = CreateRange('\u25a0', '\u25ff');
static readonly Range<char> miscellaneousSymbols = CreateRange('\u2600', '\u26ff');
static readonly Range<char> dingbats = CreateRange('\u2700', '\u27bf');
static readonly Range<char> miscellaneousMathematicalSymbolsA = CreateRange('\u27c0', '\u27ef');
static readonly Range<char> supplementalArrowsA = CreateRange('\u27f0', '\u27ff');
static readonly Range<char> braillePatterns = CreateRange('\u2800', '\u28ff');
static readonly Range<char> supplementalArrowsB = CreateRange('\u2900', '\u297f');
static readonly Range<char> miscellaneousMathematicalSymbolsB = CreateRange('\u2980', '\u29ff');
static readonly Range<char> supplementalMathematicalOperators = CreateRange('\u2a00', '\u2aff');
static readonly Range<char> miscellaneousSymbolsandArrows = CreateRange('\u2b00', '\u2bff');
static readonly Range<char> cjkRadicalsSupplement = CreateRange('\u2e80', '\u2eff');
static readonly Range<char> kangxiRadicals = CreateRange('\u2f00', '\u2fdf');
static readonly Range<char> ideographicDescriptionCharacters = CreateRange('\u2ff0', '\u2fff');
static readonly Range<char> cjkSymbolsandPunctuation = CreateRange('\u3000', '\u303f');
static readonly Range<char> hiragana = CreateRange('\u3040', '\u309f');
static readonly Range<char> katakana = CreateRange('\u30a0', '\u30ff');
static readonly Range<char> bopomofo = CreateRange('\u3100', '\u312f');
static readonly Range<char> hangulCompatibilityJamo = CreateRange('\u3130', '\u318f');
static readonly Range<char> kanbun = CreateRange('\u3190', '\u319f');
static readonly Range<char> bopomofoExtended = CreateRange('\u31a0', '\u31bf');
static readonly Range<char> katakanaPhoneticExtensions = CreateRange('\u31f0', '\u31ff');
static readonly Range<char> enclosedCjkLettersandMonths = CreateRange('\u3200', '\u32ff');
static readonly Range<char> cjkCompatibility = CreateRange('\u3300', '\u33ff');
static readonly Range<char> cjkUnifiedIdeographsExtensionA = CreateRange('\u3400', '\u4dbf');
static readonly Range<char> yijingHexagramSymbols = CreateRange('\u4dc0', '\u4dff');
static readonly Range<char> cjkUnifiedIdeographs = CreateRange('\u4e00', '\u9fff');
static readonly Range<char> yiSyllables = CreateRange('\ua000', '\ua48f');
static readonly Range<char> yiRadicals = CreateRange('\ua490', '\ua4cf');
static readonly Range<char> hangulSyllables = CreateRange('\uac00', '\ud7af');
static readonly Range<char> highSurrogates = CreateRange('\ud800', '\udb7f');
static readonly Range<char> highPrivateUseSurrogates = CreateRange('\udb80', '\udbff');
static readonly Range<char> lowSurrogates = CreateRange('\udc00', '\udfff');
static readonly Range<char> privateUse = CreateRange('\ue000', '\uf8ff');
static readonly Range<char> privateUseArea = CreateRange('\uf900', '\ufaff');
static readonly Range<char> cjkCompatibilityIdeographs = CreateRange('\ufb00', '\ufb4f');
static readonly Range<char> alphabeticPresentationForms = CreateRange('\ufb50', '\ufdff');
static readonly Range<char> arabicPresentationFormsA = CreateRange('\ufe00', '\ufe0f');
static readonly Range<char> variationSelectors = CreateRange('\ufe20', '\ufe2f');
static readonly Range<char> combiningHalfMarks = CreateRange('\ufe30', '\ufe4f');
static readonly Range<char> cjkCompatibilityForms = CreateRange('\ufe50', '\ufe6f');
static readonly Range<char> smallFormVariants = CreateRange('\ufe70', '\ufeff');
static readonly Range<char> arabicPresentationFormsB = CreateRange('\uff00', '\uffef');
static readonly Range<char> halfwidthandFullwidthForms = CreateRange('\ufff0', '\uffff');
#pragma warning disable 1591
public static Range<char> BasicLatin { get { return basicLatin; } }
public static Range<char> Latin1Supplement { get { return latin1Supplement; } }
public static Range<char> LatinExtendedA { get { return latinExtendedA; } }
public static Range<char> LatinExtendedB { get { return latinExtendedB; } }
public static Range<char> IpaExtensions { get { return ipaExtensions; } }
public static Range<char> SpacingModifierLetters { get { return spacingModifierLetters; } }
public static Range<char> CombiningDiacriticalMarks { get { return combiningDiacriticalMarks; } }
public static Range<char> GreekAndCoptic { get { return greekAndCoptic; } }
public static Range<char> Cyrillic { get { return cyrillic; } }
public static Range<char> CyrillicSupplement { get { return cyrillicSupplement; } }
public static Range<char> Armenian { get { return armenian; } }
public static Range<char> Hebrew { get { return hebrew; } }
public static Range<char> Arabic { get { return arabic; } }
public static Range<char> Syriac { get { return syriac; } }
public static Range<char> Thaana { get { return thaana; } }
public static Range<char> Devangari { get { return devangari; } }
public static Range<char> Bengali { get { return bengali; } }
public static Range<char> Gurmukhi { get { return gurmukhi; } }
public static Range<char> Gujarati { get { return gujarati; } }
public static Range<char> Oriya { get { return oriya; } }
public static Range<char> Tamil { get { return tamil; } }
public static Range<char> Telugu { get { return telugu; } }
public static Range<char> Kannada { get { return kannada; } }
public static Range<char> Malayalam { get { return malayalam; } }
public static Range<char> Sinhala { get { return sinhala; } }
public static Range<char> Thai { get { return thai; } }
public static Range<char> Lao { get { return lao; } }
public static Range<char> Tibetan { get { return tibetan; } }
public static Range<char> Myanmar { get { return myanmar; } }
public static Range<char> Georgian { get { return georgian; } }
public static Range<char> HangulJamo { get { return hangulJamo; } }
public static Range<char> Ethiopic { get { return ethiopic; } }
public static Range<char> Cherokee { get { return cherokee; } }
public static Range<char> UnifiedCanadianAboriginalSyllabics { get { return unifiedCanadianAboriginalSyllabics; } }
public static Range<char> Ogham { get { return ogham; } }
public static Range<char> Runic { get { return runic; } }
public static Range<char> Tagalog { get { return tagalog; } }
public static Range<char> Hanunoo { get { return hanunoo; } }
public static Range<char> Buhid { get { return buhid; } }
public static Range<char> Tagbanwa { get { return tagbanwa; } }
public static Range<char> Khmer { get { return khmer; } }
public static Range<char> Mongolian { get { return mongolian; } }
public static Range<char> Limbu { get { return limbu; } }
public static Range<char> TaiLe { get { return taiLe; } }
public static Range<char> KhmerSymbols { get { return khmerSymbols; } }
public static Range<char> PhoneticExtensions { get { return phoneticExtensions; } }
public static Range<char> LatinExtendedAdditional { get { return latinExtendedAdditional; } }
public static Range<char> GreekExtended { get { return greekExtended; } }
public static Range<char> GeneralPunctuation { get { return generalPunctuation; } }
public static Range<char> SuperscriptsandSubscripts { get { return superscriptsandSubscripts; } }
public static Range<char> CurrencySymbols { get { return currencySymbols; } }
public static Range<char> CombiningDiacriticalMarksforSymbols { get { return combiningDiacriticalMarksforSymbols; } }
public static Range<char> LetterlikeSymbols { get { return letterlikeSymbols; } }
public static Range<char> NumberForms { get { return numberForms; } }
public static Range<char> Arrows { get { return arrows; } }
public static Range<char> MathematicalOperators { get { return mathematicalOperators; } }
public static Range<char> MiscellaneousTechnical { get { return miscellaneousTechnical; } }
public static Range<char> ControlPictures { get { return controlPictures; } }
public static Range<char> OpticalCharacterRecognition { get { return opticalCharacterRecognition; } }
public static Range<char> EnclosedAlphanumerics { get { return enclosedAlphanumerics; } }
public static Range<char> BoxDrawing { get { return boxDrawing; } }
public static Range<char> BlockElements { get { return blockElements; } }
public static Range<char> GeometricShapes { get { return geometricShapes; } }
public static Range<char> MiscellaneousSymbols { get { return miscellaneousSymbols; } }
public static Range<char> Dingbats { get { return dingbats; } }
public static Range<char> MiscellaneousMathematicalSymbolsA { get { return miscellaneousMathematicalSymbolsA; } }
public static Range<char> SupplementalArrowsA { get { return supplementalArrowsA; } }
public static Range<char> BraillePatterns { get { return braillePatterns; } }
public static Range<char> SupplementalArrowsB { get { return supplementalArrowsB; } }
public static Range<char> MiscellaneousMathematicalSymbolsB { get { return miscellaneousMathematicalSymbolsB; } }
public static Range<char> SupplementalMathematicalOperators { get { return supplementalMathematicalOperators; } }
public static Range<char> MiscellaneousSymbolsandArrows { get { return miscellaneousSymbolsandArrows; } }
public static Range<char> CjkRadicalsSupplement { get { return cjkRadicalsSupplement; } }
public static Range<char> KangxiRadicals { get { return kangxiRadicals; } }
public static Range<char> IdeographicDescriptionCharacters { get { return ideographicDescriptionCharacters; } }
public static Range<char> CjkSymbolsandPunctuation { get { return cjkSymbolsandPunctuation; } }
public static Range<char> Hiragana { get { return hiragana; } }
public static Range<char> Katakana { get { return katakana; } }
public static Range<char> Bopomofo { get { return bopomofo; } }
public static Range<char> HangulCompatibilityJamo { get { return hangulCompatibilityJamo; } }
public static Range<char> Kanbun { get { return kanbun; } }
public static Range<char> BopomofoExtended { get { return bopomofoExtended; } }
public static Range<char> KatakanaPhoneticExtensions { get { return katakanaPhoneticExtensions; } }
public static Range<char> EnclosedCjkLettersandMonths { get { return enclosedCjkLettersandMonths; } }
public static Range<char> CjkCompatibility { get { return cjkCompatibility; } }
public static Range<char> CjkUnifiedIdeographsExtensionA { get { return cjkUnifiedIdeographsExtensionA; } }
public static Range<char> YijingHexagramSymbols { get { return yijingHexagramSymbols; } }
public static Range<char> CjkUnifiedIdeographs { get { return cjkUnifiedIdeographs; } }
public static Range<char> YiSyllables { get { return yiSyllables; } }
public static Range<char> YiRadicals { get { return yiRadicals; } }
public static Range<char> HangulSyllables { get { return hangulSyllables; } }
public static Range<char> HighSurrogates { get { return highSurrogates; } }
public static Range<char> HighPrivateUseSurrogates { get { return highPrivateUseSurrogates; } }
public static Range<char> LowSurrogates { get { return lowSurrogates; } }
public static Range<char> PrivateUse { get { return privateUse; } }
public static Range<char> PrivateUseArea { get { return privateUseArea; } }
public static Range<char> CjkCompatibilityIdeographs { get { return cjkCompatibilityIdeographs; } }
public static Range<char> AlphabeticPresentationForms { get { return alphabeticPresentationForms; } }
public static Range<char> ArabicPresentationFormsA { get { return arabicPresentationFormsA; } }
public static Range<char> VariationSelectors { get { return variationSelectors; } }
public static Range<char> CombiningHalfMarks { get { return combiningHalfMarks; } }
public static Range<char> CjkCompatibilityForms { get { return cjkCompatibilityForms; } }
public static Range<char> SmallFormVariants { get { return smallFormVariants; } }
public static Range<char> ArabicPresentationFormsB { get { return arabicPresentationFormsB; } }
public static Range<char> HalfwidthandFullwidthForms { get { return halfwidthandFullwidthForms; } }
#pragma warning restore 1591
/// <summary>
/// Returns the unicode range containing the specified character.
/// </summary>
/// <param name="c">Character to look for</param>
/// <returns>The unicode range containing the specified character, or null if the character
/// is not in a unicode range.</returns>
public static Range<char> GetRange(char c)
{
// TODO: Make this efficient. SortedList should do it with a binary search, but it
// doesn't give us quite what we want
foreach (Range<char> range in allRanges)
{
if (range.Contains(c))
{
return range;
}
}
return null;
}
}
}
| klaus-liebler/sensact | configware/MiscUtil/Text/UnicodeRange.cs | C# | apache-2.0 | 19,868 |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Function template forward</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../move/reference.html#header.boost.move.utility_core_hpp" title="Header <boost/move/utility_core.hpp>">
<link rel="prev" href="move_idp225078944.html" title="Function template move">
<link rel="next" href="../mpi.html" title="Chapter 20. Boost.MPI">
</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="move_idp225078944.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.utility_core_hpp"><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="../mpi.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.forward"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template forward</span></h2>
<p>boost::forward</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../move/reference.html#header.boost.move.utility_core_hpp" title="Header <boost/move/utility_core.hpp>">boost/move/utility_core.hpp</a>>
</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">></span> <span class="identifier">output_reference</span> <span class="identifier">forward</span><span class="special">(</span><span class="identifier">input_reference</span><span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp333759200"></a><h2>Description</h2>
<p>This function provides limited form of forwarding that is usually enough for in-place construction and avoids the exponential overloading for achieve the limited forwarding in C++03.</p>
<p>For compilers with rvalue references this function provides perfect forwarding.</p>
<p>Otherwise:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>If input_reference binds to const ::boost::rv<T> & then it output_reference is ::boost::rv<T> &</p></li>
<li class="listitem"><p>Else, output_reference is equal to input_reference. </p></li>
</ul></div>
<p>
</p>
</div>
</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 © 2008-2014 Ion Gaztanaga<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="move_idp225078944.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.utility_core_hpp"><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="../mpi.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| biospi/seamass-windeps | src/boost_1_57_0/doc/html/boost/forward.html | HTML | apache-2.0 | 4,465 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.
*/
package org.apache.oodt.cas.crawl.typedetection;
// OODT imports
import org.apache.oodt.cas.metadata.MetExtractor;
import org.apache.oodt.cas.metadata.exceptions.MetExtractionException;
import java.util.LinkedList;
import java.util.List;
/**
* @author mattmann
* @author bfoster
* @version $Revision$
*
* <p>
* A specification for instantiating {@link MetExtractor}s
* </p>.
*/
public class MetExtractorSpec {
private MetExtractor metExtractor;
private List<String> preCondComparatorIds;
private String configFile;
/**
* Default Constructor.
*/
public MetExtractorSpec() {
}
/**
* Constructs a new spec with the given parameters.
*
* @param className
* The name of the {@link MetExtractor} impl class.
* @param configFile
* The name of the configuration file used to configure This
* {@link MetExtractor} described by this class.
* @throws InstantiationException
*/
public MetExtractorSpec(String className, String configFile,
List<String> preCondComparatorIds) throws InstantiationException {
try {
this.setMetExtractor(className);
this.setExtractorConfigFile(configFile);
this.preCondComparatorIds = preCondComparatorIds;
} catch (Exception e) {
throw new InstantiationException(
"Failed to create MetExtractorSpec object : "
+ e.getMessage());
}
}
/**
* @return the extractorClassName
*/
public MetExtractor getMetExtractor() {
return this.metExtractor;
}
/**
* @param extractorClassName
* the extractorClassName to set
* @throws ClassNotFoundException
* @throws IllegalAccessException
* @throws InstantiationException
* @throws MetExtractionException
*/
public void setMetExtractor(String extractorClassName)
throws InstantiationException, IllegalAccessException,
ClassNotFoundException, MetExtractionException {
this.metExtractor = (MetExtractor) Class.forName(extractorClassName)
.newInstance();
if (this.configFile != null) {
this.metExtractor.setConfigFile(this.configFile);
}
}
/**
* @param extractorConfigFile
* the extractorConfigFile to set
* @throws MetExtractionException
*/
public void setExtractorConfigFile(String extractorConfigFile)
throws MetExtractionException {
this.configFile = extractorConfigFile;
if (this.configFile != null && this.metExtractor != null) {
this.metExtractor.setConfigFile(this.configFile);
}
}
/**
* @return List<Preconiditions> specified in the extractor preconditions
* file
*/
public List<String> getPreCondComparatorIds() {
return this.preCondComparatorIds != null ? this.preCondComparatorIds
: new LinkedList<String>();
}
/**
* @param preCondComparatorIds
* The extractor preconditions file
*/
public void setPreConditionComparatorIds(List<String> preCondComparatorIds) {
this.preCondComparatorIds = preCondComparatorIds;
}
}
| lewismc/oodt | crawler/src/main/java/org/apache/oodt/cas/crawl/typedetection/MetExtractorSpec.java | Java | apache-2.0 | 4,116 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for contrib.losses.python.losses.loss_ops."""
# pylint: disable=unused-import,g-bad-import-order
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: enable=unused-import
import numpy as np
import tensorflow as tf
class AbsoluteDifferenceLossTest(tf.test.TestCase):
def setUp(self):
self._predictions = tf.constant([4, 8, 12, 8, 1, 3], shape=(2, 3))
self._targets = tf.constant([1, 9, 2, -5, -2, 6], shape=(2, 3))
def testValueErrorThrownWhenWeightIsNone(self):
with self.test_session():
with self.assertRaises(ValueError):
tf.contrib.losses.absolute_difference(
self._predictions, self._predictions, weight=None)
def testAllCorrectNoLossWeight(self):
loss = tf.contrib.losses.absolute_difference(
self._predictions, self._predictions)
with self.test_session():
self.assertAlmostEqual(0.0, loss.eval(), 3)
def testNonZeroLoss(self):
loss = tf.contrib.losses.absolute_difference(
self._predictions, self._targets)
with self.test_session():
self.assertAlmostEqual(5.5, loss.eval(), 3)
def testNonZeroLossWithPythonScalarWeight(self):
weight = 2.3
loss = tf.contrib.losses.absolute_difference(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(5.5 * weight, loss.eval(), 3)
def testNonZeroLossWithScalarTensorWeight(self):
weight = 2.3
loss = tf.contrib.losses.absolute_difference(
self._predictions, self._targets, tf.constant(weight))
with self.test_session():
self.assertAlmostEqual(5.5 * weight, loss.eval(), 3)
def testNonZeroLossWithOneDimBatchSpecificWeights(self):
weight = tf.constant([1.2, 0.0], shape=[2,])
loss = tf.contrib.losses.absolute_difference(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(5.6, loss.eval(), 3)
def testNonZeroLossWithTwoDimBatchSpecificWeights(self):
weight = tf.constant([1.2, 0.0], shape=[2, 1])
loss = tf.contrib.losses.absolute_difference(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(5.6, loss.eval(), 3)
def testNonZeroLossWithSampleSpecificWeights(self):
weight = tf.constant([3, 6, 5, 0, 4, 2], shape=[2, 3])
loss = tf.contrib.losses.absolute_difference(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(16.6, loss.eval(), 3)
def testNonZeroLossWithSampleSpecificWeightsMostZero(self):
weight = tf.constant([0, 0, 0, 0, 0, 2], shape=[2, 3])
loss = tf.contrib.losses.absolute_difference(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(6.0, loss.eval(), 3)
def testLossWithSampleSpecificWeightsAllZero(self):
weight = tf.zeros((2, 3))
loss = tf.contrib.losses.absolute_difference(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(0.0, loss.eval(), 3)
class SoftmaxCrossEntropyLossTest(tf.test.TestCase):
def testNoneWeightRaisesValueError(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[1, 0, 0],
[0, 1, 0],
[0, 0, 1]])
with self.test_session():
with self.assertRaises(ValueError):
tf.contrib.losses.softmax_cross_entropy(logits, labels, weight=None)
def testAllCorrect(self):
with self.test_session():
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[1, 0, 0],
[0, 1, 0],
[0, 0, 1]])
loss = tf.contrib.losses.softmax_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'softmax_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 0.0, 3)
def testAllWrong(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[0, 0, 1],
[1, 0, 0],
[0, 1, 0]])
with self.test_session():
loss = tf.contrib.losses.softmax_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'softmax_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 10.0, 3)
def testNonZeroLossWithPythonScalarWeight(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[0, 0, 1],
[1, 0, 0],
[0, 1, 0]])
weight = 2.3
with self.test_session():
loss = tf.contrib.losses.softmax_cross_entropy(logits, labels, weight)
self.assertAlmostEqual(loss.eval(), weight * 10.0, 3)
def testNonZeroLossWithScalarTensorWeight(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[0, 0, 1],
[1, 0, 0],
[0, 1, 0]])
weight = 2.3
with self.test_session():
loss = tf.contrib.losses.softmax_cross_entropy(
logits, labels, tf.constant(weight))
self.assertAlmostEqual(loss.eval(), weight * 10.0, 3)
def testNonZeroLossWithOneDimBatchSpecificWeights(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[0, 0, 1],
[1, 0, 0],
[0, 1, 0]])
weight = tf.constant([1.2, 3.4, 5.6], shape=[3])
with self.test_session():
loss = tf.contrib.losses.softmax_cross_entropy(logits, labels, weight)
self.assertAlmostEqual(loss.eval(), (1.2 + 3.4 + 5.6) * 10.0 / 3.0, 3)
def testAllWrongAllWeightsMissing(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[0, 0, 1],
[1, 0, 0],
[0, 1, 0]])
weight = tf.constant([0, 0, 0], shape=[3])
with self.test_session():
loss = tf.contrib.losses.softmax_cross_entropy(logits, labels, weight)
self.assertAlmostEqual(loss.eval(), 0.0, 3)
def testSomeWeightsMissing(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[0, 0, 1],
[1, 0, 0],
[0, 1, 0]])
weight = tf.constant([1.2, 0, 0], shape=[3])
with self.test_session():
loss = tf.contrib.losses.softmax_cross_entropy(logits, labels, weight)
self.assertAlmostEqual(loss.eval(), 12.0, 3)
def testSoftmaxWithMeasurementSpecificWeightsRaisesException(self):
with self.test_session():
logits = tf.constant([[100.0, -100.0, -100.0],
[-100.0, 100.0, -100.0],
[-100.0, -100.0, 100.0]])
labels = tf.constant([[1, 0, 0],
[0, 1, 0],
[0, 0, 1]])
weight = tf.constant([[3, 4, 5],
[2, 6, 0],
[8, 0, 1]])
with self.assertRaises(ValueError):
tf.contrib.losses.softmax_cross_entropy(
logits, labels, weight=weight).eval()
def testSoftmaxLabelSmoothing(self):
with self.test_session():
# Softmax Cross Entropy Loss is:
# -\sum_i p_i \log q_i
# where for a softmax activation
# \log q_i = x_i - \log \sum_j \exp x_j
# = x_i - x_max - \log \sum_j \exp (x_j - x_max)
# For our activations, [100, -100, -100] the log partion function becomes
# \log ( exp(0) + exp(-200) + exp(-200) ) = 0
# so our log softmaxes become: [0, -200, -200]
# so our cross entropy loss is:
# -(1 - L + L/n) * 0 + 400 * L/n = 400 L/n
logits = tf.constant([[100.0, -100.0, -100.0]])
labels = tf.constant([[1, 0, 0]])
label_smoothing = 0.1
loss = tf.contrib.losses.softmax_cross_entropy(
logits, labels, label_smoothing=label_smoothing)
self.assertEquals(loss.op.name, 'softmax_cross_entropy_loss/value')
expected_value = 400.0 * label_smoothing / 3.0
self.assertAlmostEqual(loss.eval(), expected_value, 3)
class SparseSoftmaxCrossEntropyLossTest(tf.test.TestCase):
def testNoneWeightRaisesValueError(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[0], [1], [2]])
with self.test_session():
with self.assertRaises(ValueError):
tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight=None)
def testAllCorrectInt32Labels(self):
with self.test_session():
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[0], [1], [2]], dtype=tf.int32)
loss = tf.contrib.losses.sparse_softmax_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'sparse_softmax_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 0.0, 3)
def testAllCorrectInt64Labels(self):
with self.test_session():
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[0], [1], [2]], dtype=tf.int64)
loss = tf.contrib.losses.sparse_softmax_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'sparse_softmax_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 0.0, 3)
def testAllCorrectNonColumnLabels(self):
with self.test_session():
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([0, 1, 2])
loss = tf.contrib.losses.sparse_softmax_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'sparse_softmax_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 0.0, 3)
def testAllWrongInt32Labels(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[2], [0], [1]], dtype=tf.int32)
with self.test_session():
loss = tf.contrib.losses.sparse_softmax_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'sparse_softmax_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 10.0, 3)
def testAllWrongInt64Labels(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[2], [0], [1]], dtype=tf.int64)
with self.test_session():
loss = tf.contrib.losses.sparse_softmax_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'sparse_softmax_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 10.0, 3)
def testAllWrongNonColumnLabels(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([2, 0, 1])
with self.test_session():
loss = tf.contrib.losses.sparse_softmax_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'sparse_softmax_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 10.0, 3)
def testNonZeroLossWithPythonScalarWeight(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[2], [0], [1]])
weight = 2.3
with self.test_session():
loss = tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight)
self.assertAlmostEqual(loss.eval(), weight * 10.0, 3)
def testNonZeroLossWithScalarTensorWeight(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[2], [0], [1]])
weight = 2.3
with self.test_session():
loss = tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, tf.constant(weight))
self.assertAlmostEqual(loss.eval(), weight * 10.0, 3)
def testNonZeroLossWithOneDimBatchSpecificWeights(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[2], [0], [1]])
weight = tf.constant([1.2, 3.4, 5.6], shape=[3])
with self.test_session():
loss = tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight)
self.assertAlmostEqual(loss.eval(), (1.2 + 3.4 + 5.6) * 10.0 / 3.0, 3)
def testNonZeroLossWithColumnWeights(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[2], [0], [1]])
weight = tf.constant([[1.2], [3.4], [5.6]])
with self.test_session():
loss = tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight)
self.assertAlmostEqual(loss.eval(), (1.2 + 3.4 + 5.6) * 10.0 / 3.0, 3)
def testAllWrongAllWeightsMissing(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[2], [0], [1]])
weight = tf.constant([0, 0, 0], shape=[3])
with self.test_session():
loss = tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight)
self.assertAlmostEqual(loss.eval(), 0.0, 3)
def testSomeWeightsMissing(self):
logits = tf.constant([[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]])
labels = tf.constant([[2], [0], [1]])
weight = tf.constant([1.2, 0, 0], shape=[3])
with self.test_session():
loss = tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight)
self.assertAlmostEqual(loss.eval(), 12.0, 3)
def testMeasurementSpecificWeightsRaisesException(self):
with self.test_session():
logits = tf.constant([[100.0, -100.0, -100.0],
[-100.0, 100.0, -100.0],
[-100.0, -100.0, 100.0]])
labels = tf.constant([[0], [1], [2]])
weight = tf.constant([[3, 4, 5],
[2, 6, 0],
[8, 0, 1]])
with self.assertRaises(ValueError):
tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight=weight).eval()
def testInconsistentWeightSizeRaisesException(self):
"""The weight tensor has incorrect number of elements."""
with self.test_session():
logits = tf.constant([[100.0, -100.0, -100.0],
[-100.0, 100.0, -100.0],
[-100.0, -100.0, 100.0]])
labels = tf.constant([[0], [1], [2]])
weight = tf.constant([1.2, 3.4, 5.6, 7.8])
with self.assertRaises(ValueError):
tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight=weight).eval()
def testInconsistentLabelSizeRaisesException(self):
"""The label tensor has incorrect number of elements."""
with self.test_session():
logits = tf.constant([[100.0, -100.0, -100.0],
[-100.0, 100.0, -100.0],
[-100.0, -100.0, 100.0]])
labels = tf.constant([[0], [1], [2], [3]])
weight = tf.constant([1.2, 3.4, 5.6])
with self.assertRaises(ValueError):
tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight=weight).eval()
def testInconsistentWeightShapeRaisesException(self):
"""The weight tensor has incorrect shape."""
with self.test_session():
logits = tf.constant([[100.0, -100.0, -100.0, -100.0],
[-100.0, 100.0, -100.0, -100.0],
[-100.0, -100.0, 100.0, -100.0],
[-100.0, -100.0, -100.0, 100.0]])
labels = tf.constant([[0], [1], [2], [3]])
weight = tf.constant([[1.2, 3.4], [5.6, 7.8]])
with self.assertRaises(ValueError):
tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight=weight).eval()
def testInconsistentLabelShapeRaisesException(self):
"""The label tensor has incorrect shape."""
with self.test_session():
logits = tf.constant([[100.0, -100.0, -100.0, -100.0],
[-100.0, 100.0, -100.0, -100.0],
[-100.0, -100.0, 100.0, -100.0],
[-100.0, -100.0, -100.0, 100.0]])
labels = tf.constant([[0, 1], [2, 3]])
weight = tf.constant([1.2, 3.4, 5.6, 7.8])
with self.assertRaises(tf.errors.InvalidArgumentError):
tf.contrib.losses.sparse_softmax_cross_entropy(
logits, labels, weight=weight).eval()
class SigmoidCrossEntropyLossTest(tf.test.TestCase):
def testAllCorrectSigmoid(self):
with self.test_session():
logits = tf.constant([[100.0, -100.0, -100.0],
[-100.0, 100.0, -100.0],
[-100.0, -100.0, 100.0]])
labels = tf.constant([[1, 0, 0],
[0, 1, 0],
[0, 0, 1]])
loss = tf.contrib.losses.sigmoid_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'sigmoid_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 0.0, 3)
def testLossWithSingleDimPlaceholderForLogitsAndWeights1(self):
logits = tf.placeholder(tf.float32, shape=(None, 1))
labels = tf.placeholder(tf.float32, shape=(None, 1))
weight = tf.ones_like(logits, dtype=tf.float32)
loss = tf.contrib.losses.sigmoid_cross_entropy(logits, labels, weight)
with self.test_session() as sess:
loss = sess.run(loss, feed_dict={
logits: np.ones((32, 1)),
labels: np.ones((32, 1)),
})
self.assertAlmostEqual(loss, 0.313, 3)
def testLossWithSingleDimPlaceholderForLogitsAndWeights2(self):
logits = tf.placeholder(tf.float32, shape=(None, 2))
labels = tf.placeholder(tf.float32, shape=(None, 2))
weight = tf.ones_like(logits, dtype=tf.float32)
loss = tf.contrib.losses.sigmoid_cross_entropy(logits, labels, weight)
with self.test_session() as sess:
loss = sess.run(loss, feed_dict={
logits: np.ones((32, 2)),
labels: np.ones((32, 2)),
})
self.assertAlmostEqual(loss, 0.313, 3)
def testAllWrongSigmoid(self):
with self.test_session():
logits = tf.constant([[100.0, -100.0, -100.0],
[-100.0, 100.0, -100.0],
[-100.0, -100.0, 100.0]])
labels = tf.constant([[0, 0, 1],
[1, 0, 0],
[0, 1, 0]])
loss = tf.contrib.losses.sigmoid_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'sigmoid_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 600.0 / 9.0, 3)
def testAllWrongSigmoidWithMeasurementSpecificWeights(self):
with self.test_session():
logits = tf.constant([[100.0, -100.0, -100.0],
[-100.0, 100.0, -100.0],
[-100.0, -100.0, 100.0]])
labels = tf.constant([[0, 0, 1],
[1, 0, 0],
[0, 1, 0]])
weight = tf.constant([[3, 4, 5],
[2, 6, 0],
[8, 0, 1]])
loss = tf.contrib.losses.sigmoid_cross_entropy(
logits, labels, weight=weight)
self.assertEquals(loss.op.name, 'sigmoid_cross_entropy_loss/value')
self.assertAlmostEqual(loss.eval(), 1700.0 / 7.0, 3)
def testMultiCorrectSigmoid(self):
logits = tf.constant([[100.0, -100.0, 100.0],
[100.0, 100.0, -100.0],
[-100.0, 100.0, 100.0]])
labels = tf.constant([[1, 0, 1],
[1, 1, 0],
[0, 1, 1]])
loss = tf.contrib.losses.sigmoid_cross_entropy(logits, labels)
self.assertEquals(loss.op.name, 'sigmoid_cross_entropy_loss/value')
with self.test_session():
self.assertAlmostEqual(loss.eval(), 0.0, 3)
def testSigmoidLabelSmoothingCorrect(self):
with self.test_session():
logits = tf.constant([[100.0, -100.0, -100.0]])
labels = tf.constant([[1, 0, 1]])
# Sigmoid cross entropy loss is:
# max(x,0) - x*z + log(1 + exp(-abs(x)))
# The new labels are:
# z' = z * (1 - L) + 0.5 L
# 1 -> 1 - 0.5 L
# 0 -> 0.5 L
# here we expect:
# 1/3 * (100 - 100 * (1 - 0.5 L) + 0
# + 0 + 100 * (0.5 L) + 0
# + 0 + 100 * (1 - 0.5 L) + 0)
# = 1/3 * (100 + 50 L)
label_smoothing = 0.1
loss = tf.contrib.losses.sigmoid_cross_entropy(
logits, labels, label_smoothing=label_smoothing)
self.assertEquals(loss.op.name, 'sigmoid_cross_entropy_loss/value')
expected_value = (100.0 + 50.0 * label_smoothing) / 3.0
self.assertAlmostEqual(loss.eval(), expected_value, 3)
def testSigmoidLabelSmoothingEqualsSoftmaxTwoLabel(self):
with self.test_session():
label_smoothing = 0.1
sigmoid_logits = tf.constant([[100.0, -100.0, -100.0]])
sigmoid_labels = tf.constant([[1, 0, 1]])
sigmoid_loss = tf.contrib.losses.sigmoid_cross_entropy(
sigmoid_logits, sigmoid_labels, label_smoothing=label_smoothing)
softmax_logits = tf.constant([[0.0, 100.0], [100.0, 0.0], [100.0, 0.0]])
softmax_labels = tf.constant([[0, 1], [1, 0], [0, 1]])
softmax_loss = tf.contrib.losses.softmax_cross_entropy(
softmax_logits, softmax_labels, label_smoothing=label_smoothing)
self.assertAlmostEqual(sigmoid_loss.eval(), softmax_loss.eval(), 3)
class LogLossTest(tf.test.TestCase):
def setUp(self):
predictions = np.asarray([.9, .2, .2, .8, .4, .6]).reshape((2, 3))
targets = np.asarray([1.0, 0.0, 1.0, 1.0, 0.0, 0.0]).reshape((2, 3))
self._np_predictions = predictions
self._np_targets = targets
epsilon = 1e-7
self._expected_losses = np.multiply(
targets, np.log(predictions + epsilon)) + np.multiply(
1 - targets, np.log(1 - predictions + epsilon))
self._predictions = tf.constant(predictions)
self._targets = tf.constant(targets)
def testValueErrorThrownWhenWeightIsNone(self):
with self.test_session():
with self.assertRaises(ValueError):
tf.contrib.losses.log_loss(self._targets, self._targets, weight=None)
def testAllCorrectNoLossWeight(self):
loss = tf.contrib.losses.log_loss(self._targets, self._targets)
with self.test_session():
self.assertAlmostEqual(0.0, loss.eval(), 3)
def testAllCorrectNoLossWeightWithPlaceholder(self):
tf_predictions = tf.placeholder(tf.float32, shape=self._np_targets.shape)
loss = tf.contrib.losses.log_loss(tf_predictions, self._targets)
with self.test_session():
self.assertAlmostEqual(0.0, loss.eval(feed_dict={
tf_predictions: self._np_targets}), 3)
def testNonZeroLoss(self):
loss = tf.contrib.losses.log_loss(self._predictions, self._targets)
with self.test_session():
self.assertAlmostEqual(-np.sum(self._expected_losses) / 6.0,
loss.eval(), 3)
def testNonZeroLossWithPythonScalarWeight(self):
weight = 2.3
loss = tf.contrib.losses.log_loss(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(weight * -np.sum(self._expected_losses) / 6.0,
loss.eval(), 3)
def testNonZeroLossWithScalarTensorWeight(self):
weight = 2.3
loss = tf.contrib.losses.log_loss(
self._predictions, self._targets, tf.constant(weight))
with self.test_session():
self.assertAlmostEqual(weight * -np.sum(self._expected_losses) / 6.0,
loss.eval(), 3)
def testNonZeroLossWithScalarTensorWeightAndPlaceholder(self):
tf_predictions = tf.placeholder(tf.float32,
shape=self._np_predictions.shape)
weight = 2.3
loss = tf.contrib.losses.log_loss(
tf_predictions, self._targets, tf.constant(weight))
with self.test_session() as sess:
loss = sess.run(loss, feed_dict={tf_predictions: self._np_predictions})
self.assertAlmostEqual(weight * -np.sum(self._expected_losses) / 6.0,
loss, 3)
def testNonZeroLossWithScalarTensorWeightAndPlaceholderWithRankOnly(self):
tf_predictions = tf.placeholder(tf.float32, shape=[None, None])
weight = 2.3
loss = tf.contrib.losses.log_loss(
tf_predictions, self._targets, tf.constant(weight))
with self.test_session() as sess:
loss = sess.run(loss, feed_dict={tf_predictions: self._np_predictions})
self.assertAlmostEqual(weight * -np.sum(self._expected_losses) / 6.0,
loss, 3)
def testNonZeroLossWithOneDimBatchSpecificWeights(self):
weight = tf.constant([1.2, 3.4], shape=[2])
expected_losses = np.multiply(
self._expected_losses,
np.asarray([1.2, 1.2, 1.2, 3.4, 3.4, 3.4]).reshape((2, 3)))
loss = tf.contrib.losses.log_loss(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(-np.sum(expected_losses) / 6.0,
loss.eval(), 3)
def testNonZeroLossWithOneDimBatchSpecificWeightsSomeZero(self):
weight = tf.constant([1.2, 0], shape=[2])
expected_losses = np.multiply(
self._expected_losses,
np.asarray([1.2, 1.2, 1.2, 0, 0, 0]).reshape((2, 3)))
loss = tf.contrib.losses.log_loss(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(-np.sum(expected_losses) / 3.0,
loss.eval(), 3)
def testNonZeroLossWithTwoDimBatchSpecificWeightsSomeZero(self):
weight = tf.constant([1.2, 0], shape=[2, 1])
expected_losses = np.multiply(
self._expected_losses,
np.asarray([1.2, 1.2, 1.2, 0, 0, 0]).reshape((2, 3)))
loss = tf.contrib.losses.log_loss(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(-np.sum(expected_losses) / 3.0,
loss.eval(), 3)
def testWeightsWithSameNumDimsButWrongShapeThrowsException(self):
weight = tf.constant(np.random.normal(size=(2, 4)), shape=[2, 4])
with self.test_session():
with self.assertRaises(ValueError):
tf.contrib.losses.log_loss(self._predictions, self._targets, weight)
def testNonZeroLossWithMeasurementSpecificWeights(self):
weight = np.array([3, 6, 5, 0, 4, 2]).reshape((2, 3))
expected_losses = np.multiply(self._expected_losses, weight)
loss = tf.contrib.losses.log_loss(
self._predictions,
self._targets,
weight=tf.constant(weight, shape=(2, 3)))
with self.test_session():
self.assertAlmostEqual(-np.sum(expected_losses) / 5.0, loss.eval(), 3)
def testNonZeroLossWithMeasurementSpecificWeightsWithPlaceholder(self):
weight = np.array([3, 6, 5, 0, 4, 2]).reshape((2, 3))
expected_losses = np.multiply(self._expected_losses, weight)
tf_predictions = tf.placeholder(tf.float32, shape=[2, 3])
loss = tf.contrib.losses.log_loss(
tf_predictions,
self._targets,
weight=tf.constant(weight, shape=(2, 3)))
with self.test_session() as sess:
loss = sess.run(loss, feed_dict={tf_predictions: self._np_predictions})
self.assertAlmostEqual(-np.sum(expected_losses) / 5.0, loss, 3)
def testNonZeroLossWithSampleSpecificWeightsMostZero(self):
weight = np.array([0, 0, 0, 0, 0, 2]).reshape((2, 3))
expected_losses = np.multiply(self._expected_losses, weight)
loss = tf.contrib.losses.log_loss(
self._predictions,
self._targets,
weight=tf.constant(weight, shape=(2, 3)))
with self.test_session():
self.assertAlmostEqual(-np.sum(expected_losses), loss.eval(), 3)
def testNonZeroLossWithSampleSpecificWeightsMostZeroWithPlaceholder(self):
weight = np.array([0, 0, 0, 0, 0, 2]).reshape((2, 3))
expected_losses = np.multiply(self._expected_losses, weight)
tf_predictions = tf.placeholder(tf.float32, shape=[2, 3])
tf_weight = tf.constant(weight, shape=(2, 3))
loss = tf.contrib.losses.log_loss(tf_predictions, self._targets, tf_weight)
with self.test_session() as sess:
loss = sess.run(loss, feed_dict={tf_predictions: self._np_predictions})
self.assertAlmostEqual(-np.sum(expected_losses), loss, 3)
def testLossWithSampleSpecificWeightsAllZero(self):
tf_weight = tf.zeros(shape=(2, 3))
loss = tf.contrib.losses.log_loss(
self._predictions, self._targets, tf_weight)
with self.test_session():
self.assertAlmostEqual(0.0, loss.eval(), 3)
class HingeLossTest(tf.test.TestCase):
def testIncompatibleShapes(self):
with self.test_session():
logits = tf.constant([[-1.0], [2.1]])
target = tf.constant([0.0, 1.0])
with self.assertRaises(ValueError):
_ = tf.contrib.losses.hinge_loss(logits, target).eval()
def testAllOutsideMargin(self):
with self.test_session():
logits = tf.constant([1.2, -1.4, -1.0, 2.1])
target = tf.constant([1.0, 0.0, 0.0, 1.0])
loss = tf.contrib.losses.hinge_loss(logits, target)
self.assertAllClose(loss.eval(), [0.0, 0.0, 0.0, 0.0], atol=1e-3)
def testSomeInsideMargin(self):
with self.test_session():
logits = tf.constant([[-0.7], [-1.4], [1.4], [0.6]])
target = tf.constant([[0.0], [0.0], [1.0], [1.0]])
loss = tf.contrib.losses.hinge_loss(logits, target)
# Examples 1 and 4 are on the correct side of the hyperplane but within
# the margin so they incur some (small) loss.
self.assertAllClose(loss.eval(), [[0.3], [0.0], [0.0], [0.4]], atol=1e-3)
def testSomeMisclassified(self):
with self.test_session():
logits = tf.constant([[[1.2], [0.4], [-1.0], [-1.1]]])
target = tf.constant([[[1.0], [0.0], [0.0], [1.0]]])
loss = tf.contrib.losses.hinge_loss(logits, target)
# Examples 2 and 4 are on the wrong side of the hyperplane so they incur
# some (fairly large) loss.
self.assertAllClose(
loss.eval(), [[[0.0], [1.4], [0.0], [2.1]]], atol=1e-3)
class MeanSquaredErrorTest(tf.test.TestCase):
def setUp(self):
self._predictions = tf.constant([4, 8, 12, 8, 1, 3], shape=(2, 3))
self._targets = tf.constant([1, 9, 2, -5, -2, 6], shape=(2, 3))
def testDeprecatedName(self):
loss = tf.contrib.losses.sum_of_squares(
self._predictions, self._predictions)
with self.test_session():
self.assertAlmostEqual(0.0, loss.eval(), 3)
def testValueErrorThrownWhenWeightIsNone(self):
with self.test_session():
with self.assertRaises(ValueError):
tf.contrib.losses.mean_squared_error(
self._predictions, self._predictions, weight=None)
def testAllCorrectNoLossWeight(self):
loss = tf.contrib.losses.mean_squared_error(
self._predictions, self._predictions)
with self.test_session():
self.assertAlmostEqual(0.0, loss.eval(), 3)
def testNonZeroLoss(self):
loss = tf.contrib.losses.mean_squared_error(
self._predictions, self._targets)
with self.test_session():
self.assertAlmostEqual(49.5, loss.eval(), 3)
def testNonZeroLossWithPythonScalarWeight(self):
weight = 2.3
loss = tf.contrib.losses.mean_squared_error(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(49.5 * weight, loss.eval(), 3)
def testNonZeroLossWithScalarTensorWeight(self):
weight = 2.3
loss = tf.contrib.losses.mean_squared_error(
self._predictions, self._targets, tf.constant(weight))
with self.test_session():
self.assertAlmostEqual(49.5 * weight, loss.eval(), 3)
def testNonZeroLossWithOneDimBatchSpecificWeights(self):
weight = tf.constant([1.2, 3.4], shape=[2,])
loss = tf.contrib.losses.mean_squared_error(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(767.8 / 6.0, loss.eval(), 3)
def testNonZeroLossWithTwoDimBatchSpecificWeights(self):
weight = tf.constant([1.2, 3.4], shape=[2, 1])
loss = tf.contrib.losses.mean_squared_error(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(767.8 / 6.0, loss.eval(), 3)
def testNonZeroLossWithSampleSpecificWeights(self):
weight = tf.constant([3, 6, 5, 0, 4, 2], shape=[2, 3])
loss = tf.contrib.losses.mean_squared_error(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(587 / 5.0, loss.eval(), 3)
def testNonZeroLossWithSampleSpecificWeightsMostZero(self):
weight = tf.constant([0, 0, 0, 0, 0, 2], shape=[2, 3])
loss = tf.contrib.losses.mean_squared_error(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(18.0, loss.eval(), 3)
def testLossWithSampleSpecificWeightsAllZero(self):
weight = tf.zeros((2, 3))
loss = tf.contrib.losses.mean_squared_error(
self._predictions, self._targets, weight)
with self.test_session():
self.assertAlmostEqual(0.0, loss.eval(), 3)
class MeanPairwiseSquaresErrorTest(tf.test.TestCase):
def setUp(self):
self._predictions = np.array([[4, 8, 12],
[8, 1, 3]])
self._targets = np.array([[1, 9, 2],
[-5, -5, 7]])
batch_size, dims = self._targets.shape
# Compute the expected loss 'manually'.
total = np.zeros((batch_size, 1))
for b in range(batch_size):
for i in range(dims):
for j in range(dims):
x = self._predictions[b, i].item() - self._predictions[b, j].item()
y = self._targets[b, i].item() - self._targets[b, j].item()
tmp = (x-y) * (x-y)
total[b] += tmp
self._expected_losses = np.divide(total, 9.0)
def testDeprecatedName(self):
loss = tf.contrib.losses.sum_of_pairwise_squares(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets))
with self.test_session():
self.assertAlmostEqual(np.sum(self._expected_losses), loss.eval(), 3)
def testValueErrorThrownWhenWeightIsNone(self):
with self.test_session():
with self.assertRaises(ValueError):
tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf.constant(self._targets),
targets=tf.constant(self._targets),
weight=None)
def testAllCorrectNoLossWeight(self):
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf.constant(self._targets),
targets=tf.constant(self._targets))
with self.test_session():
self.assertAlmostEqual(0.0, loss.eval(), 3)
def testNonZeroLoss(self):
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets))
with self.test_session():
self.assertAlmostEqual(np.sum(self._expected_losses), loss.eval(), 3)
def testGradientWithZeroWeight(self):
with tf.Graph().as_default():
tf.set_random_seed(0)
inputs = tf.ones((2, 3))
weights = tf.get_variable('weights',
shape=[3, 4],
initializer=tf.truncated_normal_initializer())
predictions = tf.matmul(inputs, weights)
optimizer = tf.train.MomentumOptimizer(learning_rate=0.001, momentum=0.9)
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions,
predictions,
0)
gradients_to_variables = optimizer.compute_gradients(loss)
init_op = tf.initialize_all_variables()
with self.test_session() as sess:
sess.run(init_op)
for grad, _ in gradients_to_variables:
np_grad = sess.run(grad)
self.assertFalse(np.isnan(np_grad).any())
def testNonZeroLossWithPythonScalarWeight(self):
weight = 2.3
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
weight=weight)
with self.test_session():
self.assertAlmostEqual(weight * np.sum(self._expected_losses),
loss.eval(), 3)
def testNonZeroLossWithScalarTensorWeight(self):
weight = 2.3
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
weight=tf.constant(weight))
with self.test_session():
self.assertAlmostEqual(weight * np.sum(self._expected_losses),
loss.eval(), 3)
def testNonZeroLossWithScalarZeroWeight(self):
weight = 0
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
weight=tf.constant(weight))
with self.test_session():
self.assertAlmostEqual(0, loss.eval(), 3)
def testNonZeroLossWithScalarTensorWeightWithPlaceholder(self):
weight = 2.3
tf_predictions = tf.placeholder(tf.float32, shape=self._predictions.shape)
tf_targets = tf.placeholder(tf.float32, shape=self._targets.shape)
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf_predictions,
targets=tf_targets,
weight=tf.constant(weight))
with self.test_session() as sess:
loss = sess.run(loss, feed_dict={
tf_predictions: self._predictions,
tf_targets: self._targets,
})
self.assertAlmostEqual(weight * np.sum(self._expected_losses), loss, 3)
def testNonZeroLossWithOneDimBatchSpecificWeights(self):
weight = np.asarray([2.0, 1.0]).reshape((2, 1))
expected_losses = np.multiply(weight, self._expected_losses)
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
weight=tf.constant(weight, shape=[2]))
with self.test_session():
self.assertAlmostEqual(np.sum(expected_losses), loss.eval(), 3)
def testZeroLossWithOneDimBatchZeroWeights(self):
weight = np.asarray([0.0, 0.0]).reshape((2, 1))
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
weight=tf.constant(weight, shape=[2]))
with self.test_session():
self.assertAlmostEqual(0, loss.eval(), 3)
def testNonZeroLossWithOneDimBatchSpecificWeightsAndPlaceholders(self):
weight = np.asarray([1.2, 3.4]).reshape((2, 1))
expected_losses = np.multiply(weight, self._expected_losses)
tf_predictions = tf.placeholder(tf.float32, shape=self._predictions.shape)
tf_targets = tf.placeholder(tf.int32, shape=self._targets.shape)
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf_predictions,
targets=tf_targets,
weight=tf.constant(weight, shape=[2]))
with self.test_session() as sess:
loss = sess.run(loss, feed_dict={
tf_predictions: self._predictions,
tf_targets: self._targets,
})
self.assertAlmostEqual(np.sum(expected_losses), loss, 3)
def testLossWithAllZeroBatchSpecificWeights(self):
weight = np.zeros((2, 1))
loss = tf.contrib.losses.mean_pairwise_squared_error(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
weight=tf.constant(weight, shape=[2]))
with self.test_session():
self.assertAlmostEqual(0.0, loss.eval(), 3)
class CosineDistanceLossTest(tf.test.TestCase):
def setUp(self):
self._predictions = np.asarray([[1, 0, 0], # Batch 1
[0, 0, -1],
[1, 0, 0], # Batch 2
[1, 0, 0],
[0, 0, -1], # Batch 3
[1, 0, 0]]).reshape((3, 2, 3))
self._targets = np.asarray([[1, 0, 0],
[0, 0, 1],
[0, 1, 0],
[1, 0, 0],
[0, 0, 1],
[0, 1, 0]]).reshape((3, 2, 3))
def testValueErrorThrownWhenWeightIsNone(self):
with self.test_session():
with self.assertRaises(ValueError):
tf.contrib.losses.cosine_distance(
predictions=tf.constant(self._targets),
targets=tf.constant(self._targets),
dim=2,
weight=None)
def testAllCorrectNoWeights(self):
loss = tf.contrib.losses.cosine_distance(
predictions=tf.constant(self._targets),
targets=tf.constant(self._targets),
dim=2)
with self.test_session():
self.assertAlmostEqual(0, loss.eval(), 5)
def testPartiallyCorrectWithIntegerValues(self):
loss = tf.contrib.losses.cosine_distance(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
dim=2)
with self.test_session():
self.assertAlmostEqual(1, loss.eval(), 5)
def testPartiallyCorrectFloatingPointValues(self):
predictions = np.matrix((
'0.819031913261206 0.567041924552012 0.087465312324590;'
'-0.665139432070255 -0.739487441769973 -0.103671883216994;'
'0.707106781186548 -0.707106781186548 0'))
targets = np.matrix((
'0.819031913261206 0.567041924552012 0.087465312324590;'
'0.665139432070255 0.739487441769973 0.103671883216994;'
'0.707106781186548 0.707106781186548 0'))
tf_preds = tf.constant(predictions, shape=(3, 1, 3), dtype=tf.float32)
tf_targets = tf.constant(targets, shape=(3, 1, 3), dtype=tf.float32)
loss = tf.contrib.losses.cosine_distance(tf_preds, tf_targets, dim=2)
with self.test_session():
self.assertAlmostEqual(1.0, loss.eval(), 5)
def testSampleSpecificWeights(self):
loss = tf.contrib.losses.cosine_distance(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
dim=2,
weight=tf.constant([1, 0, 0]))
with self.test_session():
self.assertEqual(1.0, loss.eval())
def testMeasurementSpecificWeights(self):
loss = tf.contrib.losses.cosine_distance(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
dim=2,
weight=tf.constant([1, 0, 0, 1, 1, 1], shape=(3, 2)))
with self.test_session():
self.assertEqual(3.0 / 4.0, loss.eval())
def testValueErrorThrownWithShapelessPlaceholder(self):
tf_predictions = tf.placeholder(tf.float32)
with self.test_session():
with self.assertRaises(ValueError):
tf.contrib.losses.cosine_distance(
predictions=tf_predictions,
targets=tf.constant(self._targets),
dim=2,
weight=tf.constant([1, 0, 0, 1, 1, 1], shape=(3, 2)))
def testMeasurementSpecificWeightsWithPlaceholderWithShape(self):
tf_predictions = tf.placeholder(tf.float32, shape=self._targets.shape)
loss = tf.contrib.losses.cosine_distance(
predictions=tf_predictions,
targets=tf.constant(self._targets),
dim=2,
weight=tf.constant([1, 0, 0, 1, 1, 1], shape=(3, 2)))
with self.test_session() as sess:
loss = sess.run(loss, feed_dict={tf_predictions: self._predictions})
self.assertEqual(3.0 / 4.0, loss)
def testZeroLossWhenAllSampleSpecificWeightsAreZero(self):
loss = tf.contrib.losses.cosine_distance(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
dim=2,
weight=tf.zeros((3,)))
with self.test_session():
self.assertEqual(0, loss.eval())
def testZeroLossWhenAllMeasurementSpecificWeightsAreZero(self):
loss = tf.contrib.losses.cosine_distance(
predictions=tf.constant(self._predictions),
targets=tf.constant(self._targets),
dim=2,
weight=tf.zeros((3, 2)))
with self.test_session():
self.assertEqual(0, loss.eval())
class ComputeWeightedLossTest(tf.test.TestCase):
def testHingeLoss(self):
logits = tf.constant([1.2, 0.4, -1.0, -1.1])
target = tf.constant([1.0, 0.0, 0.0, 1.0])
losses = tf.contrib.losses.hinge_loss(logits, target)
self.assertFalse(tf.contrib.losses.get_losses())
loss = tf.contrib.losses.compute_weighted_loss(losses)
self.assertTrue(tf.contrib.losses.get_losses())
with self.test_session():
self.assertAllClose(losses.eval(), [0.0, 1.4, 0.0, 2.1], atol=1e-3)
self.assertAllClose(loss.eval(), 3.5/4.0, atol=1e-3)
class AddLossTest(tf.test.TestCase):
def testAddExternalLoss(self):
logits = tf.constant([1.2, 0.4, -1.0, -1.1])
target = tf.constant([1.0, 0.0, 0.0, 1.0])
losses = tf.contrib.losses.hinge_loss(logits, target)
self.assertFalse(tf.contrib.losses.get_losses())
tf.contrib.losses.add_loss(tf.reduce_mean(losses))
self.assertTrue(tf.contrib.losses.get_losses())
total_loss = tf.contrib.losses.get_total_loss()
with self.test_session():
self.assertAllClose(losses.eval(), [0.0, 1.4, 0.0, 2.1], atol=1e-3)
self.assertAllClose(total_loss.eval(), 3.5/4.0, atol=1e-3)
def testNoneLossCollection(self):
logits = tf.constant([1.2, 0.4, -1.0, -1.1])
target = tf.constant([1.0, 0.0, 0.0, 1.0])
losses = tf.contrib.losses.hinge_loss(logits, target)
self.assertFalse(tf.contrib.losses.get_losses())
tf.contrib.losses.add_loss(tf.reduce_mean(losses), loss_collection=None)
self.assertFalse(tf.contrib.losses.get_losses())
with self.test_session():
self.assertAllClose(losses.eval(), [0.0, 1.4, 0.0, 2.1], atol=1e-3)
def testNoCollectLosses(self):
logits = tf.constant([1.2, 0.4, -1.0, -1.1])
target = tf.constant([1.0, 0.0, 0.0, 1.0])
self.assertFalse(tf.contrib.losses.get_losses())
with tf.contrib.framework.arg_scope([tf.contrib.losses.add_loss],
loss_collection=None):
tf.contrib.losses.absolute_difference(logits, target)
tf.contrib.losses.log_loss(logits, target)
tf.contrib.losses.mean_squared_error(logits, target)
tf.contrib.losses.sigmoid_cross_entropy(logits, target)
tf.contrib.losses.softmax_cross_entropy(logits, target)
self.assertFalse(tf.contrib.losses.get_losses())
if __name__ == '__main__':
tf.test.main()
| neilhan/tensorflow | tensorflow/contrib/losses/python/losses/loss_ops_test.py | Python | apache-2.0 | 48,390 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.
*/
package org.apache.ignite.spi.discovery.tcp;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import javax.cache.Cache;
import javax.cache.event.CacheEntryEvent;
import javax.cache.event.CacheEntryUpdatedListener;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteClientDisconnectedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.cache.query.ContinuousQuery;
import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.events.DiscoveryEvent;
import org.apache.ignite.events.Event;
import org.apache.ignite.internal.IgniteClientDisconnectedCheckedException;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.client.util.GridConcurrentHashSet;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.spi.IgniteSpiException;
import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Ignore;
import org.junit.Test;
import static org.apache.ignite.events.EventType.EVT_JOB_MAPPED;
import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.events.EventType.EVT_TASK_FAILED;
import static org.apache.ignite.events.EventType.EVT_TASK_FINISHED;
/**
* Test for {@link TcpDiscoverySpi}.
*/
public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest {
/** */
private static final int GRID_CNT = 5;
/** */
private static final int CLIENT_GRID_CNT = 5;
/** */
private static final ThreadLocal<Boolean> clientFlagPerThread = new ThreadLocal<>();
/** */
private static final ThreadLocal<UUID> nodeId = new ThreadLocal<>();
/** */
private static volatile boolean clientFlagGlobal;
/** */
private static GridConcurrentHashSet<UUID> failedNodes = new GridConcurrentHashSet<>();
/**
* @return Client node flag.
*/
private static boolean client() {
Boolean client = clientFlagPerThread.get();
return client != null ? client : clientFlagGlobal;
}
/**
* @throws Exception If fails.
*/
public TcpDiscoveryMultiThreadedTest() throws Exception {
super(false);
}
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setConsistentId(igniteInstanceName);
UUID id = nodeId.get();
if (id != null) {
cfg.setNodeId(id);
nodeId.set(null);
}
if (client())
cfg.setClientMode(true);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setJoinTimeout(60_000);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setNetworkTimeout(10_000);
int[] evts = {EVT_NODE_FAILED, EVT_NODE_LEFT};
Map<IgnitePredicate<? extends Event>, int[]> lsnrs = new HashMap<>();
lsnrs.put(new IgnitePredicate<Event>() {
@Override public boolean apply(Event evt) {
DiscoveryEvent discoveryEvt = (DiscoveryEvent)evt;
failedNodes.add(discoveryEvt.eventNode().id());
return true;
}
}, evts);
cfg.setLocalEventListeners(lsnrs);
cfg.setCacheConfiguration();
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
cfg.setIncludeProperties();
((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
return cfg;
}
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
stopAllGrids();
super.afterTest();
failedNodes.clear();
}
/** {@inheritDoc} */
@Override protected long getTestTimeout() {
return 5 * 60 * 1000;
}
/**
* @throws Exception If any error occurs.
*/
@Test
public void testMultiThreadedClientsRestart() throws Exception {
final AtomicBoolean done = new AtomicBoolean();
try {
clientFlagGlobal = false;
info("Test timeout: " + (getTestTimeout() / (60 * 1000)) + " min.");
startGridsMultiThreaded(GRID_CNT);
clientFlagGlobal = true;
startGridsMultiThreaded(GRID_CNT, CLIENT_GRID_CNT);
final AtomicInteger clientIdx = new AtomicInteger(GRID_CNT);
IgniteInternalFuture<?> fut1 = multithreadedAsync(
new Callable<Object>() {
@Override public Object call() throws Exception {
clientFlagPerThread.set(true);
int idx = clientIdx.getAndIncrement();
while (!done.get()) {
stopGrid(idx, true);
startGrid(idx);
}
return null;
}
},
CLIENT_GRID_CNT,
"client-restart");
Thread.sleep(getTestTimeout() - 60 * 1000);
done.set(true);
fut1.get();
}
finally {
done.set(true);
}
}
/**
* @throws Exception If any error occurs.
*/
@Ignore("https://issues.apache.org/jira/browse/IGNITE-1123")
@Test
public void testMultiThreadedClientsServersRestart() throws Throwable {
multiThreadedClientsServersRestart(GRID_CNT, CLIENT_GRID_CNT);
}
/**
* @throws Exception If any error occurs.
*/
@Ignore("https://issues.apache.org/jira/browse/IGNITE-1123")
@Test
public void testMultiThreadedServersRestart() throws Throwable {
multiThreadedClientsServersRestart(GRID_CNT * 2, 0);
}
/**
* @param srvs Number of servers.
* @param clients Number of clients.
* @throws Exception If any error occurs.
*/
private void multiThreadedClientsServersRestart(int srvs, int clients) throws Throwable {
final AtomicBoolean done = new AtomicBoolean();
try {
clientFlagGlobal = false;
info("Test timeout: " + (getTestTimeout() / (60 * 1000)) + " min.");
startGridsMultiThreaded(srvs);
IgniteInternalFuture<?> clientFut = null;
final AtomicReference<Throwable> error = new AtomicReference<>();
if (clients > 0) {
clientFlagGlobal = true;
startGridsMultiThreaded(srvs, clients);
final BlockingQueue<Integer> clientStopIdxs = new LinkedBlockingQueue<>();
for (int i = srvs; i < srvs + clients; i++)
clientStopIdxs.add(i);
final AtomicInteger clientStartIdx = new AtomicInteger(9000);
clientFut = multithreadedAsync(
new Callable<Object>() {
@Override public Object call() throws Exception {
try {
clientFlagPerThread.set(true);
while (!done.get() && error.get() == null) {
Integer stopIdx = clientStopIdxs.take();
log.info("Stop client: " + stopIdx);
stopGrid(stopIdx);
while (!done.get() && error.get() == null) {
// Generate unique name to simplify debugging.
int startIdx = clientStartIdx.getAndIncrement();
log.info("Start client: " + startIdx);
UUID id = UUID.randomUUID();
nodeId.set(id);
try {
Ignite ignite = startGrid(startIdx);
assertTrue(ignite.configuration().isClientMode());
clientStopIdxs.add(startIdx);
break;
}
catch (Exception e) {
if (X.hasCause(e, IgniteClientDisconnectedCheckedException.class) ||
X.hasCause(e, IgniteClientDisconnectedException.class))
log.info("Client disconnected: " + e);
else if (X.hasCause(e, ClusterTopologyCheckedException.class))
log.info("Client failed to start: " + e);
else {
if (failedNodes.contains(id) && X.hasCause(e, IgniteSpiException.class))
log.info("Client failed: " + e);
else
throw e;
}
}
}
}
}
catch (Throwable e) {
log.error("Unexpected error: " + e, e);
error.compareAndSet(null, e);
return null;
}
return null;
}
},
clients,
"client-restart");
}
final BlockingQueue<Integer> srvStopIdxs = new LinkedBlockingQueue<>();
for (int i = 0; i < srvs; i++)
srvStopIdxs.add(i);
final AtomicInteger srvStartIdx = new AtomicInteger(srvs + clients);
IgniteInternalFuture<?> srvFut = multithreadedAsync(
new Callable<Object>() {
@Override public Object call() throws Exception {
try {
clientFlagPerThread.set(false);
while (!done.get() && error.get() == null) {
int stopIdx = srvStopIdxs.take();
U.sleep(50);
Thread.currentThread().setName("stop-server-" + getTestIgniteInstanceName(stopIdx));
log.info("Stop server: " + stopIdx);
stopGrid(stopIdx);
// Generate unique name to simplify debugging.
int startIdx = srvStartIdx.getAndIncrement();
Thread.currentThread().setName("start-server-" + getTestIgniteInstanceName(startIdx));
log.info("Start server: " + startIdx);
try {
Ignite ignite = startGrid(startIdx);
assertFalse(ignite.configuration().isClientMode());
srvStopIdxs.add(startIdx);
}
catch (IgniteCheckedException e) {
log.info("Failed to start: " + e);
}
}
}
catch (Throwable e) {
log.error("Unexpected error: " + e, e);
error.compareAndSet(null, e);
return null;
}
return null;
}
},
srvs - 1,
"server-restart");
final long timeToExec = getTestTimeout() - 60_000;
final long endTime = System.currentTimeMillis() + timeToExec;
while (System.currentTimeMillis() < endTime) {
Thread.sleep(3000);
if (error.get() != null) {
Throwable err = error.get();
U.error(log, "Test failed: " + err.getMessage());
done.set(true);
if (clientFut != null)
clientFut.cancel();
srvFut.cancel();
throw err;
}
}
log.info("Stop test.");
done.set(true);
if (clientFut != null)
clientFut.get();
srvFut.get();
}
finally {
done.set(true);
}
}
/**
* @throws Exception If any error occurs.
*/
@Test
public void testTopologyVersion() throws Exception {
clientFlagGlobal = false;
startGridsMultiThreaded(GRID_CNT);
long prev = 0;
for (Ignite g : G.allGrids()) {
IgniteKernal kernal = (IgniteKernal)g;
long ver = kernal.context().discovery().topologyVersion();
info("Top ver: " + ver);
if (prev == 0)
prev = ver;
}
info("Test finished.");
}
/**
* @throws Exception If any error occurs.
*/
@Test
public void testMultipleStartOnCoordinatorStop() throws Exception{
for (int k = 0; k < 3; k++) {
log.info("Iteration: " + k);
clientFlagGlobal = false;
final int START_NODES = 5;
final int JOIN_NODES = 10;
startGrids(START_NODES);
final CyclicBarrier barrier = new CyclicBarrier(JOIN_NODES + 1);
final AtomicInteger startIdx = new AtomicInteger(START_NODES);
IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
@Override public Object call() throws Exception {
int idx = startIdx.getAndIncrement();
Thread.currentThread().setName("start-thread-" + idx);
barrier.await();
Ignite ignite = startGrid(idx);
assertFalse(ignite.configuration().isClientMode());
log.info("Started node: " + ignite.name());
return null;
}
}, JOIN_NODES, "start-thread");
barrier.await();
U.sleep(ThreadLocalRandom.current().nextInt(10, 100));
for (int i = 0; i < START_NODES; i++)
stopGrid(i);
fut.get();
stopAllGrids();
}
}
/**
* @throws Exception If failed.
*/
@Ignore("https://issues.apache.org/jira/browse/IGNITE-10198")
@Test
public void testCustomEventOnJoinCoordinatorStop() throws Exception {
for (int k = 0; k < 10; k++) {
log.info("Iteration: " + k);
clientFlagGlobal = false;
final int START_NODES = 5;
final int JOIN_NODES = 5;
startGrids(START_NODES);
final AtomicInteger startIdx = new AtomicInteger(START_NODES);
final AtomicBoolean stop = new AtomicBoolean();
IgniteInternalFuture<?> fut1 = GridTestUtils.runAsync(new Callable<Void>() {
@Override public Void call() throws Exception {
String cacheName = DEFAULT_CACHE_NAME + "-tmp";
Ignite ignite = ignite(START_NODES - 1);
while (!stop.get()) {
CacheConfiguration ccfg = new CacheConfiguration(cacheName);
ignite.createCache(ccfg);
ignite.destroyCache(ccfg.getName());
}
return null;
}
});
try {
final CyclicBarrier barrier = new CyclicBarrier(JOIN_NODES + 1);
IgniteInternalFuture<?> fut2 = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
@Override public Object call() throws Exception {
int idx = startIdx.getAndIncrement();
Thread.currentThread().setName("start-thread-" + idx);
barrier.await();
Ignite ignite = startGrid(idx);
assertFalse(ignite.configuration().isClientMode());
log.info("Started node: " + ignite.name());
IgniteCache<Object, Object> cache = ignite.getOrCreateCache(DEFAULT_CACHE_NAME);
ContinuousQuery<Object, Object> qry = new ContinuousQuery<>();
qry.setLocalListener(new CacheEntryUpdatedListener<Object, Object>() {
@Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> evts) {
// No-op.
}
});
QueryCursor<Cache.Entry<Object, Object>> cur = cache.query(qry);
cur.close();
return null;
}
}, JOIN_NODES, "start-thread");
barrier.await();
U.sleep(ThreadLocalRandom.current().nextInt(10, 100));
for (int i = 0; i < START_NODES - 1; i++) {
GridTestUtils.invoke(ignite(i).configuration().getDiscoverySpi(), "simulateNodeFailure");
stopGrid(i);
}
stop.set(true);
fut1.get();
fut2.get();
}
finally {
stop.set(true);
fut1.get();
}
stopAllGrids();
}
}
/**
* @throws Exception If failed.
*/
@Ignore("https://issues.apache.org/jira/browse/IGNITE-10198")
@Test
public void testClientContinuousQueryCoordinatorStop() throws Exception {
for (int k = 0; k < 10; k++) {
log.info("Iteration: " + k);
clientFlagGlobal = false;
final int START_NODES = 5;
final int JOIN_NODES = 5;
startGrids(START_NODES);
ignite(0).createCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME));
final AtomicInteger startIdx = new AtomicInteger(START_NODES);
final CyclicBarrier barrier = new CyclicBarrier(JOIN_NODES + 1);
clientFlagGlobal = true;
IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
@Override public Object call() throws Exception {
int idx = startIdx.getAndIncrement();
Thread.currentThread().setName("start-thread-" + idx);
barrier.await();
Ignite ignite = startGrid(idx);
assertTrue(ignite.configuration().isClientMode());
log.info("Started node: " + ignite.name());
IgniteCache<Object, Object> cache = ignite.getOrCreateCache(DEFAULT_CACHE_NAME);
for (int i = 0; i < 10; i++) {
ContinuousQuery<Object, Object> qry = new ContinuousQuery<>();
qry.setLocalListener(new CacheEntryUpdatedListener<Object, Object>() {
@Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> evts) {
// No-op.
}
});
cache.query(qry);
}
return null;
}
}, JOIN_NODES, "start-thread");
barrier.await();
U.sleep(ThreadLocalRandom.current().nextInt(100, 500));
for (int i = 0; i < START_NODES - 1; i++) {
GridTestUtils.invoke(ignite(i).configuration().getDiscoverySpi(), "simulateNodeFailure");
stopGrid(i);
}
fut.get();
stopAllGrids();
}
}
/**
* @throws Exception If failed.
*/
@Ignore("https://issues.apache.org/jira/browse/IGNITE-10249")
@Test
public void testCustomEventNodeRestart() throws Exception {
clientFlagGlobal = false;
Ignite ignite = startGrid(0);
ignite.getOrCreateCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME));
final long stopTime = System.currentTimeMillis() + 60_000;
GridTestUtils.runMultiThreaded(new IgniteInClosure<Integer>() {
@Override public void apply(Integer idx) {
try {
while (System.currentTimeMillis() < stopTime) {
Ignite ignite = startGrid(idx + 1);
IgniteCache<Object, Object> cache = ignite.cache(DEFAULT_CACHE_NAME);
int qryCnt = ThreadLocalRandom.current().nextInt(10) + 1;
for (int i = 0; i < qryCnt; i++) {
ContinuousQuery<Object, Object> qry = new ContinuousQuery<>();
qry.setLocalListener(new CacheEntryUpdatedListener<Object, Object>() {
@Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> evts) {
// No-op.
}
});
QueryCursor<Cache.Entry<Object, Object>> cur = cache.query(qry);
cur.close();
}
GridTestUtils.invoke(ignite.configuration().getDiscoverySpi(), "simulateNodeFailure");
ignite.close();
}
}
catch (Exception e) {
log.error("Unexpected error: " + e, e);
throw new IgniteException(e);
}
}
}, 5, "node-restart");
}
}
| ilantukh/ignite | modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java | Java | apache-2.0 | 24,012 |
/*@import url(old.css);*/
/********* NEW STYLE *******/
body{font-family:'微软雅黑',sans-serif; }
.link{cursor: pointer;}
div.line{margin:5px 0;}
.panel{margin:0 5%;font-size:120%;}
.page-top{background:#f5f5f5;color:#333;opacity:1;filter:alpha(opacity=100);width:100%;font-size:100%;font-size:100%;border-bottom: solid 1px #ddd;line-height:25px;}
.page-top .panel{}
.page-top .panel ul{margin:0;list-style: none;}
.page-top .links a{color:#333;}
.page-top .links a:hover{}
.page-top .links li{float:left;color:#fff;}
.page-top .links li.hover,.page-top .links li.drop:hover{background:#333;}
/* HEADER */
.page-header{margin:0 auto;background:#fff url(top_bg.gif) center bottom repeat-x;padding:20px 0;}
.page-header .logo{display:inherit;text-indent: 0;}
.page-header .logo h1{text-indent: -999em;}
.page-header .search{top:60px;left:600px;}
/* 导航 */
.page-navigator{margin:0 auto;background:green;height:45px;font-size:125%;border-top:solid 1px #fff;border-bottom:solid 0px #fff;}
.page-navigator .navs,.page-navigator .left,.page-navigator .right{padding-bottom:0px;margin-bottom:-0px;}
/*.page-navigator .left{background:url(navigator_lft.gif) left top no-repeat;}
.page-navigator .right{background:url(navigator_rgt.gif) right top no-repeat;}
.page-navigator .navs{background: url(navigator_navs_bg.gif) 120px top no-repeat;}*/
.page-navigator .left,.page-navigator .right{display:none;}
.page-navigator .navs{margin:0 5%;}
.page-navigator .navs ul{padding:0 10px;line-height:45px;}
.page-navigator .navs li{border-right:solid 0px #fff;}
.page-navigator .navs li.current{background:#ddd url(navigator_current.gif) center 7px no-repeat;}
.page-navigator .navs li.last{border:none;}
.page-navigator .navs li a{color:#fff;text-decoration:none;font-weight:bold;padding:0 25px;text-align:center;}
.page-navigator .navs li a:hover{color:#000;}
.page-navigator .navs li.current a{color:green;}
/*#navigator .navs li.current .child a{background-image:none;}*/
.page-navigator .child{top:45px;background:#f5f5f5;width:140px;}
.page-navigator .child ul{padding:0;}
.page-navigator .child .menu li{
border:none;
border-bottom:solid 1px #eee;line-height:30px;height:30px;}
.page-navigator .child .menu li a{font-size:12px;color:#666;display:block;text-align:left;padding:0 20px;}
.page-navigator .child .menu li a:hover{color:#000;background:#d81e05;color:#fff;}
.page-navigator .child .menu li.current{background:none;}
.page-navigator .child2,.page-navigator .child21{width:200px;}
.page-navigator .child31{width:300px;}
.page-navigator .child39{width:250px;}
.sitemap{line-height:30px;margin:20px 0 20px 0;color:#666;}
.sitemap a{color:#666;}
.sitemap a:hover{color:red;}
.page-footer{height:50px;overflow:hidden;
background:green;color:#fff;padding:10px 0;}
.page-footer .panel{width:950px;position:relative;margin:0px auto;
background:url(logo_footer.png) left center no-repeat;
line-height: 40px;height: 40px;
}
.page-footer .center{float:left;padding-left:400px;}
.page-footer .social .icon{display: inline-block;text-indent: -999px;
background:url(social.gif) left center no-repeat;float:left;padding:11px 15px;
height:22px;overflow: hidden;margin-left:6px;}
.page-footer .social .icon-linkedin{background-position: -30px center}
.page-footer .social .icon-weibo{background-position: -60px center}
.page-footer .social .icon-qq{background-position: -90px center}
/* VALIDATE */
.validator{font-size:120%;margin-left:1em;}
.valid-error{border-radius: 10px;background:#ff0000;color:#fff;padding:3px 10px;line-height:25px;}
.valid-right{color:green;}
.form{}
.form .fl{padding:10px 0;margin:0;}
.form .fl div.label{width:140px;text-align: right;float:left;font-size:120%;}
.form .fl div.in{margin-left:140px;}
.form .fl div.in div{margin:5px 0;font-size:100%;color:#666;}
/* LOGIN PAGE */
.login-left label{width:80px;text-align:right;padding-right:10px;float:left;font-size:125%;}
.login-left{width:30%;float:left;border-right:dashed 1px #ddd;
padding:0 10%;
}
.login-left h1{font-size:150%;}
.login-tip{border:solid 1px orange;background:#ffffcc;padding:5px;}
.login-right{width:45%;float:right;}
.login-left-note{padding-left:90px;padding-top:20px;font-size:125%;}
.login-left .fl div.label{width:80px;}
.login-left .fl div.in{margin-left:80px;}
/* REGISTER PAGE */
.reg-panel{width:50%;border-right: solid 1px #ddd;}
.reg-panel .rp-i{padding:10px 0;margin:0;}
.reg-panel .rp-i div.label{width:140px;text-align: right;float:left;font-size:120%;}
.reg-panel .rp-i div.in{margin-left:140px;}
.reg-panel .rp-i div.in div{margin:5px 0;font-size:100%;color:#666;}
/* ORDING PANEL */
.loading-gate{display:none;position: absolute;top:0;left:0;z-index:100;}
.loading-gate .gate{opacity:0.7;filter:alpha(opacity=70);background:#fff;widht:100%;height:100%;}
.loading-gate div.box{position:absolute;left:0;top:0;
background:url(loadingapple.gif) left center no-repeat;padding-left:2em;line-height: 50px;font-size:250%;
z-index:101;color:green;
}
.ording-panel{margin:1% 0;overflow:hidden;
width:80%;float:left;
}
.ording-panel .category-panel{
height:100%;float:left;
width:15%;
background:#ddd;
}
.ording-panel .category-panel ul{margin:10px 20px;list-style:none;padding:0;}
.ording-panel .category-panel li{margin:0 10px;padding:8px 20px;line-height:20px;font-size:125%;cursor:pointer;text-align:center;
}
.ording-panel .category-panel li.current{background:#fff;border-radius: 5px;}
.items-panel{background:#f8f8f8;width:85%;height:100%;overflow-y:auto;}
.items-panel ul{margin:0;padding:0;list-style:none;}
.items-panel li{border-top:solid 1px #fff;border-bottom:solid 1px #ddd;
padding:1% 5%;position:relative;clear:both;height:10em;}
.items-panel li img{float:left;width:120px;height:90px;border:solid 1px #aaa;
padding:1px;background:#fff;margin-right:8em;}
.items-panel h3{padding-top:1.5em;}
.ording-summary{width:20%;float:right;position: relative;}
/* shopping_confirm */
.shopping-confirm{}
.shopping-confirm p.shopping-error{font-size:200%;text-align:center;color:#ff0000;}
.order-confirm-panel{position:relative;}
.order-confirm-panel .item .item_ctrl{display:none;}
.order-confirm-panel .item .item_info{display:inherit;}
.order-confirm-panel .item{padding:20px;border:solid 1px #ddd;border-top-width:0; }
.order-confirm-panel .first_item{border-top:solid 1px #ddd;}
.order-confirm-panel .item h2{font-size:120%;color:#000;}
.order-confirm-panel .item h2 span{padding-left:15px;}
.order-confirm-panel .item h2 span a{color:#666;text-decoration: none;outline:none;font-size:80%;}
/* 操作PANEL */
.order-confirm-panel .active_item{border:solid 2px #ff6600;padding:18px;}
.order-confirm-panel .active_item .item_info{display:none;}
.order-confirm-panel .active_item .item_ctrl{display:inherit;}
.order-confirm-panel .active_item h2 span{display:none;}
.order-confirm-panel .confirm-button{display:inline-block;padding:8px 15px;background:green;color:#fff;text-decoration: none;font-size:100%;}
.order-confirm-panel .submit-panel{text-align: right;background:#ddd;padding:10px 30px;}
.order-confirm-panel .submit-panel .final_fee{font-size:120%;color:red;font-weight: bold;padding:0 5px;}
.order-confirm-panel .cash-panel{padding:2%;
border:solid 1px #ddd;background:#f0f0f0;}
.order-confirm-panel .main-panel{padding:3%;border:solid 2px #ddd;border-radius: 5px;}
.order-confirm-panel .order-panel{}
.order-confirm-panel .order-panel p.summary{padding:1%;background:#ddd;color:#000;
font-size:120%;border:solid 1px #666;line-height:200%;}
.order-confirm-panel .coupon_desc{
border:solid 1px #ff6600;padding:20px;font-size:100%;
margin-top:20px;background:gold;
}
.order-confirm-panel .coupon_desc em{
color:green;line-height: 200%;
}
.order-confirm-panel .form .fl div.label{width:80px;}
.order-confirm-panel .form{margin:20px 0;border-top:solid 1px #ddd;padding:10px;}
.order-confirm-panel .form .fl div.in{margin-left:80px;}
.cart_details_table{width:100%;border:solid 0px #ddd;}
.cart_details_table td{padding:5px 15px;line-height:125%;}
.cart_details_table thead td{background:#f0f0f0;border-bottom:solid 1px #ddd;line-height:150%;}
.cart_details_table img.goods-thumb{float:left;width:30px;height:30px;margin-right:5px;}
/* 餐盒 */
.cart-panel {
position: fixed;
bottom: 0px;
z-index: 10000000;
width: 20%;
background: white;
display: none;
border: solid 1px green;
padding: 1px;
}
#plcart h3 {
background: #3EAF0E;
margin: 0;
padding: 5px;
color: white;
}
#plcart p {
background: #f0f0f0;
text-align: center;
}
#plcart .submit {
text-align: center;
padding: 8px 0 5px 0;
}
.cart table {
background: white;
width: 100%;
}
.cart table th {
background: #f0f0f0;
}
.cart table td {
text-align: center;
}
.cart table td input {
border: solid 1px #e0e0e0;
font-size: 10px;
height: 15px;
}
.cart table td a {
margin: 0 2px;
}
.cart table .cart_q {
width: 15px;
text-align: center;
}
div.cuporn {
background: #f0f0f0;
position: absolute;
right: 5px;
top: 30px;
width: 160px;
overflow: hidden;
}
div.cuporn h2 {
background: orange;
color: white;
padding: 0 10px;
line-height: 20px;
margin: 0;
}
div.cuporn .fd_items {
width: 160px;
height: 160px;
overflow: hidden;
border-bottom: solid 1px white;
}
div.cuporn .fd_items img {
width: 150px;
height: 120px;
}
div.cuporn .fd_items em {
display: none;
}
div.cuporn .fd_items .name {
display: none;
}
div.cuporn .fd_items .price {
position: absolute;
color: #666;
left: 0;
bottom: 5px;
}
.items-panel .add {
position: absolute;
right: 10px;
bottom: 5px;
width: 62px;
background: white url(green_btn.gif) right center no-repeat;
padding-left: 5px;
text-decoration: none;
}
div.cuporn .fd_items .zhekou {
position: absolute;
left: 0;
top: 45px;
background: white;
padding: 1px 10px;
opacity: 0.8;
color: green;
filter: alpha(opacity = 89)
} | re661b/go2o | static/css/shop/default/style.css | CSS | apache-2.0 | 10,007 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.
*/
package org.apache.kafka.streams.processor.internals;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.InvalidOffsetException;
import org.apache.kafka.clients.consumer.MockConsumer;
import org.apache.kafka.clients.consumer.OffsetResetStrategy;
import org.apache.kafka.common.PartitionInfo;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.errors.TimeoutException;
import org.apache.kafka.common.utils.LogContext;
import org.apache.kafka.common.utils.Utils;
import org.apache.kafka.streams.KeyValue;
import org.apache.kafka.streams.errors.StreamsException;
import org.apache.kafka.streams.processor.StateRestoreListener;
import org.apache.kafka.test.MockRestoreCallback;
import org.apache.kafka.test.MockStateRestoreListener;
import org.easymock.EasyMock;
import org.easymock.EasyMockRunner;
import org.easymock.Mock;
import org.easymock.MockType;
import org.hamcrest.CoreMatchers;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.time.Duration;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.apache.kafka.test.MockStateRestoreListener.RESTORE_BATCH;
import static org.apache.kafka.test.MockStateRestoreListener.RESTORE_END;
import static org.apache.kafka.test.MockStateRestoreListener.RESTORE_START;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@RunWith(EasyMockRunner.class)
public class StoreChangelogReaderTest {
@Mock(type = MockType.NICE)
private RestoringTasks active;
@Mock(type = MockType.NICE)
private StreamTask task;
private final MockStateRestoreListener callback = new MockStateRestoreListener();
private final CompositeRestoreListener restoreListener = new CompositeRestoreListener(callback);
private final MockConsumer<byte[], byte[]> consumer = new MockConsumer<>(OffsetResetStrategy.EARLIEST);
private final StateRestoreListener stateRestoreListener = new MockStateRestoreListener();
private final TopicPartition topicPartition = new TopicPartition("topic", 0);
private final LogContext logContext = new LogContext("test-reader ");
private final StoreChangelogReader changelogReader = new StoreChangelogReader(consumer, Duration.ZERO, stateRestoreListener, logContext);
@Before
public void setUp() {
restoreListener.setUserRestoreListener(stateRestoreListener);
}
@Test
public void shouldRequestTopicsAndHandleTimeoutException() {
final AtomicBoolean functionCalled = new AtomicBoolean(false);
final MockConsumer<byte[], byte[]> consumer = new MockConsumer<byte[], byte[]>(OffsetResetStrategy.EARLIEST) {
@Override
public Map<String, List<PartitionInfo>> listTopics() {
functionCalled.set(true);
throw new TimeoutException("KABOOM!");
}
};
final StoreChangelogReader changelogReader = new StoreChangelogReader(consumer, Duration.ZERO, stateRestoreListener, logContext);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true, "storeName"));
changelogReader.restore(active);
assertTrue(functionCalled.get());
}
@Test
public void shouldThrowExceptionIfConsumerHasCurrentSubscription() {
final StateRestorer mockRestorer = EasyMock.mock(StateRestorer.class);
mockRestorer.setUserRestoreListener(stateRestoreListener);
expect(mockRestorer.partition())
.andReturn(new TopicPartition("sometopic", 0))
.andReturn(new TopicPartition("sometopic", 0))
.andReturn(new TopicPartition("sometopic", 0))
.andReturn(new TopicPartition("sometopic", 0));
EasyMock.replay(mockRestorer);
changelogReader.register(mockRestorer);
consumer.subscribe(Collections.singleton("sometopic"));
try {
changelogReader.restore(active);
fail("Should have thrown IllegalStateException");
} catch (final StreamsException expected) {
// ok
}
}
@Test
public void shouldRestoreAllMessagesFromBeginningWhenCheckpointNull() {
final int messages = 10;
setupConsumer(messages, topicPartition);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true, "storeName"));
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
replay(active, task);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(messages));
}
@Test
public void shouldRecoverFromInvalidOffsetExceptionAndFinishRestore() {
final int messages = 10;
setupConsumer(messages, topicPartition);
consumer.setException(new InvalidOffsetException("Try Again!") {
@Override
public Set<TopicPartition> partitions() {
return Collections.singleton(topicPartition);
}
});
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true,
"storeName"));
EasyMock.expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
EasyMock.replay(active, task);
// first restore call "fails" but we should not die with an exception
assertEquals(0, changelogReader.restore(active).size());
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true,
"storeName"));
// retry restore should succeed
assertEquals(1, changelogReader.restore(active).size());
assertThat(callback.restored.size(), equalTo(messages));
}
@Test
public void shouldRestoreMessagesFromCheckpoint() {
final int messages = 10;
setupConsumer(messages, topicPartition);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, 5L, Long.MAX_VALUE, true,
"storeName"));
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(5));
}
@Test
public void shouldClearAssignmentAtEndOfRestore() {
final int messages = 1;
setupConsumer(messages, topicPartition);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true,
"storeName"));
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
replay(active, task);
changelogReader.restore(active);
assertThat(consumer.assignment(), equalTo(Collections.<TopicPartition>emptySet()));
}
@Test
public void shouldRestoreToLimitWhenSupplied() {
setupConsumer(10, topicPartition);
final StateRestorer restorer = new StateRestorer(topicPartition, restoreListener, null, 3, true,
"storeName");
changelogReader.register(restorer);
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
replay(active, task);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(3));
assertThat(restorer.restoredOffset(), equalTo(3L));
}
@Test
public void shouldRestoreMultipleStores() {
final TopicPartition one = new TopicPartition("one", 0);
final TopicPartition two = new TopicPartition("two", 0);
final MockRestoreCallback callbackOne = new MockRestoreCallback();
final MockRestoreCallback callbackTwo = new MockRestoreCallback();
final CompositeRestoreListener restoreListener1 = new CompositeRestoreListener(callbackOne);
final CompositeRestoreListener restoreListener2 = new CompositeRestoreListener(callbackTwo);
setupConsumer(10, topicPartition);
setupConsumer(5, one);
setupConsumer(3, two);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true, "storeName1"));
changelogReader.register(new StateRestorer(one, restoreListener1, null, Long.MAX_VALUE, true, "storeName2"));
changelogReader.register(new StateRestorer(two, restoreListener2, null, Long.MAX_VALUE, true, "storeName3"));
expect(active.restoringTaskFor(one)).andStubReturn(task);
expect(active.restoringTaskFor(two)).andStubReturn(task);
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
replay(active, task);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(10));
assertThat(callbackOne.restored.size(), equalTo(5));
assertThat(callbackTwo.restored.size(), equalTo(3));
}
@Test
public void shouldRestoreAndNotifyMultipleStores() throws Exception {
final TopicPartition one = new TopicPartition("one", 0);
final TopicPartition two = new TopicPartition("two", 0);
final MockStateRestoreListener callbackOne = new MockStateRestoreListener();
final MockStateRestoreListener callbackTwo = new MockStateRestoreListener();
final CompositeRestoreListener restoreListener1 = new CompositeRestoreListener(callbackOne);
final CompositeRestoreListener restoreListener2 = new CompositeRestoreListener(callbackTwo);
setupConsumer(10, topicPartition);
setupConsumer(5, one);
setupConsumer(3, two);
changelogReader
.register(new StateRestorer(topicPartition, restoreListener, 0L, Long.MAX_VALUE, true, "storeName1"));
changelogReader.register(new StateRestorer(one, restoreListener1, 0L, Long.MAX_VALUE, true, "storeName2"));
changelogReader.register(new StateRestorer(two, restoreListener2, 0L, Long.MAX_VALUE, true, "storeName3"));
expect(active.restoringTaskFor(one)).andReturn(task);
expect(active.restoringTaskFor(two)).andReturn(task);
expect(active.restoringTaskFor(topicPartition)).andReturn(task);
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
replay(active, task);
changelogReader.restore(active);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(10));
assertThat(callbackOne.restored.size(), equalTo(5));
assertThat(callbackTwo.restored.size(), equalTo(3));
assertAllCallbackStatesExecuted(callback, "storeName1");
assertCorrectOffsetsReportedByListener(callback, 0L, 9L, 10L);
assertAllCallbackStatesExecuted(callbackOne, "storeName2");
assertCorrectOffsetsReportedByListener(callbackOne, 0L, 4L, 5L);
assertAllCallbackStatesExecuted(callbackTwo, "storeName3");
assertCorrectOffsetsReportedByListener(callbackTwo, 0L, 2L, 3L);
}
@Test
public void shouldOnlyReportTheLastRestoredOffset() {
setupConsumer(10, topicPartition);
changelogReader
.register(new StateRestorer(topicPartition, restoreListener, 0L, 5, true, "storeName1"));
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
replay(active, task);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(5));
assertAllCallbackStatesExecuted(callback, "storeName1");
assertCorrectOffsetsReportedByListener(callback, 0L, 4L, 5L);
}
private void assertAllCallbackStatesExecuted(final MockStateRestoreListener restoreListener,
final String storeName) {
assertThat(restoreListener.storeNameCalledStates.get(RESTORE_START), equalTo(storeName));
assertThat(restoreListener.storeNameCalledStates.get(RESTORE_BATCH), equalTo(storeName));
assertThat(restoreListener.storeNameCalledStates.get(RESTORE_END), equalTo(storeName));
}
private void assertCorrectOffsetsReportedByListener(final MockStateRestoreListener restoreListener,
final long startOffset,
final long batchOffset,
final long totalRestored) {
assertThat(restoreListener.restoreStartOffset, equalTo(startOffset));
assertThat(restoreListener.restoredBatchOffset, equalTo(batchOffset));
assertThat(restoreListener.totalNumRestored, equalTo(totalRestored));
}
@Test
public void shouldNotRestoreAnythingWhenPartitionIsEmpty() {
final StateRestorer
restorer =
new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true, "storeName");
setupConsumer(0, topicPartition);
changelogReader.register(restorer);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(0));
assertThat(restorer.restoredOffset(), equalTo(0L));
}
@Test
public void shouldNotRestoreAnythingWhenCheckpointAtEndOffset() {
final Long endOffset = 10L;
setupConsumer(endOffset, topicPartition);
final StateRestorer
restorer =
new StateRestorer(topicPartition, restoreListener, endOffset, Long.MAX_VALUE, true, "storeName");
changelogReader.register(restorer);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(0));
assertThat(restorer.restoredOffset(), equalTo(endOffset));
}
@Test
public void shouldReturnRestoredOffsetsForPersistentStores() {
setupConsumer(10, topicPartition);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true, "storeName"));
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
replay(active, task);
changelogReader.restore(active);
final Map<TopicPartition, Long> restoredOffsets = changelogReader.restoredOffsets();
assertThat(restoredOffsets, equalTo(Collections.singletonMap(topicPartition, 10L)));
}
@Test
public void shouldNotReturnRestoredOffsetsForNonPersistentStore() {
setupConsumer(10, topicPartition);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, false, "storeName"));
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
replay(active, task);
changelogReader.restore(active);
final Map<TopicPartition, Long> restoredOffsets = changelogReader.restoredOffsets();
assertThat(restoredOffsets, equalTo(Collections.<TopicPartition, Long>emptyMap()));
}
@Test
public void shouldIgnoreNullKeysWhenRestoring() {
assignPartition(3, topicPartition);
final byte[] bytes = new byte[0];
consumer.addRecord(new ConsumerRecord<>(topicPartition.topic(), topicPartition.partition(), 0, bytes, bytes));
consumer.addRecord(new ConsumerRecord<>(topicPartition.topic(), topicPartition.partition(), 1, (byte[]) null, bytes));
consumer.addRecord(new ConsumerRecord<>(topicPartition.topic(), topicPartition.partition(), 2, bytes, bytes));
consumer.assign(Collections.singletonList(topicPartition));
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, false,
"storeName"));
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
replay(active, task);
changelogReader.restore(active);
assertThat(callback.restored, CoreMatchers.equalTo(Utils.mkList(KeyValue.pair(bytes, bytes), KeyValue.pair(bytes, bytes))));
}
@Test
public void shouldCompleteImmediatelyWhenEndOffsetIs0() {
final Collection<TopicPartition> expected = Collections.singleton(topicPartition);
setupConsumer(0, topicPartition);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true, "store"));
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
replay(active, task);
final Collection<TopicPartition> restored = changelogReader.restore(active);
assertThat(restored, equalTo(expected));
}
@Test
public void shouldRestorePartitionsRegisteredPostInitialization() {
final MockRestoreCallback callbackTwo = new MockRestoreCallback();
final CompositeRestoreListener restoreListener2 = new CompositeRestoreListener(callbackTwo);
setupConsumer(1, topicPartition);
consumer.updateEndOffsets(Collections.singletonMap(topicPartition, 10L));
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, false, "storeName"));
final TopicPartition postInitialization = new TopicPartition("other", 0);
expect(active.restoringTaskFor(topicPartition)).andStubReturn(task);
expect(active.restoringTaskFor(postInitialization)).andStubReturn(task);
replay(active, task);
assertTrue(changelogReader.restore(active).isEmpty());
addRecords(9, topicPartition, 1);
setupConsumer(3, postInitialization);
consumer.updateBeginningOffsets(Collections.singletonMap(postInitialization, 0L));
consumer.updateEndOffsets(Collections.singletonMap(postInitialization, 3L));
changelogReader.register(new StateRestorer(postInitialization, restoreListener2, null, Long.MAX_VALUE, false, "otherStore"));
final Collection<TopicPartition> expected = Utils.mkSet(topicPartition, postInitialization);
consumer.assign(expected);
assertThat(changelogReader.restore(active), equalTo(expected));
assertThat(callback.restored.size(), equalTo(10));
assertThat(callbackTwo.restored.size(), equalTo(3));
}
@Test
public void shouldNotThrowTaskMigratedExceptionIfSourceTopicUpdatedDuringRestoreProcess() {
final int messages = 10;
setupConsumer(messages, topicPartition);
// in this case first call to endOffsets returns correct value, but a second thread has updated the source topic
// but since it's a source topic, the second check should not fire hence no exception
consumer.addEndOffsets(Collections.singletonMap(topicPartition, 15L));
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, 9L, true, "storeName"));
expect(active.restoringTaskFor(topicPartition)).andReturn(task);
replay(active);
changelogReader.restore(active);
}
@Test
public void shouldNotThrowTaskMigratedExceptionDuringRestoreForChangelogTopicWhenEndOffsetNotExceededEOSEnabled() {
final int totalMessages = 10;
setupConsumer(totalMessages, topicPartition);
// records have offsets of 0..9 10 is commit marker so 11 is end offset
consumer.updateEndOffsets(Collections.singletonMap(topicPartition, 11L));
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true, "storeName"));
expect(active.restoringTaskFor(topicPartition)).andReturn(task);
replay(active);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(10));
}
@Test
public void shouldNotThrowTaskMigratedExceptionDuringRestoreForChangelogTopicWhenEndOffsetNotExceededEOSDisabled() {
final int totalMessages = 10;
setupConsumer(totalMessages, topicPartition);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, Long.MAX_VALUE, true, "storeName"));
expect(active.restoringTaskFor(topicPartition)).andReturn(task);
replay(active);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(10));
}
@Test
public void shouldNotThrowTaskMigratedExceptionIfEndOffsetGetsExceededDuringRestoreForSourceTopic() {
final int messages = 10;
setupConsumer(messages, topicPartition);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, 5, true, "storeName"));
expect(active.restoringTaskFor(topicPartition)).andReturn(task);
replay(active);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(5));
}
@Test
public void shouldNotThrowTaskMigratedExceptionIfEndOffsetNotExceededDuringRestoreForSourceTopic() {
final int messages = 10;
setupConsumer(messages, topicPartition);
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, 10, true, "storeName"));
expect(active.restoringTaskFor(topicPartition)).andReturn(task);
replay(active);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(10));
}
@Test
public void shouldNotThrowTaskMigratedExceptionIfEndOffsetGetsExceededDuringRestoreForSourceTopicEOSEnabled() {
final int totalMessages = 10;
assignPartition(totalMessages, topicPartition);
// records 0..4 last offset before commit is 4
addRecords(5, topicPartition, 0);
//EOS enabled so commit marker at offset 5 so records start at 6
addRecords(5, topicPartition, 6);
consumer.assign(Collections.<TopicPartition>emptyList());
// commit marker is 5 so ending offset is 12
consumer.updateEndOffsets(Collections.singletonMap(topicPartition, 12L));
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, 6, true, "storeName"));
expect(active.restoringTaskFor(topicPartition)).andReturn(task);
replay(active);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(5));
}
@Test
public void shouldNotThrowTaskMigratedExceptionIfEndOffsetNotExceededDuringRestoreForSourceTopicEOSEnabled() {
final int totalMessages = 10;
setupConsumer(totalMessages, topicPartition);
// records have offsets 0..9 10 is commit marker so 11 is ending offset
consumer.updateEndOffsets(Collections.singletonMap(topicPartition, 11L));
changelogReader.register(new StateRestorer(topicPartition, restoreListener, null, 11, true, "storeName"));
expect(active.restoringTaskFor(topicPartition)).andReturn(task);
replay(active);
changelogReader.restore(active);
assertThat(callback.restored.size(), equalTo(10));
}
private void setupConsumer(final long messages,
final TopicPartition topicPartition) {
assignPartition(messages, topicPartition);
addRecords(messages, topicPartition, 0);
consumer.assign(Collections.<TopicPartition>emptyList());
}
private void addRecords(final long messages,
final TopicPartition topicPartition,
final int startingOffset) {
for (int i = 0; i < messages; i++) {
consumer.addRecord(new ConsumerRecord<>(topicPartition.topic(), topicPartition.partition(), startingOffset + i, new byte[0], new byte[0]));
}
}
private void assignPartition(final long messages,
final TopicPartition topicPartition) {
consumer.updatePartitions(topicPartition.topic(),
Collections.singletonList(
new PartitionInfo(topicPartition.topic(),
topicPartition.partition(),
null,
null,
null)));
consumer.updateBeginningOffsets(Collections.singletonMap(topicPartition, 0L));
consumer.updateEndOffsets(Collections.singletonMap(topicPartition, Math.max(0, messages)));
consumer.assign(Collections.singletonList(topicPartition));
}
} | ollie314/kafka | streams/src/test/java/org/apache/kafka/streams/processor/internals/StoreChangelogReaderTest.java | Java | apache-2.0 | 25,467 |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
*/
package org.apache.ambari.server.api.services;
import org.junit.Test;
import java.util.HashMap;
import static org.junit.Assert.*;
/**
* RequestBody unit tests.
*/
public class RequestBodyTest {
@Test
public void testSetGetQueryString() {
RequestBody body = new RequestBody();
assertNull(body.getQueryString());
body.setQueryString("foo=bar");
assertEquals("foo=bar", body.getQueryString());
}
@Test
public void testSetGetPartialResponseFields() {
RequestBody body = new RequestBody();
assertNull(body.getPartialResponseFields());
body.setPartialResponseFields("foo,bar");
assertEquals("foo,bar", body.getPartialResponseFields());
}
@Test
public void testAddGetPropertySets() {
RequestBody body = new RequestBody();
assertEquals(0, body.getNamedPropertySets().size());
NamedPropertySet ps = new NamedPropertySet("foo", new HashMap<String, Object>());
body.addPropertySet(ps);
assertEquals(1, body.getNamedPropertySets().size());
assertSame(ps, body.getNamedPropertySets().iterator().next());
}
@Test
public void testSetGetBody() {
RequestBody body = new RequestBody();
assertNull(body.getBody());
body.setBody("{\"foo\" : \"value\" }");
assertEquals("{\"foo\" : \"value\" }", body.getBody());
}
}
| arenadata/ambari | ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestBodyTest.java | Java | apache-2.0 | 2,108 |
// Copyright 2017 Istio Authors
//
// 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 adapterManager
import (
"istio.io/mixer/pkg/adapter"
"istio.io/mixer/pkg/pool"
)
type env struct {
logger adapter.Logger
gp *pool.GoroutinePool
}
func newEnv(aspect string, gp *pool.GoroutinePool) adapter.Env {
return env{
logger: newLogger(aspect),
gp: gp,
}
}
func (e env) Logger() adapter.Logger {
return e.logger
}
func (e env) ScheduleWork(fn adapter.WorkFunc) {
e.gp.ScheduleWork(func() {
defer func() {
if r := recover(); r != nil {
_ = e.Logger().Errorf("Adapter worker failed: %v", r)
// TODO: Beyond logging, we want to do something proactive here.
// For example, we want to probably terminate the originating
// adapter and record the failure so we can count how often
// it happens, etc.
}
}()
fn()
})
}
func (e env) ScheduleDaemon(fn adapter.DaemonFunc) {
go func() {
defer func() {
if r := recover(); r != nil {
_ = e.Logger().Errorf("Adapter daemon failed: %v", r)
// TODO: Beyond logging, we want to do something proactive here.
// For example, we want to probably terminate the originating
// adapter and record the failure so we can count how often
// it happens, etc.
}
}()
fn()
}()
}
| guptasu/mixer | pkg/adapterManager/env.go | GO | apache-2.0 | 1,837 |
/*
* 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.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.videointelligence.v1.model;
/**
* Word-specific information for recognized words. Word information is only included in the response
* when certain request parameters are set, such as `enable_word_time_offsets`.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Cloud Video Intelligence API. For a detailed
* explanation see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class GoogleCloudVideointelligenceV1p2beta1WordInfo extends com.google.api.client.json.GenericJson {
/**
* Output only. The confidence estimate between 0.0 and 1.0. A higher number indicates an
* estimated greater likelihood that the recognized words are correct. This field is set only for
* the top alternative. This field is not guaranteed to be accurate and users should not rely on
* it to be always provided. The default of 0.0 is a sentinel value indicating `confidence` was
* not set.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Float confidence;
/**
* Time offset relative to the beginning of the audio, and corresponding to the end of the spoken
* word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis.
* This is an experimental feature and the accuracy of the time offset can vary.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private String endTime;
/**
* Output only. A distinct integer value is assigned for every speaker within the audio. This
* field specifies which one of those speakers was detected to have spoken this word. Value ranges
* from 1 up to diarization_speaker_count, and is only set if speaker diarization is enabled.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer speakerTag;
/**
* Time offset relative to the beginning of the audio, and corresponding to the start of the
* spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top
* hypothesis. This is an experimental feature and the accuracy of the time offset can vary.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private String startTime;
/**
* The word corresponding to this set of information.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String word;
/**
* Output only. The confidence estimate between 0.0 and 1.0. A higher number indicates an
* estimated greater likelihood that the recognized words are correct. This field is set only for
* the top alternative. This field is not guaranteed to be accurate and users should not rely on
* it to be always provided. The default of 0.0 is a sentinel value indicating `confidence` was
* not set.
* @return value or {@code null} for none
*/
public java.lang.Float getConfidence() {
return confidence;
}
/**
* Output only. The confidence estimate between 0.0 and 1.0. A higher number indicates an
* estimated greater likelihood that the recognized words are correct. This field is set only for
* the top alternative. This field is not guaranteed to be accurate and users should not rely on
* it to be always provided. The default of 0.0 is a sentinel value indicating `confidence` was
* not set.
* @param confidence confidence or {@code null} for none
*/
public GoogleCloudVideointelligenceV1p2beta1WordInfo setConfidence(java.lang.Float confidence) {
this.confidence = confidence;
return this;
}
/**
* Time offset relative to the beginning of the audio, and corresponding to the end of the spoken
* word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis.
* This is an experimental feature and the accuracy of the time offset can vary.
* @return value or {@code null} for none
*/
public String getEndTime() {
return endTime;
}
/**
* Time offset relative to the beginning of the audio, and corresponding to the end of the spoken
* word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis.
* This is an experimental feature and the accuracy of the time offset can vary.
* @param endTime endTime or {@code null} for none
*/
public GoogleCloudVideointelligenceV1p2beta1WordInfo setEndTime(String endTime) {
this.endTime = endTime;
return this;
}
/**
* Output only. A distinct integer value is assigned for every speaker within the audio. This
* field specifies which one of those speakers was detected to have spoken this word. Value ranges
* from 1 up to diarization_speaker_count, and is only set if speaker diarization is enabled.
* @return value or {@code null} for none
*/
public java.lang.Integer getSpeakerTag() {
return speakerTag;
}
/**
* Output only. A distinct integer value is assigned for every speaker within the audio. This
* field specifies which one of those speakers was detected to have spoken this word. Value ranges
* from 1 up to diarization_speaker_count, and is only set if speaker diarization is enabled.
* @param speakerTag speakerTag or {@code null} for none
*/
public GoogleCloudVideointelligenceV1p2beta1WordInfo setSpeakerTag(java.lang.Integer speakerTag) {
this.speakerTag = speakerTag;
return this;
}
/**
* Time offset relative to the beginning of the audio, and corresponding to the start of the
* spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top
* hypothesis. This is an experimental feature and the accuracy of the time offset can vary.
* @return value or {@code null} for none
*/
public String getStartTime() {
return startTime;
}
/**
* Time offset relative to the beginning of the audio, and corresponding to the start of the
* spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top
* hypothesis. This is an experimental feature and the accuracy of the time offset can vary.
* @param startTime startTime or {@code null} for none
*/
public GoogleCloudVideointelligenceV1p2beta1WordInfo setStartTime(String startTime) {
this.startTime = startTime;
return this;
}
/**
* The word corresponding to this set of information.
* @return value or {@code null} for none
*/
public java.lang.String getWord() {
return word;
}
/**
* The word corresponding to this set of information.
* @param word word or {@code null} for none
*/
public GoogleCloudVideointelligenceV1p2beta1WordInfo setWord(java.lang.String word) {
this.word = word;
return this;
}
@Override
public GoogleCloudVideointelligenceV1p2beta1WordInfo set(String fieldName, Object value) {
return (GoogleCloudVideointelligenceV1p2beta1WordInfo) super.set(fieldName, value);
}
@Override
public GoogleCloudVideointelligenceV1p2beta1WordInfo clone() {
return (GoogleCloudVideointelligenceV1p2beta1WordInfo) super.clone();
}
}
| googleapis/google-api-java-client-services | clients/google-api-services-videointelligence/v1/1.31.0/com/google/api/services/videointelligence/v1/model/GoogleCloudVideointelligenceV1p2beta1WordInfo.java | Java | apache-2.0 | 8,066 |
// GoogleAnalyticsIntegration.h
// Copyright (c) 2014 Segment.io. All rights reserved.
#import <Foundation/Foundation.h>
#import "SEGAnalyticsIntegration.h"
#import "SEGEcommerce.h"
@interface SEGGoogleAnalyticsIntegration : SEGAnalyticsIntegration <SEGEcommerce>
@property(nonatomic, copy) NSString *name;
@property(nonatomic, assign) BOOL valid;
@property(nonatomic, assign) BOOL initialized;
@property(nonatomic, copy) NSDictionary *settings;
@end
| nagyistoce/edx-app-ios | Pods/Analytics/Analytics/Integrations/GoogleAnalytics/SEGGoogleAnalyticsIntegration.h | C | apache-2.0 | 455 |
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC 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.
package org.openqa.selenium.htmlunit;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Callable;
import net.sourceforge.htmlunit.corejs.javascript.Undefined;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.ElementNotVisibleException;
import org.openqa.selenium.InvalidElementStateException;
import org.openqa.selenium.InvalidSelectorException;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.Point;
import org.openqa.selenium.Rectangle;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.internal.Coordinates;
import org.openqa.selenium.internal.FindsByCssSelector;
import org.openqa.selenium.internal.FindsById;
import org.openqa.selenium.internal.FindsByLinkText;
import org.openqa.selenium.internal.FindsByTagName;
import org.openqa.selenium.internal.FindsByXPath;
import org.openqa.selenium.internal.Locatable;
import org.openqa.selenium.internal.WrapsDriver;
import org.openqa.selenium.internal.WrapsElement;
import org.openqa.selenium.support.Color;
import org.openqa.selenium.support.Colors;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import com.gargoylesoftware.htmlunit.ScriptResult;
import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.DomText;
import com.gargoylesoftware.htmlunit.html.HtmlButton;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlImageInput;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlLabel;
import com.gargoylesoftware.htmlunit.html.HtmlOption;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlPreformattedText;
import com.gargoylesoftware.htmlunit.html.HtmlScript;
import com.gargoylesoftware.htmlunit.html.HtmlSelect;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
import com.gargoylesoftware.htmlunit.html.HtmlTextArea;
import com.gargoylesoftware.htmlunit.javascript.host.event.Event;
import com.google.common.base.Strings;
import com.google.common.base.Throwables;
public class HtmlUnitWebElement implements WrapsDriver,
FindsById, FindsByLinkText, FindsByXPath, FindsByTagName,
FindsByCssSelector, Locatable, WebElement {
protected final HtmlUnitDriver parent;
protected final DomElement element;
private static final char nbspChar = 160;
private static final String[] blockLevelsTagNames =
{"p", "h1", "h2", "h3", "h4", "h5", "h6", "dl", "div", "noscript",
"blockquote", "form", "hr", "table", "fieldset", "address", "ul", "ol", "pre", "br"};
private static final String[] booleanAttributes = {
"async",
"autofocus",
"autoplay",
"checked",
"compact",
"complete",
"controls",
"declare",
"defaultchecked",
"defaultselected",
"defer",
"disabled",
"draggable",
"ended",
"formnovalidate",
"hidden",
"indeterminate",
"iscontenteditable",
"ismap",
"itemscope",
"loop",
"multiple",
"muted",
"nohref",
"noresize",
"noshade",
"novalidate",
"nowrap",
"open",
"paused",
"pubdate",
"readonly",
"required",
"reversed",
"scoped",
"seamless",
"seeking",
"selected",
"spellcheck",
"truespeed",
"willvalidate"
};
private String toString;
public HtmlUnitWebElement(HtmlUnitDriver parent, DomElement element) {
this.parent = parent;
this.element = element;
}
@Override
public void click() {
try {
verifyCanInteractWithElement();
} catch (InvalidElementStateException e) {
Throwables.propagateIfInstanceOf(e, ElementNotVisibleException.class);
// Swallow disabled element case
// Clicking disabled elements should still be passed through,
// we just don't expect any state change
// TODO: The javadoc for this method implies we shouldn't throw for
// element not visible either
}
HtmlUnitMouse mouse = (HtmlUnitMouse) parent.getMouse();
mouse.click(getCoordinates());
if (element instanceof HtmlLabel) {
HtmlElement referencedElement = ((HtmlLabel)element).getReferencedElement();
if (referencedElement != null) {
new HtmlUnitWebElement(parent, referencedElement).click();
}
}
}
@Override
public void submit() {
try {
if (element instanceof HtmlForm) {
submitForm((HtmlForm) element);
return;
} else if ((element instanceof HtmlSubmitInput) || (element instanceof HtmlImageInput)) {
element.click();
return;
} else if (element instanceof HtmlInput) {
HtmlForm form = ((HtmlElement) element).getEnclosingForm();
if (form == null) {
throw new NoSuchElementException("Unable to find the containing form");
}
submitForm(form);
return;
}
WebElement form = findParentForm();
if (form == null) {
throw new NoSuchElementException("Unable to find the containing form");
}
form.submit();
} catch (IOException e) {
throw new WebDriverException(e);
}
}
private void submitForm(HtmlForm form) {
assertElementNotStale();
List<String> names = new ArrayList<>();
names.add("input");
names.add("button");
List<? extends HtmlElement> allElements = form.getHtmlElementsByTagNames(names);
HtmlElement submit = null;
for (HtmlElement element : allElements) {
if (!isSubmitElement(element)) {
continue;
}
if (submit == null) {
submit = element;
}
}
if (submit == null) {
if (parent.isJavascriptEnabled()) {
ScriptResult eventResult = form.fireEvent("submit");
if (!ScriptResult.isFalse(eventResult)) {
parent.executeScript("arguments[0].submit()", form);
}
return;
}
throw new WebDriverException("Cannot locate element used to submit form");
}
try {
submit.click();
} catch (IOException e) {
throw new WebDriverException(e);
}
}
private boolean isSubmitElement(HtmlElement element) {
HtmlElement candidate = null;
if (element instanceof HtmlSubmitInput && !((HtmlSubmitInput) element).isDisabled()) {
candidate = element;
} else if (element instanceof HtmlImageInput && !((HtmlImageInput) element).isDisabled()) {
candidate = element;
} else if (element instanceof HtmlButton) {
HtmlButton button = (HtmlButton) element;
if ("submit".equalsIgnoreCase(button.getTypeAttribute()) && !button.isDisabled()) {
candidate = element;
}
}
return candidate != null;
}
@Override
public void clear() {
assertElementNotStale();
if (element instanceof HtmlInput) {
HtmlInput htmlInput = (HtmlInput) element;
if (htmlInput.isReadOnly()) {
throw new InvalidElementStateException("You may only edit editable elements");
}
if (htmlInput.isDisabled()) {
throw new InvalidElementStateException("You may only interact with enabled elements");
}
htmlInput.setValueAttribute("");
} else if (element instanceof HtmlTextArea) {
HtmlTextArea htmlTextArea = (HtmlTextArea) element;
if (htmlTextArea.isReadOnly()) {
throw new InvalidElementStateException("You may only edit editable elements");
}
if (htmlTextArea.isDisabled()) {
throw new InvalidElementStateException("You may only interact with enabled elements");
}
htmlTextArea.setText("");
} else if (!element.getAttribute("contenteditable").equals(DomElement.ATTRIBUTE_NOT_DEFINED)) {
element.setTextContent("");
}
}
private void verifyCanInteractWithElement() {
assertElementNotStale();
Boolean displayed = parent.implicitlyWaitFor(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return isDisplayed();
}
});
if (displayed == null || !displayed) {
throw new ElementNotVisibleException("You may only interact with visible elements");
}
if (!isEnabled()) {
throw new InvalidElementStateException("You may only interact with enabled elements");
}
}
private void switchFocusToThisIfNeeded() {
HtmlUnitWebElement oldActiveElement =
((HtmlUnitWebElement) parent.switchTo().activeElement());
boolean jsEnabled = parent.isJavascriptEnabled();
boolean oldActiveEqualsCurrent = oldActiveElement.equals(this);
try {
boolean isBody = oldActiveElement.getTagName().toLowerCase().equals("body");
if (jsEnabled &&
!oldActiveEqualsCurrent &&
!isBody) {
oldActiveElement.element.blur();
}
} catch (StaleElementReferenceException ex) {
// old element has gone, do nothing
}
element.focus();
}
void sendKeyDownEvent(CharSequence modifierKey) {
sendSingleKeyEvent(modifierKey, Event.TYPE_KEY_DOWN);
}
void sendKeyUpEvent(CharSequence modifierKey) {
sendSingleKeyEvent(modifierKey, Event.TYPE_KEY_UP);
}
private void sendSingleKeyEvent(CharSequence modifierKey, String eventDescription) {
verifyCanInteractWithElement();
switchFocusToThisIfNeeded();
HtmlUnitKeyboard keyboard = (HtmlUnitKeyboard) parent.getKeyboard();
keyboard.performSingleKeyAction((HtmlElement) getElement(), modifierKey, eventDescription);
}
@Override
public void sendKeys(CharSequence... value) {
verifyCanInteractWithElement();
InputKeysContainer keysContainer = new InputKeysContainer(isInputElement(), value);
switchFocusToThisIfNeeded();
HtmlUnitKeyboard keyboard = (HtmlUnitKeyboard) parent.getKeyboard();
keyboard.sendKeys((HtmlElement) element, getAttribute("value"), keysContainer);
if (isInputElement() && keysContainer.wasSubmitKeyFound()) {
submit();
}
}
private boolean isInputElement() {
return element instanceof HtmlInput;
}
@Override
public String getTagName() {
assertElementNotStale();
return element.getNodeName();
}
@Override
public String getAttribute(String name) {
assertElementNotStale();
final String lowerName = name.toLowerCase();
String value = element.getAttribute(name);
if (element instanceof HtmlInput &&
("selected".equals(lowerName) || "checked".equals(lowerName))) {
return trueOrNull(((HtmlInput) element).isChecked());
}
if ("href".equals(lowerName) || "src".equals(lowerName)) {
if (!element.hasAttribute(name)) {
return null;
}
String link = element.getAttribute(name).trim();
HtmlPage page = (HtmlPage) element.getPage();
try {
return page.getFullyQualifiedUrl(link).toString();
} catch (MalformedURLException e) {
return null;
}
}
if ("disabled".equals(lowerName)) {
return trueOrNull(! isEnabled());
}
if ("multiple".equals(lowerName) && element instanceof HtmlSelect) {
String multipleAttribute = ((HtmlSelect) element).getMultipleAttribute();
if ("".equals(multipleAttribute)) {
return trueOrNull(element.hasAttribute("multiple"));
}
return "true";
}
for (String booleanAttribute : booleanAttributes) {
if (booleanAttribute.equals(lowerName)) {
return trueOrNull(element.hasAttribute(lowerName));
}
}
if ("index".equals(lowerName) && element instanceof HtmlOption) {
HtmlSelect select = ((HtmlOption) element).getEnclosingSelect();
List<HtmlOption> allOptions = select.getOptions();
for (int i = 0; i < allOptions.size(); i++) {
HtmlOption option = select.getOption(i);
if (element.equals(option)) {
return String.valueOf(i);
}
}
return null;
}
if ("readonly".equalsIgnoreCase(lowerName)) {
if (element instanceof HtmlInput) {
return trueOrNull(((HtmlInput) element).isReadOnly());
}
if (element instanceof HtmlTextArea) {
return trueOrNull("".equals(((HtmlTextArea) element).getReadOnlyAttribute()));
}
return null;
}
if ("textContent".equalsIgnoreCase(lowerName)) {
return element.getTextContent();
}
if ("innerHTML".equalsIgnoreCase(lowerName)) {
return element.asXml();
}
if ("value".equals(lowerName)) {
if (element instanceof HtmlTextArea) {
return ((HtmlTextArea) element).getText();
}
// According to
// http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-value-OPTION
// if the value attribute doesn't exist, getting the "value" attribute defers to the
// option's content.
if (element instanceof HtmlOption && !element.hasAttribute("value")) {
return element.getTextContent();
}
return value == null ? "" : value;
}
if (!"".equals(value)) {
return value;
}
if (element.hasAttribute(name)) {
return "";
}
final Object slotVal = element.getScriptObject().get(name);
if (slotVal instanceof String) {
String strVal = (String) slotVal;
if (!Strings.isNullOrEmpty(strVal)) {
return strVal;
}
}
return null;
}
private String trueOrNull(boolean condition) {
return condition ? "true" : null;
}
@Override
public boolean isSelected() {
assertElementNotStale();
if (element instanceof HtmlInput) {
return ((HtmlInput) element).isChecked();
} else if (element instanceof HtmlOption) {
return ((HtmlOption) element).isSelected();
}
throw new UnsupportedOperationException(
"Unable to determine if element is selected. Tag name is: " + element.getTagName());
}
@Override
public boolean isEnabled() {
assertElementNotStale();
return !element.hasAttribute("disabled");
}
@Override
public boolean isDisplayed() {
assertElementNotStale();
return element.isDisplayed();
}
@Override
public Point getLocation() {
assertElementNotStale();
try {
return new Point(readAndRound("left"), readAndRound("top"));
} catch (Exception e) {
throw new WebDriverException("Cannot determine size of element", e);
}
}
@Override
public Dimension getSize() {
assertElementNotStale();
try {
final int width = readAndRound("width");
final int height = readAndRound("height");
return new Dimension(width, height);
} catch (Exception e) {
throw new WebDriverException("Cannot determine size of element", e);
}
}
public Rectangle getRect() {
return new Rectangle(getLocation(), getSize());
}
private int readAndRound(final String property) {
final String cssValue = getCssValue(property).replaceAll("[^0-9\\.]", "");
if (cssValue.length() == 0) {
return 5; // wrong... but better than nothing
}
return Math.round(Float.parseFloat(cssValue));
}
// This isn't very pretty. Sorry.
@Override
public String getText() {
assertElementNotStale();
StringBuffer toReturn = new StringBuffer();
StringBuffer textSoFar = new StringBuffer();
boolean isPreformatted = element instanceof HtmlPreformattedText;
getTextFromNode(element, toReturn, textSoFar, isPreformatted);
String text = toReturn.toString() + collapseWhitespace(textSoFar);
if (!isPreformatted) {
text = text.trim();
} else {
if (text.endsWith("\n")) {
text = text.substring(0, text.length()-1);
}
}
return text.replace(nbspChar, ' ');
}
protected HtmlUnitDriver getParent() {
return parent;
}
protected DomElement getElement() {
return element;
}
private void getTextFromNode(DomNode node, StringBuffer toReturn, StringBuffer textSoFar,
boolean isPreformatted) {
if (node instanceof HtmlScript) {
return;
}
if (isPreformatted) {
getPreformattedText(node, toReturn);
} else {
for (DomNode child : node.getChildren()) {
// Do we need to collapse the text so far?
if (child instanceof HtmlPreformattedText) {
if (child.isDisplayed()) {
String textToAdd = collapseWhitespace(textSoFar);
if (! " ".equals(textToAdd)) {
toReturn.append(textToAdd);
}
textSoFar.delete(0, textSoFar.length());
}
getTextFromNode(child, toReturn, textSoFar, true);
continue;
}
// Or is this just plain text?
if (child instanceof DomText) {
if (child.isDisplayed()) {
String textToAdd = ((DomText) child).getData();
textSoFar.append(textToAdd);
}
continue;
}
// Treat as another child node.
getTextFromNode(child, toReturn, textSoFar, false);
}
}
if (isBlockLevel(node)) {
toReturn.append(collapseWhitespace(textSoFar).trim()).append("\n");
textSoFar.delete(0, textSoFar.length());
}
}
private boolean isBlockLevel(DomNode node) {
// From the HTML spec (http://www.w3.org/TR/html401/sgml/dtd.html#block)
// <!ENTITY % block
// "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT | BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
// <!ENTITY % heading "H1|H2|H3|H4|H5|H6">
// <!ENTITY % list "UL | OL">
// <!ENTITY % preformatted "PRE">
if (!(node instanceof HtmlElement)) {
return false;
}
String tagName = ((HtmlElement) node).getTagName().toLowerCase();
for (String blockLevelsTagName : blockLevelsTagNames) {
if (blockLevelsTagName.equals(tagName)) {
return true;
}
}
return false;
}
private String collapseWhitespace(StringBuffer textSoFar) {
String textToAdd = textSoFar.toString();
return textToAdd.replaceAll("\\p{javaWhitespace}+", " ").replaceAll("\r", "");
}
private void getPreformattedText(DomNode node, StringBuffer toReturn) {
if (node.isDisplayed()) {
toReturn.append(node.getTextContent());
}
}
public List<WebElement> getElementsByTagName(String tagName) {
assertElementNotStale();
List<?> allChildren = element.getByXPath(".//" + tagName);
List<WebElement> elements = new ArrayList<>();
for (Object o : allChildren) {
if (!(o instanceof HtmlElement)) {
continue;
}
HtmlElement child = (HtmlElement) o;
elements.add(getParent().newHtmlUnitWebElement(child));
}
return elements;
}
@Override
public WebElement findElement(By by) {
assertElementNotStale();
return parent.findElement(by, this);
}
@Override
public List<WebElement> findElements(By by) {
assertElementNotStale();
return parent.findElements(by, this);
}
@Override
public WebElement findElementById(String id) {
assertElementNotStale();
return findElementByXPath(".//*[@id = '" + id + "']");
}
@Override
public List<WebElement> findElementsById(String id) {
assertElementNotStale();
return findElementsByXPath(".//*[@id = '" + id + "']");
}
@Override
public List<WebElement> findElementsByCssSelector(String using) {
List<WebElement> allElements = parent.findElementsByCssSelector(using);
return findChildNodes(allElements);
}
@Override
public WebElement findElementByCssSelector(String using) {
List<WebElement> allElements = parent.findElementsByCssSelector(using);
allElements = findChildNodes(allElements);
if (allElements.isEmpty()) {
throw new NoSuchElementException("Cannot find child element using css: " + using);
}
return allElements.get(0);
}
private List<WebElement> findChildNodes(List<WebElement> allElements) {
List<WebElement> toReturn = new LinkedList<>();
for (WebElement current : allElements) {
DomElement candidate = ((HtmlUnitWebElement) current).element;
if (element.isAncestorOf(candidate) && element != candidate) {
toReturn.add(current);
}
}
return toReturn;
}
@Override
public WebElement findElementByXPath(String xpathExpr) {
assertElementNotStale();
Object node;
try {
node = element.getFirstByXPath(xpathExpr);
} catch (Exception ex) {
// The xpath expression cannot be evaluated, so the expression is invalid
throw new InvalidSelectorException(
String.format(HtmlUnitDriver.INVALIDXPATHERROR, xpathExpr), ex);
}
if (node == null) {
throw new NoSuchElementException("Unable to find an element with xpath " + xpathExpr);
}
if (node instanceof HtmlElement) {
return getParent().newHtmlUnitWebElement((HtmlElement) node);
}
// The xpath selector selected something different than a WebElement. The selector is therefore
// invalid
throw new InvalidSelectorException(
String.format(HtmlUnitDriver.INVALIDSELECTIONERROR, xpathExpr, node.getClass().toString()));
}
@Override
public List<WebElement> findElementsByXPath(String xpathExpr) {
assertElementNotStale();
List<WebElement> webElements = new ArrayList<>();
List<?> htmlElements;
try {
htmlElements = element.getByXPath(xpathExpr);
} catch (Exception ex) {
// The xpath expression cannot be evaluated, so the expression is invalid
throw new InvalidSelectorException(
String.format(HtmlUnitDriver.INVALIDXPATHERROR, xpathExpr), ex);
}
for (Object e : htmlElements) {
if (e instanceof HtmlElement) {
webElements.add(getParent().newHtmlUnitWebElement((HtmlElement) e));
}
else {
// The xpath selector selected something different than a WebElement. The selector is
// therefore invalid
throw new InvalidSelectorException(
String.format(HtmlUnitDriver.INVALIDSELECTIONERROR,
xpathExpr, e.getClass().toString()));
}
}
return webElements;
}
@Override
public WebElement findElementByLinkText(String linkText) {
assertElementNotStale();
List<WebElement> elements = findElementsByLinkText(linkText);
if (elements.isEmpty()) {
throw new NoSuchElementException("Unable to find element with linkText " + linkText);
}
return elements.get(0);
}
@Override
public List<WebElement> findElementsByLinkText(String linkText) {
assertElementNotStale();
String expectedText = linkText.trim();
List<? extends HtmlElement> htmlElements = ((HtmlElement) element).getHtmlElementsByTagName("a");
List<WebElement> webElements = new ArrayList<>();
for (DomElement e : htmlElements) {
if (expectedText.equals(e.getTextContent().trim()) && e.getAttribute("href") != null) {
webElements.add(getParent().newHtmlUnitWebElement(e));
}
}
return webElements;
}
@Override
public WebElement findElementByPartialLinkText(String linkText) {
assertElementNotStale();
List<WebElement> elements = findElementsByPartialLinkText(linkText);
if (elements.isEmpty()) {
throw new NoSuchElementException(
"Unable to find element with linkText " + linkText);
}
return elements.size() > 0 ? elements.get(0) : null;
}
@Override
public List<WebElement> findElementsByPartialLinkText(String linkText) {
assertElementNotStale();
List<? extends HtmlElement> htmlElements = ((HtmlElement) element).getHtmlElementsByTagName("a");
List<WebElement> webElements = new ArrayList<>();
for (HtmlElement e : htmlElements) {
if (e.getTextContent().contains(linkText)
&& e.getAttribute("href") != null) {
webElements.add(getParent().newHtmlUnitWebElement(e));
}
}
return webElements;
}
@Override
public WebElement findElementByTagName(String name) {
assertElementNotStale();
List<WebElement> elements = findElementsByTagName(name);
if (elements.isEmpty()) {
throw new NoSuchElementException("Cannot find element with tag name: " + name);
}
return elements.get(0);
}
@Override
public List<WebElement> findElementsByTagName(String name) {
assertElementNotStale();
List<HtmlElement> elements = ((HtmlElement) element).getHtmlElementsByTagName(name);
List<WebElement> toReturn = new ArrayList<>(elements.size());
for (HtmlElement element : elements) {
toReturn.add(parent.newHtmlUnitWebElement(element));
}
return toReturn;
}
private WebElement findParentForm() {
DomNode current = element;
while (!(current == null || current instanceof HtmlForm)) {
current = current.getParentNode();
}
return getParent().newHtmlUnitWebElement((HtmlForm) current);
}
@Override
public String toString() {
if (toString == null) {
StringBuilder sb = new StringBuilder();
sb.append('<').append(element.getTagName());
NamedNodeMap attributes = element.getAttributes();
int n = attributes.getLength();
for (int i = 0; i < n; ++i) {
Attr a = (Attr) attributes.item(i);
sb.append(' ').append(a.getName()).append("=\"")
.append(a.getValue().replace("\"", """)).append("\"");
}
if (element.hasChildNodes()) {
sb.append('>');
} else {
sb.append(" />");
}
toString = sb.toString();
}
return toString;
}
protected void assertElementNotStale() {
parent.assertElementNotStale(element);
}
@Override
public String getCssValue(String propertyName) {
assertElementNotStale();
String style = getEffectiveStyle((HtmlElement) element, propertyName);
return getColor(style);
}
private static String getColor(String name) {
if ("null".equals(name)) {
return "transparent";
}
if (name.startsWith("rgb(")) {
return Color.fromString(name).asRgba();
}
Colors colors = getColorsOf(name);
if (colors != null) {
return colors.getColorValue().asRgba();
}
return name;
}
private static Colors getColorsOf(String name) {
name = name.toUpperCase();
for (Colors colors : Colors.values()) {
if (colors.name().equals(name)) {
return colors;
}
}
return null;
}
private String getEffectiveStyle(HtmlElement htmlElement, String propertyName) {
HtmlElement current = htmlElement;
String value = "inherit";
while ("inherit".equals(value)) {
// Hat-tip to the Selenium team
Object result =
parent
.executeScript(
"if (window.getComputedStyle) { "
+
" return window.getComputedStyle(arguments[0], null).getPropertyValue(arguments[1]); "
+
"} "
+
"if (arguments[0].currentStyle) { "
+
" return arguments[0].currentStyle[arguments[1]]; "
+
"} "
+
"if (window.document.defaultView && window.document.defaultView.getComputedStyle) { "
+
" return window.document.defaultView.getComputedStyle(arguments[0], null)[arguments[1]]; "
+
"} ",
current, propertyName
);
if (!(result instanceof Undefined)) {
value = String.valueOf(result);
}
current = (HtmlElement) current.getParentNode();
}
return value;
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof WebElement)) {
return false;
}
WebElement other = (WebElement) obj;
if (other instanceof WrapsElement) {
other = ((WrapsElement) obj).getWrappedElement();
}
return other instanceof HtmlUnitWebElement &&
element.equals(((HtmlUnitWebElement) other).element);
}
@Override
public int hashCode() {
return element.hashCode();
}
/*
* (non-Javadoc)
*
* @see org.openqa.selenium.internal.WrapsDriver#getContainingDriver()
*/
@Override
public WebDriver getWrappedDriver() {
return parent;
}
@Override
public Coordinates getCoordinates() {
return new Coordinates() {
@Override
public Point onScreen() {
throw new UnsupportedOperationException("Not displayed, no screen location.");
}
@Override
public Point inViewPort() {
return getLocation();
}
@Override
public Point onPage() {
return getLocation();
}
@Override
public Object getAuxiliary() {
return getElement();
}
};
}
public <X> X getScreenshotAs(OutputType<X> outputType) throws WebDriverException {
throw new UnsupportedOperationException(
"Screenshots are not enabled for HtmlUnitDriver");
}
}
| actmd/selenium | java/client/src/org/openqa/selenium/htmlunit/HtmlUnitWebElement.java | Java | apache-2.0 | 30,105 |
// Openbravo POS is a point of sales application designed for touch screens.
// Copyright (C) 2007-2009 Openbravo, S.L.
// http://www.openbravo.com/product/pos
//
// This file is part of Openbravo POS.
//
// Openbravo POS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Openbravo POS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Openbravo POS. If not, see <http://www.gnu.org/licenses/>.
package com.openbravo.pos.ticket;
/**
*
* @author jaroslawwozniak
*/
public class UserInfo {
private String login;
private String password;
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| nordpos-mobi/nordpos-dao | src/main/java/com/openbravo/pos/ticket/UserInfo.java | Java | apache-2.0 | 1,342 |
/*
* Copyright (C) 2013 salesforce.com, inc.
*
* 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.
*/
function () {
var lib = {
/**
* helper function for formatting a number
*/
formatValue: function(cmp, helper, defaultFormatter) {
if (!$A.util.isEmpty(cmp.get("v.value"))) {
// number fields only format the initial value
//todo helper.setAttribute(cmp, { key: 'doFormat', value: false, commit: true });
var el = helper.getInputElement(cmp);
if (!$A.util.isUndefinedOrNull(el)) {
var num = helper.getNumber(cmp);
if (!$A.util.isUndefinedOrNull(num)) {
var formatter = cmp.get("v.format");
if (!$A.util.isEmpty(formatter)) {
var numberFormat;
try {
numberFormat = $A.localizationService.getNumberFormat(formatter);
} catch (e) {
el.value = "Invalid format attribute";
}
if (numberFormat && numberFormat.format) {
el.value = numberFormat.format(num);
}
} else {
el.value = defaultFormatter.format(num);
}
}
}
}
}
};
return lib;
}
| TribeMedia/aura | aura-components/src/main/components/ui/inputNumberLibrary/number.js | JavaScript | apache-2.0 | 2,047 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
*/
package org.apache.hadoop.hive.ql.optimizer.calcite.rules.jdbc;
import java.util.Arrays;
import org.apache.calcite.adapter.jdbc.JdbcRules.JdbcFilter;
import org.apache.calcite.adapter.jdbc.JdbcRules.JdbcFilterRule;
import org.apache.calcite.plan.RelOptRule;
import org.apache.calcite.plan.RelOptRuleCall;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.convert.ConverterRule;
import org.apache.calcite.rel.core.Filter;
import org.apache.calcite.rex.RexNode;
import org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveFilter;
import org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* JDBCExtractJoinFilterRule extracts out the
* {@link org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveFilter}
* from a {@link org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveJoin} operator.
* if the HiveFilter could be replaced by two HiveFilter operators that one of them could be pushed down below the
* {@link org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.jdbc.HiveJdbcConverter}
*/
public class JDBCFilterPushDownRule extends RelOptRule {
private static final Logger LOG = LoggerFactory.getLogger(JDBCFilterPushDownRule.class);
public static final JDBCFilterPushDownRule INSTANCE = new JDBCFilterPushDownRule();
public JDBCFilterPushDownRule() {
super(operand(HiveFilter.class,
operand(HiveJdbcConverter.class, any())));
}
@Override
public boolean matches(RelOptRuleCall call) {
final HiveFilter filter = call.rel(0);
final HiveJdbcConverter converter = call.rel(1);
RexNode cond = filter.getCondition();
return JDBCRexCallValidator.isValidJdbcOperation(cond, converter.getJdbcDialect());
}
@Override
public void onMatch(RelOptRuleCall call) {
LOG.debug("JDBCFilterPushDown has been called");
final HiveFilter filter = call.rel(0);
final HiveJdbcConverter converter = call.rel(1);
Filter newHiveFilter = filter.copy(filter.getTraitSet(), converter.getInput(), filter.getCondition());
JdbcFilter newJdbcFilter = (JdbcFilter) JdbcFilterRule.create(converter.getJdbcConvention()).convert(newHiveFilter);
if (newJdbcFilter != null) {
RelNode converterRes = converter.copy(converter.getTraitSet(), Arrays.asList(newJdbcFilter));
call.transformTo(converterRes);
}
}
};
| sankarh/hive | ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/jdbc/JDBCFilterPushDownRule.java | Java | apache-2.0 | 3,226 |
/**
* @fileoverview Mocha test wrapper
* @author Ilya Volodin
*/
"use strict";
/* global describe, it */
/*
* This is a wrapper around mocha to allow for DRY unittests for eslint
* Format:
* RuleTester.run("{ruleName}", {
* valid: [
* "{code}",
* { code: "{code}", options: {options}, globals: {globals}, parser: "{parser}", settings: {settings} }
* ],
* invalid: [
* { code: "{code}", errors: {numErrors} },
* { code: "{code}", errors: ["{errorMessage}"] },
* { code: "{code}", options: {options}, globals: {globals}, parser: "{parser}", settings: {settings}, errors: [{ message: "{errorMessage}", type: "{errorNodeType}"}] }
* ]
* });
*
* Variables:
* {code} - String that represents the code to be tested
* {options} - Arguments that are passed to the configurable rules.
* {globals} - An object representing a list of variables that are
* registered as globals
* {parser} - String representing the parser to use
* {settings} - An object representing global settings for all rules
* {numErrors} - If failing case doesn't need to check error message,
* this integer will specify how many errors should be
* received
* {errorMessage} - Message that is returned by the rule on failure
* {errorNodeType} - AST node type that is returned by they rule as
* a cause of the failure.
*/
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const lodash = require("lodash"),
assert = require("assert"),
util = require("util"),
validator = require("../config/config-validator"),
ajv = require("../util/ajv"),
Linter = require("../linter"),
Environments = require("../config/environments"),
SourceCodeFixer = require("../util/source-code-fixer"),
interpolate = require("../util/interpolate");
//------------------------------------------------------------------------------
// Private Members
//------------------------------------------------------------------------------
/*
* testerDefaultConfig must not be modified as it allows to reset the tester to
* the initial default configuration
*/
const testerDefaultConfig = { rules: {} };
let defaultConfig = { rules: {} };
/*
* List every parameters possible on a test case that are not related to eslint
* configuration
*/
const RuleTesterParameters = [
"code",
"filename",
"options",
"errors",
"output"
];
const hasOwnProperty = Function.call.bind(Object.hasOwnProperty);
/**
* Clones a given value deeply.
* Note: This ignores `parent` property.
*
* @param {any} x - A value to clone.
* @returns {any} A cloned value.
*/
function cloneDeeplyExcludesParent(x) {
if (typeof x === "object" && x !== null) {
if (Array.isArray(x)) {
return x.map(cloneDeeplyExcludesParent);
}
const retv = {};
for (const key in x) {
if (key !== "parent" && hasOwnProperty(x, key)) {
retv[key] = cloneDeeplyExcludesParent(x[key]);
}
}
return retv;
}
return x;
}
/**
* Freezes a given value deeply.
*
* @param {any} x - A value to freeze.
* @returns {void}
*/
function freezeDeeply(x) {
if (typeof x === "object" && x !== null) {
if (Array.isArray(x)) {
x.forEach(freezeDeeply);
} else {
for (const key in x) {
if (key !== "parent" && hasOwnProperty(x, key)) {
freezeDeeply(x[key]);
}
}
}
Object.freeze(x);
}
}
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
// default separators for testing
const DESCRIBE = Symbol("describe");
const IT = Symbol("it");
/**
* This is `it` default handler if `it` don't exist.
* @this {Mocha}
* @param {string} text - The description of the test case.
* @param {Function} method - The logic of the test case.
* @returns {any} Returned value of `method`.
*/
function itDefaultHandler(text, method) {
try {
return method.call(this);
} catch (err) {
if (err instanceof assert.AssertionError) {
err.message += ` (${util.inspect(err.actual)} ${err.operator} ${util.inspect(err.expected)})`;
}
throw err;
}
}
/**
* This is `describe` default handler if `describe` don't exist.
* @this {Mocha}
* @param {string} text - The description of the test case.
* @param {Function} method - The logic of the test case.
* @returns {any} Returned value of `method`.
*/
function describeDefaultHandler(text, method) {
return method.call(this);
}
class RuleTester {
/**
* Creates a new instance of RuleTester.
* @param {Object} [testerConfig] Optional, extra configuration for the tester
* @constructor
*/
constructor(testerConfig) {
/**
* The configuration to use for this tester. Combination of the tester
* configuration and the default configuration.
* @type {Object}
*/
this.testerConfig = lodash.merge(
// we have to clone because merge uses the first argument for recipient
lodash.cloneDeep(defaultConfig),
testerConfig,
{ rules: { "rule-tester/validate-ast": "error" } }
);
/**
* Rule definitions to define before tests.
* @type {Object}
*/
this.rules = {};
this.linter = new Linter();
}
/**
* Set the configuration to use for all future tests
* @param {Object} config the configuration to use.
* @returns {void}
*/
static setDefaultConfig(config) {
if (typeof config !== "object") {
throw new TypeError("RuleTester.setDefaultConfig: config must be an object");
}
defaultConfig = config;
// Make sure the rules object exists since it is assumed to exist later
defaultConfig.rules = defaultConfig.rules || {};
}
/**
* Get the current configuration used for all tests
* @returns {Object} the current configuration
*/
static getDefaultConfig() {
return defaultConfig;
}
/**
* Reset the configuration to the initial configuration of the tester removing
* any changes made until now.
* @returns {void}
*/
static resetDefaultConfig() {
defaultConfig = lodash.cloneDeep(testerDefaultConfig);
}
/*
* If people use `mocha test.js --watch` command, `describe` and `it` function
* instances are different for each execution. So `describe` and `it` should get fresh instance
* always.
*/
static get describe() {
return (
this[DESCRIBE] ||
(typeof describe === "function" ? describe : describeDefaultHandler)
);
}
static set describe(value) {
this[DESCRIBE] = value;
}
static get it() {
return (
this[IT] ||
(typeof it === "function" ? it : itDefaultHandler)
);
}
static set it(value) {
this[IT] = value;
}
/**
* Define a rule for one particular run of tests.
* @param {string} name The name of the rule to define.
* @param {Function} rule The rule definition.
* @returns {void}
*/
defineRule(name, rule) {
this.rules[name] = rule;
}
/**
* Adds a new rule test to execute.
* @param {string} ruleName The name of the rule to run.
* @param {Function} rule The rule to test.
* @param {Object} test The collection of tests to run.
* @returns {void}
*/
run(ruleName, rule, test) {
const testerConfig = this.testerConfig,
requiredScenarios = ["valid", "invalid"],
scenarioErrors = [],
linter = this.linter;
if (lodash.isNil(test) || typeof test !== "object") {
throw new TypeError(`Test Scenarios for rule ${ruleName} : Could not find test scenario object`);
}
requiredScenarios.forEach(scenarioType => {
if (lodash.isNil(test[scenarioType])) {
scenarioErrors.push(`Could not find any ${scenarioType} test scenarios`);
}
});
if (scenarioErrors.length > 0) {
throw new Error([
`Test Scenarios for rule ${ruleName} is invalid:`
].concat(scenarioErrors).join("\n"));
}
linter.defineRule(ruleName, Object.assign({}, rule, {
// Create a wrapper rule that freezes the `context` properties.
create(context) {
freezeDeeply(context.options);
freezeDeeply(context.settings);
freezeDeeply(context.parserOptions);
return (typeof rule === "function" ? rule : rule.create)(context);
}
}));
linter.defineRules(this.rules);
const ruleMap = linter.getRules();
/**
* Run the rule for the given item
* @param {string|Object} item Item to run the rule against
* @returns {Object} Eslint run result
* @private
*/
function runRuleForItem(item) {
let config = lodash.cloneDeep(testerConfig),
code, filename, beforeAST, afterAST;
if (typeof item === "string") {
code = item;
} else {
code = item.code;
/*
* Assumes everything on the item is a config except for the
* parameters used by this tester
*/
const itemConfig = lodash.omit(item, RuleTesterParameters);
/*
* Create the config object from the tester config and this item
* specific configurations.
*/
config = lodash.merge(
config,
itemConfig
);
}
if (item.filename) {
filename = item.filename;
}
if (Object.prototype.hasOwnProperty.call(item, "options")) {
assert(Array.isArray(item.options), "options must be an array");
config.rules[ruleName] = [1].concat(item.options);
} else {
config.rules[ruleName] = 1;
}
const schema = validator.getRuleOptionsSchema(rule);
/*
* Setup AST getters.
* The goal is to check whether or not AST was modified when
* running the rule under test.
*/
linter.defineRule("rule-tester/validate-ast", () => ({
Program(node) {
beforeAST = cloneDeeplyExcludesParent(node);
},
"Program:exit"(node) {
afterAST = node;
}
}));
if (schema) {
ajv.validateSchema(schema);
if (ajv.errors) {
const errors = ajv.errors.map(error => {
const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
return `\t${field}: ${error.message}`;
}).join("\n");
throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]);
}
}
validator.validate(config, "rule-tester", ruleMap.get.bind(ruleMap), new Environments());
return {
messages: linter.verify(code, config, filename, true),
beforeAST,
afterAST: cloneDeeplyExcludesParent(afterAST)
};
}
/**
* Check if the AST was changed
* @param {ASTNode} beforeAST AST node before running
* @param {ASTNode} afterAST AST node after running
* @returns {void}
* @private
*/
function assertASTDidntChange(beforeAST, afterAST) {
if (!lodash.isEqual(beforeAST, afterAST)) {
assert.fail("Rule should not modify AST.");
}
}
/**
* Check if the template is valid or not
* all valid cases go through this
* @param {string|Object} item Item to run the rule against
* @returns {void}
* @private
*/
function testValidTemplate(item) {
const result = runRuleForItem(item);
const messages = result.messages;
assert.strictEqual(messages.length, 0, util.format("Should have no errors but had %d: %s",
messages.length, util.inspect(messages)));
assertASTDidntChange(result.beforeAST, result.afterAST);
}
/**
* Asserts that the message matches its expected value. If the expected
* value is a regular expression, it is checked against the actual
* value.
* @param {string} actual Actual value
* @param {string|RegExp} expected Expected value
* @returns {void}
* @private
*/
function assertMessageMatches(actual, expected) {
if (expected instanceof RegExp) {
// assert.js doesn't have a built-in RegExp match function
assert.ok(
expected.test(actual),
`Expected '${actual}' to match ${expected}`
);
} else {
assert.strictEqual(actual, expected);
}
}
/**
* Check if the template is invalid or not
* all invalid cases go through this.
* @param {string|Object} item Item to run the rule against
* @returns {void}
* @private
*/
function testInvalidTemplate(item) {
assert.ok(item.errors || item.errors === 0,
`Did not specify errors for an invalid test of ${ruleName}`);
const result = runRuleForItem(item);
const messages = result.messages;
if (typeof item.errors === "number") {
assert.strictEqual(messages.length, item.errors, util.format("Should have %d error%s but had %d: %s",
item.errors, item.errors === 1 ? "" : "s", messages.length, util.inspect(messages)));
} else {
assert.strictEqual(
messages.length, item.errors.length,
util.format(
"Should have %d error%s but had %d: %s",
item.errors.length, item.errors.length === 1 ? "" : "s", messages.length, util.inspect(messages)
)
);
const hasMessageOfThisRule = messages.some(m => m.ruleId === ruleName);
for (let i = 0, l = item.errors.length; i < l; i++) {
const error = item.errors[i];
const message = messages[i];
assert(!message.fatal, `A fatal parsing error occurred: ${message.message}`);
assert(hasMessageOfThisRule, "Error rule name should be the same as the name of the rule being tested");
if (typeof error === "string" || error instanceof RegExp) {
// Just an error message.
assertMessageMatches(message.message, error);
} else if (typeof error === "object") {
/*
* Error object.
* This may have a message, messageId, data, node type, line, and/or
* column.
*/
if (hasOwnProperty(error, "message")) {
assert.ok(!hasOwnProperty(error, "messageId"), "Error should not specify both 'message' and a 'messageId'.");
assert.ok(!hasOwnProperty(error, "data"), "Error should not specify both 'data' and 'message'.");
assertMessageMatches(message.message, error.message);
} else if (hasOwnProperty(error, "messageId")) {
assert.ok(
hasOwnProperty(rule, "meta") && hasOwnProperty(rule.meta, "messages"),
"Error can not use 'messageId' if rule under test doesn't define 'meta.messages'."
);
if (!hasOwnProperty(rule.meta.messages, error.messageId)) {
const friendlyIDList = `[${Object.keys(rule.meta.messages).map(key => `'${key}'`).join(", ")}]`;
assert(false, `Invalid messageId '${error.messageId}'. Expected one of ${friendlyIDList}.`);
}
assert.strictEqual(
error.messageId,
message.messageId,
`messageId '${message.messageId}' does not match expected messageId '${error.messageId}'.`
);
if (hasOwnProperty(error, "data")) {
/*
* if data was provided, then directly compare the returned message to a synthetic
* interpolated message using the same message ID and data provided in the test.
* See https://github.com/eslint/eslint/issues/9890 for context.
*/
const unformattedOriginalMessage = rule.meta.messages[error.messageId];
const rehydratedMessage = interpolate(unformattedOriginalMessage, error.data);
assert.strictEqual(
message.message,
rehydratedMessage,
`Hydrated message "${rehydratedMessage}" does not match "${message.message}"`
);
}
}
assert.ok(
hasOwnProperty(error, "data") ? hasOwnProperty(error, "messageId") : true,
"Error must specify 'messageId' if 'data' is used."
);
if (error.type) {
assert.strictEqual(message.nodeType, error.type, `Error type should be ${error.type}, found ${message.nodeType}`);
}
if (Object.prototype.hasOwnProperty.call(error, "line")) {
assert.strictEqual(message.line, error.line, `Error line should be ${error.line}`);
}
if (Object.prototype.hasOwnProperty.call(error, "column")) {
assert.strictEqual(message.column, error.column, `Error column should be ${error.column}`);
}
if (Object.prototype.hasOwnProperty.call(error, "endLine")) {
assert.strictEqual(message.endLine, error.endLine, `Error endLine should be ${error.endLine}`);
}
if (Object.prototype.hasOwnProperty.call(error, "endColumn")) {
assert.strictEqual(message.endColumn, error.endColumn, `Error endColumn should be ${error.endColumn}`);
}
} else {
// Message was an unexpected type
assert.fail(`Error should be a string, object, or RegExp, but found (${util.inspect(message)})`);
}
}
}
if (Object.prototype.hasOwnProperty.call(item, "output")) {
if (item.output === null) {
assert.strictEqual(
messages.filter(message => message.fix).length,
0,
"Expected no autofixes to be suggested"
);
} else {
const fixResult = SourceCodeFixer.applyFixes(item.code, messages);
assert.strictEqual(fixResult.output, item.output, "Output is incorrect.");
}
}
assertASTDidntChange(result.beforeAST, result.afterAST);
}
/*
* This creates a mocha test suite and pipes all supplied info through
* one of the templates above.
*/
RuleTester.describe(ruleName, () => {
RuleTester.describe("valid", () => {
test.valid.forEach(valid => {
RuleTester.it(typeof valid === "object" ? valid.code : valid, () => {
testValidTemplate(valid);
});
});
});
RuleTester.describe("invalid", () => {
test.invalid.forEach(invalid => {
RuleTester.it(invalid.code, () => {
testInvalidTemplate(invalid);
});
});
});
});
}
}
RuleTester[DESCRIBE] = RuleTester[IT] = null;
module.exports = RuleTester;
| Khan/khan-linter | node_modules/eslint/lib/testers/rule-tester.js | JavaScript | apache-2.0 | 21,598 |
/*
* Copyright 1998-2016 Linux.org.ru
* 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 ru.org.linux.spring;
import com.google.common.base.Strings;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.feed.synd.SyndFeedImpl;
import com.sun.syndication.io.SyndFeedOutput;
import org.springframework.web.servlet.view.AbstractView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
public abstract class AbstractRomeView extends AbstractView {
private Map<String,String> contentTypes;
private Map<String,String> feedTypes;
private Integer defaultCount;
private String defaultType;
private Integer minimalCount;
private Integer maximalCount;
public Map<String, String> getContentTypes() {
return contentTypes;
}
public void setContentTypes(Map<String, String> contentTypes) {
this.contentTypes = contentTypes;
}
public Map<String, String> getFeedTypes() {
return feedTypes;
}
public void setFeedTypes(Map<String, String> feedTypes) {
this.feedTypes = feedTypes;
}
public Integer getDefaultCount() {
return defaultCount;
}
public void setDefaultCount(Integer defaultCount) {
this.defaultCount = defaultCount;
}
@Override
protected void renderMergedOutputModel(Map model, HttpServletRequest request,
HttpServletResponse response) throws Exception {
SyndFeed feed = new SyndFeedImpl();
feed.setEncoding("utf-8");
String feedType = (String) model.get("feed-type");
if (Strings.isNullOrEmpty(feedType)){
feedType = "rss";
}
feed.setFeedType(feedTypes.get(feedType));
createFeed(feed, model);
response.setContentType(contentTypes.get(feedType));
response.setCharacterEncoding("UTF-8");
SyndFeedOutput output = new SyndFeedOutput();
output.output(feed, response.getWriter());
}
protected abstract void createFeed(SyndFeed feed, Map model);
public Integer getMaximalCount() {
return maximalCount;
}
public void setMaximalCount(Integer maximalCount) {
this.maximalCount = maximalCount;
}
public Integer getMinimalCount() {
return minimalCount;
}
public void setMinimalCount(Integer minimalCount) {
this.minimalCount = minimalCount;
}
public String getDefaultType() {
return defaultType;
}
public void setDefaultType(String defaultType) {
this.defaultType = defaultType;
}
}
| fat0troll/lorsource | src/main/java/ru/org/linux/spring/AbstractRomeView.java | Java | apache-2.0 | 3,017 |
/*
* Copyright (c) 2014, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. 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
*
* This software 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.cloudera.dataflow.spark.aggregators;
import org.apache.spark.AccumulatorParam;
public class AggAccumParam implements AccumulatorParam<NamedAggregators> {
@Override
public NamedAggregators addAccumulator(NamedAggregators current, NamedAggregators added) {
return current.merge(added);
}
@Override
public NamedAggregators addInPlace(NamedAggregators current, NamedAggregators added) {
return addAccumulator(current, added);
}
@Override
public NamedAggregators zero(NamedAggregators initialValue) {
return new NamedAggregators();
}
}
| tomwhite/spark-dataflow | src/main/java/com/cloudera/dataflow/spark/aggregators/AggAccumParam.java | Java | apache-2.0 | 1,143 |
package com.bazaarvoice.emodb.web.jersey;
import com.bazaarvoice.emodb.sortedq.core.ReadOnlyQueueException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
@Provider
public class ReadOnlyQueueExceptionMapper implements ExceptionMapper<ReadOnlyQueueException> {
@Override
public Response toResponse(ReadOnlyQueueException e) {
// Don't re-throw this exception on the client side. It's internal.
return Response.status(Response.Status.SERVICE_UNAVAILABLE)
.header("X-BV-Exception", ReadOnlyQueueException.class.getName())
.entity("Server does not manage the specified resource at this time.")
.type(MediaType.TEXT_PLAIN_TYPE)
.build();
}
}
| billkalter/emodb | web/src/main/java/com/bazaarvoice/emodb/web/jersey/ReadOnlyQueueExceptionMapper.java | Java | apache-2.0 | 828 |
# Context Free Mode
If a tiny change is to be made to an ACI, for example if the name needs to be
changed, it can be cumbersome to call `begin`, `write`, and `end` for the
single change.
To make this use case more streamlined, the `--modify` flag exists. When a
command is invoked with this flag acbuild will create a directory in `/tmp` to
store the build context, and do the following with this alternate context:
- Call `acbuild begin` with the ACI passed in via the `--modify` flag.
- Call the provided command.
- Call `acbuild write --overwrite` with the ACI passed in via the `--modify`
flag.
- Call `acbuild end`.
If more than one change needs to be made, it will be faster to avoid this flag,
as it will result in unnecessary compressing/uncompressing and copying between
the changes.
| jonboulle/acbuild | Documentation/context-free-mode.md | Markdown | apache-2.0 | 799 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2021-11-10 19:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('osf', '0238_abstractprovider_allow_updates'),
]
operations = [
migrations.AddIndex(
model_name='schemaresponse',
index=models.Index(fields=['object_id', 'content_type'], name='osf_schemar_object__8cc95e_idx'),
),
]
| Johnetordoff/osf.io | osf/migrations/0239_auto_20211110_1921.py | Python | apache-2.0 | 497 |
/* ====================================================================
Copyright (C) 2004-2008 fyiReporting Software, LLC
Copyright (C) 2011 Peter Gill <peter@majorsilence.com>
This file is part of the fyiReporting RDL project.
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.
For additional information, email info@fyireporting.com or visit
the website www.fyiReporting.com.
*/
using System;
using System.Collections;
using System.Drawing;
namespace fyiReporting.RDL
{
///<summary>
/// Bar chart definition and processing.
///</summary>
internal class ChartBar: ChartBase
{
int _GapSize = 6; // TODO: hard code for now
internal ChartBar(Report r, Row row, Chart c, MatrixCellEntry[,] m, Expression showTooltips, Expression showTooltipsX,Expression _ToolTipYFormat, Expression _ToolTipXFormat)
: base(r, row, c, m,showTooltips,showTooltipsX,_ToolTipYFormat,_ToolTipXFormat)
{
}
override internal void Draw(Report rpt)
{
CreateSizedBitmap();
//AJM GJL 14082008 Using Vector Graphics
using (Graphics g1 = Graphics.FromImage(_bm))
{
_aStream = new System.IO.MemoryStream();
IntPtr HDC = g1.GetHdc();
_mf = new System.Drawing.Imaging.Metafile(_aStream, HDC, new RectangleF(0, 0, _bm.Width, _bm.Height), System.Drawing.Imaging.MetafileFrameUnit.Pixel);
g1.ReleaseHdc(HDC);
}
using (Graphics g = Graphics.FromImage(_mf))
{
// 06122007AJM Used to Force Higher Quality
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.None;
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
// Adjust the top margin to depend on the title height
Size titleSize = DrawTitleMeasure(rpt, g, ChartDefn.Title);
Layout.TopMargin = titleSize.Height;
double max=0,min=0; // Get the max and min values
// 20022008 AJM GJL - Now requires Y axis identifier
GetValueMaxMin(rpt, ref max, ref min, 0,1);
DrawChartStyle(rpt, g);
// Draw title; routine determines if necessary
DrawTitle(rpt, g, ChartDefn.Title, new System.Drawing.Rectangle(0, 0, _bm.Width, Layout.TopMargin));
// Adjust the left margin to depend on the Category Axis
Size caSize = CategoryAxisSize(rpt, g);
Layout.LeftMargin = caSize.Width;
// Adjust the bottom margin to depend on the Value Axis
Size vaSize = ValueAxisSize(rpt, g, min, max);
Layout.BottomMargin = vaSize.Height;
// Draw legend
System.Drawing.Rectangle lRect = DrawLegend(rpt, g, false, true);
// 20022008 AJM GJL - Requires Rpt and Graphics
AdjustMargins(lRect,rpt,g ); // Adjust margins based on legend.
// Draw Plot area
DrawPlotAreaStyle(rpt, g, lRect);
// Draw Value Axis
if (vaSize.Width > 0) // If we made room for the axis - we need to draw it
DrawValueAxis(rpt, g, min, max,
new System.Drawing.Rectangle(Layout.LeftMargin, _bm.Height-Layout.BottomMargin, _bm.Width - Layout.LeftMargin - Layout.RightMargin, vaSize.Height), Layout.TopMargin, _bm.Height - Layout.BottomMargin);
// Draw Category Axis
if (caSize.Height > 0)
DrawCategoryAxis(rpt, g,
new System.Drawing.Rectangle(Layout.LeftMargin - caSize.Width, Layout.TopMargin, caSize.Width, _bm.Height - Layout.TopMargin - Layout.BottomMargin));
if ((ChartSubTypeEnum)Enum.Parse(typeof(ChartSubTypeEnum), _ChartDefn.Subtype.EvaluateString(rpt, _row)) == ChartSubTypeEnum.Stacked)
DrawPlotAreaStacked(rpt, g, min, max);
else if ((ChartSubTypeEnum)Enum.Parse(typeof(ChartSubTypeEnum), _ChartDefn.Subtype.EvaluateString(rpt, _row)) == ChartSubTypeEnum.PercentStacked)
DrawPlotAreaPercentStacked(rpt, g);
else
DrawPlotAreaPlain(rpt, g, min, max);
DrawLegend(rpt, g, false, false); // after the plot is drawn
}
}
void DrawPlotAreaPercentStacked(Report rpt, Graphics g)
{
int barsNeeded = CategoryCount;
int gapsNeeded = CategoryCount * 2;
// Draw Plot area data
double max = 1;
int heightBar = (int) ((Layout.PlotArea.Height - gapsNeeded*_GapSize) / barsNeeded);
int maxBarWidth = (int) (Layout.PlotArea.Width);
// Loop thru calculating all the data points
for (int iRow = 1; iRow <= CategoryCount; iRow++)
{
int barLoc=(int) (Layout.PlotArea.Top + (iRow-1) * ((double) (Layout.PlotArea.Height) / CategoryCount));
barLoc += _GapSize; // space before series
double sum=0;
for (int iCol = 1; iCol <= SeriesCount; iCol++)
{
sum += GetDataValue(rpt, iRow, iCol);
}
double v=0;
int saveX=0;
double t=0;
for (int iCol = 1; iCol <= SeriesCount; iCol++)
{
t = GetDataValue(rpt, iRow, iCol);
v += t;
int x = (int) ((Math.Min(v/sum,max) / max) * maxBarWidth);
System.Drawing.Rectangle rect;
rect = new System.Drawing.Rectangle(Layout.PlotArea.Left + saveX, barLoc, x - saveX, heightBar);
DrawColumnBar(rpt, g,
GetSeriesBrush(rpt, iRow, iCol),
rect, iRow, iCol);
//Add a metafilecomment to use as a tooltip GJL 26092008
if (_showToolTips)
{
String val = "ToolTip:" + t.ToString(_tooltipYFormat) + "|X:" + (int)rect.X + "|Y:" + (int)rect.Y + "|W:" + rect.Width + "|H:" + rect.Height;
g.AddMetafileComment(new System.Text.ASCIIEncoding().GetBytes(val));
}
saveX = x;
}
}
return;
}
void DrawPlotAreaPlain(Report rpt, Graphics g, double min, double max)
{
int barsNeeded = SeriesCount * CategoryCount;
int gapsNeeded = CategoryCount * 2;
// Draw Plot area data
int heightBar = (int) ((Layout.PlotArea.Height - gapsNeeded*_GapSize) / barsNeeded);
int maxBarWidth = (int) (Layout.PlotArea.Width);
//int barLoc=Layout.LeftMargin;
for (int iRow=1; iRow <= CategoryCount; iRow++)
{
int barLoc=(int) (Layout.PlotArea.Top + (iRow-1) * ((double) (Layout.PlotArea.Height) / CategoryCount));
barLoc += _GapSize; // space before series
for (int iCol=1; iCol <= SeriesCount; iCol++)
{
double v = this.GetDataValue(rpt, iRow, iCol);
int x = (int) (((Math.Min(v,max)-min) / (max-min)) * maxBarWidth);
DrawColumnBar(rpt, g, GetSeriesBrush(rpt, iRow, iCol),
new System.Drawing.Rectangle(Layout.PlotArea.Left, barLoc, x, heightBar), iRow, iCol);
//Add a metafilecomment to use as a tooltip GJL 26092008
if (_showToolTips)
{
String val = "ToolTip:" + v.ToString(_tooltipYFormat) + "|X:" + (int)Layout.PlotArea.Left + "|Y:" + (int)(barLoc) + "|W:" + x + "|H:" + heightBar;
g.AddMetafileComment(new System.Text.ASCIIEncoding().GetBytes(val));
}
barLoc += heightBar;
}
}
return;
}
void DrawPlotAreaStacked(Report rpt, Graphics g, double min, double max)
{
int barsNeeded = CategoryCount;
int gapsNeeded = CategoryCount * 2;
int heightBar = (int) ((Layout.PlotArea.Height - gapsNeeded*_GapSize) / barsNeeded);
int maxBarWidth = (int) (Layout.PlotArea.Width);
// Loop thru calculating all the data points
for (int iRow = 1; iRow <= CategoryCount; iRow++)
{
int barLoc=(int) (Layout.PlotArea.Top + (iRow-1) * ((double) (Layout.PlotArea.Height) / CategoryCount));
barLoc += _GapSize; // space before series
double v=0;
double t = 0;
int saveX=0;
for (int iCol = 1; iCol <= SeriesCount; iCol++)
{
t = GetDataValue(rpt, iRow, iCol);
v += t;
int x = (int) (((Math.Min(v,max)-min) / (max-min)) * maxBarWidth);
System.Drawing.Rectangle rect;
rect = new System.Drawing.Rectangle(Layout.PlotArea.Left + saveX, barLoc, x - saveX, heightBar);
DrawColumnBar(rpt, g, GetSeriesBrush(rpt, iRow, iCol), rect, iRow, iCol);
if (_showToolTips)
{
String val = "ToolTip:" + v.ToString(_tooltipYFormat) + "|X:" + (int)rect.X + "|Y:" + (int)rect.Y + "|W:" + rect.Width + "|H:" + rect.Height;
g.AddMetafileComment(new System.Text.ASCIIEncoding().GetBytes(val));
}
saveX = x;
}
}
return;
}
// Calculate the size of the category axis
Size CategoryAxisSize(Report rpt, Graphics g)
{
_LastCategoryWidth = 0;
Size size=Size.Empty;
if (this.ChartDefn.CategoryAxis == null)
return size;
Axis a = this.ChartDefn.CategoryAxis.Axis;
if (a == null)
return size;
Style s = a.Style;
// Measure the title
size = DrawTitleMeasure(rpt, g, a.Title);
if (!a.Visible) // don't need to calculate the height
return size;
// Calculate the tallest category name
TypeCode tc;
int maxWidth=0;
for (int iRow=1; iRow <= CategoryCount; iRow++)
{
object v = this.GetCategoryValue(rpt, iRow, out tc);
Size tSize;
if (s == null)
tSize = Style.MeasureStringDefaults(rpt, g, v, tc, null, int.MaxValue);
else
tSize =s.MeasureString(rpt, g, v, tc, null, int.MaxValue);
if (tSize.Width > maxWidth)
maxWidth = tSize.Width;
if (iRow == CategoryCount)
_LastCategoryWidth = tSize.Width;
}
// Add on the widest category name
size.Width += maxWidth;
return size;
}
// DrawCategoryAxis
void DrawCategoryAxis(Report rpt, Graphics g, System.Drawing.Rectangle rect)
{
if (this.ChartDefn.CategoryAxis == null)
return;
Axis a = this.ChartDefn.CategoryAxis.Axis;
if (a == null)
return;
Style s = a.Style;
Size tSize = DrawTitleMeasure(rpt, g, a.Title);
DrawTitle(rpt, g, a.Title,
new System.Drawing.Rectangle(rect.Left, rect.Top, tSize.Width, rect.Height));
int drawHeight = rect.Height / CategoryCount;
TypeCode tc;
for (int iRow=1; iRow <= CategoryCount; iRow++)
{
object v = this.GetCategoryValue(rpt, iRow, out tc);
int drawLoc=(int) (rect.Top + (iRow-1) * ((double) rect.Height / CategoryCount));
// Draw the category text
if (a.Visible)
{
System.Drawing.Rectangle drawRect = new System.Drawing.Rectangle(rect.Left + tSize.Width, drawLoc, rect.Width-tSize.Width, drawHeight);
if (s == null)
Style.DrawStringDefaults(g, v, drawRect);
else
s.DrawString(rpt, g, v, tc, null, drawRect);
}
// Draw the Major Tick Marks (if necessary)
DrawCategoryAxisTick(g, true, a.MajorTickMarks, new Point(rect.Right, drawLoc));
}
// Draw the end on (if necessary)
DrawCategoryAxisTick(g, true, a.MajorTickMarks, new Point(rect.Right, rect.Bottom));
return;
}
protected void DrawCategoryAxisTick(Graphics g, bool bMajor, AxisTickMarksEnum tickType, Point p)
{
int len = bMajor? AxisTickMarkMajorLen: AxisTickMarkMinorLen;
switch (tickType)
{
case AxisTickMarksEnum.Outside:
g.DrawLine(Pens.Black, new Point(p.X, p.Y), new Point(p.X-len, p.Y));
break;
case AxisTickMarksEnum.Inside:
g.DrawLine(Pens.Black, new Point(p.X, p.Y), new Point(p.X+len, p.Y));
break;
case AxisTickMarksEnum.Cross:
g.DrawLine(Pens.Black, new Point(p.X-len, p.Y), new Point(p.X+len, p.Y));
break;
case AxisTickMarksEnum.None:
default:
break;
}
return;
}
void DrawColumnBar(Report rpt, Graphics g, Brush brush, System.Drawing.Rectangle rect, int iRow, int iCol)
{
g.FillRectangle(brush, rect);
g.DrawRectangle(Pens.Black, rect);
if ((ChartSubTypeEnum)Enum.Parse(typeof(ChartSubTypeEnum), _ChartDefn.Subtype.EvaluateString(rpt, _row)) == ChartSubTypeEnum.Stacked ||
(ChartSubTypeEnum)Enum.Parse(typeof(ChartSubTypeEnum), _ChartDefn.Subtype.EvaluateString(rpt, _row)) == ChartSubTypeEnum.PercentStacked)
{
DrawDataPoint(rpt, g, rect, iRow, iCol);
}
else
{
Point p;
p = new Point(rect.Right, rect.Top);
DrawDataPoint(rpt, g, p, iRow, iCol);
}
return;
}
protected void DrawValueAxis(Report rpt, Graphics g, double min, double max, System.Drawing.Rectangle rect, int plotTop, int plotBottom)
{
if (this.ChartDefn.ValueAxis == null)
return;
Axis a = this.ChartDefn.ValueAxis.Axis;
if (a == null)
return;
Style s = a.Style;
// Account for tick marks
int tickSize=0;
if (a.MajorTickMarks == AxisTickMarksEnum.Cross ||
a.MajorTickMarks == AxisTickMarksEnum.Outside)
tickSize = this.AxisTickMarkMajorLen;
else if (a.MinorTickMarks == AxisTickMarksEnum.Cross ||
a.MinorTickMarks == AxisTickMarksEnum.Outside)
tickSize += this.AxisTickMarkMinorLen;
int intervalCount;
double incr;
SetIncrementAndInterval(rpt, a, min, max, out incr, out intervalCount); // Calculate the interval count
int maxValueHeight = 0;
double v = min;
Size size= Size.Empty;
for (int i = 0; i < intervalCount+1; i++)
{
int x = (int) (((Math.Min(v,max)-min) / (max-min)) * rect.Width);
if (!a.Visible)
{
// nothing to do
}
else if (s != null)
{
size = s.MeasureString(rpt, g, v, TypeCode.Double, null, int.MaxValue);
System.Drawing.Rectangle vRect =
new System.Drawing.Rectangle(rect.Left + x - size.Width/2, rect.Top+tickSize, size.Width, size.Height);
s.DrawString(rpt, g, v, TypeCode.Double, null, vRect);
}
else
{
size = Style.MeasureStringDefaults(rpt, g, v, TypeCode.Double, null, int.MaxValue);
System.Drawing.Rectangle vRect =
new System.Drawing.Rectangle(rect.Left + x - size.Width/2, rect.Top+tickSize, size.Width, size.Height);
Style.DrawStringDefaults(g, v, vRect);
}
if (size.Height > maxValueHeight) // Need to keep track of the maximum height
maxValueHeight = size.Height; // this is probably overkill since it should always be the same??
DrawValueAxisGrid(rpt, g, a.MajorGridLines, new Point(rect.Left + x, plotTop), new Point(rect.Left + x, plotBottom));
DrawValueAxisTick(rpt, g, true, a.MajorTickMarks, a.MajorGridLines, new Point(rect.Left + x, plotBottom ));
v += incr;
}
// Draw the end points of the major grid lines
DrawValueAxisGrid(rpt, g, a.MajorGridLines, new Point(rect.Left, plotTop), new Point(rect.Left, plotBottom));
DrawValueAxisTick(rpt, g, true, a.MajorTickMarks, a.MajorGridLines, new Point(rect.Left, plotBottom));
DrawValueAxisGrid(rpt, g, a.MajorGridLines, new Point(rect.Right, plotTop), new Point(rect.Right, plotBottom));
DrawValueAxisTick(rpt, g, true, a.MajorTickMarks, a.MajorGridLines, new Point(rect.Right, plotBottom));
Size tSize = DrawTitleMeasure(rpt, g, a.Title);
DrawTitle(rpt, g, a.Title,
new System.Drawing.Rectangle(rect.Left, rect.Top+maxValueHeight+tickSize, rect.Width, tSize.Height));
return;
}
protected void DrawValueAxisGrid(Report rpt, Graphics g, ChartGridLines gl, Point s, Point e)
{
if (gl == null || !gl.ShowGridLines)
return;
if (gl.Style != null)
gl.Style.DrawStyleLine(rpt, g, null, s, e);
else
g.DrawLine(Pens.Black, s, e);
return;
}
protected void DrawValueAxisTick(Report rpt, Graphics g, bool bMajor, AxisTickMarksEnum tickType, ChartGridLines gl, Point p)
{
if (tickType == AxisTickMarksEnum.None)
return;
int len = bMajor? AxisTickMarkMajorLen: AxisTickMarkMinorLen;
Point s, e;
switch (tickType)
{
case AxisTickMarksEnum.Inside:
s = new Point(p.X, p.Y);
e = new Point(p.X, p.Y-len);
break;
case AxisTickMarksEnum.Cross:
s = new Point(p.X, p.Y-len);
e = new Point(p.X, p.Y+len);
break;
case AxisTickMarksEnum.Outside:
default:
s = new Point(p.X, p.Y+len);
e = new Point(p.X, p.Y);
break;
}
Style style = gl.Style;
if (style != null)
style.DrawStyleLine(rpt, g, null, s, e);
else
g.DrawLine(Pens.Black, s, e);
return;
}
// Calculate the size of the value axis; width is max value width + title width
// height is max value height
protected Size ValueAxisSize(Report rpt, Graphics g, double min, double max)
{
Size size=Size.Empty;
if (ChartDefn.ValueAxis == null)
return size;
Axis a = ChartDefn.ValueAxis.Axis;
if (a == null)
return size;
Size minSize;
Size maxSize;
if (!a.Visible)
{
minSize = maxSize = Size.Empty;
}
else if (a.Style != null)
{
minSize = a.Style.MeasureString(rpt, g, min, TypeCode.Double, null, int.MaxValue);
maxSize = a.Style.MeasureString(rpt, g, max, TypeCode.Double, null, int.MaxValue);
}
else
{
minSize = Style.MeasureStringDefaults(rpt, g, min, TypeCode.Double, null, int.MaxValue);
maxSize = Style.MeasureStringDefaults(rpt, g, max, TypeCode.Double, null, int.MaxValue);
}
// Choose the largest
size.Width = Math.Max(minSize.Width, maxSize.Width);
size.Height = Math.Max(minSize.Height, maxSize.Height);
// Now we need to add in the height of the title (if any)
Size titleSize = DrawTitleMeasure(rpt, g, a.Title);
size.Height += titleSize.Height;
if (a.MajorTickMarks == AxisTickMarksEnum.Cross ||
a.MajorTickMarks == AxisTickMarksEnum.Outside)
size.Height += this.AxisTickMarkMajorLen;
else if (a.MinorTickMarks == AxisTickMarksEnum.Cross ||
a.MinorTickMarks == AxisTickMarksEnum.Outside)
size.Height += this.AxisTickMarkMinorLen;
return size;
}
}
}
| majorsilence/My-FyiReporting | RdlEngine/Definition/ChartBar.cs | C# | apache-2.0 | 18,400 |
package vpc
//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)
// ModifySslVpnServer invokes the vpc.ModifySslVpnServer API synchronously
func (client *Client) ModifySslVpnServer(request *ModifySslVpnServerRequest) (response *ModifySslVpnServerResponse, err error) {
response = CreateModifySslVpnServerResponse()
err = client.DoAction(request, response)
return
}
// ModifySslVpnServerWithChan invokes the vpc.ModifySslVpnServer API asynchronously
func (client *Client) ModifySslVpnServerWithChan(request *ModifySslVpnServerRequest) (<-chan *ModifySslVpnServerResponse, <-chan error) {
responseChan := make(chan *ModifySslVpnServerResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
defer close(errChan)
response, err := client.ModifySslVpnServer(request)
if err != nil {
errChan <- err
} else {
responseChan <- response
}
})
if err != nil {
errChan <- err
close(responseChan)
close(errChan)
}
return responseChan, errChan
}
// ModifySslVpnServerWithCallback invokes the vpc.ModifySslVpnServer API asynchronously
func (client *Client) ModifySslVpnServerWithCallback(request *ModifySslVpnServerRequest, callback func(response *ModifySslVpnServerResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *ModifySslVpnServerResponse
var err error
defer close(result)
response, err = client.ModifySslVpnServer(request)
callback(response, err)
result <- 1
})
if err != nil {
defer close(result)
callback(nil, err)
result <- 0
}
return result
}
// ModifySslVpnServerRequest is the request struct for api ModifySslVpnServer
type ModifySslVpnServerRequest struct {
*requests.RpcRequest
ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
ClientToken string `position:"Query" name:"ClientToken"`
SslVpnServerId string `position:"Query" name:"SslVpnServerId"`
LocalSubnet string `position:"Query" name:"LocalSubnet"`
IDaaSRegionId string `position:"Query" name:"IDaaSRegionId"`
EnableMultiFactorAuth requests.Boolean `position:"Query" name:"EnableMultiFactorAuth"`
IDaaSInstanceId string `position:"Query" name:"IDaaSInstanceId"`
Cipher string `position:"Query" name:"Cipher"`
ClientIpPool string `position:"Query" name:"ClientIpPool"`
ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
Compress requests.Boolean `position:"Query" name:"Compress"`
OwnerAccount string `position:"Query" name:"OwnerAccount"`
OwnerId requests.Integer `position:"Query" name:"OwnerId"`
Port requests.Integer `position:"Query" name:"Port"`
Proto string `position:"Query" name:"Proto"`
Name string `position:"Query" name:"Name"`
}
// ModifySslVpnServerResponse is the response struct for api ModifySslVpnServer
type ModifySslVpnServerResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
RegionId string `json:"RegionId" xml:"RegionId"`
SslVpnServerId string `json:"SslVpnServerId" xml:"SslVpnServerId"`
VpnGatewayId string `json:"VpnGatewayId" xml:"VpnGatewayId"`
Name string `json:"Name" xml:"Name"`
LocalSubnet string `json:"LocalSubnet" xml:"LocalSubnet"`
ClientIpPool string `json:"ClientIpPool" xml:"ClientIpPool"`
CreateTime int64 `json:"CreateTime" xml:"CreateTime"`
Cipher string `json:"Cipher" xml:"Cipher"`
Proto string `json:"Proto" xml:"Proto"`
Port int `json:"Port" xml:"Port"`
Compress bool `json:"Compress" xml:"Compress"`
Connections int `json:"Connections" xml:"Connections"`
MaxConnections int `json:"MaxConnections" xml:"MaxConnections"`
InternetIp string `json:"InternetIp" xml:"InternetIp"`
EnableMultiFactorAuth bool `json:"EnableMultiFactorAuth" xml:"EnableMultiFactorAuth"`
IDaaSInstanceId string `json:"IDaaSInstanceId" xml:"IDaaSInstanceId"`
}
// CreateModifySslVpnServerRequest creates a request to invoke ModifySslVpnServer API
func CreateModifySslVpnServerRequest() (request *ModifySslVpnServerRequest) {
request = &ModifySslVpnServerRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("Vpc", "2016-04-28", "ModifySslVpnServer", "vpc", "openAPI")
request.Method = requests.POST
return
}
// CreateModifySslVpnServerResponse creates a response to parse from ModifySslVpnServer response
func CreateModifySslVpnServerResponse() (response *ModifySslVpnServerResponse) {
response = &ModifySslVpnServerResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}
| kubernetes/cloud-provider-alibaba-cloud | vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ssl_vpn_server.go | GO | apache-2.0 | 5,703 |
/**
* $Id$
* $URL$
* GenericDaoTest.java - genericdao - May 18, 2008 4:34:33 PM - azeckoski
**************************************************************************
* Copyright (c) 2008 Aaron Zeckoski
* Licensed under the Apache License, Version 2.0
*
* A copy of the Apache License has been included in this
* distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk)
*/
package org.sakaiproject.genericdao.hibernate;
import java.util.ArrayList;
import java.util.List;
import junit.framework.Assert;
import org.sakaiproject.genericdao.test.AbstractTestGenericDao;
/**
* Testing the {@link org.sakaiproject.genericdao.api.GenericDao}
*
* @author Aaron Zeckoski (aaronz@vt.edu)
*/
public class GenericDaoTest extends AbstractTestGenericDao {
@Override
protected String[] getConfigLocations() {
// point to the spring-hibernate.xml file, must be on the classpath
// (add component/src/webapp/WEB-INF to the build path in Eclipse)
return new String[] {"spring-common.xml","spring-hibernate.xml"};
}
/**
* Test method for {@link org.sakaiproject.genericdao.hibernate.HibernateGenericDao#setPersistentClasses(java.util.List)}.
*/
public void testSetPersistentClasses() {
HibernateGenericDao genericDao = new HibernateGenericDao();
List<String> l = new ArrayList<String>();
l.add("org.sakaiproject.genericdao.test.GenericTestObject");
genericDao.setPersistentClasses(l);
// test null list
l = null;
try {
genericDao.setPersistentClasses(l);
Assert.fail("Should have thrown a NullPointerException");
} catch (NullPointerException e) {
Assert.assertNotNull(e.getStackTrace());
}
// test empty list
l = new ArrayList<String>();
try {
genericDao.setPersistentClasses(l);
Assert.fail("Should have thrown an IllegalArgumentException");
} catch (IllegalArgumentException e) {
Assert.assertNotNull(e.getStackTrace());
}
}
}
| prince1a/genericdao | src/test/java/org/sakaiproject/genericdao/hibernate/GenericDaoTest.java | Java | apache-2.0 | 2,016 |
/*
* Copyright 2015 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* 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 org.drools.workbench.screens.scorecardxls.type;
import javax.enterprise.context.ApplicationScoped;
import org.uberfire.backend.vfs.Path;
import org.uberfire.workbench.type.ResourceTypeDefinition;
@ApplicationScoped
public class ScoreCardXLSResourceTypeDefinition
implements ResourceTypeDefinition {
@Override
public String getShortName() {
return "scorecard.xls";
}
@Override
public String getDescription() {
return "XLS Score Card";
}
@Override
public String getPrefix() {
return "";
}
@Override
public String getSuffix() {
return "sxls";
}
@Override
public int getPriority() {
return 0;
}
@Override
public String getSimpleWildcardPattern() {
return "*." + getSuffix();
}
@Override
public boolean accept( final Path path ) {
return path.getFileName().endsWith( "." + getSuffix() );
}
}
| sdgdsffdsfff/drools-wb | drools-wb-screens/drools-wb-scorecard-xls-editor/drools-wb-scorecard-xls-editor-api/src/main/java/org/drools/workbench/screens/scorecardxls/type/ScoreCardXLSResourceTypeDefinition.java | Java | apache-2.0 | 1,505 |
<div class="modal-header">
<button class="btn btn-default close" ng-click="s.cancel()"><span aria-hidden="true">×</span></button>
<h3 class="modal-title">Project Content</h3>
</div>
<div class="modal-body">
<section class="panel panel-default no-margin">
<table class="table table-scroll add-vc-table" ng-table="s.tableParams" show-filter="true">
<tr ng-repeat="t in s.items">
<td class="name-col select"
header-class="'name-col'"
filter="{'name':'text'}"
data-title="'Name'">
<input type="checkbox" ng-click="s.select(t._id)" ng-checked="s.isSelected(t._id)"/>{{ t.name }}</td>
<td data-title="'Version'">{{t.version}}</td><span ng-if="t.published" class="label label-success pull-right">published</span>
</tr>
<tr ng-show="!s.items" class="text-center">
<td colspan="3">No Project Content found.</td>
</tr>
</table>
</section>
</div>
<div class="modal-footer">
<button class="btn btn-default" ng-click="s.cancel()">Cancel</button>
<button class="btn btn-primary" ng-disabled="!(s.selected && s.selected.length > 0)" ng-click="s.ok()">OK</span></button>
</div>
| logancodes/esm-server | modules/artifacts/client/views/artifact-list-chooser.html | HTML | apache-2.0 | 1,182 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.
*/
package org.apache.oodt.cas.cli.option.store.spring;
//JDK imports
import java.util.Map;
import java.util.Set;
//OODT imports
import org.apache.oodt.cas.cli.option.CmdLineOption;
import org.apache.oodt.cas.cli.option.store.CmdLineOptionStore;
//Spring imports
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
//Google imports
import com.google.common.collect.Sets;
/**
* Spring Framework based {@link CmdLineOptionStore}.
*
* @author bfoster (Brian Foster)
*/
public class SpringCmdLineOptionStore implements CmdLineOptionStore {
private ApplicationContext appContext;
public SpringCmdLineOptionStore(String springConfig) {
appContext = new FileSystemXmlApplicationContext(springConfig);
}
@Override
public Set<CmdLineOption> loadSupportedOptions() {
@SuppressWarnings("unchecked")
Map<String, CmdLineOption> optionsMap = appContext
.getBeansOfType(CmdLineOption.class);
Set<CmdLineOption> supportedOptions = Sets.newHashSet();
for (CmdLineOption option : optionsMap.values()) {
if (!option.isSubOption()) {
supportedOptions.add(option);
}
}
return supportedOptions;
}
protected ApplicationContext getApplicationContext() {
return appContext;
}
}
| apache/oodt | cli/src/main/java/org/apache/oodt/cas/cli/option/store/spring/SpringCmdLineOptionStore.java | Java | apache-2.0 | 2,159 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.
*/
package org.apache.spark.mllib.examples;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.mllib.recommendation.ALS;
import org.apache.spark.mllib.recommendation.MatrixFactorizationModel;
import org.apache.spark.mllib.recommendation.Rating;
import java.util.Arrays;
import java.util.regex.Pattern;
import scala.Tuple2;
/**
* Example using MLLib ALS from Java.
*/
public final class JavaALS {
static class ParseRating extends Function<String, Rating> {
private static final Pattern COMMA = Pattern.compile(",");
@Override
public Rating call(String line) {
String[] tok = COMMA.split(line);
int x = Integer.parseInt(tok[0]);
int y = Integer.parseInt(tok[1]);
double rating = Double.parseDouble(tok[2]);
return new Rating(x, y, rating);
}
}
static class FeaturesToString extends Function<Tuple2<Object, double[]>, String> {
@Override
public String call(Tuple2<Object, double[]> element) {
return element._1() + "," + Arrays.toString(element._2());
}
}
public static void main(String[] args) {
if (args.length != 5 && args.length != 6) {
System.err.println(
"Usage: JavaALS <master> <ratings_file> <rank> <iterations> <output_dir> [<blocks>]");
System.exit(1);
}
int rank = Integer.parseInt(args[2]);
int iterations = Integer.parseInt(args[3]);
String outputDir = args[4];
int blocks = -1;
if (args.length == 6) {
blocks = Integer.parseInt(args[5]);
}
JavaSparkContext sc = new JavaSparkContext(args[0], "JavaALS",
System.getenv("SPARK_HOME"), JavaSparkContext.jarOfClass(JavaALS.class));
JavaRDD<String> lines = sc.textFile(args[1]);
JavaRDD<Rating> ratings = lines.map(new ParseRating());
MatrixFactorizationModel model = ALS.train(ratings.rdd(), rank, iterations, 0.01, blocks);
model.userFeatures().toJavaRDD().map(new FeaturesToString()).saveAsTextFile(
outputDir + "/userFeatures");
model.productFeatures().toJavaRDD().map(new FeaturesToString()).saveAsTextFile(
outputDir + "/productFeatures");
System.out.println("Final user/product features written to " + outputDir);
System.exit(0);
}
}
| sryza/spark | examples/src/main/java/org/apache/spark/mllib/examples/JavaALS.java | Java | apache-2.0 | 3,124 |
/*
* Copyright (c) 2013 DataTorrent, Inc. ALL Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.datatorrent.netlet;
import java.net.InetSocketAddress;
import com.datatorrent.netlet.Listener.ClientListener;
import com.datatorrent.netlet.Listener.ServerListener;
/**
* <p>EventLoop interface.</p>
*
* @since 1.0.0
*/
public interface EventLoop
{
void connect(final InetSocketAddress address, final ClientListener l);
void disconnect(final ClientListener l);
//void register(ServerSocketChannel channel, Listener l);
//void register(SocketChannel channel, int ops, Listener l);
void start(final String host, final int port, final ServerListener l);
void stop(final ServerListener l);
void submit(Runnable r);
//void unregister(final SelectableChannel c);
}
| DataTorrent/Netlet | src/main/java/com/datatorrent/netlet/EventLoop.java | Java | apache-2.0 | 1,325 |
/*
* Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.dynamodb.model.transform;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Map;
import java.util.List;
import com.amazonaws.AmazonClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.dynamodb.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.StringUtils;
import com.amazonaws.util.StringInputStream;
import com.amazonaws.util.json.*;
/**
* Batch Write Item Request Marshaller
*/
public class BatchWriteItemRequestMarshaller implements Marshaller<Request<BatchWriteItemRequest>, BatchWriteItemRequest> {
public Request<BatchWriteItemRequest> marshall(BatchWriteItemRequest batchWriteItemRequest) {
if (batchWriteItemRequest == null) {
throw new AmazonClientException("Invalid argument passed to marshall(...)");
}
Request<BatchWriteItemRequest> request = new DefaultRequest<BatchWriteItemRequest>(batchWriteItemRequest, "AmazonDynamoDB");
String target = "DynamoDB_20111205.BatchWriteItem";
request.addHeader("X-Amz-Target", target);
request.addHeader("Content-Type", "application/x-amz-json-1.0");
request.setHttpMethod(HttpMethodName.POST);
String uriResourcePath = "";
uriResourcePath = uriResourcePath.replaceAll("//", "/");
if (uriResourcePath.contains("?")) {
String queryString = uriResourcePath.substring(uriResourcePath.indexOf("?") + 1);
uriResourcePath = uriResourcePath.substring(0, uriResourcePath.indexOf("?"));
for (String s : queryString.split("[;&]")) {
String[] nameValuePair = s.split("=");
if (nameValuePair.length == 2) {
request.addParameter(nameValuePair[0], nameValuePair[1]);
} else {
request.addParameter(s, null);
}
}
}
request.setResourcePath(uriResourcePath);
try {
StringWriter stringWriter = new StringWriter();
JSONWriter jsonWriter = new JSONWriter(stringWriter);
jsonWriter.object();
if (batchWriteItemRequest.getRequestItems() != null) {
jsonWriter.key("RequestItems");
jsonWriter.object();
for (Map.Entry<String, java.util.List<WriteRequest>> requestItemsListValue : batchWriteItemRequest.getRequestItems().entrySet()) {
if (requestItemsListValue.getValue() != null) {
jsonWriter.key(requestItemsListValue.getKey());
jsonWriter.array();
for (WriteRequest valueListValue : requestItemsListValue.getValue()) {
if (valueListValue != null) {
jsonWriter.object();
PutRequest putRequest = valueListValue.getPutRequest();
if (putRequest != null) {
jsonWriter.key("PutRequest");
jsonWriter.object();
if (putRequest.getItem() != null) {
jsonWriter.key("Item");
jsonWriter.object();
for (Map.Entry<String, AttributeValue> itemListValue : putRequest.getItem().entrySet()) {
if (itemListValue.getValue() != null) {
jsonWriter.key(itemListValue.getKey());
jsonWriter.object();
if (itemListValue.getValue().getS() != null) {
jsonWriter.key("S").value(itemListValue.getValue().getS());
}
if (itemListValue.getValue().getN() != null) {
jsonWriter.key("N").value(itemListValue.getValue().getN());
}
if (itemListValue.getValue().getB() != null) {
jsonWriter.key("B").value(itemListValue.getValue().getB());
}
java.util.List<String> sSList = itemListValue.getValue().getSS();
if (sSList != null && sSList.size() > 0) {
jsonWriter.key("SS");
jsonWriter.array();
for (String sSListValue : sSList) {
if (sSListValue != null) {
jsonWriter.value(sSListValue);
}
}
jsonWriter.endArray();
}
java.util.List<String> nSList = itemListValue.getValue().getNS();
if (nSList != null && nSList.size() > 0) {
jsonWriter.key("NS");
jsonWriter.array();
for (String nSListValue : nSList) {
if (nSListValue != null) {
jsonWriter.value(nSListValue);
}
}
jsonWriter.endArray();
}
java.util.List<java.nio.ByteBuffer> bSList = itemListValue.getValue().getBS();
if (bSList != null && bSList.size() > 0) {
jsonWriter.key("BS");
jsonWriter.array();
for (java.nio.ByteBuffer bSListValue : bSList) {
if (bSListValue != null) {
jsonWriter.value(bSListValue);
}
}
jsonWriter.endArray();
}
jsonWriter.endObject();
}
}
jsonWriter.endObject();
}
jsonWriter.endObject();
}
DeleteRequest deleteRequest = valueListValue.getDeleteRequest();
if (deleteRequest != null) {
jsonWriter.key("DeleteRequest");
jsonWriter.object();
Key key = deleteRequest.getKey();
if (key != null) {
jsonWriter.key("Key");
jsonWriter.object();
AttributeValue hashKeyElement = key.getHashKeyElement();
if (hashKeyElement != null) {
jsonWriter.key("HashKeyElement");
jsonWriter.object();
if (hashKeyElement.getS() != null) {
jsonWriter.key("S").value(hashKeyElement.getS());
}
if (hashKeyElement.getN() != null) {
jsonWriter.key("N").value(hashKeyElement.getN());
}
if (hashKeyElement.getB() != null) {
jsonWriter.key("B").value(hashKeyElement.getB());
}
java.util.List<String> sSList = hashKeyElement.getSS();
if (sSList != null && sSList.size() > 0) {
jsonWriter.key("SS");
jsonWriter.array();
for (String sSListValue : sSList) {
if (sSListValue != null) {
jsonWriter.value(sSListValue);
}
}
jsonWriter.endArray();
}
java.util.List<String> nSList = hashKeyElement.getNS();
if (nSList != null && nSList.size() > 0) {
jsonWriter.key("NS");
jsonWriter.array();
for (String nSListValue : nSList) {
if (nSListValue != null) {
jsonWriter.value(nSListValue);
}
}
jsonWriter.endArray();
}
java.util.List<java.nio.ByteBuffer> bSList = hashKeyElement.getBS();
if (bSList != null && bSList.size() > 0) {
jsonWriter.key("BS");
jsonWriter.array();
for (java.nio.ByteBuffer bSListValue : bSList) {
if (bSListValue != null) {
jsonWriter.value(bSListValue);
}
}
jsonWriter.endArray();
}
jsonWriter.endObject();
}
AttributeValue rangeKeyElement = key.getRangeKeyElement();
if (rangeKeyElement != null) {
jsonWriter.key("RangeKeyElement");
jsonWriter.object();
if (rangeKeyElement.getS() != null) {
jsonWriter.key("S").value(rangeKeyElement.getS());
}
if (rangeKeyElement.getN() != null) {
jsonWriter.key("N").value(rangeKeyElement.getN());
}
if (rangeKeyElement.getB() != null) {
jsonWriter.key("B").value(rangeKeyElement.getB());
}
java.util.List<String> sSList = rangeKeyElement.getSS();
if (sSList != null && sSList.size() > 0) {
jsonWriter.key("SS");
jsonWriter.array();
for (String sSListValue : sSList) {
if (sSListValue != null) {
jsonWriter.value(sSListValue);
}
}
jsonWriter.endArray();
}
java.util.List<String> nSList = rangeKeyElement.getNS();
if (nSList != null && nSList.size() > 0) {
jsonWriter.key("NS");
jsonWriter.array();
for (String nSListValue : nSList) {
if (nSListValue != null) {
jsonWriter.value(nSListValue);
}
}
jsonWriter.endArray();
}
java.util.List<java.nio.ByteBuffer> bSList = rangeKeyElement.getBS();
if (bSList != null && bSList.size() > 0) {
jsonWriter.key("BS");
jsonWriter.array();
for (java.nio.ByteBuffer bSListValue : bSList) {
if (bSListValue != null) {
jsonWriter.value(bSListValue);
}
}
jsonWriter.endArray();
}
jsonWriter.endObject();
}
jsonWriter.endObject();
}
jsonWriter.endObject();
}
jsonWriter.endObject();
}
}
jsonWriter.endArray();
}
}
jsonWriter.endObject();
}
jsonWriter.endObject();
String snippet = stringWriter.toString();
byte[] content = snippet.getBytes("UTF-8");
request.setContent(new StringInputStream(snippet));
request.addHeader("Content-Length", Integer.toString(content.length));
} catch(Throwable t) {
throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
}
return request;
}
private String getString(String s) {
if (s == null) return "";
return s;
}
}
| SaiNadh001/aws-sdk-for-java | src/main/java/com/amazonaws/services/dynamodb/model/transform/BatchWriteItemRequestMarshaller.java | Java | apache-2.0 | 16,822 |
/*
Copyright 2017 The Kubernetes Authors.
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 proto_test
import (
"path/filepath"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/kube-openapi/pkg/util/proto"
"k8s.io/kube-openapi/pkg/util/proto/testing"
)
var fakeSchema = testing.Fake{Path: filepath.Join("testing", "swagger.json")}
var _ = Describe("Reading apps/v1beta1/Deployment from openAPIData", func() {
var resources proto.Resources
BeforeEach(func() {
s, err := fakeSchema.OpenAPISchema()
Expect(err).To(BeNil())
resources, err = proto.NewOpenAPIData(s, testing.ParseGroupVersionKind)
Expect(err).To(BeNil())
})
id := testing.GvkString("apps", "v1beta1", "Deployment")
var schema proto.Schema
It("should lookup the Schema by its GroupVersionKind", func() {
schema = resources.LookupResource(id)
Expect(schema).ToNot(BeNil())
})
var deployment *proto.Kind
It("should be a Kind", func() {
deployment = schema.(*proto.Kind)
Expect(deployment).ToNot(BeNil())
})
It("should have a path", func() {
Expect(deployment.GetPath().Get()).To(Equal([]string{"io.k8s.api.apps.v1beta1.Deployment"}))
})
It("should have a kind key of type string", func() {
Expect(deployment.Fields).To(HaveKey("kind"))
key := deployment.Fields["kind"].(*proto.Primitive)
Expect(key).ToNot(BeNil())
Expect(key.Type).To(Equal("string"))
Expect(key.GetPath().Get()).To(Equal([]string{"io.k8s.api.apps.v1beta1.Deployment", ".kind"}))
})
It("should have a apiVersion key of type string", func() {
Expect(deployment.Fields).To(HaveKey("apiVersion"))
key := deployment.Fields["apiVersion"].(*proto.Primitive)
Expect(key).ToNot(BeNil())
Expect(key.Type).To(Equal("string"))
Expect(key.GetPath().Get()).To(Equal([]string{"io.k8s.api.apps.v1beta1.Deployment", ".apiVersion"}))
})
It("should have a metadata key of type Reference", func() {
Expect(deployment.Fields).To(HaveKey("metadata"))
key := deployment.Fields["metadata"].(proto.Reference)
Expect(key).ToNot(BeNil())
Expect(key.Reference()).To(Equal("io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"))
subSchema := key.SubSchema().(*proto.Kind)
Expect(subSchema).ToNot(BeNil())
})
var status *proto.Kind
It("should have a status key of type Reference", func() {
Expect(deployment.Fields).To(HaveKey("status"))
key := deployment.Fields["status"].(proto.Reference)
Expect(key).ToNot(BeNil())
Expect(key.Reference()).To(Equal("io.k8s.api.apps.v1beta1.DeploymentStatus"))
status = key.SubSchema().(*proto.Kind)
Expect(status).ToNot(BeNil())
})
It("should have a valid DeploymentStatus", func() {
By("having availableReplicas key")
Expect(status.Fields).To(HaveKey("availableReplicas"))
replicas := status.Fields["availableReplicas"].(*proto.Primitive)
Expect(replicas).ToNot(BeNil())
Expect(replicas.Type).To(Equal("integer"))
By("having conditions key")
Expect(status.Fields).To(HaveKey("conditions"))
conditions := status.Fields["conditions"].(*proto.Array)
Expect(conditions).ToNot(BeNil())
Expect(conditions.GetName()).To(Equal(`Array of Reference to "io.k8s.api.apps.v1beta1.DeploymentCondition"`))
Expect(conditions.GetExtensions()).To(Equal(map[string]interface{}{
"x-kubernetes-patch-merge-key": "type",
"x-kubernetes-patch-strategy": "merge",
}))
condition := conditions.SubType.(proto.Reference)
Expect(condition.Reference()).To(Equal("io.k8s.api.apps.v1beta1.DeploymentCondition"))
})
var spec *proto.Kind
It("should have a spec key of type Reference", func() {
Expect(deployment.Fields).To(HaveKey("spec"))
key := deployment.Fields["spec"].(proto.Reference)
Expect(key).ToNot(BeNil())
Expect(key.Reference()).To(Equal("io.k8s.api.apps.v1beta1.DeploymentSpec"))
spec = key.SubSchema().(*proto.Kind)
Expect(spec).ToNot(BeNil())
})
It("should have a spec with no gvk", func() {
_, found := spec.GetExtensions()["x-kubernetes-group-version-kind"]
Expect(found).To(BeFalse())
})
It("should have a spec with a PodTemplateSpec sub-field", func() {
Expect(spec.Fields).To(HaveKey("template"))
key := spec.Fields["template"].(proto.Reference)
Expect(key).ToNot(BeNil())
Expect(key.Reference()).To(Equal("io.k8s.api.core.v1.PodTemplateSpec"))
})
})
var _ = Describe("Reading authorization.k8s.io/v1/SubjectAccessReview from openAPIData", func() {
var resources proto.Resources
BeforeEach(func() {
s, err := fakeSchema.OpenAPISchema()
Expect(err).To(BeNil())
resources, err = proto.NewOpenAPIData(s, testing.ParseGroupVersionKind)
Expect(err).To(BeNil())
})
id := testing.GvkString("authorization.k8s.io", "v1", "SubjectAccessReview")
var schema proto.Schema
It("should lookup the Schema by its GroupVersionKind", func() {
schema = resources.LookupResource(id)
Expect(schema).ToNot(BeNil())
})
var sarspec *proto.Kind
It("should be a Kind and have a spec", func() {
sar := schema.(*proto.Kind)
Expect(sar).ToNot(BeNil())
Expect(sar.Fields).To(HaveKey("spec"))
specRef := sar.Fields["spec"].(proto.Reference)
Expect(specRef).ToNot(BeNil())
Expect(specRef.Reference()).To(Equal("io.k8s.api.authorization.v1.SubjectAccessReviewSpec"))
sarspec = specRef.SubSchema().(*proto.Kind)
Expect(sarspec).ToNot(BeNil())
})
It("should have a valid SubjectAccessReviewSpec", func() {
Expect(sarspec.Fields).To(HaveKey("extra"))
extra := sarspec.Fields["extra"].(*proto.Map)
Expect(extra).ToNot(BeNil())
Expect(extra.GetName()).To(Equal("Map of Array of string"))
Expect(extra.GetPath().Get()).To(Equal([]string{"io.k8s.api.authorization.v1.SubjectAccessReviewSpec", ".extra"}))
array := extra.SubType.(*proto.Array)
Expect(array).ToNot(BeNil())
Expect(array.GetName()).To(Equal("Array of string"))
Expect(array.GetPath().Get()).To(Equal([]string{"io.k8s.api.authorization.v1.SubjectAccessReviewSpec", ".extra"}))
str := array.SubType.(*proto.Primitive)
Expect(str).ToNot(BeNil())
Expect(str.Type).To(Equal("string"))
Expect(str.GetName()).To(Equal("string"))
Expect(str.GetPath().Get()).To(Equal([]string{"io.k8s.api.authorization.v1.SubjectAccessReviewSpec", ".extra"}))
})
})
var _ = Describe("Path", func() {
It("can be created by NewPath", func() {
path := proto.NewPath("key")
Expect(path.String()).To(Equal("key"))
})
It("can create and print complex paths", func() {
key := proto.NewPath("key")
array := key.ArrayPath(12)
field := array.FieldPath("subKey")
Expect(field.String()).To(Equal("key[12].subKey"))
})
It("has a length", func() {
key := proto.NewPath("key")
array := key.ArrayPath(12)
field := array.FieldPath("subKey")
Expect(field.Len()).To(Equal(3))
})
It("can look like an array", func() {
key := proto.NewPath("key")
array := key.ArrayPath(12)
field := array.FieldPath("subKey")
Expect(field.Get()).To(Equal([]string{"key", "[12]", ".subKey"}))
})
})
| koli/koli | vendor/k8s.io/kube-openapi/pkg/util/proto/openapi_test.go | GO | apache-2.0 | 7,361 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_19) on Thu Jun 25 16:46:13 EDT 2009 -->
<TITLE>
Document (CouchDB4AJ 0.3.0-SVN API)
</TITLE>
<META NAME="keywords" CONTENT="com.fourspaces.couchdb.Document class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Document (CouchDB4AJ 0.3.0-SVN API)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../com/fourspaces/couchdb/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Document.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../com/fourspaces/couchdb/Database.html" title="class in com.fourspaces.couchdb"><B>PREV CLASS</B></A>
<A HREF="../../../com/fourspaces/couchdb/Session.html" title="class in com.fourspaces.couchdb"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?com/fourspaces/couchdb/Document.html" target="_top"><B>FRAMES</B></A>
<A HREF="Document.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.fourspaces.couchdb</FONT>
<BR>
Class Document</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.fourspaces.couchdb.Document</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.util.Map</DD>
</DL>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../com/fourspaces/couchdb/ViewResults.html" title="class in com.fourspaces.couchdb">ViewResults</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>Document</B><DT>extends java.lang.Object<DT>implements java.util.Map</DL>
</PRE>
<P>
Everything in CouchDB is a Document. In this case, the document is an object backed by a
JSONObject. The Document is also aware of the database that it is connected to. This allows
the Document to reload it's properties when needed. The only special fields are "_id", "_rev",
"_revisions", and "_view_*".
<p>
All document have an _id and a _rev. If this is a new document those fields are populated when
they are saved to the CouchDB server.
<p>
_revisions is only populated if the document has been retrieved via database.getDocumentWithRevisions();
So, if this document wasn't, then when you call document.getRevisions(), it will go back to the server
to reload itself via database.getDocumentWithRevisions().
<p>
The Document can be treated like a JSONObject, eventhough it doesn't extend JSONObject (it's final).
<p>
You can also get/set values by calling document.get(key), document.put(key,value), just like a Map.
<p>
You can get a handle on the backing JSONObject by calling document.getJSONObject(); If this hasn't
been loaded yet, it will load the data itself using the given database connection.
<p>
If you got this Document from a view, you are likely missing elements. To load them you can call
document.load().
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>mbreese</DD>
</DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
</TABLE>
<A NAME="nested_classes_inherited_from_class_java.util.Map"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Nested classes/interfaces inherited from interface java.util.Map</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>java.util.Map.Entry<K,V></CODE></TD>
</TR>
</TABLE>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../com/fourspaces/couchdb/Database.html" title="class in com.fourspaces.couchdb">Database</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#database">database</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#object">object</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#Document()">Document</A></B>()</CODE>
<BR>
Create a new Document</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#Document(net.sf.json.JSONObject)">Document</A></B>(net.sf.json.JSONObject obj)</CODE>
<BR>
Create a new Document from a JSONObject</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#accumulate(java.lang.String, boolean)">accumulate</A></B>(java.lang.String arg0,
boolean arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#accumulate(java.lang.String, double)">accumulate</A></B>(java.lang.String arg0,
double arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#accumulate(java.lang.String, int)">accumulate</A></B>(java.lang.String arg0,
int arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#accumulate(java.lang.String, long)">accumulate</A></B>(java.lang.String arg0,
long arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#accumulate(java.lang.String, java.lang.Object)">accumulate</A></B>(java.lang.String arg0,
java.lang.Object arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#accumulateAll(java.util.Map)">accumulateAll</A></B>(java.util.Map arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../com/fourspaces/couchdb/View.html" title="class in com.fourspaces.couchdb">View</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#addView(java.lang.String, java.lang.String, java.lang.String)">addView</A></B>(java.lang.String designDoc,
java.lang.String viewName,
java.lang.String function)</CODE>
<BR>
Add a view to this document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#clear()">clear</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#containsKey(java.lang.Object)">containsKey</A></B>(java.lang.Object arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#containsValue(java.lang.Object)">containsValue</A></B>(java.lang.Object arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#deleteView(java.lang.String)">deleteView</A></B>(java.lang.String viewName)</CODE>
<BR>
Removes a view from this document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#element(java.lang.String, boolean)">element</A></B>(java.lang.String arg0,
boolean arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#element(java.lang.String, java.util.Collection)">element</A></B>(java.lang.String arg0,
java.util.Collection arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#element(java.lang.String, double)">element</A></B>(java.lang.String arg0,
double arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#element(java.lang.String, int)">element</A></B>(java.lang.String arg0,
int arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#element(java.lang.String, long)">element</A></B>(java.lang.String arg0,
long arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#element(java.lang.String, java.util.Map)">element</A></B>(java.lang.String arg0,
java.util.Map arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#element(java.lang.String, java.lang.Object)">element</A></B>(java.lang.String arg0,
java.lang.Object arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#elementOpt(java.lang.String, java.lang.Object)">elementOpt</A></B>(java.lang.String arg0,
java.lang.Object arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Set</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#entrySet()">entrySet</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#get(java.lang.Object)">get</A></B>(java.lang.Object arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#get(java.lang.String)">get</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getBoolean(java.lang.String)">getBoolean</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getDouble(java.lang.String)">getDouble</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getId()">getId</A></B>()</CODE>
<BR>
This document's id (if saved)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getInt(java.lang.String)">getInt</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONArray</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getJSONArray(java.lang.String)">getJSONArray</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getJSONObject()">getJSONObject</A></B>()</CODE>
<BR>
Retrieves the backing JSONObject</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getJSONObject(java.lang.String)">getJSONObject</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getLong(java.lang.String)">getLong</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getRev()">getRev</A></B>()</CODE>
<BR>
This document's Revision (if saved)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getRevisions()">getRevisions</A></B>()</CODE>
<BR>
A list of the revision numbers that this document has.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getString(java.lang.String)">getString</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../com/fourspaces/couchdb/View.html" title="class in com.fourspaces.couchdb">View</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getView(java.lang.String)">getView</A></B>(java.lang.String name)</CODE>
<BR>
Get a named view that is stored in the document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#getViewDocumentId()">getViewDocumentId</A></B>()</CODE>
<BR>
This strips _design from the document id</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#has(java.lang.String)">has</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#isEmpty()">isEmpty</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Iterator</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#keys()">keys</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Set</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#keySet()">keySet</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#load(net.sf.json.JSONObject)">load</A></B>(net.sf.json.JSONObject object2)</CODE>
<BR>
Load data into this document from a differing JSONObject</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONArray</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#names()">names</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#opt(java.lang.String)">opt</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optBoolean(java.lang.String)">optBoolean</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optBoolean(java.lang.String, boolean)">optBoolean</A></B>(java.lang.String arg0,
boolean arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optDouble(java.lang.String)">optDouble</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optDouble(java.lang.String, double)">optDouble</A></B>(java.lang.String arg0,
double arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optInt(java.lang.String)">optInt</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optInt(java.lang.String, int)">optInt</A></B>(java.lang.String arg0,
int arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONArray</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optJSONArray(java.lang.String)">optJSONArray</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> net.sf.json.JSONObject</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optJSONObject(java.lang.String)">optJSONObject</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optLong(java.lang.String)">optLong</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optLong(java.lang.String, long)">optLong</A></B>(java.lang.String arg0,
long arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optString(java.lang.String)">optString</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#optString(java.lang.String, java.lang.String)">optString</A></B>(java.lang.String arg0,
java.lang.String arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#populateRevisions()">populateRevisions</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#put(java.lang.Object, java.lang.Object)">put</A></B>(java.lang.Object arg0,
java.lang.Object arg1)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#putAll(java.util.Map)">putAll</A></B>(java.util.Map arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#refresh()">refresh</A></B>()</CODE>
<BR>
Loads data from the server for this document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#remove(java.lang.Object)">remove</A></B>(java.lang.Object arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#remove(java.lang.String)">remove</A></B>(java.lang.String arg0)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#setId(java.lang.String)">setId</A></B>(java.lang.String id)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#setRev(java.lang.String)">setRev</A></B>(java.lang.String rev)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#size()">size</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#toString()">toString</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.Collection</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/fourspaces/couchdb/Document.html#values()">values</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.util.Map"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface java.util.Map</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, hashCode</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="database"><!-- --></A><H3>
database</H3>
<PRE>
protected <A HREF="../../../com/fourspaces/couchdb/Database.html" title="class in com.fourspaces.couchdb">Database</A> <B>database</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="object"><!-- --></A><H3>
object</H3>
<PRE>
protected net.sf.json.JSONObject <B>object</B></PRE>
<DL>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Document()"><!-- --></A><H3>
Document</H3>
<PRE>
public <B>Document</B>()</PRE>
<DL>
<DD>Create a new Document
<P>
</DL>
<HR>
<A NAME="Document(net.sf.json.JSONObject)"><!-- --></A><H3>
Document</H3>
<PRE>
public <B>Document</B>(net.sf.json.JSONObject obj)</PRE>
<DL>
<DD>Create a new Document from a JSONObject
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - </DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="load(net.sf.json.JSONObject)"><!-- --></A><H3>
load</H3>
<PRE>
protected void <B>load</B>(net.sf.json.JSONObject object2)</PRE>
<DL>
<DD>Load data into this document from a differing JSONObject
<p>
This is mainly for reloading data for an object that was retrieved from a view. This version
doesn't overwrite any unsaved data that is currently present in this object.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>object2</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="getId()"><!-- --></A><H3>
getId</H3>
<PRE>
public java.lang.String <B>getId</B>()</PRE>
<DL>
<DD>This document's id (if saved)
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="setId(java.lang.String)"><!-- --></A><H3>
setId</H3>
<PRE>
public void <B>setId</B>(java.lang.String id)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getViewDocumentId()"><!-- --></A><H3>
getViewDocumentId</H3>
<PRE>
public java.lang.String <B>getViewDocumentId</B>()</PRE>
<DL>
<DD>This strips _design from the document id
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getRev()"><!-- --></A><H3>
getRev</H3>
<PRE>
public java.lang.String <B>getRev</B>()</PRE>
<DL>
<DD>This document's Revision (if saved)
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="setRev(java.lang.String)"><!-- --></A><H3>
setRev</H3>
<PRE>
public void <B>setRev</B>(java.lang.String rev)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getRevisions()"><!-- --></A><H3>
getRevisions</H3>
<PRE>
public java.lang.String[] <B>getRevisions</B>()
throws java.io.IOException</PRE>
<DL>
<DD>A list of the revision numbers that this document has. If this hasn't been
populated with a "full=true" query, then the database will be re-queried
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getView(java.lang.String)"><!-- --></A><H3>
getView</H3>
<PRE>
public <A HREF="../../../com/fourspaces/couchdb/View.html" title="class in com.fourspaces.couchdb">View</A> <B>getView</B>(java.lang.String name)</PRE>
<DL>
<DD>Get a named view that is stored in the document.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="addView(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>
addView</H3>
<PRE>
public <A HREF="../../../com/fourspaces/couchdb/View.html" title="class in com.fourspaces.couchdb">View</A> <B>addView</B>(java.lang.String designDoc,
java.lang.String viewName,
java.lang.String function)</PRE>
<DL>
<DD>Add a view to this document. If a view function already exists with the given viewName
it is overwritten.
<p>
This isn't persisted until the document is saved.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>design</CODE> - document name<DD><CODE>viewName</CODE> - <DD><CODE>function</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="deleteView(java.lang.String)"><!-- --></A><H3>
deleteView</H3>
<PRE>
public void <B>deleteView</B>(java.lang.String viewName)</PRE>
<DL>
<DD>Removes a view from this document.
<p>
This isn't persisted until the document is saved.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>viewName</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="refresh()"><!-- --></A><H3>
refresh</H3>
<PRE>
public void <B>refresh</B>()
throws java.io.IOException</PRE>
<DL>
<DD>Loads data from the server for this document. Actually requests a new copy of data from the
server and uses that to populate this document. This doesn't overwrite any unsaved data.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="populateRevisions()"><!-- --></A><H3>
populateRevisions</H3>
<PRE>
protected void <B>populateRevisions</B>()
throws java.io.IOException</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getJSONObject()"><!-- --></A><H3>
getJSONObject</H3>
<PRE>
public net.sf.json.JSONObject <B>getJSONObject</B>()</PRE>
<DL>
<DD>Retrieves the backing JSONObject
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public java.lang.String <B>toString</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="accumulate(java.lang.String, boolean)"><!-- --></A><H3>
accumulate</H3>
<PRE>
public net.sf.json.JSONObject <B>accumulate</B>(java.lang.String arg0,
boolean arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="accumulate(java.lang.String, double)"><!-- --></A><H3>
accumulate</H3>
<PRE>
public net.sf.json.JSONObject <B>accumulate</B>(java.lang.String arg0,
double arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="accumulate(java.lang.String, int)"><!-- --></A><H3>
accumulate</H3>
<PRE>
public net.sf.json.JSONObject <B>accumulate</B>(java.lang.String arg0,
int arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="accumulate(java.lang.String, long)"><!-- --></A><H3>
accumulate</H3>
<PRE>
public net.sf.json.JSONObject <B>accumulate</B>(java.lang.String arg0,
long arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="accumulate(java.lang.String, java.lang.Object)"><!-- --></A><H3>
accumulate</H3>
<PRE>
public net.sf.json.JSONObject <B>accumulate</B>(java.lang.String arg0,
java.lang.Object arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="accumulateAll(java.util.Map)"><!-- --></A><H3>
accumulateAll</H3>
<PRE>
public void <B>accumulateAll</B>(java.util.Map arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="clear()"><!-- --></A><H3>
clear</H3>
<PRE>
public void <B>clear</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>clear</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="containsKey(java.lang.Object)"><!-- --></A><H3>
containsKey</H3>
<PRE>
public boolean <B>containsKey</B>(java.lang.Object arg0)</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>containsKey</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="containsValue(java.lang.Object)"><!-- --></A><H3>
containsValue</H3>
<PRE>
public boolean <B>containsValue</B>(java.lang.Object arg0)</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>containsValue</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="element(java.lang.String, boolean)"><!-- --></A><H3>
element</H3>
<PRE>
public net.sf.json.JSONObject <B>element</B>(java.lang.String arg0,
boolean arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="element(java.lang.String, java.util.Collection)"><!-- --></A><H3>
element</H3>
<PRE>
public net.sf.json.JSONObject <B>element</B>(java.lang.String arg0,
java.util.Collection arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="element(java.lang.String, double)"><!-- --></A><H3>
element</H3>
<PRE>
public net.sf.json.JSONObject <B>element</B>(java.lang.String arg0,
double arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="element(java.lang.String, int)"><!-- --></A><H3>
element</H3>
<PRE>
public net.sf.json.JSONObject <B>element</B>(java.lang.String arg0,
int arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="element(java.lang.String, long)"><!-- --></A><H3>
element</H3>
<PRE>
public net.sf.json.JSONObject <B>element</B>(java.lang.String arg0,
long arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="element(java.lang.String, java.util.Map)"><!-- --></A><H3>
element</H3>
<PRE>
public net.sf.json.JSONObject <B>element</B>(java.lang.String arg0,
java.util.Map arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="element(java.lang.String, java.lang.Object)"><!-- --></A><H3>
element</H3>
<PRE>
public net.sf.json.JSONObject <B>element</B>(java.lang.String arg0,
java.lang.Object arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="elementOpt(java.lang.String, java.lang.Object)"><!-- --></A><H3>
elementOpt</H3>
<PRE>
public net.sf.json.JSONObject <B>elementOpt</B>(java.lang.String arg0,
java.lang.Object arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="entrySet()"><!-- --></A><H3>
entrySet</H3>
<PRE>
public java.util.Set <B>entrySet</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>entrySet</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="get(java.lang.Object)"><!-- --></A><H3>
get</H3>
<PRE>
public java.lang.Object <B>get</B>(java.lang.Object arg0)</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>get</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="get(java.lang.String)"><!-- --></A><H3>
get</H3>
<PRE>
public java.lang.Object <B>get</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getBoolean(java.lang.String)"><!-- --></A><H3>
getBoolean</H3>
<PRE>
public boolean <B>getBoolean</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getDouble(java.lang.String)"><!-- --></A><H3>
getDouble</H3>
<PRE>
public double <B>getDouble</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getInt(java.lang.String)"><!-- --></A><H3>
getInt</H3>
<PRE>
public int <B>getInt</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getJSONArray(java.lang.String)"><!-- --></A><H3>
getJSONArray</H3>
<PRE>
public net.sf.json.JSONArray <B>getJSONArray</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getJSONObject(java.lang.String)"><!-- --></A><H3>
getJSONObject</H3>
<PRE>
public net.sf.json.JSONObject <B>getJSONObject</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getLong(java.lang.String)"><!-- --></A><H3>
getLong</H3>
<PRE>
public long <B>getLong</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getString(java.lang.String)"><!-- --></A><H3>
getString</H3>
<PRE>
public java.lang.String <B>getString</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="has(java.lang.String)"><!-- --></A><H3>
has</H3>
<PRE>
public boolean <B>has</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="keys()"><!-- --></A><H3>
keys</H3>
<PRE>
public java.util.Iterator <B>keys</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="keySet()"><!-- --></A><H3>
keySet</H3>
<PRE>
public java.util.Set <B>keySet</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>keySet</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="names()"><!-- --></A><H3>
names</H3>
<PRE>
public net.sf.json.JSONArray <B>names</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="opt(java.lang.String)"><!-- --></A><H3>
opt</H3>
<PRE>
public java.lang.Object <B>opt</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optBoolean(java.lang.String, boolean)"><!-- --></A><H3>
optBoolean</H3>
<PRE>
public boolean <B>optBoolean</B>(java.lang.String arg0,
boolean arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optBoolean(java.lang.String)"><!-- --></A><H3>
optBoolean</H3>
<PRE>
public boolean <B>optBoolean</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optDouble(java.lang.String, double)"><!-- --></A><H3>
optDouble</H3>
<PRE>
public double <B>optDouble</B>(java.lang.String arg0,
double arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optDouble(java.lang.String)"><!-- --></A><H3>
optDouble</H3>
<PRE>
public double <B>optDouble</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optInt(java.lang.String, int)"><!-- --></A><H3>
optInt</H3>
<PRE>
public int <B>optInt</B>(java.lang.String arg0,
int arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optInt(java.lang.String)"><!-- --></A><H3>
optInt</H3>
<PRE>
public int <B>optInt</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optJSONArray(java.lang.String)"><!-- --></A><H3>
optJSONArray</H3>
<PRE>
public net.sf.json.JSONArray <B>optJSONArray</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optJSONObject(java.lang.String)"><!-- --></A><H3>
optJSONObject</H3>
<PRE>
public net.sf.json.JSONObject <B>optJSONObject</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optLong(java.lang.String, long)"><!-- --></A><H3>
optLong</H3>
<PRE>
public long <B>optLong</B>(java.lang.String arg0,
long arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optLong(java.lang.String)"><!-- --></A><H3>
optLong</H3>
<PRE>
public long <B>optLong</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optString(java.lang.String, java.lang.String)"><!-- --></A><H3>
optString</H3>
<PRE>
public java.lang.String <B>optString</B>(java.lang.String arg0,
java.lang.String arg1)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="optString(java.lang.String)"><!-- --></A><H3>
optString</H3>
<PRE>
public java.lang.String <B>optString</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="put(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
put</H3>
<PRE>
public java.lang.Object <B>put</B>(java.lang.Object arg0,
java.lang.Object arg1)</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>put</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="putAll(java.util.Map)"><!-- --></A><H3>
putAll</H3>
<PRE>
public void <B>putAll</B>(java.util.Map arg0)</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>putAll</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="remove(java.lang.Object)"><!-- --></A><H3>
remove</H3>
<PRE>
public java.lang.Object <B>remove</B>(java.lang.Object arg0)</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>remove</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="remove(java.lang.String)"><!-- --></A><H3>
remove</H3>
<PRE>
public java.lang.Object <B>remove</B>(java.lang.String arg0)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="size()"><!-- --></A><H3>
size</H3>
<PRE>
public int <B>size</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>size</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="values()"><!-- --></A><H3>
values</H3>
<PRE>
public java.util.Collection <B>values</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>values</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="isEmpty()"><!-- --></A><H3>
isEmpty</H3>
<PRE>
public boolean <B>isEmpty</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>isEmpty</CODE> in interface <CODE>java.util.Map</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../com/fourspaces/couchdb/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Document.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../com/fourspaces/couchdb/Database.html" title="class in com.fourspaces.couchdb"><B>PREV CLASS</B></A>
<A HREF="../../../com/fourspaces/couchdb/Session.html" title="class in com.fourspaces.couchdb"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?com/fourspaces/couchdb/Document.html" target="_top"><B>FRAMES</B></A>
<A HREF="Document.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
| mbreese/couchdb4j | javadoc/com/fourspaces/couchdb/Document.html | HTML | apache-2.0 | 56,624 |
/*
* Copyright 2013 University of Chicago and Argonne National Laboratory
*
* 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 exm.stc.common.exceptions;
import exm.stc.frontend.Context;
public class TypeMismatchException
extends UserException {
public TypeMismatchException(Context context, String message) {
super(context, message);
}
public TypeMismatchException(String message) {
super(message);
}
private static final long serialVersionUID = 1L;
}
| swift-lang/swift-t | stc/code/src/exm/stc/common/exceptions/TypeMismatchException.java | Java | apache-2.0 | 1,008 |
<?php
/**
* THE CODE IN THIS FILE WAS GENERATED FROM THE EBAY WSDL USING THE PROJECT:
*
* https://github.com/davidtsadler/ebay-api-sdk-php
*
* Copyright 2014 David T. Sadler
*
* 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 DTS\eBaySDK\Trading\Enums;
/**
*
*/
class StoreCustomPageStatusCodeType
{
const C_ACTIVE = 'Active';
const C_CUSTOM_CODE = 'CustomCode';
const C_DELETE = 'Delete';
const C_INACTIVE = 'Inactive';
}
| emullaraj/ebay-sdk-php | src/DTS/eBaySDK/Trading/Enums/StoreCustomPageStatusCodeType.php | PHP | apache-2.0 | 964 |
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.09.30 at 06:15:10 PM PDT
//
package org.hl7.knowledgeartifact.r1;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* For a group of actions, specifies the number of actions that may be chosen by an end user.
*
* <p>Java class for GroupSelectionBehavior complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="GroupSelectionBehavior">
* <complexContent>
* <restriction base="{urn:hl7-org:knowledgeartifact:r1}Behavior">
* <attribute name="value" type="{urn:hl7-org:knowledgeartifact:r1}GroupSelectionBehaviorType" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GroupSelectionBehavior")
public class GroupSelectionBehavior
extends Behavior
{
}
| Apelon-VA/va-isaac-gui | import-export/src/main/java/org/hl7/knowledgeartifact/r1/GroupSelectionBehavior.java | Java | apache-2.0 | 1,284 |
package com.vaadin.tests.components.grid;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.WebElement;
import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.GridElement;
import com.vaadin.testbench.parallel.TestCategory;
import com.vaadin.tests.tb3.MultiBrowserTest;
@TestCategory("grid")
public class GridEditorMultiselectTest extends MultiBrowserTest {
@Test
public void testSelectCheckboxesDisabled() {
openTestURL();
GridElement grid = openEditor();
assertCheckboxesEnabled(grid, false);
}
@Test
public void testSelectCheckboxesEnabledBackOnSave() {
openTestURL();
GridElement grid = openEditor();
grid.getEditor().save();
waitForElementNotPresent(By.className("v-grid-editor-cells"));
assertCheckboxesEnabled(grid, true);
}
@Test
public void testSelectCheckboxesEnabledBackOnCancel() {
openTestURL();
GridElement grid = openEditor();
grid.getEditor().cancel();
assertCheckboxesEnabled(grid, true);
}
private GridElement openEditor() {
GridElement grid = $(GridElement.class).first();
grid.getRow(0).doubleClick();
Assert.assertTrue("Grid editor should be displayed.",
grid.getEditor().isDisplayed());
return grid;
}
private void assertCheckboxesEnabled(GridElement grid, boolean isEnabled) {
List<WebElement> checkboxes = grid
.findElements(By.xpath("//input[@type='checkbox']"));
for (WebElement checkbox : checkboxes) {
Assert.assertEquals(
"Select checkboxes should be "
+ (isEnabled ? "enabled" : "disabled"),
isEnabled, checkbox.isEnabled());
}
}
}
| peterl1084/framework | uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorMultiselectTest.java | Java | apache-2.0 | 1,848 |
/*
* #%L
* BroadleafCommerce Open Admin Platform
* %%
* Copyright (C) 2009 - 2013 Broadleaf Commerce
* %%
* 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.
* #L%
*/
package org.broadleafcommerce.openadmin.dto;
import org.broadleafcommerce.common.presentation.client.ForeignKeyRestrictionType;
import org.broadleafcommerce.openadmin.dto.visitor.PersistencePerspectiveItemVisitor;
import java.io.Serializable;
/**
*
* @author jfischer
*
*/
public class ForeignKey implements Serializable, PersistencePerspectiveItem {
private static final long serialVersionUID = 1L;
private String manyToField;
private String originatingField;
private String foreignKeyClass;
private String currentValue;
private String dataSourceName;
private ForeignKeyRestrictionType restrictionType = ForeignKeyRestrictionType.ID_EQ;
private String displayValueProperty = "name";
private Boolean mutable = true;
public ForeignKey() {
//do nothing
}
public ForeignKey(String manyToField, String foreignKeyClass) {
this(manyToField, foreignKeyClass, null);
}
public ForeignKey(String manyToField, String foreignKeyClass, String dataSourceName) {
this(manyToField, foreignKeyClass, dataSourceName, ForeignKeyRestrictionType.ID_EQ);
}
public ForeignKey(String manyToField, String foreignKeyClass, String dataSourceName, ForeignKeyRestrictionType restrictionType) {
this(manyToField, foreignKeyClass, dataSourceName, restrictionType, "name");
}
public ForeignKey(String manyToField, String foreignKeyClass, String dataSourceName, ForeignKeyRestrictionType restrictionType, String displayValueProperty) {
this.manyToField = manyToField;
this.foreignKeyClass = foreignKeyClass;
this.dataSourceName = dataSourceName;
this.restrictionType = restrictionType;
this.displayValueProperty = displayValueProperty;
}
public String getManyToField() {
return manyToField;
}
public void setManyToField(String manyToField) {
this.manyToField = manyToField;
}
public String getForeignKeyClass() {
return foreignKeyClass;
}
public void setForeignKeyClass(String foreignKeyClass) {
this.foreignKeyClass = foreignKeyClass;
}
public String getCurrentValue() {
return currentValue;
}
public void setCurrentValue(String currentValue) {
this.currentValue = currentValue;
}
public String getDataSourceName() {
return dataSourceName;
}
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
public ForeignKeyRestrictionType getRestrictionType() {
return restrictionType;
}
public void setRestrictionType(ForeignKeyRestrictionType restrictionType) {
this.restrictionType = restrictionType;
}
public String getDisplayValueProperty() {
return displayValueProperty;
}
public void setDisplayValueProperty(String displayValueProperty) {
this.displayValueProperty = displayValueProperty;
}
public Boolean getMutable() {
return mutable;
}
public void setMutable(Boolean mutable) {
this.mutable = mutable;
}
public String getOriginatingField() {
return originatingField;
}
public void setOriginatingField(String originatingField) {
this.originatingField = originatingField;
}
public void accept(PersistencePerspectiveItemVisitor visitor) {
visitor.visit(this);
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("ForeignKey{");
sb.append("manyToField='").append(manyToField).append('\'');
sb.append(", originatingField='").append(originatingField).append('\'');
sb.append(", foreignKeyClass='").append(foreignKeyClass).append('\'');
sb.append(", currentValue='").append(currentValue).append('\'');
sb.append(", dataSourceName='").append(dataSourceName).append('\'');
sb.append(", restrictionType=").append(restrictionType);
sb.append(", displayValueProperty='").append(displayValueProperty).append('\'');
sb.append(", mutable=").append(mutable);
sb.append('}');
return sb.toString();
}
public ForeignKey cloneForeignKey() {
ForeignKey foreignKey = new ForeignKey();
foreignKey.manyToField = manyToField;
foreignKey.foreignKeyClass = foreignKeyClass;
foreignKey.currentValue = currentValue;
foreignKey.dataSourceName = dataSourceName;
foreignKey.restrictionType = restrictionType;
foreignKey.displayValueProperty = displayValueProperty;
foreignKey.mutable = mutable;
foreignKey.originatingField = originatingField;
return foreignKey;
}
@Override
public PersistencePerspectiveItem clonePersistencePerspectiveItem() {
return cloneForeignKey();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
if (!getClass().isAssignableFrom(o.getClass())) return false;
ForeignKey that = (ForeignKey) o;
if (currentValue != null ? !currentValue.equals(that.currentValue) : that.currentValue != null) return false;
if (dataSourceName != null ? !dataSourceName.equals(that.dataSourceName) : that.dataSourceName != null)
return false;
if (displayValueProperty != null ? !displayValueProperty.equals(that.displayValueProperty) : that
.displayValueProperty != null)
return false;
if (foreignKeyClass != null ? !foreignKeyClass.equals(that.foreignKeyClass) : that.foreignKeyClass != null)
return false;
if (manyToField != null ? !manyToField.equals(that.manyToField) : that.manyToField != null) return false;
if (mutable != null ? !mutable.equals(that.mutable) : that.mutable != null) return false;
if (originatingField != null ? !originatingField.equals(that.originatingField) : that.originatingField != null)
return false;
if (restrictionType != that.restrictionType) return false;
return true;
}
@Override
public int hashCode() {
int result = manyToField != null ? manyToField.hashCode() : 0;
result = 31 * result + (originatingField != null ? originatingField.hashCode() : 0);
result = 31 * result + (foreignKeyClass != null ? foreignKeyClass.hashCode() : 0);
result = 31 * result + (currentValue != null ? currentValue.hashCode() : 0);
result = 31 * result + (dataSourceName != null ? dataSourceName.hashCode() : 0);
result = 31 * result + (restrictionType != null ? restrictionType.hashCode() : 0);
result = 31 * result + (displayValueProperty != null ? displayValueProperty.hashCode() : 0);
result = 31 * result + (mutable != null ? mutable.hashCode() : 0);
return result;
}
}
| shopizer/BroadleafCommerce | admin/broadleaf-open-admin-platform/src/main/java/org/broadleafcommerce/openadmin/dto/ForeignKey.java | Java | apache-2.0 | 7,605 |
<!doctype html><html lang=en><head><title>Redirecting…</title><link rel=canonical href=/v1.2/about/notes/><meta name=robots content=noindex><meta charset=utf-8><meta http-equiv=refresh content="0; url=/v1.2/about/notes/"></head><body><h1>Redirecting…</h1><a href=/v1.2/about/notes/>Click here if you are not redirected.</a></body></html> | istio/istio.io | archive/v1.2/release-notes/index.html | HTML | apache-2.0 | 351 |
export function createObject(keys: string[], values: any[]) {
return keys.reduce((result, key, i) => ((result[key] = values[i]), result), {} as any);
}
| ReactiveX/RxJS | src/internal/util/createObject.ts | TypeScript | apache-2.0 | 154 |
/* line 26, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.clearfix {
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.clearfix:before, .clearfix:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.clearfix:after {
clear: both;
}
/* line 645, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.input-block-level {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* line 19, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
display: block;
}
/* line 28, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
audio,
canvas,
video {
display: inline-block;
*display: inline;
*zoom: 1;
}
/* line 37, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
audio:not([controls]) {
display: none;
}
/* line 44, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
/* line 50, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
a:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
/* line 55, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
a:hover,
a:active {
outline: 0;
}
/* line 63, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
/* line 69, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
sup {
top: -0.5em;
}
/* line 72, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
sub {
bottom: -0.25em;
}
/* line 79, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
img {
/* Responsive images (ensure images don't scale beyond their parents) */
max-width: 100%;
/* Part 1: Set a maxium relative to the parent */
width: auto\9;
/* IE7-8 need help adjusting responsive images */
height: auto;
/* Part 2: Scale the height according to the width, otherwise you get stretching */
vertical-align: middle;
border: 0;
-ms-interpolation-mode: bicubic;
}
/* line 90, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
#map_canvas img {
max-width: none;
}
/* line 101, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
button,
input,
select,
textarea {
margin: 0;
font-size: 100%;
vertical-align: middle;
}
/* line 107, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
button,
input {
*overflow: visible;
line-height: normal;
}
/* line 112, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
button::-moz-focus-inner,
input::-moz-focus-inner {
padding: 0;
border: 0;
}
/* line 119, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
cursor: pointer;
-webkit-appearance: button;
}
/* line 123, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
input[type="search"] {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
-webkit-appearance: textfield;
}
/* line 130, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none;
}
/* line 133, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
textarea {
overflow: auto;
vertical-align: top;
}
/* line 9, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_scaffolding.scss */
body {
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #333333;
background-color: white;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_scaffolding.scss */
a {
color: #0088cc;
text-decoration: none;
}
/* line 26, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_scaffolding.scss */
a:hover {
color: #005580;
text-decoration: underline;
}
/* line 36, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_scaffolding.scss */
.img-rounded {
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
/* line 41, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_scaffolding.scss */
.img-polaroid {
padding: 4px;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* line 50, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_scaffolding.scss */
.img-circle {
-webkit-border-radius: 500px;
-moz-border-radius: 500px;
border-radius: 500px;
}
/* line 549, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row {
margin-left: -20px;
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row:before, .row:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row:after {
clear: both;
}
/* line 554, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
[class*="span"] {
float: left;
min-height: 1px;
margin-left: 20px;
}
/* line 564, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 940px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span1 {
width: 60px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span2 {
width: 140px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span3 {
width: 220px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span4 {
width: 300px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span5 {
width: 380px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span6 {
width: 460px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span7 {
width: 540px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span8 {
width: 620px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span9 {
width: 700px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span10 {
width: 780px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span11 {
width: 860px;
}
/* line 571, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.span12 {
width: 940px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset1 {
margin-left: 100px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset2 {
margin-left: 180px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset3 {
margin-left: 260px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset4 {
margin-left: 340px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset5 {
margin-left: 420px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset6 {
margin-left: 500px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset7 {
margin-left: 580px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset8 {
margin-left: 660px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset9 {
margin-left: 740px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset10 {
margin-left: 820px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset11 {
margin-left: 900px;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.offset12 {
margin-left: 980px;
}
/* line 587, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid {
width: 100%;
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid:before, .row-fluid:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid:after {
clear: both;
}
/* line 590, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid [class*="span"] {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
float: left;
margin-left: 2.12766%;
*margin-left: 2.07447%;
}
/* line 596, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid [class*="span"]:first-child {
margin-left: 0;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span1 {
width: 6.38298%;
*width: 6.32979%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset1 {
margin-left: 10.6383%;
*margin-left: 10.53191%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset1:first-child {
margin-left: 8.51064%;
*margin-left: 8.40426%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span2 {
width: 14.89362%;
*width: 14.84043%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset2 {
margin-left: 19.14894%;
*margin-left: 19.04255%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset2:first-child {
margin-left: 17.02128%;
*margin-left: 16.91489%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span3 {
width: 23.40426%;
*width: 23.35106%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset3 {
margin-left: 27.65957%;
*margin-left: 27.55319%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset3:first-child {
margin-left: 25.53191%;
*margin-left: 25.42553%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span4 {
width: 31.91489%;
*width: 31.8617%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset4 {
margin-left: 36.17021%;
*margin-left: 36.06383%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset4:first-child {
margin-left: 34.04255%;
*margin-left: 33.93617%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span5 {
width: 40.42553%;
*width: 40.37234%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset5 {
margin-left: 44.68085%;
*margin-left: 44.57447%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset5:first-child {
margin-left: 42.55319%;
*margin-left: 42.44681%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span6 {
width: 48.93617%;
*width: 48.88298%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset6 {
margin-left: 53.19149%;
*margin-left: 53.08511%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset6:first-child {
margin-left: 51.06383%;
*margin-left: 50.95745%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span7 {
width: 57.44681%;
*width: 57.39362%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset7 {
margin-left: 61.70213%;
*margin-left: 61.59574%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset7:first-child {
margin-left: 59.57447%;
*margin-left: 59.46809%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span8 {
width: 65.95745%;
*width: 65.90426%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset8 {
margin-left: 70.21277%;
*margin-left: 70.10638%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset8:first-child {
margin-left: 68.08511%;
*margin-left: 67.97872%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span9 {
width: 74.46809%;
*width: 74.41489%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset9 {
margin-left: 78.7234%;
*margin-left: 78.61702%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset9:first-child {
margin-left: 76.59574%;
*margin-left: 76.48936%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span10 {
width: 82.97872%;
*width: 82.92553%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset10 {
margin-left: 87.23404%;
*margin-left: 87.12766%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset10:first-child {
margin-left: 85.10638%;
*margin-left: 85.0%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span11 {
width: 91.48936%;
*width: 91.43617%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset11 {
margin-left: 95.74468%;
*margin-left: 95.6383%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset11:first-child {
margin-left: 93.61702%;
*margin-left: 93.51064%;
}
/* line 602, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .span12 {
width: 100%;
*width: 99.94681%;
}
/* line 603, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset12 {
margin-left: 104.25532%;
*margin-left: 104.14894%;
}
/* line 604, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.row-fluid .offset12:first-child {
margin-left: 102.12766%;
*margin-left: 102.02128%;
}
/* line 13, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_grid.scss */
[class*="span"].hide,
.row-fluid [class*="span"].hide {
display: none;
}
/* line 18, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_grid.scss */
[class*="span"].pull-right,
.row-fluid [class*="span"].pull-right {
float: right;
}
/* line 7, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_layouts.scss */
.container {
margin-right: auto;
margin-left: auto;
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.container:before, .container:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.container:after {
clear: both;
}
/* line 12, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_layouts.scss */
.container-fluid {
padding-right: 20px;
padding-left: 20px;
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.container-fluid:before, .container-fluid:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.container-fluid:after {
clear: both;
}
/* line 9, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
p {
margin: 0 0 10px;
}
/* line 12, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
.lead {
margin-bottom: 20px;
font-size: 21px;
font-weight: 200;
line-height: 30px;
}
/* line 23, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
small {
font-size: 85%;
}
/* line 26, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
strong {
font-weight: bold;
}
/* line 29, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
em {
font-style: italic;
}
/* line 32, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
cite {
font-style: normal;
}
/* line 37, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
.muted {
color: #999999;
}
/* line 40, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
.text-warning {
color: #c09853;
}
/* line 43, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
.text-error {
color: #b94a48;
}
/* line 46, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
.text-info {
color: #3a87ad;
}
/* line 49, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
.text-success {
color: #468847;
}
/* line 57, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h1, h2, h3, h4, h5, h6 {
margin: 10px 0;
font-family: inherit;
font-weight: bold;
line-height: 1;
color: inherit;
text-rendering: optimizelegibility;
}
/* line 64, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h1 small, h2 small, h3 small, h4 small, h5 small, h6 small {
font-weight: normal;
line-height: 1;
color: #999999;
}
/* line 70, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h1 {
font-size: 36px;
line-height: 40px;
}
/* line 71, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h2 {
font-size: 30px;
line-height: 40px;
}
/* line 72, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h3 {
font-size: 24px;
line-height: 40px;
}
/* line 73, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h4 {
font-size: 18px;
line-height: 20px;
}
/* line 74, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h5 {
font-size: 14px;
line-height: 20px;
}
/* line 75, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h6 {
font-size: 12px;
line-height: 20px;
}
/* line 77, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h1 small {
font-size: 24px;
}
/* line 78, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h2 small {
font-size: 18px;
}
/* line 79, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h3 small {
font-size: 14px;
}
/* line 80, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
h4 small {
font-size: 14px;
}
/* line 86, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
.page-header {
padding-bottom: 9px;
margin: 20px 0 30px;
border-bottom: 1px solid #eeeeee;
}
/* line 98, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
ul, ol {
padding: 0;
margin: 0 0 10px 25px;
}
/* line 105, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
ul ul,
ul ol,
ol ol,
ol ul {
margin-bottom: 0;
}
/* line 108, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
li {
line-height: 20px;
}
/* line 112, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
ul.unstyled,
ol.unstyled {
margin-left: 0;
list-style: none;
}
/* line 118, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
dl {
margin-bottom: 20px;
}
/* line 122, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
dt,
dd {
line-height: 20px;
}
/* line 125, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
dt {
font-weight: bold;
}
/* line 128, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
dd {
margin-left: 10px;
}
/* line 132, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
.dl-horizontal {
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.dl-horizontal:before, .dl-horizontal:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.dl-horizontal:after {
clear: both;
}
/* line 134, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
.dl-horizontal dt {
float: left;
width: 160px;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* line 141, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
.dl-horizontal dd {
margin-left: 180px;
}
/* line 150, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
hr {
margin: 20px 0;
border: 0;
border-top: 1px solid #eeeeee;
border-bottom: 1px solid white;
}
/* line 158, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
abbr[title] {
cursor: help;
border-bottom: 1px dotted #999999;
}
/* line 162, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
abbr.initialism {
font-size: 90%;
text-transform: uppercase;
}
/* line 168, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
blockquote {
padding: 0 0 0 15px;
margin: 0 0 20px;
border-left: 5px solid #eeeeee;
}
/* line 172, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
blockquote p {
margin-bottom: 0;
font-size: 16px;
font-weight: 300;
line-height: 25px;
}
/* line 176, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
blockquote small {
display: block;
line-height: 20px;
color: #999999;
}
/* line 180, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
blockquote small:before {
content: '\2014 \00A0';
}
/* line 186, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
blockquote.pull-right {
float: right;
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
}
/* line 193, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
blockquote.pull-right p,
blockquote.pull-right small {
text-align: right;
}
/* line 197, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
blockquote.pull-right small:before {
content: '';
}
/* line 200, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
blockquote.pull-right small:after {
content: '\00A0 \2014';
}
/* line 211, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
q:before,
q:after,
blockquote:before,
blockquote:after {
content: "";
}
/* line 216, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_type.scss */
address {
display: block;
margin-bottom: 20px;
font-style: normal;
line-height: 20px;
}
/* line 8, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_code.scss */
code,
pre {
padding: 0 3px 2px;
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
/* line 17, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_code.scss */
code {
padding: 2px 4px;
color: #d14;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
}
/* line 25, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_code.scss */
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 20px;
word-break: break-all;
word-wrap: break-word;
white-space: pre;
white-space: pre-wrap;
background-color: #f5f5f5;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
/* line 41, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_code.scss */
pre.prettyprint {
margin-bottom: 20px;
}
/* line 46, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_code.scss */
pre code {
padding: 0;
color: inherit;
background-color: transparent;
border: 0;
}
/* line 55, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_code.scss */
.pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
/* line 10, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
form {
margin: 0 0 20px;
}
/* line 14, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
fieldset {
padding: 0;
margin: 0;
border: 0;
}
/* line 21, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: 40px;
color: #333333;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
/* line 33, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
legend small {
font-size: 15px;
color: #999999;
}
/* line 44, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
label,
input,
button,
select,
textarea {
font-size: 14px;
font-weight: normal;
line-height: 20px;
}
/* line 50, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
input,
button,
select,
textarea {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
/* line 55, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
label {
display: block;
margin-bottom: 5px;
}
/* line 80, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
select,
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
display: inline-block;
height: 20px;
padding: 4px 6px;
margin-bottom: 9px;
font-size: 14px;
line-height: 20px;
color: #555555;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
/* line 95, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
input,
textarea,
.uneditable-input {
width: 206px;
}
/* line 99, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
textarea {
height: auto;
}
/* line 118, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
background-color: white;
border: 1px solid #cccccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
}
/* line 125, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.uneditable-input:focus {
border-color: rgba(82, 168, 236, 0.8);
outline: 0;
outline: thin dotted \9;
/* IE6-9 */
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}
/* line 135, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
input[type="radio"],
input[type="checkbox"] {
margin: 4px 0 0;
*margin-top: 0;
/* IE7 */
margin-top: 1px \9;
/* IE8-9 */
line-height: normal;
cursor: pointer;
}
/* line 150, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
input[type="file"],
input[type="image"],
input[type="submit"],
input[type="reset"],
input[type="button"],
input[type="radio"],
input[type="checkbox"] {
width: auto;
}
/* line 156, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
select,
input[type="file"] {
height: 30px;
/* In IE7, the height of the select element cannot be changed by height, only font-size */
*margin-top: 4px;
/* For IE7, add top margin to align select with labels */
line-height: 30px;
}
/* line 163, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
select {
width: 220px;
border: 1px solid #cccccc;
background-color: white;
}
/* line 171, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
select[multiple],
select[size] {
height: auto;
}
/* line 179, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
select:focus,
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
/* line 189, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.uneditable-input,
.uneditable-textarea {
color: #999999;
background-color: #fcfcfc;
border-color: #cccccc;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
cursor: not-allowed;
}
/* line 198, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.uneditable-input {
overflow: hidden;
white-space: nowrap;
}
/* line 204, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.uneditable-textarea {
width: auto;
height: auto;
}
/* line 84, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input:-moz-placeholder,
textarea:-moz-placeholder {
color: #999999;
}
/* line 87, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
color: #999999;
}
/* line 90, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
color: #999999;
}
/* line 225, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.radio,
.checkbox {
min-height: 18px;
padding-left: 18px;
}
/* line 230, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.radio input[type="radio"],
.checkbox input[type="checkbox"] {
float: left;
margin-left: -18px;
}
/* line 237, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.controls > .radio:first-child,
.controls > .checkbox:first-child {
padding-top: 5px;
}
/* line 244, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.radio.inline,
.checkbox.inline {
display: inline-block;
padding-top: 5px;
margin-bottom: 0;
vertical-align: middle;
}
/* line 251, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.radio.inline + .radio.inline,
.checkbox.inline + .checkbox.inline {
margin-left: 10px;
}
/* line 261, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-mini {
width: 60px;
}
/* line 262, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-small {
width: 90px;
}
/* line 263, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-medium {
width: 150px;
}
/* line 264, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-large {
width: 210px;
}
/* line 265, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-xlarge {
width: 270px;
}
/* line 266, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-xxlarge {
width: 530px;
}
/* line 277, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
input[class*="span"],
select[class*="span"],
textarea[class*="span"],
.uneditable-input[class*="span"],
.row-fluid input[class*="span"],
.row-fluid select[class*="span"],
.row-fluid textarea[class*="span"],
.row-fluid .uneditable-input[class*="span"] {
float: none;
margin-left: 0;
}
/* line 291, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-append input[class*="span"],
.input-append .uneditable-input[class*="span"],
.input-prepend input[class*="span"],
.input-prepend .uneditable-input[class*="span"],
.row-fluid input[class*="span"],
.row-fluid select[class*="span"],
.row-fluid textarea[class*="span"],
.row-fluid .uneditable-input[class*="span"],
.row-fluid .input-prepend [class*="span"],
.row-fluid .input-append [class*="span"] {
display: inline-block;
}
/* line 627, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input,
textarea,
.uneditable-input {
margin-left: 0;
}
/* line 632, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.controls-row [class*="span"] + [class*="span"] {
margin-left: 20px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span1, textarea.span1, .uneditable-input.span1 {
width: 46px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span2, textarea.span2, .uneditable-input.span2 {
width: 126px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span3, textarea.span3, .uneditable-input.span3 {
width: 206px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span4, textarea.span4, .uneditable-input.span4 {
width: 286px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span5, textarea.span5, .uneditable-input.span5 {
width: 366px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span6, textarea.span6, .uneditable-input.span6 {
width: 446px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span7, textarea.span7, .uneditable-input.span7 {
width: 526px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span8, textarea.span8, .uneditable-input.span8 {
width: 606px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span9, textarea.span9, .uneditable-input.span9 {
width: 686px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span10, textarea.span10, .uneditable-input.span10 {
width: 766px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span11, textarea.span11, .uneditable-input.span11 {
width: 846px;
}
/* line 637, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
input.span12, textarea.span12, .uneditable-input.span12 {
width: 926px;
}
/* line 304, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.controls-row {
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.controls-row:before, .controls-row:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.controls-row:after {
clear: both;
}
/* line 307, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.controls-row [class*="span"] {
float: left;
}
/* line 323, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
input[disabled],
select[disabled],
textarea[disabled],
input[readonly],
select[readonly],
textarea[readonly] {
cursor: not-allowed;
background-color: #eeeeee;
}
/* line 331, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"][readonly],
input[type="checkbox"][readonly] {
background-color: transparent;
}
/* line 165, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.warning > label,
.control-group.warning .help-block,
.control-group.warning .help-inline {
color: #c09853;
}
/* line 173, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.warning .checkbox,
.control-group.warning .radio,
.control-group.warning input,
.control-group.warning select,
.control-group.warning textarea {
color: #c09853;
}
/* line 178, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.warning input,
.control-group.warning select,
.control-group.warning textarea {
border-color: #c09853;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
/* line 181, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.warning input:focus,
.control-group.warning select:focus,
.control-group.warning textarea:focus {
border-color: #a47e3c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
}
/* line 188, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.warning .input-prepend .add-on,
.control-group.warning .input-append .add-on {
color: #c09853;
background-color: #fcf8e3;
border-color: #c09853;
}
/* line 165, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.error > label,
.control-group.error .help-block,
.control-group.error .help-inline {
color: #b94a48;
}
/* line 173, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.error .checkbox,
.control-group.error .radio,
.control-group.error input,
.control-group.error select,
.control-group.error textarea {
color: #b94a48;
}
/* line 178, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.error input,
.control-group.error select,
.control-group.error textarea {
border-color: #b94a48;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
/* line 181, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.error input:focus,
.control-group.error select:focus,
.control-group.error textarea:focus {
border-color: #953b39;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}
/* line 188, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.error .input-prepend .add-on,
.control-group.error .input-append .add-on {
color: #b94a48;
background-color: #f2dede;
border-color: #b94a48;
}
/* line 165, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.success > label,
.control-group.success .help-block,
.control-group.success .help-inline {
color: #468847;
}
/* line 173, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.success .checkbox,
.control-group.success .radio,
.control-group.success input,
.control-group.success select,
.control-group.success textarea {
color: #468847;
}
/* line 178, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.success input,
.control-group.success select,
.control-group.success textarea {
border-color: #468847;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
/* line 181, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.success input:focus,
.control-group.success select:focus,
.control-group.success textarea:focus {
border-color: #356635;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
}
/* line 188, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.success .input-prepend .add-on,
.control-group.success .input-append .add-on {
color: #468847;
background-color: #dff0d8;
border-color: #468847;
}
/* line 165, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.info > label,
.control-group.info .help-block,
.control-group.info .help-inline {
color: #3a87ad;
}
/* line 173, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.info .checkbox,
.control-group.info .radio,
.control-group.info input,
.control-group.info select,
.control-group.info textarea {
color: #3a87ad;
}
/* line 178, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.info input,
.control-group.info select,
.control-group.info textarea {
border-color: #3a87ad;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
/* line 181, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.info input:focus,
.control-group.info select:focus,
.control-group.info textarea:focus {
border-color: #2d6987;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
}
/* line 188, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.control-group.info .input-prepend .add-on,
.control-group.info .input-append .add-on {
color: #3a87ad;
background-color: #d9edf7;
border-color: #3a87ad;
}
/* line 362, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
input:focus:required:invalid,
textarea:focus:required:invalid,
select:focus:required:invalid {
color: #b94a48;
border-color: #ee5f5b;
}
/* line 365, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
input:focus:required:invalid:focus,
textarea:focus:required:invalid:focus,
select:focus:required:invalid:focus {
border-color: #e9322d;
-webkit-box-shadow: 0 0 6px #f8b9b7;
-moz-box-shadow: 0 0 6px #f8b9b7;
box-shadow: 0 0 6px #f8b9b7;
}
/* line 376, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-actions {
padding: 19px 20px 20px;
margin-top: 20px;
margin-bottom: 20px;
background-color: whitesmoke;
border-top: 1px solid #e5e5e5;
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.form-actions:before, .form-actions:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.form-actions:after {
clear: both;
}
/* line 391, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.help-block,
.help-inline {
color: #595959;
}
/* line 395, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.help-block {
display: block;
margin-bottom: 10px;
}
/* line 400, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.help-inline {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
vertical-align: middle;
padding-left: 5px;
}
/* line 414, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-append,
.input-prepend {
margin-bottom: 5px;
font-size: 0;
white-space: nowrap;
}
/* line 421, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-append input,
.input-append select,
.input-append .uneditable-input,
.input-prepend input,
.input-prepend select,
.input-prepend .uneditable-input {
position: relative;
margin-bottom: 0;
*margin-left: 0;
font-size: 14px;
vertical-align: top;
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
/* line 429, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-append input:focus,
.input-append select:focus,
.input-append .uneditable-input:focus,
.input-prepend input:focus,
.input-prepend select:focus,
.input-prepend .uneditable-input:focus {
z-index: 2;
}
/* line 433, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-append .add-on,
.input-prepend .add-on {
display: inline-block;
width: auto;
height: 20px;
min-width: 16px;
padding: 4px 5px;
font-size: 14px;
font-weight: normal;
line-height: 20px;
text-align: center;
text-shadow: 0 1px 0 white;
background-color: #eeeeee;
border: 1px solid #ccc;
}
/* line 448, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-append .add-on,
.input-append .btn,
.input-prepend .add-on,
.input-prepend .btn {
vertical-align: top;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
/* line 452, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-append .active,
.input-prepend .active {
background-color: #a9dba9;
border-color: #46a546;
}
/* line 459, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-prepend .add-on,
.input-prepend .btn {
margin-right: -1px;
}
/* line 463, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-prepend .add-on:first-child,
.input-prepend .btn:first-child {
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
/* line 470, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-append input,
.input-append select,
.input-append .uneditable-input {
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
/* line 474, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-append .add-on,
.input-append .btn {
margin-left: -1px;
}
/* line 478, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-append .add-on:last-child,
.input-append .btn:last-child {
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
/* line 486, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-prepend.input-append input,
.input-prepend.input-append select,
.input-prepend.input-append .uneditable-input {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
/* line 490, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-prepend.input-append .add-on:first-child,
.input-prepend.input-append .btn:first-child {
margin-right: -1px;
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
/* line 495, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.input-prepend.input-append .add-on:last-child,
.input-prepend.input-append .btn:last-child {
margin-left: -1px;
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
/* line 506, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
input.search-query {
padding-right: 14px;
padding-right: 4px \9;
padding-left: 14px;
padding-left: 4px \9;
/* IE7-8 doesn't have border-radius, so don't indent the padding */
margin-bottom: 0;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
/* Allow for input prepend/append in search forms */
/* line 517, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search .input-append .search-query,
.form-search .input-prepend .search-query {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
/* line 520, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search .input-append .search-query {
-webkit-border-radius: 14px 0 0 14px;
-moz-border-radius: 14px 0 0 14px;
border-radius: 14px 0 0 14px;
}
/* line 523, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search .input-append .btn {
-webkit-border-radius: 0 14px 14px 0;
-moz-border-radius: 0 14px 14px 0;
border-radius: 0 14px 14px 0;
}
/* line 526, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search .input-prepend .search-query {
-webkit-border-radius: 0 14px 14px 0;
-moz-border-radius: 0 14px 14px 0;
border-radius: 0 14px 14px 0;
}
/* line 529, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search .input-prepend .btn {
-webkit-border-radius: 14px 0 0 14px;
-moz-border-radius: 14px 0 0 14px;
border-radius: 14px 0 0 14px;
}
/* line 551, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search input,
.form-search textarea,
.form-search select,
.form-search .help-inline,
.form-search .uneditable-input,
.form-search .input-prepend,
.form-search .input-append,
.form-inline input,
.form-inline textarea,
.form-inline select,
.form-inline .help-inline,
.form-inline .uneditable-input,
.form-inline .input-prepend,
.form-inline .input-append,
.form-horizontal input,
.form-horizontal textarea,
.form-horizontal select,
.form-horizontal .help-inline,
.form-horizontal .uneditable-input,
.form-horizontal .input-prepend,
.form-horizontal .input-append {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
margin-bottom: 0;
vertical-align: middle;
}
/* line 558, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search .hide,
.form-inline .hide,
.form-horizontal .hide {
display: none;
}
/* line 565, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search label,
.form-inline label,
.form-search .btn-group,
.form-inline .btn-group {
display: inline-block;
}
/* line 572, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search .input-append,
.form-inline .input-append,
.form-search .input-prepend,
.form-inline .input-prepend {
margin-bottom: 0;
}
/* line 579, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search .radio,
.form-search .checkbox,
.form-inline .radio,
.form-inline .checkbox {
padding-left: 0;
margin-bottom: 0;
vertical-align: middle;
}
/* line 588, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-search .radio input[type="radio"],
.form-search .checkbox input[type="checkbox"],
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
float: left;
margin-right: 3px;
margin-left: 0;
}
/* line 596, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.control-group {
margin-bottom: 10px;
}
/* line 601, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
legend + .control-group {
margin-top: 20px;
-webkit-margin-top-collapse: separate;
}
/* line 611, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-horizontal .control-group {
margin-bottom: 20px;
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.form-horizontal .control-group:before, .form-horizontal .control-group:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.form-horizontal .control-group:after {
clear: both;
}
/* line 616, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-horizontal .control-label {
float: left;
width: 160px;
padding-top: 5px;
text-align: right;
}
/* line 623, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-horizontal .controls {
*display: inline-block;
*padding-left: 20px;
margin-left: 180px;
*margin-left: 0;
}
/* line 630, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-horizontal .controls:first-child {
*padding-left: 180px;
}
/* line 635, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-horizontal .help-block {
margin-bottom: 0;
}
/* line 642, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-horizontal input + .help-block,
.form-horizontal select + .help-block,
.form-horizontal textarea + .help-block {
margin-top: 10px;
}
/* line 647, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_forms.scss */
.form-horizontal .form-actions {
padding-left: 180px;
}
/* line 9, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table {
max-width: 100%;
background-color: transparent;
border-collapse: collapse;
border-spacing: 0;
}
/* line 19, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table {
width: 100%;
margin-bottom: 20px;
}
/* line 24, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table th,
.table td {
padding: 8px;
line-height: 20px;
text-align: left;
vertical-align: top;
border-top: 1px solid #dddddd;
}
/* line 31, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table th {
font-weight: bold;
}
/* line 35, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table thead th {
vertical-align: bottom;
}
/* line 44, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table caption + thead tr:first-child th,
.table caption + thead tr:first-child td,
.table colgroup + thead tr:first-child th,
.table colgroup + thead tr:first-child td,
.table thead:first-child tr:first-child th,
.table thead:first-child tr:first-child td {
border-top: 0;
}
/* line 48, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table tbody + tbody {
border-top: 2px solid #dddddd;
}
/* line 60, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-condensed th,
.table-condensed td {
padding: 4px 5px;
}
/* line 69, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered {
border: 1px solid #dddddd;
border-collapse: separate;
*border-collapse: collapse;
border-left: 0;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
/* line 76, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered th,
.table-bordered td {
border-left: 1px solid #dddddd;
}
/* line 88, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered caption + thead tr:first-child th,
.table-bordered caption + tbody tr:first-child th,
.table-bordered caption + tbody tr:first-child td,
.table-bordered colgroup + thead tr:first-child th,
.table-bordered colgroup + tbody tr:first-child th,
.table-bordered colgroup + tbody tr:first-child td,
.table-bordered thead:first-child tr:first-child th,
.table-bordered tbody:first-child tr:first-child th,
.table-bordered tbody:first-child tr:first-child td {
border-top: 0;
}
/* line 93, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered thead:first-child tr:first-child th:first-child,
.table-bordered tbody:first-child tr:first-child td:first-child {
-webkit-border-top-left-radius: 4px;
border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
}
/* line 99, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered thead:first-child tr:first-child th:last-child,
.table-bordered tbody:first-child tr:first-child td:last-child {
-webkit-border-top-right-radius: 4px;
border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
}
/* line 107, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered thead:last-child tr:last-child th:first-child,
.table-bordered tbody:last-child tr:last-child td:first-child,
.table-bordered tfoot:last-child tr:last-child td:first-child {
-webkit-border-radius: 0 0 0 4px;
-moz-border-radius: 0 0 0 4px;
border-radius: 0 0 0 4px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
}
/* line 115, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered thead:last-child tr:last-child th:last-child,
.table-bordered tbody:last-child tr:last-child td:last-child,
.table-bordered tfoot:last-child tr:last-child td:last-child {
-webkit-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
}
/* line 125, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered caption + thead tr:first-child th:first-child,
.table-bordered caption + tbody tr:first-child td:first-child,
.table-bordered colgroup + thead tr:first-child th:first-child,
.table-bordered colgroup + tbody tr:first-child td:first-child {
-webkit-border-top-left-radius: 4px;
border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
}
/* line 133, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered caption + thead tr:first-child th:last-child,
.table-bordered caption + tbody tr:first-child td:last-child,
.table-bordered colgroup + thead tr:first-child th:last-child,
.table-bordered colgroup + tbody tr:first-child td:last-child {
-webkit-border-top-right-radius: 4px;
border-top-right-radius: 4px;
-moz-border-radius-topleft: 4px;
}
/* line 151, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-striped tbody tr:nth-child(odd) td,
.table-striped tbody tr:nth-child(odd) th {
background-color: #f9f9f9;
}
/* line 164, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-hover tbody tr:hover td,
.table-hover tbody tr:hover th {
background-color: whitesmoke;
}
/* line 176, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table [class*=span],
.row-fluid table [class*=span] {
display: table-cell;
float: none;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span1 {
float: none;
width: 44px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span2 {
float: none;
width: 124px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span3 {
float: none;
width: 204px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span4 {
float: none;
width: 284px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span5 {
float: none;
width: 364px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span6 {
float: none;
width: 444px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span7 {
float: none;
width: 524px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span8 {
float: none;
width: 604px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span9 {
float: none;
width: 684px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span10 {
float: none;
width: 764px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span11 {
float: none;
width: 844px;
margin-left: 0;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
table .span12 {
float: none;
width: 924px;
margin-left: 0;
}
/* line 196, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table tbody tr.success td {
background-color: #dff0d8;
}
/* line 199, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table tbody tr.error td {
background-color: #f2dede;
}
/* line 202, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table tbody tr.warning td {
background-color: #fcf8e3;
}
/* line 205, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table tbody tr.info td {
background-color: #d9edf7;
}
/* line 208, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table tbody tr tbody tr.warning td {
background-color: #fcf8e3;
}
/* line 215, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-hover tbody tr.success:hover td {
background-color: #d0e9c6;
}
/* line 218, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-hover tbody tr.error:hover td {
background-color: #ebcccc;
}
/* line 221, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-hover tbody tr.warning:hover td {
background-color: #faf2cc;
}
/* line 224, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tables.scss */
.table-hover tbody tr.info:hover td {
background-color: #c4e3f3;
}
/* line 18, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
[class^="icon-"],
[class*=" icon-"] {
display: inline-block;
width: 14px;
height: 14px;
*margin-right: .3em;
line-height: 14px;
vertical-align: text-top;
background-image: url("/images/glyphicons-halflings.png");
background-position: 14px 14px;
background-repeat: no-repeat;
margin-top: 1px;
}
/* White icons with optional class, or on hover/active states of certain elements */
/* line 44, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-white,
.nav-tabs > .active > a > [class^="icon-"],
.nav-tabs > .active > a > [class*=" icon-"],
.nav-pills > .active > a > [class^="icon-"],
.nav-pills > .active > a > [class*=" icon-"],
.nav-list > .active > a > [class^="icon-"],
.nav-list > .active > a > [class*=" icon-"],
.navbar-inverse .nav > .active > a > [class^="icon-"],
.navbar-inverse .nav > .active > a > [class*=" icon-"],
.dropdown-menu > li > a:hover > [class^="icon-"],
.dropdown-menu > li > a:hover > [class*=" icon-"],
.dropdown-menu > .active > a > [class^="icon-"],
.dropdown-menu > .active > a > [class*=" icon-"] {
background-image: url("/images/glyphicons-halflings-white.png");
}
/* line 48, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-glass {
background-position: 0 0;
}
/* line 49, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-music {
background-position: -24px 0;
}
/* line 50, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-search {
background-position: -48px 0;
}
/* line 51, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-envelope {
background-position: -72px 0;
}
/* line 52, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-heart {
background-position: -96px 0;
}
/* line 53, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-star {
background-position: -120px 0;
}
/* line 54, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-star-empty {
background-position: -144px 0;
}
/* line 55, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-user {
background-position: -168px 0;
}
/* line 56, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-film {
background-position: -192px 0;
}
/* line 57, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-th-large {
background-position: -216px 0;
}
/* line 58, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-th {
background-position: -240px 0;
}
/* line 59, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-th-list {
background-position: -264px 0;
}
/* line 60, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-ok {
background-position: -288px 0;
}
/* line 61, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-remove {
background-position: -312px 0;
}
/* line 62, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-zoom-in {
background-position: -336px 0;
}
/* line 63, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-zoom-out {
background-position: -360px 0;
}
/* line 64, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-off {
background-position: -384px 0;
}
/* line 65, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-signal {
background-position: -408px 0;
}
/* line 66, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-cog {
background-position: -432px 0;
}
/* line 67, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-trash {
background-position: -456px 0;
}
/* line 69, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-home {
background-position: 0 -24px;
}
/* line 70, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-file {
background-position: -24px -24px;
}
/* line 71, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-time {
background-position: -48px -24px;
}
/* line 72, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-road {
background-position: -72px -24px;
}
/* line 73, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-download-alt {
background-position: -96px -24px;
}
/* line 74, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-download {
background-position: -120px -24px;
}
/* line 75, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-upload {
background-position: -144px -24px;
}
/* line 76, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-inbox {
background-position: -168px -24px;
}
/* line 77, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-play-circle {
background-position: -192px -24px;
}
/* line 78, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-repeat {
background-position: -216px -24px;
}
/* line 79, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-refresh {
background-position: -240px -24px;
}
/* line 80, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-list-alt {
background-position: -264px -24px;
}
/* line 81, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-lock {
background-position: -287px -24px;
}
/* line 82, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-flag {
background-position: -312px -24px;
}
/* line 83, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-headphones {
background-position: -336px -24px;
}
/* line 84, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-volume-off {
background-position: -360px -24px;
}
/* line 85, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-volume-down {
background-position: -384px -24px;
}
/* line 86, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-volume-up {
background-position: -408px -24px;
}
/* line 87, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-qrcode {
background-position: -432px -24px;
}
/* line 88, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-barcode {
background-position: -456px -24px;
}
/* line 90, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-tag {
background-position: 0 -48px;
}
/* line 91, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-tags {
background-position: -25px -48px;
}
/* line 92, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-book {
background-position: -48px -48px;
}
/* line 93, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-bookmark {
background-position: -72px -48px;
}
/* line 94, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-print {
background-position: -96px -48px;
}
/* line 95, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-camera {
background-position: -120px -48px;
}
/* line 96, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-font {
background-position: -144px -48px;
}
/* line 97, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-bold {
background-position: -167px -48px;
}
/* line 98, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-italic {
background-position: -192px -48px;
}
/* line 99, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-text-height {
background-position: -216px -48px;
}
/* line 100, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-text-width {
background-position: -240px -48px;
}
/* line 101, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-align-left {
background-position: -264px -48px;
}
/* line 102, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-align-center {
background-position: -288px -48px;
}
/* line 103, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-align-right {
background-position: -312px -48px;
}
/* line 104, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-align-justify {
background-position: -336px -48px;
}
/* line 105, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-list {
background-position: -360px -48px;
}
/* line 106, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-indent-left {
background-position: -384px -48px;
}
/* line 107, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-indent-right {
background-position: -408px -48px;
}
/* line 108, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-facetime-video {
background-position: -432px -48px;
}
/* line 109, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-picture {
background-position: -456px -48px;
}
/* line 111, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-pencil {
background-position: 0 -72px;
}
/* line 112, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-map-marker {
background-position: -24px -72px;
}
/* line 113, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-adjust {
background-position: -48px -72px;
}
/* line 114, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-tint {
background-position: -72px -72px;
}
/* line 115, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-edit {
background-position: -96px -72px;
}
/* line 116, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-share {
background-position: -120px -72px;
}
/* line 117, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-check {
background-position: -144px -72px;
}
/* line 118, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-move {
background-position: -168px -72px;
}
/* line 119, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-step-backward {
background-position: -192px -72px;
}
/* line 120, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-fast-backward {
background-position: -216px -72px;
}
/* line 121, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-backward {
background-position: -240px -72px;
}
/* line 122, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-play {
background-position: -264px -72px;
}
/* line 123, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-pause {
background-position: -288px -72px;
}
/* line 124, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-stop {
background-position: -312px -72px;
}
/* line 125, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-forward {
background-position: -336px -72px;
}
/* line 126, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-fast-forward {
background-position: -360px -72px;
}
/* line 127, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-step-forward {
background-position: -384px -72px;
}
/* line 128, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-eject {
background-position: -408px -72px;
}
/* line 129, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-chevron-left {
background-position: -432px -72px;
}
/* line 130, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-chevron-right {
background-position: -456px -72px;
}
/* line 132, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-plus-sign {
background-position: 0 -96px;
}
/* line 133, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-minus-sign {
background-position: -24px -96px;
}
/* line 134, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-remove-sign {
background-position: -48px -96px;
}
/* line 135, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-ok-sign {
background-position: -72px -96px;
}
/* line 136, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-question-sign {
background-position: -96px -96px;
}
/* line 137, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-info-sign {
background-position: -120px -96px;
}
/* line 138, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-screenshot {
background-position: -144px -96px;
}
/* line 139, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-remove-circle {
background-position: -168px -96px;
}
/* line 140, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-ok-circle {
background-position: -192px -96px;
}
/* line 141, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-ban-circle {
background-position: -216px -96px;
}
/* line 142, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-arrow-left {
background-position: -240px -96px;
}
/* line 143, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-arrow-right {
background-position: -264px -96px;
}
/* line 144, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-arrow-up {
background-position: -289px -96px;
}
/* line 145, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-arrow-down {
background-position: -312px -96px;
}
/* line 146, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-share-alt {
background-position: -336px -96px;
}
/* line 147, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-resize-full {
background-position: -360px -96px;
}
/* line 148, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-resize-small {
background-position: -384px -96px;
}
/* line 149, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-plus {
background-position: -408px -96px;
}
/* line 150, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-minus {
background-position: -433px -96px;
}
/* line 151, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-asterisk {
background-position: -456px -96px;
}
/* line 153, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-exclamation-sign {
background-position: 0 -120px;
}
/* line 154, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-gift {
background-position: -24px -120px;
}
/* line 155, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-leaf {
background-position: -48px -120px;
}
/* line 156, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-fire {
background-position: -72px -120px;
}
/* line 157, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-eye-open {
background-position: -96px -120px;
}
/* line 158, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-eye-close {
background-position: -120px -120px;
}
/* line 159, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-warning-sign {
background-position: -144px -120px;
}
/* line 160, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-plane {
background-position: -168px -120px;
}
/* line 161, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-calendar {
background-position: -192px -120px;
}
/* line 162, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-random {
background-position: -216px -120px;
width: 16px;
}
/* line 163, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-comment {
background-position: -240px -120px;
}
/* line 164, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-magnet {
background-position: -264px -120px;
}
/* line 165, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-chevron-up {
background-position: -288px -120px;
}
/* line 166, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-chevron-down {
background-position: -313px -119px;
}
/* line 167, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-retweet {
background-position: -336px -120px;
}
/* line 168, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-shopping-cart {
background-position: -360px -120px;
}
/* line 169, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-folder-close {
background-position: -384px -120px;
}
/* line 170, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-folder-open {
background-position: -408px -120px;
width: 16px;
}
/* line 171, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-resize-vertical {
background-position: -432px -119px;
}
/* line 172, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-resize-horizontal {
background-position: -456px -118px;
}
/* line 174, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-hdd {
background-position: 0 -144px;
}
/* line 175, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-bullhorn {
background-position: -24px -144px;
}
/* line 176, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-bell {
background-position: -48px -144px;
}
/* line 177, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-certificate {
background-position: -72px -144px;
}
/* line 178, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-thumbs-up {
background-position: -96px -144px;
}
/* line 179, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-thumbs-down {
background-position: -120px -144px;
}
/* line 180, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-hand-right {
background-position: -144px -144px;
}
/* line 181, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-hand-left {
background-position: -168px -144px;
}
/* line 182, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-hand-up {
background-position: -192px -144px;
}
/* line 183, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-hand-down {
background-position: -216px -144px;
}
/* line 184, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-circle-arrow-right {
background-position: -240px -144px;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-circle-arrow-left {
background-position: -264px -144px;
}
/* line 186, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-circle-arrow-up {
background-position: -288px -144px;
}
/* line 187, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-circle-arrow-down {
background-position: -312px -144px;
}
/* line 188, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-globe {
background-position: -336px -144px;
}
/* line 189, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-wrench {
background-position: -360px -144px;
}
/* line 190, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-tasks {
background-position: -384px -144px;
}
/* line 191, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-filter {
background-position: -408px -144px;
}
/* line 192, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-briefcase {
background-position: -432px -144px;
}
/* line 193, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_sprites.scss */
.icon-fullscreen {
background-position: -456px -144px;
}
/* line 8, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropup,
.dropdown {
position: relative;
}
/* line 11, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-toggle {
*margin-bottom: -3px;
}
/* line 16, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-toggle:active,
.open .dropdown-toggle {
outline: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.caret {
display: inline-block;
width: 0;
height: 0;
vertical-align: top;
border-top: 4px solid black;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
content: "";
}
/* line 34, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown .caret {
margin-top: 8px;
margin-left: 2px;
}
/* line 41, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.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;
background-color: white;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
*border-right-width: 2px;
*border-bottom-width: 2px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
/* line 64, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
/* line 70, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-menu .divider {
*width: 100%;
height: 1px;
margin: 9px 1px;
*margin: -5px 0 5px;
overflow: hidden;
background-color: #e5e5e5;
border-bottom: 1px solid white;
}
/* line 75, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-menu a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 20px;
color: #333333;
white-space: nowrap;
}
/* line 90, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-menu li > a:hover,
.dropdown-menu li > a:focus,
.dropdown-submenu:hover > a {
text-decoration: none;
color: white;
background-color: #0088cc;
background-color: #0081c2;
background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
background-image: -o-linear-gradient(top, #0088cc, #0077b3);
background-image: linear-gradient(to bottom, #0088cc, #0077b3);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF0088CC', endColorstr='#FF0077B3', GradientType=0);
}
/* line 100, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover {
color: white;
text-decoration: none;
outline: 0;
background-color: #0088cc;
background-color: #0081c2;
background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
background-image: -o-linear-gradient(top, #0088cc, #0077b3);
background-image: linear-gradient(to bottom, #0088cc, #0077b3);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF0088CC', endColorstr='#FF0077B3', GradientType=0);
}
/* line 112, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-menu .disabled > a,
.dropdown-menu .disabled > a:hover {
color: #999999;
}
/* line 116, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-menu .disabled > a:hover {
text-decoration: none;
background-color: transparent;
cursor: default;
}
/* line 124, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.open {
*z-index: 1000;
}
/* line 129, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.open > .dropdown-menu {
display: block;
}
/* line 136, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
/* line 148, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
border-top: 0;
border-bottom: 4px solid black;
content: "";
}
/* line 154, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 1px;
}
/* line 163, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-submenu {
position: relative;
}
/* line 166, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-submenu > .dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-moz-border-radius: 0 6px 6px 6px;
border-radius: 0 6px 6px 6px;
}
/* line 175, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-submenu:hover .dropdown-menu {
display: block;
}
/* line 179, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-submenu > a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -10px;
}
/* line 192, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown-submenu:hover > a:after {
border-left-color: white;
}
/* line 200, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.dropdown .dropdown-menu .nav-header {
padding-left: 20px;
padding-right: 20px;
}
/* line 207, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_dropdowns.scss */
.typeahead {
margin-top: 2px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
/* line 7, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_wells.scss */
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: whitesmoke;
border: 1px solid #e3e3e3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_wells.scss */
.well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, 0.15);
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_wells.scss */
.well-large {
padding: 24px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
/* line 26, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_wells.scss */
.well-small {
padding: 9px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
/* line 6, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_component-animations.scss */
.fade {
opacity: 0;
-webkit-transition: opacity 0.15s linear;
-moz-transition: opacity 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
/* line 9, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_component-animations.scss */
.fade.in {
opacity: 1;
}
/* line 14, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_component-animations.scss */
.collapse {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height 0.35s ease;
-moz-transition: height 0.35s ease;
-o-transition: height 0.35s ease;
transition: height 0.35s ease;
}
/* line 19, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_component-animations.scss */
.collapse.in {
height: auto;
}
/* line 6, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_close.scss */
.close {
float: right;
font-size: 20px;
font-weight: bold;
line-height: 20px;
color: black;
text-shadow: 0 1px 0 white;
opacity: 0.2;
filter: alpha(opacity=20);
}
/* line 14, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_close.scss */
.close:hover {
color: black;
text-decoration: none;
cursor: pointer;
opacity: 0.4;
filter: alpha(opacity=40);
}
/* line 25, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_close.scss */
button.close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
/* line 10, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
padding: 4px 14px;
margin-bottom: 0;
font-size: 14px;
line-height: 20px;
*line-height: 20px;
text-align: center;
vertical-align: middle;
cursor: pointer;
color: #333333;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
background-color: whitesmoke;
background-image: -moz-linear-gradient(top, white, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(white), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, white, #e6e6e6);
background-image: -o-linear-gradient(top, white, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFE6E6E6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%);
*background-color: #e6e6e6;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
border: 1px solid #bbbbbb;
*border: 0;
border-bottom-color: #a2a2a2;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
*margin-left: .3em;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
/* line 495, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn:hover, .btn:active, .btn.active, .btn.disabled, .btn[disabled] {
color: #333333;
background-color: #e6e6e6;
*background-color: #d9d9d9;
}
/* line 503, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn:active, .btn.active {
background-color: #cccccc \9;
}
/* line 62, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn:first-child {
*margin-left: 0;
}
/* line 30, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn:hover {
color: #333333;
text-decoration: none;
background-color: #e6e6e6;
*background-color: #d9d9d9;
/* Buttons in IE7 don't get borders, so darken on hover */
background-position: 0 -15px;
-webkit-transition: background-position 0.1s linear;
-moz-transition: background-position 0.1s linear;
-o-transition: background-position 0.1s linear;
transition: background-position 0.1s linear;
}
/* line 43, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
/* line 49, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn.active, .btn:active {
background-color: #e6e6e6;
background-color: #d9d9d9 \9;
background-image: none;
outline: 0;
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
/* line 59, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn.disabled, .btn[disabled] {
cursor: default;
background-color: #e6e6e6;
background-image: none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/* line 75, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-large {
padding: 9px 14px;
font-size: 16px;
line-height: normal;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
/* line 81, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-large [class^="icon-"] {
margin-top: 2px;
}
/* line 86, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-small {
padding: 3px 9px;
font-size: 12px;
line-height: 18px;
}
/* line 91, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-small [class^="icon-"] {
margin-top: 0;
}
/* line 96, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-mini {
padding: 2px 6px;
font-size: 11px;
line-height: 17px;
}
/* line 106, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-block {
display: block;
width: 100%;
padding-left: 0;
padding-right: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* line 115, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-block + .btn-block {
margin-top: 5px;
}
/* line 123, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
width: 100%;
}
/* line 139, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-primary.active,
.btn-warning.active,
.btn-danger.active,
.btn-success.active,
.btn-info.active,
.btn-inverse.active {
color: rgba(255, 255, 255, 0.75);
}
/* line 145, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn {
border-color: #c5c5c5;
border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
}
/* line 150, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-primary {
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #006ccc;
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF0088CC', endColorstr='#FF0044CC', GradientType=0);
border-color: #0044cc #0044cc #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%);
*background-color: #0044cc;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
/* line 495, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-primary:hover, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] {
color: white;
background-color: #0044cc;
*background-color: #003bb3;
}
/* line 503, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-primary:active, .btn-primary.active {
background-color: #003399 \9;
}
/* line 154, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-warning {
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #f9a732;
background-image: -moz-linear-gradient(top, #fbb450, #f89406);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
background-image: -o-linear-gradient(top, #fbb450, #f89406);
background-image: linear-gradient(to bottom, #fbb450, #f89406);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFBB450', endColorstr='#FFF89406', GradientType=0);
border-color: #f89406 #f89406 #ad6704;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%);
*background-color: #f89406;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
/* line 495, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-warning:hover, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] {
color: white;
background-color: #f89406;
*background-color: #df8505;
}
/* line 503, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-warning:active, .btn-warning.active {
background-color: #c67605 \9;
}
/* line 158, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-danger {
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #da4e49;
background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEE5F5B', endColorstr='#FFBD362F', GradientType=0);
border-color: #bd362f #bd362f #802420;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%);
*background-color: #bd362f;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
/* line 495, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-danger:hover, .btn-danger:active, .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] {
color: white;
background-color: #bd362f;
*background-color: #a9302a;
}
/* line 503, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-danger:active, .btn-danger.active {
background-color: #942a25 \9;
}
/* line 162, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-success {
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #5bb65b;
background-image: -moz-linear-gradient(top, #62c462, #51a351);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
background-image: -webkit-linear-gradient(top, #62c462, #51a351);
background-image: -o-linear-gradient(top, #62c462, #51a351);
background-image: linear-gradient(to bottom, #62c462, #51a351);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF62C462', endColorstr='#FF51A351', GradientType=0);
border-color: #51a351 #51a351 #387038;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%);
*background-color: #51a351;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
/* line 495, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-success:hover, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled] {
color: white;
background-color: #51a351;
*background-color: #499249;
}
/* line 503, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-success:active, .btn-success.active {
background-color: #408140 \9;
}
/* line 166, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-info {
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #49afcd;
background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
background-image: linear-gradient(to bottom, #5bc0de, #2f96b4);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF5BC0DE', endColorstr='#FF2F96B4', GradientType=0);
border-color: #2f96b4 #2f96b4 #1f6377;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%);
*background-color: #2f96b4;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
/* line 495, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-info:hover, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled] {
color: white;
background-color: #2f96b4;
*background-color: #2a85a0;
}
/* line 503, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-info:active, .btn-info.active {
background-color: #24748c \9;
}
/* line 170, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-inverse {
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #363636;
background-image: -moz-linear-gradient(top, #444444, #222222);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
background-image: -webkit-linear-gradient(top, #444444, #222222);
background-image: -o-linear-gradient(top, #444444, #222222);
background-image: linear-gradient(to bottom, #444444, #222222);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF444444', endColorstr='#FF222222', GradientType=0);
border-color: #222222 #222222 black;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%);
*background-color: #222222;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
/* line 495, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-inverse:hover, .btn-inverse:active, .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] {
color: white;
background-color: #222222;
*background-color: #151515;
}
/* line 503, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-inverse:active, .btn-inverse.active {
background-color: #090909 \9;
}
/* line 179, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
button.btn,
input[type="submit"].btn {
*padding-top: 3px;
*padding-bottom: 3px;
}
/* line 182, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
button.btn::-moz-focus-inner,
input[type="submit"].btn::-moz-focus-inner {
padding: 0;
border: 0;
}
/* line 191, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
button.btn.btn-large,
input[type="submit"].btn.btn-large {
*padding-top: 7px;
*padding-bottom: 7px;
}
/* line 195, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
button.btn.btn-small,
input[type="submit"].btn.btn-small {
*padding-top: 3px;
*padding-bottom: 3px;
}
/* line 199, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
button.btn.btn-mini,
input[type="submit"].btn.btn-mini {
*padding-top: 1px;
*padding-bottom: 1px;
}
/* line 212, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-link,
.btn-link:active,
.btn-link[disabled] {
background-color: transparent;
background-image: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/* line 217, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-link {
border-color: transparent;
cursor: pointer;
color: #0088cc;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
/* line 223, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-link:hover {
color: #005580;
text-decoration: underline;
background-color: transparent;
}
/* line 228, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_buttons.scss */
.btn-link[disabled]:hover {
color: #333333;
text-decoration: none;
}
/* line 7, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group {
position: relative;
font-size: 0;
vertical-align: middle;
white-space: nowrap;
*margin-left: .3em;
}
/* line 62, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.btn-group:first-child {
*margin-left: 0;
}
/* line 16, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group + .btn-group {
margin-left: 5px;
}
/* line 21, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-toolbar {
font-size: 0;
margin-top: 10px;
margin-bottom: 10px;
}
/* line 25, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-toolbar .btn-group {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
}
/* line 31, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-toolbar .btn + .btn,
.btn-toolbar .btn-group + .btn,
.btn-toolbar .btn + .btn-group {
margin-left: 5px;
}
/* line 37, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn {
position: relative;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
/* line 41, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn + .btn {
margin-left: -1px;
}
/* line 45, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn,
.btn-group > .dropdown-menu {
font-size: 14px;
}
/* line 50, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn-mini {
font-size: 11px;
}
/* line 53, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn-small {
font-size: 12px;
}
/* line 56, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn-large {
font-size: 16px;
}
/* line 61, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn:first-child {
margin-left: 0;
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
border-bottom-left-radius: 4px;
}
/* line 72, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn:last-child,
.btn-group > .dropdown-toggle {
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
border-bottom-right-radius: 4px;
}
/* line 81, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn.large:first-child {
margin-left: 0;
-webkit-border-top-left-radius: 6px;
-moz-border-radius-topleft: 6px;
border-top-left-radius: 6px;
-webkit-border-bottom-left-radius: 6px;
-moz-border-radius-bottomleft: 6px;
border-bottom-left-radius: 6px;
}
/* line 91, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn.large:last-child,
.btn-group > .large.dropdown-toggle {
-webkit-border-top-right-radius: 6px;
-moz-border-radius-topright: 6px;
border-top-right-radius: 6px;
-webkit-border-bottom-right-radius: 6px;
-moz-border-radius-bottomright: 6px;
border-bottom-right-radius: 6px;
}
/* line 104, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn:hover,
.btn-group > .btn:focus,
.btn-group > .btn:active,
.btn-group > .btn.active {
z-index: 2;
}
/* line 110, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
/* line 120, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn + .dropdown-toggle {
padding-left: 8px;
padding-right: 8px;
-webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
*padding-top: 5px;
*padding-bottom: 5px;
}
/* line 127, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn-mini + .dropdown-toggle {
padding-left: 5px;
padding-right: 5px;
*padding-top: 2px;
*padding-bottom: 2px;
}
/* line 133, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn-small + .dropdown-toggle {
*padding-top: 5px;
*padding-bottom: 4px;
}
/* line 137, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group > .btn-large + .dropdown-toggle {
padding-left: 12px;
padding-right: 12px;
*padding-top: 7px;
*padding-bottom: 7px;
}
/* line 148, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group.open .dropdown-toggle {
background-image: none;
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
/* line 154, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group.open .btn.dropdown-toggle {
background-color: #e6e6e6;
}
/* line 157, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group.open .btn-primary.dropdown-toggle {
background-color: #0044cc;
}
/* line 160, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group.open .btn-warning.dropdown-toggle {
background-color: #f89406;
}
/* line 163, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group.open .btn-danger.dropdown-toggle {
background-color: #bd362f;
}
/* line 166, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group.open .btn-success.dropdown-toggle {
background-color: #51a351;
}
/* line 169, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group.open .btn-info.dropdown-toggle {
background-color: #2f96b4;
}
/* line 172, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group.open .btn-inverse.dropdown-toggle {
background-color: #222222;
}
/* line 179, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn .caret {
margin-top: 8px;
margin-left: 0;
}
/* line 186, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-mini .caret,
.btn-small .caret,
.btn-large .caret {
margin-top: 6px;
}
/* line 189, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-large .caret {
border-left-width: 5px;
border-right-width: 5px;
border-top-width: 5px;
}
/* line 195, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.dropup .btn-large .caret {
border-bottom: 5px solid black;
border-top: 0;
}
/* line 209, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-primary .caret,
.btn-warning .caret,
.btn-danger .caret,
.btn-info .caret,
.btn-success .caret,
.btn-inverse .caret {
border-top-color: white;
border-bottom-color: white;
}
/* line 220, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group-vertical {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
}
/* line 224, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group-vertical .btn {
display: block;
float: none;
width: 100%;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
/* line 230, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group-vertical .btn + .btn {
margin-left: 0;
margin-top: -1px;
}
/* line 234, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group-vertical .btn:first-child {
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
}
/* line 237, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group-vertical .btn:last-child {
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
/* line 240, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group-vertical .btn-large:first-child {
-webkit-border-radius: 6px 6px 0 0;
-moz-border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
}
/* line 243, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_button-groups.scss */
.btn-group-vertical .btn-large:last-child {
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
}
/* line 9, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_alerts.scss */
.alert {
padding: 8px 35px 8px 14px;
margin-bottom: 20px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
background-color: #fcf8e3;
border: 1px solid #fbeed5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
color: #c09853;
}
/* line 18, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_alerts.scss */
.alert h4 {
margin: 0;
}
/* line 23, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_alerts.scss */
.alert .close {
position: relative;
top: -2px;
right: -21px;
line-height: 20px;
}
/* line 34, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_alerts.scss */
.alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #468847;
}
/* line 40, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_alerts.scss */
.alert-danger,
.alert-error {
background-color: #f2dede;
border-color: #eed3d7;
color: #b94a48;
}
/* line 45, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_alerts.scss */
.alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #3a87ad;
}
/* line 55, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_alerts.scss */
.alert-block {
padding-top: 14px;
padding-bottom: 14px;
}
/* line 60, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_alerts.scss */
.alert-block > p,
.alert-block > ul {
margin-bottom: 0;
}
/* line 63, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_alerts.scss */
.alert-block p + p {
margin-top: 5px;
}
/* line 9, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav {
margin-left: 0;
margin-bottom: 20px;
list-style: none;
}
/* line 16, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav > li > a {
display: block;
}
/* line 19, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav > li > a:hover {
text-decoration: none;
background-color: #eeeeee;
}
/* line 25, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav > .pull-right {
float: right;
}
/* line 30, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-header {
display: block;
padding: 3px 15px;
font-size: 11px;
font-weight: bold;
line-height: 20px;
color: #999999;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
text-transform: uppercase;
}
/* line 41, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav li + .nav-header {
margin-top: 9px;
}
/* line 50, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-list {
padding-left: 15px;
padding-right: 15px;
margin-bottom: 0;
}
/* line 56, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-list > li > a,
.nav-list .nav-header {
margin-left: -15px;
margin-right: -15px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
/* line 61, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-list > li > a {
padding: 3px 15px;
}
/* line 65, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-list > .active > a,
.nav-list > .active > a:hover {
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
background-color: #0088cc;
}
/* line 70, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-list [class^="icon-"] {
margin-right: 2px;
}
/* line 74, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-list .divider {
*width: 100%;
height: 1px;
margin: 9px 1px;
*margin: -5px 0 5px;
overflow: hidden;
background-color: #e5e5e5;
border-bottom: 1px solid white;
}
/* line 85, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs,
.nav-pills {
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.nav-tabs:before, .nav-tabs:after,
.nav-pills:before,
.nav-pills:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.nav-tabs:after,
.nav-pills:after {
clear: both;
}
/* line 89, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs > li,
.nav-pills > li {
float: left;
}
/* line 93, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs > li > a,
.nav-pills > li > a {
padding-right: 12px;
padding-left: 12px;
margin-right: 2px;
line-height: 14px;
}
/* line 104, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs {
border-bottom: 1px solid #ddd;
}
/* line 108, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs > li {
margin-bottom: -1px;
}
/* line 112, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs > li > a {
padding-top: 8px;
padding-bottom: 8px;
line-height: 20px;
border: 1px solid transparent;
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
}
/* line 118, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #dddddd;
}
/* line 124, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs > .active > a,
.nav-tabs > .active > a:hover {
color: #555555;
background-color: white;
border: 1px solid #ddd;
border-bottom-color: transparent;
cursor: default;
}
/* line 137, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-pills > li > a {
padding-top: 8px;
padding-bottom: 8px;
margin-top: 2px;
margin-bottom: 2px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
/* line 147, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-pills > .active > a,
.nav-pills > .active > a:hover {
color: white;
background-color: #0088cc;
}
/* line 158, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-stacked > li {
float: none;
}
/* line 161, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-stacked > li > a {
margin-right: 0;
}
/* line 166, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs.nav-stacked {
border-bottom: 0;
}
/* line 169, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs.nav-stacked > li > a {
border: 1px solid #ddd;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
/* line 173, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs.nav-stacked > li:first-child > a {
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
border-top-right-radius: 4px;
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
border-top-left-radius: 4px;
}
/* line 176, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs.nav-stacked > li:last-child > a {
-webkit-border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
border-bottom-left-radius: 4px;
}
/* line 179, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs.nav-stacked > li > a:hover {
border-color: #ddd;
z-index: 2;
}
/* line 185, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-pills.nav-stacked > li > a {
margin-bottom: 3px;
}
/* line 188, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-pills.nav-stacked > li:last-child > a {
margin-bottom: 1px;
}
/* line 197, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs .dropdown-menu {
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
}
/* line 200, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-pills .dropdown-menu {
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
/* line 207, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav .dropdown-toggle .caret {
border-top-color: #0088cc;
border-bottom-color: #0088cc;
margin-top: 6px;
}
/* line 212, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav .dropdown-toggle:hover .caret {
border-top-color: #005580;
border-bottom-color: #005580;
}
/* move down carets for tabs */
/* line 217, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs .dropdown-toggle .caret {
margin-top: 8px;
}
/* line 223, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav .active .dropdown-toggle .caret {
border-top-color: #fff;
border-bottom-color: #fff;
}
/* line 227, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs .active .dropdown-toggle .caret {
border-top-color: #555555;
border-bottom-color: #555555;
}
/* line 234, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav > .dropdown.active > a:hover {
cursor: pointer;
}
/* line 242, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav-tabs .open .dropdown-toggle,
.nav-pills .open .dropdown-toggle,
.nav > li.dropdown.open.active > a:hover {
color: white;
background-color: #999999;
border-color: #999999;
}
/* line 249, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav li.dropdown.open .caret,
.nav li.dropdown.open.active .caret,
.nav li.dropdown.open a:hover .caret {
border-top-color: white;
border-bottom-color: white;
opacity: 1;
filter: alpha(opacity=100);
}
/* line 256, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-stacked .open > a:hover {
border-color: #999999;
}
/* line 270, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabbable {
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.tabbable:before, .tabbable:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.tabbable:after {
clear: both;
}
/* line 273, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tab-content {
overflow: auto;
}
/* line 280, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-below > .nav-tabs,
.tabs-right > .nav-tabs,
.tabs-left > .nav-tabs {
border-bottom: 0;
}
/* line 286, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tab-content > .tab-pane,
.pill-content > .pill-pane {
display: none;
}
/* line 290, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tab-content > .active,
.pill-content > .active {
display: block;
}
/* line 298, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-below > .nav-tabs {
border-top: 1px solid #ddd;
}
/* line 301, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-below > .nav-tabs > li {
margin-top: -1px;
margin-bottom: 0;
}
/* line 305, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-below > .nav-tabs > li > a {
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
/* line 307, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-below > .nav-tabs > li > a:hover {
border-bottom-color: transparent;
border-top-color: #ddd;
}
/* line 313, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-below > .nav-tabs > .active > a,
.tabs-below > .nav-tabs > .active > a:hover {
border-color: transparent #ddd #ddd #ddd;
}
/* line 322, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-left > .nav-tabs > li,
.tabs-right > .nav-tabs > li {
float: none;
}
/* line 326, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-left > .nav-tabs > li > a,
.tabs-right > .nav-tabs > li > a {
min-width: 74px;
margin-right: 0;
margin-bottom: 3px;
}
/* line 333, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-left > .nav-tabs {
float: left;
margin-right: 19px;
border-right: 1px solid #ddd;
}
/* line 338, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-left > .nav-tabs > li > a {
margin-right: -1px;
-webkit-border-radius: 4px 0 0 4px;
-moz-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
/* line 342, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-left > .nav-tabs > li > a:hover {
border-color: #eeeeee #dddddd #eeeeee #eeeeee;
}
/* line 346, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-left > .nav-tabs .active > a,
.tabs-left > .nav-tabs .active > a:hover {
border-color: #ddd transparent #ddd #ddd;
*border-right-color: white;
}
/* line 352, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-right > .nav-tabs {
float: right;
margin-left: 19px;
border-left: 1px solid #ddd;
}
/* line 357, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-right > .nav-tabs > li > a {
margin-left: -1px;
-webkit-border-radius: 0 4px 4px 0;
-moz-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
}
/* line 361, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-right > .nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #eeeeee #dddddd;
}
/* line 365, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.tabs-right > .nav-tabs .active > a,
.tabs-right > .nav-tabs .active > a:hover {
border-color: #ddd #ddd #ddd transparent;
*border-left-color: white;
}
/* line 376, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav > .disabled > a {
color: #999999;
}
/* line 380, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navs.scss */
.nav > .disabled > a:hover {
text-decoration: none;
background-color: transparent;
cursor: default;
}
/* line 10, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar {
overflow: visible;
margin-bottom: 20px;
color: #555555;
*position: relative;
*z-index: 2;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inner {
min-height: 40px;
padding-left: 20px;
padding-right: 20px;
background-color: #f9f9f9;
background-image: -moz-linear-gradient(top, white, #f2f2f2);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(white), to(#f2f2f2));
background-image: -webkit-linear-gradient(top, white, #f2f2f2);
background-image: -o-linear-gradient(top, white, #f2f2f2);
background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFF2F2F2', GradientType=0);
border: 1px solid #d4d4d4;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar-inner:before, .navbar-inner:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar-inner:after {
clear: both;
}
/* line 37, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .container {
width: auto;
}
/* line 42, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.nav-collapse.collapse {
height: auto;
}
/* line 49, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .brand {
float: left;
display: block;
padding: 10px 20px 10px;
margin-left: -20px;
font-size: 20px;
font-weight: 200;
color: #555555;
text-shadow: 0 1px 0 white;
}
/* line 59, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .brand:hover {
text-decoration: none;
}
/* line 66, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-text {
margin-bottom: 0;
line-height: 40px;
}
/* line 73, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-link {
color: #555555;
}
/* line 75, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-link:hover {
color: #333333;
}
/* line 82, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .divider-vertical {
height: 40px;
margin: 0 9px;
border-left: 1px solid #f2f2f2;
border-right: 1px solid white;
}
/* line 92, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .btn,
.navbar .btn-group {
margin-top: 5px;
}
/* line 97, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .btn-group .btn,
.navbar .input-prepend .btn,
.navbar .input-append .btn {
margin-top: 0;
}
/* line 103, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-form {
margin-bottom: 0;
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar-form:before, .navbar-form:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar-form:after {
clear: both;
}
/* line 109, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-form input,
.navbar-form select,
.navbar-form .radio,
.navbar-form .checkbox {
margin-top: 5px;
}
/* line 114, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-form input,
.navbar-form select,
.navbar-form .btn {
display: inline-block;
margin-bottom: 0;
}
/* line 120, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-form input[type="image"],
.navbar-form input[type="checkbox"],
.navbar-form input[type="radio"] {
margin-top: 3px;
}
/* line 124, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-form .input-append,
.navbar-form .input-prepend {
margin-top: 6px;
white-space: nowrap;
}
/* line 127, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-form .input-append input,
.navbar-form .input-prepend input {
margin-top: 0;
}
/* line 135, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-search {
position: relative;
float: left;
margin-top: 5px;
margin-bottom: 0;
}
/* line 140, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-search .search-query {
margin-bottom: 0;
padding: 4px 14px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
font-weight: normal;
line-height: 1;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
/* line 153, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-static-top {
position: static;
width: 100%;
margin-bottom: 0;
}
/* line 157, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-static-top .navbar-inner {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
/* line 169, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
margin-bottom: 0;
}
/* line 177, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-fixed-top .navbar-inner,
.navbar-static-top .navbar-inner {
border-width: 0 0 1px;
}
/* line 180, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-fixed-bottom .navbar-inner {
border-width: 1px 0 0;
}
/* line 184, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-fixed-top .navbar-inner,
.navbar-fixed-bottom .navbar-inner {
padding-left: 0;
padding-right: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
/* line 194, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 940px;
}
/* line 199, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-fixed-top {
top: 0;
}
/* line 204, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-fixed-top .navbar-inner,
.navbar-static-top .navbar-inner {
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
}
/* line 210, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-fixed-bottom {
bottom: 0;
}
/* line 212, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-fixed-bottom .navbar-inner {
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);
}
/* line 222, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav {
position: relative;
left: 0;
display: block;
float: left;
margin: 0 10px 0 0;
}
/* line 229, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav.pull-right {
float: right;
margin-right: 0;
}
/* line 233, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav > li {
float: left;
}
/* line 238, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav > li > a {
float: none;
padding: 10px 15px 10px;
color: #555555;
text-decoration: none;
text-shadow: 0 1px 0 white;
}
/* line 246, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav .dropdown-toggle .caret {
margin-top: 8px;
}
/* line 252, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav > li > a:focus,
.navbar .nav > li > a:hover {
background-color: transparent;
color: #333333;
text-decoration: none;
}
/* line 261, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav > .active > a,
.navbar .nav > .active > a:hover,
.navbar .nav > .active > a:focus {
color: #555555;
text-decoration: none;
background-color: #e6e6e6;
-webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
-moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
}
/* line 270, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .btn-navbar {
display: none;
float: right;
padding: 7px 10px;
margin-left: 5px;
margin-right: 5px;
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #ededed;
background-image: -moz-linear-gradient(top, #f2f2f2, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #f2f2f2, #e6e6e6);
background-image: -o-linear-gradient(top, #f2f2f2, #e6e6e6);
background-image: linear-gradient(to bottom, #f2f2f2, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFF2F2F2', endColorstr='#FFE6E6E6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%);
*background-color: #e6e6e6;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
}
/* line 495, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar .btn-navbar:hover, .navbar .btn-navbar:active, .navbar .btn-navbar.active, .navbar .btn-navbar.disabled, .navbar .btn-navbar[disabled] {
color: white;
background-color: #e6e6e6;
*background-color: #d9d9d9;
}
/* line 503, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar .btn-navbar:active, .navbar .btn-navbar.active {
background-color: #cccccc \9;
}
/* line 279, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .btn-navbar .icon-bar {
display: block;
width: 18px;
height: 2px;
background-color: #f5f5f5;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
/* line 287, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.btn-navbar .icon-bar + .icon-bar {
margin-top: 3px;
}
/* line 298, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav > li > .dropdown-menu:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
top: -7px;
left: 9px;
}
/* line 309, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav > li > .dropdown-menu:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
position: absolute;
top: -6px;
left: 10px;
}
/* line 322, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-fixed-bottom .nav > li > .dropdown-menu:before {
border-top: 7px solid #ccc;
border-top-color: rgba(0, 0, 0, 0.2);
border-bottom: 0;
bottom: -7px;
top: auto;
}
/* line 329, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-fixed-bottom .nav > li > .dropdown-menu:after {
border-top: 6px solid white;
border-bottom: 0;
bottom: -6px;
top: auto;
}
/* line 340, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav li.dropdown.open > .dropdown-toggle,
.navbar .nav li.dropdown.active > .dropdown-toggle,
.navbar .nav li.dropdown.open.active > .dropdown-toggle {
background-color: #e6e6e6;
color: #555555;
}
/* line 344, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav li.dropdown > .dropdown-toggle .caret {
border-top-color: #555555;
border-bottom-color: #555555;
}
/* line 350, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .nav li.dropdown.open > .dropdown-toggle .caret,
.navbar .nav li.dropdown.active > .dropdown-toggle .caret,
.navbar .nav li.dropdown.open.active > .dropdown-toggle .caret {
border-top-color: #555555;
border-bottom-color: #555555;
}
/* line 357, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .pull-right > li > .dropdown-menu,
.navbar .nav > li > .dropdown-menu.pull-right {
left: auto;
right: 0;
}
/* line 360, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .pull-right > li > .dropdown-menu:before,
.navbar .nav > li > .dropdown-menu.pull-right:before {
left: auto;
right: 12px;
}
/* line 364, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .pull-right > li > .dropdown-menu:after,
.navbar .nav > li > .dropdown-menu.pull-right:after {
left: auto;
right: 13px;
}
/* line 368, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar .pull-right > li > .dropdown-menu .dropdown-menu,
.navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu {
left: auto;
right: 100%;
margin-left: 0;
margin-right: -1px;
-webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px;
border-radius: 6px 0 6px 6px;
}
/* line 381, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse {
color: #999999;
}
/* line 384, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .navbar-inner {
background-color: #1b1b1b;
background-image: -moz-linear-gradient(top, #222222, #111111);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111));
background-image: -webkit-linear-gradient(top, #222222, #111111);
background-image: -o-linear-gradient(top, #222222, #111111);
background-image: linear-gradient(to bottom, #222222, #111111);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF222222', endColorstr='#FF111111', GradientType=0);
border-color: #252525;
}
/* line 390, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .brand,
.navbar-inverse .nav > li > a {
color: #999999;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
/* line 393, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .brand:hover,
.navbar-inverse .nav > li > a:hover {
color: white;
}
/* line 399, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .nav > li > a:focus,
.navbar-inverse .nav > li > a:hover {
background-color: transparent;
color: white;
}
/* line 406, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .nav .active > a,
.navbar-inverse .nav .active > a:hover,
.navbar-inverse .nav .active > a:focus {
color: white;
background-color: #111111;
}
/* line 412, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .navbar-link {
color: #999999;
}
/* line 414, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .navbar-link:hover {
color: white;
}
/* line 420, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .divider-vertical {
border-left-color: #111111;
border-right-color: #222222;
}
/* line 428, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .nav li.dropdown.open > .dropdown-toggle,
.navbar-inverse .nav li.dropdown.active > .dropdown-toggle,
.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle {
background-color: #111111;
color: white;
}
/* line 432, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .nav li.dropdown > .dropdown-toggle .caret {
border-top-color: #999999;
border-bottom-color: #999999;
}
/* line 438, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret,
.navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret,
.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret {
border-top-color: white;
border-bottom-color: white;
}
/* line 445, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .navbar-search .search-query {
color: white;
background-color: #515151;
border-color: #111111;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
/* line 84, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar-inverse .navbar-search .search-query:-moz-placeholder {
color: #cccccc;
}
/* line 87, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar-inverse .navbar-search .search-query:-ms-input-placeholder {
color: #cccccc;
}
/* line 90, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder {
color: #cccccc;
}
/* line 455, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .navbar-search .search-query:focus, .navbar-inverse .navbar-search .search-query.focused {
padding: 5px 15px;
color: #333333;
text-shadow: 0 1px 0 white;
background-color: white;
border: 0;
-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
outline: 0;
}
/* line 468, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_navbar.scss */
.navbar-inverse .btn-navbar {
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #0e0e0e;
background-image: -moz-linear-gradient(top, #151515, #040404);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404));
background-image: -webkit-linear-gradient(top, #151515, #040404);
background-image: -o-linear-gradient(top, #151515, #040404);
background-image: linear-gradient(to bottom, #151515, #040404);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF151515', endColorstr='#FF040404', GradientType=0);
border-color: #040404 #040404 black;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%);
*background-color: #040404;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
/* line 495, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar-inverse .btn-navbar:hover, .navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active, .navbar-inverse .btn-navbar.disabled, .navbar-inverse .btn-navbar[disabled] {
color: white;
background-color: #040404;
*background-color: black;
}
/* line 503, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active {
background-color: black \9;
}
/* line 6, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss */
.breadcrumb {
padding: 8px 15px;
margin: 0 0 20px;
list-style: none;
background-color: #f5f5f5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
/* line 12, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss */
.breadcrumb li {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
text-shadow: 0 1px 0 white;
}
/* line 17, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss */
.breadcrumb .divider {
padding: 0 5px;
color: #ccc;
}
/* line 21, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss */
.breadcrumb .active {
color: #999999;
}
/* line 6, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination {
height: 40px;
margin: 20px 0;
}
/* line 10, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination ul {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
margin-left: 0;
margin-bottom: 0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
/* line 18, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination ul > li {
display: inline;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination ul > li > a,
.pagination ul > li > span {
float: left;
padding: 0 14px;
line-height: 38px;
text-decoration: none;
background-color: white;
border: 1px solid #dddddd;
border-left-width: 0;
}
/* line 33, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination ul > li > a:hover,
.pagination ul > .active > a,
.pagination ul > .active > span {
background-color: #f5f5f5;
}
/* line 37, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination ul > .active > a,
.pagination ul > .active > span {
color: #999999;
cursor: default;
}
/* line 43, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination ul > .disabled > span,
.pagination ul > .disabled > a,
.pagination ul > .disabled > a:hover {
color: #999999;
background-color: transparent;
cursor: default;
}
/* line 49, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination ul > li:first-child > a,
.pagination ul > li:first-child > span {
border-left-width: 1px;
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
/* line 54, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination ul > li:last-child > a,
.pagination ul > li:last-child > span {
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
/* line 59, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination-centered {
text-align: center;
}
/* line 62, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pagination.scss */
.pagination-right {
text-align: right;
}
/* line 6, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pager.scss */
.pager {
margin: 20px 0;
list-style: none;
text-align: center;
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.pager:before, .pager:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.pager:after {
clear: both;
}
/* line 12, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pager.scss */
.pager li {
display: inline;
}
/* line 16, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pager.scss */
.pager a,
.pager span {
display: inline-block;
padding: 5px 14px;
background-color: #fff;
border: 1px solid #ddd;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
/* line 23, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pager.scss */
.pager a:hover {
text-decoration: none;
background-color: #f5f5f5;
}
/* line 28, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pager.scss */
.pager .next a,
.pager .next span {
float: right;
}
/* line 31, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pager.scss */
.pager .previous a {
float: left;
}
/* line 36, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_pager.scss */
.pager .disabled a,
.pager .disabled a:hover,
.pager .disabled span {
color: #999999;
background-color: #fff;
cursor: default;
}
/* line 9, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-open modal .dropdown-menu {
z-index: 2050;
}
/* line 10, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-open modal .dropdown.open {
*z-index: 2050;
}
/* line 11, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-open modal .popover {
z-index: 2060;
}
/* line 12, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-open modal .tooltip {
z-index: 2080;
}
/* line 16, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: black;
}
/* line 25, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-backdrop.fade {
opacity: 0;
}
/* line 29, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-backdrop,
.modal-backdrop.fade.in {
opacity: 0.8;
filter: alpha(opacity=80);
}
/* line 34, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal {
position: fixed;
top: 50%;
left: 50%;
z-index: 1050;
overflow: auto;
width: 560px;
margin: -250px 0 0 -280px;
background-color: white;
border: 1px solid #999;
border: 1px solid rgba(0, 0, 0, 0.3);
*border: 1px solid #999;
/* IE6-7 */
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
}
/* line 49, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal.fade {
-webkit-transition: opacity 0.3s linear, top 0.3s ease-out;
-moz-transition: opacity 0.3s linear, top 0.3s ease-out;
-o-transition: opacity 0.3s linear, top 0.3s ease-out;
transition: opacity 0.3s linear, top 0.3s ease-out;
top: -25%;
}
/* line 53, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal.fade.in {
top: 50%;
}
/* line 55, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-header {
padding: 9px 15px;
border-bottom: 1px solid #eee;
}
/* line 59, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-header .close {
margin-top: 2px;
}
/* line 61, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-header h3 {
margin: 0;
line-height: 30px;
}
/* line 68, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-body {
overflow-y: auto;
max-height: 400px;
padding: 15px;
}
/* line 74, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-form {
margin-bottom: 0;
}
/* line 79, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-footer {
padding: 14px 15px 15px;
margin-bottom: 0;
text-align: right;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
-webkit-box-shadow: inset 0 1px 0 white;
-moz-box-shadow: inset 0 1px 0 white;
box-shadow: inset 0 1px 0 white;
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.modal-footer:before, .modal-footer:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.modal-footer:after {
clear: both;
}
/* line 90, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-footer .btn + .btn {
margin-left: 5px;
margin-bottom: 0;
}
/* line 95, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_modals.scss */
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
/* line 7, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip {
position: absolute;
z-index: 1030;
display: block;
visibility: visible;
padding: 5px;
font-size: 11px;
opacity: 0;
filter: alpha(opacity=0);
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip.in {
opacity: 0.8;
filter: alpha(opacity=80);
}
/* line 16, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip.top {
margin-top: -3px;
}
/* line 17, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip.right {
margin-left: 3px;
}
/* line 18, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip.bottom {
margin-top: 3px;
}
/* line 19, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip.left {
margin-left: -3px;
}
/* line 23, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: white;
text-align: center;
text-decoration: none;
background-color: black;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
/* line 34, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
/* line 42, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: black;
}
/* line 49, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: black;
}
/* line 56, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: black;
}
/* line 63, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_tooltip.scss */
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: black;
}
/* line 6, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
width: 236px;
padding: 1px;
background-color: white;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
/* line 24, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.top {
margin-bottom: 10px;
}
/* line 25, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.right {
margin-left: 10px;
}
/* line 26, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.bottom {
margin-top: 10px;
}
/* line 27, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.left {
margin-right: 10px;
}
/* line 31, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover-title {
margin: 0;
padding: 8px 14px;
font-size: 14px;
font-weight: normal;
line-height: 18px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
-webkit-border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
border-radius: 5px 5px 0 0;
}
/* line 42, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover-content {
padding: 9px 14px;
}
/* line 44, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover-content p, .popover-content ul, .popover-content ol {
margin-bottom: 0;
}
/* line 51, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover .arrow,
.popover .arrow:after {
position: absolute;
display: inline-block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
/* line 59, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover .arrow:after {
content: "";
z-index: -1;
}
/* line 65, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.top .arrow {
bottom: -10px;
left: 50%;
margin-left: -10px;
border-width: 10px 10px 0;
border-top-color: white;
}
/* line 71, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.top .arrow:after {
border-width: 11px 11px 0;
border-top-color: rgba(0, 0, 0, 0.25);
bottom: -1px;
left: -11px;
}
/* line 78, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.right .arrow {
top: 50%;
left: -10px;
margin-top: -10px;
border-width: 10px 10px 10px 0;
border-right-color: white;
}
/* line 84, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.right .arrow:after {
border-width: 11px 11px 11px 0;
border-right-color: rgba(0, 0, 0, 0.25);
bottom: -11px;
left: -1px;
}
/* line 91, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.bottom .arrow {
top: -10px;
left: 50%;
margin-left: -10px;
border-width: 0 10px 10px;
border-bottom-color: white;
}
/* line 97, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.bottom .arrow:after {
border-width: 0 11px 11px;
border-bottom-color: rgba(0, 0, 0, 0.25);
top: -1px;
left: -11px;
}
/* line 104, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.left .arrow {
top: 50%;
right: -10px;
margin-top: -10px;
border-width: 10px 0 10px 10px;
border-left-color: white;
}
/* line 110, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_popovers.scss */
.popover.left .arrow:after {
border-width: 11px 0 11px 11px;
border-left-color: rgba(0, 0, 0, 0.25);
bottom: -11px;
right: -1px;
}
/* line 9, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_thumbnails.scss */
.thumbnails {
margin-left: -20px;
list-style: none;
*zoom: 1;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.thumbnails:before, .thumbnails:after {
display: table;
content: "";
line-height: 0;
}
/* line 22, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */
.thumbnails:after {
clear: both;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_thumbnails.scss */
.row-fluid .thumbnails {
margin-left: 0;
}
/* line 20, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_thumbnails.scss */
.thumbnails > li {
float: left;
margin-bottom: 20px;
margin-left: 20px;
}
/* line 27, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_thumbnails.scss */
.thumbnail {
display: block;
padding: 4px;
line-height: 20px;
border: 1px solid #ddd;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
/* line 37, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_thumbnails.scss */
a.thumbnail:hover {
border-color: #0088cc;
-webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
-moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
}
/* line 43, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_thumbnails.scss */
.thumbnail > img {
display: block;
max-width: 100%;
margin-left: auto;
margin-right: auto;
}
/* line 49, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_thumbnails.scss */
.thumbnail .caption {
padding: 9px;
color: #555555;
}
/* line 8, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label,
.badge {
font-size: 11.844px;
font-weight: bold;
line-height: 14px;
color: white;
vertical-align: baseline;
white-space: nowrap;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #999999;
}
/* line 19, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label {
padding: 1px 4px 2px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
/* line 23, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.badge {
padding: 1px 9px 2px;
-webkit-border-radius: 9px;
-moz-border-radius: 9px;
border-radius: 9px;
}
/* line 31, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
a.label:hover, a.badge:hover {
color: white;
text-decoration: none;
cursor: pointer;
}
/* line 42, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label-important, .badge-important {
background-color: #b94a48;
}
/* line 43, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label-important[href], .badge-important[href] {
background-color: #953b39;
}
/* line 45, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label-warning, .badge-warning {
background-color: #f89406;
}
/* line 46, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label-warning[href], .badge-warning[href] {
background-color: #c67605;
}
/* line 48, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label-success, .badge-success {
background-color: #468847;
}
/* line 49, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label-success[href], .badge-success[href] {
background-color: #356635;
}
/* line 51, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label-info, .badge-info {
background-color: #3a87ad;
}
/* line 52, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label-info[href], .badge-info[href] {
background-color: #2d6987;
}
/* line 54, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label-inverse, .badge-inverse {
background-color: #333333;
}
/* line 55, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.label-inverse[href], .badge-inverse[href] {
background-color: #1a1a1a;
}
/* line 60, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.btn .label,
.btn .badge {
position: relative;
top: -1px;
}
/* line 67, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_labels-badges.scss */
.btn-mini .label,
.btn-mini .badge {
top: 0;
}
@-webkit-keyframes progress-bar-stripes {
/* line 11, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
from {
background-position: 40px 0;
}
/* line 12, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
to {
background-position: 0 0;
}
}
@-moz-keyframes progress-bar-stripes {
/* line 17, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
from {
background-position: 40px 0;
}
/* line 18, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
to {
background-position: 0 0;
}
}
@-ms-keyframes progress-bar-stripes {
/* line 23, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
from {
background-position: 40px 0;
}
/* line 24, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
to {
background-position: 0 0;
}
}
@-o-keyframes progress-bar-stripes {
/* line 29, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
from {
background-position: 0 0;
}
/* line 30, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
to {
background-position: 40px 0;
}
}
@keyframes progress-bar-stripes {
/* line 35, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
from {
background-position: 40px 0;
}
/* line 36, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
to {
background-position: 0 0;
}
}
/* line 45, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress {
overflow: hidden;
height: 20px;
margin-bottom: 20px;
background-color: #f6f6f6;
background-image: -moz-linear-gradient(top, whitesmoke, #f9f9f9);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(whitesmoke), to(#f9f9f9));
background-image: -webkit-linear-gradient(top, whitesmoke, #f9f9f9);
background-image: -o-linear-gradient(top, whitesmoke, #f9f9f9);
background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFF5F5F5', endColorstr='#FFF9F9F9', GradientType=0);
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
/* line 55, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress .bar {
width: 0%;
height: 100%;
color: white;
float: left;
font-size: 12px;
text-align: center;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #0d90d1;
background-image: -moz-linear-gradient(top, #149bdf, #0480be);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));
background-image: -webkit-linear-gradient(top, #149bdf, #0480be);
background-image: -o-linear-gradient(top, #149bdf, #0480be);
background-image: linear-gradient(to bottom, #149bdf, #0480be);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF149BDF', endColorstr='#FF0480BE', GradientType=0);
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: width 0.6s ease;
-moz-transition: width 0.6s ease;
-o-transition: width 0.6s ease;
transition: width 0.6s ease;
}
/* line 68, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress .bar + .bar {
-webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}
/* line 73, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress-striped .bar {
background-color: #149bdf;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
-webkit-background-size: 40px 40px;
-moz-background-size: 40px 40px;
-o-background-size: 40px 40px;
background-size: 40px 40px;
}
/* line 79, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress.active .bar {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-moz-animation: progress-bar-stripes 2s linear infinite;
-ms-animation: progress-bar-stripes 2s linear infinite;
-o-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
/* line 93, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress-danger .bar, .progress .bar-danger {
background-color: #dd514b;
background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));
background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
background-image: linear-gradient(to bottom, #ee5f5b, #c43c35);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEE5F5B', endColorstr='#FFC43C35', GradientType=0);
}
/* line 96, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress-danger.progress-striped .bar, .progress-striped .bar-danger {
background-color: #ee5f5b;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
}
/* line 101, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress-success .bar, .progress .bar-success {
background-color: #5db95d;
background-image: -moz-linear-gradient(top, #62c462, #57a957);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));
background-image: -webkit-linear-gradient(top, #62c462, #57a957);
background-image: -o-linear-gradient(top, #62c462, #57a957);
background-image: linear-gradient(to bottom, #62c462, #57a957);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF62C462', endColorstr='#FF57A957', GradientType=0);
}
/* line 104, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress-success.progress-striped .bar, .progress-striped .bar-success {
background-color: #62c462;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
}
/* line 109, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress-info .bar, .progress .bar-info {
background-color: #4bb1cf;
background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));
background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);
background-image: -o-linear-gradient(top, #5bc0de, #339bb9);
background-image: linear-gradient(to bottom, #5bc0de, #339bb9);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF5BC0DE', endColorstr='#FF339BB9', GradientType=0);
}
/* line 112, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress-info.progress-striped .bar, .progress-striped .bar-info {
background-color: #5bc0de;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
}
/* line 117, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress-warning .bar, .progress .bar-warning {
background-color: #f9a732;
background-image: -moz-linear-gradient(top, #fbb450, #f89406);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
background-image: -o-linear-gradient(top, #fbb450, #f89406);
background-image: linear-gradient(to bottom, #fbb450, #f89406);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFBB450', endColorstr='#FFF89406', GradientType=0);
}
/* line 120, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_progress-bars.scss */
.progress-warning.progress-striped .bar, .progress-striped .bar-warning {
background-color: #fbb450;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
}
/* line 7, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_accordion.scss */
.accordion {
margin-bottom: 20px;
}
/* line 12, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_accordion.scss */
.accordion-group {
margin-bottom: 2px;
border: 1px solid #e5e5e5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
/* line 17, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_accordion.scss */
.accordion-heading {
border-bottom: 0;
}
/* line 20, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_accordion.scss */
.accordion-heading .accordion-toggle {
display: block;
padding: 8px 15px;
}
/* line 26, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_accordion.scss */
.accordion-toggle {
cursor: pointer;
}
/* line 31, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_accordion.scss */
.accordion-inner {
padding: 9px 15px;
border-top: 1px solid #e5e5e5;
}
/* line 6, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel {
position: relative;
margin-bottom: 20px;
line-height: 1;
}
/* line 12, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel-inner {
overflow: hidden;
width: 100%;
position: relative;
}
/* line 20, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel .item {
display: none;
position: relative;
-webkit-transition: 0.6s ease-in-out left;
-moz-transition: 0.6s ease-in-out left;
-o-transition: 0.6s ease-in-out left;
transition: 0.6s ease-in-out left;
}
/* line 27, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel .item > img {
display: block;
line-height: 1;
}
/* line 34, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel .active,
.carousel .next,
.carousel .prev {
display: block;
}
/* line 36, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel .active {
left: 0;
}
/* line 41, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel .next,
.carousel .prev {
position: absolute;
top: 0;
width: 100%;
}
/* line 47, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel .next {
left: 100%;
}
/* line 50, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel .prev {
left: -100%;
}
/* line 54, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel .next.left,
.carousel .prev.right {
left: 0;
}
/* line 58, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel .active.left {
left: -100%;
}
/* line 61, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel .active.right {
left: 100%;
}
/* line 70, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel-control {
position: absolute;
top: 40%;
left: 15px;
width: 40px;
height: 40px;
margin-top: -20px;
font-size: 60px;
font-weight: 100;
line-height: 30px;
color: white;
text-align: center;
background: #222222;
border: 3px solid white;
-webkit-border-radius: 23px;
-moz-border-radius: 23px;
border-radius: 23px;
opacity: 0.5;
filter: alpha(opacity=50);
}
/* line 95, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel-control.right {
left: auto;
right: 15px;
}
/* line 101, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel-control:hover {
color: white;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
/* line 112, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel-caption {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 15px;
background: #333333;
background: rgba(0, 0, 0, 0.75);
}
/* line 122, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel-caption h4,
.carousel-caption p {
color: white;
line-height: 20px;
}
/* line 126, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel-caption h4 {
margin: 0 0 5px;
}
/* line 129, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_carousel.scss */
.carousel-caption p {
margin-bottom: 0;
}
/* line 6, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_hero-unit.scss */
.hero-unit {
padding: 60px;
margin-bottom: 30px;
background-color: #eeeeee;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
/* line 11, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_hero-unit.scss */
.hero-unit h1 {
margin-bottom: 0;
font-size: 60px;
line-height: 1;
color: inherit;
letter-spacing: -1px;
}
/* line 18, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_hero-unit.scss */
.hero-unit p {
font-size: 18px;
font-weight: 200;
line-height: 30px;
color: inherit;
}
/* line 7, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_utilities.scss */
.pull-right {
float: right;
}
/* line 10, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_utilities.scss */
.pull-left {
float: left;
}
/* line 15, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_utilities.scss */
.hide {
display: none;
}
/* line 18, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_utilities.scss */
.show {
display: block;
}
/* line 23, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_utilities.scss */
.invisible {
visibility: hidden;
}
/* line 28, ../../../../../../../.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.1.1.0/vendor/assets/stylesheets/bootstrap/_utilities.scss */
.affix {
position: fixed;
}
| zendesk/zendesk_api_playground | public/stylesheets/styles.css | CSS | apache-2.0 | 242,295 |
<?php
/*
* Copyright (c) Lightstreamer Srl
*
* 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 lightstreamer\adapters\remote;
/**
* Base class for all exceptions directly thrown by the Data Adapter.
*/
class DataException extends \Exception
{
public function __construct($message, $code = 0, $previous = NULL)
{
parent::__construct($message, $code, $previous);
}
} | Lightstreamer/Lightstreamer-example-HelloWorld-adapter-php | src/lightstreamer/adapters/remote/DataException.php | PHP | apache-2.0 | 912 |
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* 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.
*/
#pragma once
#include <caffe2/distributed/store_handler.h>
namespace caffe2 {
class FileStoreHandler : public StoreHandler {
public:
explicit FileStoreHandler(const std::string& path, const std::string& prefix);
virtual ~FileStoreHandler();
virtual void set(const std::string& name, const std::string& data) override;
virtual std::string get(const std::string& name) override;
virtual int64_t add(const std::string& name, int64_t value) override;
virtual bool check(const std::vector<std::string>& names) override;
virtual void wait(
const std::vector<std::string>& names,
const std::chrono::milliseconds& timeout = kDefaultTimeout) override;
protected:
std::string basePath_;
std::string realPath(const std::string& path);
std::string tmpPath(const std::string& name);
std::string objectPath(const std::string& name);
};
} // namespace caffe2
| davinwang/caffe2 | caffe2/distributed/file_store_handler.h | C | apache-2.0 | 1,506 |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
package org.elasticsearch.xpack.searchablesnapshots.action;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.routing.allocation.ExistingShardsAllocator;
import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ListenableFuture;
import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.indices.ShardLimitValidator;
import org.elasticsearch.indices.SystemIndices;
import org.elasticsearch.license.XPackLicenseState;
import org.elasticsearch.repositories.IndexId;
import org.elasticsearch.repositories.RepositoriesService;
import org.elasticsearch.repositories.Repository;
import org.elasticsearch.repositories.RepositoryData;
import org.elasticsearch.snapshots.SnapshotId;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider;
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction;
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants;
import org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots;
import org.elasticsearch.xpack.searchablesnapshots.allocation.SearchableSnapshotAllocator;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import static org.elasticsearch.index.IndexModule.INDEX_RECOVERY_TYPE_SETTING;
import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING;
import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE;
import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.isSearchableSnapshotStore;
/**
* Action that mounts a snapshot as a searchable snapshot, by converting the mount request into a restore request with specific settings
* using {@link #buildIndexSettings}.
*
* This action needs to run on the master node because it retrieves the {@link RepositoryData}.
*/
public class TransportMountSearchableSnapshotAction extends TransportMasterNodeAction<
MountSearchableSnapshotRequest,
RestoreSnapshotResponse> {
private static final Collection<Setting<String>> DATA_TIER_ALLOCATION_SETTINGS = List.of(
DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING
);
private final Client client;
private final RepositoriesService repositoriesService;
private final XPackLicenseState licenseState;
private final SystemIndices systemIndices;
@Inject
public TransportMountSearchableSnapshotAction(
TransportService transportService,
ClusterService clusterService,
Client client,
ThreadPool threadPool,
RepositoriesService repositoriesService,
ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver,
XPackLicenseState licenseState,
SystemIndices systemIndices
) {
super(
MountSearchableSnapshotAction.NAME,
transportService,
clusterService,
threadPool,
actionFilters,
MountSearchableSnapshotRequest::new,
indexNameExpressionResolver,
RestoreSnapshotResponse::new,
// Use SNAPSHOT_META pool since we are slow due to loading repository metadata in this action
ThreadPool.Names.SNAPSHOT_META
);
this.client = client;
this.repositoriesService = repositoriesService;
this.licenseState = Objects.requireNonNull(licenseState);
this.systemIndices = Objects.requireNonNull(systemIndices);
}
@Override
protected ClusterBlockException checkBlock(MountSearchableSnapshotRequest request, ClusterState state) {
// The restore action checks the cluster blocks.
return null;
}
/**
* Return the index settings required to make a snapshot searchable
*/
private static Settings buildIndexSettings(
String repoUuid,
String repoName,
SnapshotId snapshotId,
IndexId indexId,
MountSearchableSnapshotRequest.Storage storage,
Version minNodeVersion
) {
final Settings.Builder settings = Settings.builder();
if (repoUuid.equals(RepositoryData.MISSING_UUID) == false) {
settings.put(SearchableSnapshots.SNAPSHOT_REPOSITORY_UUID_SETTING.getKey(), repoUuid);
}
settings.put(SearchableSnapshots.SNAPSHOT_REPOSITORY_NAME_SETTING.getKey(), repoName)
.put(SearchableSnapshots.SNAPSHOT_SNAPSHOT_NAME_SETTING.getKey(), snapshotId.getName())
.put(SearchableSnapshots.SNAPSHOT_SNAPSHOT_ID_SETTING.getKey(), snapshotId.getUUID())
.put(SearchableSnapshots.SNAPSHOT_INDEX_NAME_SETTING.getKey(), indexId.getName())
.put(SearchableSnapshots.SNAPSHOT_INDEX_ID_SETTING.getKey(), indexId.getId())
.put(INDEX_STORE_TYPE_SETTING.getKey(), SEARCHABLE_SNAPSHOT_STORE_TYPE)
.put(IndexMetadata.SETTING_BLOCKS_WRITE, true)
.put(ExistingShardsAllocator.EXISTING_SHARDS_ALLOCATOR_SETTING.getKey(), SearchableSnapshotAllocator.ALLOCATOR_NAME)
.put(INDEX_RECOVERY_TYPE_SETTING.getKey(), SearchableSnapshots.SNAPSHOT_RECOVERY_STATE_FACTORY_KEY);
if (storage == MountSearchableSnapshotRequest.Storage.SHARED_CACHE) {
if (minNodeVersion.before(Version.V_7_12_0)) {
throw new IllegalArgumentException("shared cache searchable snapshots require minimum node version " + Version.V_7_12_0);
}
settings.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true)
.put(DiskThresholdDecider.SETTING_IGNORE_DISK_WATERMARKS.getKey(), true);
// we cannot apply this setting during rolling upgrade.
if (minNodeVersion.onOrAfter(Version.V_7_13_0)) {
settings.put(ShardLimitValidator.INDEX_SETTING_SHARD_LIMIT_GROUP.getKey(), ShardLimitValidator.FROZEN_GROUP);
}
}
return settings.build();
}
@Override
protected void masterOperation(
Task task,
final MountSearchableSnapshotRequest request,
final ClusterState state,
final ActionListener<RestoreSnapshotResponse> listener
) {
SearchableSnapshots.ensureValidLicense(licenseState);
final String mountedIndexName = request.mountedIndexName();
if (systemIndices.isSystemIndex(mountedIndexName)) {
throw new ElasticsearchException("system index [{}] cannot be mounted as searchable snapshots", mountedIndexName);
}
final String repoName = request.repositoryName();
final String snapName = request.snapshotName();
final String indexName = request.snapshotIndexName();
// Retrieve IndexId and SnapshotId instances, which are then used to create a new restore
// request, which is then sent on to the actual snapshot restore mechanism
final Repository repository = repositoriesService.repository(repoName);
SearchableSnapshots.getSearchableRepository(repository); // just check it's valid
final ListenableFuture<RepositoryData> repositoryDataListener = new ListenableFuture<>();
repository.getRepositoryData(repositoryDataListener);
repositoryDataListener.addListener(ActionListener.wrap(repoData -> {
final Map<String, IndexId> indexIds = repoData.getIndices();
if (indexIds.containsKey(indexName) == false) {
throw new IndexNotFoundException("index [" + indexName + "] not found in repository [" + repoName + "]");
}
final IndexId indexId = indexIds.get(indexName);
final Optional<SnapshotId> matchingSnapshotId = repoData.getSnapshotIds()
.stream()
.filter(s -> snapName.equals(s.getName()))
.findFirst();
if (matchingSnapshotId.isEmpty()) {
throw new ElasticsearchException("snapshot [" + snapName + "] not found in repository [" + repoName + "]");
}
final SnapshotId snapshotId = matchingSnapshotId.get();
final IndexMetadata indexMetadata = repository.getSnapshotIndexMetaData(repoData, snapshotId, indexId);
if (isSearchableSnapshotStore(indexMetadata.getSettings())) {
throw new IllegalArgumentException(
String.format(
Locale.ROOT,
"index [%s] in snapshot [%s/%s:%s] is a snapshot of a searchable snapshot index "
+ "backed by index [%s] in snapshot [%s/%s:%s] and cannot be mounted; did you mean to restore it instead?",
indexName,
repoName,
repository.getMetadata().uuid(),
snapName,
SearchableSnapshots.SNAPSHOT_INDEX_NAME_SETTING.get(indexMetadata.getSettings()),
SearchableSnapshots.SNAPSHOT_REPOSITORY_NAME_SETTING.get(indexMetadata.getSettings()),
SearchableSnapshots.SNAPSHOT_REPOSITORY_UUID_SETTING.get(indexMetadata.getSettings()),
SearchableSnapshots.SNAPSHOT_SNAPSHOT_NAME_SETTING.get(indexMetadata.getSettings())
)
);
}
final Set<String> ignoreIndexSettings = new LinkedHashSet<>(Arrays.asList(request.ignoreIndexSettings()));
ignoreIndexSettings.add(IndexMetadata.SETTING_DATA_PATH);
for (final String indexSettingKey : indexMetadata.getSettings().keySet()) {
if (indexSettingKey.startsWith(IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_PREFIX)
|| indexSettingKey.startsWith(IndexMetadata.INDEX_ROUTING_INCLUDE_GROUP_PREFIX)
|| indexSettingKey.startsWith(IndexMetadata.INDEX_ROUTING_EXCLUDE_GROUP_PREFIX)) {
ignoreIndexSettings.add(indexSettingKey);
}
}
final Settings indexSettings = Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) // can be overridden
.put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, false) // can be overridden
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), false) // can be overridden
.put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, request.storage().defaultDataTiersPreference())
.put(request.indexSettings())
.put(
buildIndexSettings(
repoData.getUuid(),
request.repositoryName(),
snapshotId,
indexId,
request.storage(),
state.nodes().getMinNodeVersion()
)
)
.build();
// todo: restore archives bad settings, for now we verify just the data tiers, since we know their dependencies are available
// in settings
for (Setting<String> dataTierAllocationSetting : DATA_TIER_ALLOCATION_SETTINGS) {
dataTierAllocationSetting.get(indexSettings);
}
client.admin()
.cluster()
.restoreSnapshot(
new RestoreSnapshotRequest(repoName, snapName)
// Restore the single index specified
.indices(indexName)
// Always rename it to the desired mounted index name
.renamePattern(".+")
.renameReplacement(mountedIndexName)
// Pass through index settings, adding the index-level settings required to use searchable snapshots
.indexSettings(indexSettings)
// Pass through ignored index settings
.ignoreIndexSettings(ignoreIndexSettings.toArray(new String[0]))
// Don't include global state
.includeGlobalState(false)
// Don't include aliases
.includeAliases(false)
// Pass through the wait-for-completion flag
.waitForCompletion(request.waitForCompletion())
// Pass through the master-node timeout
.masterNodeTimeout(request.masterNodeTimeout())
// Fail the restore if the snapshot found above is swapped out from under us before the restore happens
.snapshotUuid(snapshotId.getUUID()),
listener
);
}, listener::onFailure), threadPool.executor(ThreadPool.Names.SNAPSHOT_META), null);
}
}
| ern/elasticsearch | x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java | Java | apache-2.0 | 14,381 |
#pragma once
#include <memory>
#include <string>
#include <vector>
namespace YAML {
class Node;
}
namespace Tangram {
class StyleMixer {
public:
using Node = YAML::Node;
// Get the sequence of style names that are designated to be mixed into the
// input style node by its 'base' and 'mix' fields.
std::vector<std::string> getStylesToMix(const Node& _style);
// Get a sequence of style names ordered such that if style 'a' mixes style
// 'b', 'b' will always precede 'a' in the sequence.
std::vector<std::string> getMixingOrder(const Node& _styles);
// Apply mixing to all styles in the input map with modifications in-place
// unless otherwise noted.
void mixStyleNodes(Node _styles);
// Apply the given list of 'mixin' styles to the first style.
void applyStyleMixins(Node _style, const std::vector<Node>& _mixins);
// Apply the given list of 'mixin' style shader nodes to the first style
// shader node. Note that 'blocks' and 'extensions' are merged into new
// output fields called 'blocks_merged' and 'extensions_merged'.
void applyShaderMixins(Node _shaders, const std::vector<Node>& _mixins);
private:
void mergeBooleanFieldAsDisjunction(const std::string& _key, Node _target, const std::vector<Node>& _sources);
void mergeFieldTakingLast(const std::string& _key, Node _target, const std::vector<Node>& _sources);
void mergeMapFieldTakingLast(const std::string& _key, Node _target, const std::vector<Node>& _sources);
};
}
| mgarcia01752/weg | lib/tangram-es/core/src/scene/styleMixer.h | C | apache-2.0 | 1,528 |
/*
* Copyright 2016-present Open Networking Foundation
*
* 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 org.onosproject.cli.net;
import org.apache.karaf.shell.api.action.Argument;
import org.apache.karaf.shell.api.action.Command;
import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.apache.karaf.shell.api.action.Option;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.net.key.DeviceKey;
import org.onosproject.net.key.DeviceKeyAdminService;
import org.onosproject.net.key.DeviceKeyId;
/**
* Adds a device key.
*/
@Service
@Command(scope = "onos", name = "device-key-add",
description = "Adds a device key. Adding a new device key with " +
"the same id will replace the existing device key.")
public class DeviceKeyAddCommand extends AbstractShellCommand {
private static final String COMMUNITY_NAME = "CommunityName";
private static final String USERNAME = "UsernamePassword";
@Argument(index = 0, name = "id", description = "Device Key ID",
required = true, multiValued = false)
String id = null;
@Argument(index = 1, name = "type", description = "Device Key Type, " +
"it includes CommunityName, UsernamePassword.",
required = true, multiValued = false)
String type = null;
@Option(name = "-c", aliases = "--communityName", description = "Device Key Community Name",
required = false, multiValued = false)
String communityName = null;
@Option(name = "-l", aliases = "--label", description = "Device Key Label",
required = false, multiValued = false)
String label = null;
@Option(name = "-u", aliases = "--username", description = "Device Key Username",
required = false, multiValued = false)
String username = null;
@Option(name = "-p", aliases = "--password", description = "Device Key Password",
required = false, multiValued = false)
String password = null;
@Override
protected void doExecute() {
DeviceKeyAdminService service = get(DeviceKeyAdminService.class);
DeviceKey deviceKey = null;
if (type.equalsIgnoreCase(COMMUNITY_NAME)) {
deviceKey = DeviceKey.createDeviceKeyUsingCommunityName(DeviceKeyId.deviceKeyId(id),
label, communityName);
} else if (type.equalsIgnoreCase(USERNAME)) {
deviceKey = DeviceKey.createDeviceKeyUsingUsernamePassword(DeviceKeyId.deviceKeyId(id),
label, username, password);
} else {
print("Invalid Device key type: {}", type);
return;
}
service.addKey(deviceKey);
print("Device Key successfully added.");
}
}
| gkatsikas/onos | cli/src/main/java/org/onosproject/cli/net/DeviceKeyAddCommand.java | Java | apache-2.0 | 3,352 |
<div class="page page-oito">
<!-- <img class="elements" src="img/page-oito/fundo.jpg" alt="fundo"/>
<img class="elements mapa" src="img/page-oito/mapa.png" alt="mapa"/>
<img class="elements mapa" src="img/page-oito/animacao.gif" alt="animacao"/> -->
</div>
| tortoyoyo/tortoyoyo.github.io | curriculo/partials/page-oito.html | HTML | apache-2.0 | 269 |
/* Copyright (C) 2013-2015 Computer Sciences Corporation
*
* 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 ezbake.groups.graph;
import com.google.common.base.Joiner;
import com.thinkaurelius.titan.core.Titan;
import com.thinkaurelius.titan.diskstorage.accumulo.AccumuloStoreManager;
import com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex;
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration;
import ezbakehelpers.accumulo.AccumuloHelper;
import ezbakehelpers.ezconfigurationhelpers.application.EzBakeApplicationConfigurationHelper;
import ezbakehelpers.ezconfigurationhelpers.elasticsearch.ElasticsearchConfigurationHelper;
import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Properties;
/**
* User: jhastings
* Date: 6/23/14
* Time: 12:29 PM
*/
public class TitanGraphConfiguration extends BaseConfiguration {
private static final Logger LOGGER = LoggerFactory.getLogger(TitanGraphConfiguration.class);
private static final String SEARCH_INDEX = "search";
private final Properties ezConfiguration;
public TitanGraphConfiguration(Properties ezConfiguration) {
this.ezConfiguration = ezConfiguration;
// Copy all the titan configurations out of the ezconfiguration
for (String key : ezConfiguration.stringPropertyNames()) {
String propValue = ezConfiguration.getProperty(key);
if (propValue != null && key.startsWith(GraphDatabaseConfiguration.STORAGE_NAMESPACE)) {
setProperty(key, propValue);
}
}
// Update the instance number
EzBakeApplicationConfigurationHelper appHelper = new EzBakeApplicationConfigurationHelper(ezConfiguration);
setProperty(joinProperties(
GraphDatabaseConfiguration.STORAGE_NAMESPACE,
GraphDatabaseConfiguration.INSTANCE_RID_SHORT_KEY
), appHelper.getApplicationInstanceNumber());
// Gather all the accumulo configurations
AccumuloHelper ah = new AccumuloHelper(ezConfiguration);
setProperty(joinProperties(
GraphDatabaseConfiguration.STORAGE_NAMESPACE,
AccumuloStoreManager.ACCUMULO_NAMESPACE,
AccumuloStoreManager.ACCUMULO_INSTANCE_KEY
), ah.getAccumuloInstance());
setProperty(joinProperties(
GraphDatabaseConfiguration.STORAGE_NAMESPACE,
GraphDatabaseConfiguration.HOSTNAME_KEY
), ah.getAccumuloZookeepers());
String tableNameKey = joinProperties(GraphDatabaseConfiguration.STORAGE_NAMESPACE,
AccumuloStoreManager.TABLE_NAME_KEY);
setProperty(tableNameKey, joinProperties(ah.getAccumuloNamespace(), getString(tableNameKey)));
setProperty(joinProperties(
GraphDatabaseConfiguration.STORAGE_NAMESPACE,
GraphDatabaseConfiguration.AUTH_USERNAME_KEY
), ah.getAccumuloUsername());
setProperty(joinProperties(
GraphDatabaseConfiguration.STORAGE_NAMESPACE,
GraphDatabaseConfiguration.AUTH_PASSWORD_KEY
), ah.getAccumuloPassword());
// Gather elasticsearch properties
ElasticsearchConfigurationHelper eh = new ElasticsearchConfigurationHelper(ezConfiguration);
setProperty(joinProperties(
GraphDatabaseConfiguration.STORAGE_NAMESPACE,
GraphDatabaseConfiguration.INDEX_NAMESPACE,
SEARCH_INDEX,
ElasticSearchIndex.CLUSTER_NAME_KEY
), eh.getElasticsearchClusterName());
setProperty(joinProperties(
GraphDatabaseConfiguration.STORAGE_NAMESPACE,
GraphDatabaseConfiguration.INDEX_NAMESPACE,
SEARCH_INDEX,
GraphDatabaseConfiguration.HOSTNAME_KEY
), eh.getElasticsearchHostWithPort());
}
public Properties getEzConfiguration() {
return ezConfiguration;
}
public String getIndex() {
Configuration indexSubset = subset(joinProperties(
GraphDatabaseConfiguration.STORAGE_NAMESPACE,
GraphDatabaseConfiguration.INDEX_NAMESPACE,
SEARCH_INDEX));
String index = Titan.Token.STANDARD_INDEX;
if (!indexSubset.isEmpty()) {
index = SEARCH_INDEX;
}
return index;
}
private String joinProperties(String ...properties) {
return Joiner.on(".").skipNulls().join(properties);
}
}
| infochimps-forks/ezbake-platform-services | groups/graph/src/main/java/ezbake/groups/graph/TitanGraphConfiguration.java | Java | apache-2.0 | 5,132 |
/*
Copyright 2021 The Knative Authors
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 sut
// NewDefault will return a default SUT for this repo.
func NewDefault() SystemUnderTest {
return NewBrokerAndTriggers()
}
| knative-sandbox/eventing-kafka-broker | vendor/knative.dev/eventing/test/upgrade/prober/sut/default.go | GO | apache-2.0 | 704 |
/*
* Copyright (c) 2015, Jurriaan Mous and contributors as indicated by the @author tags.
*
* 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 mousio.etcd4j.transport;
import mousio.etcd4j.promises.EtcdResponsePromise;
import mousio.etcd4j.requests.EtcdRequest;
import java.io.Closeable;
import java.io.IOException;
/**
* @author Jurriaan Mous
*
* Interface for Etcd client implementations
*/
public interface EtcdClientImpl extends Closeable {
/**
* Sends a request to the server
*
* @param request to send
* @param <R> Type of response
* @return A Promise
* @throws java.io.IOException if IO failure while sending
*/
public <R> EtcdResponsePromise<R> send(EtcdRequest<R> request) throws IOException;
@Override
public void close();
} | armstrongli/etcd4j | src/main/java/mousio/etcd4j/transport/EtcdClientImpl.java | Java | apache-2.0 | 1,294 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
*/
package my.test.cluster;
import my.test.start.CassandraDaemonStart;
public class Node2 extends CassandraDaemonStart {
public static void main(String[] args) {
setConfigLoader(Node2.class);
System.setProperty("mx4jaddress", "127.0.0.2");
System.setProperty("mx4jport", "8082");
run(args, "my-cassandra.yaml");
}
public Node2() {
this.listen_address = "127.0.0.2";
this.dir = "cluster/node2";
}
}
| mashuai/Cassandra-Research | my-test/my/test/cluster/Node2.java | Java | apache-2.0 | 1,268 |
package org.drools.integrationtests.eventgenerator.example;
import org.drools.integrationtests.eventgenerator.Event;
public class ProductionEvent extends Event {
/**
* Special constructor for a production event
* @param parentId The id of the corresponding site, resource, ...
*/
public ProductionEvent(String parentId) {
super(EventType.PRODUCTION, parentId);
}
/**
* Special constructor for a production event
* @param parentId The id of the corresponding site, resource, ...
* @param start The start instance of the event.
* @param end The end instance of the event.
* @param parameters The event parameters.
*/
public ProductionEvent(String parentId, long start, long end) {
super(EventType.PRODUCTION, parentId, start, end);
}
}
| pperboires/PocDrools | drools-compiler/src/test/java/org/drools/integrationtests/eventgenerator/example/ProductionEvent.java | Java | apache-2.0 | 823 |
---
title: Release 0.40
short-description: Release notes for 0.40
...
# New features
## Outputs of generators can be used in custom targets in the VS backend
This has been possible with the Ninja backend for a long time but now
the Visual Studio backend works too.
## `compute_int` method in the compiler objects
This method can be used to evaluate the value of an expression. As an
example:
```meson
cc = meson.get_compiler('c')
two = cc.compute_int('1 + 1') # A very slow way of adding two numbers.
```
## Visual Studio 2017 support
There is now a VS2017 backend (`--backend=vs2017`) as well as a
generic VS backend (`--backend=vs`) that autodetects the currently
active VS version.
## Automatic initialization of subprojects that are git submodules
If you have a directory inside your subprojects directory (usually
`subprojects/`) that is a git submodule, Meson will automatically
initialize it if your build files refer to it. This will be done
without needing a wrap file since git contains all the information
needed.
## No download mode for wraps
Added a new option `wrap-mode` that can be toggled to prevent Meson
from downloading dependency projects. Attempting to do so will cause
an error. This is useful for distro packagers and other cases where
you must explicitly enforce that nothing is downloaded from the net
during configuration or build.
## Overriding options per target
Build targets got a new keyword argument `override_options` that can
be used to override system options. As an example if you have a target
that you know can't be built with `-Werror` enabled you can override
the value of the option like this:
```meson
executable('foo', 'foo.c', override_options : ['werror=false'])
```
Note that this does not affect project options, only those options
that come from Meson (language standards, unity builds etc).
## Compiler object get define
Compiler objects got a new method `get_define()` that returns the
given preprocessor symbol as a string.
```meson
cc = meson.get_compiler('c')
one = cc.get_define('__linux__') # returns '1' on Linux hosts
```
## Cygwin support
Meson now works under Cygwin and we have added it to our CI test
matrix.
## Multiple install directories
Custom targets can produce many output files. Previously it was only
possible to install all of them in the same directory, but now you can
install each output in its own directory like this:
```meson
custom_target('two_out',
output : ['diff.h', 'diff.sh'],
command : [creator, '@OUTDIR@'],
install : true,
install_dir : ['dir1', 'dir2'])
```
For backwards compatibility and for conciseness, if you only specify
one directory all outputs will be installed into it.
The same feature is also available for Vala build targets. For
instance, to install a shared library built by valac, the generated
header, and the generated VAPI (respectively) into the default
locations, you can do:
```meson
shared_library('valalib', 'mylib.vala',
install : true,
install_dir : [true, true, true])
```
To install any of the three in a custom directory, just pass it as a
string instead of `true`. To not install it, pass `false`. You can
also pass a single string (as before) and it will cause only the
library to be installed, so this is a backwards-compatible change.
## Can specify method of obtaining dependencies
Some dependencies have many ways of being provided. As an example Qt
can either be detected via `pkg-config` or `qmake`. Until now Meson
has had a heuristic for selecting which method to choose but sometimes
it does the wrong thing. This can now be overridden with the `method`
keyword like this:
```meson
qt5_dep = dependency('qt5', modules : 'core', method : 'qmake')
```
## Link whole contents of static libraries
The default behavior of static libraries is to discard all symbols
that are not not directly referenced. This may lead to exported
symbols being lost. Most compilers support "whole archive" linking
that includes all symbols and code of a given static library. This is
exposed with the `link_whole` keyword.
```meson
shared_library('foo', 'foo.c', link_whole : some_static_library)
```
Note that Visual Studio compilers only support this functionality on
VS 2015 and newer.
## Unity builds only for subprojects
Up until now unity builds were either done for every target or none of
them. Now unity builds can be specified to be enabled only for
subprojects, which change seldom, and not for the master project,
which changes a lot. This is enabled by setting the `unity` option to
`subprojects`.
## Running `mesonintrospect` from scripts
Meson now sets the `MESONINTROSPECT` environment variable in addition
to `MESON_SOURCE_ROOT` and other variables when running scripts. It is
guaranteed to point to the correct `mesonintrospect` script, which is
important when running Meson uninstalled from git or when your `PATH`s
may not be set up correctly.
Specifically, the following Meson functions will set it:
`meson.add_install_script()`, `meson.add_postconf_script()`,
`run_command()`, `run_target()`.
| mesonbuild/meson | docs/markdown/Release-notes-for-0.40.0.md | Markdown | apache-2.0 | 5,072 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>Uses of Class org.myrobotlab.service.GUIDynamic</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.myrobotlab.service.GUIDynamic";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../org/myrobotlab/service/GUIDynamic.html" title="class in org.myrobotlab.service">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/myrobotlab/service/class-use/GUIDynamic.html" target="_top">Frames</a></li>
<li><a href="GUIDynamic.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.myrobotlab.service.GUIDynamic" class="title">Uses of Class<br>org.myrobotlab.service.GUIDynamic</h2>
</div>
<div class="classUseContainer">No usage of org.myrobotlab.service.GUIDynamic</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../org/myrobotlab/service/GUIDynamic.html" title="class in org.myrobotlab.service">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/myrobotlab/service/class-use/GUIDynamic.html" target="_top">Frames</a></li>
<li><a href="GUIDynamic.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| lanchun/myrobotlab | javadoc/org/myrobotlab/service/class-use/GUIDynamic.html | HTML | apache-2.0 | 3,942 |
---
layout: post
title: Tracing our path to production
status: public
type: post
published: true
author: Scott Turnquest
---
Ever since the Mingle team started working on its new cloud offering we made a conscious effort to improve our ability to continuously deliver valuable features and enhancements to our production environment. I expected that frequent deployments, tons of automation and lots of learning about Amazon’s AWS would come with the territory - and it did. What I didn’t expect was that I’d end up asking and answering so many questions dealing with when feature X or bug fix Y would be ready for testing and when it would be ready to be promoted to production.
With a traditional release structure all features and bug fixes are released at once, so it is an easy task to determine which features and bug fixes would be released. When we moved to a schedule that pushed new features and bug fixes into our cloud environment as soon as they were ready, we found ourselves with a new crop of questions on our hands.
###Tracing features and bugs through a non-trivial build setup was not as easy as it should be
>What features and bugs will be in tonight's deployment to production?
>When can we start to dogfood this new feature in our staging environment?
>That bug fix we put in, where is that in our pipelines?
>Are we going to start testing it today?
I find myself answering or asking some variant of the questions above multiple times a day. Either because I’m eager to start testing a new fix, or because I want to help set our product managers expectations properly, or because we want to know when a customer will be happy because we’ve responded to their feedback, or... you get the idea.
We have multiple pipelines in our path to production. For legacy reasons we have pipelines that run tests using different browsers, databases and operating systems. We also run upgrade tests and performance tests at different frequencies based on need. Since we have a number of pipelines chained together it isn't always easy to know where a given change is in our deployment process. Consequently, it is difficult to answer questions about what features are in a given build or when a bug fix will be available for testing.
###Go’s value stream mapping feature
To answer each of the above questions, we now refer a lot to the new value stream mapping feature in Go. From any build we can now zoom in to find upstream and downstream pipelines and basically trace a single revision all the way through to production. Below is an example of the overview for a recent build that we are waiting to see promoted to our staging environment (called pasty).
<img style="width:100%" src="/images/blog/tracingprod1.png" alt="">
The map above shows the key pipelines involved in the flow from our tests using Firefox and Oracle 11g all the way through to testing our hosting environment. Once the ‘mingle-saas’ pipeline is green I know that the targeted bug fix will be ready for deployment to our dogfooding environment (called ‘pasty’).
###Seeing the big picture improves understanding
To answer our key questions easily we needed a big picture view of our pipelines. We needed to know more about our pipeline dependencies and where are artifacts are flowing. These days I find myself using the value stream map multiple times a day and I use it in conjunction with our card wall to drive conversations with our product manager around which new features and bug fixes will be included in the next deployment and when that deployment is likely to be done.
One added benefit we’ve gained from the value stream map is that I now have a much better understanding of the different pieces of our deployment process. This has definitely helped in conversations with the developers:
>Developer: “We just have to wait for the GreenInstallers build to pass...”
>
>Me: “GreenInstallers... ah yes I know exactly where that fits in the overall process so I have a good idea about when that build will be ready. Thanks.”
I think it’s safe to say that the new value stream map is my new favorite feature in Go.
<div class="highlight">This post is also cross-posted <a href="http://www.thoughtworks.com/insights/blog/tracing-our-path-production">here</a>.</div>
| jmnarloch/gocd.github.io | _posts/2014-02-24-tracing-our-path-production.markdown | Markdown | apache-2.0 | 4,310 |
# 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.
import json
import logging
import django
from django.conf import settings
from django.utils import html
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.debug import sensitive_variables # noqa
from oslo_utils import strutils
import six
from horizon import exceptions
from horizon import forms
from horizon import messages
from openstack_dashboard import api
from openstack_dashboard.dashboards.project.images \
import utils as image_utils
from openstack_dashboard.dashboards.project.instances \
import utils as instance_utils
LOG = logging.getLogger(__name__)
def create_upload_form_attributes(prefix, input_type, name):
"""Creates attribute dicts for the switchable upload form
:type prefix: str
:param prefix: prefix (environment, template) of field
:type input_type: str
:param input_type: field type (file, raw, url)
:type name: str
:param name: translated text label to display to user
:rtype: dict
:return: an attribute set to pass to form build
"""
attributes = {'class': 'switched', 'data-switch-on': prefix + 'source'}
attributes['data-' + prefix + 'source-' + input_type] = name
return attributes
class TemplateForm(forms.SelfHandlingForm):
class Meta(object):
name = _('Select Template')
help_text = _('Select a template to launch a stack.')
# TODO(jomara) - update URL choice for template & environment files
# w/ client side download when applicable
base_choices = [('file', _('File')),
('raw', _('Direct Input'))]
url_choice = [('url', _('URL'))]
attributes = {'class': 'switchable', 'data-slug': 'templatesource'}
template_source = forms.ChoiceField(label=_('Template Source'),
choices=base_choices + url_choice,
widget=forms.Select(attrs=attributes))
attributes = create_upload_form_attributes(
'template',
'file',
_('Template File'))
template_upload = forms.FileField(
label=_('Template File'),
help_text=_('A local template to upload.'),
widget=forms.FileInput(attrs=attributes),
required=False)
attributes = create_upload_form_attributes(
'template',
'url',
_('Template URL'))
template_url = forms.URLField(
label=_('Template URL'),
help_text=_('An external (HTTP) URL to load the template from.'),
widget=forms.TextInput(attrs=attributes),
required=False)
attributes = create_upload_form_attributes(
'template',
'raw',
_('Template Data'))
template_data = forms.CharField(
label=_('Template Data'),
help_text=_('The raw contents of the template.'),
widget=forms.widgets.Textarea(attrs=attributes),
required=False)
attributes = {'data-slug': 'envsource', 'class': 'switchable'}
environment_source = forms.ChoiceField(
label=_('Environment Source'),
choices=base_choices,
widget=forms.Select(attrs=attributes),
required=False)
attributes = create_upload_form_attributes(
'env',
'file',
_('Environment File'))
environment_upload = forms.FileField(
label=_('Environment File'),
help_text=_('A local environment to upload.'),
widget=forms.FileInput(attrs=attributes),
required=False)
attributes = create_upload_form_attributes(
'env',
'raw',
_('Environment Data'))
environment_data = forms.CharField(
label=_('Environment Data'),
help_text=_('The raw contents of the environment file.'),
widget=forms.widgets.Textarea(attrs=attributes),
required=False)
if django.VERSION >= (1, 9):
# Note(Itxaka): On django>=1.9 Charfield has an strip option that
# we need to set to False as to not hit
# https://bugs.launchpad.net/python-heatclient/+bug/1546166
environment_data.strip = False
template_data.strip = False
def __init__(self, *args, **kwargs):
self.next_view = kwargs.pop('next_view')
super(TemplateForm, self).__init__(*args, **kwargs)
def clean(self):
cleaned = super(TemplateForm, self).clean()
files = self.request.FILES
self.clean_uploaded_files('template', _('template'), cleaned, files)
self.clean_uploaded_files('environment', _('environment'), cleaned,
files)
# Validate the template and get back the params.
kwargs = {}
if cleaned['environment_data']:
kwargs['environment'] = cleaned['environment_data']
try:
files, tpl =\
api.heat.get_template_files(cleaned.get('template_data'),
cleaned.get('template_url'))
kwargs['files'] = files
kwargs['template'] = tpl
validated = api.heat.template_validate(self.request, **kwargs)
cleaned['template_validate'] = validated
cleaned['template_validate']['files'] = files
cleaned['template_validate']['template'] = tpl
except Exception as e:
raise forms.ValidationError(six.text_type(e))
return cleaned
def clean_uploaded_files(self, prefix, field_label, cleaned, files):
"""Cleans Template & Environment data from form upload.
Does some of the crunchy bits for processing uploads vs raw
data depending on what the user specified. Identical process
for environment data & template data.
:type prefix: str
:param prefix: prefix (environment, template) of field
:type field_label: str
:param field_label: translated prefix str for messages
:type input_type: dict
:param prefix: existing cleaned fields from form
:rtype: dict
:return: cleaned dict including environment & template data
"""
upload_str = prefix + "_upload"
data_str = prefix + "_data"
url = cleaned.get(prefix + '_url')
data = cleaned.get(prefix + '_data')
has_upload = upload_str in files
# Uploaded file handler
if has_upload and not url:
log_template_name = files[upload_str].name
LOG.info('got upload %s' % log_template_name)
tpl = files[upload_str].read()
if tpl.startswith('{'):
try:
json.loads(tpl)
except Exception as e:
msg = _('There was a problem parsing the'
' %(prefix)s: %(error)s')
msg = msg % {'prefix': prefix, 'error': six.text_type(e)}
raise forms.ValidationError(msg)
cleaned[data_str] = tpl
# URL handler
elif url and (has_upload or data):
msg = _('Please specify a %s using only one source method.')
msg = msg % field_label
raise forms.ValidationError(msg)
elif prefix == 'template':
# Check for raw template input - blank environment allowed
if not url and not data:
msg = _('You must specify a template via one of the '
'available sources.')
raise forms.ValidationError(msg)
def create_kwargs(self, data):
kwargs = {'parameters': data['template_validate'],
'environment_data': data['environment_data']}
if data.get('stack_id'):
kwargs['stack_id'] = data['stack_id']
return kwargs
def handle(self, request, data):
kwargs = self.create_kwargs(data)
# NOTE (gabriel): This is a bit of a hack, essentially rewriting this
# request so that we can chain it as an input to the next view...
# but hey, it totally works.
request.method = 'GET'
return self.next_view.as_view()(request, **kwargs)
class ChangeTemplateForm(TemplateForm):
class Meta(object):
name = _('Edit Template')
help_text = _('Select a new template to re-launch a stack.')
stack_id = forms.CharField(label=_('Stack ID'),
widget=forms.widgets.HiddenInput)
stack_name = forms.CharField(label=_('Stack Name'),
widget=forms.TextInput(attrs={'readonly':
'readonly'}))
class PreviewTemplateForm(TemplateForm):
class Meta(object):
name = _('Preview Template')
help_text = _('Select a new template to preview a stack.')
class CreateStackForm(forms.SelfHandlingForm):
param_prefix = '__param_'
class Meta(object):
name = _('Create Stack')
environment_data = forms.CharField(
widget=forms.widgets.HiddenInput,
required=False)
if django.VERSION >= (1, 9):
# Note(Itxaka): On django>=1.9 Charfield has an strip option that
# we need to set to False as to not hit
# https://bugs.launchpad.net/python-heatclient/+bug/1546166
environment_data.strip = False
parameters = forms.CharField(
widget=forms.widgets.HiddenInput)
stack_name = forms.RegexField(
max_length=255,
label=_('Stack Name'),
help_text=_('Name of the stack to create.'),
regex=r"^[a-zA-Z][a-zA-Z0-9_.-]*$",
error_messages={'invalid':
_('Name must start with a letter and may '
'only contain letters, numbers, underscores, '
'periods and hyphens.')})
timeout_mins = forms.IntegerField(
initial=60,
label=_('Creation Timeout (minutes)'),
help_text=_('Stack creation timeout in minutes.'))
enable_rollback = forms.BooleanField(
label=_('Rollback On Failure'),
help_text=_('Enable rollback on create/update failure.'),
required=False)
def __init__(self, *args, **kwargs):
parameters = kwargs.pop('parameters')
# special case: load template data from API, not passed in params
if kwargs.get('validate_me'):
parameters = kwargs.pop('validate_me')
super(CreateStackForm, self).__init__(*args, **kwargs)
if self._stack_password_enabled():
self.fields['password'] = forms.CharField(
label=_('Password for user "%s"') % self.request.user.username,
help_text=_('This is required for operations to be performed '
'throughout the lifecycle of the stack'),
widget=forms.PasswordInput())
self._build_parameter_fields(parameters)
def _stack_password_enabled(self):
stack_settings = getattr(settings, 'OPENSTACK_HEAT_STACK', {})
return stack_settings.get('enable_user_pass', True)
def _build_parameter_fields(self, template_validate):
self.help_text = template_validate['Description']
params = template_validate.get('Parameters', {})
if template_validate.get('ParameterGroups'):
params_in_order = []
for group in template_validate['ParameterGroups']:
for param in group.get('parameters', []):
if param in params:
params_in_order.append((param, params[param]))
else:
# no parameter groups, simply sorted to make the order fixed
params_in_order = sorted(params.items())
for param_key, param in params_in_order:
field = None
field_key = self.param_prefix + param_key
field_args = {
'initial': param.get('Default', None),
'label': param.get('Label', param_key),
'help_text': html.escape(param.get('Description', '')),
'required': param.get('Default', None) is None
}
param_type = param.get('Type', None)
hidden = strutils.bool_from_string(param.get('NoEcho', 'false'))
if 'CustomConstraint' in param:
choices = self._populate_custom_choices(
param['CustomConstraint'])
field_args['choices'] = choices
field = forms.ChoiceField(**field_args)
elif 'AllowedValues' in param:
choices = map(lambda x: (x, x), param['AllowedValues'])
field_args['choices'] = choices
field = forms.ChoiceField(**field_args)
elif param_type == 'Json' and 'Default' in param:
field_args['initial'] = json.dumps(param['Default'])
field = forms.CharField(**field_args)
elif param_type in ('CommaDelimitedList', 'String', 'Json'):
if 'MinLength' in param:
field_args['min_length'] = int(param['MinLength'])
field_args['required'] = field_args['min_length'] > 0
if 'MaxLength' in param:
field_args['max_length'] = int(param['MaxLength'])
if hidden:
field_args['widget'] = forms.PasswordInput(
render_value=True)
field = forms.CharField(**field_args)
elif param_type == 'Number':
if 'MinValue' in param:
field_args['min_value'] = int(param['MinValue'])
if 'MaxValue' in param:
field_args['max_value'] = int(param['MaxValue'])
field = forms.IntegerField(**field_args)
# heat-api currently returns the boolean type in lowercase
# (see https://bugs.launchpad.net/heat/+bug/1361448)
# so for better compatibility both are checked here
elif param_type in ('Boolean', 'boolean'):
field_args['required'] = False
field = forms.BooleanField(**field_args)
if field:
self.fields[field_key] = field
@sensitive_variables('password')
def handle(self, request, data):
prefix_length = len(self.param_prefix)
params_list = [(k[prefix_length:], v) for (k, v) in six.iteritems(data)
if k.startswith(self.param_prefix)]
fields = {
'stack_name': data.get('stack_name'),
'timeout_mins': data.get('timeout_mins'),
'disable_rollback': not(data.get('enable_rollback')),
'parameters': dict(params_list),
'files': json.loads(data.get('parameters')).get('files'),
'template': json.loads(data.get('parameters')).get('template')
}
if data.get('password'):
fields['password'] = data.get('password')
if data.get('environment_data'):
fields['environment'] = data.get('environment_data')
try:
api.heat.stack_create(self.request, **fields)
messages.info(request, _("Stack creation started."))
return True
except Exception:
exceptions.handle(request)
def _populate_custom_choices(self, custom_type):
if custom_type == 'neutron.network':
return instance_utils.network_field_data(self.request, True)
if custom_type == 'nova.keypair':
return instance_utils.keypair_field_data(self.request, True)
if custom_type == 'glance.image':
return image_utils.image_field_data(self.request, True)
if custom_type == 'nova.flavor':
return instance_utils.flavor_field_data(self.request, True)
return []
class EditStackForm(CreateStackForm):
class Meta(object):
name = _('Update Stack Parameters')
stack_id = forms.CharField(
label=_('Stack ID'),
widget=forms.widgets.HiddenInput)
stack_name = forms.CharField(
label=_('Stack Name'),
widget=forms.TextInput(attrs={'readonly': 'readonly'}))
@sensitive_variables('password')
def handle(self, request, data):
prefix_length = len(self.param_prefix)
params_list = [(k[prefix_length:], v) for (k, v) in six.iteritems(data)
if k.startswith(self.param_prefix)]
stack_id = data.get('stack_id')
fields = {
'stack_name': data.get('stack_name'),
'timeout_mins': data.get('timeout_mins'),
'disable_rollback': not(data.get('enable_rollback')),
'parameters': dict(params_list),
'files': json.loads(data.get('parameters')).get('files'),
'template': json.loads(data.get('parameters')).get('template')
}
if data.get('password'):
fields['password'] = data.get('password')
if data.get('environment_data'):
fields['environment'] = data.get('environment_data')
try:
api.heat.stack_update(self.request, stack_id=stack_id, **fields)
messages.info(request, _("Stack update started."))
return True
except Exception:
exceptions.handle(request)
class PreviewStackForm(CreateStackForm):
class Meta(object):
name = _('Preview Stack Parameters')
def __init__(self, *args, **kwargs):
self.next_view = kwargs.pop('next_view')
super(CreateStackForm, self).__init__(*args, **kwargs)
def handle(self, request, data):
prefix_length = len(self.param_prefix)
params_list = [(k[prefix_length:], v) for (k, v) in six.iteritems(data)
if k.startswith(self.param_prefix)]
fields = {
'stack_name': data.get('stack_name'),
'timeout_mins': data.get('timeout_mins'),
'disable_rollback': not(data.get('enable_rollback')),
'parameters': dict(params_list),
'files': json.loads(data.get('parameters')).get('files'),
'template': json.loads(data.get('parameters')).get('template')
}
if data.get('environment_data'):
fields['environment'] = data.get('environment_data')
try:
stack_preview = api.heat.stack_preview(self.request, **fields)
request.method = 'GET'
return self.next_view.as_view()(request,
stack_preview=stack_preview)
except Exception:
exceptions.handle(request)
| bigswitch/horizon | openstack_dashboard/dashboards/project/stacks/forms.py | Python | apache-2.0 | 18,998 |
$packageName = 'aida64-extreme'
$installerType = 'EXE'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$validExitCodes = @(0) #please insert other valid exit codes here, exit codes for ms http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx
try {
$processor = Get-WmiObject Win32_Processor
$is64bit = $processor.AddressWidth -eq 64
if ($is64bit) {
$unpath = "${Env:ProgramFiles(x86)}\FinalWire\AIDA64 Extreme Edition\unins000.exe"
} else {
$unpath = "$Env:ProgramFiles\FinalWire\AIDA64 Extreme Edition\unins000.exe"
}
Uninstall-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$unpath" -validExitCodes $validExitCodes
# the following is all part of error handling
Write-ChocolateySuccess "$packageName"
} catch {
Write-ChocolateyFailure "$packageName" "$($_.Exception.Message)"
throw
}
| dtgm/chocolatey-packages | automatic/_output/aida64-extreme/4.60.3100/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 857 |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct template def_del_compatible_cond</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../move/reference.html#header.boost.move.default_delete_hpp" title="Header <boost/move/default_delete.hpp>">
<link rel="prev" href="../../BOOST_MOVE_RET.html" title="Macro BOOST_MOVE_RET">
<link rel="next" href="enable_def_del.html" title="Struct template enable_def_del">
</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="../../BOOST_MOVE_RET.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../move/reference.html#header.boost.move.default_delete_hpp"><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="enable_def_del.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.move_upd.def_del_compatible_cond"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template def_del_compatible_cond</span></h2>
<p>boost::move_upd::def_del_compatible_cond</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../move/reference.html#header.boost.move.default_delete_hpp" title="Header <boost/move/default_delete.hpp>">boost/move/default_delete.hpp</a>>
</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> U<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">></span>
<span class="keyword">struct</span> <a class="link" href="def_del_compatible_cond.html" title="Struct template def_del_compatible_cond">def_del_compatible_cond</a> <span class="special">:</span>
<span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_upmu</span><span class="special">::</span><span class="identifier">is_convertible</span><span class="special"><</span> <span class="identifier">U</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">T</span> <span class="special">*</span> <span class="special">></span>
<span class="special">{</span>
<span class="special">}</span><span class="special">;</span></pre></div>
</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 © 2008-2014 Ion Gaztanaga<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="../../BOOST_MOVE_RET.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../move/reference.html#header.boost.move.default_delete_hpp"><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="enable_def_del.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| biospi/seamass-windeps | src/boost_1_57_0/doc/html/boost/move_upd/def_del_compatible_cond.html | HTML | apache-2.0 | 4,518 |
/*
* Copyright 2015 JBoss, by Red Hat, Inc
*
* 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 org.uberfire.ext.wires.core.client.canvas;
import com.ait.lienzo.client.widget.LienzoPanel;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.DomEvent;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseWheelEvent;
import com.google.gwt.event.dom.client.MouseWheelHandler;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
/**
* LienzoPanel that can take the Focus (and more importantly cause other Widgets to loose the Focus)
*/
public class FocusableLienzoPanel extends LienzoPanel {
public FocusableLienzoPanel(final int width,
final int height) {
super(width,
height);
//Basic support to loose focus on other Widgets when a WiresCanvas is clicked
addMouseDownHandler(new MouseDownHandler() {
@Override
public void onMouseDown(final MouseDownEvent event) {
broadcastBlurEvent();
}
});
addMouseWheelHandler(new MouseWheelHandler() {
@Override
public void onMouseWheel(final MouseWheelEvent event) {
broadcastBlurEvent();
}
});
}
protected void broadcastBlurEvent() {
final NativeEvent blur = Document.get().createBlurEvent();
for (int i = 0; i < RootPanel.get().getWidgetCount(); i++) {
final Widget w = RootPanel.get().getWidget(i);
DomEvent.fireNativeEvent(blur,
w);
}
}
}
| karreiro/uberfire | uberfire-extensions/uberfire-wires/uberfire-wires-core/uberfire-wires-core-client/src/main/java/org/uberfire/ext/wires/core/client/canvas/FocusableLienzoPanel.java | Java | apache-2.0 | 2,325 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.