code
stringlengths 4
1.01M
| language
stringclasses 2
values |
|---|---|
---
layout: post
title: 桶排序-OC
---
```objective-c
NSArray * b = @[@5,@2,@3,@1,@8];
NSMutableArray *a = @[].mutableCopy;
for (int i=0; i<11; i++) {
a[i] = @0;
}
for (NSNumber *num in b) {
int index = [num intValue];
if(a[index]){
a[index] = @([a[index] intValue] + 1);
} else {
a[index] = @0;
}
}
for (int i = 0; i<a.count; i++) {
if([a[i] intValue]>0){
NSLog(@"%d",i);
}
}
```
|
Java
|
package jenkins.plugins.hygieia;
public class DefaultHygieiaServiceStub extends DefaultHygieiaService {
// private HttpClientStub httpClientStub;
public DefaultHygieiaServiceStub(String host, String token, String name) {
super(host, token, name);
}
// @Override
// public HttpClientStub getHttpClient() {
// return httpClientStub;
// }
// public void setHttpClient(HttpClientStub httpClientStub) {
// this.httpClientStub = httpClientStub;
// }
}
|
Java
|
# Zwackhiomyces dispersus (J. Lahm ex Körb.) Triebel & Grube SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
in Grube & Hafellner, Nova Hedwigia 51(3-4): 314 (1990)
#### Original name
Arthopyrenia dispersa J. Lahm ex Körb.
### Remarks
null
|
Java
|
package cn.aezo.demo.rabbitmq.c05_model_topic;
import cn.aezo.demo.rabbitmq.util.RabbitmqU;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope;
import java.io.IOException;
/**
* 测试 topic 类型消息模型
*
* 结果如下:
* consumer1收到消息:[aezo.order.vip] 这是 0 条消息
* consumer2收到消息:[smalle.vip] 这是 2 条消息
* consumer1收到消息:[aezo.user] 这是 1 条消息
* consumer1收到消息:[smalle.vip] 这是 2 条消息
* consumer1收到消息:[aezo.order.vip] 这是 3 条消息
* consumer1收到消息:[aezo.user] 这是 4 条消息
*
* @author smalle
* @date 2020-08-29 16:31
*/
public class Consumer {
private static final String EXCHANGE_NAME = "topic_logs";
public static void main(String[] args) throws IOException {
consumer1();
consumer2();
}
public static void consumer1() throws IOException {
Connection connection = RabbitmqU.getConnection();
Channel channel = connection.createChannel();
channel.exchangeDeclare(EXCHANGE_NAME, "topic");
// 获取一个临时队列。管理后台的Queues-Features会增加"AD"(autoDelete)和"Excl"(exclusive)标识
String queueName = channel.queueDeclare().getQueue();
// **将临时队列和交换机绑定,并订阅某些类型的消息**
channel.queueBind(queueName, EXCHANGE_NAME, "aezo.#"); // *匹配一个单词,#匹配多个单词
channel.queueBind(queueName, EXCHANGE_NAME, "*.vip");
channel.basicConsume(queueName, true, new DefaultConsumer(channel) {
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
System.out.println("consumer1收到消息:" + new String(body, "UTF-8"));
}
});
}
public static void consumer2() throws IOException {
Connection connection = RabbitmqU.getConnection();
Channel channel = connection.createChannel();
channel.exchangeDeclare(EXCHANGE_NAME, "topic");
String queueName = channel.queueDeclare().getQueue();
// * 表示一个单词。此时无法匹配 aezo.order.vip 和 aezo.vip.hello 等
channel.queueBind(queueName, EXCHANGE_NAME, "*.vip");
channel.basicConsume(queueName, true, new DefaultConsumer(channel) {
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
System.out.println("consumer2收到消息:" + new String(body, "UTF-8"));
}
});
}
}
|
Java
|
# AUTOGENERATED FILE
FROM balenalib/aarch64-debian:stretch-run
ENV NODE_VERSION 10.23.1
ENV YARN_VERSION 1.22.4
RUN buildDeps='curl libatomic1' \
&& set -x \
&& for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
done \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-arm64.tar.gz" \
&& echo "e7d0476b1e9add7b21297698517356bb7c7d7f10e75f5abad6ab5806518a6cd6 node-v$NODE_VERSION-linux-arm64.tar.gz" | sha256sum -c - \
&& tar -xzf "node-v$NODE_VERSION-linux-arm64.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-arm64.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& mkdir -p /opt/yarn \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& npm config set unsafe-perm true -g --unsafe-perm \
&& rm -rf /tmp/*
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \
&& echo "Running test-stack@node" \
&& chmod +x test-stack@node.sh \
&& bash test-stack@node.sh \
&& rm -rf test-stack@node.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Debian Stretch \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v10.23.1, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh
|
Java
|
# AUTOGENERATED FILE
FROM balenalib/qemux86-debian:buster-run
ENV GO_VERSION 1.15.8
# gcc for cgo
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
pkg-config \
git \
&& rm -rf /var/lib/apt/lists/*
RUN set -x \
&& fetchDeps=' \
curl \
' \
&& apt-get update && apt-get install -y $fetchDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/local/go \
&& curl -SLO "https://storage.googleapis.com/golang/go$GO_VERSION.linux-386.tar.gz" \
&& echo "a0cc9df6d04f89af8396278d171087894a453a03a950b0f60a4ac18b480f758f go$GO_VERSION.linux-386.tar.gz" | sha256sum -c - \
&& tar -xzf "go$GO_VERSION.linux-386.tar.gz" -C /usr/local/go --strip-components=1 \
&& rm -f go$GO_VERSION.linux-386.tar.gz
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@golang.sh" \
&& echo "Running test-stack@golang" \
&& chmod +x test-stack@golang.sh \
&& bash test-stack@golang.sh \
&& rm -rf test-stack@golang.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: Intel 32-bit (x86) \nOS: Debian Buster \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.15.8 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh
|
Java
|
<?php
include("config.php");
$content = file_get_contents($data_munched);
$data = json_decode($content, true);
function sort_by_order ($a, $b)
{
return $b['amount']['total'] - $a['amount']['total'];
}
usort($data["exchanges"], 'sort_by_order');
print_r($data);
?>
|
Java
|
@import url('/static/libs/alice/poptip/1.2.0/poptip.css');
.poptip {
top: 0;
left: 0;
}
|
Java
|
class GetSharedLinkAccessRightsResult
attr_accessor :access_rights
# :internal => :external
def self.attribute_map
{
:access_rights => :accessRights
}
end
def initialize(attributes = {})
# Morph attribute keys into undescored rubyish style
if attributes.to_s != ""
if GetSharedLinkAccessRightsResult.attribute_map["access_rights".to_sym] != nil
name = "access_rights".to_sym
value = attributes["accessRights"]
send("#{name}=", value) if self.respond_to?(name)
end
end
end
def to_body
body = {}
GetSharedLinkAccessRightsResult.attribute_map.each_pair do |key,value|
body[value] = self.send(key) unless self.send(key).nil?
end
body
end
end
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Mon Sep 30 21:58:47 GMT-05:00 2002 -->
<TITLE>
Index ()
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="Index ()";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="index-all.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT>
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<A HREF="#_A_">A</A> <A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_I_">I</A> <A HREF="#_L_">L</A> <A HREF="#_M_">M</A> <A HREF="#_N_">N</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A> <HR>
<A NAME="_A_"><!-- --></A><H2>
<B>A</B></H2>
<DL>
<DT><A HREF="com/jamonapi/AccumulateMonitor.html"><B>AccumulateMonitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>.<DD>AccumulateMonitors represent Monitors that increase in value.<DT><A HREF="com/jamonapi/AccumulateMonitor.html#AccumulateMonitor()"><B>AccumulateMonitor()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Default constructor.
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#AccumulateMonitor(com.jamonapi.AccumulateMonitorInterface)"><B>AccumulateMonitor(AccumulateMonitorInterface)</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Monitors use the Gang of 4 decorator pattern where each monitor points to and calls the next monitor in the chain.
<DT><A HREF="com/jamonapi/AccumulateMonitorInterface.html"><B>AccumulateMonitorInterface</B></A> - interface com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitorInterface.html">AccumulateMonitorInterface</A>.<DD>This is very similar to the Monitor interface.<DT><A HREF="com/jamonapi/ActiveStatsMonitor.html"><B>ActiveStatsMonitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/ActiveStatsMonitor.html">ActiveStatsMonitor</A>.<DD>Tracks statistics for Monitors that are currently running.<DT><A HREF="com/jamonapi/ActiveStatsMonitor.html#ActiveStatsMonitor()"><B>ActiveStatsMonitor()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/ActiveStatsMonitor.html">ActiveStatsMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/ActiveStatsMonitor.html#ActiveStatsMonitor(com.jamonapi.AccumulateMonitorInterface)"><B>ActiveStatsMonitor(AccumulateMonitorInterface)</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/ActiveStatsMonitor.html">ActiveStatsMonitor</A>
<DD>Constructor that uses the Gang Of 4's decorator pattern.
<DT><A HREF="com/jamonapi/MonitorComposite.html#addCompositeNode(java.lang.String, com.jamonapi.utils.CompositeNode)"><B>addCompositeNode(String, CompositeNode)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Add a CompositeNode to the data structure if it doesn't exist.
<DT><A HREF="com/jamonapi/utils/CompositeNode.html#addCompositeNode(java.lang.String, com.jamonapi.utils.CompositeNode)"><B>addCompositeNode(String, CompositeNode)</B></A> -
Method in interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/CompositeNode.html">CompositeNode</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorComposite.html#addLeafNode(java.lang.String, com.jamonapi.utils.LeafNode)"><B>addLeafNode(String, LeafNode)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Add a LeafNode to the data structure if it doesn't exist.
<DT><A HREF="com/jamonapi/utils/CompositeNode.html#addLeafNode(java.lang.String, com.jamonapi.utils.LeafNode)"><B>addLeafNode(String, LeafNode)</B></A> -
Method in interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/CompositeNode.html">CompositeNode</A>
<DD>
<DT><A HREF="com/jamonapi/utils/AppBaseException.html"><B>AppBaseException</B></A> - exception com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppBaseException.html">AppBaseException</A>.<DD> <DT><A HREF="com/jamonapi/utils/AppBaseException.html#AppBaseException()"><B>AppBaseException()</B></A> -
Constructor for class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppBaseException.html">AppBaseException</A>
<DD>
<DT><A HREF="com/jamonapi/utils/AppBaseException.html#AppBaseException(java.lang.String)"><B>AppBaseException(String)</B></A> -
Constructor for class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppBaseException.html">AppBaseException</A>
<DD>
<DT><A HREF="com/jamonapi/utils/AppBaseException.html#AppBaseException(java.lang.String, java.lang.String)"><B>AppBaseException(String, String)</B></A> -
Constructor for class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppBaseException.html">AppBaseException</A>
<DD>
<DT><A HREF="com/jamonapi/utils/AppConstants.html"><B>AppConstants</B></A> - class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppConstants.html">AppConstants</A>.<DD> <DT><A HREF="com/jamonapi/utils/AppConstants.html#AppConstants()"><B>AppConstants()</B></A> -
Constructor for class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppConstants.html">AppConstants</A>
<DD>
<DT><A HREF="com/jamonapi/utils/AppMap.html"><B>AppMap</B></A> - class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppMap.html">AppMap</A>.<DD>Case Insensitive HashMap() - If the maps key is a string then the following keys are all considered equal:
myKey<br>
MYKEY<br>
MyKey<br>
...<DT><A HREF="com/jamonapi/utils/AppMap.html#AppMap()"><B>AppMap()</B></A> -
Constructor for class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppMap.html">AppMap</A>
<DD>
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html#arrayListToString(java.util.ArrayList)"><B>arrayListToString(ArrayList)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>
<DD>The following method converts an ArrayList, containing string arrays of ResultSet row data,
into a two dimensional string array.
</DL>
<HR>
<A NAME="_B_"><!-- --></A><H2>
<B>B</B></H2>
<DL>
<DT><A HREF="com/jamonapi/BaseMonitor.html"><B>BaseMonitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>.<DD>Abstract base class for other Monitors<DT><A HREF="com/jamonapi/BaseMonitor.html#BaseMonitor()"><B>BaseMonitor()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/BasicTimingMonitor.html"><B>BasicTimingMonitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/BasicTimingMonitor.html">BasicTimingMonitor</A>.<DD>The most basic of timing Monitors.<DT><A HREF="com/jamonapi/TestClassPerformance.html#basicTimingMonitor()"><B>basicTimingMonitor()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>
<DD>
<DT><A HREF="com/jamonapi/BasicTimingMonitor.html#BasicTimingMonitor()"><B>BasicTimingMonitor()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/BasicTimingMonitor.html">BasicTimingMonitor</A>
<DD>
</DL>
<HR>
<A NAME="_C_"><!-- --></A><H2>
<B>C</B></H2>
<DL>
<DT><A HREF="com/jamonapi/package-summary.html"><B>com.jamonapi</B></A> - package com.jamonapi<DD>This package contains classes and interfaces used to monitor Java applications.<DT><A HREF="com/jamonapi/utils/package-summary.html"><B>com.jamonapi.utils</B></A> - package com.jamonapi.utils<DD>This package contains utility classes used by the JAMon implementation that are of general use beyond JAMon.<DT><A HREF="com/jamonapi/utils/Command.html"><B>Command</B></A> - interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/Command.html">Command</A>.<DD>Simple interface that is used in the implementation of the Gang Of 4 Command pattern in Java.<DT><A HREF="com/jamonapi/utils/CommandIterator.html"><B>CommandIterator</B></A> - class com.jamonapi.utils.<A HREF="com/jamonapi/utils/CommandIterator.html">CommandIterator</A>.<DD>Used with the Command interface to implement the Gang of 4 Command pattern to execute some logic for
every entry of various iterators.<DT><A HREF="com/jamonapi/utils/CompositeNode.html"><B>CompositeNode</B></A> - interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/CompositeNode.html">CompositeNode</A>.<DD>A CompositeNode works with NodeTrees and LeafNodes to create heirarchical object trees.<DT><A HREF="com/jamonapi/MonitorComposite.html#compositeNodeExists(java.lang.String)"><B>compositeNodeExists(String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Does the passed in CompositeNode exist.
<DT><A HREF="com/jamonapi/utils/NodeTree.html#compositeNodeExists(java.lang.String)"><B>compositeNodeExists(String)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/NodeTree.html">NodeTree</A>
<DD>Determine if the CompositeNode represented by the locator string exists.
<DT><A HREF="com/jamonapi/utils/CompositeNode.html#compositeNodeExists(java.lang.String)"><B>compositeNodeExists(String)</B></A> -
Method in interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/CompositeNode.html">CompositeNode</A>
<DD>Returns true if the compositeNodeExists
<DT><A HREF="com/jamonapi/utils/AppMap.html#containsKey(java.lang.Object)"><B>containsKey(Object)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppMap.html">AppMap</A>
<DD>
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#createInstance()"><B>createInstance()</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html#createInstance()"><B>createInstance()</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>
<DD>
<DT><A HREF="com/jamonapi/utils/AppMap.html#createInstance()"><B>createInstance()</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppMap.html">AppMap</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorLeafFactoryInterface.html#createInstance(java.lang.String)"><B>createInstance(String)</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MonitorLeafFactoryInterface.html">MonitorLeafFactoryInterface</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorLeafFactory.html#createInstance(java.lang.String)"><B>createInstance(String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorLeafFactory.html">MonitorLeafFactory</A>
<DD>This is the method that creates monitors.
</DL>
<HR>
<A NAME="_D_"><!-- --></A><H2>
<B>D</B></H2>
<DL>
<DT><A HREF="com/jamonapi/TestClassPerformance.html#debugFactoryMonitor()"><B>debugFactoryMonitor()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorLeafFactory.html#DEFAULT"><B>DEFAULT</B></A> -
Static variable in class com.jamonapi.<A HREF="com/jamonapi/MonitorLeafFactory.html">MonitorLeafFactory</A>
<DD>
</DL>
<HR>
<A NAME="_E_"><!-- --></A><H2>
<B>E</B></H2>
<DL>
<DT><A HREF="com/jamonapi/utils/EnumIterator.html"><B>EnumIterator</B></A> - class com.jamonapi.utils.<A HREF="com/jamonapi/utils/EnumIterator.html">EnumIterator</A>.<DD>Simple Wrapper utility class that makes an Enumeration behave like an Iterator.<DT><A HREF="com/jamonapi/utils/EnumIterator.html#EnumIterator(java.util.Enumeration)"><B>EnumIterator(Enumeration)</B></A> -
Constructor for class com.jamonapi.utils.<A HREF="com/jamonapi/utils/EnumIterator.html">EnumIterator</A>
<DD>
<DT><A HREF="com/jamonapi/utils/Command.html#execute(java.lang.Object)"><B>execute(Object)</B></A> -
Method in interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/Command.html">Command</A>
<DD>
</DL>
<HR>
<A NAME="_F_"><!-- --></A><H2>
<B>F</B></H2>
<DL>
<DT><A HREF="com/jamonapi/TestClassPerformance.html#factoryBasicMonitor()"><B>factoryBasicMonitor()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>
<DD>
<DT><A HREF="com/jamonapi/TestClassPerformance.html#factoryMonitor()"><B>factoryMonitor()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>
<DD>
<DT><A HREF="com/jamonapi/utils/FileUtils.html"><B>FileUtils</B></A> - class com.jamonapi.utils.<A HREF="com/jamonapi/utils/FileUtils.html">FileUtils</A>.<DD>Reusable Utilities used for File manipulations such as reading a file as a String.<DT><A HREF="com/jamonapi/utils/FileUtils.html#FileUtils()"><B>FileUtils()</B></A> -
Constructor for class com.jamonapi.utils.<A HREF="com/jamonapi/utils/FileUtils.html">FileUtils</A>
<DD>
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html#fullResultSetToArrayList(java.util.ArrayList, java.sql.ResultSet)"><B>fullResultSetToArrayList(ArrayList, ResultSet)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>
<DD>The following method returns an ArrayList containing the ResultSet column names and data.
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html#fullResultSetToString(java.sql.ResultSet)"><B>fullResultSetToString(ResultSet)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>
<DD>The following method simply takes the ResultSet and converts it to a two dimensional
array of strings containing the column names and data using calls to
the resultSetToArrayList and arrayListToString methods.
</DL>
<HR>
<A NAME="_G_"><!-- --></A><H2>
<B>G</B></H2>
<DL>
<DT><A HREF="com/jamonapi/utils/AppMap.html#get(java.util.Map, java.lang.Object)"><B>get(Map, Object)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppMap.html">AppMap</A>
<DD>
<DT><A HREF="com/jamonapi/utils/AppMap.html#get(java.lang.Object)"><B>get(Object)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppMap.html">AppMap</A>
<DD>
<DT><A HREF="com/jamonapi/TimingMonitor.html#getAccrued()"><B>getAccrued()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>Returns the time that the Monitor has been running
<DT><A HREF="com/jamonapi/TimeStatsMonitor.html#getAccrued()"><B>getAccrued()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimeStatsMonitor.html">TimeStatsMonitor</A>
<DD>Returned the total accrued time for this monitor
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#getAccrued()"><B>getAccrued()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorComposite.html#getAccrued()"><B>getAccrued()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Returns the accrued value of all Monitors underneath this MonitorComposite.
<DT><A HREF="com/jamonapi/MinimalMonitor.html#getAccrued()"><B>getAccrued()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MinimalMonitor.html">MinimalMonitor</A>
<DD>Return the accrued value.
<DT><A HREF="com/jamonapi/BaseMonitor.html#getAccrued()"><B>getAccrued()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/ActiveStatsMonitor.html#getAccrued()"><B>getAccrued()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/ActiveStatsMonitor.html">ActiveStatsMonitor</A>
<DD>Return the number of Active Monitors of this instance
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#getAccrued()"><B>getAccrued()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Get the value of the monitor.
<DT><A HREF="com/jamonapi/MonitorComposite.html#getAccruedString()"><B>getAccruedString()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Return the accrued value in String format
<DT><A HREF="com/jamonapi/BaseMonitor.html#getAccruedString()"><B>getAccruedString()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#getAccruedString()"><B>getAccruedString()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Return the accrued value in String format
<DT><A HREF="com/jamonapi/utils/Misc.html#getClassName(java.lang.Object)"><B>getClassName(Object)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/Misc.html">Misc</A>
<DD>Returns an Objects ClassName minus the package name
Sample Call:
String className=Misc.getClassName("My Object"); // returns "String"
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html#getColumnNames(java.sql.ResultSetMetaData)"><B>getColumnNames(ResultSetMetaData)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>
<DD>The following method returns an array of strings containing the column names for
a given ResultSetMetaData object.
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html#getColumnNames(java.sql.ResultSetMetaData, int[])"><B>getColumnNames(ResultSetMetaData, int[])</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>
<DD>The following method returns an array of strings containing the column names for
a given ResultSetMetaData object.
<DT><A HREF="com/jamonapi/MonitorFactoryInterface.html#getComposite(java.lang.String)"><B>getComposite(String)</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MonitorFactoryInterface.html">MonitorFactoryInterface</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactory.html#getComposite(java.lang.String)"><B>getComposite(String)</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Returns the composite monitor specified in the argument.
<DT><A HREF="com/jamonapi/MonitorComposite.html#getCompositeNode(java.lang.String)"><B>getCompositeNode(String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>This is CompositeNode interface method that returns the child MonitorComposite identified by the given label or it creates a
new CompositeMonitor.
<DT><A HREF="com/jamonapi/utils/NodeTree.html#getCompositeNode(java.lang.String)"><B>getCompositeNode(String)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/NodeTree.html">NodeTree</A>
<DD>Return the NodeTree's CompositeNode object that is identified by the locator.
<DT><A HREF="com/jamonapi/utils/CompositeNode.html#getCompositeNode(java.lang.String)"><B>getCompositeNode(String)</B></A> -
Method in interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/CompositeNode.html">CompositeNode</A>
<DD>Return the composite node pointed to by the node name
<DT><A HREF="com/jamonapi/MonitorComposite.html#getCompositeNodeKey(java.lang.String)"><B>getCompositeNodeKey(String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>getCompositeNodeKey(...) and getLeafNodeKey(...) are used to ensure that composite nodes are not replaced by leaf nodes
and vice versa.
<DT><A HREF="com/jamonapi/utils/CompositeNode.html#getCompositeNodeKey(java.lang.String)"><B>getCompositeNodeKey(String)</B></A> -
Method in interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/CompositeNode.html">CompositeNode</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorReportInterface.html#getData()"><B>getData()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MonitorReportInterface.html">MonitorReportInterface</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorConverter.html#getData()"><B>getData()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorConverter.html">MonitorConverter</A>
<DD>end inner class MonitorReport
<DT><A HREF="com/jamonapi/MonitorComposite.html#getData()"><B>getData()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Return the contents of this MonitorComposite as a 2 dimensional array of Strings.
<DT><A HREF="com/jamonapi/TimingMonitor.html#getData(java.util.ArrayList)"><B>getData(ArrayList)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#getData(java.util.ArrayList)"><B>getData(ArrayList)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorComposite.html#getData(java.util.ArrayList)"><B>getData(ArrayList)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>
<DT><A HREF="com/jamonapi/MinimalMonitor.html#getData(java.util.ArrayList)"><B>getData(ArrayList)</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MinimalMonitor.html">MinimalMonitor</A>
<DD>Add this elements value to the ArrayList.
<DT><A HREF="com/jamonapi/BaseMonitor.html#getData(java.util.ArrayList)"><B>getData(ArrayList)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#getData(java.util.ArrayList)"><B>getData(ArrayList)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Populate the ArrayList with data from this Monitor as well as all other Monitors in the decorator chain
<DT><A HREF="com/jamonapi/MonitorReportInterface.html#getData(java.lang.String)"><B>getData(String)</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MonitorReportInterface.html">MonitorReportInterface</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorConverter.html#getData(java.lang.String)"><B>getData(String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorConverter.html">MonitorConverter</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorComposite.html#getData(java.lang.String)"><B>getData(String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Return the contents of this MonitorComposite as a 2 dimensional array of Strings.
<DT><A HREF="com/jamonapi/MonitorConverter.html#getData(java.lang.String, int, java.lang.String)"><B>getData(String, int, String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorConverter.html">MonitorConverter</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactory.html#getDebugFactory()"><B>getDebugFactory()</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Returns the factory for creating debug monitors.
<DT><A HREF="com/jamonapi/MonitorFactory.html#getDebugFactory(int)"><B>getDebugFactory(int)</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Returns the factory for creating debug monitors.
<DT><A HREF="com/jamonapi/utils/AppBaseException.html#getErrorIndicator()"><B>getErrorIndicator()</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppBaseException.html">AppBaseException</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorComposite.html#getExistingCompositeNode(java.lang.String)"><B>getExistingCompositeNode(String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Returns the CompositeNode if it exists.
<DT><A HREF="com/jamonapi/MonitorComposite.html#getExistingLeafNode(java.lang.String)"><B>getExistingLeafNode(String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Returns the LeafNode if it exists.
<DT><A HREF="com/jamonapi/utils/FileUtils.html#getFileContents(java.lang.String)"><B>getFileContents(String)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/FileUtils.html">FileUtils</A>
<DD>Read text files contents in as a String.
<DT><A HREF="com/jamonapi/MonitorLeafFactoryInterface.html#getHeader()"><B>getHeader()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MonitorLeafFactoryInterface.html">MonitorLeafFactoryInterface</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorLeafFactory.html#getHeader()"><B>getHeader()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorLeafFactory.html">MonitorLeafFactory</A>
<DD>Get the header used in the monitor html report.
<DT><A HREF="com/jamonapi/TimingMonitor.html#getHeader(java.util.ArrayList)"><B>getHeader(ArrayList)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#getHeader(java.util.ArrayList)"><B>getHeader(ArrayList)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorComposite.html#getHeader(java.util.ArrayList)"><B>getHeader(ArrayList)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>
<DT><A HREF="com/jamonapi/MinimalMonitor.html#getHeader(java.util.ArrayList)"><B>getHeader(ArrayList)</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MinimalMonitor.html">MinimalMonitor</A>
<DD>Add this elements header value to an ArrayList.
<DT><A HREF="com/jamonapi/BaseMonitor.html#getHeader(java.util.ArrayList)"><B>getHeader(ArrayList)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#getHeader(java.util.ArrayList)"><B>getHeader(ArrayList)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Add the display header that is associated with this Monitor to the header (as an ArrayList entry).
<DT><A HREF="com/jamonapi/MonitorComposite.html#getLeafNode(java.lang.String, java.lang.String)"><B>getLeafNode(String, String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>This is CompositeNode interface method that returns a leaf node identified by the given label or it creates a
new leaf node by calling the Leaf.
<DT><A HREF="com/jamonapi/utils/NodeTree.html#getLeafNode(java.lang.String, java.lang.String)"><B>getLeafNode(String, String)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/NodeTree.html">NodeTree</A>
<DD>Return the NodeTree's LeafNode object that is identified by the locator and type.
<DT><A HREF="com/jamonapi/utils/CompositeNode.html#getLeafNode(java.lang.String, java.lang.String)"><B>getLeafNode(String, String)</B></A> -
Method in interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/CompositeNode.html">CompositeNode</A>
<DD>Return the leaf node pointed to by the node name.
<DT><A HREF="com/jamonapi/MonitorComposite.html#getLeafNodeKey(java.lang.String)"><B>getLeafNodeKey(String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>getCompositeNodeKey(...) and getLeafNodeKey(...) are used to ensure that composite nodes are not replaced by leaf nodes
and vice versa.
<DT><A HREF="com/jamonapi/utils/CompositeNode.html#getLeafNodeKey(java.lang.String)"><B>getLeafNodeKey(String)</B></A> -
Method in interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/CompositeNode.html">CompositeNode</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorReportInterface.html#getReport()"><B>getReport()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MonitorReportInterface.html">MonitorReportInterface</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactory.html#getReport()"><B>getReport()</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Returns all gathered statistics as an HTML table as a String.
<DT><A HREF="com/jamonapi/MonitorConverter.html#getReport()"><B>getReport()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorConverter.html">MonitorConverter</A>
<DD>Return an html table in String format in the default sort order
<DT><A HREF="com/jamonapi/MonitorComposite.html#getReport()"><B>getReport()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Return the contents of this MonitorComposite as an HTML table.
<DT><A HREF="com/jamonapi/MonitorConverter.html#getReport(int, java.lang.String)"><B>getReport(int, String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorConverter.html">MonitorConverter</A>
<DD>Return an html table in String format that is sorted by the passed column in ascending or descending order
<DT><A HREF="com/jamonapi/MonitorComposite.html#getReport(int, java.lang.String)"><B>getReport(int, String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Return the contents of this MonitorComposite as an HTML table sorted by the specified column number in ascending or descending order.
<DT><A HREF="com/jamonapi/MonitorFactory.html#getReport(java.lang.String)"><B>getReport(String)</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Returns gathered statistics underneath lower in the heirarchy than the locator string.
<DT><A HREF="com/jamonapi/MonitorFactoryInterface.html#getRootMonitor()"><B>getRootMonitor()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MonitorFactoryInterface.html">MonitorFactoryInterface</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactory.html#getRootMonitor()"><B>getRootMonitor()</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Returns the topmost Composite Monitor
<DT><A HREF="com/jamonapi/MonitorComposite.html#getRootNode()"><B>getRootNode()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Return this MonitorComposite as a CompositeNode
<DT><A HREF="com/jamonapi/utils/NodeTree.html#getRootNode()"><B>getRootNode()</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/NodeTree.html">NodeTree</A>
<DD>Return the highest level CompositeNode in the NodeTree.
<DT><A HREF="com/jamonapi/utils/CompositeNode.html#getRootNode()"><B>getRootNode()</B></A> -
Method in interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/CompositeNode.html">CompositeNode</A>
<DD>Return the NodeTrees root CompositeNode i.e.
<DT><A HREF="com/jamonapi/utils/AppBaseException.html#getRuntimeException(java.lang.Exception)"><B>getRuntimeException(Exception)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppBaseException.html">AppBaseException</A>
<DD>
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#getType()"><B>getType()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Display this Monitors type
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#getUnits()"><B>getUnits()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Dispay the units appropriate for this monitor
</DL>
<HR>
<A NAME="_H_"><!-- --></A><H2>
<B>H</B></H2>
<DL>
<DT><A HREF="com/jamonapi/utils/EnumIterator.html#hasNext()"><B>hasNext()</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/EnumIterator.html">EnumIterator</A>
<DD>
</DL>
<HR>
<A NAME="_I_"><!-- --></A><H2>
<B>I</B></H2>
<DL>
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#increase()"><B>increase()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/AccumulateMonitorInterface.html#increase()"><B>increase()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitorInterface.html">AccumulateMonitorInterface</A>
<DD>increase the stored value for this Monitor
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#increase()"><B>increase()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Increase the monitors accrued value by 1 unit.
<DT><A HREF="com/jamonapi/TimingMonitor.html#increase(long)"><B>increase(long)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>increase the time by the specified ammount of milliseconds.
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#increase(long)"><B>increase(long)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorComposite.html#increase(long)"><B>increase(long)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Call increase(long) on all Monitors that this MonitorComposite instance contains
<DT><A HREF="com/jamonapi/MinimalMonitor.html#increase(long)"><B>increase(long)</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MinimalMonitor.html">MinimalMonitor</A>
<DD>Increase the monitors value
<DT><A HREF="com/jamonapi/BaseMonitor.html#increase(long)"><B>increase(long)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#increase(long)"><B>increase(long)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Increase the monitors accrued value by the ammount specified in the parameter, and call increase on all monitors in the
decorator chain.
<DT><A HREF="com/jamonapi/utils/Misc.html#isObjectString(java.lang.Object)"><B>isObjectString(Object)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/Misc.html">Misc</A>
<DD>
<DT><A HREF="com/jamonapi/TimingMonitor.html#isPrimary()"><B>isPrimary()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/NullMonitor.html#isPrimary()"><B>isPrimary()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullMonitor.html">NullMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#isPrimary()"><B>isPrimary()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/Monitor.html#isPrimary()"><B>isPrimary()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/Monitor.html">Monitor</A>
<DD>Is this a primary Monitor.
<DT><A HREF="com/jamonapi/AccumulateMonitorInterface.html#isPrimary()"><B>isPrimary()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitorInterface.html">AccumulateMonitorInterface</A>
<DD>indicates whether or not this Monitor is primary or not.
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#isPrimary()"><B>isPrimary()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Indicates whether or not this Monitor is primary.
<DT><A HREF="com/jamonapi/utils/CommandIterator.html#iterate(java.util.Collection, com.jamonapi.utils.Command)"><B>iterate(Collection, Command)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/CommandIterator.html">CommandIterator</A>
<DD>Iterate through a Collection passing the Command object each element in the collection.
<DT><A HREF="com/jamonapi/utils/CommandIterator.html#iterate(java.util.Enumeration, com.jamonapi.utils.Command)"><B>iterate(Enumeration, Command)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/CommandIterator.html">CommandIterator</A>
<DD>Iterate through an Enumeration passing the Command object each element in the Collection
<DT><A HREF="com/jamonapi/utils/CommandIterator.html#iterate(java.util.Iterator, com.jamonapi.utils.Command)"><B>iterate(Iterator, Command)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/CommandIterator.html">CommandIterator</A>
<DD>Iterate passing each Command each Object that is being iterated
<DT><A HREF="com/jamonapi/utils/CommandIterator.html#iterate(java.util.Map, com.jamonapi.utils.Command)"><B>iterate(Map, Command)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/CommandIterator.html">CommandIterator</A>
<DD>Iterate through a Map passing Command object a Map.Entry.
<DT><A HREF="com/jamonapi/utils/CommandIterator.html#iterate(java.sql.ResultSet, com.jamonapi.utils.Command)"><B>iterate(ResultSet, Command)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/CommandIterator.html">CommandIterator</A>
<DD>Iterate through a ResultSet passing in a Command object.
</DL>
<HR>
<A NAME="_L_"><!-- --></A><H2>
<B>L</B></H2>
<DL>
<DT><A HREF="com/jamonapi/LastAccessMonitor.html"><B>LastAccessMonitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/LastAccessMonitor.html">LastAccessMonitor</A>.<DD>Class that tracks when a Monitor was first and last called.<DT><A HREF="com/jamonapi/LastAccessMonitor.html#LastAccessMonitor()"><B>LastAccessMonitor()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/LastAccessMonitor.html">LastAccessMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/LastAccessMonitor.html#LastAccessMonitor(com.jamonapi.AccumulateMonitorInterface)"><B>LastAccessMonitor(AccumulateMonitorInterface)</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/LastAccessMonitor.html">LastAccessMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/utils/LeafNode.html"><B>LeafNode</B></A> - interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/LeafNode.html">LeafNode</A>.<DD>A tag interface to indicate a leaf node in a tree/heirarchical relationship.<DT><A HREF="com/jamonapi/MonitorComposite.html#leafNodeExists(java.lang.String)"><B>leafNodeExists(String)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Does the passed in leaf node exist.
<DT><A HREF="com/jamonapi/utils/NodeTree.html#leafNodeExists(java.lang.String)"><B>leafNodeExists(String)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/NodeTree.html">NodeTree</A>
<DD>Determine if the leaf represented by the locator string exists.
<DT><A HREF="com/jamonapi/utils/CompositeNode.html#leafNodeExists(java.lang.String)"><B>leafNodeExists(String)</B></A> -
Method in interface com.jamonapi.utils.<A HREF="com/jamonapi/utils/CompositeNode.html">CompositeNode</A>
<DD>Returns true if the leafNodeExists
<DT><A HREF="com/jamonapi/utils/Logger.html#log(java.lang.Object)"><B>log(Object)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/Logger.html">Logger</A>
<DD>
<DT><A HREF="com/jamonapi/utils/Logger.html#logDebug(java.lang.Object)"><B>logDebug(Object)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/Logger.html">Logger</A>
<DD>
<DT><A HREF="com/jamonapi/utils/Logger.html"><B>Logger</B></A> - class com.jamonapi.utils.<A HREF="com/jamonapi/utils/Logger.html">Logger</A>.<DD>Very Simple Utility class used for Logging.<DT><A HREF="com/jamonapi/utils/Logger.html#logInfo(java.lang.Object)"><B>logInfo(Object)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/Logger.html">Logger</A>
<DD>
</DL>
<HR>
<A NAME="_M_"><!-- --></A><H2>
<B>M</B></H2>
<DL>
<DT><A HREF="com/jamonapi/TimingMonitor.html#main(java.lang.String[])"><B>main(String[])</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>Method with the classes test code
<DT><A HREF="com/jamonapi/TimeStatsMonitor.html#main(java.lang.String[])"><B>main(String[])</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/TimeStatsMonitor.html">TimeStatsMonitor</A>
<DD>The main method contains this classes test code
<DT><A HREF="com/jamonapi/TimeStatsDistMonitor.html#main(java.lang.String[])"><B>main(String[])</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/TimeStatsDistMonitor.html">TimeStatsDistMonitor</A>
<DD>Test method for this class
<DT><A HREF="com/jamonapi/TestClassPerformance.html#main(java.lang.String[])"><B>main(String[])</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>
<DD>Test class for performance numbers of JAMon.
<DT><A HREF="com/jamonapi/TestClass.html#main(java.lang.String[])"><B>main(String[])</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/TestClass.html">TestClass</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactory.html#main(java.lang.String[])"><B>main(String[])</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Test code for the MonitorFactory class.
<DT><A HREF="com/jamonapi/LastAccessMonitor.html#main(java.lang.String[])"><B>main(String[])</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/LastAccessMonitor.html">LastAccessMonitor</A>
<DD>Test code for this class
<DT><A HREF="com/jamonapi/ActiveStatsMonitor.html#main(java.lang.String[])"><B>main(String[])</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/ActiveStatsMonitor.html">ActiveStatsMonitor</A>
<DD>Method that contains test data for this class
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#main(java.lang.String[])"><B>main(String[])</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Method that calls test code for this class.
<DT><A HREF="com/jamonapi/utils/CommandIterator.html#main(java.lang.String[])"><B>main(String[])</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/CommandIterator.html">CommandIterator</A>
<DD>Test code for this class
<DT><A HREF="com/jamonapi/MinimalMonitor.html"><B>MinimalMonitor</B></A> - interface com.jamonapi.<A HREF="com/jamonapi/MinimalMonitor.html">MinimalMonitor</A>.<DD>Most basic interfaces that all monitors must implement.<DT><A HREF="com/jamonapi/utils/Misc.html"><B>Misc</B></A> - class com.jamonapi.utils.<A HREF="com/jamonapi/utils/Misc.html">Misc</A>.<DD>Difficult to group Utilities<DT><A HREF="com/jamonapi/utils/Misc.html#Misc()"><B>Misc()</B></A> -
Constructor for class com.jamonapi.utils.<A HREF="com/jamonapi/utils/Misc.html">Misc</A>
<DD>
<DT><A HREF="com/jamonapi/Monitor.html"><B>Monitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/Monitor.html">Monitor</A>.<DD>The basic Monitor interface used by all of the Timing related Monitors.<DT><A HREF="com/jamonapi/utils/AppConstants.html#MONITOR_PREFIX"><B>MONITOR_PREFIX</B></A> -
Static variable in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppConstants.html">AppConstants</A>
<DD>
<DT><A HREF="com/jamonapi/utils/AppConstants.html#MONITOR_PRIORITY_LEVEL"><B>MONITOR_PRIORITY_LEVEL</B></A> -
Static variable in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppConstants.html">AppConstants</A>
<DD>
<DT><A HREF="com/jamonapi/Monitor.html#Monitor()"><B>Monitor()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/Monitor.html">Monitor</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorComposite.html"><B>MonitorComposite</B></A> - class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>.<DD>MonitorComposite can contain other MonitorComposite and TimingMonitors (at the leaf level)<DT><A HREF="com/jamonapi/MonitorComposite.html#MonitorComposite()"><B>MonitorComposite()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorConverter.html"><B>MonitorConverter</B></A> - class com.jamonapi.<A HREF="com/jamonapi/MonitorConverter.html">MonitorConverter</A>.<DD>MonitorConverter is a utility class used by MonitorComposite to convert Monitor data to various formats.<DT><A HREF="com/jamonapi/MonitorFactory.html"><B>MonitorFactory</B></A> - class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>.<DD>MonitorFactory - Class that controls monitors including creating, starting, enabling, disabling and resetting them.<DT><A HREF="com/jamonapi/MonitorFactory.html#MonitorFactory()"><B>MonitorFactory()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactoryInterface.html"><B>MonitorFactoryInterface</B></A> - interface com.jamonapi.<A HREF="com/jamonapi/MonitorFactoryInterface.html">MonitorFactoryInterface</A>.<DD>Interface used in the Monitor enabled and disabled factories<DT><A HREF="com/jamonapi/MonitorLeafFactory.html"><B>MonitorLeafFactory</B></A> - class com.jamonapi.<A HREF="com/jamonapi/MonitorLeafFactory.html">MonitorLeafFactory</A>.<DD>The MonitorLeafFactory is an important class in that it determines how to create Monitor objects.<DT><A HREF="com/jamonapi/MonitorLeafFactory.html#MonitorLeafFactory()"><B>MonitorLeafFactory()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/MonitorLeafFactory.html">MonitorLeafFactory</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorLeafFactoryInterface.html"><B>MonitorLeafFactoryInterface</B></A> - interface com.jamonapi.<A HREF="com/jamonapi/MonitorLeafFactoryInterface.html">MonitorLeafFactoryInterface</A>.<DD>Interface used to create Leaf level Monitors<DT><A HREF="com/jamonapi/MonitorReportInterface.html"><B>MonitorReportInterface</B></A> - interface com.jamonapi.<A HREF="com/jamonapi/MonitorReportInterface.html">MonitorReportInterface</A>.<DD>Interface used in relation to data and data display of Monitors</DL>
<HR>
<A NAME="_N_"><!-- --></A><H2>
<B>N</B></H2>
<DL>
<DT><A HREF="com/jamonapi/utils/EnumIterator.html#next()"><B>next()</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/EnumIterator.html">EnumIterator</A>
<DD>
<DT><A HREF="com/jamonapi/utils/NodeTree.html#nodeExists(java.lang.String)"><B>nodeExists(String)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/NodeTree.html">NodeTree</A>
<DD>Determine if the Node represented by the locator string exists.
<DT><A HREF="com/jamonapi/utils/NodeTree.html"><B>NodeTree</B></A> - class com.jamonapi.utils.<A HREF="com/jamonapi/utils/NodeTree.html">NodeTree</A>.<DD>A NodeTree works with Compositenodes and LeafNodes to create heirarchical object trees.<DT><A HREF="com/jamonapi/utils/NodeTree.html#NodeTree(com.jamonapi.utils.CompositeNode)"><B>NodeTree(CompositeNode)</B></A> -
Constructor for class com.jamonapi.utils.<A HREF="com/jamonapi/utils/NodeTree.html">NodeTree</A>
<DD>
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html"><B>NullAccumulateMonitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>.<DD>Null implementation of the AccumulateMonitorInterface.<DT><A HREF="com/jamonapi/NullMonitor.html"><B>NullMonitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/NullMonitor.html">NullMonitor</A>.<DD>Null implementation of the Monitor interface.<DT><A HREF="com/jamonapi/TestClassPerformance.html#nullMonitor()"><B>nullMonitor()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>
<DD>
<DT><A HREF="com/jamonapi/TestClassPerformance.html#nullMonitor2()"><B>nullMonitor2()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>
<DD>
</DL>
<HR>
<A NAME="_P_"><!-- --></A><H2>
<B>P</B></H2>
<DL>
<DT><A HREF="com/jamonapi/MonitorLeafFactory.html#PRIMARY"><B>PRIMARY</B></A> -
Static variable in class com.jamonapi.<A HREF="com/jamonapi/MonitorLeafFactory.html">MonitorLeafFactory</A>
<DD>
<DT><A HREF="com/jamonapi/utils/AppMap.html#put(java.lang.Object, java.lang.Object)"><B>put(Object, Object)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppMap.html">AppMap</A>
<DD>
</DL>
<HR>
<A NAME="_R_"><!-- --></A><H2>
<B>R</B></H2>
<DL>
<DT><A HREF="com/jamonapi/utils/EnumIterator.html#remove()"><B>remove()</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/EnumIterator.html">EnumIterator</A>
<DD>
<DT><A HREF="com/jamonapi/TimingMonitor.html#reset()"><B>reset()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>Resets the accrued time and restarts the Monitor
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#reset()"><B>reset()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactory.html#reset()"><B>reset()</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Wipes out all statistics that have been gathered.
<DT><A HREF="com/jamonapi/MonitorComposite.html#reset()"><B>reset()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Call reset() on all Monitors that this MonitorComposite instance contains
<DT><A HREF="com/jamonapi/MinimalMonitor.html#reset()"><B>reset()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MinimalMonitor.html">MinimalMonitor</A>
<DD>Erase the values in the monitor
<DT><A HREF="com/jamonapi/BaseMonitor.html#reset()"><B>reset()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#reset()"><B>reset()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Erase/wipe out any accrued statistics for this monitor, and call reset on all monitors in the decorator chain
Sample Call:
monitor.reset();
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html#resultSetMetaDataToArrayList(java.util.ArrayList, java.sql.ResultSet)"><B>resultSetMetaDataToArrayList(ArrayList, ResultSet)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>
<DD>The following method returns an ArrayList containing the ResultSetMetaData column names.
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html#resultSetToArrayList(java.util.ArrayList, java.sql.ResultSet)"><B>resultSetToArrayList(ArrayList, ResultSet)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>
<DD>The following method returns an ArrayList containing the ResultSet column names and data.
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html#resultSetToMap(java.util.Map, java.sql.ResultSet)"><B>resultSetToMap(Map, ResultSet)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>
<DD>The following method converts ResultSet data to a Map of object keys and values using an instance
of HashMap.
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html#resultSetToString(java.sql.ResultSet)"><B>resultSetToString(ResultSet)</B></A> -
Method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>
<DD>The following method simply takes the ResultSet and converts it to a two dimensional
array of strings containing the column names and data using calls to
the resultSetToArrayList and arrayListToString methods.
<DT><A HREF="com/jamonapi/utils/ResultSetUtils.html"><B>ResultSetUtils</B></A> - class com.jamonapi.utils.<A HREF="com/jamonapi/utils/ResultSetUtils.html">ResultSetUtils</A>.<DD>Purpose: Provides various methods for obtaining resultset data.<DT><A HREF="com/jamonapi/TestClass.html#run()"><B>run()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TestClass.html">TestClass</A>
<DD>
</DL>
<HR>
<A NAME="_S_"><!-- --></A><H2>
<B>S</B></H2>
<DL>
<DT><A HREF="com/jamonapi/MonitorFactory.html#setDebugEnabled(boolean)"><B>setDebugEnabled(boolean)</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Enable or disable the debug factory.
<DT><A HREF="com/jamonapi/MonitorFactory.html#setDebugPriorityLevel(int)"><B>setDebugPriorityLevel(int)</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Enable or disable the priority driven debug factory.
<DT><A HREF="com/jamonapi/MonitorComposite.html#setDisplayDelimiter(java.lang.String)"><B>setDisplayDelimiter(String)</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Delimiter to be used when displaying the monitor label returned by the getReport() and getData() methods.
<DT><A HREF="com/jamonapi/MonitorFactory.html#setEnabled(boolean)"><B>setEnabled(boolean)</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Enable or disable the factory.
<DT><A HREF="com/jamonapi/MonitorFactory.html#setJAMonAdminPage(java.lang.String)"><B>setJAMonAdminPage(String)</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Call this method if you don't want to use the default name or location for JAMonAdmin.jsp that is returned in the JAMon report.
<DT><A HREF="com/jamonapi/TimingMonitor.html#setPrimary(boolean)"><B>setPrimary(boolean)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/NullMonitor.html#setPrimary(boolean)"><B>setPrimary(boolean)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullMonitor.html">NullMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#setPrimary(boolean)"><B>setPrimary(boolean)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/Monitor.html#setPrimary(boolean)"><B>setPrimary(boolean)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/Monitor.html">Monitor</A>
<DD>Indicate that this a primary Monitor.
<DT><A HREF="com/jamonapi/AccumulateMonitorInterface.html#setPrimary(boolean)"><B>setPrimary(boolean)</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitorInterface.html">AccumulateMonitorInterface</A>
<DD>Specify whether or not this Monitor is primary.
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#setPrimary(boolean)"><B>setPrimary(boolean)</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Specify whether or not this Monitor is primary.
<DT><A HREF="com/jamonapi/utils/Misc.html#sort(java.lang.Object[][], int, java.lang.String)"><B>sort(Object[][], int, String)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/Misc.html">Misc</A>
<DD>Sort a 2 dimensional array based on 1 columns data in either ascending or descending order.
<DT><A HREF="com/jamonapi/TimingMonitor.html#start()"><B>start()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>Start timing for the Monitor
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#start()"><B>start()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactoryInterface.html#start()"><B>start()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MonitorFactoryInterface.html">MonitorFactoryInterface</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactory.html#start()"><B>start()</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Return a Monitor and begin gathering timing statistics for it.
<DT><A HREF="com/jamonapi/BasicTimingMonitor.html#start()"><B>start()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BasicTimingMonitor.html">BasicTimingMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/BaseMonitor.html#start()"><B>start()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/AccumulateMonitorInterface.html#start()"><B>start()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitorInterface.html">AccumulateMonitorInterface</A>
<DD>start() gathering statistics for this Monitor
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#start()"><B>start()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Start gathering statistics for this Monitor.
<DT><A HREF="com/jamonapi/MonitorFactoryInterface.html#start(java.lang.String)"><B>start(String)</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MonitorFactoryInterface.html">MonitorFactoryInterface</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactory.html#start(java.lang.String)"><B>start(String)</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Return a Monitor and begin gathering timing statistics for it.<br>
<DT><A HREF="com/jamonapi/utils/AppConstants.html#start(java.lang.String)"><B>start(String)</B></A> -
Static method in class com.jamonapi.utils.<A HREF="com/jamonapi/utils/AppConstants.html">AppConstants</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactoryInterface.html#startPrimary(java.lang.String)"><B>startPrimary(String)</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/MonitorFactoryInterface.html">MonitorFactoryInterface</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorFactory.html#startPrimary(java.lang.String)"><B>startPrimary(String)</B></A> -
Static method in class com.jamonapi.<A HREF="com/jamonapi/MonitorFactory.html">MonitorFactory</A>
<DD>Return a Monitor and begin gathering timing statistics for it.
<DT><A HREF="com/jamonapi/TimingMonitor.html#stop()"><B>stop()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>Stop the Monitor and keep track of how long it was running.
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#stop()"><B>stop()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/Monitor.html#stop()"><B>stop()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/Monitor.html">Monitor</A>
<DD>Stop the montior
<DT><A HREF="com/jamonapi/BasicTimingMonitor.html#stop()"><B>stop()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BasicTimingMonitor.html">BasicTimingMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/BaseMonitor.html#stop()"><B>stop()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/AccumulateMonitorInterface.html#stop()"><B>stop()</B></A> -
Method in interface com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitorInterface.html">AccumulateMonitorInterface</A>
<DD>stop() gathering statistics for this Monitor
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#stop()"><B>stop()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Stop gathering statistics for the Monitor.
</DL>
<HR>
<A NAME="_T_"><!-- --></A><H2>
<B>T</B></H2>
<DL>
<DT><A HREF="com/jamonapi/TestClass.html"><B>TestClass</B></A> - class com.jamonapi.<A HREF="com/jamonapi/TestClass.html">TestClass</A>.<DD>Class used to test all classes in JAMon.<DT><A HREF="com/jamonapi/TestClass.html#TestClass(int, long, long, com.jamonapi.AccumulateMonitor)"><B>TestClass(int, long, long, AccumulateMonitor)</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/TestClass.html">TestClass</A>
<DD>
<DT><A HREF="com/jamonapi/TestClassPerformance.html"><B>TestClassPerformance</B></A> - class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>.<DD>Class used to test performance of JAMon.<DT><A HREF="com/jamonapi/TestClassPerformance.html#TestClassPerformance()"><B>TestClassPerformance()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>
<DD>Creates a new instance of TestClassPerformance
<DT><A HREF="com/jamonapi/TestClassPerformance.html#TestClassPerformance(int)"><B>TestClassPerformance(int)</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>
<DD>
<DT><A HREF="com/jamonapi/TimeStatsDistMonitor.html"><B>TimeStatsDistMonitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/TimeStatsDistMonitor.html">TimeStatsDistMonitor</A>.<DD>TimeStatsDistMonitor keeps track of statistics for JAMon time ranges.<DT><A HREF="com/jamonapi/TimeStatsDistMonitor.html#TimeStatsDistMonitor()"><B>TimeStatsDistMonitor()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/TimeStatsDistMonitor.html">TimeStatsDistMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/TimeStatsDistMonitor.html#TimeStatsDistMonitor(com.jamonapi.AccumulateMonitorInterface)"><B>TimeStatsDistMonitor(AccumulateMonitorInterface)</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/TimeStatsDistMonitor.html">TimeStatsDistMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/TimeStatsMonitor.html"><B>TimeStatsMonitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/TimeStatsMonitor.html">TimeStatsMonitor</A>.<DD>Monitor that keeps track of various timing statistics such as max, min, average, hits, total, and standard deviation.<DT><A HREF="com/jamonapi/TimeStatsMonitor.html#TimeStatsMonitor()"><B>TimeStatsMonitor()</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/TimeStatsMonitor.html">TimeStatsMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/TimeStatsMonitor.html#TimeStatsMonitor(com.jamonapi.AccumulateMonitorInterface)"><B>TimeStatsMonitor(AccumulateMonitorInterface)</B></A> -
Constructor for class com.jamonapi.<A HREF="com/jamonapi/TimeStatsMonitor.html">TimeStatsMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/TimingMonitor.html"><B>TimingMonitor</B></A> - class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>.<DD>This is the Monitor class that starts the decorator chain of Monitors.<DT><A HREF="com/jamonapi/TestClassPerformance.html#timingNoMonitor()"><B>timingNoMonitor()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TestClassPerformance.html">TestClassPerformance</A>
<DD>
<DT><A HREF="com/jamonapi/TimingMonitor.html#toString()"><B>toString()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/TimingMonitor.html">TimingMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/NullAccumulateMonitor.html#toString()"><B>toString()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/NullAccumulateMonitor.html">NullAccumulateMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/MonitorComposite.html#toString()"><B>toString()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/MonitorComposite.html">MonitorComposite</A>
<DD>Display the accrued value as a string
<DT><A HREF="com/jamonapi/BaseMonitor.html#toString()"><B>toString()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/BaseMonitor.html">BaseMonitor</A>
<DD>
<DT><A HREF="com/jamonapi/AccumulateMonitor.html#toString()"><B>toString()</B></A> -
Method in class com.jamonapi.<A HREF="com/jamonapi/AccumulateMonitor.html">AccumulateMonitor</A>
<DD>Display this Monitor as well as all Monitor's in the decorator chain as Strings
</DL>
<HR>
<A HREF="#_A_">A</A> <A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_I_">I</A> <A HREF="#_L_">L</A> <A HREF="#_M_">M</A> <A HREF="#_N_">N</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="index-all.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT>
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
|
Java
|
/*
* Copyright 2016 The Simple File Server 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 org.sfs.integration.java;
import io.vertx.core.Context;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpClient;
import io.vertx.core.logging.Logger;
import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.Rule;
import org.junit.runner.RunWith;
import org.sfs.RunBootedTestOnContextRx;
import org.sfs.Server;
import org.sfs.TestSubscriber;
import org.sfs.VertxContext;
import rx.Observable;
import java.nio.file.Path;
import java.util.concurrent.Callable;
import static io.vertx.core.logging.LoggerFactory.getLogger;
@RunWith(VertxUnitRunner.class)
public class BaseTestVerticle {
private static final Logger LOGGER = getLogger(BaseTestVerticle.class);
@Rule
public RunBootedTestOnContextRx runTestOnContext = new RunBootedTestOnContextRx();
public VertxContext<Server> vertxContext() {
return runTestOnContext.getVertxContext();
}
public HttpClient httpClient() {
return runTestOnContext.getHttpClient();
}
public Vertx vertx() {
return vertxContext().vertx();
}
public Path tmpDir() {
return runTestOnContext.getTmpDir();
}
public void runOnServerContext(TestContext testContext, RunnableWithException callable) {
Async async = testContext.async();
Context c = vertxContext().verticle().getContext();
c.runOnContext(event -> {
try {
callable.run();
async.complete();
} catch (Exception e) {
testContext.fail(e);
}
});
}
public void runOnServerContext(TestContext testContext, Callable<Observable<Void>> callable) {
Async async = testContext.async();
Context c = vertxContext().verticle().getContext();
c.runOnContext(event -> {
try {
callable.call().subscribe(new TestSubscriber(testContext, async));
} catch (Exception e) {
testContext.fail(e);
}
});
}
public interface RunnableWithException {
void run() throws Exception;
}
}
|
Java
|
///<reference path="Math.ts"/>
class Entity {
get X(): number {
return this.Position.x;
}
get Y(): number {
return this.Position.y;
}
get Z(): number {
return this.Position.z;
}
constructor(public Position: Vec3) {
}
}
|
Java
|
#pragma once
#include "indexer/feature_decl.hpp"
#include "geometry/point2d.hpp"
#include "std/initializer_list.hpp"
#include "std/limits.hpp"
#include "std/string.hpp"
#include "std/vector.hpp"
#include "3party/osrm/osrm-backend/typedefs.h"
namespace routing
{
using TNodeId = uint32_t;
using TEdgeWeight = double;
/// \brief Unique identification for a road edge between two junctions (joints).
/// In case of OSRM it's NodeID and in case of RoadGraph (IndexGraph)
/// it's mwm id, feature id, segment id and direction.
struct UniNodeId
{
enum class Type
{
Osrm,
Mwm,
};
UniNodeId(Type type) : m_type(type) {}
UniNodeId(FeatureID const & featureId, uint32_t segId, bool forward)
: m_type(Type::Mwm), m_featureId(featureId), m_segId(segId), m_forward(forward)
{
}
UniNodeId(uint32_t nodeId) : m_type(Type::Osrm), m_nodeId(nodeId) {}
bool operator==(UniNodeId const & rh) const;
bool operator<(UniNodeId const & rh) const;
void Clear();
uint32_t GetNodeId() const;
FeatureID const & GetFeature() const;
uint32_t GetSegId() const;
bool IsForward() const;
private:
Type m_type;
/// \note In case of OSRM unique id is kept in |m_featureId.m_index|.
/// So |m_featureId.m_mwmId|, |m_segId| and |m_forward| have default values.
FeatureID m_featureId; // |m_featureId.m_index| is NodeID for OSRM.
uint32_t m_segId = 0; // Not valid for OSRM.
bool m_forward = true; // Segment direction in |m_featureId|.
NodeID m_nodeId = SPECIAL_NODEID;
};
string DebugPrint(UniNodeId::Type type);
namespace turns
{
/// @todo(vbykoianko) It's a good idea to gather all the turns information into one entity.
/// For the time being several separate entities reflect the turn information. Like Route::TTurns
double constexpr kFeaturesNearTurnMeters = 3.0;
/*!
* \warning The order of values below shall not be changed.
* TurnRight(TurnLeft) must have a minimal value and
* TurnSlightRight(TurnSlightLeft) must have a maximum value
* \warning The values of TurnDirection shall be synchronized with values of TurnDirection enum in
* java.
*/
enum class TurnDirection
{
NoTurn = 0,
GoStraight,
TurnRight,
TurnSharpRight,
TurnSlightRight,
TurnLeft,
TurnSharpLeft,
TurnSlightLeft,
UTurnLeft,
UTurnRight,
TakeTheExit,
EnterRoundAbout,
LeaveRoundAbout,
StayOnRoundAbout,
StartAtEndOfStreet,
ReachedYourDestination,
Count /**< This value is used for internals only. */
};
string DebugPrint(TurnDirection const l);
/*!
* \warning The values of PedestrianDirectionType shall be synchronized with values in java
*/
enum class PedestrianDirection
{
None = 0,
Upstairs,
Downstairs,
LiftGate,
Gate,
ReachedYourDestination,
Count /**< This value is used for internals only. */
};
string DebugPrint(PedestrianDirection const l);
/*!
* \warning The values of LaneWay shall be synchronized with values of LaneWay enum in java.
*/
enum class LaneWay
{
None = 0,
Reverse,
SharpLeft,
Left,
SlightLeft,
MergeToRight,
Through,
MergeToLeft,
SlightRight,
Right,
SharpRight,
Count /**< This value is used for internals only. */
};
string DebugPrint(LaneWay const l);
typedef vector<LaneWay> TSingleLane;
struct SingleLaneInfo
{
TSingleLane m_lane;
bool m_isRecommended = false;
SingleLaneInfo() = default;
SingleLaneInfo(initializer_list<LaneWay> const & l) : m_lane(l) {}
bool operator==(SingleLaneInfo const & other) const;
};
string DebugPrint(SingleLaneInfo const & singleLaneInfo);
struct TurnItem
{
TurnItem()
: m_index(numeric_limits<uint32_t>::max()),
m_turn(TurnDirection::NoTurn),
m_exitNum(0),
m_keepAnyway(false),
m_pedestrianTurn(PedestrianDirection::None)
{
}
TurnItem(uint32_t idx, TurnDirection t, uint32_t exitNum = 0)
: m_index(idx), m_turn(t), m_exitNum(exitNum), m_keepAnyway(false)
, m_pedestrianTurn(PedestrianDirection::None)
{
}
TurnItem(uint32_t idx, PedestrianDirection p)
: m_index(idx), m_turn(TurnDirection::NoTurn), m_exitNum(0), m_keepAnyway(false)
, m_pedestrianTurn(p)
{
}
bool operator==(TurnItem const & rhs) const
{
return m_index == rhs.m_index && m_turn == rhs.m_turn && m_lanes == rhs.m_lanes &&
m_exitNum == rhs.m_exitNum && m_sourceName == rhs.m_sourceName &&
m_targetName == rhs.m_targetName && m_keepAnyway == rhs.m_keepAnyway &&
m_pedestrianTurn == rhs.m_pedestrianTurn;
}
uint32_t m_index; /*!< Index of point on polyline (number of segment + 1). */
TurnDirection m_turn; /*!< The turn instruction of the TurnItem */
vector<SingleLaneInfo> m_lanes; /*!< Lane information on the edge before the turn. */
uint32_t m_exitNum; /*!< Number of exit on roundabout. */
string m_sourceName; /*!< Name of the street which the ingoing edge belongs to */
string m_targetName; /*!< Name of the street which the outgoing edge belongs to */
/*!
* \brief m_keepAnyway is true if the turn shall not be deleted
* and shall be demonstrated to an end user.
*/
bool m_keepAnyway;
/*!
* \brief m_pedestrianTurn is type of corresponding direction for a pedestrian, or None
* if there is no pedestrian specific direction
*/
PedestrianDirection m_pedestrianTurn;
};
string DebugPrint(TurnItem const & turnItem);
struct TurnItemDist
{
TurnItem m_turnItem;
double m_distMeters;
};
string DebugPrint(TurnItemDist const & turnItemDist);
string const GetTurnString(TurnDirection turn);
bool IsLeftTurn(TurnDirection t);
bool IsRightTurn(TurnDirection t);
bool IsLeftOrRightTurn(TurnDirection t);
bool IsStayOnRoad(TurnDirection t);
bool IsGoStraightOrSlightTurn(TurnDirection t);
/*!
* \param l A variant of going along a lane.
* \param t A turn direction.
* \return True if @l corresponds with @t exactly. For example it returns true
* when @l equals to LaneWay::Right and @t equals to TurnDirection::TurnRight.
* Otherwise it returns false.
*/
bool IsLaneWayConformedTurnDirection(LaneWay l, TurnDirection t);
/*!
* \param l A variant of going along a lane.
* \param t A turn direction.
* \return True if @l corresponds with @t approximately. For example it returns true
* when @l equals to LaneWay::Right and @t equals to TurnDirection::TurnSlightRight.
* Otherwise it returns false.
*/
bool IsLaneWayConformedTurnDirectionApproximately(LaneWay l, TurnDirection t);
/*!
* \brief Parse lane information which comes from @lanesString
* \param lanesString lane information. Example through|through|through|through;right
* \param lanes the result of parsing.
* \return true if @lanesString parsed successfully, false otherwise.
* Note 1: if @lanesString is empty returns false.
* Note 2: @laneString is passed by value on purpose. It'll be used(changed) in the method.
*/
bool ParseLanes(string lanesString, vector<SingleLaneInfo> & lanes);
void SplitLanes(string const & lanesString, char delimiter, vector<string> & lanes);
bool ParseSingleLane(string const & laneString, char delimiter, TSingleLane & lane);
/*!
* \returns pi minus angle from vector [junctionPoint, ingoingPoint]
* to vector [junctionPoint, outgoingPoint]. A counterclockwise rotation.
* Angle is in range [-pi, pi].
*/
double PiMinusTwoVectorsAngle(m2::PointD const & junctionPoint, m2::PointD const & ingoingPoint,
m2::PointD const & outgoingPoint);
} // namespace turns
} // namespace routing
|
Java
|
# Cristula integra Chenant., 1920 SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Bull. Soc. mycol. Fr. 35: (1920)
#### Original name
Cristula integra Chenant., 1920
### Remarks
null
|
Java
|
/*
* Copyright 2008-2015 Arsen Chaloyan
*
* 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.
*/
#ifdef WIN32
#pragma warning(disable: 4127)
#endif
#include <apr_ring.h>
#include <apr_hash.h>
#include "rtsp_server.h"
#include "rtsp_stream.h"
#include "apt_poller_task.h"
#include "apt_text_stream.h"
#include "apt_pool.h"
#include "apt_obj_list.h"
#include "apt_log.h"
#define RTSP_SESSION_ID_HEX_STRING_LENGTH 16
#define RTSP_STREAM_BUFFER_SIZE 1024
typedef struct rtsp_server_connection_t rtsp_server_connection_t;
/** RTSP server */
struct rtsp_server_t {
apr_pool_t *pool;
apt_poller_task_t *task;
/** List (ring) of RTSP connections */
APR_RING_HEAD(rtsp_server_connection_head_t, rtsp_server_connection_t) connection_list;
apr_uint32_t inactivity_timeout;
apt_bool_t online;
/* Listening socket descriptor */
apr_sockaddr_t *sockaddr;
apr_socket_t *listen_sock;
apr_pollfd_t listen_sock_pfd;
void *obj;
const rtsp_server_vtable_t *vtable;
};
/** RTSP connection */
struct rtsp_server_connection_t {
/** Ring entry */
APR_RING_ENTRY(rtsp_server_connection_t) link;
/** Memory pool */
apr_pool_t *pool;
/** Client IP address */
char *client_ip;
/** Accepted socket */
apr_socket_t *sock;
/** Socket poll descriptor */
apr_pollfd_t sock_pfd;
/** String identifier used for traces */
const char *id;
/** RTSP server, connection belongs to */
rtsp_server_t *server;
/** Session table (rtsp_server_session_t*) */
apr_hash_t *session_table;
char rx_buffer[RTSP_STREAM_BUFFER_SIZE];
apt_text_stream_t rx_stream;
rtsp_parser_t *parser;
char tx_buffer[RTSP_STREAM_BUFFER_SIZE];
apt_text_stream_t tx_stream;
rtsp_generator_t *generator;
/** Inactivity timer */
apt_timer_t *inactivity_timer;
};
/** RTSP session */
struct rtsp_server_session_t {
apr_pool_t *pool;
void *obj;
rtsp_server_connection_t *connection;
/** Session identifier */
apt_str_t id;
/** Last cseq sent */
apr_size_t last_cseq;
/** In-progress request */
rtsp_message_t *active_request;
/** request queue */
apt_obj_list_t *request_queue;
/** Resource table */
apr_hash_t *resource_table;
/** In-progress termination request */
apt_bool_t terminating;
};
typedef enum {
TASK_MSG_SEND_MESSAGE,
TASK_MSG_TERMINATE_SESSION,
TASK_MSG_RELEASE_SESSION
} task_msg_data_type_e;
typedef struct task_msg_data_t task_msg_data_t;
struct task_msg_data_t {
task_msg_data_type_e type;
rtsp_server_t *server;
rtsp_server_session_t *session;
rtsp_message_t *message;
};
static apt_bool_t rtsp_server_on_destroy(apt_task_t *task);
static void rtsp_server_on_offline(apt_task_t *task);
static void rtsp_server_on_online(apt_task_t *task);
static apt_bool_t rtsp_server_task_msg_process(apt_task_t *task, apt_task_msg_t *msg);
static apt_bool_t rtsp_server_poller_signal_process(void *obj, const apr_pollfd_t *descriptor);
static apt_bool_t rtsp_server_message_send(rtsp_server_t *server, rtsp_server_connection_t *connection, rtsp_message_t *message);
static apt_bool_t rtsp_server_session_terminate_request(rtsp_server_t *server, rtsp_server_session_t *session);
static apt_bool_t rtsp_server_listening_socket_create(rtsp_server_t *server);
static void rtsp_server_listening_socket_destroy(rtsp_server_t *server);
static void rtsp_server_inactivity_timer_proc(apt_timer_t *timer, void *obj);
/** Get string identifier */
static const char* rtsp_server_id_get(const rtsp_server_t *server)
{
apt_task_t *task = apt_poller_task_base_get(server->task);
return apt_task_name_get(task);
}
/** Create RTSP server */
RTSP_DECLARE(rtsp_server_t*) rtsp_server_create(
const char *id,
const char *listen_ip,
apr_port_t listen_port,
apr_size_t max_connection_count,
apr_size_t connection_timeout,
void *obj,
const rtsp_server_vtable_t *handler,
apr_pool_t *pool)
{
apt_task_t *task;
apt_task_vtable_t *vtable;
apt_task_msg_pool_t *msg_pool;
rtsp_server_t *server;
if(!listen_ip) {
return NULL;
}
apt_log(RTSP_LOG_MARK,APT_PRIO_NOTICE,"Create RTSP Server [%s] %s:%hu [%"APR_SIZE_T_FMT"] connection timeout [%"APR_SIZE_T_FMT" sec]",
id,
listen_ip,
listen_port,
max_connection_count,
connection_timeout);
server = apr_palloc(pool,sizeof(rtsp_server_t));
server->pool = pool;
server->obj = obj;
server->vtable = handler;
server->inactivity_timeout = (apr_uint32_t)connection_timeout * 1000;
server->online = TRUE;
server->listen_sock = NULL;
server->sockaddr = NULL;
apr_sockaddr_info_get(&server->sockaddr,listen_ip,APR_INET,listen_port,0,pool);
if(!server->sockaddr) {
return NULL;
}
msg_pool = apt_task_msg_pool_create_dynamic(sizeof(task_msg_data_t),pool);
server->task = apt_poller_task_create(
max_connection_count + 1,
rtsp_server_poller_signal_process,
server,
msg_pool,
pool);
if(!server->task) {
return NULL;
}
task = apt_poller_task_base_get(server->task);
if(task) {
apt_task_name_set(task,id);
}
vtable = apt_poller_task_vtable_get(server->task);
if(vtable) {
vtable->destroy = rtsp_server_on_destroy;
vtable->on_offline_complete = rtsp_server_on_offline;
vtable->on_online_complete = rtsp_server_on_online;
vtable->process_msg = rtsp_server_task_msg_process;
}
APR_RING_INIT(&server->connection_list, rtsp_server_connection_t, link);
if(rtsp_server_listening_socket_create(server) != TRUE) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Create Listening Socket [%s] %s:%hu",
id,
listen_ip,
listen_port);
}
return server;
}
static apt_bool_t rtsp_server_on_destroy(apt_task_t *task)
{
apt_poller_task_t *poller_task = apt_task_object_get(task);
rtsp_server_t *server = apt_poller_task_object_get(poller_task);
rtsp_server_listening_socket_destroy(server);
apt_poller_task_cleanup(poller_task);
return TRUE;
}
/** Destroy RTSP server */
RTSP_DECLARE(apt_bool_t) rtsp_server_destroy(rtsp_server_t *server)
{
apt_log(RTSP_LOG_MARK,APT_PRIO_NOTICE,"Destroy RTSP Server [%s]",
rtsp_server_id_get(server));
return apt_poller_task_destroy(server->task);
}
/** Start connection agent */
RTSP_DECLARE(apt_bool_t) rtsp_server_start(rtsp_server_t *server)
{
return apt_poller_task_start(server->task);
}
/** Terminate connection agent */
RTSP_DECLARE(apt_bool_t) rtsp_server_terminate(rtsp_server_t *server)
{
return apt_poller_task_terminate(server->task);
}
/** Get task */
RTSP_DECLARE(apt_task_t*) rtsp_server_task_get(const rtsp_server_t *server)
{
return apt_poller_task_base_get(server->task);
}
/** Get external object */
RTSP_DECLARE(void*) rtsp_server_object_get(const rtsp_server_t *server)
{
return server->obj;
}
/** Get object associated with the session */
RTSP_DECLARE(void*) rtsp_server_session_object_get(const rtsp_server_session_t *session)
{
return session->obj;
}
/** Set object associated with the session */
RTSP_DECLARE(void) rtsp_server_session_object_set(rtsp_server_session_t *session, void *obj)
{
session->obj = obj;
}
/** Get the session identifier */
RTSP_DECLARE(const apt_str_t*) rtsp_server_session_id_get(const rtsp_server_session_t *session)
{
return &session->id;
}
/** Get active request */
RTSP_DECLARE(const rtsp_message_t*) rtsp_server_session_request_get(const rtsp_server_session_t *session)
{
return session->active_request;
}
/** Get the session destination (client) IP address */
RTSP_DECLARE(const char*) rtsp_server_session_destination_get(const rtsp_server_session_t *session)
{
if(session->connection) {
return session->connection->client_ip;
}
return NULL;
}
/** Signal task message */
static apt_bool_t rtsp_server_control_message_signal(
task_msg_data_type_e type,
rtsp_server_t *server,
rtsp_server_session_t *session,
rtsp_message_t *message)
{
apt_task_t *task = apt_poller_task_base_get(server->task);
apt_task_msg_t *task_msg = apt_task_msg_get(task);
if(task_msg) {
task_msg_data_t *data = (task_msg_data_t*)task_msg->data;
data->type = type;
data->server = server;
data->session = session;
data->message = message;
apt_task_msg_signal(task,task_msg);
}
return TRUE;
}
/** Signal RTSP message */
RTSP_DECLARE(apt_bool_t) rtsp_server_session_respond(rtsp_server_t *server, rtsp_server_session_t *session, rtsp_message_t *message)
{
return rtsp_server_control_message_signal(TASK_MSG_SEND_MESSAGE,server,session,message);
}
/** Signal terminate response */
RTSP_DECLARE(apt_bool_t) rtsp_server_session_terminate(rtsp_server_t *server, rtsp_server_session_t *session)
{
return rtsp_server_control_message_signal(TASK_MSG_TERMINATE_SESSION,server,session,NULL);
}
/** Signal release event/request */
RTSP_DECLARE(apt_bool_t) rtsp_server_session_release(rtsp_server_t *server, rtsp_server_session_t *session)
{
return rtsp_server_control_message_signal(TASK_MSG_RELEASE_SESSION,server,session,NULL);
}
/* Create RTSP session */
static rtsp_server_session_t* rtsp_server_session_create(rtsp_server_t *server)
{
rtsp_server_session_t *session;
apr_pool_t *pool = apt_pool_create();
session = apr_palloc(pool,sizeof(rtsp_server_session_t));
session->pool = pool;
session->obj = NULL;
session->last_cseq = 0;
session->active_request = NULL;
session->request_queue = apt_list_create(pool);
session->resource_table = apr_hash_make(pool);
session->terminating = FALSE;
apt_unique_id_generate(&session->id,RTSP_SESSION_ID_HEX_STRING_LENGTH,pool);
apt_log(RTSP_LOG_MARK,APT_PRIO_NOTICE,"Create RTSP Session " APT_SID_FMT,session->id.buf);
if(server->vtable->create_session(server,session) != TRUE) {
apr_pool_destroy(pool);
return NULL;
}
return session;
}
/* Destroy RTSP session */
static void rtsp_server_session_destroy(rtsp_server_session_t *session)
{
apt_log(RTSP_LOG_MARK,APT_PRIO_NOTICE,"Destroy RTSP Session " APT_SID_FMT,
session ? session->id.buf : "(null)");
if(session && session->pool) {
apr_pool_destroy(session->pool);
}
}
/** Destroy RTSP connection */
static void rtsp_server_connection_destroy(rtsp_server_connection_t *rtsp_connection)
{
apt_log(RTSP_LOG_MARK,APT_PRIO_NOTICE,"Destroy RTSP Connection %s",rtsp_connection->id);
apr_pool_destroy(rtsp_connection->pool);
}
/* Finally terminate RTSP session */
static apt_bool_t rtsp_server_session_do_terminate(rtsp_server_t *server, rtsp_server_session_t *session)
{
rtsp_server_connection_t *rtsp_connection = session->connection;
if(session->active_request) {
rtsp_message_t *response = rtsp_response_create(session->active_request,
RTSP_STATUS_CODE_OK,RTSP_REASON_PHRASE_OK,session->active_request->pool);
if(response) {
if(session->id.buf) {
response->header.session_id = session->id;
rtsp_header_property_add(&response->header,RTSP_HEADER_FIELD_SESSION_ID,response->pool);
}
if(rtsp_connection) {
rtsp_server_message_send(server,rtsp_connection,response);
}
}
}
apt_log(RTSP_LOG_MARK,APT_PRIO_INFO,"Remove RTSP Session " APT_SID_FMT,session->id.buf);
if(rtsp_connection) {
apr_hash_set(rtsp_connection->session_table,session->id.buf,session->id.length,NULL);
}
rtsp_server_session_destroy(session);
if(rtsp_connection && !rtsp_connection->sock) {
if(apr_hash_count(rtsp_connection->session_table) == 0) {
rtsp_server_connection_destroy(rtsp_connection);
}
}
return TRUE;
}
/* Release RTSP session (internal event/request) */
static apt_bool_t rtsp_server_session_do_release(rtsp_server_t *server, rtsp_server_session_t *session)
{
/* Initiate regular session termination now */
apt_log(RTSP_LOG_MARK,APT_PRIO_INFO,"Release RTSP Session " APT_SID_FMT,session->id.buf);
return rtsp_server_session_terminate_request(server,session);
}
static apt_bool_t rtsp_server_error_respond(rtsp_server_t *server, rtsp_server_connection_t *rtsp_connection, rtsp_message_t *request,
rtsp_status_code_e status_code, rtsp_reason_phrase_e reason)
{
/* send error response to client */
rtsp_message_t *response = rtsp_response_create(request,status_code,reason,request->pool);
if(rtsp_server_message_send(server,rtsp_connection,response) == FALSE) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Send RTSP Response");
return FALSE;
}
return TRUE;
}
static apt_bool_t rtsp_server_session_terminate_request(rtsp_server_t *server, rtsp_server_session_t *session)
{
if(session->terminating == TRUE) {
/* error case, session is being terminated */
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Session Termination Already Initiated " APT_SID_FMT,session->id.buf);
return FALSE;
}
session->terminating = TRUE;
return server->vtable->terminate_session(server,session);
}
static apt_bool_t rtsp_server_session_message_handle(rtsp_server_t *server, rtsp_server_session_t *session, rtsp_message_t *message)
{
if(message->start_line.common.request_line.method_id == RTSP_METHOD_TEARDOWN) {
/* remove resource */
const char *resource_name = message->start_line.common.request_line.resource_name;
apr_hash_set(session->resource_table,resource_name,APR_HASH_KEY_STRING,NULL);
if(apr_hash_count(session->resource_table) == 0) {
rtsp_server_session_terminate_request(server,session);
return TRUE;
}
}
if(server->vtable->handle_message(server,session,message) != TRUE) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Handle Message " APT_SID_FMT,session->id.buf);
rtsp_server_error_respond(server,session->connection,message,
RTSP_STATUS_CODE_INTERNAL_SERVER_ERROR,
RTSP_REASON_PHRASE_INTERNAL_SERVER_ERROR);
return FALSE;
}
return TRUE;
}
/* Process incoming SETUP/DESCRIBE request */
static rtsp_server_session_t* rtsp_server_session_setup_process(rtsp_server_t *server, rtsp_server_connection_t *rtsp_connection, rtsp_message_t *message)
{
/* create new session */
rtsp_server_session_t *session = rtsp_server_session_create(server);
if(!session) {
return NULL;
}
session->connection = rtsp_connection;
apt_log(RTSP_LOG_MARK,APT_PRIO_INFO,"Add RTSP Session " APT_SID_FMT,session->id.buf);
apr_hash_set(rtsp_connection->session_table,session->id.buf,session->id.length,session);
return session;
}
/* Process incoming RTSP request */
static apt_bool_t rtsp_server_session_request_process(rtsp_server_t *server, rtsp_server_connection_t *rtsp_connection, rtsp_message_t *message)
{
rtsp_server_session_t *session = NULL;
if(message->start_line.message_type != RTSP_MESSAGE_TYPE_REQUEST) {
/* received response to ANNOUNCE request/event */
return TRUE;
}
if(rtsp_header_property_check(&message->header,RTSP_HEADER_FIELD_SESSION_ID) != TRUE) {
/* no session-id specified */
if(message->start_line.common.request_line.method_id == RTSP_METHOD_SETUP ||
message->start_line.common.request_line.method_id == RTSP_METHOD_DESCRIBE) {
if(server->online == FALSE) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Cannot Establish RTSP Session in Offline Mode");
return rtsp_server_error_respond(server,rtsp_connection,message,
RTSP_STATUS_CODE_SERVICE_UNAVAILABLE,
RTSP_REASON_PHRASE_SERVICE_UNAVAILABLE);
}
session = rtsp_server_session_setup_process(server,rtsp_connection,message);
}
else if(message->start_line.common.request_line.method_id == RTSP_METHOD_OPTIONS) {
/* respond with OK to OPTIONS request */
rtsp_message_t *response = rtsp_response_create(message,RTSP_STATUS_CODE_OK,RTSP_REASON_PHRASE_OK,message->pool);
if(rtsp_server_message_send(server,rtsp_connection,response) == FALSE) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Send RTSP Response");
return FALSE;
}
return TRUE;
}
else {
/* error case */
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Missing RTSP Session-ID");
return rtsp_server_error_respond(server,rtsp_connection,message,
RTSP_STATUS_CODE_BAD_REQUEST,
RTSP_REASON_PHRASE_BAD_REQUEST);
}
if(session) {
session->active_request = message;
if(rtsp_server_session_message_handle(server,session,message) != TRUE) {
rtsp_server_session_destroy(session);
}
}
else {
/* error case, failed to create a session */
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Create RTSP Session");
return rtsp_server_error_respond(server,rtsp_connection,message,
RTSP_STATUS_CODE_NOT_ACCEPTABLE,
RTSP_REASON_PHRASE_NOT_ACCEPTABLE);
}
return TRUE;
}
/* existing session */
session = apr_hash_get(
rtsp_connection->session_table,
message->header.session_id.buf,
message->header.session_id.length);
if(!session) {
/* error case, no such session */
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"No Such RTSP Session " APT_SID_FMT,message->header.session_id.buf);
return rtsp_server_error_respond(server,rtsp_connection,message,
RTSP_STATUS_CODE_NOT_FOUND,
RTSP_REASON_PHRASE_NOT_FOUND);
}
if(session->terminating == TRUE) {
/* error case, session is being terminated */
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Not Acceptable Request " APT_SID_FMT,message->header.session_id.buf);
return rtsp_server_error_respond(server,rtsp_connection,message,
RTSP_STATUS_CODE_NOT_ACCEPTABLE,
RTSP_REASON_PHRASE_NOT_ACCEPTABLE);
}
if(session->active_request) {
apt_log(RTSP_LOG_MARK,APT_PRIO_DEBUG,"Push RTSP Request to Queue " APT_SID_FMT,session->id.buf);
apt_list_push_back(session->request_queue,message,message->pool);
return TRUE;
}
/* handle the request */
session->active_request = message;
rtsp_server_session_message_handle(server,session,message);
return TRUE;
}
/* Process outgoing RTSP response */
static apt_bool_t rtsp_server_session_response_process(rtsp_server_t *server, rtsp_server_session_t *session, rtsp_message_t *message)
{
apt_bool_t terminate = FALSE;
rtsp_message_t *request = NULL;
if(message->start_line.message_type == RTSP_MESSAGE_TYPE_REQUEST) {
/* RTSP ANNOUNCE request (asynch event) */
const char *resource_name = message->start_line.common.request_line.resource_name;
if(resource_name) {
request = apr_hash_get(session->resource_table,resource_name,APR_HASH_KEY_STRING);
}
if(!request) {
return FALSE;
}
message->start_line.common.request_line.url = request->start_line.common.request_line.url;
message->header.cseq = session->last_cseq;
rtsp_header_property_add(&message->header,RTSP_HEADER_FIELD_CSEQ,message->pool);
if(session->id.buf) {
message->header.session_id = session->id;
rtsp_header_property_add(&message->header,RTSP_HEADER_FIELD_SESSION_ID,message->pool);
}
rtsp_server_message_send(server,session->connection,message);
return TRUE;
}
if(!session->active_request) {
/* unexpected response */
return FALSE;
}
request = session->active_request;
if(request->start_line.common.request_line.method_id == RTSP_METHOD_DESCRIBE) {
terminate = TRUE;
}
else {
if(session->id.buf) {
message->header.session_id = session->id;
rtsp_header_property_add(&message->header,RTSP_HEADER_FIELD_SESSION_ID,message->pool);
}
if(request->start_line.common.request_line.method_id == RTSP_METHOD_SETUP) {
if(message->start_line.common.status_line.status_code == RTSP_STATUS_CODE_OK) {
/* add resource */
const char *resource_name = request->start_line.common.request_line.resource_name;
apr_hash_set(session->resource_table,resource_name,APR_HASH_KEY_STRING,request);
}
else if(apr_hash_count(session->resource_table) == 0) {
terminate = TRUE;
}
}
}
session->last_cseq = message->header.cseq;
rtsp_server_message_send(server,session->connection,message);
if(terminate == TRUE) {
session->active_request = NULL;
rtsp_server_session_terminate_request(server,session);
return TRUE;
}
session->active_request = apt_list_pop_front(session->request_queue);
if(session->active_request) {
rtsp_server_session_message_handle(server,session,session->active_request);
}
return TRUE;
}
/* Send RTSP message through RTSP connection */
static apt_bool_t rtsp_server_message_send(rtsp_server_t *server, rtsp_server_connection_t *rtsp_connection, rtsp_message_t *message)
{
apt_bool_t status = FALSE;
apt_text_stream_t *stream;
apt_message_status_e result;
if(!rtsp_connection || !rtsp_connection->sock) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"No RTSP Connection");
return FALSE;
}
stream = &rtsp_connection->tx_stream;
do {
stream->text.length = sizeof(rtsp_connection->tx_buffer)-1;
apt_text_stream_reset(stream);
result = rtsp_generator_run(rtsp_connection->generator,message,stream);
if(result != APT_MESSAGE_STATUS_INVALID) {
stream->text.length = stream->pos - stream->text.buf;
*stream->pos = '\0';
apt_log(RTSP_LOG_MARK,APT_PRIO_INFO,"Send RTSP Data %s [%"APR_SIZE_T_FMT" bytes]\n%s",
rtsp_connection->id,
stream->text.length,
stream->text.buf);
if(apr_socket_send(rtsp_connection->sock,stream->text.buf,&stream->text.length) == APR_SUCCESS) {
status = TRUE;
}
else {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Send RTSP Data");
}
}
else {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Generate RTSP Data");
}
}
while(result == APT_MESSAGE_STATUS_INCOMPLETE);
return status;
}
static apt_bool_t rtsp_server_message_handler(rtsp_server_connection_t *rtsp_connection, rtsp_message_t *message, apt_message_status_e status)
{
if(status == APT_MESSAGE_STATUS_COMPLETE) {
/* message is completely parsed */
apt_str_t *destination;
/* (re)set inactivity timer on every message received */
if(rtsp_connection->inactivity_timer) {
apt_timer_set(rtsp_connection->inactivity_timer,rtsp_connection->server->inactivity_timeout);
}
destination = &message->header.transport.destination;
if(!destination->buf && rtsp_connection->client_ip) {
apt_string_assign(destination,rtsp_connection->client_ip,rtsp_connection->pool);
}
rtsp_server_session_request_process(rtsp_connection->server,rtsp_connection,message);
}
else if(status == APT_MESSAGE_STATUS_INVALID) {
/* error case */
rtsp_message_t *response;
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Parse RTSP Data");
if(message) {
response = rtsp_response_create(message,RTSP_STATUS_CODE_BAD_REQUEST,
RTSP_REASON_PHRASE_BAD_REQUEST,message->pool);
if(rtsp_server_message_send(rtsp_connection->server,rtsp_connection,response) == FALSE) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Send RTSP Response");
}
}
}
return TRUE;
}
/** Create listening socket and add it to pollset */
static apt_bool_t rtsp_server_listening_socket_create(rtsp_server_t *server)
{
apr_status_t status;
if(!server->sockaddr) {
return FALSE;
}
/* create listening socket */
status = apr_socket_create(&server->listen_sock, server->sockaddr->family, SOCK_STREAM, APR_PROTO_TCP, server->pool);
if(status != APR_SUCCESS) {
return FALSE;
}
apr_socket_opt_set(server->listen_sock, APR_SO_NONBLOCK, 0);
apr_socket_timeout_set(server->listen_sock, -1);
apr_socket_opt_set(server->listen_sock, APR_SO_REUSEADDR, 1);
status = apr_socket_bind(server->listen_sock, server->sockaddr);
if(status != APR_SUCCESS) {
apr_socket_close(server->listen_sock);
server->listen_sock = NULL;
return FALSE;
}
status = apr_socket_listen(server->listen_sock, SOMAXCONN);
if(status != APR_SUCCESS) {
apr_socket_close(server->listen_sock);
server->listen_sock = NULL;
return FALSE;
}
/* add listening socket to pollset */
memset(&server->listen_sock_pfd,0,sizeof(apr_pollfd_t));
server->listen_sock_pfd.desc_type = APR_POLL_SOCKET;
server->listen_sock_pfd.reqevents = APR_POLLIN;
server->listen_sock_pfd.desc.s = server->listen_sock;
server->listen_sock_pfd.client_data = server->listen_sock;
if(apt_poller_task_descriptor_add(server->task, &server->listen_sock_pfd) != TRUE) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Add RTSP Listening Socket to Pollset");
apr_socket_close(server->listen_sock);
server->listen_sock = NULL;
return FALSE;
}
return TRUE;
}
/** Remove from pollset and destroy listening socket */
static void rtsp_server_listening_socket_destroy(rtsp_server_t *server)
{
if(server->listen_sock) {
apt_poller_task_descriptor_remove(server->task,&server->listen_sock_pfd);
apr_socket_close(server->listen_sock);
server->listen_sock = NULL;
}
}
/* Accept RTSP connection */
static apt_bool_t rtsp_server_connection_accept(rtsp_server_t *server)
{
rtsp_server_connection_t *rtsp_connection;
char *local_ip = NULL;
char *remote_ip = NULL;
apr_sockaddr_t *l_sockaddr = NULL;
apr_sockaddr_t *r_sockaddr = NULL;
apr_pool_t *pool = apt_pool_create();
if(!pool) {
return FALSE;
}
rtsp_connection = apr_palloc(pool,sizeof(rtsp_server_connection_t));
rtsp_connection->pool = pool;
rtsp_connection->sock = NULL;
rtsp_connection->client_ip = NULL;
APR_RING_ELEM_INIT(rtsp_connection,link);
if(apr_socket_accept(&rtsp_connection->sock,server->listen_sock,rtsp_connection->pool) != APR_SUCCESS) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Accept RTSP Connection");
apr_pool_destroy(pool);
return FALSE;
}
if(apr_socket_addr_get(&l_sockaddr,APR_LOCAL,rtsp_connection->sock) != APR_SUCCESS ||
apr_socket_addr_get(&r_sockaddr,APR_REMOTE,rtsp_connection->sock) != APR_SUCCESS) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Get RTSP Socket Address");
apr_pool_destroy(pool);
return FALSE;
}
apr_sockaddr_ip_get(&local_ip,l_sockaddr);
apr_sockaddr_ip_get(&remote_ip,r_sockaddr);
rtsp_connection->client_ip = remote_ip;
rtsp_connection->id = apr_psprintf(pool,"%s:%hu <-> %s:%hu",
local_ip,l_sockaddr->port,
remote_ip,r_sockaddr->port);
memset(&rtsp_connection->sock_pfd,0,sizeof(apr_pollfd_t));
rtsp_connection->sock_pfd.desc_type = APR_POLL_SOCKET;
rtsp_connection->sock_pfd.reqevents = APR_POLLIN;
rtsp_connection->sock_pfd.desc.s = rtsp_connection->sock;
rtsp_connection->sock_pfd.client_data = rtsp_connection;
if(apt_poller_task_descriptor_add(server->task,&rtsp_connection->sock_pfd) != TRUE) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Add to Pollset %s",rtsp_connection->id);
apr_socket_close(rtsp_connection->sock);
apr_pool_destroy(pool);
return FALSE;
}
apt_log(RTSP_LOG_MARK,APT_PRIO_NOTICE,"Accepted RTSP Connection %s",rtsp_connection->id);
rtsp_connection->session_table = apr_hash_make(rtsp_connection->pool);
apt_text_stream_init(&rtsp_connection->rx_stream,rtsp_connection->rx_buffer,sizeof(rtsp_connection->rx_buffer)-1);
apt_text_stream_init(&rtsp_connection->tx_stream,rtsp_connection->tx_buffer,sizeof(rtsp_connection->tx_buffer)-1);
rtsp_connection->parser = rtsp_parser_create(rtsp_connection->pool);
rtsp_connection->generator = rtsp_generator_create(rtsp_connection->pool);
rtsp_connection->server = server;
rtsp_connection->inactivity_timer = NULL;
if(server->inactivity_timeout) {
rtsp_connection->inactivity_timer = apt_poller_task_timer_create(
server->task,
rtsp_server_inactivity_timer_proc,
rtsp_connection,
rtsp_connection->pool);
}
APR_RING_INSERT_TAIL(&server->connection_list,rtsp_connection,rtsp_server_connection_t,link);
if(rtsp_connection->inactivity_timer) {
apt_timer_set(rtsp_connection->inactivity_timer,server->inactivity_timeout);
}
return TRUE;
}
/** Close connection */
static apt_bool_t rtsp_server_connection_close(rtsp_server_t *server, rtsp_server_connection_t *rtsp_connection)
{
apr_size_t remaining_sessions = 0;
if(!rtsp_connection || !rtsp_connection->sock) {
return FALSE;
}
apt_log(RTSP_LOG_MARK,APT_PRIO_INFO,"Close RTSP Connection %s",rtsp_connection->id);
apt_poller_task_descriptor_remove(server->task,&rtsp_connection->sock_pfd);
apr_socket_close(rtsp_connection->sock);
rtsp_connection->sock = NULL;
if(rtsp_connection->inactivity_timer) {
apt_timer_kill(rtsp_connection->inactivity_timer);
}
APR_RING_REMOVE(rtsp_connection,link);
remaining_sessions = apr_hash_count(rtsp_connection->session_table);
if(remaining_sessions) {
rtsp_server_session_t *session;
void *val;
apr_hash_index_t *it;
apt_log(RTSP_LOG_MARK,APT_PRIO_NOTICE,"Terminate Remaining RTSP Sessions [%"APR_SIZE_T_FMT"]",
remaining_sessions);
it = apr_hash_first(rtsp_connection->pool,rtsp_connection->session_table);
for(; it; it = apr_hash_next(it)) {
apr_hash_this(it,NULL,NULL,&val);
session = val;
if(session) {
rtsp_server_session_terminate_request(server,session);
}
}
}
else {
rtsp_server_connection_destroy(rtsp_connection);
}
return TRUE;
}
/* Timer callback */
static void rtsp_server_inactivity_timer_proc(apt_timer_t *timer, void *obj)
{
rtsp_server_connection_t *rtsp_connection = obj;
if(!rtsp_connection) return;
if(rtsp_connection->inactivity_timer == timer) {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"RTSP Connection Timed Out %s",rtsp_connection->id);
rtsp_server_connection_close(rtsp_connection->server,rtsp_connection);
}
}
/* Receive RTSP message through RTSP connection */
static apt_bool_t rtsp_server_poller_signal_process(void *obj, const apr_pollfd_t *descriptor)
{
rtsp_server_t *server = obj;
rtsp_server_connection_t *rtsp_connection = descriptor->client_data;
apr_status_t status;
apr_size_t offset;
apr_size_t length;
apt_text_stream_t *stream;
rtsp_message_t *message;
apt_message_status_e msg_status;
if(descriptor->desc.s == server->listen_sock) {
return rtsp_server_connection_accept(server);
}
if(!rtsp_connection || !rtsp_connection->sock) {
return FALSE;
}
stream = &rtsp_connection->rx_stream;
/* calculate offset remaining from the previous receive / if any */
offset = stream->pos - stream->text.buf;
/* calculate available length */
length = sizeof(rtsp_connection->rx_buffer) - 1 - offset;
status = apr_socket_recv(rtsp_connection->sock,stream->pos,&length);
if(status == APR_EOF || length == 0) {
apt_log(RTSP_LOG_MARK,APT_PRIO_INFO,"RTSP Peer Disconnected %s",rtsp_connection->id);
return rtsp_server_connection_close(server,rtsp_connection);
}
/* calculate actual length of the stream */
stream->text.length = offset + length;
stream->pos[length] = '\0';
apt_log(RTSP_LOG_MARK,APT_PRIO_INFO,"Receive RTSP Data %s [%"APR_SIZE_T_FMT" bytes]\n%s",
rtsp_connection->id,
length,
stream->pos);
/* reset pos */
apt_text_stream_reset(stream);
do {
msg_status = rtsp_parser_run(rtsp_connection->parser,stream,&message);
rtsp_server_message_handler(rtsp_connection,message,msg_status);
}
while(apt_text_is_eos(stream) == FALSE);
/* scroll remaining stream */
apt_text_stream_scroll(stream);
return TRUE;
}
static void rtsp_server_on_offline(apt_task_t *task)
{
apt_poller_task_t *poller_task = apt_task_object_get(task);
rtsp_server_t *server = apt_poller_task_object_get(poller_task);
server->online = FALSE;
}
static void rtsp_server_on_online(apt_task_t *task)
{
apt_poller_task_t *poller_task = apt_task_object_get(task);
rtsp_server_t *server = apt_poller_task_object_get(poller_task);
server->online = TRUE;
}
/* Process task message */
static apt_bool_t rtsp_server_task_msg_process(apt_task_t *task, apt_task_msg_t *task_msg)
{
apt_poller_task_t *poller_task = apt_task_object_get(task);
rtsp_server_t *server = apt_poller_task_object_get(poller_task);
task_msg_data_t *data = (task_msg_data_t*) task_msg->data;
switch(data->type) {
case TASK_MSG_SEND_MESSAGE:
rtsp_server_session_response_process(server,data->session,data->message);
break;
case TASK_MSG_TERMINATE_SESSION:
rtsp_server_session_do_terminate(server,data->session);
break;
case TASK_MSG_RELEASE_SESSION:
rtsp_server_session_do_release(server,data->session);
break;
}
return TRUE;
}
|
Java
|
define(function (require) {
var SymbolDraw = require('../helper/SymbolDraw');
var LargeSymbolDraw = require('../helper/LargeSymbolDraw');
require('../../echarts').extendChartView({
type: 'scatter',
init: function () {
this._normalSymbolDraw = new SymbolDraw();
this._largeSymbolDraw = new LargeSymbolDraw();
},
render: function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var largeSymbolDraw = this._largeSymbolDraw;
var normalSymbolDraw = this._normalSymbolDraw;
var group = this.group;
var symbolDraw = seriesModel.get('large') && data.count() > seriesModel.get('largeThreshold')
? largeSymbolDraw : normalSymbolDraw;
this._symbolDraw = symbolDraw;
symbolDraw.updateData(data);
group.add(symbolDraw.group);
group.remove(
symbolDraw === largeSymbolDraw
? normalSymbolDraw.group : largeSymbolDraw.group
);
},
updateLayout: function (seriesModel) {
this._symbolDraw.updateLayout(seriesModel);
},
remove: function (ecModel, api) {
this._symbolDraw && this._symbolDraw.remove(api, true);
}
});
});
|
Java
|
# first-try
cnm stemulus deep dive coders prework
|
Java
|
/**
* @author fanguozhu
*/
$(function()
{
var tab = new TabPanel("tab",true);
var f_tree = new Fieldset("f_tree","公司列表",{
state: Fieldset.OPEN_STATE,
topdown: false
});
var mytree = new PorTreeT("tree", "-1", "手机公司",{isDefaultClick:0} );
var dw = new DataWrapper();
dw.service("PRtree");
mytree.dataWrapper(dw);
tab.dataWrapper(dw);
tab.addChangeObserver(function(src, msg){
var dw = this.dataWrapper();
if (!dw) return;
var label = msg.data.label;
var name = msg.data.name;
for (var i=1;i<=3;i++) {
if (label) {
this.setTitle(i,"["+name+"]公司产品["+i+"]");
} else {
this.setTitle(i,"全部公司产品["+i+"]");
}
}
},PorMessage.MSG_TREE_ONCLICK);
var dw1 = new DataWrapper();
dw1.service("PR02");
var dw2 = new DataWrapper();
dw2.service("PR02");
var dw3 = new DataWrapper();
dw3.service("PR02");
var dg1 = new DataGrid("grid_1",{autoDraw:true,readonly:true});
dg1.dataWrapper(dw1);
var dg2 = new DataGrid("grid_2",{autoDraw:true,readonly:true});
dg2.dataWrapper(dw2);
var dg3 = new DataGrid("grid_3",{autoDraw:true,readonly:true});
dg3.dataWrapper(dw3);
var mapping = {
master:["label"],
sub:["company"]
};
PorUtil.linkTreeAndGrid( dw,[{
sub:dw1,
mapping:mapping,
tabs:{
tab:[0,1] //配置在'tab'的第1个tab页需要加载
}
},{
sub:dw2,
mapping:mapping,
tabs:{
tab:[2] //配置在'tab'的第2个tab页需要加载
}
},{
sub:dw3,
mapping:mapping,
tabs:{
tab:[3] //配置在'tab'的第3个tab页需要加载
}
}]);
mytree.init();
});
|
Java
|
/*
* Core Utils - Common Utilities.
* Copyright 2015-2016 GRyCAP (Universitat Politecnica de Valencia)
*
* 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 product combines work with different licenses. See the "NOTICE" text
* file for details on the various modules and licenses.
*
* The "NOTICE" text file is part of the distribution. Any derivative works
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
package es.upv.grycap.coreutils.common;
import com.google.common.collect.Range;
/**
* Hard-coded configuration limits.
* @author Erik Torres
* @since 0.2.0
*/
public interface CoreutilsLimits {
public static final int NUM_AVAILABLE_PROCESSORS = Runtime.getRuntime().availableProcessors();
public static final Range<Long> TRY_LOCK_TIMEOUT_RANGE = Range.closed(1l, 2000l);
public static final Range<Integer> MAX_POOL_SIZE_RANGE = Range.closed(Math.min(2, NUM_AVAILABLE_PROCESSORS), Math.max(128, NUM_AVAILABLE_PROCESSORS));
public static final Range<Long> KEEP_ALIVE_TIME_RANGE = Range.closed(60000l, 3600000l);
public static final Range<Long> WAIT_TERMINATION_TIMEOUT_RANGE = Range.closed(1000l, 60000l);
}
|
Java
|
# Papillomembrana N. Spjeldnaes, 1963 GENUS
#### Status
ACCEPTED
#### According to
Interim Register of Marine and Nonmarine Genera
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
/*
* Copyright (c) 2016 Ni YueMing<niyueming@163.com>
* 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 net.nym.napply.library.cookie.store;
/**
* Created by zhy on 16/3/10.
*/
public interface HasCookieStore
{
CookieStore getCookieStore();
}
|
Java
|
/*
* Copyright 2012-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.
*/
package com.amazonaws.services.kinesisfirehose.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.kinesisfirehose.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* ProcessingConfiguration JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ProcessingConfigurationJsonUnmarshaller implements Unmarshaller<ProcessingConfiguration, JsonUnmarshallerContext> {
public ProcessingConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {
ProcessingConfiguration processingConfiguration = new ProcessingConfiguration();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("Enabled", targetDepth)) {
context.nextToken();
processingConfiguration.setEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context));
}
if (context.testExpression("Processors", targetDepth)) {
context.nextToken();
processingConfiguration.setProcessors(new ListUnmarshaller<Processor>(ProcessorJsonUnmarshaller.getInstance()).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return processingConfiguration;
}
private static ProcessingConfigurationJsonUnmarshaller instance;
public static ProcessingConfigurationJsonUnmarshaller getInstance() {
if (instance == null)
instance = new ProcessingConfigurationJsonUnmarshaller();
return instance;
}
}
|
Java
|
/*
* Copyright 2021 Google LLC
*
* 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
*
* https://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.cloud.compute.v1.stub;
import com.google.api.core.BetaApi;
import com.google.api.gax.httpjson.HttpJsonCallSettings;
import com.google.api.gax.httpjson.HttpJsonCallableFactory;
import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
import com.google.api.gax.rpc.BatchingCallSettings;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.ServerStreamingCallSettings;
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.compute.v1.Operation;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* REST callable factory implementation for the Routes service API.
*
* <p>This class is for advanced usage.
*/
@Generated("by gapic-generator-java")
@BetaApi
public class HttpJsonRoutesCallableFactory
implements HttpJsonStubCallableFactory<Operation, GlobalOperationsStub> {
@Override
public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createUnaryCallable(
HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
UnaryCallSettings<RequestT, ResponseT> callSettings,
ClientContext clientContext) {
return HttpJsonCallableFactory.createUnaryCallable(
httpJsonCallSettings, callSettings, clientContext);
}
@Override
public <RequestT, ResponseT, PagedListResponseT>
UnaryCallable<RequestT, PagedListResponseT> createPagedCallable(
HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
PagedCallSettings<RequestT, ResponseT, PagedListResponseT> callSettings,
ClientContext clientContext) {
return HttpJsonCallableFactory.createPagedCallable(
httpJsonCallSettings, callSettings, clientContext);
}
@Override
public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCallable(
HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
BatchingCallSettings<RequestT, ResponseT> callSettings,
ClientContext clientContext) {
return HttpJsonCallableFactory.createBatchingCallable(
httpJsonCallSettings, callSettings, clientContext);
}
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
@Override
public <RequestT, ResponseT, MetadataT>
OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(
HttpJsonCallSettings<RequestT, Operation> httpJsonCallSettings,
OperationCallSettings<RequestT, ResponseT, MetadataT> callSettings,
ClientContext clientContext,
GlobalOperationsStub operationsStub) {
UnaryCallable<RequestT, Operation> innerCallable =
HttpJsonCallableFactory.createBaseUnaryCallable(
httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
HttpJsonOperationSnapshotCallable<RequestT, Operation> initialCallable =
new HttpJsonOperationSnapshotCallable<RequestT, Operation>(
innerCallable,
httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
return HttpJsonCallableFactory.createOperationCallable(
callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
}
@Override
public <RequestT, ResponseT>
ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
HttpJsonCallSettings<RequestT, ResponseT> httpJsonCallSettings,
ServerStreamingCallSettings<RequestT, ResponseT> callSettings,
ClientContext clientContext) {
return HttpJsonCallableFactory.createServerStreamingCallable(
httpJsonCallSettings, callSettings, clientContext);
}
}
|
Java
|
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
audio,
canvas,
progress,
video {
display: inline-block;
vertical-align: baseline;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden],
template {
display: none;
}
a {
background-color: transparent;
}
a:active,
a:hover {
outline: 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
mark {
background: #ff0;
color: #000;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
box-sizing: content-box;
height: 0;
}
pre {
overflow: auto;
}
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
button,
input,
optgroup,
select,
textarea {
color: inherit;
font: inherit;
margin: 0;
}
button {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
input {
line-height: normal;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
input[type="search"] {
-webkit-appearance: textfield;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
}
optgroup {
font-weight: bold;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
@media print {
*,
*:before,
*:after {
background: transparent !important;
color: #000 !important;
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
a[href^="#"]:after,
a[href^="javascript:"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
.navbar {
display: none;
}
.btn > .caret,
.dropup > .btn > .caret {
border-top-color: #000 !important;
}
.label {
border: 1px solid #000;
}
.table {
border-collapse: collapse !important;
}
.table td,
.table th {
background-color: #fff !important;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.glyphicon-asterisk:before {
content: "\002a";
}
.glyphicon-plus:before {
content: "\002b";
}
.glyphicon-euro:before,
.glyphicon-eur:before {
content: "\20ac";
}
.glyphicon-minus:before {
content: "\2212";
}
.glyphicon-cloud:before {
content: "\2601";
}
.glyphicon-envelope:before {
content: "\2709";
}
.glyphicon-pencil:before {
content: "\270f";
}
.glyphicon-glass:before {
content: "\e001";
}
.glyphicon-music:before {
content: "\e002";
}
.glyphicon-search:before {
content: "\e003";
}
.glyphicon-heart:before {
content: "\e005";
}
.glyphicon-star:before {
content: "\e006";
}
.glyphicon-star-empty:before {
content: "\e007";
}
.glyphicon-user:before {
content: "\e008";
}
.glyphicon-film:before {
content: "\e009";
}
.glyphicon-th-large:before {
content: "\e010";
}
.glyphicon-th:before {
content: "\e011";
}
.glyphicon-th-list:before {
content: "\e012";
}
.glyphicon-ok:before {
content: "\e013";
}
.glyphicon-remove:before {
content: "\e014";
}
.glyphicon-zoom-in:before {
content: "\e015";
}
.glyphicon-zoom-out:before {
content: "\e016";
}
.glyphicon-off:before {
content: "\e017";
}
.glyphicon-signal:before {
content: "\e018";
}
.glyphicon-cog:before {
content: "\e019";
}
.glyphicon-trash:before {
content: "\e020";
}
.glyphicon-home:before {
content: "\e021";
}
.glyphicon-file:before {
content: "\e022";
}
.glyphicon-time:before {
content: "\e023";
}
.glyphicon-road:before {
content: "\e024";
}
.glyphicon-download-alt:before {
content: "\e025";
}
.glyphicon-download:before {
content: "\e026";
}
.glyphicon-upload:before {
content: "\e027";
}
.glyphicon-inbox:before {
content: "\e028";
}
.glyphicon-play-circle:before {
content: "\e029";
}
.glyphicon-repeat:before {
content: "\e030";
}
.glyphicon-refresh:before {
content: "\e031";
}
.glyphicon-list-alt:before {
content: "\e032";
}
.glyphicon-lock:before {
content: "\e033";
}
.glyphicon-flag:before {
content: "\e034";
}
.glyphicon-headphones:before {
content: "\e035";
}
.glyphicon-volume-off:before {
content: "\e036";
}
.glyphicon-volume-down:before {
content: "\e037";
}
.glyphicon-volume-up:before {
content: "\e038";
}
.glyphicon-qrcode:before {
content: "\e039";
}
.glyphicon-barcode:before {
content: "\e040";
}
.glyphicon-tag:before {
content: "\e041";
}
.glyphicon-tags:before {
content: "\e042";
}
.glyphicon-book:before {
content: "\e043";
}
.glyphicon-bookmark:before {
content: "\e044";
}
.glyphicon-print:before {
content: "\e045";
}
.glyphicon-camera:before {
content: "\e046";
}
.glyphicon-font:before {
content: "\e047";
}
.glyphicon-bold:before {
content: "\e048";
}
.glyphicon-italic:before {
content: "\e049";
}
.glyphicon-text-height:before {
content: "\e050";
}
.glyphicon-text-width:before {
content: "\e051";
}
.glyphicon-align-left:before {
content: "\e052";
}
.glyphicon-align-center:before {
content: "\e053";
}
.glyphicon-align-right:before {
content: "\e054";
}
.glyphicon-align-justify:before {
content: "\e055";
}
.glyphicon-list:before {
content: "\e056";
}
.glyphicon-indent-left:before {
content: "\e057";
}
.glyphicon-indent-right:before {
content: "\e058";
}
.glyphicon-facetime-video:before {
content: "\e059";
}
.glyphicon-picture:before {
content: "\e060";
}
.glyphicon-map-marker:before {
content: "\e062";
}
.glyphicon-adjust:before {
content: "\e063";
}
.glyphicon-tint:before {
content: "\e064";
}
.glyphicon-edit:before {
content: "\e065";
}
.glyphicon-share:before {
content: "\e066";
}
.glyphicon-check:before {
content: "\e067";
}
.glyphicon-move:before {
content: "\e068";
}
.glyphicon-step-backward:before {
content: "\e069";
}
.glyphicon-fast-backward:before {
content: "\e070";
}
.glyphicon-backward:before {
content: "\e071";
}
.glyphicon-play:before {
content: "\e072";
}
.glyphicon-pause:before {
content: "\e073";
}
.glyphicon-stop:before {
content: "\e074";
}
.glyphicon-forward:before {
content: "\e075";
}
.glyphicon-fast-forward:before {
content: "\e076";
}
.glyphicon-step-forward:before {
content: "\e077";
}
.glyphicon-eject:before {
content: "\e078";
}
.glyphicon-chevron-left:before {
content: "\e079";
}
.glyphicon-chevron-right:before {
content: "\e080";
}
.glyphicon-plus-sign:before {
content: "\e081";
}
.glyphicon-minus-sign:before {
content: "\e082";
}
.glyphicon-remove-sign:before {
content: "\e083";
}
.glyphicon-ok-sign:before {
content: "\e084";
}
.glyphicon-question-sign:before {
content: "\e085";
}
.glyphicon-info-sign:before {
content: "\e086";
}
.glyphicon-screenshot:before {
content: "\e087";
}
.glyphicon-remove-circle:before {
content: "\e088";
}
.glyphicon-ok-circle:before {
content: "\e089";
}
.glyphicon-ban-circle:before {
content: "\e090";
}
.glyphicon-arrow-left:before {
content: "\e091";
}
.glyphicon-arrow-right:before {
content: "\e092";
}
.glyphicon-arrow-up:before {
content: "\e093";
}
.glyphicon-arrow-down:before {
content: "\e094";
}
.glyphicon-share-alt:before {
content: "\e095";
}
.glyphicon-resize-full:before {
content: "\e096";
}
.glyphicon-resize-small:before {
content: "\e097";
}
.glyphicon-exclamation-sign:before {
content: "\e101";
}
.glyphicon-gift:before {
content: "\e102";
}
.glyphicon-leaf:before {
content: "\e103";
}
.glyphicon-fire:before {
content: "\e104";
}
.glyphicon-eye-open:before {
content: "\e105";
}
.glyphicon-eye-close:before {
content: "\e106";
}
.glyphicon-warning-sign:before {
content: "\e107";
}
.glyphicon-plane:before {
content: "\e108";
}
.glyphicon-calendar:before {
content: "\e109";
}
.glyphicon-random:before {
content: "\e110";
}
.glyphicon-comment:before {
content: "\e111";
}
.glyphicon-magnet:before {
content: "\e112";
}
.glyphicon-chevron-up:before {
content: "\e113";
}
.glyphicon-chevron-down:before {
content: "\e114";
}
.glyphicon-retweet:before {
content: "\e115";
}
.glyphicon-shopping-cart:before {
content: "\e116";
}
.glyphicon-folder-close:before {
content: "\e117";
}
.glyphicon-folder-open:before {
content: "\e118";
}
.glyphicon-resize-vertical:before {
content: "\e119";
}
.glyphicon-resize-horizontal:before {
content: "\e120";
}
.glyphicon-hdd:before {
content: "\e121";
}
.glyphicon-bullhorn:before {
content: "\e122";
}
.glyphicon-bell:before {
content: "\e123";
}
.glyphicon-certificate:before {
content: "\e124";
}
.glyphicon-thumbs-up:before {
content: "\e125";
}
.glyphicon-thumbs-down:before {
content: "\e126";
}
.glyphicon-hand-right:before {
content: "\e127";
}
.glyphicon-hand-left:before {
content: "\e128";
}
.glyphicon-hand-up:before {
content: "\e129";
}
.glyphicon-hand-down:before {
content: "\e130";
}
.glyphicon-circle-arrow-right:before {
content: "\e131";
}
.glyphicon-circle-arrow-left:before {
content: "\e132";
}
.glyphicon-circle-arrow-up:before {
content: "\e133";
}
.glyphicon-circle-arrow-down:before {
content: "\e134";
}
.glyphicon-globe:before {
content: "\e135";
}
.glyphicon-wrench:before {
content: "\e136";
}
.glyphicon-tasks:before {
content: "\e137";
}
.glyphicon-filter:before {
content: "\e138";
}
.glyphicon-briefcase:before {
content: "\e139";
}
.glyphicon-fullscreen:before {
content: "\e140";
}
.glyphicon-dashboard:before {
content: "\e141";
}
.glyphicon-paperclip:before {
content: "\e142";
}
.glyphicon-heart-empty:before {
content: "\e143";
}
.glyphicon-link:before {
content: "\e144";
}
.glyphicon-phone:before {
content: "\e145";
}
.glyphicon-pushpin:before {
content: "\e146";
}
.glyphicon-usd:before {
content: "\e148";
}
.glyphicon-gbp:before {
content: "\e149";
}
.glyphicon-sort:before {
content: "\e150";
}
.glyphicon-sort-by-alphabet:before {
content: "\e151";
}
.glyphicon-sort-by-alphabet-alt:before {
content: "\e152";
}
.glyphicon-sort-by-order:before {
content: "\e153";
}
.glyphicon-sort-by-order-alt:before {
content: "\e154";
}
.glyphicon-sort-by-attributes:before {
content: "\e155";
}
.glyphicon-sort-by-attributes-alt:before {
content: "\e156";
}
.glyphicon-unchecked:before {
content: "\e157";
}
.glyphicon-expand:before {
content: "\e158";
}
.glyphicon-collapse-down:before {
content: "\e159";
}
.glyphicon-collapse-up:before {
content: "\e160";
}
.glyphicon-log-in:before {
content: "\e161";
}
.glyphicon-flash:before {
content: "\e162";
}
.glyphicon-log-out:before {
content: "\e163";
}
.glyphicon-new-window:before {
content: "\e164";
}
.glyphicon-record:before {
content: "\e165";
}
.glyphicon-save:before {
content: "\e166";
}
.glyphicon-open:before {
content: "\e167";
}
.glyphicon-saved:before {
content: "\e168";
}
.glyphicon-import:before {
content: "\e169";
}
.glyphicon-export:before {
content: "\e170";
}
.glyphicon-send:before {
content: "\e171";
}
.glyphicon-floppy-disk:before {
content: "\e172";
}
.glyphicon-floppy-saved:before {
content: "\e173";
}
.glyphicon-floppy-remove:before {
content: "\e174";
}
.glyphicon-floppy-save:before {
content: "\e175";
}
.glyphicon-floppy-open:before {
content: "\e176";
}
.glyphicon-credit-card:before {
content: "\e177";
}
.glyphicon-transfer:before {
content: "\e178";
}
.glyphicon-cutlery:before {
content: "\e179";
}
.glyphicon-header:before {
content: "\e180";
}
.glyphicon-compressed:before {
content: "\e181";
}
.glyphicon-earphone:before {
content: "\e182";
}
.glyphicon-phone-alt:before {
content: "\e183";
}
.glyphicon-tower:before {
content: "\e184";
}
.glyphicon-stats:before {
content: "\e185";
}
.glyphicon-sd-video:before {
content: "\e186";
}
.glyphicon-hd-video:before {
content: "\e187";
}
.glyphicon-subtitles:before {
content: "\e188";
}
.glyphicon-sound-stereo:before {
content: "\e189";
}
.glyphicon-sound-dolby:before {
content: "\e190";
}
.glyphicon-sound-5-1:before {
content: "\e191";
}
.glyphicon-sound-6-1:before {
content: "\e192";
}
.glyphicon-sound-7-1:before {
content: "\e193";
}
.glyphicon-copyright-mark:before {
content: "\e194";
}
.glyphicon-registration-mark:before {
content: "\e195";
}
.glyphicon-cloud-download:before {
content: "\e197";
}
.glyphicon-cloud-upload:before {
content: "\e198";
}
.glyphicon-tree-conifer:before {
content: "\e199";
}
.glyphicon-tree-deciduous:before {
content: "\e200";
}
.glyphicon-cd:before {
content: "\e201";
}
.glyphicon-save-file:before {
content: "\e202";
}
.glyphicon-open-file:before {
content: "\e203";
}
.glyphicon-level-up:before {
content: "\e204";
}
.glyphicon-copy:before {
content: "\e205";
}
.glyphicon-paste:before {
content: "\e206";
}
.glyphicon-alert:before {
content: "\e209";
}
.glyphicon-equalizer:before {
content: "\e210";
}
.glyphicon-king:before {
content: "\e211";
}
.glyphicon-queen:before {
content: "\e212";
}
.glyphicon-pawn:before {
content: "\e213";
}
.glyphicon-bishop:before {
content: "\e214";
}
.glyphicon-knight:before {
content: "\e215";
}
.glyphicon-baby-formula:before {
content: "\e216";
}
.glyphicon-tent:before {
content: "\26fa";
}
.glyphicon-blackboard:before {
content: "\e218";
}
.glyphicon-bed:before {
content: "\e219";
}
.glyphicon-apple:before {
content: "\f8ff";
}
.glyphicon-erase:before {
content: "\e221";
}
.glyphicon-hourglass:before {
content: "\231b";
}
.glyphicon-lamp:before {
content: "\e223";
}
.glyphicon-duplicate:before {
content: "\e224";
}
.glyphicon-piggy-bank:before {
content: "\e225";
}
.glyphicon-scissors:before {
content: "\e226";
}
.glyphicon-bitcoin:before {
content: "\e227";
}
.glyphicon-btc:before {
content: "\e227";
}
.glyphicon-xbt:before {
content: "\e227";
}
.glyphicon-yen:before {
content: "\00a5";
}
.glyphicon-jpy:before {
content: "\00a5";
}
.glyphicon-ruble:before {
content: "\20bd";
}
.glyphicon-rub:before {
content: "\20bd";
}
.glyphicon-scale:before {
content: "\e230";
}
.glyphicon-ice-lolly:before {
content: "\e231";
}
.glyphicon-ice-lolly-tasted:before {
content: "\e232";
}
.glyphicon-education:before {
content: "\e233";
}
.glyphicon-option-horizontal:before {
content: "\e234";
}
.glyphicon-option-vertical:before {
content: "\e235";
}
.glyphicon-menu-hamburger:before {
content: "\e236";
}
.glyphicon-modal-window:before {
content: "\e237";
}
.glyphicon-oil:before {
content: "\e238";
}
.glyphicon-grain:before {
content: "\e239";
}
.glyphicon-sunglasses:before {
content: "\e240";
}
.glyphicon-text-size:before {
content: "\e241";
}
.glyphicon-text-color:before {
content: "\e242";
}
.glyphicon-text-background:before {
content: "\e243";
}
.glyphicon-object-align-top:before {
content: "\e244";
}
.glyphicon-object-align-bottom:before {
content: "\e245";
}
.glyphicon-object-align-horizontal:before {
content: "\e246";
}
.glyphicon-object-align-left:before {
content: "\e247";
}
.glyphicon-object-align-vertical:before {
content: "\e248";
}
.glyphicon-object-align-right:before {
content: "\e249";
}
.glyphicon-triangle-right:before {
content: "\e250";
}
.glyphicon-triangle-left:before {
content: "\e251";
}
.glyphicon-triangle-bottom:before {
content: "\e252";
}
.glyphicon-triangle-top:before {
content: "\e253";
}
.glyphicon-console:before {
content: "\e254";
}
.glyphicon-superscript:before {
content: "\e255";
}
.glyphicon-subscript:before {
content: "\e256";
}
.glyphicon-menu-left:before {
content: "\e257";
}
.glyphicon-menu-right:before {
content: "\e258";
}
.glyphicon-menu-down:before {
content: "\e259";
}
.glyphicon-menu-up:before {
content: "\e260";
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-size: 10px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333333;
background-color: #ffffff;
}
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
a {
color: #337ab7;
text-decoration: none;
}
a:hover,
a:focus {
color: #23527c;
text-decoration: underline;
}
a:focus {
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
figure {
margin: 0;
}
img {
vertical-align: middle;
}
.img-responsive,
.thumbnail > img,
.thumbnail a > img,
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
max-width: 100%;
height: auto;
}
.img-rounded {
border-radius: 6px;
}
.img-thumbnail {
padding: 4px;
line-height: 1.42857143;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto;
}
.img-circle {
border-radius: 50%;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eeeeee;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.sr-only-focusable:active,
.sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
[role="button"] {
cursor: pointer;
}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small,
h1 .small,
h2 .small,
h3 .small,
h4 .small,
h5 .small,
h6 .small,
.h1 .small,
.h2 .small,
.h3 .small,
.h4 .small,
.h5 .small,
.h6 .small {
font-weight: normal;
line-height: 1;
color: #777777;
}
h1,
.h1,
h2,
.h2,
h3,
.h3 {
margin-top: 20px;
margin-bottom: 10px;
}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {
font-size: 65%;
}
h4,
.h4,
h5,
.h5,
h6,
.h6 {
margin-top: 10px;
margin-bottom: 10px;
}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {
font-size: 75%;
}
h1,
.h1 {
font-size: 36px;
}
h2,
.h2 {
font-size: 30px;
}
h3,
.h3 {
font-size: 24px;
}
h4,
.h4 {
font-size: 18px;
}
h5,
.h5 {
font-size: 14px;
}
h6,
.h6 {
font-size: 12px;
}
p {
margin: 0 0 10px;
}
.lead {
margin-bottom: 20px;
font-size: 16px;
font-weight: 300;
line-height: 1.4;
}
@media (min-width: 768px) {
.lead {
font-size: 21px;
}
}
small,
.small {
font-size: 85%;
}
mark,
.mark {
background-color: #fcf8e3;
padding: .2em;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
.text-justify {
text-align: justify;
}
.text-nowrap {
white-space: nowrap;
}
.text-lowercase {
text-transform: lowercase;
}
.text-uppercase {
text-transform: uppercase;
}
.text-capitalize {
text-transform: capitalize;
}
.text-muted {
color: #777777;
}
.text-primary {
color: #337ab7;
}
a.text-primary:hover,
a.text-primary:focus {
color: #286090;
}
.text-success {
color: #3c763d;
}
a.text-success:hover,
a.text-success:focus {
color: #2b542c;
}
.text-info {
color: #31708f;
}
a.text-info:hover,
a.text-info:focus {
color: #245269;
}
.text-warning {
color: #8a6d3b;
}
a.text-warning:hover,
a.text-warning:focus {
color: #66512c;
}
.text-danger {
color: #a94442;
}
a.text-danger:hover,
a.text-danger:focus {
color: #843534;
}
.bg-primary {
color: #fff;
background-color: #337ab7;
}
a.bg-primary:hover,
a.bg-primary:focus {
background-color: #286090;
}
.bg-success {
background-color: #dff0d8;
}
a.bg-success:hover,
a.bg-success:focus {
background-color: #c1e2b3;
}
.bg-info {
background-color: #d9edf7;
}
a.bg-info:hover,
a.bg-info:focus {
background-color: #afd9ee;
}
.bg-warning {
background-color: #fcf8e3;
}
a.bg-warning:hover,
a.bg-warning:focus {
background-color: #f7ecb5;
}
.bg-danger {
background-color: #f2dede;
}
a.bg-danger:hover,
a.bg-danger:focus {
background-color: #e4b9b9;
}
.page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eeeeee;
}
ul,
ol {
margin-top: 0;
margin-bottom: 10px;
}
ul ul,
ol ul,
ul ol,
ol ol {
margin-bottom: 0;
}
.list-unstyled {
padding-left: 0;
list-style: none;
}
.list-inline {
padding-left: 0;
list-style: none;
margin-left: -5px;
}
.list-inline > li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
dl {
margin-top: 0;
margin-bottom: 20px;
}
dt,
dd {
line-height: 1.42857143;
}
dt {
font-weight: bold;
}
dd {
margin-left: 0;
}
@media (min-width: 768px) {
.dl-horizontal dt {
float: left;
width: 160px;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dl-horizontal dd {
margin-left: 180px;
}
}
abbr[title],
abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #777777;
}
.initialism {
font-size: 90%;
text-transform: uppercase;
}
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eeeeee;
}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {
margin-bottom: 0;
}
blockquote footer,
blockquote small,
blockquote .small {
display: block;
font-size: 80%;
line-height: 1.42857143;
color: #777777;
}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {
content: '\2014 \00A0';
}
.blockquote-reverse,
blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
text-align: right;
}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {
content: '';
}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {
content: '\00A0 \2014';
}
address {
margin-bottom: 20px;
font-style: normal;
line-height: 1.42857143;
}
code,
kbd,
pre,
samp {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
border-radius: 4px;
}
kbd {
padding: 2px 4px;
font-size: 90%;
color: #ffffff;
background-color: #333333;
border-radius: 3px;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}
kbd kbd {
padding: 0;
font-size: 100%;
font-weight: bold;
box-shadow: none;
}
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.42857143;
word-break: break-all;
word-wrap: break-word;
color: #333333;
background-color: #f5f5f5;
border: 1px solid #cccccc;
border-radius: 4px;
}
pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0;
}
.pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
.container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
@media (min-width: 768px) {
.container {
width: 750px;
}
}
@media (min-width: 992px) {
.container {
width: 970px;
}
}
@media (min-width: 1200px) {
.container {
width: 1170px;
}
}
.container-fluid {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
.row {
margin-left: -15px;
margin-right: -15px;
}
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
float: left;
}
.col-xs-12 {
width: 100%;
}
.col-xs-11 {
width: 91.66666667%;
}
.col-xs-10 {
width: 83.33333333%;
}
.col-xs-9 {
width: 75%;
}
.col-xs-8 {
width: 66.66666667%;
}
.col-xs-7 {
width: 58.33333333%;
}
.col-xs-6 {
width: 50%;
}
.col-xs-5 {
width: 41.66666667%;
}
.col-xs-4 {
width: 33.33333333%;
}
.col-xs-3 {
width: 25%;
}
.col-xs-2 {
width: 16.66666667%;
}
.col-xs-1 {
width: 8.33333333%;
}
.col-xs-pull-12 {
right: 100%;
}
.col-xs-pull-11 {
right: 91.66666667%;
}
.col-xs-pull-10 {
right: 83.33333333%;
}
.col-xs-pull-9 {
right: 75%;
}
.col-xs-pull-8 {
right: 66.66666667%;
}
.col-xs-pull-7 {
right: 58.33333333%;
}
.col-xs-pull-6 {
right: 50%;
}
.col-xs-pull-5 {
right: 41.66666667%;
}
.col-xs-pull-4 {
right: 33.33333333%;
}
.col-xs-pull-3 {
right: 25%;
}
.col-xs-pull-2 {
right: 16.66666667%;
}
.col-xs-pull-1 {
right: 8.33333333%;
}
.col-xs-pull-0 {
right: auto;
}
.col-xs-push-12 {
left: 100%;
}
.col-xs-push-11 {
left: 91.66666667%;
}
.col-xs-push-10 {
left: 83.33333333%;
}
.col-xs-push-9 {
left: 75%;
}
.col-xs-push-8 {
left: 66.66666667%;
}
.col-xs-push-7 {
left: 58.33333333%;
}
.col-xs-push-6 {
left: 50%;
}
.col-xs-push-5 {
left: 41.66666667%;
}
.col-xs-push-4 {
left: 33.33333333%;
}
.col-xs-push-3 {
left: 25%;
}
.col-xs-push-2 {
left: 16.66666667%;
}
.col-xs-push-1 {
left: 8.33333333%;
}
.col-xs-push-0 {
left: auto;
}
.col-xs-offset-12 {
margin-left: 100%;
}
.col-xs-offset-11 {
margin-left: 91.66666667%;
}
.col-xs-offset-10 {
margin-left: 83.33333333%;
}
.col-xs-offset-9 {
margin-left: 75%;
}
.col-xs-offset-8 {
margin-left: 66.66666667%;
}
.col-xs-offset-7 {
margin-left: 58.33333333%;
}
.col-xs-offset-6 {
margin-left: 50%;
}
.col-xs-offset-5 {
margin-left: 41.66666667%;
}
.col-xs-offset-4 {
margin-left: 33.33333333%;
}
.col-xs-offset-3 {
margin-left: 25%;
}
.col-xs-offset-2 {
margin-left: 16.66666667%;
}
.col-xs-offset-1 {
margin-left: 8.33333333%;
}
.col-xs-offset-0 {
margin-left: 0%;
}
@media (min-width: 768px) {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666667%;
}
.col-sm-10 {
width: 83.33333333%;
}
.col-sm-9 {
width: 75%;
}
.col-sm-8 {
width: 66.66666667%;
}
.col-sm-7 {
width: 58.33333333%;
}
.col-sm-6 {
width: 50%;
}
.col-sm-5 {
width: 41.66666667%;
}
.col-sm-4 {
width: 33.33333333%;
}
.col-sm-3 {
width: 25%;
}
.col-sm-2 {
width: 16.66666667%;
}
.col-sm-1 {
width: 8.33333333%;
}
.col-sm-pull-12 {
right: 100%;
}
.col-sm-pull-11 {
right: 91.66666667%;
}
.col-sm-pull-10 {
right: 83.33333333%;
}
.col-sm-pull-9 {
right: 75%;
}
.col-sm-pull-8 {
right: 66.66666667%;
}
.col-sm-pull-7 {
right: 58.33333333%;
}
.col-sm-pull-6 {
right: 50%;
}
.col-sm-pull-5 {
right: 41.66666667%;
}
.col-sm-pull-4 {
right: 33.33333333%;
}
.col-sm-pull-3 {
right: 25%;
}
.col-sm-pull-2 {
right: 16.66666667%;
}
.col-sm-pull-1 {
right: 8.33333333%;
}
.col-sm-pull-0 {
right: auto;
}
.col-sm-push-12 {
left: 100%;
}
.col-sm-push-11 {
left: 91.66666667%;
}
.col-sm-push-10 {
left: 83.33333333%;
}
.col-sm-push-9 {
left: 75%;
}
.col-sm-push-8 {
left: 66.66666667%;
}
.col-sm-push-7 {
left: 58.33333333%;
}
.col-sm-push-6 {
left: 50%;
}
.col-sm-push-5 {
left: 41.66666667%;
}
.col-sm-push-4 {
left: 33.33333333%;
}
.col-sm-push-3 {
left: 25%;
}
.col-sm-push-2 {
left: 16.66666667%;
}
.col-sm-push-1 {
left: 8.33333333%;
}
.col-sm-push-0 {
left: auto;
}
.col-sm-offset-12 {
margin-left: 100%;
}
.col-sm-offset-11 {
margin-left: 91.66666667%;
}
.col-sm-offset-10 {
margin-left: 83.33333333%;
}
.col-sm-offset-9 {
margin-left: 75%;
}
.col-sm-offset-8 {
margin-left: 66.66666667%;
}
.col-sm-offset-7 {
margin-left: 58.33333333%;
}
.col-sm-offset-6 {
margin-left: 50%;
}
.col-sm-offset-5 {
margin-left: 41.66666667%;
}
.col-sm-offset-4 {
margin-left: 33.33333333%;
}
.col-sm-offset-3 {
margin-left: 25%;
}
.col-sm-offset-2 {
margin-left: 16.66666667%;
}
.col-sm-offset-1 {
margin-left: 8.33333333%;
}
.col-sm-offset-0 {
margin-left: 0%;
}
}
@media (min-width: 992px) {
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
float: left;
}
.col-md-12 {
width: 100%;
}
.col-md-11 {
width: 91.66666667%;
}
.col-md-10 {
width: 83.33333333%;
}
.col-md-9 {
width: 75%;
}
.col-md-8 {
width: 66.66666667%;
}
.col-md-7 {
width: 58.33333333%;
}
.col-md-6 {
width: 50%;
}
.col-md-5 {
width: 41.66666667%;
}
.col-md-4 {
width: 33.33333333%;
}
.col-md-3 {
width: 25%;
}
.col-md-2 {
width: 16.66666667%;
}
.col-md-1 {
width: 8.33333333%;
}
.col-md-pull-12 {
right: 100%;
}
.col-md-pull-11 {
right: 91.66666667%;
}
.col-md-pull-10 {
right: 83.33333333%;
}
.col-md-pull-9 {
right: 75%;
}
.col-md-pull-8 {
right: 66.66666667%;
}
.col-md-pull-7 {
right: 58.33333333%;
}
.col-md-pull-6 {
right: 50%;
}
.col-md-pull-5 {
right: 41.66666667%;
}
.col-md-pull-4 {
right: 33.33333333%;
}
.col-md-pull-3 {
right: 25%;
}
.col-md-pull-2 {
right: 16.66666667%;
}
.col-md-pull-1 {
right: 8.33333333%;
}
.col-md-pull-0 {
right: auto;
}
.col-md-push-12 {
left: 100%;
}
.col-md-push-11 {
left: 91.66666667%;
}
.col-md-push-10 {
left: 83.33333333%;
}
.col-md-push-9 {
left: 75%;
}
.col-md-push-8 {
left: 66.66666667%;
}
.col-md-push-7 {
left: 58.33333333%;
}
.col-md-push-6 {
left: 50%;
}
.col-md-push-5 {
left: 41.66666667%;
}
.col-md-push-4 {
left: 33.33333333%;
}
.col-md-push-3 {
left: 25%;
}
.col-md-push-2 {
left: 16.66666667%;
}
.col-md-push-1 {
left: 8.33333333%;
}
.col-md-push-0 {
left: auto;
}
.col-md-offset-12 {
margin-left: 100%;
}
.col-md-offset-11 {
margin-left: 91.66666667%;
}
.col-md-offset-10 {
margin-left: 83.33333333%;
}
.col-md-offset-9 {
margin-left: 75%;
}
.col-md-offset-8 {
margin-left: 66.66666667%;
}
.col-md-offset-7 {
margin-left: 58.33333333%;
}
.col-md-offset-6 {
margin-left: 50%;
}
.col-md-offset-5 {
margin-left: 41.66666667%;
}
.col-md-offset-4 {
margin-left: 33.33333333%;
}
.col-md-offset-3 {
margin-left: 25%;
}
.col-md-offset-2 {
margin-left: 16.66666667%;
}
.col-md-offset-1 {
margin-left: 8.33333333%;
}
.col-md-offset-0 {
margin-left: 0%;
}
}
@media (min-width: 1200px) {
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
float: left;
}
.col-lg-12 {
width: 100%;
}
.col-lg-11 {
width: 91.66666667%;
}
.col-lg-10 {
width: 83.33333333%;
}
.col-lg-9 {
width: 75%;
}
.col-lg-8 {
width: 66.66666667%;
}
.col-lg-7 {
width: 58.33333333%;
}
.col-lg-6 {
width: 50%;
}
.col-lg-5 {
width: 41.66666667%;
}
.col-lg-4 {
width: 33.33333333%;
}
.col-lg-3 {
width: 25%;
}
.col-lg-2 {
width: 16.66666667%;
}
.col-lg-1 {
width: 8.33333333%;
}
.col-lg-pull-12 {
right: 100%;
}
.col-lg-pull-11 {
right: 91.66666667%;
}
.col-lg-pull-10 {
right: 83.33333333%;
}
.col-lg-pull-9 {
right: 75%;
}
.col-lg-pull-8 {
right: 66.66666667%;
}
.col-lg-pull-7 {
right: 58.33333333%;
}
.col-lg-pull-6 {
right: 50%;
}
.col-lg-pull-5 {
right: 41.66666667%;
}
.col-lg-pull-4 {
right: 33.33333333%;
}
.col-lg-pull-3 {
right: 25%;
}
.col-lg-pull-2 {
right: 16.66666667%;
}
.col-lg-pull-1 {
right: 8.33333333%;
}
.col-lg-pull-0 {
right: auto;
}
.col-lg-push-12 {
left: 100%;
}
.col-lg-push-11 {
left: 91.66666667%;
}
.col-lg-push-10 {
left: 83.33333333%;
}
.col-lg-push-9 {
left: 75%;
}
.col-lg-push-8 {
left: 66.66666667%;
}
.col-lg-push-7 {
left: 58.33333333%;
}
.col-lg-push-6 {
left: 50%;
}
.col-lg-push-5 {
left: 41.66666667%;
}
.col-lg-push-4 {
left: 33.33333333%;
}
.col-lg-push-3 {
left: 25%;
}
.col-lg-push-2 {
left: 16.66666667%;
}
.col-lg-push-1 {
left: 8.33333333%;
}
.col-lg-push-0 {
left: auto;
}
.col-lg-offset-12 {
margin-left: 100%;
}
.col-lg-offset-11 {
margin-left: 91.66666667%;
}
.col-lg-offset-10 {
margin-left: 83.33333333%;
}
.col-lg-offset-9 {
margin-left: 75%;
}
.col-lg-offset-8 {
margin-left: 66.66666667%;
}
.col-lg-offset-7 {
margin-left: 58.33333333%;
}
.col-lg-offset-6 {
margin-left: 50%;
}
.col-lg-offset-5 {
margin-left: 41.66666667%;
}
.col-lg-offset-4 {
margin-left: 33.33333333%;
}
.col-lg-offset-3 {
margin-left: 25%;
}
.col-lg-offset-2 {
margin-left: 16.66666667%;
}
.col-lg-offset-1 {
margin-left: 8.33333333%;
}
.col-lg-offset-0 {
margin-left: 0%;
}
}
table {
background-color: transparent;
}
caption {
padding-top: 8px;
padding-bottom: 8px;
color: #777777;
text-align: left;
}
th {
text-align: left;
}
.table {
width: 100%;
max-width: 100%;
margin-bottom: 20px;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
padding: 8px;
line-height: 1.42857143;
vertical-align: top;
border-top: 1px solid #dddddd;
}
.table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #dddddd;
}
.table > caption + thead > tr:first-child > th,
.table > colgroup + thead > tr:first-child > th,
.table > thead:first-child > tr:first-child > th,
.table > caption + thead > tr:first-child > td,
.table > colgroup + thead > tr:first-child > td,
.table > thead:first-child > tr:first-child > td {
border-top: 0;
}
.table > tbody + tbody {
border-top: 2px solid #dddddd;
}
.table .table {
background-color: #ffffff;
}
.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > tbody > tr > td,
.table-condensed > tfoot > tr > td {
padding: 5px;
}
.table-bordered {
border: 1px solid #dddddd;
}
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
border: 1px solid #dddddd;
}
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
.table-striped > tbody > tr:nth-of-type(odd) {
background-color: #f9f9f9;
}
.table-hover > tbody > tr:hover {
background-color: #f5f5f5;
}
table col[class*="col-"] {
position: static;
float: none;
display: table-column;
}
table td[class*="col-"],
table th[class*="col-"] {
position: static;
float: none;
display: table-cell;
}
.table > thead > tr > td.active,
.table > tbody > tr > td.active,
.table > tfoot > tr > td.active,
.table > thead > tr > th.active,
.table > tbody > tr > th.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > tbody > tr.active > td,
.table > tfoot > tr.active > td,
.table > thead > tr.active > th,
.table > tbody > tr.active > th,
.table > tfoot > tr.active > th {
background-color: #f5f5f5;
}
.table-hover > tbody > tr > td.active:hover,
.table-hover > tbody > tr > th.active:hover,
.table-hover > tbody > tr.active:hover > td,
.table-hover > tbody > tr:hover > .active,
.table-hover > tbody > tr.active:hover > th {
background-color: #e8e8e8;
}
.table > thead > tr > td.success,
.table > tbody > tr > td.success,
.table > tfoot > tr > td.success,
.table > thead > tr > th.success,
.table > tbody > tr > th.success,
.table > tfoot > tr > th.success,
.table > thead > tr.success > td,
.table > tbody > tr.success > td,
.table > tfoot > tr.success > td,
.table > thead > tr.success > th,
.table > tbody > tr.success > th,
.table > tfoot > tr.success > th {
background-color: #dff0d8;
}
.table-hover > tbody > tr > td.success:hover,
.table-hover > tbody > tr > th.success:hover,
.table-hover > tbody > tr.success:hover > td,
.table-hover > tbody > tr:hover > .success,
.table-hover > tbody > tr.success:hover > th {
background-color: #d0e9c6;
}
.table > thead > tr > td.info,
.table > tbody > tr > td.info,
.table > tfoot > tr > td.info,
.table > thead > tr > th.info,
.table > tbody > tr > th.info,
.table > tfoot > tr > th.info,
.table > thead > tr.info > td,
.table > tbody > tr.info > td,
.table > tfoot > tr.info > td,
.table > thead > tr.info > th,
.table > tbody > tr.info > th,
.table > tfoot > tr.info > th {
background-color: #d9edf7;
}
.table-hover > tbody > tr > td.info:hover,
.table-hover > tbody > tr > th.info:hover,
.table-hover > tbody > tr.info:hover > td,
.table-hover > tbody > tr:hover > .info,
.table-hover > tbody > tr.info:hover > th {
background-color: #c4e3f3;
}
.table > thead > tr > td.warning,
.table > tbody > tr > td.warning,
.table > tfoot > tr > td.warning,
.table > thead > tr > th.warning,
.table > tbody > tr > th.warning,
.table > tfoot > tr > th.warning,
.table > thead > tr.warning > td,
.table > tbody > tr.warning > td,
.table > tfoot > tr.warning > td,
.table > thead > tr.warning > th,
.table > tbody > tr.warning > th,
.table > tfoot > tr.warning > th {
background-color: #fcf8e3;
}
.table-hover > tbody > tr > td.warning:hover,
.table-hover > tbody > tr > th.warning:hover,
.table-hover > tbody > tr.warning:hover > td,
.table-hover > tbody > tr:hover > .warning,
.table-hover > tbody > tr.warning:hover > th {
background-color: #faf2cc;
}
.table > thead > tr > td.danger,
.table > tbody > tr > td.danger,
.table > tfoot > tr > td.danger,
.table > thead > tr > th.danger,
.table > tbody > tr > th.danger,
.table > tfoot > tr > th.danger,
.table > thead > tr.danger > td,
.table > tbody > tr.danger > td,
.table > tfoot > tr.danger > td,
.table > thead > tr.danger > th,
.table > tbody > tr.danger > th,
.table > tfoot > tr.danger > th {
background-color: #f2dede;
}
.table-hover > tbody > tr > td.danger:hover,
.table-hover > tbody > tr > th.danger:hover,
.table-hover > tbody > tr.danger:hover > td,
.table-hover > tbody > tr:hover > .danger,
.table-hover > tbody > tr.danger:hover > th {
background-color: #ebcccc;
}
.table-responsive {
overflow-x: auto;
min-height: 0.01%;
}
@media screen and (max-width: 767px) {
.table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
-ms-overflow-style: -ms-autohiding-scrollbar;
border: 1px solid #dddddd;
}
.table-responsive > .table {
margin-bottom: 0;
}
.table-responsive > .table > thead > tr > th,
.table-responsive > .table > tbody > tr > th,
.table-responsive > .table > tfoot > tr > th,
.table-responsive > .table > thead > tr > td,
.table-responsive > .table > tbody > tr > td,
.table-responsive > .table > tfoot > tr > td {
white-space: nowrap;
}
.table-responsive > .table-bordered {
border: 0;
}
.table-responsive > .table-bordered > thead > tr > th:first-child,
.table-responsive > .table-bordered > tbody > tr > th:first-child,
.table-responsive > .table-bordered > tfoot > tr > th:first-child,
.table-responsive > .table-bordered > thead > tr > td:first-child,
.table-responsive > .table-bordered > tbody > tr > td:first-child,
.table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.table-responsive > .table-bordered > thead > tr > th:last-child,
.table-responsive > .table-bordered > tbody > tr > th:last-child,
.table-responsive > .table-bordered > tfoot > tr > th:last-child,
.table-responsive > .table-bordered > thead > tr > td:last-child,
.table-responsive > .table-bordered > tbody > tr > td:last-child,
.table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.table-responsive > .table-bordered > tbody > tr:last-child > th,
.table-responsive > .table-bordered > tfoot > tr:last-child > th,
.table-responsive > .table-bordered > tbody > tr:last-child > td,
.table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
}
fieldset {
padding: 0;
margin: 0;
border: 0;
min-width: 0;
}
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #333333;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
label {
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
font-weight: bold;
}
input[type="search"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
input[type="radio"],
input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
line-height: normal;
}
input[type="file"] {
display: block;
}
input[type="range"] {
display: block;
width: 100%;
}
select[multiple],
select[size] {
height: auto;
}
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
output {
display: block;
padding-top: 7px;
font-size: 14px;
line-height: 1.42857143;
color: #555555;
}
.form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555555;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 4px;
-webkit-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-color ease-in-out .15s, box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.form-control::-moz-placeholder {
color: #999999;
opacity: 1;
}
.form-control:-ms-input-placeholder {
color: #999999;
}
.form-control::-webkit-input-placeholder {
color: #999999;
}
.form-control::-ms-expand {
border: 0;
background-color: transparent;
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
background-color: #eeeeee;
opacity: 1;
}
.form-control[disabled],
fieldset[disabled] .form-control {
cursor: not-allowed;
}
textarea.form-control {
height: auto;
}
input[type="search"] {
-webkit-appearance: none;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control,
input[type="month"].form-control {
line-height: 34px;
}
input[type="date"].input-sm,
input[type="time"].input-sm,
input[type="datetime-local"].input-sm,
input[type="month"].input-sm,
.input-group-sm input[type="date"],
.input-group-sm input[type="time"],
.input-group-sm input[type="datetime-local"],
.input-group-sm input[type="month"] {
line-height: 30px;
}
input[type="date"].input-lg,
input[type="time"].input-lg,
input[type="datetime-local"].input-lg,
input[type="month"].input-lg,
.input-group-lg input[type="date"],
.input-group-lg input[type="time"],
.input-group-lg input[type="datetime-local"],
.input-group-lg input[type="month"] {
line-height: 46px;
}
}
.form-group {
margin-bottom: 15px;
}
.radio,
.checkbox {
position: relative;
display: block;
margin-top: 10px;
margin-bottom: 10px;
}
.radio label,
.checkbox label {
min-height: 20px;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
.radio input[type="radio"],
.radio-inline input[type="radio"],
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
position: absolute;
margin-left: -20px;
margin-top: 4px \9;
}
.radio + .radio,
.checkbox + .checkbox {
margin-top: -5px;
}
.radio-inline,
.checkbox-inline {
position: relative;
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
vertical-align: middle;
font-weight: normal;
cursor: pointer;
}
.radio-inline + .radio-inline,
.checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px;
}
input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"].disabled,
input[type="checkbox"].disabled,
fieldset[disabled] input[type="radio"],
fieldset[disabled] input[type="checkbox"] {
cursor: not-allowed;
}
.radio-inline.disabled,
.checkbox-inline.disabled,
fieldset[disabled] .radio-inline,
fieldset[disabled] .checkbox-inline {
cursor: not-allowed;
}
.radio.disabled label,
.checkbox.disabled label,
fieldset[disabled] .radio label,
fieldset[disabled] .checkbox label {
cursor: not-allowed;
}
.form-control-static {
padding-top: 7px;
padding-bottom: 7px;
margin-bottom: 0;
min-height: 34px;
}
.form-control-static.input-lg,
.form-control-static.input-sm {
padding-left: 0;
padding-right: 0;
}
.input-sm {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-sm {
height: 30px;
line-height: 30px;
}
textarea.input-sm,
select[multiple].input-sm {
height: auto;
}
.form-group-sm .form-control {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.form-group-sm select.form-control {
height: 30px;
line-height: 30px;
}
.form-group-sm textarea.form-control,
.form-group-sm select[multiple].form-control {
height: auto;
}
.form-group-sm .form-control-static {
height: 30px;
min-height: 32px;
padding: 6px 10px;
font-size: 12px;
line-height: 1.5;
}
.input-lg {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
select.input-lg {
height: 46px;
line-height: 46px;
}
textarea.input-lg,
select[multiple].input-lg {
height: auto;
}
.form-group-lg .form-control {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
.form-group-lg select.form-control {
height: 46px;
line-height: 46px;
}
.form-group-lg textarea.form-control,
.form-group-lg select[multiple].form-control {
height: auto;
}
.form-group-lg .form-control-static {
height: 46px;
min-height: 38px;
padding: 11px 16px;
font-size: 18px;
line-height: 1.3333333;
}
.has-feedback {
position: relative;
}
.has-feedback .form-control {
padding-right: 42.5px;
}
.form-control-feedback {
position: absolute;
top: 0;
right: 0;
z-index: 2;
display: block;
width: 34px;
height: 34px;
line-height: 34px;
text-align: center;
pointer-events: none;
}
.input-lg + .form-control-feedback,
.input-group-lg + .form-control-feedback,
.form-group-lg .form-control + .form-control-feedback {
width: 46px;
height: 46px;
line-height: 46px;
}
.input-sm + .form-control-feedback,
.input-group-sm + .form-control-feedback,
.form-group-sm .form-control + .form-control-feedback {
width: 30px;
height: 30px;
line-height: 30px;
}
.has-success .help-block,
.has-success .control-label,
.has-success .radio,
.has-success .checkbox,
.has-success .radio-inline,
.has-success .checkbox-inline,
.has-success.radio label,
.has-success.checkbox label,
.has-success.radio-inline label,
.has-success.checkbox-inline label {
color: #3c763d;
}
.has-success .form-control {
border-color: #3c763d;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-success .form-control:focus {
border-color: #2b542c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
}
.has-success .input-group-addon {
color: #3c763d;
border-color: #3c763d;
background-color: #dff0d8;
}
.has-success .form-control-feedback {
color: #3c763d;
}
.has-warning .help-block,
.has-warning .control-label,
.has-warning .radio,
.has-warning .checkbox,
.has-warning .radio-inline,
.has-warning .checkbox-inline,
.has-warning.radio label,
.has-warning.checkbox label,
.has-warning.radio-inline label,
.has-warning.checkbox-inline label {
color: #8a6d3b;
}
.has-warning .form-control {
border-color: #8a6d3b;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-warning .form-control:focus {
border-color: #66512c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
}
.has-warning .input-group-addon {
color: #8a6d3b;
border-color: #8a6d3b;
background-color: #fcf8e3;
}
.has-warning .form-control-feedback {
color: #8a6d3b;
}
.has-error .help-block,
.has-error .control-label,
.has-error .radio,
.has-error .checkbox,
.has-error .radio-inline,
.has-error .checkbox-inline,
.has-error.radio label,
.has-error.checkbox label,
.has-error.radio-inline label,
.has-error.checkbox-inline label {
color: #a94442;
}
.has-error .form-control {
border-color: #a94442;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-error .form-control:focus {
border-color: #843534;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
}
.has-error .input-group-addon {
color: #a94442;
border-color: #a94442;
background-color: #f2dede;
}
.has-error .form-control-feedback {
color: #a94442;
}
.has-feedback label ~ .form-control-feedback {
top: 25px;
}
.has-feedback label.sr-only ~ .form-control-feedback {
top: 0;
}
.help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #737373;
}
@media (min-width: 768px) {
.form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
.form-inline .form-control-static {
display: inline-block;
}
.form-inline .input-group {
display: inline-table;
vertical-align: middle;
}
.form-inline .input-group .input-group-addon,
.form-inline .input-group .input-group-btn,
.form-inline .input-group .form-control {
width: auto;
}
.form-inline .input-group > .form-control {
width: 100%;
}
.form-inline .control-label {
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio,
.form-inline .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio label,
.form-inline .checkbox label {
padding-left: 0;
}
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
position: relative;
margin-left: 0;
}
.form-inline .has-feedback .form-control-feedback {
top: 0;
}
}
.form-horizontal .radio,
.form-horizontal .checkbox,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
margin-top: 0;
margin-bottom: 0;
padding-top: 7px;
}
.form-horizontal .radio,
.form-horizontal .checkbox {
min-height: 27px;
}
.form-horizontal .form-group {
margin-left: -15px;
margin-right: -15px;
}
@media (min-width: 768px) {
.form-horizontal .control-label {
text-align: right;
margin-bottom: 0;
padding-top: 7px;
}
}
.form-horizontal .has-feedback .form-control-feedback {
right: 15px;
}
@media (min-width: 768px) {
.form-horizontal .form-group-lg .control-label {
padding-top: 11px;
font-size: 18px;
}
}
@media (min-width: 768px) {
.form-horizontal .form-group-sm .control-label {
padding-top: 6px;
font-size: 12px;
}
}
.btn {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.btn:focus,
.btn:active:focus,
.btn.active:focus,
.btn.focus,
.btn:active.focus,
.btn.active.focus {
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.btn:hover,
.btn:focus,
.btn.focus {
color: #333333;
text-decoration: none;
}
.btn:active,
.btn.active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
cursor: not-allowed;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
a.btn.disabled,
fieldset[disabled] a.btn {
pointer-events: none;
}
.btn-default {
color: #333333;
background-color: #ffffff;
border-color: #cccccc;
}
.btn-default:focus,
.btn-default.focus {
color: #333333;
background-color: #e6e6e6;
border-color: #8c8c8c;
}
.btn-default:hover {
color: #333333;
background-color: #e6e6e6;
border-color: #adadad;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #333333;
background-color: #e6e6e6;
border-color: #adadad;
}
.btn-default:active:hover,
.btn-default.active:hover,
.open > .dropdown-toggle.btn-default:hover,
.btn-default:active:focus,
.btn-default.active:focus,
.open > .dropdown-toggle.btn-default:focus,
.btn-default:active.focus,
.btn-default.active.focus,
.open > .dropdown-toggle.btn-default.focus {
color: #333333;
background-color: #d4d4d4;
border-color: #8c8c8c;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
background-image: none;
}
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled.focus,
.btn-default[disabled].focus,
fieldset[disabled] .btn-default.focus {
background-color: #ffffff;
border-color: #cccccc;
}
.btn-default .badge {
color: #ffffff;
background-color: #333333;
}
.btn-primary {
color: #ffffff;
background-color: #337ab7;
border-color: #2e6da4;
}
.btn-primary:focus,
.btn-primary.focus {
color: #ffffff;
background-color: #286090;
border-color: #122b40;
}
.btn-primary:hover {
color: #ffffff;
background-color: #286090;
border-color: #204d74;
}
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
color: #ffffff;
background-color: #286090;
border-color: #204d74;
}
.btn-primary:active:hover,
.btn-primary.active:hover,
.open > .dropdown-toggle.btn-primary:hover,
.btn-primary:active:focus,
.btn-primary.active:focus,
.open > .dropdown-toggle.btn-primary:focus,
.btn-primary:active.focus,
.btn-primary.active.focus,
.open > .dropdown-toggle.btn-primary.focus {
color: #ffffff;
background-color: #204d74;
border-color: #122b40;
}
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
background-image: none;
}
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled.focus,
.btn-primary[disabled].focus,
fieldset[disabled] .btn-primary.focus {
background-color: #337ab7;
border-color: #2e6da4;
}
.btn-primary .badge {
color: #337ab7;
background-color: #ffffff;
}
.btn-success {
color: #ffffff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success:focus,
.btn-success.focus {
color: #ffffff;
background-color: #449d44;
border-color: #255625;
}
.btn-success:hover {
color: #ffffff;
background-color: #449d44;
border-color: #398439;
}
.btn-success:active,
.btn-success.active,
.open > .dropdown-toggle.btn-success {
color: #ffffff;
background-color: #449d44;
border-color: #398439;
}
.btn-success:active:hover,
.btn-success.active:hover,
.open > .dropdown-toggle.btn-success:hover,
.btn-success:active:focus,
.btn-success.active:focus,
.open > .dropdown-toggle.btn-success:focus,
.btn-success:active.focus,
.btn-success.active.focus,
.open > .dropdown-toggle.btn-success.focus {
color: #ffffff;
background-color: #398439;
border-color: #255625;
}
.btn-success:active,
.btn-success.active,
.open > .dropdown-toggle.btn-success {
background-image: none;
}
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled.focus,
.btn-success[disabled].focus,
fieldset[disabled] .btn-success.focus {
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success .badge {
color: #5cb85c;
background-color: #ffffff;
}
.btn-info {
color: #ffffff;
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info:focus,
.btn-info.focus {
color: #ffffff;
background-color: #31b0d5;
border-color: #1b6d85;
}
.btn-info:hover {
color: #ffffff;
background-color: #31b0d5;
border-color: #269abc;
}
.btn-info:active,
.btn-info.active,
.open > .dropdown-toggle.btn-info {
color: #ffffff;
background-color: #31b0d5;
border-color: #269abc;
}
.btn-info:active:hover,
.btn-info.active:hover,
.open > .dropdown-toggle.btn-info:hover,
.btn-info:active:focus,
.btn-info.active:focus,
.open > .dropdown-toggle.btn-info:focus,
.btn-info:active.focus,
.btn-info.active.focus,
.open > .dropdown-toggle.btn-info.focus {
color: #ffffff;
background-color: #269abc;
border-color: #1b6d85;
}
.btn-info:active,
.btn-info.active,
.open > .dropdown-toggle.btn-info {
background-image: none;
}
.btn-info.disabled:hover,
.btn-info[disabled]:hover,
fieldset[disabled] .btn-info:hover,
.btn-info.disabled:focus,
.btn-info[disabled]:focus,
fieldset[disabled] .btn-info:focus,
.btn-info.disabled.focus,
.btn-info[disabled].focus,
fieldset[disabled] .btn-info.focus {
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info .badge {
color: #5bc0de;
background-color: #ffffff;
}
.btn-warning {
color: #ffffff;
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning:focus,
.btn-warning.focus {
color: #ffffff;
background-color: #ec971f;
border-color: #985f0d;
}
.btn-warning:hover {
color: #ffffff;
background-color: #ec971f;
border-color: #d58512;
}
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
color: #ffffff;
background-color: #ec971f;
border-color: #d58512;
}
.btn-warning:active:hover,
.btn-warning.active:hover,
.open > .dropdown-toggle.btn-warning:hover,
.btn-warning:active:focus,
.btn-warning.active:focus,
.open > .dropdown-toggle.btn-warning:focus,
.btn-warning:active.focus,
.btn-warning.active.focus,
.open > .dropdown-toggle.btn-warning.focus {
color: #ffffff;
background-color: #d58512;
border-color: #985f0d;
}
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
background-image: none;
}
.btn-warning.disabled:hover,
.btn-warning[disabled]:hover,
fieldset[disabled] .btn-warning:hover,
.btn-warning.disabled:focus,
.btn-warning[disabled]:focus,
fieldset[disabled] .btn-warning:focus,
.btn-warning.disabled.focus,
.btn-warning[disabled].focus,
fieldset[disabled] .btn-warning.focus {
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning .badge {
color: #f0ad4e;
background-color: #ffffff;
}
.btn-danger {
color: #ffffff;
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger:focus,
.btn-danger.focus {
color: #ffffff;
background-color: #c9302c;
border-color: #761c19;
}
.btn-danger:hover {
color: #ffffff;
background-color: #c9302c;
border-color: #ac2925;
}
.btn-danger:active,
.btn-danger.active,
.open > .dropdown-toggle.btn-danger {
color: #ffffff;
background-color: #c9302c;
border-color: #ac2925;
}
.btn-danger:active:hover,
.btn-danger.active:hover,
.open > .dropdown-toggle.btn-danger:hover,
.btn-danger:active:focus,
.btn-danger.active:focus,
.open > .dropdown-toggle.btn-danger:focus,
.btn-danger:active.focus,
.btn-danger.active.focus,
.open > .dropdown-toggle.btn-danger.focus {
color: #ffffff;
background-color: #ac2925;
border-color: #761c19;
}
.btn-danger:active,
.btn-danger.active,
.open > .dropdown-toggle.btn-danger {
background-image: none;
}
.btn-danger.disabled:hover,
.btn-danger[disabled]:hover,
fieldset[disabled] .btn-danger:hover,
.btn-danger.disabled:focus,
.btn-danger[disabled]:focus,
fieldset[disabled] .btn-danger:focus,
.btn-danger.disabled.focus,
.btn-danger[disabled].focus,
fieldset[disabled] .btn-danger.focus {
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger .badge {
color: #d9534f;
background-color: #ffffff;
}
.btn-link {
color: #337ab7;
font-weight: normal;
border-radius: 0;
}
.btn-link,
.btn-link:active,
.btn-link.active,
.btn-link[disabled],
fieldset[disabled] .btn-link {
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-link,
.btn-link:hover,
.btn-link:focus,
.btn-link:active {
border-color: transparent;
}
.btn-link:hover,
.btn-link:focus {
color: #23527c;
text-decoration: underline;
background-color: transparent;
}
.btn-link[disabled]:hover,
fieldset[disabled] .btn-link:hover,
.btn-link[disabled]:focus,
fieldset[disabled] .btn-link:focus {
color: #777777;
text-decoration: none;
}
.btn-lg,
.btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
.btn-sm,
.btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-xs,
.btn-group-xs > .btn {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-block {
display: block;
width: 100%;
}
.btn-block + .btn-block {
margin-top: 5px;
}
input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
width: 100%;
}
.fade {
opacity: 0;
-webkit-transition: opacity 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
.fade.in {
opacity: 1;
}
.collapse {
display: none;
}
.collapse.in {
display: block;
}
tr.collapse.in {
display: table-row;
}
tbody.collapse.in {
display: table-row-group;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-property: height, visibility;
transition-property: height, visibility;
-webkit-transition-duration: 0.35s;
transition-duration: 0.35s;
-webkit-transition-timing-function: ease;
transition-timing-function: ease;
}
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px dashed;
border-top: 4px solid \9;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
}
.dropup,
.dropdown {
position: relative;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: 14px;
text-align: left;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
}
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.42857143;
color: #333333;
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #ffffff;
text-decoration: none;
outline: 0;
background-color: #337ab7;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
color: #777777;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
.open > .dropdown-menu {
display: block;
}
.open > a {
outline: 0;
}
.dropdown-menu-right {
left: auto;
right: 0;
}
.dropdown-menu-left {
left: 0;
right: auto;
}
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.42857143;
color: #777777;
white-space: nowrap;
}
.dropdown-backdrop {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 990;
}
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
border-top: 0;
border-bottom: 4px dashed;
border-bottom: 4px solid \9;
content: "";
}
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 2px;
}
@media (min-width: 768px) {
.navbar-right .dropdown-menu {
left: auto;
right: 0;
}
.navbar-right .dropdown-menu-left {
left: 0;
right: auto;
}
}
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle;
}
.btn-group > .btn,
.btn-group-vertical > .btn {
position: relative;
float: left;
}
.btn-group > .btn:hover,
.btn-group-vertical > .btn:hover,
.btn-group > .btn:focus,
.btn-group-vertical > .btn:focus,
.btn-group > .btn:active,
.btn-group-vertical > .btn:active,
.btn-group > .btn.active,
.btn-group-vertical > .btn.active {
z-index: 2;
}
.btn-group .btn + .btn,
.btn-group .btn + .btn-group,
.btn-group .btn-group + .btn,
.btn-group .btn-group + .btn-group {
margin-left: -1px;
}
.btn-toolbar {
margin-left: -5px;
}
.btn-toolbar .btn,
.btn-toolbar .btn-group,
.btn-toolbar .input-group {
float: left;
}
.btn-toolbar > .btn,
.btn-toolbar > .btn-group,
.btn-toolbar > .input-group {
margin-left: 5px;
}
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
.btn-group > .btn:first-child {
margin-left: 0;
}
.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.btn-group > .btn:last-child:not(:first-child),
.btn-group > .dropdown-toggle:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.btn-group > .btn-group {
float: left;
}
.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
.btn-group > .btn + .dropdown-toggle {
padding-left: 8px;
padding-right: 8px;
}
.btn-group > .btn-lg + .dropdown-toggle {
padding-left: 12px;
padding-right: 12px;
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn-group.open .dropdown-toggle.btn-link {
-webkit-box-shadow: none;
box-shadow: none;
}
.btn .caret {
margin-left: 0;
}
.btn-lg .caret {
border-width: 5px 5px 0;
border-bottom-width: 0;
}
.dropup .btn-lg .caret {
border-width: 0 5px 5px;
}
.btn-group-vertical > .btn,
.btn-group-vertical > .btn-group,
.btn-group-vertical > .btn-group > .btn {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.btn-group-vertical > .btn-group > .btn {
float: none;
}
.btn-group-vertical > .btn + .btn,
.btn-group-vertical > .btn + .btn-group,
.btn-group-vertical > .btn-group + .btn,
.btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0;
}
.btn-group-vertical > .btn:first-child:not(:last-child) {
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn:last-child:not(:first-child) {
border-top-right-radius: 0;
border-top-left-radius: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.btn-group-justified > .btn,
.btn-group-justified > .btn-group {
float: none;
display: table-cell;
width: 1%;
}
.btn-group-justified > .btn-group .btn {
width: 100%;
}
.btn-group-justified > .btn-group .dropdown-menu {
left: auto;
}
[data-toggle="buttons"] > .btn input[type="radio"],
[data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
[data-toggle="buttons"] > .btn input[type="checkbox"],
[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;
}
.input-group {
position: relative;
display: table;
border-collapse: separate;
}
.input-group[class*="col-"] {
float: none;
padding-left: 0;
padding-right: 0;
}
.input-group .form-control {
position: relative;
z-index: 2;
float: left;
width: 100%;
margin-bottom: 0;
}
.input-group .form-control:focus {
z-index: 3;
}
.input-group-lg > .form-control,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .btn {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
border-radius: 6px;
}
select.input-group-lg > .form-control,
select.input-group-lg > .input-group-addon,
select.input-group-lg > .input-group-btn > .btn {
height: 46px;
line-height: 46px;
}
textarea.input-group-lg > .form-control,
textarea.input-group-lg > .input-group-addon,
textarea.input-group-lg > .input-group-btn > .btn,
select[multiple].input-group-lg > .form-control,
select[multiple].input-group-lg > .input-group-addon,
select[multiple].input-group-lg > .input-group-btn > .btn {
height: auto;
}
.input-group-sm > .form-control,
.input-group-sm > .input-group-addon,
.input-group-sm > .input-group-btn > .btn {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-group-sm > .form-control,
select.input-group-sm > .input-group-addon,
select.input-group-sm > .input-group-btn > .btn {
height: 30px;
line-height: 30px;
}
textarea.input-group-sm > .form-control,
textarea.input-group-sm > .input-group-addon,
textarea.input-group-sm > .input-group-btn > .btn,
select[multiple].input-group-sm > .form-control,
select[multiple].input-group-sm > .input-group-addon,
select[multiple].input-group-sm > .input-group-btn > .btn {
height: auto;
}
.input-group-addon,
.input-group-btn,
.input-group .form-control {
display: table-cell;
}
.input-group-addon:not(:first-child):not(:last-child),
.input-group-btn:not(:first-child):not(:last-child),
.input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0;
}
.input-group-addon,
.input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle;
}
.input-group-addon {
padding: 6px 12px;
font-size: 14px;
font-weight: normal;
line-height: 1;
color: #555555;
text-align: center;
background-color: #eeeeee;
border: 1px solid #cccccc;
border-radius: 4px;
}
.input-group-addon.input-sm {
padding: 5px 10px;
font-size: 12px;
border-radius: 3px;
}
.input-group-addon.input-lg {
padding: 10px 16px;
font-size: 18px;
border-radius: 6px;
}
.input-group-addon input[type="radio"],
.input-group-addon input[type="checkbox"] {
margin-top: 0;
}
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.input-group-addon:first-child {
border-right: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child),
.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.input-group-addon:last-child {
border-left: 0;
}
.input-group-btn {
position: relative;
font-size: 0;
white-space: nowrap;
}
.input-group-btn > .btn {
position: relative;
}
.input-group-btn > .btn + .btn {
margin-left: -1px;
}
.input-group-btn > .btn:hover,
.input-group-btn > .btn:focus,
.input-group-btn > .btn:active {
z-index: 2;
}
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group {
margin-right: -1px;
}
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group {
z-index: 2;
margin-left: -1px;
}
.nav {
margin-bottom: 0;
padding-left: 0;
list-style: none;
}
.nav > li {
position: relative;
display: block;
}
.nav > li > a {
position: relative;
display: block;
padding: 10px 15px;
}
.nav > li > a:hover,
.nav > li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.nav > li.disabled > a {
color: #777777;
}
.nav > li.disabled > a:hover,
.nav > li.disabled > a:focus {
color: #777777;
text-decoration: none;
background-color: transparent;
cursor: not-allowed;
}
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus {
background-color: #eeeeee;
border-color: #337ab7;
}
.nav .nav-divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.nav > li > a > img {
max-width: none;
}
.nav-tabs {
border-bottom: 1px solid #dddddd;
}
.nav-tabs > li {
float: left;
margin-bottom: -1px;
}
.nav-tabs > li > a {
margin-right: 2px;
line-height: 1.42857143;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
}
.nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #dddddd;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
color: #555555;
background-color: #ffffff;
border: 1px solid #dddddd;
border-bottom-color: transparent;
cursor: default;
}
.nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.nav-tabs.nav-justified > li {
float: none;
}
.nav-tabs.nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
.nav-tabs.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs.nav-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border: 1px solid #dddddd;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #dddddd;
border-radius: 4px 4px 0 0;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border-bottom-color: #ffffff;
}
}
.nav-pills > li {
float: left;
}
.nav-pills > li > a {
border-radius: 4px;
}
.nav-pills > li + li {
margin-left: 2px;
}
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
color: #ffffff;
background-color: #337ab7;
}
.nav-stacked > li {
float: none;
}
.nav-stacked > li + li {
margin-top: 2px;
margin-left: 0;
}
.nav-justified {
width: 100%;
}
.nav-justified > li {
float: none;
}
.nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs-justified {
border-bottom: 0;
}
.nav-tabs-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border: 1px solid #dddddd;
}
@media (min-width: 768px) {
.nav-tabs-justified > li > a {
border-bottom: 1px solid #dddddd;
border-radius: 4px 4px 0 0;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border-bottom-color: #ffffff;
}
}
.tab-content > .tab-pane {
display: none;
}
.tab-content > .active {
display: block;
}
.nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.navbar {
position: relative;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent;
}
@media (min-width: 768px) {
.navbar {
border-radius: 4px;
}
}
@media (min-width: 768px) {
.navbar-header {
float: left;
}
}
.navbar-collapse {
overflow-x: visible;
padding-right: 15px;
padding-left: 15px;
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-webkit-overflow-scrolling: touch;
}
.navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
.navbar-collapse {
width: auto;
border-top: 0;
box-shadow: none;
}
.navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.navbar-collapse.in {
overflow-y: visible;
}
.navbar-fixed-top .navbar-collapse,
.navbar-static-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
padding-left: 0;
padding-right: 0;
}
}
.navbar-fixed-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
max-height: 340px;
}
@media (max-device-width: 480px) and (orientation: landscape) {
.navbar-fixed-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
max-height: 200px;
}
}
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: 0;
margin-left: 0;
}
}
.navbar-static-top {
z-index: 1000;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.navbar-static-top {
border-radius: 0;
}
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
}
@media (min-width: 768px) {
.navbar-fixed-top,
.navbar-fixed-bottom {
border-radius: 0;
}
}
.navbar-fixed-top {
top: 0;
border-width: 0 0 1px;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
border-width: 1px 0 0;
}
.navbar-brand {
float: left;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
height: 50px;
}
.navbar-brand:hover,
.navbar-brand:focus {
text-decoration: none;
}
.navbar-brand > img {
display: block;
}
@media (min-width: 768px) {
.navbar > .container .navbar-brand,
.navbar > .container-fluid .navbar-brand {
margin-left: -15px;
}
}
.navbar-toggle {
position: relative;
float: right;
margin-right: 15px;
padding: 9px 10px;
margin-top: 8px;
margin-bottom: 8px;
background-color: transparent;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.navbar-toggle:focus {
outline: 0;
}
.navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
}
.navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
@media (min-width: 768px) {
.navbar-toggle {
display: none;
}
}
.navbar-nav {
margin: 7.5px -15px;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
}
@media (max-width: 767px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none;
}
.navbar-nav .open .dropdown-menu > li > a,
.navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px;
}
.navbar-nav .open .dropdown-menu > li > a {
line-height: 20px;
}
.navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-nav .open .dropdown-menu > li > a:focus {
background-image: none;
}
}
@media (min-width: 768px) {
.navbar-nav {
float: left;
margin: 0;
}
.navbar-nav > li {
float: left;
}
.navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
}
.navbar-form {
margin-left: -15px;
margin-right: -15px;
padding: 10px 15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
margin-top: 8px;
margin-bottom: 8px;
}
@media (min-width: 768px) {
.navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
.navbar-form .form-control-static {
display: inline-block;
}
.navbar-form .input-group {
display: inline-table;
vertical-align: middle;
}
.navbar-form .input-group .input-group-addon,
.navbar-form .input-group .input-group-btn,
.navbar-form .input-group .form-control {
width: auto;
}
.navbar-form .input-group > .form-control {
width: 100%;
}
.navbar-form .control-label {
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .radio,
.navbar-form .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .radio label,
.navbar-form .checkbox label {
padding-left: 0;
}
.navbar-form .radio input[type="radio"],
.navbar-form .checkbox input[type="checkbox"] {
position: relative;
margin-left: 0;
}
.navbar-form .has-feedback .form-control-feedback {
top: 0;
}
}
@media (max-width: 767px) {
.navbar-form .form-group {
margin-bottom: 5px;
}
.navbar-form .form-group:last-child {
margin-bottom: 0;
}
}
@media (min-width: 768px) {
.navbar-form {
width: auto;
border: 0;
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
margin-bottom: 0;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.navbar-btn {
margin-top: 8px;
margin-bottom: 8px;
}
.navbar-btn.btn-sm {
margin-top: 10px;
margin-bottom: 10px;
}
.navbar-btn.btn-xs {
margin-top: 14px;
margin-bottom: 14px;
}
.navbar-text {
margin-top: 15px;
margin-bottom: 15px;
}
@media (min-width: 768px) {
.navbar-text {
float: left;
margin-left: 15px;
margin-right: 15px;
}
}
@media (min-width: 768px) {
.navbar-left {
float: left !important;
}
.navbar-right {
float: right !important;
margin-right: -15px;
}
.navbar-right ~ .navbar-right {
margin-right: 0;
}
}
.navbar-default {
background-color: #f8f8f8;
border-color: #e7e7e7;
}
.navbar-default .navbar-brand {
color: #777777;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #5e5e5e;
background-color: transparent;
}
.navbar-default .navbar-text {
color: #777777;
}
.navbar-default .navbar-nav > li > a {
color: #777777;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #333333;
background-color: transparent;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav > .disabled > a,
.navbar-default .navbar-nav > .disabled > a:hover,
.navbar-default .navbar-nav > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
.navbar-default .navbar-toggle {
border-color: #dddddd;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #dddddd;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #888888;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #e7e7e7;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
background-color: #e7e7e7;
color: #555555;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777777;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #333333;
background-color: transparent;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
}
.navbar-default .navbar-link {
color: #777777;
}
.navbar-default .navbar-link:hover {
color: #333333;
}
.navbar-default .btn-link {
color: #777777;
}
.navbar-default .btn-link:hover,
.navbar-default .btn-link:focus {
color: #333333;
}
.navbar-default .btn-link[disabled]:hover,
fieldset[disabled] .navbar-default .btn-link:hover,
.navbar-default .btn-link[disabled]:focus,
fieldset[disabled] .navbar-default .btn-link:focus {
color: #cccccc;
}
.navbar-inverse {
background-color: #222222;
border-color: #080808;
}
.navbar-inverse .navbar-brand {
color: #9d9d9d;
}
.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus {
color: #ffffff;
background-color: transparent;
}
.navbar-inverse .navbar-text {
color: #9d9d9d;
}
.navbar-inverse .navbar-nav > li > a {
color: #9d9d9d;
}
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.navbar-inverse .navbar-nav > .disabled > a,
.navbar-inverse .navbar-nav > .disabled > a:hover,
.navbar-inverse .navbar-nav > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
.navbar-inverse .navbar-toggle {
border-color: #333333;
}
.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
background-color: #333333;
}
.navbar-inverse .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
border-color: #101010;
}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
background-color: #080808;
color: #ffffff;
}
@media (max-width: 767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu .divider {
background-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #9d9d9d;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
}
.navbar-inverse .navbar-link {
color: #9d9d9d;
}
.navbar-inverse .navbar-link:hover {
color: #ffffff;
}
.navbar-inverse .btn-link {
color: #9d9d9d;
}
.navbar-inverse .btn-link:hover,
.navbar-inverse .btn-link:focus {
color: #ffffff;
}
.navbar-inverse .btn-link[disabled]:hover,
fieldset[disabled] .navbar-inverse .btn-link:hover,
.navbar-inverse .btn-link[disabled]:focus,
fieldset[disabled] .navbar-inverse .btn-link:focus {
color: #444444;
}
.breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;
}
.breadcrumb > li {
display: inline-block;
}
.breadcrumb > li + li:before {
content: "/\00a0";
padding: 0 5px;
color: #cccccc;
}
.breadcrumb > .active {
color: #777777;
}
.pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
}
.pagination > li {
display: inline;
}
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
line-height: 1.42857143;
text-decoration: none;
color: #337ab7;
background-color: #ffffff;
border: 1px solid #dddddd;
margin-left: -1px;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
}
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination > li > a:focus,
.pagination > li > span:focus {
z-index: 2;
color: #23527c;
background-color: #eeeeee;
border-color: #dddddd;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
z-index: 3;
color: #ffffff;
background-color: #337ab7;
border-color: #337ab7;
cursor: default;
}
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
color: #777777;
background-color: #ffffff;
border-color: #dddddd;
cursor: not-allowed;
}
.pagination-lg > li > a,
.pagination-lg > li > span {
padding: 10px 16px;
font-size: 18px;
line-height: 1.3333333;
}
.pagination-lg > li:first-child > a,
.pagination-lg > li:first-child > span {
border-bottom-left-radius: 6px;
border-top-left-radius: 6px;
}
.pagination-lg > li:last-child > a,
.pagination-lg > li:last-child > span {
border-bottom-right-radius: 6px;
border-top-right-radius: 6px;
}
.pagination-sm > li > a,
.pagination-sm > li > span {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
}
.pagination-sm > li:first-child > a,
.pagination-sm > li:first-child > span {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.pagination-sm > li:last-child > a,
.pagination-sm > li:last-child > span {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.pager {
padding-left: 0;
margin: 20px 0;
list-style: none;
text-align: center;
}
.pager li {
display: inline;
}
.pager li > a,
.pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 15px;
}
.pager li > a:hover,
.pager li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.pager .next > a,
.pager .next > span {
float: right;
}
.pager .previous > a,
.pager .previous > span {
float: left;
}
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
color: #777777;
background-color: #ffffff;
cursor: not-allowed;
}
.label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #ffffff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
a.label:hover,
a.label:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.label:empty {
display: none;
}
.btn .label {
position: relative;
top: -1px;
}
.label-default {
background-color: #777777;
}
.label-default[href]:hover,
.label-default[href]:focus {
background-color: #5e5e5e;
}
.label-primary {
background-color: #337ab7;
}
.label-primary[href]:hover,
.label-primary[href]:focus {
background-color: #286090;
}
.label-success {
background-color: #5cb85c;
}
.label-success[href]:hover,
.label-success[href]:focus {
background-color: #449d44;
}
.label-info {
background-color: #5bc0de;
}
.label-info[href]:hover,
.label-info[href]:focus {
background-color: #31b0d5;
}
.label-warning {
background-color: #f0ad4e;
}
.label-warning[href]:hover,
.label-warning[href]:focus {
background-color: #ec971f;
}
.label-danger {
background-color: #d9534f;
}
.label-danger[href]:hover,
.label-danger[href]:focus {
background-color: #c9302c;
}
.badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
color: #ffffff;
line-height: 1;
vertical-align: middle;
white-space: nowrap;
text-align: center;
background-color: #777777;
border-radius: 10px;
}
.badge:empty {
display: none;
}
.btn .badge {
position: relative;
top: -1px;
}
.btn-xs .badge,
.btn-group-xs > .btn .badge {
top: 0;
padding: 1px 5px;
}
a.badge:hover,
a.badge:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.list-group-item.active > .badge,
.nav-pills > .active > a > .badge {
color: #337ab7;
background-color: #ffffff;
}
.list-group-item > .badge {
float: right;
}
.list-group-item > .badge + .badge {
margin-right: 5px;
}
.nav-pills > li > a > .badge {
margin-left: 3px;
}
.jumbotron {
padding-top: 30px;
padding-bottom: 30px;
margin-bottom: 30px;
color: inherit;
background-color: #eeeeee;
}
.jumbotron h1,
.jumbotron .h1 {
color: inherit;
}
.jumbotron p {
margin-bottom: 15px;
font-size: 21px;
font-weight: 200;
}
.jumbotron > hr {
border-top-color: #d5d5d5;
}
.container .jumbotron,
.container-fluid .jumbotron {
border-radius: 6px;
padding-left: 15px;
padding-right: 15px;
}
.jumbotron .container {
max-width: 100%;
}
@media screen and (min-width: 768px) {
.jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .jumbotron,
.container-fluid .jumbotron {
padding-left: 60px;
padding-right: 60px;
}
.jumbotron h1,
.jumbotron .h1 {
font-size: 63px;
}
}
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: border 0.2s ease-in-out;
-o-transition: border 0.2s ease-in-out;
transition: border 0.2s ease-in-out;
}
.thumbnail > img,
.thumbnail a > img {
margin-left: auto;
margin-right: auto;
}
a.thumbnail:hover,
a.thumbnail:focus,
a.thumbnail.active {
border-color: #337ab7;
}
.thumbnail .caption {
padding: 9px;
color: #333333;
}
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.alert h4 {
margin-top: 0;
color: inherit;
}
.alert .alert-link {
font-weight: bold;
}
.alert > p,
.alert > ul {
margin-bottom: 0;
}
.alert > p + p {
margin-top: 5px;
}
.alert-dismissable,
.alert-dismissible {
padding-right: 35px;
}
.alert-dismissable .close,
.alert-dismissible .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #3c763d;
}
.alert-success hr {
border-top-color: #c9e2b3;
}
.alert-success .alert-link {
color: #2b542c;
}
.alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #31708f;
}
.alert-info hr {
border-top-color: #a6e1ec;
}
.alert-info .alert-link {
color: #245269;
}
.alert-warning {
background-color: #fcf8e3;
border-color: #faebcc;
color: #8a6d3b;
}
.alert-warning hr {
border-top-color: #f7e1b5;
}
.alert-warning .alert-link {
color: #66512c;
}
.alert-danger {
background-color: #f2dede;
border-color: #ebccd1;
color: #a94442;
}
.alert-danger hr {
border-top-color: #e4b9c0;
}
.alert-danger .alert-link {
color: #843534;
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.progress {
overflow: hidden;
height: 20px;
margin-bottom: 20px;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
.progress-bar {
float: left;
width: 0%;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #ffffff;
text-align: center;
background-color: #337ab7;
-webkit-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-transition: width 0.6s ease;
-o-transition: width 0.6s ease;
transition: width 0.6s ease;
}
.progress-striped .progress-bar,
.progress-bar-striped {
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: -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%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-size: 40px 40px;
}
.progress.active .progress-bar,
.progress-bar.active {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-o-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
.progress-bar-success {
background-color: #5cb85c;
}
.progress-striped .progress-bar-success {
background-image: -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: -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%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-info {
background-color: #5bc0de;
}
.progress-striped .progress-bar-info {
background-image: -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: -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%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-warning {
background-color: #f0ad4e;
}
.progress-striped .progress-bar-warning {
background-image: -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: -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%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-danger {
background-color: #d9534f;
}
.progress-striped .progress-bar-danger {
background-image: -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: -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%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.media {
margin-top: 15px;
}
.media:first-child {
margin-top: 0;
}
.media,
.media-body {
zoom: 1;
overflow: hidden;
}
.media-body {
width: 10000px;
}
.media-object {
display: block;
}
.media-object.img-thumbnail {
max-width: none;
}
.media-right,
.media > .pull-right {
padding-left: 10px;
}
.media-left,
.media > .pull-left {
padding-right: 10px;
}
.media-left,
.media-right,
.media-body {
display: table-cell;
vertical-align: top;
}
.media-middle {
vertical-align: middle;
}
.media-bottom {
vertical-align: bottom;
}
.media-heading {
margin-top: 0;
margin-bottom: 5px;
}
.media-list {
padding-left: 0;
list-style: none;
}
.list-group {
margin-bottom: 20px;
padding-left: 0;
}
.list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #ffffff;
border: 1px solid #dddddd;
}
.list-group-item:first-child {
border-top-right-radius: 4px;
border-top-left-radius: 4px;
}
.list-group-item:last-child {
margin-bottom: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
a.list-group-item,
button.list-group-item {
color: #555555;
}
a.list-group-item .list-group-item-heading,
button.list-group-item .list-group-item-heading {
color: #333333;
}
a.list-group-item:hover,
button.list-group-item:hover,
a.list-group-item:focus,
button.list-group-item:focus {
text-decoration: none;
color: #555555;
background-color: #f5f5f5;
}
button.list-group-item {
width: 100%;
text-align: left;
}
.list-group-item.disabled,
.list-group-item.disabled:hover,
.list-group-item.disabled:focus {
background-color: #eeeeee;
color: #777777;
cursor: not-allowed;
}
.list-group-item.disabled .list-group-item-heading,
.list-group-item.disabled:hover .list-group-item-heading,
.list-group-item.disabled:focus .list-group-item-heading {
color: inherit;
}
.list-group-item.disabled .list-group-item-text,
.list-group-item.disabled:hover .list-group-item-text,
.list-group-item.disabled:focus .list-group-item-text {
color: #777777;
}
.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
z-index: 2;
color: #ffffff;
background-color: #337ab7;
border-color: #337ab7;
}
.list-group-item.active .list-group-item-heading,
.list-group-item.active:hover .list-group-item-heading,
.list-group-item.active:focus .list-group-item-heading,
.list-group-item.active .list-group-item-heading > small,
.list-group-item.active:hover .list-group-item-heading > small,
.list-group-item.active:focus .list-group-item-heading > small,
.list-group-item.active .list-group-item-heading > .small,
.list-group-item.active:hover .list-group-item-heading > .small,
.list-group-item.active:focus .list-group-item-heading > .small {
color: inherit;
}
.list-group-item.active .list-group-item-text,
.list-group-item.active:hover .list-group-item-text,
.list-group-item.active:focus .list-group-item-text {
color: #c7ddef;
}
.list-group-item-success {
color: #3c763d;
background-color: #dff0d8;
}
a.list-group-item-success,
button.list-group-item-success {
color: #3c763d;
}
a.list-group-item-success .list-group-item-heading,
button.list-group-item-success .list-group-item-heading {
color: inherit;
}
a.list-group-item-success:hover,
button.list-group-item-success:hover,
a.list-group-item-success:focus,
button.list-group-item-success:focus {
color: #3c763d;
background-color: #d0e9c6;
}
a.list-group-item-success.active,
button.list-group-item-success.active,
a.list-group-item-success.active:hover,
button.list-group-item-success.active:hover,
a.list-group-item-success.active:focus,
button.list-group-item-success.active:focus {
color: #fff;
background-color: #3c763d;
border-color: #3c763d;
}
.list-group-item-info {
color: #31708f;
background-color: #d9edf7;
}
a.list-group-item-info,
button.list-group-item-info {
color: #31708f;
}
a.list-group-item-info .list-group-item-heading,
button.list-group-item-info .list-group-item-heading {
color: inherit;
}
a.list-group-item-info:hover,
button.list-group-item-info:hover,
a.list-group-item-info:focus,
button.list-group-item-info:focus {
color: #31708f;
background-color: #c4e3f3;
}
a.list-group-item-info.active,
button.list-group-item-info.active,
a.list-group-item-info.active:hover,
button.list-group-item-info.active:hover,
a.list-group-item-info.active:focus,
button.list-group-item-info.active:focus {
color: #fff;
background-color: #31708f;
border-color: #31708f;
}
.list-group-item-warning {
color: #8a6d3b;
background-color: #fcf8e3;
}
a.list-group-item-warning,
button.list-group-item-warning {
color: #8a6d3b;
}
a.list-group-item-warning .list-group-item-heading,
button.list-group-item-warning .list-group-item-heading {
color: inherit;
}
a.list-group-item-warning:hover,
button.list-group-item-warning:hover,
a.list-group-item-warning:focus,
button.list-group-item-warning:focus {
color: #8a6d3b;
background-color: #faf2cc;
}
a.list-group-item-warning.active,
button.list-group-item-warning.active,
a.list-group-item-warning.active:hover,
button.list-group-item-warning.active:hover,
a.list-group-item-warning.active:focus,
button.list-group-item-warning.active:focus {
color: #fff;
background-color: #8a6d3b;
border-color: #8a6d3b;
}
.list-group-item-danger {
color: #a94442;
background-color: #f2dede;
}
a.list-group-item-danger,
button.list-group-item-danger {
color: #a94442;
}
a.list-group-item-danger .list-group-item-heading,
button.list-group-item-danger .list-group-item-heading {
color: inherit;
}
a.list-group-item-danger:hover,
button.list-group-item-danger:hover,
a.list-group-item-danger:focus,
button.list-group-item-danger:focus {
color: #a94442;
background-color: #ebcccc;
}
a.list-group-item-danger.active,
button.list-group-item-danger.active,
a.list-group-item-danger.active:hover,
button.list-group-item-danger.active:hover,
a.list-group-item-danger.active:focus,
button.list-group-item-danger.active:focus {
color: #fff;
background-color: #a94442;
border-color: #a94442;
}
.list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}
.panel {
margin-bottom: 20px;
background-color: #ffffff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.panel-body {
padding: 15px;
}
.panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.panel-heading > .dropdown .dropdown-toggle {
color: inherit;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit;
}
.panel-title > a,
.panel-title > small,
.panel-title > .small,
.panel-title > small > a,
.panel-title > .small > a {
color: inherit;
}
.panel-footer {
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #dddddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel > .list-group,
.panel > .panel-collapse > .list-group {
margin-bottom: 0;
}
.panel > .list-group .list-group-item,
.panel > .panel-collapse > .list-group .list-group-item {
border-width: 1px 0;
border-radius: 0;
}
.panel > .list-group:first-child .list-group-item:first-child,
.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
border-top: 0;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.panel > .list-group:last-child .list-group-item:last-child,
.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
border-bottom: 0;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0;
}
.list-group + .panel-footer {
border-top-width: 0;
}
.panel > .table,
.panel > .table-responsive > .table,
.panel > .panel-collapse > .table {
margin-bottom: 0;
}
.panel > .table caption,
.panel > .table-responsive > .table caption,
.panel > .panel-collapse > .table caption {
padding-left: 15px;
padding-right: 15px;
}
.panel > .table:first-child,
.panel > .table-responsive:first-child > .table:first-child {
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
border-top-left-radius: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
border-top-right-radius: 3px;
}
.panel > .table:last-child,
.panel > .table-responsive:last-child > .table:last-child {
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
border-bottom-left-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
border-bottom-right-radius: 3px;
}
.panel > .panel-body + .table,
.panel > .panel-body + .table-responsive,
.panel > .table + .panel-body,
.panel > .table-responsive + .panel-body {
border-top: 1px solid #dddddd;
}
.panel > .table > tbody:first-child > tr:first-child th,
.panel > .table > tbody:first-child > tr:first-child td {
border-top: 0;
}
.panel > .table-bordered,
.panel > .table-responsive > .table-bordered {
border: 0;
}
.panel > .table-bordered > thead > tr > th:first-child,
.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
.panel > .table-bordered > tbody > tr > th:first-child,
.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
.panel > .table-bordered > tfoot > tr > th:first-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.panel > .table-bordered > thead > tr > td:first-child,
.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
.panel > .table-bordered > tbody > tr > td:first-child,
.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
.panel > .table-bordered > tfoot > tr > td:first-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.panel > .table-bordered > thead > tr > th:last-child,
.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
.panel > .table-bordered > tbody > tr > th:last-child,
.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
.panel > .table-bordered > tfoot > tr > th:last-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.panel > .table-bordered > thead > tr > td:last-child,
.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
.panel > .table-bordered > tbody > tr > td:last-child,
.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
.panel > .table-bordered > tfoot > tr > td:last-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.panel > .table-bordered > thead > tr:first-child > td,
.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
.panel > .table-bordered > tbody > tr:first-child > td,
.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
.panel > .table-bordered > thead > tr:first-child > th,
.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
.panel > .table-bordered > tbody > tr:first-child > th,
.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
border-bottom: 0;
}
.panel > .table-bordered > tbody > tr:last-child > td,
.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
.panel > .table-bordered > tfoot > tr:last-child > td,
.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
.panel > .table-bordered > tbody > tr:last-child > th,
.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
.panel > .table-bordered > tfoot > tr:last-child > th,
.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
border-bottom: 0;
}
.panel > .table-responsive {
border: 0;
margin-bottom: 0;
}
.panel-group {
margin-bottom: 20px;
}
.panel-group .panel {
margin-bottom: 0;
border-radius: 4px;
}
.panel-group .panel + .panel {
margin-top: 5px;
}
.panel-group .panel-heading {
border-bottom: 0;
}
.panel-group .panel-heading + .panel-collapse > .panel-body,
.panel-group .panel-heading + .panel-collapse > .list-group {
border-top: 1px solid #dddddd;
}
.panel-group .panel-footer {
border-top: 0;
}
.panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #dddddd;
}
.panel-default {
border-color: #dddddd;
}
.panel-default > .panel-heading {
color: #333333;
background-color: #f5f5f5;
border-color: #dddddd;
}
.panel-default > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #dddddd;
}
.panel-default > .panel-heading .badge {
color: #f5f5f5;
background-color: #333333;
}
.panel-default > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #dddddd;
}
.panel-primary {
border-color: #337ab7;
}
.panel-primary > .panel-heading {
color: #ffffff;
background-color: #337ab7;
border-color: #337ab7;
}
.panel-primary > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #337ab7;
}
.panel-primary > .panel-heading .badge {
color: #337ab7;
background-color: #ffffff;
}
.panel-primary > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #337ab7;
}
.panel-success {
border-color: #d6e9c6;
}
.panel-success > .panel-heading {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.panel-success > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #d6e9c6;
}
.panel-success > .panel-heading .badge {
color: #dff0d8;
background-color: #3c763d;
}
.panel-success > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #d6e9c6;
}
.panel-info {
border-color: #bce8f1;
}
.panel-info > .panel-heading {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;
}
.panel-info > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #bce8f1;
}
.panel-info > .panel-heading .badge {
color: #d9edf7;
background-color: #31708f;
}
.panel-info > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #bce8f1;
}
.panel-warning {
border-color: #faebcc;
}
.panel-warning > .panel-heading {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
.panel-warning > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #faebcc;
}
.panel-warning > .panel-heading .badge {
color: #fcf8e3;
background-color: #8a6d3b;
}
.panel-warning > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #faebcc;
}
.panel-danger {
border-color: #ebccd1;
}
.panel-danger > .panel-heading {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
.panel-danger > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #ebccd1;
}
.panel-danger > .panel-heading .badge {
color: #f2dede;
background-color: #a94442;
}
.panel-danger > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #ebccd1;
}
.embed-responsive {
position: relative;
display: block;
height: 0;
padding: 0;
overflow: hidden;
}
.embed-responsive .embed-responsive-item,
.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
position: absolute;
top: 0;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
border: 0;
}
.embed-responsive-16by9 {
padding-bottom: 56.25%;
}
.embed-responsive-4by3 {
padding-bottom: 75%;
}
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, 0.15);
}
.well-lg {
padding: 24px;
border-radius: 6px;
}
.well-sm {
padding: 9px;
border-radius: 3px;
}
.close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
}
.close:hover,
.close:focus {
color: #000000;
text-decoration: none;
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
}
button.close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.modal-open {
overflow: hidden;
}
.modal {
display: none;
overflow: hidden;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
-webkit-overflow-scrolling: touch;
outline: 0;
}
.modal.fade .modal-dialog {
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
-o-transform: translate(0, -25%);
transform: translate(0, -25%);
-webkit-transition: -webkit-transform 0.3s ease-out;
-moz-transition: -moz-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
}
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
-o-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}
.modal-dialog {
position: relative;
width: auto;
margin: 10px;
}
.modal-content {
position: relative;
background-color: #ffffff;
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
background-clip: padding-box;
outline: 0;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000000;
}
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0);
}
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50);
}
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.42857143;
}
.modal-body {
position: relative;
padding: 15px;
}
.modal-footer {
padding: 15px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer .btn + .btn {
margin-left: 5px;
margin-bottom: 0;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
.modal-scrollbar-measure {
position: absolute;
top: -9999px;
width: 50px;
height: 50px;
overflow: scroll;
}
@media (min-width: 768px) {
.modal-dialog {
width: 600px;
margin: 30px auto;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
.modal-sm {
width: 300px;
}
}
@media (min-width: 992px) {
.modal-lg {
width: 900px;
}
}
.tooltip {
position: absolute;
z-index: 1070;
display: block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-style: normal;
font-weight: normal;
letter-spacing: normal;
line-break: auto;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
white-space: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
font-size: 12px;
opacity: 0;
filter: alpha(opacity=0);
}
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90);
}
.tooltip.top {
margin-top: -3px;
padding: 5px 0;
}
.tooltip.right {
margin-left: 3px;
padding: 0 5px;
}
.tooltip.bottom {
margin-top: 3px;
padding: 5px 0;
}
.tooltip.left {
margin-left: -3px;
padding: 0 5px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
background-color: #000000;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
right: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
left: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
right: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
left: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1060;
display: none;
max-width: 276px;
padding: 1px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-style: normal;
font-weight: normal;
letter-spacing: normal;
line-break: auto;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
white-space: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
font-size: 14px;
background-color: #ffffff;
background-clip: padding-box;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
margin: 0;
padding: 8px 14px;
font-size: 14px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0;
}
.popover-content {
padding: 9px 14px;
}
.popover > .arrow,
.popover > .arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.popover > .arrow {
border-width: 11px;
}
.popover > .arrow:after {
border-width: 10px;
content: "";
}
.popover.top > .arrow {
left: 50%;
margin-left: -11px;
border-bottom-width: 0;
border-top-color: #999999;
border-top-color: rgba(0, 0, 0, 0.25);
bottom: -11px;
}
.popover.top > .arrow:after {
content: " ";
bottom: 1px;
margin-left: -10px;
border-bottom-width: 0;
border-top-color: #ffffff;
}
.popover.right > .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-left-width: 0;
border-right-color: #999999;
border-right-color: rgba(0, 0, 0, 0.25);
}
.popover.right > .arrow:after {
content: " ";
left: 1px;
bottom: -10px;
border-left-width: 0;
border-right-color: #ffffff;
}
.popover.bottom > .arrow {
left: 50%;
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999999;
border-bottom-color: rgba(0, 0, 0, 0.25);
top: -11px;
}
.popover.bottom > .arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
border-top-width: 0;
border-bottom-color: #ffffff;
}
.popover.left > .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-right-width: 0;
border-left-color: #999999;
border-left-color: rgba(0, 0, 0, 0.25);
}
.popover.left > .arrow:after {
content: " ";
right: 1px;
border-right-width: 0;
border-left-color: #ffffff;
bottom: -10px;
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
overflow: hidden;
width: 100%;
}
.carousel-inner > .item {
display: none;
position: relative;
-webkit-transition: 0.6s ease-in-out left;
-o-transition: 0.6s ease-in-out left;
transition: 0.6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
line-height: 1;
}
@media all and (transform-3d), (-webkit-transform-3d) {
.carousel-inner > .item {
-webkit-transition: -webkit-transform 0.6s ease-in-out;
-moz-transition: -moz-transform 0.6s ease-in-out;
-o-transition: -o-transform 0.6s ease-in-out;
transition: transform 0.6s ease-in-out;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-perspective: 1000px;
-moz-perspective: 1000px;
perspective: 1000px;
}
.carousel-inner > .item.next,
.carousel-inner > .item.active.right {
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
left: 0;
}
.carousel-inner > .item.prev,
.carousel-inner > .item.active.left {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
left: 0;
}
.carousel-inner > .item.next.left,
.carousel-inner > .item.prev.right,
.carousel-inner > .item.active {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
left: 0;
}
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 15%;
opacity: 0.5;
filter: alpha(opacity=50);
font-size: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
background-color: rgba(0, 0, 0, 0);
}
.carousel-control.left {
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
}
.carousel-control.right {
left: auto;
right: 0;
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
}
.carousel-control:hover,
.carousel-control:focus {
outline: 0;
color: #ffffff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
margin-top: -10px;
z-index: 5;
display: inline-block;
}
.carousel-control .icon-prev,
.carousel-control .glyphicon-chevron-left {
left: 50%;
margin-left: -10px;
}
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-right {
right: 50%;
margin-right: -10px;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
line-height: 1;
font-family: serif;
}
.carousel-control .icon-prev:before {
content: '\2039';
}
.carousel-control .icon-next:before {
content: '\203a';
}
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
margin-left: -30%;
padding-left: 0;
list-style: none;
text-align: center;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
border: 1px solid #ffffff;
border-radius: 10px;
cursor: pointer;
background-color: #000 \9;
background-color: rgba(0, 0, 0, 0);
}
.carousel-indicators .active {
margin: 0;
width: 12px;
height: 12px;
background-color: #ffffff;
}
.carousel-caption {
position: absolute;
left: 15%;
right: 15%;
bottom: 20px;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-caption .btn {
text-shadow: none;
}
@media screen and (min-width: 768px) {
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -10px;
font-size: 30px;
}
.carousel-control .glyphicon-chevron-left,
.carousel-control .icon-prev {
margin-left: -10px;
}
.carousel-control .glyphicon-chevron-right,
.carousel-control .icon-next {
margin-right: -10px;
}
.carousel-caption {
left: 20%;
right: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}
}
.clearfix:before,
.clearfix:after,
.dl-horizontal dd:before,
.dl-horizontal dd:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after,
.form-horizontal .form-group:before,
.form-horizontal .form-group:after,
.btn-toolbar:before,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after,
.nav:before,
.nav:after,
.navbar:before,
.navbar:after,
.navbar-header:before,
.navbar-header:after,
.navbar-collapse:before,
.navbar-collapse:after,
.pager:before,
.pager:after,
.panel-body:before,
.panel-body:after,
.modal-header:before,
.modal-header:after,
.modal-footer:before,
.modal-footer:after {
content: " ";
display: table;
}
.clearfix:after,
.dl-horizontal dd:after,
.container:after,
.container-fluid:after,
.row:after,
.form-horizontal .form-group:after,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:after,
.nav:after,
.navbar:after,
.navbar-header:after,
.navbar-collapse:after,
.pager:after,
.panel-body:after,
.modal-header:after,
.modal-footer:after {
clear: both;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
}
.affix {
position: fixed;
}
@-ms-viewport {
width: device-width;
}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {
display: none !important;
}
.visible-xs-block,
.visible-xs-inline,
.visible-xs-inline-block,
.visible-sm-block,
.visible-sm-inline,
.visible-sm-inline-block,
.visible-md-block,
.visible-md-inline,
.visible-md-inline-block,
.visible-lg-block,
.visible-lg-inline,
.visible-lg-inline-block {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
}
table.visible-xs {
display: table !important;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
@media (max-width: 767px) {
.visible-xs-block {
display: block !important;
}
}
@media (max-width: 767px) {
.visible-xs-inline {
display: inline !important;
}
}
@media (max-width: 767px) {
.visible-xs-inline-block {
display: inline-block !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
table.visible-sm {
display: table !important;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-block {
display: block !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline {
display: inline !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline-block {
display: inline-block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
table.visible-md {
display: table !important;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-block {
display: block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline {
display: inline !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline-block {
display: inline-block !important;
}
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
table.visible-lg {
display: table !important;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-lg-block {
display: block !important;
}
}
@media (min-width: 1200px) {
.visible-lg-inline {
display: inline !important;
}
}
@media (min-width: 1200px) {
.visible-lg-inline-block {
display: inline-block !important;
}
}
@media (max-width: 767px) {
.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-lg {
display: none !important;
}
}
.visible-print {
display: none !important;
}
@media print {
.visible-print {
display: block !important;
}
table.visible-print {
display: table !important;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
}
.visible-print-block {
display: none !important;
}
@media print {
.visible-print-block {
display: block !important;
}
}
.visible-print-inline {
display: none !important;
}
@media print {
.visible-print-inline {
display: inline !important;
}
}
.visible-print-inline-block {
display: none !important;
}
@media print {
.visible-print-inline-block {
display: inline-block !important;
}
}
@media print {
.hidden-print {
display: none !important;
}
}
/**
* Additional styles for BraincraftedBootstrapBundle
* (c) 2013 Florian Eckerstorfer (http://braincrafted.com)
* http://bootstrap.braincrafted.com
*/
.bootstrap-time {
width: 100%;
}
.bootstrap-time select {
display: inline-block;
width: auto;
}
.bootstrap-date {
width: 100%;
}
.bootstrap-date select {
display: inline-block;
width: auto;
margin-right: 5px;
}
.bootstrap-datetime .bootstrap-time,
.bootstrap-datetime .bootstrap-date {
display: inline-block;
width: auto;
}
.form-group .bc-collection {
margin-bottom: 0;
}
.form-group .bc-collection li + li {
margin-top: 10px;
}
.form-group .bc-collection li:nth-last-child(1) {
margin-bottom: 10px;
}
.form-inline .form-group {
margin-left: 0;
margin-right: 0;
}
.form-horizontal .col-lg-1 .col-1,
.form-horizontal .col-lg-2 .col-1,
.form-horizontal .col-lg-3 .col-1,
.form-horizontal .col-lg-4 .col-1,
.form-horizontal .col-lg-5 .col-1,
.form-horizontal .col-lg-6 .col-1,
.form-horizontal .col-lg-7 .col-1,
.form-horizontal .col-lg-8 .col-1,
.form-horizontal .col-lg-9 .col-1,
.form-horizontal .col-lg-10 .col-1,
.form-horizontal .col-lg-11 .col-1,
.form-horizontal .col-lg12 .col-1,
.form-horizontal .col-lg-1 .col-2,
.form-horizontal .col-lg-2 .col-2,
.form-horizontal .col-lg-3 .col-2,
.form-horizontal .col-lg-4 .col-2,
.form-horizontal .col-lg-5 .col-2,
.form-horizontal .col-lg-6 .col-2,
.form-horizontal .col-lg-7 .col-2,
.form-horizontal .col-lg-8 .col-2,
.form-horizontal .col-lg-9 .col-2,
.form-horizontal .col-lg-10 .col-2,
.form-horizontal .col-lg-11 .col-2,
.form-horizontal .col-lg12 .col-2,
.form-horizontal .col-lg-1 .col-3,
.form-horizontal .col-lg-2 .col-3,
.form-horizontal .col-lg-3 .col-3,
.form-horizontal .col-lg-4 .col-3,
.form-horizontal .col-lg-5 .col-3,
.form-horizontal .col-lg-6 .col-3,
.form-horizontal .col-lg-7 .col-3,
.form-horizontal .col-lg-8 .col-3,
.form-horizontal .col-lg-9 .col-3,
.form-horizontal .col-lg-10 .col-3,
.form-horizontal .col-lg-11 .col-3,
.form-horizontal .col-lg12 .col-3,
.form-horizontal .col-lg-1 .col-4,
.form-horizontal .col-lg-2 .col-4,
.form-horizontal .col-lg-3 .col-4,
.form-horizontal .col-lg-4 .col-4,
.form-horizontal .col-lg-5 .col-4,
.form-horizontal .col-lg-6 .col-4,
.form-horizontal .col-lg-7 .col-4,
.form-horizontal .col-lg-8 .col-4,
.form-horizontal .col-lg-9 .col-4,
.form-horizontal .col-lg-10 .col-4,
.form-horizontal .col-lg-11 .col-4,
.form-horizontal .col-lg12 .col-4,
.form-horizontal .col-lg-1 .col-5,
.form-horizontal .col-lg-2 .col-5,
.form-horizontal .col-lg-3 .col-5,
.form-horizontal .col-lg-4 .col-5,
.form-horizontal .col-lg-5 .col-5,
.form-horizontal .col-lg-6 .col-5,
.form-horizontal .col-lg-7 .col-5,
.form-horizontal .col-lg-8 .col-5,
.form-horizontal .col-lg-9 .col-5,
.form-horizontal .col-lg-10 .col-5,
.form-horizontal .col-lg-11 .col-5,
.form-horizontal .col-lg12 .col-5,
.form-horizontal .col-lg-1 .col-6,
.form-horizontal .col-lg-2 .col-6,
.form-horizontal .col-lg-3 .col-6,
.form-horizontal .col-lg-4 .col-6,
.form-horizontal .col-lg-5 .col-6,
.form-horizontal .col-lg-6 .col-6,
.form-horizontal .col-lg-7 .col-6,
.form-horizontal .col-lg-8 .col-6,
.form-horizontal .col-lg-9 .col-6,
.form-horizontal .col-lg-10 .col-6,
.form-horizontal .col-lg-11 .col-6,
.form-horizontal .col-lg12 .col-6,
.form-horizontal .col-lg-1 .col-7,
.form-horizontal .col-lg-2 .col-7,
.form-horizontal .col-lg-3 .col-7,
.form-horizontal .col-lg-4 .col-7,
.form-horizontal .col-lg-5 .col-7,
.form-horizontal .col-lg-6 .col-7,
.form-horizontal .col-lg-7 .col-7,
.form-horizontal .col-lg-8 .col-7,
.form-horizontal .col-lg-9 .col-7,
.form-horizontal .col-lg-10 .col-7,
.form-horizontal .col-lg-11 .col-7,
.form-horizontal .col-lg12 .col-7,
.form-horizontal .col-lg-1 .col-8,
.form-horizontal .col-lg-2 .col-8,
.form-horizontal .col-lg-3 .col-8,
.form-horizontal .col-lg-4 .col-8,
.form-horizontal .col-lg-5 .col-8,
.form-horizontal .col-lg-6 .col-8,
.form-horizontal .col-lg-7 .col-8,
.form-horizontal .col-lg-8 .col-8,
.form-horizontal .col-lg-9 .col-8,
.form-horizontal .col-lg-10 .col-8,
.form-horizontal .col-lg-11 .col-8,
.form-horizontal .col-lg12 .col-8,
.form-horizontal .col-lg-1 .col-9,
.form-horizontal .col-lg-2 .col-9,
.form-horizontal .col-lg-3 .col-9,
.form-horizontal .col-lg-4 .col-9,
.form-horizontal .col-lg-5 .col-9,
.form-horizontal .col-lg-6 .col-9,
.form-horizontal .col-lg-7 .col-9,
.form-horizontal .col-lg-8 .col-9,
.form-horizontal .col-lg-9 .col-9,
.form-horizontal .col-lg-10 .col-9,
.form-horizontal .col-lg-11 .col-9,
.form-horizontal .col-lg12 .col-9,
.form-horizontal .col-lg-1 .col-10,
.form-horizontal .col-lg-2 .col-10,
.form-horizontal .col-lg-3 .col-10,
.form-horizontal .col-lg-4 .col-10,
.form-horizontal .col-lg-5 .col-10,
.form-horizontal .col-lg-6 .col-10,
.form-horizontal .col-lg-7 .col-10,
.form-horizontal .col-lg-8 .col-10,
.form-horizontal .col-lg-9 .col-10,
.form-horizontal .col-lg-10 .col-10,
.form-horizontal .col-lg-11 .col-10,
.form-horizontal .col-lg12 .col-10,
.form-horizontal .col-lg-1 .col-11,
.form-horizontal .col-lg-2 .col-11,
.form-horizontal .col-lg-3 .col-11,
.form-horizontal .col-lg-4 .col-11,
.form-horizontal .col-lg-5 .col-11,
.form-horizontal .col-lg-6 .col-11,
.form-horizontal .col-lg-7 .col-11,
.form-horizontal .col-lg-8 .col-11,
.form-horizontal .col-lg-9 .col-11,
.form-horizontal .col-lg-10 .col-11,
.form-horizontal .col-lg-11 .col-11,
.form-horizontal .col-lg12 .col-11,
.form-horizontal .col-lg-1 .col-12,
.form-horizontal .col-lg-2 .col-12,
.form-horizontal .col-lg-3 .col-12,
.form-horizontal .col-lg-4 .col-12,
.form-horizontal .col-lg-5 .col-12,
.form-horizontal .col-lg-6 .col-12,
.form-horizontal .col-lg-7 .col-12,
.form-horizontal .col-lg-8 .col-12,
.form-horizontal .col-lg-9 .col-12,
.form-horizontal .col-lg-10 .col-12,
.form-horizontal .col-lg-11 .col-12,
.form-horizontal .col-lg12 .col-12,
.form-horizontal .col-lg-1 .col-sm-1,
.form-horizontal .col-lg-2 .col-sm-1,
.form-horizontal .col-lg-3 .col-sm-1,
.form-horizontal .col-lg-4 .col-sm-1,
.form-horizontal .col-lg-5 .col-sm-1,
.form-horizontal .col-lg-6 .col-sm-1,
.form-horizontal .col-lg-7 .col-sm-1,
.form-horizontal .col-lg-8 .col-sm-1,
.form-horizontal .col-lg-9 .col-sm-1,
.form-horizontal .col-lg-10 .col-sm-1,
.form-horizontal .col-lg-11 .col-sm-1,
.form-horizontal .col-lg12 .col-sm-1,
.form-horizontal .col-lg-1 .col-sm-2,
.form-horizontal .col-lg-2 .col-sm-2,
.form-horizontal .col-lg-3 .col-sm-2,
.form-horizontal .col-lg-4 .col-sm-2,
.form-horizontal .col-lg-5 .col-sm-2,
.form-horizontal .col-lg-6 .col-sm-2,
.form-horizontal .col-lg-7 .col-sm-2,
.form-horizontal .col-lg-8 .col-sm-2,
.form-horizontal .col-lg-9 .col-sm-2,
.form-horizontal .col-lg-10 .col-sm-2,
.form-horizontal .col-lg-11 .col-sm-2,
.form-horizontal .col-lg12 .col-sm-2,
.form-horizontal .col-lg-1 .col-sm-3,
.form-horizontal .col-lg-2 .col-sm-3,
.form-horizontal .col-lg-3 .col-sm-3,
.form-horizontal .col-lg-4 .col-sm-3,
.form-horizontal .col-lg-5 .col-sm-3,
.form-horizontal .col-lg-6 .col-sm-3,
.form-horizontal .col-lg-7 .col-sm-3,
.form-horizontal .col-lg-8 .col-sm-3,
.form-horizontal .col-lg-9 .col-sm-3,
.form-horizontal .col-lg-10 .col-sm-3,
.form-horizontal .col-lg-11 .col-sm-3,
.form-horizontal .col-lg12 .col-sm-3,
.form-horizontal .col-lg-1 .col-sm-4,
.form-horizontal .col-lg-2 .col-sm-4,
.form-horizontal .col-lg-3 .col-sm-4,
.form-horizontal .col-lg-4 .col-sm-4,
.form-horizontal .col-lg-5 .col-sm-4,
.form-horizontal .col-lg-6 .col-sm-4,
.form-horizontal .col-lg-7 .col-sm-4,
.form-horizontal .col-lg-8 .col-sm-4,
.form-horizontal .col-lg-9 .col-sm-4,
.form-horizontal .col-lg-10 .col-sm-4,
.form-horizontal .col-lg-11 .col-sm-4,
.form-horizontal .col-lg12 .col-sm-4,
.form-horizontal .col-lg-1 .col-sm-5,
.form-horizontal .col-lg-2 .col-sm-5,
.form-horizontal .col-lg-3 .col-sm-5,
.form-horizontal .col-lg-4 .col-sm-5,
.form-horizontal .col-lg-5 .col-sm-5,
.form-horizontal .col-lg-6 .col-sm-5,
.form-horizontal .col-lg-7 .col-sm-5,
.form-horizontal .col-lg-8 .col-sm-5,
.form-horizontal .col-lg-9 .col-sm-5,
.form-horizontal .col-lg-10 .col-sm-5,
.form-horizontal .col-lg-11 .col-sm-5,
.form-horizontal .col-lg12 .col-sm-5,
.form-horizontal .col-lg-1 .col-sm-6,
.form-horizontal .col-lg-2 .col-sm-6,
.form-horizontal .col-lg-3 .col-sm-6,
.form-horizontal .col-lg-4 .col-sm-6,
.form-horizontal .col-lg-5 .col-sm-6,
.form-horizontal .col-lg-6 .col-sm-6,
.form-horizontal .col-lg-7 .col-sm-6,
.form-horizontal .col-lg-8 .col-sm-6,
.form-horizontal .col-lg-9 .col-sm-6,
.form-horizontal .col-lg-10 .col-sm-6,
.form-horizontal .col-lg-11 .col-sm-6,
.form-horizontal .col-lg12 .col-sm-6,
.form-horizontal .col-lg-1 .col-sm-7,
.form-horizontal .col-lg-2 .col-sm-7,
.form-horizontal .col-lg-3 .col-sm-7,
.form-horizontal .col-lg-4 .col-sm-7,
.form-horizontal .col-lg-5 .col-sm-7,
.form-horizontal .col-lg-6 .col-sm-7,
.form-horizontal .col-lg-7 .col-sm-7,
.form-horizontal .col-lg-8 .col-sm-7,
.form-horizontal .col-lg-9 .col-sm-7,
.form-horizontal .col-lg-10 .col-sm-7,
.form-horizontal .col-lg-11 .col-sm-7,
.form-horizontal .col-lg12 .col-sm-7,
.form-horizontal .col-lg-1 .col-sm-8,
.form-horizontal .col-lg-2 .col-sm-8,
.form-horizontal .col-lg-3 .col-sm-8,
.form-horizontal .col-lg-4 .col-sm-8,
.form-horizontal .col-lg-5 .col-sm-8,
.form-horizontal .col-lg-6 .col-sm-8,
.form-horizontal .col-lg-7 .col-sm-8,
.form-horizontal .col-lg-8 .col-sm-8,
.form-horizontal .col-lg-9 .col-sm-8,
.form-horizontal .col-lg-10 .col-sm-8,
.form-horizontal .col-lg-11 .col-sm-8,
.form-horizontal .col-lg12 .col-sm-8,
.form-horizontal .col-lg-1 .col-sm-9,
.form-horizontal .col-lg-2 .col-sm-9,
.form-horizontal .col-lg-3 .col-sm-9,
.form-horizontal .col-lg-4 .col-sm-9,
.form-horizontal .col-lg-5 .col-sm-9,
.form-horizontal .col-lg-6 .col-sm-9,
.form-horizontal .col-lg-7 .col-sm-9,
.form-horizontal .col-lg-8 .col-sm-9,
.form-horizontal .col-lg-9 .col-sm-9,
.form-horizontal .col-lg-10 .col-sm-9,
.form-horizontal .col-lg-11 .col-sm-9,
.form-horizontal .col-lg12 .col-sm-9,
.form-horizontal .col-lg-1 .col-sm-10,
.form-horizontal .col-lg-2 .col-sm-10,
.form-horizontal .col-lg-3 .col-sm-10,
.form-horizontal .col-lg-4 .col-sm-10,
.form-horizontal .col-lg-5 .col-sm-10,
.form-horizontal .col-lg-6 .col-sm-10,
.form-horizontal .col-lg-7 .col-sm-10,
.form-horizontal .col-lg-8 .col-sm-10,
.form-horizontal .col-lg-9 .col-sm-10,
.form-horizontal .col-lg-10 .col-sm-10,
.form-horizontal .col-lg-11 .col-sm-10,
.form-horizontal .col-lg12 .col-sm-10,
.form-horizontal .col-lg-1 .col-sm-11,
.form-horizontal .col-lg-2 .col-sm-11,
.form-horizontal .col-lg-3 .col-sm-11,
.form-horizontal .col-lg-4 .col-sm-11,
.form-horizontal .col-lg-5 .col-sm-11,
.form-horizontal .col-lg-6 .col-sm-11,
.form-horizontal .col-lg-7 .col-sm-11,
.form-horizontal .col-lg-8 .col-sm-11,
.form-horizontal .col-lg-9 .col-sm-11,
.form-horizontal .col-lg-10 .col-sm-11,
.form-horizontal .col-lg-11 .col-sm-11,
.form-horizontal .col-lg12 .col-sm-11,
.form-horizontal .col-lg-1 .col-sm-12,
.form-horizontal .col-lg-2 .col-sm-12,
.form-horizontal .col-lg-3 .col-sm-12,
.form-horizontal .col-lg-4 .col-sm-12,
.form-horizontal .col-lg-5 .col-sm-12,
.form-horizontal .col-lg-6 .col-sm-12,
.form-horizontal .col-lg-7 .col-sm-12,
.form-horizontal .col-lg-8 .col-sm-12,
.form-horizontal .col-lg-9 .col-sm-12,
.form-horizontal .col-lg-10 .col-sm-12,
.form-horizontal .col-lg-11 .col-sm-12,
.form-horizontal .col-lg12 .col-sm-12 {
padding-left: 0;
}
form .has-error ul.help-block {
list-style: none;
padding-left: 0;
}
form .alert ul {
list-style: none;
padding-left: 0;
}
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Enable Or Disable Extension Loading</title>
<style type="text/css">
body {
margin: auto;
font-family: Verdana, sans-serif;
padding: 8px 1%;
}
a { color: #044a64 }
a:visited { color: #734559 }
.logo { position:absolute; margin:3px; }
.tagline {
float:right;
text-align:right;
font-style:italic;
width:300px;
margin:12px;
margin-top:58px;
}
.menubar {
clear: both;
border-radius: 8px;
background: #044a64;
padding: 0px;
margin: 0px;
cell-spacing: 0px;
}
.toolbar {
text-align: center;
line-height: 1.6em;
margin: 0;
padding: 0px 8px;
}
.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
.toolbar a:visited { color: white; }
.toolbar a:hover { color: #044a64; background: white; }
.content { margin: 5%; }
.content dt { font-weight:bold; }
.content dd { margin-bottom: 25px; margin-left:20%; }
.content ul { padding:0px; padding-left: 15px; margin:0px; }
/* Things for "fancyformat" documents start here. */
.fancy img+p {font-style:italic}
.fancy .codeblock i { color: darkblue; }
.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
.fancy h2 { margin-left: 10px }
.fancy h3 { margin-left: 20px }
.fancy h4 { margin-left: 30px }
.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
.fancy #toc a { color: darkblue ; text-decoration: none }
.fancy .todo { color: #AA3333 ; font-style : italic }
.fancy .todo:before { content: 'TODO:' }
.fancy p.todo { border: solid #AA3333 1px; padding: 1ex }
.fancy img { display:block; }
.fancy :link:hover, .fancy :visited:hover { background: wheat }
.fancy p,.fancy ul,.fancy ol,.fancy dl { margin: 1em 5ex }
.fancy li p { margin: 1em 0 }
/* End of "fancyformat" specific rules. */
.yyterm {
background: #fff;
border: 1px solid #000;
border-radius: 11px;
padding-left: 4px;
padding-right: 4px;
}
</style>
</head>
<body>
<div><!-- container div to satisfy validator -->
<a href="../index.html">
<img class="logo" src="../images/sqlite370_banner.gif" alt="SQLite Logo"
border="0"></a>
<div><!-- IE hack to prevent disappearing logo--></div>
<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
<table width=100% class="menubar"><tr>
<td width=100%>
<div class="toolbar">
<a href="../about.html">About</a>
<a href="../docs.html">Documentation</a>
<a href="../download.html">Download</a>
<a href="../copyright.html">License</a>
<a href="../support.html">Support</a>
<a href="http://www.hwaci.com/sw/sqlite/prosupport.html">Purchase</a>
</div>
<script>
gMsg = "Search SQLite Docs..."
function entersearch() {
var q = document.getElementById("q");
if( q.value == gMsg ) { q.value = "" }
q.style.color = "black"
q.style.fontStyle = "normal"
}
function leavesearch() {
var q = document.getElementById("q");
if( q.value == "" ) {
q.value = gMsg
q.style.color = "#044a64"
q.style.fontStyle = "italic"
}
}
function hideorshow(btn,obj){
var x = document.getElementById(obj);
var b = document.getElementById(btn);
if( x.style.display!='none' ){
x.style.display = 'none';
b.innerHTML='show';
}else{
x.style.display = '';
b.innerHTML='hide';
}
return false;
}
</script>
<td>
<div style="padding:0 1em 0px 0;white-space:nowrap">
<form name=f method="GET" action="https://www.sqlite.org/search">
<input id=q name=q type=text
onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
<input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
</form>
</div>
</table>
<div class=startsearch></div>
<a href="intro.html"><h2>SQLite C Interface</h2></a><h2>Enable Or Disable Extension Loading</h2><blockquote><pre>int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
</pre></blockquote><p>
So as not to open security holes in older applications that are
unprepared to deal with <a href="../loadext.html">extension loading</a>, and as a means of disabling
<a href="../loadext.html">extension loading</a> while evaluating user-entered SQL, the following API
is provided to turn the <a href="../c3ref/load_extension.html">sqlite3_load_extension()</a> mechanism on and off.</p>
<p>Extension loading is off by default.
Call the sqlite3_enable_load_extension() routine with onoff==1
to turn extension loading on and call it with onoff==0 to turn
it back off again.
</p><p>See also lists of
<a href="objlist.html">Objects</a>,
<a href="constlist.html">Constants</a>, and
<a href="funclist.html">Functions</a>.</p>
|
Java
|
# Sopubia similis Skan SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
/*
Copyright 2013 Semantic Discovery, Inc. (www.semanticdiscovery.com)
This file is part of the Semantic Discovery Toolkit.
The Semantic Discovery Toolkit is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The Semantic Discovery Toolkit is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with The Semantic Discovery Toolkit. If not, see <http://www.gnu.org/licenses/>.
*/
package org.sd.token;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import org.sd.nlp.NormalizedString;
/**
* An nlp.NormalizedString implementation based on this package's tokenization.
* <p>
* @author Spence Koehler
*/
public class TokenizerNormalizedString implements NormalizedString {
private TokenizerBasedNormalizer normalizer;
private StandardTokenizer tokenizer;
private boolean lowerCaseFlag;
private boolean computed;
private Normalization _normalization;
/**
* Construct with default case-sensitive settings.
*/
public TokenizerNormalizedString(String string) {
this(TokenizerBasedNormalizer.CASE_SENSITIVE_INSTANCE, new StandardTokenizer(string, TokenizerBasedNormalizer.DEFAULT_TOKENIZER_OPTIONS), false);
}
/**
* Construct with the given settings.
*/
public TokenizerNormalizedString(TokenizerBasedNormalizer normalizer, StandardTokenizer tokenizer, boolean lowerCaseFlag) {
this.normalizer = normalizer;
this.tokenizer = tokenizer;
this.lowerCaseFlag = lowerCaseFlag;
this.computed = false;
reset();
}
public StandardTokenizer getTokenizer() {
return tokenizer;
}
public void setLowerCaseFlag(boolean lowerCaseFlag) {
if (lowerCaseFlag != this.lowerCaseFlag) {
this.lowerCaseFlag = lowerCaseFlag;
reset();
}
}
public boolean getLowerCaseFlag() {
return lowerCaseFlag;
}
/**
* Set a flag indicating whether to split on camel-casing.
*/
public void setSplitOnCamelCase(boolean splitOnCamelCase) {
final Break curBreak = tokenizer.getOptions().getLowerUpperBreak();
final Break nextBreak = splitOnCamelCase ? Break.ZERO_WIDTH_SOFT_BREAK : Break.NO_BREAK;
if (curBreak != nextBreak) {
final StandardTokenizerOptions newOptions = new StandardTokenizerOptions(tokenizer.getOptions());
newOptions.setLowerUpperBreak(nextBreak);
this.tokenizer = new StandardTokenizer(tokenizer.getText(), newOptions);
reset();
}
}
private final void reset() {
this.computed = false;
}
/**
* Get the flag indicating whether to split on camel-casing.
*/
public boolean getSplitOnCamelCase() {
return tokenizer.getOptions().getLowerUpperBreak() != Break.NO_BREAK;
}
/**
* Get the length of the normalized string.
*/
public int getNormalizedLength() {
return getNormalized().length();
}
/**
* Get the normalized string.
* <p>
* Note that the normalized string may apply to only a portion of the full
* original string.
*/
public String getNormalized() {
return getNormalization().getNormalized();
}
public String toString() {
return getNormalized();
}
/**
* Get the normalized string from the start (inclusive) to end (exclusive).
* <p>
* Note that the normalized string may apply to only a portion of the full
* original string.
*/
public String getNormalized(int startPos, int endPos) {
return getNormalized().substring(startPos, endPos);
}
/**
* Get the original string that applies to the normalized string.
*/
public String getOriginal() {
return tokenizer.getText();
}
/**
* Get the original string that applies to the normalized string from the
* given index for the given number of normalized characters.
*/
public String getOriginal(int normalizedStartIndex, int normalizedLength) {
final int origStartIdx = getOriginalIndex(normalizedStartIndex);
final int origEndIdx = getOriginalIndex(normalizedStartIndex + normalizedLength);
return getOriginal().substring(origStartIdx, origEndIdx);
}
/**
* Get the index in the original string corresponding to the normalized index.
*/
public int getOriginalIndex(int normalizedIndex) {
final Integer result = getNormalization().getOriginalIndex(normalizedIndex);
return result == null ? -1 : result;
}
/**
* Get a new normalized string for the portion of this normalized string
* preceding the normalized start index (exclusive). Remove extra whitespace
* at the end of the returned string. Ensure that the returned string ends
* on an end token boundary.
*
* @return the preceding normalized string or null if empty (after skipping white).
*/
public NormalizedString getPreceding(int normalizedStartIndex) {
return getPreceding(normalizedStartIndex, true);
}
/**
* Get a new normalized string for the portion of this normalized string
* preceding the normalized start index (exclusive). Remove extra whitespace
* at the end of the returned string.
*
* @param normalizedStartIndex a token start position in the normalized string beyond the result
* @param checkEndBreak when true, skip back over non breaking chars to ensure result ends at a break.
*
* @return the preceding normalized string or null if empty (after skipping white).
*/
public NormalizedString getPreceding(int normalizedStartIndex, boolean checkEndBreak) {
NormalizedString result = null;
final int origIdx = getOriginalIndex(normalizedStartIndex);
if (origIdx >= 0) {
final Token token = tokenizer.getToken(origIdx);
if (token != null) {
final String priorText =
checkEndBreak ? tokenizer.getPriorText(token) :
tokenizer.getText().substring(0, token.getStartIndex()).trim();
if (!"".equals(priorText)) {
result = normalizer.normalize(priorText);
}
}
}
return result;
}
/**
* Find the (normalized) index of the nth token preceding the normalizedPos.
* <p>
* If normalizedPos is -1, start from the end of the string.
* If the beginning of the string is fewer than numTokens prior to normalizedPos,
* return the beginning of the string.
*/
public int getPrecedingIndex(int normalizedPos, int numTokens) {
int result = normalizedPos < 0 ? getNormalization().getNormalizedLength() : normalizedPos;
// skip back to the numTokens-th start break.
int numStarts = 0;
for (; result > 0 && numStarts < numTokens; result = findPrecedingTokenStart(result)) {
++numStarts;
}
return result;
}
/**
* Find the start of the token before the normalizedPos.
* <p>
* If normalizedPos is at a token start, the prior token (or -1 if there is
* no prior token) will be returned; otherwise, the start of the token of
* which normalizedPos is a part will be returned.
*/
public int findPrecedingTokenStart(int normalizedPos) {
final Integer priorStart = getNormalization().getBreaks().lower(normalizedPos);
return priorStart == null ? -1 : priorStart;
}
/**
* Get a new normalized string for the portion of this normalized string
* following the normalized start index (inclusive). Remove extra whitespace
* at the beginning of the returned string.
*
* @return the following normalized string or null if empty (after skipping white).
*/
public NormalizedString getRemaining(int normalizedStartIndex) {
NormalizedString result = null;
final int origIdx = getOriginalIndex(normalizedStartIndex);
if (origIdx >= 0) {
final String origText = tokenizer.getText();
final int origLen = origText.length();
if (origIdx < origLen) {
final String remainingText = origText.substring(origIdx).trim();
if (!"".equals(remainingText)) {
result = normalizer.normalize(remainingText);
}
}
}
return result;
}
/**
* Build a normalized string from this using the given normalized index range.
*/
public NormalizedString buildNormalizedString(int normalizedStartIndex, int normalizedEndIndex) {
NormalizedString result = null;
final int origStartIdx = getOriginalIndex(normalizedStartIndex);
if (origStartIdx >= 0) {
final int origEndIdx = getOriginalIndex(normalizedEndIndex);
if (origEndIdx > origStartIdx) {
final String origText = tokenizer.getText();
final int origLen = origText.length();
if (origStartIdx < origLen) {
final String string = origText.substring(origStartIdx, Math.min(origEndIdx, origLen));
result = normalizer.normalize(string);
}
}
}
return result;
}
/**
* Lowercase the normalized form in this instance.
*
* @return this instance.
*/
public NormalizedString toLowerCase() {
getNormalization().toLowerCase();
return this;
}
/**
* Get the normalized string's chars.
*/
public char[] getNormalizedChars() {
return getNormalization().getNormalizedChars();
}
/**
* Get the normalized char at the given (normalized) index.
* <p>
* NOTE: Bounds checking is left up to the caller.
*/
public char getNormalizedChar(int index) {
return getNormalization().getNormalizedChars()[index];
}
/**
* Get the original code point corresponding to the normalized char at the
* (normalized) index.
* <p>
* NOTE: Bounds checking is left up to the caller.
*/
public int getOriginalCodePoint(int nIndex) {
int result = 0;
final int origIdx = getOriginalIndex(nIndex);
if (origIdx >= 0) {
final String origText = tokenizer.getText();
final int origLen = origText.length();
if (origIdx < origLen) {
result = origText.codePointAt(origIdx);
}
}
return result;
}
/**
* Determine whether the original character corresponding to the normalized
* index is a letter or digit.
*/
public boolean isLetterOrDigit(int nIndex) {
return Character.isLetterOrDigit(getOriginalCodePoint(nIndex));
}
/**
* Get the ORIGINAL index of the first symbol (non-letter, digit, or white
* character) prior to the NORMALIZED index in the full original string.
*
* @return -1 if no symbol is found or the index of the found symbol in the
* original input string.
*/
public int findPreviousSymbolIndex(int nIndex) {
int result = -1;
final int origIdx = getOriginalIndex(nIndex);
if (origIdx >= 0) {
final String origText = tokenizer.getText();
final int origLen = origText.length();
for (result = Math.min(origIdx, origLen) - 1; result >= 0; --result) {
final int cp = origText.codePointAt(result);
if (cp != ' ' && !Character.isLetterOrDigit(cp)) break;
}
}
return result;
}
/**
* Determine whether the normalized string has a digit between the normalized
* start (inclusive) and end (exclusive).
*/
public boolean hasDigit(int nStartIndex, int nEndIndex) {
boolean result = false;
final char[] nchars = getNormalization().getNormalizedChars();
nEndIndex = Math.min(nEndIndex, nchars.length);
for (int idx = Math.max(nStartIndex, 0); idx < nEndIndex; ++idx) {
final char c = nchars[idx];
if (c <= '9' && c >= '0') {
result = true;
break;
}
}
return result;
}
/**
* Count the number of normalized words in the given range.
*/
public int numWords(int nStartIndex, int nEndIndex) {
int result = 0;
final Normalization normalization = getNormalization();
final TreeSet<Integer> breaks = normalization.getBreaks();
final int nLen = normalization.getNormalizedLength();
nEndIndex = Math.min(nEndIndex, nLen);
for (int idx = Math.max(nStartIndex, 0); idx < nEndIndex && idx >= 0; idx = breaks.higher(idx)) {
if (idx == nEndIndex - 1) break; // nEndIdex as at the beginning of a word -- doesn't count
++result;
}
return result;
}
/**
* Determine whether there is a break before the normalized startIndex.
*/
public boolean isStartBreak(int startIndex) {
return getNormalization().isBreak(startIndex - 1);
}
/**
* Determine whether there is a break after the normalized endIndex.
*/
public boolean isEndBreak(int endIndex) {
return getNormalization().isBreak(endIndex + 1);
}
/**
* Get (first) the normalized index that best corresponds to the original index.
*/
public int getNormalizedIndex(int originalIndex) {
return getNormalization().getNormalizedIndex(originalIndex);
}
/**
* Split into normalized token strings.
*/
public String[] split() {
return getNormalization().getNormalized().split("\\s+");
}
/**
* Split into normalized token strings, removing stopwords.
*/
public String[] split(Set<String> stopwords) {
final List<String> result = new ArrayList<String>();
for (NormalizedToken token = getToken(0, true); token != null; token = token.getNext(true)) {
final String ntoken = token.getNormalized();
if (stopwords == null || !stopwords.contains(ntoken)) {
result.add(ntoken);
}
}
return result.toArray(new String[result.size()]);
}
/**
* Split this normalized string into tokens.
*/
public NormalizedToken[] tokenize() {
final List<NormalizedToken> result = new ArrayList<NormalizedToken>();
for (NormalizedToken token = getToken(0, true); token != null; token = token.getNext(true)) {
result.add(token);
}
return result.toArray(new NormalizedToken[result.size()]);
}
/**
* Get the token starting from the start position, optionally skipping to a
* start break first.
*
* @return the token or null if there are no tokens to get.
*/
public NormalizedToken getToken(int startPos, boolean skipToBreak) {
NormalizedToken result = null;
startPos = getTokenStart(startPos, skipToBreak);
if (startPos < getNormalization().getNormalizedLength()) {
final int endPos = getTokenEnd(startPos);
result = new NormalizedToken(this, startPos, endPos);
}
return result;
}
/**
* Get the token after the given token, optionally skipping to a start
* break first.
*/
public NormalizedToken getNextToken(NormalizedToken curToken, boolean skipToBreak) {
NormalizedToken result = null;
if (curToken != null) {
final Normalization normalization = getNormalization();
final TreeSet<Integer> breaks = normalization.getBreaks();
final int nLen = normalization.getNormalizedLength();
int curEndPos = curToken.getEndPos();
if (skipToBreak && !normalization.isBreak(curEndPos)) {
final Integer nextBreak = breaks.higher(curEndPos);
curEndPos = (nextBreak == null) ? nLen : nextBreak;
}
if (curEndPos < nLen) {
final int startPos = getTokenStart(curEndPos + 1, true);
if (startPos < nLen) {
final int nextEndPos = getTokenEnd(startPos);
result = new NormalizedToken(this, startPos, nextEndPos);
}
}
}
return result;
}
/**
* Get the normalized token start pos at or after (normalized) startPos
* after optionally skipping to a token start position (if not already
* at one.)
*/
private final int getTokenStart(int startPos, boolean skipToBreak) {
final Normalization normalization = getNormalization();
final TreeSet<Integer> breaks = normalization.getBreaks();
final int nLen = normalization.getNormalizedLength();
if (skipToBreak && !isStartBreak(startPos)) {
final Integer nextBreak = breaks.ceiling(startPos);
startPos = nextBreak == null ? nLen : nextBreak + 1;
}
return startPos;
}
/**
* Get the normalized index just after the token starting at (normalized) startPos.
*/
private final int getTokenEnd(int startPos) {
final Normalization normalization = getNormalization();
final TreeSet<Integer> breaks = normalization.getBreaks();
final int nLen = normalization.getNormalizedLength();
final Integer endPos = breaks.higher(startPos);
return endPos == null ? nLen : endPos;
}
protected final Normalization getNormalization() {
if (!computed) {
computeNormalization();
}
return _normalization;
}
private final void computeNormalization() {
this._normalization = buildNewNormalization(tokenizer, lowerCaseFlag);
for (Token token = tokenizer.getToken(0); token != null; token = token.getNextToken()) {
_normalization.updateWithToken(token);
}
this.computed = true;
}
protected Normalization buildNewNormalization(StandardTokenizer tokenizer, boolean lowerCaseFlag) {
return new Normalization(tokenizer, lowerCaseFlag);
}
public static class Normalization {
private StandardTokenizer tokenizer;
private boolean lowerCaseFlag;
private StringBuilder normalized;
private Map<Integer, Integer> norm2orig;
private TreeSet<Integer> breaks;
private char[] _nchars;
public Normalization(StandardTokenizer tokenizer, boolean lowerCaseFlag) {
this.tokenizer = tokenizer;
this.lowerCaseFlag = lowerCaseFlag;
this.normalized = new StringBuilder();
this.norm2orig = new HashMap<Integer, Integer>();
this.breaks = new TreeSet<Integer>();
this._nchars = null;
}
public final StandardTokenizer getTokenizer() {
return tokenizer;
}
public final boolean getLowerCaseFlag() {
return lowerCaseFlag;
}
/** Get original input. */
public final String getInput() {
return tokenizer.getText();
}
/** Get the normalized string. */
public final String getNormalized() {
return normalized.toString();
}
public final char[] getNormalizedChars() {
if (_nchars == null) {
_nchars = normalized.toString().toCharArray();
}
return _nchars;
}
public final int getNormalizedLength() {
return normalized.length();
}
public final int getOriginalIndex(int normalizedIndex) {
final Integer result =
(normalizedIndex == normalized.length()) ?
tokenizer.getText().length() :
norm2orig.get(normalizedIndex);
return result == null ? -1 : result;
}
public final int getNormalizedIndex(int originalIndex) {
int result = -1;
for (Map.Entry<Integer, Integer> entry : norm2orig.entrySet()) {
final int normIdx = entry.getKey();
final int origIdx = entry.getValue();
if (originalIndex == origIdx) {
// maps to normalized char
result = normIdx;
break;
}
else if (originalIndex > origIdx) {
// maps back to normalized white (break)
result = normIdx - 1;
break;
}
}
return result;
}
/**
* Determine whether there is a break at the given index.
*/
public final boolean isBreak(int normalizedIndex) {
return !norm2orig.containsKey(normalizedIndex);
}
/** Get the normalized break positions (not including string start or end). */
public final TreeSet<Integer> getBreaks() {
return breaks;
}
/** Lowercase this instance's normalized chars. */
public final void toLowerCase() {
final String newNorm = normalized.toString().toLowerCase();
this.normalized.setLength(0);
this.normalized.append(newNorm);
this._nchars = null;
}
/**
* Build the next normalized chars from the given token using
* the "appendX" method calls.
*/
protected void updateWithToken(Token token) {
final String tokenText = lowerCaseFlag ? token.getText().toLowerCase() : token.getText();
appendNormalizedText(token.getStartIndex(), tokenText, true);
}
/**
* Append each normalized character originally starting at startIdx.
*/
protected final void appendNormalizedText(int startIdx, String normalizedTokenText) {
appendNormalizedText(startIdx, normalizedTokenText, true);
}
/**
* Append each normalized character originally starting at startIdx.
*/
protected final void appendNormalizedText(int startIdx, String normalizedTokenText, boolean addWhite) {
final int len = normalizedTokenText.length();
for (int i = 0; i < len; ++i) {
final char c = normalizedTokenText.charAt(i);
appendNormalizedChar(startIdx++, c, addWhite && i == 0);
}
}
/**
* Append the normalized character originally starting at origIdx.
*/
protected final void appendNormalizedChar(int origIdx, char c, boolean addWhite) {
int normIdx = normalized.length();
if (normIdx > 0 && addWhite) {
normalized.append(' ');
breaks.add(normIdx++);
}
norm2orig.put(normIdx, origIdx);
normalized.append(c);
_nchars = null;
}
/**
* Append the normalized characters all expanding from the originalIdx.
*/
protected final void appendExpandedText(int origIdx, String chars) {
appendExpandedText(origIdx, chars, true);
}
/**
* Append the normalized characters all expanding from the originalIdx.
*/
protected final void appendExpandedText(int origIdx, String chars, boolean addWhite) {
final int len = chars.length();
for (int i = 0; i < chars.length(); ++i) {
final char c = chars.charAt(i);
appendNormalizedChar(origIdx, c, addWhite && i == 0);
}
}
}
}
|
Java
|
package lodVader.spring.REST.models.degree;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import org.junit.Test;
import com.mongodb.BasicDBList;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
import lodVader.mongodb.DBSuperClass2;
import lodVader.mongodb.collections.DatasetDB;
import lodVader.mongodb.collections.DatasetLinksetDB;
import lodVader.mongodb.collections.LinksetDB;
import lodVader.mongodb.collections.ResourceDB;
public class IndegreeDatasetModel {
public StringBuilder result = new StringBuilder();
public boolean isVocabulary = true;
public boolean isDeadLinks = false;
/**
* MapReduce functions for indegree linksets
*/
public String mapindegreeWithVocabs;
public String mapindegreeNoVocabs;
public String reduceinDegree;
class Result implements Comparator<Result>, Comparable<Result> {
int targetDataset;
int links = 0;
HashSet<Integer> sourceDatasetList = new HashSet<>();
@Override
public int compare(Result o1, Result o2) {
return o1.links - o2.links;
}
@Override
public int compareTo(Result o) {
return this.sourceDatasetList.size() - o.sourceDatasetList.size();
}
}
HashMap<Integer, Result> tmpResults = new HashMap<Integer, Result>();
ArrayList<Result> finalList = new ArrayList<Result>();
@Test
public void calc() {
/**
* MapReduce to find indegree with vocabularies
*/
result.append("===============================================================\n");
result.append("Comparing with vocabularies\n");
result.append("===============================================================\n\n");
DBCollection collection = DBSuperClass2.getDBInstance().getCollection(DatasetLinksetDB.COLLECTION_NAME);
DBCursor instances;
if(!isDeadLinks){
BasicDBList and = new BasicDBList();
// and.add(new BasicDBObject(DatasetLinksetDB.LINKS, new BasicDBObject("$gt", 0)));
// and.add(new BasicDBObject(DatasetLinksetDB.DATASET_SOURCE, new BasicDBObject("$ne", DatasetLinksetDB.DATASET_TARGET)));
instances = collection.find( new BasicDBObject(DatasetLinksetDB.LINKS, new BasicDBObject("$gt", 0)));
}
else{
BasicDBList and = new BasicDBList();
// and.add(new BasicDBObject(DatasetLinksetDB.DEAD_LINKS, new BasicDBObject("$gt", 0)));
// and.add(new BasicDBObject(DatasetLinksetDB.DATASET_SOURCE, new BasicDBObject("$ne", DatasetLinksetDB.DATASET_TARGET)));
// instances = collection.find( new BasicDBObject("$and", and));
instances = collection.find(new BasicDBObject(DatasetLinksetDB.DEAD_LINKS, new BasicDBObject("$gt", 0)));
}
for (DBObject object : instances) {
DatasetLinksetDB linkset = new DatasetLinksetDB(object);
if (linkset.getDistributionTargetIsVocabulary() == isVocabulary) {
Result result = tmpResults.get(linkset.getDatasetTarget());
if (result == null) {
result = new Result();
}
if (isDeadLinks)
result.links = result.links + linkset.getDeadLinks();
else
result.links = result.links + linkset.getLinks();
result.sourceDatasetList.add(linkset.getDatasetSource());
result.targetDataset = linkset.getDatasetTarget();
tmpResults.put(linkset.getDatasetTarget(), result);
}
}
for (Integer r : tmpResults.keySet()) {
finalList.add(tmpResults.get(r));
}
result.append("\n===== Sorted by links=======");
Collections.sort(finalList, new Result());
printTableindegree();
result.append("\n===== Sorted by number of datasets=======");
Collections.sort(finalList);
printTableindegree();
result.append("\n\n\n\n===============================================================\n");
result.append("Comparing without vocabularies\n");
result.append("===============================================================\n\n");
tmpResults = new HashMap<Integer, Result>();
finalList = new ArrayList<Result>();
isVocabulary = false;
for (DBObject object : instances) {
DatasetLinksetDB linkset = new DatasetLinksetDB(object);
if (linkset.getDistributionTargetIsVocabulary() == isVocabulary) {
Result result = tmpResults.get(linkset.getDatasetTarget());
if (result == null) {
result = new Result();
}
if (isDeadLinks)
result.links = result.links + linkset.getDeadLinks();
else
result.links = result.links + linkset.getLinks();
result.sourceDatasetList.add(linkset.getDatasetSource());
result.targetDataset = linkset.getDatasetTarget();
tmpResults.put(linkset.getDatasetTarget(), result);
}
}
for (Integer r : tmpResults.keySet()) {
finalList.add(tmpResults.get(r));
}
result.append("\n===== Sorted by links=======");
Collections.sort(finalList, new Result());
printTableindegree();
result.append("\n===== Sorted by number of datasets=======");
Collections.sort(finalList);
printTableindegree();
}
private void printTableindegree() {
result.append("\n\nName\t indegree \t Links \n");
DatasetDB tmpDataset;
for (Result r : finalList) {
tmpDataset = new DatasetDB(r.targetDataset);
result.append(tmpDataset.getTitle());
result.append("\t" + r.sourceDatasetList.size());
result.append("\t" + r.links);
result.append("\n");
}
result.append("\n\n\n");
}
}
|
Java
|
package no.api.regurgitator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.dropwizard.Configuration;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
@JsonIgnoreProperties(ignoreUnknown = true)
public class RegurgitatorConfiguration extends Configuration {
@Valid
@NotNull
@JsonProperty
private int proxyPort;
@Valid
@JsonProperty
private String archivedFolder;
@Valid
@NotNull
@JsonProperty
private Boolean recordOnStart;
@Valid
@NotNull
@JsonProperty
private String storageManager;
public int getProxyPort() {
return proxyPort;
}
public String getStorageManager() {
return storageManager;
}
public Boolean getRecordOnStart() {
return recordOnStart;
}
public String getArchivedFolder() {
return archivedFolder;
}
}
|
Java
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<title>TestBatchHRegionLockingAndWrites xref</title>
<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />
</head>
<body>
<pre>
<a name="1" href="#1">1</a> <em class="jxr_javadoccomment">/**</em>
<a name="2" href="#2">2</a> <em class="jxr_javadoccomment"> * Copyright 2010 The Apache Software Foundation</em>
<a name="3" href="#3">3</a> <em class="jxr_javadoccomment"> *</em>
<a name="4" href="#4">4</a> <em class="jxr_javadoccomment"> * Licensed to the Apache Software Foundation (ASF) under one</em>
<a name="5" href="#5">5</a> <em class="jxr_javadoccomment"> * or more contributor license agreements. See the NOTICE file</em>
<a name="6" href="#6">6</a> <em class="jxr_javadoccomment"> * distributed with this work for additional information</em>
<a name="7" href="#7">7</a> <em class="jxr_javadoccomment"> * regarding copyright ownership. The ASF licenses this file</em>
<a name="8" href="#8">8</a> <em class="jxr_javadoccomment"> * to you under the Apache License, Version 2.0 (the</em>
<a name="9" href="#9">9</a> <em class="jxr_javadoccomment"> * "License"); you may not use this file except in compliance</em>
<a name="10" href="#10">10</a> <em class="jxr_javadoccomment"> * with the License. You may obtain a copy of the License at</em>
<a name="11" href="#11">11</a> <em class="jxr_javadoccomment"> *</em>
<a name="12" href="#12">12</a> <em class="jxr_javadoccomment"> * <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
<a name="13" href="#13">13</a> <em class="jxr_javadoccomment"> *</em>
<a name="14" href="#14">14</a> <em class="jxr_javadoccomment"> * Unless required by applicable law or agreed to in writing, software</em>
<a name="15" href="#15">15</a> <em class="jxr_javadoccomment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
<a name="16" href="#16">16</a> <em class="jxr_javadoccomment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
<a name="17" href="#17">17</a> <em class="jxr_javadoccomment"> * See the License for the specific language governing permissions and</em>
<a name="18" href="#18">18</a> <em class="jxr_javadoccomment"> * limitations under the License.</em>
<a name="19" href="#19">19</a> <em class="jxr_javadoccomment"> */</em>
<a name="20" href="#20">20</a> <strong class="jxr_keyword">package</strong> org.apache.hadoop.hbase.regionserver;
<a name="21" href="#21">21</a>
<a name="22" href="#22">22</a> <strong class="jxr_keyword">import</strong> com.google.common.collect.Lists;
<a name="23" href="#23">23</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.conf.Configuration;
<a name="24" href="#24">24</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.fs.FileSystem;
<a name="25" href="#25">25</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.fs.Path;
<a name="26" href="#26">26</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.hbase.*;
<a name="27" href="#27">27</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.hbase.client.Mutation;
<a name="28" href="#28">28</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.hbase.client.Put;
<a name="29" href="#29">29</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.hbase.io.HeapSize;
<a name="30" href="#30">30</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.hbase.regionserver.wal.HLog;
<a name="31" href="#31">31</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.hbase.util.Bytes;
<a name="32" href="#32">32</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.hbase.util.HashedBytes;
<a name="33" href="#33">33</a> <strong class="jxr_keyword">import</strong> org.apache.hadoop.hbase.util.Pair;
<a name="34" href="#34">34</a> <strong class="jxr_keyword">import</strong> org.junit.Test;
<a name="35" href="#35">35</a> <strong class="jxr_keyword">import</strong> org.junit.experimental.categories.Category;
<a name="36" href="#36">36</a>
<a name="37" href="#37">37</a> <strong class="jxr_keyword">import</strong> java.io.IOException;
<a name="38" href="#38">38</a> <strong class="jxr_keyword">import</strong> java.util.List;
<a name="39" href="#39">39</a>
<a name="40" href="#40">40</a> <strong class="jxr_keyword">import</strong> <strong class="jxr_keyword">static</strong> org.junit.Assert.assertEquals;
<a name="41" href="#41">41</a>
<a name="42" href="#42">42</a>
<a name="43" href="#43">43</a> @Category(SmallTests.<strong class="jxr_keyword">class</strong>)
<a name="44" href="#44">44</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/hadoop/hbase/regionserver/TestBatchHRegionLockingAndWrites.html">TestBatchHRegionLockingAndWrites</a> {
<a name="45" href="#45">45</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> String FAMILY = <span class="jxr_string">"a"</span>;
<a name="46" href="#46">46</a>
<a name="47" href="#47">47</a> @Test
<a name="48" href="#48">48</a> @SuppressWarnings(<span class="jxr_string">"unchecked"</span>)
<a name="49" href="#49">49</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testRedundantRowKeys() <strong class="jxr_keyword">throws</strong> Exception {
<a name="50" href="#50">50</a>
<a name="51" href="#51">51</a> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> batchSize = 100000;
<a name="52" href="#52">52</a>
<a name="53" href="#53">53</a> String tableName = getClass().getSimpleName();
<a name="54" href="#54">54</a> Configuration conf = HBaseConfiguration.create();
<a name="55" href="#55">55</a> conf.setClass(HConstants.REGION_IMPL, MockHRegion.<strong class="jxr_keyword">class</strong>, HeapSize.<strong class="jxr_keyword">class</strong>);
<a name="56" href="#56">56</a> <a href="../../../../../org/apache/hadoop/hbase/regionserver/TestHBase7051.html">MockHRegion</a> region = (MockHRegion) TestHRegion.initHRegion(Bytes.toBytes(tableName), tableName, conf, Bytes.toBytes(<span class="jxr_string">"a"</span>));
<a name="57" href="#57">57</a>
<a name="58" href="#58">58</a> List<Pair<Mutation, Integer>> someBatch = Lists.newArrayList();
<a name="59" href="#59">59</a> <strong class="jxr_keyword">int</strong> i = 0;
<a name="60" href="#60">60</a> <strong class="jxr_keyword">while</strong> (i < batchSize) {
<a name="61" href="#61">61</a> <strong class="jxr_keyword">if</strong> (i % 2 == 0) {
<a name="62" href="#62">62</a> someBatch.add(<strong class="jxr_keyword">new</strong> Pair<Mutation, Integer>(<strong class="jxr_keyword">new</strong> Put(Bytes.toBytes(0)), <strong class="jxr_keyword">null</strong>));
<a name="63" href="#63">63</a> } <strong class="jxr_keyword">else</strong> {
<a name="64" href="#64">64</a> someBatch.add(<strong class="jxr_keyword">new</strong> Pair<Mutation, Integer>(<strong class="jxr_keyword">new</strong> Put(Bytes.toBytes(1)), <strong class="jxr_keyword">null</strong>));
<a name="65" href="#65">65</a> }
<a name="66" href="#66">66</a> i++;
<a name="67" href="#67">67</a> }
<a name="68" href="#68">68</a> <strong class="jxr_keyword">long</strong> start = System.nanoTime();
<a name="69" href="#69">69</a> region.batchMutate(someBatch.toArray(<strong class="jxr_keyword">new</strong> Pair[0]));
<a name="70" href="#70">70</a> <strong class="jxr_keyword">long</strong> duration = System.nanoTime() - start;
<a name="71" href="#71">71</a> System.out.println(<span class="jxr_string">"Batch mutate took: "</span> + duration + <span class="jxr_string">"ns"</span>);
<a name="72" href="#72">72</a> assertEquals(2, region.getAcquiredLockCount());
<a name="73" href="#73">73</a> }
<a name="74" href="#74">74</a>
<a name="75" href="#75">75</a> @Test
<a name="76" href="#76">76</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGettingTheLockMatchesMyRow() <strong class="jxr_keyword">throws</strong> Exception {
<a name="77" href="#77">77</a> <a href="../../../../../org/apache/hadoop/hbase/regionserver/TestHBase7051.html">MockHRegion</a> region = getMockHRegion();
<a name="78" href="#78">78</a> HashedBytes rowKey = <strong class="jxr_keyword">new</strong> HashedBytes(Bytes.toBytes(1));
<a name="79" href="#79">79</a> assertEquals(Integer.valueOf(2), region.getLock(<strong class="jxr_keyword">null</strong>, rowKey, false));
<a name="80" href="#80">80</a> assertEquals(Integer.valueOf(2), region.getLock(2, rowKey, false));
<a name="81" href="#81">81</a> }
<a name="82" href="#82">82</a>
<a name="83" href="#83">83</a> <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/hadoop/hbase/regionserver/TestHBase7051.html">MockHRegion</a> getMockHRegion() <strong class="jxr_keyword">throws</strong> IOException {
<a name="84" href="#84">84</a> String tableName = getClass().getSimpleName();
<a name="85" href="#85">85</a> Configuration conf = HBaseConfiguration.create();
<a name="86" href="#86">86</a> conf.setClass(HConstants.REGION_IMPL, MockHRegion.<strong class="jxr_keyword">class</strong>, HeapSize.<strong class="jxr_keyword">class</strong>);
<a name="87" href="#87">87</a> <strong class="jxr_keyword">return</strong> (MockHRegion) TestHRegion.initHRegion(Bytes.toBytes(tableName), tableName, conf, Bytes.toBytes(FAMILY));
<a name="88" href="#88">88</a> }
<a name="89" href="#89">89</a>
<a name="90" href="#90">90</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/hadoop/hbase/regionserver/TestHBase7051.html">MockHRegion</a> <strong class="jxr_keyword">extends</strong> HRegion {
<a name="91" href="#91">91</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">int</strong> acqioredLockCount = 0;
<a name="92" href="#92">92</a>
<a name="93" href="#93">93</a> <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/hadoop/hbase/regionserver/TestHBase7051.html">MockHRegion</a>(Path tableDir, HLog log, FileSystem fs, Configuration conf, <strong class="jxr_keyword">final</strong> HRegionInfo regionInfo, <strong class="jxr_keyword">final</strong> HTableDescriptor htd, RegionServerServices rsServices) {
<a name="94" href="#94">94</a> <strong class="jxr_keyword">super</strong>(tableDir, log, fs, conf, regionInfo, htd, rsServices);
<a name="95" href="#95">95</a> }
<a name="96" href="#96">96</a>
<a name="97" href="#97">97</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">int</strong> getAcquiredLockCount() {
<a name="98" href="#98">98</a> <strong class="jxr_keyword">return</strong> acqioredLockCount;
<a name="99" href="#99">99</a> }
<a name="100" href="#100">100</a>
<a name="101" href="#101">101</a> @Override
<a name="102" href="#102">102</a> <strong class="jxr_keyword">public</strong> Integer getLock(Integer lockid, HashedBytes row, <strong class="jxr_keyword">boolean</strong> waitForLock) <strong class="jxr_keyword">throws</strong> IOException {
<a name="103" href="#103">103</a> acqioredLockCount++;
<a name="104" href="#104">104</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">super</strong>.getLock(lockid, row, waitForLock);
<a name="105" href="#105">105</a> }
<a name="106" href="#106">106</a> }
<a name="107" href="#107">107</a> }
</pre>
<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
</html>
|
Java
|
package org.minimalj.example.petclinic.frontend;
import org.minimalj.backend.Backend;
import org.minimalj.example.petclinic.model.Vet;
import org.minimalj.frontend.Frontend;
import org.minimalj.frontend.editor.Editor.NewObjectEditor;
import org.minimalj.frontend.form.Form;
public class AddVetEditor extends NewObjectEditor<Vet> {
@Override
protected Form<Vet> createForm() {
Form<Vet> form = new Form<>();
form.line(Vet.$.person.firstName);
form.line(Vet.$.person.lastName);
form.line(Vet.$.specialties);
return form;
}
@Override
protected Vet save(Vet owner) {
return Backend.save(owner);
}
@Override
protected void finished(Vet newVet) {
Frontend.show(new VetTablePage());
}
}
|
Java
|
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get -y install curl git vim
git clone https://github.com/openstack-dev/devstack.git -b stable/icehouse devstack/
cd devstack/
wget https://gist.githubusercontent.com/everett-toews/3cbbf4c3d059848ac316/raw/6a18ded87190c87ac981e8682b783bb25aa9e844/local.conf
./stack.sh
|
Java
|
# -*- coding: utf-8 -*-
# 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.
# Glance Release Notes documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 3 17:40:50 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'oslosphinx',
'reno.sphinxext',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'cellar Release Notes'
copyright = u'2016, OpenStack Foundation'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
# The full version, including alpha/beta/rc tags.
release = ''
# The short X.Y version.
version = ''
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all
# documents.
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
# html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}
# If false, no module index is generated.
# html_domain_indices = True
# If false, no index is generated.
# html_use_index = True
# If true, the index is split into individual pages for each letter.
# html_split_index = False
# If true, links to the reST sources are added to the pages.
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'GlanceReleaseNotesdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'GlanceReleaseNotes.tex', u'Glance Release Notes Documentation',
u'Glance Developers', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False
# If true, show page references after internal links.
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
# latex_appendices = []
# If false, no module index is generated.
# latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'glancereleasenotes', u'Glance Release Notes Documentation',
[u'Glance Developers'], 1)
]
# If true, show URL addresses after external links.
# man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'GlanceReleaseNotes', u'Glance Release Notes Documentation',
u'Glance Developers', 'GlanceReleaseNotes',
'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
# texinfo_appendices = []
# If false, no module index is generated.
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
|
Java
|
/*
* Copyright 2019 Frederic Thevenet
*
* 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 eu.binjr.common.javafx.controls;
import javafx.scene.Node;
import javafx.scene.SnapshotParameters;
import javafx.scene.image.WritableImage;
import javafx.scene.transform.Transform;
import javafx.stage.Screen;
public final class SnapshotUtils {
public static WritableImage outputScaleAwareSnapshot(Node node) {
return scaledSnapshot(node, 0.0,0.0);
}
public static WritableImage scaledSnapshot(Node node, double scaleX, double scaleY) {
SnapshotParameters spa = new SnapshotParameters();
spa.setTransform(Transform.scale(
scaleX == 0.0 ? Screen.getPrimary().getOutputScaleX() : scaleX,
scaleY == 0.0 ? Screen.getPrimary().getOutputScaleY() : scaleY));
return node.snapshot(spa, null);
}
}
|
Java
|
FILES_TO_SERVE=index.html dmcc.js dmcc.css
all: $(addprefix Deploy/, $(FILES_TO_SERVE)) Deploy/build_rules.json
Deploy/build_rules.json: Source/process_build_rules.py
cd Source && ./process_build_rules.py > ../$@.tmp && mv ../$@.tmp ../$@
Deploy/%: Source/%
cp $< $@
run_server_old: all
cd Deploy && php -S localhost:8081
run_server: all
cd Deploy && node ../Source/dmcc_server.js
clean:
rm -f $(addprefix Deploy/, $(FILES_TO_SERVE))
rm -f Deploy/build_rules.json
|
Java
|
//
// Client+Extensions.h
//
// MobileTech Conference 2014
// Copyright (c) 2014 Ivo Wessel. All rights reserved.
// Fragen zum Quellcode? Unterstützung bei iOS-Projekten? Melden Sie sich bei mir...
//
// Ivo Wessel
// Lehrter Str. 57, Haus 2
// D-10557 Berlin
// Phone : +49-(0)30-89 62 64 77
// Mobile: +49-(0)177-4 86 93 77
// Skype : ivo.wessel
// E-Mail: email@ivo-wessel.de
// Web : www.we-make-apps.com
//
// -------------------------------------------------------------------------------------------------
@interface UIColor (Extensions)
// -------------------------------------------------------------------------------------------------
- (float) red;
- (float) green;
- (float) blue;
- (float) alpha;
- (NSString *) cacheKey;
+ (UIColor *) randomColor;
+ (UIColor *) colorWithRed:(int) nRed
green:(int) nGreen
blue:(int) nBlue;
// -------------------------------------------------------------------------------------------------
@end
|
Java
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, 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.
"""Test suite for XenAPI."""
import ast
import contextlib
import datetime
import functools
import os
import re
import mox
from nova.compute import aggregate_states
from nova.compute import instance_types
from nova.compute import power_state
from nova.compute import task_states
from nova.compute import utils as compute_utils
from nova.compute import vm_states
from nova import context
from nova import db
from nova import exception
from nova import flags
from nova import log as logging
from nova.openstack.common import importutils
from nova import test
from nova.tests.db import fakes as db_fakes
from nova.tests import fake_network
from nova.tests import fake_utils
from nova.tests.glance import stubs as glance_stubs
from nova.tests.xenapi import stubs
from nova.virt.xenapi import connection as xenapi_conn
from nova.virt.xenapi import fake as xenapi_fake
from nova.virt.xenapi import vm_utils
from nova.virt.xenapi import vmops
from nova.virt.xenapi import volume_utils
LOG = logging.getLogger(__name__)
FLAGS = flags.FLAGS
def stub_vm_utils_with_vdi_attached_here(function, should_return=True):
"""
vm_utils.with_vdi_attached_here needs to be stubbed out because it
calls down to the filesystem to attach a vdi. This provides a
decorator to handle that.
"""
@functools.wraps(function)
def decorated_function(self, *args, **kwargs):
@contextlib.contextmanager
def fake_vdi_attached_here(*args, **kwargs):
fake_dev = 'fakedev'
yield fake_dev
def fake_stream_disk(*args, **kwargs):
pass
def fake_is_vdi_pv(*args, **kwargs):
return should_return
orig_vdi_attached_here = vm_utils.vdi_attached_here
orig_stream_disk = vm_utils._stream_disk
orig_is_vdi_pv = vm_utils._is_vdi_pv
try:
vm_utils.vdi_attached_here = fake_vdi_attached_here
vm_utils._stream_disk = fake_stream_disk
vm_utils._is_vdi_pv = fake_is_vdi_pv
return function(self, *args, **kwargs)
finally:
vm_utils._is_vdi_pv = orig_is_vdi_pv
vm_utils._stream_disk = orig_stream_disk
vm_utils.vdi_attached_here = orig_vdi_attached_here
return decorated_function
class XenAPIVolumeTestCase(test.TestCase):
"""Unit tests for Volume operations."""
def setUp(self):
super(XenAPIVolumeTestCase, self).setUp()
self.user_id = 'fake'
self.project_id = 'fake'
self.context = context.RequestContext(self.user_id, self.project_id)
self.flags(target_host='127.0.0.1',
xenapi_connection_url='test_url',
xenapi_connection_password='test_pass',
firewall_driver='nova.virt.xenapi.firewall.'
'Dom0IptablesFirewallDriver')
db_fakes.stub_out_db_instance_api(self.stubs)
xenapi_fake.reset()
self.instance_values = {'id': 1,
'project_id': self.user_id,
'user_id': 'fake',
'image_ref': 1,
'kernel_id': 2,
'ramdisk_id': 3,
'root_gb': 20,
'instance_type_id': '3', # m1.large
'os_type': 'linux',
'architecture': 'x86-64'}
def _create_volume(self, size='0'):
"""Create a volume object."""
vol = {}
vol['size'] = size
vol['user_id'] = 'fake'
vol['project_id'] = 'fake'
vol['host'] = 'localhost'
vol['availability_zone'] = FLAGS.storage_availability_zone
vol['status'] = "creating"
vol['attach_status'] = "detached"
return db.volume_create(self.context, vol)
@staticmethod
def _make_info():
return {
'driver_volume_type': 'iscsi',
'data': {
'volume_id': 1,
'target_iqn': 'iqn.2010-10.org.openstack:volume-00000001',
'target_portal': '127.0.0.1:3260,fake',
'target_lun': None,
'auth_method': 'CHAP',
'auth_method': 'fake',
'auth_method': 'fake',
}
}
def test_mountpoint_to_number(self):
cases = {
'sda': 0,
'sdp': 15,
'hda': 0,
'hdp': 15,
'vda': 0,
'xvda': 0,
'0': 0,
'10': 10,
'vdq': -1,
'sdq': -1,
'hdq': -1,
'xvdq': -1,
}
for (input, expected) in cases.iteritems():
func = volume_utils.VolumeHelper.mountpoint_to_number
actual = func(input)
self.assertEqual(actual, expected,
'%s yielded %s, not %s' % (input, actual, expected))
def test_parse_volume_info_raise_exception(self):
"""This shows how to test helper classes' methods."""
stubs.stubout_session(self.stubs, stubs.FakeSessionForVolumeTests)
session = xenapi_conn.XenAPISession('test_url', 'root', 'test_pass')
helper = volume_utils.VolumeHelper
helper.XenAPI = session.get_imported_xenapi()
vol = self._create_volume()
# oops, wrong mount point!
self.assertRaises(volume_utils.StorageError,
helper.parse_volume_info,
self._make_info(),
'dev/sd'
)
db.volume_destroy(context.get_admin_context(), vol['id'])
def test_attach_volume(self):
"""This shows how to test Ops classes' methods."""
stubs.stubout_session(self.stubs, stubs.FakeSessionForVolumeTests)
conn = xenapi_conn.get_connection(False)
volume = self._create_volume()
instance = db.instance_create(self.context, self.instance_values)
vm = xenapi_fake.create_vm(instance.name, 'Running')
result = conn.attach_volume(self._make_info(),
instance.name, '/dev/sdc')
# check that the VM has a VBD attached to it
# Get XenAPI record for VBD
vbds = xenapi_fake.get_all('VBD')
vbd = xenapi_fake.get_record('VBD', vbds[0])
vm_ref = vbd['VM']
self.assertEqual(vm_ref, vm)
def test_attach_volume_raise_exception(self):
"""This shows how to test when exceptions are raised."""
stubs.stubout_session(self.stubs,
stubs.FakeSessionForVolumeFailedTests)
conn = xenapi_conn.get_connection(False)
volume = self._create_volume()
instance = db.instance_create(self.context, self.instance_values)
xenapi_fake.create_vm(instance.name, 'Running')
self.assertRaises(exception.VolumeDriverNotFound,
conn.attach_volume,
{'driver_volume_type': 'nonexist'},
instance.name,
'/dev/sdc')
class XenAPIVMTestCase(test.TestCase):
"""Unit tests for VM operations."""
def setUp(self):
super(XenAPIVMTestCase, self).setUp()
self.network = importutils.import_object(FLAGS.network_manager)
self.flags(xenapi_connection_url='test_url',
xenapi_connection_password='test_pass',
instance_name_template='%d',
firewall_driver='nova.virt.xenapi.firewall.'
'Dom0IptablesFirewallDriver')
xenapi_fake.reset()
xenapi_fake.create_local_srs()
xenapi_fake.create_local_pifs()
db_fakes.stub_out_db_instance_api(self.stubs)
xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
stubs.stubout_get_this_vm_uuid(self.stubs)
stubs.stubout_stream_disk(self.stubs)
stubs.stubout_is_vdi_pv(self.stubs)
stubs.stub_out_vm_methods(self.stubs)
glance_stubs.stubout_glance_client(self.stubs)
fake_utils.stub_out_utils_execute(self.stubs)
self.user_id = 'fake'
self.project_id = 'fake'
self.context = context.RequestContext(self.user_id, self.project_id)
self.conn = xenapi_conn.get_connection(False)
def test_init_host(self):
session = xenapi_conn.XenAPISession('test_url', 'root', 'test_pass')
vm = vm_utils.get_this_vm_ref(session)
# Local root disk
vdi0 = xenapi_fake.create_vdi('compute', None)
vbd0 = xenapi_fake.create_vbd(vm, vdi0)
# Instance VDI
vdi1 = xenapi_fake.create_vdi('instance-aaaa', None,
other_config={'nova_instance_uuid': 'aaaa'})
vbd1 = xenapi_fake.create_vbd(vm, vdi1)
# Only looks like instance VDI
vdi2 = xenapi_fake.create_vdi('instance-bbbb', None)
vbd2 = xenapi_fake.create_vbd(vm, vdi2)
self.conn.init_host(None)
self.assertEquals(set(xenapi_fake.get_all('VBD')), set([vbd0, vbd2]))
def test_list_instances_0(self):
instances = self.conn.list_instances()
self.assertEquals(instances, [])
def test_get_rrd_server(self):
self.flags(xenapi_connection_url='myscheme://myaddress/')
server_info = vm_utils.get_rrd_server()
self.assertEqual(server_info[0], 'myscheme')
self.assertEqual(server_info[1], 'myaddress')
def test_get_diagnostics(self):
def fake_get_rrd(host, vm_uuid):
with open('xenapi/vm_rrd.xml') as f:
return re.sub(r'\s', '', f.read())
self.stubs.Set(vm_utils, 'get_rrd', fake_get_rrd)
fake_diagnostics = {
'vbd_xvdb_write': '0.0',
'memory_target': '10961792000.0000',
'memory_internal_free': '3612860.6020',
'memory': '10961792000.0000',
'vbd_xvda_write': '0.0',
'cpu0': '0.0110',
'vif_0_tx': '752.4007',
'vbd_xvda_read': '0.0',
'vif_0_rx': '4837.8805'
}
instance = self._create_instance()
expected = self.conn.get_diagnostics(instance)
self.assertDictMatch(fake_diagnostics, expected)
def test_instance_snapshot_fails_with_no_primary_vdi(self):
def create_bad_vbd(vm_ref, vdi_ref):
vbd_rec = {'VM': vm_ref,
'VDI': vdi_ref,
'userdevice': 'fake',
'currently_attached': False}
vbd_ref = xenapi_fake._create_object('VBD', vbd_rec)
xenapi_fake.after_VBD_create(vbd_ref, vbd_rec)
return vbd_ref
self.stubs.Set(xenapi_fake, 'create_vbd', create_bad_vbd)
stubs.stubout_instance_snapshot(self.stubs)
# Stubbing out firewall driver as previous stub sets alters
# xml rpc result parsing
stubs.stubout_firewall_driver(self.stubs, self.conn)
instance = self._create_instance()
name = "MySnapshot"
self.assertRaises(exception.NovaException, self.conn.snapshot,
self.context, instance, name)
def test_instance_snapshot(self):
stubs.stubout_instance_snapshot(self.stubs)
stubs.stubout_is_snapshot(self.stubs)
# Stubbing out firewall driver as previous stub sets alters
# xml rpc result parsing
stubs.stubout_firewall_driver(self.stubs, self.conn)
instance = self._create_instance()
name = "MySnapshot"
template_vm_ref = self.conn.snapshot(self.context, instance, name)
# Ensure VM was torn down
vm_labels = []
for vm_ref in xenapi_fake.get_all('VM'):
vm_rec = xenapi_fake.get_record('VM', vm_ref)
if not vm_rec["is_control_domain"]:
vm_labels.append(vm_rec["name_label"])
self.assertEquals(vm_labels, [instance.name])
# Ensure VBDs were torn down
vbd_labels = []
for vbd_ref in xenapi_fake.get_all('VBD'):
vbd_rec = xenapi_fake.get_record('VBD', vbd_ref)
vbd_labels.append(vbd_rec["vm_name_label"])
self.assertEquals(vbd_labels, [instance.name])
# Ensure VDIs were torn down
for vdi_ref in xenapi_fake.get_all('VDI'):
vdi_rec = xenapi_fake.get_record('VDI', vdi_ref)
name_label = vdi_rec["name_label"]
self.assert_(not name_label.endswith('snapshot'))
def create_vm_record(self, conn, os_type, name):
instances = conn.list_instances()
self.assertEquals(instances, [name])
# Get Nova record for VM
vm_info = conn.get_info({'name': name})
# Get XenAPI record for VM
vms = [rec for ref, rec
in xenapi_fake.get_all_records('VM').iteritems()
if not rec['is_control_domain']]
vm = vms[0]
self.vm_info = vm_info
self.vm = vm
def check_vm_record(self, conn, check_injection=False):
# Check that m1.large above turned into the right thing.
instance_type = db.instance_type_get_by_name(conn, 'm1.large')
mem_kib = long(instance_type['memory_mb']) << 10
mem_bytes = str(mem_kib << 10)
vcpus = instance_type['vcpus']
self.assertEquals(self.vm_info['max_mem'], mem_kib)
self.assertEquals(self.vm_info['mem'], mem_kib)
self.assertEquals(self.vm['memory_static_max'], mem_bytes)
self.assertEquals(self.vm['memory_dynamic_max'], mem_bytes)
self.assertEquals(self.vm['memory_dynamic_min'], mem_bytes)
self.assertEquals(self.vm['VCPUs_max'], str(vcpus))
self.assertEquals(self.vm['VCPUs_at_startup'], str(vcpus))
# Check that the VM is running according to Nova
self.assertEquals(self.vm_info['state'], power_state.RUNNING)
# Check that the VM is running according to XenAPI.
self.assertEquals(self.vm['power_state'], 'Running')
if check_injection:
xenstore_data = self.vm['xenstore_data']
self.assertEquals(xenstore_data['vm-data/hostname'], 'test')
key = 'vm-data/networking/DEADBEEF0000'
xenstore_value = xenstore_data[key]
tcpip_data = ast.literal_eval(xenstore_value)
self.assertEquals(tcpip_data,
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
'ips': [{'enabled': '1',
'ip': '192.168.0.100',
'netmask': '255.255.255.0'}],
'dhcp_server': '192.168.0.1',
'label': 'fake',
'mac': 'DE:AD:BE:EF:00:00',
'rxtx_cap': 3})
def check_vm_params_for_windows(self):
self.assertEquals(self.vm['platform']['nx'], 'true')
self.assertEquals(self.vm['HVM_boot_params'], {'order': 'dc'})
self.assertEquals(self.vm['HVM_boot_policy'], 'BIOS order')
# check that these are not set
self.assertEquals(self.vm['PV_args'], '')
self.assertEquals(self.vm['PV_bootloader'], '')
self.assertEquals(self.vm['PV_kernel'], '')
self.assertEquals(self.vm['PV_ramdisk'], '')
def check_vm_params_for_linux(self):
self.assertEquals(self.vm['platform']['nx'], 'false')
self.assertEquals(self.vm['PV_args'], '')
self.assertEquals(self.vm['PV_bootloader'], 'pygrub')
# check that these are not set
self.assertEquals(self.vm['PV_kernel'], '')
self.assertEquals(self.vm['PV_ramdisk'], '')
self.assertEquals(self.vm['HVM_boot_params'], {})
self.assertEquals(self.vm['HVM_boot_policy'], '')
def check_vm_params_for_linux_with_external_kernel(self):
self.assertEquals(self.vm['platform']['nx'], 'false')
self.assertEquals(self.vm['PV_args'], 'root=/dev/xvda1')
self.assertNotEquals(self.vm['PV_kernel'], '')
self.assertNotEquals(self.vm['PV_ramdisk'], '')
# check that these are not set
self.assertEquals(self.vm['HVM_boot_params'], {})
self.assertEquals(self.vm['HVM_boot_policy'], '')
def _list_vdis(self):
url = FLAGS.xenapi_connection_url
username = FLAGS.xenapi_connection_username
password = FLAGS.xenapi_connection_password
session = xenapi_conn.XenAPISession(url, username, password)
return session.call_xenapi('VDI.get_all')
def _check_vdis(self, start_list, end_list):
for vdi_ref in end_list:
if not vdi_ref in start_list:
vdi_rec = xenapi_fake.get_record('VDI', vdi_ref)
# If the cache is turned on then the base disk will be
# there even after the cleanup
if 'other_config' in vdi_rec:
if vdi_rec['other_config']['image-id'] is None:
self.fail('Found unexpected VDI:%s' % vdi_ref)
else:
self.fail('Found unexpected VDI:%s' % vdi_ref)
def _test_spawn(self, image_ref, kernel_id, ramdisk_id,
instance_type_id="3", os_type="linux",
hostname="test", architecture="x86-64", instance_id=1,
check_injection=False,
create_record=True, empty_dns=False):
if create_record:
instance_values = {'id': instance_id,
'project_id': self.project_id,
'user_id': self.user_id,
'image_ref': image_ref,
'kernel_id': kernel_id,
'ramdisk_id': ramdisk_id,
'root_gb': 20,
'instance_type_id': instance_type_id,
'os_type': os_type,
'hostname': hostname,
'architecture': architecture}
instance = db.instance_create(self.context, instance_values)
else:
instance = db.instance_get(self.context, instance_id)
network_info = [({'bridge': 'fa0', 'id': 0,
'injected': True,
'cidr': '192.168.0.0/24',
'cidr_v6': 'dead:beef::1/120',
},
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
'ips': [{'enabled': '1',
'ip': '192.168.0.100',
'netmask': '255.255.255.0'}],
'dhcp_server': '192.168.0.1',
'label': 'fake',
'mac': 'DE:AD:BE:EF:00:00',
'rxtx_cap': 3})]
if empty_dns:
network_info[0][1]['dns'] = []
# admin_pass isn't part of the DB model, but it does get set as
# an attribute for spawn to use
instance.admin_pass = 'herp'
image_meta = {'id': glance_stubs.FakeGlance.IMAGE_VHD,
'disk_format': 'vhd'}
self.conn.spawn(self.context, instance, image_meta, network_info)
self.create_vm_record(self.conn, os_type, instance['name'])
self.check_vm_record(self.conn, check_injection)
self.assertTrue(instance.os_type)
self.assertTrue(instance.architecture)
def test_spawn_empty_dns(self):
"""Test spawning with an empty dns list"""
self._test_spawn(glance_stubs.FakeGlance.IMAGE_VHD, None, None,
os_type="linux", architecture="x86-64",
empty_dns=True)
self.check_vm_params_for_linux()
def test_spawn_not_enough_memory(self):
self.assertRaises(exception.InsufficientFreeMemory,
self._test_spawn,
1, 2, 3, "4") # m1.xlarge
def test_spawn_fail_cleanup_1(self):
"""Simulates an error while downloading an image.
Verifies that VDIs created are properly cleaned up.
"""
vdi_recs_start = self._list_vdis()
stubs.stubout_fetch_image_glance_disk(self.stubs, raise_failure=True)
self.assertRaises(xenapi_fake.Failure,
self._test_spawn, 1, 2, 3)
# No additional VDI should be found.
vdi_recs_end = self._list_vdis()
self._check_vdis(vdi_recs_start, vdi_recs_end)
def test_spawn_fail_cleanup_2(self):
"""Simulates an error while creating VM record.
It verifies that VDIs created are properly cleaned up.
"""
vdi_recs_start = self._list_vdis()
stubs.stubout_create_vm(self.stubs)
self.assertRaises(xenapi_fake.Failure,
self._test_spawn, 1, 2, 3)
# No additional VDI should be found.
vdi_recs_end = self._list_vdis()
self._check_vdis(vdi_recs_start, vdi_recs_end)
@stub_vm_utils_with_vdi_attached_here
def test_spawn_raw_glance(self):
self._test_spawn(glance_stubs.FakeGlance.IMAGE_RAW, None, None)
self.check_vm_params_for_linux()
def test_spawn_vhd_glance_linux(self):
self._test_spawn(glance_stubs.FakeGlance.IMAGE_VHD, None, None,
os_type="linux", architecture="x86-64")
self.check_vm_params_for_linux()
def test_spawn_vhd_glance_swapdisk(self):
# Change the default host_call_plugin to one that'll return
# a swap disk
orig_func = stubs.FakeSessionForVMTests.host_call_plugin
_host_call_plugin = stubs.FakeSessionForVMTests.host_call_plugin_swap
stubs.FakeSessionForVMTests.host_call_plugin = _host_call_plugin
# Stubbing out firewall driver as previous stub sets a particular
# stub for async plugin calls
stubs.stubout_firewall_driver(self.stubs, self.conn)
try:
# We'll steal the above glance linux test
self.test_spawn_vhd_glance_linux()
finally:
# Make sure to put this back
stubs.FakeSessionForVMTests.host_call_plugin = orig_func
# We should have 2 VBDs.
self.assertEqual(len(self.vm['VBDs']), 2)
# Now test that we have 1.
self.tearDown()
self.setUp()
self.test_spawn_vhd_glance_linux()
self.assertEqual(len(self.vm['VBDs']), 1)
def test_spawn_vhd_glance_windows(self):
self._test_spawn(glance_stubs.FakeGlance.IMAGE_VHD, None, None,
os_type="windows", architecture="i386")
self.check_vm_params_for_windows()
def test_spawn_iso_glance(self):
self._test_spawn(glance_stubs.FakeGlance.IMAGE_ISO, None, None,
os_type="windows", architecture="i386")
self.check_vm_params_for_windows()
def test_spawn_glance(self):
stubs.stubout_fetch_image_glance_disk(self.stubs)
self._test_spawn(glance_stubs.FakeGlance.IMAGE_MACHINE,
glance_stubs.FakeGlance.IMAGE_KERNEL,
glance_stubs.FakeGlance.IMAGE_RAMDISK)
self.check_vm_params_for_linux_with_external_kernel()
def test_spawn_netinject_file(self):
self.flags(flat_injected=True)
db_fakes.stub_out_db_instance_api(self.stubs, injected=True)
self._tee_executed = False
def _tee_handler(cmd, **kwargs):
input = kwargs.get('process_input', None)
self.assertNotEqual(input, None)
config = [line.strip() for line in input.split("\n")]
# Find the start of eth0 configuration and check it
index = config.index('auto eth0')
self.assertEquals(config[index + 1:index + 8], [
'iface eth0 inet static',
'address 192.168.0.100',
'netmask 255.255.255.0',
'broadcast 192.168.0.255',
'gateway 192.168.0.1',
'dns-nameservers 192.168.0.1',
''])
self._tee_executed = True
return '', ''
fake_utils.fake_execute_set_repliers([
# Capture the tee .../etc/network/interfaces command
(r'tee.*interfaces', _tee_handler),
])
self._test_spawn(glance_stubs.FakeGlance.IMAGE_MACHINE,
glance_stubs.FakeGlance.IMAGE_KERNEL,
glance_stubs.FakeGlance.IMAGE_RAMDISK,
check_injection=True)
self.assertTrue(self._tee_executed)
def test_spawn_netinject_xenstore(self):
db_fakes.stub_out_db_instance_api(self.stubs, injected=True)
self._tee_executed = False
def _mount_handler(cmd, *ignore_args, **ignore_kwargs):
# When mounting, create real files under the mountpoint to simulate
# files in the mounted filesystem
# mount point will be the last item of the command list
self._tmpdir = cmd[len(cmd) - 1]
LOG.debug(_('Creating files in %s to simulate guest agent'),
self._tmpdir)
os.makedirs(os.path.join(self._tmpdir, 'usr', 'sbin'))
# Touch the file using open
open(os.path.join(self._tmpdir, 'usr', 'sbin',
'xe-update-networking'), 'w').close()
return '', ''
def _umount_handler(cmd, *ignore_args, **ignore_kwargs):
# Umount would normall make files in the m,ounted filesystem
# disappear, so do that here
LOG.debug(_('Removing simulated guest agent files in %s'),
self._tmpdir)
os.remove(os.path.join(self._tmpdir, 'usr', 'sbin',
'xe-update-networking'))
os.rmdir(os.path.join(self._tmpdir, 'usr', 'sbin'))
os.rmdir(os.path.join(self._tmpdir, 'usr'))
return '', ''
def _tee_handler(cmd, *ignore_args, **ignore_kwargs):
self._tee_executed = True
return '', ''
fake_utils.fake_execute_set_repliers([
(r'mount', _mount_handler),
(r'umount', _umount_handler),
(r'tee.*interfaces', _tee_handler)])
self._test_spawn(1, 2, 3, check_injection=True)
# tee must not run in this case, where an injection-capable
# guest agent is detected
self.assertFalse(self._tee_executed)
def test_spawn_vlanmanager(self):
self.flags(image_service='nova.image.glance.GlanceImageService',
network_manager='nova.network.manager.VlanManager',
vlan_interface='fake0')
def dummy(*args, **kwargs):
pass
self.stubs.Set(vmops.VMOps, '_create_vifs', dummy)
# Reset network table
xenapi_fake.reset_table('network')
# Instance id = 2 will use vlan network (see db/fakes.py)
ctxt = self.context.elevated()
instance = self._create_instance(2, False)
networks = self.network.db.network_get_all(ctxt)
for network in networks:
self.network.set_network_host(ctxt, network)
self.network.allocate_for_instance(ctxt,
instance_id=2,
instance_uuid="00000000-0000-0000-0000-000000000000",
host=FLAGS.host,
vpn=None,
rxtx_factor=3,
project_id=self.project_id)
self._test_spawn(glance_stubs.FakeGlance.IMAGE_MACHINE,
glance_stubs.FakeGlance.IMAGE_KERNEL,
glance_stubs.FakeGlance.IMAGE_RAMDISK,
instance_id=2,
create_record=False)
# TODO(salvatore-orlando): a complete test here would require
# a check for making sure the bridge for the VM's VIF is
# consistent with bridge specified in nova db
def test_spawn_with_network_qos(self):
self._create_instance()
for vif_ref in xenapi_fake.get_all('VIF'):
vif_rec = xenapi_fake.get_record('VIF', vif_ref)
self.assertEquals(vif_rec['qos_algorithm_type'], 'ratelimit')
self.assertEquals(vif_rec['qos_algorithm_params']['kbps'],
str(3 * 1024))
def test_rescue(self):
instance = self._create_instance()
session = xenapi_conn.XenAPISession('test_url', 'root', 'test_pass')
vm = vm_utils.VMHelper.lookup(session, instance.name)
vbd = xenapi_fake.create_vbd(vm, None)
conn = xenapi_conn.get_connection(False)
image_meta = {'id': glance_stubs.FakeGlance.IMAGE_VHD,
'disk_format': 'vhd'}
conn.rescue(self.context, instance, [], image_meta)
def test_unrescue(self):
instance = self._create_instance()
conn = xenapi_conn.get_connection(False)
# Unrescue expects the original instance to be powered off
conn.power_off(instance)
rescue_vm = xenapi_fake.create_vm(instance.name + '-rescue', 'Running')
conn.unrescue(instance, None)
def test_unrescue_not_in_rescue(self):
instance = self._create_instance()
conn = xenapi_conn.get_connection(False)
# Ensure that it will not unrescue a non-rescued instance.
self.assertRaises(exception.InstanceNotInRescueMode, conn.unrescue,
instance, None)
def test_finish_revert_migration(self):
instance = self._create_instance()
class VMOpsMock():
def __init__(self):
self.finish_revert_migration_called = False
def finish_revert_migration(self, instance):
self.finish_revert_migration_called = True
conn = xenapi_conn.get_connection(False)
conn._vmops = VMOpsMock()
conn.finish_revert_migration(instance, None)
self.assertTrue(conn._vmops.finish_revert_migration_called)
def _create_instance(self, instance_id=1, spawn=True):
"""Creates and spawns a test instance."""
instance_values = {
'id': instance_id,
'project_id': self.project_id,
'user_id': self.user_id,
'image_ref': 1,
'kernel_id': 2,
'ramdisk_id': 3,
'root_gb': 20,
'instance_type_id': '3', # m1.large
'os_type': 'linux',
'architecture': 'x86-64'}
instance = db.instance_create(self.context, instance_values)
network_info = [({'bridge': 'fa0', 'id': 0,
'injected': False,
'cidr': '192.168.0.0/24',
'cidr_v6': 'dead:beef::1/120',
},
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
'ips': [{'enabled': '1',
'ip': '192.168.0.100',
'netmask': '255.255.255.0'}],
'dhcp_server': '192.168.0.1',
'label': 'fake',
'mac': 'DE:AD:BE:EF:00:00',
'rxtx_cap': 3})]
image_meta = {'id': glance_stubs.FakeGlance.IMAGE_VHD,
'disk_format': 'vhd'}
if spawn:
instance.admin_pass = 'herp'
self.conn.spawn(self.context, instance, image_meta, network_info)
return instance
class XenAPIDiffieHellmanTestCase(test.TestCase):
"""Unit tests for Diffie-Hellman code."""
def setUp(self):
super(XenAPIDiffieHellmanTestCase, self).setUp()
self.alice = vmops.SimpleDH()
self.bob = vmops.SimpleDH()
def test_shared(self):
alice_pub = self.alice.get_public()
bob_pub = self.bob.get_public()
alice_shared = self.alice.compute_shared(bob_pub)
bob_shared = self.bob.compute_shared(alice_pub)
self.assertEquals(alice_shared, bob_shared)
def _test_encryption(self, message):
enc = self.alice.encrypt(message)
self.assertFalse(enc.endswith('\n'))
dec = self.bob.decrypt(enc)
self.assertEquals(dec, message)
def test_encrypt_simple_message(self):
self._test_encryption('This is a simple message.')
def test_encrypt_message_with_newlines_at_end(self):
self._test_encryption('This message has a newline at the end.\n')
def test_encrypt_many_newlines_at_end(self):
self._test_encryption('Message with lotsa newlines.\n\n\n')
def test_encrypt_newlines_inside_message(self):
self._test_encryption('Message\nwith\ninterior\nnewlines.')
def test_encrypt_with_leading_newlines(self):
self._test_encryption('\n\nMessage with leading newlines.')
def test_encrypt_really_long_message(self):
self._test_encryption(''.join(['abcd' for i in xrange(1024)]))
class XenAPIMigrateInstance(test.TestCase):
"""Unit test for verifying migration-related actions."""
def setUp(self):
super(XenAPIMigrateInstance, self).setUp()
self.flags(target_host='127.0.0.1',
xenapi_connection_url='test_url',
xenapi_connection_password='test_pass',
firewall_driver='nova.virt.xenapi.firewall.'
'Dom0IptablesFirewallDriver')
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
db_fakes.stub_out_db_instance_api(self.stubs)
xenapi_fake.reset()
xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
self.user_id = 'fake'
self.project_id = 'fake'
self.context = context.RequestContext(self.user_id, self.project_id)
self.instance_values = {'id': 1,
'project_id': self.project_id,
'user_id': self.user_id,
'image_ref': 1,
'kernel_id': None,
'ramdisk_id': None,
'root_gb': 5,
'instance_type_id': '3', # m1.large
'os_type': 'linux',
'architecture': 'x86-64'}
migration_values = {
'source_compute': 'nova-compute',
'dest_compute': 'nova-compute',
'dest_host': '10.127.5.114',
'status': 'post-migrating',
'instance_uuid': '15f23e6a-cc6e-4d22-b651-d9bdaac316f7',
'old_instance_type_id': 5,
'new_instance_type_id': 1
}
self.migration = db.migration_create(
context.get_admin_context(), migration_values)
fake_utils.stub_out_utils_execute(self.stubs)
stubs.stub_out_migration_methods(self.stubs)
stubs.stubout_get_this_vm_uuid(self.stubs)
glance_stubs.stubout_glance_client(self.stubs)
def test_resize_xenserver_6(self):
instance = db.instance_create(self.context, self.instance_values)
called = {'resize': False}
def fake_vdi_resize(*args, **kwargs):
called['resize'] = True
self.stubs.Set(stubs.FakeSessionForVMTests,
"VDI_resize", fake_vdi_resize)
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests,
product_version=(6, 0, 0))
conn = xenapi_conn.get_connection(False)
vdi_ref = xenapi_fake.create_vdi('hurr', 'fake')
vdi_uuid = xenapi_fake.get_record('VDI', vdi_ref)['uuid']
conn._vmops._resize_instance(instance, vdi_uuid)
self.assertEqual(called['resize'], True)
def test_migrate_disk_and_power_off(self):
instance = db.instance_create(self.context, self.instance_values)
xenapi_fake.create_vm(instance.name, 'Running')
instance_type = db.instance_type_get_by_name(self.context, 'm1.large')
conn = xenapi_conn.get_connection(False)
conn.migrate_disk_and_power_off(self.context, instance,
'127.0.0.1', instance_type, None)
def test_migrate_disk_and_power_off_passes_exceptions(self):
instance = db.instance_create(self.context, self.instance_values)
xenapi_fake.create_vm(instance.name, 'Running')
instance_type = db.instance_type_get_by_name(self.context, 'm1.large')
def fake_raise(*args, **kwargs):
raise exception.MigrationError(reason='test failure')
self.stubs.Set(vmops.VMOps, "_migrate_vhd", fake_raise)
conn = xenapi_conn.get_connection(False)
self.assertRaises(exception.MigrationError,
conn.migrate_disk_and_power_off,
self.context, instance,
'127.0.0.1', instance_type, None)
def test_revert_migrate(self):
instance = db.instance_create(self.context, self.instance_values)
self.called = False
self.fake_vm_start_called = False
self.fake_finish_revert_migration_called = False
def fake_vm_start(*args, **kwargs):
self.fake_vm_start_called = True
def fake_vdi_resize(*args, **kwargs):
self.called = True
def fake_finish_revert_migration(*args, **kwargs):
self.fake_finish_revert_migration_called = True
self.stubs.Set(stubs.FakeSessionForVMTests,
"VDI_resize_online", fake_vdi_resize)
self.stubs.Set(vmops.VMOps, '_start', fake_vm_start)
self.stubs.Set(vmops.VMOps, 'finish_revert_migration',
fake_finish_revert_migration)
conn = xenapi_conn.get_connection(False)
network_info = [({'bridge': 'fa0', 'id': 0, 'injected': False},
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
'ips': [{'enabled': '1',
'ip': '192.168.0.100',
'netmask': '255.255.255.0'}],
'label': 'fake',
'mac': 'DE:AD:BE:EF:00:00',
'rxtx_cap': 3})]
image_meta = {'id': instance.image_ref, 'disk_format': 'vhd'}
base = xenapi_fake.create_vdi('hurr', 'fake')
base_uuid = xenapi_fake.get_record('VDI', base)['uuid']
cow = xenapi_fake.create_vdi('durr', 'fake')
cow_uuid = xenapi_fake.get_record('VDI', cow)['uuid']
conn.finish_migration(self.context, self.migration, instance,
dict(base_copy=base_uuid, cow=cow_uuid),
network_info, image_meta, resize_instance=True)
self.assertEqual(self.called, True)
self.assertEqual(self.fake_vm_start_called, True)
conn.finish_revert_migration(instance, network_info)
self.assertEqual(self.fake_finish_revert_migration_called, True)
def test_finish_migrate(self):
instance = db.instance_create(self.context, self.instance_values)
self.called = False
self.fake_vm_start_called = False
def fake_vm_start(*args, **kwargs):
self.fake_vm_start_called = True
def fake_vdi_resize(*args, **kwargs):
self.called = True
self.stubs.Set(vmops.VMOps, '_start', fake_vm_start)
self.stubs.Set(stubs.FakeSessionForVMTests,
"VDI_resize_online", fake_vdi_resize)
conn = xenapi_conn.get_connection(False)
network_info = [({'bridge': 'fa0', 'id': 0, 'injected': False},
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
'ips': [{'enabled': '1',
'ip': '192.168.0.100',
'netmask': '255.255.255.0'}],
'label': 'fake',
'mac': 'DE:AD:BE:EF:00:00',
'rxtx_cap': 3})]
image_meta = {'id': instance.image_ref, 'disk_format': 'vhd'}
conn.finish_migration(self.context, self.migration, instance,
dict(base_copy='hurr', cow='durr'),
network_info, image_meta, resize_instance=True)
self.assertEqual(self.called, True)
self.assertEqual(self.fake_vm_start_called, True)
def test_finish_migrate_no_local_storage(self):
tiny_type = instance_types.get_instance_type_by_name('m1.tiny')
tiny_type_id = tiny_type['id']
self.instance_values.update({'instance_type_id': tiny_type_id,
'root_gb': 0})
instance = db.instance_create(self.context, self.instance_values)
def fake_vdi_resize(*args, **kwargs):
raise Exception("This shouldn't be called")
self.stubs.Set(stubs.FakeSessionForVMTests,
"VDI_resize_online", fake_vdi_resize)
conn = xenapi_conn.get_connection(False)
network_info = [({'bridge': 'fa0', 'id': 0, 'injected': False},
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
'ips': [{'enabled': '1',
'ip': '192.168.0.100',
'netmask': '255.255.255.0'}],
'label': 'fake',
'mac': 'DE:AD:BE:EF:00:00',
'rxtx_cap': 3})]
image_meta = {'id': instance.image_ref, 'disk_format': 'vhd'}
conn.finish_migration(self.context, self.migration, instance,
dict(base_copy='hurr', cow='durr'),
network_info, image_meta, resize_instance=True)
def test_finish_migrate_no_resize_vdi(self):
instance = db.instance_create(self.context, self.instance_values)
def fake_vdi_resize(*args, **kwargs):
raise Exception("This shouldn't be called")
self.stubs.Set(stubs.FakeSessionForVMTests,
"VDI_resize_online", fake_vdi_resize)
conn = xenapi_conn.get_connection(False)
network_info = [({'bridge': 'fa0', 'id': 0, 'injected': False},
{'broadcast': '192.168.0.255',
'dns': ['192.168.0.1'],
'gateway': '192.168.0.1',
'gateway_v6': 'dead:beef::1',
'ip6s': [{'enabled': '1',
'ip': 'dead:beef::dcad:beff:feef:0',
'netmask': '64'}],
'ips': [{'enabled': '1',
'ip': '192.168.0.100',
'netmask': '255.255.255.0'}],
'label': 'fake',
'mac': 'DE:AD:BE:EF:00:00',
'rxtx_cap': 3})]
# Resize instance would be determined by the compute call
image_meta = {'id': instance.image_ref, 'disk_format': 'vhd'}
conn.finish_migration(self.context, self.migration, instance,
dict(base_copy='hurr', cow='durr'),
network_info, image_meta, resize_instance=False)
class XenAPIImageTypeTestCase(test.TestCase):
"""Test ImageType class."""
def test_to_string(self):
"""Can convert from type id to type string."""
self.assertEquals(
vm_utils.ImageType.to_string(vm_utils.ImageType.KERNEL),
vm_utils.ImageType.KERNEL_STR)
def test_from_string(self):
"""Can convert from string to type id."""
self.assertEquals(
vm_utils.ImageType.from_string(vm_utils.ImageType.KERNEL_STR),
vm_utils.ImageType.KERNEL)
class XenAPIDetermineDiskImageTestCase(test.TestCase):
"""Unit tests for code that detects the ImageType."""
def setUp(self):
super(XenAPIDetermineDiskImageTestCase, self).setUp()
glance_stubs.stubout_glance_client(self.stubs)
class FakeInstance(object):
pass
self.fake_instance = FakeInstance()
self.fake_instance.id = 42
self.fake_instance.os_type = 'linux'
self.fake_instance.architecture = 'x86-64'
def assert_disk_type(self, image_meta, expected_disk_type):
actual = vm_utils.VMHelper.determine_disk_image_type(image_meta)
self.assertEqual(expected_disk_type, actual)
def test_machine(self):
image_meta = {'id': 'a', 'disk_format': 'ami'}
self.assert_disk_type(image_meta, vm_utils.ImageType.DISK)
def test_raw(self):
image_meta = {'id': 'a', 'disk_format': 'raw'}
self.assert_disk_type(image_meta, vm_utils.ImageType.DISK_RAW)
def test_vhd(self):
image_meta = {'id': 'a', 'disk_format': 'vhd'}
self.assert_disk_type(image_meta, vm_utils.ImageType.DISK_VHD)
class CompareVersionTestCase(test.TestCase):
def test_less_than(self):
"""Test that cmp_version compares a as less than b"""
self.assertTrue(vmops.cmp_version('1.2.3.4', '1.2.3.5') < 0)
def test_greater_than(self):
"""Test that cmp_version compares a as greater than b"""
self.assertTrue(vmops.cmp_version('1.2.3.5', '1.2.3.4') > 0)
def test_equal(self):
"""Test that cmp_version compares a as equal to b"""
self.assertTrue(vmops.cmp_version('1.2.3.4', '1.2.3.4') == 0)
def test_non_lexical(self):
"""Test that cmp_version compares non-lexically"""
self.assertTrue(vmops.cmp_version('1.2.3.10', '1.2.3.4') > 0)
def test_length(self):
"""Test that cmp_version compares by length as last resort"""
self.assertTrue(vmops.cmp_version('1.2.3', '1.2.3.4') < 0)
class XenAPIHostTestCase(test.TestCase):
"""Tests HostState, which holds metrics from XenServer that get
reported back to the Schedulers."""
def setUp(self):
super(XenAPIHostTestCase, self).setUp()
self.flags(xenapi_connection_url='test_url',
xenapi_connection_password='test_pass')
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
xenapi_fake.reset()
xenapi_fake.create_local_srs()
self.conn = xenapi_conn.get_connection(False)
def test_host_state(self):
stats = self.conn.get_host_stats()
self.assertEquals(stats['disk_total'], 10000)
self.assertEquals(stats['disk_used'], 20000)
self.assertEquals(stats['host_memory_total'], 10)
self.assertEquals(stats['host_memory_overhead'], 20)
self.assertEquals(stats['host_memory_free'], 30)
self.assertEquals(stats['host_memory_free_computed'], 40)
def _test_host_action(self, method, action, expected=None):
result = method('host', action)
if not expected:
expected = action
self.assertEqual(result, expected)
def test_host_reboot(self):
self._test_host_action(self.conn.host_power_action, 'reboot')
def test_host_shutdown(self):
self._test_host_action(self.conn.host_power_action, 'shutdown')
def test_host_startup(self):
self.assertRaises(NotImplementedError,
self.conn.host_power_action, 'host', 'startup')
def test_host_maintenance_on(self):
self._test_host_action(self.conn.host_maintenance_mode,
True, 'on_maintenance')
def test_host_maintenance_off(self):
self._test_host_action(self.conn.host_maintenance_mode,
False, 'off_maintenance')
def test_set_enable_host_enable(self):
self._test_host_action(self.conn.set_host_enabled, True, 'enabled')
def test_set_enable_host_disable(self):
self._test_host_action(self.conn.set_host_enabled, False, 'disabled')
class XenAPIAutoDiskConfigTestCase(test.TestCase):
def setUp(self):
super(XenAPIAutoDiskConfigTestCase, self).setUp()
self.flags(target_host='127.0.0.1',
xenapi_connection_url='test_url',
xenapi_connection_password='test_pass',
firewall_driver='nova.virt.xenapi.firewall.'
'Dom0IptablesFirewallDriver')
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
xenapi_fake.reset()
self.conn = xenapi_conn.get_connection(False)
self.user_id = 'fake'
self.project_id = 'fake'
self.instance_values = {'id': 1,
'project_id': self.project_id,
'user_id': self.user_id,
'image_ref': 1,
'kernel_id': 2,
'ramdisk_id': 3,
'root_gb': 20,
'instance_type_id': '3', # m1.large
'os_type': 'linux',
'architecture': 'x86-64'}
self.context = context.RequestContext(self.user_id, self.project_id)
@classmethod
def fake_create_vbd(cls, session, vm_ref, vdi_ref, userdevice,
vbd_type='disk', read_only=False, bootable=True):
pass
self.stubs.Set(vm_utils.VMHelper,
"create_vbd",
fake_create_vbd)
def assertIsPartitionCalled(self, called):
marker = {"partition_called": False}
def fake_resize_part_and_fs(dev, start, old, new):
marker["partition_called"] = True
self.stubs.Set(vm_utils, "_resize_part_and_fs",
fake_resize_part_and_fs)
instance = db.instance_create(self.context, self.instance_values)
disk_image_type = vm_utils.ImageType.DISK_VHD
vm_ref = "blah"
first_vdi_ref = "blah"
vdis = ["blah"]
self.conn._vmops._attach_disks(
instance, disk_image_type, vm_ref, first_vdi_ref, vdis)
self.assertEqual(marker["partition_called"], called)
def test_instance_not_auto_disk_config(self):
"""Should not partition unless instance is marked as
auto_disk_config.
"""
self.instance_values['auto_disk_config'] = False
self.assertIsPartitionCalled(False)
@stub_vm_utils_with_vdi_attached_here
def test_instance_auto_disk_config_doesnt_pass_fail_safes(self):
"""Should not partition unless fail safes pass"""
self.instance_values['auto_disk_config'] = True
def fake_get_partitions(dev):
return [(1, 0, 100, 'ext4'), (2, 100, 200, 'ext4')]
self.stubs.Set(vm_utils, "_get_partitions",
fake_get_partitions)
self.assertIsPartitionCalled(False)
@stub_vm_utils_with_vdi_attached_here
def test_instance_auto_disk_config_passes_fail_safes(self):
"""Should partition if instance is marked as auto_disk_config=True and
virt-layer specific fail-safe checks pass.
"""
self.instance_values['auto_disk_config'] = True
def fake_get_partitions(dev):
return [(1, 0, 100, 'ext4')]
self.stubs.Set(vm_utils, "_get_partitions",
fake_get_partitions)
self.assertIsPartitionCalled(True)
class XenAPIGenerateLocal(test.TestCase):
"""Test generating of local disks, like swap and ephemeral"""
def setUp(self):
super(XenAPIGenerateLocal, self).setUp()
self.flags(target_host='127.0.0.1',
xenapi_connection_url='test_url',
xenapi_connection_password='test_pass',
xenapi_generate_swap=True,
firewall_driver='nova.virt.xenapi.firewall.'
'Dom0IptablesFirewallDriver')
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
db_fakes.stub_out_db_instance_api(self.stubs)
xenapi_fake.reset()
self.conn = xenapi_conn.get_connection(False)
self.user_id = 'fake'
self.project_id = 'fake'
self.instance_values = {'id': 1,
'project_id': self.project_id,
'user_id': self.user_id,
'image_ref': 1,
'kernel_id': 2,
'ramdisk_id': 3,
'root_gb': 20,
'instance_type_id': '3', # m1.large
'os_type': 'linux',
'architecture': 'x86-64'}
self.context = context.RequestContext(self.user_id, self.project_id)
@classmethod
def fake_create_vbd(cls, session, vm_ref, vdi_ref, userdevice,
vbd_type='disk', read_only=False, bootable=True):
pass
self.stubs.Set(vm_utils.VMHelper,
"create_vbd",
fake_create_vbd)
def assertCalled(self, instance):
disk_image_type = vm_utils.ImageType.DISK_VHD
vm_ref = "blah"
first_vdi_ref = "blah"
vdis = ["blah"]
self.called = False
self.conn._vmops._attach_disks(instance, disk_image_type,
vm_ref, first_vdi_ref, vdis)
self.assertTrue(self.called)
def test_generate_swap(self):
"""Test swap disk generation."""
instance = db.instance_create(self.context, self.instance_values)
instance = db.instance_update(self.context, instance['id'],
{'instance_type_id': 5})
@classmethod
def fake_generate_swap(cls, *args, **kwargs):
self.called = True
self.stubs.Set(vm_utils.VMHelper, 'generate_swap',
fake_generate_swap)
self.assertCalled(instance)
def test_generate_ephemeral(self):
"""Test ephemeral disk generation."""
instance = db.instance_create(self.context, self.instance_values)
instance = db.instance_update(self.context, instance['id'],
{'instance_type_id': 4})
@classmethod
def fake_generate_ephemeral(cls, *args):
self.called = True
self.stubs.Set(vm_utils.VMHelper, 'generate_ephemeral',
fake_generate_ephemeral)
self.assertCalled(instance)
class XenAPIBWUsageTestCase(test.TestCase):
def setUp(self):
super(XenAPIBWUsageTestCase, self).setUp()
self.stubs.Set(vm_utils.VMHelper, "compile_metrics",
XenAPIBWUsageTestCase._fake_compile_metrics)
self.flags(target_host='127.0.0.1',
xenapi_connection_url='test_url',
xenapi_connection_password='test_pass',
firewall_driver='nova.virt.xenapi.firewall.'
'Dom0IptablesFirewallDriver')
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
xenapi_fake.reset()
self.conn = xenapi_conn.get_connection(False)
@classmethod
def _fake_compile_metrics(cls, start_time, stop_time=None):
raise exception.CouldNotFetchMetrics()
def test_get_all_bw_usage_in_failure_case(self):
"""Test that get_all_bw_usage returns an empty list when metrics
compilation failed. c.f. bug #910045.
"""
class testinstance(object):
def __init__(self):
self.name = "instance-0001"
self.uuid = "1-2-3-4-5"
result = self.conn.get_all_bw_usage([testinstance()],
datetime.datetime.utcnow())
self.assertEqual(result, [])
# TODO(salvatore-orlando): this class and
# nova.tests.test_libvirt.IPTablesFirewallDriverTestCase share a lot of code.
# Consider abstracting common code in a base class for firewall driver testing.
class XenAPIDom0IptablesFirewallTestCase(test.TestCase):
_in_nat_rules = [
'# Generated by iptables-save v1.4.10 on Sat Feb 19 00:03:19 2011',
'*nat',
':PREROUTING ACCEPT [1170:189210]',
':INPUT ACCEPT [844:71028]',
':OUTPUT ACCEPT [5149:405186]',
':POSTROUTING ACCEPT [5063:386098]',
]
_in_filter_rules = [
'# Generated by iptables-save v1.4.4 on Mon Dec 6 11:54:13 2010',
'*filter',
':INPUT ACCEPT [969615:281627771]',
':FORWARD ACCEPT [0:0]',
':OUTPUT ACCEPT [915599:63811649]',
':nova-block-ipv4 - [0:0]',
'-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT ',
'-A FORWARD -d 192.168.122.0/24 -o virbr0 -m state --state RELATED'
',ESTABLISHED -j ACCEPT ',
'-A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT ',
'-A FORWARD -i virbr0 -o virbr0 -j ACCEPT ',
'-A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable ',
'-A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable ',
'COMMIT',
'# Completed on Mon Dec 6 11:54:13 2010',
]
_in6_filter_rules = [
'# Generated by ip6tables-save v1.4.4 on Tue Jan 18 23:47:56 2011',
'*filter',
':INPUT ACCEPT [349155:75810423]',
':FORWARD ACCEPT [0:0]',
':OUTPUT ACCEPT [349256:75777230]',
'COMMIT',
'# Completed on Tue Jan 18 23:47:56 2011',
]
def setUp(self):
super(XenAPIDom0IptablesFirewallTestCase, self).setUp()
self.flags(xenapi_connection_url='test_url',
xenapi_connection_password='test_pass',
instance_name_template='%d',
firewall_driver='nova.virt.xenapi.firewall.'
'Dom0IptablesFirewallDriver')
xenapi_fake.reset()
xenapi_fake.create_local_srs()
xenapi_fake.create_local_pifs()
self.user_id = 'mappin'
self.project_id = 'fake'
stubs.stubout_session(self.stubs, stubs.FakeSessionForFirewallTests,
test_case=self)
self.context = context.RequestContext(self.user_id, self.project_id)
self.network = importutils.import_object(FLAGS.network_manager)
self.conn = xenapi_conn.get_connection(False)
self.fw = self.conn._vmops.firewall_driver
def _create_instance_ref(self):
return db.instance_create(self.context,
{'user_id': self.user_id,
'project_id': self.project_id,
'instance_type_id': 1})
def _create_test_security_group(self):
admin_ctxt = context.get_admin_context()
secgroup = db.security_group_create(admin_ctxt,
{'user_id': self.user_id,
'project_id': self.project_id,
'name': 'testgroup',
'description': 'test group'})
db.security_group_rule_create(admin_ctxt,
{'parent_group_id': secgroup['id'],
'protocol': 'icmp',
'from_port': -1,
'to_port': -1,
'cidr': '192.168.11.0/24'})
db.security_group_rule_create(admin_ctxt,
{'parent_group_id': secgroup['id'],
'protocol': 'icmp',
'from_port': 8,
'to_port': -1,
'cidr': '192.168.11.0/24'})
db.security_group_rule_create(admin_ctxt,
{'parent_group_id': secgroup['id'],
'protocol': 'tcp',
'from_port': 80,
'to_port': 81,
'cidr': '192.168.10.0/24'})
return secgroup
def _validate_security_group(self):
in_rules = filter(lambda l: not l.startswith('#'),
self._in_filter_rules)
for rule in in_rules:
if not 'nova' in rule:
self.assertTrue(rule in self._out_rules,
'Rule went missing: %s' % rule)
instance_chain = None
for rule in self._out_rules:
# This is pretty crude, but it'll do for now
# last two octets change
if re.search('-d 192.168.[0-9]{1,3}.[0-9]{1,3} -j', rule):
instance_chain = rule.split(' ')[-1]
break
self.assertTrue(instance_chain, "The instance chain wasn't added")
security_group_chain = None
for rule in self._out_rules:
# This is pretty crude, but it'll do for now
if '-A %s -j' % instance_chain in rule:
security_group_chain = rule.split(' ')[-1]
break
self.assertTrue(security_group_chain,
"The security group chain wasn't added")
regex = re.compile('-A .* -j ACCEPT -p icmp -s 192.168.11.0/24')
self.assertTrue(len(filter(regex.match, self._out_rules)) > 0,
"ICMP acceptance rule wasn't added")
regex = re.compile('-A .* -j ACCEPT -p icmp -m icmp --icmp-type 8'
' -s 192.168.11.0/24')
self.assertTrue(len(filter(regex.match, self._out_rules)) > 0,
"ICMP Echo Request acceptance rule wasn't added")
regex = re.compile('-A .* -j ACCEPT -p tcp --dport 80:81'
' -s 192.168.10.0/24')
self.assertTrue(len(filter(regex.match, self._out_rules)) > 0,
"TCP port 80/81 acceptance rule wasn't added")
def test_static_filters(self):
instance_ref = self._create_instance_ref()
src_instance_ref = self._create_instance_ref()
admin_ctxt = context.get_admin_context()
secgroup = self._create_test_security_group()
src_secgroup = db.security_group_create(admin_ctxt,
{'user_id': self.user_id,
'project_id': self.project_id,
'name': 'testsourcegroup',
'description': 'src group'})
db.security_group_rule_create(admin_ctxt,
{'parent_group_id': secgroup['id'],
'protocol': 'tcp',
'from_port': 80,
'to_port': 81,
'group_id': src_secgroup['id']})
db.instance_add_security_group(admin_ctxt, instance_ref['uuid'],
secgroup['id'])
db.instance_add_security_group(admin_ctxt, src_instance_ref['uuid'],
src_secgroup['id'])
instance_ref = db.instance_get(admin_ctxt, instance_ref['id'])
src_instance_ref = db.instance_get(admin_ctxt, src_instance_ref['id'])
network_model = fake_network.fake_get_instance_nw_info(self.stubs,
1, spectacular=True)
fake_network.stub_out_nw_api_get_instance_nw_info(self.stubs,
lambda *a, **kw: network_model)
network_info = compute_utils.legacy_network_info(network_model)
self.fw.prepare_instance_filter(instance_ref, network_info)
self.fw.apply_instance_filter(instance_ref, network_info)
self._validate_security_group()
# Extra test for TCP acceptance rules
for ip in network_model.fixed_ips():
if ip['version'] != 4:
continue
regex = re.compile('-A .* -j ACCEPT -p tcp'
' --dport 80:81 -s %s' % ip['address'])
self.assertTrue(len(filter(regex.match, self._out_rules)) > 0,
"TCP port 80/81 acceptance rule wasn't added")
db.instance_destroy(admin_ctxt, instance_ref['id'])
def test_filters_for_instance_with_ip_v6(self):
self.flags(use_ipv6=True)
network_info = fake_network.fake_get_instance_nw_info(self.stubs, 1)
rulesv4, rulesv6 = self.fw._filters_for_instance("fake", network_info)
self.assertEquals(len(rulesv4), 2)
self.assertEquals(len(rulesv6), 1)
def test_filters_for_instance_without_ip_v6(self):
self.flags(use_ipv6=False)
network_info = fake_network.fake_get_instance_nw_info(self.stubs, 1)
rulesv4, rulesv6 = self.fw._filters_for_instance("fake", network_info)
self.assertEquals(len(rulesv4), 2)
self.assertEquals(len(rulesv6), 0)
def test_multinic_iptables(self):
ipv4_rules_per_addr = 1
ipv4_addr_per_network = 2
ipv6_rules_per_addr = 1
ipv6_addr_per_network = 1
networks_count = 5
instance_ref = self._create_instance_ref()
_get_instance_nw_info = fake_network.fake_get_instance_nw_info
network_info = _get_instance_nw_info(self.stubs,
networks_count,
ipv4_addr_per_network)
ipv4_len = len(self.fw.iptables.ipv4['filter'].rules)
ipv6_len = len(self.fw.iptables.ipv6['filter'].rules)
inst_ipv4, inst_ipv6 = self.fw.instance_rules(instance_ref,
network_info)
self.fw.prepare_instance_filter(instance_ref, network_info)
ipv4 = self.fw.iptables.ipv4['filter'].rules
ipv6 = self.fw.iptables.ipv6['filter'].rules
ipv4_network_rules = len(ipv4) - len(inst_ipv4) - ipv4_len
ipv6_network_rules = len(ipv6) - len(inst_ipv6) - ipv6_len
self.assertEquals(ipv4_network_rules,
ipv4_rules_per_addr * ipv4_addr_per_network * networks_count)
self.assertEquals(ipv6_network_rules,
ipv6_rules_per_addr * ipv6_addr_per_network * networks_count)
def test_do_refresh_security_group_rules(self):
admin_ctxt = context.get_admin_context()
instance_ref = self._create_instance_ref()
network_info = fake_network.fake_get_instance_nw_info(self.stubs, 1, 1)
secgroup = self._create_test_security_group()
db.instance_add_security_group(admin_ctxt, instance_ref['uuid'],
secgroup['id'])
self.fw.prepare_instance_filter(instance_ref, network_info)
self.fw.instances[instance_ref['id']] = instance_ref
self._validate_security_group()
# add a rule to the security group
db.security_group_rule_create(admin_ctxt,
{'parent_group_id': secgroup['id'],
'protocol': 'udp',
'from_port': 200,
'to_port': 299,
'cidr': '192.168.99.0/24'})
#validate the extra rule
self.fw.refresh_security_group_rules(secgroup)
regex = re.compile('-A .* -j ACCEPT -p udp --dport 200:299'
' -s 192.168.99.0/24')
self.assertTrue(len(filter(regex.match, self._out_rules)) > 0,
"Rules were not updated properly."
"The rule for UDP acceptance is missing")
def test_provider_firewall_rules(self):
# setup basic instance data
instance_ref = self._create_instance_ref()
# FRAGILE: as in libvirt tests
# peeks at how the firewall names chains
chain_name = 'inst-%s' % instance_ref['id']
network_info = fake_network.fake_get_instance_nw_info(self.stubs, 1, 1)
self.fw.prepare_instance_filter(instance_ref, network_info)
self.assertTrue('provider' in self.fw.iptables.ipv4['filter'].chains)
rules = [rule for rule in self.fw.iptables.ipv4['filter'].rules
if rule.chain == 'provider']
self.assertEqual(0, len(rules))
admin_ctxt = context.get_admin_context()
# add a rule and send the update message, check for 1 rule
provider_fw0 = db.provider_fw_rule_create(admin_ctxt,
{'protocol': 'tcp',
'cidr': '10.99.99.99/32',
'from_port': 1,
'to_port': 65535})
self.fw.refresh_provider_fw_rules()
rules = [rule for rule in self.fw.iptables.ipv4['filter'].rules
if rule.chain == 'provider']
self.assertEqual(1, len(rules))
# Add another, refresh, and make sure number of rules goes to two
provider_fw1 = db.provider_fw_rule_create(admin_ctxt,
{'protocol': 'udp',
'cidr': '10.99.99.99/32',
'from_port': 1,
'to_port': 65535})
self.fw.refresh_provider_fw_rules()
rules = [rule for rule in self.fw.iptables.ipv4['filter'].rules
if rule.chain == 'provider']
self.assertEqual(2, len(rules))
# create the instance filter and make sure it has a jump rule
self.fw.prepare_instance_filter(instance_ref, network_info)
self.fw.apply_instance_filter(instance_ref, network_info)
inst_rules = [rule for rule in self.fw.iptables.ipv4['filter'].rules
if rule.chain == chain_name]
jump_rules = [rule for rule in inst_rules if '-j' in rule.rule]
provjump_rules = []
# IptablesTable doesn't make rules unique internally
for rule in jump_rules:
if 'provider' in rule.rule and rule not in provjump_rules:
provjump_rules.append(rule)
self.assertEqual(1, len(provjump_rules))
# remove a rule from the db, cast to compute to refresh rule
db.provider_fw_rule_destroy(admin_ctxt, provider_fw1['id'])
self.fw.refresh_provider_fw_rules()
rules = [rule for rule in self.fw.iptables.ipv4['filter'].rules
if rule.chain == 'provider']
self.assertEqual(1, len(rules))
class XenAPISRSelectionTestCase(test.TestCase):
"""Unit tests for testing we find the right SR."""
def setUp(self):
super(XenAPISRSelectionTestCase, self).setUp()
xenapi_fake.reset()
def test_safe_find_sr_raise_exception(self):
"""Ensure StorageRepositoryNotFound is raise when wrong filter."""
self.flags(sr_matching_filter='yadayadayada')
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
session = xenapi_conn.XenAPISession('test_url', 'root', 'test_pass')
helper = vm_utils.VMHelper
helper.XenAPI = session.get_imported_xenapi()
self.assertRaises(exception.StorageRepositoryNotFound,
helper.safe_find_sr, session)
def test_safe_find_sr_local_storage(self):
"""Ensure the default local-storage is found."""
self.flags(sr_matching_filter='other-config:i18n-key=local-storage')
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
session = xenapi_conn.XenAPISession('test_url', 'root', 'test_pass')
helper = vm_utils.VMHelper
helper.XenAPI = session.get_imported_xenapi()
host_ref = xenapi_fake.get_all('host')[0]
local_sr = xenapi_fake.create_sr(
name_label='Fake Storage',
type='lvm',
other_config={'i18n-original-value-name_label':
'Local storage',
'i18n-key': 'local-storage'},
host_ref=host_ref)
expected = helper.safe_find_sr(session)
self.assertEqual(local_sr, expected)
def test_safe_find_sr_by_other_criteria(self):
"""Ensure the SR is found when using a different filter."""
self.flags(sr_matching_filter='other-config:my_fake_sr=true')
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
session = xenapi_conn.XenAPISession('test_url', 'root', 'test_pass')
helper = vm_utils.VMHelper
helper.XenAPI = session.get_imported_xenapi()
host_ref = xenapi_fake.get_all('host')[0]
local_sr = xenapi_fake.create_sr(name_label='Fake Storage',
type='lvm',
other_config={'my_fake_sr': 'true'},
host_ref=host_ref)
expected = helper.safe_find_sr(session)
self.assertEqual(local_sr, expected)
def test_safe_find_sr_default(self):
"""Ensure the default SR is found regardless of other-config."""
self.flags(sr_matching_filter='default-sr:true')
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
session = xenapi_conn.XenAPISession('test_url', 'root', 'test_pass')
helper = vm_utils.VMHelper
pool_ref = xenapi_fake.create_pool('')
helper.XenAPI = session.get_imported_xenapi()
expected = helper.safe_find_sr(session)
self.assertEqual(session.call_xenapi('pool.get_default_SR', pool_ref),
expected)
class XenAPIAggregateTestCase(test.TestCase):
"""Unit tests for aggregate operations."""
def setUp(self):
super(XenAPIAggregateTestCase, self).setUp()
self.flags(xenapi_connection_url='http://test_url',
xenapi_connection_username='test_user',
xenapi_connection_password='test_pass',
instance_name_template='%d',
firewall_driver='nova.virt.xenapi.firewall.'
'Dom0IptablesFirewallDriver',
host='host')
xenapi_fake.reset()
host_ref = xenapi_fake.get_all('host')[0]
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
self.context = context.get_admin_context()
self.conn = xenapi_conn.get_connection(False)
self.fake_metadata = {'main_compute': 'host',
'host': xenapi_fake.get_record('host',
host_ref)['uuid']}
def test_add_to_aggregate_called(self):
def fake_add_to_aggregate(context, aggregate, host):
fake_add_to_aggregate.called = True
self.stubs.Set(self.conn._pool,
"add_to_aggregate",
fake_add_to_aggregate)
self.conn.add_to_aggregate(None, None, None)
self.assertTrue(fake_add_to_aggregate.called)
def test_add_to_aggregate_for_first_host_sets_metadata(self):
def fake_init_pool(id, name):
fake_init_pool.called = True
self.stubs.Set(self.conn._pool, "_init_pool", fake_init_pool)
aggregate = self._aggregate_setup()
self.conn._pool.add_to_aggregate(self.context, aggregate, "host")
result = db.aggregate_get(self.context, aggregate.id)
self.assertTrue(fake_init_pool.called)
self.assertDictMatch(self.fake_metadata, result.metadetails)
self.assertEqual(aggregate_states.ACTIVE, result.operational_state)
def test_join_subordinate(self):
"""Ensure join_subordinate gets called when the request gets to main."""
def fake_join_subordinate(id, compute_uuid, host, url, user, password):
fake_join_subordinate.called = True
self.stubs.Set(self.conn._pool, "_join_subordinate", fake_join_subordinate)
aggregate = self._aggregate_setup(hosts=['host', 'host2'],
metadata=self.fake_metadata)
self.conn._pool.add_to_aggregate(self.context, aggregate, "host2",
compute_uuid='fake_uuid',
url='fake_url',
user='fake_user',
passwd='fake_pass',
xenhost_uuid='fake_uuid')
self.assertTrue(fake_join_subordinate.called)
def test_add_to_aggregate_first_host(self):
def fake_pool_set_name_label(self, session, pool_ref, name):
fake_pool_set_name_label.called = True
self.stubs.Set(xenapi_fake.SessionBase, "pool_set_name_label",
fake_pool_set_name_label)
self.conn._session.call_xenapi("pool.create", {"name": "asdf"})
values = {"name": 'fake_aggregate',
"availability_zone": 'fake_zone'}
result = db.aggregate_create(self.context, values)
db.aggregate_host_add(self.context, result.id, "host")
aggregate = db.aggregate_get(self.context, result.id)
self.assertEqual(["host"], aggregate.hosts)
self.assertEqual({}, aggregate.metadetails)
self.conn._pool.add_to_aggregate(self.context, aggregate, "host")
self.assertTrue(fake_pool_set_name_label.called)
def test_remove_from_aggregate_called(self):
def fake_remove_from_aggregate(context, aggregate, host):
fake_remove_from_aggregate.called = True
self.stubs.Set(self.conn._pool,
"remove_from_aggregate",
fake_remove_from_aggregate)
self.conn.remove_from_aggregate(None, None, None)
self.assertTrue(fake_remove_from_aggregate.called)
def test_remove_from_empty_aggregate(self):
values = {"name": 'fake_aggregate',
"availability_zone": 'fake_zone'}
result = db.aggregate_create(self.context, values)
self.assertRaises(exception.AggregateError,
self.conn._pool.remove_from_aggregate,
None, result, "test_host")
def test_remove_subordinate(self):
"""Ensure eject subordinate gets called."""
def fake_eject_subordinate(id, compute_uuid, host_uuid):
fake_eject_subordinate.called = True
self.stubs.Set(self.conn._pool, "_eject_subordinate", fake_eject_subordinate)
self.fake_metadata['host2'] = 'fake_host2_uuid'
aggregate = self._aggregate_setup(hosts=['host', 'host2'],
metadata=self.fake_metadata)
self.conn._pool.remove_from_aggregate(self.context, aggregate, "host2")
self.assertTrue(fake_eject_subordinate.called)
def test_remove_main_solo(self):
"""Ensure metadata are cleared after removal."""
def fake_clear_pool(id):
fake_clear_pool.called = True
self.stubs.Set(self.conn._pool, "_clear_pool", fake_clear_pool)
aggregate = self._aggregate_setup(aggr_state=aggregate_states.ACTIVE,
metadata=self.fake_metadata)
self.conn._pool.remove_from_aggregate(self.context, aggregate, "host")
result = db.aggregate_get(self.context, aggregate.id)
self.assertTrue(fake_clear_pool.called)
self.assertDictMatch({}, result.metadetails)
self.assertEqual(aggregate_states.ACTIVE, result.operational_state)
def test_remote_main_non_empty_pool(self):
"""Ensure AggregateError is raised if removing the main."""
aggregate = self._aggregate_setup(aggr_state=aggregate_states.ACTIVE,
hosts=['host', 'host2'],
metadata=self.fake_metadata)
self.assertRaises(exception.InvalidAggregateAction,
self.conn._pool.remove_from_aggregate,
self.context, aggregate, "host")
def _aggregate_setup(self, aggr_name='fake_aggregate',
aggr_zone='fake_zone',
aggr_state=aggregate_states.CREATED,
hosts=['host'], metadata=None):
values = {"name": aggr_name,
"availability_zone": aggr_zone,
"operational_state": aggr_state, }
result = db.aggregate_create(self.context, values)
for host in hosts:
db.aggregate_host_add(self.context, result.id, host)
if metadata:
db.aggregate_metadata_add(self.context, result.id, metadata)
return db.aggregate_get(self.context, result.id)
|
Java
|
/**
* Copyright (C) 2012 Ness Computing, 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.nesscomputing.jersey.types;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Objects;
import java.util.regex.Pattern;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
/**
* Simple Jersey date parameter class. Accepts either milliseconds since epoch UTC or ISO formatted dates.
* Will convert everything into UTC regardless of input timezone.
*/
public class DateParam
{
private static final Pattern NUMBER_PATTERN = Pattern.compile("-?\\d+");
private final DateTime dateTime;
DateParam(DateTime dateTime)
{
this.dateTime = checkNotNull(dateTime, "null datetime").withZone(DateTimeZone.UTC);
}
public static DateParam valueOf(DateTime dateTime)
{
return new DateParam(dateTime);
}
public static DateParam valueOf(String string)
{
if (string == null) {
return null;
}
if (NUMBER_PATTERN.matcher(string).matches()) {
return new DateParam(new DateTime(Long.parseLong(string), DateTimeZone.UTC));
} else {
return new DateParam(new DateTime(string, DateTimeZone.UTC));
}
}
/**
* @return a DateTime if the parameter was provided, or null otherwise.
*/
// This method is static so that you can handle optional parameters as null instances.
public static DateTime getDateTime(DateParam param)
{
return param == null ? null : param.dateTime;
}
@Override
public String toString()
{
return Objects.toString(dateTime);
}
}
|
Java
|
module.exports = unbuild
unbuild.usage = "npm unbuild <folder>\n(this is plumbing)"
var readJson = require("read-package-json")
, rm = require("./utils/gently-rm.js")
, gentlyRm = require("./utils/gently-rm.js")
, npm = require("./npm.js")
, path = require("path")
, fs = require("graceful-fs")
, lifecycle = require("./utils/lifecycle.js")
, asyncMap = require("slide").asyncMap
, chain = require("slide").chain
, log = require("npmlog")
, build = require("./build.js")
// args is a list of folders.
// remove any bins/etc, and then DELETE the folder.
function unbuild (args, silent, cb) {
if (typeof silent === 'function') cb = silent, silent = false
asyncMap(args, unbuild_(silent), cb)
}
function unbuild_ (silent) { return function (folder, cb_) {
function cb (er) {
cb_(er, path.relative(npm.root, folder))
}
folder = path.resolve(folder)
delete build._didBuild[folder]
log.info(folder, "unbuild")
readJson(path.resolve(folder, "package.json"), function (er, pkg) {
// if no json, then just trash it, but no scripts or whatever.
if (er) return rm(folder, cb)
readJson.cache.del(folder)
chain
( [ [lifecycle, pkg, "preuninstall", folder, false, true]
, [lifecycle, pkg, "uninstall", folder, false, true]
, !silent && function(cb) {
console.log("unbuild " + pkg._id)
cb()
}
, [rmStuff, pkg, folder]
, [lifecycle, pkg, "postuninstall", folder, false, true]
, [rm, folder] ]
, cb )
})
}}
function rmStuff (pkg, folder, cb) {
// if it's global, and folder is in {prefix}/node_modules,
// then bins are in {prefix}/bin
// otherwise, then bins are in folder/../.bin
var parent = path.dirname(folder)
, gnm = npm.dir
, top = gnm === parent
readJson.cache.del(path.resolve(folder, "package.json"))
log.verbose([top, gnm, parent], "unbuild " + pkg._id)
asyncMap([rmBins, rmMans], function (fn, cb) {
fn(pkg, folder, parent, top, cb)
}, cb)
}
function rmBins (pkg, folder, parent, top, cb) {
if (!pkg.bin) return cb()
var binRoot = top ? npm.bin : path.resolve(parent, ".bin")
log.verbose([binRoot, pkg.bin], "binRoot")
asyncMap(Object.keys(pkg.bin), function (b, cb) {
if (process.platform === "win32") {
chain([ [rm, path.resolve(binRoot, b) + ".cmd"]
, [rm, path.resolve(binRoot, b) ] ], cb)
} else {
gentlyRm( path.resolve(binRoot, b)
, !npm.config.get("force") && folder
, cb )
}
}, cb)
}
function rmMans (pkg, folder, parent, top, cb) {
if (!pkg.man
|| !top
|| process.platform === "win32"
|| !npm.config.get("global")) {
return cb()
}
var manRoot = path.resolve(npm.config.get("prefix"), "share", "man")
asyncMap(pkg.man, function (man, cb) {
if (Array.isArray(man)) {
man.forEach(rm)
} else {
rm(man)
}
function rm(man) {
var parseMan = man.match(/(.*)\.([0-9]+)(\.gz)?$/)
, stem = parseMan[1]
, sxn = parseMan[2]
, gz = parseMan[3] || ""
, bn = path.basename(stem)
, manDest = path.join( manRoot
, "man"+sxn
, (bn.indexOf(pkg.name) === 0 ? bn
: pkg.name + "-" + bn)
+ "." + sxn + gz
)
gentlyRm( manDest
, !npm.config.get("force") && folder
, cb )
}
}, cb)
}
|
Java
|
package hu.akarnokd.rxjava;
import java.util.concurrent.TimeUnit;
import rx.*;
import rx.plugins.RxJavaHooks;
import rx.schedulers.Schedulers;
public class TrackSubscriber1 {
@SuppressWarnings("unchecked")
public static void main(String[] args) throws Exception {
RxJavaHooks.setOnObservableStart((observable, onSubscribe) -> {
if (!onSubscribe.getClass().getName().toLowerCase().contains("map")) {
return onSubscribe;
}
System.out.println("Started");
return (Observable.OnSubscribe<Object>)observer -> {
class SignalTracker extends Subscriber<Object> {
@Override public void onNext(Object o) {
// handle onNext before or aftern notifying the downstream
observer.onNext(o);
}
@Override public void onError(Throwable t) {
// handle onError
observer.onError(t);
}
@Override public void onCompleted() {
// handle onComplete
System.out.println("Completed");
observer.onCompleted();
}
}
SignalTracker t = new SignalTracker();
onSubscribe.call(t);
};
});
Observable<Integer> observable = Observable.range(1, 5)
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.computation())
.map(integer -> {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
return integer * 3;
});
observable.subscribe(System.out::println);
Thread.sleep(6000L);
}
}
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_74) on Fri Apr 01 14:41:57 CDT 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Uses of Class org.apache.solr.client.solrj.response.schema.SchemaResponse.SchemaNameResponse (Solr 6.0.0 API)</title>
<meta name="date" content="2016-04-01">
<link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.solr.client.solrj.response.schema.SchemaResponse.SchemaNameResponse (Solr 6.0.0 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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/apache/solr/client/solrj/response/schema/SchemaResponse.SchemaNameResponse.html" title="class in org.apache.solr.client.solrj.response.schema">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="../../../../../../../../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/apache/solr/client/solrj/response/schema/class-use/SchemaResponse.SchemaNameResponse.html" target="_top">Frames</a></li>
<li><a href="SchemaResponse.SchemaNameResponse.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.apache.solr.client.solrj.response.schema.SchemaResponse.SchemaNameResponse" class="title">Uses of Class<br>org.apache.solr.client.solrj.response.schema.SchemaResponse.SchemaNameResponse</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../../org/apache/solr/client/solrj/response/schema/SchemaResponse.SchemaNameResponse.html" title="class in org.apache.solr.client.solrj.response.schema">SchemaResponse.SchemaNameResponse</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.solr.client.solrj.request.schema">org.apache.solr.client.solrj.request.schema</a></td>
<td class="colLast">
<div class="block">Convenience classes for making Schema API requests.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.apache.solr.client.solrj.request.schema">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../../org/apache/solr/client/solrj/response/schema/SchemaResponse.SchemaNameResponse.html" title="class in org.apache.solr.client.solrj.response.schema">SchemaResponse.SchemaNameResponse</a> in <a href="../../../../../../../../org/apache/solr/client/solrj/request/schema/package-summary.html">org.apache.solr.client.solrj.request.schema</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/apache/solr/client/solrj/request/schema/package-summary.html">org.apache.solr.client.solrj.request.schema</a> that return <a href="../../../../../../../../org/apache/solr/client/solrj/response/schema/SchemaResponse.SchemaNameResponse.html" title="class in org.apache.solr.client.solrj.response.schema">SchemaResponse.SchemaNameResponse</a></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>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../../../../org/apache/solr/client/solrj/response/schema/SchemaResponse.SchemaNameResponse.html" title="class in org.apache.solr.client.solrj.response.schema">SchemaResponse.SchemaNameResponse</a></code></td>
<td class="colLast"><span class="typeNameLabel">SchemaRequest.SchemaName.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/apache/solr/client/solrj/request/schema/SchemaRequest.SchemaName.html#createResponse-org.apache.solr.client.solrj.SolrClient-">createResponse</a></span>(<a href="../../../../../../../../org/apache/solr/client/solrj/SolrClient.html" title="class in org.apache.solr.client.solrj">SolrClient</a> client)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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/apache/solr/client/solrj/response/schema/SchemaResponse.SchemaNameResponse.html" title="class in org.apache.solr.client.solrj.response.schema">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="../../../../../../../../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/apache/solr/client/solrj/response/schema/class-use/SchemaResponse.SchemaNameResponse.html" target="_top">Frames</a></li>
<li><a href="SchemaResponse.SchemaNameResponse.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 ======= -->
<p class="legalCopy"><small>
<i>Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
|
Java
|
package tk.zielony.carbonsamples.feature;
import android.app.Activity;
import android.os.Bundle;
import tk.zielony.carbonsamples.R;
/**
* Created by Marcin on 2016-03-13.
*/
public class TextMarkerActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_textmarker);
}
}
|
Java
|
//
// nOpenWeb.h
// janbin
//
// Created by katobit on 10/25/2556 BE.
// Copyright (c) 2556 Kittipong Kulapruk. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface nOpenWeb_iphone : UIViewController<UIWebViewDelegate>
{
NSString *urlMain;
NSString *type;
NSString *link;
}
@property (strong, nonatomic) NSString *urlMain;
@property (strong, nonatomic) NSString *type;
@property (strong, nonatomic) NSString *link;
@property (strong, nonatomic) IBOutlet UIWebView *webMain;
@end
|
Java
|
class Stage < ActiveRecord::Base
self.primary_key = 'reference'
include Taggable
end
|
Java
|
// Copyright (c) Microsoft Corporation
//
// 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
//
// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
// EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE,
// FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
namespace Microsoft.Spectrum.Storage.Table.Azure.DataAccessLayer
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Microsoft.Spectrum.Common;
using Microsoft.Spectrum.Storage.DataContracts;
using Microsoft.Spectrum.Storage.Table.Azure.Helpers;
using Microsoft.WindowsAzure.Storage.Table;
using UserRoleType = Microsoft.Spectrum.Storage.Enums.UserRoles;
/// <summary>
/// -----------------------------------------------------------------
/// Namespace: Microsoft.Spectrum.Storage.Table.Azure
/// Class: UserManagementTableOperations
/// Description: class containing operations to deal with user related tables
/// -----------------------------------------------------------------
public class UserManagementTableOperations : IUserManagementTableOperations
{
private readonly RetryAzureTableOperations<Users> userTableOperations;
private readonly RetryAzureTableOperations<UserRoles> userRolesTableOperations;
private readonly RetryAzureTableOperations<WebpagesOAuthMembership> oauthMembershipTableOperations;
/// <summary>
/// Initializes a new instance of the <see cref="UserManagementTableOperations"/> class
/// </summary>
/// <param name="dataContext">data context containing table references</param>
public UserManagementTableOperations(AzureTableDbContext dataContext)
{
if (dataContext == null)
{
throw new ArgumentNullException("dataContext");
}
this.userTableOperations = dataContext.UserTableOperations;
this.userTableOperations.GetTableReference(AzureTableHelper.UsersTable);
this.userRolesTableOperations = dataContext.UserRoleTableOperations;
this.userRolesTableOperations.GetTableReference(AzureTableHelper.UserRoleTable);
this.oauthMembershipTableOperations = dataContext.OAuthMembershipTableOperations;
this.oauthMembershipTableOperations.GetTableReference(AzureTableHelper.WebpagesOAuthMembershipTable);
}
public User GetUserByProviderUserId(string providerUserId)
{
return this.GetUserById(this.GetMembershipInfoByProviderUserId(providerUserId).UserId);
}
/// <summary>
/// Get user details by user id
/// </summary>
/// <param name="userId">user id</param>
/// <returns>user</returns>
public User GetUserByAccountEmail(string accountEmail)
{
if (string.IsNullOrWhiteSpace(accountEmail))
{
throw new ArgumentException("accountEmail should not be empty", "accountEmail");
}
string likeString = accountEmail.ToLower(CultureInfo.InvariantCulture).Replace(" ", string.Empty);
Users user = this.userTableOperations.QueryEntities<Users>(x => x.RowKey.IndexOf(likeString, StringComparison.OrdinalIgnoreCase) == 0).FirstOrDefault();
if (user != null)
{
return new User(user.Id, user.UserName, user.FirstName, user.LastName, user.Location, user.Region, user.TimeZoneId, user.PreferredEmail, user.AccountEmail, user.CreatedOn.ToString(), user.UpdatedTime.ToString(), user.Link, user.Gender, user.Address1, user.Address2, user.Phone, user.Country, user.ZipCode, user.PhoneCountryCode, user.SubscribeNotifications);
}
return null;
}
/// <summary>
/// Get user details by user name
/// </summary>
/// <param name="userName">user name</param>
/// <returns>user</returns>
public void InsertOrUpdateUser(User user)
{
if (user == null)
{
throw new ArgumentException("user can not be null", "user");
}
Users userTableEntity = new Users
{
AccountEmail = user.AccountEmail,
Address1 = user.Address1,
Address2 = user.Address2,
Country = user.Country,
CreatedOn = Convert.ToDateTime(user.CreatedOn, CultureInfo.InvariantCulture),
FirstName = user.FirstName,
Gender = user.Gender,
LastName = user.LastName,
Link = user.Link,
Location = user.Location,
PartitionKey = Constants.DummyPartitionKey,
RowKey = user.UserName.Replace(" ", string.Empty).ToLower(CultureInfo.InvariantCulture) + ":" + user.UserId.ToString(CultureInfo.InvariantCulture),
Phone = user.Phone,
PhoneCountryCode = user.PhoneCountryCode,
PreferredEmail = user.PreferredEmail,
Region = user.Region,
TimeZone = user.TimeZone,
TimeZoneId = user.TimeZoneId,
UpdatedTime = Convert.ToDateTime(user.UpdatedTime, CultureInfo.InvariantCulture),
UserName = user.UserName,
ZipCode = user.ZipCode,
SubscribeNotifications = user.SubscribeNotifications
};
this.userTableOperations.InsertOrReplaceEntity(userTableEntity, true);
}
/// <summary>
/// insert or update user
/// </summary>
/// <param name="user">user details</param>
public UserRole GetUserRole(int userId, Guid measurementStationId)
{
UserRoles userRoleEntity = this.userRolesTableOperations.GetByKeys<UserRoles>(measurementStationId.ToString(), userId.ToString(CultureInfo.InvariantCulture)).FirstOrDefault();
if (userRoleEntity != null)
{
return new UserRole(userRoleEntity.UserId, userRoleEntity.Role, userRoleEntity.MeasurementStationId);
}
return null;
}
public void RemoveAdmin(int userId, Guid measurementStationId)
{
UserRoles userRoleEntity = this.userRolesTableOperations.GetByKeys<UserRoles>(measurementStationId.ToString(), userId.ToString(CultureInfo.InvariantCulture)).FirstOrDefault();
this.userRolesTableOperations.DeleteEntity(userRoleEntity);
}
/// <summary>
/// Get user roles by UserId
/// </summary>
/// <param name="userId">user Id</param>
/// <returns>list of user roles</returns>
public IEnumerable<UserRole> GetUserRoles(int userId)
{
string query = TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, userId.ToString(CultureInfo.InvariantCulture));
return this.userRolesTableOperations.ExecuteQueryWithContinuation<UserRoles>(query)
.Select(x => new UserRole(x.UserId, x.Role, x.MeasurementStationId));
}
/// <summary>
/// Get user roles by user id
/// </summary>
/// <param name="userId">user id</param>
/// <returns>user role</returns>
public void InsertOrUpdate(UserRole userRole)
{
if (userRole == null)
{
throw new ArgumentException("userRole can not be null", "userRole");
}
UserRoles userRoleEntity = new UserRoles(userRole.MeasurementStationId, userRole.UserId)
{
Role = userRole.Role
};
this.userRolesTableOperations.InsertOrReplaceEntity(userRoleEntity, true);
}
/// <summary>
/// insert or update user role
/// </summary>
/// <param name="userRole"></param>
public OAuthMembershipInfo GetMembershipInfoByProviderUserId(string providerUserId)
{
WebpagesOAuthMembership membershipEntity = this.oauthMembershipTableOperations.QueryEntities<WebpagesOAuthMembership>(x =>
{
System.Diagnostics.Debug.WriteLine(x.RowKey);
return x.RowKey.IndexOf(providerUserId, StringComparison.OrdinalIgnoreCase) == 0;
}).SingleOrDefault();
if (membershipEntity != null)
{
return new OAuthMembershipInfo(membershipEntity.ProviderUserId, membershipEntity.Provider, membershipEntity.UserId);
}
return null;
}
/// <summary>
/// Get membership info by provider user id
/// </summary>
/// <param name="providerUserId">provider user id</param>
/// <returns>membership info</returns>
public OAuthMembershipInfo GetMembershipInfoByUserId(int userId)
{
WebpagesOAuthMembership membershipEntity = this.oauthMembershipTableOperations.QueryEntities<WebpagesOAuthMembership>(x => x.RowKey.IndexOf(userId.ToString(CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase) > 0).SingleOrDefault();
return new OAuthMembershipInfo(membershipEntity.ProviderUserId, membershipEntity.Provider, membershipEntity.UserId);
}
/// <summary>
/// Gets membership info by user id
/// </summary>
/// <param name="userId">user id</param>
/// <returns>membership info</returns>
public void InsertOrUpdateMembershipInfo(OAuthMembershipInfo membershipInfo)
{
if (membershipInfo == null)
{
throw new ArgumentException("membershipInfo can not be null", "membershipInfo");
}
WebpagesOAuthMembership membershipEntity = new WebpagesOAuthMembership(membershipInfo.ProviderUserId, membershipInfo.UserId.ToString(CultureInfo.InvariantCulture), membershipInfo.Provider);
this.oauthMembershipTableOperations.InsertOrReplaceEntity(membershipEntity, true);
}
/// <summary>
/// Inserts or update membership info
/// </summary>
/// <param name="membershipInfo">membership info</param>
public User GetUserById(int userId)
{
string likeString = ":" + userId.ToString(CultureInfo.InvariantCulture);
Users user = this.userTableOperations.QueryEntities<Users>(x => x.RowKey.IndexOf(likeString, StringComparison.OrdinalIgnoreCase) > 0).SingleOrDefault();
if (user != null)
{
return new User(user.Id, user.UserName, user.FirstName, user.LastName, user.Location, user.Region, user.TimeZoneId, user.PreferredEmail, user.AccountEmail, user.CreatedOn.ToString(), user.UpdatedTime.ToString(), user.Link, user.Gender, user.Address1, user.Address2, user.Phone, user.Country, user.ZipCode, user.PhoneCountryCode, user.SubscribeNotifications);
}
return null;
}
/// <summary>
/// Gets all the Station administrators for the measurement station.
/// </summary>
/// <param name="measurementStationId">Measurement Station Id.</param>
/// <returns>Collection Station administrators.</returns>
public IEnumerable<User> GetAllStationAdmins(Guid measurementStationId)
{
if (measurementStationId == null)
{
throw new ArgumentNullException("measurementStationId", "Measurement station id can not be null");
}
string stationAdminRole = UserRoleType.StationAdmin.ToString();
string partitionKey = measurementStationId.ToString();
IEnumerable<User> stationAdmins = this.userRolesTableOperations.QueryEntities<UserRoles>(
(user) =>
{
return (user.PartitionKey == partitionKey)
&& (string.Compare(user.Role, stationAdminRole, StringComparison.OrdinalIgnoreCase) == 0);
})
.Select(stationAmdin => this.GetUserById(stationAmdin.UserId));
return stationAdmins;
}
/// <summary>
/// Gets all the Site administrators.
/// </summary>
/// <returns>Collection site administrators.</returns>
public IEnumerable<User> GetAllSiteAdmins()
{
string stationAdminRole = UserRoleType.SiteAdmin.ToString();
IEnumerable<User> siteAdmins = this.userRolesTableOperations.QueryEntities<UserRoles>(
(user) =>
{
// Idea behind having a different partition key for site Administrators instead of measurement station id is to avoid data redundancy that
// can occur have a corresponding entry for each measurement station for a given user
return (user.PartitionKey == Constants.SiteAdminsPartitionKey)
&& (string.Compare(user.Role, stationAdminRole, StringComparison.OrdinalIgnoreCase) == 0);
})
.Select(siteAdmin => this.GetUserById(siteAdmin.UserId));
return siteAdmins;
}
public User GetUserByEmail(string email)
{
Users user = this.userTableOperations.GetByKeys<Users>(Constants.DummyPartitionKey).Where(x => (string.Compare(x.AccountEmail, email, StringComparison.OrdinalIgnoreCase) == 0)).FirstOrDefault();
if (user != null)
{
return new User(user.Id, user.UserName, user.FirstName, user.LastName, user.Location, user.Region, user.TimeZoneId, user.PreferredEmail, user.AccountEmail, user.CreatedOn.ToString(CultureInfo.InvariantCulture), user.UpdatedTime.ToString(CultureInfo.InvariantCulture), user.Link, user.Gender, user.Address1, user.Address2, user.Phone, user.Country, user.ZipCode, user.PhoneCountryCode, user.SubscribeNotifications);
}
return null;
}
}
}
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_172) on Wed Mar 13 10:37:22 EDT 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>API Help (jrugged-core 4.0.0-SNAPSHOT API)</title>
<meta name="date" content="2019-03-13">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="API Help (jrugged-core 4.0.0-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li class="navBarCell1Rev">Help</li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?help-doc.html" target="_top">Frames</a></li>
<li><a href="help-doc.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">
<h1 class="title">How This API Document Is Organized</h1>
<div class="subTitle">This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.</div>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<h2>Overview</h2>
<p>The <a href="overview-summary.html">Overview</a> page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.</p>
</li>
<li class="blockList">
<h2>Package</h2>
<p>Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:</p>
<ul>
<li>Interfaces (italic)</li>
<li>Classes</li>
<li>Enums</li>
<li>Exceptions</li>
<li>Errors</li>
<li>Annotation Types</li>
</ul>
</li>
<li class="blockList">
<h2>Class/Interface</h2>
<p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:</p>
<ul>
<li>Class inheritance diagram</li>
<li>Direct Subclasses</li>
<li>All Known Subinterfaces</li>
<li>All Known Implementing Classes</li>
<li>Class/interface declaration</li>
<li>Class/interface description</li>
</ul>
<ul>
<li>Nested Class Summary</li>
<li>Field Summary</li>
<li>Constructor Summary</li>
<li>Method Summary</li>
</ul>
<ul>
<li>Field Detail</li>
<li>Constructor Detail</li>
<li>Method Detail</li>
</ul>
<p>Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</p>
</li>
<li class="blockList">
<h2>Annotation Type</h2>
<p>Each annotation type has its own separate page with the following sections:</p>
<ul>
<li>Annotation Type declaration</li>
<li>Annotation Type description</li>
<li>Required Element Summary</li>
<li>Optional Element Summary</li>
<li>Element Detail</li>
</ul>
</li>
<li class="blockList">
<h2>Enum</h2>
<p>Each enum has its own separate page with the following sections:</p>
<ul>
<li>Enum declaration</li>
<li>Enum description</li>
<li>Enum Constant Summary</li>
<li>Enum Constant Detail</li>
</ul>
</li>
<li class="blockList">
<h2>Use</h2>
<p>Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.</p>
</li>
<li class="blockList">
<h2>Tree (Class Hierarchy)</h2>
<p>There is a <a href="overview-tree.html">Class Hierarchy</a> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.</p>
<ul>
<li>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.</li>
<li>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</li>
</ul>
</li>
<li class="blockList">
<h2>Deprecated API</h2>
<p>The <a href="deprecated-list.html">Deprecated API</a> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</p>
</li>
<li class="blockList">
<h2>Index</h2>
<p>The <a href="index-all.html">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p>
</li>
<li class="blockList">
<h2>Prev/Next</h2>
<p>These links take you to the next or previous class, interface, package, or related page.</p>
</li>
<li class="blockList">
<h2>Frames/No Frames</h2>
<p>These links show and hide the HTML frames. All pages are available with or without frames.</p>
</li>
<li class="blockList">
<h2>All Classes</h2>
<p>The <a href="allclasses-noframe.html">All Classes</a> link shows all classes and interfaces except non-static nested types.</p>
</li>
<li class="blockList">
<h2>Serialized Form</h2>
<p>Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.</p>
</li>
<li class="blockList">
<h2>Constant Field Values</h2>
<p>The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.</p>
</li>
</ul>
<span class="emphasizedPhrase">This help file applies to API documentation generated using the standard doclet.</span></div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li class="navBarCell1Rev">Help</li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?help-doc.html" target="_top">Frames</a></li>
<li><a href="help-doc.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 ======= -->
<p class="legalCopy"><small>Copyright © 2019. All Rights Reserved.</small></p>
</body>
</html>
|
Java
|
/* */ package com.hundsun.network.gates.houchao.biz.services.pojo;
/* */
/* */ import org.springframework.context.annotation.Scope;
/* */ import org.springframework.stereotype.Service;
/* */
/* */ @Service("outFundTrans")
/* */ @Scope("prototype")
/* */ public class OutFundTrans extends InOutFundTrans
/* */ {
/* */ protected boolean isTrans()
/* */ {
/* 26 */ return true;
/* */ }
/* */
/* */ protected boolean isOutFund()
/* */ {
/* 31 */ return true;
/* */ }
/* */
/* */ protected boolean isNeedRecordUncomeFund()
/* */ {
/* 39 */ return false;
/* */ }
/* */
/* */ protected boolean isInOutTrans()
/* */ {
/* 49 */ return true;
/* */ }
/* */ }
/* Location: E:\__安装归档\linquan-20161112\deploy16\houchao\webroot\WEB-INF\classes\
* Qualified Name: com.hundsun.network.gates.houchao.biz.services.pojo.OutFundTrans
* JD-Core Version: 0.6.0
*/
|
Java
|
import type { IProviderSettings } from '@spinnaker/core';
import { SETTINGS } from '@spinnaker/core';
export interface IAppengineProviderSettings extends IProviderSettings {
defaults: {
account?: string;
};
}
export const AppengineProviderSettings: IAppengineProviderSettings = (SETTINGS.providers
.appengine as IAppengineProviderSettings) || { defaults: {} };
if (AppengineProviderSettings) {
AppengineProviderSettings.resetToOriginal = SETTINGS.resetProvider('appengine');
}
|
Java
|
/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
#include <memory>
#include "kernel/expr.h"
namespace lean {
/**
\brief Functional object for creating expressions with maximally
shared sub-expressions.
*/
class max_sharing_fn {
struct imp;
friend expr max_sharing(expr const & a);
std::unique_ptr<imp> m_ptr;
public:
max_sharing_fn();
~max_sharing_fn();
expr operator()(expr const & a);
/**
\brief Clear the cache.
*/
void clear();
};
/**
\brief The resultant expression is structurally identical to the input one, but
it uses maximally shared sub-expressions.
*/
expr max_sharing(expr const & a);
}
|
Java
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace ExemploEFCrud
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}
|
Java
|
/*
* Copyright 2002-2018 the original author or 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
*
* https://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.springframework.web.bind.support;
import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.core.convert.ConversionService;
import org.springframework.lang.Nullable;
import org.springframework.validation.BindingErrorProcessor;
import org.springframework.validation.MessageCodesResolver;
import org.springframework.validation.Validator;
import org.springframework.web.bind.WebDataBinder;
/**
* Convenient {@link WebBindingInitializer} for declarative configuration
* in a Spring application context. Allows for reusing pre-configured
* initializers with multiple controller/handlers.
*
* @author Juergen Hoeller
* @since 2.5
* @see #setDirectFieldAccess
* @see #setMessageCodesResolver
* @see #setBindingErrorProcessor
* @see #setValidator(Validator)
* @see #setConversionService(ConversionService)
* @see #setPropertyEditorRegistrar
*/
public class ConfigurableWebBindingInitializer implements WebBindingInitializer {
private boolean autoGrowNestedPaths = true;
private boolean directFieldAccess = false;
@Nullable
private MessageCodesResolver messageCodesResolver;
@Nullable
private BindingErrorProcessor bindingErrorProcessor;
@Nullable
private Validator validator;
@Nullable
private ConversionService conversionService;
@Nullable
private PropertyEditorRegistrar[] propertyEditorRegistrars;
/**
* Set whether a binder should attempt to "auto-grow" a nested path that contains a null value.
* <p>If "true", a null path location will be populated with a default object value and traversed
* instead of resulting in an exception. This flag also enables auto-growth of collection elements
* when accessing an out-of-bounds index.
* <p>Default is "true" on a standard DataBinder. Note that this feature is only supported
* for bean property access (DataBinder's default mode), not for field access.
* @see org.springframework.validation.DataBinder#initBeanPropertyAccess()
* @see org.springframework.validation.DataBinder#setAutoGrowNestedPaths
*/
public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths) {
this.autoGrowNestedPaths = autoGrowNestedPaths;
}
/**
* Return whether a binder should attempt to "auto-grow" a nested path that contains a null value.
*/
public boolean isAutoGrowNestedPaths() {
return this.autoGrowNestedPaths;
}
/**
* Set whether to use direct field access instead of bean property access.
* <p>Default is {@code false}, using bean property access.
* Switch this to {@code true} in order to enforce direct field access.
* @see org.springframework.validation.DataBinder#initDirectFieldAccess()
* @see org.springframework.validation.DataBinder#initBeanPropertyAccess()
*/
public final void setDirectFieldAccess(boolean directFieldAccess) {
this.directFieldAccess = directFieldAccess;
}
/**
* Return whether to use direct field access instead of bean property access.
*/
public boolean isDirectFieldAccess() {
return this.directFieldAccess;
}
/**
* Set the strategy to use for resolving errors into message codes.
* Applies the given strategy to all data binders used by this controller.
* <p>Default is {@code null}, i.e. using the default strategy of
* the data binder.
* @see org.springframework.validation.DataBinder#setMessageCodesResolver
*/
public final void setMessageCodesResolver(@Nullable MessageCodesResolver messageCodesResolver) {
this.messageCodesResolver = messageCodesResolver;
}
/**
* Return the strategy to use for resolving errors into message codes.
*/
@Nullable
public final MessageCodesResolver getMessageCodesResolver() {
return this.messageCodesResolver;
}
/**
* Set the strategy to use for processing binding errors, that is,
* required field errors and {@code PropertyAccessException}s.
* <p>Default is {@code null}, that is, using the default strategy
* of the data binder.
* @see org.springframework.validation.DataBinder#setBindingErrorProcessor
*/
public final void setBindingErrorProcessor(@Nullable BindingErrorProcessor bindingErrorProcessor) {
this.bindingErrorProcessor = bindingErrorProcessor;
}
/**
* Return the strategy to use for processing binding errors.
*/
@Nullable
public final BindingErrorProcessor getBindingErrorProcessor() {
return this.bindingErrorProcessor;
}
/**
* Set the Validator to apply after each binding step.
*/
public final void setValidator(@Nullable Validator validator) {
this.validator = validator;
}
/**
* Return the Validator to apply after each binding step, if any.
*/
@Nullable
public final Validator getValidator() {
return this.validator;
}
/**
* Specify a ConversionService which will apply to every DataBinder.
* @since 3.0
*/
public final void setConversionService(@Nullable ConversionService conversionService) {
this.conversionService = conversionService;
}
/**
* Return the ConversionService which will apply to every DataBinder.
*/
@Nullable
public final ConversionService getConversionService() {
return this.conversionService;
}
/**
* Specify a single PropertyEditorRegistrar to be applied to every DataBinder.
*/
public final void setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar) {
this.propertyEditorRegistrars = new PropertyEditorRegistrar[] {propertyEditorRegistrar};
}
/**
* Specify multiple PropertyEditorRegistrars to be applied to every DataBinder.
*/
public final void setPropertyEditorRegistrars(@Nullable PropertyEditorRegistrar[] propertyEditorRegistrars) {
this.propertyEditorRegistrars = propertyEditorRegistrars;
}
/**
* Return the PropertyEditorRegistrars to be applied to every DataBinder.
*/
@Nullable
public final PropertyEditorRegistrar[] getPropertyEditorRegistrars() {
return this.propertyEditorRegistrars;
}
@Override
public void initBinder(WebDataBinder binder) {
binder.setAutoGrowNestedPaths(this.autoGrowNestedPaths);
if (this.directFieldAccess) {
binder.initDirectFieldAccess();
}
if (this.messageCodesResolver != null) {
binder.setMessageCodesResolver(this.messageCodesResolver);
}
if (this.bindingErrorProcessor != null) {
binder.setBindingErrorProcessor(this.bindingErrorProcessor);
}
if (this.validator != null && binder.getTarget() != null &&
this.validator.supports(binder.getTarget().getClass())) {
binder.setValidator(this.validator);
}
if (this.conversionService != null) {
binder.setConversionService(this.conversionService);
}
if (this.propertyEditorRegistrars != null) {
for (PropertyEditorRegistrar propertyEditorRegistrar : this.propertyEditorRegistrars) {
propertyEditorRegistrar.registerCustomEditors(binder);
}
}
}
}
|
Java
|
\hypertarget{dir_e1120d38b56829564970ce9576dddbdf}{\section{jamms Directory Reference}
\label{dir_e1120d38b56829564970ce9576dddbdf}\index{jamms Directory Reference@{jamms Directory Reference}}
}
Directory dependency graph for jamms\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=262pt]{dir_e1120d38b56829564970ce9576dddbdf_dep}
\end{center}
\end{figure}
\subsection*{Directories}
\begin{DoxyCompactItemize}
\item
directory \hyperlink{dir_77b208f94221f94139bdd2444dc4f570}{Tower\+Defense}
\end{DoxyCompactItemize}
|
Java
|
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2015 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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 is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi.impl;
import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.util.PsiTreeUtil;
import static com.intellij.plugins.haxe.lang.lexer.HaxeTokenTypes.*;
import com.intellij.plugins.haxe.lang.psi.*;
public class HaxeMultiplicativeExpressionImpl extends HaxeExpressionImpl implements HaxeMultiplicativeExpression {
public HaxeMultiplicativeExpressionImpl(ASTNode node) {
super(node);
}
public void accept(@NotNull PsiElementVisitor visitor) {
if (visitor instanceof HaxeVisitor) ((HaxeVisitor)visitor).visitMultiplicativeExpression(this);
else super.accept(visitor);
}
@Override
@NotNull
public List<HaxeExpression> getExpressionList() {
return PsiTreeUtil.getChildrenOfTypeAsList(this, HaxeExpression.class);
}
@Override
@Nullable
public HaxeIfStatement getIfStatement() {
return findChildByClass(HaxeIfStatement.class);
}
@Override
@Nullable
public HaxeSwitchStatement getSwitchStatement() {
return findChildByClass(HaxeSwitchStatement.class);
}
@Override
@Nullable
public HaxeTryStatement getTryStatement() {
return findChildByClass(HaxeTryStatement.class);
}
}
|
Java
|
# AUTOGENERATED FILE
FROM balenalib/orangepi-plus2-alpine:3.12-run
# remove several traces of python
RUN apk del python*
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# install python dependencies
RUN apk add --no-cache ca-certificates libffi \
&& apk add --no-cache libssl1.0 || apk add --no-cache libssl1.1
# key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported
# key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported
RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \
&& gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \
&& gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059
# point Python at a system-provided certificate database. Otherwise, we might hit CERTIFICATE_VERIFY_FAILED.
# https://www.python.org/dev/peps/pep-0476/#trust-database
ENV SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt
ENV PYTHON_VERSION 3.8.12
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 21.3.1
ENV SETUPTOOLS_VERSION 60.5.4
RUN set -x \
&& buildDeps=' \
curl \
gnupg \
' \
&& apk add --no-cache --virtual .build-deps $buildDeps \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-alpine-armv7hf-libffi3.3.tar.gz" \
&& echo "a9c035ae60c69723a518ec604de8e0cc39dde8f6f838946393e5999c9cdf3cba Python-$PYTHON_VERSION.linux-alpine-armv7hf-libffi3.3.tar.gz" | sha256sum -c - \
&& tar -xzf "Python-$PYTHON_VERSION.linux-alpine-armv7hf-libffi3.3.tar.gz" --strip-components=1 \
&& rm -rf "Python-$PYTHON_VERSION.linux-alpine-armv7hf-libffi3.3.tar.gz" \
&& if [ ! -e /usr/local/bin/pip3 ]; then : \
&& curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \
&& echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \
&& python3 get-pip.py \
&& rm get-pip.py \
; fi \
&& pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& cd / \
&& rm -rf /usr/src/python ~/.cache
# make some useful symlinks that are expected to exist
RUN cd /usr/local/bin \
&& ln -sf pip3 pip \
&& { [ -e easy_install ] || ln -s easy_install-* easy_install; } \
&& ln -sf idle3 idle \
&& ln -sf pydoc3 pydoc \
&& ln -sf python3 python \
&& ln -sf python3-config python-config
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \
&& echo "Running test-stack@python" \
&& chmod +x test-stack@python.sh \
&& bash test-stack@python.sh \
&& rm -rf test-stack@python.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Alpine Linux 3.12 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.8.12, Pip v21.3.1, Setuptools v60.5.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& ln -f /bin/sh /bin/sh.real \
&& ln -f /bin/sh-shim /bin/sh
|
Java
|
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
import subprocess
from pants.backend.codegen.subsystems.thrift_defaults import ThriftDefaults
from pants.base.build_environment import get_buildroot
from pants.base.exceptions import TaskError
from pants.base.workunit import WorkUnitLabel
from pants.binaries.thrift_binary import ThriftBinary
from pants.task.simple_codegen_task import SimpleCodegenTask
from pants.util.dirutil import safe_mkdir
from pants.util.memo import memoized_property
from twitter.common.collections import OrderedSet
from pants.contrib.go.targets.go_thrift_library import GoThriftGenLibrary, GoThriftLibrary
class GoThriftGen(SimpleCodegenTask):
@classmethod
def register_options(cls, register):
super(GoThriftGen, cls).register_options(register)
register('--strict', default=True, fingerprint=True, type=bool,
help='Run thrift compiler with strict warnings.')
register('--gen-options', advanced=True, fingerprint=True,
help='Use these apache thrift go gen options.')
register('--thrift-import', advanced=True,
help='Use this thrift-import gen option to thrift.')
register('--thrift-import-target', advanced=True,
help='Use this thrift import on symbolic defs.')
@classmethod
def subsystem_dependencies(cls):
return (super(GoThriftGen, cls).subsystem_dependencies() +
(ThriftDefaults, ThriftBinary.Factory.scoped(cls)))
@memoized_property
def _thrift_binary(self):
thrift_binary = ThriftBinary.Factory.scoped_instance(self).create()
return thrift_binary.path
@memoized_property
def _deps(self):
thrift_import_target = self.get_options().thrift_import_target
thrift_imports = self.context.resolve(thrift_import_target)
return thrift_imports
@memoized_property
def _service_deps(self):
service_deps = self.get_options().get('service_deps')
return list(self.resolve_deps(service_deps)) if service_deps else self._deps
SERVICE_PARSER = re.compile(r'^\s*service\s+(?:[^\s{]+)')
NAMESPACE_PARSER = re.compile(r'^\s*namespace go\s+([^\s]+)', re.MULTILINE)
def _declares_service(self, source):
with open(source) as thrift:
return any(line for line in thrift if self.SERVICE_PARSER.search(line))
def _get_go_namespace(self, source):
with open(source) as thrift:
namespace = self.NAMESPACE_PARSER.search(thrift.read())
if not namespace:
raise TaskError('Thrift file {} must contain "namespace go "', source)
return namespace.group(1)
def synthetic_target_extra_dependencies(self, target, target_workdir):
for source in target.sources_relative_to_buildroot():
if self._declares_service(os.path.join(get_buildroot(), source)):
return self._service_deps
return self._deps
def synthetic_target_type(self, target):
return GoThriftGenLibrary
def is_gentarget(self, target):
return isinstance(target, GoThriftLibrary)
@memoized_property
def _thrift_cmd(self):
cmd = [self._thrift_binary]
thrift_import = 'thrift_import={}'.format(self.get_options().thrift_import)
gen_options = self.get_options().gen_options
if gen_options:
gen_options += ',' + thrift_import
else:
gen_options = thrift_import
cmd.extend(('--gen', 'go:{}'.format(gen_options)))
if self.get_options().strict:
cmd.append('-strict')
if self.get_options().level == 'debug':
cmd.append('-verbose')
return cmd
def _generate_thrift(self, target, target_workdir):
target_cmd = self._thrift_cmd[:]
bases = OrderedSet(tgt.target_base for tgt in target.closure() if self.is_gentarget(tgt))
for base in bases:
target_cmd.extend(('-I', base))
target_cmd.extend(('-o', target_workdir))
all_sources = list(target.sources_relative_to_buildroot())
if len(all_sources) != 1:
raise TaskError('go_thrift_library only supports a single .thrift source file for {}.', target)
source = all_sources[0]
target_cmd.append(os.path.join(get_buildroot(), source))
with self.context.new_workunit(name=source,
labels=[WorkUnitLabel.TOOL],
cmd=' '.join(target_cmd)) as workunit:
result = subprocess.call(target_cmd,
stdout=workunit.output('stdout'),
stderr=workunit.output('stderr'))
if result != 0:
raise TaskError('{} ... exited non-zero ({})'.format(self._thrift_binary, result))
gen_dir = os.path.join(target_workdir, 'gen-go')
src_dir = os.path.join(target_workdir, 'src')
safe_mkdir(src_dir)
go_dir = os.path.join(target_workdir, 'src', 'go')
os.rename(gen_dir, go_dir)
@classmethod
def product_types(cls):
return ['go']
def execute_codegen(self, target, target_workdir):
self._generate_thrift(target, target_workdir)
@property
def _copy_target_attributes(self):
"""Override `_copy_target_attributes` to exclude `provides`."""
return [a for a in super(GoThriftGen, self)._copy_target_attributes if a != 'provides']
def synthetic_target_dir(self, target, target_workdir):
all_sources = list(target.sources_relative_to_buildroot())
source = all_sources[0]
namespace = self._get_go_namespace(source)
return os.path.join(target_workdir, 'src', 'go', namespace.replace(".", os.path.sep))
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_25) on Tue Feb 07 22:52:55 CET 2012 -->
<TITLE>
S-Index
</TITLE>
<META NAME="date" CONTENT="2012-02-07">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="S-Index";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../com/osbcp/cssparser/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </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="index-8.html"><B>PREV LETTER</B></A>
<A HREF="index-10.html"><B>NEXT LETTER</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?index-filesindex-9.html" target="_top"><B>FRAMES</B></A>
<A HREF="index-9.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<A HREF="index-1.html">A</A> <A HREF="index-2.html">C</A> <A HREF="index-3.html">E</A> <A HREF="index-4.html">G</A> <A HREF="index-5.html">H</A> <A HREF="index-6.html">I</A> <A HREF="index-7.html">P</A> <A HREF="index-8.html">R</A> <A HREF="index-9.html">S</A> <A HREF="index-10.html">T</A> <A HREF="index-11.html">V</A> <HR>
<A NAME="_S_"><!-- --></A><H2>
<B>S</B></H2>
<DL>
<DT><A HREF="../com/osbcp/cssparser/Selector.html" title="class in com.osbcp.cssparser"><B>Selector</B></A> - Class in <A HREF="../com/osbcp/cssparser/package-summary.html">com.osbcp.cssparser</A><DD>Represents a CSS selector.<DT><A HREF="../com/osbcp/cssparser/Selector.html#Selector(java.lang.String)"><B>Selector(String)</B></A> -
Constructor for class com.osbcp.cssparser.<A HREF="../com/osbcp/cssparser/Selector.html" title="class in com.osbcp.cssparser">Selector</A>
<DD>Creates a new selector.
</DL>
<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/osbcp/cssparser/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </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="index-8.html"><B>PREV LETTER</B></A>
<A HREF="index-10.html"><B>NEXT LETTER</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?index-filesindex-9.html" target="_top"><B>FRAMES</B></A>
<A HREF="index-9.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<A HREF="index-1.html">A</A> <A HREF="index-2.html">C</A> <A HREF="index-3.html">E</A> <A HREF="index-4.html">G</A> <A HREF="index-5.html">H</A> <A HREF="index-6.html">I</A> <A HREF="index-7.html">P</A> <A HREF="index-8.html">R</A> <A HREF="index-9.html">S</A> <A HREF="index-10.html">T</A> <A HREF="index-11.html">V</A> <HR>
</BODY>
</HTML>
|
Java
|
# Github pages for DHGMS Solutions
## Introduction
This is the branch for the [Github pages for the DHGMS Solutions project documentation](http://dhgms-solutions.github.io/).
## Viewing the documentation
The documentation can be found at http://dhgms-solutions.github.io/
## Contributing to the documentation
It is likely you won't want to contribute to this repository, but one of the [actual project repositories](https://github.com/DHGMS-Solutions/).
### 1\. Fork the documentation
See the [github help page for instructions on how to create a fork](http://help.github.com/fork-a-repo/).
### 2\. Write desired content
Use your preffered method for carrying out work.
### 3\. Send a pull request
See the [github help page for instructions on how to send pull requests](http://help.github.com/send-pull-requests/)
|
Java
|
var gplay = require('google-play-scraper');
var fs = require('fs')
var Promise = require('promise');
var myArgs = process.argv.slice(2);
var passed_appid = myArgs[0];
var passed_appcount = myArgs[1];
console.log(passed_appid);
var read = Promise.denodeify(fs.readFile);
var write = Promise.denodeify(fs.writeFile);
var dir = './dataset/' + passed_appcount;
gplay.app({appId: passed_appid})
.then(function (str) {
if(JSON.stringify(str, null, ' ').indexOf("title") > -1) {
if (!fs.existsSync(dir)){
fs.mkdirSync(dir);
}
return write(dir + '/meta.json', JSON.stringify(str, null, ' '), 'utf8')
} else {
console.log('app doesnt exist');
return false
}
})
.then(function (){process.exit()});
|
Java
|
import unittest, re
from rexp.compiler import PatternCompiler
class CompilerTestMethods(unittest.TestCase):
def test_compile_1(self):
compiler = PatternCompiler(pattern_set=dict(
TEST=r'\w+'
))
try:
c1 = compiler.compile('$1{TEST}')
except Exception as exc:
self.assertTrue(1)
c1 = compiler.compile('$1{TEST}', ['test'])
self.assertEqual(c1, r'(?:(?P<test>(\w+)))')
def test_compile_2(self):
compiler = PatternCompiler(pattern_set=dict(
TEST=r'\w+'
))
try:
c1 = compiler.compile('$1{TEST}')
except:
self.assertTrue(1)
c1 = compiler.compile('$1{TEST}', ['test'])
self.assertEqual(c1, r'(?:(?P<test>(\w+)))')
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_79) on Thu Sep 17 01:48:29 IST 2015 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Uses of Class org.apache.solr.client.solrj.request.CoreAdminRequest.RequestRecovery (Solr 5.3.1 API)</title>
<meta name="date" content="2015-09-17">
<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.apache.solr.client.solrj.request.CoreAdminRequest.RequestRecovery (Solr 5.3.1 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/apache/solr/client/solrj/request/CoreAdminRequest.RequestRecovery.html" title="class in org.apache.solr.client.solrj.request">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="../../../../../../../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/apache/solr/client/solrj/request/class-use/CoreAdminRequest.RequestRecovery.html" target="_top">Frames</a></li>
<li><a href="CoreAdminRequest.RequestRecovery.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.apache.solr.client.solrj.request.CoreAdminRequest.RequestRecovery" class="title">Uses of Class<br>org.apache.solr.client.solrj.request.CoreAdminRequest.RequestRecovery</h2>
</div>
<div class="classUseContainer">No usage of org.apache.solr.client.solrj.request.CoreAdminRequest.RequestRecovery</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/apache/solr/client/solrj/request/CoreAdminRequest.RequestRecovery.html" title="class in org.apache.solr.client.solrj.request">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="../../../../../../../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/apache/solr/client/solrj/request/class-use/CoreAdminRequest.RequestRecovery.html" target="_top">Frames</a></li>
<li><a href="CoreAdminRequest.RequestRecovery.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 ======= -->
<p class="legalCopy"><small>
<i>Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
|
Java
|
// Models
app.SearchModel = Backbone.Model.extend({
idAttribute: "session_token",
urlRoot: function() {
var u = '/search/' + this.id;
return u;
}
});
// Collections
app.SearchCollection = Backbone.Collection.extend({
model: app.SearchModel,
url: function() {
if (typeof this.id === 'undefined')
return '/search';
else
return '/search/' + this.id;
},
initialize: function(options) {
if (typeof options != 'undefined')
this.id = options.session_token;
}
});
// Views
app.cardList = Backbone.View.extend({
el: '#cardList'
});
app.cardView = Backbone.View.extend({
tagName: 'div',
initialize: function(card) {
this.card = card;
},
template: _.template($("#card-template").html()),
render: function(cardList) {
this.$el.html(this.template({
card: this.card
}));
this.$el.addClass('card');
cardList.$el.append(this.el);
return this;
}
});
|
Java
|
---
layout: post
title: "383. Ransom Note-勒索信"
subtitle: " \"LeetCode\""
date: 2016-9-13 10:08:36
author: "Zering"
header-img: "img/road.jpg"
catalog: true
tags:
- LeetCode
---
### 问题
问题地址:https://leetcode.com/problems/ransom-note/
Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines ; otherwise, it will return false.
Each letter in the magazine string can only be used once in your ransom note.
Note:
You may assume that both strings contain only lowercase letters.
canConstruct("a", "b") -> false
canConstruct("aa", "ab") -> false
canConstruct("aa", "aab") -> true
### 问题翻译
任意给你一个勒索信字符串和一个包含杂志所有字母的字符串,写一个功能判断勒索信能否由杂志的字母组成。
杂志里的每一个字母只能使用一次
注意:假定所有的字母都是小写字母,示例:
canConstruct("a", "b") -> false
canConstruct("aa", "ab") -> false
canConstruct("aa", "aab") -> true
### 问题分析
1. 杂志必须包含勒索信的所有字母;
2. 杂志单个字母只能使用一次;
这个问题,最简单的想法就是逐一的遍历勒索信和杂志字母,以下提供三种解法:
解法一:将ransomNote的字符串挨个遍历,每个字符再从magazine里遍历匹配,只是再创建了个byte数组,数组每个元素的索引表示magazine字符串的位置,元素值表示是否被校验过,0表示还未被校验过,非0就表示该位置已经被校验过。不过这种做法效率不高。
解法二:将ransomNote和magazine都从小到大排序,然后对ransomNote遍历,同时在magazine中匹配,如果匹配到了,则记住此时magazine中字符的索引,便于下次操作,因为都是排序的。如果直到magazine中字符已经大于ransomNote中字符了,就说明就再也匹配不到了,则表示匹配失败。
解法三:LeetCode Discuss中的最热代码,它的原理是列出了magazine的字母表,然后算出了出现个数,然后遍历ransomNote,保证有足够的字母可用,代码非常清晰。
### 问题解答(java示例)
解法一:
public boolean canConstruct(String ransomNote, String magazine) {
boolean ret = true;
byte[] bytes = new byte[magazine.length()];
for (int i = 0; i < ransomNote.length(); i++) {
char c = ransomNote.charAt(i);
boolean found = false;
for (int j = 0; j < magazine.length(); j++) {
if (bytes[j] == 0 && magazine.charAt(j) == c) {
bytes[j]++;
found = true;
break;
}
}
if (!found) {
ret = false;
break;
}
}
return ret;
}
解法二:
public boolean canConstruct(String ransomNote, String magazine) {
boolean ret = true;
char[] ra = ransomNote.toCharArray();
Arrays.sort(ra);
char[] ma = magazine.toCharArray();
Arrays.sort(ma);
int index = 0;
boolean found = true;
for (int i = 0; i < ra.length && ret; i++) {
char ri = ra[i];
found = false;
for (int j = index; j < ma.length; j++) {
if (ma[j] > ri) {
ret = false;
break;
} else if (ma[j] == ri) {
index++;
found = true;
break;
} else {
index++;
}
}
if (!found) {
ret = false;
break;
}
}
return ret;
}
解法三:
public boolean canConstruct(String ransomNote, String magazine) {
int[] arr = new int[26];
for (int i = 0; i < magazine.length(); i++) {
arr[magazine.charAt(i) - 'a']++;
}
for (int i = 0; i < ransomNote.length(); i++) {
if(--arr[ransomNote.charAt(i)-'a'] < 0) {
return false;
}
}
return true;
}
### 后记
练习源码地址:[https://github.com/Zering/LeetCode](https://github.com/Zering/LeetCode)
|
Java
|
package com.yuzhou.viewer.service;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import android.widget.Toast;
import com.google.common.eventbus.EventBus;
import com.loopj.android.http.JsonHttpResponseHandler;
import com.loopj.android.http.SyncHttpClient;
import com.yuzhou.viewer.R;
import com.yuzhou.viewer.model.GoogleImage;
import com.yuzhou.viewer.model.GoogleImageFactory;
import org.apache.http.Header;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
/**
* Created by yuzhou on 2015/08/02.
*/
public class GoogleApiTask extends AsyncTask<ApiParam, Integer, List<GoogleImage>>
{
private final SyncHttpClient client = new SyncHttpClient();
private final List<GoogleImage> items = new ArrayList<>();
private final EventBus eventBus;
private final Context context;
private int errorResource;
public GoogleApiTask(EventBus eventBus, Context context)
{
this.eventBus = eventBus;
this.context = context;
}
private List<GoogleImage> interExecute(ApiParam request)
{
Log.d("VIEWER", request.toString());
client.get(request.getUrl(), request.getParams(), new JsonHttpResponseHandler()
{
@Override
public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject response)
{
Log.i("VIEWER", "status code=" + statusCode + ", response=" + response + ", error=" + throwable.getMessage());
errorResource = R.string.error_unavailable_network;
}
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response)
{
if (response == null) {
Log.i("VIEWER", "Response no context");
errorResource = R.string.error_server_side;
return;
}
try {
int httpCode = response.getInt("responseStatus");
if (httpCode == 400) {
errorResource = R.string.error_data_not_found;
Log.d("VIEWER", "response=" + response.getString("responseDetails"));
return;
}
if (httpCode != 200) {
errorResource = R.string.error_server_side;
Log.d("VIEWER", "response=" + response.getString("responseDetails"));
return;
}
List<GoogleImage> images = GoogleImageFactory.create(response);
if (images.isEmpty()) {
Log.i("VIEWER", "Can not parse JSON");
Log.d("VIEWER", "response=" + response.toString());
errorResource = R.string.error_server_side;
return;
}
items.addAll(images);
} catch (JSONException e) {
Log.i("VIEWER", "Can not parse JSON");
e.printStackTrace();
}
}
});
return items;
}
@Override
protected List<GoogleImage> doInBackground(ApiParam... requests)
{
ApiParam request = requests[0];
return interExecute(request);
}
@Override
protected void onPreExecute()
{
items.clear();
}
@Override
protected void onPostExecute(List<GoogleImage> googleImages)
{
if (errorResource > 0) {
Toast.makeText(context, errorResource, Toast.LENGTH_LONG).show();
}
eventBus.post(items);
}
}
|
Java
|
<?php
/**
* Smarty Internal Plugin Compile Insert
*
* Compiles the {insert} tag
*
* @package Smarty
* @subpackage Compiler
* @author Uwe Tews
*/
/**
* Smarty Internal Plugin Compile Insert Class
*
* @package Smarty
* @subpackage Compiler
*/
class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase {
/**
* Attribute definition: Overwrites base class.
*
* @var array
* @see Smarty_Internal_CompileBase
*/
public $required_attributes = array('name');
/**
* Attribute definition: Overwrites base class.
*
* @var array
* @see Smarty_Internal_CompileBase
*/
public $shorttag_order = array('name');
/**
* Attribute definition: Overwrites base class.
*
* @var array
* @see Smarty_Internal_CompileBase
*/
public $optional_attributes = array('_any');
/**
* Compiles code for the {insert} tag
*
* @param array $args array with attributes from parser
* @param object $compiler compiler object
*
* @return string compiled code
*/
public function compile($args, $compiler) {
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
// never compile as nocache code
$compiler->suppressNocacheProcessing = true;
$compiler->tag_nocache = true;
$_smarty_tpl = $compiler->template;
$_name = null;
$_script = null;
$_output = '<?php ';
// save posible attributes
eval('$_name = ' . $_attr['name'] . ';');
if (isset($_attr['assign']))
{
// output will be stored in a smarty variable instead of being displayed
$_assign = $_attr['assign'];
// create variable to make shure that the compiler knows about its nocache status
$compiler->template->tpl_vars[trim($_attr['assign'], "'")] = new Smarty_Variable(null, true);
}
if (isset($_attr['script']))
{
// script which must be included
$_function = "smarty_insert_{$_name}";
$_smarty_tpl = $compiler->template;
$_filepath = false;
eval('$_script = ' . $_attr['script'] . ';');
if (!isset($compiler->smarty->security_policy) && file_exists($_script))
{
$_filepath = $_script;
}
else
{
if (isset($compiler->smarty->security_policy))
{
$_dir = $compiler->smarty->security_policy->trusted_dir;
}
else
{
$_dir = $compiler->smarty->trusted_dir;
}
if (!empty($_dir))
{
foreach ((array)$_dir as $_script_dir)
{
$_script_dir = rtrim($_script_dir, '/\\') . DS;
if (file_exists($_script_dir . $_script))
{
$_filepath = $_script_dir . $_script;
break;
}
}
}
}
if ($_filepath == false)
{
$compiler->trigger_template_error("{insert} missing script file '{$_script}'", $compiler->lex->taglineno);
}
// code for script file loading
$_output .= "require_once '{$_filepath}' ;";
require_once $_filepath;
if (!is_callable($_function))
{
$compiler->trigger_template_error(" {insert} function '{$_function}' is not callable in script file '{$_script}'", $compiler->lex->taglineno);
}
}
else
{
$_filepath = 'null';
$_function = "insert_{$_name}";
// function in PHP script ?
if (!is_callable($_function))
{
// try plugin
if (!$_function = $compiler->getPlugin($_name, 'insert'))
{
$compiler->trigger_template_error("{insert} no function or plugin found for '{$_name}'", $compiler->lex->taglineno);
}
}
}
// delete {insert} standard attributes
unset($_attr['name'], $_attr['assign'], $_attr['script'], $_attr['nocache']);
// convert attributes into parameter array string
$_paramsArray = array();
foreach ($_attr as $_key => $_value)
{
$_paramsArray[] = "'$_key' => $_value";
}
$_params = 'array(' . implode(", ", $_paramsArray) . ')';
// call insert
if (isset($_assign))
{
if ($_smarty_tpl->caching)
{
$_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}',{$_assign});?>";
}
else
{
$_output .= "\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\$_smarty_tpl), true);?>";
}
}
else
{
$compiler->has_output = true;
if ($_smarty_tpl->caching)
{
$_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}');?>";
}
else
{
$_output .= "echo {$_function}({$_params},\$_smarty_tpl);?>";
}
}
return $_output;
}
}
?>
|
Java
|
ChromeTabDisguise
=================
A simple tool to disguise Chrome Tab's favicon and title.
|
Java
|
package com.rockhoppertech.music.fx.cmn;
/*
* #%L
* rockymusic-fx
* %%
* Copyright (C) 1996 - 2013 Rockhopper Technologies
* %%
* 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%
*/
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.SceneBuilder;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.stage.Screen;
import javafx.stage.Stage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author <a href="http://genedelisa.com/">Gene De Lisa</a>
*
*/
public class GrandStaffApp extends Application {
private static final Logger logger = LoggerFactory
.getLogger(GrandStaffApp.class);
private Stage stage;
private Scene scene;
private Pane root;
private GrandStaffAppController controller;
public static void main(String[] args) throws Exception {
launch(args);
}
void loadRootFxml() {
String fxmlFile = "/fxml/GrandStaffPanel.fxml";
logger.debug("Loading FXML for main view from: {}", fxmlFile);
try {
FXMLLoader loader = new FXMLLoader(
GrandStaffApp.class.getResource(fxmlFile));
root = (AnchorPane) loader.load();
controller = loader.getController();
} catch (IOException e) {
logger.error(e.getLocalizedMessage(),e);
}
}
@Override
public void start(Stage stage) throws Exception {
this.stage = stage;
// this.staffModel = new StaffModel();
// MIDITrack track = MIDITrackBuilder
// .create()
// .noteString(
// "E5 F G Ab G# A B C C6 D Eb F# G A B C7 B4 Bf4 A4 Af4")
// .durations(5, 4, 3, 2, 1, 1.5, .5, .75, .25, .25)
// .sequential()
// .build();
// this.staffModel.setTrack(track);
loadRootFxml();
this.scene = SceneBuilder.create()
.root(root)
.fill(Color.web("#1030F0"))
.stylesheets("/styles/grandStaffApp.css")
.build();
this.configureStage();
logger.debug("started");
}
private void configureStage() {
stage.setTitle("Music Notation");
// fullScreen();
stage.setScene(this.scene);
stage.show();
}
private void fullScreen() {
// make it full screen
stage.setX(0);
stage.setY(0);
stage.setWidth(Screen.getPrimary().getVisualBounds().getWidth());
stage.setHeight(Screen.getPrimary().getVisualBounds().getHeight());
}
}
|
Java
|
function htmlEncode(value){
return $('<div/>').text(value).html();
}
var app = angular.module("oasassets",[]).controller("snippetsController",function($scope){
$scope.snippet = function(item){
var elem = $("#"+item);
var contents = elem.html().trim();
elem.html(htmlEncode(contents));
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
};
$scope.loadMenu = function(){
$('#side-menu').metisMenu();
};
});
|
Java
|
package org.tuxdevelop.spring.batch.lightmin.server.cluster.configuration;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
@Data
@ConfigurationProperties(prefix = "spring.batch.lightmin.server.cluster.infinispan")
public class InfinispanServerClusterConfigurationProperties {
@NestedConfigurationProperty
private RepositoryConfigurationProperties repository = new RepositoryConfigurationProperties();
@Data
static class RepositoryConfigurationProperties {
private Boolean initSchedulerExecutionRepository = Boolean.FALSE;
private Boolean initSchedulerConfigurationRepository = Boolean.FALSE;
}
}
|
Java
|
<?php
$this->Nm_lang_conf_region = array();
$this->Nm_lang_conf_region['en_us;en_us'] = "English (United States)";
$this->Nm_lang_conf_region['es;es_es'] = "Spanish (Spain)";
$this->Nm_lang_conf_region['pt_br;pt_br'] = "Portuguese (Brazil)";
ksort($this->Nm_lang_conf_region);
?>
|
Java
|
<?php
/************************
Example Client App for inserting categories
*************************/
// Make sure we're being called from the command line, not a web interface
if (PHP_SAPI !== 'cli')
{
die('This is a command line only application.');
}
// We are a valid entry point.
const _JEXEC = 1;
error_reporting(E_ALL | E_NOTICE);
ini_set('display_errors', 1);
// Load system defines
if (file_exists(dirname(__DIR__) . '/defines.php'))
{
require_once dirname(__DIR__) . '/defines.php';
}
if (!defined('_JDEFINES'))
{
define('JPATH_BASE', dirname(__DIR__));
require_once JPATH_BASE . '/includes/defines.php';
}
require_once JPATH_LIBRARIES . '/import.legacy.php';
require_once JPATH_LIBRARIES . '/cms.php';
// Load the configuration
require_once JPATH_CONFIGURATION . '/configuration.php';
// ----------------------
class InsertCatExampleCli extends JApplicationCli {
public function __construct() {
parent::__construct();
$this->config = new JConfig();
$this->dbo = JDatabase::getInstance(
array(
'driver' => $this->config->dbtype,
'host' => $this->config->host,
'user' => $this->config->user,
'password' => $this->config->password,
'database' => $this->config->db,
'prefix' => $this->config->dbprefix,
)
);
// important for storing several rows
JFactory::$application = $this;
}
public function doExecute() {
$category_titles = array("Test Title 1", "Test Title 2", "Test Title 3");
// add categories to database
for ($i=0; $i<count($category_titles); $i++) {
$this->insertCategory($category_titles[$i]);
}
}
private function insertCategory($cat_title) {
$tbl_cat = JTable::getInstance("Category");
// get existing aliases from categories table
$tab = $this->dbo->quoteName($this->config->dbprefix . "categories");
$conditions = array(
$this->dbo->quoteName("extension") . " LIKE 'com_content'"
);
$query = $this->dbo->getQuery(true);
$query
->select($this->dbo->quoteName("alias"))
->from($tab)
->where($conditions);
$this->dbo->setQuery($query);
$cat_from_db = $this->dbo->loadObjectList();
$category_existing = False;
$new_cat_alias = JFilterOutput::stringURLSafe($cat_title);
foreach ($cat_from_db as $cdb) {
if ($cdb->alias == $new_cat_alias) {
$category_existing = True;
echo "category already existing: " . $new_cat_alias . "\n";
}
}
// ----------------
if (!$category_existing) {
$values = [
"id" => null,
"title" => $cat_title,
"path" => $new_cat_alias,
"access" => 1,
"extension" => "com_content",
"published" => 1,
"language" => "*",
"created_user_id" => 0,
"params" => array (
"category_layout" => "",
"image" => "",
),
"metadata" => array (
"author" => "",
"robots" => "",
),
];
$tbl_cat->setLocation(1, "last-child");
if (!$tbl_cat->bind($values)) {
JError::raiseWarning(500, $row->getError());
return FALSE;
}
if (!$tbl_cat->check()) {
JError::raiseError(500, $article->getError());
return FALSE;
}
if (!$tbl_cat->store(TRUE)) {
JError::raiseError(500, $article->getError());
return FALSE;
}
$tbl_cat->rebuildPath($tbl_cat->id);
echo "category inserted: " . $tbl_cat->id . " - " . $new_cat_alias . "\n";
}
}
}
try {
JApplicationCli::getInstance('InsertCatExampleCli')->execute();
}
catch (Exception $e) {
// An exception has been caught, just echo the message.
fwrite(STDOUT, $e->getMessage() . "\n");
exit($e->getCode());
}
?>
|
Java
|
# Annotations
You can add these Kubernetes annotations to specific Ingress objects to customize their behavior.
!!! tip
Annotation keys and values can only be strings.
Other types, such as boolean or numeric values must be quoted,
i.e. `"true"`, `"false"`, `"100"`.
!!! note
The annotation prefix can be changed using the
[`--annotations-prefix` command line argument](../cli-arguments.md),
but the default is `nginx.ingress.kubernetes.io`, as described in the
table below.
|Name | type |
|---------------------------|------|
|[nginx.ingress.kubernetes.io/app-root](#rewrite)|string|
|[nginx.ingress.kubernetes.io/affinity](#session-affinity)|cookie|
|[nginx.ingress.kubernetes.io/affinity-mode](#session-affinity)|"balanced" or "persistent"|
|[nginx.ingress.kubernetes.io/affinity-canary-behavior](#session-affinity)|"sticky" or "legacy"|
|[nginx.ingress.kubernetes.io/auth-realm](#authentication)|string|
|[nginx.ingress.kubernetes.io/auth-secret](#authentication)|string|
|[nginx.ingress.kubernetes.io/auth-secret-type](#authentication)|string|
|[nginx.ingress.kubernetes.io/auth-type](#authentication)|basic or digest|
|[nginx.ingress.kubernetes.io/auth-tls-secret](#client-certificate-authentication)|string|
|[nginx.ingress.kubernetes.io/auth-tls-verify-depth](#client-certificate-authentication)|number|
|[nginx.ingress.kubernetes.io/auth-tls-verify-client](#client-certificate-authentication)|string|
|[nginx.ingress.kubernetes.io/auth-tls-error-page](#client-certificate-authentication)|string|
|[nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream](#client-certificate-authentication)|"true" or "false"|
|[nginx.ingress.kubernetes.io/auth-url](#external-authentication)|string|
|[nginx.ingress.kubernetes.io/auth-cache-key](#external-authentication)|string|
|[nginx.ingress.kubernetes.io/auth-cache-duration](#external-authentication)|string|
|[nginx.ingress.kubernetes.io/auth-proxy-set-headers](#external-authentication)|string|
|[nginx.ingress.kubernetes.io/auth-snippet](#external-authentication)|string|
|[nginx.ingress.kubernetes.io/enable-global-auth](#external-authentication)|"true" or "false"|
|[nginx.ingress.kubernetes.io/backend-protocol](#backend-protocol)|string|HTTP,HTTPS,GRPC,GRPCS,AJP|
|[nginx.ingress.kubernetes.io/canary](#canary)|"true" or "false"|
|[nginx.ingress.kubernetes.io/canary-by-header](#canary)|string|
|[nginx.ingress.kubernetes.io/canary-by-header-value](#canary)|string|
|[nginx.ingress.kubernetes.io/canary-by-header-pattern](#canary)|string|
|[nginx.ingress.kubernetes.io/canary-by-cookie](#canary)|string|
|[nginx.ingress.kubernetes.io/canary-weight](#canary)|number|
|[nginx.ingress.kubernetes.io/client-body-buffer-size](#client-body-buffer-size)|string|
|[nginx.ingress.kubernetes.io/configuration-snippet](#configuration-snippet)|string|
|[nginx.ingress.kubernetes.io/custom-http-errors](#custom-http-errors)|[]int|
|[nginx.ingress.kubernetes.io/default-backend](#default-backend)|string|
|[nginx.ingress.kubernetes.io/enable-cors](#enable-cors)|"true" or "false"|
|[nginx.ingress.kubernetes.io/cors-allow-origin](#enable-cors)|string|
|[nginx.ingress.kubernetes.io/cors-allow-methods](#enable-cors)|string|
|[nginx.ingress.kubernetes.io/cors-allow-headers](#enable-cors)|string|
|[nginx.ingress.kubernetes.io/cors-expose-headers](#enable-cors)|string|
|[nginx.ingress.kubernetes.io/cors-allow-credentials](#enable-cors)|"true" or "false"|
|[nginx.ingress.kubernetes.io/cors-max-age](#enable-cors)|number|
|[nginx.ingress.kubernetes.io/force-ssl-redirect](#server-side-https-enforcement-through-redirect)|"true" or "false"|
|[nginx.ingress.kubernetes.io/from-to-www-redirect](#redirect-fromto-www)|"true" or "false"|
|[nginx.ingress.kubernetes.io/http2-push-preload](#http2-push-preload)|"true" or "false"|
|[nginx.ingress.kubernetes.io/limit-connections](#rate-limiting)|number|
|[nginx.ingress.kubernetes.io/limit-rps](#rate-limiting)|number|
|[nginx.ingress.kubernetes.io/global-rate-limit](#global-rate-limiting)|number|
|[nginx.ingress.kubernetes.io/global-rate-limit-window](#global-rate-limiting)|duration|
|[nginx.ingress.kubernetes.io/global-rate-limit-key](#global-rate-limiting)|string|
|[nginx.ingress.kubernetes.io/global-rate-limit-ignored-cidrs](#global-rate-limiting)|string|
|[nginx.ingress.kubernetes.io/permanent-redirect](#permanent-redirect)|string|
|[nginx.ingress.kubernetes.io/permanent-redirect-code](#permanent-redirect-code)|number|
|[nginx.ingress.kubernetes.io/temporal-redirect](#temporal-redirect)|string|
|[nginx.ingress.kubernetes.io/preserve-trailing-slash](#server-side-https-enforcement-through-redirect)|"true" or "false"|
|[nginx.ingress.kubernetes.io/proxy-body-size](#custom-max-body-size)|string|
|[nginx.ingress.kubernetes.io/proxy-cookie-domain](#proxy-cookie-domain)|string|
|[nginx.ingress.kubernetes.io/proxy-cookie-path](#proxy-cookie-path)|string|
|[nginx.ingress.kubernetes.io/proxy-connect-timeout](#custom-timeouts)|number|
|[nginx.ingress.kubernetes.io/proxy-send-timeout](#custom-timeouts)|number|
|[nginx.ingress.kubernetes.io/proxy-read-timeout](#custom-timeouts)|number|
|[nginx.ingress.kubernetes.io/proxy-next-upstream](#custom-timeouts)|string|
|[nginx.ingress.kubernetes.io/proxy-next-upstream-timeout](#custom-timeouts)|number|
|[nginx.ingress.kubernetes.io/proxy-next-upstream-tries](#custom-timeouts)|number|
|[nginx.ingress.kubernetes.io/proxy-request-buffering](#custom-timeouts)|string|
|[nginx.ingress.kubernetes.io/proxy-redirect-from](#proxy-redirect)|string|
|[nginx.ingress.kubernetes.io/proxy-redirect-to](#proxy-redirect)|string|
|[nginx.ingress.kubernetes.io/proxy-http-version](#proxy-http-version)|"1.0" or "1.1"|
|[nginx.ingress.kubernetes.io/proxy-ssl-secret](#backend-certificate-authentication)|string|
|[nginx.ingress.kubernetes.io/proxy-ssl-ciphers](#backend-certificate-authentication)|string|
|[nginx.ingress.kubernetes.io/proxy-ssl-name](#backend-certificate-authentication)|string|
|[nginx.ingress.kubernetes.io/proxy-ssl-protocols](#backend-certificate-authentication)|string|
|[nginx.ingress.kubernetes.io/proxy-ssl-verify](#backend-certificate-authentication)|string|
|[nginx.ingress.kubernetes.io/proxy-ssl-verify-depth](#backend-certificate-authentication)|number|
|[nginx.ingress.kubernetes.io/proxy-ssl-server-name](#backend-certificate-authentication)|string|
|[nginx.ingress.kubernetes.io/enable-rewrite-log](#enable-rewrite-log)|"true" or "false"|
|[nginx.ingress.kubernetes.io/rewrite-target](#rewrite)|URI|
|[nginx.ingress.kubernetes.io/satisfy](#satisfy)|string|
|[nginx.ingress.kubernetes.io/server-alias](#server-alias)|string|
|[nginx.ingress.kubernetes.io/server-snippet](#server-snippet)|string|
|[nginx.ingress.kubernetes.io/service-upstream](#service-upstream)|"true" or "false"|
|[nginx.ingress.kubernetes.io/session-cookie-name](#cookie-affinity)|string|
|[nginx.ingress.kubernetes.io/session-cookie-path](#cookie-affinity)|string|
|[nginx.ingress.kubernetes.io/session-cookie-change-on-failure](#cookie-affinity)|"true" or "false"|
|[nginx.ingress.kubernetes.io/session-cookie-samesite](#cookie-affinity)|string|
|[nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none](#cookie-affinity)|"true" or "false"|
|[nginx.ingress.kubernetes.io/ssl-redirect](#server-side-https-enforcement-through-redirect)|"true" or "false"|
|[nginx.ingress.kubernetes.io/ssl-passthrough](#ssl-passthrough)|"true" or "false"|
|[nginx.ingress.kubernetes.io/upstream-hash-by](#custom-nginx-upstream-hashing)|string|
|[nginx.ingress.kubernetes.io/x-forwarded-prefix](#x-forwarded-prefix-header)|string|
|[nginx.ingress.kubernetes.io/load-balance](#custom-nginx-load-balancing)|string|
|[nginx.ingress.kubernetes.io/upstream-vhost](#custom-nginx-upstream-vhost)|string|
|[nginx.ingress.kubernetes.io/whitelist-source-range](#whitelist-source-range)|CIDR|
|[nginx.ingress.kubernetes.io/proxy-buffering](#proxy-buffering)|string|
|[nginx.ingress.kubernetes.io/proxy-buffers-number](#proxy-buffers-number)|number|
|[nginx.ingress.kubernetes.io/proxy-buffer-size](#proxy-buffer-size)|string|
|[nginx.ingress.kubernetes.io/proxy-max-temp-file-size](#proxy-max-temp-file-size)|string|
|[nginx.ingress.kubernetes.io/ssl-ciphers](#ssl-ciphers)|string|
|[nginx.ingress.kubernetes.io/ssl-prefer-server-ciphers](#ssl-ciphers)|"true" or "false"|
|[nginx.ingress.kubernetes.io/connection-proxy-header](#connection-proxy-header)|string|
|[nginx.ingress.kubernetes.io/enable-access-log](#enable-access-log)|"true" or "false"|
|[nginx.ingress.kubernetes.io/enable-opentracing](#enable-opentracing)|"true" or "false"|
|[nginx.ingress.kubernetes.io/opentracing-trust-incoming-span](#opentracing-trust-incoming-span)|"true" or "false"|
|[nginx.ingress.kubernetes.io/enable-influxdb](#influxdb)|"true" or "false"|
|[nginx.ingress.kubernetes.io/influxdb-measurement](#influxdb)|string|
|[nginx.ingress.kubernetes.io/influxdb-port](#influxdb)|string|
|[nginx.ingress.kubernetes.io/influxdb-host](#influxdb)|string|
|[nginx.ingress.kubernetes.io/influxdb-server-name](#influxdb)|string|
|[nginx.ingress.kubernetes.io/use-regex](#use-regex)|bool|
|[nginx.ingress.kubernetes.io/enable-modsecurity](#modsecurity)|bool|
|[nginx.ingress.kubernetes.io/enable-owasp-core-rules](#modsecurity)|bool|
|[nginx.ingress.kubernetes.io/modsecurity-transaction-id](#modsecurity)|string|
|[nginx.ingress.kubernetes.io/modsecurity-snippet](#modsecurity)|string|
|[nginx.ingress.kubernetes.io/mirror-request-body](#mirror)|string|
|[nginx.ingress.kubernetes.io/mirror-target](#mirror)|string|
### Canary
In some cases, you may want to "canary" a new set of changes by sending a small number of requests to a different service than the production service. The canary annotation enables the Ingress spec to act as an alternative service for requests to route to depending on the rules applied. The following annotations to configure canary can be enabled after `nginx.ingress.kubernetes.io/canary: "true"` is set:
* `nginx.ingress.kubernetes.io/canary-by-header`: The header to use for notifying the Ingress to route the request to the service specified in the Canary Ingress. When the request header is set to `always`, it will be routed to the canary. When the header is set to `never`, it will never be routed to the canary. For any other value, the header will be ignored and the request compared against the other canary rules by precedence.
* `nginx.ingress.kubernetes.io/canary-by-header-value`: The header value to match for notifying the Ingress to route the request to the service specified in the Canary Ingress. When the request header is set to this value, it will be routed to the canary. For any other header value, the header will be ignored and the request compared against the other canary rules by precedence. This annotation has to be used together with . The annotation is an extension of the `nginx.ingress.kubernetes.io/canary-by-header` to allow customizing the header value instead of using hardcoded values. It doesn't have any effect if the `nginx.ingress.kubernetes.io/canary-by-header` annotation is not defined.
* `nginx.ingress.kubernetes.io/canary-by-header-pattern`: This works the same way as `canary-by-header-value` except it does PCRE Regex matching. Note that when `canary-by-header-value` is set this annotation will be ignored. When the given Regex causes error during request processing, the request will be considered as not matching.
* `nginx.ingress.kubernetes.io/canary-by-cookie`: The cookie to use for notifying the Ingress to route the request to the service specified in the Canary Ingress. When the cookie value is set to `always`, it will be routed to the canary. When the cookie is set to `never`, it will never be routed to the canary. For any other value, the cookie will be ignored and the request compared against the other canary rules by precedence.
* `nginx.ingress.kubernetes.io/canary-weight`: The integer based (0 - 100) percent of random requests that should be routed to the service specified in the canary Ingress. A weight of 0 implies that no requests will be sent to the service in the Canary ingress by this canary rule. A weight of 100 means implies all requests will be sent to the alternative service specified in the Ingress.
Canary rules are evaluated in order of precedence. Precedence is as follows:
`canary-by-header -> canary-by-cookie -> canary-weight`
**Note** that when you mark an ingress as canary, then all the other non-canary annotations will be ignored (inherited from the corresponding main ingress) except `nginx.ingress.kubernetes.io/load-balance`, `nginx.ingress.kubernetes.io/upstream-hash-by`, and [annotations related to session affinity](#session-affinity). If you want to restore the original behavior of canaries when session affinity was ignored, set `nginx.ingress.kubernetes.io/affinity-canary-behavior` annotation with value `legacy` on the canary ingress definition.
**Known Limitations**
Currently a maximum of one canary ingress can be applied per Ingress rule.
### Rewrite
In some scenarios the exposed URL in the backend service differs from the specified path in the Ingress rule. Without a rewrite any request will return 404.
Set the annotation `nginx.ingress.kubernetes.io/rewrite-target` to the path expected by the service.
If the Application Root is exposed in a different path and needs to be redirected, set the annotation `nginx.ingress.kubernetes.io/app-root` to redirect requests for `/`.
!!! example
Please check the [rewrite](../../examples/rewrite/README.md) example.
### Session Affinity
The annotation `nginx.ingress.kubernetes.io/affinity` enables and sets the affinity type in all Upstreams of an Ingress. This way, a request will always be directed to the same upstream server.
The only affinity type available for NGINX is `cookie`.
The annotation `nginx.ingress.kubernetes.io/affinity-mode` defines the stickiness of a session. Setting this to `balanced` (default) will redistribute some sessions if a deployment gets scaled up, therefore rebalancing the load on the servers. Setting this to `persistent` will not rebalance sessions to new servers, therefore providing maximum stickiness.
The annotation `nginx.ingress.kubernetes.io/affinity-canary-behavior` defines the behavior of canaries when session affinity is enabled. Setting this to `sticky` (default) will ensure that users that were served by canaries, will continue to be served by canaries. Setting this to `legacy` will restore original canary behavior, when session affinity was ignored.
!!! attention
If more than one Ingress is defined for a host and at least one Ingress uses `nginx.ingress.kubernetes.io/affinity: cookie`, then only paths on the Ingress using `nginx.ingress.kubernetes.io/affinity` will use session cookie affinity. All paths defined on other Ingresses for the host will be load balanced through the random selection of a backend server.
!!! example
Please check the [affinity](../../examples/affinity/cookie/README.md) example.
#### Cookie affinity
If you use the ``cookie`` affinity type you can also specify the name of the cookie that will be used to route the requests with the annotation `nginx.ingress.kubernetes.io/session-cookie-name`. The default is to create a cookie named 'INGRESSCOOKIE'.
The NGINX annotation `nginx.ingress.kubernetes.io/session-cookie-path` defines the path that will be set on the cookie. This is optional unless the annotation `nginx.ingress.kubernetes.io/use-regex` is set to true; Session cookie paths do not support regex.
Use `nginx.ingress.kubernetes.io/session-cookie-samesite` to apply a `SameSite` attribute to the sticky cookie. Browser accepted values are `None`, `Lax`, and `Strict`. Some browsers reject cookies with `SameSite=None`, including those created before the `SameSite=None` specification (e.g. Chrome 5X). Other browsers mistakenly treat `SameSite=None` cookies as `SameSite=Strict` (e.g. Safari running on OSX 14). To omit `SameSite=None` from browsers with these incompatibilities, add the annotation `nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true"`.
### Authentication
It is possible to add authentication by adding additional annotations in the Ingress rule. The source of the authentication is a secret that contains usernames and passwords.
The annotations are:
```
nginx.ingress.kubernetes.io/auth-type: [basic|digest]
```
Indicates the [HTTP Authentication Type: Basic or Digest Access Authentication](https://tools.ietf.org/html/rfc2617).
```
nginx.ingress.kubernetes.io/auth-secret: secretName
```
The name of the Secret that contains the usernames and passwords which are granted access to the `path`s defined in the Ingress rules.
This annotation also accepts the alternative form "namespace/secretName", in which case the Secret lookup is performed in the referenced namespace instead of the Ingress namespace.
```
nginx.ingress.kubernetes.io/auth-secret-type: [auth-file|auth-map]
```
The `auth-secret` can have two forms:
- `auth-file` - default, an htpasswd file in the key `auth` within the secret
- `auth-map` - the keys of the secret are the usernames, and the values are the hashed passwords
```
nginx.ingress.kubernetes.io/auth-realm: "realm string"
```
!!! example
Please check the [auth](../../examples/auth/basic/README.md) example.
### Custom NGINX upstream hashing
NGINX supports load balancing by client-server mapping based on [consistent hashing](http://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash) for a given key. The key can contain text, variables or any combination thereof. This feature allows for request stickiness other than client IP or cookies. The [ketama](https://www.last.fm/user/RJ/journal/2007/04/10/rz_libketama_-_a_consistent_hashing_algo_for_memcache_clients) consistent hashing method will be used which ensures only a few keys would be remapped to different servers on upstream group changes.
There is a special mode of upstream hashing called subset. In this mode, upstream servers are grouped into subsets, and stickiness works by mapping keys to a subset instead of individual upstream servers. Specific server is chosen uniformly at random from the selected sticky subset. It provides a balance between stickiness and load distribution.
To enable consistent hashing for a backend:
`nginx.ingress.kubernetes.io/upstream-hash-by`: the nginx variable, text value or any combination thereof to use for consistent hashing. For example: `nginx.ingress.kubernetes.io/upstream-hash-by: "$request_uri"` or `nginx.ingress.kubernetes.io/upstream-hash-by: "$request_uri$host"` or `nginx.ingress.kubernetes.io/upstream-hash-by: "${request_uri}-text-value"` to consistently hash upstream requests by the current request URI.
"subset" hashing can be enabled setting `nginx.ingress.kubernetes.io/upstream-hash-by-subset`: "true". This maps requests to subset of nodes instead of a single one. `upstream-hash-by-subset-size` determines the size of each subset (default 3).
Please check the [chashsubset](../../examples/chashsubset/deployment.yaml) example.
### Custom NGINX load balancing
This is similar to [`load-balance` in ConfigMap](./configmap.md#load-balance), but configures load balancing algorithm per ingress.
>Note that `nginx.ingress.kubernetes.io/upstream-hash-by` takes preference over this. If this and `nginx.ingress.kubernetes.io/upstream-hash-by` are not set then we fallback to using globally configured load balancing algorithm.
### Custom NGINX upstream vhost
This configuration setting allows you to control the value for host in the following statement: `proxy_set_header Host $host`, which forms part of the location block. This is useful if you need to call the upstream server by something other than `$host`.
### Client Certificate Authentication
It is possible to enable Client Certificate Authentication using additional annotations in Ingress Rule.
Client Certificate Authentication is applied per host and it is not possible to specify rules that differ for individual paths.
To enable, add the annotation `nginx.ingress.kubernetes.io/auth-tls-secret: namespace/secretName`. This secret must have a file named `ca.crt` containing the full Certificate Authority chain `ca.crt` that is enabled to authenticate against this Ingress.
You can further customize client certificate authentication and behaviour with these annotations:
* `nginx.ingress.kubernetes.io/auth-tls-verify-depth`: The validation depth between the provided client certificate and the Certification Authority chain. (default: 1)
* `nginx.ingress.kubernetes.io/auth-tls-verify-client`: Enables verification of client certificates. Possible values are:
* `on`: Request a client certificate that must be signed by a certificate that is included in the secret key `ca.crt` of the secret specified by `nginx.ingress.kubernetes.io/auth-tls-secret: namespace/secretName`. Failed certificate verification will result in a status code 400 (Bad Request) (default)
* `off`: Don't request client certificates and don't do client certificate verification.
* `optional`: Do optional client certificate validation against the CAs from `auth-tls-secret`. The request fails with status code 400 (Bad Request) when a certificate is provided that is not signed by the CA. When no or an otherwise invalid certificate is provided, the request does not fail, but instead the verification result is sent to the upstream service.
* `optional_no_ca`: Do optional client certificate validation, but do not fail the request when the client certificate is not signed by the CAs from `auth-tls-secret`. Certificate verification result is sent to the upstream service.
* `nginx.ingress.kubernetes.io/auth-tls-error-page`: The URL/Page that user should be redirected in case of a Certificate Authentication Error
* `nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream`: Indicates if the received certificates should be passed or not to the upstream server in the header `ssl-client-cert`. Possible values are "true" or "false" (default).
The following headers are sent to the upstream service according to the `auth-tls-*` annotations:
* `ssl-client-issuer-dn`: The issuer information of the client certificate. Example: "CN=My CA"
* `ssl-client-subject-dn`: The subject information of the client certificate. Example: "CN=My Client"
* `ssl-client-verify`: The result of the client verification. Possible values: "SUCCESS", "FAILED: <description, why the verification failed>"
* `ssl-client-cert`: The full client certificate in PEM format. Will only be sent when `nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream` is set to "true". Example: `-----BEGIN%20CERTIFICATE-----%0A...---END%20CERTIFICATE-----%0A`
!!! example
Please check the [client-certs](../../examples/auth/client-certs/README.md) example.
!!! attention
TLS with Client Authentication is **not** possible in Cloudflare and might result in unexpected behavior.
Cloudflare only allows Authenticated Origin Pulls and is required to use their own certificate: [https://blog.cloudflare.com/protecting-the-origin-with-tls-authenticated-origin-pulls/](https://blog.cloudflare.com/protecting-the-origin-with-tls-authenticated-origin-pulls/)
Only Authenticated Origin Pulls are allowed and can be configured by following their tutorial: [https://support.cloudflare.com/hc/en-us/articles/204494148-Setting-up-NGINX-to-use-TLS-Authenticated-Origin-Pulls](https://support.cloudflare.com/hc/en-us/articles/204494148-Setting-up-NGINX-to-use-TLS-Authenticated-Origin-Pulls)
### Backend Certificate Authentication
It is possible to authenticate to a proxied HTTPS backend with certificate using additional annotations in Ingress Rule.
* `nginx.ingress.kubernetes.io/proxy-ssl-secret: secretName`:
Specifies a Secret with the certificate `tls.crt`, key `tls.key` in PEM format used for authentication to a proxied HTTPS server. It should also contain trusted CA certificates `ca.crt` in PEM format used to verify the certificate of the proxied HTTPS server.
This annotation expects the Secret name in the form "namespace/secretName".
* `nginx.ingress.kubernetes.io/proxy-ssl-verify`:
Enables or disables verification of the proxied HTTPS server certificate. (default: off)
* `nginx.ingress.kubernetes.io/proxy-ssl-verify-depth`:
Sets the verification depth in the proxied HTTPS server certificates chain. (default: 1)
* `nginx.ingress.kubernetes.io/proxy-ssl-ciphers`:
Specifies the enabled [ciphers](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_ciphers) for requests to a proxied HTTPS server. The ciphers are specified in the format understood by the OpenSSL library.
* `nginx.ingress.kubernetes.io/proxy-ssl-name`:
Allows to set [proxy_ssl_name](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_name). This allows overriding the server name used to verify the certificate of the proxied HTTPS server. This value is also passed through SNI when a connection is established to the proxied HTTPS server.
* `nginx.ingress.kubernetes.io/proxy-ssl-protocols`:
Enables the specified [protocols](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_protocols) for requests to a proxied HTTPS server.
* `nginx.ingress.kubernetes.io/proxy-ssl-server-name`:
Enables passing of the server name through TLS Server Name Indication extension (SNI, RFC 6066) when establishing a connection with the proxied HTTPS server.
### Configuration snippet
Using this annotation you can add additional configuration to the NGINX location. For example:
```yaml
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "Request-Id: $req_id";
```
Be aware this can be dangerous in multi-tenant clusters, as it can lead to people with otherwise limited permissions being able to retrieve all secrets on the cluster. The recommended mitigation for this threat is to disable this feature, so it may not work for you. See CVE-2021-25742 and the [related issue on github](https://github.com/kubernetes/ingress-nginx/issues/7837) for more information.
### Custom HTTP Errors
Like the [`custom-http-errors`](./configmap.md#custom-http-errors) value in the ConfigMap, this annotation will set NGINX `proxy-intercept-errors`, but only for the NGINX location associated with this ingress. If a [default backend annotation](#default-backend) is specified on the ingress, the errors will be routed to that annotation's default backend service (instead of the global default backend).
Different ingresses can specify different sets of error codes. Even if multiple ingress objects share the same hostname, this annotation can be used to intercept different error codes for each ingress (for example, different error codes to be intercepted for different paths on the same hostname, if each path is on a different ingress).
If `custom-http-errors` is also specified globally, the error values specified in this annotation will override the global value for the given ingress' hostname and path.
Example usage:
```
nginx.ingress.kubernetes.io/custom-http-errors: "404,415"
```
### Default Backend
This annotation is of the form `nginx.ingress.kubernetes.io/default-backend: <svc name>` to specify a custom default backend. This `<svc name>` is a reference to a service inside of the same namespace in which you are applying this annotation. This annotation overrides the global default backend. In case the service has [multiple ports](https://kubernetes.io/docs/concepts/services-networking/service/#multi-port-services), the first one is the one which will received the backend traffic.
This service will be used to handle the response when the configured service in the Ingress rule does not have any active endpoints. It will also be used to handle the error responses if both this annotation and the [custom-http-errors annotation](#custom-http-errors) are set.
### Enable CORS
To enable Cross-Origin Resource Sharing (CORS) in an Ingress rule, add the annotation
`nginx.ingress.kubernetes.io/enable-cors: "true"`. This will add a section in the server
location enabling this functionality.
CORS can be controlled with the following annotations:
* `nginx.ingress.kubernetes.io/cors-allow-methods`: Controls which methods are accepted.
This is a multi-valued field, separated by ',' and accepts only letters (upper and lower case).
- Default: `GET, PUT, POST, DELETE, PATCH, OPTIONS`
- Example: `nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, OPTIONS"`
* `nginx.ingress.kubernetes.io/cors-allow-headers`: Controls which headers are accepted.
This is a multi-valued field, separated by ',' and accepts letters, numbers, _ and -.
- Default: `DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization`
- Example: `nginx.ingress.kubernetes.io/cors-allow-headers: "X-Forwarded-For, X-app123-XPTO"`
* `nginx.ingress.kubernetes.io/cors-expose-headers`: Controls which headers are exposed to response.
This is a multi-valued field, separated by ',' and accepts letters, numbers, _, - and *.
- Default: *empty*
- Example: `nginx.ingress.kubernetes.io/cors-expose-headers: "*, X-CustomResponseHeader"`
* `nginx.ingress.kubernetes.io/cors-allow-origin`: Controls what's the accepted Origin for CORS.
This is a multi-valued field, separated by ','. It must follow this format: `http(s)://origin-site.com` or `http(s)://origin-site.com:port`
- Default: `*`
- Example: `nginx.ingress.kubernetes.io/cors-allow-origin: "https://origin-site.com:4443, http://origin-site.com, https://example.org:1199"`
It also supports single level wildcard subdomains and follows this format: `http(s)://*.foo.bar`, `http(s)://*.bar.foo:8080` or `http(s)://*.abc.bar.foo:9000`
- Example: `nginx.ingress.kubernetes.io/cors-allow-origin: "https://*.origin-site.com:4443, http://*.origin-site.com, https://example.org:1199"`
* `nginx.ingress.kubernetes.io/cors-allow-credentials`: Controls if credentials can be passed during CORS operations.
- Default: `true`
- Example: `nginx.ingress.kubernetes.io/cors-allow-credentials: "false"`
* `nginx.ingress.kubernetes.io/cors-max-age`: Controls how long preflight requests can be cached.
- Default: `1728000`
- Example: `nginx.ingress.kubernetes.io/cors-max-age: 600`
!!! note
For more information please see [https://enable-cors.org](https://enable-cors.org/server_nginx.html)
### HTTP2 Push Preload.
Enables automatic conversion of preload links specified in the “Link” response header fields into push requests.
!!! example
* `nginx.ingress.kubernetes.io/http2-push-preload: "true"`
### Server Alias
Allows the definition of one or more aliases in the server definition of the NGINX configuration using the annotation `nginx.ingress.kubernetes.io/server-alias: "<alias 1>,<alias 2>"`.
This will create a server with the same configuration, but adding new values to the `server_name` directive.
!!! note
A server-alias name cannot conflict with the hostname of an existing server. If it does, the server-alias annotation will be ignored.
If a server-alias is created and later a new server with the same hostname is created, the new server configuration will take
place over the alias configuration.
For more information please see [the `server_name` documentation](http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name).
### Server snippet
Using the annotation `nginx.ingress.kubernetes.io/server-snippet` it is possible to add custom configuration in the server configuration block.
```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/server-snippet: |
set $agentflag 0;
if ($http_user_agent ~* "(Mobile)" ){
set $agentflag 1;
}
if ( $agentflag = 1 ) {
return 301 https://m.example.com;
}
```
!!! attention
This annotation can be used only once per host.
### Client Body Buffer Size
Sets buffer size for reading client request body per location. In case the request body is larger than the buffer,
the whole body or only its part is written to a temporary file. By default, buffer size is equal to two memory pages.
This is 8K on x86, other 32-bit platforms, and x86-64. It is usually 16K on other 64-bit platforms. This annotation is
applied to each location provided in the ingress rule.
!!! note
The annotation value must be given in a format understood by Nginx.
!!! example
* `nginx.ingress.kubernetes.io/client-body-buffer-size: "1000"` # 1000 bytes
* `nginx.ingress.kubernetes.io/client-body-buffer-size: 1k` # 1 kilobyte
* `nginx.ingress.kubernetes.io/client-body-buffer-size: 1K` # 1 kilobyte
* `nginx.ingress.kubernetes.io/client-body-buffer-size: 1m` # 1 megabyte
* `nginx.ingress.kubernetes.io/client-body-buffer-size: 1M` # 1 megabyte
For more information please see [http://nginx.org](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_buffer_size)
### External Authentication
To use an existing service that provides authentication the Ingress rule can be annotated with `nginx.ingress.kubernetes.io/auth-url` to indicate the URL where the HTTP request should be sent.
```yaml
nginx.ingress.kubernetes.io/auth-url: "URL to the authentication service"
```
Additionally it is possible to set:
* `nginx.ingress.kubernetes.io/auth-method`:
`<Method>` to specify the HTTP method to use.
* `nginx.ingress.kubernetes.io/auth-signin`:
`<SignIn_URL>` to specify the location of the error page.
* `nginx.ingress.kubernetes.io/auth-signin-redirect-param`:
`<SignIn_URL>` to specify the URL parameter in the error page which should contain the original URL for a failed signin request.
* `nginx.ingress.kubernetes.io/auth-response-headers`:
`<Response_Header_1, ..., Response_Header_n>` to specify headers to pass to backend once authentication request completes.
* `nginx.ingress.kubernetes.io/auth-proxy-set-headers`:
`<ConfigMap>` the name of a ConfigMap that specifies headers to pass to the authentication service
* `nginx.ingress.kubernetes.io/auth-request-redirect`:
`<Request_Redirect_URL>` to specify the X-Auth-Request-Redirect header value.
* `nginx.ingress.kubernetes.io/auth-cache-key`:
`<Cache_Key>` this enables caching for auth requests. specify a lookup key for auth responses. e.g. `$remote_user$http_authorization`. Each server and location has it's own keyspace. Hence a cached response is only valid on a per-server and per-location basis.
* `nginx.ingress.kubernetes.io/auth-cache-duration`:
`<Cache_duration>` to specify a caching time for auth responses based on their response codes, e.g. `200 202 30m`. See [proxy_cache_valid](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid) for details. You may specify multiple, comma-separated values: `200 202 10m, 401 5m`. defaults to `200 202 401 5m`.
* `nginx.ingress.kubernetes.io/auth-snippet`:
`<Auth_Snippet>` to specify a custom snippet to use with external authentication, e.g.
```yaml
nginx.ingress.kubernetes.io/auth-url: http://foo.com/external-auth
nginx.ingress.kubernetes.io/auth-snippet: |
proxy_set_header Foo-Header 42;
```
> Note: `nginx.ingress.kubernetes.io/auth-snippet` is an optional annotation. However, it may only be used in conjunction with `nginx.ingress.kubernetes.io/auth-url` and will be ignored if `nginx.ingress.kubernetes.io/auth-url` is not set
!!! example
Please check the [external-auth](../../examples/auth/external-auth/README.md) example.
#### Global External Authentication
By default the controller redirects all requests to an existing service that provides authentication if `global-auth-url` is set in the NGINX ConfigMap. If you want to disable this behavior for that ingress, you can use `enable-global-auth: "false"` in the NGINX ConfigMap.
`nginx.ingress.kubernetes.io/enable-global-auth`:
indicates if GlobalExternalAuth configuration should be applied or not to this Ingress rule. Default values is set to `"true"`.
!!! note
For more information please see [global-auth-url](./configmap.md#global-auth-url).
### Rate Limiting
These annotations define limits on connections and transmission rates. These can be used to mitigate [DDoS Attacks](https://www.nginx.com/blog/mitigating-ddos-attacks-with-nginx-and-nginx-plus).
* `nginx.ingress.kubernetes.io/limit-connections`: number of concurrent connections allowed from a single IP address. A 503 error is returned when exceeding this limit.
* `nginx.ingress.kubernetes.io/limit-rps`: number of requests accepted from a given IP each second. The burst limit is set to this limit multiplied by the burst multiplier, the default multiplier is 5. When clients exceed this limit, [limit-req-status-code](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#limit-req-status-code) ***default:*** 503 is returned.
* `nginx.ingress.kubernetes.io/limit-rpm`: number of requests accepted from a given IP each minute. The burst limit is set to this limit multiplied by the burst multiplier, the default multiplier is 5. When clients exceed this limit, [limit-req-status-code](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#limit-req-status-code) ***default:*** 503 is returned.
* `nginx.ingress.kubernetes.io/limit-burst-multiplier`: multiplier of the limit rate for burst size. The default burst multiplier is 5, this annotation override the default multiplier. When clients exceed this limit, [limit-req-status-code](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#limit-req-status-code) ***default:*** 503 is returned.
* `nginx.ingress.kubernetes.io/limit-rate-after`: initial number of kilobytes after which the further transmission of a response to a given connection will be rate limited. This feature must be used with [proxy-buffering](#proxy-buffering) enabled.
* `nginx.ingress.kubernetes.io/limit-rate`: number of kilobytes per second allowed to send to a given connection. The zero value disables rate limiting. This feature must be used with [proxy-buffering](#proxy-buffering) enabled.
* `nginx.ingress.kubernetes.io/limit-whitelist`: client IP source ranges to be excluded from rate-limiting. The value is a comma separated list of CIDRs.
If you specify multiple annotations in a single Ingress rule, limits are applied in the order `limit-connections`, `limit-rpm`, `limit-rps`.
To configure settings globally for all Ingress rules, the `limit-rate-after` and `limit-rate` values may be set in the [NGINX ConfigMap](./configmap.md#limit-rate). The value set in an Ingress annotation will override the global setting.
The client IP address will be set based on the use of [PROXY protocol](./configmap.md#use-proxy-protocol) or from the `X-Forwarded-For` header value when [use-forwarded-headers](./configmap.md#use-forwarded-headers) is enabled.
### Global Rate Limiting
**Note:** Be careful when configuring both (Local) Rate Limiting and Global Rate Limiting at the same time.
They are two completely different rate limiting implementations. Whichever limit exceeds first will reject the
requests. It might be a good idea to configure both of them to ease load on Global Rate Limiting backend
in cases of spike in traffic.
The stock NGINX rate limiting does not share its counters among different NGINX instances.
Given that most ingress-nginx deployments are elastic and number of replicas can change any day
it is impossible to configure a proper rate limit using stock NGINX functionalities.
Global Rate Limiting overcome this by using [lua-resty-global-throttle](https://github.com/ElvinEfendi/lua-resty-global-throttle). `lua-resty-global-throttle` shares its counters via a central store such as `memcached`.
The obvious shortcoming of this is users have to deploy and operate a `memcached` instance
in order to benefit from this functionality. Configure the `memcached`
using [these configmap settings](./configmap.md#global-rate-limit).
**Here are a few remarks for ingress-nginx integration of `lua-resty-global-throttle`:**
1. We minimize `memcached` access by caching exceeding limit decisions. The expiry of
cache entry is the desired delay `lua-resty-global-throttle` calculates for us.
The Lua Shared Dictionary used for that is `global_throttle_cache`. Currently its size defaults to 10M.
Customize it as per your needs using [lua-shared-dicts](./configmap.md#lua-shared-dicts).
When we fail to cache the exceeding limit decision then we log an NGINX error. You can monitor
for that error to decide if you need to bump the cache size. Without cache the cost of processing a
request is two memcached commands: `GET`, and `INCR`. With the cache it is only `INCR`.
1. Log NGINX variable `$global_rate_limit_exceeding`'s value to have some visibility into
what portion of requests are rejected (value `y`), whether they are rejected using cached decision (value `c`),
or if they are not rejeced (default value `n`). You can use [log-format-upstream](./configmap.md#log-format-upstream)
to include that in access logs.
1. In case of an error it will log the error message and **fail open**.
1. The annotations below creates Global Rate Limiting instance per ingress.
That means if there are multuple paths configured under the same ingress,
the Global Rate Limiting will count requests to all the paths under the same counter.
Extract a path out into its own ingress if you need to isolate a certain path.
* `nginx.ingress.kubernetes.io/global-rate-limit`: Configures maximum allowed number of requests per window. Required.
* `nginx.ingress.kubernetes.io/global-rate-limit-window`: Configures a time window (i.e `1m`) that the limit is applied. Required.
* `nginx.ingress.kubernetes.io/global-rate-limit-key`: Configures a key for counting the samples. Defaults to `$remote_addr`. You can also combine multiple NGINX variables here, like `${remote_addr}-${http_x_api_client}` which would mean the limit will be applied to requests coming from the same API client (indicated by `X-API-Client` HTTP request header) with the same source IP address.
* `nginx.ingress.kubernetes.io/global-rate-limit-ignored-cidrs`: comma separated list of IPs and CIDRs to match client IP against. When there's a match request is not considered for rate limiting.
### Permanent Redirect
This annotation allows to return a permanent redirect (Return Code 301) instead of sending data to the upstream. For example `nginx.ingress.kubernetes.io/permanent-redirect: https://www.google.com` would redirect everything to Google.
### Permanent Redirect Code
This annotation allows you to modify the status code used for permanent redirects. For example `nginx.ingress.kubernetes.io/permanent-redirect-code: '308'` would return your permanent-redirect with a 308.
### Temporal Redirect
This annotation allows you to return a temporal redirect (Return Code 302) instead of sending data to the upstream. For example `nginx.ingress.kubernetes.io/temporal-redirect: https://www.google.com` would redirect everything to Google with a Return Code of 302 (Moved Temporarily)
### SSL Passthrough
The annotation `nginx.ingress.kubernetes.io/ssl-passthrough` instructs the controller to send TLS connections directly
to the backend instead of letting NGINX decrypt the communication. See also [TLS/HTTPS](../tls.md#ssl-passthrough) in
the User guide.
!!! note
SSL Passthrough is **disabled by default** and requires starting the controller with the
[`--enable-ssl-passthrough`](../cli-arguments.md) flag.
!!! attention
Because SSL Passthrough works on layer 4 of the OSI model (TCP) and not on the layer 7 (HTTP), using SSL Passthrough
invalidates all the other annotations set on an Ingress object.
### Service Upstream
By default the NGINX ingress controller uses a list of all endpoints (Pod IP/port) in the NGINX upstream configuration.
The `nginx.ingress.kubernetes.io/service-upstream` annotation disables that behavior and instead uses a single upstream in NGINX, the service's Cluster IP and port.
This can be desirable for things like zero-downtime deployments as it reduces the need to reload NGINX configuration when Pods come up and down. See issue [#257](https://github.com/kubernetes/ingress-nginx/issues/257).
#### Known Issues
If the `service-upstream` annotation is specified the following things should be taken into consideration:
* Sticky Sessions will not work as only round-robin load balancing is supported.
* The `proxy_next_upstream` directive will not have any effect meaning on error the request will not be dispatched to another upstream.
### Server-side HTTPS enforcement through redirect
By default the controller redirects (308) to HTTPS if TLS is enabled for that ingress.
If you want to disable this behavior globally, you can use `ssl-redirect: "false"` in the NGINX [ConfigMap](./configmap.md#ssl-redirect).
To configure this feature for specific ingress resources, you can use the `nginx.ingress.kubernetes.io/ssl-redirect: "false"`
annotation in the particular resource.
When using SSL offloading outside of cluster (e.g. AWS ELB) it may be useful to enforce a redirect to HTTPS
even when there is no TLS certificate available.
This can be achieved by using the `nginx.ingress.kubernetes.io/force-ssl-redirect: "true"` annotation in the particular resource.
To preserve the trailing slash in the URI with `ssl-redirect`, set `nginx.ingress.kubernetes.io/preserve-trailing-slash: "true"` annotation for that particular resource.
### Redirect from/to www
In some scenarios is required to redirect from `www.domain.com` to `domain.com` or vice versa.
To enable this feature use the annotation `nginx.ingress.kubernetes.io/from-to-www-redirect: "true"`
!!! attention
If at some point a new Ingress is created with a host equal to one of the options (like `domain.com`) the annotation will be omitted.
!!! attention
For HTTPS to HTTPS redirects is mandatory the SSL Certificate defined in the Secret, located in the TLS section of Ingress, contains both FQDN in the common name of the certificate.
### Whitelist source range
You can specify allowed client IP source ranges through the `nginx.ingress.kubernetes.io/whitelist-source-range` annotation.
The value is a comma separated list of [CIDRs](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing), e.g. `10.0.0.0/24,172.10.0.1`.
To configure this setting globally for all Ingress rules, the `whitelist-source-range` value may be set in the [NGINX ConfigMap](./configmap.md#whitelist-source-range).
!!! note
Adding an annotation to an Ingress rule overrides any global restriction.
### Custom timeouts
Using the configuration configmap it is possible to set the default global timeout for connections to the upstream servers.
In some scenarios is required to have different values. To allow this we provide annotations that allows this customization:
- `nginx.ingress.kubernetes.io/proxy-connect-timeout`
- `nginx.ingress.kubernetes.io/proxy-send-timeout`
- `nginx.ingress.kubernetes.io/proxy-read-timeout`
- `nginx.ingress.kubernetes.io/proxy-next-upstream`
- `nginx.ingress.kubernetes.io/proxy-next-upstream-timeout`
- `nginx.ingress.kubernetes.io/proxy-next-upstream-tries`
- `nginx.ingress.kubernetes.io/proxy-request-buffering`
Note: All timeout values are unitless and in seconds e.g. `nginx.ingress.kubernetes.io/proxy-read-timeout: "120"` sets a valid 120 seconds proxy read timeout.
### Proxy redirect
With the annotations `nginx.ingress.kubernetes.io/proxy-redirect-from` and `nginx.ingress.kubernetes.io/proxy-redirect-to` it is possible to
set the text that should be changed in the `Location` and `Refresh` header fields of a [proxied server response](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect)
Setting "off" or "default" in the annotation `nginx.ingress.kubernetes.io/proxy-redirect-from` disables `nginx.ingress.kubernetes.io/proxy-redirect-to`,
otherwise, both annotations must be used in unison. Note that each annotation must be a string without spaces.
By default the value of each annotation is "off".
### Custom max body size
For NGINX, an 413 error will be returned to the client when the size in a request exceeds the maximum allowed size of the client request body. This size can be configured by the parameter [`client_max_body_size`](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size).
To configure this setting globally for all Ingress rules, the `proxy-body-size` value may be set in the [NGINX ConfigMap](./configmap.md#proxy-body-size).
To use custom values in an Ingress rule define these annotation:
```yaml
nginx.ingress.kubernetes.io/proxy-body-size: 8m
```
### Proxy cookie domain
Sets a text that [should be changed in the domain attribute](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cookie_domain) of the "Set-Cookie" header fields of a proxied server response.
To configure this setting globally for all Ingress rules, the `proxy-cookie-domain` value may be set in the [NGINX ConfigMap](./configmap.md#proxy-cookie-domain).
### Proxy cookie path
Sets a text that [should be changed in the path attribute](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cookie_path) of the "Set-Cookie" header fields of a proxied server response.
To configure this setting globally for all Ingress rules, the `proxy-cookie-path` value may be set in the [NGINX ConfigMap](./configmap.md#proxy-cookie-path).
### Proxy buffering
Enable or disable proxy buffering [`proxy_buffering`](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering).
By default proxy buffering is disabled in the NGINX config.
To configure this setting globally for all Ingress rules, the `proxy-buffering` value may be set in the [NGINX ConfigMap](./configmap.md#proxy-buffering).
To use custom values in an Ingress rule define these annotation:
```yaml
nginx.ingress.kubernetes.io/proxy-buffering: "on"
```
### Proxy buffers Number
Sets the number of the buffers in [`proxy_buffers`](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers) used for reading the first part of the response received from the proxied server.
By default proxy buffers number is set as 4
To configure this setting globally, set `proxy-buffers-number` in [NGINX ConfigMap](./configmap.md#proxy-buffers-number). To use custom values in an Ingress rule, define this annotation:
```yaml
nginx.ingress.kubernetes.io/proxy-buffers-number: "4"
```
### Proxy buffer size
Sets the size of the buffer [`proxy_buffer_size`](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size) used for reading the first part of the response received from the proxied server.
By default proxy buffer size is set as "4k"
To configure this setting globally, set `proxy-buffer-size` in [NGINX ConfigMap](./configmap.md#proxy-buffer-size). To use custom values in an Ingress rule, define this annotation:
```yaml
nginx.ingress.kubernetes.io/proxy-buffer-size: "8k"
```
### Proxy max temp file size
When [`buffering`](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering) of responses from the proxied server is enabled, and the whole response does not fit into the buffers set by the [`proxy_buffer_size`](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size) and [`proxy_buffers`](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers) directives, a part of the response can be saved to a temporary file. This directive sets the maximum `size` of the temporary file setting the [`proxy_max_temp_file_size`](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_max_temp_file_size). The size of data written to the temporary file at a time is set by the [`proxy_temp_file_write_size`](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_temp_file_write_size) directive.
The zero value disables buffering of responses to temporary files.
To use custom values in an Ingress rule, define this annotation:
```yaml
nginx.ingress.kubernetes.io/proxy-max-temp-file-size: "1024m"
```
### Proxy HTTP version
Using this annotation sets the [`proxy_http_version`](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version) that the Nginx reverse proxy will use to communicate with the backend.
By default this is set to "1.1".
```yaml
nginx.ingress.kubernetes.io/proxy-http-version: "1.0"
```
### SSL ciphers
Specifies the [enabled ciphers](http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_ciphers).
Using this annotation will set the `ssl_ciphers` directive at the server level. This configuration is active for all the paths in the host.
```yaml
nginx.ingress.kubernetes.io/ssl-ciphers: "ALL:!aNULL:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP"
```
The following annotation will set the `ssl_prefer_server_ciphers` directive at the server level. This configuration specifies that server ciphers should be preferred over client ciphers when using the SSLv3 and TLS protocols.
```yaml
nginx.ingress.kubernetes.io/ssl-prefer-server-ciphers: "true"
```
### Connection proxy header
Using this annotation will override the default connection header set by NGINX.
To use custom values in an Ingress rule, define the annotation:
```yaml
nginx.ingress.kubernetes.io/connection-proxy-header: "keep-alive"
```
### Enable Access Log
Access logs are enabled by default, but in some scenarios access logs might be required to be disabled for a given
ingress. To do this, use the annotation:
```yaml
nginx.ingress.kubernetes.io/enable-access-log: "false"
```
### Enable Rewrite Log
Rewrite logs are not enabled by default. In some scenarios it could be required to enable NGINX rewrite logs.
Note that rewrite logs are sent to the error_log file at the notice level. To enable this feature use the annotation:
```yaml
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
```
### Enable Opentracing
Opentracing can be enabled or disabled globally through the ConfigMap but this will sometimes need to be overridden
to enable it or disable it for a specific ingress (e.g. to turn off tracing of external health check endpoints)
```yaml
nginx.ingress.kubernetes.io/enable-opentracing: "true"
```
### Opentracing Trust Incoming Span
The option to trust incoming trace spans can be enabled or disabled globally through the ConfigMap but this will
sometimes need to be overriden to enable it or disable it for a specific ingress (e.g. only enable on a private endpoint)
```yaml
nginx.ingress.kubernetes.io/opentracing-trust-incoming-span: "true"
```
### X-Forwarded-Prefix Header
To add the non-standard `X-Forwarded-Prefix` header to the upstream request with a string value, the following annotation can be used:
```yaml
nginx.ingress.kubernetes.io/x-forwarded-prefix: "/path"
```
### ModSecurity
[ModSecurity](http://modsecurity.org/) is an OpenSource Web Application firewall. It can be enabled for a particular set
of ingress locations. The ModSecurity module must first be enabled by enabling ModSecurity in the
[ConfigMap](./configmap.md#enable-modsecurity). Note this will enable ModSecurity for all paths, and each path
must be disabled manually.
It can be enabled using the following annotation:
```yaml
nginx.ingress.kubernetes.io/enable-modsecurity: "true"
```
ModSecurity will run in "Detection-Only" mode using the [recommended configuration](https://github.com/SpiderLabs/ModSecurity/blob/v3/master/modsecurity.conf-recommended).
You can enable the [OWASP Core Rule Set](https://www.modsecurity.org/CRS/Documentation/) by
setting the following annotation:
```yaml
nginx.ingress.kubernetes.io/enable-owasp-core-rules: "true"
```
You can pass transactionIDs from nginx by setting up the following:
```yaml
nginx.ingress.kubernetes.io/modsecurity-transaction-id: "$request_id"
```
You can also add your own set of modsecurity rules via a snippet:
```yaml
nginx.ingress.kubernetes.io/modsecurity-snippet: |
SecRuleEngine On
SecDebugLog /tmp/modsec_debug.log
```
Note: If you use both `enable-owasp-core-rules` and `modsecurity-snippet` annotations together, only the
`modsecurity-snippet` will take effect. If you wish to include the [OWASP Core Rule Set](https://www.modsecurity.org/CRS/Documentation/) or
[recommended configuration](https://github.com/SpiderLabs/ModSecurity/blob/v3/master/modsecurity.conf-recommended) simply use the include
statement:
nginx 0.24.1 and below
```yaml
nginx.ingress.kubernetes.io/modsecurity-snippet: |
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
Include /etc/nginx/modsecurity/modsecurity.conf
```
nginx 0.25.0 and above
```yaml
nginx.ingress.kubernetes.io/modsecurity-snippet: |
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
```
### InfluxDB
Using `influxdb-*` annotations we can monitor requests passing through a Location by sending them to an InfluxDB backend exposing the UDP socket
using the [nginx-influxdb-module](https://github.com/influxdata/nginx-influxdb-module/).
```yaml
nginx.ingress.kubernetes.io/enable-influxdb: "true"
nginx.ingress.kubernetes.io/influxdb-measurement: "nginx-reqs"
nginx.ingress.kubernetes.io/influxdb-port: "8089"
nginx.ingress.kubernetes.io/influxdb-host: "127.0.0.1"
nginx.ingress.kubernetes.io/influxdb-server-name: "nginx-ingress"
```
For the `influxdb-host` parameter you have two options:
- Use an InfluxDB server configured with the [UDP protocol](https://docs.influxdata.com/influxdb/v1.5/supported_protocols/udp/) enabled.
- Deploy Telegraf as a sidecar proxy to the Ingress controller configured to listen UDP with the [socket listener input](https://github.com/influxdata/telegraf/tree/release-1.6/plugins/inputs/socket_listener) and to write using
anyone of the [outputs plugins](https://github.com/influxdata/telegraf/tree/release-1.7/plugins/outputs) like InfluxDB, Apache Kafka,
Prometheus, etc.. (recommended)
It's important to remember that there's no DNS resolver at this stage so you will have to configure
an ip address to `nginx.ingress.kubernetes.io/influxdb-host`. If you deploy Influx or Telegraf as sidecar (another container in the same pod) this becomes straightforward since you can directly use `127.0.0.1`.
### Backend Protocol
Using `backend-protocol` annotations is possible to indicate how NGINX should communicate with the backend service. (Replaces `secure-backends` in older versions)
Valid Values: HTTP, HTTPS, GRPC, GRPCS, AJP and FCGI
By default NGINX uses `HTTP`.
Example:
```yaml
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
```
### Use Regex
!!! attention
When using this annotation with the NGINX annotation `nginx.ingress.kubernetes.io/affinity` of type `cookie`, `nginx.ingress.kubernetes.io/session-cookie-path` must be also set; Session cookie paths do not support regex.
Using the `nginx.ingress.kubernetes.io/use-regex` annotation will indicate whether or not the paths defined on an Ingress use regular expressions. The default value is `false`.
The following will indicate that regular expression paths are being used:
```yaml
nginx.ingress.kubernetes.io/use-regex: "true"
```
The following will indicate that regular expression paths are __not__ being used:
```yaml
nginx.ingress.kubernetes.io/use-regex: "false"
```
When this annotation is set to `true`, the case insensitive regular expression [location modifier](https://nginx.org/en/docs/http/ngx_http_core_module.html#location) will be enforced on ALL paths for a given host regardless of what Ingress they are defined on.
Additionally, if the [`rewrite-target` annotation](#rewrite) is used on any Ingress for a given host, then the case insensitive regular expression [location modifier](https://nginx.org/en/docs/http/ngx_http_core_module.html#location) will be enforced on ALL paths for a given host regardless of what Ingress they are defined on.
Please read about [ingress path matching](../ingress-path-matching.md) before using this modifier.
### Satisfy
By default, a request would need to satisfy all authentication requirements in order to be allowed. By using this annotation, requests that satisfy either any or all authentication requirements are allowed, based on the configuration value.
```yaml
nginx.ingress.kubernetes.io/satisfy: "any"
```
### Mirror
Enables a request to be mirrored to a mirror backend. Responses by mirror backends are ignored. This feature is useful, to see how requests will react in "test" backends.
The mirror backend can be set by applying:
```yaml
nginx.ingress.kubernetes.io/mirror-target: https://test.env.com/$request_uri
```
By default the request-body is sent to the mirror backend, but can be turned off by applying:
```yaml
nginx.ingress.kubernetes.io/mirror-request-body: "off"
```
**Note:** The mirror directive will be applied to all paths within the ingress resource.
The request sent to the mirror is linked to the original request. If you have a slow mirror backend, then the original request will throttle.
For more information on the mirror module see [ngx_http_mirror_module](https://nginx.org/en/docs/http/ngx_http_mirror_module.html)
|
Java
|
# Bidens schaffneri Sherff SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
module SchemaEvolutionManager
# Container for common args, mainly to have stricter validation on
# inputs. Tried to use GetoptLong but could not write solid unit
# tests around it... so we have our own internal simple implementation.
class Args
if !defined?(FLAGS_WITH_ARGUMENTS)
FLAGS_WITH_ARGUMENTS = {
:artifact_name => "Specifies the name of the artifact. Tag will be appended to this name",
:user => "Connect to the database as this username instead of the default",
:host => "Specifies the host name of the machine on which the server is running",
:port => "Specifies the port on which the server is running",
:name => "Specifies the name of the database to which to connect",
:url => "The connection string for the psql database",
:dir => "Path to a directory",
:tag => "A git tag (e.g. 0.0.1)",
:prefix => "Configure installer to use this prefix",
:set => "Passthrough for postgresql --set argument"
}
FLAGS_NO_ARGUMENTS = {
:password => "Prompt user to enter password for the database user. Password is stored for the duration of the process",
:dry_run => "Include flag to echo commands that will run without actually executing them",
:help => "Display help",
:verbose => "Enable verbose logging of all system calls",
}
end
attr_reader :artifact_name, :host, :port, :name, :prefix, :url, :user, :dir, :dry_run, :tag, :password, :set
# args: Actual string arguments
# :required => list of parameters that are required
# :optional => list of parameters that are optional
def initialize(args, opts={})
Preconditions.assert_class_or_nil(args, String)
required = (opts.delete(:required) || []).map { |flag| format_flag(flag) }
optional = (opts.delete(:optional) || []).map { |flag| format_flag(flag) }
Preconditions.assert_class(required, Array)
Preconditions.assert_class(optional, Array)
Preconditions.assert_empty_opts(opts)
Preconditions.check_state(optional.size + required.size > 0,
"Must have at least 1 optional or required parameter")
if !optional.include?(:help)
optional << :help
end
if !optional.include?(:verbose)
optional << :verbose
end
found_arguments = parse_string_arguments(args)
missing = required.select { |field| blank?(found_arguments[field]) }
@artifact_name = found_arguments.delete(:artifact_name)
@host = found_arguments.delete(:host)
@port = found_arguments.delete(:port)
@name = found_arguments.delete(:name)
@prefix = found_arguments.delete(:prefix)
@url = found_arguments.delete(:url)
@user = found_arguments.delete(:user)
@dir = found_arguments.delete(:dir)
@tag = found_arguments.delete(:tag)
@set = found_arguments.delete(:set)
@dry_run = found_arguments.delete(:dry_run)
@password = found_arguments.delete(:password)
@help = found_arguments.delete(:help)
@verbose = found_arguments.delete(:verbose)
Preconditions.check_state(found_arguments.empty?,
"Did not handle all flags: %s" % found_arguments.keys.join(" "))
if @help
RdocUsage.printAndExit(0)
end
if @verbose
Library.set_verbose(true)
end
if !missing.empty?
missing_fields_error(required, optional, missing)
end
end
# Hack to minimize bleeding from STDIN. Returns an instance of Args class
def Args.from_stdin(opts)
values = ARGV.join(" ")
Args.new(values, opts)
end
private
def blank?(value)
value.to_s.strip == ""
end
def missing_fields_error(required, optional, fields)
Preconditions.assert_class(fields, Array)
Preconditions.check_state(!fields.empty?, "Missing fields cannot be empty")
title = fields.size == 1 ? "Missing parameter" : "Missing parameters"
sorted = fields.sort_by { |f| f.to_s }
puts "**************************************************"
puts "ERROR: #{title}: #{sorted.join(", ")}"
puts "**************************************************"
puts help_parameters("Required parameters", required)
puts help_parameters("Optional parameters", optional)
exit(1)
end
def help_parameters(title, parameters)
docs = []
if !parameters.empty?
docs << ""
docs << title
docs << "-------------------"
parameters.each do |flag|
documentation = FLAGS_WITH_ARGUMENTS[flag] || FLAGS_NO_ARGUMENTS[flag]
Preconditions.check_not_null(documentation, "No documentation found for flag[%s]" % flag)
docs << " --#{flag}"
docs << " " + documentation
docs << ""
end
end
docs.join("\n")
end
def parse_string_arguments(args)
Preconditions.assert_class_or_nil(args, String)
found = {}
index = 0
values = args.to_s.strip.split(/\s+/)
while index < values.length do
flag = format_flag(values[index])
index += 1
if FLAGS_WITH_ARGUMENTS.has_key?(flag)
found[flag] = values[index]
index += 1
elsif FLAGS_NO_ARGUMENTS.has_key?(flag)
found[flag] = true
else
raise "Unknown flag[%s]" % flag
end
end
found
end
# Strip leading dashes and convert to symbol
def format_flag(flag)
Preconditions.assert_class(flag, String)
flag.sub(/^\-\-/, '').to_sym
end
end
end
|
Java
|
<?php
namespace Ajax\semantic\components\validation;
use Ajax\service\AjaxCall;
use Ajax\JsUtils;
/**
* @author jc
* @version 1.001
* Generates a JSON Rule for the validation of a field
*/
class Rule implements \JsonSerializable{
/**
* @var string
*/
private $type;
/**
* @var string
*/
private $prompt;
/**
* @var string
*/
private $value;
public function __construct($type,$prompt=NULL,$value=NULL){
$this->type=$type;
$this->prompt=$prompt;
$this->value=$value;
}
public function getType() {
return $this->type;
}
public function setType($type) {
$this->type=$type;
return $this;
}
public function getPrompt() {
return $this->prompt;
}
public function setPrompt($prompt) {
$this->prompt=$prompt;
return $this;
}
public function getValue() {
return $this->value;
}
public function setValue($value) {
$this->value=$value;
return $this;
}
#[\ReturnTypeWillChange]
public function jsonSerialize() {
$result= ["type"=>$this->type];
if(isset($this->prompt))
$result["prompt"]=$this->prompt;
if(isset($this->value))
$result["value"]=$this->value;
return $result;
}
/**
* A field should match the value of another validation field, for example to confirm passwords
* @param string $name
* @param string $prompt
* @return \Ajax\semantic\components\validation\Rule
*/
public static function match($name,$prompt=NULL){
return new Rule("match[".$name."]",$prompt);
}
/**
* A field should be different than another specified field
* @param string $name
* @param string $prompt
* @return \Ajax\semantic\components\validation\Rule
*/
public static function different($name,$prompt=NULL){
return new Rule("different[".$name."]",$prompt);
}
/**
* A field is an integer value, or matches an integer range
* @param int|NULL $min
* @param int|NULL $max
* @param string $prompt
* @return \Ajax\semantic\components\validation\Rule
*/
public static function integer($min=NULL,$max=NULL,$prompt=NULL){
if(\is_int($min) && \is_int($max))
return new Rule("integer[{$min}..{$max}]",$prompt);
return new Rule("integer",$prompt);
}
public static function decimal($prompt=NULL){
return new Rule("decimal",$prompt);
}
public static function number($prompt=NULL){
return new Rule("number",$prompt);
}
public static function is($value,$prompt=NULL){
return new Rule("is[".$value."]",$prompt);
}
public static function isExactly($value,$prompt=NULL){
return new Rule("isExactly[".$value."]",$prompt);
}
public static function not($value,$prompt=NULL){
return new Rule("not[".$value."]",$prompt);
}
public static function notExactly($value,$prompt=NULL){
return new Rule("notExactly[".$value."]",$prompt);
}
public static function contains($value,$prompt=NULL){
return new Rule("contains[".$value."]",$prompt);
}
public static function containsExactly($value,$prompt=NULL){
return new Rule("containsExactly[".$value."]",$prompt);
}
public static function doesntContain($value,$prompt=NULL){
return new Rule("doesntContain[".$value."]",$prompt);
}
public static function doesntContainExactly($value,$prompt=NULL){
return new Rule("doesntContainExactly[".$value."]",$prompt);
}
public static function minCount($value,$prompt=NULL){
return new Rule("minCount[".$value."]",$prompt);
}
public static function maxCount($value,$prompt=NULL){
return new Rule("maxCount[".$value."]",$prompt);
}
public static function exactCount($value,$prompt=NULL){
return new Rule("exactCount[".$value."]",$prompt);
}
public static function email($prompt=NULL){
return new Rule("email",$prompt);
}
public static function url($prompt=NULL){
return new Rule("url",$prompt);
}
public static function regExp($value,$prompt=NULL){
return new Rule("regExp",$prompt,$value);
}
public static function custom($name,$jsFunction){
return "$.fn.form.settings.rules.".$name." =".$jsFunction ;
}
public static function ajax(JsUtils $js,$name,$url,$params,$jsCallback,$method="post",$parameters=[]){
$parameters=\array_merge(["async"=>false,"url"=>$url,"params"=>$params,"hasLoader"=>false,"jsCallback"=>$jsCallback,"dataType"=>"json","stopPropagation"=>false,"preventDefault"=>false,"responseElement"=>null],$parameters);
$ajax=new AjaxCall($method, $parameters);
return self::custom($name, "function(value,ruleValue){var result=true;".$ajax->compile($js)."return result;}");
}
}
|
Java
|
import torch
from deluca.lung.core import Controller, LungEnv
class PIDCorrection(Controller):
def __init__(self, base_controller: Controller, sim: LungEnv, pid_K=[0.0, 0.0], decay=0.1, **kwargs):
self.base_controller = base_controller
self.sim = sim
self.I = 0.0
self.K = pid_K
self.decay = decay
self.reset()
def reset(self):
self.base_controller.reset()
self.sim.reset()
self.I = 0.0
def compute_action(self, state, t):
u_in_base, u_out = self.base_controller(state, t)
err = self.sim.pressure - state
self.I = self.I * (1 - self.decay) + err * self.decay
pid_correction = self.K[0] * err + self.K[1] * self.I
u_in = torch.clamp(u_in_base + pid_correction, min=0.0, max=100.0)
self.sim(u_in, u_out, t)
return u_in, u_out
|
Java
|
# Sphaeria eckfeldtii Ellis SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
Bull. Torrey bot. Club 8: 91 (1881)
#### Original name
Sphaeria eckfeldtii Ellis
### Remarks
null
|
Java
|
# Heliopsis patula Wender. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
# Numulariola mucronata (Mont.) P.M.D. Martin, 1976 SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
S. Afr. J. Bot. 42(1): 78 (1976)
#### Original name
Camillea mucronata Mont., 1855
### Remarks
null
|
Java
|
# Agave applanata var. parryi VARIETY
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
# Duvernaysphaera oa Loeblich & Wicander, 1976 SPECIES
#### Status
ACCEPTED
#### According to
Interim Register of Marine and Nonmarine Genera
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
# Memecylon perakense Merr. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
# Puccinia spreta Peck SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
Ann. Rep. N. Y. St. Mus. nat. Hist. 29: 67 (1878)
#### Original name
Puccinia tiarellae Peck
### Remarks
null
|
Java
|
# Croton uruguayensis Baill. SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
# Leymus divaricatus (Drobow) Tzvelev SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Bot. Mater. Gerb. Bot. Inst. Komarova Akad. Nauk S. S. S. R. 20:430. 1960
#### Original name
null
### Remarks
null
|
Java
|
# Rottlera lappacea Wall. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
# Heteropterys candolleana A.Juss. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
# Dianthus gasparrini Guss. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
# Schistophyllidium imbricatum (Kar. & Kir.) Soják SPECIES
#### Status
DOUBTFUL
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
/* ====================================================================
Copyright (C) 2004-2008 fyiReporting Software, LLC
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.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Xml;
using System.Text;
using System.IO;
using fyiReporting.RDL;
namespace fyiReporting.RdlDesign
{
/// <summary>
/// DialogValidValues allow user to provide ValidValues: Value and Label lists
/// </summary>
internal class DialogValidValues : System.Windows.Forms.Form
{
private DataTable _DataTable;
private DataGridTextBoxColumn dgtbLabel;
private DataGridTextBoxColumn dgtbValue;
private System.Windows.Forms.DataGridTableStyle dgTableStyle;
private System.Windows.Forms.DataGrid dgParms;
private System.Windows.Forms.Button bOK;
private System.Windows.Forms.Button bCancel;
private System.Windows.Forms.Button bDelete;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
internal DialogValidValues(List<ParameterValueItem> list)
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// Initialize form using the style node values
InitValues(list);
}
internal List<ParameterValueItem> ValidValues
{
get
{
List<ParameterValueItem> list = new List<ParameterValueItem>();
foreach (DataRow dr in _DataTable.Rows)
{
if (dr[0] == DBNull.Value)
continue;
string val = (string) dr[0];
if (val.Length <= 0)
continue;
string label;
if (dr[1] == DBNull.Value)
label = null;
else
label = (string) dr[1];
ParameterValueItem pvi = new ParameterValueItem();
pvi.Value = val;
pvi.Label = label;
list.Add(pvi);
}
return list.Count > 0? list: null;
}
}
private void InitValues(List<ParameterValueItem> list)
{
// Initialize the DataGrid columns
dgtbLabel = new DataGridTextBoxColumn();
dgtbValue = new DataGridTextBoxColumn();
this.dgTableStyle.GridColumnStyles.AddRange(new DataGridColumnStyle[] {
this.dgtbValue,
this.dgtbLabel});
//
// dgtbFE
//
dgtbValue.HeaderText = "Value";
dgtbValue.MappingName = "Value";
dgtbValue.Width = 75;
//
// dgtbValue
//
this.dgtbLabel.HeaderText = "Label";
this.dgtbLabel.MappingName = "Label";
this.dgtbLabel.Width = 75;
// Initialize the DataGrid
//this.dgParms.DataSource = _dsv.QueryParameters;
_DataTable = new DataTable();
_DataTable.Columns.Add(new DataColumn("Value", typeof(string)));
_DataTable.Columns.Add(new DataColumn("Label", typeof(string)));
string[] rowValues = new string[2];
if (list != null)
foreach (ParameterValueItem pvi in list)
{
rowValues[0] = pvi.Value;
rowValues[1] = pvi.Label;
_DataTable.Rows.Add(rowValues);
}
this.dgParms.DataSource = _DataTable;
////
DataGridTableStyle ts = dgParms.TableStyles[0];
ts.GridColumnStyles[0].Width = 140;
ts.GridColumnStyles[1].Width = 140;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.dgParms = new System.Windows.Forms.DataGrid();
this.dgTableStyle = new System.Windows.Forms.DataGridTableStyle();
this.bOK = new System.Windows.Forms.Button();
this.bCancel = new System.Windows.Forms.Button();
this.bDelete = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgParms)).BeginInit();
this.SuspendLayout();
//
// dgParms
//
this.dgParms.CaptionVisible = false;
this.dgParms.DataMember = "";
this.dgParms.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgParms.Location = new System.Drawing.Point(8, 8);
this.dgParms.Name = "dgParms";
this.dgParms.Size = new System.Drawing.Size(320, 168);
this.dgParms.TabIndex = 2;
this.dgParms.TableStyles.AddRange(new System.Windows.Forms.DataGridTableStyle[] {
this.dgTableStyle});
//
// dgTableStyle
//
this.dgTableStyle.AllowSorting = false;
this.dgTableStyle.DataGrid = this.dgParms;
this.dgTableStyle.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgTableStyle.MappingName = "";
//
// bOK
//
this.bOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.bOK.Location = new System.Drawing.Point(216, 192);
this.bOK.Name = "bOK";
this.bOK.TabIndex = 3;
this.bOK.Text = "OK";
//
// bCancel
//
this.bCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.bCancel.Location = new System.Drawing.Point(312, 192);
this.bCancel.Name = "bCancel";
this.bCancel.TabIndex = 4;
this.bCancel.Text = "Cancel";
//
// bDelete
//
this.bDelete.Location = new System.Drawing.Point(336, 16);
this.bDelete.Name = "bDelete";
this.bDelete.Size = new System.Drawing.Size(48, 23);
this.bDelete.TabIndex = 5;
this.bDelete.Text = "Delete";
this.bDelete.Click += new System.EventHandler(this.bDelete_Click);
//
// DialogValidValues
//
this.AcceptButton = this.bOK;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this.bCancel;
this.ClientSize = new System.Drawing.Size(392, 222);
this.ControlBox = false;
this.Controls.Add(this.bDelete);
this.Controls.Add(this.bCancel);
this.Controls.Add(this.bOK);
this.Controls.Add(this.dgParms);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "DialogValidValues";
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Valid Values";
((System.ComponentModel.ISupportInitialize)(this.dgParms)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void bDelete_Click(object sender, System.EventArgs e)
{
this._DataTable.Rows.RemoveAt(this.dgParms.CurrentRowIndex);
}
}
}
|
Java
|
package org.ngrinder.home.controller;
import lombok.RequiredArgsConstructor;
import org.ngrinder.common.constant.ControllerConstants;
import org.ngrinder.home.model.PanelEntry;
import org.ngrinder.home.service.HomeService;
import org.ngrinder.infra.config.Config;
import org.ngrinder.script.handler.ScriptHandler;
import org.ngrinder.script.handler.ScriptHandlerFactory;
import org.ngrinder.user.service.UserContext;
import org.springframework.context.MessageSource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PostConstruct;
import java.util.*;
import static java.util.Comparator.comparing;
import static org.ngrinder.common.constant.ControllerConstants.*;
import static org.ngrinder.common.util.CollectionUtils.buildMap;
import static org.ngrinder.common.util.NoOp.noOp;
/**
* Home index page api controller.
*
* @since 3.5.0
*/
@RestController
@RequestMapping("/home/api")
@RequiredArgsConstructor
public class HomeApiController {
private static final String TIMEZONE_ID_PREFIXES = "^(Africa|America|Asia|Atlantic|Australia|Europe|Indian|Pacific)/.*";
private final HomeService homeService;
private final ScriptHandlerFactory scriptHandlerFactory;
private final UserContext userContext;
private final Config config;
private final MessageSource messageSource;
private List<TimeZone> timeZones = null;
@PostConstruct
public void init() {
timeZones = new ArrayList<>();
final String[] timeZoneIds = TimeZone.getAvailableIDs();
for (final String id : timeZoneIds) {
if (id.matches(TIMEZONE_ID_PREFIXES) && !TimeZone.getTimeZone(id).getDisplayName().contains("GMT")) {
timeZones.add(TimeZone.getTimeZone(id));
}
}
timeZones.sort(comparing(TimeZone::getID));
}
@GetMapping("/handlers")
public List<ScriptHandler> getHandlers() {
return scriptHandlerFactory.getVisibleHandlers();
}
@GetMapping("/panel")
public Map<String, Object> getPanelEntries() {
return buildMap("leftPanelEntries", getLeftPanelEntries(), "rightPanelEntries", getRightPanelEntries());
}
@GetMapping("/timezones")
public List<TimeZone> getTimezones() {
return timeZones;
}
@GetMapping("/config")
public Map<String, Object> getCommonHomeConfig() {
return buildMap(
"askQuestionUrl", config.getControllerProperties().getProperty(PROP_CONTROLLER_FRONT_PAGE_ASK_QUESTION_URL,
getMessages(PROP_CONTROLLER_FRONT_PAGE_ASK_QUESTION_URL)),
"seeMoreQuestionUrl", config.getControllerProperties().getProperty(PROP_CONTROLLER_FRONT_PAGE_QNA_MORE_URL,
getMessages(PROP_CONTROLLER_FRONT_PAGE_QNA_MORE_URL)),
"seeMoreResourcesUrl", config.getControllerProperties().getProperty(PROP_CONTROLLER_FRONT_PAGE_RESOURCES_MORE_URL),
"userLanguage", config.getControllerProperties().getProperty(ControllerConstants.PROP_CONTROLLER_DEFAULT_LANG));
}
private List<PanelEntry> getRightPanelEntries() {
if (config.getControllerProperties().getPropertyBoolean(PROP_CONTROLLER_FRONT_PAGE_ENABLED)) {
// Get nGrinder Resource RSS
String rightPanelRssURL = config.getControllerProperties().getProperty(PROP_CONTROLLER_FRONT_PAGE_RESOURCES_RSS);
return homeService.getRightPanelEntries(rightPanelRssURL);
}
return Collections.emptyList();
}
private List<PanelEntry> getLeftPanelEntries() {
if (config.getControllerProperties().getPropertyBoolean(PROP_CONTROLLER_FRONT_PAGE_ENABLED)) {
// Make the i18n applied QnA panel. Depending on the user language, show the different QnA panel.
String leftPanelRssURLKey = getMessages(PROP_CONTROLLER_FRONT_PAGE_QNA_RSS);
// Make admin configure the QnA panel.
String leftPanelRssURL = config.getControllerProperties().getProperty(PROP_CONTROLLER_FRONT_PAGE_QNA_RSS,
leftPanelRssURLKey);
return homeService.getLeftPanelEntries(leftPanelRssURL);
}
return Collections.emptyList();
}
@GetMapping("/messagesources/{locale}")
public Map<String, String> getUserDefinedMessageSources(@PathVariable String locale) {
return homeService.getUserDefinedMessageSources(locale);
}
/**
* Get the message from messageSource by the given key.
*
* @param key key of message
* @return the found message. If not found, the error message will return.
*/
private String getMessages(String key) {
String userLanguage = "en";
try {
userLanguage = userContext.getCurrentUser().getUserLanguage();
} catch (Exception e) {
noOp();
}
Locale locale = new Locale(userLanguage);
return messageSource.getMessage(key, null, locale);
}
}
|
Java
|
package com.huawei.esdk.fusionmanager.local.model.system;
import com.huawei.esdk.fusionmanager.local.model.FMSDKResponse;
/**
* 查询计划任务详情返回信息。
* <p>
* @since eSDK Cloud V100R003C30
*/
public class QueryScheduleTaskDetailResp extends FMSDKResponse
{
/**
* 计划任务。
*/
private ScheduleTask scheduleTask;
public ScheduleTask getScheduleTask()
{
return scheduleTask;
}
public void setScheduleTask(ScheduleTask scheduleTask)
{
this.scheduleTask = scheduleTask;
}
}
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_74) on Mon Jan 02 20:06:46 EET 2017 -->
<title>Uses of Class com.complet.DatabaseConnection</title>
<meta name="date" content="2017-01-02">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class com.complet.DatabaseConnection";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../com/complet/package-summary.html">Package</a></li>
<li><a href="../../../com/complet/DatabaseConnection.html" title="class in com.complet">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?com/complet/class-use/DatabaseConnection.html" target="_top">Frames</a></li>
<li><a href="DatabaseConnection.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 com.complet.DatabaseConnection" class="title">Uses of Class<br>com.complet.DatabaseConnection</h2>
</div>
<div class="classUseContainer">No usage of com.complet.DatabaseConnection</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../com/complet/package-summary.html">Package</a></li>
<li><a href="../../../com/complet/DatabaseConnection.html" title="class in com.complet">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?com/complet/class-use/DatabaseConnection.html" target="_top">Frames</a></li>
<li><a href="DatabaseConnection.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>
|
Java
|
//Copyright (c) 2014 by Disy Informationssysteme GmbH
package net.disy.eenvplus.tfes.modules.sparql.expression;
import com.hp.hpl.jena.sparql.expr.E_LogicalAnd;
import com.hp.hpl.jena.sparql.expr.E_LogicalOr;
import com.hp.hpl.jena.sparql.expr.Expr;
import com.hp.hpl.jena.sparql.syntax.ElementFilter;
// NOT_PUBLISHED
public class SparqlExpressionBuilder {
private Expr current;
private SparqlExpressionBuilder(Expr expression) {
this.current = expression;
}
public static SparqlExpressionBuilder use(Expr expression) {
return new SparqlExpressionBuilder(expression);
}
public Expr toExpr() {
return current;
}
public ElementFilter toElementFilter() {
return new ElementFilter(current);
}
public SparqlExpressionBuilder and(Expr expression) {
if (expression != null) {
current = new E_LogicalAnd(current, expression);
}
return this;
}
public SparqlExpressionBuilder and(Expr expression, boolean condition) {
if (condition) {
return and(expression);
}
return this;
}
public SparqlExpressionBuilder or(Expr expression) {
if (expression != null) {
current = new E_LogicalOr(current, expression);
}
return this;
}
}
|
Java
|
(function (chaiJquery) {
// Module systems magic dance.
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
// NodeJS
module.exports = chaiJquery;
} else if (typeof define === "function" && define.amd) {
// AMD
define(function () {
return chaiJquery;
});
} else {
// Other environment (usually <script> tag): pass into global chai
var global = (false || eval)("this");
global.chai.use(chaiJquery);
}
}(function (chai, utils) {
var inspect = utils.inspect,
flag = utils.flag;
jQuery.fn.inspect = function (depth) {
var el = jQuery('<div />').append(this.clone());
if (depth) {
var children = el.children();
while (depth-- > 0)
children = children.children();
children.html('...');
}
return el.html();
};
chai.Assertion.addMethod('attr', function (name, val) {
var actual = flag(this, 'object').attr(name);
if (!flag(this, 'negate') || undefined === val) {
this.assert(
undefined !== actual
, 'expected #{this} to have a #{exp} attribute'
, 'expected #{this} not to have a #{exp} attribute'
, name
);
}
if (undefined !== val) {
this.assert(
val === actual
, 'expected #{this} to have a ' + inspect(name) + ' attribute with the value #{exp}, but the value was #{act}'
, 'expected #{this} not to have a ' + inspect(name) + ' attribute with the value #{act}'
, val
, actual
);
}
flag(this, 'object', actual);
});
chai.Assertion.addMethod('data', function (name, val) {
// Work around a chai bug (https://github.com/logicalparadox/chai/issues/16)
if (flag(this, 'negate') && undefined !== val && undefined === flag(this, 'object').data(name)) {
return;
}
var assertion = new chai.Assertion(flag(this, 'object').data());
if (flag(this, 'negate'))
assertion = assertion.not;
assertion.property(name, val);
});
chai.Assertion.addMethod('class', function (className) {
this.assert(
flag(this, 'object').hasClass(className)
, 'expected #{this} to have class #{exp}'
, 'expected #{this} not to have class #{exp}'
, className
);
});
chai.Assertion.addMethod('id', function (id) {
this.assert(
flag(this, 'object').attr('id') === id
, 'expected #{this} to have id #{exp}'
, 'expected #{this} not to have id #{exp}'
, id
);
});
chai.Assertion.addMethod('html', function (html) {
this.assert(
flag(this, 'object').html() === html
, 'expected #{this} to have HTML #{exp}'
, 'expected #{this} not to have HTML #{exp}'
, html
);
});
chai.Assertion.addMethod('text', function (text) {
this.assert(
flag(this, 'object').text() === text
, 'expected #{this} to have text #{exp}'
, 'expected #{this} not to have text #{exp}'
, text
);
});
chai.Assertion.addMethod('value', function (value) {
this.assert(
flag(this, 'object').val() === value
, 'expected #{this} to have value #{exp}'
, 'expected #{this} not to have value #{exp}'
, value
);
});
jQuery.each(['visible', 'hidden', 'selected', 'checked', 'disabled'], function (i, attr) {
chai.Assertion.addProperty(attr, function () {
this.assert(
flag(this, 'object').is(':' + attr)
, 'expected #{this} to be ' + attr
, 'expected #{this} not to be ' + attr);
});
});
chai.Assertion.overwriteProperty('exist', function (_super) {
return function () {
var obj = flag(this, 'object');
if (obj instanceof jQuery) {
this.assert(
obj.length > 0
, 'expected ' + inspect(obj.selector) + ' to exist'
, 'expected ' + inspect(obj.selector) + ' not to exist');
} else {
_super.apply(this, arguments);
}
};
});
chai.Assertion.overwriteProperty('be', function (_super) {
return function () {
var be = function (selector) {
var obj = flag(this, 'object');
if (obj instanceof jQuery) {
this.assert(
obj.is(selector)
, 'expected #{this} to be #{exp}'
, 'expected #{this} not to be #{exp}'
, selector
);
} else {
_super.apply(this, arguments);
}
};
be.__proto__ = this;
return be;
}
});
chai.Assertion.overwriteMethod('match', function (_super) {
return function (selector) {
var obj = flag(this, 'object');
if (obj instanceof jQuery) {
this.assert(
obj.is(selector)
, 'expected #{this} to match #{exp}'
, 'expected #{this} not to match #{exp}'
, selector
);
} else {
_super.apply(this, arguments);
}
}
});
chai.Assertion.overwriteProperty('contain', function (_super) {
return function () {
_super.call(this);
var contain = function (text) {
var obj = flag(this, 'object');
if (obj instanceof jQuery) {
this.assert(
obj.is(':contains(\'' + text + '\')')
, 'expected #{this} to contain #{exp}'
, 'expected #{this} not to contain #{exp}'
, text
);
} else {
Function.prototype.apply.call(_super.call(this), this, arguments);
}
};
contain.__proto__ = this;
return contain;
}
});
chai.Assertion.overwriteProperty('have', function (_super) {
return function () {
_super.call(this);
var have = function (selector) {
var obj = flag(this, 'object');
if (obj instanceof jQuery) {
this.assert(
// Using find() rather than has() to work around a jQuery bug:
// http://bugs.jquery.com/ticket/11706
obj.find(selector).length > 0
, 'expected #{this} to have #{exp}'
, 'expected #{this} not to have #{exp}'
, selector
);
}
};
have.__proto__ = this;
return have;
}
});
}));
|
Java
|
package util
import "errors"
var (
// ErrNotFound Import or Version was not found.
ErrNotFound = errors.New("Requested resource was not found")
// ErrAlreadyExists Import or Version already exists and cannot be overwritten.
ErrAlreadyExists = errors.New("Resource already exists and cannot be overritten")
// ErrDisabled Import or Version has been disabled and cannot be downloaded.
ErrDisabled = errors.New("Resource disabled")
)
|
Java
|
/*
* Software License Agreement (Apache License)
*
* Copyright (c) 2014, Southwest Research Institute
*
* 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 ROBOT_KINEMATICS_H_
#define ROBOT_KINEMATICS_H_
// TODO: The include below picks up Eigen::Isometry3d, but there is probably a better way
#include <moveit/kinematic_constraints/kinematic_constraint.h>
#include "descartes_core/utils.h"
namespace descartes_core
{
DESCARTES_CLASS_FORWARD(RobotModel);
/**@brief RobotModel defines the interface to a kinematics/dynamics functions. Implementations
* of this class will be used in conjunction with TrajectoryPt objects to determine forward
* and inverse kinematics
*
* All methods in this interface class assume a *FIXED* TOOL & WOBJ frame (see TrajectoryPt
* for frame definitions). The methods for setting/getting these frames are not defined by
* this class. Implementations of this interface should provide these either by construction
* or getter/setter methods.
*/
class RobotModel
{
public:
virtual ~RobotModel()
{
}
/**
* @brief Returns the joint pose closest to the seed pose for a desired affine pose
* @param pose Affine pose of TOOL in WOBJ frame
* @param seed_state Joint position seed (returned solution is "close" to the seed).
* @param joint_pose Solution (if function successful).
* @return True if successful
*/
virtual bool getIK(const Eigen::Isometry3d &pose, const std::vector<double> &seed_state,
std::vector<double> &joint_pose) const = 0;
/**
* @brief Returns "all" the joint poses("distributed" in joint space) for a desired affine pose.
* "All" is determined by each implementation (In the worst case, this means at least getIK).
* "Distributed" is determined by each implementation.
* @param pose Affine pose of TOOL in WOBJ frame
* @param joint_poses Solution (if function successful).
* @return True if successful
*/
virtual bool getAllIK(const Eigen::Isometry3d &pose, std::vector<std::vector<double> > &joint_poses) const = 0;
/**
* @brief Returns the affine pose
* @param joint_pose Solution (if function successful).
* @param pose Affine pose of TOOL in WOBJ frame
* @return True if successful
*/
virtual bool getFK(const std::vector<double> &joint_pose, Eigen::Isometry3d &pose) const = 0;
/**
* @brief Returns number of DOFs
* @return Int
*/
virtual int getDOF() const = 0;
/**
* @brief Performs all necessary checks to determine joint pose is valid
* @param joint_pose Pose to check
* @return True if valid
*/
virtual bool isValid(const std::vector<double> &joint_pose) const = 0;
/**
* @brief Performs all necessary checks to determine affine pose is valid
* @param pose Affine pose of TOOL in WOBJ frame
* @return True if valid
*/
virtual bool isValid(const Eigen::Isometry3d &pose) const = 0;
/**
* @brief Returns the joint velocity limits for each joint in the robot kinematic model
* @return Sequence of joint velocity limits. Units are a function of the joint type (m/s
* for linear joints; rad/s for rotational). size of vector == getDOF()
*/
virtual std::vector<double> getJointVelocityLimits() const = 0;
/**
* @brief Initializes the robot model when it is instantiated as a moveit_core plugin.
* @param robot_description name of the ros parameter containing the urdf description
* @param group_name the manipulation group for all the robot links that are part of the same kinematic chain
* @param world_frame name of the root link in the urdf
* @param tcp_frame tool link attached to the robot. When it's not in 'group_name' then it should have
* a fixed location relative to the last link in 'group_name'.
*/
virtual bool initialize(const std::string &robot_description, const std::string &group_name,
const std::string &world_frame, const std::string &tcp_frame) = 0;
/**
* @brief Enables collision checks
* @param check_collisions enables or disables collisions
*/
virtual void setCheckCollisions(bool check_collisions)
{
check_collisions_ = check_collisions;
}
/**
* @brief Indicates if collision checks are enabled
* @return Bool
*/
virtual bool getCheckCollisions()
{
return check_collisions_;
}
/**
* @brief Performs necessary checks to see if the robot is capable of moving from the initial joint pose
* to the final pose in dt seconds
* @param from_joint_pose [description]
* @param to_joint_pose [description]
* @param dt [description]
* @return [description]
*/
virtual bool isValidMove(const std::vector<double> &from_joint_pose, const std::vector<double> &to_joint_pose,
double dt) const
{
return isValidMove(from_joint_pose.data(), to_joint_pose.data(), dt);
}
virtual bool isValidMove(const double* s, const double* f, double dt) const = 0;
protected:
RobotModel() : check_collisions_(false)
{
}
bool check_collisions_;
};
} // descartes_core
#endif /* ROBOT_KINEMATICS_H_ */
|
Java
|
# Agropyron transiliense Popov SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
// Copyright (c) 2015 Illyriad Games Ltd. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.md in the project root for license information.
using System;
using System.Numerics;
namespace IllyriadGames.ByteArrayExtensions
{
public static class VectorizedCopyExtension
{
// Will be Jit'd to consts https://github.com/dotnet/coreclr/issues/1079
private static readonly int _vectorSpan = Vector<byte>.Count;
private static readonly int _vectorSpan2 = Vector<byte>.Count + Vector<byte>.Count;
private static readonly int _vectorSpan3 = Vector<byte>.Count + Vector<byte>.Count + Vector<byte>.Count;
private static readonly int _vectorSpan4 = Vector<byte>.Count + Vector<byte>.Count + Vector<byte>.Count + Vector<byte>.Count;
private const int _longSpan = sizeof(long);
private const int _longSpan2 = sizeof(long) + sizeof(long);
private const int _longSpan3 = sizeof(long) + sizeof(long) + sizeof(long);
private const int _intSpan = sizeof(int);
/// <summary>
/// Copies a specified number of bytes from a source array starting at a particular
/// offset to a destination array starting at a particular offset, not safe for overlapping data.
/// </summary>
/// <param name="src">The source buffer</param>
/// <param name="srcOffset">The zero-based byte offset into src</param>
/// <param name="dst">The destination buffer</param>
/// <param name="dstOffset">The zero-based byte offset into dst</param>
/// <param name="count">The number of bytes to copy</param>
/// <exception cref="ArgumentNullException"><paramref name="src"/> or <paramref name="dst"/> is null</exception>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="srcOffset"/>, <paramref name="dstOffset"/>, or <paramref name="count"/> is less than 0</exception>
/// <exception cref="ArgumentException">
/// The number of bytes in src is less
/// than srcOffset plus count.-or- The number of bytes in dst is less than dstOffset
/// plus count.
/// </exception>
/// <remarks>
/// Code must be optimized, in release mode and <see cref="Vector"/>.IsHardwareAccelerated must be true for the performance benefits.
/// </remarks>
public unsafe static void VectorizedCopy(this byte[] src, int srcOffset, byte[] dst, int dstOffset, int count)
{
#if !DEBUG
// Tests need to check even if IsHardwareAccelerated == false
// Check will be Jitted away https://github.com/dotnet/coreclr/issues/1079
if (Vector.IsHardwareAccelerated)
{
#endif
if (count > 512 + 64)
{
// In-built copy faster for large arrays (vs repeated bounds checks on Vector.ctor?)
Array.Copy(src, srcOffset, dst, dstOffset, count);
return;
}
if (src == null) throw new ArgumentNullException(nameof(src));
if (dst == null) throw new ArgumentNullException(nameof(dst));
if (count < 0 || srcOffset < 0 || dstOffset < 0) throw new ArgumentOutOfRangeException(nameof(count));
if (count == 0) return;
if (srcOffset + count > src.Length) throw new ArgumentException(nameof(src));
if (dstOffset + count > dst.Length) throw new ArgumentException(nameof(dst));
while (count >= _vectorSpan4)
{
new Vector<byte>(src, srcOffset).CopyTo(dst, dstOffset);
new Vector<byte>(src, srcOffset + _vectorSpan).CopyTo(dst, dstOffset + _vectorSpan);
new Vector<byte>(src, srcOffset + _vectorSpan2).CopyTo(dst, dstOffset + _vectorSpan2);
new Vector<byte>(src, srcOffset + _vectorSpan3).CopyTo(dst, dstOffset + _vectorSpan3);
if (count == _vectorSpan4) return;
count -= _vectorSpan4;
srcOffset += _vectorSpan4;
dstOffset += _vectorSpan4;
}
if (count >= _vectorSpan2)
{
new Vector<byte>(src, srcOffset).CopyTo(dst, dstOffset);
new Vector<byte>(src, srcOffset + _vectorSpan).CopyTo(dst, dstOffset + _vectorSpan);
if (count == _vectorSpan2) return;
count -= _vectorSpan2;
srcOffset += _vectorSpan2;
dstOffset += _vectorSpan2;
}
if (count >= _vectorSpan)
{
new Vector<byte>(src, srcOffset).CopyTo(dst, dstOffset);
if (count == _vectorSpan) return;
count -= _vectorSpan;
srcOffset += _vectorSpan;
dstOffset += _vectorSpan;
}
if (count > 0)
{
fixed (byte* srcOrigin = src)
fixed (byte* dstOrigin = dst)
{
var pSrc = srcOrigin + srcOffset;
var dSrc = dstOrigin + dstOffset;
if (count >= _longSpan)
{
var lpSrc = (long*)pSrc;
var ldSrc = (long*)dSrc;
if (count < _longSpan2)
{
count -= _longSpan;
pSrc += _longSpan;
dSrc += _longSpan;
*ldSrc = *lpSrc;
}
else if (count < _longSpan3)
{
count -= _longSpan2;
pSrc += _longSpan2;
dSrc += _longSpan2;
*ldSrc = *lpSrc;
*(ldSrc + 1) = *(lpSrc + 1);
}
else
{
count -= _longSpan3;
pSrc += _longSpan3;
dSrc += _longSpan3;
*ldSrc = *lpSrc;
*(ldSrc + 1) = *(lpSrc + 1);
*(ldSrc + 2) = *(lpSrc + 2);
}
}
if (count >= _intSpan)
{
var ipSrc = (int*)pSrc;
var idSrc = (int*)dSrc;
count -= _intSpan;
pSrc += _intSpan;
dSrc += _intSpan;
*idSrc = *ipSrc;
}
while (count > 0)
{
count--;
*dSrc = *pSrc;
dSrc += 1;
pSrc += 1;
}
}
}
#if !DEBUG
}
else
{
Array.Copy(src, srcOffset, dst, dstOffset, count);
return;
}
#endif
}
}
}
|
Java
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
#if USE_FASTQUANT
namespace FastQuant.Tests
#else
namespace SmartQuant.Tests
#endif
{
public class TickSeriesTest
{
[Fact]
public void TestGetIndex()
{
var ts = new TickSeries("test");
for (int i = 0; i < 10; ++i)
ts.Add(new Tick { DateTime = new DateTime(2000, 1, 1, 10, i, 30) });
var firstDt = new DateTime(2000, 1, 1, 10, 3, 30);
var firstTick = new Tick { DateTime = firstDt };
var lastDt = new DateTime(2000, 1, 1, 10, 9, 30);
var lastTick = new Tick { DateTime = lastDt };
// DateTime is in the middle;
Assert.Equal(3, ts.GetIndex(firstDt, IndexOption.Null));
Assert.Equal(-1, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 25), IndexOption.Null));
Assert.Equal(4, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 30), IndexOption.Null));
Assert.Equal(4, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 30), IndexOption.Prev));
Assert.Equal(4, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 30), IndexOption.Next));
Assert.Equal(-1, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 25), IndexOption.Null));
Assert.Equal(3, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 25), IndexOption.Prev));
Assert.Equal(4, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 25), IndexOption.Next));
Assert.Equal(-1, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 40), IndexOption.Null));
Assert.Equal(4, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 40), IndexOption.Prev));
Assert.Equal(5, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 40), IndexOption.Next));
// DateTime > LastDateTime
Assert.Equal(5, ts.GetIndex(new DateTime(2000, 1, 1, 10, 4, 40), IndexOption.Next));
Assert.Equal(-1, ts.GetIndex(new DateTime(2000, 1, 1, 10, 11, 30), IndexOption.Null));
Assert.Equal(9, ts.GetIndex(new DateTime(2000, 1, 1, 10, 11, 30), IndexOption.Prev));
Assert.Equal(-1, ts.GetIndex(new DateTime(2000, 1, 1, 10, 11, 30), IndexOption.Next));
// DateTime < FirstDateTime
Assert.Equal(-1, ts.GetIndex(new DateTime(2000, 1, 1, 9, 31, 30), IndexOption.Null));
Assert.Equal(-1, ts.GetIndex(new DateTime(2000, 1, 1, 9, 31, 30), IndexOption.Prev));
Assert.Equal(0, ts.GetIndex(new DateTime(2000, 1, 1, 9, 31, 30), IndexOption.Next));
}
}
}
|
Java
|
package com.sectong.util;
import org.apache.log4j.Logger;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
public class HttpUtil {
private static Logger logger = Logger.getLogger(HttpUtil.class);
private final static int CONNECT_TIMEOUT = 5000; // in milliseconds
private final static String DEFAULT_ENCODING = "UTF-8";
public static String postData(String urlStr, String data){
return postData(urlStr, data, null);
}
public static String postData(String urlStr, String data, String contentType){
BufferedReader reader = null;
try {
URL url = new URL(urlStr);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
conn.setConnectTimeout(CONNECT_TIMEOUT);
conn.setReadTimeout(CONNECT_TIMEOUT);
if(contentType != null)
conn.setRequestProperty("content-type", contentType);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream(), DEFAULT_ENCODING);
if(data == null)
data = "";
writer.write(data);
writer.flush();
writer.close();
reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), DEFAULT_ENCODING));
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line);
sb.append("\r\n");
}
return sb.toString();
} catch (IOException e) {
logger.error("Error connecting to " + urlStr + ": " + e.getMessage());
} finally {
try {
if (reader != null)
reader.close();
} catch (IOException e) {
}
}
return null;
}
}
|
Java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.