text stringlengths 2 1.04M | meta dict |
|---|---|
package scalan.pointers
import scala.reflect.runtime.universe._
import scalan.util.{Covariant, Invariant}
import scalan.{Base, Scalan, ScalanExp}
trait PointerOps extends Base { self: Scalan =>
class Pointer[A](implicit val eA: Elem[A])
class Scalar[A](implicit val eA: Elem[A])
def nullPtr[A: Elem]: Rep[Pointer[A]]
def scalarPtr[A: Elem](source: Rep[A]): Rep[Pointer[A]]
def arrayPtr[A: Elem](xs: Rep[Array[A]]): Rep[Pointer[A]]
case class PointerElem[A, To <: Pointer[A]](eItem: Elem[A]) extends EntityElem[To] {
def parent: Option[Elem[_]] = None
override lazy val typeArgs = TypeArgs("A" -> (eItem -> Invariant))
override lazy val tag = {
implicit val ttag = eItem.tag
weakTypeTag[Pointer[A]].asInstanceOf[WeakTypeTag[To]]
}
def convertPointer(x: Rep[Pointer[A]]): Rep[To] = x.asRep[To]
protected def getDefaultRep = convertPointer(nullPtr[A](eItem))
}
implicit def PointerElement[A](implicit eItem: Elem[A]): Elem[Pointer[A]] =
new PointerElem[A, Pointer[A]](eItem)
case class ScalarElem[A: Elem, To <: Scalar[A]](eItem: Elem[A]) extends EntityElem[To] {
def parent: Option[Elem[_]] = None
override lazy val typeArgs = TypeArgs("A" -> (eItem -> Covariant))
override lazy val tag = {
implicit val ttag = eItem.tag
weakTypeTag[Scalar[A]].asInstanceOf[WeakTypeTag[To]]
}
def convertScalar(x: Rep[Scalar[A]]): Rep[To] = x.asRep[To]
protected def getDefaultRep = convertScalar(eItem.defaultRepValue.asRep[Scalar[A]])
}
implicit def ScalarElement[A](implicit eItem: Elem[A]): Elem[Scalar[A]] =
new ScalarElem[A, Scalar[A]](eItem)
}
trait PointerOpsExp extends PointerOps { self: ScalanExp =>
case class NullPtr[A]()(implicit val eA: Elem[A]) extends BaseDef[Pointer[A]]
def nullPtr[A: Elem]: Exp[Pointer[A]] = NullPtr[A]()
// type Scalar for case when Exp[A] is a value and no pointer can be applied
case class CreateScalar[A](source: Exp[A])(implicit val eA: Elem[A]) extends BaseDef[Scalar[A]]
case class ScalarPtr[A](xScalar: Exp[Scalar[A]])(implicit val eA: Elem[A]) extends BaseDef[Pointer[A]]
def scalarPtr[A: Elem](source: Exp[A]): Exp[Pointer[A]] = {
source.elem match {
case be: BaseElem[_] => ScalarPtr(CreateScalar(source))
case _ => !!!(s"not allowed to make scalar pointer for non-BaseElem: ${source.elem}", source)
}
}
case class ArrayPtr[A](xs: Exp[Array[A]])(implicit val eA: Elem[A]) extends BaseDef[Pointer[A]]
def arrayPtr[A: Elem](xs: Exp[Array[A]]): Exp[Pointer[A]] = ArrayPtr(xs)
}
| {
"content_hash": "39dd2980e641c3eba198f9548d592d6e",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 104,
"avg_line_length": 41.91803278688525,
"alnum_prop": 0.67774736018772,
"repo_name": "scalan/scalan",
"id": "697c8f291e3d82466a94ea8e9a2e2c2e5cb1cb2f",
"size": "2557",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pointers/src/main/scala/scalan/pointers/PointerOps.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "31495"
},
{
"name": "Java",
"bytes": "2702"
},
{
"name": "Scala",
"bytes": "2562405"
},
{
"name": "Shell",
"bytes": "2871"
}
],
"symlink_target": ""
} |
import { BaseAccessor } from './base';
const { TEXT_NODE, ELEMENT_NODE } = window.Node;
export class TextAccessor extends BaseAccessor {
static test (node, name) {
if (node.nodeType === TEXT_NODE) {
return true;
}
return name === 'text' && node.nodeType === ELEMENT_NODE;
}
constructor (node) {
super(node, 'textContent');
}
set (value = '') {
if (value !== this.node.textContent) {
this.node.textContent = value;
}
}
}
| {
"content_hash": "16b08456511deeb26c9dd389cbf48ada",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 61,
"avg_line_length": 20.565217391304348,
"alnum_prop": 0.5961945031712473,
"repo_name": "xinix-technology/xin",
"id": "021b7d74dd29fba2bdf854ab1e3b4d7cead54adc",
"size": "473",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "component/accessors/text.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2181"
},
{
"name": "HTML",
"bytes": "11176"
},
{
"name": "JavaScript",
"bytes": "122093"
}
],
"symlink_target": ""
} |
class Card < ActiveRecord::Base
has_many :card_bank_partners
has_many :bank_partners, through: :card_bank_partners
belongs_to :category
# accepts_nested_attributes_for :bank_partners
enum :c_type => [:personal, :business]
validates :name, :uniqueness => true
NON_VALIDATABLE_ATTR = ["id", "created_at", "updated_at"]
VALIDATABLE_ATTR = self.attribute_names.reject{|attr| NON_VALIDATABLE_ATTR.include?(attr)}
validates_presence_of VALIDATABLE_ATTR
def bank_partners_attributes=(bank_partners_attributes)
bank_partners_attributes.each do |i, attributes|
if attributes[:name].present?
bank_partner = BankPartner.find_or_create_by(:name => attributes[:name])
if !self.bank_partners.include?(bank_partner)
self.bank_partners << bank_partner
end
end
end
end
def self.type(c_type)
Card.all.find_all do |card|
card.c_type == c_type
end
end
end | {
"content_hash": "03dbaef6bd9a7e92736a563de0abb748",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 91,
"avg_line_length": 29.939393939393938,
"alnum_prop": 0.645748987854251,
"repo_name": "mo6709/credit_cards_managment",
"id": "1f10021a72c57e0301c56aaaa58a9021fc12fe05",
"size": "988",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/card.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5288"
},
{
"name": "CoffeeScript",
"bytes": "1477"
},
{
"name": "HTML",
"bytes": "20888"
},
{
"name": "JavaScript",
"bytes": "4949"
},
{
"name": "Ruby",
"bytes": "61948"
}
],
"symlink_target": ""
} |
suite('FontSizeSlider', function() {
test('Font Scale Desktop Selection', function() {
chai.assert.strictEqual(pincher, undefined);
const documentElement = document.documentElement;
const fontSizeSelector = document.getElementById('font-size-selection');
useFontScaling(1);
chai.assert.equal(documentElement.style.fontSize, '16px');
useFontScaling(3);
chai.assert.equal(documentElement.style.fontSize, '48px');
useFontScaling(0.875);
chai.assert.equal(documentElement.style.fontSize, '14px');
});
});
| {
"content_hash": "6bfe772518098afa5586cb7c7610d5a7",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 76,
"avg_line_length": 34,
"alnum_prop": 0.7224264705882353,
"repo_name": "chromium/chromium",
"id": "f146fd335e0fb853958699038c07a65d2cd33e68",
"size": "688",
"binary": false,
"copies": "6",
"ref": "refs/heads/main",
"path": "components/test/data/dom_distiller/font_size_slider_tester.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<?php
namespace Markette\GopayInline;
use Markette\GopayInline\Api\Gateway;
class Config
{
// Modes
const PROD = 'PROD';
const TEST = 'TEST';
/** @var float */
private $goId;
/** @var string */
private $clientId;
/** @var string */
private $clientSecret;
/** @var string */
private $mode;
/**
* @param float $goId
* @param string $clientId
* @param string $clientSecret
* @param string $mode
*/
public function __construct($goId, $clientId, $clientSecret, $mode = self::TEST)
{
$this->goId = $goId;
$this->clientId = $clientId;
$this->clientSecret = $clientSecret;
$this->setMode($mode);
}
/**
* @return float
*/
public function getGoId()
{
return $this->goId;
}
/**
* @return string
*/
public function getClientId()
{
return $this->clientId;
}
/**
* @return string
*/
public function getClientSecret()
{
return $this->clientSecret;
}
/**
* @return string
*/
public function getMode()
{
return $this->mode;
}
/**
* @param string $mode
* @return void
*/
public function setMode($mode)
{
if ($mode === self::PROD) {
Gateway::init(Gateway::PROD);
$this->mode = self::PROD;
} else {
Gateway::init(Gateway::TEST);
$this->mode = self::TEST;
}
}
}
| {
"content_hash": "c14f136fef7d748349f6989c7f265112",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 81,
"avg_line_length": 14.448275862068966,
"alnum_prop": 0.6014319809069213,
"repo_name": "vojtasvoboda/GopayInline",
"id": "e5b5fe23bf101946901d3104fefc9fc1596dea88",
"size": "1257",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Config.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "125"
},
{
"name": "JavaScript",
"bytes": "199"
},
{
"name": "PHP",
"bytes": "119116"
},
{
"name": "Shell",
"bytes": "93"
}
],
"symlink_target": ""
} |
#include "win32inc.hpp"
#define HRESULT LONG
using namespace System;
using namespace System::IO;
using namespace System::Collections;
using namespace System::Reflection;
using namespace System::Runtime::InteropServices;
using namespace System::Collections::Specialized;
using namespace System::Xml;
using namespace System::Xml::XPath;
using namespace System::Printing::Interop;
using namespace System::IO::Packaging;
using namespace System::Windows::Documents;
using namespace System::Windows::Xps::Serialization;
using namespace System::Windows::Xps::Packaging;
using namespace System::Security::Permissions;
using namespace System::Drawing::Printing;
#ifndef __PRINTSYSTEMINTEROPINC_HPP__
#include <PrintSystemInteropInc.hpp>
#endif
#ifndef __GENERICTHUNKINGINC_HPP__
#include <GenericThunkingInc.hpp>
#endif
#ifndef __PRINTSYSTEMINC_HPP__
#include <PrintSystemInc.hpp>
#endif
#ifndef __PRINTSYSTEMPATHRESOLVER_HPP__
#include <PrintSystemPathResolver.hpp>
#endif
using namespace System::Printing;
using namespace System::Printing::IndexedProperties;
#ifndef __PRINTSYSTEMATTRIBUTEVALUEFACTORY_HPP__
#include <PrintSystemAttributeValueFactory.hpp>
#endif
#ifndef __PRINTSYSTEMOBJECTFACTORY_HPP__
#include <PrintSystemObjectFactory.hpp>
#endif
#ifndef __OBJECTSATTRIBUTESVALUESFACTORY_HPP__
#include <ObjectsAttributesValuesFactory.hpp>
#endif
using namespace System::Printing::Activation;
#ifndef __GETDATATHUNKOBJECT_HPP__
#include <GetDataThunkObject.hpp>
#endif
#ifndef __ENUMDATATHUNKOBJECT_HPP__
#include <EnumDataThunkObject.hpp>
#endif
#ifndef __SETDATATHUNKOBJECT_HPP__
#include <SetDataThunkObject.hpp>
#endif
#ifndef __PREMIUMPRINTSTREAM_HPP__
#include <PremiumPrintStream.hpp>
#endif
using namespace System::Threading;
[assembly:System::Runtime::InteropServices::ComVisibleAttribute(false)];
using namespace MS::Internal;
using namespace MS::Internal::PrintWin32Thunk::DirectInteropForPrintQueue;
using namespace System::Security;
using namespace System::Security::Permissions;
using namespace System::Drawing::Printing;
/*--------------------------------------------------------------------------------------*/
/* PrintQueue Implementation */
/*--------------------------------------------------------------------------------------*/
/*++
Function Name:
PrintQueue
Description:
Constructor of class instance
Parameters:
PrintServer: Server on which object would be instantiated
Null == on this local print server
String: Name of the Print Queue targeted on that server
Return Value
None
--*/
PrintQueue::
PrintQueue(
PrintServer^ printServer,
String^ printQueueName
):
printerThunkHandler(nullptr),
printTicketManager(nullptr),
refreshPropertiesFilter(nullptr),
hostingPrintServer(printServer),
fullQueueName(nullptr),
clientPrintSchemaVersion(1),
printingIsCancelled(false),
accessVerifier(nullptr),
_lockObject(gcnew Object())
{
Initialize(printServer, printQueueName, (array<String^>^)(nullptr), nullptr);
}
/*++
Function Name:
PrintQueue
Description:
Constructor of class instance
Parameters:
PrintServer: Server on which object would be instantiated
Null == on this local print server
String: Name of the Print Queue targeted on that server
Int32: client schema version
Return Value
None
--*/
PrintQueue::
PrintQueue(
PrintServer^ printServer,
String^ printQueueName,
Int32 printSchemaVersion
):
printerThunkHandler(nullptr),
printTicketManager(nullptr),
refreshPropertiesFilter(nullptr),
hostingPrintServer(printServer),
fullQueueName(nullptr),
clientPrintSchemaVersion(printSchemaVersion),
printingIsCancelled(false),
accessVerifier(nullptr),
_lockObject(gcnew Object())
{
Initialize(printServer, printQueueName, (array<String^>^)(nullptr), nullptr);
}
/*++
Function Name:
PrintQueue
Description:
Constructor of class instance
Parameters:
PrintServer: Server on which object would be instantiated
Null == on this local print server
String: Name of the Print Queue targeted on that server
String[]: Names of properties that the queue would be
initialized with. If someone is interested in a
subset of the the PrintQueue properties they
could require a parameter looking like
new String^[]={"Comment","Location"}
Return Value
None
--*/
PrintQueue::
PrintQueue(
PrintServer^ printServer,
String^ printQueueName,
array<String^>^ propertiesFilter
):
printerThunkHandler(nullptr),
printTicketManager(nullptr),
refreshPropertiesFilter(nullptr),
hostingPrintServer(printServer),
fullQueueName(nullptr),
clientPrintSchemaVersion(1),
printingIsCancelled(false),
accessVerifier(nullptr),
_lockObject(gcnew Object())
{
Initialize(printServer, printQueueName, propertiesFilter, nullptr);
}
/*++
Function Name:
PrintQueue
Description:
Constructor of class instance
Parameters:
PrintServer: Server on which object would be instantiated
Null == on this local print server
String: Name of the Print Queue targeted on that server
PrintQueueIndexedProperty[]: Enums of properties that the queue would be
initialized with. If someone is interested in a
subset of the the PrintQueue properties they
could require a parameter looking like
PrintQueueIndexedProperty[]={PrintQueueIndexedProperty::QueueDriver,
PrintQueueIndexedProperty::QueueStatus}
Return Value
None
--*/
PrintQueue::
PrintQueue(
PrintServer^ printServer,
String^ printQueueName,
array<PrintQueueIndexedProperty>^ propertiesFilter
):
printerThunkHandler(nullptr),
printTicketManager(nullptr),
refreshPropertiesFilter(nullptr),
hostingPrintServer(printServer),
fullQueueName(nullptr),
clientPrintSchemaVersion(1),
printingIsCancelled(false),
accessVerifier(nullptr),
_lockObject(gcnew Object())
{
Initialize(printServer,
printQueueName,
PrintQueue::ConvertPropertyFilterToString(propertiesFilter),
nullptr);
}
/*++
Function Name:
PrintQueue
Description:
Constructor of class instance
Parameters:
PrintServer: Server on which object would be instantiated
Null == on this local print server
String: Name of the Print Queue targeted on that server
PrintSystemDesiredAccess: Security role-based deired access.
Return Value
None
--*/
PrintQueue::
PrintQueue(
PrintServer^ printServer,
String^ printQueueName,
PrintSystemDesiredAccess desiredAccess
):
printerThunkHandler(nullptr),
printTicketManager(nullptr),
refreshPropertiesFilter(nullptr),
hostingPrintServer(printServer),
fullQueueName(nullptr),
clientPrintSchemaVersion(1),
printingIsCancelled(false),
accessVerifier(nullptr),
_lockObject(gcnew Object())
{
PrinterDefaults^ printerDefaults = gcnew PrinterDefaults(nullptr,
nullptr,
desiredAccess);
Initialize(printServer, printQueueName, (array<String^>^)(nullptr), printerDefaults);
}
/*++
Function Name:
PrintQueue
Description:
Constructor of class instance
Parameters:
PrintServer: Server on which object would be instantiated
Null == on this local print server
String: Name of the Print Queue targeted on that server
Int32: Client Schema Version
PrintSystemDesiredAccess: Security role-based deired access.
Return Value
None
--*/
PrintQueue::
PrintQueue(
PrintServer^ printServer,
String^ printQueueName,
Int32 printSchemaVersion,
PrintSystemDesiredAccess desiredAccess
):
printerThunkHandler(nullptr),
printTicketManager(nullptr),
refreshPropertiesFilter(nullptr),
hostingPrintServer(printServer),
fullQueueName(nullptr),
clientPrintSchemaVersion(printSchemaVersion),
printingIsCancelled(false),
accessVerifier(nullptr),
_lockObject(gcnew Object())
{
PrinterDefaults^ printerDefaults = gcnew PrinterDefaults(nullptr,
nullptr,
desiredAccess);
Initialize(printServer, printQueueName, (array<String^>^)(nullptr), printerDefaults);
}
/*++
Function Name:
PrintQueue
Description:
Constructor of class instance
Parameters:
PrintServer: Server on which object would be instantiated
Null == on this local print server
String: Name of the Print Queue targeted on that server
String[]: Names of properties that the queue would be
initialized with. If someone is interested in a
subset of the the PrintQueue properties they
could require a parameter looking like
new String^[]={"Comment","Location"}
PrintSystemDesiredAccess: Security role-based deired access.
Return Value
None
--*/
PrintQueue::
PrintQueue(
PrintServer^ printServer,
String^ printQueueName,
array<String^>^ propertiesFilter,
PrintSystemDesiredAccess desiredAccess
):
printerThunkHandler(nullptr),
printTicketManager(nullptr),
refreshPropertiesFilter(nullptr),
hostingPrintServer(printServer),
fullQueueName(nullptr),
clientPrintSchemaVersion(1),
printingIsCancelled(false),
accessVerifier(nullptr),
_lockObject(gcnew Object())
{
PrinterDefaults^ printerDefaults = gcnew PrinterDefaults(nullptr,
nullptr,
desiredAccess);
Initialize(printServer, printQueueName, propertiesFilter, printerDefaults);
}
/*++
Function Name:
PrintQueue
Description:
Constructor of class instance
Parameters:
PrintServer: Server on which object would be instantiated
Null == on this local print server
String: Name of the Print Queue targeted on that server
PrintQueueIndexedProperty[]: Enums of properties that the queue would be
initialized with. If someone is interested in a
subset of the the PrintQueue properties they
could require a parameter looking like
PrintQueueIndexedProperty[]={PrintQueueIndexedProperty::QueueDriver,
PrintQueueIndexedProperty::QueueStatus}
PrintSystemDesiredAccess: Security role-based deired access.
Return Value
None
--*/
PrintQueue::
PrintQueue(
PrintServer^ printServer,
String^ printQueueName,
array<PrintQueueIndexedProperty>^ propertiesFilter,
PrintSystemDesiredAccess desiredAccess
):
printerThunkHandler(nullptr),
printTicketManager(nullptr),
refreshPropertiesFilter(nullptr),
hostingPrintServer(printServer),
fullQueueName(nullptr),
clientPrintSchemaVersion(1),
printingIsCancelled(false),
accessVerifier(nullptr),
_lockObject(gcnew Object())
{
PrinterDefaults^ printerDefaults = gcnew PrinterDefaults(nullptr,
nullptr,
desiredAccess);
Initialize(printServer,
printQueueName,
PrintQueue::ConvertPropertyFilterToString(propertiesFilter),
printerDefaults);
}
/*++
Function Name:
PrintQueue
Description:
Constructor of class instance for a browsable PritnQueue
used during enumerations
Parameters:
PrintQueueIndexedProperty[]: Enums of properties that the queue would be
initialized with. If someone is interested in a
subset of the the PrintQueue properties they
could require a parameter looking like
PrintQueueProperty[]={PrintQueueIndexedProperty::QueueDriver,
PrintQueueIndexedProperty::QueueStatus}
Return Value
None
--*/
PrintQueue::
PrintQueue(
array<String^>^ propertiesFilter
):
printerThunkHandler(nullptr),
printTicketManager(nullptr),
isBrowsable(true),
refreshPropertiesFilter(nullptr),
hostingPrintServer(nullptr),
fullQueueName(nullptr),
clientPrintSchemaVersion(1),
printingIsCancelled(false),
accessVerifier(nullptr),
_lockObject(gcnew Object())
{
try
{
InPartialTrust = false;
InitializeInternalCollections();
refreshPropertiesFilter = propertiesFilter;
}
catch (InternalPrintSystemException^ internalException)
{
throw CreatePrintQueueException(internalException->HResult, "PrintSystemException.PrintQueue.Generic");
}
}
/*++
Function Name:
PrintQueue
Description:
Constructor of class instance for a browsable PritnQueue
used during enumerations
Parameters:
PrintServer: The Print Server hosting the print queue
PrintQueueIndexedProperty[]: Enums of properties that the queue would be
initialized with. If someone is interested in a
subset of the the PrintQueue properties they
could require a parameter looking like
PrintQueueProperty[]={PrintQueueIndexedProperty::QueueDriver,
PrintQueueIndexedProperty::QueueStatus}
Return Value
None
--*/
PrintQueue::
PrintQueue(
PrintServer^ printServer,
array<String^>^ propertiesFilter
):
printerThunkHandler(nullptr),
printTicketManager(nullptr),
isBrowsable(true),
refreshPropertiesFilter(nullptr),
hostingPrintServer(printServer),
fullQueueName(nullptr),
clientPrintSchemaVersion(1),
printingIsCancelled(false),
accessVerifier(nullptr),
_lockObject(gcnew Object())
{
try
{
InPartialTrust = false;
InitializeInternalCollections();
refreshPropertiesFilter = propertiesFilter;
}
catch (InternalPrintSystemException^ internalException)
{
throw CreatePrintQueueException(internalException->HResult, "PrintSystemException.PrintQueue.Generic");
}
}
void
PrintQueue::
Initialize(
PrintServer^ printServer,
String^ printQueueName,
array<String^>^ propertiesFilter,
PrinterDefaults^ printerDefaults
)
{
bool disposePrinterThunkHandler = false;
GetDataThunkObject^ dataThunkObject = nullptr;
_currentJobSettings = nullptr;
InPartialTrust = false;
try
{
isWriterAttached = false;
writerStream = nullptr;
xpsDocument = nullptr;
InitializeInternalCollections();
PropertiesCollection->GetProperty("Name")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("Name")->Value = printQueueName;
//
// We have to resolve the name of the Print Server and the
// Print Queue to map to one entity to be usefull for dowlevel
// thunking
//
fullQueueName = PrepareNameForDownLevelConnectivity(printServer->Name,Name);
//
// Call the thunk code to do the actual OpenPrinter
//
printerThunkHandler = gcnew PrintWin32Thunk::PrinterThunkHandler(fullQueueName,printerDefaults);
//
// Since no Filters were provided in the constructor, I would
// instantiate an object with all possible properties populated
//
array<String^>^ propertiesAsStrings = PrintQueue::GetAllPropertiesFilter(propertiesFilter);
//
// Call the thunking code to populate the required properties of the
// PrintQueue Object
//
dataThunkObject = gcnew GetDataThunkObject(this->GetType());
dataThunkObject->PopulatePrintSystemObject(printerThunkHandler,
this,
propertiesAsStrings);
//
// When an object consumer asks for a refresh on the object,
// I only refresh the properties that he already asked for and
// those are maintained in the following array
//
refreshPropertiesFilter = propertiesAsStrings;
}
catch (InternalPrintSystemException^ internalException)
{
disposePrinterThunkHandler = true;
throw CreatePrintQueueException(internalException->HResult, "PrintSystemException.PrintQueue.Populate");
}
__finally
{
if (disposePrinterThunkHandler &&
printerThunkHandler)
{
delete printerThunkHandler;
printerThunkHandler = nullptr;
}
if (dataThunkObject)
{
delete dataThunkObject;
dataThunkObject = nullptr;
}
if (printerDefaults)
{
delete printerDefaults;
printerDefaults = nullptr;
}
}
}
void
PrintQueue::
ActivateBrowsableQueue(
void
)
{
bool disposePrinterThunkHandler = false;
try
{
PrinterDefaults^ printerDefaults = nullptr;
fullQueueName = PrepareNameForDownLevelConnectivity(hostingPrintServer->Name,Name);
printerThunkHandler = gcnew PrintWin32Thunk::PrinterThunkHandler(fullQueueName, printerDefaults);
}
catch (InternalPrintSystemException^ internalException)
{
disposePrinterThunkHandler = true;
throw CreatePrintQueueException(internalException->HResult, "PrintSystemException.PrintQueue.Populate");
}
__finally
{
if (disposePrinterThunkHandler &&
printerThunkHandler)
{
delete printerThunkHandler;
printerThunkHandler = nullptr;
}
}
}
/*++
Routine Name:
Install
Routine Description:
Installs a print queue on the print server
Arguments:
printServer - Print Server Object
printQueueName - print queue name
driverName - driver name
portNames[] - array of port names
printProcessorName - print processor name
printQueueAttributes - attributes
Return Value:
PrintQueue object representing the just installed printer.
--*/
PrintQueue^
PrintQueue::
Install(
PrintServer^ printServer,
String^ printQueueName,
String^ driverName,
array<String^>^ portNames,
String^ printProcessorName,
PrintQueueAttributes printQueueAttributes
)
{
PrintWin32Thunk::PrinterThunkHandler^ printerHandle = nullptr;
try
{
if (printQueueName && driverName && portNames)
{
printerHandle = PrintWin32Thunk::PrinterThunkHandler::ThunkAddPrinter(printServer->Name,
printQueueName,
driverName,
BuildPortNamesString(portNames),
printProcessorName,
nullptr,
nullptr,
nullptr,
nullptr,
static_cast<int>(printQueueAttributes),
0,
0);
}
}
catch (InternalPrintSystemException^ internalException)
{
if (printerHandle)
{
delete printerHandle;
}
throw printServer->CreatePrintServerException(internalException->HResult, "PrintSystemException.PrintServer.AddPrinter");
}
__finally
{
if (printerHandle)
{
delete printerHandle;
}
}
return gcnew PrintQueue(printServer, printQueueName);
}
/*++
Routine Name:
Install
Routine Description:
Installs a print queue on the print server
Arguments:
printServer - Print Server Object
printQueueName - print queue name
driverName - driver name
portNames[] - array of port names
printProcessorName - print processor name
printQueueAttributes - attributes
requiredPrintQueueProperty - either comment, sharename or location
requiredPriority - print queue priority
requiredDefaultPriority - print queue default priority
Return Value:
PrintQueue object representing the just installed printer.
--*/
PrintQueue^
PrintQueue::
Install(
PrintServer^ printServer,
String^ printQueueName,
String^ driverName,
array<String^>^ portNames,
String^ printProcessorName,
PrintQueueAttributes printQueueAttributes,
PrintQueueStringProperty^ requiredPrintQueueProperty,
Int32 requiredPriority,
Int32 requiredDefaultPriority
)
{
PrintWin32Thunk::PrinterThunkHandler^ printerHandle = nullptr;
try
{
if (printQueueName && driverName && portNames)
{
array<String^>^ commentLocationSharename = gcnew array<String^>(3);
try
{
int i = (int)requiredPrintQueueProperty->Type;
commentLocationSharename[i] = requiredPrintQueueProperty->Name;
}
catch (IndexOutOfRangeException^ e)
{
throw printServer->CreatePrintServerException(HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER),
"PrintSystemException.PrintServer.AddPrinter",
e);
}
printerHandle = PrintWin32Thunk::
PrinterThunkHandler::
ThunkAddPrinter(printServer->Name,
printQueueName,
driverName,
PrintQueue::BuildPortNamesString(portNames),
printProcessorName,
commentLocationSharename[(int)PrintQueueStringPropertyType::Comment],
commentLocationSharename[(int)PrintQueueStringPropertyType::Location],
commentLocationSharename[(int)PrintQueueStringPropertyType::ShareName],
nullptr,
static_cast<int>(printQueueAttributes),
requiredPriority,
requiredDefaultPriority);
}
}
catch (InternalPrintSystemException^ internalException)
{
if (printerHandle)
{
delete printerHandle;
}
throw printServer->CreatePrintServerException(internalException->HResult, "PrintSystemException.PrintServer.AddPrinter");
}
__finally
{
if (printerHandle)
{
delete printerHandle;
}
}
return gcnew PrintQueue(printServer, printQueueName);
}
/*++
Routine Name:
Install
Routine Description:
Installs a print queue on the print server
Arguments:
printServer - Print Server Object
printQueueName - print queue name
driverName - driver name
portNames[] - array of port names
printProcessorName - print processor name
printQueueAttributes - attributes
requiredShareName - share name
requiredComment - comment
requiredLocation - location
requiredSepFile - separator file
requiredPriority - print queue priority
requiredDefaultPriority - print queue default priority
Return Value:
PrintQueue object representing the just installed printer.
--*/
PrintQueue^
PrintQueue::
Install(
PrintServer^ printServer,
String^ printQueueName,
String^ driverName,
array<String^>^ portNames,
String^ printProcessorName,
PrintQueueAttributes printQueueAttributes,
String^ requiredShareName,
String^ requiredComment,
String^ requiredLocation,
String^ requiredSeparatorFile,
Int32 requiredPriority,
Int32 requiredDefaultPriority
)
{
PrintWin32Thunk::PrinterThunkHandler^ printerHandle = nullptr;
try
{
if (printQueueName && driverName && portNames)
{
printerHandle = PrintWin32Thunk::PrinterThunkHandler::ThunkAddPrinter(printServer->Name,
printQueueName,
driverName,
BuildPortNamesString(portNames),
printProcessorName,
requiredComment,
requiredLocation,
requiredShareName,
requiredSeparatorFile,
static_cast<int>(printQueueAttributes),
requiredPriority,
requiredDefaultPriority);
}
}
catch (InternalPrintSystemException^ internalException)
{
if (printerHandle)
{
delete printerHandle;
}
throw printServer->CreatePrintServerException(internalException->HResult, "PrintSystemException.PrintServer.AddPrinter");
}
__finally
{
if (printerHandle)
{
delete printerHandle;
}
}
return gcnew PrintQueue(printServer, printQueueName);
}
/*++
Routine Name:
Install
Routine Description:
Installs a print queue on the print server
Arguments:
printServer - Print Server Object
printQueueName - print queue name
driverName - driver name
portNames[] - array of port names
initParams - attribute value collection that specifies
the rest of the properties
Return Value:
PrintQueue object representing the just installed printer.
--*/
PrintQueue^
PrintQueue::
Install(
PrintServer^ printServer,
String^ printQueueName,
String^ driverName,
array<String^>^ portNames,
String^ printProcessorName,
PrintPropertyDictionary^ initParams
)
{
PrintWin32Thunk::PrinterThunkHandler^ printerHandle = nullptr;
PrinterInfoTwoSetter^ printInfoTwoLeveThunk = nullptr;
PrintQueue^ installedPrintQueue = nullptr;
try
{
if (printQueueName && driverName && portNames)
{
printInfoTwoLeveThunk = gcnew PrinterInfoTwoSetter;
IEnumerator^ initParamsEnumerator = initParams->GetEnumerator();
Hashtable^ setParameters = gcnew Hashtable;
//
// Set the attribute values in the printInfoTwoLeveThunk
// Skip the attributes that are not settable and that are covered by different levels
//
for ( ; initParamsEnumerator->MoveNext() ;)
{
DictionaryEntry^ collectionEntry = (DictionaryEntry^)initParamsEnumerator->Current;
PrintProperty^ attributeValue = (PrintProperty^)collectionEntry->Value;
if (attributeValue->Value)
{
if (!attributeValue->Name->Equals("HostingPrintServer") &&
!attributeValue->Name->Equals("Name"))
{
if (attributeValue->Name->Equals("UserPrintTicket") ||
attributeValue->Name->Equals("DefaultPrintTicket"))
{
setParameters->Add(attributeValue->Name, attributeValue);
}
else
{
printInfoTwoLeveThunk->SetValueFromName(PrintQueue::GetAttributeNamePerPrintQueueObject(attributeValue),
PrintQueue::GetAttributeValuePerPrintQueueObject(attributeValue));
}
}
}
}
//
// Overwrite the attributes with the values passed in as parameters
//
printInfoTwoLeveThunk->SetValueFromName("Name", printQueueName);
printInfoTwoLeveThunk->SetValueFromName("QueueDriverName", driverName);
printInfoTwoLeveThunk->SetValueFromName("QueuePortName", BuildPortNamesString(portNames));
printInfoTwoLeveThunk->SetValueFromName("QueuePrintProcessorName", printProcessorName);
printerHandle = PrintWin32Thunk::PrinterThunkHandler::ThunkAddPrinter(printServer->Name,
printInfoTwoLeveThunk);
//
// The printer was created. Set the rest of the attributes that weren't covered by level 2.
// If anything throws after this point we should try and delete the printer.
//
installedPrintQueue = gcnew PrintQueue(printServer, printQueueName, PrintSystemDesiredAccess::AdministratePrinter);
IEnumerator^ remainingParamsEnumerator = setParameters->GetEnumerator();
for ( ; remainingParamsEnumerator->MoveNext() ;)
{
DictionaryEntry^ collectionEntry = (DictionaryEntry^)remainingParamsEnumerator->Current;
PrintProperty^ attributeValue = (PrintProperty^)collectionEntry->Value;
installedPrintQueue->PropertiesCollection->GetProperty(attributeValue->Name)->Value = attributeValue->Value;
}
installedPrintQueue->Commit();
}
}
catch (PrintSystemException^ printException)
{
if (printerHandle)
{
delete printerHandle;
}
if (printInfoTwoLeveThunk)
{
delete printInfoTwoLeveThunk;
}
if (installedPrintQueue)
{
//
// printServer->DeletePrintQueue(printQueueName);
//
}
throw printException;
}
catch (InternalPrintSystemException^ internalException)
{
if (printerHandle)
{
delete printerHandle;
}
if (printInfoTwoLeveThunk)
{
delete printInfoTwoLeveThunk;
}
if (installedPrintQueue)
{
//
// printServer->DeletePrintQueue(printQueueName);
//
}
throw printServer->CreatePrintServerException(internalException->HResult, "PrintSystemException.PrintServer.AddPrinter");
}
__finally
{
if (printerHandle)
{
delete printerHandle;
}
if (printInfoTwoLeveThunk)
{
delete printInfoTwoLeveThunk;
}
}
return installedPrintQueue;
}
/*++
Routine Name:
DeletePrintQueue
Routine Description:
Deletes a print queue on the print server represented by the current object.
Arguments:
printQueueName - name of the print queue to be deleted
Return Value:
true if succeeded
--*/
bool
PrintQueue::
Delete(
String^ printQueueName
)
{
bool returnValue = false;
PrintWin32Thunk::PrinterThunkHandler^ printerThunkHandler = nullptr;
try
{
PrinterDefaults^ printerDefaults = gcnew PrinterDefaults(nullptr,
nullptr,
PrintSystemDesiredAccess::AdministratePrinter);
printerThunkHandler = gcnew PrintWin32Thunk::PrinterThunkHandler(printQueueName,
printerDefaults);
if (printerThunkHandler && !printerThunkHandler->IsInvalid)
{
returnValue = printerThunkHandler->ThunkDeletePrinter();
}
}
__finally
{
if (printerThunkHandler)
{
delete printerThunkHandler;
}
}
return returnValue;
}
void
PrintQueue::
InternalDispose(
bool disposing
)
{
if(!this->IsDisposed)
{
System::Threading::Monitor::Enter(_lockObject);
{
try
{
if(!IsDisposed)
{
if (disposing)
{
if (printerThunkHandler)
{
delete printerThunkHandler;
printerThunkHandler = nullptr;
}
if (printTicketManager)
{
delete printTicketManager;
printTicketManager = nullptr;
}
}
}
}
__finally
{
try
{
PrintSystemObject::InternalDispose(disposing);
}
__finally
{
this->IsDisposed = true;
System::Threading::Monitor::Exit(_lockObject);
}
}
}
}
}
PrintCapabilities^
PrintQueue::
GetPrintCapabilities(
PrintTicket^ printTicket
)
{
VerifyAccess();
PrintCapabilities^ capabilities = nullptr;
if (this->InPartialTrust)
{
(gcnew PrintingPermission(PrintingPermissionLevel::DefaultPrinting))->Assert();
}
try
{
if(printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
capabilities = printTicketManager->GetPrintCapabilities(printTicket);
}
__finally
{
if (this->InPartialTrust)
{
SecurityPermission::RevertAssert();
}
}
return capabilities;
}
PrintCapabilities^
PrintQueue::
GetPrintCapabilities(
void
)
{
VerifyAccess();
if(printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
return printTicketManager->GetPrintCapabilities(nullptr);
}
MemoryStream^
PrintQueue::
GetPrintCapabilitiesAsXml(
PrintTicket^ printTicket
)
{
VerifyAccess();
if(printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
return printTicketManager->GetPrintCapabilitiesAsXml(printTicket);
}
MemoryStream^
PrintQueue::
GetPrintCapabilitiesAsXml(
void
)
{
VerifyAccess();
if(printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
return printTicketManager->GetPrintCapabilitiesAsXml(nullptr);
}
ValidationResult
PrintQueue::
MergeAndValidatePrintTicket(
PrintTicket^ basePrintTicket,
PrintTicket^ deltaPrintTicket
)
{
VerifyAccess();
if(printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
return printTicketManager->MergeAndValidatePrintTicket(basePrintTicket,
deltaPrintTicket);
}
ValidationResult
PrintQueue::
MergeAndValidatePrintTicket(
PrintTicket^ basePrintTicket,
PrintTicket^ deltaPrintTicket,
PrintTicketScope scope
)
{
VerifyAccess();
if(printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
return printTicketManager->MergeAndValidatePrintTicket(basePrintTicket,
deltaPrintTicket,
scope);
}
/*++
Function Name:
Pause
Description:
Pause the Printer
Parameters:
None
Return Value
None
--*/
void
PrintQueue::
Pause(
void
)
{
VerifyAccess();
try
{
printerThunkHandler->ThunkSetPrinter(PRINTER_CONTROL_PAUSE);
}
catch (InternalPrintSystemException^ internalException)
{
throw CreatePrintQueueException(internalException->HResult,
"PrintSystemException.PrintQueue.Pause");
}
}
/*++
Function Name:
Purge
Description:
Deletes all the jobs in the printer
Parameters:
None
Return Value
None
--*/
void
PrintQueue::
Purge(
void
)
{
VerifyAccess();
try
{
printerThunkHandler->ThunkSetPrinter(PRINTER_CONTROL_PURGE);
}
catch (InternalPrintSystemException^ internalException)
{
throw CreatePrintQueueException(internalException->HResult,
"PrintSystemException.PrintQueue.Purge");
}
}
Boolean
PrintQueue::PrintingIsCancelled::
get(
void
)
{
VerifyAccess();
return printingIsCancelled;
}
void
PrintQueue::PrintingIsCancelled::
set(
Boolean isCancelled
)
{
VerifyAccess();
printingIsCancelled = isCancelled;
}
/*++
Function Name:
Resume
Description:
Resumes the pasued printer
Parameters:
None
Return Value
None
--*/
void
PrintQueue::
Resume(
void
)
{
VerifyAccess();
try
{
printerThunkHandler->ThunkSetPrinter(PRINTER_CONTROL_RESUME);
}
catch (InternalPrintSystemException^ internalException)
{
throw CreatePrintQueueException(internalException->HResult,
"PrintSystemException.PrintQueue.Resume");
}
}
PrintSystemJobInfo^
PrintQueue::
AddJob(
void
)
{
VerifyAccess();
// We need to pass down a print ticket so that the job ID will be available
// immediately. Since the caller did not specify a print ticket, we will use
// the user/default print ticket for this print queue.
PrintTicket^ printTicket = UserPrintTicket;
if(printTicket == nullptr)
{
printTicket = DefaultPrintTicket;
}
PrintSystemJobInfo^ jobInfo = PrintSystemJobInfo::Add(this, printTicket);
return jobInfo;
}
PrintSystemJobInfo^
PrintQueue::
AddJob(
String^ jobName
)
{
VerifyAccess();
// We need to pass down a print ticket so that the job ID will be available
// immediately. Since the caller did not specify a print ticket, we will use
// the user/default print ticket for this print queue.
PrintTicket^ printTicket = UserPrintTicket;
if(printTicket == nullptr)
{
printTicket = DefaultPrintTicket;
}
PrintSystemJobInfo^ jobInfo = PrintSystemJobInfo::Add(this, jobName, printTicket);
return jobInfo;
}
PrintSystemJobInfo^
PrintQueue::
AddJob(
String^ jobName,
PrintTicket^ printTicket
)
{
VerifyAccess();
// Get the UserPrintTicket. We don't need it, but fetching it has a side-effect
// of initializing the PrinterThunkHandler. In some cases (e.g. Win7 printing
// to XPS printer), this doesn't happen any other way so calling this method
// would get NullReferenceException (Dev11 780899).
PrintTicket ^userPrintTicket = UserPrintTicket;
if (userPrintTicket == nullptr) // keep the compiler from optimizing away the previous call
{
userPrintTicket = printTicket; // no real effect
}
// Note: in the other overloads of AddJob we defaulted to either the
// UserTicket or the DefaultTicket. We intentionally do not fallback to
// using those tickets if the caller passed in a null ticket to allow the
// caller to create a print job without a ticket. This will have the
// consequence on >= win8 that the JobID will not be available, but
// it allows the caller to avoid the consequences of using a print ticket
// that may specify incompatible settings with the print ticket in the
// payload written to the print stream.
PrintSystemJobInfo^ jobInfo = PrintSystemJobInfo::Add(this, jobName, printTicket);
return jobInfo;
}
PrintSystemJobInfo^
PrintQueue::
AddJob(
String^ jobName,
String^ document,
Boolean fastCopy
)
{
VerifyAccess();
PrintTicket^ printTicket = nullptr;
if (!IsXpsDevice)
{
// We need to pass down a print ticket so that the job ID will be available
// immediately. Since the caller did not specify a print ticket, we will use
// the user/default print ticket for this print queue.
printTicket = UserPrintTicket;
if(printTicket == nullptr)
{
printTicket = DefaultPrintTicket;
}
}
PrintSystemJobInfo^ jobInfo = PrintSystemJobInfo::Add(this, jobName, document, fastCopy, printTicket);
return jobInfo;
}
PrintSystemJobInfo^
PrintQueue::
AddJob(
String^ jobName,
String^ document,
Boolean fastCopy,
PrintTicket^ printTicket
)
{
VerifyAccess();
// Get the UserPrintTicket. We don't need it, but fetching it has a side-effect
// of initializing the PrinterThunkHandler. In some cases (e.g. Win7 printing
// to XPS printer), this doesn't happen any other way so calling this method
// would get NullReferenceException (Dev11 780899).
PrintTicket ^userPrintTicket = UserPrintTicket;
if (userPrintTicket == nullptr) // keep the compiler from optimizing away the previous call
{
userPrintTicket = printTicket; // no real effect
}
// Note: in the other overloads of AddJob we defaulted to either the
// UserTicket or the DefaultTicket. We intentionally do not fallback to
// using those tickets if the caller passed in a null ticket to allow the
// caller to create a print job without a ticket. This will have the
// consequence on >= win8 that the JobID will not be available, but
// it allows the caller to avoid the consequences of using a print ticket
// that may specify incompatible settings with the print ticket in the
// payload written to the print stream.
PrintSystemJobInfo^ jobInfo = PrintSystemJobInfo::Add(this, jobName, document, fastCopy, printTicket);
return jobInfo;
}
PrintSystemJobInfo^
PrintQueue::
GetJob(
Int32 jobId
)
{
VerifyAccess();
PrintSystemJobInfo^ jobInfo = PrintSystemJobInfo::Get(this, jobId);
return jobInfo;
}
PrintJobInfoCollection^
PrintQueue::
GetPrintJobInfoCollection(
void
)
{
VerifyAccess();
return gcnew PrintJobInfoCollection(this,PrintSystemJobInfo::GetAllPropertiesFilter());
}
/*++
Function Name:
The following are the set of functions that
set/get the PrintQueue properties
Description:
set/get Priority: A priority value that the spooler
uses to route print jobs.
set/get DefaultPriority: A default priority value assigned to
each print job.
set/get StartTime: The earliest time at which the PrintQueue
will print a job. This value is expressed
as minutes elapsed since 12:00 AM GMT
(Greenwich Mean Time).
set/get UntilTime: The latest time at which the PritnQueue will
print a job. This value is expressed as
minutes elapsed since 12:00 AM GMT
(Greenwich Mean Time).
set/get AveragePPM Specifies the average number of pages per
minute that have been printed on the PrintQueue
get NumberOfJobs Queries the number of print jobs that have
been queued for the PrintQueue.
set/get ShareName The sharepoint for the PrintQueue.
set/get Comment A brief description of the PrintQueue.
set/get Location The physical location of the PrintQueue (for
example, "Bldg. 38, Room 1164").
set/get Description Description of the contents of the structure
set/get SepFile The file used to create the separator page.
This page is used to separate print jobs sent
to the PrintQueue.
set/get QueueDriver The PrintQueue driver
set/get QueuePort The port used to transmit data to the PrintQueue
set/get QueuePrintProcessor The print processor
set/get DefaultPrintTicket The global default PrintQueue print ticket.
set/get UserPrintTicket The current user print ticket
get QueueStatus Thhe PrintQueue Status
get QueueAttributes
Parameters:
Either new values or None
Return Value
Either PrintQueue Properties or None
--*/
Int32
PrintQueue::Priority::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("Priority","Priority");
return priority;
}
void
PrintQueue::Priority::
set(
Int32 requiredPriority
)
{
VerifyAccess();
if(priority != requiredPriority)
{
priority = requiredPriority;
PropertiesCollection->GetProperty("Priority")->Value = priority;
}
}
Int32
PrintQueue::DefaultPriority::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("DefaultPriority","DefaultPriority");
return defaultPriority;
}
void
PrintQueue::DefaultPriority::
set(
Int32 requiredDefaultPriority
)
{
VerifyAccess();
if(defaultPriority != requiredDefaultPriority)
{
defaultPriority = requiredDefaultPriority;
PropertiesCollection->GetProperty("DefaultPriority")->Value = defaultPriority;
}
}
Int32
PrintQueue::StartTimeOfDay::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("StartTimeOfDay","StartTimeOfDay");
return startTime;
}
void
PrintQueue::StartTimeOfDay::
set(
Int32 requiredStartTime
)
{
VerifyAccess();
if(startTime != requiredStartTime)
{
startTime = requiredStartTime;
PropertiesCollection->GetProperty("StartTimeOfDay")->Value = startTime;
}
}
Int32
PrintQueue::UntilTimeOfDay::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("UntilTimeOfDay","UntilTimeOfDay");
return untilTime;
}
void
PrintQueue::UntilTimeOfDay::
set(
Int32 requiredUntilTime
)
{
VerifyAccess();
if(untilTime != requiredUntilTime)
{
untilTime = requiredUntilTime;
PropertiesCollection->GetProperty("UntilTimeOfDay")->Value = untilTime;
}
}
Int32
PrintQueue::AveragePagesPerMinute::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("AveragePagesPerMinute","AveragePagesPerMinute");
return averagePagesPerMinute;
}
Int32
PrintQueue::NumberOfJobs::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("NumberOfJobs","NumberOfJobs");
return numberOfJobs;
}
Boolean
PrintQueue::InPartialTrust::
get(
void
)
{
VerifyAccess();
return runsInPartialTrust;
}
void
PrintQueue::InPartialTrust::
set(
Boolean isPT
)
{
VerifyAccess();
(gcnew PrintingPermission(PrintingPermissionLevel::DefaultPrinting))->Demand();
runsInPartialTrust = isPT;
}
String^
PrintQueue::ShareName::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("ShareName","ShareName");
return shareName;
}
void
PrintQueue::ShareName::
set(
String^ newShareName
)
{
VerifyAccess();
if(shareName != newShareName ||
(newShareName &&
!newShareName->Equals(shareName)))
{
shareName = newShareName;
PropertiesCollection->GetProperty("ShareName")->Value = shareName;
if (!PropertiesCollection->GetProperty("ShareName")->IsInternallyInitialized)
{
Int32 attributes = Int32(queueAttributes);
if (shareName != nullptr)
{
attributes |= static_cast<Int32>(PrintQueueAttributes::Shared);
}
else
{
attributes &= ~static_cast<Int32>(PrintQueueAttributes::Shared);
}
get_InternalPropertiesCollection("Attributes")->GetProperty("Attributes")->Value = attributes;
PropertiesCollection->GetProperty("QueueAttributes")->IsDirty = true;
}
}
}
String^
PrintQueue::Comment::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("Comment","Comment");
return comment;
}
void
PrintQueue::Comment::
set(
String^ newComment
)
{
VerifyAccess();
if(comment != newComment ||
(newComment &&
!newComment->Equals(comment)))
{
comment = newComment;
PropertiesCollection->GetProperty("Comment")->Value = comment;
}
}
String^
PrintQueue::Description::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("Description","Description");
return description;
}
void
PrintQueue::Description::
set(
String^ newDescription
)
{
VerifyAccess();
if(description != newDescription ||
(newDescription &&
!newDescription->Equals(description)))
{
description = newDescription;
PropertiesCollection->GetProperty("Description")->Value = description;
}
}
String^
PrintQueue::Location::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("Location","Location");
return location;
}
void
PrintQueue::Location::
set(
String^ newLocation
)
{
VerifyAccess();
if(location != newLocation ||
(newLocation &&
!newLocation->Equals(location)))
{
location = newLocation;
PropertiesCollection->GetProperty("Location")->Value = location;
}
}
void
PrintQueue::Name::
set(
String^ name
)
{
Boolean mustResetInternalInitialization = false;
if(PrintSystemObject::Name::get() != name ||
(name&&
!name->Equals(PrintSystemObject::Name::get())))
{
//
// If the name is a UNC name revert to the pritner name
// after stripping the server part
//
Boolean isPrinterConnection = PrintSystemUNCPathResolver::ValidateUNCPath(name);
if(isPrinterConnection == true)
{
if(PropertiesCollection->GetProperty("Name")->IsInternallyInitialized)
{
mustResetInternalInitialization = true;
}
PrintSystemUNCPath----er^ ----er = gcnew PrintSystemUNCPath----er(name);
name = ----er->PrintQueueName;
if(!hostingPrintServer)
{
if(isBrowsable)
{
hostingPrintServer = gcnew PrintServer(----er->PrintServerName,PrintServerType::Browsable);
}
else
{
hostingPrintServer = gcnew PrintServer(----er->PrintServerName);
}
}
}
else
{
if(!hostingPrintServer)
{
hostingPrintServer = gcnew PrintServer();
}
}
if(!fullQueueName)
{
fullQueueName = PrepareNameForDownLevelConnectivity(hostingPrintServer->Name,name);
}
PrintSystemObject::Name::set(name);
PropertiesCollection->GetProperty("Name")->Value = PrintSystemObject::Name::get();
}
if(mustResetInternalInitialization)
{
PropertiesCollection->GetProperty("Name")->IsInternallyInitialized = true;
}
}
String^
PrintQueue::Name::
get(
void
)
{
return PrintSystemObject::Name::get();
}
String^
PrintQueue::SeparatorFile::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("SeparatorFile","SeparatorFile");
return separatorFile;
}
void
PrintQueue::SeparatorFile::
set(
String^ newSeparatorFile
)
{
VerifyAccess();
if(separatorFile != newSeparatorFile ||
(newSeparatorFile &&
!newSeparatorFile->Equals(newSeparatorFile)))
{
separatorFile = newSeparatorFile;
PropertiesCollection->GetProperty("SeparatorFile")->Value = separatorFile;
}
}
PrintTicket^
PrintQueue::UserPrintTicket::
get(
void
)
{
VerifyAccess();
if (userPrintTicket == nullptr)
{
if (this->InPartialTrust)
{
(gcnew PrintingPermission(PrintingPermissionLevel::DefaultPrinting))->Assert();
}
GetUnInitializedData("UserPrintTicket","UserDevMode");
try
{
if (userDevMode != nullptr)
{
if (printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
PropertiesCollection->GetProperty("UserPrintTicket")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("UserPrintTicket")->Value = printTicketManager->ConvertDevModeToPrintTicket(userDevMode);
delete userDevMode;
userDevMode = nullptr;
}
}
__finally
{
if (this->InPartialTrust)
{
SecurityPermission::RevertAssert();
}
}
}
return userPrintTicket;
}
void
PrintQueue::UserPrintTicket::
set(
PrintTicket^ newUserPrintTicket
)
{
VerifyAccess();
if(userPrintTicket != newUserPrintTicket)
{
userPrintTicket = newUserPrintTicket;
//
// Set the value for downlevel thunking
//
if(!PropertiesCollection->GetProperty("UserPrintTicket")->IsInternallyInitialized)
{
if (printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
array<Byte>^ devMode = printTicketManager->ConvertPrintTicketToDevMode(userPrintTicket, BaseDevModeType::UserDefault);
get_InternalPropertiesCollection("UserDevMode")->GetProperty("UserDevMode")->Value = devMode;
}
//
// Set the managed property
//
PropertiesCollection->GetProperty("UserPrintTicket")->Value = userPrintTicket;
}
}
PrintTicket^
PrintQueue::DefaultPrintTicket::
get(
void
)
{
VerifyAccess();
if (defaultPrintTicket == nullptr)
{
GetUnInitializedData("DefaultPrintTicket", "DefaultDevMode");
if (this->InPartialTrust)
{
(gcnew PrintingPermission(PrintingPermissionLevel::DefaultPrinting))->Assert();
}
try
{
if (defaultDevMode != nullptr)
{
if (printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
PropertiesCollection->GetProperty("DefaultPrintTicket")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("DefaultPrintTicket")->Value = printTicketManager->ConvertDevModeToPrintTicket(defaultDevMode);
delete defaultDevMode;
defaultDevMode = nullptr;
}
}
__finally
{
if (this->InPartialTrust)
{
SecurityPermission::RevertAssert();
}
}
}
return defaultPrintTicket;
}
void
PrintQueue::DefaultPrintTicket::
set(
PrintTicket^ newDefaultPrintTicket
)
{
VerifyAccess();
if(defaultPrintTicket != newDefaultPrintTicket)
{
defaultPrintTicket = newDefaultPrintTicket;
//
// Set the value for downlevel thunking
//
if(!PropertiesCollection->GetProperty("DefaultPrintTicket")->IsInternallyInitialized)
{
if (printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
array<Byte>^ devMode = printTicketManager->ConvertPrintTicketToDevMode(defaultPrintTicket, BaseDevModeType::PrinterDefault);
get_InternalPropertiesCollection("DefaultDevMode")->GetProperty("DefaultDevMode")->Value = devMode;
}
//
// Set the managed property
//
PropertiesCollection->GetProperty("DefaultPrintTicket")->Value = defaultPrintTicket;
}
}
PrintJobSettings^
PrintQueue::CurrentJobSettings::
get(
void
)
{
VerifyAccess();
if(_currentJobSettings == nullptr)
{
_currentJobSettings = gcnew PrintJobSettings(this->UserPrintTicket);
}
return _currentJobSettings;
}
PrintDriver^
PrintQueue::QueueDriver::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueDriver","QueueDriverName");
return queueDriver;
}
void
PrintQueue::QueueDriver::
set(
PrintDriver^ newDriver
)
{
VerifyAccess();
if(queueDriver != newDriver)
{
queueDriver = newDriver;
//
// Set the value for downlevel thunking
//
if(!PropertiesCollection->GetProperty("QueueDriver")->IsInternallyInitialized)
{
get_InternalPropertiesCollection("QueueDriverName")->GetProperty("QueueDriverName")->Value = queueDriver->Name;
}
//
// Set the Managed Property
//
PropertiesCollection->GetProperty("QueueDriver")->Value = newDriver;
}
}
PrintPort^
PrintQueue::QueuePort::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueuePort","QueuePortName");
return queuePort;
}
void
PrintQueue::QueuePort::
set(
PrintPort^ ----
)
{
VerifyAccess();
if(queuePort != ----)
{
queuePort = ----;
//
// Set the value for downlevel thunking
//
if(!PropertiesCollection->GetProperty("QueuePort")->IsInternallyInitialized)
{
get_InternalPropertiesCollection("QueuePortName")->GetProperty("QueuePortName")->Value = queuePort->Name;
}
//
// Set the Managed Property
//
PropertiesCollection->GetProperty("QueuePort")->Value = ----;
}
}
PrintProcessor^
PrintQueue::QueuePrintProcessor::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueuePrintProcessor","QueuePrintProcessorName");
return queuePrintProcessor;
}
void
PrintQueue::QueuePrintProcessor::
set(
PrintProcessor^ newPrintProcessor
)
{
VerifyAccess();
if(queuePrintProcessor != newPrintProcessor)
{
queuePrintProcessor = newPrintProcessor;
//
// Set the value for downlevel thunking
//
if(!PropertiesCollection->GetProperty("QueuePrintProcessor")->IsInternallyInitialized)
{
get_InternalPropertiesCollection("QueuePrintProcessorName")->
GetProperty("QueuePrintProcessorName")->Value = queuePrintProcessor->Name;
}
//
// Set the Managed Property
//
PropertiesCollection->GetProperty("QueuePrintProcessor")->Value = newPrintProcessor;
}
}
PrintServer^
PrintQueue::HostingPrintServer::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("HostingPrintServer","HostingPrintServerName");
return hostingPrintServer;
}
String^
PrintQueue::FullName::
get(
void
)
{
VerifyAccess();
return fullQueueName;
}
void
PrintQueue::HostingPrintServer::
set(
PrintServer^ printServer
)
{
VerifyAccess();
if(hostingPrintServer != printServer)
{
hostingPrintServer = printServer;
PropertiesCollection->GetProperty("HostingPrintServer")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("HostingPrintServer")->Value = printServer;
}
}
PrintQueueStatus
PrintQueue::QueueStatus::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return queueStatus;
}
/*++
Function Name:
set_Status
Description:
In the unmanaged world, status is a 32-bit value, but in
the managed world status is distributed over a number of
Boolean values each representing one individual PrintQueue
status like {PrintQueue Paused, PrintQueue suffering paper
jam ...} and it is this function that converts the unmanaged
representation to the managed one. Moreover it updates the
named property of the collection.
Parameters:
Int32: The 32-bit PrintQueue status
Return Value
None
--*/
void
PrintQueue::Status::
set(
Int32 status
)
{
queueStatus = static_cast<PrintQueueStatus>(status);
PropertiesCollection->GetProperty("QueueStatus")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("QueueStatus")->Value = queueStatus;
isPaused = (status & (static_cast<Int32>(PrintQueueStatus::Paused))) ? true : false;
isInError = (status & (static_cast<Int32>(PrintQueueStatus::Error))) ? true : false;
isPendingDeletion = (status & (static_cast<Int32>(PrintQueueStatus::PendingDeletion))) ? true : false;
isPaperJammed = (status & (static_cast<Int32>(PrintQueueStatus::PaperJam))) ? true : false;
isOutOfPaper = (status & (static_cast<Int32>(PrintQueueStatus::PaperOut))) ? true : false;
isManualFeedRequired = (status & (static_cast<Int32>(PrintQueueStatus::ManualFeed))) ? true : false;
hasPaperProblem = (status & (static_cast<Int32>(PrintQueueStatus::PaperProblem))) ? true : false;
isOffline = (status & (static_cast<Int32>(PrintQueueStatus::Offline))) ? true : false;
isIOActive = (status & (static_cast<Int32>(PrintQueueStatus::IOActive))) ? true : false;
isBusy = (status & (static_cast<Int32>(PrintQueueStatus::Busy))) ? true : false;
isPrinting = (status & (static_cast<Int32>(PrintQueueStatus::Printing))) ? true : false;
isOutputBinFull = (status & (static_cast<Int32>(PrintQueueStatus::OutputBinFull))) ? true : false;
isNotAvailable = (status & (static_cast<Int32>(PrintQueueStatus::NotAvailable))) ? true : false;
isWaiting = (status & (static_cast<Int32>(PrintQueueStatus::Waiting))) ? true : false;
isProcessing = (status & (static_cast<Int32>(PrintQueueStatus::Processing))) ? true : false;
isInitializing = (status & (static_cast<Int32>(PrintQueueStatus::Initializing))) ? true : false;
isWarmingUp = (status & (static_cast<Int32>(PrintQueueStatus::WarmingUp))) ? true : false;
isTonerLow = (status & (static_cast<Int32>(PrintQueueStatus::TonerLow))) ? true : false;
hasNoToner = (status & (static_cast<Int32>(PrintQueueStatus::NoToner))) ? true : false;
doPagePunt = (status & (static_cast<Int32>(PrintQueueStatus::PagePunt))) ? true : false;
needUserIntervention = (status & (static_cast<Int32>(PrintQueueStatus::UserIntervention))) ? true : false;
isOutOfMemory = (status & (static_cast<Int32>(PrintQueueStatus::OutOfMemory))) ? true : false;
isDoorOpened = (status & (static_cast<Int32>(PrintQueueStatus::DoorOpen))) ? true : false;
isServerUnknown = (status & (static_cast<Int32>(PrintQueueStatus::ServerUnknown))) ? true : false;
isPowerSaveOn = (status & (static_cast<Int32>(PrintQueueStatus::PowerSave))) ? true : false;
}
PrintQueueAttributes
PrintQueue::QueueAttributes::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return queueAttributes;
}
/*++
Function Name:
set_Attributes
Description:
In the unmanaged world, attributes is a 32-bit value, but in
the managed world attributes are distributed over a number of
Boolean values each representing one individual PrintQueue
attribute like {PrintQueue Shared, PrintQueue allows printing
while spooling ...} and it is this function that converts the
unmanaged representation to the managed one. Moreover it
updates the named property of the collection.
Parameters:
Int32: The 32-bit PrintQueue attributes
Return Value
None
--*/
void
PrintQueue::Attributes::
set(
Int32 attributes
)
{
queueAttributes= static_cast<PrintQueueAttributes>(attributes);
PropertiesCollection->GetProperty("QueueAttributes")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("QueueAttributes")->Value = queueAttributes;
isQueued = (attributes & (static_cast<Int32>(PrintQueueAttributes::Queued))) ? true : false;
isDirect = (attributes & (static_cast<Int32>(PrintQueueAttributes::Direct))) ? true : false;
isShared = (attributes & (static_cast<Int32>(PrintQueueAttributes::Shared))) ? true : false;
isHidden = (attributes & (static_cast<Int32>(PrintQueueAttributes::Hidden))) ? true : false;
isDevQueryEnabled = (attributes & (static_cast<Int32>(PrintQueueAttributes::EnableDevQuery))) ? true : false;
arePrintedJobsKept = (attributes & (static_cast<Int32>(PrintQueueAttributes::KeepPrintedJobs))) ? true : false;
areCompletedJobsScheduledFirst = (attributes & (static_cast<Int32>(PrintQueueAttributes::ScheduleCompletedJobsFirst))) ? true : false;
isBidiEnabled = (attributes & (static_cast<Int32>(PrintQueueAttributes::EnableBidi))) ? true : false;
isRawOnlyEnabled = (attributes & (static_cast<Int32>(PrintQueueAttributes::RawOnly))) ? true : false;
isPublished = (attributes & (static_cast<Int32>(PrintQueueAttributes::Published))) ? true : false;
}
/*++
Function Name:
A set of Boolean methods
Description:
Those methods return the Boolean representation
of the PrintQueue individual attributes and status
bits.
Parameters:
None
Return Value
Boolean: Status OR Attribute
--*/
bool
PrintQueue::IsPaused::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isPaused;
}
bool
PrintQueue::IsInError::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isInError;
}
bool
PrintQueue::IsPendingDeletion::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isPendingDeletion;
}
bool
PrintQueue::IsPaperJammed::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isPaperJammed;
}
bool
PrintQueue::IsOutOfPaper::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isOutOfPaper;
}
bool
PrintQueue::IsManualFeedRequired::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isManualFeedRequired;
}
bool
PrintQueue::HasPaperProblem::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return hasPaperProblem;
}
bool
PrintQueue::IsOffline::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isOffline;
}
bool
PrintQueue::IsIOActive::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isIOActive;
}
bool
PrintQueue::IsBusy::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isBusy;
}
bool
PrintQueue::IsPrinting::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isPrinting;
}
bool
PrintQueue::IsOutputBinFull::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isOutputBinFull;
}
bool
PrintQueue::IsNotAvailable::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isNotAvailable;
}
bool
PrintQueue::IsWaiting::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isWaiting;
}
bool
PrintQueue::IsProcessing::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isProcessing;
}
bool
PrintQueue::IsInitializing::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isInitializing;
}
bool
PrintQueue::IsWarmingUp::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isWarmingUp;
}
bool
PrintQueue::IsTonerLow::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isTonerLow;
}
bool
PrintQueue::HasToner::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return !hasNoToner;
}
bool
PrintQueue::PagePunt::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return doPagePunt;
}
bool
PrintQueue::NeedUserIntervention::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return needUserIntervention;
}
bool
PrintQueue::IsOutOfMemory::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isOutOfMemory;
}
bool
PrintQueue::IsDoorOpened::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isDoorOpened;
}
bool
PrintQueue::IsServerUnknown::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isServerUnknown;
}
bool
PrintQueue::IsPowerSaveOn::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueStatus","Status");
return isPowerSaveOn;
}
Boolean
PrintQueue::IsQueued::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return isQueued;
}
Boolean
PrintQueue::IsDirect::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return isDirect;
}
Boolean
PrintQueue::IsShared::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return isShared;
}
Boolean
PrintQueue::IsHidden::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return isHidden;
}
Boolean
PrintQueue::IsDevQueryEnabled::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return isDevQueryEnabled;
}
Boolean
PrintQueue::KeepPrintedJobs::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return arePrintedJobsKept;
}
Boolean
PrintQueue::ScheduleCompletedJobsFirst::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return areCompletedJobsScheduledFirst;
}
Boolean
PrintQueue::IsBidiEnabled::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return isBidiEnabled;
}
Boolean
PrintQueue::IsRawOnlyEnabled::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return isRawOnlyEnabled;
}
Boolean
PrintQueue::IsPublished::
get(
void
)
{
VerifyAccess();
GetUnInitializedData("QueueAttributes","Attributes");
return isPublished;
}
Boolean
PrintQueue::
GetIsXpsDevice(
void
)
{
Boolean printerIsXpsDevice = false;
if (this->InPartialTrust)
{
(gcnew PrintingPermission(PrintingPermissionLevel::DefaultPrinting))->Assert();
}
try
{
if (isBrowsable)
{
ActivateBrowsableQueue();
isBrowsable = false;
}
printerIsXpsDevice = printerThunkHandler->ThunkIsMetroDriverEnabled();
}
catch (InternalPrintSystemException^ internalException)
{
throw CreatePrintQueueException(internalException->HResult,
"PrintSystemException.PrintQueue.XpsDeviceQuery");
}
__finally
{
if (this->InPartialTrust)
{
SecurityPermission::RevertAssert();
}
}
return printerIsXpsDevice;
}
Boolean
PrintQueue::IsXpsDevice::
get(
void
)
{
VerifyAccess();
if (!PropertiesCollection->GetProperty("IsXpsEnabled")->IsInitialized)
{
isXpsDevice = this->GetIsXpsDevice();
PropertiesCollection->GetProperty("IsXpsEnabled")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("IsXpsEnabled")->Value = isXpsDevice;
}
return isXpsDevice;
}
void
PrintQueue::IsXpsDevice::
set(
Boolean isXpsEnabled
)
{
VerifyAccess();
isXpsDevice = isXpsEnabled;
}
PrinterThunkHandlerBase^
PrintQueue::
CreatePrintThunkHandler(
void
)
{
if(IsXpsDeviceSimulationSupported())
{
return gcnew XpsDeviceSimulatingPrintThunkHandler(this->FullName);
}
else
{
return PrinterThunkHandler->DuplicateHandler();
}
}
Boolean
PrintQueue::
IsXpsDeviceSimulationSupported(
void
)
{
return PresentationNativeUnsafeNativeMethods::IsStartXpsPrintJobSupported();
}
/*++
Function Name:
set_HostingPrintServerName
Description:
Coming from the downlevel unmanaged code, we get
a print server name and not an object. This code
is running internally from the thunk layer up to
the managed object.
Parameters:
String: Print Server Name
Return Value
None
--*/
void
PrintQueue::HostingPrintServerName::
set(
String^ serverName
)
{
hostingPrintServerName = serverName;
//
// If there is no Print Server object created
// within this print queue, then this means that
// we are dealing with one of the browsable objects
// and we should create one.
// Since this is a special path, we might need
// to create those PrintSErver objects in a different
// manner, than the normal path --> TBD
//
if(!hostingPrintServer)
{
HostingPrintServer = gcnew PrintServer(serverName,PrintServerType::Browsable);
}
else
{
//
// assuming that the PrintServer was instantiated
// for a local server and the initial name is set
// to NULL, then update with the name you get from the
// server
//
if(!hostingPrintServer->Name ||
hostingPrintServer->Name->Length == 0)
{
hostingPrintServer->IsInternallyInitialized = true;
hostingPrintServer->Name = serverName;
}
}
}
/*++
Function Name:
get_InternalPropertiesCollection
Description:
For any of the managed objects, a consumer can
access a property either by the compile time name
or by a property collection as a named property.
For the later, the names vary whether it is coming in
to the object from a managed consumer or from the
thunking code bubling up in the managed world.
So to solve this problem I supplied 2 lists of named
properties and each list is maintained within its own
collection. So when there is a difference in the name
between the managed and downlevel property (usually the
difference is mandated by a type difference) a call to
this function would return the collection which handles
the given name
Parameters:
String: name of property at hand
Return Value
Collection handling the property
--*/
PrintPropertyDictionary^
PrintQueue::
get_InternalPropertiesCollection(
String^ attributeName
)
{
return (PrintPropertyDictionary^)collectionsTable[attributeName];
}
/*++
Function Name:
A number of Set Functions.
Description:
Those functions help setting the unmanaged property name
in the appropriate collection, so that the thunking layer
can digest those with their appropriate types.
To give some examples
managed unmanaged
------- ---------
QueueDriver(Type->Driver) | DriverName(Type->String)
QueuePort(Type->Port) | PortName(Type->String)
DefaultPrintTicket(Type->JT)| DefaultDevMode(Type Byte[])
Parameters:
depends on the downlevel type
Return Value
None
--*/
void
PrintQueue::QueueDriverName::
set(
String^ driverName
)
{
if(get_InternalPropertiesCollection("QueueDriverName")->GetProperty("QueueDriverName")->IsInternallyInitialized)
{
PropertiesCollection->GetProperty("QueueDriver")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("QueueDriver")->Value = gcnew PrintDriver(driverName);
}
}
void
PrintQueue::QueuePrintProcessorName::
set(
String^ printProcessorName
)
{
if(get_InternalPropertiesCollection("QueuePrintProcessorName")->GetProperty("QueuePrintProcessorName")->IsInternallyInitialized)
{
PropertiesCollection->GetProperty("QueuePrintProcessor")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("QueuePrintProcessor")->Value = gcnew PrintProcessor(printProcessorName);
}
}
void
PrintQueue::NumberOfJobs::
set(
int numOfJobs
)
{
VerifyAccess();
numberOfJobs = numOfJobs;
PropertiesCollection->GetProperty("NumberOfJobs")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("NumberOfJobs")->Value = numberOfJobs;
}
void
PrintQueue::DefaultDevMode::
set(
array<Byte>^ devMode
)
{
defaultDevMode = devMode;
defaultPrintTicket = nullptr;
}
void
PrintQueue::UserDevMode::
set(
array<Byte>^ devMode
)
{
userDevMode = devMode;
userPrintTicket = nullptr;
}
void
PrintQueue::QueuePortName::
set(
String^ portName
)
{
if(get_InternalPropertiesCollection("QueuePortName")->GetProperty("QueuePortName")->IsInternallyInitialized)
{
PropertiesCollection->GetProperty("QueuePort")->IsInternallyInitialized = true;
PropertiesCollection->GetProperty("QueuePort")->Value = gcnew PrintPort(portName);
}
}
/*++
Function Name:
Commit
Description:
The way the APIs work, is that individual properties
are set independently and then the whole list of set
properties is commited all at once.
TBD: If a commit partially fails / succeedes, then
the original value of the variable before the set
would be retained.
Parameters:
None
Return Value
None
--*/
void
PrintQueue::
Commit(
void
)
{
VerifyAccess();
PrintWin32Thunk::SetDataThunkObject^ setDataThunkObject = nullptr;
try
{
if (isBrowsable)
{
ActivateBrowsableQueue();
isBrowsable = false;
}
setDataThunkObject = gcnew PrintWin32Thunk::SetDataThunkObject(this->GetType());
array<String^>^ alteredPropertiesFilter = nullptr;
StringCollection^ mappedStringCollection = gcnew StringCollection();
setDataThunkObject->CommitDataFromPrintSystemObject(printerThunkHandler,
this,
(alteredPropertiesFilter = GetAlteredPropertiesFilter(mappedStringCollection)));
//
// Reset the dirty bits in the altered attributes
//
if(alteredPropertiesFilter != nullptr)
{
for(Int32 alteredPropertiesIndex = 0;
alteredPropertiesIndex < alteredPropertiesFilter->Length;
alteredPropertiesIndex++)
{
PrintPropertyDictionary^ dictionary = nullptr;
(dictionary = get_InternalPropertiesCollection(alteredPropertiesFilter[alteredPropertiesIndex]))->
GetProperty(alteredPropertiesFilter[alteredPropertiesIndex])->IsDirty = false;
if(dictionary != PropertiesCollection)
{
//
// This means that we are dealing with a downlevel property & so we
// have to set also the dirty bit of the uplevel property
//
String^ mappedString;
PropertiesCollection->GetProperty(mappedString = mappedStringCollection[0])->IsDirty = false;
mappedStringCollection->RemoveAt(0);
}
}
}
//
// Making sure that the Full Name reflects the current name
//
fullQueueName = PrepareNameForDownLevelConnectivity(hostingPrintServer->Name,Name);
}
catch (PrintCommitAttributesException^ e)
{
throw gcnew PrintCommitAttributesException(Marshal::GetHRForException(e),
"PrintSystemException.PrintQueue.Commit",
e->CommittedAttributesCollection,
e->FailedAttributesCollection,
Name);
}
__finally
{
delete setDataThunkObject;
setDataThunkObject = nullptr;
}
}
/*++
Function Name:
Refresh
Description:
This method helps in refreshing the state of the object.
Only those properties that where either requested during
initialization or requested later on during individual
gets are the ones refreshed.
Parameters:
None
Return Value
None
--*/
void
PrintQueue::
Refresh(
void
)
{
VerifyAccess();
GetDataThunkObject^ dataThunkObject = nullptr;
try
{
if (isBrowsable)
{
ActivateBrowsableQueue();
isBrowsable = false;
}
dataThunkObject = gcnew GetDataThunkObject(this->GetType());
dataThunkObject->PopulatePrintSystemObject(printerThunkHandler,
this,
refreshPropertiesFilter);
//
// Making sure that the Full Name reflects the current name
//
fullQueueName = PrepareNameForDownLevelConnectivity(hostingPrintServer->Name,Name);
}
catch (InternalPrintSystemException^ internalException)
{
throw CreatePrintQueueException(internalException->HResult, "PrintSystemException.PrintQueue.Refresh");
}
__finally
{
delete dataThunkObject;
}
}
/*++
Function Name:
GetAllPropertiesFilter
Description:
The method populates a String Array of all
possible properties of the PrintQueue object.
Parameters:
None
Return Value
String[]: All the properties supported by
the PrintQueue
--*/
array<String^>^
PrintQueue::
GetAllPropertiesFilter(
void
)
{
//
// Properties = Base Class Properties + Inherited Class Properties
//
array<String^>^ allPropertiesFilter = gcnew array<String^>(PrintSystemObject::BaseAttributeNames()->Length +
PrintQueue::primaryAttributeNames->Length);
//
// First Add the Base Class Properties
//
for(Int32 numOfAttributes = 0;
numOfAttributes < PrintSystemObject::BaseAttributeNames()->Length;
numOfAttributes++)
{
allPropertiesFilter[numOfAttributes] = PrintSystemObject::BaseAttributeNames()[numOfAttributes];
}
//
// Then Add the Inherited Class Properties
//
for(Int32 numOfAttributes = 0;
numOfAttributes < PrintQueue::primaryAttributeNames->Length;
numOfAttributes++)
{
String^ upLevelAttribute = nullptr;
if(String^ downLevelAttribute = (String^)(upLevelToDownLevelMapping
[upLevelAttribute = PrintQueue::primaryAttributeNames[numOfAttributes]]))
{
allPropertiesFilter[PrintSystemObject::BaseAttributeNames()->Length + numOfAttributes] = downLevelAttribute;
}
else
{
allPropertiesFilter[PrintSystemObject::BaseAttributeNames()->Length + numOfAttributes] = upLevelAttribute;
}
}
return allPropertiesFilter;
}
/*++
Function Name:
GetAllPropertiesFilter
Description:
The method populates a String Array of all
properties requested by a given filter. The
difference between the input and the returned,
is that I have to account for the downlevel
named properties used to thunk to the unmanaged
code.
Parameters:
String[]: The proeprties asked for by the consumer
through an input filter
Return Value
String[]: The properties both managed and unmanaged
matching such input filter.
--*/
array<String^>^
PrintQueue::
GetAllPropertiesFilter(
array<String^>^ propertiesFilter
)
{
if (propertiesFilter != nullptr)
{
array<String^>^ allPropertiesFilter = gcnew array<String^>(propertiesFilter->Length);
for(Int32 numOfProperties = 0;
numOfProperties < propertiesFilter->Length;
numOfProperties++)
{
String^ upLevelAttribute = nullptr;
if(String^ downLevelAttribute = (String^)(upLevelToDownLevelMapping
[upLevelAttribute = propertiesFilter[numOfProperties]]))
{
allPropertiesFilter[numOfProperties] = downLevelAttribute;
}
else
{
allPropertiesFilter[numOfProperties] = upLevelAttribute;
}
}
return allPropertiesFilter;
}
else
{
return GetAllPropertiesFilter();
}
}
/*++
Function Name:
GetAlteredPropertiesFilter
Description:
When properties are commited, those that only
changed from their initial values are committed.
It is the responsibility of this method to figure
out those properties that changed
Parameters:
None
Return Value
String[]: The properties that changed from their
initial state
--*/
array<String^>^
PrintQueue::
GetAlteredPropertiesFilter(
StringCollection^ uplevelAttributes
)
{
Int32 indexInAlteredProperties = 0;
Int32 indexInMappedProperties = 0;
//
// Properties = Base Class Properties + Inherited Class Properties
//
array<String^>^ probePropertiesFilter = gcnew array<String^>(PrintSystemObject::BaseAttributeNames()->Length +
PrintQueue::primaryAttributeNames->Length);
array<String^>^ probeMappedPropertiesFilter = gcnew array<String^>(PrintSystemObject::BaseAttributeNames()->Length +
PrintQueue::primaryAttributeNames->Length);
//
// As the PrintTicket interface changed from a Stream to an Object, it is possible
// for a caller in our APIs to use the pattern printQueue->UserPrintTicket->Property->Value = XXXX.
// Based on this, the PrintTicket is changing without setting a property on the Print Queue and hence
// we have to internally make a call in the PrintTicket to see whether it was altered or not
//
if((userPrintTicket != nullptr) &&
(PropertiesCollection->GetProperty("UserPrintTicket")->IsDirty == false))
{
if(userPrintTicket->IsSettingChanged)
{
PropertiesCollection->GetProperty("UserPrintTicket")->IsDirty = true;
if (printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
array<Byte>^ devMode = printTicketManager->ConvertPrintTicketToDevMode(userPrintTicket, BaseDevModeType::UserDefault);
get_InternalPropertiesCollection("UserDevMode")->GetProperty("UserDevMode")->Value = devMode;
}
}
if((defaultPrintTicket != nullptr)&&
(PropertiesCollection->GetProperty("DefaultPrintTicket")->IsDirty == false))
{
if(defaultPrintTicket->IsSettingChanged)
{
PropertiesCollection->GetProperty("DefaultPrintTicket")->IsDirty = true;
if (printTicketManager == nullptr)
{
printTicketManager = gcnew PrintTicketManager(fullQueueName,clientPrintSchemaVersion);
}
array<Byte>^ devMode = printTicketManager->ConvertPrintTicketToDevMode(defaultPrintTicket, BaseDevModeType::PrinterDefault);
get_InternalPropertiesCollection("DefaultDevMode")->GetProperty("DefaultDevMode")->Value = devMode;
}
}
//
// First Add the altered Base Class Properties
//
for(Int32 numOfAttributes = 0;
numOfAttributes < PrintSystemObject::BaseAttributeNames()->Length;
numOfAttributes++)
{
if(PropertiesCollection->GetProperty(PrintSystemObject::BaseAttributeNames()[numOfAttributes])->IsDirty)
{
probePropertiesFilter[indexInAlteredProperties++] = PrintSystemObject::BaseAttributeNames()[numOfAttributes];
}
}
//
// Then Add the altered Inherited Class Properties
//
for(Int32 numOfAttributes = 0;
numOfAttributes < PrintQueue::primaryAttributeNames->Length;
numOfAttributes++)
{
String^ upLevelAttribute = nullptr;
if(PropertiesCollection->GetProperty(PrintQueue::primaryAttributeNames[numOfAttributes])->IsDirty)
{
if(String^ downLevelAttribute = (String^)(upLevelToDownLevelMapping
[upLevelAttribute = PrintQueue::primaryAttributeNames[numOfAttributes]]))
{
probePropertiesFilter[indexInAlteredProperties++] = downLevelAttribute;
probeMappedPropertiesFilter[indexInMappedProperties++] = upLevelAttribute;
}
else
{
probePropertiesFilter[indexInAlteredProperties++] = upLevelAttribute;
}
}
}
array<String^>^ alteredPropertiesFilter = nullptr;
if(indexInAlteredProperties)
{
alteredPropertiesFilter = gcnew array<String^>(indexInAlteredProperties);
for(Int32 indexOfMovedData = 0;
indexOfMovedData < indexInAlteredProperties;
indexOfMovedData++)
{
alteredPropertiesFilter[indexOfMovedData] = probePropertiesFilter[indexOfMovedData];
}
}
if(indexInMappedProperties)
{
for(Int32 indexOfMovedData = 0;
indexOfMovedData < indexInMappedProperties;
indexOfMovedData++)
{
uplevelAttributes->Add(probeMappedPropertiesFilter[indexOfMovedData]);
}
}
return alteredPropertiesFilter;
}
/*++
Function Name:
RegisterAttributesNamesTypes
Description:
The way the APIs work is that every compile time
property is linked internally to a named property.
The named property is an attribute / value pair.
This pair has a generic type inheriting form
PrintProperty and the specific type is
determined by the type of the compile time property.
By registering the named property and giving it a type,
later on it is pretty easy to determine which specific
type should be assigned to this named property in the
property collection.
This generally applies for
1. Base class properties
2. Managed properties
3. Properties required for unmanaged thunking
Parameters:
None
Return Value
None
--*/
void
PrintQueue::
RegisterAttributesNamesTypes(
void
)
{
//
// Register the attributes of the base class first
//
PrintSystemObject::RegisterAttributesNamesTypes(PrintQueue::attributeNameTypes);
//
// Register the attributes of the current class
//
for(Int32 numOfAttributes = 0;
numOfAttributes < PrintQueue::primaryAttributeNames->Length;
numOfAttributes++)
{
attributeNameTypes->Add(PrintQueue::primaryAttributeNames[numOfAttributes],
PrintQueue::primaryAttributeTypes[numOfAttributes]);
}
for(Int32 numOfAttributes = 0;
numOfAttributes < PrintQueue::secondaryAttributeNames->Length;
numOfAttributes++)
{
attributeNameTypes->Add(PrintQueue::secondaryAttributeNames[numOfAttributes],
PrintQueue::secondaryAttributeTypes[numOfAttributes]);
}
}
/*++
Function Name:
Instantiate
Description:
Due to the way the APIs are implemented and to apply
generic patterns to some of the methods instantiated
and to make it easier in applying single patterns on
simillar paradiagms, I used Factories in some internal
instantiation models. This method is the one called by
such factories to intantiate an instance of the PrintQueue
Parameters:
None
Return Value
PrintSystemObject: An instance of a PrintQueue
--*/
PrintSystemObject^
PrintQueue::
Instantiate(
array<String^>^ propertiesFilter
)
{
return gcnew PrintQueue(propertiesFilter);
}
/*++
Function Name:
Instantiate
Description:
Due to the way the APIs are implemented and to apply
generic patterns to some of the methods instantiated
and to make it easier in applying single patterns on
simillar paradiagms, I used Factories in some internal
instantiation models. This method is the one called by
such factories to intantiate an instance of the PrintQueue
and this instance would have an optimization of not requiring
to create a PrintServer. The PrintServer would be passed in
as a parameter
Parameters:
PrintServer: Print Server to be set as the server hosting the
Print Queue
PropertiesFilter: The set of properties required to be visible on
that Print Queue
Return Value
PrintSystemObject: An instance of a PrintQueue
--*/
PrintSystemObject^
PrintQueue::
InstantiateOptimized(
Object^ printServer,
array<String^>^ propertiesFilter
)
{
return gcnew PrintQueue((PrintServer^)printServer,
propertiesFilter);
}
/*++
Function Name:
CreateAttributeNoValue
Description:
When the internal collection of proeprties for an object is
created, the way individual properties are added to that
collection is through using a factory. The reason for using a
factory, is that every object is delegated adding its properties
to its internal collection. Reason for that is that the object
best knows it properties and their types.
Parameters:
String: The name of the property
Return Value
PrintProperty: The property created as an
Attribute / Value pair
--*/
PrintProperty^
PrintQueue::
CreateAttributeNoValue(
String^ attributeName
)
{
Type^ type = (Type^)PrintQueue::attributeNameTypes[attributeName];
return PrintPropertyFactory::Value->Create(type,attributeName);
}
/*++
Function Name:
CreateAttributeValue
Description:
When the internal collection of proeprties for an object is
created, the way individual properties are added to that
collection is through using a factory. The reason for using a
factory, is that every object is delegated adding its properties
to its internal collection. Reason for that is that the object
best knows it properties and their types.
Parameters:
String: The name of the property
Object: The value of the property
Return Value
PrintProperty: The property created as an
Attribute / Value pair
--*/
PrintProperty^
PrintQueue::
CreateAttributeValue(
String^ attributeName,
Object^ attributeValue
)
{
Type^ type = (Type^)PrintQueue::attributeNameTypes[attributeName];
return PrintPropertyFactory::Value->Create(type,attributeName,attributeValue);
}
/*++
Function Name:
CreateAttributeNoValueLinked
Description:
When the internal collection of proeprties for an object is
created, the way individual properties are added to that
collection is through using a factory. The reason for using a
factory, is that every object is delegated adding its properties
to its internal collection. Reason for that is that the object
best knows it properties and their types.
Parameters:
String: The name of the property
MulticastDelegate: The delegate linking the named property to
a compile time property.
Return Value
PrintProperty: The property created as an
Attribute / Value pair
--*/
PrintProperty^
PrintQueue::
CreateAttributeNoValueLinked(
String^ attributeName,
MulticastDelegate^ delegate
)
{
Type^ type = (Type^)PrintQueue::attributeNameTypes[attributeName];
return PrintPropertyFactory::Value->Create(type,attributeName,delegate);
}
/*++
Function Name:
CreateAttributeValueLinked
Description:
When the internal collection of proeprties for an object is
created, the way individual properties are added to that
collection is through using a factory. The reason for using a
factory, is that every object is delegated adding its properties
to its internal collection. Reason for that is that the object
best knows it properties and their types.
Parameters:
String: The name of the property
Object: The value of the property
MulticastDelegate: The delegate linking the named property to
a compile time property.
Return Value
PrintProperty: The property created as an
Attribute / Value pair
--*/
PrintProperty^
PrintQueue::
CreateAttributeValueLinked(
String^ attributeName,
Object^ attributeValue,
MulticastDelegate^ delegate
)
{
Type^ type = (Type^)PrintQueue::attributeNameTypes[attributeName];
return PrintPropertyFactory::Value->Create(type,attributeName,attributeValue,delegate);
}
/*++
Function Name:
InitializeInternalCollections
Description:
The function initialized the internal state of the object
at instantiation time
Parameters:
None
Return Value
None
--*/
void
PrintQueue::
InitializeInternalCollections(
void
)
{
accessVerifier = gcnew PrintSystemDispatcherObject();
collectionsTable = gcnew Hashtable();
thunkPropertiesCollection = gcnew PrintPropertyDictionary();
//
// Initialize the PrintTickets held by the PrintQueue
//
InitializePrintTickets();
//
// Add the attributes from the base class to the appropriate collection
//
for(Int32 numOfBaseAttributes=0;
numOfBaseAttributes < PrintSystemObject::BaseAttributeNames()->Length;
numOfBaseAttributes++)
{
collectionsTable->Add(PrintSystemObject::BaseAttributeNames()[numOfBaseAttributes],PropertiesCollection);
}
//
// Override the set_Name property in the base class
//
((PrintStringProperty^)PropertiesCollection->GetProperty("Name"))->
ChangeHandler = gcnew PrintSystemDelegates::StringValueChanged(this,&PrintQueue::Name::set);
array<MulticastDelegate^>^ propertiesDelegates = CreatePropertiesDelegates();
//
// Perparing the primary (purely managed) attributes
//
Int32 numOfPrimaryAttributes = 0;
for(numOfPrimaryAttributes = 0;
numOfPrimaryAttributes < PrintQueue::primaryAttributeNames->Length;
numOfPrimaryAttributes++)
{
PrintProperty^ printSystemAttributeValue = nullptr;
printSystemAttributeValue =
ObjectsAttributesValuesFactory::Value->Create(this->GetType(),
primaryAttributeNames[numOfPrimaryAttributes],
propertiesDelegates[numOfPrimaryAttributes]);
PrintSystemObject::PropertiesCollection->Add(printSystemAttributeValue);
//
// The following links an attribute name to a collection
//
collectionsTable->Add(PrintQueue::primaryAttributeNames[numOfPrimaryAttributes],PropertiesCollection);
}
//
// Perparing the secondary (used for downlevel -unamanged- thunking) attributes
//
for(Int32 numOfSecondaryAttributes=0;
numOfSecondaryAttributes < PrintQueue::secondaryAttributeNames->Length;
numOfSecondaryAttributes++)
{
PrintProperty^ printSystemAttributeValue = nullptr;
printSystemAttributeValue =
ObjectsAttributesValuesFactory::Value->Create(this->GetType(),
secondaryAttributeNames[numOfSecondaryAttributes],
propertiesDelegates[numOfPrimaryAttributes + numOfSecondaryAttributes]);
thunkPropertiesCollection->Add(printSystemAttributeValue);
//
// The following links an attribute name to a collection
//
collectionsTable->Add(PrintQueue::secondaryAttributeNames[numOfSecondaryAttributes],thunkPropertiesCollection);
}
}
/*++
Function Name:
InitializePrintTickets
Description:
Sets the user print ticket and default print ticket to null
Parameters:
None
Return Value
None:
--*/
__declspec(noinline)
void
PrintQueue::
InitializePrintTickets(
void
)
{
userPrintTicket = nullptr;
defaultPrintTicket = nullptr;
}
/*++
Function Name:
CreatePropertiesDelegates
Description:
This is indicating which delegate is called when
a named property is changed to reflect the change
in the compile time property
Parameters:
None
Return Value
MultiCastDelegate[]: An array of delegates delegated the
property set when a named proeprty change
--*/
array<MulticastDelegate^>^
PrintQueue::
CreatePropertiesDelegates(
void
)
{
array<MulticastDelegate^>^ propertiesDelegates = gcnew array<MulticastDelegate^>(primaryAttributeNames->Length +
secondaryAttributeNames->Length);
//
// Note to self: This should be impelemented in
// a better way
//
//
// Primary Delegates
//
propertiesDelegates[0] = gcnew PrintSystemDelegates::StringValueChanged(this,&PrintQueue::ShareName::set);
propertiesDelegates[1] = gcnew PrintSystemDelegates::StringValueChanged(this,&PrintQueue::Comment::set);
propertiesDelegates[2] = gcnew PrintSystemDelegates::StringValueChanged(this,&PrintQueue::Location::set);
propertiesDelegates[3] = gcnew PrintSystemDelegates::StringValueChanged(this,&PrintQueue::Description::set);
propertiesDelegates[4] = gcnew PrintSystemDelegates::Int32ValueChanged(this,&PrintQueue::Priority::set);
propertiesDelegates[5] = gcnew PrintSystemDelegates::Int32ValueChanged(this,&PrintQueue::DefaultPriority::set);
propertiesDelegates[6] = gcnew PrintSystemDelegates::Int32ValueChanged(this,&PrintQueue::StartTimeOfDay::set);
propertiesDelegates[7] = gcnew PrintSystemDelegates::Int32ValueChanged(this,&PrintQueue::UntilTimeOfDay::set);
//
// Average Pages per Minute cannot be set through the collection interface
//
propertiesDelegates[8] = nullptr;
//
// Number of Jobs can't be set through the collection interface
//
propertiesDelegates[9] = gcnew PrintSystemDelegates::Int32ValueChanged(this,&PrintQueue::NumberOfJobs::set);
propertiesDelegates[10] = nullptr;
propertiesDelegates[11] = gcnew PrintSystemDelegates::DriverValueChanged(this,&PrintQueue::QueueDriver::set);
propertiesDelegates[12] = gcnew PrintSystemDelegates::PortValueChanged(this,&PrintQueue::QueuePort::set);
propertiesDelegates[13] = gcnew PrintSystemDelegates::PrintProcessorValueChanged(this,&PrintQueue::QueuePrintProcessor::set);
//
// The hosting Print Server can't be changed through the collection interface
//
propertiesDelegates[14] = nullptr;
propertiesDelegates[15] = nullptr;
propertiesDelegates[16] = gcnew PrintSystemDelegates::StringValueChanged(this,&PrintQueue::SeparatorFile::set);
propertiesDelegates[17] = gcnew PrintSystemDelegates::PrintTicketValueChanged(this,&PrintQueue::DefaultPrintTicket::set);
propertiesDelegates[18] = gcnew PrintSystemDelegates::PrintTicketValueChanged(this,&PrintQueue::UserPrintTicket::set);
propertiesDelegates[19] = gcnew PrintSystemDelegates::BooleanValueChanged(this,&PrintQueue::IsXpsDevice::set);
//
// Secondary Delegates
//
propertiesDelegates[20] = gcnew PrintSystemDelegates::StringValueChanged(this,&PrintQueue::HostingPrintServerName::set);
propertiesDelegates[21] = gcnew PrintSystemDelegates::StringValueChanged(this,&PrintQueue::QueueDriverName::set);
propertiesDelegates[22] = gcnew PrintSystemDelegates::StringValueChanged(this,&PrintQueue::QueuePrintProcessorName::set);
propertiesDelegates[23] = gcnew PrintSystemDelegates::StringValueChanged(this,&PrintQueue::QueuePortName::set);
propertiesDelegates[24] = gcnew PrintSystemDelegates::ByteArrayValueChanged(this,&PrintQueue::DefaultDevMode::set);
propertiesDelegates[25] = gcnew PrintSystemDelegates::ByteArrayValueChanged(this,&PrintQueue::UserDevMode::set);
propertiesDelegates[26] = gcnew PrintSystemDelegates::Int32ValueChanged(this,&PrintQueue::Status::set);
propertiesDelegates[27] = gcnew PrintSystemDelegates::Int32ValueChanged(this,&PrintQueue::Attributes::set);
return propertiesDelegates;
}
/*++
Function Name:
ConvertPropertyFilterToString
Description:
For usage with Intellisense and personas like Mort, it is
usefull to have an enumeration that could be easily detected in
those situations. But internally everything is represented as a
string and not an enum and hence this functions that comverts the
later to the former.
Parameters:
PrintQueueIndexedProperty[]: An Array of enums
Return Value
MultiCastDelegate[]: An Array of corresponding strings
--*/
array<String^>^
PrintQueue::
ConvertPropertyFilterToString(
array<PrintQueueIndexedProperty>^ propertiesFilter
)
{
array<String^>^ propertiesFilterAsStrings = gcnew array<String^>(propertiesFilter->Length);
for(Int32 numOfProperties = 0;
numOfProperties < propertiesFilter->Length;
numOfProperties++)
{
String^ upLevelAttribute = nullptr;
if(String^ downLevelAttribute = (String^)(upLevelToDownLevelMapping
[upLevelAttribute =
propertiesFilter[numOfProperties].ToString()]))
{
propertiesFilterAsStrings[numOfProperties] = downLevelAttribute;
}
else
{
propertiesFilterAsStrings[numOfProperties] = upLevelAttribute;
}
}
return propertiesFilterAsStrings;
}
/*++
Function Name:
PrepareNameForDownLevelConnectivity
Description:
Although in the managed world everything is represented
as an object. In the unamanaged world things are still
respresented as strings and in order to instantiate those
unamanged objects (like calling OpenPrinter) we need the
proper name to do that. This is where this function comes
in play as it utilizes the resolver to created the full name
string from its composings individual parts.
Parameters:
String: Server Name
String PrintQueue Name
Return Value
String: DownLevel name
--*/
String^
PrintQueue::
PrepareNameForDownLevelConnectivity(
String^ serverName,
String^ printerName
)
{
String^ downLevelName = nullptr;
if(serverName->Equals(PrintWin32Thunk::PrinterThunkHandler::GetLocalMachineName()))
{
downLevelName = printerName;
}
else
{
PrintPropertyDictionary^ resolverAttributeValueCollection = gcnew PrintPropertyDictionary();
PrintStringProperty^ stringAttributeValue = nullptr;
PrintSystemProtocol^ protocol = nullptr;
stringAttributeValue = gcnew PrintStringProperty("ServerName",
serverName);
resolverAttributeValueCollection->Add(stringAttributeValue);
stringAttributeValue = gcnew PrintStringProperty("PrinterName",
printerName);
resolverAttributeValueCollection->Add(stringAttributeValue);
PrintSystemPathResolver^ resolver =
gcnew PrintSystemPathResolver(resolverAttributeValueCollection,
gcnew PrintSystemUNCPathResolver(gcnew PrintSystemDefaultPathResolver));
resolver->Resolve();
protocol = resolver->Protocol;
downLevelName = protocol->Path;
}
return downLevelName;
}
/*++
Function Name:
GetUnInitializedData
Description:
If a consumer of a property asks for a property that is
not initialized, then we intialized the property by doing
a real Get from the server before returning the data. This
could happen if someone instantiated an object with a Filter
and then later asks for a property outside the Filter range.
Parameters:
String: managed property name
String unamanged property name
Return Value
None
--*/
void
PrintQueue::
GetUnInitializedData(
String^ upLevelPropertyName,
String^ downLevelPropertyName
)
{
GetDataThunkObject^ dataThunkObject = nullptr;
try
{
if(!PropertiesCollection->GetProperty(upLevelPropertyName)->IsInitialized &&
!get_InternalPropertiesCollection(downLevelPropertyName)->GetProperty(downLevelPropertyName)->IsInitialized)
{
if (isBrowsable)
{
ActivateBrowsableQueue();
isBrowsable = false;
}
//
// retrieve the data from the server
//
dataThunkObject = gcnew GetDataThunkObject(this->GetType());
array<String^>^ propertyFilter = {downLevelPropertyName};
dataThunkObject->PopulatePrintSystemObject(printerThunkHandler,
this,
propertyFilter);
//
// Add the property to the registered properties filter
//
array<String^>^ newRefreshPropertiesFilter = gcnew array<String^>(refreshPropertiesFilter->Length + 1);
Int32 numOfProperties = 0;
for(numOfProperties = 0;
numOfProperties < refreshPropertiesFilter->Length;
numOfProperties++)
{
newRefreshPropertiesFilter[numOfProperties] = refreshPropertiesFilter[numOfProperties];
}
newRefreshPropertiesFilter[numOfProperties] = gcnew String(downLevelPropertyName->ToCharArray());
refreshPropertiesFilter = newRefreshPropertiesFilter;
}
}
catch (InternalPrintSystemException^ internalException)
{
throw CreatePrintSystemException(internalException->HResult, "PrintSystemException.PrintQueue.GetUninitializedProperty");
}
__finally
{
if (dataThunkObject)
{
delete dataThunkObject;
dataThunkObject = nullptr;
}
}
}
/*++
Routine Name:
BuildPortNamesString
Routine Description:
It builds the string of ports from an array of strings.
If a printer is connected to more than one port,
the names of each port must be separated by commas (for example, "LPT1:,LPT2:,LPT3:").
Arguments:
portNames - arrays of strings representing the ports
Return Value:
string representing the ports in the format that the Win32 API expects.
--*/
String^
PrintQueue::
BuildPortNamesString(
array<String^>^ portNames
)
{
String^ portNamesSeparatedByComma = nullptr;
StringBuilder^ portNamesSeparatedByCommaBuilder = gcnew StringBuilder(PrintSystemObject::MaxPath);
if (portNamesSeparatedByCommaBuilder)
{
portNamesSeparatedByCommaBuilder->Append(portNames[0]);
for (int index = 1 ; index < portNames->Length; index++)
{
portNamesSeparatedByCommaBuilder->AppendFormat(",{0}", portNames[index]);
}
portNamesSeparatedByComma = portNamesSeparatedByCommaBuilder->ToString();
}
return portNamesSeparatedByComma;
}
String^
PrintQueue::
GetAttributeNamePerPrintQueueObject(
PrintProperty^ attributeValue
)
{
String^ name = nullptr;
if (attributeValue && attributeValue->Name)
{
String^ upLevelAttribute = nullptr;
if(String^ downLevelAttribute = (String^)(upLevelToDownLevelMapping
[upLevelAttribute = attributeValue->Name]))
{
name = downLevelAttribute;
}
else
{
name = upLevelAttribute;
}
}
return name;
}
Object^
PrintQueue::
GetAttributeValuePerPrintQueueObject(
PrintProperty^ attributeValue
)
{
Object^ value = nullptr;
if (attributeValue && attributeValue->Name && attributeValue->Value)
{
Type^ type = (Type^)(PrintQueue::attributeNameTypes[attributeValue->Name]);
// OACR false positive: as PrintDriver, PrintPort, PrintProcessor and PrintServer are different types with a common base class.
#pragma warning (push)
#pragma warning (disable : 6287)
if (type == PrintDriver::typeid ||
type == PrintPort::typeid ||
type == PrintProcessor::typeid ||
type == PrintServer::typeid
)
#pragma warning (pop)
{
value = ((PrintSystemObject^)attributeValue->Value)->Name;
}
else
{
value = attributeValue->Value;
}
}
return value;
}
Stream^
PrintQueue::
ClonePrintTicket(
Stream^ printTicket
)
{
Stream^ clonedPrintTicket = nullptr;
if(printTicket)
{
int printTicketLength = static_cast<int>(printTicket->Length);
array<Byte>^ streamData = gcnew array<Byte>(printTicketLength);
printTicket->Read(streamData,0,printTicketLength);
clonedPrintTicket = gcnew MemoryStream();
clonedPrintTicket->Write(streamData,0,printTicketLength);
clonedPrintTicket->Position = 0;
printTicket->Position = 0;
}
return clonedPrintTicket;
}
Int32
PrintQueue::MaxPrintSchemaVersion::
get(
void
)
{
return PrintTicketManager::MaxPrintSchemaVersion;
}
Int32
PrintQueue::ClientPrintSchemaVersion::
get(
void
)
{
VerifyAccess();
return clientPrintSchemaVersion;
}
PrintWin32Thunk::PrinterThunkHandler^
PrintQueue::PrinterThunkHandler::
get(
void
)
{
return printerThunkHandler;
}
/*++
Function Name:
CreateSerializationManager
Description:
Creates the appropriate Synchronous serialization manager to serialize and print the document objects.
Parameters:
None
Return Value
PackageSerializationManager
--*/
PackageSerializationManager^
PrintQueue::
CreateSerializationManager(
bool isBatchMode,
bool mustSetJobIdentifier
)
{
return CreateSerializationManager(isBatchMode, mustSetJobIdentifier, nullptr);
}
/*++
Function Name:
CreateSerializationManager
Description:
Creates the appropriate Synchronous serialization manager to serialize and print the document objects.
Parameters:
None
Return Value
PackageSerializationManager
--*/
PackageSerializationManager^
PrintQueue::
CreateSerializationManager(
bool isBatchMode,
bool mustSetJobIdentifier,
PrintTicket^ printTicket
)
{
PackageSerializationManager^ serializationManager = nullptr;
printingIsCancelled = false;
bool supportsXpsSerialization = IsXpsDevice || IsXpsDeviceSimulationSupported();
if (!supportsXpsSerialization)
{
//
// If this is a Xps device, we are going to use a Next Generation Conversion Serialization Manager
//
#pragma warning ( disable:4691 )
serializationManager = gcnew NgcSerializationManager(this,isBatchMode);
#pragma warning ( default:4691 )
}
else
{
String^ printJobName = this->CurrentJobSettings->Description;
if (this->CurrentJobSettings->Description == nullptr)
{
printJobName = defaultXpsJobName;
}
PrintQueueStream^ printStream = gcnew PrintQueueStream(this, printJobName, false, printTicket);
#pragma warning ( disable:4691 )
XpsDocument^ reachPackage = XpsDocument::CreateXpsDocument(printStream);
#pragma warning ( default:4691 )
XpsPackagingPolicy^ reachPolicy = gcnew XpsPackagingPolicy(reachPackage, PackageInterleavingOrder::ResourceFirst);
reachPolicy->PackagingProgressEvent += gcnew PackagingProgressEventHandler(printStream,
&PrintQueueStream::HandlePackagingProgressEvent);
XpsSerializationManager^ xpsSerializationManager = gcnew XpsSerializationManager(reachPolicy, isBatchMode);
//
// Quearies to ISV's has identified four pages as the optimal page batch size
// This sacrifices best case savings of font subsetting vs.
// memory foot print of accumlating page data to discover font subsets
//
xpsSerializationManager->SetFontSubsettingPolicy(FontSubsetterCommitPolicies::CommitPerPage );
xpsSerializationManager->SetFontSubsettingCountPolicy(4);
serializationManager = xpsSerializationManager;
if(serializationManager != nullptr)
{
((XpsSerializationManager^)serializationManager)->XpsSerializationXpsDriverDocEvent += gcnew XpsSerializationXpsDriverDocEventHandler(this,
&PrintQueue::ForwardXpsDriverDocEvent);
System::Threading::Monitor::Enter(_lockObject);
try
{
isWriterAttached = true;
writerStream = printStream;
xpsDocument = reachPackage;
if (mustSetJobIdentifier)
{
serializationManager->JobIdentifier = printStream->JobIdentifier;
}
}
__finally
{
System::Threading::Monitor::Exit(_lockObject);
}
}
}
return serializationManager;
}
/*++
Function Name:
CreateSerializationManager
Description:
Creates the appropriate Synchronous serialization manager to serialize and print the document objects.
Parameters:
None
Return Value
PackageSerializationManager
--*/
PackageSerializationManager^
PrintQueue::
CreateSerializationManager(
bool isBatchMode
)
{
return CreateSerializationManager(isBatchMode, false);
}
/*++
Function Name:
CreateAsyncSerializationManager
Description:
Creates the appropriate Asynchronous serialization manager to serialize and print the document objects.
Parameters:
None
Return Value
PackageAsyncSerializationManager
--*/
PackageSerializationManager^
PrintQueue::
CreateAsyncSerializationManager(
bool isBatchMode
)
{
return CreateAsyncSerializationManager(isBatchMode, false);
}
/*++
Function Name:
CreateAsyncSerializationManager
Description:
Creates the appropriate Asynchronous serialization manager to serialize and print the document objects.
Parameters:
None
Return Value
PackageAsyncSerializationManager
--*/
PackageSerializationManager^
PrintQueue::
CreateAsyncSerializationManager(
bool isBatchMode,
bool mustSetJobIdentifier
)
{
PackageSerializationManager^ serializationManager = nullptr;
printingIsCancelled = false;
bool supportsXpsSerialization = IsXpsDevice || IsXpsDeviceSimulationSupported();
if (!supportsXpsSerialization)
{
if (mustSetJobIdentifier)
{
throw gcnew NotSupportedException;
}
//
// If this is a Xps device, we are going to use a Next Generation Conversion Serialization Manager
//
#pragma warning ( disable:4691 )
serializationManager = gcnew NgcSerializationManagerAsync(this,isBatchMode);
#pragma warning ( default:4691 )
}
else
{
String^ printJobName = this->CurrentJobSettings->Description;
if (this->CurrentJobSettings->Description == nullptr)
{
printJobName = defaultXpsJobName;
}
PrintQueueStream^ printStream = gcnew PrintQueueStream(this, printJobName);
XpsDocument^ reachPackage = XpsDocument::CreateXpsDocument(printStream);
XpsPackagingPolicy^ reachPolicy = gcnew XpsPackagingPolicy(reachPackage, PackageInterleavingOrder::ResourceFirst);
reachPolicy->PackagingProgressEvent += gcnew PackagingProgressEventHandler(printStream,
&PrintQueueStream::HandlePackagingProgressEvent);
XpsSerializationManagerAsync^ xpsSerializationManagerAsync = gcnew XpsSerializationManagerAsync(reachPolicy, isBatchMode);
//
// Quearies to ISV's has identified four pages as the optimal page batch size
// This sacrifices best case savings of font subsetting vs.
// memory foot print of accumlating page data to discover font subsets
//
xpsSerializationManagerAsync->SetFontSubsettingPolicy(FontSubsetterCommitPolicies::CommitPerPage );
xpsSerializationManagerAsync->SetFontSubsettingCountPolicy(4);
serializationManager = xpsSerializationManagerAsync;
if(serializationManager != nullptr)
{
((XpsSerializationManagerAsync^)serializationManager)->XpsSerializationXpsDriverDocEvent += gcnew XpsSerializationXpsDriverDocEventHandler(this,
&PrintQueue::ForwardXpsDriverDocEvent);
System::Threading::Monitor::Enter(_lockObject);
try
{
isWriterAttached = true;
writerStream = printStream;
xpsDocument = reachPackage;
if (mustSetJobIdentifier)
{
serializationManager->JobIdentifier = printStream->JobIdentifier;
}
}
__finally
{
System::Threading::Monitor::Exit(_lockObject);
}
}
}
return serializationManager;
}
/*++
Function Name:
DisposeSerializationManager
Description:
Some actions need to be done at the end of the life cycle of
a serializaiton manager and this is the function to carry out
those methods
Parameters:
None
Return Value
none
--*/
void
PrintQueue::
DisposeSerializationManager(
void
)
{
DisposeSerializationManager( false );
}
/*++
Function Name:
DisposeSerializationManager
Description:
Some actions need to be done at the end of the life cycle of
a serializaiton manager and this is the function to carry out
those methods
Parameters:
bool abort indicates whether the print stream needs to be aborted or closed
Return Value
none
--*/
void
PrintQueue::
DisposeSerializationManager(
bool abort
)
{
XpsDocument^ document = nullptr;
PrintQueueStream^ printStream = nullptr;
System::Threading::Monitor::Enter(_lockObject);
try
{
if (isWriterAttached == true)
{
isWriterAttached = false;
if (xpsDocument != nullptr)
{
document = xpsDocument;
xpsDocument = nullptr;
}
if (writerStream != nullptr)
{
printStream = writerStream;
writerStream = nullptr;
}
}
}
__finally
{
System::Threading::Monitor::Exit(_lockObject);
}
if (abort &&
printStream != nullptr)
{
//Notify printstream that we have aborted before calling DisposeXpsDocument which
//will try to write to the spool file.
printStream->Abort();
}
if(document != nullptr)
{
document->DisposeXpsDocument();
}
if(printStream != nullptr)
{
printStream->Close();
}
}
XpsDocumentWriter^
PrintQueue::
CreateXpsDocumentWriter(
PrintQueue^ printQueue
)
{
XpsDocumentWriter^ writer = gcnew XpsDocumentWriter(printQueue);
return writer;
}
/*--------------------------------------------------------------------------------------*/
XpsDocumentWriter^
PrintQueue::
CreateXpsDocumentWriter(
double% width,
double% height
)
{
XpsDocumentWriter^ writer = nullptr;
PrintTicket^ partialTrustPrintTicket = nullptr;
PrintQueue^ partialTrustPrintQueue = nullptr;
ShowPrintDialog(writer,
partialTrustPrintTicket,
partialTrustPrintQueue,
width,
height,
nullptr
);
return writer;
}
XpsDocumentWriter^
PrintQueue::
CreateXpsDocumentWriter(
PrintDocumentImageableArea^% printDocumentImageableArea
)
{
return CreateXpsDocumentWriter(nullptr,
printDocumentImageableArea);
}
XpsDocumentWriter^
PrintQueue::
CreateXpsDocumentWriter(
PrintDocumentImageableArea^% printDocumentImageableArea,
System::Windows::Controls::PageRangeSelection% pageRangeSelection,
System::Windows::Controls::PageRange% pageRange
)
{
return CreateXpsDocumentWriter(nullptr,
printDocumentImageableArea,
pageRangeSelection,
pageRange);
}
XpsDocumentWriter^
PrintQueue::
CreateXpsDocumentWriter(
String^ jobDescription,
PrintDocumentImageableArea^% printDocumentImageableArea
)
{
XpsDocumentWriter^ writer = nullptr;
PrintTicket^ partialTrustPrintTicket = nullptr;
PrintQueue^ partialTrustPrintQueue = nullptr;
double height;
double width;
if(ShowPrintDialog(writer,
partialTrustPrintTicket,
partialTrustPrintQueue,
height,
width,
jobDescription
))
{
printDocumentImageableArea = CalculateImagableArea(partialTrustPrintTicket,
partialTrustPrintQueue,
height,
width
);
}
return writer;
}
XpsDocumentWriter^
PrintQueue::
CreateXpsDocumentWriter(
String^ jobDescription,
PrintDocumentImageableArea^% printDocumentImageableArea,
System::Windows::Controls::PageRangeSelection% pageRangeSelection,
System::Windows::Controls::PageRange% pageRange
)
{
XpsDocumentWriter^ writer = nullptr;
PrintTicket^ partialTrustPrintTicket = nullptr;
PrintQueue^ partialTrustPrintQueue = nullptr;
double height;
double width;
if(ShowPrintDialogEnablePageRange(writer,
partialTrustPrintTicket,
partialTrustPrintQueue,
height,
width,
pageRangeSelection,
pageRange,
jobDescription
))
{
printDocumentImageableArea = CalculateImagableArea(partialTrustPrintTicket,
partialTrustPrintQueue,
height,
width);
}
return writer;
}
PrintDocumentImageableArea^
PrintQueue::
CalculateImagableArea(
PrintTicket^ partialTrustPrintTicket,
PrintQueue^ partialTrustPrintQueue,
double height,
double width
)
{
PrintDocumentImageableArea^ documentImageableArea = gcnew PrintDocumentImageableArea();
documentImageableArea->MediaSizeWidth = height;
documentImageableArea->MediaSizeHeight = width;
//
// Now let's calculate the real size of the imageable are on the device
//
PrintCapabilities^ printCapabilities = nullptr;
(gcnew PrintingPermission(PrintingPermissionLevel::DefaultPrinting))->Assert();
try
{
printCapabilities = partialTrustPrintQueue->GetPrintCapabilities(partialTrustPrintTicket);
}
_finally
{
PrintingPermission::RevertAssert();
}
if (printCapabilities->PageImageableArea != nullptr )
{
documentImageableArea->OriginWidth = printCapabilities->PageImageableArea->OriginWidth;
documentImageableArea->OriginHeight = printCapabilities->PageImageableArea->OriginHeight;
documentImageableArea->ExtentWidth = printCapabilities->PageImageableArea->ExtentWidth;
documentImageableArea->ExtentHeight = printCapabilities->PageImageableArea->ExtentHeight;
}
else
{
documentImageableArea->ExtentWidth = documentImageableArea->MediaSizeWidth;
documentImageableArea->ExtentHeight = documentImageableArea->MediaSizeHeight;
}
return documentImageableArea;
}
bool
PrintQueue::
ShowPrintDialog(
XpsDocumentWriter^% writer,
PrintTicket^% partialTrustPrintTicket,
PrintQueue^% partialTrustPrintQueue,
double% width,
double% height,
String^ jobDescription
)
{
//
// Invoke Avalon UI and get a partialTrustPrintQueue
//
#pragma warning ( disable:4691 )
System::Windows::Controls::PrintDialog^ printDialog = gcnew System::Windows::Controls::PrintDialog();
#pragma warning ( default:4691 )
bool dialogOk = GatherDataFromPrintDialog(printDialog,
writer,
partialTrustPrintTicket,
partialTrustPrintQueue,
width,
height,
jobDescription);
return dialogOk;
}
bool
PrintQueue::
ShowPrintDialogEnablePageRange(
XpsDocumentWriter^% writer,
PrintTicket^% partialTrustPrintTicket,
PrintQueue^% partialTrustPrintQueue,
double% width,
double% height,
System::Windows::Controls::PageRangeSelection% pageRangeSelection,
System::Windows::Controls::PageRange% pageRange,
String^ jobDescription
)
{
//
// Invoke Avalon UI and get a partialTrustPrintQueue
//
#pragma warning ( disable:4691 )
System::Windows::Controls::PrintDialog^ printDialog = gcnew System::Windows::Controls::PrintDialog();
#pragma warning ( default:4691 )
printDialog->UserPageRangeEnabled = true;
bool dialogOk = GatherDataFromPrintDialog(printDialog,
writer,
partialTrustPrintTicket,
partialTrustPrintQueue,
width,
height,
jobDescription);
if( dialogOk )
{
pageRangeSelection = printDialog->PageRangeSelection;
pageRange = printDialog->PageRange;
}
return dialogOk;
}
bool
PrintQueue::
GatherDataFromPrintDialog(
System::Windows::Controls::PrintDialog^ printDialog,
XpsDocumentWriter^% writer,
PrintTicket^% partialTrustPrintTicket,
PrintQueue^% partialTrustPrintQueue,
double% width,
double% height,
String^ jobDescription
)
{
bool dialogOk = false;
Nullable<bool> boolNullable = printDialog->ShowDialog();
if(boolNullable.HasValue &&
boolNullable.Value == true)
{
dialogOk = true;
(gcnew PrintingPermission(PrintingPermissionLevel::DefaultPrinting))->Assert();
try
{
partialTrustPrintTicket = printDialog->PrintTicket;
partialTrustPrintQueue = printDialog->PrintQueue;
if(partialTrustPrintQueue!=nullptr &&
jobDescription!=nullptr)
{
partialTrustPrintQueue->CurrentJobSettings->Description = jobDescription;
}
partialTrustPrintQueue->InPartialTrust = true;
}
__finally
{
PrintingPermission::RevertAssert();
}
writer = gcnew XpsDocumentWriter(partialTrustPrintQueue, nullptr);
PartialTrustPrintTicketEventHandler^
printTicketEventHandler = gcnew PartialTrustPrintTicketEventHandler(partialTrustPrintTicket);
writer->WritingPrintTicketRequired +=
gcnew WritingPrintTicketRequiredEventHandler(printTicketEventHandler,
&PartialTrustPrintTicketEventHandler::
SetPrintTicketInPartialTrust);
width = printDialog->PrintableAreaWidth;
height = printDialog->PrintableAreaHeight;
}
return dialogOk;
}
PrintQueue::
PartialTrustPrintTicketEventHandler::
PartialTrustPrintTicketEventHandler(
PrintTicket^ printTicket
):
isPrintTicketHandedOver(false)
{
partialTrustPrintTicket = printTicket;
}
void
PrintQueue::
PartialTrustPrintTicketEventHandler::
SetPrintTicketInPartialTrust(
Object^ sender,
WritingPrintTicketRequiredEventArgs^ args
)
{
if(!isPrintTicketHandedOver)
{
if ( (args->CurrentPrintTicketLevel == PrintTicketLevel::FixedDocumentSequencePrintTicket) ||
(args->CurrentPrintTicketLevel == PrintTicketLevel::FixedDocumentPrintTicket) )
{
args->CurrentPrintTicket = partialTrustPrintTicket;
//
// In partial trust, we only have one print ticket for the whole
// document and we should hand it over only once to the calling
// component.
//
isPrintTicketHandedOver = true;
}
}
}
Boolean
PrintQueue::
IsXpsDocumentEventSupported(
XpsDocumentEventType escape
)
{
return printerThunkHandler->IsXpsDocumentEventSupported(escape,
(escape == XpsDocumentEventType::AddFixedDocumentSequencePre));
}
void
PrintQueue::
ForwardXpsDriverDocEvent(
Object^ sender,
System::Windows::Xps::Serialization::XpsSerializationXpsDriverDocEventArgs^ e
)
{
try
{
if (IsXpsDevice && IsXpsDocumentEventSupported(e->DocumentEvent))
{
switch (e->DocumentEvent)
{
case XpsDocumentEventType::AddFixedDocumentSequencePre:
case XpsDocumentEventType::AddFixedDocumentSequencePost:
{
ForwardXpsFixedDocumentSequenceEvent(e);
break;
}
case XpsDocumentEventType::AddFixedDocumentPre:
case XpsDocumentEventType::AddFixedDocumentPost:
{
ForwardXpsFixedDocumentEvent(e);
break;
}
case XpsDocumentEventType::AddFixedPagePre:
case XpsDocumentEventType::AddFixedPagePost:
{
ForwardXpsFixedPageEvent(e);
break;
}
case XpsDocumentEventType::AddFixedDocumentSequencePrintTicketPre:
{
ForwardXpsFixedDocumentSequencePrintTicket(e);
break;
}
case XpsDocumentEventType::AddFixedDocumentPrintTicketPre:
{
ForwardXpsFixedDocumentPrintTicket(e);
break;
}
case XpsDocumentEventType::AddFixedPagePrintTicketPre:
{
ForwardXpsFixedPagePrintTicket(e);
break;
}
case XpsDocumentEventType::XpsDocumentCancel:
{
XpsDocumentEventCancel();
break;
}
case XpsDocumentEventType::AddFixedPagePrintTicketPost:
case XpsDocumentEventType::AddFixedDocumentPrintTicketPost:
case XpsDocumentEventType::AddFixedDocumentSequencePrintTicketPost:
case XpsDocumentEventType::None:
default:
{
break;
}
}
}
}
catch(InternalPrintSystemException^ internalException)
{
throw PrintSystemJobInfo::CreatePrintJobException(internalException->HResult, "PrintSystemException.PrintSystemJobInfo.XpsDocumentEvent");
}
}
void
PrintQueue::
ForwardXpsFixedDocumentSequenceEvent(
System::Windows::Xps::Serialization::XpsSerializationXpsDriverDocEventArgs^ e
)
{
SafeHandle^ inputBufferSafeHandle = nullptr;
Int32 returnValue = DOCUMENTEVENT_UNSUPPORTED;
try
{
inputBufferSafeHandle = UnmanagedXpsDocEventBuilder::XpsDocEventFixedDocSequence(e->DocumentEvent,
writerStream->JobIdentifier,
(this->CurrentJobSettings->Description == nullptr) ?
defaultXpsJobName :
this->CurrentJobSettings->Description,
nullptr,
false);
returnValue = this->XpsDocumentEvent(e->DocumentEvent,
inputBufferSafeHandle);
}
catch(InternalPrintSystemException^ internalException)
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
throw PrintSystemJobInfo::CreatePrintJobException(internalException->HResult, "PrintSystemException.PrintSystemJobInfo.XpsDocumentEvent");
}
__finally
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
}
}
void
PrintQueue::
ForwardXpsFixedDocumentEvent(
System::Windows::Xps::Serialization::XpsSerializationXpsDriverDocEventArgs^ e
)
{
SafeHandle^ inputBufferSafeHandle = nullptr;
Int32 returnValue = DOCUMENTEVENT_UNSUPPORTED;
try
{
inputBufferSafeHandle = UnmanagedXpsDocEventBuilder::XpsDocEventFixedDocument(e->DocumentEvent,
e->CurrentCount,
nullptr,
false);
returnValue = this->XpsDocumentEvent(e->DocumentEvent,
inputBufferSafeHandle);
}
catch(InternalPrintSystemException^ internalException)
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
throw PrintSystemJobInfo::CreatePrintJobException(internalException->HResult, "PrintSystemException.PrintSystemJobInfo.XpsDocumentEvent");
}
__finally
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
}
}
void
PrintQueue::
ForwardXpsFixedPageEvent(
System::Windows::Xps::Serialization::XpsSerializationXpsDriverDocEventArgs^ e
)
{
SafeHandle^ inputBufferSafeHandle = nullptr;
Int32 returnValue = DOCUMENTEVENT_UNSUPPORTED;
try
{
inputBufferSafeHandle = UnmanagedXpsDocEventBuilder::XpsDocEventFixedPage(e->DocumentEvent,
e->CurrentCount,
nullptr,
false);
returnValue = this->XpsDocumentEvent(e->DocumentEvent,
inputBufferSafeHandle);
}
catch(InternalPrintSystemException^ internalException)
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
throw PrintSystemJobInfo::CreatePrintJobException(internalException->HResult, "PrintSystemException.PrintSystemJobInfo.XpsDocumentEvent");
}
__finally
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
}
}
void
PrintQueue::
ForwardXpsFixedDocumentSequencePrintTicket(
System::Windows::Xps::Serialization::XpsSerializationXpsDriverDocEventArgs^ e
)
{
SafeHandle^ inputBufferSafeHandle = nullptr;
MemoryStream^ printTicketStream = nullptr;
try
{
if (e->PrintTicket != nullptr)
{
printTicketStream = e->PrintTicket->GetXmlStream();
}
inputBufferSafeHandle = UnmanagedXpsDocEventBuilder::XpsDocEventFixedDocSequence(e->DocumentEvent,
writerStream->JobIdentifier,
(this->CurrentJobSettings->Description == nullptr) ?
defaultXpsJobName :
this->CurrentJobSettings->Description,
printTicketStream,
true);
this->XpsDocumentEventPrintTicket(XpsDocumentEventType::AddFixedDocumentSequencePrintTicketPre,
XpsDocumentEventType::AddFixedDocumentSequencePrintTicketPost,
inputBufferSafeHandle,
e);
}
catch(InternalPrintSystemException^ internalException)
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
if (printTicketStream != nullptr)
{
delete printTicketStream;
printTicketStream = nullptr;
}
throw PrintSystemJobInfo::CreatePrintJobException(internalException->HResult, "PrintSystemException.PrintSystemJobInfo.XpsDocumentEvent");
}
__finally
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
if (printTicketStream != nullptr)
{
delete printTicketStream;
printTicketStream = nullptr;
}
}
}
void
PrintQueue::
ForwardXpsFixedDocumentPrintTicket(
System::Windows::Xps::Serialization::XpsSerializationXpsDriverDocEventArgs^ e
)
{
SafeHandle^ inputBufferSafeHandle = nullptr;
Stream^ printTicketStream = nullptr;
try
{
if (e->PrintTicket != nullptr)
{
printTicketStream = e->PrintTicket->GetXmlStream();
}
inputBufferSafeHandle = UnmanagedXpsDocEventBuilder::XpsDocEventFixedDocument(e->DocumentEvent,
e->CurrentCount,
printTicketStream,
true);
this->XpsDocumentEventPrintTicket(XpsDocumentEventType::AddFixedDocumentPrintTicketPre,
XpsDocumentEventType::AddFixedDocumentPrintTicketPost,
inputBufferSafeHandle,
e);
}
catch(InternalPrintSystemException^ internalException)
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
if (printTicketStream != nullptr)
{
delete printTicketStream;
printTicketStream = nullptr;
}
throw PrintSystemJobInfo::CreatePrintJobException(internalException->HResult, "PrintSystemException.PrintSystemJobInfo.XpsDocumentEvent");
}
__finally
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
if (printTicketStream != nullptr)
{
delete printTicketStream;
printTicketStream = nullptr;
}
}
}
void
PrintQueue::
ForwardXpsFixedPagePrintTicket(
System::Windows::Xps::Serialization::XpsSerializationXpsDriverDocEventArgs^ e
)
{
SafeHandle^ inputBufferSafeHandle = nullptr;
Stream^ printTicketStream = nullptr;
try
{
if (e->PrintTicket != nullptr)
{
printTicketStream = e->PrintTicket->GetXmlStream();
}
inputBufferSafeHandle = UnmanagedXpsDocEventBuilder::XpsDocEventFixedDocument(e->DocumentEvent,
e->CurrentCount,
printTicketStream,
true);
this->XpsDocumentEventPrintTicket(XpsDocumentEventType::AddFixedPagePrintTicketPre,
XpsDocumentEventType::AddFixedPagePrintTicketPost,
inputBufferSafeHandle,
e);
}
catch(InternalPrintSystemException^ internalException)
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
if (printTicketStream != nullptr)
{
delete printTicketStream;
printTicketStream = nullptr;
}
throw PrintSystemJobInfo::CreatePrintJobException(internalException->HResult, "PrintSystemException.PrintSystemJobInfo.XpsDocumentEvent");
}
__finally
{
if (inputBufferSafeHandle != nullptr)
{
delete inputBufferSafeHandle;
}
if (printTicketStream != nullptr)
{
delete printTicketStream;
printTicketStream = nullptr;
}
}
}
Int32
PrintQueue::
XpsDocumentEvent(
XpsDocumentEventType escape,
SafeHandle^ inputBufferSafeHandle
)
{
Int32 returnValue = DOCUMENTEVENT_UNSUPPORTED;
try
{
if (this->InPartialTrust)
{
(gcnew PrintingPermission(PrintingPermissionLevel::DefaultPrinting))->Assert(); //Blessed
}
if (inputBufferSafeHandle != nullptr)
{
returnValue = printerThunkHandler->ThunkDocumentEvent(escape,
inputBufferSafeHandle);
}
}
__finally
{
if (this->InPartialTrust)
{
SecurityPermission::RevertAssert();
}
}
return returnValue;
}
Int32
PrintQueue::
XpsDocumentEventPrintTicket(
XpsDocumentEventType preEscape,
XpsDocumentEventType postEscape,
SafeHandle^ inputBufferSafeHandle,
XpsSerializationXpsDriverDocEventArgs^ e
)
{
MemoryStream^ driverPrintTicketStream = nullptr;
PrintTicket^ driverPrintTicket = nullptr;
Int32 returnValue = DOCUMENTEVENT_UNSUPPORTED;
if (this->InPartialTrust)
{
(gcnew PrintingPermission(PrintingPermissionLevel::DefaultPrinting))->Assert(); //Blessed
}
try
{
returnValue = printerThunkHandler->ThunkDocumentEventPrintTicket(preEscape,
postEscape,
inputBufferSafeHandle,
driverPrintTicketStream);
if (returnValue)
{
if (driverPrintTicketStream)
{
driverPrintTicket = gcnew PrintTicket(driverPrintTicketStream);
}
e->PrintTicket = driverPrintTicket;
}
}
catch(InternalPrintSystemException^ internalException)
{
if (driverPrintTicketStream != nullptr)
{
delete driverPrintTicketStream;
driverPrintTicketStream = nullptr;
}
if (this->InPartialTrust)
{
SecurityPermission::RevertAssert();
}
throw PrintSystemJobInfo::CreatePrintJobException(internalException->HResult, "PrintSystemException.PrintSystemJobInfo.XpsDocumentEvent");
}
__finally
{
if (driverPrintTicketStream != nullptr)
{
delete driverPrintTicketStream;
driverPrintTicketStream = nullptr;
}
if (this->InPartialTrust)
{
SecurityPermission::RevertAssert();
}
}
return returnValue;
}
void
PrintQueue::
XpsDocumentEventCancel(
void
)
{
try
{
if (this->InPartialTrust)
{
(gcnew PrintingPermission(PrintingPermissionLevel::DefaultPrinting))->Assert(); //Blessed
}
printerThunkHandler->ThunkDocumentEvent(XpsDocumentEventType::XpsDocumentCancel);
}
__finally
{
if (this->InPartialTrust)
{
SecurityPermission::RevertAssert();
}
}
}
void
PrintQueue::
VerifyAccess(
void
)
{
if(accessVerifier==nullptr)
{
accessVerifier = gcnew PrintSystemDispatcherObject();
}
accessVerifier->VerifyThreadLocality();
}
__declspec(noinline)
Exception^
PrintQueue::CreatePrintQueueException(
int hresult,
String^ messageId
)
{
return gcnew PrintQueueException(hresult, messageId, Name);
}
__declspec(noinline)
Exception^
PrintQueue::CreatePrintSystemException(
int hresult,
String^ messageId
)
{
return gcnew PrintSystemException(hresult, messageId);
}
/*--------------------------------------------------------------------------------------*/
/* PrintQueueCollection Implementation */
/*--------------------------------------------------------------------------------------*/
PrintQueueCollection::
PrintQueueCollection(
void
)
{
printQueuesCollection = gcnew System::Collections::Generic::Queue<PrintQueue ^>();
accessVerifier = gcnew PrintSystemDispatcherObject();
}
PrintQueueCollection::
PrintQueueCollection(
PrintServer^ printServer,
array<String^>^ propertyFilter,
array<EnumeratedPrintQueueTypes>^ enumerationFlag
)
{
EnumDataThunkObject^ enumDataThunkObject = nullptr;
printQueuesCollection = gcnew System::Collections::Generic::Queue<PrintQueue ^>();
accessVerifier = gcnew PrintSystemDispatcherObject();
try
{
enumDataThunkObject =
gcnew EnumDataThunkObject(System::Printing::PrintQueue::typeid);
enumDataThunkObject->GetPrintSystemValuesPerPrintQueues(printServer,
enumerationFlag,
printQueuesCollection,
AddNameAndHostToProperties(propertyFilter));
}
catch (InternalPrintSystemException^ internalException)
{
throw printServer->CreatePrintServerException(internalException->HResult, "PrintSystemException.PrintQueues.Enumerate");
}
__finally
{
if (enumDataThunkObject)
{
delete enumDataThunkObject;
enumDataThunkObject = nullptr;
}
}
}
PrintQueueCollection::
PrintQueueCollection(
PrintServer^ printServer,
array<String^>^ propertyFilter
)
{
EnumDataThunkObject^ enumDataThunkObject = nullptr;
printQueuesCollection = gcnew System::Collections::Generic::Queue<PrintQueue ^>();
accessVerifier = gcnew PrintSystemDispatcherObject();
try
{
enumDataThunkObject =
gcnew EnumDataThunkObject(System::Printing::PrintQueue::typeid);
array<EnumeratedPrintQueueTypes>^ enumerationFlag = {EnumeratedPrintQueueTypes::Local};
enumDataThunkObject->GetPrintSystemValuesPerPrintQueues(printServer,
enumerationFlag,
printQueuesCollection,
AddNameAndHostToProperties(propertyFilter));
}
catch (InternalPrintSystemException^ internalException)
{
throw printServer->CreatePrintServerException(internalException->HResult, "PrintSystemException.PrintQueues.Enumerate");
}
__finally
{
if (enumDataThunkObject)
{
delete enumDataThunkObject;
enumDataThunkObject = nullptr;
}
}
}
PrintQueueCollection::
~PrintQueueCollection(
)
{
VerifyAccess();
printQueuesCollection = nullptr;
}
array<String^>^
PrintQueueCollection::
AddNameAndHostToProperties(
array<String^>^ propertyFilter
)
{
Int32 index = 0;
array<String^>^ NameAndHostPropertiesFilter = gcnew array<String^>(propertyFilter->Length + 2);
NameAndHostPropertiesFilter[0] = L"Name";
NameAndHostPropertiesFilter[1] = L"HostingPrintServerName";
for(index = 0; index < propertyFilter->Length; index++)
{
NameAndHostPropertiesFilter[index + 2] = propertyFilter[index];
}
return NameAndHostPropertiesFilter;
}
void
PrintQueueCollection::
Add(
PrintQueue^ printQueue
)
{
VerifyAccess();
printQueuesCollection->Enqueue(printQueue);
}
System::
Collections::
Generic::
IEnumerator<PrintQueue ^>^
PrintQueueCollection::
GetEnumerator(
void
)
{
VerifyAccess();
return printQueuesCollection->GetEnumerator();
}
System::
Collections::
IEnumerator^
PrintQueueCollection::
GetNonGenericEnumerator(
void
)
{
VerifyAccess();
return printQueuesCollection->GetEnumerator();
}
Object^
PrintQueueCollection::SyncRoot::
get(
void
)
{
return const_cast<Object^>(syncRoot);
}
void
PrintQueueCollection::
VerifyAccess(
void
)
{
if(accessVerifier==nullptr)
{
accessVerifier = gcnew PrintSystemDispatcherObject();
}
accessVerifier->VerifyThreadLocality();
}
| {
"content_hash": "5cbb8664b20ac59959293d08c28707e2",
"timestamp": "",
"source": "github",
"line_count": 5797,
"max_line_length": 156,
"avg_line_length": 28.128514749008108,
"alnum_prop": 0.6013148453646181,
"repo_name": "mind0n/hive",
"id": "e00a6b39a8e07adb97f208ce804ccbfbe9c22049",
"size": "163366",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Cache/Libs/net46/wpf/src/printing/cpp/src/printqueue.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "670329"
},
{
"name": "ActionScript",
"bytes": "7830"
},
{
"name": "ApacheConf",
"bytes": "47"
},
{
"name": "Batchfile",
"bytes": "18096"
},
{
"name": "C",
"bytes": "19746409"
},
{
"name": "C#",
"bytes": "258148996"
},
{
"name": "C++",
"bytes": "48534520"
},
{
"name": "CSS",
"bytes": "933736"
},
{
"name": "ColdFusion",
"bytes": "10780"
},
{
"name": "GLSL",
"bytes": "3935"
},
{
"name": "HTML",
"bytes": "4631854"
},
{
"name": "Java",
"bytes": "10881"
},
{
"name": "JavaScript",
"bytes": "10250558"
},
{
"name": "Logos",
"bytes": "1526844"
},
{
"name": "MAXScript",
"bytes": "18182"
},
{
"name": "Mathematica",
"bytes": "1166912"
},
{
"name": "Objective-C",
"bytes": "2937200"
},
{
"name": "PHP",
"bytes": "81898"
},
{
"name": "Perl",
"bytes": "9496"
},
{
"name": "PowerShell",
"bytes": "44339"
},
{
"name": "Python",
"bytes": "188058"
},
{
"name": "Shell",
"bytes": "758"
},
{
"name": "Smalltalk",
"bytes": "5818"
},
{
"name": "TypeScript",
"bytes": "50090"
}
],
"symlink_target": ""
} |
package dispatch
import (
"github.com/BotBotMe/botbot-bot/common"
"github.com/BotBotMe/botbot-bot/line"
"testing"
)
func TestDispatch(t *testing.T) {
dis := &Dispatcher{}
l := line.Line{
ChatBotId: 12,
Command: "PRIVMSG",
Content: "Hello",
Channel: "#foo"}
queue := common.NewMockQueue()
dis.queue = queue
dis.Dispatch(&l)
if len(queue.Got) != 1 {
t.Error("Dispatch did not go on queue")
}
received, _ := queue.Got[QUEUE_PREFIX]
if received == nil {
t.Error("Expected '", QUEUE_PREFIX, "' as queue name")
}
}
| {
"content_hash": "04480951e2fe079147cf1b0118476317",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 56,
"avg_line_length": 17.64516129032258,
"alnum_prop": 0.6416819012797075,
"repo_name": "BotBotMe/botbot-bot",
"id": "47657ccc62aa9f7c931c1ccb3bf6544a56a912c8",
"size": "547",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dispatch/dispatch_test.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Go",
"bytes": "65720"
}
],
"symlink_target": ""
} |
'use strict';
var path = require('path');
var yoUtils = require('yo-utils');
var chalk = require('chalk');
var controllerCfg = require('./config');
var _;
var EndpointGenerator = yoUtils.NamedBase.extend({
constructor: function() {
yoUtils.NamedBase.apply(this, arguments);
// add usage options
for (var opt in controllerCfg.options) {
this.option(opt, controllerCfg.options[opt]);
}
_ = this._;
},
/* Init method */
initializing: function() {
if (!this.options['skip-message']) {
console.log(chalk.magenta('Express controllers brought to you by generator-express-component.\n'));
}
// config defaults
this.option('skip-message', {
desc: 'Suppress generator messages',
defaults: false
});
this.defaults = controllerCfg.defaults;
},
/* Prompting priority methods */
prompting: {
subGenCfg: function() {
var done = this.async();
var ops = yoUtils.app.pluckOps(/^controller-/, this.options);
var cfg = this.config.get('controller') || {};
ops = _.merge(cfg, ops);
var prompts = controllerCfg.prompts(ops);
this.prompt(prompts, function(answers) {
this.ops = _.merge(ops, answers);
done();
}.bind(this));
},
instancePrompts: function() {
var done = this.async();
var name = this.name;
var ops = this.ops;
var nameTpl = this.ops.name || this.defaults.name;
var prompts = [{
name: 'name',
message: 'What will the variable name of your controller be?',
default: this.engine(nameTpl, this),
when: yoUtils.app.promptWhen(ops)('name', 'register')
}];
this.prompt(prompts, function (answers) {
this.ops.name = answers.name || controllerCfg.defaults.name;
done();
}.bind(this));
}
},
configuring: {
templateOps: function() {
for (var op in this.ops) {
var opVal = this.ops[op];
if (typeof opVal === 'string') {
this.ops[op] = this.engine(opVal, this);
}
}
}
},
/* Writing priority methods */
writing: {
// add new controller file
createFiles: function() {
var tPath;
if (!this.ops.template || this.ops.template.toLowerCase() === 'default') {
tPath = path.join(__dirname, './templates/controller.js');
} else {
tPath = path.relative(this.sourceRoot(), this.ops.template);
}
this.template(tPath, this.ops.path, this);
}
},
/* End priority methods */
end: {
// add controller endpoint to express route
registerEndpoint: function() {
if (this.ops.register) {
var ctrlName = this.ops.name;
var regControllerFile = this.ops.haystack;
var controllerFile = this.ops.path;
var relativeController = yoUtils.templating.relativePathTo(regControllerFile, controllerFile, true);
yoUtils.templating.rewriteFile({
file: regControllerFile,
needle: this.ops.needle,
splicable: [
"var " + ctrlName + " = require(\'" + relativeController + "\'));"
]
});
}
}
}
});
module.exports = EndpointGenerator;
| {
"content_hash": "2bd7ad279ede070636342924ab3256ac",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 108,
"avg_line_length": 26.608333333333334,
"alnum_prop": 0.5891011587848418,
"repo_name": "yo-components/generator-express-component",
"id": "50c970404b65e4c53397ead269cd3583d4e2cdf5",
"size": "3193",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "controller/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "16136"
}
],
"symlink_target": ""
} |
package com.stopo_pilot
import Network._
import scala.xml._
import scala.collection.mutable.ListBuffer
import scala.collection.mutable.LinkedHashMap
import scala.concurrent._
import akka.actor._
import spray.http._
import spray.client.pipelining._
import java.util.regex.Pattern
import scala.concurrent.duration._
import akka.actor.ActorSystem
import akka.util.Timeout
import akka.pattern.ask
import akka.io.IO
import spray.can.Http
import HttpMethods._
import spray.can.Http.{ClientConnectionType, HostConnectorInfo}
import spray.http.HttpHeaders.`User-Agent`
import spray.can.client.{HostConnectorSettings, ClientConnectionSettings}
object MapQuest {
implicit val system: ActorSystem = Pilot.system
implicit val timeout: Timeout = Timeout(5.seconds)
import system.dispatcher
val defaultSettings = ClientConnectionSettings(system)
//http://open.mapquestapi.com/nominatim/v1/reverse.php?format=xml&lat=51.521435&lon=1.162714
val setup = Http.HostConnectorSetup(
"open.mapquestapi.com",
port = 80,
sslEncryption = false,
defaultHeaders = List(`User-Agent`(Seq(ProductVersion("scala-wikiDB", "1.0", "email = github/bdwashbu")))),
settings = Some(new HostConnectorSettings(
maxConnections = 8,
maxRetries = 3,
maxRedirects = 0,
pipelining = false,
idleTimeout = 30.seconds,
connectionSettings = defaultSettings))
)
val Http.HostConnectorInfo(mapQuest, _) = Await.result(IO(Http)(system).ask (setup), 5.second)
def getCountry(lat: Double, lon: Double): Future[(String, String)] = {
val request = (mapQuest ? Get(
Uri("/nominatim/v1/reverse.php").
withQuery(
"format" -> "xml",
"lat" -> lat.toString,
"lon" -> lon.toString,
"accept-language" -> "en_EN"
)
)).mapTo[HttpResponse]
request.map{ response =>
val imageXML = XML.loadString(response.entity.asString)
((imageXML \\ "country").text, (imageXML \\ "state").text)
}
}
} | {
"content_hash": "72b8ba571367147db68a0b9349758d4e",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 111,
"avg_line_length": 29,
"alnum_prop": 0.69064039408867,
"repo_name": "bdwashbu/scala-wikiDB",
"id": "64031ba94911bbdcd0cf1652208074ac6cb3f483",
"size": "2030",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/scala/com/stopo_pilot/MapQuest.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Scala",
"bytes": "42930"
}
],
"symlink_target": ""
} |
package com.xhsoft.framework.common.utils;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
* 基本方法工具类接口
*
* @author shadow
* @email 124010356@qq.com
* @create 2012.04.28
*/
public interface CommonUtil {
/**
* 获取客户端IP地址
*
* @return String
*/
public String getClientIP();
/**
* 获取客户端IP地址
*
* @param request
* @return String
*/
public String getClientIP(HttpServletRequest request);
/**
* 把Object对象数组封装成Map
*
* @param keys
* @param values
* @return Map
*/
public Map<String, Object> toMap(Object[] keys, Object[] values);
/**
* 把Object对象封装成Map
*
* @param key
* @param value
* @return Map<String, Object>
*/
public Map<String, Object> toMap(Object key, Object value);
/**
* 把Object数组键值对封装入Map
*
* @param params
* @param keys
* @param values
* @return Map<String, Object>
*/
public Map<String, Object> toMap(Map<String, Object> map, Object[] keys,
Object[] values);
/**
* 把Object键值对封装入Map
*
* @param params
* @param keys
* @param values
* @return Map<String, Object>
*/
public Map<String, Object> toMap(Map<String, Object> map, Object key,
Object value);
/**
* 生成String类型UUID编号
*
* @return String
*/
public String getUUID();
/**
* 自定义编码强转(odlEncode不设置默认为ISO8859-1)
*
* @param string
* @param oldEncode
* @param newEncode
* @return String
*/
public String toEncoding(String string, String oldEncode, String newEncode);
}
| {
"content_hash": "8fd30da4ddd1753fe0a7cd4eee898020",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 77,
"avg_line_length": 16.988505747126435,
"alnum_prop": 0.6434370771312584,
"repo_name": "hopestar720/aioweb",
"id": "6af375e70fd8731509d30282972b7b86ceec7185",
"size": "1622",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/xhsoft/framework/common/utils/CommonUtil.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "532039"
},
{
"name": "Java",
"bytes": "1181791"
},
{
"name": "JavaScript",
"bytes": "1712197"
}
],
"symlink_target": ""
} |
class CreateForumPostParticipants < ActiveRecord::Migration[5.0]
def change
create_table :forum_post_participants do |t|
t.integer :forum_post_id, null: false
t.integer :user_id, null: false
t.timestamps null: false
end
add_index :forum_post_participants, :forum_post_id
add_index :forum_post_participants, :user_id
add_index :forum_post_participants, %i[forum_post_id user_id], unique: true
add_foreign_key :forum_post_participants, :forum_posts
add_foreign_key :forum_post_participants, :users
end
end
| {
"content_hash": "fb33ab8c7bf09057253ddcd32137334a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 79,
"avg_line_length": 34.75,
"alnum_prop": 0.7086330935251799,
"repo_name": "annict/annict",
"id": "d4098ff871bfc6abfe95ef987771809464bf8e79",
"size": "587",
"binary": false,
"copies": "1",
"ref": "refs/heads/dependabot/bundler/listen-3.7.1",
"path": "db/migrate/20170113204733_create_forum_post_participants.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "30911"
},
{
"name": "Dockerfile",
"bytes": "378"
},
{
"name": "HTML",
"bytes": "530616"
},
{
"name": "JavaScript",
"bytes": "76188"
},
{
"name": "Ruby",
"bytes": "933169"
},
{
"name": "TypeScript",
"bytes": "32431"
},
{
"name": "Vue",
"bytes": "58626"
}
],
"symlink_target": ""
} |
package play.db.jpa;
import play.*;
import play.libs.F;
import play.mvc.Http;
import javax.persistence.*;
/**
* JPA Helpers.
*/
public class JPA {
// Only used when there's no HTTP context
static ThreadLocal<EntityManager> currentEntityManager = new ThreadLocal<EntityManager>();
/**
* Create a default JPAApi with the given persistence unit configuration.
* Automatically initialise the JPA entity manager factories.
*/
public static JPAApi createFor(String name, String unitName) {
return new DefaultJPAApi(DefaultJPAConfig.of(name, unitName)).start();
}
/**
* Create a default JPAApi with name "default" and the given unit name.
* Automatically initialise the JPA entity manager factories.
*/
public static JPAApi createFor(String unitName) {
return new DefaultJPAApi(DefaultJPAConfig.of("default", unitName)).start();
}
/**
* Get the JPA api for the current play application.
*/
public static JPAApi jpaApi() {
Application app = Play.application();
if (app == null) {
throw new RuntimeException("No application running");
}
return app.injector().instanceOf(JPAApi.class);
}
/**
* Get the EntityManager for specified persistence unit for this thread.
*/
public static EntityManager em(String key) {
EntityManager em = jpaApi().em(key);
if (em == null) {
throw new RuntimeException("No JPA EntityManagerFactory configured for name [" + key + "]");
}
return em;
}
/**
* Get the default EntityManager for this thread.
*/
public static EntityManager em() {
Http.Context context = Http.Context.current.get();
if (context != null) {
EntityManager em = (EntityManager) context.args.get("currentEntityManager");
if (em == null) {
throw new RuntimeException("No EntityManager bound to this thread. Try to annotate your action method with @play.db.jpa.Transactional");
}
return em;
}
// Not a web request
EntityManager em = currentEntityManager.get();
if(em == null) {
throw new RuntimeException("No EntityManager bound to this thread. Try wrapping this call in JPA.withTransaction, or ensure that the HTTP context is setup on this thread.");
}
return em;
}
/**
* Bind an EntityManager to the current thread.
*/
public static void bindForCurrentThread(EntityManager em) {
Http.Context context = Http.Context.current.get();
if (context != null) {
if (em == null) {
context.args.remove("currentEntityManager");
} else {
context.args.put("currentEntityManager", em);
}
} else {
currentEntityManager.set(em);
}
}
/**
* Run a block of code in a JPA transaction.
*
* @param block Block of code to execute.
*/
public static <T> T withTransaction(play.libs.F.Function0<T> block) throws Throwable {
return jpaApi().withTransaction(block);
}
/**
* Run a block of asynchronous code in a JPA transaction.
*
* @param block Block of code to execute.
*
* @deprecated This may cause deadlocks
*/
@Deprecated
public static <T> F.Promise<T> withTransactionAsync(play.libs.F.Function0<F.Promise<T>> block) throws Throwable {
return jpaApi().withTransactionAsync(block);
}
/**
* Run a block of code in a JPA transaction.
*
* @param block Block of code to execute.
*/
public static void withTransaction(final play.libs.F.Callback0 block) {
jpaApi().withTransaction(block);
}
/**
* Run a block of code in a JPA transaction.
*
* @param name The persistence unit name
* @param readOnly Is the transaction read-only?
* @param block Block of code to execute.
*/
public static <T> T withTransaction(String name, boolean readOnly, play.libs.F.Function0<T> block) throws Throwable {
return jpaApi().withTransaction(name, readOnly, block);
}
/**
* Run a block of asynchronous code in a JPA transaction.
*
* @param name The persistence unit name
* @param readOnly Is the transaction read-only?
* @param block Block of code to execute.
*
* @deprecated This may cause deadlocks
*/
@Deprecated
public static <T> F.Promise<T> withTransactionAsync(String name, boolean readOnly, play.libs.F.Function0<F.Promise<T>> block) throws Throwable {
return jpaApi().withTransactionAsync(name, readOnly, block);
}
}
| {
"content_hash": "dbc3dae554492e907cd8d768fe7b28b0",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 185,
"avg_line_length": 32.21768707482993,
"alnum_prop": 0.6247888513513513,
"repo_name": "jyotikamboj/container",
"id": "cb210e0d6d5439c969782e94a5bed18ffa21b557",
"size": "4809",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pf-framework/src/play-java-jpa/src/main/java/play/db/jpa/JPA.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "130"
},
{
"name": "Assembly",
"bytes": "1050"
},
{
"name": "C",
"bytes": "6984025"
},
{
"name": "C#",
"bytes": "5011"
},
{
"name": "C++",
"bytes": "76346"
},
{
"name": "CSS",
"bytes": "332655"
},
{
"name": "Clojure",
"bytes": "4018"
},
{
"name": "CoffeeScript",
"bytes": "260"
},
{
"name": "Erlang",
"bytes": "693"
},
{
"name": "Go",
"bytes": "7990"
},
{
"name": "Java",
"bytes": "854529"
},
{
"name": "JavaScript",
"bytes": "1142584"
},
{
"name": "Lua",
"bytes": "4142"
},
{
"name": "Makefile",
"bytes": "6026"
},
{
"name": "Objective-C",
"bytes": "2621"
},
{
"name": "PHP",
"bytes": "6012"
},
{
"name": "Perl",
"bytes": "33126"
},
{
"name": "Perl6",
"bytes": "2994"
},
{
"name": "Python",
"bytes": "10715733"
},
{
"name": "Ruby",
"bytes": "654838"
},
{
"name": "Scala",
"bytes": "2829497"
},
{
"name": "Shell",
"bytes": "28228"
},
{
"name": "TeX",
"bytes": "7441"
},
{
"name": "VimL",
"bytes": "37498"
},
{
"name": "XSLT",
"bytes": "4275"
}
],
"symlink_target": ""
} |
package com.tectonica.jonix.onix2;
import java.io.Serializable;
import com.tectonica.jonix.JPU;
import com.tectonica.jonix.OnixElement;
import com.tectonica.jonix.codelist.BibleTextFeatures;
import com.tectonica.jonix.codelist.LanguageCodes;
import com.tectonica.jonix.codelist.RecordSourceTypes;
import com.tectonica.jonix.codelist.TextCaseFlags;
import com.tectonica.jonix.codelist.TextFormats;
import com.tectonica.jonix.codelist.TransliterationSchemes;
/*
* NOTE: THIS IS AN AUTO-GENERATED FILE, DON'T EDIT MANUALLY
*/
@SuppressWarnings("serial")
public class BibleTextFeature implements OnixElement, Serializable
{
public static final String refname = "BibleTextFeature";
public static final String shortname = "b357";
public TextFormats textformat;
public TextCaseFlags textcase;
public LanguageCodes language;
public TransliterationSchemes transliteration;
/**
* (type: DateOrDateTime)
*/
public String datestamp;
public RecordSourceTypes sourcetype;
public String sourcename;
public BibleTextFeatures value;
public BibleTextFeature()
{}
public BibleTextFeature(org.w3c.dom.Element element)
{
textformat = TextFormats.byValue(JPU.getAttribute(element, "textformat"));
textcase = TextCaseFlags.byValue(JPU.getAttribute(element, "textcase"));
language = LanguageCodes.byValue(JPU.getAttribute(element, "language"));
transliteration = TransliterationSchemes.byValue(JPU.getAttribute(element, "transliteration"));
datestamp = JPU.getAttribute(element, "datestamp");
sourcetype = RecordSourceTypes.byValue(JPU.getAttribute(element, "sourcetype"));
sourcename = JPU.getAttribute(element, "sourcename");
value = BibleTextFeatures.byValue(JPU.getContentAsString(element));
}
}
| {
"content_hash": "28a63109a0cffaeec6889b7910d4b135",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 97,
"avg_line_length": 28.85,
"alnum_prop": 0.7949162333911034,
"repo_name": "aparod/jonix",
"id": "3724e3bdad3f1e586f5fabd032e5b1e1c82318c6",
"size": "2438",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jonix-onix2/src/main/java/com/tectonica/jonix/onix2/BibleTextFeature.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "3354319"
},
{
"name": "Shell",
"bytes": "156"
}
],
"symlink_target": ""
} |
module Engines::RailsExtensions
# let's not rely *entirely* on Rails' magic modules. Not just yet.
end | {
"content_hash": "6d7690c8e0a11fd01c6e7325b0340bac",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 68,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.7596153846153846,
"repo_name": "asapnet/engines",
"id": "36e76a919c0d99751f3837f6cffc2567d979185a",
"size": "303",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/engines/rails_extensions.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "70757"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>FooJitsu - QUnit tests</title>
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.20.0.css">
<style>
#root {
-webkit-transition: width 0.2s ease;
-moz-transition: width 0.2s ease;
transition: width 0.2s ease;
width: 100px;
}
#root.start-transition {
width: 150px;
}
#root.start-transition-2 {
width: 200px;
}
</style>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture">
<div id="root">
<a id="child"></a>
</div>
</div>
<script src="http://code.jquery.com/qunit/qunit-1.20.0.js"></script>
<script src="@@file"></script>
<script>
QUnit.module('FooJitsu.prototype');
QUnit.test('trigger', function(assert){
assert.expect(6);
var root = document.querySelector('#root'),
$root = FooJitsu(root);
function onClick(e){
assert.ok(true, 'click handler executed');
assert.ok(e instanceof MouseEvent, 'click event type');
}
function onKeyUp(e){
assert.ok(true, 'keyup handler executed');
assert.ok(e instanceof KeyboardEvent, 'keyup event type');
}
function onCustom(e){
assert.ok(true, 'custom handler executed');
assert.ok(e instanceof Event, 'custom event type');
}
root.addEventListener('click', onClick);
root.addEventListener('keyup', onKeyUp);
root.addEventListener('custom', onCustom);
$root.trigger('click').trigger('keyup').trigger('custom');
root.removeEventListener('click', onClick);
root.removeEventListener('keyup', onKeyUp);
root.removeEventListener('custom', onCustom);
});
QUnit.test('on', function(assert){
assert.expect(16);
var $root = FooJitsu('#root'),
root = $root.get(0),
$child = FooJitsu('#child'),
child = $child.get(0);
function onClick(e){
assert.ok(true, 'click handler executed');
assert.ok(e instanceof MouseEvent, 'click event type');
}
function onCustom(e){
assert.ok(true, 'custom handler executed');
assert.ok(e instanceof Event, 'custom event type');
assert.propEqual(e.data, {test: 'test'}, 'custom data');
}
function onDblClick(e){
assert.ok(true, 'dblclick handler executed');
assert.ok(e instanceof MouseEvent, 'dblclick event type');
}
function onResize(e){
assert.ok(true, 'resize handler executed');
assert.ok(e instanceof Event, 'event type');
}
$root.on('click', onClick).trigger('click').trigger('click');
$root.on('custom', {test: 'test'}, onCustom).trigger('custom').trigger('custom');
$root.on('dblclick', 'a#child', onDblClick).trigger('dblclick');
$child.trigger('dblclick');
FooJitsu(window).on('resize', onResize).trigger('resize').trigger('resize');
root.removeEventListener('click', onClick);
root.removeEventListener('custom', onCustom);
});
QUnit.test('off', function(assert){
assert.expect(7);
var $root = FooJitsu('#root'),
$child = FooJitsu('#child');
function onClick(e){
assert.ok(true, 'click handler executed');
assert.ok(e instanceof MouseEvent, 'click event type');
}
function onCustom(e){
assert.ok(true, 'custom handler executed');
assert.ok(e instanceof Event, 'custom event type');
assert.propEqual(e.data, {test: 'test'}, 'custom data');
}
function onDblClick(e){
assert.ok(true, 'dblclick handler executed');
assert.ok(e instanceof MouseEvent, 'dblclick event type');
}
$root.on('click', onClick).trigger('click').off('click').trigger('click');
$root.on('custom', {test: 'test'}, onCustom).trigger('custom').off('custom').trigger('custom');
$root.on('dblclick', 'a#child', onDblClick).trigger('dblclick');
$child.trigger('dblclick');
$root.off('dblclick').trigger('dblclick');
$child.trigger('dblclick');
});
QUnit.test('one', function(assert){
assert.expect(5);
var $root = FooJitsu('#root');
function onClick(e){
assert.ok(true, 'click handler executed');
assert.ok(e instanceof MouseEvent, 'click event type');
}
function onCustom(e){
assert.ok(true, 'custom handler executed');
assert.ok(e instanceof Event, 'custom event type');
assert.propEqual(e.data, {test: 'test'}, 'custom data');
}
$root.one('click', onClick).trigger('click').trigger('click');
$root.one('custom', {test: 'test'}, onCustom).trigger('custom').trigger('custom');
});
QUnit.test('transitionend', function(assert){
assert.expect(4);
var done = assert.async(),
$root = FooJitsu('#root');
function onTransitionEnd(e){
$root.addClass('start-transition-2');
assert.ok(true, 'transitionend handler executed');
assert.ok(typeof e.propertyName === 'string', 'transitionend propertyName');
assert.ok(typeof e.elapsedTime === 'number', 'transitionend elapsedTime');
assert.propEqual(e.data, {test: 'test'}, 'transitionend data');
done();
}
$root.transitionend({test: 'test'}, onTransitionEnd).addClass('start-transition');
});
</script>
</body>
</html> | {
"content_hash": "01ab3e2ce776d53c6694eb14d8ab63f2",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 97,
"avg_line_length": 32.42,
"alnum_prop": 0.6687230104873535,
"repo_name": "fooplugins/foojitsu",
"id": "6d4b3a8d4c4e3cabe92b1061f10795ae38c93db5",
"size": "4863",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/tests/events.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "87617"
},
{
"name": "JavaScript",
"bytes": "170255"
}
],
"symlink_target": ""
} |
//=======================================================================
// Copyright Baptiste Wicht 2011-2014.
// Distributed under the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//=======================================================================
#include <ostream>
#include "cpp_utils/assert.hpp"
#include "AssemblyFileWriter.hpp"
#include "FunctionContext.hpp"
#include "Labels.hpp"
#include "VisitorUtils.hpp"
#include "GlobalContext.hpp"
#include "mtac/Program.hpp"
#include "asm/StringConverter.hpp"
#include "asm/IntelX86CodeGenerator.hpp"
#include "asm/IntelAssemblyUtils.hpp"
using namespace eddic;
as::IntelX86CodeGenerator::IntelX86CodeGenerator(AssemblyFileWriter& w, mtac::Program& program, std::shared_ptr<GlobalContext> context) : IntelCodeGenerator(w, program, context) {}
namespace {
const std::string registers[6] = {"eax", "ebx", "ecx", "edx", "esi", "edi"};
const std::string registers_8[6] = {"al", "bl", "cl", "dl", "", ""};
const std::string registers_16[6] = {"ax", "bx", "cx", "dx", "si", "di"};
const std::string float_registers[8] = {"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"};
struct X86_32StringConverter : public as::StringConverter, public boost::static_visitor<std::string> {
std::string operator()(ltac::Register& reg) const {
if(static_cast<int>(reg) == 1000){
return "esp";
} else if(static_cast<int>(reg) == 1001){
return "ebp";
}
return registers[static_cast<int>(reg)];
}
std::string operator()(ltac::FloatRegister& reg) const {
return float_registers[static_cast<int>(reg)];
}
std::string operator()(ltac::Address& address) const {
return address_to_string(address);
}
std::string operator()(int value) const {
return std::to_string(value);
}
std::string operator()(const std::string& value) const {
return value;
}
std::string operator()(ltac::PseudoRegister&) const {
cpp_unreachable("All the pseudo registers should have been converted into a hard register");
}
std::string operator()(ltac::PseudoFloatRegister&) const {
cpp_unreachable("All the pseudo registers should have been converted into a hard register");
}
std::string operator()(double value) const {
std::stringstream ss;
ss << "__float32__(" << std::fixed << value << ")";
return ss.str();
}
};
} //end of anonymous namespace
namespace x86 {
std::ostream& operator<<(std::ostream& os, eddic::ltac::Argument& arg){
X86_32StringConverter converter;
return os << visit(converter, arg);
}
} //end of x86 namespace
using namespace x86;
namespace {
std::string get_register_8(ltac::Register& reg){
cpp_assert(reg.reg < 6, "SP and BP registers cannot be subclassed");
auto sub_reg = registers_8[reg.reg];
cpp_assert(!sub_reg.empty(), "RSI and RDI are not 8-bit allocatable");
return sub_reg;
}
std::string get_register_16(ltac::Register& reg){
cpp_assert(reg.reg < 6, "SP and BP registers cannot be subclassed");
return registers_16[reg.reg];
}
void compile_statement(AssemblyFileWriter& writer, ltac::Instruction& instruction){
switch(instruction.op){
case ltac::Operator::LABEL:
writer.stream() << "." << instruction.label << ":" << '\n';
break;
case ltac::Operator::MOV:
if(instruction.size != tac::Size::DEFAULT){
if(boost::get<ltac::Address>(&*instruction.arg1)){
if(auto* ptr = boost::get<ltac::Register>(&*instruction.arg2)){
switch(instruction.size){
case tac::Size::BYTE:
writer.stream() << "mov byte " << *instruction.arg1 << ", " << get_register_8(*ptr) << '\n';
break;
case tac::Size::WORD:
writer.stream() << "mov word " << *instruction.arg1 << ", " << get_register_16(*ptr) << '\n';
break;
default:
writer.stream() << "mov dword " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
}
} else {
switch(instruction.size){
case tac::Size::BYTE:
writer.stream() << "mov byte " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case tac::Size::WORD:
writer.stream() << "mov word " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
default:
writer.stream() << "mov dword " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
}
}
} else {
//TODO The instruction should always be mov (and not movzx) to avoid having something context-dependent
//movzx should be chosen higher
switch(instruction.size){
case tac::Size::BYTE:
writer.stream() << "movzx " << *instruction.arg1 << ", byte " << *instruction.arg2 << '\n';
break;
case tac::Size::WORD:
writer.stream() << "movzx " << *instruction.arg1 << ", word " << *instruction.arg2 << '\n';
break;
default:
writer.stream() << "mov " << *instruction.arg1 << ", dword " << *instruction.arg2 << '\n';
break;
}
}
break;
}
if(boost::get<ltac::FloatRegister>(&*instruction.arg1) && boost::get<ltac::Register>(&*instruction.arg2)){
writer.stream() << "movd " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
} else if(boost::get<ltac::Register>(&*instruction.arg1) && boost::get<ltac::FloatRegister>(&*instruction.arg2)){
writer.stream() << "movd " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
} else if(boost::get<ltac::Address>(&*instruction.arg1)){
writer.stream() << "mov dword " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
} else {
writer.stream() << "mov " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
}
break;
case ltac::Operator::FMOV:
if(boost::get<ltac::FloatRegister>(&*instruction.arg1) && boost::get<ltac::Register>(&*instruction.arg2)){
writer.stream() << "movd " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
} else {
writer.stream() << "movss " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
}
break;
case ltac::Operator::ENTER:
writer.stream() << "push ebp" << '\n';
writer.stream() << "mov ebp, esp" << '\n';
break;
case ltac::Operator::LEAVE:
writer.stream() << "mov esp, ebp" << '\n';
writer.stream() << "pop ebp" << '\n';
break;
case ltac::Operator::RET:
writer.stream() << "ret" << '\n';
break;
case ltac::Operator::CMP_INT:
writer.stream() << "cmp " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMP_FLOAT:
writer.stream() << "ucomiss " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::OR:
writer.stream() << "or " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::XOR:
writer.stream() << "xor " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::PUSH:
if(boost::get<ltac::Address>(&*instruction.arg1)){
writer.stream() << "push dword " << *instruction.arg1 << '\n';
} else {
writer.stream() << "push " << *instruction.arg1 << '\n';
}
break;
case ltac::Operator::POP:
writer.stream() << "pop " << *instruction.arg1 << '\n';
break;
case ltac::Operator::LEA:
writer.stream() << "lea " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::SHIFT_LEFT:
writer.stream() << "sal " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::SHIFT_RIGHT:
writer.stream() << "sar " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::ADD:
writer.stream() << "add " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::SUB:
writer.stream() << "sub " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::MUL2:
case ltac::Operator::MUL3:
if(instruction.arg3){
writer.stream() << "imul " << *instruction.arg1 << ", " << *instruction.arg2 << ", " << *instruction.arg3 << '\n';
} else {
writer.stream() << "imul " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
}
break;
case ltac::Operator::DIV:
writer.stream() << "idiv " << *instruction.arg1 << '\n';
break;
case ltac::Operator::FADD:
writer.stream() << "addss " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::FSUB:
writer.stream() << "subss " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::FMUL:
writer.stream() << "mulss " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::FDIV:
writer.stream() << "divss " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::INC:
writer.stream() << "inc " << *instruction.arg1 << '\n';
break;
case ltac::Operator::DEC:
writer.stream() << "dec " << *instruction.arg1 << '\n';
break;
case ltac::Operator::NEG:
writer.stream() << "neg " << *instruction.arg1 << '\n';
break;
case ltac::Operator::NOT:
writer.stream() << "not " << *instruction.arg1 << '\n';
break;
case ltac::Operator::AND:
writer.stream() << "and " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::I2F:
writer.stream() << "cvtsi2ss " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::F2I:
writer.stream() << "cvttss2si " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMOVE:
writer.stream() << "cmove " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMOVNE:
writer.stream() << "cmovne " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMOVA:
writer.stream() << "cmova " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMOVAE:
writer.stream() << "cmovae " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMOVB:
writer.stream() << "cmovb " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMOVBE:
writer.stream() << "cmovbe " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMOVG:
writer.stream() << "cmovg " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMOVGE:
writer.stream() << "cmovge " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMOVL:
writer.stream() << "cmovl " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::CMOVLE:
writer.stream() << "cmovle " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::XORPS:
writer.stream() << "xorps " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::MOVDQU:
writer.stream() << "movdqu " << *instruction.arg1 << ", " << *instruction.arg2 << '\n';
break;
case ltac::Operator::NOP:
//Nothing to output for a nop
break;
case ltac::Operator::CALL:
writer.stream() << "call " << instruction.label << '\n';
break;
case ltac::Operator::ALWAYS:
writer.stream() << "jmp " << "." << instruction.label << '\n';
break;
case ltac::Operator::NE:
writer.stream() << "jne " << "." << instruction.label << '\n';
break;
case ltac::Operator::E:
writer.stream() << "je " << "." << instruction.label << '\n';
break;
case ltac::Operator::GE:
writer.stream() << "jge " << "." << instruction.label << '\n';
break;
case ltac::Operator::G:
writer.stream() << "jg " << "." << instruction.label << '\n';
break;
case ltac::Operator::LE:
writer.stream() << "jle " << "." << instruction.label << '\n';
break;
case ltac::Operator::L:
writer.stream() << "jl " << "." << instruction.label << '\n';
break;
case ltac::Operator::AE:
writer.stream() << "jae " << "." << instruction.label << '\n';
break;
case ltac::Operator::A:
writer.stream() << "ja" << "." << instruction.label << '\n';
break;
case ltac::Operator::BE:
writer.stream() << "jbe " << "." << instruction.label << '\n';
break;
case ltac::Operator::B:
writer.stream() << "jb " << "." << instruction.label << '\n';
break;
case ltac::Operator::P:
writer.stream() << "jp " << "." << instruction.label << '\n';
break;
case ltac::Operator::Z:
writer.stream() << "jz " << "." << instruction.label << '\n';
break;
case ltac::Operator::NZ:
writer.stream() << "jnz " << "." << instruction.label << '\n';
break;
default:
cpp_unreachable("The instruction operator is not supported");
}
}
} //end of anonymous namespace
void as::IntelX86CodeGenerator::compile(mtac::Function& function){
writer.stream() << '\n' << function.get_name() << ":" << '\n';
for(auto& bb : function){
for(auto& statement : bb->l_statements){
compile_statement(writer, statement);
}
}
}
void as::IntelX86CodeGenerator::writeRuntimeSupport(){
writer.stream() << "section .text" << '\n' << '\n';
writer.stream() << "global _start" << '\n' << '\n';
writer.stream() << "_start:" << '\n';
//If necessary init memory manager
if(context->exists("_F4mainAS")
|| program.call_graph.is_reachable(context->getFunction("_F4freePI"))
|| program.call_graph.is_reachable(context->getFunction("_F5allocI"))){
writer.stream() << "call _F4init" << '\n';
}
//If the user wants the args, we add support for them
if(context->exists("_F4mainAS")){
writer.stream() << "pop ebx" << '\n'; //ebx = number of args
writer.stream() << "lea ecx, [4 + ebx * 8]" << '\n'; //ecx = size of the array
writer.stream() << "call _F5allocI" << '\n'; //eax = start address of the array
writer.stream() << "mov esi, eax" << '\n'; //esi = last address of the array
writer.stream() << "mov edx, esi" << '\n'; //edx = last address of the array
writer.stream() << "mov [esi], ebx" << '\n'; //Set the length of the array
writer.stream() << "add esi, 4" << '\n'; //Move to the destination address of the first arg
writer.stream() << ".copy_args:" << '\n';
writer.stream() << "pop edi" << '\n'; //edi = address of current args
writer.stream() << "mov [esi], edi" << '\n'; //set the address of the string
/* Calculate the length of the string */
writer.stream() << "xor eax, eax" << '\n';
writer.stream() << "xor ecx, ecx" << '\n';
writer.stream() << "not ecx" << '\n';
writer.stream() << "repne scasb" << '\n';
writer.stream() << "not ecx" << '\n';
writer.stream() << "dec ecx" << '\n';
/* End of the calculation */
writer.stream() << "mov [esi+4], ecx" << '\n'; //set the length of the string
writer.stream() << "add esi, 8" << '\n';
writer.stream() << "dec ebx" << '\n';
writer.stream() << "jnz .copy_args" << '\n';
writer.stream() << "push edx" << '\n';
}
/* Give control to the user main function */
if(context->exists("_F4mainAS")){
writer.stream() << "call _F4mainAS" << '\n';
} else {
writer.stream() << "call _F4main" << '\n';
}
/* Exit the program */
writer.stream() << "mov eax, 1" << '\n';
writer.stream() << "xor ebx, ebx" << '\n';
writer.stream() << "int 80h" << '\n';
}
void as::IntelX86CodeGenerator::defineDataSection(){
writer.stream() << '\n' << "section .data" << '\n';
}
void as::IntelX86CodeGenerator::declareIntArray(const std::string& name, unsigned int size){
writer.stream() << "V" << name << ":" <<'\n';
writer.stream() << "dd " << size << '\n';
writer.stream() << "times " << size << " dd 0" << '\n';
}
void as::IntelX86CodeGenerator::declareFloatArray(const std::string& name, unsigned int size){
writer.stream() << "V" << name << ":" <<'\n';
writer.stream() << "dd " << size << '\n';
writer.stream() << "times " << size << " dd __float32__(0.0)" << '\n';
}
void as::IntelX86CodeGenerator::declareStringArray(const std::string& name, unsigned int size){
writer.stream() << "V" << name << ":" <<'\n';
writer.stream() << "dd " << size << '\n';
writer.stream() << "%rep " << size << '\n';
writer.stream() << "dd S1" << '\n';
writer.stream() << "dd 0" << '\n';
writer.stream() << "%endrep" << '\n';
}
void as::IntelX86CodeGenerator::declareIntVariable(const std::string& name, int value){
writer.stream() << "V" << name << " dd " << value << '\n';
}
void as::IntelX86CodeGenerator::declareBoolVariable(const std::string& name, bool value){
writer.stream() << "V" << name << " db " << value << '\n';
}
void as::IntelX86CodeGenerator::declareCharVariable(const std::string& name, char value){
writer.stream() << "V" << name << " db " << value << '\n';
}
void as::IntelX86CodeGenerator::declareStringVariable(const std::string& name, const std::string& label, int size){
writer.stream() << "V" << name << " dd " << label << ", " << size << '\n';
}
void as::IntelX86CodeGenerator::declareString(const std::string& label, const std::string& value){
writer.stream() << label << " dd " << value << '\n';
}
void as::IntelX86CodeGenerator::declareFloat(const std::string& label, double value){
writer.stream() << std::fixed << label << " dd __float32__(" << value << ")" << '\n';
}
void as::IntelX86CodeGenerator::addStandardFunctions(){
if(program.call_graph.is_reachable(context->getFunction("_F5printC"))){
output_function("x86_32_printC");
}
if(program.call_graph.is_reachable(context->getFunction("_F5printS"))){
output_function("x86_32_printS");
}
//Memory management functions are included the three together
if(context->exists("_F4mainAS") || program.call_graph.is_reachable(context->getFunction("_F4freePI")) || program.call_graph.is_reachable(context->getFunction("_F5allocI"))){
output_function("x86_32_alloc");
output_function("x86_32_init");
output_function("x86_32_free");
}
if(program.call_graph.is_reachable(context->getFunction("_F4timeAI"))){
output_function("x86_32_time");
}
if(program.call_graph.is_reachable(context->getFunction("_F8durationAIAI"))){
output_function("x86_32_duration");
}
if(program.call_graph.is_reachable(context->getFunction("_F9read_char"))){
output_function("x86_32_read_char");
}
}
| {
"content_hash": "bf644daae63d02552fbea23656d0d3ee",
"timestamp": "",
"source": "github",
"line_count": 508,
"max_line_length": 180,
"avg_line_length": 42.40157480314961,
"alnum_prop": 0.5006963788300836,
"repo_name": "vogelsgesang/eddic",
"id": "09ba5328061fd63d098966202e0ebe59a4977e8d",
"size": "21540",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/asm/IntelX86CodeGenerator.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "6650"
},
{
"name": "C",
"bytes": "2833"
},
{
"name": "C++",
"bytes": "1480574"
},
{
"name": "Makefile",
"bytes": "96381"
},
{
"name": "Shell",
"bytes": "665"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using ServiceStack.ServiceInterface.Auth;
using ServiceStack.WebHost.Endpoints;
namespace ServiceStack.ServiceInterface
{
/// <summary>
/// Enable the authentication feature and configure the AuthService.
/// </summary>
public class AuthFeature : IPlugin
{
public static bool AddUserIdHttpHeader = true;
private readonly Func<IAuthSession> sessionFactory;
private readonly IAuthProvider[] authProviders;
public Dictionary<Type, string[]> ServiceRoutes { get; set; }
public List<IPlugin> RegisterPlugins { get; set; }
public string HtmlRedirect { get; set; }
public bool IncludeAssignRoleServices
{
set
{
if (!value)
{
(from registerService in ServiceRoutes
where registerService.Key == typeof(AssignRolesService)
|| registerService.Key == typeof(UnAssignRolesService)
select registerService.Key).ToList()
.ForEach(x => ServiceRoutes.Remove(x));
}
}
}
public AuthFeature(Func<IAuthSession> sessionFactory, IAuthProvider[] authProviders, string htmlRedirect = "~/login")
{
this.sessionFactory = sessionFactory;
this.authProviders = authProviders;
ServiceRoutes = new Dictionary<Type, string[]> {
{ typeof(AuthService), new[]{"/auth", "/auth/{provider}"} },
{ typeof(AssignRolesService), new[]{"/assignroles"} },
{ typeof(UnAssignRolesService), new[]{"/unassignroles"} },
};
RegisterPlugins = new List<IPlugin> {
new SessionFeature()
};
this.HtmlRedirect = htmlRedirect;
}
public void Register(IAppHost appHost)
{
AuthService.Init(sessionFactory, authProviders);
AuthService.HtmlRedirect = HtmlRedirect;
var unitTest = appHost == null;
if (unitTest) return;
foreach (var registerService in ServiceRoutes)
{
appHost.RegisterService(registerService.Key, registerService.Value);
}
RegisterPlugins.ForEach(x => appHost.LoadPlugin(x));
}
public static TimeSpan? GetDefaultSessionExpiry()
{
if (AuthService.AuthProviders == null)
return SessionFeature.DefaultSessionExpiry;
var authProvider = AuthService.AuthProviders.FirstOrDefault() as AuthProvider;
return authProvider != null
? authProvider.SessionExpiry
: SessionFeature.DefaultSessionExpiry;
}
}
} | {
"content_hash": "1a0ec8c6761ceb4b4c487dac5d2df058",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 125,
"avg_line_length": 34.023809523809526,
"alnum_prop": 0.5811756473058083,
"repo_name": "fanta-mnix/ServiceStack",
"id": "e0f96b440cda1b92b5a3866a78ebbdc642fc1bb9",
"size": "2860",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/ServiceStack.ServiceInterface/AuthFeature.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "13505"
},
{
"name": "C#",
"bytes": "4364890"
},
{
"name": "CSS",
"bytes": "151175"
},
{
"name": "JavaScript",
"bytes": "455722"
},
{
"name": "PowerShell",
"bytes": "2528"
},
{
"name": "Puppet",
"bytes": "14979"
},
{
"name": "Shell",
"bytes": "2482"
}
],
"symlink_target": ""
} |
const timexConstants = require('./timexConstants.js');
const timexInference = require('../timexInference.js');
const convertDate = function(timex) {
if ('dayOfWeek' in timex) {
return timexConstants.days[timex.dayOfWeek - 1];
}
const month = timexConstants.months[timex.month - 1];
const date = timex.dayOfMonth.toString();
const abbreviation = timexConstants.dateAbbreviation[date.slice(-1)];
if ('year' in timex) {
return `${date}${abbreviation} ${month} ${timex.year}`.trim();
}
return `${date}${abbreviation} ${month}`;
};
const convertTime = function(timex) {
if (timex.hour === 0 && timex.minute === 0 && timex.second === 0) {
return 'midnight';
}
if (timex.hour === 12 && timex.minute === 0 && timex.second === 0) {
return 'midday';
}
const pad = function (s) { return (s.length === 1) ? '0' + s : s; };
const hour = (timex.hour === 0) ? '12' : (timex.hour > 12) ? (timex.hour - 12).toString() : timex.hour.toString();
const minute = (timex.minute === 0 && timex.second === 0) ? '' : ':' + pad(timex.minute.toString());
const second = (timex.second === 0) ? '' : ':' + pad(timex.second.toString());
const period = timex.hour < 12 ? 'AM' : 'PM';
return `${hour}${minute}${second}${period}`;
};
const convertDurationPropertyToString = function (timex, property, includeSingleCount) {
const propertyName = property + 's';
const value = timex[propertyName];
if (value !== undefined) {
if (value === 1) {
return includeSingleCount ? '1 ' + property : property;
}
else {
return `${value} ${property}s`;
}
}
return false;
};
const convertTimexDurationToString = function (timex, includeSingleCount) {
return convertDurationPropertyToString(timex, 'year', includeSingleCount)
|| convertDurationPropertyToString(timex, 'month', includeSingleCount)
|| convertDurationPropertyToString(timex, 'week', includeSingleCount)
|| convertDurationPropertyToString(timex, 'day', includeSingleCount)
|| convertDurationPropertyToString(timex, 'hour', includeSingleCount)
|| convertDurationPropertyToString(timex, 'minute', includeSingleCount)
|| convertDurationPropertyToString(timex, 'second', includeSingleCount);
};
const convertDuration = function(timex) {
return convertTimexDurationToString(timex, true);
};
const convertDateRange = function(timex) {
const season = ('season' in timex) ? timexConstants.seasons[timex.season] : '';
const year = ('year' in timex) ? timex.year.toString() : '';
if ('weekOfYear' in timex) {
if (timex.weekend) {
return '';
}
else {
return '';
}
}
if ('month' in timex) {
const month = `${timexConstants.months[timex.month - 1]}`;
if ('weekOfMonth' in timex) {
return `${timexConstants.weeks[timex.weekOfMonth - 1]} week of ${month}`;
}
else {
return `${month} ${year}`.trim();
}
}
return `${season} ${year}`.trim();
};
const convertTimeRange = function(timex) {
return timexConstants.dayParts[timex.partOfDay];
};
const convertDateTime = function(timex) {
return `${convertTime(timex)} ${convertDate(timex)}`;
};
const convertDateTimeRange = function(timex) {
if (timex.types.has('timerange')) {
return `${convertDate(timex)} ${convertTimeRange(timex)}`;
}
// date + time + duration
// - OR -
// date + duration
return '';
};
const convertTimexToString = function (timex) {
const types = ('types' in timex) ? timex.types : timexInference.infer(timex);
if (types.has('present')) {
return 'now';
}
if (types.has('datetimerange')) {
return convertDateTimeRange(timex);
}
if (types.has('daterange')) {
return convertDateRange(timex);
}
if (types.has('duration')) {
return convertDuration(timex);
}
if (types.has('timerange')) {
return convertTimeRange(timex);
}
// TODO: where appropriate delegate most the formatting delegate to Date.toLocaleString(options)
if (types.has('datetime')) {
return convertDateTime(timex);
}
if (types.has('date')) {
return convertDate(timex);
}
if (types.has('time')) {
return convertTime(timex);
}
return '';
};
const convertTimexSetToString = function(timexSet) {
const timex = timexSet.timex;
if (timex.types.has('duration')) {
return `every ${convertTimexDurationToString(timex, false)}`;
}
else {
return `every ${convertTimexToString(timex)}`;
}
};
module.exports = {
convertDate: convertDate,
convertTime: convertTime,
convertTimexToString: convertTimexToString,
convertTimexSetToString: convertTimexSetToString
};
| {
"content_hash": "3b24e246d14bf1341e93121577a701af",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 118,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.6161224489795918,
"repo_name": "rubio41/Recognizers-Text",
"id": "730dbba61430e109e0bd265d03e13f63f22a1bf1",
"size": "4962",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "JavaScript/packages/datatypes-date-time/src/en/timexConvert.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "120"
},
{
"name": "Batchfile",
"bytes": "9869"
},
{
"name": "C#",
"bytes": "1669407"
},
{
"name": "HTML",
"bytes": "6689"
},
{
"name": "JavaScript",
"bytes": "1754879"
},
{
"name": "PowerShell",
"bytes": "1418"
},
{
"name": "Shell",
"bytes": "173"
},
{
"name": "TypeScript",
"bytes": "1227979"
}
],
"symlink_target": ""
} |
module Financor
module BudgetlinesHelper
end
end
| {
"content_hash": "7009788c99ec3e6e1371b72f1164eb06",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 26,
"avg_line_length": 13.25,
"alnum_prop": 0.8113207547169812,
"repo_name": "farukca/financor",
"id": "fa58274208adc527cb4d626d12b304121082205f",
"size": "53",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/helpers/financor/budgetlines_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3032"
},
{
"name": "CoffeeScript",
"bytes": "763"
},
{
"name": "HTML",
"bytes": "85024"
},
{
"name": "JavaScript",
"bytes": "3153"
},
{
"name": "Ruby",
"bytes": "63359"
}
],
"symlink_target": ""
} |
package com.afollestad.cabinet.cram;
/**
* @author Aidan Follestad (afollestad)
*/
public final class UnsupportedFormatException extends RuntimeException {
protected UnsupportedFormatException(String message) {
super(message);
}
}
| {
"content_hash": "d3c5833420ca364dbe82aa72b34e159f",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 72,
"avg_line_length": 22.818181818181817,
"alnum_prop": 0.7410358565737052,
"repo_name": "BioHaZard1/cabinet",
"id": "694919e40bf73fed785012b29006964938b4ae60",
"size": "251",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/afollestad/cabinet/cram/UnsupportedFormatException.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Groovy",
"bytes": "2211"
},
{
"name": "Java",
"bytes": "400107"
}
],
"symlink_target": ""
} |
@import url(http://fonts.googleapis.com/css?family=Sacramento);
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden],
template {
display: none;
}
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
a {
background: transparent;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
mark {
background: #ff0;
color: #000;
}
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
pre {
white-space: pre-wrap;
}
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
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: 0;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
button,
input,
select,
textarea {
font-family: inherit;
font-size: 100%;
margin: 0;
}
button,
input {
line-height: normal;
}
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;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
vertical-align: top;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
@font-face {
font-family: 'Neristhin';
src: url('/dist/fonts/Neris-Thin-webfont.eot');
src: url('/dist/fonts/Neris-Thin-webfont.eot?#iefix') format('embedded-opentype'), url('/dist/fonts/Neris-Thin-webfont.woff') format('woff'), url('/dist/fonts/Neris-Thin-webfont.ttf') format('truetype'), url('/dist/fonts/Neris-Thin-webfont.svg#/dist/fonts/Neristhin') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Nerissemibold_italic';
src: url('/dist/fonts/Neris-SemiBoldItalic-webfont.eot');
src: url('/dist/fonts/Neris-SemiBoldItalic-webfont.eot?#iefix') format('embedded-opentype'), url('/dist/fonts/Neris-SemiBoldItalic-webfont.woff') format('woff'), url('/dist/fonts/Neris-SemiBoldItalic-webfont.ttf') format('truetype'), url('/dist/fonts/Neris-SemiBoldItalic-webfont.svg#/dist/fonts/Nerissemibold_italic') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Nerissemibold';
src: url('/dist/fonts/Neris-SemiBold-webfont.eot');
src: url('/dist/fonts/Neris-SemiBold-webfont.eot?#iefix') format('embedded-opentype'), url('/dist/fonts/Neris-SemiBold-webfont.woff') format('woff'), url('/dist/fonts/Neris-SemiBold-webfont.ttf') format('truetype'), url('/dist/fonts/Neris-SemiBold-webfont.svg#/dist/fonts/Nerissemibold') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Nerislight_italic';
src: url('/dist/fonts/Neris-LightItalic-webfont.eot');
src: url('/dist/fonts/Neris-LightItalic-webfont.eot?#iefix') format('embedded-opentype'), url('/dist/fonts/Neris-LightItalic-webfont.woff') format('woff'), url('/dist/fonts/Neris-LightItalic-webfont.ttf') format('truetype'), url('/dist/fonts/Neris-LightItalic-webfont.svg#/dist/fonts/Nerislight_italic') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Nerislight';
src: url('/dist/fonts/Neris-Light-webfont.eot');
src: url('/dist/fonts/Neris-Light-webfont.eot?#iefix') format('embedded-opentype'), url('/dist/fonts/Neris-Light-webfont.woff') format('woff'), url('/dist/fonts/Neris-Light-webfont.ttf') format('truetype'), url('/dist/fonts/Neris-Light-webfont.svg#/dist/fonts/Nerislight') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Nerisbold_italic';
src: url('/dist/fonts/Neris-BoldItalic-webfont.eot');
src: url('/dist/fonts/Neris-BoldItalic-webfont.eot?#iefix') format('embedded-opentype'), url('/dist/fonts/Neris-BoldItalic-webfont.woff') format('woff'), url('/dist/fonts/Neris-BoldItalic-webfont.ttf') format('truetype'), url('/dist/fonts/Neris-BoldItalic-webfont.svg#/dist/fonts/Nerisbold_italic') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Nerisblack_italic';
src: url('/dist/fonts/Neris-BlackItalic-webfont.eot');
src: url('/dist/fonts/Neris-BlackItalic-webfont.eot?#iefix') format('embedded-opentype'), url('/dist/fonts/Neris-BlackItalic-webfont.woff') format('woff'), url('/dist/fonts/Neris-BlackItalic-webfont.ttf') format('truetype'), url('/dist/fonts/Neris-BlackItalic-webfont.svg#/dist/fonts/Nerisblack_italic') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Nerisblack';
src: url('/dist/fonts/Neris-Black-webfont.eot');
src: url('/dist/fonts/Neris-Black-webfont.eot?#iefix') format('embedded-opentype'), url('/dist/fonts/Neris-Black-webfont.woff') format('woff'), url('/dist/fonts/Neris-Black-webfont.ttf') format('truetype'), url('/dist/fonts/Neris-Black-webfont.svg#/dist/fonts/Nerisblack') format('svg');
font-weight: normal;
font-style: normal;
}
/*
.adjust-font-size-to(@sizeValue) {
@remValue: @sizeValue;
@pxValue: (@sizeValue * 16);
font-size: ~"@{pxValue}px";
font-size: ~"@{remValue}rem";
}
*/
html {
font-size: ((16 * 100) / 16) + 0%;
}
.navbar-wrapper {
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 20;
}
.dev-header {
background-color: #333;
color: #fff;
text-align: center;
background-image: url("/assets/img/dev-bg.jpg");
background-repeat: no-repeat;
-moz-background-size: cover;
background-size: cover;
position: relative;
padding: 70px 0 30px;
}
@media screen and (min-width: 765px) {
.dev-header {
padding: 145px 0 50px;
}
}
.description {
font-family: 'Nerislight', Arial, sans-serif;
font-size: 1.2em;
letter-spacing: -0.05em;
line-height: 1em;
color: #d2d2d2;
margin: 15px auto 20px;
display: block;
max-width: 60%;
}
.description b {
font-family: 'nerissemibold', Arial, sans-serif;
}
@media screen and (min-width: 765px) {
.description {
font-size: 2.2em;
line-height: 1.2em;
margin: 0 auto 20px;
text-shadow: 1px 2px 0 #000000;
}
}
@media screen and (min-width: 992px) {
.description {
font-size: 3.125em;
margin: 5px auto 30px;
max-width: 60%;
}
}
@media screen and (min-width: 1200px) {
.description {
font-size: 3.125em;
margin: 20px auto 45px;
}
}
.who-wrapper {
text-align: center;
}
.who {
font-family: 'Lato';
font-size: 2em;
color: #ff9833;
margin: 15px auto 10px;
display: block;
}
@media screen and (max-width: 360px) {
.who {
margin: 30px auto;
}
}
@media screen and (min-width: 765px) {
.who {
font-size: 3em;
line-height: 1.5em;
margin: 15px auto 10px;
word-spacing: 0.2em;
}
}
@media screen and (min-width: 1200px) {
.who {
font-size: 3.5em;
margin: 40px auto 50px;
}
}
.dev-header .big-btn {
border: 3px solid #ffffff;
padding: 10px;
display: inline-block;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
font-size: 1.5em;
font-family: 'Nerisblack';
color: #ffffff;
max-width: 90%;
margin: 0 auto;
}
@media screen and (max-width: 360px) {
.dev-header .big-btn {
display: block;
margin-bottom: 5px;
border: 1px solid #ffffff;
font-size: 1.3em;
padding: auto;
}
}
.dev-header .big-btn:hover {
text-decoration: none;
}
.dev-header .big-btn:hover {
color: #ff9833;
}
@media screen and (max-width: 360px) {
.dev-header .big-btn {
margin-top: 15px;
}
}
@media screen and (min-width: 765px) {
.dev-header .big-btn {
font-size: 2.5em;
padding: 0 30px 10px;
}
}
.video {
margin: 10px auto;
padding: 0 10px;
}
@media screen and (min-width: 765px) {
.video {
max-width: 853px;
margin-bottom: 50px;
}
}
.red {
margin-top: 20px;
padding: 30px 0;
background: #fd7070 url(/assets/img/red-bg.jpg);
background-position: left top;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
/*
.icon1,
.icon2,
.icon3,
.icon4,
.icon5{
-webkit-background-size: 60%;
-moz-background-size: 60%;
background-size: 60%;
max-width: 100px;
}
*/
}
@media screen and (min-width: 765px) {
.red {
padding: 110px 0 80px;
}
}
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
.red ul li {
margin: 0 15px 0 0;
}
}
.orange {
padding: 30px 0;
background: #ff9833 url(/assets/img/orange-bg.jpg);
background-position: left top;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
@media screen and (min-width: 765px) {
.orange {
padding: 110px 0 80px;
}
}
.green {
margin-bottom: 20px;
padding: 30px 0;
background: #fd7070 url(/assets/img/green-bg.jpg);
background-position: left top;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
@media screen and (min-width: 765px) {
.green {
padding: 110px 0 80px;
}
}
@media screen and (min-width: 765px) {
.red-bg {
background-image: url('/assets/img/icons/stack1.png');
background-position: left top auto;
background-repeat: no-repeat;
background-position: right 110px;
}
}
@media screen and (min-width: 765px) and all and (-webkit-min-device-pixel-ratio: 1.3) {
.red-bg {
background-image: url('/assets/img/icons/stack1@2x.png');
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
}
@media screen and (min-width: 765px) {
.orange-bg {
background-image: url('/assets/img/icons/stack2.png');
background-position: right top auto;
background-repeat: no-repeat;
background-position: left 110px;
}
}
@media screen and (min-width: 765px) and all and (-webkit-min-device-pixel-ratio: 1.3) {
.orange-bg {
background-image: url('/assets/img/icons/stack2@2x.png');
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
}
@media screen and (min-width: 765px) {
.green-bg {
background-image: url('/assets/img/icons/stack3.png');
background-position: left top auto;
background-repeat: no-repeat;
background-position: right 110px;
}
}
@media screen and (min-width: 765px) and all and (-webkit-min-device-pixel-ratio: 1.3) {
.green-bg {
background-image: url('/assets/img/icons/stack3@2x.png');
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
}
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
.orange-bg,
.red-bg,
.green-bg {
-moz-background-size: 40%;
background-size: 40%;
}
}
.highlights {
position: relative;
text-align: center;
}
@media screen and (min-width: 765px) {
.highlights {
text-align: left;
}
}
.highlights h2 {
color: #ffffff;
font-size: 2.4em;
font-family: 'Nerissemibold';
margin-bottom: 17px;
}
@media screen and (min-width: 765px) {
.highlights h2 {
font-size: (35px * 16) + 0px;
font-size: 35px + 0rem;
margin-bottom: 35px;
}
}
@media screen and (min-width: 992px) {
.highlights h2 {
font-size: (107px * 16) + 0px;
font-size: 107px + 0rem;
}
}
.highlights p {
margin-bottom: 20px;
}
@media screen and (min-width: 765px) {
.highlights p {
font-size: (25px * 16) + 0px;
font-size: 25px + 0rem;
}
}
.highlights p b {
font-family: 'Nerissemibold';
}
.highlights ul {
display: block;
}
@media screen and (min-width: 765px) {
.highlights ul {
margin: 40px 0;
}
}
.highlights ul li {
display: -moz-inline-stack;
display: inline-block;
vertical-align: left;
*vertical-align: auto;
zoom: 1;
*display: inline;
list-style: none;
margin: 0 10px 0 0;
padding: 0;
}
@media screen and (min-width: 992px) {
.highlights ul li {
margin: 0 25px 0 0;
}
}
.highlights ul a {
display: block;
text-indent: -99999px;
}
.highlights .big-btn {
color: #ffffff;
}
.highlights .big-btn:hover {
color: #d2d2d2;
}
@media screen and (min-width: 765px) {
.highlights .big-btn {
margin-bottom: 90px;
}
}
.icon1 {
background-image: url('/assets/img/icons/angular.png');
background-repeat: no-repeat;
display: block;
height: 82px;
width: 171px;
}
@media all and (-webkit-min-device-pixel-ratio: 1.3) {
.icon1 {
background-image: url('/assets/img/icons/angular@2x.png');
background-size: 171px 82px;
width: 171px;
height: 82px;
}
}
.icon2 {
background-image: url('/assets/img/icons/npm.png');
background-repeat: no-repeat;
display: block;
height: 82px;
width: 125px;
}
@media all and (-webkit-min-device-pixel-ratio: 1.3) {
.icon2 {
background-image: url('/assets/img/icons/npm@2x.png');
background-size: 125px 82px;
width: 125px;
height: 82px;
}
}
.icon3 {
background-image: url('/assets/img/icons/grunt.png');
background-repeat: no-repeat;
display: block;
height: 82px;
width: 59px;
}
@media all and (-webkit-min-device-pixel-ratio: 1.3) {
.icon3 {
background-image: url('/assets/img/icons/grunt@2x.png');
background-size: 59px 82px;
width: 59px;
height: 82px;
}
}
.icon4 {
background-image: url('/assets/img/icons/bower.png');
background-repeat: no-repeat;
display: block;
height: 82px;
width: 69px;
}
@media all and (-webkit-min-device-pixel-ratio: 1.3) {
.icon4 {
background-image: url('/assets/img/icons/bower@2x.png');
background-size: 69px 82px;
width: 69px;
height: 82px;
}
}
.icon5 {
background-image: url('/assets/img/icons/requres.png');
background-repeat: no-repeat;
display: block;
height: 82px;
width: 69px;
}
@media all and (-webkit-min-device-pixel-ratio: 1.3) {
.icon5 {
background-image: url('/assets/img/icons/requres@2x.png');
background-size: 69px 82px;
width: 69px;
height: 82px;
}
}
.icon6 {
background-image: url('/assets/img/icons/angularwhite.png');
background-repeat: no-repeat;
display: block;
height: 106px;
width: 81px;
}
@media all and (-webkit-min-device-pixel-ratio: 1.3) {
.icon6 {
background-image: url('/assets/img/icons/angularwhite@2x.png');
background-size: 81px 106px;
width: 81px;
height: 106px;
}
}
.icon7 {
background-image: url('/assets/img/icons/cli.png');
background-repeat: no-repeat;
display: block;
height: 107px;
width: 69px;
}
@media all and (-webkit-min-device-pixel-ratio: 1.3) {
.icon7 {
background-image: url('/assets/img/icons/cli@2x.png');
background-size: 69px 107px;
width: 69px;
height: 107px;
}
}
.icon8 {
background-image: url('/assets/img/icons/controller.png');
background-repeat: no-repeat;
display: block;
height: 107px;
width: 93px;
}
@media all and (-webkit-min-device-pixel-ratio: 1.3) {
.icon8 {
background-image: url('/assets/img/icons/controller@2x.png');
background-size: 93px 107px;
width: 93px;
height: 107px;
}
}
.icon9 {
background-image: url('/assets/img/icons/node.png');
background-repeat: no-repeat;
display: block;
height: 61px;
width: 193px;
}
@media all and (-webkit-min-device-pixel-ratio: 1.3) {
.icon9 {
background-image: url('/assets/img/icons/node@2x.png');
background-size: 193px 61px;
width: 193px;
height: 61px;
}
}
.footer {
text-align: center;
}
.footer a {
color: #ff9833;
}
/*# sourceMappingURL=main_developer.css.map */ | {
"content_hash": "0333abb10755ce22d4546b8aabc97dfa",
"timestamp": "",
"source": "github",
"line_count": 713,
"max_line_length": 335,
"avg_line_length": 23.12201963534362,
"alnum_prop": 0.6614096809414048,
"repo_name": "CleverStack/cleverstack.io",
"id": "fa767b8a25616a79723adf608d92f9d6ba15dc48",
"size": "16486",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/dist/css/main_developer.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "219204"
},
{
"name": "HTML",
"bytes": "1678"
},
{
"name": "JavaScript",
"bytes": "134715"
},
{
"name": "Python",
"bytes": "3517"
}
],
"symlink_target": ""
} |
:tocdepth: 2
===============
Placement API
===============
This is a reference for the OpenStack Placement API. To learn more about
OpenStack Placement API concepts, please refer to the :nova-doc:`Placement
Introduction <user/placement.html>`.
The Placement API uses JSON for data exchange. As such, the ``Content-Type``
header for APIs sending data payloads in the request body (i.e. ``PUT`` and
``POST``) must be set to ``application/json`` unless otherwise noted.
.. rest_expand_all::
.. include:: request-ids.inc
.. include:: root.inc
.. include:: resource_providers.inc
.. include:: resource_provider.inc
.. include:: resource_classes.inc
.. include:: resource_class.inc
.. include:: inventories.inc
.. include:: inventory.inc
.. include:: aggregates.inc
.. include:: traits.inc
.. include:: resource_provider_traits.inc
.. include:: allocations.inc
.. include:: resource_provider_allocations.inc
.. include:: usages.inc
.. include:: resource_provider_usages.inc
.. include:: allocation_candidates.inc
.. include:: reshaper.inc
| {
"content_hash": "e8ca737aab0a8850e8f5426ed20b8a78",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 77,
"avg_line_length": 31.515151515151516,
"alnum_prop": 0.7153846153846154,
"repo_name": "gooddata/openstack-nova",
"id": "c72c796210dec23ba430d99492a342aeed728bea",
"size": "1040",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "placement-api-ref/source/index.rst",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "3858"
},
{
"name": "HTML",
"bytes": "1386"
},
{
"name": "PHP",
"bytes": "43584"
},
{
"name": "Python",
"bytes": "23012372"
},
{
"name": "Shell",
"bytes": "32567"
},
{
"name": "Smarty",
"bytes": "429290"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Sat Mar 18 18:54:07 PDT 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.apache.guacamole.xml (guacamole-ext 0.9.12-incubating API)</title>
<meta name="date" content="2017-03-18">
<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="org.apache.guacamole.xml (guacamole-ext 0.9.12-incubating 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 class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/guacamole/token/package-summary.html">Prev Package</a></li>
<li>Next Package</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/guacamole/xml/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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 title="Package" class="title">Package org.apache.guacamole.xml</h1>
<div class="docSummary">
<div class="block">Classes driving the SAX-based XML parser used by the Guacamole web
application.</div>
</div>
<p>See: <a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/guacamole/xml/TagHandler.html" title="interface in org.apache.guacamole.xml">TagHandler</a></td>
<td class="colLast">
<div class="block">A simple element-level event handler for events triggered by the
SAX-driven DocumentHandler parser.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/guacamole/xml/DocumentHandler.html" title="class in org.apache.guacamole.xml">DocumentHandler</a></td>
<td class="colLast">
<div class="block">A simple ContentHandler implementation which digests SAX document events and
produces simpler tag-level events, maintaining its own stack for the
convenience of the tag handlers.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!-- -->
</a>
<h2 title="Package org.apache.guacamole.xml Description">Package org.apache.guacamole.xml Description</h2>
<div class="block">Classes driving the SAX-based XML parser used by the Guacamole web
application.</div>
</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 class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/guacamole/token/package-summary.html">Prev Package</a></li>
<li>Next Package</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/guacamole/xml/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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 © 2017. All rights reserved.</small></p>
<!-- Google Analytics -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-75289145-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
| {
"content_hash": "2eef4b2723a5ae4aa7beba2da46c3e8c",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 155,
"avg_line_length": 36.74331550802139,
"alnum_prop": 0.641245815747344,
"repo_name": "mike-jumper/incubator-guacamole-website",
"id": "2f6343552ba828e242964871a148fa5bc6c5d2cf",
"size": "6871",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "doc/0.9.12-incubating/guacamole-ext/org/apache/guacamole/xml/package-summary.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "12886"
},
{
"name": "HTML",
"bytes": "37702"
},
{
"name": "JavaScript",
"bytes": "439018"
},
{
"name": "Perl",
"bytes": "2217"
},
{
"name": "Ruby",
"bytes": "660"
},
{
"name": "Shell",
"bytes": "4849"
}
],
"symlink_target": ""
} |
require 'minitest/autorun'
require_relative 'dequeue'
class DequeTest < MiniTest::Unit::TestCase
def test_push_pop
deque = Deque.new
deque.push(10)
deque.push(20)
assert_equal 20, deque.pop()
assert_equal 10, deque.pop()
end
def test_push_shift
deque = Deque.new
deque.push(10)
deque.push(20)
assert_equal 10, deque.shift()
assert_equal 20, deque.shift()
end
def test_unshift_shift
deque = Deque.new
deque.unshift(10)
deque.unshift(20)
assert_equal 20, deque.shift()
assert_equal 10, deque.shift()
end
def test_unshift_pop
deque = Deque.new
deque.unshift(10)
deque.unshift(20)
assert_equal 10, deque.pop
assert_equal 20, deque.pop()
end
def test_example
deque = Deque.new
deque.push(10)
deque.push(20)
assert_equal 20, deque.pop()
deque.push(30)
assert_equal 10, deque.shift()
deque.unshift(40)
deque.push(50)
assert_equal 40, deque.shift()
assert_equal 50, deque.pop()
assert_equal 30, deque.shift()
end
end
| {
"content_hash": "f6600e19543d8a6b3d6f544ef345f78f",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 42,
"avg_line_length": 20.384615384615383,
"alnum_prop": 0.6471698113207547,
"repo_name": "aarti/data-structures-ruby",
"id": "ab148aca467eb602bf4829895c591b29629d43f2",
"size": "1060",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "code/deque/deque_test.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "99712"
},
{
"name": "JavaScript",
"bytes": "80926"
},
{
"name": "Ruby",
"bytes": "29395"
}
],
"symlink_target": ""
} |
validateIt
==========
Validation Library for IOS apps
## Options
Validation for: <br/>
<b>email address,</b><br/>
<b>required text field,</b><br/>
<b>minimum length,</b><br/>
<b>maximum length,</b><br/>
<b>letters and space only.</b>
## Examples
```objc
//====== Initialize The Validation Library
validation *validate=[[validation alloc] init];
//====== Pass In the textField and desired textFieldName for each validation method
[validate Email:self.email FieldName:@"Email Address"];
[validate Required:self.email FieldName:@"Email Address"];
[validate Required:self.password FieldName:@"Password"];
[validate MaxLength:12 textField:self.password FieldName:@"User Password"];
[validate isValid];
```
## Usage
Check out the xCode sample project for this validation plugin.
## Contact
Email : arpiderm@gmail.com
| {
"content_hash": "a0498c6acea8ef5935c7f17be0d09f33",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 83,
"avg_line_length": 24.82857142857143,
"alnum_prop": 0.6777905638665133,
"repo_name": "arpi6/validateIt",
"id": "f70c8b6cda96ac0c939eba08bec26f9a6a7595ae",
"size": "869",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "23610"
}
],
"symlink_target": ""
} |
<?php
namespace Sydes\L10n\Locales;
use Sydes\L10n\Locale;
use Sydes\L10n\Plural\Rule2;
class WaLocale extends Locale
{
use Rule2;
protected $isoCode = 'wa';
protected $englishName = 'Walloon';
protected $nativeName = 'Walon';
protected $isRtl = false;
}
| {
"content_hash": "c4ad013a961c6f009ab30027db6d6fc6",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 39,
"avg_line_length": 17.4375,
"alnum_prop": 0.6845878136200717,
"repo_name": "sydes/framework",
"id": "f80530bd9e0f4ca61d70b0b0accdaaedf8e833fd",
"size": "279",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/L10n/Locales/WaLocale.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "631405"
}
],
"symlink_target": ""
} |
from collections import namedtuple, defaultdict
import operator
import idaapi
import idc
from . import exceptions
from .code import lines
FF_TYPES = [idc.FF_BYTE, idc.FF_WORD, idc.FF_DWRD, idc.FF_QWRD, idc.FF_OWRD, ]
FF_SIZES = [1, 2, 4, 8, 16, ]
SIZE_TO_TYPE = dict(zip(FF_SIZES, FF_TYPES))
STRUCT_ERROR_MAP = {
idc.STRUC_ERROR_MEMBER_NAME:
(exceptions.SarkErrorStructMemberName, "already has member with this name (bad name)"),
idc.STRUC_ERROR_MEMBER_OFFSET:
(exceptions.SarkErrorStructMemberOffset, "already has member at this offset"),
idc.STRUC_ERROR_MEMBER_SIZE:
(exceptions.SarkErrorStructMemberSize, "bad number of bytes or bad sizeof(type)"),
idc.STRUC_ERROR_MEMBER_TINFO:
(exceptions.SarkErrorStructMemberTinfo, "bad typeid parameter"),
idc.STRUC_ERROR_MEMBER_STRUCT:
(exceptions.SarkErrorStructMemberStruct, "bad struct id (the 1st argument)"),
idc.STRUC_ERROR_MEMBER_UNIVAR:
(exceptions.SarkErrorStructMemberUnivar, "unions can't have variable sized members"),
idc.STRUC_ERROR_MEMBER_VARLAST:
(exceptions.SarkErrorStructMemberVarlast, "variable sized member should be the last member in the structure"),
}
def struct_member_error(err, sid, name, offset, size):
"""Create and format a struct member exception.
Args:
err: The error value returned from struct member creation
sid: The struct id
name: The member name
offset: Memeber offset
size: Member size
Returns:
A ``SarkErrorAddStructMemeberFailed`` derivative exception, with an
informative message.
"""
exception, msg = STRUCT_ERROR_MAP[err]
struct_name = idc.GetStrucName(sid)
return exception(('AddStructMember(struct="{}", member="{}", offset={}, size={}) '
'failed: {}').format(
struct_name,
name,
offset,
size,
msg
))
def create_struct(name):
"""Create a structure.
Args:
name: The structure's name
Returns:
The sturct ID
Raises:
exceptions.SarkStructAlreadyExists: A struct with the same name already exists
exceptions.SarkCreationFailed: Struct creation failed
"""
sid = idc.GetStrucIdByName(name)
if sid != idaapi.BADADDR:
# The struct already exists.
raise exceptions.SarkStructAlreadyExists("A struct names {!r} already exists.".format(name))
sid = idc.AddStrucEx(-1, name, 0)
if sid == idaapi.BADADDR:
raise exceptions.SarkStructCreationFailed("Struct creation failed.")
return sid
def get_struct(name):
"""Get a struct by it's name.
Args:
name: The name of the struct
Returns:
The struct's id
Raises:
exceptions.SarkStructNotFound: is the struct does not exist.
"""
sid = idc.GetStrucIdByName(name)
if sid == idaapi.BADADDR:
raise exceptions.SarkStructNotFound()
return sid
def size_to_flags(size):
return SIZE_TO_TYPE[size] | idc.FF_DATA
def add_struct_member(sid, name, offset, size):
failure = idc.AddStrucMember(sid, name, offset, size_to_flags(size), -1, size)
if failure:
raise struct_member_error(failure, sid, name, offset, size)
StructOffset = namedtuple("StructOffset", "offset size")
OperandRef = namedtuple("OperandRef", "ea n")
def infer_struct_offsets(start, end, reg_name):
offsets = set()
operands = []
for line in lines(start, end):
for operand in line.insn.operands:
if not operand.has_reg(reg_name):
continue
if not operand.type.has_phrase:
continue
if not operand.base:
continue
offset = operand.offset
if offset < 0:
raise exceptions.InvalidStructOffset(
"Invalid structure offset 0x{:08X}, probably negative number.".format(offset))
size = operand.size
offsets.add(StructOffset(offset, size))
operands.append(OperandRef(line.ea, operand.n))
return offsets, operands
def get_common_register(start, end):
"""Get the register most commonly used in accessing structs.
Access to is considered for every opcode that accesses memory
in an offset from a register::
mov eax, [ebx + 5]
For every access, the struct-referencing registers, in this case
`ebx`, are counted. The most used one is returned.
Args:
start: The adderss to start at
end: The address to finish at
"""
registers = defaultdict(int)
for line in lines(start, end):
insn = line.insn
for operand in insn.operands:
if not operand.type.has_phrase:
continue
if not operand.base:
continue
register_name = operand.base
registers[register_name] += 1
return max(registers.iteritems(), key=operator.itemgetter(1))[0]
def offset_name(offset):
"""Format an offset into a name."""
return "offset_{:X}".format(offset.offset)
def set_struct_offsets(offsets, sid):
for offset in offsets:
try:
add_struct_member(sid,
offset_name(offset),
offset.offset,
offset.size)
except exceptions.SarkErrorStructMemberName:
# Get the offset of the member with the same name
existing_offset = idc.GetMemberOffset(sid, offset_name(offset))
if offset.offset == existing_offset:
pass
else:
raise
except exceptions.SarkErrorStructMemberOffset:
# Get the size of the member at the same offset
if offset.size == idc.GetMemberSize(sid, offset.offset):
# If they are the same, all is well.
pass
def create_struct_from_offsets(name, offsets):
sid = create_struct(name)
set_struct_offsets(offsets, sid)
def apply_struct(start, end, reg_name, struct_name):
offsets, operands = infer_struct_offsets(start, end, reg_name)
sid = get_struct(struct_name)
for ea, n in operands:
idc.OpStroff(ea, n, sid)
def selection_has_offsets(start, end):
for line in lines(start, end):
for operand in line.insn.operands:
if not operand.type.has_phrase:
continue
if not operand.base:
continue
return True
return False
| {
"content_hash": "abcfbe19d9e9540c3264e761efaf769a",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 118,
"avg_line_length": 29.06222222222222,
"alnum_prop": 0.6244074017433858,
"repo_name": "chubbymaggie/Sark",
"id": "51545575669f6c29297b7caae5d478ecc1d3014f",
"size": "6539",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sark/structure.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "154814"
}
],
"symlink_target": ""
} |
<?php
class Frapi_Database_Exception extends Frapi_Exception {
}
/**
* Database
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://getfrapi.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@getfrapi.com so we can send you a copy immediately.
*
* This context is the one that is going to be executing
* the database interactions through the web service.
*
* @uses Frapi_Database_Exception
* @license New BSD
* @package frapi
*/
class Frapi_Database extends PDO {
/**
* Just the instance of the PDO connection.
*
* @var PDO object
*/
private static $instance = array();
/**
* Singleton for database connections
*
* This method is going to verify if there's an existing instance
* of a database object and if so will return it.
*
* @param string $name The name of the instantiation (namespace emulation)
* This parameter is optional and is defaulted to 'default'
*
* @return PDO A new PDO object or an existing PDO object
*/
protected static function factory($name = 'default') {
if (!isset(self::$instance[$name])) {
$configs = Frapi_Internal::getCachedDbConfig();
$dsn = self::buildDsn($configs);
// I iz not happy with this. We already have a switch
// for the dsn in the "buildDsn" method...
if (isset($configs['db_engine']) &&
in_array($configs['db_engine'], array('pgsql'))) {
// DSN that have the user/pass implicitely defined.
self::$instance[$name] = new PDO($dsn);
} else {
// Other dsns like mysql, mssql, etc.
self::$instance[$name] = new PDO(
$dsn, $configs['db_username'], $configs['db_password'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'utf8\'')
);
}
}
return self::$instance[$name];
}
public static function buildDsnManual($db_engine, $db_database, $db_hostname, $db_username, $db_password) {
$dsn = false;
switch ($db_engine) {
case 'mysql':
$dsn = 'mysql:dbname=' . $db_database .
';host=' . $db_hostname;
break;
case 'pgsql':
$dsn = 'pgsql:host=' . $db_hostname .
';dbname=' . $db_database .
';user=' . $db_username .
';password=' . $db_password;
break;
case 'mssql':
$dsn = 'sqlsrv:Server=' . $db_hostname .
';Database=' . $db_database;
break;
}
return $dsn;
}
protected static function manual($db_engine, $db_database, $db_hostname, $db_username, $db_password) {
$name = 'manual';
if (!isset(self::$instance[$name])) {
$dsn = self::buildDsnManual($db_engine, $db_database, $db_hostname, $db_username, $db_password);
if (isset($db_engine) &&
in_array($db_engine, array('pgsql'))) {
// DSN that have the user/pass implicitely defined.
self::$instance[$name] = new PDO($dsn);
} else {
// Other dsns like mysql, mssql, etc.
self::$instance[$name] = new PDO(
$dsn, $db_username, $db_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'utf8\'')
);
}
}
return self::$instance[$name];
}
/**
* Build a DataSource Name.
*
* This method is used by the factory method to build
* a datasource name for PDO based on the db_engine
* specified in the configuration (configurable via the admin)
*
* @throw Frapi_Error
* @return string The Datasource for the selected database engine.
*/
public static function buildDsn(array $configs) {
$dsn = false;
if (!isset($configs['db_engine'])) {
throw new Frapi_Error(
'NO_DATABASE_DEFINED', 'No Database is defined in the configuration', 500, 'Internal Server Error'
);
}
switch ($configs['db_engine']) {
case 'mysql':
$dsn = 'mysql:dbname=' . $configs['db_database'] .
';host=' . $configs['db_hostname'];
break;
case 'pgsql':
$dsn = 'pgsql:host=' . $configs['db_hostname'] .
';dbname=' . $configs['db_database'] .
';user=' . $configs['db_username'] .
';password=' . $configs['db_password'];
break;
case 'mssql':
$dsn = 'sqlsrv:Server=' . $configs['db_hostname'] .
';Database=' . $configs['db_database'];
break;
}
return $dsn;
}
/**
* Get a database instance
*
* This method is used to retrieve a database instance. For the sake
* of simplicity we are using PDO by default. Thus returning a PDO
* object (or whichever of it's kind)
*
* @param string $name The name of the instantiation (namespace emulation)
* This parameter is optional and is defaulted to 'default'
*
* @return mixed PDO* An object of type PDO
*/
public static function getInstance($name = 'default') {
return self::factory($name);
}
public static function getInstanceManual($db_engine, $db_database, $db_hostname, $db_username, $db_password) {
return self::manual($db_engine, $db_database, $db_hostname, $db_username, $db_password);
}
public static function getGLOBAL_ID() {
return self::manual("mysql", "registro_id", "minisitiosdb.c4cbjqvfkgm3.us-west-2.rds.amazonaws.com", "reg22", "admyver22");
}
public static function getMasterInstance() {
throw new Frapi_Database_Exception('Method not yet implemented');
}
public static function getSlavesInstance() {
throw new Frapi_Database_Exception('Method not yet implemented');
}
}
| {
"content_hash": "b4abaa732f7c712b876f1f85a60ea490",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 139,
"avg_line_length": 35.44808743169399,
"alnum_prop": 0.543240326807461,
"repo_name": "winlolo/frapi",
"id": "3b960ce5b62549adc58f76c5c6b96ff2cf04cc6c",
"size": "6487",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/frapi/library/Frapi/Database.php",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "17176"
},
{
"name": "CSS",
"bytes": "55601"
},
{
"name": "HTML",
"bytes": "71344"
},
{
"name": "JavaScript",
"bytes": "48653"
},
{
"name": "PHP",
"bytes": "14863507"
},
{
"name": "Shell",
"bytes": "802"
},
{
"name": "Smarty",
"bytes": "17249"
}
],
"symlink_target": ""
} |
<?php
namespace Sun\Filesystem;
use Exception;
class FileNotFoundException extends Exception
{
}
| {
"content_hash": "9764e63fd53bd06e1eea20b1414d6ea7",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 45,
"avg_line_length": 11.1,
"alnum_prop": 0.7117117117117117,
"repo_name": "IftekherSunny/Planet-Framework",
"id": "dd02313da6b05219d7eb3490bd276548ce1177eb",
"size": "111",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Sun/Filesystem/FileNotFoundException.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "189759"
}
],
"symlink_target": ""
} |
from setuptools import setup, find_packages
setup(
name='PyspotifyCtypesProxy',
version='0.4',
description='An embedded proxy server intended for players that cannot integrate libspotify easily.',
author='Mikel Azkolain',
author_email='azkotoki@gmail.com',
url='http://forge.azkotoki.org/pyspotify-ctypes',
package_dir = {'': 'src'},
packages=find_packages('src'),
include_package_data=True,
)
| {
"content_hash": "b6e766ef05d4ffc522f603cff2206fdb",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 105,
"avg_line_length": 31.857142857142858,
"alnum_prop": 0.6771300448430493,
"repo_name": "mazkolain/pyspotify-ctypes-proxy",
"id": "35cd5dd120261aa41878e8ae7b0b7486cf69795b",
"size": "469",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "setup.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "45207"
}
],
"symlink_target": ""
} |
from setuptools import setup, find_packages
from ORCSchlange import __version__
import os.path
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="ORCSchlange",
version=__version__,
packages=find_packages(),
package_data={"ORCSchlange.command": "*.js"},
zip_safe=False,
install_requires=['pybtex>=0.21', 'requests>=2.18.1'],
author="Fabian Gaertner",
author_email="fabian@bioinf.uni-leipzig.de",
url="https://github.com/ScaDS/ORC-Schlange",
description="Create a nice static publishing websites from ORCIDs.",
license="Apache 2.0",
long_description=read('docs/README.rst'),
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6"
],
entry_points={
'console_scripts': [
'orcs = ORCSchlange.__main__:main'
]
},
command_options={
'build_sphinx': {
'version': ('setup.py', __version__),
'release': ('setup.py', __version__)
}
},
keywords="ORCID Website Bibliography Publication ScaDS"
)
| {
"content_hash": "ce4a0aa57a2b1cef8450b7d0cbde5e26",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 72,
"avg_line_length": 30.818181818181817,
"alnum_prop": 0.6010324483775811,
"repo_name": "ScaDS/ORC-Schlange",
"id": "d68ce462ebbdd7a62c2c339a150b5db6e94afd79",
"size": "1356",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "setup.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "18383"
},
{
"name": "Python",
"bytes": "64140"
},
{
"name": "Shell",
"bytes": "118"
},
{
"name": "TeX",
"bytes": "4142"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2020 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
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud.tools.opensource</groupId>
<artifactId>return-type-mismatch</artifactId>
<version>1.0-SNAPSHOT</version>
<name>return-type-mismatch</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<!-- protobuf-java 3.12.4 references a Java 11 method that does not exist in Java 8
https://github.com/protocolbuffers/protobuf/issues/7827 -->
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.12.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<dependencies>
<dependency>
<groupId>com.google.cloud.tools</groupId>
<artifactId>linkage-checker-enforcer-rules</artifactId>
<version>@project.version@</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>enforce-linkage-checker</id>
<phase>verify</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<LinkageCheckerRule
implementation="com.google.cloud.tools.dependencies.enforcer.LinkageCheckerRule">
</LinkageCheckerRule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "89188d156b34c1abe36adbc45f53fde2",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 104,
"avg_line_length": 34.467532467532465,
"alnum_prop": 0.6386586284853052,
"repo_name": "GoogleCloudPlatform/cloud-opensource-java",
"id": "0d0948b72c57eb9e01d5e9c500a52e53beb5ddae",
"size": "2654",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "enforcer-rules/src/it/return-type-mismatch/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "337"
},
{
"name": "CSS",
"bytes": "1971"
},
{
"name": "FreeMarker",
"bytes": "22514"
},
{
"name": "Groovy",
"bytes": "25536"
},
{
"name": "Java",
"bytes": "221350"
},
{
"name": "JavaScript",
"bytes": "1043"
},
{
"name": "Shell",
"bytes": "12174"
}
],
"symlink_target": ""
} |
// ***************************************************************************
// * Copyright 2017 Joseph Molnar
// *
// * 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.talvish.tales.validation.constraints;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This annotation is used as a constraint on parameters and class members
* that are integers (e.g int, long, etc) to indicate the maximum value of the
* parameter or class member.
* Currently this supports int, long and BigDecimal.
* @author jmolnar
*/
@Retention( RetentionPolicy.RUNTIME)
@Target(value={ElementType.FIELD,ElementType.PARAMETER})
public @interface NotNull {
}
| {
"content_hash": "c31a7112c5f1d09aaa5900ffcd5145d3",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 79,
"avg_line_length": 43.06060606060606,
"alnum_prop": 0.6432090077410274,
"repo_name": "Talvish/Tales",
"id": "34388d7a4359e2a117ab8381b965211720341179",
"size": "1421",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "product/common/src/com/talvish/tales/validation/constraints/NotNull.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1651354"
}
],
"symlink_target": ""
} |
package org.qi4j.sample.dcicargo.sample_b.infrastructure.testing;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
/**
* ExpectedException.
* <p>
* Wrapper of {@link org.junit.rules.ExpectedException} in order to provide custom
* expected exception one-liners for convenience.
* </p>
* <p>
* If you're checking certain DomainSpecificException often, you could wrap it here too...
* </p>
* <p>
* See <a href="http://alexruiz.developerblogs.com/?p=1530">http://alexruiz.developerblogs.com/?p=1530</a>
* </p>
* <p>
* NOTE!
* </p>
* <p>
* 1. the check for the expected exception must be immediately above the code that is expected to throw such exception
* </p>
* <p>
* 2. the line of code that is expected to throw an exception should be the last line in the test method
* </p>
* <p>
* See <a href="http://java.dzone.com/articles/unexpected-behavior-junits">http://java.dzone.com/articles/unexpected-behavior-junits</a>
* </p>
* <p>
*/
public class ExpectedException implements TestRule
{
private final org.junit.rules.ExpectedException delegate = org.junit.rules.ExpectedException.none();
public static ExpectedException none()
{
return new ExpectedException();
}
private ExpectedException() {}
public Statement apply( Statement base, Description description )
{
return delegate.apply( base, description );
}
// This one saves a little typing :-)
public void expect( Class<? extends Throwable> type, String substringOfMessage )
{
expect( type );
expectMessage( substringOfMessage );
}
public void expectAssertionError( String message )
{
expect( AssertionError.class );
expectMessage( message );
}
public void expectNullPointerException( String message )
{
expect( NullPointerException.class );
expectMessage( message );
}
public void expect( Throwable error )
{
expect( error.getClass() );
expectMessage( error.getMessage() );
}
public void expect( Class<? extends Throwable> type )
{
delegate.expect( type );
}
public void expectMessage( String message )
{
delegate.expectMessage( message );
}
} | {
"content_hash": "2d55cccb19c8694628ad8d3ccbe4687d",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 136,
"avg_line_length": 27.058823529411764,
"alnum_prop": 0.6691304347826087,
"repo_name": "joobn72/qi4j-sdk",
"id": "568d7506a12d83a792350a5b39579439cc170283",
"size": "2910",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/testing/ExpectedException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "44634"
},
{
"name": "Groovy",
"bytes": "15077"
},
{
"name": "HTML",
"bytes": "73513"
},
{
"name": "Java",
"bytes": "6576434"
},
{
"name": "JavaScript",
"bytes": "17052"
},
{
"name": "Python",
"bytes": "4879"
},
{
"name": "Ruby",
"bytes": "81"
},
{
"name": "Scala",
"bytes": "2917"
},
{
"name": "Shell",
"bytes": "1785"
},
{
"name": "XSLT",
"bytes": "53394"
}
],
"symlink_target": ""
} |
killall.sh; netcfg
| {
"content_hash": "68886a33b2e22ff690a4878ddac73fa5",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 18,
"avg_line_length": 19,
"alnum_prop": 0.7894736842105263,
"repo_name": "Mirantis/octane",
"id": "4150cf132c9d21ad875eff5e2a0519524b215167",
"size": "19",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "deploy/net_reconfigure.sh",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "204473"
},
{
"name": "Shell",
"bytes": "33878"
}
],
"symlink_target": ""
} |
/***********/
/* General */
/***********/
html, body {
height: auto !important;
overflow-x: hidden !important;
overflow-y: auto !important;
margin: 0;
}
body::before {
content: none !important;
}
.column {
background: transparent !important;
}
/***********************/
/* Redesign scrollbars */
/***********************/
.scroll-styled-v::-webkit-scrollbar {
width: 7px !important;
}
.scroll-styled-v::-webkit-scrollbar-thumb {
border-radius: 0 !important;
}
.scroll-styled-v::-webkit-scrollbar-track {
border-left: 0 !important;
}
/********************/
/* Square-ify stuff */
/********************/
.media-item, .media-preview, .media-badge {
border-radius: 1px !important;
}
.quoted-tweet {
border-radius: 0 !important;
}
/***********************/
/* Tweaks for features */
/***********************/
a[data-full-url] {
word-break: break-all !important;
}
#tduck-show-thread {
display: inline-block !important;
cursor: pointer;
}
/*******************************************/
/* Fix general visual issues or annoyances */
/*******************************************/
html[data-td-font='smallest'] .sprite-verified-mini {
/* fix cut off badge in timelines */
width: 13px !important;
height: 13px !important;
background-position: -223px -99px !important;
}
html[data-td-font='smallest'] .badge-verified:before {
/* fix cut off badge in notifications */
width: 13px !important;
height: 13px !important;
background-position: -223px -98px !important;
}
html[data-td-font='smallest'] .fullname-badged:before, html[data-td-font='small'] .fullname-badged:before {
/* fix cut off badge in follow chirps */
margin-top: -7px !important;
}
.account-inline .username {
vertical-align: 10% !important;
}
.account-inline .position-rel + .username {
vertical-align: -10% !important;
}
/****************************************/
/* Tweak notification layout and design */
/****************************************/
.activity-header.has-source-avatar {
margin-bottom: 4px !important;
}
.activity-header .tweet-timestamp {
line-height: unset !important;
}
.activity-header .icon-user-filled {
vertical-align: sub !important;
margin-right: 4px !important;
}
.td-notification-padded .item-img {
position: absolute;
left: 21px;
top: 48px;
width: 0 !important;
}
.td-notification-padded .activity-header > .nbfc {
margin-left: 46px;
line-height: unset !important;
}
.td-notification-padded .activity-header > .nbfc > .avatar {
position: absolute;
margin-left: -34px;
}
.td-notification-padded-alt .item-img {
/* td-notification-padded-alt is used alongside td-notification-padded to save space in the file */
position: relative;
left: 10px;
top: 2px;
width: 0 !important;
}
.td-notification-padded-alt .activity-header > .nbfc > .avatar {
padding-top: 1px;
}
/*********/
/* Media */
/*********/
.td-notification .media-size-medium {
max-height: 240px;
height: calc(100vh - 20px) !important;
border-radius: 1px !important;
}
.td-notification .js-quote-detail .media-size-medium {
height: calc(100vh - 28px) !important;
}
#tduck .js-media, #tduck .js-media-preview-container {
padding-top: 1px;
margin-bottom: 2px !important;
}
#tduck .js-quote-detail .js-media, #tduck .js-quote-detail .js-media-preview-container {
margin-bottom: 0 !important;
}
/***************/
/* Skip button */
/***************/
#td-skip {
position: fixed;
left: 29px;
bottom: 10px;
z-index: 1000;
cursor: pointer;
opacity: 0;
transition: opacity 0.15s ease;
}
.td-example #td-skip {
display: none;
}
.td-hover #td-skip {
opacity: 0.75;
}
#td-skip:hover {
opacity: 1;
}
| {
"content_hash": "88e29037d0d783994c604f26e2749de0",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 107,
"avg_line_length": 19.9027027027027,
"alnum_prop": 0.6075502444323737,
"repo_name": "chylex/TweetDuck",
"id": "e6a7a24caccbe0bc475539a4baa27dd51bbbde93",
"size": "3682",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "resources/Content/notification/notification.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "122"
},
{
"name": "C#",
"bytes": "568526"
},
{
"name": "CSS",
"bytes": "101678"
},
{
"name": "F#",
"bytes": "43385"
},
{
"name": "HTML",
"bytes": "46603"
},
{
"name": "Inno Setup",
"bytes": "17552"
},
{
"name": "JavaScript",
"bytes": "198552"
},
{
"name": "PowerShell",
"bytes": "1856"
},
{
"name": "Shell",
"bytes": "795"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="Usuario" table="usuario">
<indexes>
<index name="idEmpleado" columns="idEmpleado"/>
</indexes>
<unique-constraints>
<unique-constraint name="nombre" columns="nombre"/>
</unique-constraints>
<id name="idusuario" type="integer" column="idUsuario">
<generator strategy="IDENTITY"/>
</id>
<field name="nombre" type="string" column="nombre" length="20" nullable="false">
<options>
<option name="fixed"/>
</options>
</field>
<field name="role" type="string" column="role" length="45" nullable="false">
<options>
<option name="fixed"/>
</options>
</field>
<field name="email" type="string" column="email" length="45" nullable="false">
<options>
<option name="fixed"/>
</options>
</field>
<field name="password" type="string" column="password" length="255" nullable="false">
<options>
<option name="fixed"/>
</options>
</field>
<field name="caducidad" type="date" column="caducidad" nullable="true"/>
<many-to-one field="idempleado" target-entity="Empleado" fetch="LAZY">
<join-columns>
<join-column name="idEmpleado" referenced-column-name="id"/>
</join-columns>
</many-to-one>
</entity>
</doctrine-mapping>
| {
"content_hash": "394a9f61ccab762123b2dfac2cf36aa2",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 276,
"avg_line_length": 40.525,
"alnum_prop": 0.6397285626156693,
"repo_name": "omarmdalo/ControlLatino",
"id": "032edabeae5e776044128422a5a980846ca0f4b5",
"size": "1621",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/ModeloBundle/Resources/config/doctrine/orm/Usuario.orm.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3605"
},
{
"name": "CSS",
"bytes": "17172"
},
{
"name": "HTML",
"bytes": "495083"
},
{
"name": "JavaScript",
"bytes": "665048"
},
{
"name": "PHP",
"bytes": "311045"
}
],
"symlink_target": ""
} |
import CalendarAPI from './api/CalendarAPI';
import CalendarStore from './CalendarStore';
const api = new CalendarAPI();
const store = new CalendarStore();
import Configstore from 'configstore';
const conf = new Configstore('menu-calendar');
import EventEmitter from 'events';
const POLL_INTERVAL = 30000;
export default class extends EventEmitter {
setAuth(auth) {
api.setAuth(auth);
}
async sync() {
const { syncTokens, items } = await api.syncEvents(conf.get('syncTokens') || {});
conf.set('syncTokens', syncTokens);
await store.removeItems(items.remove);
await store.setItems(items.save);
}
async getEvents() {
const start = new Date();
start.setDate(start.getDate() - 30);
start.setHours(0);
start.setMinutes(0);
const end = new Date();
end.setDate(end.getDate() + 30);
console.log('Sync: #tick: Now pulling all from store');
const events = await store.getByDate(start.toISOString(), end.toISOString());
console.log('Sync: #tick: Update done, firing update:', events.length);
this.emit('update', events);
}
async tick() {
try {
console.log('Sync: #tick: Starting');
await this.sync();
console.log('Sync: #tick: Synced and updated store');
await this.getEvents();
} catch (e) {
console.error(e, e.stack);
}
this.timeout = setTimeout(this.tick.bind(this), POLL_INTERVAL);
}
async start() {
if (this.timeout) this.stop();
console.log('Sync: #start: Start');
await this.getEvents();
this.tick();
}
stop() {
clearTimeout(this.timeout);
}
}
| {
"content_hash": "682749d0e575879eb54812e20e1b4220",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 85,
"avg_line_length": 22.985714285714284,
"alnum_prop": 0.6426351771286514,
"repo_name": "bmathews/menubar-calendar",
"id": "4cab11d821d6ce45a9e122e85afbce710a67d018",
"size": "1609",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/SyncService.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9912"
},
{
"name": "HTML",
"bytes": "297"
},
{
"name": "JavaScript",
"bytes": "39893"
}
],
"symlink_target": ""
} |
package org.apache.tinkerpop.gremlin.object.traversal.library;
import org.apache.tinkerpop.gremlin.object.traversal.TraversalTest;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
/**
* Verify that {@link HasTest} traverses the has step with the provided arguments.
*
* @author Karthick Sankarachary (http://github.com/karthicks)
*/
public class HasTest extends TraversalTest<Element> {
@Test
public void testHasTraversal() {
Has has = Has.of("label", "key", "value");
traverse(has);
verify(traversal, times(1)).has("label", "key", "value");
assertEquals("label", has.label());
assertEquals("key", has.key());
assertEquals("value", has.value());
}
}
| {
"content_hash": "251da23544273769da8532800f99e06d",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 82,
"avg_line_length": 27.387096774193548,
"alnum_prop": 0.7243816254416962,
"repo_name": "karthicks/gremlin-ogm",
"id": "f66d1c5febd861345e46c801a0abb27ab37f47de",
"size": "1652",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gremlin-objects/src/test/java/org/apache/tinkerpop/gremlin/object/traversal/library/HasTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "331078"
},
{
"name": "Shell",
"bytes": "1400"
}
],
"symlink_target": ""
} |
"""
This example demonstrates user management.
To run this example, you must have a user with the user-manager role!
"""
from intern.remote.boss import BossRemote
rmt = BossRemote('example.cfg')
user = 'example_user'
# Create a user. Note that users are unique, so you may need to change
# the user name for this example to run.
print('Creating user . . .')
rmt.add_user(user, 'John', 'Doe', 'jd@example.com', 'secure_password')
print('\nGet the user just created . . .')
user_data = rmt.get_user(user)
print(user_data)
#############################################################################
# The user needs to login before group operations can be performed.
# This is due to the Single-Sign On workflow requires a manual log into update
# the application database
#############################################################################
print('\nMake the user a resource manager . . .')
rmt.add_user_role(user, 'resource-manager')
print('\nList the user\'s roles . . .')
print(rmt.get_user_roles(user))
print('\nRemove the resource manager role . . .')
rmt.delete_user_role(user, 'resource-manager')
print('\nList the user\'s roles again. . .')
print(rmt.get_user_roles(user))
print('\nClean up be deleting the user . . .')
rmt.delete_user(user)
| {
"content_hash": "08127405e8b8d1dae8249a1308675cc6",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 78,
"avg_line_length": 32.53846153846154,
"alnum_prop": 0.6256895193065406,
"repo_name": "jhuapl-boss/intern",
"id": "061ff9913e2e9627972b45c4ff1cdaeabaa224c4",
"size": "1885",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/boss/user_ex.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "602876"
}
],
"symlink_target": ""
} |
Title: Crumble aux pommes
Category: Recette
Tags: recette, dessert, gateau, moyen
Summary: Recette de mon crumble aux pommes, délicieux en hiver comme en été !
Recette de mon crumble aux pommes, délicieux en hiver comme en été !
- *Préparation* : 15 minutes.
- *Cuisson* : 25-30 minutes.
## Ingrédients
- 5 ou 6 pommes de bonne taille (golden, ou autres),
- 150 g de sucre roux (cassonade) ou blanc,
- [Cannelle](https://fr.wikipedia.org/wiki/Cannelle) en poudre, un peu,
- 300 g de farine blanche[ref]Je pensais qu'on pouvait faire une variante avec moitié farine blanche, moitié farine de sarrasin, mais en fait ça ne marche pas du tout ! Le sablé ne prend pas et ça ressemble à des miettes de galettes bretonnes pas assez cuites...[/ref],
- 100 g de beurre (salé),
- Optionnel : 25 g de pralin.
## Préparation
1. Éplucher les pommes, les couper en tranches ou en gros morceaux,
[{width=40%}]({static}images/crumble-aux-pommes-1.jpg)
2. Les faire réduire à feu fort 2 min avec une cuillerée à soupe d'eau puis maintenir la cuisson à feu doux pendant 7 à 8 min.
3. Écraser les derniers gros morceaux de pommes à la fourchette. Mélanger les pommes avec 125 g de sucre et 1/2 cuillère à café de cannelle. Verser ce mélange dans un plat à gratin beurré.
4. Écraser le beurre à la fourchette dans un saladier. Ajouter le reste du sucre et de le cannelle, ainsi que la farine, puis mélanger le tout avec les doigts afin d'obtenir un sable grossier. Rajouter de la farine si le mélange est trop liquide. Optionnel : ajouter le pralin à la fin,
5. Répartir sur la compote dans le plat,
6. Saupoudrer avec un peu de sucre roux,
7. Faire cuire maximum 30 minutes dans un four à 180°C / T6 <i class="fa fa-thermometer-full" aria-hidden="true"></i>, en vérifiant la cuisson à partir de 15 minutes (le dessus ne doit pas cramer !).
## Photo
- Le plat :
[{width=50%}]({static}images/crumble-aux-pommes-2.jpg)
- Une part :
[{width=50%}]({static}images/crumble-aux-pommes-3.jpg)
----
## Variantes
On peut varier un peu les fruits :
- en été on peut faire pommes et fruits rouges,
- en automne, faire 1/3 coings et 2/3 pommes (en laissant fondre les coings à la casserole), ou moitié pommes - moitié poires,
- en hiver, on peut rajouter des noix ou des chataîgnes !
Autres variantes :
- Je n'ai jamais essayé moi-même, mais pommes - bananes est un grand classique !
- On peut aussi faire un crumble pommes - bananes - chocolat ! Je rédigerai la recette [quand j'aurai essayé](https://github.com/Naereen/cuisine/issues/114) !
----
## Remarques
- :cutlery: Servir tiède avec une boule de glace vanille ! *Miam !*
- Il pleut être réchauffé rapidement au four à micro-ondes si besoin.
- Convient bien aux régimes sans viande et sans produit d'origine porcine, mais ne convient pas aux régimes sans lait (beurre !).
- Se conserve quelques jours, sous une cloche (ou au four), mais pas plus longtemps (il n'y a ni œufs ni lait, mais il y a du beurre !).
## Notes
| {
"content_hash": "f77c3eb91ddd0715489f49030afce948",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 286,
"avg_line_length": 55.54385964912281,
"alnum_prop": 0.7409981048641819,
"repo_name": "Naereen/cuisine",
"id": "37a9d789852ad254e02bee51606e260e5c6b6281",
"size": "3226",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "content/crumble-aux-pommes.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "108439"
},
{
"name": "HTML",
"bytes": "16416"
},
{
"name": "Makefile",
"bytes": "4071"
},
{
"name": "Python",
"bytes": "111371"
},
{
"name": "Shell",
"bytes": "2537"
}
],
"symlink_target": ""
} |
package consulo.javascript.ide.codeInsight;
import javax.annotation.Nonnull;
import com.intellij.lang.javascript.inspections.qucikFixes.CreateJSFunctionOrMethodFix;
import com.intellij.openapi.util.KeyedExtensionCollector;
import com.intellij.psi.PsiElement;
import consulo.javascript.lang.BaseJavaScriptLanguageVersion;
import consulo.lang.LanguageVersion;
/**
* @author VISTALL
* @since 23.02.2016
*/
public class JavaScriptQuickFixFactory
{
private static final JavaScriptQuickFixFactory ourDefaultImpl = new JavaScriptQuickFixFactory();
@Nonnull
public static JavaScriptQuickFixFactory byElement(PsiElement element)
{
LanguageVersion languageVersion = element.getLanguageVersion();
if(languageVersion instanceof BaseJavaScriptLanguageVersion)
{
JavaScriptQuickFixFactory quickFixFactory = EP.findSingle(languageVersion.getName());
if(quickFixFactory != null)
{
return quickFixFactory;
}
}
return ourDefaultImpl;
}
public static final KeyedExtensionCollector<JavaScriptQuickFixFactory, String> EP = new KeyedExtensionCollector<>("consulo.javascript.quickFixFactory");
public CreateJSFunctionOrMethodFix createFunctionOrMethodFix(String referenceName, boolean isMethod)
{
return new CreateJSFunctionOrMethodFix(referenceName, isMethod);
}
}
| {
"content_hash": "4dce7d819c971b9d820733e3f96e14cc",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 153,
"avg_line_length": 31.463414634146343,
"alnum_prop": 0.8201550387596899,
"repo_name": "consulo/consulo-javascript",
"id": "e2d8509dece69294a375e0c4c1b67bee40360cca",
"size": "1885",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "base-impl/src/main/java/consulo/javascript/ide/codeInsight/JavaScriptQuickFixFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "82933"
},
{
"name": "Java",
"bytes": "2939705"
},
{
"name": "JavaScript",
"bytes": "436"
},
{
"name": "Lex",
"bytes": "78754"
}
],
"symlink_target": ""
} |
<?php
namespace Likedo\Helpers\Test;
use Likedo\Helpers\ConvertValidateHelper;
class ConvertValidateHelperTest extends \PHPUnit_Framework_TestCase {
use \Likedo\Helpers\Test\DataProviders\ConvertValidateHelperDataProvider;
/**
* @param $expected
* @return bool
*/
protected function expectedIsAnException($expected)
{
if (is_array($expected)) {
return false;
}
return strpos($expected, 'Exception') !== false
|| strpos($expected, 'PHPUnit_Framework_') !== false
|| strpos($expected, 'TypeError') !== false;
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider isIntegerUnsignedNoFloatingValidateProvider
*/
public function isIntegerUnsignedNoFloatingTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isInteger($val);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isInteger($val, true));
}
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider isDoubleUnSigned2DecProvider
*/
public function isDoubleUnSigned2DecTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isDouble($val, 2, true);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isDouble($val, 2, true));
}
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider dateItaValidateProvider
*/
public function isDateItaTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isDateIta($val);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isDateIta($val));
}
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider dateIsoValidateProvider
*/
public function isDateIsoTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isDateIso($val);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isDateIso($val));
}
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider dateTimeIsoValidateProvider
*/
public function isDateTimeIsoTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isDateTimeIso($val);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isDateTimeIso($val));
}
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider dateTimeItaValidateProvider
*/
public function isDateTimeItaTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isDateTimeIta($val);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isDateTimeIta($val));
}
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider timeIsoValidateProvider
*/
public function isTimeIsoTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isTimeIso($val);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isTimeIso($val));
}
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider mailValidateProvider
*/
public function isMailTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isMail($val);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isMail($val));
}
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider mailMxValidateProvider
*/
public function isMailMxTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isMail($val, true);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isMail($val, true));
}
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider arrayValidateProvider
*/
public function isArrayTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isArray($val, false);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isArray($val, false));
}
}
/**
* @test
* @param $val
* @param $expected
* @dataProvider arrayEmptyValidateProvider
*/
public function isEmptyArrayTest($val, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isArray($val, true);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isArray($val, true));
}
}
/**
* @test
* @param $value
* @param $leftRange
* @param $rightRange
* @param $expected
* @dataProvider isInRangeProvider
*/
public function isInRangeTest($value, $leftRange, $rightRange, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isInRange($value, $leftRange, $rightRange);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isInRange($value, $leftRange, $rightRange));
}
}
/**
* @test
* @param $value
* @param $expected
* @dataProvider isStringNumberStartsWithMoreThanOneZeroValidateProvider
*/
public function isStringNumberStartsWithMoreThanOneZeroTest($value, $expected)
{
if ($this->expectedIsAnException($expected)) {
$this->expectException($expected);
ConvertValidateHelper::isStringNumberStartsWithMoreThanOneZero($value);
} else {
$this->assertEquals($expected, ConvertValidateHelper::isStringNumberStartsWithMoreThanOneZero($value));
}
}
}
| {
"content_hash": "c333e95759b6596c86481263554a916b",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 115,
"avg_line_length": 28.632911392405063,
"alnum_prop": 0.5901856763925729,
"repo_name": "likedo/helpers",
"id": "8ab35242659b73ad4d8eee34d852219b50b24f26",
"size": "6786",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/ConvertValidateHelperTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "53137"
}
],
"symlink_target": ""
} |
grails-falcone-util
===================
A copy of the Grails falcone util plugin. The original plugin can be found here: http://grails.org/plugin/falcone-util. | {
"content_hash": "86bf8808bd32944be03d2542a3b61069",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 119,
"avg_line_length": 40,
"alnum_prop": 0.69375,
"repo_name": "cfxram/grails-falcone-util",
"id": "15ca8db4fc1fbe819b5cbffc71a3aad17d9c3b55",
"size": "160",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Gosu",
"bytes": "1601"
},
{
"name": "Groovy",
"bytes": "10433"
},
{
"name": "Java",
"bytes": "317911"
},
{
"name": "JavaScript",
"bytes": "373"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Cenangium populinum f. populorum Sacc.
### Remarks
null | {
"content_hash": "ae9cbc6cd54d461a5c6878faaf2a4965",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 38,
"avg_line_length": 11,
"alnum_prop": 0.7132867132867133,
"repo_name": "mdoering/backbone",
"id": "7f90f858cd1c3bb6b0127de8ce47d26522ab1607",
"size": "202",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Helotiaceae/Cenangium/Cenangium populinum/Cenangium populinum populorum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using UnityEngine;
public class PlayerBehavior : MonoBehaviour
{
private Vector3 TargetPosition;
private Quaternion TargetRotaion;
private Vector3 velocity;
public int playerID;
public string playerName;
void Start()
{
TargetPosition = transform.position;
TargetRotaion = transform.localRotation;
}
void Update ()
{
transform.position = Vector3.SmoothDamp(transform.position, TargetPosition, ref velocity, 1f, 50);
Quaternion quaternion = Quaternion.Slerp(transform.localRotation, Quaternion.FromToRotation(transform.worldToLocalMatrix.MultiplyVector(transform.forward), velocity), Time.deltaTime);
transform.localRotation = Quaternion.AngleAxis(quaternion.eulerAngles.y, Vector3.up);
}
public void UpdateLocation(Vector3 position,float eulurAngle)
{
TargetPosition = position;
TargetRotaion = Quaternion.Euler(0f,eulurAngle,0f);
}
}
| {
"content_hash": "72c8d375576e1c6afb6d26068d0ce872",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 191,
"avg_line_length": 27.9375,
"alnum_prop": 0.7684563758389261,
"repo_name": "NCTU-Isolated-Island/Isolated-Island-Game",
"id": "2e55259db3171de66a27c5b8e4cde2a5e77af6fd",
"size": "896",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "UnityProject/Assets/Scripts/PlayerBehavior.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "1902336"
},
{
"name": "GLSL",
"bytes": "224840"
},
{
"name": "Objective-C",
"bytes": "284053"
},
{
"name": "Objective-C++",
"bytes": "30603"
}
],
"symlink_target": ""
} |
import { from, Observable } from 'rxjs';
import { AfterViewInit, Component, OnInit } from '@angular/core';
import { AcNotification, ActionType } from 'angular-cesium';
import { map } from 'rxjs/operators';
@Component({
selector: 'boxes-layer-example',
template: `
<ac-layer acFor="let box of boxes$" [context]="this" [debug]="true">
<ac-box-desc props="{
position: box.position,
dimensions: boxDimensions,
material: Cesium.Color.fromRandom(),
outline: true,
outlineWidth: 8,
outlineColor: Cesium.Color.BLACK
}">
</ac-box-desc>
</ac-layer>
`,
})
export class BoxesLayerComponent implements OnInit {
entities = [
{
id: '0',
position: Cesium.Cartesian3.fromDegrees(-100.0, 40.0, 300000.0),
},
{
id: '1',
position: Cesium.Cartesian3.fromDegrees(-120.0, 40.0, 300000.0),
}
];
boxDimensions = new Cesium.Cartesian3(800000, 800000, 800000);
boxes$: Observable<AcNotification>;
Cesium = Cesium;
constructor() {}
ngOnInit() {
this.boxes$ = from(this.entities).pipe(map(entity => ({
id: entity.id,
actionType: ActionType.ADD_UPDATE,
entity: entity,
}
)));
}
}
| {
"content_hash": "c4313e7181e61642c3b6c118fb3d4013",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 72,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.58359375,
"repo_name": "TGFTech/angular-cesium",
"id": "149cb6337d37e7cca6efe98e2314bb7c5e09a47d",
"size": "1280",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "projects/demo/src/app/components/boxes-layer/boxes-layer.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "11108"
},
{
"name": "JavaScript",
"bytes": "12403"
},
{
"name": "TypeScript",
"bytes": "600024"
}
],
"symlink_target": ""
} |
"""
Project Euler Problem 86: https://projecteuler.net/problem=86
A spider, S, sits in one corner of a cuboid room, measuring 6 by 5 by 3, and a fly, F,
sits in the opposite corner. By travelling on the surfaces of the room the shortest
"straight line" distance from S to F is 10 and the path is shown on the diagram.

However, there are up to three "shortest" path candidates for any given cuboid and the
shortest route doesn't always have integer length.
It can be shown that there are exactly 2060 distinct cuboids, ignoring rotations, with
integer dimensions, up to a maximum size of M by M by M, for which the shortest route
has integer length when M = 100. This is the least value of M for which the number of
solutions first exceeds two thousand; the number of solutions when M = 99 is 1975.
Find the least value of M such that the number of solutions first exceeds one million.
Solution:
Label the 3 side-lengths of the cuboid a,b,c such that 1 <= a <= b <= c <= M.
By conceptually "opening up" the cuboid and laying out its faces on a plane,
it can be seen that the shortest distance between 2 opposite corners is
sqrt((a+b)^2 + c^2). This distance is an integer if and only if (a+b),c make up
the first 2 sides of a pythagorean triplet.
The second useful insight is rather than calculate the number of cuboids
with integral shortest distance for each maximum cuboid side-length M,
we can calculate this number iteratively each time we increase M, as follows.
The set of cuboids satisfying this property with maximum side-length M-1 is a
subset of the cuboids satisfying the property with maximum side-length M
(since any cuboids with side lengths <= M-1 are also <= M). To calculate the
number of cuboids in the larger set (corresponding to M) we need only consider
the cuboids which have at least one side of length M. Since we have ordered the
side lengths a <= b <= c, we can assume that c = M. Then we just need to count
the number of pairs a,b satisfying the conditions:
sqrt((a+b)^2 + M^2) is integer
1 <= a <= b <= M
To count the number of pairs (a,b) satisfying these conditions, write d = a+b.
Now we have:
1 <= a <= b <= M => 2 <= d <= 2*M
we can actually make the second equality strict,
since d = 2*M => d^2 + M^2 = 5M^2
=> shortest distance = M * sqrt(5)
=> not integral.
a + b = d => b = d - a
and a <= b
=> a <= d/2
also a <= M
=> a <= min(M, d//2)
a + b = d => a = d - b
and b <= M
=> a >= d - M
also a >= 1
=> a >= max(1, d - M)
So a is in range(max(1, d - M), min(M, d // 2) + 1)
For a given d, the number of cuboids satisfying the required property with c = M
and a + b = d is the length of this range, which is
min(M, d // 2) + 1 - max(1, d - M).
In the code below, d is sum_shortest_sides
and M is max_cuboid_size.
"""
from math import sqrt
def solution(limit: int = 1000000) -> int:
"""
Return the least value of M such that there are more than one million cuboids
of side lengths 1 <= a,b,c <= M such that the shortest distance between two
opposite vertices of the cuboid is integral.
>>> solution(100)
24
>>> solution(1000)
72
>>> solution(2000)
100
>>> solution(20000)
288
"""
num_cuboids: int = 0
max_cuboid_size: int = 0
sum_shortest_sides: int
while num_cuboids <= limit:
max_cuboid_size += 1
for sum_shortest_sides in range(2, 2 * max_cuboid_size + 1):
if sqrt(sum_shortest_sides**2 + max_cuboid_size**2).is_integer():
num_cuboids += (
min(max_cuboid_size, sum_shortest_sides // 2)
- max(1, sum_shortest_sides - max_cuboid_size)
+ 1
)
return max_cuboid_size
if __name__ == "__main__":
print(f"{solution() = }")
| {
"content_hash": "4ec2b80df800a7d14c1403eed27d6525",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 86,
"avg_line_length": 40.22857142857143,
"alnum_prop": 0.5935132575757576,
"repo_name": "TheAlgorithms/Python",
"id": "064af215c049ecc1de5e7a945c8a7bc444bb874c",
"size": "4226",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "project_euler/problem_086/sol1.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "2601694"
}
],
"symlink_target": ""
} |
import m from 'mithril';
import merge from 'mergerino';
import stream from 'mithril/stream';
import { app } from './app';
const update = stream();
const states = stream.scan(merge, app.initial, update);
const createCell = (state) => ({ state, update });
const cells = states.map(createCell);
// vv Only for using Meiosis Tracer in development.
// Only for using Meiosis Tracer in development.
import meiosisTracer from 'meiosis-tracer';
meiosisTracer({ selector: '#tracer', rows: 25, streams: [states] });
// ^^ Only for using Meiosis Tracer in development.
m.mount(document.getElementById('app'), {
view: () => app.view(cells())
});
cells.map(() => m.redraw());
| {
"content_hash": "ef978af55a3f6eca94ede111b84f5509",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 68,
"avg_line_length": 30.454545454545453,
"alnum_prop": 0.6955223880597015,
"repo_name": "foxdonut/meiosis-examples",
"id": "f63d997bb1aa0259810690cb7cfc4e6d35cbc79d",
"size": "670",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/setup/mithril/src/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "339"
},
{
"name": "HTML",
"bytes": "7463"
},
{
"name": "JavaScript",
"bytes": "69"
}
],
"symlink_target": ""
} |
@interface PodsDummy_Pods_IShopAwayApiManager_Tests : NSObject
@end
@implementation PodsDummy_Pods_IShopAwayApiManager_Tests
@end
| {
"content_hash": "4e3c197d89edc997a8b424697312893f",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 62,
"avg_line_length": 32.5,
"alnum_prop": 0.8538461538461538,
"repo_name": "SomeHero/iShopAwayAPIManager",
"id": "114a5e045ee9c7c9abad554ef8b438fdfd247093",
"size": "164",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Example/Pods/Target Support Files/Pods-IShopAwayApiManager_Tests/Pods-IShopAwayApiManager_Tests-dummy.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "45942"
},
{
"name": "Ruby",
"bytes": "1365"
},
{
"name": "Shell",
"bytes": "9646"
},
{
"name": "Swift",
"bytes": "569084"
}
],
"symlink_target": ""
} |
.class public Lcom/android/internal/telephony/cdma/CdmaRadioStateInfo;
.super Ljava/lang/Object;
.source "CdmaRadioStateInfo.java"
# instance fields
.field public customer_id:Ljava/lang/String;
.field public esn:Ljava/lang/String;
.field public imsi:Ljava/lang/String;
.field public mobile_sw_version:Ljava/lang/String;
.field public pre_only:I
.field public pri_version:Ljava/lang/String;
.field public pri_version_2:Ljava/lang/String;
.field public prl_version:Ljava/lang/String;
.field public version:Ljava/lang/String;
# direct methods
.method public constructor <init>()V
.locals 0
.prologue
.line 27
invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public toString()Ljava/lang/String;
.locals 2
.prologue
.line 50
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "com.android.internal.telephony.cdma.CdmaRadioStateInfo: { version: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/telephony/cdma/CdmaRadioStateInfo;->version:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ", mobile_sw_version: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/telephony/cdma/CdmaRadioStateInfo;->mobile_sw_version:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ", esn: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/telephony/cdma/CdmaRadioStateInfo;->esn:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ", prl_version: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/telephony/cdma/CdmaRadioStateInfo;->prl_version:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ", pre_only: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget v1, p0, Lcom/android/internal/telephony/cdma/CdmaRadioStateInfo;->pre_only:I
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ", imsi: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/telephony/cdma/CdmaRadioStateInfo;->imsi:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ", customer_id: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/telephony/cdma/CdmaRadioStateInfo;->customer_id:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ", pri_version: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/telephony/cdma/CdmaRadioStateInfo;->pri_version:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ", pri_version_2: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/telephony/cdma/CdmaRadioStateInfo;->pri_version_2:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, " }"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
| {
"content_hash": "ddcac29d5abe42f1f9d93548ba8e9226",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 118,
"avg_line_length": 30.347305389221557,
"alnum_prop": 0.7298737174427782,
"repo_name": "baidurom/devices-onex",
"id": "33e421e691094c154852f26ba9c4b2dc8a8ba9a0",
"size": "5068",
"binary": false,
"copies": "1",
"ref": "refs/heads/coron-4.0",
"path": "framework2.jar.out/smali/com/android/internal/telephony/cdma/CdmaRadioStateInfo.smali",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
class Ess_M2ePro_Block_Adminhtml_Amazon_Template_Description_Category_Chooser_Tabs_Browse
extends Mage_Adminhtml_Block_Widget
{
//########################################
public function __construct()
{
parent::__construct();
// Initialization block
// ---------------------------------------
$this->setId('amazonTemplateDescriptionCategoryChooserBrowse');
// ---------------------------------------
// Set template
// ---------------------------------------
$this->setTemplate('M2ePro/amazon/template/description/category/chooser/tabs/browse.phtml');
// ---------------------------------------
}
//########################################
}
| {
"content_hash": "f5e088d47810b5d28228ccedd153dbf1",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 100,
"avg_line_length": 28.884615384615383,
"alnum_prop": 0.4141145139813582,
"repo_name": "portchris/NaturalRemedyCompany",
"id": "5567eb0be7863630e11f0e95ddbf42fc3977c1bb",
"size": "862",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/code/community/Ess/M2ePro/Block/Adminhtml/Amazon/Template/Description/Category/Chooser/Tabs/Browse.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "20009"
},
{
"name": "Batchfile",
"bytes": "1036"
},
{
"name": "CSS",
"bytes": "2584823"
},
{
"name": "Dockerfile",
"bytes": "828"
},
{
"name": "HTML",
"bytes": "8762252"
},
{
"name": "JavaScript",
"bytes": "2932806"
},
{
"name": "PHP",
"bytes": "66466458"
},
{
"name": "PowerShell",
"bytes": "1028"
},
{
"name": "Ruby",
"bytes": "576"
},
{
"name": "Shell",
"bytes": "40066"
},
{
"name": "XSLT",
"bytes": "2135"
}
],
"symlink_target": ""
} |
package com.hazelcast.simulator.coordinator;
import com.hazelcast.simulator.probes.Result;
import com.hazelcast.simulator.probes.impl.ResultImpl;
import com.hazelcast.simulator.probes.xml.ResultXmlUtils;
import com.hazelcast.simulator.protocol.core.SimulatorAddress;
import com.hazelcast.simulator.worker.performance.PerformanceState;
import org.HdrHistogram.Histogram;
import org.apache.log4j.Logger;
import java.io.File;
import java.nio.ByteBuffer;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import static java.lang.String.format;
import static javax.xml.bind.DatatypeConverter.parseBase64Binary;
import static org.HdrHistogram.Histogram.decodeFromCompressedByteBuffer;
/**
* Responsible for storing and aggregating test histograms from Simulator workers.
*/
public class TestHistogramContainer {
private static final Logger LOGGER = Logger.getLogger(TestHistogramContainer.class);
private final ConcurrentMap<SimulatorAddress, ConcurrentMap<String, Map<String, String>>> workerTestProbeHistogramMap
= new ConcurrentHashMap<SimulatorAddress, ConcurrentMap<String, Map<String, String>>>();
private final PerformanceStateContainer performanceStateContainer;
public TestHistogramContainer(PerformanceStateContainer performanceStateContainer) {
this.performanceStateContainer = performanceStateContainer;
}
public synchronized void addTestHistograms(SimulatorAddress workerAddress, String testId, Map<String, String> histograms) {
ConcurrentMap<String, Map<String, String>> testHistogramMap = workerTestProbeHistogramMap.get(workerAddress);
if (testHistogramMap == null) {
testHistogramMap = new ConcurrentHashMap<String, Map<String, String>>();
workerTestProbeHistogramMap.put(workerAddress, testHistogramMap);
}
testHistogramMap.put(testId, histograms);
}
public ConcurrentMap<String, Map<String, String>> getTestHistograms(SimulatorAddress workerAddress) {
return workerTestProbeHistogramMap.get(workerAddress);
}
void createProbeResults(String testSuiteId, String testCaseId) {
PerformanceState performanceState = performanceStateContainer.getPerformanceStateForTestCase(testCaseId);
Result result = aggregateHistogramsForTestCase(testCaseId, performanceState);
if (!result.isEmpty()) {
String fileName = "probes-" + testSuiteId + '_' + testCaseId + ".xml";
ResultXmlUtils.toXml(result, new File(fileName));
logProbesResultInHumanReadableFormat(testCaseId, result);
}
}
private synchronized Result aggregateHistogramsForTestCase(String testCaseId, PerformanceState state) {
if (state == null) {
return new ResultImpl(testCaseId, 0, 0.0d);
}
Result result = new ResultImpl(testCaseId, state.getOperationCount(), state.getTotalThroughput());
for (ConcurrentMap<String, Map<String, String>> testHistogramMap : workerTestProbeHistogramMap.values()) {
Map<String, String> probeHistogramMap = testHistogramMap.get(testCaseId);
if (probeHistogramMap == null) {
continue;
}
for (Map.Entry<String, String> mapEntry : probeHistogramMap.entrySet()) {
String probeName = mapEntry.getKey();
String encodedHistogram = mapEntry.getValue();
try {
ByteBuffer buffer = ByteBuffer.wrap(parseBase64Binary(encodedHistogram));
Histogram histogram = decodeFromCompressedByteBuffer(buffer, 0);
result.addHistogram(probeName, histogram);
} catch (Exception e) {
LOGGER.warn("Could not decode histogram from test " + testCaseId + " of probe " + probeName);
}
}
}
return result;
}
private void logProbesResultInHumanReadableFormat(String testId, Result result) {
for (String probeName : result.probeNames()) {
LOGGER.info(format("%s Results of probe %s:%n%s", testId, probeName, result.toHumanString(probeName)));
}
}
}
| {
"content_hash": "5aa1eeeaeb18b6f837627b645b3f90f0",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 127,
"avg_line_length": 46.32967032967033,
"alnum_prop": 0.7122865275142315,
"repo_name": "Danny-Hazelcast/hazelcast-stabilizer",
"id": "25cf2933a52b8e7ad7e16432d7765a7a9c6d6e40",
"size": "4841",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "simulator/src/main/java/com/hazelcast/simulator/coordinator/TestHistogramContainer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2263002"
},
{
"name": "Shell",
"bytes": "14775"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="./../../helpwin.css">
<title>MATLAB File Help: prtClassBagging/baseClassifier</title>
</head>
<body>
<!--Single-page help-->
<table border="0" cellspacing="0" width="100%">
<tr class="subheader">
<td class="headertitle">MATLAB File Help: prtClassBagging/baseClassifier</td>
</tr>
</table>
<div class="title">prtClassBagging/baseClassifier</div>
<div class="helptext"><pre><!--helptext --> <span class="helptopic">baseClassifier</span> - The classifier to be bagged</pre></div><!--after help -->
<!--Property-->
<div class="sectiontitle">Property Details</div>
<table class="class-details">
<tr>
<td class="class-detail-label">Constant</td>
<td>false</td>
</tr>
<tr>
<td class="class-detail-label">Dependent</td>
<td>true</td>
</tr>
<tr>
<td class="class-detail-label">Sealed</td>
<td>false</td>
</tr>
<tr>
<td class="class-detail-label">Transient</td>
<td>false</td>
</tr>
<tr>
<td class="class-detail-label">GetAccess</td>
<td>public</td>
</tr>
<tr>
<td class="class-detail-label">SetAccess</td>
<td>public</td>
</tr>
<tr>
<td class="class-detail-label">GetObservable</td>
<td>false</td>
</tr>
<tr>
<td class="class-detail-label">SetObservable</td>
<td>false</td>
</tr>
</table>
</body>
</html> | {
"content_hash": "3236b669d0db72c84ad9ec1934bafb50",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 156,
"avg_line_length": 31.910714285714285,
"alnum_prop": 0.498041410184667,
"repo_name": "jpalves/PRT",
"id": "f70dd30914f31190938a890171ae5d4765be1489",
"size": "1787",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "doc/functionReference/prtClassBagging/baseClassifier.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "33"
},
{
"name": "C",
"bytes": "55188"
},
{
"name": "C++",
"bytes": "66966"
},
{
"name": "CSS",
"bytes": "7676"
},
{
"name": "HTML",
"bytes": "23733"
},
{
"name": "JavaScript",
"bytes": "503"
},
{
"name": "Makefile",
"bytes": "1462"
},
{
"name": "Matlab",
"bytes": "4725394"
},
{
"name": "Objective-C",
"bytes": "3171"
},
{
"name": "Shell",
"bytes": "2184"
}
],
"symlink_target": ""
} |
comments: true
postDate: '2010-07-13 15:49:00+00:00'
layout: page
isPost: true
active: false
image:
thumb: esx4.1_thumb.jpg
subheadline: VMware
teaser: "As you may have read throughout the blogsphere, VMware released vSphere 4.1 today. Well my question is, what should I do about it?"
title: What to do about vSphere 4.1
categories: VMware
tags:
- VMware
- vSphere
- vSphere 4.1
---
The release does provide some neat features such as being able to add your ESX or ESXi server to Active Directory allowing for domain login into the servers. But another feature is that the upgrade for vCenter only runs on 64-bit Windows OS which makes transitioning to the new vCenter a little bit of a hassle.
Thankfully, VMware has provided some [kb articles](http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1021635) on how to migrate the database to the new vCenter.
For where I work. We will probably wait a little bit before making the migration. But that is ok. I will make another post on how it went when we do migrate.
| {
"content_hash": "90fb7fb53aef8fe2ece5cca55d6a0433",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 311,
"avg_line_length": 53.05,
"alnum_prop": 0.7803958529688972,
"repo_name": "virtuallyanadmi/virtuallyanadmi.github.io",
"id": "fc0fa132f5d3a26f6f87a415128838adf9f0b394",
"size": "1065",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/vmware/2010-07-13-what-to-do-about-vsphere-4-1.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "375201"
},
{
"name": "HTML",
"bytes": "230928"
},
{
"name": "JavaScript",
"bytes": "501064"
},
{
"name": "Ruby",
"bytes": "1506"
},
{
"name": "XSLT",
"bytes": "8443"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "cf548c751ead1362668c9c3fb766b29d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "4f36d0860069efe7a24c3f805187d82c3c8665a7",
"size": "209",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Pyrrocoma/Pyrrocoma hirta/ Syn. Haplopappus hirtus sonchifolius/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
<!-- Material Design Lite css Library -->
<link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.indigo-pink.min.css">
<!-- Material Design Fonts -->
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- Custom theme css -->
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
<!-- does not work for some reason -->
<link rel="stylesheet" type="text/css" href="mystyle.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
</head>
| {
"content_hash": "586360d052adf29e4c0580f48868afda",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 166,
"avg_line_length": 50.3448275862069,
"alnum_prop": 0.6568493150684932,
"repo_name": "MaterialEngineering/MaterialEngineering.github.io",
"id": "be20c3b91a5edce9cdd94447621fe47e9e71e5de",
"size": "1460",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/head.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "18705"
},
{
"name": "HTML",
"bytes": "10751"
},
{
"name": "JavaScript",
"bytes": "1539"
}
],
"symlink_target": ""
} |
layout: sidebar-right
category: childrens-ya-books
title: New in and children's reading ideas
breadcrumb: children-parents
sidebar: children-parents
pagination:
enabled: true
category: childrens-ya-books
---
<p>Reviews, suggestions and lists of new books for children aged 0-11. We have recommendations for readers aged 11+ in <a href="/new-suggestions/young-adult/">our Young Adult section</a>.</p>
{% include post-listing.html %}
| {
"content_hash": "fcdf33718ace564fd0ffe904866cb289",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 191,
"avg_line_length": 33.69230769230769,
"alnum_prop": 0.7648401826484018,
"repo_name": "suffolklibraries/sljekyll",
"id": "474c90413b33a17fd6103b973d62eff587ce689a",
"size": "442",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "parents-carers-and-children/childrens-ya-books/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "157758"
},
{
"name": "HTML",
"bytes": "27181305"
},
{
"name": "JavaScript",
"bytes": "247140"
},
{
"name": "Rich Text Format",
"bytes": "265002"
},
{
"name": "Ruby",
"bytes": "1015"
}
],
"symlink_target": ""
} |
package com.pzhao.pzhaoweather.model;
public class County {
private int id;
private String countyName;
private String countyCode;
private int cityId;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCountyName() {
return countyName;
}
public void setCountyName(String countyName) {
this.countyName = countyName;
}
public String getCountyCode() {
return countyCode;
}
public void setCountyCode(String countyId) {
this.countyCode = countyId;
}
public int getCityId() {
return cityId;
}
public void setCityId(int cityId) {
this.cityId = cityId;
}
}
| {
"content_hash": "6f97886fc01d1a58591f7d1f5f1bc7fa",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 47,
"avg_line_length": 17.63888888888889,
"alnum_prop": 0.710236220472441,
"repo_name": "pengood/PengWeather",
"id": "04b1452c86f3c559d1473f9745c8642ce5de480c",
"size": "635",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/pzhao/pzhaoweather/model/County.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "28966"
}
],
"symlink_target": ""
} |
nodejs versioone proxy
| {
"content_hash": "aa8726dbd433d7671bcf96035d2bcd9f",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 22,
"avg_line_length": 23,
"alnum_prop": 0.8695652173913043,
"repo_name": "gkathan/v1proxy",
"id": "2dc38e6b39dbaf7213887f77947f01682de67fd3",
"size": "33",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "110"
},
{
"name": "HTML",
"bytes": "309"
},
{
"name": "JavaScript",
"bytes": "152101"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XOMNI.SDK.Core.ApiAccess;
using XOMNI.SDK.Core.Providers;
namespace XOMNI.SDK.Core.Management
{
public abstract class BaseCRUDPManagement<T> : BaseCRUDManagement<T>
{
protected override CRUDApiAccessBase<T> ApiAccess
{
get { return CRUDPApiAccess; }
}
protected abstract CRUDPApiAccessBase<T> CRUDPApiAccess { get; }
/// <summary>
/// Updates an entity
/// </summary>
/// <param name="entity">Dynamic entity to be updated</param>
/// <returns>Updated entity</returns>
public virtual Task<T> PatchAsync(dynamic entity)
{
return CRUDPApiAccess.PatchAsync(entity, base.ApiCredential);
}
#region Low level methods
public virtual XOMNIRequestMessage<T> CreatePatchRequest(dynamic entity)
{
return CRUDPApiAccess.CreatePatchRequest(entity, base.ApiCredential);
}
#endregion
}
}
| {
"content_hash": "fc0b0496d429e42f5a25d60573d6d628",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 81,
"avg_line_length": 26.51219512195122,
"alnum_prop": 0.6485740570377185,
"repo_name": "nseckinoral/xomni-sdk-dotnet",
"id": "e85b8f7e54e0aa5f33a7241f4a70dce7eba338de",
"size": "1089",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "src/XOMNI.SDK.Core/Management/BaseCRUDPManagement.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1192844"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source 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.
-->
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/abc_list_pressed_holo_light" />
<item android:drawable="@drawable/abc_list_longpressed_holo" />
</transition>
<!-- From: file:/Users/daehyun/GitHub/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/20.0.0/res/drawable/abc_list_selector_background_transition_holo_light.xml --> | {
"content_hash": "a329db7bd061acda44cbafeb2caa798e",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 194,
"avg_line_length": 51.95238095238095,
"alnum_prop": 0.7341888175985335,
"repo_name": "mapia/android",
"id": "2bd28171884ebd01ef2c30bb6d92ad0684737919",
"size": "1091",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/build/intermediates/res/debug/drawable/abc_list_selector_background_transition_holo_light.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1171615"
}
],
"symlink_target": ""
} |
<div class="container">
<div class="flex-header">
<h1>Open pull requests</h1>
<button
mat-raised-button
color="accent"
class="align-center"
[routerLink]="['/new', repoName, repoOwner]"
>
Create new snippet
</button>
</div>
<table
*ngIf="pullsList$ | async as pullsList; else loading"
mat-table
[dataSource]="pullsList"
>
<ng-container matColumnDef="number">
<th mat-header-cell *matHeaderCellDef>#</th>
<td mat-cell *matCellDef="let item" class="mat-cell-padding">
{{ item.number }}
</td>
</ng-container>
<ng-container matColumnDef="title">
<th mat-header-cell *matHeaderCellDef>Title</th>
<td mat-cell *matCellDef="let item" class="mat-cell-padding">
<a
href="https://github.com/{{ repoOwner }}/{{ repoName }}/pull/{{
item.number
}}"
target="_blank"
>{{ item.title }}</a
>
</td>
</ng-container>
<ng-container matColumnDef="login">
<th mat-header-cell *matHeaderCellDef>Author</th>
<td mat-cell *matCellDef="let item" class="mat-cell-padding">
{{ item.user.login }}
</td>
</ng-container>
<ng-container matColumnDef="created_at">
<th mat-header-cell *matHeaderCellDef>Creation Date</th>
<td mat-cell *matCellDef="let item" class="mat-cell-padding">
{{ item.created_at | date: 'MM/dd/yyyy' }}
</td>
</ng-container>
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef>Action</th>
<td mat-cell *matCellDef="let item" class="mat-cell-padding">
<button
mat-button
color="warn"
[routerLink]="['/new', repoName, repoOwner, item['number']]"
>
Edit
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
</div>
<ng-template #loading>
loading ...
</ng-template>
| {
"content_hash": "fdd8503bf5114f94aacc23cb7b3c52c1",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 73,
"avg_line_length": 30.191176470588236,
"alnum_prop": 0.5796395518753045,
"repo_name": "nycJSorg/angular-presentation",
"id": "a47a9a2048d0e8eb63bd21012c0710e1ae29380c",
"size": "2053",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "apps/angular-thirty-seconds/src/app/pull-requests-list/pull-requests-list.component.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "64088"
},
{
"name": "HTML",
"bytes": "378245"
},
{
"name": "JavaScript",
"bytes": "6734881"
},
{
"name": "TypeScript",
"bytes": "614237"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>paco: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.11.2 / paco - 1.2.8</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
paco
<small>
1.2.8
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-04-03 22:58:34 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-04-03 22:58:34 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.11.2 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "paco@sf.snu.ac.kr"
version: "1.2.8"
homepage: "https://github.com/snu-sf/paco/"
dev-repo: "git+https://github.com/snu-sf/paco.git"
bug-reports: "https://github.com/snu-sf/paco/issues/"
authors: [
"Chung-Kil Hur <gil.hur@sf.snu.ac.kr>"
"Georg Neis <neis@mpi-sws.org>"
"Derek Dreyer <dreyer@mpi-sws.org>"
"Viktor Vafeiadis <viktor@mpi-sws.org>"
]
license: "BSD-3"
build: [
[make "-C" "src" "all" "-j%{jobs}%"]
]
install: [
[make "-C" "src" "-f" "Makefile.coq" "install"]
]
remove: ["rm" "-r" "-f" "%{lib}%/coq/user-contrib/Paco"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.9~"}
]
synopsis: "Coq library implementing parameterized coinduction"
tags: [
"date:2018-02-11"
"category:Computer Science/Programming Languages/Formal Definitions and Theory"
"category:Mathematics/Logic"
"keyword:co-induction"
"keyword:simulation"
"keyword:parameterized greatest fixed point"
]
flags: light-uninstall
url {
src:
"https://github.com/snu-sf/paco/archive/5cc7babe1423b56d7fe9a474f1645f495c82061b.tar.gz"
checksum: "md5=32ee0f67d5901a138722dd39ffee14a2"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-paco.1.2.8 coq.8.11.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.11.2).
The following dependencies couldn't be met:
- coq-paco -> coq < 8.9~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-paco.1.2.8</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "e9e60e9470d2ccb7b582a25d7b726ab1",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 159,
"avg_line_length": 39.74301675977654,
"alnum_prop": 0.5442788867022772,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "17b3b573cb62da9e3de1d1c3cb05bfecfdf90a20",
"size": "7139",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.11.2/paco/1.2.8.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<p>This is the first release of the low-coverage 2.63X assembly of the
megabat (<i>Pteropus vampyrus</i>). The genome sequencing is provided by
the <a href=" http://www.hgsc.bcm.tmc.edu/">Human Genome Sequencing Center</a>,
Baylor College of Medicine and assembly is provided by the
<a href="http://www.broad.mit.edu/">Broad Institute</a>.</p>
</p>
<p>
The N50 size is the length such that 50% of the assembled genome lies
in blocks of the N50 size or longer. The N50 length for supercontigs
is 118.14 kb and is 8.53 kb for contigs. The total number of bases in
supercontigs is 1.96 Gb and in contigs is 1.84 Gb.
</p>
| {
"content_hash": "1015630c919abdc1b66f820d819ef7d4",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 80,
"avg_line_length": 45,
"alnum_prop": 0.726984126984127,
"repo_name": "muffato/public-plugins",
"id": "0e56e3a169b1d936f0027fce1dc6d1ee283cba81",
"size": "630",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ensembl/htdocs/ssi/species/Pteropus_vampyrus_assembly.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "186"
},
{
"name": "CSS",
"bytes": "164321"
},
{
"name": "CoffeeScript",
"bytes": "171316"
},
{
"name": "HTML",
"bytes": "1271868"
},
{
"name": "JavaScript",
"bytes": "1719676"
},
{
"name": "Perl",
"bytes": "1712523"
}
],
"symlink_target": ""
} |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package tls
import (
"crypto"
"crypto/ecdsa"
"crypto/rsa"
"crypto/subtle"
"crypto/x509"
"encoding/asn1"
"errors"
"fmt"
"io"
)
// serverHandshakeState contains details of a server handshake in progress.
// It's discarded once the handshake has completed.
type serverHandshakeState struct {
c *Conn
clientHello *clientHelloMsg
hello *serverHelloMsg
suite *cipherSuite
ellipticOk bool
ecdsaOk bool
sessionState *sessionState
finishedHash finishedHash
masterSecret []byte
certsFromClient [][]byte
cert *Certificate
}
// serverHandshake performs a TLS handshake as a server.
func (c *Conn) serverHandshake() error {
config := c.config
// If this is the first server handshake, we generate a random key to
// encrypt the tickets with.
config.serverInitOnce.Do(config.serverInit)
hs := serverHandshakeState{
c: c,
}
isResume, err := hs.readClientHello()
if err != nil {
return err
}
// For an overview of TLS handshaking, see https://tools.ietf.org/html/rfc5246#section-7.3
if isResume {
// The client has included a session ticket and so we do an abbreviated handshake.
if err := hs.doResumeHandshake(); err != nil {
return err
}
if err := hs.establishKeys(); err != nil {
return err
}
if err := hs.sendFinished(); err != nil {
return err
}
if err := hs.readFinished(); err != nil {
return err
}
c.didResume = true
} else {
// The client didn't include a session ticket, or it wasn't
// valid so we do a full handshake.
if err := hs.doFullHandshake(); err != nil {
return err
}
if err := hs.establishKeys(); err != nil {
return err
}
if err := hs.readFinished(); err != nil {
return err
}
if err := hs.sendSessionTicket(); err != nil {
return err
}
if err := hs.sendFinished(); err != nil {
return err
}
}
c.handshakeComplete = true
return nil
}
// readClientHello reads a ClientHello message from the client and decides
// whether we will perform session resumption.
func (hs *serverHandshakeState) readClientHello() (isResume bool, err error) {
config := hs.c.config
c := hs.c
msg, err := c.readHandshake()
if err != nil {
return false, err
}
var ok bool
hs.clientHello, ok = msg.(*clientHelloMsg)
if !ok {
c.sendAlert(alertUnexpectedMessage)
return false, unexpectedMessageError(hs.clientHello, msg)
}
c.vers, ok = config.mutualVersion(hs.clientHello.vers)
if !ok {
c.sendAlert(alertProtocolVersion)
return false, fmt.Errorf("tls: client offered an unsupported, maximum protocol version of %x", hs.clientHello.vers)
}
c.haveVers = true
hs.finishedHash = newFinishedHash(c.vers)
hs.finishedHash.Write(hs.clientHello.marshal())
hs.hello = new(serverHelloMsg)
supportedCurve := false
Curves:
for _, curve := range hs.clientHello.supportedCurves {
switch curve {
case curveP256, curveP384, curveP521:
supportedCurve = true
break Curves
}
}
supportedPointFormat := false
for _, pointFormat := range hs.clientHello.supportedPoints {
if pointFormat == pointFormatUncompressed {
supportedPointFormat = true
break
}
}
hs.ellipticOk = supportedCurve && supportedPointFormat
foundCompression := false
// We only support null compression, so check that the client offered it.
for _, compression := range hs.clientHello.compressionMethods {
if compression == compressionNone {
foundCompression = true
break
}
}
if !foundCompression {
c.sendAlert(alertHandshakeFailure)
return false, errors.New("tls: client does not support uncompressed connections")
}
hs.hello.vers = c.vers
hs.hello.random = make([]byte, 32)
_, err = io.ReadFull(config.rand(), hs.hello.random)
if err != nil {
c.sendAlert(alertInternalError)
return false, err
}
hs.hello.secureRenegotiation = hs.clientHello.secureRenegotiation
hs.hello.compressionMethod = compressionNone
if len(hs.clientHello.serverName) > 0 {
c.serverName = hs.clientHello.serverName
}
// Although sending an empty NPN extension is reasonable, Firefox has
// had a bug around this. Best to send nothing at all if
// config.NextProtos is empty. See
// https://code.google.com/p/go/issues/detail?id=5445.
if hs.clientHello.nextProtoNeg && len(config.NextProtos) > 0 {
hs.hello.nextProtoNeg = true
hs.hello.nextProtos = config.NextProtos
}
if len(config.Certificates) == 0 {
c.sendAlert(alertInternalError)
return false, errors.New("tls: no certificates configured")
}
hs.cert = &config.Certificates[0]
if len(hs.clientHello.serverName) > 0 {
hs.cert = config.getCertificateForName(hs.clientHello.serverName)
}
_, hs.ecdsaOk = hs.cert.PrivateKey.(*ecdsa.PrivateKey)
if hs.checkForResumption() {
return true, nil
}
var preferenceList, supportedList []uint16
if c.config.PreferServerCipherSuites {
preferenceList = c.config.cipherSuites()
supportedList = hs.clientHello.cipherSuites
} else {
preferenceList = hs.clientHello.cipherSuites
supportedList = c.config.cipherSuites()
}
for _, id := range preferenceList {
if hs.suite = c.tryCipherSuite(id, supportedList, c.vers, hs.ellipticOk, hs.ecdsaOk); hs.suite != nil {
break
}
}
if hs.suite == nil {
c.sendAlert(alertHandshakeFailure)
return false, errors.New("tls: no cipher suite supported by both client and server")
}
return false, nil
}
// checkForResumption returns true if we should perform resumption on this connection.
func (hs *serverHandshakeState) checkForResumption() bool {
c := hs.c
var ok bool
if hs.sessionState, ok = c.decryptTicket(hs.clientHello.sessionTicket); !ok {
return false
}
if hs.sessionState.vers > hs.clientHello.vers {
return false
}
if vers, ok := c.config.mutualVersion(hs.sessionState.vers); !ok || vers != hs.sessionState.vers {
return false
}
cipherSuiteOk := false
// Check that the client is still offering the ciphersuite in the session.
for _, id := range hs.clientHello.cipherSuites {
if id == hs.sessionState.cipherSuite {
cipherSuiteOk = true
break
}
}
if !cipherSuiteOk {
return false
}
// Check that we also support the ciphersuite from the session.
hs.suite = c.tryCipherSuite(hs.sessionState.cipherSuite, c.config.cipherSuites(), hs.sessionState.vers, hs.ellipticOk, hs.ecdsaOk)
if hs.suite == nil {
return false
}
sessionHasClientCerts := len(hs.sessionState.certificates) != 0
needClientCerts := c.config.ClientAuth == RequireAnyClientCert || c.config.ClientAuth == RequireAndVerifyClientCert
if needClientCerts && !sessionHasClientCerts {
return false
}
if sessionHasClientCerts && c.config.ClientAuth == NoClientCert {
return false
}
return true
}
func (hs *serverHandshakeState) doResumeHandshake() error {
c := hs.c
hs.hello.cipherSuite = hs.suite.id
// We echo the client's session ID in the ServerHello to let it know
// that we're doing a resumption.
hs.hello.sessionId = hs.clientHello.sessionId
hs.finishedHash.Write(hs.hello.marshal())
c.writeRecord(recordTypeHandshake, hs.hello.marshal())
if len(hs.sessionState.certificates) > 0 {
if _, err := hs.processCertsFromClient(hs.sessionState.certificates); err != nil {
return err
}
}
hs.masterSecret = hs.sessionState.masterSecret
return nil
}
func (hs *serverHandshakeState) doFullHandshake() error {
config := hs.c.config
c := hs.c
if hs.clientHello.ocspStapling && len(hs.cert.OCSPStaple) > 0 {
hs.hello.ocspStapling = true
}
hs.hello.ticketSupported = hs.clientHello.ticketSupported && !config.SessionTicketsDisabled
hs.hello.cipherSuite = hs.suite.id
hs.finishedHash.Write(hs.hello.marshal())
c.writeRecord(recordTypeHandshake, hs.hello.marshal())
certMsg := new(certificateMsg)
certMsg.certificates = hs.cert.Certificate
hs.finishedHash.Write(certMsg.marshal())
c.writeRecord(recordTypeHandshake, certMsg.marshal())
if hs.hello.ocspStapling {
certStatus := new(certificateStatusMsg)
certStatus.statusType = statusTypeOCSP
certStatus.response = hs.cert.OCSPStaple
hs.finishedHash.Write(certStatus.marshal())
c.writeRecord(recordTypeHandshake, certStatus.marshal())
}
keyAgreement := hs.suite.ka(c.vers)
skx, err := keyAgreement.generateServerKeyExchange(config, hs.cert, hs.clientHello, hs.hello)
if err != nil {
c.sendAlert(alertHandshakeFailure)
return err
}
if skx != nil {
hs.finishedHash.Write(skx.marshal())
c.writeRecord(recordTypeHandshake, skx.marshal())
}
if config.ClientAuth >= RequestClientCert {
// Request a client certificate
certReq := new(certificateRequestMsg)
certReq.certificateTypes = []byte{
byte(certTypeRSASign),
byte(certTypeECDSASign),
}
if c.vers >= VersionTLS12 {
certReq.hasSignatureAndHash = true
certReq.signatureAndHashes = supportedClientCertSignatureAlgorithms
}
// An empty list of certificateAuthorities signals to
// the client that it may send any certificate in response
// to our request. When we know the CAs we trust, then
// we can send them down, so that the client can choose
// an appropriate certificate to give to us.
if config.ClientCAs != nil {
certReq.certificateAuthorities = config.ClientCAs.Subjects()
}
hs.finishedHash.Write(certReq.marshal())
c.writeRecord(recordTypeHandshake, certReq.marshal())
}
helloDone := new(serverHelloDoneMsg)
hs.finishedHash.Write(helloDone.marshal())
c.writeRecord(recordTypeHandshake, helloDone.marshal())
var pub crypto.PublicKey // public key for client auth, if any
msg, err := c.readHandshake()
if err != nil {
return err
}
var ok bool
// If we requested a client certificate, then the client must send a
// certificate message, even if it's empty.
if config.ClientAuth >= RequestClientCert {
if certMsg, ok = msg.(*certificateMsg); !ok {
c.sendAlert(alertUnexpectedMessage)
return unexpectedMessageError(certMsg, msg)
}
hs.finishedHash.Write(certMsg.marshal())
if len(certMsg.certificates) == 0 {
// The client didn't actually send a certificate
switch config.ClientAuth {
case RequireAnyClientCert, RequireAndVerifyClientCert:
c.sendAlert(alertBadCertificate)
return errors.New("tls: client didn't provide a certificate")
}
}
pub, err = hs.processCertsFromClient(certMsg.certificates)
if err != nil {
return err
}
msg, err = c.readHandshake()
if err != nil {
return err
}
}
// Get client key exchange
ckx, ok := msg.(*clientKeyExchangeMsg)
if !ok {
c.sendAlert(alertUnexpectedMessage)
return unexpectedMessageError(ckx, msg)
}
hs.finishedHash.Write(ckx.marshal())
// If we received a client cert in response to our certificate request message,
// the client will send us a certificateVerifyMsg immediately after the
// clientKeyExchangeMsg. This message is a digest of all preceding
// handshake-layer messages that is signed using the private key corresponding
// to the client's certificate. This allows us to verify that the client is in
// possession of the private key of the certificate.
if len(c.peerCertificates) > 0 {
msg, err = c.readHandshake()
if err != nil {
return err
}
certVerify, ok := msg.(*certificateVerifyMsg)
if !ok {
c.sendAlert(alertUnexpectedMessage)
return unexpectedMessageError(certVerify, msg)
}
switch key := pub.(type) {
case *ecdsa.PublicKey:
ecdsaSig := new(ecdsaSignature)
if _, err = asn1.Unmarshal(certVerify.signature, ecdsaSig); err != nil {
break
}
if ecdsaSig.R.Sign() <= 0 || ecdsaSig.S.Sign() <= 0 {
err = errors.New("ECDSA signature contained zero or negative values")
break
}
digest, _, _ := hs.finishedHash.hashForClientCertificate(signatureECDSA)
if !ecdsa.Verify(key, digest, ecdsaSig.R, ecdsaSig.S) {
err = errors.New("ECDSA verification failure")
break
}
case *rsa.PublicKey:
digest, hashFunc, _ := hs.finishedHash.hashForClientCertificate(signatureRSA)
err = rsa.VerifyPKCS1v15(key, hashFunc, digest, certVerify.signature)
}
if err != nil {
c.sendAlert(alertBadCertificate)
return errors.New("could not validate signature of connection nonces: " + err.Error())
}
hs.finishedHash.Write(certVerify.marshal())
}
preMasterSecret, err := keyAgreement.processClientKeyExchange(config, hs.cert, ckx, c.vers)
if err != nil {
c.sendAlert(alertHandshakeFailure)
return err
}
hs.masterSecret = masterFromPreMasterSecret(c.vers, preMasterSecret, hs.clientHello.random, hs.hello.random)
return nil
}
func (hs *serverHandshakeState) establishKeys() error {
c := hs.c
clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV :=
keysFromMasterSecret(c.vers, hs.masterSecret, hs.clientHello.random, hs.hello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen)
var clientCipher, serverCipher interface{}
var clientHash, serverHash macFunction
if hs.suite.aead == nil {
clientCipher = hs.suite.cipher(clientKey, clientIV, true /* for reading */)
clientHash = hs.suite.mac(c.vers, clientMAC)
serverCipher = hs.suite.cipher(serverKey, serverIV, false /* not for reading */)
serverHash = hs.suite.mac(c.vers, serverMAC)
} else {
clientCipher = hs.suite.aead(clientKey, clientIV)
serverCipher = hs.suite.aead(serverKey, serverIV)
}
c.in.prepareCipherSpec(c.vers, clientCipher, clientHash)
c.out.prepareCipherSpec(c.vers, serverCipher, serverHash)
return nil
}
func (hs *serverHandshakeState) readFinished() error {
c := hs.c
c.readRecord(recordTypeChangeCipherSpec)
if err := c.error(); err != nil {
return err
}
if hs.hello.nextProtoNeg {
msg, err := c.readHandshake()
if err != nil {
return err
}
nextProto, ok := msg.(*nextProtoMsg)
if !ok {
c.sendAlert(alertUnexpectedMessage)
return unexpectedMessageError(nextProto, msg)
}
hs.finishedHash.Write(nextProto.marshal())
c.clientProtocol = nextProto.proto
}
msg, err := c.readHandshake()
if err != nil {
return err
}
clientFinished, ok := msg.(*finishedMsg)
if !ok {
c.sendAlert(alertUnexpectedMessage)
return unexpectedMessageError(clientFinished, msg)
}
verify := hs.finishedHash.clientSum(hs.masterSecret)
if len(verify) != len(clientFinished.verifyData) ||
subtle.ConstantTimeCompare(verify, clientFinished.verifyData) != 1 {
c.sendAlert(alertHandshakeFailure)
return errors.New("tls: client's Finished message is incorrect")
}
hs.finishedHash.Write(clientFinished.marshal())
return nil
}
func (hs *serverHandshakeState) sendSessionTicket() error {
if !hs.hello.ticketSupported {
return nil
}
c := hs.c
m := new(newSessionTicketMsg)
var err error
state := sessionState{
vers: c.vers,
cipherSuite: hs.suite.id,
masterSecret: hs.masterSecret,
certificates: hs.certsFromClient,
}
m.ticket, err = c.encryptTicket(&state)
if err != nil {
return err
}
hs.finishedHash.Write(m.marshal())
c.writeRecord(recordTypeHandshake, m.marshal())
return nil
}
func (hs *serverHandshakeState) sendFinished() error {
c := hs.c
c.writeRecord(recordTypeChangeCipherSpec, []byte{1})
finished := new(finishedMsg)
finished.verifyData = hs.finishedHash.serverSum(hs.masterSecret)
hs.finishedHash.Write(finished.marshal())
c.writeRecord(recordTypeHandshake, finished.marshal())
c.cipherSuite = hs.suite.id
return nil
}
// processCertsFromClient takes a chain of client certificates either from a
// Certificates message or from a sessionState and verifies them. It returns
// the public key of the leaf certificate.
func (hs *serverHandshakeState) processCertsFromClient(certificates [][]byte) (crypto.PublicKey, error) {
c := hs.c
hs.certsFromClient = certificates
certs := make([]*x509.Certificate, len(certificates))
var err error
for i, asn1Data := range certificates {
if certs[i], err = x509.ParseCertificate(asn1Data); err != nil {
c.sendAlert(alertBadCertificate)
return nil, errors.New("tls: failed to parse client certificate: " + err.Error())
}
}
if c.config.ClientAuth >= VerifyClientCertIfGiven && len(certs) > 0 {
opts := x509.VerifyOptions{
Roots: c.config.ClientCAs,
CurrentTime: c.config.time(),
Intermediates: x509.NewCertPool(),
KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
}
for _, cert := range certs[1:] {
opts.Intermediates.AddCert(cert)
}
chains, err := certs[0].Verify(opts)
if err != nil {
c.sendAlert(alertBadCertificate)
return nil, errors.New("tls: failed to verify client's certificate: " + err.Error())
}
ok := false
for _, ku := range certs[0].ExtKeyUsage {
if ku == x509.ExtKeyUsageClientAuth {
ok = true
break
}
}
if !ok {
c.sendAlert(alertHandshakeFailure)
return nil, errors.New("tls: client's certificate's extended key usage doesn't permit it to be used for client authentication")
}
c.verifiedChains = chains
}
if len(certs) > 0 {
var pub crypto.PublicKey
switch key := certs[0].PublicKey.(type) {
case *ecdsa.PublicKey, *rsa.PublicKey:
pub = key
default:
c.sendAlert(alertUnsupportedCertificate)
return nil, fmt.Errorf("tls: client's certificate contains an unsupported public key of type %T", certs[0].PublicKey)
}
c.peerCertificates = certs
return pub, nil
}
return nil, nil
}
// tryCipherSuite returns a cipherSuite with the given id if that cipher suite
// is acceptable to use.
func (c *Conn) tryCipherSuite(id uint16, supportedCipherSuites []uint16, version uint16, ellipticOk, ecdsaOk bool) *cipherSuite {
for _, supported := range supportedCipherSuites {
if id == supported {
var candidate *cipherSuite
for _, s := range cipherSuites {
if s.id == id {
candidate = s
break
}
}
if candidate == nil {
continue
}
// Don't select a ciphersuite which we can't
// support for this client.
if (candidate.flags&suiteECDHE != 0) && !ellipticOk {
continue
}
if (candidate.flags&suiteECDSA != 0) != ecdsaOk {
continue
}
if version < VersionTLS12 && candidate.flags&suiteTLS12 != 0 {
continue
}
return candidate
}
}
return nil
}
| {
"content_hash": "948a7718d84716f8a21fba141e6c9354",
"timestamp": "",
"source": "github",
"line_count": 648,
"max_line_length": 137,
"avg_line_length": 28.03240740740741,
"alnum_prop": 0.7159922928709056,
"repo_name": "TomHoenderdos/go-sunos",
"id": "12e5ff1e5895b9052b2751e043a51c8db7e39a78",
"size": "18165",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/pkg/crypto/tls/handshake_server.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "548907"
},
{
"name": "Awk",
"bytes": "3851"
},
{
"name": "C",
"bytes": "4870090"
},
{
"name": "C++",
"bytes": "145450"
},
{
"name": "CSS",
"bytes": "3120"
},
{
"name": "Emacs Lisp",
"bytes": "49391"
},
{
"name": "Go",
"bytes": "16125531"
},
{
"name": "JavaScript",
"bytes": "13246"
},
{
"name": "Objective-C",
"bytes": "24687"
},
{
"name": "Perl",
"bytes": "190519"
},
{
"name": "Python",
"bytes": "121132"
},
{
"name": "Shell",
"bytes": "93640"
},
{
"name": "VimL",
"bytes": "28149"
}
],
"symlink_target": ""
} |
var assert = require('assert');
var guid = require('node-uuid');
// Lib includes
var testutil = require('../../framework/util');
var SR = testutil.libRequire('common/util/sr');
var TestSuite = require('../../framework/test-suite');
var azure = testutil.libRequire('azure-storage');
var Constants = azure.Constants;
var BlobUtilities = azure.BlobUtilities;
var HttpConstants = Constants.HttpConstants;
var containerNamesPrefix = 'cont-';
var blobNamesPrefix = 'blob-';
var suite = new TestSuite('blobservice-container-tests');
var timeout = (suite.isRecording || !suite.isMocked) ? 30000 : 10;
var blobService;
var containerName;
var blobs = [];
describe('BlobContainer', function () {
before(function (done) {
if (suite.isMocked) {
testutil.POLL_REQUEST_INTERVAL = 0;
}
suite.setupSuite(function () {
blobService = azure.createBlobService().withFilter(new azure.ExponentialRetryPolicyFilter());
done();
});
});
after(function (done) {
suite.teardownSuite(done);
});
beforeEach(function (done) {
containerName = suite.getName(containerNamesPrefix);
suite.setupTest(function () {
blobService.createContainerIfNotExists(containerName, function (createError, container) {
assert.equal(createError, null);
assert.notEqual(container, null);
done();
});
});
});
afterEach(function (done) {
blobService.deleteContainerIfExists(containerName, function (deleteError) {
assert.equal(deleteError, null);
suite.teardownTest(done);
});
});
describe('doesContainerExist', function () {
it('should work', function (done) {
containerName = suite.getName(containerNamesPrefix);
assert.doesNotThrow(function () { blobService.doesContainerExist('$root', function () { }); });
assert.doesNotThrow(function () { blobService.doesContainerExist('$logs', function () { }); });
blobService.doesContainerExist(containerName, function (existsError, exists) {
assert.equal(existsError, null);
assert.strictEqual(exists, false);
blobService.createContainer(containerName, function (createError, container1, createContainerResponse) {
assert.equal(createError, null);
assert.notEqual(container1, null);
assert.equal(createContainerResponse.statusCode, HttpConstants.HttpResponseCodes.Created);
blobService.doesContainerExist(containerName, function (existsError, exists) {
assert.equal(existsError, null);
assert.strictEqual(exists, true);
done();
});
});
});
});
});
describe('createContainer', function () {
it('should detect incorrect container names', function (done) {
assert.throws(function () { blobService.createContainer(null, function () { }); },
/Required argument container for function createContainer is not defined/);
assert.throws(function () { blobService.createContainer('$root1', function () { }); },
/Container name format is incorrect./);
assert.throws(function () { blobService.createContainer('$root$logs', function () { }); },
/Container name format is incorrect./);
assert.throws(function () { blobService.createContainer('', function () { }); },
/Required argument container for function createContainer is not defined/);
assert.throws(function () { blobService.createContainer('as', function () { }); },
/Container name must be between 3 and 63 characters long./);
assert.throws(function () { blobService.createContainer('a--s', function () { }); },
/Container name format is incorrect./);
assert.throws(function () { blobService.createContainer('cont-', function () { }); },
/Container name format is incorrect./);
assert.throws(function () { blobService.createContainer('conTain', function () { }); },
/Container name format is incorrect./);
done();
});
it('should work', function (done) {
var containerName = suite.getName(containerNamesPrefix);
blobService.createContainer(containerName, function (createError, container1, createContainerResponse) {
assert.equal(createError, null);
assert.notEqual(container1, null);
if (container1) {
assert.notEqual(container1.name, null);
assert.notEqual(container1.etag, null);
assert.notEqual(container1.lastModified, null);
}
assert.equal(createContainerResponse.statusCode, HttpConstants.HttpResponseCodes.Created);
// creating again will result in a duplicate error
blobService.createContainer(containerName, function (createError2, container2) {
assert.equal(createError2.code, Constants.BlobErrorCodeStrings.CONTAINER_ALREADY_EXISTS);
assert.equal(container2, null);
blobService.deleteContainer(containerName, function (deleteError) {
assert.equal(deleteError, null);
done();
});
});
});
});
});
describe('createContainerIfNotExists', function() {
it('should create a container if not exists', function (done) {
var containerName = suite.getName(containerNamesPrefix);
blobService.createContainerIfNotExists(containerName, function (createError, created) {
assert.equal(createError, null);
assert.equal(created, true);
blobService.doesContainerExist(containerName, function (existsError, exists) {
assert.equal(existsError, null);
assert.equal(exists, true);
blobService.createContainerIfNotExists(containerName, function (createError2, created2) {
assert.equal(createError2, null);
assert.equal(created2, false);
blobService.deleteContainer(containerName, function (deleteError) {
assert.equal(deleteError, null);
blobService.createContainerIfNotExists(containerName, function (createError3) {
assert.notEqual(createError3, null);
assert.equal(createError3.code, 'ContainerBeingDeleted');
done();
});
});
});
});
});
});
it('should throw if called without a callback', function (done) {
assert.throws(function () { blobService.createContainerIfNotExists('name'); },
Error
);
done();
});
});
describe('deleteContainerIfExists', function() {
it('should delete a container if exists', function (done) {
var containerName = suite.getName(containerNamesPrefix);
blobService.doesContainerExist(containerName, function(existsError, exists){
assert.equal(existsError, null);
assert.strictEqual(exists, false);
blobService.deleteContainerIfExists(containerName, function (deleteError, deleted) {
assert.equal(deleteError, null);
assert.strictEqual(deleted, false);
blobService.createContainer(containerName, function (createError, container1, createContainerResponse) {
assert.equal(createError, null);
assert.notEqual(container1, null);
if (container1) {
assert.notEqual(container1.name, null);
assert.notEqual(container1.etag, null);
assert.notEqual(container1.lastModified, null);
}
assert.equal(createContainerResponse.statusCode, HttpConstants.HttpResponseCodes.Created);
// delete if exists should succeed
blobService.deleteContainerIfExists(containerName, function (deleteError2, deleted2) {
assert.equal(deleteError2, null);
assert.strictEqual(deleted2, true);
blobService.doesContainerExist(containerName, function(existsError, exists){
assert.equal(existsError, null);
assert.strictEqual(exists, false);
done();
});
});
});
});
});
});
it('should throw if called without a callback', function (done) {
assert.throws(function () { blobService.deleteContainerIfExists('name'); },
Error
);
done();
});
});
describe('getContainerProperties', function () {
it('should work', function (done) {
var metadata = { 'Color': 'Blue' };
blobService.setContainerMetadata(containerName, metadata, function (setMetadataError, setMetadataResult, setMetadataResponse) {
assert.equal(setMetadataError, null);
assert.ok(setMetadataResponse.isSuccessful);
blobService.getContainerProperties(containerName, function (getError, container2, getResponse) {
assert.equal(getError, null);
assert.notEqual(container2, null);
if (container2) {
assert.equal('unlocked', container2.leaseStatus);
assert.equal('available', container2.leaseState);
assert.equal(null, container2.leaseDuration);
assert.notEqual(null, container2.requestId);
assert.strictEqual(container2.metadata.color, metadata.Color);
}
assert.notEqual(getResponse, null);
assert.equal(getResponse.isSuccessful, true);
blobService.deleteContainer(containerName, function (deleteError) {
assert.equal(deleteError, null);
done();
});
});
});
});
});
describe('setContainerMetadata', function () {
it('should work', function (done) {
var metadata = { 'Class': 'Test' };
blobService.setContainerMetadata(containerName, metadata, function (setMetadataError, setMetadataResult, setMetadataResponse) {
assert.equal(setMetadataError, null);
assert.ok(setMetadataResponse.isSuccessful);
blobService.getContainerMetadata(containerName, function (getMetadataError, containerMetadata, getMetadataResponse) {
assert.equal(getMetadataError, null);
assert.notEqual(containerMetadata, null);
assert.notEqual(containerMetadata.metadata, null);
if (containerMetadata.metadata) {
assert.equal(containerMetadata.metadata.class, 'Test');
}
assert.ok(getMetadataResponse.isSuccessful);
blobService.deleteContainer(containerName, function (deleteError) {
assert.equal(deleteError, null);
done();
});
});
});
});
it('should merge the metadata', function (done) {
var metadata = { color: 'blue', Color: 'Orange', COLOR: 'Red' };
blobService.setContainerMetadata(containerName, metadata, function (setMetadataError, setMetadataResult, setMetadataResponse) {
assert.equal(setMetadataError, null);
assert.ok(setMetadataResponse.isSuccessful);
blobService.getContainerMetadata(containerName, function (getMetadataError, containerMetadata, getMetadataResponse) {
assert.equal(getMetadataError, null);
assert.notEqual(containerMetadata, null);
assert.notEqual(containerMetadata.metadata, null);
if (containerMetadata.metadata) {
assert.equal(containerMetadata.metadata.color, 'blue,Orange,Red');
}
assert.ok(getMetadataResponse.isSuccessful);
blobService.deleteContainer(containerName, function (deleteError) {
assert.equal(deleteError, null);
done();
});
});
});
});
it('should work with a lease', function (done) {
blobService.acquireLease(containerName, null, function (leaseError, lease, leaseResponse) {
assert.equal(leaseError, null);
assert.notEqual(lease, null);
assert.ok(lease.id);
assert.notEqual(lease.etag, null);
assert.notEqual(lease.lastModified, null);
assert.notEqual(leaseResponse, null);
assert.ok(leaseResponse.isSuccessful);
var metadata = { 'class': 'test' };
var options = { 'leaseId' : lease.id};
blobService.setContainerMetadata(containerName, metadata, options, function (setMetadataError, setMetadataResult, setMetadataResponse) {
assert.equal(setMetadataError, null);
assert.notEqual(setMetadataResult.etag, null);
assert.ok(setMetadataResponse.isSuccessful);
blobService.getContainerMetadata(containerName, options, function (getMetadataError, containerMetadata, getMetadataResponse) {
assert.equal(getMetadataError, null);
assert.notEqual(containerMetadata, null);
assert.notEqual(containerMetadata.metadata, null);
if (containerMetadata.metadata) {
assert.equal(containerMetadata.metadata['class'], 'test');
}
assert.ok(getMetadataResponse.isSuccessful);
blobService.breakLease(containerName, null, {leaseBreakPeriod: 0}, function(leaseError){
assert.equal(leaseError, null);
blobService.deleteContainer(containerName, function (deleteError) {
assert.equal(deleteError, null);
done();
});
});
});
});
});
});
});
describe('setContainerMetadataThrows', function () {
it('should work', function (done) {
function setContainerMetadata(containerName, metadata) {
blobService.setContainerMetadata(containerName, metadata, function(){});
}
assert.throws( function() { setContainerMetadata(containerName, {'' : 'value1'}); },
function (err) {return (err instanceof Error) && err.message === SR.METADATA_KEY_INVALID});
assert.throws( function() { setContainerMetadata(containerName, {' ' : 'value1'}); },
function (err) {return (err instanceof Error) && err.message === SR.METADATA_KEY_INVALID});
assert.throws( function() { setContainerMetadata(containerName, {'\n\t' : 'value1'}); },
function (err) {return (err instanceof Error) && err.message === SR.METADATA_KEY_INVALID});
assert.throws( function() { setContainerMetadata(containerName, {'key1' : null}); },
function (err) {return (err instanceof Error) && err.message === SR.METADATA_VALUE_INVALID});
assert.throws( function() { setContainerMetadata(containerName, {'key1' : ''}); },
function (err) {return (err instanceof Error) && err.message === SR.METADATA_VALUE_INVALID});
assert.throws( function() { setContainerMetadata(containerName, {'key1' : '\n\t'}); },
function (err) {return (err instanceof Error) && err.message === SR.METADATA_VALUE_INVALID});
assert.throws( function() { setContainerMetadata(containerName, {'key1' : ' '}); },
function (err) {return (err instanceof Error) && err.message === SR.METADATA_VALUE_INVALID});
// test that empty headers can be got.
var callback = function(webresource) {
webresource.headers['x-ms-meta-key1'] = '';
};
blobService.on('sendingRequestEvent', callback);
blobService.setContainerMetadata(containerName, {}, function(setMetadataError) {
assert.equal(setMetadataError, null);
blobService.getContainerProperties(containerName, function(getContainerPropsError, properties) {
assert.equal(getContainerPropsError, null);
assert.equal(properties.metadata['key1'], '');
done();
});
});
});
});
describe('getContainerAcl', function () {
it('should work', function (done) {
blobService.getContainerAcl(containerName, function (containerAclError, containerBlob, containerAclResponse) {
assert.equal(containerAclError, null);
assert.notEqual(containerBlob, null);
if (containerBlob) {
assert.equal(containerBlob.publicAccessLevel, BlobUtilities.BlobContainerPublicAccessType.OFF);
}
assert.equal(containerAclResponse.isSuccessful, true);
blobService.deleteContainer(containerName, function (deleteError) {
assert.equal(deleteError, null);
done();
});
});
});
});
describe('setContainerAcl', function () {
it('should work', function (done) {
var blobServiceAnonymous = azure.createBlobServiceAnonymous(blobService.host.primaryHost)
.withFilter(new azure.ExponentialRetryPolicyFilter());
var blobName = suite.getName(blobNamesPrefix);
var blobText = 'Hello World!';
blobService.createBlockBlobFromText(containerName, blobName, blobText, function (err) {
assert.equal(err, null);
var options = {publicAccessLevel: BlobUtilities.BlobContainerPublicAccessType.BLOB};
blobService.setContainerAcl(containerName, null, options, function (setAclError, setAclContainer1, setResponse1) {
assert.equal(setAclError, null);
assert.notEqual(setAclContainer1, null);
assert.ok(setResponse1.isSuccessful);
setTimeout(function () {
blobService.getContainerAcl(containerName, function (getAclError, getAclContainer1, getResponse1) {
assert.equal(getAclError, null);
assert.notEqual(getAclContainer1, null);
assert.equal(getAclContainer1.publicAccessLevel, BlobUtilities.BlobContainerPublicAccessType.BLOB);
assert.ok(getResponse1.isSuccessful);
blobServiceAnonymous.getBlobToText(containerName, blobName, function(createBlobError, blobTextResponse, blockBlob, getBlobResponse) {
assert.equal(setAclError, null);
assert.notEqual(blockBlob, null);
assert.ok(getBlobResponse.isSuccessful);
assert.equal(blobTextResponse, blobText);
options.publicAccessLevel = BlobUtilities.BlobContainerPublicAccessType.CONTAINER;
blobService.setContainerAcl(containerName, null, options, function (setAclError2, setAclContainer2, setResponse2) {
assert.equal(setAclError2, null);
assert.notEqual(setAclContainer2, null);
assert.ok(setResponse2.isSuccessful);
setTimeout(function () {
blobService.getContainerAcl(containerName, function (getAclError2, getAclContainer2, getResponse3) {
assert.equal(getAclError2, null);
assert.notEqual(getAclContainer2, null);
assert.equal(getAclContainer2.publicAccessLevel, BlobUtilities.BlobContainerPublicAccessType.CONTAINER);
assert.ok(getResponse3.isSuccessful);
blobServiceAnonymous.getBlobToText(containerName, blobName, function(createBlobError2, blobTextResponse2, blockBlob2, getBlobResponse2) {
assert.equal(setAclError2, null);
assert.notEqual(blockBlob2, null);
assert.ok(getBlobResponse2.isSuccessful);
assert.equal(blobTextResponse2, blobText);
blobService.deleteBlobIfExists(containerName, blobName, function(error) {
assert.equal(error, null);
done();
});
});
});
}, timeout);
});
});
});
}, timeout);
});
});
});
it('should work with policies', function (done) {
var readWriteStartDate = new Date(Date.UTC(2012, 10, 10));
var readWriteExpiryDate = new Date(readWriteStartDate);
readWriteExpiryDate.setMinutes(readWriteStartDate.getMinutes() + 10);
readWriteExpiryDate.setMilliseconds(999);
var readWriteSharedAccessPolicy = {
Id: 'readwrite',
AccessPolicy: {
Start: readWriteStartDate,
Expiry: readWriteExpiryDate,
Permissions: 'rw'
}
};
var readSharedAccessPolicy = {
Id: 'read',
AccessPolicy: {
Expiry: readWriteStartDate,
Permissions: 'r'
}
};
var options = { publicAccessLevel: BlobUtilities.BlobContainerPublicAccessType.BLOB };
var signedIdentifiers = [readWriteSharedAccessPolicy, readSharedAccessPolicy];
blobService.setContainerAcl(containerName, signedIdentifiers, options, function (setAclError, setAclContainer1, setResponse1) {
assert.equal(setAclError, null);
assert.notEqual(setAclContainer1, null);
assert.ok(setResponse1.isSuccessful);
setTimeout(function () {
blobService.getContainerAcl(containerName, function (getAclError, getAclContainer1, getResponse1) {
assert.equal(getAclError, null);
assert.notEqual(getAclContainer1, null);
assert.equal(getAclContainer1.publicAccessLevel, BlobUtilities.BlobContainerPublicAccessType.BLOB);
assert.equal(getAclContainer1.signedIdentifiers[0].AccessPolicy.Expiry.getTime(), readWriteExpiryDate.getTime());
assert.ok(getResponse1.isSuccessful);
options.publicAccessLevel = BlobUtilities.BlobContainerPublicAccessType.CONTAINER;
blobService.setContainerAcl(containerName, null, options, function (setAclError2, setAclContainer2, setResponse2) {
assert.equal(setAclError2, null);
assert.notEqual(setAclContainer2, null);
assert.ok(setResponse2.isSuccessful);
setTimeout(function () {
blobService.getContainerAcl(containerName, function (getAclError2, getAclContainer2, getResponse3) {
assert.equal(getAclError2, null);
assert.notEqual(getAclContainer2, null);
assert.equal(getAclContainer2.publicAccessLevel, BlobUtilities.BlobContainerPublicAccessType.CONTAINER);
assert.ok(getResponse3.isSuccessful);
done();
});
}, timeout);
});
});
}, timeout);
});
});
it('should work with signed identifiers', function (done) {
var signedIdentifiers = [
{ Id: 'id1',
AccessPolicy: {
Start: '2009-10-10T00:00:00.123Z',
Expiry: '2009-10-11T00:00:00.456Z',
Permissions: 'r'
}
},
{ Id: 'id2',
AccessPolicy: {
Start: '2009-11-10T00:00:00.006Z',
Expiry: '2009-11-11T00:00:00.4Z',
Permissions: 'w'
}
}];
var options = {publicAccessLevel: BlobUtilities.BlobContainerPublicAccessType.OFF};
blobService.setContainerAcl(containerName, signedIdentifiers, options, function (setAclError, setAclContainer, setAclResponse) {
assert.equal(setAclError, null);
assert.notEqual(setAclContainer, null);
assert.ok(setAclResponse.isSuccessful);
setTimeout(function () {
blobService.getContainerAcl(containerName, function (getAclError, containerAcl, getAclResponse) {
assert.equal(getAclError, null);
assert.notEqual(containerAcl, null);
assert.notEqual(getAclResponse, null);
if (getAclResponse) {
assert.equal(getAclResponse.isSuccessful, true);
}
var entries = 0;
containerAcl.signedIdentifiers.forEach(function (identifier) {
if (identifier.Id === 'id1') {
assert.equal(identifier.AccessPolicy.Start.getTime(), new Date('2009-10-10T00:00:00.123Z').getTime());
assert.equal(identifier.AccessPolicy.Expiry.getTime(), new Date('2009-10-11T00:00:00.456Z').getTime());
assert.equal(identifier.AccessPolicy.Permissions, 'r');
entries += 1;
}
else if (identifier.Id === 'id2') {
assert.equal(identifier.AccessPolicy.Start.getTime(), new Date('2009-11-10T00:00:00.006Z').getTime());
assert.equal(identifier.AccessPolicy.Start.getMilliseconds(), 6);
assert.equal(identifier.AccessPolicy.Expiry.getTime(), new Date('2009-11-11T00:00:00.4Z').getTime());
assert.equal(identifier.AccessPolicy.Expiry.getMilliseconds(), 400);
assert.equal(identifier.AccessPolicy.Permissions, 'w');
entries += 2;
}
});
assert.equal(entries, 3);
done();
});
}, timeout);
});
});
});
describe('listBlobs', function () {
it('should work', function (done) {
var blobName1 = suite.getName(blobNamesPrefix);
var blobName2 = suite.getName(blobNamesPrefix);
var blobText1 = 'hello1';
var blobText2 = 'hello2';
blobs.length = 0;
var listBlobsWithoutPrefix = function (options, token, callback) {
blobService.listBlobsSegmented(containerName, token, options, function(error, result) {
assert.equal(error, null);
blobs.push.apply(blobs, result.entries);
var token = result.continuationToken;
if(token) {
listBlobsWithoutPrefix(options, token, callback);
}
else {
callback();
}
});
};
listBlobsWithoutPrefix(null, null, function() {
assert.equal(blobs.length, 0);
blobService.createBlockBlobFromText(containerName, blobName1, blobText1, function (blobErr1) {
assert.equal(blobErr1, null);
// Test listing 1 blob
listBlobsWithoutPrefix(null, null, function() {
assert.equal(blobs.length, 1);
assert.equal(blobs[0].name, blobName1);
blobService.createBlockBlobFromText(containerName, blobName2, blobText2, function (blobErr2) {
assert.equal(blobErr2, null);
blobs.length = 0;
// Test listing multiple blobs
listBlobsWithoutPrefix(null, null, function() {
assert.equal(blobs.length, 2);
var entries = 0;
blobs.forEach(function (blob) {
if (blob.name === blobName1) {
entries += 1;
}
else if (blob.name === blobName2) {
entries += 2;
}
});
assert.equal(entries, 3);
blobService.createBlobSnapshot(containerName, blobName1, function (snapErr) {
assert.equal(snapErr, null);
blobs.length = 0;
// Test listing without requesting snapshots
listBlobsWithoutPrefix(null, null, function() {
assert.equal(blobs.length, 2);
var options = {
include: BlobUtilities.BlobListingDetails.SNAPSHOTS,
maxResults: 2
};
blobs.length = 0;
// Test listing including snapshots
listBlobsWithoutPrefix(options, null, function() {
assert.equal(blobs.length, 3);
blobService.deleteContainer(containerName, function (deleteError) {
assert.equal(deleteError, null);
done();
});
});
});
});
});
});
});
});
});
});
it('should work with prefix', function(done) {
var blobName1 = suite.getName(blobNamesPrefix);
var blobName2 = suite.getName(blobNamesPrefix);
var blobText1 = 'hello1';
var blobText2 = 'hello2';
blobs.length = 0;
listBlobs(null, null, null, function() {
assert.equal(blobs.length, 0);
blobService.createBlockBlobFromText(containerName, blobName1, blobText1, function (blobErr1) {
assert.equal(blobErr1, null);
// Test listing 1 blob
listBlobs(null, null, null, function() {
assert.equal(blobs.length, 1);
assert.equal(blobs[0].name, blobName1);
blobService.createBlockBlobFromText(containerName, blobName2, blobText2, function (blobErr2) {
assert.equal(blobErr2, null);
blobs.length = 0;
// Test listing multiple blobs with prefix
listBlobs(blobName1, null, null, function() {
assert.equal(blobs.length, 1);
blobService.createBlobSnapshot(containerName, blobName1, function (snapErr) {
assert.equal(snapErr, null);
blobs.length = 0;
// Test listing without requesting snapshots
listBlobs(null, null, null, function() {
assert.equal(blobs.length, 2);
var options = {
include: BlobUtilities.BlobListingDetails.SNAPSHOTS
};
blobs.length = 0;
// Test listing with prefix and including snapshots
listBlobs(blobName1, options, null, function() {
assert.equal(blobs.length, 2);
blobService.deleteContainer(containerName, function (deleteError) {
assert.equal(deleteError, null);
done();
});
});
});
});
});
});
});
});
});
});
});
describe('listBlobDirectories', function () {
it('should list blob directories', function (done) {
var blobPrefix1 = suite.getName(blobNamesPrefix) + '/';
var blobPrefix2 = blobPrefix1 + suite.getName(blobNamesPrefix) + '/';
var blobName1 = blobPrefix1 + suite.getName(blobNamesPrefix);
var blobName2 = blobPrefix2 + suite.getName(blobNamesPrefix);
var blobText1 = 'hello1';
var blobText2 = 'hello2';
blobs.length = 0;
listBlobDirectoriesWithoutPrefix(null, null, function() {
assert.equal(blobs.length, 0);
blobService.createBlockBlobFromText(containerName, blobName1, blobText1, function (blobErr1) {
assert.equal(blobErr1, null);
listBlobDirectoriesWithoutPrefix(null, null, function() {
assert.equal(blobs.length, 1);
assert.equal(blobs[0].name, blobPrefix1);
blobService.createBlockBlobFromText(containerName, blobName2, blobText2, function (blobErr2) {
assert.equal(blobErr2, null);
blobs.length = 0;
listBlobDirectoriesWithoutPrefix(null, null, function() {
assert.equal(blobs.length, 1);
var prefix = blobs[0].name;
blobs.length = 0;
listBlobDirectoriesWithPrefix(prefix, null, null, function() {
assert.equal(blobs.length, 1);
assert.equal(blobs[0].name, blobPrefix2);
prefix = blobs[0].name;
blobs.length = 0;
listBlobs(prefix, null, null, function (blobErr) {
assert.equal(blobErr, null);
assert.equal(blobs.length, 1);
assert.equal(blobs[0].name, blobName2);
done();
})
});
});
});
});
});
});
});
it('should list blob directories with prefix', function (done) {
var blobPrefix1 = suite.getName(blobNamesPrefix) + '/';
var blobPrefix2 = blobPrefix1 + suite.getName(blobNamesPrefix) + '/';
var blobPrefix3 = blobPrefix1 + suite.getName(blobNamesPrefix) + '/';
var blobName1 = blobPrefix1 + suite.getName(blobNamesPrefix);
var blobName2 = blobPrefix2 + suite.getName(blobNamesPrefix);
var blobName3 = blobPrefix3 + suite.getName(blobNamesPrefix);
var blobText1 = 'hello1';
var blobText2 = 'hello2';
var blobText3 = 'hello3';
blobs.length = 0;
var prefix = blobPrefix1.slice(0, -1);
listBlobDirectoriesWithPrefix(prefix, null, null, function() {
assert.equal(blobs.length, 0);
blobService.createBlockBlobFromText(containerName, blobName1, blobText1, function (blobErr1) {
assert.equal(blobErr1, null);
listBlobDirectoriesWithPrefix(prefix, null, null, function() {
assert.equal(blobs.length, 1);
assert.equal(blobs[0].name, blobPrefix1);
blobService.createBlockBlobFromText(containerName, blobName2, blobText2, function (blobErr2) {
assert.equal(blobErr2, null);
blobService.createBlockBlobFromText(containerName, blobName3, blobText3, function (blobErr3) {
assert.equal(blobErr3, null);
blobs.length = 0;
listBlobDirectoriesWithPrefix(blobPrefix1, null, null, function() {
assert.equal(blobs.length, 2);
var prefix = blobs[1].name.slice(0, -1);
blobs.length = 0;
listBlobDirectoriesWithPrefix(prefix, null, null, function() {
assert.equal(blobs.length, 1);
assert.equal(blobs[0].name, blobPrefix3);
prefix = blobs[0].name;
blobs.length = 0;
listBlobs(prefix, null, null, function (blobErr) {
assert.equal(blobErr, null);
assert.equal(blobs.length, 1);
assert.equal(blobs[0].name, blobName3);
done();
});
});
});
});
});
});
});
});
});
});
});
function listBlobs (prefix, options, token, callback) {
blobService.listBlobsSegmentedWithPrefix(containerName, prefix, token, options, function(error, result) {
assert.equal(error, null);
blobs.push.apply(blobs, result.entries);
var token = result.continuationToken;
if(token) {
listBlobs(prefix, options, token, callback);
}
else {
callback();
}
});
}
function listBlobDirectoriesWithPrefix(prefix, options, token, callback) {
blobService.listBlobDirectoriesSegmentedWithPrefix(containerName, prefix, token, options, function(error, result) {
assert.equal(error, null);
blobs.push.apply(blobs, result.entries);
var token = result.continuationToken;
if(token) {
listBlobDirectoriesWithPrefix(prefix, options, token, callback);
}
else {
callback();
}
});
}
function listBlobDirectoriesWithoutPrefix(options, token, callback) {
blobService.listBlobDirectoriesSegmented(containerName, token, options, function(error, result) {
assert.equal(error, null);
blobs.push.apply(blobs, result.entries);
var token = result.continuationToken;
if(token) {
listBlobDirectoriesWithoutPrefix(options, token, callback);
}
else {
callback();
}
});
}
| {
"content_hash": "3b2fc9d17a1d5d00265c76ba4664a2ad",
"timestamp": "",
"source": "github",
"line_count": 891,
"max_line_length": 159,
"avg_line_length": 39.515151515151516,
"alnum_prop": 0.6078732106339468,
"repo_name": "aarontract/azure-storage-node",
"id": "8888aa82186289e71c71d68eea68e35877016fe6",
"size": "35842",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "test/services/blob/blobservice-container-tests.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "2869225"
}
],
"symlink_target": ""
} |
from __future__ import absolute_import, division, print_function
import warnings
import datashape
from datashape import String, DataShape, Option, bool_
from odo.utils import copydoc
from .expressions import schema_method_list, ElemWise
from .arithmetic import Interp, Repeat, _mkbin, repeat, interp, _add, _radd
from ..compatibility import basestring, _inttypes, builtins
from ..deprecation import deprecated
__all__ = ['Like',
'like',
'Pad',
'Replace',
'SliceReplace',
# prevent 'len' to end up in global namespace
#'len',
'upper',
'lower',
'cat',
'isalnum',
'isalpha',
'isdecimal',
'isdigit',
'islower',
'isnumeric',
'isspace',
'istitle',
'isupper',
'StrCat',
'find',
'StrFind',
'StrSlice',
'slice',
'slice_replace',
'replace',
'capitalize',
'strip',
'lstrip',
'rstrip',
'pad',
'UnaryStringFunction']
def _validate(var, name, type, typename):
if not isinstance(var, type):
raise TypeError('"%s" argument must be a %s'%(name, typename))
def _validate_optional(var, name, type, typename):
if var is not None and not isinstance(var, type):
raise TypeError('"%s" argument must be a %s'%(name, typename))
class Like(ElemWise):
""" Filter expression by string comparison
>>> from blaze import symbol, like, compute
>>> t = symbol('t', 'var * {name: string, city: string}')
>>> expr = t[t.name.like('Alice*')]
>>> data = [('Alice Smith', 'New York'),
... ('Bob Jones', 'Chicago'),
... ('Alice Walker', 'LA')]
>>> list(compute(expr, data))
[('Alice Smith', 'New York'), ('Alice Walker', 'LA')]
"""
_arguments = '_child', 'pattern'
def _dshape(self):
shape, schema = self._child.dshape.shape, self._child.schema
schema = Option(bool_) if isinstance(schema.measure, Option) else bool_
return DataShape(*(shape + (schema,)))
@copydoc(Like)
def like(child, pattern):
if not isinstance(pattern, basestring):
raise TypeError('pattern argument must be a string')
return Like(child, pattern)
class UnaryStringFunction(ElemWise):
"""String function that only takes a single argument.
"""
_arguments = '_child',
class len(UnaryStringFunction):
schema = datashape.int64
class upper(UnaryStringFunction):
@property
def schema(self):
return self._child.schema
class lower(UnaryStringFunction):
@property
def schema(self):
return self._child.schema
class PredicateFunction(UnaryStringFunction):
@property
def schema(self):
return bool_ if self._child.schema == datashape.string else Option(bool_)
class isalnum(PredicateFunction): pass
class isalpha(PredicateFunction): pass
class isdecimal(PredicateFunction): pass
class isdigit(PredicateFunction): pass
class islower(PredicateFunction): pass
class isnumeric(PredicateFunction): pass
class isspace(PredicateFunction): pass
class istitle(PredicateFunction): pass
class isupper(PredicateFunction): pass
class StrFind(ElemWise):
"""
Find literal substring in string column.
"""
_arguments = '_child', 'sub'
schema = Option(datashape.int64)
@copydoc(StrFind)
def find(col, sub):
if not isinstance(sub, basestring):
raise TypeError("'sub' argument must be a String")
return StrFind(col, sub)
class Replace(ElemWise):
_arguments = '_child', 'old', 'new', 'max'
@property
def schema(self):
return self._child.schema
def replace(col, old, new, max=None):
_validate(old, 'old', basestring, 'string')
_validate(new, 'new', basestring, 'string')
_validate_optional(max, 'max', int, 'integer')
return Replace(col, old, new, max)
class Pad(ElemWise):
_arguments = '_child', 'width', 'side', 'fillchar'
@property
def schema(self):
return self._child.schema
def pad(col, width, side=None, fillchar=None):
_validate(width, 'width', int, 'integer')
if side not in (None, 'left', 'right'):
raise TypeError('"side" argument must be either "left" or "right"')
_validate_optional(fillchar, 'fillchar', basestring, 'string')
return Pad(col, width, side, fillchar)
class capitalize(UnaryStringFunction):
@property
def schema(self):
return self._child.schema
class strip(UnaryStringFunction):
@property
def schema(self):
return self._child.schema
class lstrip(UnaryStringFunction):
@property
def schema(self):
return self._child.schema
class rstrip(UnaryStringFunction):
@property
def schema(self):
return self._child.schema
class StrSlice(ElemWise):
_arguments = '_child', 'slice'
@property
def schema(self):
return self._child.schema
class SliceReplace(ElemWise):
_arguments = '_child', 'start', 'stop', 'repl'
@property
def schema(self):
return self._child.schema
def slice_replace(col, start=None, stop=None, repl=None):
_validate_optional(start, 'start', int, 'integer')
_validate_optional(stop, 'stop', int, 'integer')
_validate_optional(repl, 'repl', basestring, 'string')
return SliceReplace(col, start, stop, repl)
@copydoc(StrSlice)
def slice(col, idx):
if not isinstance(idx, (builtins.slice, _inttypes)):
raise TypeError("idx argument must be a slice or integer, given {}".format(slc))
return StrSlice(col, (idx.start, idx.stop, idx.step) if isinstance(idx, builtins.slice) else idx)
class StrCat(ElemWise):
"""
Concatenate two string columns together with optional 'sep' argument.
>>> import pandas as pd
>>> from blaze import symbol, compute, dshape
>>> ds = dshape('3 * {name: ?string, comment: ?string, num: int32}')
>>> s = symbol('s', dshape=ds)
>>> data = [('al', 'good', 0), ('suri', 'not good', 1), ('jinka', 'ok', 2)]
>>> df = pd.DataFrame(data, columns=['name', 'comment', 'num'])
>>> compute(s.name.str.cat(s.comment, sep=' -- '), df)
0 al -- good
1 suri -- not good
2 jinka -- ok
Name: name, dtype: object
For rows with null entries, it returns null. This is consistent with
default pandas behavior with kwarg: na_rep=None.
>>> data = [(None, None, 0), ('suri', 'not good', 1), ('jinka', None, 2)]
>>> df = pd.DataFrame(data, columns=['name', 'comment', 'num'])
>>> compute(s.name.str.cat(s.comment, sep=' -- '), df)
0 NaN
1 suri -- not good
2 NaN
Name: name, dtype: object
"""
_arguments = 'lhs', 'rhs', 'sep'
_input_attributes = 'lhs', 'rhs'
def _dshape(self):
'''
since pandas supports concat for string columns, do the same for blaze
'''
shape = self.lhs.dshape.shape
if isinstance(self.lhs.schema.measure, Option):
schema = self.lhs.schema
elif isinstance(self.rhs.schema.measure, Option):
schema = self.rhs.schema
else:
_, lhs_encoding = self.lhs.schema.measure.parameters
_, rhs_encoding = self.rhs.schema.measure.parameters
assert lhs_encoding == rhs_encoding
# convert fixed length string to variable length string
schema = DataShape(String(None, lhs_encoding))
return DataShape(*(shape + (schema,)))
@copydoc(StrCat)
def cat(lhs, rhs, sep=None):
"""
returns lhs + sep + rhs
Raises:
Invoking on a non string column raises a TypeError
If kwarg 'sep' is not a string, raises a TypeError
"""
# pandas supports concat for string columns only, do the same for blaze
if not isstring(rhs.dshape):
raise TypeError("can only concat string columns")
_validate_optional(sep, 'sep', basestring, 'string')
return StrCat(lhs, rhs, sep=sep)
def isstring(ds):
measure = ds.measure
return isinstance(getattr(measure, 'ty', measure), String)
_mod, _rmod = _mkbin('mod', Interp)
_mul, _rmul = _mkbin('mul', Repeat)
class str_ns(object):
def __init__(self, field):
self.field = field
def upper(self): return upper(self.field)
def lower(self): return lower(self.field)
def len(self): return len(self.field)
def like(self, pattern): return like(self.field, pattern)
def cat(self, other, sep=None): return cat(self.field, other, sep=sep)
def find(self, sub): return find(self.field, sub)
def isalnum(self): return isalnum(self.field)
def isalpha(self): return isalpha(self.field)
def isdecimal(self): return isdecimal(self.field)
def isdigit(self): return isdigit(self.field)
def islower(self): return islower(self.field)
def isnumeric(self): return isnumeric(self.field)
def isspace(self): return isspace(self.field)
def istitle(self): return istitle(self.field)
def isupper(self): return isupper(self.field)
def replace(self, old, new, max=None): return replace(self.field, old, new, max)
def capitalize(self): return capitalize(self.field)
def pad(self, width, side=None, fillchar=None): return pad(self.field, width, side, fillchar)
def strip(self): return strip(self.field)
def lstrip(self): return lstrip(self.field)
def rstrip(self): return rstrip(self.field)
def __getitem__(self, idx): return slice(self.field, idx)
def slice_replace(self, start=None, stop=None, repl=None):
return slice_replace(self.field, start, stop, repl)
class str(object):
__name__ = 'str'
def __get__(self, obj, type):
return str_ns(obj) if obj is not None else self
@deprecated('0.11', replacement='len()')
def str_len(*args, **kwds): return len(*args, **kwds)
@deprecated('0.11', replacement='upper()')
def str_upper(*args, **kwds): return upper(*args, **kwds)
@deprecated('0.11', replacement='lower()')
def str_lower(*args, **kwds): return lower(*args, **kwds)
@deprecated('0.11', replacement='cat(lhs, rhs, sep=None)')
def str_cat(*args, **kwds): return cat(*args, **kwds)
schema_method_list.extend([(isstring,
set([_add,
_radd,
_mod,
_rmod,
_mul,
_rmul,
str(),
repeat,
interp,
like,
str_len, # deprecated
str_upper, # deprecated
str_lower, # deprecated
str_cat]))]) # deprecated
| {
"content_hash": "7191fe506633296ea0bdebeb53fbfdbc",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 101,
"avg_line_length": 30.14364640883978,
"alnum_prop": 0.5998900293255132,
"repo_name": "ContinuumIO/blaze",
"id": "34b8a8b4263fb61c09bd65d2026b080fc3fd50cd",
"size": "10912",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "blaze/expr/strings.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "37"
},
{
"name": "Python",
"bytes": "862729"
},
{
"name": "Shell",
"bytes": "35"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>circuits: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / extra-dev</a></li>
<li class="active"><a href="">dev / circuits - 8.6.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
circuits
<small>
8.6.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-05-14 08:21:45 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-14 08:21:45 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq dev Formal proof management system
dune 3.1.1 Fast, portable, and opinionated build system
ocaml 4.12.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.12.1 Official release 4.12.1
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/circuits"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Circuits"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.7~"}
]
tags: [ "keyword: hardware verification" "category: Computer Science/Architecture" ]
authors: [ "Laurent Arditi" ]
bug-reports: "https://github.com/coq-contribs/circuits/issues"
dev-repo: "git+https://github.com/coq-contribs/circuits.git"
synopsis: "Some proofs of hardware (adder, multiplier, memory block instruction)"
description: """
definition and proof of a combinatorial adder, a
sequential multiplier, a memory block instruction"""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/circuits/archive/v8.6.0.tar.gz"
checksum: "md5=b9ba5f4874f9845c96a9e72e12df3f32"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-circuits.8.6.0 coq.dev</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is dev).
The following dependencies couldn't be met:
- coq-circuits -> coq < 8.7~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-circuits.8.6.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "abbbd2d3f3ab5e3fcd61eaa5b2cae9a7",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 159,
"avg_line_length": 42.16167664670659,
"alnum_prop": 0.543956824314728,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "6a8be6fe7ff4e48f4bcf0a71f6788bcb8714be56",
"size": "7066",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.12.1-2.0.8/extra-dev/dev/circuits/8.6.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
module SplitUtil where
import DataStructures
data ColumnsData = ColumnsData{text::String, width::Int, height::Int}
-- naive implementation to start with
stupidSlicer i s = ( take i s, drop i s )
split :: (String -> (Line, String) ) -> String -> [Line]
split _ "" = []
split sl x = line : split sl rest
where (line, rest) = sl x
toDocument :: Int -> [Line] -> Document
toDocument _ [] = []
toDocument i ls = col : toDocument i rest
where col = take i ls
rest = drop i ls
document :: Int -> Int -> String -> Document
document lineLength lines = toDocument lines . split (stupidSlicer lineLength)
| {
"content_hash": "a16aefeccdfe416268b44bea75dacea1",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 78,
"avg_line_length": 26.48,
"alnum_prop": 0.6178247734138973,
"repo_name": "axelGschaider/ttofu",
"id": "b4a942c357986b2e7e9250c7a46b00e6378d03df",
"size": "662",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/SplitUtil.hs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Haskell",
"bytes": "1029"
},
{
"name": "Ruby",
"bytes": "124"
}
],
"symlink_target": ""
} |
#include "mex.h"
#include "RigidBodyConstraint.h"
#include "drakeUtil.h"
#include "../RigidBodyManipulator.h"
#include <cstring>
/*
* [type,num_constraint,constraint_val,dconstraint_val,constraint_name,lower_bound,upper_bound] = testSingleTimeKinCnstmex(kinCnst_ptr,q,t)
* @param kinCnst_ptr A pointer to a SingleTimeKinematicConstraint object
* @param q A nqx1 double vector
* @param t A double scalar, the time to evaluate constraint value, bounds and name. This is optional.
* @retval type The type of the constraint
* @retval num_constraint The number of constraint active at time t
* @retval constraint_val The value of the constraint at time t
* @retval dconstraint_val The gradient of the constraint w.r.t q at time t
* @retval constraint_name The name of the constraint at time t
* @retval lower_bound The lower bound of the constraint at time t
* @retval upper_bound The upper bound of the constraint at time t
* */
void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
{
if((nrhs!=3 && nrhs != 2)||nlhs != 7)
{
mexErrMsgIdAndTxt("Drake:testSingleTimeKinCnstmex:BadInputs","Usage [type, num_cnst,cnst_val,dcnst_val,cnst_name,lb,ub] = testSingleTimeKinKinCnstmex(kinCnst,q,t)");
}
SingleTimeKinematicConstraint* cnst = (SingleTimeKinematicConstraint*) getDrakeMexPointer(prhs[0]);
double* t_ptr;
if(nrhs == 2)
{
t_ptr = nullptr;
}
else
{
int num_t = mxGetNumberOfElements(prhs[2]);
if(num_t == 0)
{
t_ptr = nullptr;
}
if(num_t == 1)
{
t_ptr = mxGetPrSafe(prhs[2]);
}
if(num_t>1)
{
mexErrMsgIdAndTxt("Drake:testSingleTimeKinCnstmex:BadInputs","t must be either empty or a single number");
}
}
int type = cnst->getType();
int num_cnst = cnst->getNumConstraint(t_ptr);
//mexPrintf("num_cnst = %d\n",num_cnst);
int nq = cnst->getRobotPointer()->num_positions;
Map<VectorXd> q(mxGetPrSafe(prhs[1]), nq);
cnst->getRobotPointer()->doKinematics(q);
VectorXd c(num_cnst);
MatrixXd dc(num_cnst,nq);
cnst->eval(t_ptr,c,dc);
//mexPrintf("get c,dc\n");
VectorXd lb(num_cnst);
VectorXd ub(num_cnst);
cnst->bounds(t_ptr,lb,ub);
//mexPrintf("get lb, ub\n");
std::vector<std::string> cnst_names;
cnst->name(t_ptr,cnst_names);
//mexPrintf("get name\n");
int retvec_size;
if(num_cnst == 0)
{
retvec_size = 0;
}
else
{
retvec_size = 1;
}
plhs[0] = mxCreateDoubleScalar((double) type);
plhs[1] = mxCreateDoubleScalar((double) num_cnst);
plhs[2] = mxCreateDoubleMatrix(num_cnst,retvec_size,mxREAL);
memcpy(mxGetPrSafe(plhs[2]),c.data(),sizeof(double)*num_cnst);
plhs[3] = mxCreateDoubleMatrix(num_cnst,nq,mxREAL);
memcpy(mxGetPrSafe(plhs[3]),dc.data(),sizeof(double)*num_cnst*nq);
int name_ndim = 1;
mwSize name_dims[] = {(mwSize) num_cnst};
plhs[4] = mxCreateCellArray(name_ndim,name_dims);
mxArray *name_ptr;
for(int i = 0;i<num_cnst;i++)
{
name_ptr = mxCreateString(cnst_names[i].c_str());
mxSetCell(plhs[4],i,name_ptr);
}
plhs[5] = mxCreateDoubleMatrix(num_cnst,retvec_size,mxREAL);
plhs[6] = mxCreateDoubleMatrix(num_cnst,retvec_size,mxREAL);
memcpy(mxGetPrSafe(plhs[5]),lb.data(),sizeof(double)*num_cnst);
memcpy(mxGetPrSafe(plhs[6]),ub.data(),sizeof(double)*num_cnst);
}
| {
"content_hash": "6890d4e51eee711c3f7e57b61c7e1013",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 169,
"avg_line_length": 36.869565217391305,
"alnum_prop": 0.6624410377358491,
"repo_name": "astrorog/drake",
"id": "0afcab0671fecf7169da25eed547d3bceda6537e",
"size": "3392",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "systems/plants/constraint/testSingleTimeKinCnstmex.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "17333"
},
{
"name": "C++",
"bytes": "1554770"
},
{
"name": "CMake",
"bytes": "35878"
},
{
"name": "Java",
"bytes": "29789"
},
{
"name": "M",
"bytes": "20151"
},
{
"name": "Makefile",
"bytes": "3884"
},
{
"name": "Matlab",
"bytes": "4031776"
},
{
"name": "Objective-C",
"bytes": "2758"
},
{
"name": "Perl",
"bytes": "3251"
},
{
"name": "Python",
"bytes": "22706"
},
{
"name": "Shell",
"bytes": "4408"
},
{
"name": "TeX",
"bytes": "2740"
}
],
"symlink_target": ""
} |
namespace ui {
enum class DomCode;
// A KeyboardLayoutEngine provides a platform-independent interface to
// key mapping. Key mapping provides a meaning (DomKey and character,
// and optionally Windows key code) for a physical key press (DomCode
// and modifier flags).
//
// This interface does not expose individual layouts because it must support
// platforms that only provide for one active system layout, and/or platforms
// where layouts have no accessible representation.
class EVENTS_OZONE_LAYOUT_EXPORT KeyboardLayoutEngine {
public:
KeyboardLayoutEngine() {}
virtual ~KeyboardLayoutEngine() {}
// Returns true if it is possible to change the current layout.
virtual bool CanSetCurrentLayout() const = 0;
// Sets the current layout; returns true on success.
// Drop-in replacement for ImeKeyboard::SetCurrentKeyboardLayoutByName();
// the argument string is defined by that interface (crbug.com/362698).
virtual bool SetCurrentLayoutByName(const std::string& layout_name) = 0;
// Returns true if the current layout makes use of the ISO Level 5 Shift key.
// Drop-in replacement for ImeKeyboard::IsISOLevel5ShiftAvailable().
virtual bool UsesISOLevel5Shift() const = 0;
// Returns true if the current layout makes use of the AltGr
// (ISO Level 3 Shift) key.
// Drop-in replacement for ImeKeyboard::IsAltGrAvailable().
virtual bool UsesAltGr() const = 0;
// Provides the meaning of a physical key.
//
// The caller must supply valid addresses for all the output parameters;
// the function must not use their initial values.
//
// Returns true if it can determine the DOM meaning (i.e. ui::DomKey and
// character) and the corresponding (non-located) KeyboardCode from the given
// physical state (ui::DomCode and ui::EventFlags), OR if it can determine
// that there is no meaning in the current layout (e.g. the key is unbound).
// In the latter case, the function sets *dom_key to UNIDENTIFIED, *character
// to 0, and *key_code to VKEY_UNKNOWN.
//
// Returns false if it cannot determine the meaning (and cannot determine
// that there is none); in this case it does not set any of the output
// parameters.
virtual bool Lookup(DomCode dom_code,
int event_flags,
DomKey* dom_key,
KeyboardCode* key_code) const = 0;
};
} // namespace ui
#endif // UI_OZONE_PUBLIC_KEYBOARD_LAYOUT_ENGINE_H_
| {
"content_hash": "4c8130ed41b34d74ef8d236de308bfac",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 79,
"avg_line_length": 42.08620689655172,
"alnum_prop": 0.7189676362146661,
"repo_name": "CapOM/ChromiumGStreamerBackend",
"id": "20cf1d88f1ea69dfe1bd39f579ec076b8b60a316",
"size": "2917",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ui/events/ozone/layout/keyboard_layout_engine.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "37073"
},
{
"name": "Batchfile",
"bytes": "8451"
},
{
"name": "C",
"bytes": "9560486"
},
{
"name": "C++",
"bytes": "246838243"
},
{
"name": "CSS",
"bytes": "943687"
},
{
"name": "DM",
"bytes": "60"
},
{
"name": "Groff",
"bytes": "2494"
},
{
"name": "HTML",
"bytes": "27371019"
},
{
"name": "Java",
"bytes": "15348315"
},
{
"name": "JavaScript",
"bytes": "20872607"
},
{
"name": "Makefile",
"bytes": "70983"
},
{
"name": "Objective-C",
"bytes": "2029825"
},
{
"name": "Objective-C++",
"bytes": "10156554"
},
{
"name": "PHP",
"bytes": "97817"
},
{
"name": "PLpgSQL",
"bytes": "182741"
},
{
"name": "Perl",
"bytes": "63937"
},
{
"name": "Protocol Buffer",
"bytes": "494625"
},
{
"name": "Python",
"bytes": "8594611"
},
{
"name": "Shell",
"bytes": "486464"
},
{
"name": "Standard ML",
"bytes": "5106"
},
{
"name": "XSLT",
"bytes": "418"
},
{
"name": "nesC",
"bytes": "18347"
}
],
"symlink_target": ""
} |
package cn.luo.yuan.maze.model.effect.original;
import cn.luo.yuan.maze.model.effect.Effect;
import cn.luo.yuan.maze.utils.Field;
import cn.luo.yuan.maze.utils.StringUtils;
import java.util.Arrays;
public class AtkPercentEffect extends PercentEffect {
private static final long serialVersionUID = Field.SERVER_VERSION;
public String toString(){
return "增加基础攻击:" + StringUtils.formatPercentage(getValue());
}
@Override
public boolean isReject(Class<? extends Effect> effectClass) {
return effectClass == AgiEffect.class || effectClass == HPPercentEffect.class || effectClass == HpEffect.class || effectClass == DefEffect.class || effectClass == DefPercentEffect.class;
}
}
| {
"content_hash": "9d5f2476496c3673cdca63eb3eb0ee80",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 194,
"avg_line_length": 35.85,
"alnum_prop": 0.7391910739191074,
"repo_name": "luoyuan800/NeverEnd",
"id": "3186faa93c799564860cf255269397b8c76bc033",
"size": "794",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dataModel/src/cn/luo/yuan/maze/model/effect/original/AtkPercentEffect.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "299752"
},
{
"name": "HTML",
"bytes": "86849"
},
{
"name": "Java",
"bytes": "1125483"
},
{
"name": "JavaScript",
"bytes": "81097"
},
{
"name": "Kotlin",
"bytes": "208133"
}
],
"symlink_target": ""
} |
package CH.ifa.draw.figures;
import java.awt.*;
import java.io.IOException;
import java.util.List;
import CH.ifa.draw.util.*;
import CH.ifa.draw.framework.*;
import CH.ifa.draw.standard.*;
/**
* An ellipse figure.
*
* @version <$CURRENT_VERSION$>
*/
public class EllipseFigure extends AttributeFigure {
private Rectangle fDisplayBox;
/*
* Serialization support.
*/
private static final long serialVersionUID = -6856203289355118951L;
private int ellipseFigureSerializedDataVersion = 1;
public EllipseFigure() {
this(new Point(0,0), new Point(0,0));
}
public EllipseFigure(Point origin, Point corner) {
basicDisplayBox(origin,corner);
}
public HandleEnumeration handles() {
List handles = CollectionsFactory.current().createList();
BoxHandleKit.addHandles(this, handles);
return new HandleEnumerator(handles);
}
public void basicDisplayBox(Point origin, Point corner) {
fDisplayBox = new Rectangle(origin);
fDisplayBox.add(corner);
}
public Rectangle displayBox() {
return new Rectangle(
fDisplayBox.x,
fDisplayBox.y,
fDisplayBox.width,
fDisplayBox.height);
}
protected void basicMoveBy(int x, int y) {
fDisplayBox.translate(x,y);
}
public void drawBackground(Graphics g) {
Rectangle r = displayBox();
g.fillOval(r.x, r.y, r.width-1, r.height-1);
}
public void drawFrame(Graphics g) {
Rectangle r = displayBox();
g.drawOval(r.x, r.y, r.width-1, r.height-1);
}
public Insets connectionInsets() {
Rectangle r = fDisplayBox;
int cx = r.width/2;
int cy = r.height/2;
return new Insets(cy, cx, cy, cx);
}
public Connector connectorAt(int x, int y) {
return new ChopEllipseConnector(this);
}
public void write(StorableOutput dw) {
super.write(dw);
dw.writeInt(fDisplayBox.x);
dw.writeInt(fDisplayBox.y);
dw.writeInt(fDisplayBox.width);
dw.writeInt(fDisplayBox.height);
}
public void read(StorableInput dr) throws IOException {
super.read(dr);
fDisplayBox = new Rectangle(
dr.readInt(),
dr.readInt(),
dr.readInt(),
dr.readInt());
}
}
| {
"content_hash": "7be4b275d58ec5d832ef7c4d55250ce0",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 68,
"avg_line_length": 21.63157894736842,
"alnum_prop": 0.7075425790754258,
"repo_name": "mmohan01/ReFactory",
"id": "56555384bf6e9cb6a225447289f0e4343f7560b2",
"size": "2389",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "data/jhotdraw/jhotdraw-5.4b1/CH/ifa/draw/figures/EllipseFigure.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "95"
},
{
"name": "HTML",
"bytes": "18697"
},
{
"name": "Java",
"bytes": "83306379"
}
],
"symlink_target": ""
} |
<?php
/**
* The template for displaying 404 pages (not found).
*
* @link https://codex.wordpress.org/Creating_an_Error_404_Page
*
* @package WPChit
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can’t be found.', 'wpchit' ); ?></h1>
</header>
<div class="page-content">
<p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'wpchit' ); ?></p>
<?php
get_search_form();
the_widget( 'WP_Widget_Recent_Posts' );
// Only show the widget if site has multiple categories.
if ( wpchit_categorized_blog() ) :
?>
<div class="widget widget_categories">
<h2 class="widget-title"><?php esc_html_e( 'Most Used Categories', 'wpchit' ); ?></h2>
<ul>
<?php
wp_list_categories( array(
'orderby' => 'count',
'order' => 'DESC',
'show_count' => 1,
'title_li' => '',
'number' => 10,
) );
?>
</ul>
</div>
<?php
endif;
/* translators: %1$s: smiley */
$archive_content = '<p>' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', 'wpchit' ), convert_smilies( ':)' ) ) . '</p>';
the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=</h2>$archive_content" );
the_widget( 'WP_Widget_Tag_Cloud' );
?>
</div>
</section>
</main>
</div>
<?php
get_footer();
| {
"content_hash": "9e2efce308e4fd31d2c78504b6aa1332",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 146,
"avg_line_length": 27.35,
"alnum_prop": 0.5478366849482024,
"repo_name": "NautHnim/WPChit",
"id": "9b98c312978c796ffe364881caa371e490ef6ff0",
"size": "1641",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "404.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "14802"
},
{
"name": "JavaScript",
"bytes": "12323"
},
{
"name": "PHP",
"bytes": "30612"
}
],
"symlink_target": ""
} |
import logging
import logging.handlers
import sys
from contextlib import contextmanager
from datetime import datetime
from os import getcwd
from os.path import join
LOGGING_FORMAT = '%(asctime)-15s %(levelname)s %(message)s'
DATE_FORMAT = '[%Y-%m-%d %H:%M:%S]'
logger = logging.getLogger()
logger.level = logging.DEBUG
TEN_MB = 10 * (1024 ** 2)
def configure_stream_logger(stream=sys.stdout, level='DEBUG', track_configured_loggers=True):
level = logging.getLevelName(level)
if track_configured_loggers:
for handler in logging.root.handlers:
if isinstance(handler, logging.StreamHandler) and handler.stream == stream \
and handler.level == level:
return
stream_handler = logging.StreamHandler(stream=stream)
stream_handler.level = level
formatter = logging.Formatter(datefmt=DATE_FORMAT, fmt=LOGGING_FORMAT)
stream_handler.setFormatter(formatter)
logging.getLogger().addHandler(stream_handler)
def configure_file_logger(filename='app.log', level='DEBUG', rotate_file=True):
file_path = join(getcwd(), filename)
file_handler = logging.FileHandler(filename=file_path)
file_handler.level = logging.getLevelName(level)
formatter = logging.Formatter(datefmt=DATE_FORMAT, fmt=LOGGING_FORMAT)
file_handler.setFormatter(formatter)
logging.getLogger().addHandler(file_handler)
if rotate_file:
open(file_path, 'w').close()
def configure_file_and_stream_logger(stream=sys.stdout, filename='app.log', level='DEBUG', rotate_file=True):
configure_stream_logger(stream, level)
configure_file_logger(filename, level, rotate_file)
def configure_file_rotate_handler(filename='app.log', level='DEBUG'):
file_path = join(getcwd(), filename)
file_handler = logging.handlers.RotatingFileHandler(filename=file_path,
maxBytes=TEN_MB, backupCount=3)
file_handler.level = logging.getLevelName(level)
formatter = logging.Formatter(datefmt=DATE_FORMAT, fmt=LOGGING_FORMAT)
file_handler.setFormatter(formatter)
logging.getLogger().addHandler(file_handler)
@contextmanager
def timeit():
start_time = datetime.now()
logger.info('START TIME: %s', start_time)
yield
logger.info('TIME SPENT: %s', (datetime.now() - start_time))
def timeit_with_context(context_name):
start_time = datetime.now()
yield
logger.info('TIME SPENT for {}: {}'.format(context_name, datetime.now() - start_time))
| {
"content_hash": "e747b8297a0c0a134b3ae737400d2b6e",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 109,
"avg_line_length": 36.30434782608695,
"alnum_prop": 0.6986027944111777,
"repo_name": "ahcub/armory",
"id": "af37ffecf6290f94bcf64a24c1205d6f168199e6",
"size": "2505",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "os_utils/logging_utils.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "97"
},
{
"name": "Python",
"bytes": "27611"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "2c635ffcebf546cd7161688ab4223258",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "d55faea7e7f971e0735f5e8f464dc01c3bbc79b1",
"size": "191",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Gynoxys fuliginosa/ Syn. Gynoxys fuliginosa fuliginosa/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.apache.carbondata.core.datastorage.store.compression;
import org.apache.carbondata.core.util.ValueCompressionUtil;
public class ValueCompressionModel {
/**
* COMPRESSION_TYPE[] variable.
*/
private ValueCompressionUtil.COMPRESSION_TYPE[] compType;
/**
* DataType[] variable.
*/
private ValueCompressionUtil.DataType[] changedDataType;
/**
* DataType[] variable.
*/
private ValueCompressionUtil.DataType[] actualDataType;
/**
* maxValue
*/
private Object[] maxValue;
/**
* minValue.
*/
private Object[] minValue;
private Object[] minValueFactForAgg;
/**
* uniqueValue
*/
private Object[] uniqueValue;
/**
* decimal.
*/
private int[] decimal;
/**
* aggType
*/
private char[] type;
/**
* dataTypeSelected
*/
private byte[] dataTypeSelected;
/**
* unCompressValues.
*/
private ValueCompressonHolder.UnCompressValue[] unCompressValues;
/**
* @return the compType
*/
public ValueCompressionUtil.COMPRESSION_TYPE[] getCompType() {
return compType;
}
/**
* @param compType the compType to set
*/
public void setCompType(ValueCompressionUtil.COMPRESSION_TYPE[] compType) {
this.compType = compType;
}
/**
* @return the changedDataType
*/
public ValueCompressionUtil.DataType[] getChangedDataType() {
return changedDataType;
}
/**
* @param changedDataType the changedDataType to set
*/
public void setChangedDataType(ValueCompressionUtil.DataType[] changedDataType) {
this.changedDataType = changedDataType;
}
/**
* @return the actualDataType
*/
public ValueCompressionUtil.DataType[] getActualDataType() {
return actualDataType;
}
/**
* @param actualDataType
*/
public void setActualDataType(ValueCompressionUtil.DataType[] actualDataType) {
this.actualDataType = actualDataType;
}
/**
* @return the maxValue
*/
public Object[] getMaxValue() {
return maxValue;
}
/**
* @param maxValue the maxValue to set
*/
public void setMaxValue(Object[] maxValue) {
this.maxValue = maxValue;
}
/**
* @return the decimal
*/
public int[] getDecimal() {
return decimal;
}
/**
* @param decimal the decimal to set
*/
public void setDecimal(int[] decimal) {
this.decimal = decimal;
}
/**
* getUnCompressValues().
*
* @return the unCompressValues
*/
public ValueCompressonHolder.UnCompressValue[] getUnCompressValues() {
return unCompressValues;
}
/**
* @param unCompressValues the unCompressValues to set
*/
public void setUnCompressValues(ValueCompressonHolder.UnCompressValue[] unCompressValues) {
this.unCompressValues = unCompressValues;
}
/**
* getMinValue
*
* @return
*/
public Object[] getMinValue() {
return minValue;
}
/**
* setMinValue.
*
* @param minValue
*/
public void setMinValue(Object[] minValue) {
this.minValue = minValue;
}
/**
* @return the aggType
*/
public char[] getType() {
return type;
}
/**
* @param type the type to set
*/
public void setType(char[] type) {
this.type = type;
}
/**
* @return the dataTypeSelected
*/
public byte[] getDataTypeSelected() {
return dataTypeSelected;
}
/**
* @param dataTypeSelected the dataTypeSelected to set
*/
public void setDataTypeSelected(byte[] dataTypeSelected) {
this.dataTypeSelected = dataTypeSelected;
}
/**
* getUniqueValue
*
* @return
*/
public Object[] getUniqueValue() {
return uniqueValue;
}
/**
* setUniqueValue
*
* @param uniqueValue
*/
public void setUniqueValue(Object[] uniqueValue) {
this.uniqueValue = uniqueValue;
}
/**
* @return the minValueFactForAgg
*/
public Object[] getMinValueFactForAgg() {
return minValueFactForAgg;
}
/**
* @param minValueFactForAgg the minValueFactForAgg to set
*/
public void setMinValueFactForAgg(Object[] minValueFactForAgg) {
this.minValueFactForAgg = minValueFactForAgg;
}
}
| {
"content_hash": "8a49ed27cfef0b3589ba96f7ce882700",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 93,
"avg_line_length": 18.67579908675799,
"alnum_prop": 0.652078239608802,
"repo_name": "foryou2030/incubator-carbondata",
"id": "94cbf194aaf994a3f7436ea4b5b73f265dd02022",
"size": "4898",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/ValueCompressionModel.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "3295958"
},
{
"name": "Scala",
"bytes": "2537650"
},
{
"name": "Shell",
"bytes": "6406"
},
{
"name": "Smalltalk",
"bytes": "86"
},
{
"name": "Thrift",
"bytes": "17576"
}
],
"symlink_target": ""
} |
meta.foundation-version {
font-family: "/5.5.3/"; }
meta.foundation-mq-small {
font-family: "/only screen/";
width: 0; }
meta.foundation-mq-small-only {
font-family: "/only screen and (max-width: 40em)/";
width: 0; }
meta.foundation-mq-medium {
font-family: "/only screen and (min-width:40.0625em)/";
width: 40.0625em; }
meta.foundation-mq-medium-only {
font-family: "/only screen and (min-width:40.0625em) and (max-width:64em)/";
width: 40.0625em; }
meta.foundation-mq-large {
font-family: "/only screen and (min-width:64.0625em)/";
width: 64.0625em; }
meta.foundation-mq-large-only {
font-family: "/only screen and (min-width:64.0625em) and (max-width:90em)/";
width: 64.0625em; }
meta.foundation-mq-xlarge {
font-family: "/only screen and (min-width:90.0625em)/";
width: 90.0625em; }
meta.foundation-mq-xlarge-only {
font-family: "/only screen and (min-width:90.0625em) and (max-width:120em)/";
width: 90.0625em; }
meta.foundation-mq-xxlarge {
font-family: "/only screen and (min-width:120.0625em)/";
width: 120.0625em; }
meta.foundation-data-attribute-namespace {
font-family: false; }
html, body {
height: 100%; }
*,
*:before,
*:after {
box-sizing: border-box; }
html,
body {
font-size: 100%; }
body {
background: #fff;
color: #222;
cursor: auto;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-style: normal;
font-weight: normal;
line-height: 1.5;
margin: 0;
padding: 0;
position: relative; }
a:hover {
cursor: pointer; }
img {
max-width: 100%;
height: auto; }
img {
-ms-interpolation-mode: bicubic; }
#map_canvas img,
#map_canvas embed,
#map_canvas object,
.map_canvas img,
.map_canvas embed,
.map_canvas object,
.mqa-display img,
.mqa-display embed,
.mqa-display object {
max-width: none !important; }
.left {
float: left !important; }
.right {
float: right !important; }
.clearfix:before, .clearfix:after {
content: " ";
display: table; }
.clearfix:after {
clear: both; }
.hide {
display: none; }
.invisible {
visibility: hidden; }
.antialiased {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; }
img {
display: inline-block;
vertical-align: middle; }
textarea {
height: auto;
min-height: 50px; }
select {
width: 100%; }
.row {
margin: 0 auto;
max-width: 62.5rem;
width: 100%; }
.row:before, .row:after {
content: " ";
display: table; }
.row:after {
clear: both; }
.row.collapse > .column,
.row.collapse > .columns {
padding-left: 0;
padding-right: 0; }
.row.collapse .row {
margin-left: 0;
margin-right: 0; }
.row .row {
margin: 0 -0.9375rem;
max-width: none;
width: auto; }
.row .row:before, .row .row:after {
content: " ";
display: table; }
.row .row:after {
clear: both; }
.row .row.collapse {
margin: 0;
max-width: none;
width: auto; }
.row .row.collapse:before, .row .row.collapse:after {
content: " ";
display: table; }
.row .row.collapse:after {
clear: both; }
.column,
.columns {
padding-left: 0.9375rem;
padding-right: 0.9375rem;
width: 100%;
float: left; }
.column + .column:last-child,
.columns + .column:last-child, .column +
.columns:last-child,
.columns +
.columns:last-child {
float: right; }
.column + .column.end,
.columns + .column.end, .column +
.columns.end,
.columns +
.columns.end {
float: left; }
@media only screen {
.small-push-0 {
position: relative;
left: 0;
right: auto; }
.small-pull-0 {
position: relative;
right: 0;
left: auto; }
.small-push-1 {
position: relative;
left: 8.33333%;
right: auto; }
.small-pull-1 {
position: relative;
right: 8.33333%;
left: auto; }
.small-push-2 {
position: relative;
left: 16.66667%;
right: auto; }
.small-pull-2 {
position: relative;
right: 16.66667%;
left: auto; }
.small-push-3 {
position: relative;
left: 25%;
right: auto; }
.small-pull-3 {
position: relative;
right: 25%;
left: auto; }
.small-push-4 {
position: relative;
left: 33.33333%;
right: auto; }
.small-pull-4 {
position: relative;
right: 33.33333%;
left: auto; }
.small-push-5 {
position: relative;
left: 41.66667%;
right: auto; }
.small-pull-5 {
position: relative;
right: 41.66667%;
left: auto; }
.small-push-6 {
position: relative;
left: 50%;
right: auto; }
.small-pull-6 {
position: relative;
right: 50%;
left: auto; }
.small-push-7 {
position: relative;
left: 58.33333%;
right: auto; }
.small-pull-7 {
position: relative;
right: 58.33333%;
left: auto; }
.small-push-8 {
position: relative;
left: 66.66667%;
right: auto; }
.small-pull-8 {
position: relative;
right: 66.66667%;
left: auto; }
.small-push-9 {
position: relative;
left: 75%;
right: auto; }
.small-pull-9 {
position: relative;
right: 75%;
left: auto; }
.small-push-10 {
position: relative;
left: 83.33333%;
right: auto; }
.small-pull-10 {
position: relative;
right: 83.33333%;
left: auto; }
.small-push-11 {
position: relative;
left: 91.66667%;
right: auto; }
.small-pull-11 {
position: relative;
right: 91.66667%;
left: auto; }
.column,
.columns {
position: relative;
padding-left: 0.9375rem;
padding-right: 0.9375rem;
float: left; }
.small-1 {
width: 8.33333%; }
.small-2 {
width: 16.66667%; }
.small-3 {
width: 25%; }
.small-4 {
width: 33.33333%; }
.small-5 {
width: 41.66667%; }
.small-6 {
width: 50%; }
.small-7 {
width: 58.33333%; }
.small-8 {
width: 66.66667%; }
.small-9 {
width: 75%; }
.small-10 {
width: 83.33333%; }
.small-11 {
width: 91.66667%; }
.small-12 {
width: 100%; }
.small-offset-0 {
margin-left: 0 !important; }
.small-offset-1 {
margin-left: 8.33333% !important; }
.small-offset-2 {
margin-left: 16.66667% !important; }
.small-offset-3 {
margin-left: 25% !important; }
.small-offset-4 {
margin-left: 33.33333% !important; }
.small-offset-5 {
margin-left: 41.66667% !important; }
.small-offset-6 {
margin-left: 50% !important; }
.small-offset-7 {
margin-left: 58.33333% !important; }
.small-offset-8 {
margin-left: 66.66667% !important; }
.small-offset-9 {
margin-left: 75% !important; }
.small-offset-10 {
margin-left: 83.33333% !important; }
.small-offset-11 {
margin-left: 91.66667% !important; }
.small-reset-order {
float: left;
left: auto;
margin-left: 0;
margin-right: 0;
right: auto; }
.column.small-centered,
.columns.small-centered {
margin-left: auto;
margin-right: auto;
float: none; }
.column.small-uncentered,
.columns.small-uncentered {
float: left;
margin-left: 0;
margin-right: 0; }
.column.small-centered:last-child,
.columns.small-centered:last-child {
float: none; }
.column.small-uncentered:last-child,
.columns.small-uncentered:last-child {
float: left; }
.column.small-uncentered.opposite,
.columns.small-uncentered.opposite {
float: right; }
.row.small-collapse > .column,
.row.small-collapse > .columns {
padding-left: 0;
padding-right: 0; }
.row.small-collapse .row {
margin-left: 0;
margin-right: 0; }
.row.small-uncollapse > .column,
.row.small-uncollapse > .columns {
padding-left: 0.9375rem;
padding-right: 0.9375rem;
float: left; } }
@media only screen and (min-width: 40.0625em) {
.medium-push-0 {
position: relative;
left: 0;
right: auto; }
.medium-pull-0 {
position: relative;
right: 0;
left: auto; }
.medium-push-1 {
position: relative;
left: 8.33333%;
right: auto; }
.medium-pull-1 {
position: relative;
right: 8.33333%;
left: auto; }
.medium-push-2 {
position: relative;
left: 16.66667%;
right: auto; }
.medium-pull-2 {
position: relative;
right: 16.66667%;
left: auto; }
.medium-push-3 {
position: relative;
left: 25%;
right: auto; }
.medium-pull-3 {
position: relative;
right: 25%;
left: auto; }
.medium-push-4 {
position: relative;
left: 33.33333%;
right: auto; }
.medium-pull-4 {
position: relative;
right: 33.33333%;
left: auto; }
.medium-push-5 {
position: relative;
left: 41.66667%;
right: auto; }
.medium-pull-5 {
position: relative;
right: 41.66667%;
left: auto; }
.medium-push-6 {
position: relative;
left: 50%;
right: auto; }
.medium-pull-6 {
position: relative;
right: 50%;
left: auto; }
.medium-push-7 {
position: relative;
left: 58.33333%;
right: auto; }
.medium-pull-7 {
position: relative;
right: 58.33333%;
left: auto; }
.medium-push-8 {
position: relative;
left: 66.66667%;
right: auto; }
.medium-pull-8 {
position: relative;
right: 66.66667%;
left: auto; }
.medium-push-9 {
position: relative;
left: 75%;
right: auto; }
.medium-pull-9 {
position: relative;
right: 75%;
left: auto; }
.medium-push-10 {
position: relative;
left: 83.33333%;
right: auto; }
.medium-pull-10 {
position: relative;
right: 83.33333%;
left: auto; }
.medium-push-11 {
position: relative;
left: 91.66667%;
right: auto; }
.medium-pull-11 {
position: relative;
right: 91.66667%;
left: auto; }
.column,
.columns {
position: relative;
padding-left: 0.9375rem;
padding-right: 0.9375rem;
float: left; }
.medium-1 {
width: 8.33333%; }
.medium-2 {
width: 16.66667%; }
.medium-3 {
width: 25%; }
.medium-4 {
width: 33.33333%; }
.medium-5 {
width: 41.66667%; }
.medium-6 {
width: 50%; }
.medium-7 {
width: 58.33333%; }
.medium-8 {
width: 66.66667%; }
.medium-9 {
width: 75%; }
.medium-10 {
width: 83.33333%; }
.medium-11 {
width: 91.66667%; }
.medium-12 {
width: 100%; }
.medium-offset-0 {
margin-left: 0 !important; }
.medium-offset-1 {
margin-left: 8.33333% !important; }
.medium-offset-2 {
margin-left: 16.66667% !important; }
.medium-offset-3 {
margin-left: 25% !important; }
.medium-offset-4 {
margin-left: 33.33333% !important; }
.medium-offset-5 {
margin-left: 41.66667% !important; }
.medium-offset-6 {
margin-left: 50% !important; }
.medium-offset-7 {
margin-left: 58.33333% !important; }
.medium-offset-8 {
margin-left: 66.66667% !important; }
.medium-offset-9 {
margin-left: 75% !important; }
.medium-offset-10 {
margin-left: 83.33333% !important; }
.medium-offset-11 {
margin-left: 91.66667% !important; }
.medium-reset-order {
float: left;
left: auto;
margin-left: 0;
margin-right: 0;
right: auto; }
.column.medium-centered,
.columns.medium-centered {
margin-left: auto;
margin-right: auto;
float: none; }
.column.medium-uncentered,
.columns.medium-uncentered {
float: left;
margin-left: 0;
margin-right: 0; }
.column.medium-centered:last-child,
.columns.medium-centered:last-child {
float: none; }
.column.medium-uncentered:last-child,
.columns.medium-uncentered:last-child {
float: left; }
.column.medium-uncentered.opposite,
.columns.medium-uncentered.opposite {
float: right; }
.row.medium-collapse > .column,
.row.medium-collapse > .columns {
padding-left: 0;
padding-right: 0; }
.row.medium-collapse .row {
margin-left: 0;
margin-right: 0; }
.row.medium-uncollapse > .column,
.row.medium-uncollapse > .columns {
padding-left: 0.9375rem;
padding-right: 0.9375rem;
float: left; }
.push-0 {
position: relative;
left: 0;
right: auto; }
.pull-0 {
position: relative;
right: 0;
left: auto; }
.push-1 {
position: relative;
left: 8.33333%;
right: auto; }
.pull-1 {
position: relative;
right: 8.33333%;
left: auto; }
.push-2 {
position: relative;
left: 16.66667%;
right: auto; }
.pull-2 {
position: relative;
right: 16.66667%;
left: auto; }
.push-3 {
position: relative;
left: 25%;
right: auto; }
.pull-3 {
position: relative;
right: 25%;
left: auto; }
.push-4 {
position: relative;
left: 33.33333%;
right: auto; }
.pull-4 {
position: relative;
right: 33.33333%;
left: auto; }
.push-5 {
position: relative;
left: 41.66667%;
right: auto; }
.pull-5 {
position: relative;
right: 41.66667%;
left: auto; }
.push-6 {
position: relative;
left: 50%;
right: auto; }
.pull-6 {
position: relative;
right: 50%;
left: auto; }
.push-7 {
position: relative;
left: 58.33333%;
right: auto; }
.pull-7 {
position: relative;
right: 58.33333%;
left: auto; }
.push-8 {
position: relative;
left: 66.66667%;
right: auto; }
.pull-8 {
position: relative;
right: 66.66667%;
left: auto; }
.push-9 {
position: relative;
left: 75%;
right: auto; }
.pull-9 {
position: relative;
right: 75%;
left: auto; }
.push-10 {
position: relative;
left: 83.33333%;
right: auto; }
.pull-10 {
position: relative;
right: 83.33333%;
left: auto; }
.push-11 {
position: relative;
left: 91.66667%;
right: auto; }
.pull-11 {
position: relative;
right: 91.66667%;
left: auto; } }
@media only screen and (min-width: 64.0625em) {
.large-push-0 {
position: relative;
left: 0;
right: auto; }
.large-pull-0 {
position: relative;
right: 0;
left: auto; }
.large-push-1 {
position: relative;
left: 8.33333%;
right: auto; }
.large-pull-1 {
position: relative;
right: 8.33333%;
left: auto; }
.large-push-2 {
position: relative;
left: 16.66667%;
right: auto; }
.large-pull-2 {
position: relative;
right: 16.66667%;
left: auto; }
.large-push-3 {
position: relative;
left: 25%;
right: auto; }
.large-pull-3 {
position: relative;
right: 25%;
left: auto; }
.large-push-4 {
position: relative;
left: 33.33333%;
right: auto; }
.large-pull-4 {
position: relative;
right: 33.33333%;
left: auto; }
.large-push-5 {
position: relative;
left: 41.66667%;
right: auto; }
.large-pull-5 {
position: relative;
right: 41.66667%;
left: auto; }
.large-push-6 {
position: relative;
left: 50%;
right: auto; }
.large-pull-6 {
position: relative;
right: 50%;
left: auto; }
.large-push-7 {
position: relative;
left: 58.33333%;
right: auto; }
.large-pull-7 {
position: relative;
right: 58.33333%;
left: auto; }
.large-push-8 {
position: relative;
left: 66.66667%;
right: auto; }
.large-pull-8 {
position: relative;
right: 66.66667%;
left: auto; }
.large-push-9 {
position: relative;
left: 75%;
right: auto; }
.large-pull-9 {
position: relative;
right: 75%;
left: auto; }
.large-push-10 {
position: relative;
left: 83.33333%;
right: auto; }
.large-pull-10 {
position: relative;
right: 83.33333%;
left: auto; }
.large-push-11 {
position: relative;
left: 91.66667%;
right: auto; }
.large-pull-11 {
position: relative;
right: 91.66667%;
left: auto; }
.column,
.columns {
position: relative;
padding-left: 0.9375rem;
padding-right: 0.9375rem;
float: left; }
.large-1 {
width: 8.33333%; }
.large-2 {
width: 16.66667%; }
.large-3 {
width: 25%; }
.large-4 {
width: 33.33333%; }
.large-5 {
width: 41.66667%; }
.large-6 {
width: 50%; }
.large-7 {
width: 58.33333%; }
.large-8 {
width: 66.66667%; }
.large-9 {
width: 75%; }
.large-10 {
width: 83.33333%; }
.large-11 {
width: 91.66667%; }
.large-12 {
width: 100%; }
.large-offset-0 {
margin-left: 0 !important; }
.large-offset-1 {
margin-left: 8.33333% !important; }
.large-offset-2 {
margin-left: 16.66667% !important; }
.large-offset-3 {
margin-left: 25% !important; }
.large-offset-4 {
margin-left: 33.33333% !important; }
.large-offset-5 {
margin-left: 41.66667% !important; }
.large-offset-6 {
margin-left: 50% !important; }
.large-offset-7 {
margin-left: 58.33333% !important; }
.large-offset-8 {
margin-left: 66.66667% !important; }
.large-offset-9 {
margin-left: 75% !important; }
.large-offset-10 {
margin-left: 83.33333% !important; }
.large-offset-11 {
margin-left: 91.66667% !important; }
.large-reset-order {
float: left;
left: auto;
margin-left: 0;
margin-right: 0;
right: auto; }
.column.large-centered,
.columns.large-centered {
margin-left: auto;
margin-right: auto;
float: none; }
.column.large-uncentered,
.columns.large-uncentered {
float: left;
margin-left: 0;
margin-right: 0; }
.column.large-centered:last-child,
.columns.large-centered:last-child {
float: none; }
.column.large-uncentered:last-child,
.columns.large-uncentered:last-child {
float: left; }
.column.large-uncentered.opposite,
.columns.large-uncentered.opposite {
float: right; }
.row.large-collapse > .column,
.row.large-collapse > .columns {
padding-left: 0;
padding-right: 0; }
.row.large-collapse .row {
margin-left: 0;
margin-right: 0; }
.row.large-uncollapse > .column,
.row.large-uncollapse > .columns {
padding-left: 0.9375rem;
padding-right: 0.9375rem;
float: left; }
.push-0 {
position: relative;
left: 0;
right: auto; }
.pull-0 {
position: relative;
right: 0;
left: auto; }
.push-1 {
position: relative;
left: 8.33333%;
right: auto; }
.pull-1 {
position: relative;
right: 8.33333%;
left: auto; }
.push-2 {
position: relative;
left: 16.66667%;
right: auto; }
.pull-2 {
position: relative;
right: 16.66667%;
left: auto; }
.push-3 {
position: relative;
left: 25%;
right: auto; }
.pull-3 {
position: relative;
right: 25%;
left: auto; }
.push-4 {
position: relative;
left: 33.33333%;
right: auto; }
.pull-4 {
position: relative;
right: 33.33333%;
left: auto; }
.push-5 {
position: relative;
left: 41.66667%;
right: auto; }
.pull-5 {
position: relative;
right: 41.66667%;
left: auto; }
.push-6 {
position: relative;
left: 50%;
right: auto; }
.pull-6 {
position: relative;
right: 50%;
left: auto; }
.push-7 {
position: relative;
left: 58.33333%;
right: auto; }
.pull-7 {
position: relative;
right: 58.33333%;
left: auto; }
.push-8 {
position: relative;
left: 66.66667%;
right: auto; }
.pull-8 {
position: relative;
right: 66.66667%;
left: auto; }
.push-9 {
position: relative;
left: 75%;
right: auto; }
.pull-9 {
position: relative;
right: 75%;
left: auto; }
.push-10 {
position: relative;
left: 83.33333%;
right: auto; }
.pull-10 {
position: relative;
right: 83.33333%;
left: auto; }
.push-11 {
position: relative;
left: 91.66667%;
right: auto; }
.pull-11 {
position: relative;
right: 91.66667%;
left: auto; } }
.accordion {
margin-bottom: 0;
margin-left: 0; }
.accordion:before, .accordion:after {
content: " ";
display: table; }
.accordion:after {
clear: both; }
.accordion .accordion-navigation, .accordion dd {
display: block;
margin-bottom: 0 !important; }
.accordion .accordion-navigation.active > a, .accordion dd.active > a {
background: #e8e8e8;
color: #222222; }
.accordion .accordion-navigation > a, .accordion dd > a {
background: #EFEFEF;
color: #222222;
display: block;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 1rem;
padding: 1rem; }
.accordion .accordion-navigation > a:hover, .accordion dd > a:hover {
background: #e3e3e3; }
.accordion .accordion-navigation > .content, .accordion dd > .content {
display: none;
padding: 0.9375rem; }
.accordion .accordion-navigation > .content.active, .accordion dd > .content.active {
background: #FFFFFF;
display: block; }
.alert-box {
border-style: solid;
border-width: 1px;
display: block;
font-size: 0.8125rem;
font-weight: normal;
margin-bottom: 1.25rem;
padding: 0.875rem 1.5rem 0.875rem 0.875rem;
position: relative;
transition: opacity 300ms ease-out;
background-color: #008CBA;
border-color: #0078a0;
color: #FFFFFF; }
.alert-box .close {
right: 0.25rem;
background: inherit;
color: #333333;
font-size: 1.375rem;
line-height: .9;
margin-top: -0.6875rem;
opacity: 0.3;
padding: 0 6px 4px;
position: absolute;
top: 50%; }
.alert-box .close:hover, .alert-box .close:focus {
opacity: 0.5; }
.alert-box.radius {
border-radius: 3px; }
.alert-box.round {
border-radius: 1000px; }
.alert-box.success {
background-color: #43AC6A;
border-color: #3a945b;
color: #FFFFFF; }
.alert-box.alert {
background-color: #f04124;
border-color: #de2d0f;
color: #FFFFFF; }
.alert-box.secondary {
background-color: #e7e7e7;
border-color: #c7c7c7;
color: #4f4f4f; }
.alert-box.warning {
background-color: #f08a24;
border-color: #de770f;
color: #FFFFFF; }
.alert-box.info {
background-color: #a0d3e8;
border-color: #74bfdd;
color: #4f4f4f; }
.alert-box.alert-close {
opacity: 0; }
[class*="block-grid-"] {
display: block;
padding: 0;
margin: 0 -0.625rem; }
[class*="block-grid-"]:before, [class*="block-grid-"]:after {
content: " ";
display: table; }
[class*="block-grid-"]:after {
clear: both; }
[class*="block-grid-"] > li {
display: block;
float: left;
height: auto;
padding: 0 0.625rem 1.25rem; }
@media only screen {
.small-block-grid-1 > li {
list-style: none;
width: 100%; }
.small-block-grid-1 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-1 > li:nth-of-type(1n+1) {
clear: both; }
.small-block-grid-2 > li {
list-style: none;
width: 50%; }
.small-block-grid-2 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-2 > li:nth-of-type(2n+1) {
clear: both; }
.small-block-grid-3 > li {
list-style: none;
width: 33.33333%; }
.small-block-grid-3 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-3 > li:nth-of-type(3n+1) {
clear: both; }
.small-block-grid-4 > li {
list-style: none;
width: 25%; }
.small-block-grid-4 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-4 > li:nth-of-type(4n+1) {
clear: both; }
.small-block-grid-5 > li {
list-style: none;
width: 20%; }
.small-block-grid-5 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-5 > li:nth-of-type(5n+1) {
clear: both; }
.small-block-grid-6 > li {
list-style: none;
width: 16.66667%; }
.small-block-grid-6 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-6 > li:nth-of-type(6n+1) {
clear: both; }
.small-block-grid-7 > li {
list-style: none;
width: 14.28571%; }
.small-block-grid-7 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-7 > li:nth-of-type(7n+1) {
clear: both; }
.small-block-grid-8 > li {
list-style: none;
width: 12.5%; }
.small-block-grid-8 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-8 > li:nth-of-type(8n+1) {
clear: both; }
.small-block-grid-9 > li {
list-style: none;
width: 11.11111%; }
.small-block-grid-9 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-9 > li:nth-of-type(9n+1) {
clear: both; }
.small-block-grid-10 > li {
list-style: none;
width: 10%; }
.small-block-grid-10 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-10 > li:nth-of-type(10n+1) {
clear: both; }
.small-block-grid-11 > li {
list-style: none;
width: 9.09091%; }
.small-block-grid-11 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-11 > li:nth-of-type(11n+1) {
clear: both; }
.small-block-grid-12 > li {
list-style: none;
width: 8.33333%; }
.small-block-grid-12 > li:nth-of-type(1n) {
clear: none; }
.small-block-grid-12 > li:nth-of-type(12n+1) {
clear: both; } }
@media only screen and (min-width: 40.0625em) {
.medium-block-grid-1 > li {
list-style: none;
width: 100%; }
.medium-block-grid-1 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-1 > li:nth-of-type(1n+1) {
clear: both; }
.medium-block-grid-2 > li {
list-style: none;
width: 50%; }
.medium-block-grid-2 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-2 > li:nth-of-type(2n+1) {
clear: both; }
.medium-block-grid-3 > li {
list-style: none;
width: 33.33333%; }
.medium-block-grid-3 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-3 > li:nth-of-type(3n+1) {
clear: both; }
.medium-block-grid-4 > li {
list-style: none;
width: 25%; }
.medium-block-grid-4 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-4 > li:nth-of-type(4n+1) {
clear: both; }
.medium-block-grid-5 > li {
list-style: none;
width: 20%; }
.medium-block-grid-5 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-5 > li:nth-of-type(5n+1) {
clear: both; }
.medium-block-grid-6 > li {
list-style: none;
width: 16.66667%; }
.medium-block-grid-6 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-6 > li:nth-of-type(6n+1) {
clear: both; }
.medium-block-grid-7 > li {
list-style: none;
width: 14.28571%; }
.medium-block-grid-7 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-7 > li:nth-of-type(7n+1) {
clear: both; }
.medium-block-grid-8 > li {
list-style: none;
width: 12.5%; }
.medium-block-grid-8 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-8 > li:nth-of-type(8n+1) {
clear: both; }
.medium-block-grid-9 > li {
list-style: none;
width: 11.11111%; }
.medium-block-grid-9 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-9 > li:nth-of-type(9n+1) {
clear: both; }
.medium-block-grid-10 > li {
list-style: none;
width: 10%; }
.medium-block-grid-10 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-10 > li:nth-of-type(10n+1) {
clear: both; }
.medium-block-grid-11 > li {
list-style: none;
width: 9.09091%; }
.medium-block-grid-11 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-11 > li:nth-of-type(11n+1) {
clear: both; }
.medium-block-grid-12 > li {
list-style: none;
width: 8.33333%; }
.medium-block-grid-12 > li:nth-of-type(1n) {
clear: none; }
.medium-block-grid-12 > li:nth-of-type(12n+1) {
clear: both; } }
@media only screen and (min-width: 64.0625em) {
.large-block-grid-1 > li {
list-style: none;
width: 100%; }
.large-block-grid-1 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-1 > li:nth-of-type(1n+1) {
clear: both; }
.large-block-grid-2 > li {
list-style: none;
width: 50%; }
.large-block-grid-2 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-2 > li:nth-of-type(2n+1) {
clear: both; }
.large-block-grid-3 > li {
list-style: none;
width: 33.33333%; }
.large-block-grid-3 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-3 > li:nth-of-type(3n+1) {
clear: both; }
.large-block-grid-4 > li {
list-style: none;
width: 25%; }
.large-block-grid-4 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-4 > li:nth-of-type(4n+1) {
clear: both; }
.large-block-grid-5 > li {
list-style: none;
width: 20%; }
.large-block-grid-5 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-5 > li:nth-of-type(5n+1) {
clear: both; }
.large-block-grid-6 > li {
list-style: none;
width: 16.66667%; }
.large-block-grid-6 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-6 > li:nth-of-type(6n+1) {
clear: both; }
.large-block-grid-7 > li {
list-style: none;
width: 14.28571%; }
.large-block-grid-7 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-7 > li:nth-of-type(7n+1) {
clear: both; }
.large-block-grid-8 > li {
list-style: none;
width: 12.5%; }
.large-block-grid-8 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-8 > li:nth-of-type(8n+1) {
clear: both; }
.large-block-grid-9 > li {
list-style: none;
width: 11.11111%; }
.large-block-grid-9 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-9 > li:nth-of-type(9n+1) {
clear: both; }
.large-block-grid-10 > li {
list-style: none;
width: 10%; }
.large-block-grid-10 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-10 > li:nth-of-type(10n+1) {
clear: both; }
.large-block-grid-11 > li {
list-style: none;
width: 9.09091%; }
.large-block-grid-11 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-11 > li:nth-of-type(11n+1) {
clear: both; }
.large-block-grid-12 > li {
list-style: none;
width: 8.33333%; }
.large-block-grid-12 > li:nth-of-type(1n) {
clear: none; }
.large-block-grid-12 > li:nth-of-type(12n+1) {
clear: both; } }
.breadcrumbs {
border-style: solid;
border-width: 1px;
display: block;
list-style: none;
margin-left: 0;
overflow: hidden;
padding: 0.5625rem 0.875rem 0.5625rem;
background-color: #f4f4f4;
border-color: gainsboro;
border-radius: 3px; }
.breadcrumbs > * {
color: #008CBA;
float: left;
font-size: 0.6875rem;
line-height: 0.6875rem;
margin: 0;
text-transform: uppercase; }
.breadcrumbs > *:hover a, .breadcrumbs > *:focus a {
text-decoration: underline; }
.breadcrumbs > * a {
color: #008CBA; }
.breadcrumbs > *.current {
color: #333333;
cursor: default; }
.breadcrumbs > *.current a {
color: #333333;
cursor: default; }
.breadcrumbs > *.current:hover, .breadcrumbs > *.current:hover a, .breadcrumbs > *.current:focus, .breadcrumbs > *.current:focus a {
text-decoration: none; }
.breadcrumbs > *.unavailable {
color: #999999; }
.breadcrumbs > *.unavailable a {
color: #999999; }
.breadcrumbs > *.unavailable:hover,
.breadcrumbs > *.unavailable:hover a, .breadcrumbs > *.unavailable:focus,
.breadcrumbs > *.unavailable a:focus {
color: #999999;
cursor: not-allowed;
text-decoration: none; }
.breadcrumbs > *:before {
color: #AAAAAA;
content: "/";
margin: 0 0.75rem;
position: relative;
top: 1px; }
.breadcrumbs > *:first-child:before {
content: " ";
margin: 0; }
/* Accessibility - hides the forward slash */
[aria-label="breadcrumbs"] [aria-hidden="true"]:after {
content: "/"; }
button, .button {
-webkit-appearance: none;
-moz-appearance: none;
border-radius: 0;
border-style: solid;
border-width: 0;
cursor: pointer;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-weight: normal;
line-height: normal;
margin: 0 0 1.25rem;
position: relative;
text-align: center;
text-decoration: none;
display: inline-block;
padding: 1rem 2rem 1.0625rem 2rem;
font-size: 1rem;
background-color: #008CBA;
border-color: #007095;
color: #FFFFFF;
transition: background-color 300ms ease-out; }
button:hover, button:focus, .button:hover, .button:focus {
background-color: #007095; }
button:hover, button:focus, .button:hover, .button:focus {
color: #FFFFFF; }
button.secondary, .button.secondary {
background-color: #e7e7e7;
border-color: #b9b9b9;
color: #333333; }
button.secondary:hover, button.secondary:focus, .button.secondary:hover, .button.secondary:focus {
background-color: #b9b9b9; }
button.secondary:hover, button.secondary:focus, .button.secondary:hover, .button.secondary:focus {
color: #333333; }
button.success, .button.success {
background-color: #43AC6A;
border-color: #368a55;
color: #FFFFFF; }
button.success:hover, button.success:focus, .button.success:hover, .button.success:focus {
background-color: #368a55; }
button.success:hover, button.success:focus, .button.success:hover, .button.success:focus {
color: #FFFFFF; }
button.alert, .button.alert {
background-color: #f04124;
border-color: #cf2a0e;
color: #FFFFFF; }
button.alert:hover, button.alert:focus, .button.alert:hover, .button.alert:focus {
background-color: #cf2a0e; }
button.alert:hover, button.alert:focus, .button.alert:hover, .button.alert:focus {
color: #FFFFFF; }
button.warning, .button.warning {
background-color: #f08a24;
border-color: #cf6e0e;
color: #FFFFFF; }
button.warning:hover, button.warning:focus, .button.warning:hover, .button.warning:focus {
background-color: #cf6e0e; }
button.warning:hover, button.warning:focus, .button.warning:hover, .button.warning:focus {
color: #FFFFFF; }
button.info, .button.info {
background-color: #a0d3e8;
border-color: #61b6d9;
color: #333333; }
button.info:hover, button.info:focus, .button.info:hover, .button.info:focus {
background-color: #61b6d9; }
button.info:hover, button.info:focus, .button.info:hover, .button.info:focus {
color: #FFFFFF; }
button.large, .button.large {
padding: 1.125rem 2.25rem 1.1875rem 2.25rem;
font-size: 1.25rem; }
button.small, .button.small {
padding: 0.875rem 1.75rem 0.9375rem 1.75rem;
font-size: 0.8125rem; }
button.tiny, .button.tiny {
padding: 0.625rem 1.25rem 0.6875rem 1.25rem;
font-size: 0.6875rem; }
button.expand, .button.expand {
padding: 1rem 2rem 1.0625rem 2rem;
font-size: 1rem;
padding-bottom: 1.0625rem;
padding-top: 1rem;
padding-left: 1rem;
padding-right: 1rem;
width: 100%; }
button.left-align, .button.left-align {
text-align: left;
text-indent: 0.75rem; }
button.right-align, .button.right-align {
text-align: right;
padding-right: 0.75rem; }
button.radius, .button.radius {
border-radius: 3px; }
button.round, .button.round {
border-radius: 1000px; }
button.disabled, button[disabled], .button.disabled, .button[disabled] {
background-color: #008CBA;
border-color: #007095;
color: #FFFFFF;
box-shadow: none;
cursor: default;
opacity: 0.7; }
button.disabled:hover, button.disabled:focus, button[disabled]:hover, button[disabled]:focus, .button.disabled:hover, .button.disabled:focus, .button[disabled]:hover, .button[disabled]:focus {
background-color: #007095; }
button.disabled:hover, button.disabled:focus, button[disabled]:hover, button[disabled]:focus, .button.disabled:hover, .button.disabled:focus, .button[disabled]:hover, .button[disabled]:focus {
color: #FFFFFF; }
button.disabled:hover, button.disabled:focus, button[disabled]:hover, button[disabled]:focus, .button.disabled:hover, .button.disabled:focus, .button[disabled]:hover, .button[disabled]:focus {
background-color: #008CBA; }
button.disabled.secondary, button[disabled].secondary, .button.disabled.secondary, .button[disabled].secondary {
background-color: #e7e7e7;
border-color: #b9b9b9;
color: #333333;
box-shadow: none;
cursor: default;
opacity: 0.7; }
button.disabled.secondary:hover, button.disabled.secondary:focus, button[disabled].secondary:hover, button[disabled].secondary:focus, .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary:hover, .button[disabled].secondary:focus {
background-color: #b9b9b9; }
button.disabled.secondary:hover, button.disabled.secondary:focus, button[disabled].secondary:hover, button[disabled].secondary:focus, .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary:hover, .button[disabled].secondary:focus {
color: #333333; }
button.disabled.secondary:hover, button.disabled.secondary:focus, button[disabled].secondary:hover, button[disabled].secondary:focus, .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary:hover, .button[disabled].secondary:focus {
background-color: #e7e7e7; }
button.disabled.success, button[disabled].success, .button.disabled.success, .button[disabled].success {
background-color: #43AC6A;
border-color: #368a55;
color: #FFFFFF;
box-shadow: none;
cursor: default;
opacity: 0.7; }
button.disabled.success:hover, button.disabled.success:focus, button[disabled].success:hover, button[disabled].success:focus, .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success:hover, .button[disabled].success:focus {
background-color: #368a55; }
button.disabled.success:hover, button.disabled.success:focus, button[disabled].success:hover, button[disabled].success:focus, .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success:hover, .button[disabled].success:focus {
color: #FFFFFF; }
button.disabled.success:hover, button.disabled.success:focus, button[disabled].success:hover, button[disabled].success:focus, .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success:hover, .button[disabled].success:focus {
background-color: #43AC6A; }
button.disabled.alert, button[disabled].alert, .button.disabled.alert, .button[disabled].alert {
background-color: #f04124;
border-color: #cf2a0e;
color: #FFFFFF;
box-shadow: none;
cursor: default;
opacity: 0.7; }
button.disabled.alert:hover, button.disabled.alert:focus, button[disabled].alert:hover, button[disabled].alert:focus, .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert:hover, .button[disabled].alert:focus {
background-color: #cf2a0e; }
button.disabled.alert:hover, button.disabled.alert:focus, button[disabled].alert:hover, button[disabled].alert:focus, .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert:hover, .button[disabled].alert:focus {
color: #FFFFFF; }
button.disabled.alert:hover, button.disabled.alert:focus, button[disabled].alert:hover, button[disabled].alert:focus, .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert:hover, .button[disabled].alert:focus {
background-color: #f04124; }
button.disabled.warning, button[disabled].warning, .button.disabled.warning, .button[disabled].warning {
background-color: #f08a24;
border-color: #cf6e0e;
color: #FFFFFF;
box-shadow: none;
cursor: default;
opacity: 0.7; }
button.disabled.warning:hover, button.disabled.warning:focus, button[disabled].warning:hover, button[disabled].warning:focus, .button.disabled.warning:hover, .button.disabled.warning:focus, .button[disabled].warning:hover, .button[disabled].warning:focus {
background-color: #cf6e0e; }
button.disabled.warning:hover, button.disabled.warning:focus, button[disabled].warning:hover, button[disabled].warning:focus, .button.disabled.warning:hover, .button.disabled.warning:focus, .button[disabled].warning:hover, .button[disabled].warning:focus {
color: #FFFFFF; }
button.disabled.warning:hover, button.disabled.warning:focus, button[disabled].warning:hover, button[disabled].warning:focus, .button.disabled.warning:hover, .button.disabled.warning:focus, .button[disabled].warning:hover, .button[disabled].warning:focus {
background-color: #f08a24; }
button.disabled.info, button[disabled].info, .button.disabled.info, .button[disabled].info {
background-color: #a0d3e8;
border-color: #61b6d9;
color: #333333;
box-shadow: none;
cursor: default;
opacity: 0.7; }
button.disabled.info:hover, button.disabled.info:focus, button[disabled].info:hover, button[disabled].info:focus, .button.disabled.info:hover, .button.disabled.info:focus, .button[disabled].info:hover, .button[disabled].info:focus {
background-color: #61b6d9; }
button.disabled.info:hover, button.disabled.info:focus, button[disabled].info:hover, button[disabled].info:focus, .button.disabled.info:hover, .button.disabled.info:focus, .button[disabled].info:hover, .button[disabled].info:focus {
color: #FFFFFF; }
button.disabled.info:hover, button.disabled.info:focus, button[disabled].info:hover, button[disabled].info:focus, .button.disabled.info:hover, .button.disabled.info:focus, .button[disabled].info:hover, .button[disabled].info:focus {
background-color: #a0d3e8; }
button::-moz-focus-inner {
border: 0;
padding: 0; }
@media only screen and (min-width: 40.0625em) {
button, .button {
display: inline-block; } }
.button-group {
list-style: none;
margin: 0;
left: 0; }
.button-group:before, .button-group:after {
content: " ";
display: table; }
.button-group:after {
clear: both; }
.button-group.even-2 li {
display: inline-block;
margin: 0 -2px;
width: 50%; }
.button-group.even-2 li > button, .button-group.even-2 li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.even-2 li:first-child button, .button-group.even-2 li:first-child .button {
border-left: 0; }
.button-group.even-2 li button, .button-group.even-2 li .button {
width: 100%; }
.button-group.even-3 li {
display: inline-block;
margin: 0 -2px;
width: 33.33333%; }
.button-group.even-3 li > button, .button-group.even-3 li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.even-3 li:first-child button, .button-group.even-3 li:first-child .button {
border-left: 0; }
.button-group.even-3 li button, .button-group.even-3 li .button {
width: 100%; }
.button-group.even-4 li {
display: inline-block;
margin: 0 -2px;
width: 25%; }
.button-group.even-4 li > button, .button-group.even-4 li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.even-4 li:first-child button, .button-group.even-4 li:first-child .button {
border-left: 0; }
.button-group.even-4 li button, .button-group.even-4 li .button {
width: 100%; }
.button-group.even-5 li {
display: inline-block;
margin: 0 -2px;
width: 20%; }
.button-group.even-5 li > button, .button-group.even-5 li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.even-5 li:first-child button, .button-group.even-5 li:first-child .button {
border-left: 0; }
.button-group.even-5 li button, .button-group.even-5 li .button {
width: 100%; }
.button-group.even-6 li {
display: inline-block;
margin: 0 -2px;
width: 16.66667%; }
.button-group.even-6 li > button, .button-group.even-6 li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.even-6 li:first-child button, .button-group.even-6 li:first-child .button {
border-left: 0; }
.button-group.even-6 li button, .button-group.even-6 li .button {
width: 100%; }
.button-group.even-7 li {
display: inline-block;
margin: 0 -2px;
width: 14.28571%; }
.button-group.even-7 li > button, .button-group.even-7 li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.even-7 li:first-child button, .button-group.even-7 li:first-child .button {
border-left: 0; }
.button-group.even-7 li button, .button-group.even-7 li .button {
width: 100%; }
.button-group.even-8 li {
display: inline-block;
margin: 0 -2px;
width: 12.5%; }
.button-group.even-8 li > button, .button-group.even-8 li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.even-8 li:first-child button, .button-group.even-8 li:first-child .button {
border-left: 0; }
.button-group.even-8 li button, .button-group.even-8 li .button {
width: 100%; }
.button-group > li {
display: inline-block;
margin: 0 -2px; }
.button-group > li > button, .button-group > li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group > li:first-child button, .button-group > li:first-child .button {
border-left: 0; }
.button-group.stack > li {
display: block;
margin: 0;
float: none; }
.button-group.stack > li > button, .button-group.stack > li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.stack > li:first-child button, .button-group.stack > li:first-child .button {
border-left: 0; }
.button-group.stack > li > button, .button-group.stack > li .button {
border-color: rgba(255, 255, 255, 0.5);
border-left-width: 0;
border-top: 1px solid;
display: block;
margin: 0; }
.button-group.stack > li > button {
width: 100%; }
.button-group.stack > li:first-child button, .button-group.stack > li:first-child .button {
border-top: 0; }
.button-group.stack-for-small > li {
display: inline-block;
margin: 0 -2px; }
.button-group.stack-for-small > li > button, .button-group.stack-for-small > li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.stack-for-small > li:first-child button, .button-group.stack-for-small > li:first-child .button {
border-left: 0; }
@media only screen and (max-width: 40em) {
.button-group.stack-for-small > li {
display: block;
margin: 0;
width: 100%; }
.button-group.stack-for-small > li > button, .button-group.stack-for-small > li .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.stack-for-small > li:first-child button, .button-group.stack-for-small > li:first-child .button {
border-left: 0; }
.button-group.stack-for-small > li > button, .button-group.stack-for-small > li .button {
border-color: rgba(255, 255, 255, 0.5);
border-left-width: 0;
border-top: 1px solid;
display: block;
margin: 0; }
.button-group.stack-for-small > li > button {
width: 100%; }
.button-group.stack-for-small > li:first-child button, .button-group.stack-for-small > li:first-child .button {
border-top: 0; } }
.button-group.radius > * {
display: inline-block;
margin: 0 -2px; }
.button-group.radius > * > button, .button-group.radius > * .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.radius > *:first-child button, .button-group.radius > *:first-child .button {
border-left: 0; }
.button-group.radius > *,
.button-group.radius > * > a,
.button-group.radius > * > button,
.button-group.radius > * > .button {
border-radius: 0; }
.button-group.radius > *:first-child,
.button-group.radius > *:first-child > a,
.button-group.radius > *:first-child > button,
.button-group.radius > *:first-child > .button {
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
.button-group.radius > *:last-child,
.button-group.radius > *:last-child > a,
.button-group.radius > *:last-child > button,
.button-group.radius > *:last-child > .button {
-webkit-border-bottom-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px; }
.button-group.radius.stack > * {
display: block;
margin: 0; }
.button-group.radius.stack > * > button, .button-group.radius.stack > * .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.radius.stack > *:first-child button, .button-group.radius.stack > *:first-child .button {
border-left: 0; }
.button-group.radius.stack > * > button, .button-group.radius.stack > * .button {
border-color: rgba(255, 255, 255, 0.5);
border-left-width: 0;
border-top: 1px solid;
display: block;
margin: 0; }
.button-group.radius.stack > * > button {
width: 100%; }
.button-group.radius.stack > *:first-child button, .button-group.radius.stack > *:first-child .button {
border-top: 0; }
.button-group.radius.stack > *,
.button-group.radius.stack > * > a,
.button-group.radius.stack > * > button,
.button-group.radius.stack > * > .button {
border-radius: 0; }
.button-group.radius.stack > *:first-child,
.button-group.radius.stack > *:first-child > a,
.button-group.radius.stack > *:first-child > button,
.button-group.radius.stack > *:first-child > .button {
-webkit-top-left-radius: 3px;
-webkit-top-right-radius: 3px;
border-top-left-radius: 3px;
border-top-right-radius: 3px; }
.button-group.radius.stack > *:last-child,
.button-group.radius.stack > *:last-child > a,
.button-group.radius.stack > *:last-child > button,
.button-group.radius.stack > *:last-child > .button {
-webkit-bottom-left-radius: 3px;
-webkit-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px; }
@media only screen and (min-width: 40.0625em) {
.button-group.radius.stack-for-small > * {
display: inline-block;
margin: 0 -2px; }
.button-group.radius.stack-for-small > * > button, .button-group.radius.stack-for-small > * .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.radius.stack-for-small > *:first-child button, .button-group.radius.stack-for-small > *:first-child .button {
border-left: 0; }
.button-group.radius.stack-for-small > *,
.button-group.radius.stack-for-small > * > a,
.button-group.radius.stack-for-small > * > button,
.button-group.radius.stack-for-small > * > .button {
border-radius: 0; }
.button-group.radius.stack-for-small > *:first-child,
.button-group.radius.stack-for-small > *:first-child > a,
.button-group.radius.stack-for-small > *:first-child > button,
.button-group.radius.stack-for-small > *:first-child > .button {
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
.button-group.radius.stack-for-small > *:last-child,
.button-group.radius.stack-for-small > *:last-child > a,
.button-group.radius.stack-for-small > *:last-child > button,
.button-group.radius.stack-for-small > *:last-child > .button {
-webkit-border-bottom-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px; } }
@media only screen and (max-width: 40em) {
.button-group.radius.stack-for-small > * {
display: block;
margin: 0; }
.button-group.radius.stack-for-small > * > button, .button-group.radius.stack-for-small > * .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.radius.stack-for-small > *:first-child button, .button-group.radius.stack-for-small > *:first-child .button {
border-left: 0; }
.button-group.radius.stack-for-small > * > button, .button-group.radius.stack-for-small > * .button {
border-color: rgba(255, 255, 255, 0.5);
border-left-width: 0;
border-top: 1px solid;
display: block;
margin: 0; }
.button-group.radius.stack-for-small > * > button {
width: 100%; }
.button-group.radius.stack-for-small > *:first-child button, .button-group.radius.stack-for-small > *:first-child .button {
border-top: 0; }
.button-group.radius.stack-for-small > *,
.button-group.radius.stack-for-small > * > a,
.button-group.radius.stack-for-small > * > button,
.button-group.radius.stack-for-small > * > .button {
border-radius: 0; }
.button-group.radius.stack-for-small > *:first-child,
.button-group.radius.stack-for-small > *:first-child > a,
.button-group.radius.stack-for-small > *:first-child > button,
.button-group.radius.stack-for-small > *:first-child > .button {
-webkit-top-left-radius: 3px;
-webkit-top-right-radius: 3px;
border-top-left-radius: 3px;
border-top-right-radius: 3px; }
.button-group.radius.stack-for-small > *:last-child,
.button-group.radius.stack-for-small > *:last-child > a,
.button-group.radius.stack-for-small > *:last-child > button,
.button-group.radius.stack-for-small > *:last-child > .button {
-webkit-bottom-left-radius: 3px;
-webkit-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px; } }
.button-group.round > * {
display: inline-block;
margin: 0 -2px; }
.button-group.round > * > button, .button-group.round > * .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.round > *:first-child button, .button-group.round > *:first-child .button {
border-left: 0; }
.button-group.round > *,
.button-group.round > * > a,
.button-group.round > * > button,
.button-group.round > * > .button {
border-radius: 0; }
.button-group.round > *:first-child,
.button-group.round > *:first-child > a,
.button-group.round > *:first-child > button,
.button-group.round > *:first-child > .button {
-webkit-border-bottom-left-radius: 1000px;
-webkit-border-top-left-radius: 1000px;
border-bottom-left-radius: 1000px;
border-top-left-radius: 1000px; }
.button-group.round > *:last-child,
.button-group.round > *:last-child > a,
.button-group.round > *:last-child > button,
.button-group.round > *:last-child > .button {
-webkit-border-bottom-right-radius: 1000px;
-webkit-border-top-right-radius: 1000px;
border-bottom-right-radius: 1000px;
border-top-right-radius: 1000px; }
.button-group.round.stack > * {
display: block;
margin: 0; }
.button-group.round.stack > * > button, .button-group.round.stack > * .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.round.stack > *:first-child button, .button-group.round.stack > *:first-child .button {
border-left: 0; }
.button-group.round.stack > * > button, .button-group.round.stack > * .button {
border-color: rgba(255, 255, 255, 0.5);
border-left-width: 0;
border-top: 1px solid;
display: block;
margin: 0; }
.button-group.round.stack > * > button {
width: 100%; }
.button-group.round.stack > *:first-child button, .button-group.round.stack > *:first-child .button {
border-top: 0; }
.button-group.round.stack > *,
.button-group.round.stack > * > a,
.button-group.round.stack > * > button,
.button-group.round.stack > * > .button {
border-radius: 0; }
.button-group.round.stack > *:first-child,
.button-group.round.stack > *:first-child > a,
.button-group.round.stack > *:first-child > button,
.button-group.round.stack > *:first-child > .button {
-webkit-top-left-radius: 1rem;
-webkit-top-right-radius: 1rem;
border-top-left-radius: 1rem;
border-top-right-radius: 1rem; }
.button-group.round.stack > *:last-child,
.button-group.round.stack > *:last-child > a,
.button-group.round.stack > *:last-child > button,
.button-group.round.stack > *:last-child > .button {
-webkit-bottom-left-radius: 1rem;
-webkit-bottom-right-radius: 1rem;
border-bottom-left-radius: 1rem;
border-bottom-right-radius: 1rem; }
@media only screen and (min-width: 40.0625em) {
.button-group.round.stack-for-small > * {
display: inline-block;
margin: 0 -2px; }
.button-group.round.stack-for-small > * > button, .button-group.round.stack-for-small > * .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.round.stack-for-small > *:first-child button, .button-group.round.stack-for-small > *:first-child .button {
border-left: 0; }
.button-group.round.stack-for-small > *,
.button-group.round.stack-for-small > * > a,
.button-group.round.stack-for-small > * > button,
.button-group.round.stack-for-small > * > .button {
border-radius: 0; }
.button-group.round.stack-for-small > *:first-child,
.button-group.round.stack-for-small > *:first-child > a,
.button-group.round.stack-for-small > *:first-child > button,
.button-group.round.stack-for-small > *:first-child > .button {
-webkit-border-bottom-left-radius: 1000px;
-webkit-border-top-left-radius: 1000px;
border-bottom-left-radius: 1000px;
border-top-left-radius: 1000px; }
.button-group.round.stack-for-small > *:last-child,
.button-group.round.stack-for-small > *:last-child > a,
.button-group.round.stack-for-small > *:last-child > button,
.button-group.round.stack-for-small > *:last-child > .button {
-webkit-border-bottom-right-radius: 1000px;
-webkit-border-top-right-radius: 1000px;
border-bottom-right-radius: 1000px;
border-top-right-radius: 1000px; } }
@media only screen and (max-width: 40em) {
.button-group.round.stack-for-small > * {
display: block;
margin: 0; }
.button-group.round.stack-for-small > * > button, .button-group.round.stack-for-small > * .button {
border-left: 1px solid;
border-color: rgba(255, 255, 255, 0.5); }
.button-group.round.stack-for-small > *:first-child button, .button-group.round.stack-for-small > *:first-child .button {
border-left: 0; }
.button-group.round.stack-for-small > * > button, .button-group.round.stack-for-small > * .button {
border-color: rgba(255, 255, 255, 0.5);
border-left-width: 0;
border-top: 1px solid;
display: block;
margin: 0; }
.button-group.round.stack-for-small > * > button {
width: 100%; }
.button-group.round.stack-for-small > *:first-child button, .button-group.round.stack-for-small > *:first-child .button {
border-top: 0; }
.button-group.round.stack-for-small > *,
.button-group.round.stack-for-small > * > a,
.button-group.round.stack-for-small > * > button,
.button-group.round.stack-for-small > * > .button {
border-radius: 0; }
.button-group.round.stack-for-small > *:first-child,
.button-group.round.stack-for-small > *:first-child > a,
.button-group.round.stack-for-small > *:first-child > button,
.button-group.round.stack-for-small > *:first-child > .button {
-webkit-top-left-radius: 1rem;
-webkit-top-right-radius: 1rem;
border-top-left-radius: 1rem;
border-top-right-radius: 1rem; }
.button-group.round.stack-for-small > *:last-child,
.button-group.round.stack-for-small > *:last-child > a,
.button-group.round.stack-for-small > *:last-child > button,
.button-group.round.stack-for-small > *:last-child > .button {
-webkit-bottom-left-radius: 1rem;
-webkit-bottom-right-radius: 1rem;
border-bottom-left-radius: 1rem;
border-bottom-right-radius: 1rem; } }
.button-bar:before, .button-bar:after {
content: " ";
display: table; }
.button-bar:after {
clear: both; }
.button-bar .button-group {
float: left;
margin-right: 0.625rem; }
.button-bar .button-group div {
overflow: hidden; }
/* Clearing Styles */
.clearing-thumbs, [data-clearing] {
list-style: none;
margin-left: 0;
margin-bottom: 0; }
.clearing-thumbs:before, .clearing-thumbs:after, [data-clearing]:before, [data-clearing]:after {
content: " ";
display: table; }
.clearing-thumbs:after, [data-clearing]:after {
clear: both; }
.clearing-thumbs li, [data-clearing] li {
float: left;
margin-right: 10px; }
.clearing-thumbs[class*="block-grid-"] li, [data-clearing][class*="block-grid-"] li {
margin-right: 0; }
.clearing-blackout {
background: #333333;
height: 100%;
position: fixed;
top: 0;
width: 100%;
z-index: 998;
left: 0; }
.clearing-blackout .clearing-close {
display: block; }
.clearing-container {
height: 100%;
margin: 0;
overflow: hidden;
position: relative;
z-index: 998; }
.clearing-touch-label {
color: #AAAAAA;
font-size: .6em;
left: 50%;
position: absolute;
top: 50%; }
.visible-img {
height: 95%;
position: relative; }
.visible-img img {
position: absolute;
left: 50%;
top: 50%;
-webkit-transform: translateY(-50%) translateX(-50%);
-ms-transform: translateY(-50%) translateX(-50%);
transform: translateY(-50%) translateX(-50%);
max-height: 100%;
max-width: 100%; }
.clearing-caption {
background: #333333;
bottom: 0;
color: #CCCCCC;
font-size: 0.875em;
line-height: 1.3;
margin-bottom: 0;
padding: 10px 30px 20px;
position: absolute;
text-align: center;
width: 100%;
left: 0; }
.clearing-close {
color: #CCCCCC;
display: none;
font-size: 30px;
line-height: 1;
padding-left: 20px;
padding-top: 10px;
z-index: 999; }
.clearing-close:hover, .clearing-close:focus {
color: #CCCCCC; }
.clearing-assembled .clearing-container {
height: 100%; }
.clearing-assembled .clearing-container .carousel > ul {
display: none; }
.clearing-feature li {
display: none; }
.clearing-feature li.clearing-featured-img {
display: block; }
@media only screen and (min-width: 40.0625em) {
.clearing-main-prev,
.clearing-main-next {
height: 100%;
position: absolute;
top: 0;
width: 40px; }
.clearing-main-prev > span,
.clearing-main-next > span {
border: solid 12px;
display: block;
height: 0;
position: absolute;
top: 50%;
width: 0; }
.clearing-main-prev > span:hover,
.clearing-main-next > span:hover {
opacity: .8; }
.clearing-main-prev {
left: 0; }
.clearing-main-prev > span {
left: 5px;
border-color: transparent;
border-right-color: #CCCCCC; }
.clearing-main-next {
right: 0; }
.clearing-main-next > span {
border-color: transparent;
border-left-color: #CCCCCC; }
.clearing-main-prev.disabled,
.clearing-main-next.disabled {
opacity: .3; }
.clearing-assembled .clearing-container .carousel {
background: rgba(51, 51, 51, 0.8);
height: 120px;
margin-top: 10px;
text-align: center; }
.clearing-assembled .clearing-container .carousel > ul {
display: inline-block;
z-index: 999;
height: 100%;
position: relative;
float: none; }
.clearing-assembled .clearing-container .carousel > ul li {
clear: none;
cursor: pointer;
display: block;
float: left;
margin-right: 0;
min-height: inherit;
opacity: .4;
overflow: hidden;
padding: 0;
position: relative;
width: 120px; }
.clearing-assembled .clearing-container .carousel > ul li.fix-height img {
height: 100%;
max-width: none; }
.clearing-assembled .clearing-container .carousel > ul li a.th {
border: none;
box-shadow: none;
display: block; }
.clearing-assembled .clearing-container .carousel > ul li img {
cursor: pointer !important;
width: 100% !important; }
.clearing-assembled .clearing-container .carousel > ul li.visible {
opacity: 1; }
.clearing-assembled .clearing-container .carousel > ul li:hover {
opacity: .8; }
.clearing-assembled .clearing-container .visible-img {
background: #333333;
height: 85%;
overflow: hidden; }
.clearing-close {
padding-left: 0;
padding-top: 0;
position: absolute;
top: 10px;
right: 20px; } }
/* Foundation Dropdowns */
.f-dropdown {
display: none;
left: -9999px;
list-style: none;
margin-left: 0;
position: absolute;
background: #FFFFFF;
border: solid 1px #cccccc;
font-size: 0.875rem;
height: auto;
max-height: none;
width: 100%;
z-index: 89;
margin-top: 2px;
max-width: 200px; }
.f-dropdown.open {
display: block; }
.f-dropdown > *:first-child {
margin-top: 0; }
.f-dropdown > *:last-child {
margin-bottom: 0; }
.f-dropdown:before {
border: inset 6px;
content: "";
display: block;
height: 0;
width: 0;
border-color: transparent transparent #FFFFFF transparent;
border-bottom-style: solid;
position: absolute;
top: -12px;
left: 10px;
z-index: 89; }
.f-dropdown:after {
border: inset 7px;
content: "";
display: block;
height: 0;
width: 0;
border-color: transparent transparent #cccccc transparent;
border-bottom-style: solid;
position: absolute;
top: -14px;
left: 9px;
z-index: 88; }
.f-dropdown.right:before {
left: auto;
right: 10px; }
.f-dropdown.right:after {
left: auto;
right: 9px; }
.f-dropdown.drop-right {
display: none;
left: -9999px;
list-style: none;
margin-left: 0;
position: absolute;
background: #FFFFFF;
border: solid 1px #cccccc;
font-size: 0.875rem;
height: auto;
max-height: none;
width: 100%;
z-index: 89;
margin-top: 0;
margin-left: 2px;
max-width: 200px; }
.f-dropdown.drop-right.open {
display: block; }
.f-dropdown.drop-right > *:first-child {
margin-top: 0; }
.f-dropdown.drop-right > *:last-child {
margin-bottom: 0; }
.f-dropdown.drop-right:before {
border: inset 6px;
content: "";
display: block;
height: 0;
width: 0;
border-color: transparent #FFFFFF transparent transparent;
border-right-style: solid;
position: absolute;
top: 10px;
left: -12px;
z-index: 89; }
.f-dropdown.drop-right:after {
border: inset 7px;
content: "";
display: block;
height: 0;
width: 0;
border-color: transparent #cccccc transparent transparent;
border-right-style: solid;
position: absolute;
top: 9px;
left: -14px;
z-index: 88; }
.f-dropdown.drop-left {
display: none;
left: -9999px;
list-style: none;
margin-left: 0;
position: absolute;
background: #FFFFFF;
border: solid 1px #cccccc;
font-size: 0.875rem;
height: auto;
max-height: none;
width: 100%;
z-index: 89;
margin-top: 0;
margin-left: -2px;
max-width: 200px; }
.f-dropdown.drop-left.open {
display: block; }
.f-dropdown.drop-left > *:first-child {
margin-top: 0; }
.f-dropdown.drop-left > *:last-child {
margin-bottom: 0; }
.f-dropdown.drop-left:before {
border: inset 6px;
content: "";
display: block;
height: 0;
width: 0;
border-color: transparent transparent transparent #FFFFFF;
border-left-style: solid;
position: absolute;
top: 10px;
right: -12px;
left: auto;
z-index: 89; }
.f-dropdown.drop-left:after {
border: inset 7px;
content: "";
display: block;
height: 0;
width: 0;
border-color: transparent transparent transparent #cccccc;
border-left-style: solid;
position: absolute;
top: 9px;
right: -14px;
left: auto;
z-index: 88; }
.f-dropdown.drop-top {
display: none;
left: -9999px;
list-style: none;
margin-left: 0;
position: absolute;
background: #FFFFFF;
border: solid 1px #cccccc;
font-size: 0.875rem;
height: auto;
max-height: none;
width: 100%;
z-index: 89;
margin-left: 0;
margin-top: -2px;
max-width: 200px; }
.f-dropdown.drop-top.open {
display: block; }
.f-dropdown.drop-top > *:first-child {
margin-top: 0; }
.f-dropdown.drop-top > *:last-child {
margin-bottom: 0; }
.f-dropdown.drop-top:before {
border: inset 6px;
content: "";
display: block;
height: 0;
width: 0;
border-color: #FFFFFF transparent transparent transparent;
border-top-style: solid;
bottom: -12px;
position: absolute;
top: auto;
left: 10px;
right: auto;
z-index: 89; }
.f-dropdown.drop-top:after {
border: inset 7px;
content: "";
display: block;
height: 0;
width: 0;
border-color: #cccccc transparent transparent transparent;
border-top-style: solid;
bottom: -14px;
position: absolute;
top: auto;
left: 9px;
right: auto;
z-index: 88; }
.f-dropdown li {
cursor: pointer;
font-size: 0.875rem;
line-height: 1.125rem;
margin: 0; }
.f-dropdown li:hover, .f-dropdown li:focus {
background: #EEEEEE; }
.f-dropdown li a {
display: block;
padding: 0.5rem;
color: #555555; }
.f-dropdown.content {
display: none;
left: -9999px;
list-style: none;
margin-left: 0;
position: absolute;
background: #FFFFFF;
border: solid 1px #cccccc;
font-size: 0.875rem;
height: auto;
max-height: none;
padding: 1.25rem;
width: 100%;
z-index: 89;
max-width: 200px; }
.f-dropdown.content.open {
display: block; }
.f-dropdown.content > *:first-child {
margin-top: 0; }
.f-dropdown.content > *:last-child {
margin-bottom: 0; }
.f-dropdown.radius {
border-radius: 3px; }
.f-dropdown.tiny {
max-width: 200px; }
.f-dropdown.small {
max-width: 300px; }
.f-dropdown.medium {
max-width: 500px; }
.f-dropdown.large {
max-width: 800px; }
.f-dropdown.mega {
width: 100% !important;
max-width: 100% !important; }
.f-dropdown.mega.open {
left: 0 !important; }
.dropdown.button, button.dropdown {
position: relative;
padding-right: 3.5625rem; }
.dropdown.button::after, button.dropdown::after {
border-color: #FFFFFF transparent transparent transparent;
border-style: solid;
content: "";
display: block;
height: 0;
position: absolute;
top: 50%;
width: 0; }
.dropdown.button::after, button.dropdown::after {
border-width: 0.375rem;
right: 1.40625rem;
margin-top: -0.15625rem; }
.dropdown.button::after, button.dropdown::after {
border-color: #FFFFFF transparent transparent transparent; }
.dropdown.button.tiny, button.dropdown.tiny {
padding-right: 2.625rem; }
.dropdown.button.tiny:after, button.dropdown.tiny:after {
border-width: 0.375rem;
right: 1.125rem;
margin-top: -0.125rem; }
.dropdown.button.tiny::after, button.dropdown.tiny::after {
border-color: #FFFFFF transparent transparent transparent; }
.dropdown.button.small, button.dropdown.small {
padding-right: 3.0625rem; }
.dropdown.button.small::after, button.dropdown.small::after {
border-width: 0.4375rem;
right: 1.3125rem;
margin-top: -0.15625rem; }
.dropdown.button.small::after, button.dropdown.small::after {
border-color: #FFFFFF transparent transparent transparent; }
.dropdown.button.large, button.dropdown.large {
padding-right: 3.625rem; }
.dropdown.button.large::after, button.dropdown.large::after {
border-width: 0.3125rem;
right: 1.71875rem;
margin-top: -0.15625rem; }
.dropdown.button.large::after, button.dropdown.large::after {
border-color: #FFFFFF transparent transparent transparent; }
.dropdown.button.secondary:after, button.dropdown.secondary:after {
border-color: #333333 transparent transparent transparent; }
.flex-video {
height: 0;
margin-bottom: 1rem;
overflow: hidden;
padding-bottom: 67.5%;
padding-top: 1.5625rem;
position: relative; }
.flex-video.widescreen {
padding-bottom: 56.34%; }
.flex-video.vimeo {
padding-top: 0; }
.flex-video iframe,
.flex-video object,
.flex-video embed,
.flex-video video {
height: 100%;
position: absolute;
top: 0;
width: 100%;
left: 0; }
/* Standard Forms */
form {
margin: 0 0 1rem; }
/* Using forms within rows, we need to set some defaults */
form .row .row {
margin: 0 -0.5rem; }
form .row .row .column,
form .row .row .columns {
padding: 0 0.5rem; }
form .row .row.collapse {
margin: 0; }
form .row .row.collapse .column,
form .row .row.collapse .columns {
padding: 0; }
form .row .row.collapse input {
-webkit-border-bottom-right-radius: 0;
-webkit-border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-top-right-radius: 0; }
form .row input.column,
form .row input.columns,
form .row textarea.column,
form .row textarea.columns {
padding-left: 0.5rem; }
/* Label Styles */
label {
color: #4d4d4d;
cursor: pointer;
display: block;
font-size: 0.875rem;
font-weight: normal;
line-height: 1.5;
margin-bottom: 0;
/* Styles for required inputs */ }
label.right {
float: none !important;
text-align: right; }
label.inline {
margin: 0 0 1rem 0;
padding: 0.5625rem 0; }
label small {
text-transform: capitalize;
color: #676767; }
/* Attach elements to the beginning or end of an input */
.prefix,
.postfix {
border-style: solid;
border-width: 1px;
display: block;
font-size: 0.875rem;
height: 2.3125rem;
line-height: 2.3125rem;
overflow: visible;
padding-bottom: 0;
padding-top: 0;
position: relative;
text-align: center;
width: 100%;
z-index: 2; }
/* Adjust padding, alignment and radius if pre/post element is a button */
.postfix.button {
border: none;
padding-left: 0;
padding-right: 0;
padding-bottom: 0;
padding-top: 0;
text-align: center; }
.prefix.button {
border: none;
padding-left: 0;
padding-right: 0;
padding-bottom: 0;
padding-top: 0;
text-align: center; }
.prefix.button.radius {
border-radius: 0;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
.postfix.button.radius {
border-radius: 0;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px; }
.prefix.button.round {
border-radius: 0;
-webkit-border-bottom-left-radius: 1000px;
-webkit-border-top-left-radius: 1000px;
border-bottom-left-radius: 1000px;
border-top-left-radius: 1000px; }
.postfix.button.round {
border-radius: 0;
-webkit-border-bottom-right-radius: 1000px;
-webkit-border-top-right-radius: 1000px;
border-bottom-right-radius: 1000px;
border-top-right-radius: 1000px; }
/* Separate prefix and postfix styles when on span or label so buttons keep their own */
span.prefix, label.prefix {
background: #f2f2f2;
border-right: none;
color: #333333;
border-color: #cccccc; }
span.postfix, label.postfix {
background: #f2f2f2;
border-left: none;
color: #333333;
border-color: #cccccc; }
/* We use this to get basic styling on all basic form elements */
input:not([type]), input[type="text"], input[type="password"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="week"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="time"], input[type="url"], input[type="color"], textarea {
-webkit-appearance: none;
-moz-appearance: none;
border-radius: 0;
background-color: #FFFFFF;
border-style: solid;
border-width: 1px;
border-color: #cccccc;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
color: rgba(0, 0, 0, 0.75);
display: block;
font-family: inherit;
font-size: 0.875rem;
height: 2.3125rem;
margin: 0 0 1rem 0;
padding: 0.5rem;
width: 100%;
box-sizing: border-box;
transition: border-color 0.15s linear, background 0.15s linear; }
input:not([type]):focus, input[type="text"]:focus, input[type="password"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="week"]:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="time"]:focus, input[type="url"]:focus, input[type="color"]:focus, textarea:focus {
background: #fafafa;
border-color: #999999;
outline: none; }
input:not([type]):disabled, input[type="text"]:disabled, input[type="password"]:disabled, input[type="date"]:disabled, input[type="datetime"]:disabled, input[type="datetime-local"]:disabled, input[type="month"]:disabled, input[type="week"]:disabled, input[type="email"]:disabled, input[type="number"]:disabled, input[type="search"]:disabled, input[type="tel"]:disabled, input[type="time"]:disabled, input[type="url"]:disabled, input[type="color"]:disabled, textarea:disabled {
background-color: #DDDDDD;
cursor: default; }
input:not([type])[disabled], input:not([type])[readonly],
fieldset[disabled] input:not([type]), input[type="text"][disabled], input[type="text"][readonly],
fieldset[disabled] input[type="text"], input[type="password"][disabled], input[type="password"][readonly],
fieldset[disabled] input[type="password"], input[type="date"][disabled], input[type="date"][readonly],
fieldset[disabled] input[type="date"], input[type="datetime"][disabled], input[type="datetime"][readonly],
fieldset[disabled] input[type="datetime"], input[type="datetime-local"][disabled], input[type="datetime-local"][readonly],
fieldset[disabled] input[type="datetime-local"], input[type="month"][disabled], input[type="month"][readonly],
fieldset[disabled] input[type="month"], input[type="week"][disabled], input[type="week"][readonly],
fieldset[disabled] input[type="week"], input[type="email"][disabled], input[type="email"][readonly],
fieldset[disabled] input[type="email"], input[type="number"][disabled], input[type="number"][readonly],
fieldset[disabled] input[type="number"], input[type="search"][disabled], input[type="search"][readonly],
fieldset[disabled] input[type="search"], input[type="tel"][disabled], input[type="tel"][readonly],
fieldset[disabled] input[type="tel"], input[type="time"][disabled], input[type="time"][readonly],
fieldset[disabled] input[type="time"], input[type="url"][disabled], input[type="url"][readonly],
fieldset[disabled] input[type="url"], input[type="color"][disabled], input[type="color"][readonly],
fieldset[disabled] input[type="color"], textarea[disabled], textarea[readonly],
fieldset[disabled] textarea {
background-color: #DDDDDD;
cursor: default; }
input:not([type]).radius, input[type="text"].radius, input[type="password"].radius, input[type="date"].radius, input[type="datetime"].radius, input[type="datetime-local"].radius, input[type="month"].radius, input[type="week"].radius, input[type="email"].radius, input[type="number"].radius, input[type="search"].radius, input[type="tel"].radius, input[type="time"].radius, input[type="url"].radius, input[type="color"].radius, textarea.radius {
border-radius: 3px; }
form .row .prefix-radius.row.collapse input,
form .row .prefix-radius.row.collapse textarea,
form .row .prefix-radius.row.collapse select,
form .row .prefix-radius.row.collapse button {
border-radius: 0;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px; }
form .row .prefix-radius.row.collapse .prefix {
border-radius: 0;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
form .row .postfix-radius.row.collapse input,
form .row .postfix-radius.row.collapse textarea,
form .row .postfix-radius.row.collapse select,
form .row .postfix-radius.row.collapse button {
border-radius: 0;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
form .row .postfix-radius.row.collapse .postfix {
border-radius: 0;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px; }
form .row .prefix-round.row.collapse input,
form .row .prefix-round.row.collapse textarea,
form .row .prefix-round.row.collapse select,
form .row .prefix-round.row.collapse button {
border-radius: 0;
-webkit-border-bottom-right-radius: 1000px;
-webkit-border-top-right-radius: 1000px;
border-bottom-right-radius: 1000px;
border-top-right-radius: 1000px; }
form .row .prefix-round.row.collapse .prefix {
border-radius: 0;
-webkit-border-bottom-left-radius: 1000px;
-webkit-border-top-left-radius: 1000px;
border-bottom-left-radius: 1000px;
border-top-left-radius: 1000px; }
form .row .postfix-round.row.collapse input,
form .row .postfix-round.row.collapse textarea,
form .row .postfix-round.row.collapse select,
form .row .postfix-round.row.collapse button {
border-radius: 0;
-webkit-border-bottom-left-radius: 1000px;
-webkit-border-top-left-radius: 1000px;
border-bottom-left-radius: 1000px;
border-top-left-radius: 1000px; }
form .row .postfix-round.row.collapse .postfix {
border-radius: 0;
-webkit-border-bottom-right-radius: 1000px;
-webkit-border-top-right-radius: 1000px;
border-bottom-right-radius: 1000px;
border-top-right-radius: 1000px; }
input[type="submit"] {
-webkit-appearance: none;
-moz-appearance: none;
border-radius: 0; }
/* Respect enforced amount of rows for textarea */
textarea[rows] {
height: auto; }
/* Not allow resize out of parent */
textarea {
max-width: 100%; }
::-webkit-input-placeholder {
color: #666666; }
:-moz-placeholder {
/* Firefox 18- */
color: #666666; }
::-moz-placeholder {
/* Firefox 19+ */
color: #666666; }
:-ms-input-placeholder {
color: #666666; }
/* Add height value for select elements to match text input height */
select {
-webkit-appearance: none !important;
-moz-appearance: none !important;
background-color: #FAFAFA;
border-radius: 0;
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMTJweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIzcHgiIHZpZXdCb3g9IjAgMCA2IDMiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDYgMyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gcG9pbnRzPSI1Ljk5MiwwIDIuOTkyLDMgLTAuMDA4LDAgIi8+PC9zdmc+");
background-position: 100% center;
background-repeat: no-repeat;
border-style: solid;
border-width: 1px;
border-color: #cccccc;
color: rgba(0, 0, 0, 0.75);
font-family: inherit;
font-size: 0.875rem;
line-height: normal;
padding: 0.5rem;
border-radius: 0;
height: 2.3125rem; }
select::-ms-expand {
display: none; }
select.radius {
border-radius: 3px; }
select:focus {
background-color: #f3f3f3;
border-color: #999999; }
select:disabled {
background-color: #DDDDDD;
cursor: default; }
select[multiple] {
height: auto; }
/* Adjust margin for form elements below */
input[type="file"],
input[type="checkbox"],
input[type="radio"],
select {
margin: 0 0 1rem 0; }
input[type="checkbox"] + label,
input[type="radio"] + label {
display: inline-block;
margin-left: 0.5rem;
margin-right: 1rem;
margin-bottom: 0;
vertical-align: baseline; }
/* Normalize file input width */
input[type="file"] {
width: 100%; }
/* HTML5 Number spinners settings */
/* We add basic fieldset styling */
fieldset {
border: 1px solid #DDDDDD;
margin: 1.125rem 0;
padding: 1.25rem; }
fieldset legend {
font-weight: bold;
margin: 0;
margin-left: -0.1875rem;
padding: 0 0.1875rem; }
/* Error Handling */
[data-abide] .error small.error, [data-abide] .error span.error, [data-abide] span.error, [data-abide] small.error {
display: block;
font-size: 0.75rem;
font-style: italic;
font-weight: normal;
margin-bottom: 1rem;
margin-top: -1px;
padding: 0.375rem 0.5625rem 0.5625rem;
background: #f04124;
color: #FFFFFF; }
[data-abide] span.error, [data-abide] small.error {
display: none; }
span.error, small.error {
display: block;
font-size: 0.75rem;
font-style: italic;
font-weight: normal;
margin-bottom: 1rem;
margin-top: -1px;
padding: 0.375rem 0.5625rem 0.5625rem;
background: #f04124;
color: #FFFFFF; }
.error input,
.error textarea,
.error select {
margin-bottom: 0; }
.error input[type="checkbox"],
.error input[type="radio"] {
margin-bottom: 1rem; }
.error label,
.error label.error {
color: #f04124; }
.error small.error {
display: block;
font-size: 0.75rem;
font-style: italic;
font-weight: normal;
margin-bottom: 1rem;
margin-top: -1px;
padding: 0.375rem 0.5625rem 0.5625rem;
background: #f04124;
color: #FFFFFF; }
.error > label > small {
background: transparent;
color: #676767;
display: inline;
font-size: 60%;
font-style: normal;
margin: 0;
padding: 0;
text-transform: capitalize; }
.error span.error-message {
display: block; }
input.error,
textarea.error,
select.error {
margin-bottom: 0; }
label.error {
color: #f04124; }
.icon-bar {
display: inline-block;
font-size: 0;
width: 100%;
background: #333333; }
.icon-bar > * {
display: block;
float: left;
font-size: 1rem;
margin: 0 auto;
padding: 1.25rem;
text-align: center;
width: 25%; }
.icon-bar > * i, .icon-bar > * img {
display: block;
margin: 0 auto; }
.icon-bar > * i + label, .icon-bar > * img + label {
margin-top: .0625rem; }
.icon-bar > * i {
font-size: 1.875rem;
vertical-align: middle; }
.icon-bar > * img {
height: 1.875rem;
width: 1.875rem; }
.icon-bar.label-right > * i, .icon-bar.label-right > * img {
display: inline-block;
margin: 0 .0625rem 0 0; }
.icon-bar.label-right > * i + label, .icon-bar.label-right > * img + label {
margin-top: 0; }
.icon-bar.label-right > * label {
display: inline-block; }
.icon-bar.vertical.label-right > * {
text-align: left; }
.icon-bar.vertical, .icon-bar.small-vertical {
height: 100%;
width: auto; }
.icon-bar.vertical .item, .icon-bar.small-vertical .item {
float: none;
margin: auto;
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.medium-vertical {
height: 100%;
width: auto; }
.icon-bar.medium-vertical .item {
float: none;
margin: auto;
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.large-vertical {
height: 100%;
width: auto; }
.icon-bar.large-vertical .item {
float: none;
margin: auto;
width: auto; } }
.icon-bar > * {
font-size: 1rem;
padding: 1.25rem; }
.icon-bar > * i + label, .icon-bar > * img + label {
margin-top: .0625rem;
font-size: 1rem; }
.icon-bar > * i {
font-size: 1.875rem; }
.icon-bar > * img {
height: 1.875rem;
width: 1.875rem; }
.icon-bar > * label {
color: #FFFFFF; }
.icon-bar > * i {
color: #FFFFFF; }
.icon-bar > a:hover {
background: #008CBA; }
.icon-bar > a:hover label {
color: #FFFFFF; }
.icon-bar > a:hover i {
color: #FFFFFF; }
.icon-bar > a.active {
background: #008CBA; }
.icon-bar > a.active label {
color: #FFFFFF; }
.icon-bar > a.active i {
color: #FFFFFF; }
.icon-bar .item.disabled {
cursor: not-allowed;
opacity: 0.7;
pointer-events: none; }
.icon-bar .item.disabled > * {
opacity: 0.7;
cursor: not-allowed; }
.icon-bar.two-up .item {
width: 50%; }
.icon-bar.two-up.vertical .item, .icon-bar.two-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.two-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.two-up.large-vertical .item {
width: auto; } }
.icon-bar.three-up .item {
width: 33.3333%; }
.icon-bar.three-up.vertical .item, .icon-bar.three-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.three-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.three-up.large-vertical .item {
width: auto; } }
.icon-bar.four-up .item {
width: 25%; }
.icon-bar.four-up.vertical .item, .icon-bar.four-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.four-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.four-up.large-vertical .item {
width: auto; } }
.icon-bar.five-up .item {
width: 20%; }
.icon-bar.five-up.vertical .item, .icon-bar.five-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.five-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.five-up.large-vertical .item {
width: auto; } }
.icon-bar.six-up .item {
width: 16.66667%; }
.icon-bar.six-up.vertical .item, .icon-bar.six-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.six-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.six-up.large-vertical .item {
width: auto; } }
.icon-bar.seven-up .item {
width: 14.28571%; }
.icon-bar.seven-up.vertical .item, .icon-bar.seven-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.seven-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.seven-up.large-vertical .item {
width: auto; } }
.icon-bar.eight-up .item {
width: 12.5%; }
.icon-bar.eight-up.vertical .item, .icon-bar.eight-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.eight-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.eight-up.large-vertical .item {
width: auto; } }
.icon-bar.two-up .item {
width: 50%; }
.icon-bar.two-up.vertical .item, .icon-bar.two-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.two-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.two-up.large-vertical .item {
width: auto; } }
.icon-bar.three-up .item {
width: 33.3333%; }
.icon-bar.three-up.vertical .item, .icon-bar.three-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.three-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.three-up.large-vertical .item {
width: auto; } }
.icon-bar.four-up .item {
width: 25%; }
.icon-bar.four-up.vertical .item, .icon-bar.four-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.four-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.four-up.large-vertical .item {
width: auto; } }
.icon-bar.five-up .item {
width: 20%; }
.icon-bar.five-up.vertical .item, .icon-bar.five-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.five-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.five-up.large-vertical .item {
width: auto; } }
.icon-bar.six-up .item {
width: 16.66667%; }
.icon-bar.six-up.vertical .item, .icon-bar.six-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.six-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.six-up.large-vertical .item {
width: auto; } }
.icon-bar.seven-up .item {
width: 14.28571%; }
.icon-bar.seven-up.vertical .item, .icon-bar.seven-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.seven-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.seven-up.large-vertical .item {
width: auto; } }
.icon-bar.eight-up .item {
width: 12.5%; }
.icon-bar.eight-up.vertical .item, .icon-bar.eight-up.small-vertical .item {
width: auto; }
@media only screen and (min-width: 40.0625em) {
.icon-bar.eight-up.medium-vertical .item {
width: auto; } }
@media only screen and (min-width: 64.0625em) {
.icon-bar.eight-up.large-vertical .item {
width: auto; } }
.inline-list {
list-style: none;
margin-top: 0;
margin-bottom: 1.0625rem;
margin-left: -1.375rem;
margin-right: 0;
overflow: hidden;
padding: 0; }
.inline-list > li {
display: block;
float: left;
list-style: none;
margin-left: 1.375rem; }
.inline-list > li > * {
display: block; }
/* Foundation Joyride */
.joyride-list {
display: none; }
/* Default styles for the container */
.joyride-tip-guide {
background: #333333;
color: #FFFFFF;
display: none;
font-family: inherit;
font-weight: normal;
position: absolute;
top: 0;
width: 95%;
z-index: 103;
left: 2.5%; }
.lt-ie9 .joyride-tip-guide {
margin-left: -400px;
max-width: 800px;
left: 50%; }
.joyride-content-wrapper {
padding: 1.125rem 1.25rem 1.5rem;
width: 100%; }
.joyride-content-wrapper .button {
margin-bottom: 0 !important; }
.joyride-content-wrapper .joyride-prev-tip {
margin-right: 10px; }
/* Add a little css triangle pip, older browser just miss out on the fanciness of it */
.joyride-tip-guide .joyride-nub {
border: 10px solid #333333;
display: block;
height: 0;
position: absolute;
width: 0;
left: 22px; }
.joyride-tip-guide .joyride-nub.top {
border-color: #333333;
border-top-color: transparent !important;
border-top-style: solid;
border-left-color: transparent !important;
border-right-color: transparent !important;
top: -20px; }
.joyride-tip-guide .joyride-nub.bottom {
border-color: #333333 !important;
border-bottom-color: transparent !important;
border-bottom-style: solid;
border-left-color: transparent !important;
border-right-color: transparent !important;
bottom: -20px; }
.joyride-tip-guide .joyride-nub.right {
right: -20px; }
.joyride-tip-guide .joyride-nub.left {
left: -20px; }
/* Typography */
.joyride-tip-guide h1,
.joyride-tip-guide h2,
.joyride-tip-guide h3,
.joyride-tip-guide h4,
.joyride-tip-guide h5,
.joyride-tip-guide h6 {
color: #FFFFFF;
font-weight: bold;
line-height: 1.25;
margin: 0; }
.joyride-tip-guide p {
font-size: 0.875rem;
line-height: 1.3;
margin: 0 0 1.125rem 0; }
.joyride-timer-indicator-wrap {
border: solid 1px #555555;
bottom: 1rem;
height: 3px;
position: absolute;
width: 50px;
right: 1.0625rem; }
.joyride-timer-indicator {
background: #666666;
display: block;
height: inherit;
width: 0; }
.joyride-close-tip {
color: #777777 !important;
font-size: 24px;
font-weight: normal;
line-height: .5 !important;
position: absolute;
text-decoration: none;
top: 10px;
right: 12px; }
.joyride-close-tip:hover, .joyride-close-tip:focus {
color: #EEEEEE !important; }
.joyride-modal-bg {
background: rgba(0, 0, 0, 0.5);
cursor: pointer;
display: none;
height: 100%;
position: fixed;
top: 0;
width: 100%;
z-index: 100;
left: 0; }
.joyride-expose-wrapper {
background-color: #FFFFFF;
border-radius: 3px;
box-shadow: 0 0 15px #FFFFFF;
position: absolute;
z-index: 102; }
.joyride-expose-cover {
background: transparent;
border-radius: 3px;
left: 0;
position: absolute;
top: 0;
z-index: 9999; }
/* Styles for screens that are at least 768px; */
@media only screen {
.joyride-tip-guide {
width: 300px;
left: inherit; }
.joyride-tip-guide .joyride-nub.bottom {
border-color: #333333 !important;
border-bottom-color: transparent !important;
border-left-color: transparent !important;
border-right-color: transparent !important;
bottom: -20px; }
.joyride-tip-guide .joyride-nub.right {
border-color: #333333 !important;
border-right-color: transparent !important;
border-bottom-color: transparent !important;
border-top-color: transparent !important;
left: auto;
right: -20px;
top: 22px; }
.joyride-tip-guide .joyride-nub.left {
border-color: #333333 !important;
border-bottom-color: transparent !important;
border-left-color: transparent !important;
border-top-color: transparent !important;
left: -20px;
right: auto;
top: 22px; } }
.keystroke,
kbd {
background-color: #ededed;
border-color: #dddddd;
color: #222222;
border-style: solid;
border-width: 1px;
font-family: "Consolas", "Menlo", "Courier", monospace;
font-size: inherit;
margin: 0;
padding: 0.125rem 0.25rem 0;
border-radius: 3px; }
.label {
display: inline-block;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-weight: normal;
line-height: 1;
margin-bottom: auto;
position: relative;
text-align: center;
text-decoration: none;
white-space: nowrap;
padding: 0.25rem 0.5rem 0.25rem;
font-size: 0.6875rem;
background-color: #008CBA;
color: #FFFFFF; }
.label.radius {
border-radius: 3px; }
.label.round {
border-radius: 1000px; }
.label.alert {
background-color: #f04124;
color: #FFFFFF; }
.label.warning {
background-color: #f08a24;
color: #FFFFFF; }
.label.success {
background-color: #43AC6A;
color: #FFFFFF; }
.label.secondary {
background-color: #e7e7e7;
color: #333333; }
.label.info {
background-color: #a0d3e8;
color: #333333; }
"[data-magellan-expedition]", [data-magellan-expedition-clone] {
background: #FFFFFF;
min-width: 100%;
padding: 10px;
z-index: 50; }
"[data-magellan-expedition]" .sub-nav, [data-magellan-expedition-clone] .sub-nav {
margin-bottom: 0; }
"[data-magellan-expedition]" .sub-nav dd, [data-magellan-expedition-clone] .sub-nav dd {
margin-bottom: 0; }
"[data-magellan-expedition]" .sub-nav a, [data-magellan-expedition-clone] .sub-nav a {
line-height: 1.8em; }
@-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg); }
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg); } }
@keyframes rotate {
from {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg); }
to {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg); } }
/* Orbit Graceful Loading */
.slideshow-wrapper {
position: relative; }
.slideshow-wrapper ul {
list-style-type: none;
margin: 0; }
.slideshow-wrapper ul li,
.slideshow-wrapper ul li .orbit-caption {
display: none; }
.slideshow-wrapper ul li:first-child {
display: block; }
.slideshow-wrapper .orbit-container {
background-color: transparent; }
.slideshow-wrapper .orbit-container li {
display: block; }
.slideshow-wrapper .orbit-container li .orbit-caption {
display: block; }
.slideshow-wrapper .orbit-container .orbit-bullets li {
display: inline-block; }
.slideshow-wrapper .preloader {
border-radius: 1000px;
-webkit-animation-duration: 1.5s;
animation-duration: 1.5s;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-name: rotate;
animation-name: rotate;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
border-color: #555555 #FFFFFF;
border: solid 3px;
display: block;
height: 40px;
left: 50%;
margin-left: -20px;
margin-top: -20px;
position: absolute;
top: 50%;
width: 40px; }
.orbit-container {
background: none;
overflow: hidden;
position: relative;
width: 100%; }
.orbit-container .orbit-slides-container {
list-style: none;
margin: 0;
padding: 0;
position: relative;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0); }
.orbit-container .orbit-slides-container img {
display: block;
max-width: 100%; }
.orbit-container .orbit-slides-container > * {
position: absolute;
top: 0;
width: 100%;
margin-left: 100%; }
.orbit-container .orbit-slides-container > *:first-child {
margin-left: 0; }
.orbit-container .orbit-slides-container > * .orbit-caption {
bottom: 0;
position: absolute;
background-color: rgba(51, 51, 51, 0.8);
color: #FFFFFF;
font-size: 0.875rem;
padding: 0.625rem 0.875rem;
width: 100%; }
.orbit-container .orbit-slide-number {
left: 10px;
background: transparent;
color: #FFFFFF;
font-size: 12px;
position: absolute;
top: 10px;
z-index: 10; }
.orbit-container .orbit-slide-number span {
font-weight: 700;
padding: 0.3125rem; }
.orbit-container .orbit-timer {
position: absolute;
top: 12px;
right: 10px;
height: 6px;
width: 100px;
z-index: 10; }
.orbit-container .orbit-timer .orbit-progress {
height: 3px;
background-color: rgba(255, 255, 255, 0.3);
display: block;
width: 0;
position: relative;
right: 20px;
top: 5px; }
.orbit-container .orbit-timer > span {
border: solid 4px #FFFFFF;
border-bottom: none;
border-top: none;
display: none;
height: 14px;
position: absolute;
top: 0;
width: 11px;
right: 0; }
.orbit-container .orbit-timer.paused > span {
top: 0;
width: 11px;
height: 14px;
border: inset 8px;
border-left-style: solid;
border-color: transparent;
border-left-color: #FFFFFF;
right: -4px; }
.orbit-container .orbit-timer.paused > span.dark {
border-left-color: #333333; }
.orbit-container:hover .orbit-timer > span {
display: block; }
.orbit-container .orbit-prev,
.orbit-container .orbit-next {
background-color: transparent;
color: white;
height: 60px;
line-height: 50px;
margin-top: -25px;
position: absolute;
text-indent: -9999px !important;
top: 45%;
width: 36px;
z-index: 10; }
.orbit-container .orbit-prev:hover,
.orbit-container .orbit-next:hover {
background-color: rgba(0, 0, 0, 0.3); }
.orbit-container .orbit-prev > span,
.orbit-container .orbit-next > span {
border: inset 10px;
display: block;
height: 0;
margin-top: -10px;
position: absolute;
top: 50%;
width: 0; }
.orbit-container .orbit-prev {
left: 0; }
.orbit-container .orbit-prev > span {
border-right-style: solid;
border-color: transparent;
border-right-color: #FFFFFF; }
.orbit-container .orbit-prev:hover > span {
border-right-color: #FFFFFF; }
.orbit-container .orbit-next {
right: 0; }
.orbit-container .orbit-next > span {
border-color: transparent;
border-left-style: solid;
border-left-color: #FFFFFF;
left: 50%;
margin-left: -4px; }
.orbit-container .orbit-next:hover > span {
border-left-color: #FFFFFF; }
.orbit-bullets-container {
text-align: center; }
.orbit-bullets {
display: block;
float: none;
margin: 0 auto 30px auto;
overflow: hidden;
position: relative;
text-align: center;
top: 10px; }
.orbit-bullets li {
background: #CCCCCC;
cursor: pointer;
display: inline-block;
float: none;
height: 0.5625rem;
margin-right: 6px;
width: 0.5625rem;
border-radius: 1000px; }
.orbit-bullets li.active {
background: #999999; }
.orbit-bullets li:last-child {
margin-right: 0; }
.touch .orbit-container .orbit-prev,
.touch .orbit-container .orbit-next {
display: none; }
.touch .orbit-bullets {
display: none; }
@media only screen and (min-width: 40.0625em) {
.touch .orbit-container .orbit-prev,
.touch .orbit-container .orbit-next {
display: inherit; }
.touch .orbit-bullets {
display: block; } }
@media only screen and (max-width: 40em) {
.orbit-stack-on-small .orbit-slides-container {
height: auto !important; }
.orbit-stack-on-small .orbit-slides-container > * {
margin: 0 !important;
opacity: 1 !important;
position: relative; }
.orbit-stack-on-small .orbit-slide-number {
display: none; }
.orbit-timer {
display: none; }
.orbit-next, .orbit-prev {
display: none; }
.orbit-bullets {
display: none; } }
ul.pagination {
display: block;
margin-left: -0.3125rem;
min-height: 1.5rem; }
ul.pagination li {
color: #222222;
font-size: 0.875rem;
height: 1.5rem;
margin-left: 0.3125rem; }
ul.pagination li a, ul.pagination li button {
border-radius: 3px;
transition: background-color 300ms ease-out;
background: none;
color: #999999;
display: block;
font-size: 1em;
font-weight: normal;
line-height: inherit;
padding: 0.0625rem 0.625rem 0.0625rem; }
ul.pagination li:hover a,
ul.pagination li a:focus,
ul.pagination li:hover button,
ul.pagination li button:focus {
background: #e6e6e6; }
ul.pagination li.unavailable a, ul.pagination li.unavailable button {
cursor: default;
color: #999999;
pointer-events: none; }
ul.pagination li.unavailable:hover a,
ul.pagination li.unavailable a:focus,
ul.pagination li.unavailable:hover button,
ul.pagination li.unavailable button:focus {
background: transparent; }
ul.pagination li.current a, ul.pagination li.current button {
background: #008CBA;
color: #FFFFFF;
cursor: default;
font-weight: bold; }
ul.pagination li.current a:hover, ul.pagination li.current a:focus, ul.pagination li.current button:hover, ul.pagination li.current button:focus {
background: #008CBA; }
ul.pagination li {
display: block;
float: left; }
/* Pagination centred wrapper */
.pagination-centered {
text-align: center; }
.pagination-centered ul.pagination li {
display: inline-block;
float: none; }
/* Panels */
.panel {
border-style: solid;
border-width: 1px;
border-color: #d8d8d8;
margin-bottom: 1.25rem;
padding: 1.25rem;
background: #f2f2f2;
color: #333333; }
.panel > :first-child {
margin-top: 0; }
.panel > :last-child {
margin-bottom: 0; }
.panel h1, .panel h2, .panel h3, .panel h4, .panel h5, .panel h6, .panel p, .panel li, .panel dl {
color: #333333; }
.panel h1, .panel h2, .panel h3, .panel h4, .panel h5, .panel h6 {
line-height: 1;
margin-bottom: 0.625rem; }
.panel h1.subheader, .panel h2.subheader, .panel h3.subheader, .panel h4.subheader, .panel h5.subheader, .panel h6.subheader {
line-height: 1.4; }
.panel.callout {
border-style: solid;
border-width: 1px;
border-color: #d8d8d8;
margin-bottom: 1.25rem;
padding: 1.25rem;
background: #ecfaff;
color: #333333; }
.panel.callout > :first-child {
margin-top: 0; }
.panel.callout > :last-child {
margin-bottom: 0; }
.panel.callout h1, .panel.callout h2, .panel.callout h3, .panel.callout h4, .panel.callout h5, .panel.callout h6, .panel.callout p, .panel.callout li, .panel.callout dl {
color: #333333; }
.panel.callout h1, .panel.callout h2, .panel.callout h3, .panel.callout h4, .panel.callout h5, .panel.callout h6 {
line-height: 1;
margin-bottom: 0.625rem; }
.panel.callout h1.subheader, .panel.callout h2.subheader, .panel.callout h3.subheader, .panel.callout h4.subheader, .panel.callout h5.subheader, .panel.callout h6.subheader {
line-height: 1.4; }
.panel.callout a:not(.button) {
color: #008CBA; }
.panel.callout a:not(.button):hover, .panel.callout a:not(.button):focus {
color: #0078a0; }
.panel.radius {
border-radius: 3px; }
/* Pricing Tables */
.pricing-table {
border: solid 1px #DDDDDD;
margin-left: 0;
margin-bottom: 1.25rem; }
.pricing-table * {
list-style: none;
line-height: 1; }
.pricing-table .title {
background-color: #333333;
color: #EEEEEE;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 1rem;
font-weight: normal;
padding: 0.9375rem 1.25rem;
text-align: center; }
.pricing-table .price {
background-color: #F6F6F6;
color: #333333;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 2rem;
font-weight: normal;
padding: 0.9375rem 1.25rem;
text-align: center; }
.pricing-table .description {
background-color: #FFFFFF;
border-bottom: dotted 1px #DDDDDD;
color: #777777;
font-size: 0.75rem;
font-weight: normal;
line-height: 1.4;
padding: 0.9375rem;
text-align: center; }
.pricing-table .bullet-item {
background-color: #FFFFFF;
border-bottom: dotted 1px #DDDDDD;
color: #333333;
font-size: 0.875rem;
font-weight: normal;
padding: 0.9375rem;
text-align: center; }
.pricing-table .cta-button {
background-color: #FFFFFF;
padding: 1.25rem 1.25rem 0;
text-align: center; }
/* Progress Bar */
.progress {
background-color: #F6F6F6;
border: 1px solid white;
height: 1.5625rem;
margin-bottom: 0.625rem;
padding: 0.125rem; }
.progress .meter {
background: #008CBA;
display: block;
height: 100%;
float: left;
width: 0%; }
.progress .meter.secondary {
background: #e7e7e7;
display: block;
height: 100%;
float: left;
width: 0%; }
.progress .meter.success {
background: #43AC6A;
display: block;
height: 100%;
float: left;
width: 0%; }
.progress .meter.alert {
background: #f04124;
display: block;
height: 100%;
float: left;
width: 0%; }
.progress.secondary .meter {
background: #e7e7e7;
display: block;
height: 100%;
float: left;
width: 0%; }
.progress.success .meter {
background: #43AC6A;
display: block;
height: 100%;
float: left;
width: 0%; }
.progress.alert .meter {
background: #f04124;
display: block;
height: 100%;
float: left;
width: 0%; }
.progress.radius {
border-radius: 3px; }
.progress.radius .meter {
border-radius: 2px; }
.progress.round {
border-radius: 1000px; }
.progress.round .meter {
border-radius: 999px; }
.range-slider {
border: 1px solid #DDDDDD;
margin: 1.25rem 0;
position: relative;
-ms-touch-action: none;
touch-action: none;
display: block;
height: 1rem;
width: 100%;
background: #FAFAFA; }
.range-slider.vertical-range {
border: 1px solid #DDDDDD;
margin: 1.25rem 0;
position: relative;
-ms-touch-action: none;
touch-action: none;
display: inline-block;
height: 12.5rem;
width: 1rem; }
.range-slider.vertical-range .range-slider-handle {
bottom: -10.5rem;
margin-left: -0.5rem;
margin-top: 0;
position: absolute; }
.range-slider.vertical-range .range-slider-active-segment {
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
border-top-left-radius: initial;
bottom: 0;
height: auto;
width: 0.875rem; }
.range-slider.radius {
background: #FAFAFA;
border-radius: 3px; }
.range-slider.radius .range-slider-handle {
background: #008CBA;
border-radius: 3px; }
.range-slider.radius .range-slider-handle:hover {
background: #007ba4; }
.range-slider.round {
background: #FAFAFA;
border-radius: 1000px; }
.range-slider.round .range-slider-handle {
background: #008CBA;
border-radius: 1000px; }
.range-slider.round .range-slider-handle:hover {
background: #007ba4; }
.range-slider.disabled, .range-slider[disabled] {
background: #FAFAFA;
cursor: not-allowed;
opacity: 0.7; }
.range-slider.disabled .range-slider-handle, .range-slider[disabled] .range-slider-handle {
background: #008CBA;
cursor: default;
opacity: 0.7; }
.range-slider.disabled .range-slider-handle:hover, .range-slider[disabled] .range-slider-handle:hover {
background: #007ba4; }
.range-slider-active-segment {
background: #e5e5e5;
border-bottom-left-radius: inherit;
border-top-left-radius: inherit;
display: inline-block;
height: 0.875rem;
position: absolute; }
.range-slider-handle {
border: 1px solid none;
cursor: pointer;
display: inline-block;
height: 1.375rem;
position: absolute;
top: -0.3125rem;
width: 2rem;
z-index: 1;
-ms-touch-action: manipulation;
touch-action: manipulation;
background: #008CBA; }
.range-slider-handle:hover {
background: #007ba4; }
.reveal-modal-bg {
background: #000000;
background: rgba(0, 0, 0, 0.45);
bottom: 0;
display: none;
left: 0;
position: fixed;
right: 0;
top: 0;
z-index: 1004;
left: 0; }
.reveal-modal {
border-radius: 3px;
display: none;
position: absolute;
top: 0;
visibility: hidden;
width: 100%;
z-index: 1005;
left: 0;
background-color: #FFFFFF;
padding: 1.875rem;
border: solid 1px #666666;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); }
@media only screen and (max-width: 40em) {
.reveal-modal {
min-height: 100vh; } }
.reveal-modal .column, .reveal-modal .columns {
min-width: 0; }
.reveal-modal > :first-child {
margin-top: 0; }
.reveal-modal > :last-child {
margin-bottom: 0; }
@media only screen and (min-width: 40.0625em) {
.reveal-modal {
left: 0;
margin: 0 auto;
max-width: 62.5rem;
right: 0;
width: 80%; } }
@media only screen and (min-width: 40.0625em) {
.reveal-modal {
top: 6.25rem; } }
.reveal-modal.radius {
box-shadow: none;
border-radius: 3px; }
.reveal-modal.round {
box-shadow: none;
border-radius: 1000px; }
.reveal-modal.collapse {
padding: 0;
box-shadow: none; }
@media only screen and (min-width: 40.0625em) {
.reveal-modal.tiny {
left: 0;
margin: 0 auto;
max-width: 62.5rem;
right: 0;
width: 30%; } }
@media only screen and (min-width: 40.0625em) {
.reveal-modal.small {
left: 0;
margin: 0 auto;
max-width: 62.5rem;
right: 0;
width: 40%; } }
@media only screen and (min-width: 40.0625em) {
.reveal-modal.medium {
left: 0;
margin: 0 auto;
max-width: 62.5rem;
right: 0;
width: 60%; } }
@media only screen and (min-width: 40.0625em) {
.reveal-modal.large {
left: 0;
margin: 0 auto;
max-width: 62.5rem;
right: 0;
width: 70%; } }
@media only screen and (min-width: 40.0625em) {
.reveal-modal.xlarge {
left: 0;
margin: 0 auto;
max-width: 62.5rem;
right: 0;
width: 95%; } }
.reveal-modal.full {
height: 100vh;
height: 100%;
left: 0;
margin-left: 0 !important;
max-width: none !important;
min-height: 100vh;
top: 0; }
@media only screen and (min-width: 40.0625em) {
.reveal-modal.full {
left: 0;
margin: 0 auto;
max-width: 62.5rem;
right: 0;
width: 100%; } }
.reveal-modal.toback {
z-index: 1003; }
.reveal-modal .close-reveal-modal {
color: #AAAAAA;
cursor: pointer;
font-size: 2.5rem;
font-weight: bold;
line-height: 1;
position: absolute;
top: 0.625rem;
right: 1.375rem; }
.side-nav {
display: block;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
list-style-position: outside;
list-style-type: none;
margin: 0;
padding: 0.875rem 0; }
.side-nav li {
font-size: 0.875rem;
font-weight: normal;
margin: 0 0 0.4375rem 0; }
.side-nav li a:not(.button) {
color: #008CBA;
display: block;
margin: 0;
padding: 0.4375rem 0.875rem; }
.side-nav li a:not(.button):hover, .side-nav li a:not(.button):focus {
background: rgba(0, 0, 0, 0.025);
color: #1cc7ff; }
.side-nav li a:not(.button):active {
color: #1cc7ff; }
.side-nav li.active > a:first-child:not(.button) {
color: #1cc7ff;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-weight: normal; }
.side-nav li.divider {
border-top: 1px solid;
height: 0;
list-style: none;
padding: 0;
border-top-color: #e6e6e6; }
.side-nav li.heading {
color: #008CBA;
font-size: 0.875rem;
font-weight: bold;
text-transform: uppercase; }
.split.button {
position: relative;
padding-right: 5.0625rem; }
.split.button span {
display: block;
height: 100%;
position: absolute;
right: 0;
top: 0;
border-left: solid 1px; }
.split.button span:after {
position: absolute;
content: "";
width: 0;
height: 0;
display: block;
border-style: inset;
top: 50%;
left: 50%; }
.split.button span:active {
background-color: rgba(0, 0, 0, 0.1); }
.split.button span {
border-left-color: rgba(255, 255, 255, 0.5); }
.split.button span {
width: 3.09375rem; }
.split.button span:after {
border-top-style: solid;
border-width: 0.375rem;
margin-left: -0.375rem;
top: 48%; }
.split.button span:after {
border-color: #FFFFFF transparent transparent transparent; }
.split.button.secondary span {
border-left-color: rgba(255, 255, 255, 0.5); }
.split.button.secondary span:after {
border-color: #FFFFFF transparent transparent transparent; }
.split.button.alert span {
border-left-color: rgba(255, 255, 255, 0.5); }
.split.button.success span {
border-left-color: rgba(255, 255, 255, 0.5); }
.split.button.tiny {
padding-right: 3.75rem; }
.split.button.tiny span {
width: 2.25rem; }
.split.button.tiny span:after {
border-top-style: solid;
border-width: 0.375rem;
margin-left: -0.375rem;
top: 48%; }
.split.button.small {
padding-right: 4.375rem; }
.split.button.small span {
width: 2.625rem; }
.split.button.small span:after {
border-top-style: solid;
border-width: 0.4375rem;
margin-left: -0.375rem;
top: 48%; }
.split.button.large {
padding-right: 5.5rem; }
.split.button.large span {
width: 3.4375rem; }
.split.button.large span:after {
border-top-style: solid;
border-width: 0.3125rem;
margin-left: -0.375rem;
top: 48%; }
.split.button.expand {
padding-left: 2rem; }
.split.button.secondary span:after {
border-color: #333333 transparent transparent transparent; }
.split.button.radius span {
-webkit-border-bottom-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px; }
.split.button.round span {
-webkit-border-bottom-right-radius: 1000px;
-webkit-border-top-right-radius: 1000px;
border-bottom-right-radius: 1000px;
border-top-right-radius: 1000px; }
.split.button.no-pip span:before {
border-style: none; }
.split.button.no-pip span:after {
border-style: none; }
.split.button.no-pip span > i {
display: block;
left: 50%;
margin-left: -0.28889em;
margin-top: -0.48889em;
position: absolute;
top: 50%; }
.sub-nav {
display: block;
margin: -0.25rem 0 1.125rem;
overflow: hidden;
padding-top: 0.25rem;
width: auto; }
.sub-nav dt {
text-transform: uppercase; }
.sub-nav dt,
.sub-nav dd,
.sub-nav li {
color: #999999;
float: left;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 0.875rem;
font-weight: normal;
margin-left: 1rem;
margin-bottom: 0; }
.sub-nav dt a,
.sub-nav dd a,
.sub-nav li a {
color: #999999;
padding: 0.1875rem 1rem;
text-decoration: none; }
.sub-nav dt a:hover,
.sub-nav dd a:hover,
.sub-nav li a:hover {
color: #737373; }
.sub-nav dt.active a,
.sub-nav dd.active a,
.sub-nav li.active a {
border-radius: 3px;
background: #008CBA;
color: #FFFFFF;
cursor: default;
font-weight: normal;
padding: 0.1875rem 1rem; }
.sub-nav dt.active a:hover,
.sub-nav dd.active a:hover,
.sub-nav li.active a:hover {
background: #0078a0; }
.switch {
border: none;
margin-bottom: 1.5rem;
outline: 0;
padding: 0;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.switch label {
background: #DDDDDD;
color: transparent;
cursor: pointer;
display: block;
margin-bottom: 1rem;
position: relative;
text-indent: 100%;
width: 4rem;
height: 2rem;
transition: left 0.15s ease-out; }
.switch input {
left: 10px;
opacity: 0;
padding: 0;
position: absolute;
top: 9px; }
.switch input + label {
margin-left: 0;
margin-right: 0; }
.switch label:after {
background: #FFFFFF;
content: "";
display: block;
height: 1.5rem;
left: .25rem;
position: absolute;
top: .25rem;
width: 1.5rem;
transition: left 0.15s ease-out;
-webkit-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
.switch input:checked + label {
background: #008CBA; }
.switch input:checked + label:after {
left: 2.25rem; }
.switch label {
height: 2rem;
width: 4rem; }
.switch label:after {
height: 1.5rem;
width: 1.5rem; }
.switch input:checked + label:after {
left: 2.25rem; }
.switch label {
color: transparent;
background: #DDDDDD; }
.switch label:after {
background: #FFFFFF; }
.switch input:checked + label {
background: #008CBA; }
.switch.large label {
height: 2.5rem;
width: 5rem; }
.switch.large label:after {
height: 2rem;
width: 2rem; }
.switch.large input:checked + label:after {
left: 2.75rem; }
.switch.small label {
height: 1.75rem;
width: 3.5rem; }
.switch.small label:after {
height: 1.25rem;
width: 1.25rem; }
.switch.small input:checked + label:after {
left: 2rem; }
.switch.tiny label {
height: 1.5rem;
width: 3rem; }
.switch.tiny label:after {
height: 1rem;
width: 1rem; }
.switch.tiny input:checked + label:after {
left: 1.75rem; }
.switch.radius label {
border-radius: 4px; }
.switch.radius label:after {
border-radius: 3px; }
.switch.round {
border-radius: 1000px; }
.switch.round label {
border-radius: 2rem; }
.switch.round label:after {
border-radius: 2rem; }
table {
background: #FFFFFF;
border: solid 1px #DDDDDD;
margin-bottom: 1.25rem;
table-layout: auto; }
table caption {
background: transparent;
color: #222222;
font-size: 1rem;
font-weight: bold; }
table thead {
background: #F5F5F5; }
table thead tr th,
table thead tr td {
color: #222222;
font-size: 0.875rem;
font-weight: bold;
padding: 0.5rem 0.625rem 0.625rem; }
table tfoot {
background: #F5F5F5; }
table tfoot tr th,
table tfoot tr td {
color: #222222;
font-size: 0.875rem;
font-weight: bold;
padding: 0.5rem 0.625rem 0.625rem; }
table tr th,
table tr td {
color: #222222;
font-size: 0.875rem;
padding: 0.5625rem 0.625rem;
text-align: left; }
table tr.even, table tr.alt, table tr:nth-of-type(even) {
background: #F9F9F9; }
table thead tr th,
table tfoot tr th,
table tfoot tr td,
table tbody tr th,
table tbody tr td,
table tr td {
display: table-cell;
line-height: 1.125rem; }
.tabs {
margin-bottom: 0 !important;
margin-left: 0; }
.tabs:before, .tabs:after {
content: " ";
display: table; }
.tabs:after {
clear: both; }
.tabs dd,
.tabs .tab-title {
float: left;
list-style: none;
margin-bottom: 0 !important;
position: relative; }
.tabs dd > a,
.tabs .tab-title > a {
display: block;
background-color: #EFEFEF;
color: #222222;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 1rem;
padding: 1rem 2rem; }
.tabs dd > a:hover,
.tabs .tab-title > a:hover {
background-color: #e1e1e1; }
.tabs dd.active > a,
.tabs .tab-title.active > a {
background-color: #FFFFFF;
color: #222222; }
.tabs.radius dd:first-child a,
.tabs.radius .tab:first-child a {
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
.tabs.radius dd:last-child a,
.tabs.radius .tab:last-child a {
-webkit-border-bottom-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px; }
.tabs.vertical dd,
.tabs.vertical .tab-title {
position: inherit;
float: none;
display: block;
top: auto; }
.tabs-content {
margin-bottom: 1.5rem;
width: 100%; }
.tabs-content:before, .tabs-content:after {
content: " ";
display: table; }
.tabs-content:after {
clear: both; }
.tabs-content > .content {
display: none;
float: left;
padding: 0.9375rem 0;
width: 100%; }
.tabs-content > .content.active {
display: block;
float: none; }
.tabs-content > .content.contained {
padding: 0.9375rem; }
.tabs-content.vertical {
display: block; }
.tabs-content.vertical > .content {
padding: 0 0.9375rem; }
@media only screen and (min-width: 40.0625em) {
.tabs.vertical {
float: left;
margin: 0;
margin-bottom: 1.25rem !important;
max-width: 20%;
width: 20%; }
.tabs-content.vertical {
float: left;
margin-left: -1px;
max-width: 80%;
padding-left: 1rem;
width: 80%; } }
.no-js .tabs-content > .content {
display: block;
float: none; }
/* Image Thumbnails */
.th {
border: solid 4px #FFFFFF;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
display: inline-block;
line-height: 0;
max-width: 100%;
transition: all 200ms ease-out; }
.th:hover, .th:focus {
box-shadow: 0 0 6px 1px rgba(0, 140, 186, 0.5); }
.th.radius {
border-radius: 3px; }
/* Tooltips */
.has-tip {
border-bottom: dotted 1px #CCCCCC;
color: #333333;
cursor: help;
font-weight: bold; }
.has-tip:hover, .has-tip:focus {
border-bottom: dotted 1px #003f54;
color: #008CBA; }
.has-tip.tip-left, .has-tip.tip-right {
float: none !important; }
.tooltip {
background: #333333;
color: #FFFFFF;
display: none;
font-size: 0.875rem;
font-weight: normal;
line-height: 1.3;
max-width: 300px;
padding: 0.75rem;
position: absolute;
width: 100%;
z-index: 1006;
left: 50%; }
.tooltip > .nub {
border: solid 5px;
border-color: transparent transparent #333333 transparent;
display: block;
height: 0;
pointer-events: none;
position: absolute;
top: -10px;
width: 0;
left: 5px; }
.tooltip > .nub.rtl {
left: auto;
right: 5px; }
.tooltip.radius {
border-radius: 3px; }
.tooltip.round {
border-radius: 1000px; }
.tooltip.round > .nub {
left: 2rem; }
.tooltip.opened {
border-bottom: dotted 1px #003f54 !important;
color: #008CBA !important; }
.tap-to-close {
color: #777777;
display: block;
font-size: 0.625rem;
font-weight: normal; }
@media only screen {
.tooltip > .nub {
border-color: transparent transparent #333333 transparent;
top: -10px; }
.tooltip.tip-top > .nub {
border-color: #333333 transparent transparent transparent;
bottom: -10px;
top: auto; }
.tooltip.tip-left, .tooltip.tip-right {
float: none !important; }
.tooltip.tip-left > .nub {
border-color: transparent transparent transparent #333333;
left: auto;
margin-top: -5px;
right: -10px;
top: 50%; }
.tooltip.tip-right > .nub {
border-color: transparent #333333 transparent transparent;
left: -10px;
margin-top: -5px;
right: auto;
top: 50%; } }
meta.foundation-mq-topbar {
font-family: "/only screen and (min-width:40.0625em)/";
width: 40.0625em; }
/* Wrapped around .top-bar to contain to grid width */
.contain-to-grid {
width: 100%;
background: #333333; }
.contain-to-grid .top-bar {
margin-bottom: 0; }
.fixed {
position: fixed;
top: 0;
width: 100%;
z-index: 99;
left: 0; }
.fixed.expanded:not(.top-bar) {
height: auto;
max-height: 100%;
overflow-y: auto;
width: 100%; }
.fixed.expanded:not(.top-bar) .title-area {
position: fixed;
width: 100%;
z-index: 99; }
.fixed.expanded:not(.top-bar) .top-bar-section {
margin-top: 2.8125rem;
z-index: 98; }
.top-bar {
background: #333333;
height: 2.8125rem;
line-height: 2.8125rem;
margin-bottom: 0;
overflow: hidden;
position: relative; }
.top-bar ul {
list-style: none;
margin-bottom: 0; }
.top-bar .row {
max-width: none; }
.top-bar form,
.top-bar input,
.top-bar select {
margin-bottom: 0; }
.top-bar input,
.top-bar select {
font-size: 0.75rem;
height: 1.75rem;
padding-bottom: .35rem;
padding-top: .35rem; }
.top-bar .button, .top-bar button {
font-size: 0.75rem;
margin-bottom: 0;
padding-bottom: 0.4125rem;
padding-top: 0.4125rem; }
@media only screen and (max-width: 40em) {
.top-bar .button, .top-bar button {
position: relative;
top: -1px; } }
.top-bar .title-area {
margin: 0;
position: relative; }
.top-bar .name {
font-size: 16px;
height: 2.8125rem;
margin: 0; }
.top-bar .name h1, .top-bar .name h2, .top-bar .name h3, .top-bar .name h4, .top-bar .name p, .top-bar .name span {
font-size: 1.0625rem;
line-height: 2.8125rem;
margin: 0; }
.top-bar .name h1 a, .top-bar .name h2 a, .top-bar .name h3 a, .top-bar .name h4 a, .top-bar .name p a, .top-bar .name span a {
color: #FFFFFF;
display: block;
font-weight: normal;
padding: 0 0.9375rem;
width: 75%; }
.top-bar .toggle-topbar {
position: absolute;
right: 0;
top: 0; }
.top-bar .toggle-topbar a {
color: #FFFFFF;
display: block;
font-size: 0.8125rem;
font-weight: bold;
height: 2.8125rem;
line-height: 2.8125rem;
padding: 0 0.9375rem;
position: relative;
text-transform: uppercase; }
.top-bar .toggle-topbar.menu-icon {
margin-top: -16px;
top: 50%; }
.top-bar .toggle-topbar.menu-icon a {
color: #FFFFFF;
height: 34px;
line-height: 33px;
padding: 0 2.5rem 0 0.9375rem;
position: relative; }
.top-bar .toggle-topbar.menu-icon a span::after {
content: "";
display: block;
height: 0;
position: absolute;
margin-top: -8px;
top: 50%;
right: 0.9375rem;
box-shadow: 0 0 0 1px #FFFFFF, 0 7px 0 1px #FFFFFF, 0 14px 0 1px #FFFFFF;
width: 16px; }
.top-bar .toggle-topbar.menu-icon a span:hover:after {
box-shadow: 0 0 0 1px "", 0 7px 0 1px "", 0 14px 0 1px ""; }
.top-bar.expanded {
background: transparent;
height: auto; }
.top-bar.expanded .title-area {
background: #333333; }
.top-bar.expanded .toggle-topbar a {
color: #888888; }
.top-bar.expanded .toggle-topbar a span::after {
box-shadow: 0 0 0 1px #888888, 0 7px 0 1px #888888, 0 14px 0 1px #888888; }
@media screen and (-webkit-min-device-pixel-ratio: 0) {
.top-bar.expanded .top-bar-section .has-dropdown.moved > .dropdown,
.top-bar.expanded .top-bar-section .dropdown {
clip: initial; }
.top-bar.expanded .top-bar-section .has-dropdown:not(.moved) > ul {
padding: 0; } }
.top-bar-section {
left: 0;
position: relative;
width: auto;
transition: left 300ms ease-out; }
.top-bar-section ul {
display: block;
font-size: 16px;
height: auto;
margin: 0;
padding: 0;
width: 100%; }
.top-bar-section .divider,
.top-bar-section [role="separator"] {
border-top: solid 1px #1a1a1a;
clear: both;
height: 1px;
width: 100%; }
.top-bar-section ul li {
background: #333333; }
.top-bar-section ul li > a {
color: #FFFFFF;
display: block;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 0.8125rem;
font-weight: normal;
padding-left: 0.9375rem;
padding: 12px 0 12px 0.9375rem;
text-transform: none;
width: 100%; }
.top-bar-section ul li > a.button {
font-size: 0.8125rem;
padding-left: 0.9375rem;
padding-right: 0.9375rem;
background-color: #008CBA;
border-color: #007095;
color: #FFFFFF; }
.top-bar-section ul li > a.button:hover, .top-bar-section ul li > a.button:focus {
background-color: #007095; }
.top-bar-section ul li > a.button:hover, .top-bar-section ul li > a.button:focus {
color: #FFFFFF; }
.top-bar-section ul li > a.button.secondary {
background-color: #e7e7e7;
border-color: #b9b9b9;
color: #333333; }
.top-bar-section ul li > a.button.secondary:hover, .top-bar-section ul li > a.button.secondary:focus {
background-color: #b9b9b9; }
.top-bar-section ul li > a.button.secondary:hover, .top-bar-section ul li > a.button.secondary:focus {
color: #333333; }
.top-bar-section ul li > a.button.success {
background-color: #43AC6A;
border-color: #368a55;
color: #FFFFFF; }
.top-bar-section ul li > a.button.success:hover, .top-bar-section ul li > a.button.success:focus {
background-color: #368a55; }
.top-bar-section ul li > a.button.success:hover, .top-bar-section ul li > a.button.success:focus {
color: #FFFFFF; }
.top-bar-section ul li > a.button.alert {
background-color: #f04124;
border-color: #cf2a0e;
color: #FFFFFF; }
.top-bar-section ul li > a.button.alert:hover, .top-bar-section ul li > a.button.alert:focus {
background-color: #cf2a0e; }
.top-bar-section ul li > a.button.alert:hover, .top-bar-section ul li > a.button.alert:focus {
color: #FFFFFF; }
.top-bar-section ul li > a.button.warning {
background-color: #f08a24;
border-color: #cf6e0e;
color: #FFFFFF; }
.top-bar-section ul li > a.button.warning:hover, .top-bar-section ul li > a.button.warning:focus {
background-color: #cf6e0e; }
.top-bar-section ul li > a.button.warning:hover, .top-bar-section ul li > a.button.warning:focus {
color: #FFFFFF; }
.top-bar-section ul li > a.button.info {
background-color: #a0d3e8;
border-color: #61b6d9;
color: #333333; }
.top-bar-section ul li > a.button.info:hover, .top-bar-section ul li > a.button.info:focus {
background-color: #61b6d9; }
.top-bar-section ul li > a.button.info:hover, .top-bar-section ul li > a.button.info:focus {
color: #FFFFFF; }
.top-bar-section ul li > button {
font-size: 0.8125rem;
padding-left: 0.9375rem;
padding-right: 0.9375rem;
background-color: #008CBA;
border-color: #007095;
color: #FFFFFF; }
.top-bar-section ul li > button:hover, .top-bar-section ul li > button:focus {
background-color: #007095; }
.top-bar-section ul li > button:hover, .top-bar-section ul li > button:focus {
color: #FFFFFF; }
.top-bar-section ul li > button.secondary {
background-color: #e7e7e7;
border-color: #b9b9b9;
color: #333333; }
.top-bar-section ul li > button.secondary:hover, .top-bar-section ul li > button.secondary:focus {
background-color: #b9b9b9; }
.top-bar-section ul li > button.secondary:hover, .top-bar-section ul li > button.secondary:focus {
color: #333333; }
.top-bar-section ul li > button.success {
background-color: #43AC6A;
border-color: #368a55;
color: #FFFFFF; }
.top-bar-section ul li > button.success:hover, .top-bar-section ul li > button.success:focus {
background-color: #368a55; }
.top-bar-section ul li > button.success:hover, .top-bar-section ul li > button.success:focus {
color: #FFFFFF; }
.top-bar-section ul li > button.alert {
background-color: #f04124;
border-color: #cf2a0e;
color: #FFFFFF; }
.top-bar-section ul li > button.alert:hover, .top-bar-section ul li > button.alert:focus {
background-color: #cf2a0e; }
.top-bar-section ul li > button.alert:hover, .top-bar-section ul li > button.alert:focus {
color: #FFFFFF; }
.top-bar-section ul li > button.warning {
background-color: #f08a24;
border-color: #cf6e0e;
color: #FFFFFF; }
.top-bar-section ul li > button.warning:hover, .top-bar-section ul li > button.warning:focus {
background-color: #cf6e0e; }
.top-bar-section ul li > button.warning:hover, .top-bar-section ul li > button.warning:focus {
color: #FFFFFF; }
.top-bar-section ul li > button.info {
background-color: #a0d3e8;
border-color: #61b6d9;
color: #333333; }
.top-bar-section ul li > button.info:hover, .top-bar-section ul li > button.info:focus {
background-color: #61b6d9; }
.top-bar-section ul li > button.info:hover, .top-bar-section ul li > button.info:focus {
color: #FFFFFF; }
.top-bar-section ul li:hover:not(.has-form) > a {
background-color: #555555;
color: #FFFFFF;
background: #222222; }
.top-bar-section ul li.active > a {
background: #008CBA;
color: #FFFFFF; }
.top-bar-section ul li.active > a:hover {
background: #0078a0;
color: #FFFFFF; }
.top-bar-section .has-form {
padding: 0.9375rem; }
.top-bar-section .has-dropdown {
position: relative; }
.top-bar-section .has-dropdown > a:after {
border: inset 5px;
content: "";
display: block;
height: 0;
width: 0;
border-color: transparent transparent transparent rgba(255, 255, 255, 0.4);
border-left-style: solid;
margin-right: 0.9375rem;
margin-top: -4.5px;
position: absolute;
top: 50%;
right: 0; }
.top-bar-section .has-dropdown.moved {
position: static; }
.top-bar-section .has-dropdown.moved > .dropdown {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto;
display: block;
position: absolute !important;
width: 100%; }
.top-bar-section .has-dropdown.moved > a:after {
display: none; }
.top-bar-section .dropdown {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px;
display: block;
padding: 0;
position: absolute;
top: 0;
z-index: 99;
left: 100%; }
.top-bar-section .dropdown li {
height: auto;
width: 100%; }
.top-bar-section .dropdown li a {
font-weight: normal;
padding: 8px 0.9375rem; }
.top-bar-section .dropdown li a.parent-link {
font-weight: normal; }
.top-bar-section .dropdown li.title h5, .top-bar-section .dropdown li.parent-link {
margin-bottom: 0;
margin-top: 0;
font-size: 1.125rem; }
.top-bar-section .dropdown li.title h5 a, .top-bar-section .dropdown li.parent-link a {
color: #FFFFFF;
display: block; }
.top-bar-section .dropdown li.title h5 a:hover, .top-bar-section .dropdown li.parent-link a:hover {
background: none; }
.top-bar-section .dropdown li.has-form {
padding: 8px 0.9375rem; }
.top-bar-section .dropdown li .button,
.top-bar-section .dropdown li button {
top: auto; }
.top-bar-section .dropdown label {
color: #777777;
font-size: 0.625rem;
font-weight: bold;
margin-bottom: 0;
padding: 8px 0.9375rem 2px;
text-transform: uppercase; }
.js-generated {
display: block; }
@media only screen and (min-width: 40.0625em) {
.top-bar {
background: #333333;
overflow: visible; }
.top-bar:before, .top-bar:after {
content: " ";
display: table; }
.top-bar:after {
clear: both; }
.top-bar .toggle-topbar {
display: none; }
.top-bar .title-area {
float: left; }
.top-bar .name h1 a,
.top-bar .name h2 a,
.top-bar .name h3 a,
.top-bar .name h4 a,
.top-bar .name h5 a,
.top-bar .name h6 a {
width: auto; }
.top-bar input,
.top-bar select,
.top-bar .button,
.top-bar button {
font-size: 0.875rem;
height: 1.75rem;
position: relative;
top: 0.53125rem; }
.top-bar .has-form > .button,
.top-bar .has-form > button {
font-size: 0.875rem;
height: 1.75rem;
position: relative;
top: 0.53125rem; }
.top-bar.expanded {
background: #333333; }
.contain-to-grid .top-bar {
margin: 0 auto;
margin-bottom: 0;
max-width: 62.5rem; }
.top-bar-section {
transition: none 0 0;
left: 0 !important; }
.top-bar-section ul {
display: inline;
height: auto !important;
width: auto; }
.top-bar-section ul li {
float: left; }
.top-bar-section ul li .js-generated {
display: none; }
.top-bar-section li.hover > a:not(.button) {
background-color: #555555;
background: #222222;
color: #FFFFFF; }
.top-bar-section li:not(.has-form) a:not(.button) {
background: #333333;
line-height: 2.8125rem;
padding: 0 0.9375rem; }
.top-bar-section li:not(.has-form) a:not(.button):hover {
background-color: #555555;
background: #222222; }
.top-bar-section li.active:not(.has-form) a:not(.button) {
background: #008CBA;
color: #FFFFFF;
line-height: 2.8125rem;
padding: 0 0.9375rem; }
.top-bar-section li.active:not(.has-form) a:not(.button):hover {
background: #0078a0;
color: #FFFFFF; }
.top-bar-section .has-dropdown > a {
padding-right: 2.1875rem !important; }
.top-bar-section .has-dropdown > a:after {
border: inset 5px;
content: "";
display: block;
height: 0;
width: 0;
border-color: rgba(255, 255, 255, 0.4) transparent transparent transparent;
border-top-style: solid;
margin-top: -2.5px;
top: 1.40625rem; }
.top-bar-section .has-dropdown.moved {
position: relative; }
.top-bar-section .has-dropdown.moved > .dropdown {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px;
display: block; }
.top-bar-section .has-dropdown.hover > .dropdown, .top-bar-section .has-dropdown.not-click:hover > .dropdown {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto;
display: block;
position: absolute !important; }
.top-bar-section .has-dropdown > a:focus + .dropdown {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto;
display: block;
position: absolute !important; }
.top-bar-section .has-dropdown .dropdown li.has-dropdown > a:after {
border: none;
content: "\00bb";
top: 0.1875rem;
right: 5px; }
.top-bar-section .dropdown {
left: 0;
background: transparent;
min-width: 100%;
top: auto; }
.top-bar-section .dropdown li a {
background: #333333;
color: #FFFFFF;
line-height: 2.8125rem;
padding: 12px 0.9375rem;
white-space: nowrap; }
.top-bar-section .dropdown li:not(.has-form):not(.active) > a:not(.button) {
background: #333333;
color: #FFFFFF; }
.top-bar-section .dropdown li:not(.has-form):not(.active):hover > a:not(.button) {
background-color: #555555;
color: #FFFFFF;
background: #222222; }
.top-bar-section .dropdown li label {
background: #333333;
white-space: nowrap; }
.top-bar-section .dropdown li .dropdown {
left: 100%;
top: 0; }
.top-bar-section > ul > .divider,
.top-bar-section > ul > [role="separator"] {
border-right: solid 1px #4e4e4e;
border-bottom: none;
border-top: none;
clear: none;
height: 2.8125rem;
width: 0; }
.top-bar-section .has-form {
background: #333333;
height: 2.8125rem;
padding: 0 0.9375rem; }
.top-bar-section .right li .dropdown {
left: auto;
right: 0; }
.top-bar-section .right li .dropdown li .dropdown {
right: 100%; }
.top-bar-section .left li .dropdown {
right: auto;
left: 0; }
.top-bar-section .left li .dropdown li .dropdown {
left: 100%; }
.no-js .top-bar-section ul li:hover > a {
background-color: #555555;
background: #222222;
color: #FFFFFF; }
.no-js .top-bar-section ul li:active > a {
background: #008CBA;
color: #FFFFFF; }
.no-js .top-bar-section .has-dropdown:hover > .dropdown {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto;
display: block;
position: absolute !important; }
.no-js .top-bar-section .has-dropdown > a:focus + .dropdown {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto;
display: block;
position: absolute !important; } }
.text-left {
text-align: left !important; }
.text-right {
text-align: right !important; }
.text-center {
text-align: center !important; }
.text-justify {
text-align: justify !important; }
@media only screen and (max-width: 40em) {
.small-only-text-left {
text-align: left !important; }
.small-only-text-right {
text-align: right !important; }
.small-only-text-center {
text-align: center !important; }
.small-only-text-justify {
text-align: justify !important; } }
@media only screen {
.small-text-left {
text-align: left !important; }
.small-text-right {
text-align: right !important; }
.small-text-center {
text-align: center !important; }
.small-text-justify {
text-align: justify !important; } }
@media only screen and (min-width: 40.0625em) and (max-width: 64em) {
.medium-only-text-left {
text-align: left !important; }
.medium-only-text-right {
text-align: right !important; }
.medium-only-text-center {
text-align: center !important; }
.medium-only-text-justify {
text-align: justify !important; } }
@media only screen and (min-width: 40.0625em) {
.medium-text-left {
text-align: left !important; }
.medium-text-right {
text-align: right !important; }
.medium-text-center {
text-align: center !important; }
.medium-text-justify {
text-align: justify !important; } }
@media only screen and (min-width: 64.0625em) and (max-width: 90em) {
.large-only-text-left {
text-align: left !important; }
.large-only-text-right {
text-align: right !important; }
.large-only-text-center {
text-align: center !important; }
.large-only-text-justify {
text-align: justify !important; } }
@media only screen and (min-width: 64.0625em) {
.large-text-left {
text-align: left !important; }
.large-text-right {
text-align: right !important; }
.large-text-center {
text-align: center !important; }
.large-text-justify {
text-align: justify !important; } }
@media only screen and (min-width: 90.0625em) and (max-width: 120em) {
.xlarge-only-text-left {
text-align: left !important; }
.xlarge-only-text-right {
text-align: right !important; }
.xlarge-only-text-center {
text-align: center !important; }
.xlarge-only-text-justify {
text-align: justify !important; } }
@media only screen and (min-width: 90.0625em) {
.xlarge-text-left {
text-align: left !important; }
.xlarge-text-right {
text-align: right !important; }
.xlarge-text-center {
text-align: center !important; }
.xlarge-text-justify {
text-align: justify !important; } }
@media only screen and (min-width: 120.0625em) and (max-width: 6249999.9375em) {
.xxlarge-only-text-left {
text-align: left !important; }
.xxlarge-only-text-right {
text-align: right !important; }
.xxlarge-only-text-center {
text-align: center !important; }
.xxlarge-only-text-justify {
text-align: justify !important; } }
@media only screen and (min-width: 120.0625em) {
.xxlarge-text-left {
text-align: left !important; }
.xxlarge-text-right {
text-align: right !important; }
.xxlarge-text-center {
text-align: center !important; }
.xxlarge-text-justify {
text-align: justify !important; } }
/* Typography resets */
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
form,
p,
blockquote,
th,
td {
margin: 0;
padding: 0; }
/* Default Link Styles */
a {
color: #008CBA;
line-height: inherit;
text-decoration: none; }
a:hover, a:focus {
color: #0078a0; }
a img {
border: none; }
/* Default paragraph styles */
p {
font-family: inherit;
font-size: 1rem;
font-weight: normal;
line-height: 1.6;
margin-bottom: 1.25rem;
text-rendering: optimizeLegibility; }
p.lead {
font-size: 1.21875rem;
line-height: 1.6; }
p aside {
font-size: 0.875rem;
font-style: italic;
line-height: 1.35; }
/* Default header styles */
h1, h2, h3, h4, h5, h6 {
color: #222222;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-style: normal;
font-weight: normal;
line-height: 1.4;
margin-bottom: 0.5rem;
margin-top: 0.2rem;
text-rendering: optimizeLegibility; }
h1 small, h2 small, h3 small, h4 small, h5 small, h6 small {
color: #6f6f6f;
font-size: 60%;
line-height: 0; }
h1 {
font-size: 2.125rem; }
h2 {
font-size: 1.6875rem; }
h3 {
font-size: 1.375rem; }
h4 {
font-size: 1.125rem; }
h5 {
font-size: 1.125rem; }
h6 {
font-size: 1rem; }
.subheader {
line-height: 1.4;
color: #6f6f6f;
font-weight: normal;
margin-top: 0.2rem;
margin-bottom: 0.5rem; }
hr {
border: solid #DDDDDD;
border-width: 1px 0 0;
clear: both;
height: 0;
margin: 1.25rem 0 1.1875rem; }
/* Helpful Typography Defaults */
em,
i {
font-style: italic;
line-height: inherit; }
strong,
b {
font-weight: bold;
line-height: inherit; }
small {
font-size: 60%;
line-height: inherit; }
code {
background-color: #f8f8f8;
border-color: #dfdfdf;
border-style: solid;
border-width: 1px;
color: #333333;
font-family: Consolas, "Liberation Mono", Courier, monospace;
font-weight: normal;
padding: 0.125rem 0.3125rem 0.0625rem; }
/* Lists */
ul,
ol,
dl {
font-family: inherit;
font-size: 1rem;
line-height: 1.6;
list-style-position: outside;
margin-bottom: 1.25rem; }
ul {
margin-left: 1.1rem; }
/* Unordered Lists */
ul li ul,
ul li ol {
margin-left: 1.25rem;
margin-bottom: 0; }
ul.square li ul, ul.circle li ul, ul.disc li ul {
list-style: inherit; }
ul.square {
list-style-type: square;
margin-left: 1.1rem; }
ul.circle {
list-style-type: circle;
margin-left: 1.1rem; }
ul.disc {
list-style-type: disc;
margin-left: 1.1rem; }
/* Ordered Lists */
ol {
margin-left: 1.4rem; }
ol li ul,
ol li ol {
margin-left: 1.25rem;
margin-bottom: 0; }
.no-bullet {
list-style-type: none;
margin-left: 0; }
.no-bullet li ul,
.no-bullet li ol {
margin-left: 1.25rem;
margin-bottom: 0;
list-style: none; }
/* Definition Lists */
dl dt {
margin-bottom: 0.3rem;
font-weight: bold; }
dl dd {
margin-bottom: 0.75rem; }
/* Abbreviations */
abbr,
acronym {
text-transform: uppercase;
font-size: 90%;
color: #222;
cursor: help; }
abbr {
text-transform: none; }
abbr[title] {
border-bottom: 1px dotted #DDDDDD; }
/* Blockquotes */
blockquote {
margin: 0 0 1.25rem;
padding: 0.5625rem 1.25rem 0 1.1875rem;
border-left: 1px solid #DDDDDD; }
blockquote cite {
display: block;
font-size: 0.8125rem;
color: #555555; }
blockquote cite:before {
content: "\2014 \0020"; }
blockquote cite a,
blockquote cite a:visited {
color: #555555; }
blockquote,
blockquote p {
line-height: 1.6;
color: #6f6f6f; }
/* Microformats */
.vcard {
display: inline-block;
margin: 0 0 1.25rem 0;
border: 1px solid #DDDDDD;
padding: 0.625rem 0.75rem; }
.vcard li {
margin: 0;
display: block; }
.vcard .fn {
font-weight: bold;
font-size: 0.9375rem; }
.vevent .summary {
font-weight: bold; }
.vevent abbr {
cursor: default;
text-decoration: none;
font-weight: bold;
border: none;
padding: 0 0.0625rem; }
@media only screen and (min-width: 40.0625em) {
h1, h2, h3, h4, h5, h6 {
line-height: 1.4; }
h1 {
font-size: 2.75rem; }
h2 {
font-size: 2.3125rem; }
h3 {
font-size: 1.6875rem; }
h4 {
font-size: 1.4375rem; }
h5 {
font-size: 1.125rem; }
h6 {
font-size: 1rem; } }
/*
* Print styles.
*
* Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/
* Credit to Paul Irish and HTML5 Boilerplate (html5boilerplate.com)
*/
@media print {
* {
background: transparent !important;
color: #000000 !important;
/* Black prints faster: h5bp.com/s */
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) ")"; }
.ir a:after,
a[href^="javascript:"]:after,
a[href^="#"]:after {
content: ""; }
pre,
blockquote {
border: 1px solid #999999;
page-break-inside: avoid; }
thead {
display: table-header-group;
/* h5bp.com/t */ }
tr,
img {
page-break-inside: avoid; }
img {
max-width: 100% !important; }
@page {
margin: 0.34in; }
p,
h2,
h3 {
orphans: 3;
widows: 3; }
h2,
h3 {
page-break-after: avoid; } }
.off-canvas-wrap {
-webkit-backface-visibility: hidden;
position: relative;
width: 100%;
overflow: hidden; }
.off-canvas-wrap.move-right, .off-canvas-wrap.move-left, .off-canvas-wrap.move-bottom, .off-canvas-wrap.move-top {
min-height: 100%;
-webkit-overflow-scrolling: touch; }
.inner-wrap {
position: relative;
width: 100%;
transition: -webkit-transform 500ms ease;
transition: transform 500ms ease;
transition: transform 500ms ease, -webkit-transform 500ms ease; }
.inner-wrap:before, .inner-wrap:after {
content: " ";
display: table; }
.inner-wrap:after {
clear: both; }
.tab-bar {
-webkit-backface-visibility: hidden;
background: #333333;
color: #FFFFFF;
height: 2.8125rem;
line-height: 2.8125rem;
position: relative; }
.tab-bar h1, .tab-bar h2, .tab-bar h3, .tab-bar h4, .tab-bar h5, .tab-bar h6 {
color: #FFFFFF;
font-weight: bold;
line-height: 2.8125rem;
margin: 0; }
.tab-bar h1, .tab-bar h2, .tab-bar h3, .tab-bar h4 {
font-size: 1.125rem; }
.left-small {
height: 2.8125rem;
position: absolute;
top: 0;
width: 2.8125rem;
border-right: solid 1px #1a1a1a;
left: 0; }
.right-small {
height: 2.8125rem;
position: absolute;
top: 0;
width: 2.8125rem;
border-left: solid 1px #1a1a1a;
right: 0; }
.tab-bar-section {
height: 2.8125rem;
padding: 0 0.625rem;
position: absolute;
text-align: center;
top: 0; }
.tab-bar-section.left {
text-align: left; }
.tab-bar-section.right {
text-align: right; }
.tab-bar-section.left {
left: 0;
right: 2.8125rem; }
.tab-bar-section.right {
left: 2.8125rem;
right: 0; }
.tab-bar-section.middle {
left: 2.8125rem;
right: 2.8125rem; }
.tab-bar .menu-icon {
color: #FFFFFF;
display: block;
height: 2.8125rem;
padding: 0;
position: relative;
text-indent: 2.1875rem;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
width: 2.8125rem; }
.tab-bar .menu-icon span::after {
content: "";
display: block;
height: 0;
position: absolute;
top: 50%;
margin-top: -0.5rem;
left: 0.90625rem;
box-shadow: 0 0 0 1px #FFFFFF, 0 7px 0 1px #FFFFFF, 0 14px 0 1px #FFFFFF;
width: 1rem; }
.tab-bar .menu-icon span:hover:after {
box-shadow: 0 0 0 1px #b3b3b3, 0 7px 0 1px #b3b3b3, 0 14px 0 1px #b3b3b3; }
.left-off-canvas-menu {
-webkit-backface-visibility: hidden;
background: #333333;
bottom: 0;
box-sizing: content-box;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
overflow-x: hidden;
overflow-y: auto;
position: absolute;
transition: -webkit-transform 500ms ease 0s;
transition: transform 500ms ease 0s;
transition: transform 500ms ease 0s, -webkit-transform 500ms ease 0s;
width: 15.625rem;
z-index: 1001;
-webkit-transform: translate3d(-100%, 0, 0);
-ms-transform: translate(-100%, 0);
transform: translate3d(-100%, 0, 0);
left: 0;
top: 0; }
.left-off-canvas-menu * {
-webkit-backface-visibility: hidden; }
.right-off-canvas-menu {
-webkit-backface-visibility: hidden;
background: #333333;
bottom: 0;
box-sizing: content-box;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
overflow-x: hidden;
overflow-y: auto;
position: absolute;
transition: -webkit-transform 500ms ease 0s;
transition: transform 500ms ease 0s;
transition: transform 500ms ease 0s, -webkit-transform 500ms ease 0s;
width: 15.625rem;
z-index: 1001;
-webkit-transform: translate3d(100%, 0, 0);
-ms-transform: translate(100%, 0);
transform: translate3d(100%, 0, 0);
right: 0;
top: 0; }
.right-off-canvas-menu * {
-webkit-backface-visibility: hidden; }
.top-off-canvas-menu {
-webkit-backface-visibility: hidden;
background: #333333;
bottom: 0;
box-sizing: content-box;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
overflow-x: hidden;
overflow-y: auto;
position: absolute;
transition: -webkit-transform 500ms ease 0s;
transition: transform 500ms ease 0s;
transition: transform 500ms ease 0s, -webkit-transform 500ms ease 0s;
width: 15.625rem;
z-index: 1001;
-webkit-transform: translate3d(0, -100%, 0);
-ms-transform: translate(0, -100%);
transform: translate3d(0, -100%, 0);
top: 0;
width: 100%;
height: 18.75rem; }
.top-off-canvas-menu * {
-webkit-backface-visibility: hidden; }
.bottom-off-canvas-menu {
-webkit-backface-visibility: hidden;
background: #333333;
bottom: 0;
box-sizing: content-box;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
overflow-x: hidden;
overflow-y: auto;
position: absolute;
transition: -webkit-transform 500ms ease 0s;
transition: transform 500ms ease 0s;
transition: transform 500ms ease 0s, -webkit-transform 500ms ease 0s;
width: 15.625rem;
z-index: 1001;
-webkit-transform: translate3d(0, 100%, 0);
-ms-transform: translate(0, 100%);
transform: translate3d(0, 100%, 0);
bottom: 0;
width: 100%;
height: 18.75rem; }
.bottom-off-canvas-menu * {
-webkit-backface-visibility: hidden; }
ul.off-canvas-list {
list-style-type: none;
margin: 0;
padding: 0; }
ul.off-canvas-list li label {
background: #444444;
border-bottom: none;
border-top: 1px solid #5e5e5e;
color: #999999;
display: block;
font-size: 0.75rem;
font-weight: bold;
margin: 0;
padding: 0.3rem 0.9375rem;
text-transform: uppercase; }
ul.off-canvas-list li a {
border-bottom: 1px solid #262626;
color: rgba(255, 255, 255, 0.7);
display: block;
padding: 0.66667rem;
transition: background 300ms ease; }
ul.off-canvas-list li a:hover {
background: #242424; }
ul.off-canvas-list li a:active {
background: #242424; }
.move-right > .inner-wrap {
-webkit-transform: translate3d(15.625rem, 0, 0);
-ms-transform: translate(15.625rem, 0);
transform: translate3d(15.625rem, 0, 0); }
.move-right .exit-off-canvas {
-webkit-backface-visibility: hidden;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: background 300ms ease;
-webkit-tap-highlight-color: transparent;
background: rgba(255, 255, 255, 0.2);
bottom: 0;
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 1002; }
@media only screen and (min-width: 40.0625em) {
.move-right .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.move-left > .inner-wrap {
-webkit-transform: translate3d(-15.625rem, 0, 0);
-ms-transform: translate(-15.625rem, 0);
transform: translate3d(-15.625rem, 0, 0); }
.move-left .exit-off-canvas {
-webkit-backface-visibility: hidden;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: background 300ms ease;
-webkit-tap-highlight-color: transparent;
background: rgba(255, 255, 255, 0.2);
bottom: 0;
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 1002; }
@media only screen and (min-width: 40.0625em) {
.move-left .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.move-top > .inner-wrap {
-webkit-transform: translate3d(0, -18.75rem, 0);
-ms-transform: translate(0, -18.75rem);
transform: translate3d(0, -18.75rem, 0); }
.move-top .exit-off-canvas {
-webkit-backface-visibility: hidden;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: background 300ms ease;
-webkit-tap-highlight-color: transparent;
background: rgba(255, 255, 255, 0.2);
bottom: 0;
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 1002; }
@media only screen and (min-width: 40.0625em) {
.move-top .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.move-bottom > .inner-wrap {
-webkit-transform: translate3d(0, 18.75rem, 0);
-ms-transform: translate(0, 18.75rem);
transform: translate3d(0, 18.75rem, 0); }
.move-bottom .exit-off-canvas {
-webkit-backface-visibility: hidden;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: background 300ms ease;
-webkit-tap-highlight-color: transparent;
background: rgba(255, 255, 255, 0.2);
bottom: 0;
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 1002; }
@media only screen and (min-width: 40.0625em) {
.move-bottom .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.offcanvas-overlap .left-off-canvas-menu, .offcanvas-overlap .right-off-canvas-menu,
.offcanvas-overlap .top-off-canvas-menu, .offcanvas-overlap .bottom-off-canvas-menu {
-ms-transform: none;
-webkit-transform: none;
transform: none;
z-index: 1003; }
.offcanvas-overlap .exit-off-canvas {
-webkit-backface-visibility: hidden;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: background 300ms ease;
-webkit-tap-highlight-color: transparent;
background: rgba(255, 255, 255, 0.2);
bottom: 0;
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 1002; }
@media only screen and (min-width: 40.0625em) {
.offcanvas-overlap .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.offcanvas-overlap-left .right-off-canvas-menu {
-ms-transform: none;
-webkit-transform: none;
transform: none;
z-index: 1003; }
.offcanvas-overlap-left .exit-off-canvas {
-webkit-backface-visibility: hidden;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: background 300ms ease;
-webkit-tap-highlight-color: transparent;
background: rgba(255, 255, 255, 0.2);
bottom: 0;
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 1002; }
@media only screen and (min-width: 40.0625em) {
.offcanvas-overlap-left .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.offcanvas-overlap-right .left-off-canvas-menu {
-ms-transform: none;
-webkit-transform: none;
transform: none;
z-index: 1003; }
.offcanvas-overlap-right .exit-off-canvas {
-webkit-backface-visibility: hidden;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: background 300ms ease;
-webkit-tap-highlight-color: transparent;
background: rgba(255, 255, 255, 0.2);
bottom: 0;
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 1002; }
@media only screen and (min-width: 40.0625em) {
.offcanvas-overlap-right .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.offcanvas-overlap-top .bottom-off-canvas-menu {
-ms-transform: none;
-webkit-transform: none;
transform: none;
z-index: 1003; }
.offcanvas-overlap-top .exit-off-canvas {
-webkit-backface-visibility: hidden;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: background 300ms ease;
-webkit-tap-highlight-color: transparent;
background: rgba(255, 255, 255, 0.2);
bottom: 0;
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 1002; }
@media only screen and (min-width: 40.0625em) {
.offcanvas-overlap-top .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.offcanvas-overlap-bottom .top-off-canvas-menu {
-ms-transform: none;
-webkit-transform: none;
transform: none;
z-index: 1003; }
.offcanvas-overlap-bottom .exit-off-canvas {
-webkit-backface-visibility: hidden;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
cursor: pointer;
transition: background 300ms ease;
-webkit-tap-highlight-color: transparent;
background: rgba(255, 255, 255, 0.2);
bottom: 0;
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 1002; }
@media only screen and (min-width: 40.0625em) {
.offcanvas-overlap-bottom .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.no-csstransforms .left-off-canvas-menu {
left: -15.625rem; }
.no-csstransforms .right-off-canvas-menu {
right: -15.625rem; }
.no-csstransforms .top-off-canvas-menu {
top: -18.75rem; }
.no-csstransforms .bottom-off-canvas-menu {
bottom: -18.75rem; }
.no-csstransforms .move-left > .inner-wrap {
right: 15.625rem; }
.no-csstransforms .move-right > .inner-wrap {
left: 15.625rem; }
.no-csstransforms .move-top > .inner-wrap {
right: 18.75rem; }
.no-csstransforms .move-bottom > .inner-wrap {
left: 18.75rem; }
.left-submenu {
-webkit-backface-visibility: hidden;
-webkit-overflow-scrolling: touch;
background: #333333;
bottom: 0;
box-sizing: content-box;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
position: absolute;
top: 0;
width: 15.625rem;
height: 18.75rem;
z-index: 1002;
-webkit-transform: translate3d(-100%, 0, 0);
-ms-transform: translate(-100%, 0);
transform: translate3d(-100%, 0, 0);
left: 0;
transition: -webkit-transform 500ms ease;
transition: transform 500ms ease;
transition: transform 500ms ease, -webkit-transform 500ms ease; }
.left-submenu * {
-webkit-backface-visibility: hidden; }
.left-submenu .back > a {
background: #444;
border-bottom: none;
border-top: 1px solid #5e5e5e;
color: #999999;
font-weight: bold;
padding: 0.3rem 0.9375rem;
text-transform: uppercase;
margin: 0; }
.left-submenu .back > a:hover {
background: #303030;
border-bottom: none;
border-top: 1px solid #5e5e5e; }
.left-submenu .back > a:before {
content: "\AB";
margin-right: .5rem;
display: inline; }
.left-submenu.move-right, .left-submenu.offcanvas-overlap-right, .left-submenu.offcanvas-overlap {
-webkit-transform: translate3d(0%, 0, 0);
-ms-transform: translate(0%, 0);
transform: translate3d(0%, 0, 0); }
.right-submenu {
-webkit-backface-visibility: hidden;
-webkit-overflow-scrolling: touch;
background: #333333;
bottom: 0;
box-sizing: content-box;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
position: absolute;
top: 0;
width: 15.625rem;
height: 18.75rem;
z-index: 1002;
-webkit-transform: translate3d(100%, 0, 0);
-ms-transform: translate(100%, 0);
transform: translate3d(100%, 0, 0);
right: 0;
transition: -webkit-transform 500ms ease;
transition: transform 500ms ease;
transition: transform 500ms ease, -webkit-transform 500ms ease; }
.right-submenu * {
-webkit-backface-visibility: hidden; }
.right-submenu .back > a {
background: #444;
border-bottom: none;
border-top: 1px solid #5e5e5e;
color: #999999;
font-weight: bold;
padding: 0.3rem 0.9375rem;
text-transform: uppercase;
margin: 0; }
.right-submenu .back > a:hover {
background: #303030;
border-bottom: none;
border-top: 1px solid #5e5e5e; }
.right-submenu .back > a:after {
content: "\BB";
margin-left: .5rem;
display: inline; }
.right-submenu.move-left, .right-submenu.offcanvas-overlap-left, .right-submenu.offcanvas-overlap {
-webkit-transform: translate3d(0%, 0, 0);
-ms-transform: translate(0%, 0);
transform: translate3d(0%, 0, 0); }
.top-submenu {
-webkit-backface-visibility: hidden;
-webkit-overflow-scrolling: touch;
background: #333333;
bottom: 0;
box-sizing: content-box;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
position: absolute;
top: 0;
width: 15.625rem;
height: 18.75rem;
z-index: 1002;
-webkit-transform: translate3d(0, -100%, 0);
-ms-transform: translate(0, -100%);
transform: translate3d(0, -100%, 0);
top: 0;
width: 100%;
transition: -webkit-transform 500ms ease;
transition: transform 500ms ease;
transition: transform 500ms ease, -webkit-transform 500ms ease; }
.top-submenu * {
-webkit-backface-visibility: hidden; }
.top-submenu .back > a {
background: #444;
border-bottom: none;
border-top: 1px solid #5e5e5e;
color: #999999;
font-weight: bold;
padding: 0.3rem 0.9375rem;
text-transform: uppercase;
margin: 0; }
.top-submenu .back > a:hover {
background: #303030;
border-bottom: none;
border-top: 1px solid #5e5e5e; }
.top-submenu.move-bottom, .top-submenu.offcanvas-overlap-bottom, .top-submenu.offcanvas-overlap {
-webkit-transform: translate3d(0, 0%, 0);
-ms-transform: translate(0, 0%);
transform: translate3d(0, 0%, 0); }
.bottom-submenu {
-webkit-backface-visibility: hidden;
-webkit-overflow-scrolling: touch;
background: #333333;
bottom: 0;
box-sizing: content-box;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
position: absolute;
top: 0;
width: 15.625rem;
height: 18.75rem;
z-index: 1002;
-webkit-transform: translate3d(0, 100%, 0);
-ms-transform: translate(0, 100%);
transform: translate3d(0, 100%, 0);
bottom: 0;
width: 100%;
transition: -webkit-transform 500ms ease;
transition: transform 500ms ease;
transition: transform 500ms ease, -webkit-transform 500ms ease; }
.bottom-submenu * {
-webkit-backface-visibility: hidden; }
.bottom-submenu .back > a {
background: #444;
border-bottom: none;
border-top: 1px solid #5e5e5e;
color: #999999;
font-weight: bold;
padding: 0.3rem 0.9375rem;
text-transform: uppercase;
margin: 0; }
.bottom-submenu .back > a:hover {
background: #303030;
border-bottom: none;
border-top: 1px solid #5e5e5e; }
.bottom-submenu.move-top, .bottom-submenu.offcanvas-overlap-top, .bottom-submenu.offcanvas-overlap {
-webkit-transform: translate3d(0, 0%, 0);
-ms-transform: translate(0, 0%);
transform: translate3d(0, 0%, 0); }
.left-off-canvas-menu ul.off-canvas-list li.has-submenu > a:after {
content: "\BB";
margin-left: .5rem;
display: inline; }
.right-off-canvas-menu ul.off-canvas-list li.has-submenu > a:before {
content: "\AB";
margin-right: .5rem;
display: inline; }
/* small displays */
@media only screen {
.show-for-small-only, .show-for-small-up, .show-for-small, .show-for-small-down, .hide-for-medium-only, .hide-for-medium-up, .hide-for-medium, .show-for-medium-down, .hide-for-large-only, .hide-for-large-up, .hide-for-large, .show-for-large-down, .hide-for-xlarge-only, .hide-for-xlarge-up, .hide-for-xlarge, .show-for-xlarge-down, .hide-for-xxlarge-only, .hide-for-xxlarge-up, .hide-for-xxlarge, .show-for-xxlarge-down {
display: inherit !important; }
.hide-for-small-only, .hide-for-small-up, .hide-for-small, .hide-for-small-down, .show-for-medium-only, .show-for-medium-up, .show-for-medium, .hide-for-medium-down, .show-for-large-only, .show-for-large-up, .show-for-large, .hide-for-large-down, .show-for-xlarge-only, .show-for-xlarge-up, .show-for-xlarge, .hide-for-xlarge-down, .show-for-xxlarge-only, .show-for-xxlarge-up, .show-for-xxlarge, .hide-for-xxlarge-down {
display: none !important; }
.visible-for-small-only, .visible-for-small-up, .visible-for-small, .visible-for-small-down, .hidden-for-medium-only, .hidden-for-medium-up, .hidden-for-medium, .visible-for-medium-down, .hidden-for-large-only, .hidden-for-large-up, .hidden-for-large, .visible-for-large-down, .hidden-for-xlarge-only, .hidden-for-xlarge-up, .hidden-for-xlarge, .visible-for-xlarge-down, .hidden-for-xxlarge-only, .hidden-for-xxlarge-up, .hidden-for-xxlarge, .visible-for-xxlarge-down {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto; }
.hidden-for-small-only, .hidden-for-small-up, .hidden-for-small, .hidden-for-small-down, .visible-for-medium-only, .visible-for-medium-up, .visible-for-medium, .hidden-for-medium-down, .visible-for-large-only, .visible-for-large-up, .visible-for-large, .hidden-for-large-down, .visible-for-xlarge-only, .visible-for-xlarge-up, .visible-for-xlarge, .hidden-for-xlarge-down, .visible-for-xxlarge-only, .visible-for-xxlarge-up, .visible-for-xxlarge, .hidden-for-xxlarge-down {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px; }
table.show-for-small-only, table.show-for-small-up, table.show-for-small, table.show-for-small-down, table.hide-for-medium-only, table.hide-for-medium-up, table.hide-for-medium, table.show-for-medium-down, table.hide-for-large-only, table.hide-for-large-up, table.hide-for-large, table.show-for-large-down, table.hide-for-xlarge-only, table.hide-for-xlarge-up, table.hide-for-xlarge, table.show-for-xlarge-down, table.hide-for-xxlarge-only, table.hide-for-xxlarge-up, table.hide-for-xxlarge, table.show-for-xxlarge-down {
display: table !important; }
thead.show-for-small-only, thead.show-for-small-up, thead.show-for-small, thead.show-for-small-down, thead.hide-for-medium-only, thead.hide-for-medium-up, thead.hide-for-medium, thead.show-for-medium-down, thead.hide-for-large-only, thead.hide-for-large-up, thead.hide-for-large, thead.show-for-large-down, thead.hide-for-xlarge-only, thead.hide-for-xlarge-up, thead.hide-for-xlarge, thead.show-for-xlarge-down, thead.hide-for-xxlarge-only, thead.hide-for-xxlarge-up, thead.hide-for-xxlarge, thead.show-for-xxlarge-down {
display: table-header-group !important; }
tbody.show-for-small-only, tbody.show-for-small-up, tbody.show-for-small, tbody.show-for-small-down, tbody.hide-for-medium-only, tbody.hide-for-medium-up, tbody.hide-for-medium, tbody.show-for-medium-down, tbody.hide-for-large-only, tbody.hide-for-large-up, tbody.hide-for-large, tbody.show-for-large-down, tbody.hide-for-xlarge-only, tbody.hide-for-xlarge-up, tbody.hide-for-xlarge, tbody.show-for-xlarge-down, tbody.hide-for-xxlarge-only, tbody.hide-for-xxlarge-up, tbody.hide-for-xxlarge, tbody.show-for-xxlarge-down {
display: table-row-group !important; }
tr.show-for-small-only, tr.show-for-small-up, tr.show-for-small, tr.show-for-small-down, tr.hide-for-medium-only, tr.hide-for-medium-up, tr.hide-for-medium, tr.show-for-medium-down, tr.hide-for-large-only, tr.hide-for-large-up, tr.hide-for-large, tr.show-for-large-down, tr.hide-for-xlarge-only, tr.hide-for-xlarge-up, tr.hide-for-xlarge, tr.show-for-xlarge-down, tr.hide-for-xxlarge-only, tr.hide-for-xxlarge-up, tr.hide-for-xxlarge, tr.show-for-xxlarge-down {
display: table-row; }
th.show-for-small-only, td.show-for-small-only, th.show-for-small-up, td.show-for-small-up, th.show-for-small, td.show-for-small, th.show-for-small-down, td.show-for-small-down, th.hide-for-medium-only, td.hide-for-medium-only, th.hide-for-medium-up, td.hide-for-medium-up, th.hide-for-medium, td.hide-for-medium, th.show-for-medium-down, td.show-for-medium-down, th.hide-for-large-only, td.hide-for-large-only, th.hide-for-large-up, td.hide-for-large-up, th.hide-for-large, td.hide-for-large, th.show-for-large-down, td.show-for-large-down, th.hide-for-xlarge-only, td.hide-for-xlarge-only, th.hide-for-xlarge-up, td.hide-for-xlarge-up, th.hide-for-xlarge, td.hide-for-xlarge, th.show-for-xlarge-down, td.show-for-xlarge-down, th.hide-for-xxlarge-only, td.hide-for-xxlarge-only, th.hide-for-xxlarge-up, td.hide-for-xxlarge-up, th.hide-for-xxlarge, td.hide-for-xxlarge, th.show-for-xxlarge-down, td.show-for-xxlarge-down {
display: table-cell !important; } }
/* medium displays */
@media only screen and (min-width: 40.0625em) {
.hide-for-small-only, .show-for-small-up, .hide-for-small, .hide-for-small-down, .show-for-medium-only, .show-for-medium-up, .show-for-medium, .show-for-medium-down, .hide-for-large-only, .hide-for-large-up, .hide-for-large, .show-for-large-down, .hide-for-xlarge-only, .hide-for-xlarge-up, .hide-for-xlarge, .show-for-xlarge-down, .hide-for-xxlarge-only, .hide-for-xxlarge-up, .hide-for-xxlarge, .show-for-xxlarge-down {
display: inherit !important; }
.show-for-small-only, .hide-for-small-up, .show-for-small, .show-for-small-down, .hide-for-medium-only, .hide-for-medium-up, .hide-for-medium, .hide-for-medium-down, .show-for-large-only, .show-for-large-up, .show-for-large, .hide-for-large-down, .show-for-xlarge-only, .show-for-xlarge-up, .show-for-xlarge, .hide-for-xlarge-down, .show-for-xxlarge-only, .show-for-xxlarge-up, .show-for-xxlarge, .hide-for-xxlarge-down {
display: none !important; }
.hidden-for-small-only, .visible-for-small-up, .hidden-for-small, .hidden-for-small-down, .visible-for-medium-only, .visible-for-medium-up, .visible-for-medium, .visible-for-medium-down, .hidden-for-large-only, .hidden-for-large-up, .hidden-for-large, .visible-for-large-down, .hidden-for-xlarge-only, .hidden-for-xlarge-up, .hidden-for-xlarge, .visible-for-xlarge-down, .hidden-for-xxlarge-only, .hidden-for-xxlarge-up, .hidden-for-xxlarge, .visible-for-xxlarge-down {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto; }
.visible-for-small-only, .hidden-for-small-up, .visible-for-small, .visible-for-small-down, .hidden-for-medium-only, .hidden-for-medium-up, .hidden-for-medium, .hidden-for-medium-down, .visible-for-large-only, .visible-for-large-up, .visible-for-large, .hidden-for-large-down, .visible-for-xlarge-only, .visible-for-xlarge-up, .visible-for-xlarge, .hidden-for-xlarge-down, .visible-for-xxlarge-only, .visible-for-xxlarge-up, .visible-for-xxlarge, .hidden-for-xxlarge-down {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px; }
table.hide-for-small-only, table.show-for-small-up, table.hide-for-small, table.hide-for-small-down, table.show-for-medium-only, table.show-for-medium-up, table.show-for-medium, table.show-for-medium-down, table.hide-for-large-only, table.hide-for-large-up, table.hide-for-large, table.show-for-large-down, table.hide-for-xlarge-only, table.hide-for-xlarge-up, table.hide-for-xlarge, table.show-for-xlarge-down, table.hide-for-xxlarge-only, table.hide-for-xxlarge-up, table.hide-for-xxlarge, table.show-for-xxlarge-down {
display: table !important; }
thead.hide-for-small-only, thead.show-for-small-up, thead.hide-for-small, thead.hide-for-small-down, thead.show-for-medium-only, thead.show-for-medium-up, thead.show-for-medium, thead.show-for-medium-down, thead.hide-for-large-only, thead.hide-for-large-up, thead.hide-for-large, thead.show-for-large-down, thead.hide-for-xlarge-only, thead.hide-for-xlarge-up, thead.hide-for-xlarge, thead.show-for-xlarge-down, thead.hide-for-xxlarge-only, thead.hide-for-xxlarge-up, thead.hide-for-xxlarge, thead.show-for-xxlarge-down {
display: table-header-group !important; }
tbody.hide-for-small-only, tbody.show-for-small-up, tbody.hide-for-small, tbody.hide-for-small-down, tbody.show-for-medium-only, tbody.show-for-medium-up, tbody.show-for-medium, tbody.show-for-medium-down, tbody.hide-for-large-only, tbody.hide-for-large-up, tbody.hide-for-large, tbody.show-for-large-down, tbody.hide-for-xlarge-only, tbody.hide-for-xlarge-up, tbody.hide-for-xlarge, tbody.show-for-xlarge-down, tbody.hide-for-xxlarge-only, tbody.hide-for-xxlarge-up, tbody.hide-for-xxlarge, tbody.show-for-xxlarge-down {
display: table-row-group !important; }
tr.hide-for-small-only, tr.show-for-small-up, tr.hide-for-small, tr.hide-for-small-down, tr.show-for-medium-only, tr.show-for-medium-up, tr.show-for-medium, tr.show-for-medium-down, tr.hide-for-large-only, tr.hide-for-large-up, tr.hide-for-large, tr.show-for-large-down, tr.hide-for-xlarge-only, tr.hide-for-xlarge-up, tr.hide-for-xlarge, tr.show-for-xlarge-down, tr.hide-for-xxlarge-only, tr.hide-for-xxlarge-up, tr.hide-for-xxlarge, tr.show-for-xxlarge-down {
display: table-row; }
th.hide-for-small-only, td.hide-for-small-only, th.show-for-small-up, td.show-for-small-up, th.hide-for-small, td.hide-for-small, th.hide-for-small-down, td.hide-for-small-down, th.show-for-medium-only, td.show-for-medium-only, th.show-for-medium-up, td.show-for-medium-up, th.show-for-medium, td.show-for-medium, th.show-for-medium-down, td.show-for-medium-down, th.hide-for-large-only, td.hide-for-large-only, th.hide-for-large-up, td.hide-for-large-up, th.hide-for-large, td.hide-for-large, th.show-for-large-down, td.show-for-large-down, th.hide-for-xlarge-only, td.hide-for-xlarge-only, th.hide-for-xlarge-up, td.hide-for-xlarge-up, th.hide-for-xlarge, td.hide-for-xlarge, th.show-for-xlarge-down, td.show-for-xlarge-down, th.hide-for-xxlarge-only, td.hide-for-xxlarge-only, th.hide-for-xxlarge-up, td.hide-for-xxlarge-up, th.hide-for-xxlarge, td.hide-for-xxlarge, th.show-for-xxlarge-down, td.show-for-xxlarge-down {
display: table-cell !important; } }
/* large displays */
@media only screen and (min-width: 64.0625em) {
.hide-for-small-only, .show-for-small-up, .hide-for-small, .hide-for-small-down, .hide-for-medium-only, .show-for-medium-up, .hide-for-medium, .hide-for-medium-down, .show-for-large-only, .show-for-large-up, .show-for-large, .show-for-large-down, .hide-for-xlarge-only, .hide-for-xlarge-up, .hide-for-xlarge, .show-for-xlarge-down, .hide-for-xxlarge-only, .hide-for-xxlarge-up, .hide-for-xxlarge, .show-for-xxlarge-down {
display: inherit !important; }
.show-for-small-only, .hide-for-small-up, .show-for-small, .show-for-small-down, .show-for-medium-only, .hide-for-medium-up, .show-for-medium, .show-for-medium-down, .hide-for-large-only, .hide-for-large-up, .hide-for-large, .hide-for-large-down, .show-for-xlarge-only, .show-for-xlarge-up, .show-for-xlarge, .hide-for-xlarge-down, .show-for-xxlarge-only, .show-for-xxlarge-up, .show-for-xxlarge, .hide-for-xxlarge-down {
display: none !important; }
.hidden-for-small-only, .visible-for-small-up, .hidden-for-small, .hidden-for-small-down, .hidden-for-medium-only, .visible-for-medium-up, .hidden-for-medium, .hidden-for-medium-down, .visible-for-large-only, .visible-for-large-up, .visible-for-large, .visible-for-large-down, .hidden-for-xlarge-only, .hidden-for-xlarge-up, .hidden-for-xlarge, .visible-for-xlarge-down, .hidden-for-xxlarge-only, .hidden-for-xxlarge-up, .hidden-for-xxlarge, .visible-for-xxlarge-down {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto; }
.visible-for-small-only, .hidden-for-small-up, .visible-for-small, .visible-for-small-down, .visible-for-medium-only, .hidden-for-medium-up, .visible-for-medium, .visible-for-medium-down, .hidden-for-large-only, .hidden-for-large-up, .hidden-for-large, .hidden-for-large-down, .visible-for-xlarge-only, .visible-for-xlarge-up, .visible-for-xlarge, .hidden-for-xlarge-down, .visible-for-xxlarge-only, .visible-for-xxlarge-up, .visible-for-xxlarge, .hidden-for-xxlarge-down {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px; }
table.hide-for-small-only, table.show-for-small-up, table.hide-for-small, table.hide-for-small-down, table.hide-for-medium-only, table.show-for-medium-up, table.hide-for-medium, table.hide-for-medium-down, table.show-for-large-only, table.show-for-large-up, table.show-for-large, table.show-for-large-down, table.hide-for-xlarge-only, table.hide-for-xlarge-up, table.hide-for-xlarge, table.show-for-xlarge-down, table.hide-for-xxlarge-only, table.hide-for-xxlarge-up, table.hide-for-xxlarge, table.show-for-xxlarge-down {
display: table !important; }
thead.hide-for-small-only, thead.show-for-small-up, thead.hide-for-small, thead.hide-for-small-down, thead.hide-for-medium-only, thead.show-for-medium-up, thead.hide-for-medium, thead.hide-for-medium-down, thead.show-for-large-only, thead.show-for-large-up, thead.show-for-large, thead.show-for-large-down, thead.hide-for-xlarge-only, thead.hide-for-xlarge-up, thead.hide-for-xlarge, thead.show-for-xlarge-down, thead.hide-for-xxlarge-only, thead.hide-for-xxlarge-up, thead.hide-for-xxlarge, thead.show-for-xxlarge-down {
display: table-header-group !important; }
tbody.hide-for-small-only, tbody.show-for-small-up, tbody.hide-for-small, tbody.hide-for-small-down, tbody.hide-for-medium-only, tbody.show-for-medium-up, tbody.hide-for-medium, tbody.hide-for-medium-down, tbody.show-for-large-only, tbody.show-for-large-up, tbody.show-for-large, tbody.show-for-large-down, tbody.hide-for-xlarge-only, tbody.hide-for-xlarge-up, tbody.hide-for-xlarge, tbody.show-for-xlarge-down, tbody.hide-for-xxlarge-only, tbody.hide-for-xxlarge-up, tbody.hide-for-xxlarge, tbody.show-for-xxlarge-down {
display: table-row-group !important; }
tr.hide-for-small-only, tr.show-for-small-up, tr.hide-for-small, tr.hide-for-small-down, tr.hide-for-medium-only, tr.show-for-medium-up, tr.hide-for-medium, tr.hide-for-medium-down, tr.show-for-large-only, tr.show-for-large-up, tr.show-for-large, tr.show-for-large-down, tr.hide-for-xlarge-only, tr.hide-for-xlarge-up, tr.hide-for-xlarge, tr.show-for-xlarge-down, tr.hide-for-xxlarge-only, tr.hide-for-xxlarge-up, tr.hide-for-xxlarge, tr.show-for-xxlarge-down {
display: table-row; }
th.hide-for-small-only, td.hide-for-small-only, th.show-for-small-up, td.show-for-small-up, th.hide-for-small, td.hide-for-small, th.hide-for-small-down, td.hide-for-small-down, th.hide-for-medium-only, td.hide-for-medium-only, th.show-for-medium-up, td.show-for-medium-up, th.hide-for-medium, td.hide-for-medium, th.hide-for-medium-down, td.hide-for-medium-down, th.show-for-large-only, td.show-for-large-only, th.show-for-large-up, td.show-for-large-up, th.show-for-large, td.show-for-large, th.show-for-large-down, td.show-for-large-down, th.hide-for-xlarge-only, td.hide-for-xlarge-only, th.hide-for-xlarge-up, td.hide-for-xlarge-up, th.hide-for-xlarge, td.hide-for-xlarge, th.show-for-xlarge-down, td.show-for-xlarge-down, th.hide-for-xxlarge-only, td.hide-for-xxlarge-only, th.hide-for-xxlarge-up, td.hide-for-xxlarge-up, th.hide-for-xxlarge, td.hide-for-xxlarge, th.show-for-xxlarge-down, td.show-for-xxlarge-down {
display: table-cell !important; } }
/* xlarge displays */
@media only screen and (min-width: 90.0625em) {
.hide-for-small-only, .show-for-small-up, .hide-for-small, .hide-for-small-down, .hide-for-medium-only, .show-for-medium-up, .hide-for-medium, .hide-for-medium-down, .hide-for-large-only, .show-for-large-up, .hide-for-large, .hide-for-large-down, .show-for-xlarge-only, .show-for-xlarge-up, .show-for-xlarge, .show-for-xlarge-down, .hide-for-xxlarge-only, .hide-for-xxlarge-up, .hide-for-xxlarge, .show-for-xxlarge-down {
display: inherit !important; }
.show-for-small-only, .hide-for-small-up, .show-for-small, .show-for-small-down, .show-for-medium-only, .hide-for-medium-up, .show-for-medium, .show-for-medium-down, .show-for-large-only, .hide-for-large-up, .show-for-large, .show-for-large-down, .hide-for-xlarge-only, .hide-for-xlarge-up, .hide-for-xlarge, .hide-for-xlarge-down, .show-for-xxlarge-only, .show-for-xxlarge-up, .show-for-xxlarge, .hide-for-xxlarge-down {
display: none !important; }
.hidden-for-small-only, .visible-for-small-up, .hidden-for-small, .hidden-for-small-down, .hidden-for-medium-only, .visible-for-medium-up, .hidden-for-medium, .hidden-for-medium-down, .hidden-for-large-only, .visible-for-large-up, .hidden-for-large, .hidden-for-large-down, .visible-for-xlarge-only, .visible-for-xlarge-up, .visible-for-xlarge, .visible-for-xlarge-down, .hidden-for-xxlarge-only, .hidden-for-xxlarge-up, .hidden-for-xxlarge, .visible-for-xxlarge-down {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto; }
.visible-for-small-only, .hidden-for-small-up, .visible-for-small, .visible-for-small-down, .visible-for-medium-only, .hidden-for-medium-up, .visible-for-medium, .visible-for-medium-down, .visible-for-large-only, .hidden-for-large-up, .visible-for-large, .visible-for-large-down, .hidden-for-xlarge-only, .hidden-for-xlarge-up, .hidden-for-xlarge, .hidden-for-xlarge-down, .visible-for-xxlarge-only, .visible-for-xxlarge-up, .visible-for-xxlarge, .hidden-for-xxlarge-down {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px; }
table.hide-for-small-only, table.show-for-small-up, table.hide-for-small, table.hide-for-small-down, table.hide-for-medium-only, table.show-for-medium-up, table.hide-for-medium, table.hide-for-medium-down, table.hide-for-large-only, table.show-for-large-up, table.hide-for-large, table.hide-for-large-down, table.show-for-xlarge-only, table.show-for-xlarge-up, table.show-for-xlarge, table.show-for-xlarge-down, table.hide-for-xxlarge-only, table.hide-for-xxlarge-up, table.hide-for-xxlarge, table.show-for-xxlarge-down {
display: table !important; }
thead.hide-for-small-only, thead.show-for-small-up, thead.hide-for-small, thead.hide-for-small-down, thead.hide-for-medium-only, thead.show-for-medium-up, thead.hide-for-medium, thead.hide-for-medium-down, thead.hide-for-large-only, thead.show-for-large-up, thead.hide-for-large, thead.hide-for-large-down, thead.show-for-xlarge-only, thead.show-for-xlarge-up, thead.show-for-xlarge, thead.show-for-xlarge-down, thead.hide-for-xxlarge-only, thead.hide-for-xxlarge-up, thead.hide-for-xxlarge, thead.show-for-xxlarge-down {
display: table-header-group !important; }
tbody.hide-for-small-only, tbody.show-for-small-up, tbody.hide-for-small, tbody.hide-for-small-down, tbody.hide-for-medium-only, tbody.show-for-medium-up, tbody.hide-for-medium, tbody.hide-for-medium-down, tbody.hide-for-large-only, tbody.show-for-large-up, tbody.hide-for-large, tbody.hide-for-large-down, tbody.show-for-xlarge-only, tbody.show-for-xlarge-up, tbody.show-for-xlarge, tbody.show-for-xlarge-down, tbody.hide-for-xxlarge-only, tbody.hide-for-xxlarge-up, tbody.hide-for-xxlarge, tbody.show-for-xxlarge-down {
display: table-row-group !important; }
tr.hide-for-small-only, tr.show-for-small-up, tr.hide-for-small, tr.hide-for-small-down, tr.hide-for-medium-only, tr.show-for-medium-up, tr.hide-for-medium, tr.hide-for-medium-down, tr.hide-for-large-only, tr.show-for-large-up, tr.hide-for-large, tr.hide-for-large-down, tr.show-for-xlarge-only, tr.show-for-xlarge-up, tr.show-for-xlarge, tr.show-for-xlarge-down, tr.hide-for-xxlarge-only, tr.hide-for-xxlarge-up, tr.hide-for-xxlarge, tr.show-for-xxlarge-down {
display: table-row; }
th.hide-for-small-only, td.hide-for-small-only, th.show-for-small-up, td.show-for-small-up, th.hide-for-small, td.hide-for-small, th.hide-for-small-down, td.hide-for-small-down, th.hide-for-medium-only, td.hide-for-medium-only, th.show-for-medium-up, td.show-for-medium-up, th.hide-for-medium, td.hide-for-medium, th.hide-for-medium-down, td.hide-for-medium-down, th.hide-for-large-only, td.hide-for-large-only, th.show-for-large-up, td.show-for-large-up, th.hide-for-large, td.hide-for-large, th.hide-for-large-down, td.hide-for-large-down, th.show-for-xlarge-only, td.show-for-xlarge-only, th.show-for-xlarge-up, td.show-for-xlarge-up, th.show-for-xlarge, td.show-for-xlarge, th.show-for-xlarge-down, td.show-for-xlarge-down, th.hide-for-xxlarge-only, td.hide-for-xxlarge-only, th.hide-for-xxlarge-up, td.hide-for-xxlarge-up, th.hide-for-xxlarge, td.hide-for-xxlarge, th.show-for-xxlarge-down, td.show-for-xxlarge-down {
display: table-cell !important; } }
/* xxlarge displays */
@media only screen and (min-width: 120.0625em) {
.hide-for-small-only, .show-for-small-up, .hide-for-small, .hide-for-small-down, .hide-for-medium-only, .show-for-medium-up, .hide-for-medium, .hide-for-medium-down, .hide-for-large-only, .show-for-large-up, .hide-for-large, .hide-for-large-down, .hide-for-xlarge-only, .show-for-xlarge-up, .hide-for-xlarge, .hide-for-xlarge-down, .show-for-xxlarge-only, .show-for-xxlarge-up, .show-for-xxlarge, .show-for-xxlarge-down {
display: inherit !important; }
.show-for-small-only, .hide-for-small-up, .show-for-small, .show-for-small-down, .show-for-medium-only, .hide-for-medium-up, .show-for-medium, .show-for-medium-down, .show-for-large-only, .hide-for-large-up, .show-for-large, .show-for-large-down, .show-for-xlarge-only, .hide-for-xlarge-up, .show-for-xlarge, .show-for-xlarge-down, .hide-for-xxlarge-only, .hide-for-xxlarge-up, .hide-for-xxlarge, .hide-for-xxlarge-down {
display: none !important; }
.hidden-for-small-only, .visible-for-small-up, .hidden-for-small, .hidden-for-small-down, .hidden-for-medium-only, .visible-for-medium-up, .hidden-for-medium, .hidden-for-medium-down, .hidden-for-large-only, .visible-for-large-up, .hidden-for-large, .hidden-for-large-down, .hidden-for-xlarge-only, .visible-for-xlarge-up, .hidden-for-xlarge, .hidden-for-xlarge-down, .visible-for-xxlarge-only, .visible-for-xxlarge-up, .visible-for-xxlarge, .visible-for-xxlarge-down {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto; }
.visible-for-small-only, .hidden-for-small-up, .visible-for-small, .visible-for-small-down, .visible-for-medium-only, .hidden-for-medium-up, .visible-for-medium, .visible-for-medium-down, .visible-for-large-only, .hidden-for-large-up, .visible-for-large, .visible-for-large-down, .visible-for-xlarge-only, .hidden-for-xlarge-up, .visible-for-xlarge, .visible-for-xlarge-down, .hidden-for-xxlarge-only, .hidden-for-xxlarge-up, .hidden-for-xxlarge, .hidden-for-xxlarge-down {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px; }
table.hide-for-small-only, table.show-for-small-up, table.hide-for-small, table.hide-for-small-down, table.hide-for-medium-only, table.show-for-medium-up, table.hide-for-medium, table.hide-for-medium-down, table.hide-for-large-only, table.show-for-large-up, table.hide-for-large, table.hide-for-large-down, table.hide-for-xlarge-only, table.show-for-xlarge-up, table.hide-for-xlarge, table.hide-for-xlarge-down, table.show-for-xxlarge-only, table.show-for-xxlarge-up, table.show-for-xxlarge, table.show-for-xxlarge-down {
display: table !important; }
thead.hide-for-small-only, thead.show-for-small-up, thead.hide-for-small, thead.hide-for-small-down, thead.hide-for-medium-only, thead.show-for-medium-up, thead.hide-for-medium, thead.hide-for-medium-down, thead.hide-for-large-only, thead.show-for-large-up, thead.hide-for-large, thead.hide-for-large-down, thead.hide-for-xlarge-only, thead.show-for-xlarge-up, thead.hide-for-xlarge, thead.hide-for-xlarge-down, thead.show-for-xxlarge-only, thead.show-for-xxlarge-up, thead.show-for-xxlarge, thead.show-for-xxlarge-down {
display: table-header-group !important; }
tbody.hide-for-small-only, tbody.show-for-small-up, tbody.hide-for-small, tbody.hide-for-small-down, tbody.hide-for-medium-only, tbody.show-for-medium-up, tbody.hide-for-medium, tbody.hide-for-medium-down, tbody.hide-for-large-only, tbody.show-for-large-up, tbody.hide-for-large, tbody.hide-for-large-down, tbody.hide-for-xlarge-only, tbody.show-for-xlarge-up, tbody.hide-for-xlarge, tbody.hide-for-xlarge-down, tbody.show-for-xxlarge-only, tbody.show-for-xxlarge-up, tbody.show-for-xxlarge, tbody.show-for-xxlarge-down {
display: table-row-group !important; }
tr.hide-for-small-only, tr.show-for-small-up, tr.hide-for-small, tr.hide-for-small-down, tr.hide-for-medium-only, tr.show-for-medium-up, tr.hide-for-medium, tr.hide-for-medium-down, tr.hide-for-large-only, tr.show-for-large-up, tr.hide-for-large, tr.hide-for-large-down, tr.hide-for-xlarge-only, tr.show-for-xlarge-up, tr.hide-for-xlarge, tr.hide-for-xlarge-down, tr.show-for-xxlarge-only, tr.show-for-xxlarge-up, tr.show-for-xxlarge, tr.show-for-xxlarge-down {
display: table-row; }
th.hide-for-small-only, td.hide-for-small-only, th.show-for-small-up, td.show-for-small-up, th.hide-for-small, td.hide-for-small, th.hide-for-small-down, td.hide-for-small-down, th.hide-for-medium-only, td.hide-for-medium-only, th.show-for-medium-up, td.show-for-medium-up, th.hide-for-medium, td.hide-for-medium, th.hide-for-medium-down, td.hide-for-medium-down, th.hide-for-large-only, td.hide-for-large-only, th.show-for-large-up, td.show-for-large-up, th.hide-for-large, td.hide-for-large, th.hide-for-large-down, td.hide-for-large-down, th.hide-for-xlarge-only, td.hide-for-xlarge-only, th.show-for-xlarge-up, td.show-for-xlarge-up, th.hide-for-xlarge, td.hide-for-xlarge, th.hide-for-xlarge-down, td.hide-for-xlarge-down, th.show-for-xxlarge-only, td.show-for-xxlarge-only, th.show-for-xxlarge-up, td.show-for-xxlarge-up, th.show-for-xxlarge, td.show-for-xxlarge, th.show-for-xxlarge-down, td.show-for-xxlarge-down {
display: table-cell !important; } }
/* Orientation targeting */
.show-for-landscape,
.hide-for-portrait {
display: inherit !important; }
.hide-for-landscape,
.show-for-portrait {
display: none !important; }
/* Specific visibility for tables */
table.hide-for-landscape, table.show-for-portrait {
display: table !important; }
thead.hide-for-landscape, thead.show-for-portrait {
display: table-header-group !important; }
tbody.hide-for-landscape, tbody.show-for-portrait {
display: table-row-group !important; }
tr.hide-for-landscape, tr.show-for-portrait {
display: table-row !important; }
td.hide-for-landscape, td.show-for-portrait,
th.hide-for-landscape,
th.show-for-portrait {
display: table-cell !important; }
@media only screen and (orientation: landscape) {
.show-for-landscape,
.hide-for-portrait {
display: inherit !important; }
.hide-for-landscape,
.show-for-portrait {
display: none !important; }
/* Specific visibility for tables */
table.show-for-landscape, table.hide-for-portrait {
display: table !important; }
thead.show-for-landscape, thead.hide-for-portrait {
display: table-header-group !important; }
tbody.show-for-landscape, tbody.hide-for-portrait {
display: table-row-group !important; }
tr.show-for-landscape, tr.hide-for-portrait {
display: table-row !important; }
td.show-for-landscape, td.hide-for-portrait,
th.show-for-landscape,
th.hide-for-portrait {
display: table-cell !important; } }
@media only screen and (orientation: portrait) {
.show-for-portrait,
.hide-for-landscape {
display: inherit !important; }
.hide-for-portrait,
.show-for-landscape {
display: none !important; }
/* Specific visibility for tables */
table.show-for-portrait, table.hide-for-landscape {
display: table !important; }
thead.show-for-portrait, thead.hide-for-landscape {
display: table-header-group !important; }
tbody.show-for-portrait, tbody.hide-for-landscape {
display: table-row-group !important; }
tr.show-for-portrait, tr.hide-for-landscape {
display: table-row !important; }
td.show-for-portrait, td.hide-for-landscape,
th.show-for-portrait,
th.hide-for-landscape {
display: table-cell !important; } }
/* Touch-enabled device targeting */
.show-for-touch {
display: none !important; }
.hide-for-touch {
display: inherit !important; }
.touch .show-for-touch {
display: inherit !important; }
.touch .hide-for-touch {
display: none !important; }
/* Specific visibility for tables */
table.hide-for-touch {
display: table !important; }
.touch table.show-for-touch {
display: table !important; }
thead.hide-for-touch {
display: table-header-group !important; }
.touch thead.show-for-touch {
display: table-header-group !important; }
tbody.hide-for-touch {
display: table-row-group !important; }
.touch tbody.show-for-touch {
display: table-row-group !important; }
tr.hide-for-touch {
display: table-row !important; }
.touch tr.show-for-touch {
display: table-row !important; }
td.hide-for-touch {
display: table-cell !important; }
.touch td.show-for-touch {
display: table-cell !important; }
th.hide-for-touch {
display: table-cell !important; }
.touch th.show-for-touch {
display: table-cell !important; }
/* Screen reader-specific classes */
.show-for-sr {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px; }
.show-on-focus {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px; }
.show-on-focus:focus, .show-on-focus:active {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto; }
/* Print visibility */
.print-only,
.show-for-print {
display: none !important; }
@media print {
.print-only,
.show-for-print {
display: block !important; }
.hide-on-print,
.hide-for-print {
display: none !important; }
table.show-for-print {
display: table !important; }
thead.show-for-print {
display: table-header-group !important; }
tbody.show-for-print {
display: table-row-group !important; }
tr.show-for-print {
display: table-row !important; }
td.show-for-print {
display: table-cell !important; }
th.show-for-print {
display: table-cell !important; } }
html {
padding: 0;
margin: 0; }
body {
padding: 0;
margin: 0;
font-family: -apple-system, 'Helvetica Neue', Helvetica, sans-serif; }
| {
"content_hash": "fb45800c8067206febcbfa92e76718be",
"timestamp": "",
"source": "github",
"line_count": 6339,
"max_line_length": 924,
"avg_line_length": 32.554503864962925,
"alnum_prop": 0.6383072546919748,
"repo_name": "keithmattix/audioDemo",
"id": "68bfa582649c4541a81beb86f1825b52433ea3b9",
"size": "206363",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/css/app.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "206530"
},
{
"name": "HTML",
"bytes": "473"
},
{
"name": "JavaScript",
"bytes": "2010"
}
],
"symlink_target": ""
} |
int main(int argc, char** argv) {
CEngine& game = CEngine::Instance();
game.CreateWindow("wintermute", 1280, 720, false);
game.ChangeFrame(&ModelFrame::Instance());
while (game.Running()) {
game.Tick();
}
game.Cleanup();
return 0;
}
| {
"content_hash": "2c6b98164a8e67d3ceda919359d7478f",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 54,
"avg_line_length": 26.9,
"alnum_prop": 0.5985130111524164,
"repo_name": "ThomasLagace/wintermute",
"id": "f554b3cba4db098b7b596466a0cf86fca8647233",
"size": "313",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "main.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "2970"
},
{
"name": "GLSL",
"bytes": "1274"
},
{
"name": "Shell",
"bytes": "232"
}
],
"symlink_target": ""
} |
<?php
/**
* DO NOT EDIT THIS FILE!
*
* This file was automatically generated from external sources.
*
* Any manual change here will be lost the next time the SDK
* is updated. You've been warned!
*/
namespace DTS\eBaySDK\Test\Trading\Enums;
use DTS\eBaySDK\Trading\Enums\ItemSortFilterCodeType;
class ItemSortFilterCodeTypeTest extends \PHPUnit_Framework_TestCase
{
private $obj;
protected function setUp()
{
$this->obj = new ItemSortFilterCodeType();
}
public function testCanBeCreated()
{
$this->assertInstanceOf('\DTS\eBaySDK\Trading\Enums\ItemSortFilterCodeType', $this->obj);
}
}
| {
"content_hash": "ddf9990d8d76b1c590d1a823d18d3fcb",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 97,
"avg_line_length": 22.892857142857142,
"alnum_prop": 0.7035881435257411,
"repo_name": "davidtsadler/ebay-sdk-php",
"id": "4d7d6ee3647356dfd4746bde52ece165d4b44ecd",
"size": "641",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/Trading/Enums/ItemSortFilterCodeTypeTest.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "10944"
},
{
"name": "PHP",
"bytes": "9958599"
}
],
"symlink_target": ""
} |
package de.josko.cvsanalyser.reader;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.junit.Before;
import org.junit.Test;
import java.util.List;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public class SVNXmlLogReaderTest {
public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
private LogReader reader;
@Before
public void setUp() throws Exception {
reader = new SVNXmlLogReader(this.getClass().getResourceAsStream("log.xml"));
}
@Test
public void commitObjectIsFilledAsExpected() throws Exception {
List<Commit> commits = reader.getCommits();
Commit commit = commits.get(0);
assertThat(commits.size(), is(2));
assertThat(commit.getCommitter(), is("ggregory"));
assertThat(commit.getRevision(), is("1674710"));
assertThat(commit.getDate().toString(DATE_TIME_FORMATTER), is("2015-04-20 00:25:55"));
assertThat(commit.getAffectedFiles().size(), is(1));
}
} | {
"content_hash": "87eba2852ee13de844c6a4e3880bcd9b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 113,
"avg_line_length": 31.685714285714287,
"alnum_prop": 0.7096483318304779,
"repo_name": "sprengerjo/cvs-analyser",
"id": "8896aa2ab07a7520a4e7deb9f5c200f389c2327e",
"size": "1109",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/de/josko/cvsanalyser/reader/SVNXmlLogReaderTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "20844"
}
],
"symlink_target": ""
} |
/*global define */
define (
[
"./lb.base.i18n",
"./lb.base.object",
"./lb.base.type"
],
function(
i18n,
object,
type
) {
// Declare aliases
var has = object.has,
is = type.is,
equals = i18n.equals,
languageCompare = i18n.languageCompare,
contains = i18n.contains,
// private fields
// languages - array, the list of language objects, sorted by language
// code, in case-insensitive lexical order.
// Each language object is in the format:
// | {
// | code: 'en-US', // string, language code
// | properties: {...} // object, properties given
// | // in addLanguageProperties
// | }
// Note:
// In current implementation, the same language code may be repeated in
// several language objects. These duplicates may be merged into a single
// language object in a future implementation (trading less memory for
// more computations due to added merging step).
languages = [];
function getLanguageCodes(){
// Function: getLanguageCodes(): array
// Get the list of language codes associated with language properties.
//
// Returns:
// array of strings, the list of unique language codes with associated
// language properties, sorted in case-insensitive lexical order.
//
// Notes:
// Language codes are returned AS IS, but in case the same language code
// has been registered several times, comparing in a case-insensitive
// manner, duplicates are not included in the list. Language codes are not
// currently normalized to a lower case form in the resulting list; this
// may be done in a future implementation.
var i,
length,
languageCode,
previousLanguageCode = null,
languageCodes = [];
for (i=0, length=languages.length; i<length; i++){
languageCode = languages[i].code;
if ( !equals(languageCode,previousLanguageCode) ){
languageCodes.push(languageCode);
}
previousLanguageCode = languageCode;
}
return languageCodes;
}
function addLanguageProperties(languageCode,languageProperties){
// Function: addLanguageProperties(languageCode,languageProperties)
// Add or replace language properties associated with given language code.
//
// Language properties may be specified in multiple calls with the same
// language code. In case of duplicate properties, the properties defined
// last are considered more specific and take precedence over properties
// defined previously.
//
// Parameters:
// languageCode - string, the language code identifying the language,
// as defined in RFC5646 "Tags for Identifying Languages"
// languageProperties - object, a set of language properties
//
// Note:
// Nothing happens in case the given language code is not a string.
if ( !is(languageCode,'string') ){
return;
}
// Note: array.sort does not guarantee that the order of items with the
// same value is preserved. This is the case in recent versions of Firefox,
// Opera and Chrome, but not in IE and Safari.
//
// Thus I chose to insert the new item at the highest position where
// the lexical order of previous language is lesser or equal, instead of
// adding the item to the array and calling sort().
var insertionPosition = 0,
length = languages.length,
j;
// find the first suitable position for insertion
for (j=length-1; j>=0; j--){
if ( languageCompare(languageCode,languages[j].code)>=0 ){
insertionPosition = j+1; // insert just after
break;
}
}
// insert new language at found location (possibly 0)
languages.splice(insertionPosition,0,{
code: languageCode,
properties: languageProperties
});
}
// Function: getDefaultLanguageCode(): string
// Get the default language code for use in internationalization methods.
//
// This method is intended to provide a default value to optional language
// code arguments of base internationalization methods.
//
// Returns:
// string, the value of the 'lang' attribute of the root HTML element,
// or when it is missing or an empty string '', the value of the browser
// language found in navigator.language or navigator.browserLanguage.
function getDefaultLanguageCode(){
var languageCode = i18n.getLanguage();
if ( !has(languageCode) || languageCode==='' ){
return i18n.getBrowserLanguage();
}
return languageCode;
}
function get(key,languageCode){
// Function: get(key[,languageCode]): any
// Get the value of the property identified by given key, in the most
// specific language available.
//
// The key argument may be a string
// or an array of strings:
// - the name of a property defined at top level:
// e.g. 'propertyName'
// - the dotted name of a nested property:
// e.g. 'section.subsection.propertyName'
// - the list of sections and subsections:
// e.g. ['section','subsection','propertyName']
//
// The last two forms are equivalent, both matching a property
// 'propertyName' nested in a property 'subsection' within a property
// 'section' at top level of language properties. The array notation allows
// to look up a property which would contain a dot in its name, without the
// substitution to a section and subsection: ['no.substitution.done'].
//
// Parameters:
// key - string, the name of the looked up property such as 'name',
// or string, a dotted string such as 'section.subsection.name',
// or an array of strings to represent a path to a property
// such as ['section','subsection','name'] nested within sections
// and subsections
// languageCode - string, optional, the language code used to filter
// relevant languages, defaults to the value of
// getDefaultLanguageCode()
//
// Returns:
// * any, the value of the property found in the most specific language
// object whose language code put in lower case is a hyphenated
// substring of the given language code put in lower case
// * or null if the property is not found in suitable languages,
// if the given path is null or undefined, or if the given language
// code is not a string.
if ( !has(key) ){
return null;
}
if ( !is(languageCode,'string') ){
languageCode = getDefaultLanguageCode();
}
if ( is(key,'string') ){
key = key.split('.');
}
var language,
i,
properties,
pathElement,
j,
length;
// for each language, from most specific (last) to least specific (first)
for (i=languages.length-1; i>=0; i--){
language = languages[i];
// does selected language inherit properties from this language ?
if ( contains(languageCode,language.code) ){
// start at top of language properties
properties = language.properties;
// for each path element in the given key
for (j=0, length=key.length; j<length && properties; j++){
pathElement = key[j];
// if the final path element is found
if ( has(properties,pathElement) && j===length-1){
return properties[pathElement];
}
// go on with next level (may be null or undefined)
properties = properties[pathElement];
}
}
}
return null;
}
function reset(){
// Function: reset()
// Remove all language properties.
languages.length = 0;
}
// Assign to lb.base.i18n.data
// for backward-compatibility in browser environment
i18n.data = { // public API
getLanguageCodes: getLanguageCodes,
addLanguageProperties: addLanguageProperties,
getDefaultLanguageCode: getDefaultLanguageCode,
get: get,
reset: reset
};
return i18n.data;
}
);
| {
"content_hash": "44f2f88b50e84a042e6733b4ca2c2941",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 81,
"avg_line_length": 37.60262008733624,
"alnum_prop": 0.6037626291952154,
"repo_name": "eric-brechemier/lb_js_scalableApp",
"id": "27acb670b89e205ba5cba2920d570e31a57af934",
"size": "11086",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/lb/lb.base.i18n.data.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "80448"
},
{
"name": "JavaScript",
"bytes": "2030842"
},
{
"name": "Perl",
"bytes": "1130064"
},
{
"name": "Shell",
"bytes": "377"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!--
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.5
Version: 4.1.0
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Follow: www.twitter.com/keenthemes
Like: www.facebook.com/keenthemes
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" dir="rtl">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8"/>
<title>Metronic | Extra - About Us</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta content="" name="description"/>
<meta content="" name="author"/>
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/bootstrap/css/bootstrap-rtl.min.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/bootstrap-switch/css/bootstrap-switch-rtl.min.css" rel="stylesheet" type="text/css"/>
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN PAGE LEVEL STYLES -->
<link href="../../assets/admin/pages/css/about-us-rtl.css" rel="stylesheet" type="text/css"/>
<!-- END PAGE LEVEL STYLES -->
<!-- BEGIN THEME STYLES -->
<link href="../../assets/global/css/components-md-rtl.css" id="style_components" rel="stylesheet" type="text/css"/>
<link href="../../assets/global/css/plugins-md-rtl.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/admin/layout2/css/layout-rtl.css" rel="stylesheet" type="text/css"/>
<link id="style_color" href="../../assets/admin/layout2/css/themes/grey.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/admin/layout2/css/custom-rtl.css" rel="stylesheet" type="text/css"/>
<!-- END THEME STYLES -->
<link rel="shortcut icon" href="favicon.ico"/>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices -->
<!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default -->
<!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle -->
<!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle -->
<!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle -->
<!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar -->
<!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer -->
<!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side -->
<!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu -->
<body class="page-md page-boxed page-header-fixed page-container-bg-solid page-sidebar-closed-hide-logo ">
<!-- BEGIN HEADER -->
<div class="page-header md-shadow-z-1-i navbar navbar-fixed-top">
<!-- BEGIN HEADER INNER -->
<div class="page-header-inner container">
<!-- BEGIN LOGO -->
<div class="page-logo">
<a href="index.html">
<img src="../../assets/admin/layout2/img/logo-default.png" alt="logo" class="logo-default"/>
</a>
<div class="menu-toggler sidebar-toggler">
<!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header -->
</div>
</div>
<!-- END LOGO -->
<!-- BEGIN RESPONSIVE MENU TOGGLER -->
<a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">
</a>
<!-- END RESPONSIVE MENU TOGGLER -->
<!-- BEGIN PAGE ACTIONS -->
<!-- DOC: Remove "hide" class to enable the page header actions -->
<div class="page-actions hide">
<div class="btn-group">
<button type="button" class="btn btn-circle red-pink dropdown-toggle" data-toggle="dropdown">
<i class="icon-bar-chart"></i> <span class="hidden-sm hidden-xs">New </span> <i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="javascript:;">
<i class="icon-user"></i> New User </a>
</li>
<li>
<a href="javascript:;">
<i class="icon-present"></i> New Event <span class="badge badge-success">4</span>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-basket"></i> New order </a>
</li>
<li class="divider">
</li>
<li>
<a href="javascript:;">
<i class="icon-flag"></i> Pending Orders <span class="badge badge-danger">4</span>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-users"></i> Pending Users <span class="badge badge-warning">12</span>
</a>
</li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-circle green-haze dropdown-toggle" data-toggle="dropdown">
<i class="icon-bell"></i> <span class="hidden-sm hidden-xs">Post </span> <i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="javascript:;">
<i class="icon-docs"></i> New Post </a>
</li>
<li>
<a href="javascript:;">
<i class="icon-tag"></i> New Comment </a>
</li>
<li>
<a href="javascript:;">
<i class="icon-share"></i> Share </a>
</li>
<li class="divider">
</li>
<li>
<a href="javascript:;">
<i class="icon-flag"></i> Comments <span class="badge badge-success">4</span>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-users"></i> Feedbacks <span class="badge badge-danger">2</span>
</a>
</li>
</ul>
</div>
</div>
<!-- END PAGE ACTIONS -->
<!-- BEGIN PAGE TOP -->
<div class="page-top">
<!-- BEGIN HEADER SEARCH BOX -->
<!-- DOC: Apply "search-form-expanded" right after the "search-form" class to have half expanded search box -->
<form class="search-form search-form-expanded" action="extra_search.html" method="GET">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search..." name="query">
<span class="input-group-btn">
<a href="javascript:;" class="btn submit"><i class="icon-magnifier"></i></a>
</span>
</div>
</form>
<!-- END HEADER SEARCH BOX -->
<!-- BEGIN TOP NAVIGATION MENU -->
<div class="top-menu">
<ul class="nav navbar-nav pull-right">
<!-- BEGIN NOTIFICATION DROPDOWN -->
<!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
<li class="dropdown dropdown-extended dropdown-notification" id="header_notification_bar">
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
<i class="icon-bell"></i>
<span class="badge badge-default">
7 </span>
</a>
<ul class="dropdown-menu">
<li class="external">
<h3><span class="bold">12 pending</span> notifications</h3>
<a href="extra_profile.html">view all</a>
</li>
<li>
<ul class="dropdown-menu-list scroller" style="height: 250px;" data-handle-color="#637283">
<li>
<a href="javascript:;">
<span class="time">just now</span>
<span class="details">
<span class="label label-sm label-icon label-success">
<i class="fa fa-plus"></i>
</span>
New user registered. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">3 mins</span>
<span class="details">
<span class="label label-sm label-icon label-danger">
<i class="fa fa-bolt"></i>
</span>
Server #12 overloaded. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">10 mins</span>
<span class="details">
<span class="label label-sm label-icon label-warning">
<i class="fa fa-bell-o"></i>
</span>
Server #2 not responding. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">14 hrs</span>
<span class="details">
<span class="label label-sm label-icon label-info">
<i class="fa fa-bullhorn"></i>
</span>
Application error. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">2 days</span>
<span class="details">
<span class="label label-sm label-icon label-danger">
<i class="fa fa-bolt"></i>
</span>
Database overloaded 68%. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">3 days</span>
<span class="details">
<span class="label label-sm label-icon label-danger">
<i class="fa fa-bolt"></i>
</span>
A user IP blocked. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">4 days</span>
<span class="details">
<span class="label label-sm label-icon label-warning">
<i class="fa fa-bell-o"></i>
</span>
Storage Server #4 not responding dfdfdfd. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">5 days</span>
<span class="details">
<span class="label label-sm label-icon label-info">
<i class="fa fa-bullhorn"></i>
</span>
System Error. </span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="time">9 days</span>
<span class="details">
<span class="label label-sm label-icon label-danger">
<i class="fa fa-bolt"></i>
</span>
Storage server failed. </span>
</a>
</li>
</ul>
</li>
</ul>
</li>
<!-- END NOTIFICATION DROPDOWN -->
<!-- BEGIN INBOX DROPDOWN -->
<!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
<li class="dropdown dropdown-extended dropdown-inbox" id="header_inbox_bar">
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
<i class="icon-envelope-open"></i>
<span class="badge badge-default">
4 </span>
</a>
<ul class="dropdown-menu">
<li class="external">
<h3>You have <span class="bold">7 New</span> Messages</h3>
<a href="page_inbox.html">view all</a>
</li>
<li>
<ul class="dropdown-menu-list scroller" style="height: 275px;" data-handle-color="#637283">
<li>
<a href="inbox.html?a=view">
<span class="photo">
<img src="../../assets/admin/layout3/img/avatar2.jpg" class="img-circle" alt="">
</span>
<span class="subject">
<span class="from">
Lisa Wong </span>
<span class="time">Just Now </span>
</span>
<span class="message">
Vivamus sed auctor nibh congue nibh. auctor nibh auctor nibh... </span>
</a>
</li>
<li>
<a href="inbox.html?a=view">
<span class="photo">
<img src="../../assets/admin/layout3/img/avatar3.jpg" class="img-circle" alt="">
</span>
<span class="subject">
<span class="from">
Richard Doe </span>
<span class="time">16 mins </span>
</span>
<span class="message">
Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span>
</a>
</li>
<li>
<a href="inbox.html?a=view">
<span class="photo">
<img src="../../assets/admin/layout3/img/avatar1.jpg" class="img-circle" alt="">
</span>
<span class="subject">
<span class="from">
Bob Nilson </span>
<span class="time">2 hrs </span>
</span>
<span class="message">
Vivamus sed nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span>
</a>
</li>
<li>
<a href="inbox.html?a=view">
<span class="photo">
<img src="../../assets/admin/layout3/img/avatar2.jpg" class="img-circle" alt="">
</span>
<span class="subject">
<span class="from">
Lisa Wong </span>
<span class="time">40 mins </span>
</span>
<span class="message">
Vivamus sed auctor 40% nibh congue nibh... </span>
</a>
</li>
<li>
<a href="inbox.html?a=view">
<span class="photo">
<img src="../../assets/admin/layout3/img/avatar3.jpg" class="img-circle" alt="">
</span>
<span class="subject">
<span class="from">
Richard Doe </span>
<span class="time">46 mins </span>
</span>
<span class="message">
Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span>
</a>
</li>
</ul>
</li>
</ul>
</li>
<!-- END INBOX DROPDOWN -->
<!-- BEGIN TODO DROPDOWN -->
<!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
<li class="dropdown dropdown-extended dropdown-tasks" id="header_task_bar">
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
<i class="icon-calendar"></i>
<span class="badge badge-default">
3 </span>
</a>
<ul class="dropdown-menu extended tasks">
<li class="external">
<h3>You have <span class="bold">12 pending</span> tasks</h3>
<a href="page_todo.html">view all</a>
</li>
<li>
<ul class="dropdown-menu-list scroller" style="height: 275px;" data-handle-color="#637283">
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">New release v1.2 </span>
<span class="percent">30%</span>
</span>
<span class="progress">
<span style="width: 40%;" class="progress-bar progress-bar-success" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">40% Complete</span></span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">Application deployment</span>
<span class="percent">65%</span>
</span>
<span class="progress">
<span style="width: 65%;" class="progress-bar progress-bar-danger" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">65% Complete</span></span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">Mobile app release</span>
<span class="percent">98%</span>
</span>
<span class="progress">
<span style="width: 98%;" class="progress-bar progress-bar-success" aria-valuenow="98" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">98% Complete</span></span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">Database migration</span>
<span class="percent">10%</span>
</span>
<span class="progress">
<span style="width: 10%;" class="progress-bar progress-bar-warning" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">10% Complete</span></span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">Web server upgrade</span>
<span class="percent">58%</span>
</span>
<span class="progress">
<span style="width: 58%;" class="progress-bar progress-bar-info" aria-valuenow="58" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">58% Complete</span></span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">Mobile development</span>
<span class="percent">85%</span>
</span>
<span class="progress">
<span style="width: 85%;" class="progress-bar progress-bar-success" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">85% Complete</span></span>
</span>
</a>
</li>
<li>
<a href="javascript:;">
<span class="task">
<span class="desc">New UI release</span>
<span class="percent">38%</span>
</span>
<span class="progress progress-striped">
<span style="width: 38%;" class="progress-bar progress-bar-important" aria-valuenow="18" aria-valuemin="0" aria-valuemax="100"><span class="sr-only">38% Complete</span></span>
</span>
</a>
</li>
</ul>
</li>
</ul>
</li>
<!-- END TODO DROPDOWN -->
<!-- BEGIN USER LOGIN DROPDOWN -->
<!-- DOC: Apply "dropdown-dark" class after below "dropdown-extended" to change the dropdown styte -->
<li class="dropdown dropdown-user">
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
<img alt="" class="img-circle" src="../../assets/admin/layout2/img/avatar3_small.jpg"/>
<span class="username username-hide-on-mobile">
Nick </span>
<i class="fa fa-angle-down"></i>
</a>
<ul class="dropdown-menu dropdown-menu-default">
<li>
<a href="extra_profile.html">
<i class="icon-user"></i> My Profile </a>
</li>
<li>
<a href="page_calendar.html">
<i class="icon-calendar"></i> My Calendar </a>
</li>
<li>
<a href="inbox.html">
<i class="icon-envelope-open"></i> My Inbox <span class="badge badge-danger">
3 </span>
</a>
</li>
<li>
<a href="page_todo.html">
<i class="icon-rocket"></i> My Tasks <span class="badge badge-success">
7 </span>
</a>
</li>
<li class="divider">
</li>
<li>
<a href="extra_lock.html">
<i class="icon-lock"></i> Lock Screen </a>
</li>
<li>
<a href="login.html">
<i class="icon-key"></i> Log Out </a>
</li>
</ul>
</li>
<!-- END USER LOGIN DROPDOWN -->
</ul>
</div>
<!-- END TOP NAVIGATION MENU -->
</div>
<!-- END PAGE TOP -->
</div>
<!-- END HEADER INNER -->
</div>
<!-- END HEADER -->
<div class="clearfix">
</div>
<div class="container">
<!-- BEGIN CONTAINER -->
<div class="page-container">
<!-- BEGIN SIDEBAR -->
<div class="page-sidebar-wrapper">
<!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
<!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed -->
<div class="page-sidebar navbar-collapse collapse">
<!-- BEGIN SIDEBAR MENU -->
<!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) -->
<!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode -->
<!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode -->
<!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
<!-- DOC: Set data-keep-expand="true" to keep the submenues expanded -->
<!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed -->
<ul class="page-sidebar-menu page-sidebar-menu-hover-submenu " data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200">
<li class="start ">
<a href="index.html">
<i class="icon-home"></i>
<span class="title">Dashboard</span>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-basket"></i>
<span class="title">eCommerce</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="ecommerce_index.html">
<i class="icon-home"></i>
Dashboard</a>
</li>
<li>
<a href="ecommerce_orders.html">
<i class="icon-basket"></i>
Orders</a>
</li>
<li>
<a href="ecommerce_orders_view.html">
<i class="icon-tag"></i>
Order View</a>
</li>
<li>
<a href="ecommerce_products.html">
<i class="icon-handbag"></i>
Products</a>
</li>
<li>
<a href="ecommerce_products_edit.html">
<i class="icon-pencil"></i>
Product Edit</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-rocket"></i>
<span class="title">Page Layouts</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="layout_fontawesome_icons.html">
<span class="badge badge-roundless badge-danger">new</span>Layout with Fontawesome Icons</a>
</li>
<li>
<a href="layout_glyphicons.html">
Layout with Glyphicon</a>
</li>
<li>
<a href="layout_full_height_content.html">
<span class="badge badge-roundless badge-warning">new</span>Full Height Content</a>
</li>
<li>
<a href="layout_sidebar_reversed.html">
<span class="badge badge-roundless badge-warning">new</span>Right Sidebar Page</a>
</li>
<li>
<a href="layout_sidebar_fixed.html">
Sidebar Fixed Page</a>
</li>
<li>
<a href="layout_sidebar_closed.html">
Sidebar Closed Page</a>
</li>
<li>
<a href="layout_ajax.html">
Content Loading via Ajax</a>
</li>
<li>
<a href="layout_disabled_menu.html">
Disabled Menu Links</a>
</li>
<li>
<a href="layout_blank_page.html">
Blank Page</a>
</li>
<li>
<a href="layout_fluid_page.html">
Fluid Page</a>
</li>
<li>
<a href="layout_language_bar.html">
Language Switch Bar</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-diamond"></i>
<span class="title">UI Features</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="ui_general.html">
General Components</a>
</li>
<li>
<a href="ui_buttons.html">
Buttons</a>
</li>
<li>
<a href="ui_icons.html">
<span class="badge badge-roundless badge-danger">new</span>Font Icons</a>
</li>
<li>
<a href="ui_colors.html">
Flat UI Colors</a>
</li>
<li>
<a href="ui_typography.html">
Typography</a>
</li>
<li>
<a href="ui_tabs_accordions_navs.html">
Tabs, Accordions & Navs</a>
</li>
<li>
<a href="ui_tree.html">
<span class="badge badge-roundless badge-danger">new</span>Tree View</a>
</li>
<li>
<a href="ui_page_progress_style_1.html">
<span class="badge badge-roundless badge-warning">new</span>Page Progress Bar</a>
</li>
<li>
<a href="ui_blockui.html">
Block UI</a>
</li>
<li>
<a href="ui_bootstrap_growl.html">
<span class="badge badge-roundless badge-warning">new</span>Bootstrap Growl Notifications</a>
</li>
<li>
<a href="ui_notific8.html">
Notific8 Notifications</a>
</li>
<li>
<a href="ui_toastr.html">
Toastr Notifications</a>
</li>
<li>
<a href="ui_alert_dialog_api.html">
<span class="badge badge-roundless badge-danger">new</span>Alerts & Dialogs API</a>
</li>
<li>
<a href="ui_session_timeout.html">
Session Timeout</a>
</li>
<li>
<a href="ui_idle_timeout.html">
User Idle Timeout</a>
</li>
<li>
<a href="ui_modals.html">
Modals</a>
</li>
<li>
<a href="ui_extended_modals.html">
Extended Modals</a>
</li>
<li>
<a href="ui_tiles.html">
Tiles</a>
</li>
<li>
<a href="ui_datepaginator.html">
<span class="badge badge-roundless badge-success">new</span>Date Paginator</a>
</li>
<li>
<a href="ui_nestable.html">
Nestable List</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-puzzle"></i>
<span class="title">UI Components</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="components_pickers.html">
Date & Time Pickers</a>
</li>
<li>
<a href="components_context_menu.html">
Context Menu</a>
</li>
<li>
<a href="components_dropdowns.html">
Custom Dropdowns</a>
</li>
<li>
<a href="components_form_tools.html">
Form Widgets & Tools</a>
</li>
<li>
<a href="components_form_tools2.html">
Form Widgets & Tools 2</a>
</li>
<li>
<a href="components_editors.html">
Markdown & WYSIWYG Editors</a>
</li>
<li>
<a href="components_ion_sliders.html">
Ion Range Sliders</a>
</li>
<li>
<a href="components_noui_sliders.html">
NoUI Range Sliders</a>
</li>
<li>
<a href="components_jqueryui_sliders.html">
jQuery UI Sliders</a>
</li>
<li>
<a href="components_knob_dials.html">
Knob Circle Dials</a>
</li>
</ul>
</li>
<!-- BEGIN ANGULARJS LINK -->
<li class="tooltips" data-container="body" data-placement="right" data-html="true" data-original-title="AngularJS version demo">
<a href="angularjs" target="_blank">
<i class="icon-paper-plane"></i>
<span class="title">
AngularJS Version </span>
</a>
</li>
<!-- END ANGULARJS LINK -->
<li>
<a href="javascript:;">
<i class="icon-settings"></i>
<span class="title">Form Stuff</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="form_controls_md.html">
<span class="badge badge-roundless badge-danger">new</span>Material Design<br>
Form Controls</a>
</li>
<li>
<a href="form_controls.html">
Bootstrap<br>
Form Controls</a>
</li>
<li>
<a href="form_icheck.html">
iCheck Controls</a>
</li>
<li>
<a href="form_layouts.html">
Form Layouts</a>
</li>
<li>
<a href="form_editable.html">
<span class="badge badge-roundless badge-warning">new</span>Form X-editable</a>
</li>
<li>
<a href="form_wizard.html">
Form Wizard</a>
</li>
<li>
<a href="form_validation.html">
Form Validation</a>
</li>
<li>
<a href="form_image_crop.html">
<span class="badge badge-roundless badge-danger">new</span>Image Cropping</a>
</li>
<li>
<a href="form_fileupload.html">
Multiple File Upload</a>
</li>
<li>
<a href="form_dropzone.html">
Dropzone File Upload</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-briefcase"></i>
<span class="title">Data Tables</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="table_basic.html">
Basic Datatables</a>
</li>
<li>
<a href="table_tree.html">
Tree Datatables</a>
</li>
<li>
<a href="table_responsive.html">
Responsive Datatables</a>
</li>
<li>
<a href="table_managed.html">
Managed Datatables</a>
</li>
<li>
<a href="table_editable.html">
Editable Datatables</a>
</li>
<li>
<a href="table_advanced.html">
Advanced Datatables</a>
</li>
<li>
<a href="table_ajax.html">
Ajax Datatables</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-wallet"></i>
<span class="title">Portlets</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="portlet_general.html">
General Portlets</a>
</li>
<li>
<a href="portlet_general2.html">
<span class="badge badge-roundless badge-danger">new</span>New Portlets #1</a>
</li>
<li>
<a href="portlet_general3.html">
<span class="badge badge-roundless badge-danger">new</span>New Portlets #2</a>
</li>
<li>
<a href="portlet_ajax.html">
Ajax Portlets</a>
</li>
<li>
<a href="portlet_draggable.html">
Draggable Portlets</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-bar-chart"></i>
<span class="title">Charts</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="charts_amcharts.html">
amChart</a>
</li>
<li>
<a href="charts_flotcharts.html">
Flotchart</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-docs"></i>
<span class="title">Pages</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="page_timeline.html">
<i class="icon-paper-plane"></i>
<span class="badge badge-warning">2</span>New Timeline</a>
</li>
<li>
<a href="extra_profile.html">
<i class="icon-user-following"></i>
<span class="badge badge-success badge-roundless">new</span>New User Profile</a>
</li>
<li>
<a href="page_todo.html">
<i class="icon-hourglass"></i>
<span class="badge badge-danger">4</span>Todo</a>
</li>
<li>
<a href="inbox.html">
<i class="icon-envelope"></i>
<span class="badge badge-danger">4</span>Inbox</a>
</li>
<li>
<a href="extra_faq.html">
<i class="icon-info"></i>
FAQ</a>
</li>
<li>
<a href="page_portfolio.html">
<i class="icon-feed"></i>
Portfolio</a>
</li>
<li>
<a href="page_coming_soon.html">
<i class="icon-flag"></i>
Coming Soon</a>
</li>
<li>
<a href="page_calendar.html">
<i class="icon-calendar"></i>
<span class="badge badge-danger">14</span>Calendar</a>
</li>
<li>
<a href="extra_invoice.html">
<i class="icon-flag"></i>
Invoice</a>
</li>
<li>
<a href="page_blog.html">
<i class="icon-speech"></i>
Blog</a>
</li>
<li>
<a href="page_blog_item.html">
<i class="icon-link"></i>
Blog Post</a>
</li>
<li>
<a href="page_news.html">
<i class="icon-eye"></i>
<span class="badge badge-success">9</span>News</a>
</li>
<li>
<a href="page_news_item.html">
<i class="icon-bell"></i>
News View</a>
</li>
<li>
<a href="page_timeline_old.html">
<i class="icon-paper-plane"></i>
<span class="badge badge-warning">2</span>Old Timeline</a>
</li>
<li>
<a href="extra_profile_old.html">
<i class="icon-user"></i>
Old User Profile</a>
</li>
</ul>
</li>
<li class="active open">
<a href="javascript:;">
<i class="icon-present"></i>
<span class="title">Extra</span>
<span class="selected"></span>
<span class="arrow open"></span>
</a>
<ul class="sub-menu">
<li class="active">
<a href="page_about.html">
About Us</a>
</li>
<li>
<a href="page_contact.html">
Contact Us</a>
</li>
<li>
<a href="extra_search.html">
Search Results</a>
</li>
<li>
<a href="extra_pricing_table.html">
Pricing Tables</a>
</li>
<li>
<a href="extra_404_option1.html">
404 Page Option 1</a>
</li>
<li>
<a href="extra_404_option2.html">
404 Page Option 2</a>
</li>
<li>
<a href="extra_404_option3.html">
404 Page Option 3</a>
</li>
<li>
<a href="extra_500_option1.html">
500 Page Option 1</a>
</li>
<li>
<a href="extra_500_option2.html">
500 Page Option 2</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-folder"></i>
<span class="title">Multi Level Menu</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="javascript:;">
<i class="icon-settings"></i> Item 1 <span class="arrow"></span>
</a>
<ul class="sub-menu">
<li>
<a href="javascript:;">
<i class="icon-user"></i>
Sample Link 1 <span class="arrow"></span>
</a>
<ul class="sub-menu">
<li>
<a href="#"><i class="icon-power"></i> Sample Link 1</a>
</li>
<li>
<a href="#"><i class="icon-paper-plane"></i> Sample Link 1</a>
</li>
<li>
<a href="#"><i class="icon-star"></i> Sample Link 1</a>
</li>
</ul>
</li>
<li>
<a href="#"><i class="icon-camera"></i> Sample Link 1</a>
</li>
<li>
<a href="#"><i class="icon-link"></i> Sample Link 2</a>
</li>
<li>
<a href="#"><i class="icon-pointer"></i> Sample Link 3</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-globe"></i> Item 2 <span class="arrow"></span>
</a>
<ul class="sub-menu">
<li>
<a href="#"><i class="icon-tag"></i> Sample Link 1</a>
</li>
<li>
<a href="#"><i class="icon-pencil"></i> Sample Link 1</a>
</li>
<li>
<a href="#"><i class="icon-graph"></i> Sample Link 1</a>
</li>
</ul>
</li>
<li>
<a href="#">
<i class="icon-bar-chart"></i>
Item 3 </a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-user"></i>
<span class="title">Login Options</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="login.html">
Login Form 1</a>
</li>
<li>
<a href="login_2.html">
Login Form 2</a>
</li>
<li>
<a href="login_3.html">
Login Form 3</a>
</li>
<li>
<a href="login_soft.html">
Login Form 4</a>
</li>
<li>
<a href="extra_lock.html">
Lock Screen 1</a>
</li>
<li>
<a href="extra_lock2.html">
Lock Screen 2</a>
</li>
</ul>
</li>
<li class="last ">
<a href="javascript:;">
<i class="icon-pointer"></i>
<span class="title">Maps</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a href="maps_google.html">
Google Maps</a>
</li>
<li>
<a href="maps_vector.html">
Vector Maps</a>
</li>
</ul>
</li>
</ul>
<!-- END SIDEBAR MENU -->
</div>
</div>
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<div class="page-content">
<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
<div class="modal fade" id="portlet-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
Widget settings form goes here
</div>
<div class="modal-footer">
<button type="button" class="btn blue">Save changes</button>
<button type="button" class="btn default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
<!-- BEGIN STYLE CUSTOMIZER -->
<div class="theme-panel">
<div class="toggler tooltips" data-container="body" data-placement="left" data-html="true" data-original-title="Click to open advance theme customizer panel">
<i class="icon-settings"></i>
</div>
<div class="toggler-close">
<i class="icon-close"></i>
</div>
<div class="theme-options">
<div class="theme-option theme-colors clearfix">
<span>
THEME COLOR </span>
<ul>
<li class="color-default current tooltips" data-style="default" data-container="body" data-original-title="Default">
</li>
<li class="color-grey tooltips" data-style="grey" data-container="body" data-original-title="Grey">
</li>
<li class="color-blue tooltips" data-style="blue" data-container="body" data-original-title="Blue">
</li>
<li class="color-dark tooltips" data-style="dark" data-container="body" data-original-title="Dark">
</li>
<li class="color-light tooltips" data-style="light" data-container="body" data-original-title="Light">
</li>
</ul>
</div>
<div class="theme-option">
<span>
Theme Style </span>
<select class="layout-style-option form-control input-small">
<option value="square" selected="selected">Square corners</option>
<option value="rounded">Rounded corners</option>
</select>
</div>
<div class="theme-option">
<span>
Layout </span>
<select class="layout-option form-control input-small">
<option value="fluid" selected="selected">Fluid</option>
<option value="boxed">Boxed</option>
</select>
</div>
<div class="theme-option">
<span>
Header </span>
<select class="page-header-option form-control input-small">
<option value="fixed" selected="selected">Fixed</option>
<option value="default">Default</option>
</select>
</div>
<div class="theme-option">
<span>
Top Dropdown</span>
<select class="page-header-top-dropdown-style-option form-control input-small">
<option value="light" selected="selected">Light</option>
<option value="dark">Dark</option>
</select>
</div>
<div class="theme-option">
<span>
Sidebar Mode</span>
<select class="sidebar-option form-control input-small">
<option value="fixed">Fixed</option>
<option value="default" selected="selected">Default</option>
</select>
</div>
<div class="theme-option">
<span>
Sidebar Style</span>
<select class="sidebar-style-option form-control input-small">
<option value="default" selected="selected">Default</option>
<option value="compact">Compact</option>
</select>
</div>
<div class="theme-option">
<span>
Sidebar Menu </span>
<select class="sidebar-menu-option form-control input-small">
<option value="accordion" selected="selected">Accordion</option>
<option value="hover">Hover</option>
</select>
</div>
<div class="theme-option">
<span>
Sidebar Position </span>
<select class="sidebar-pos-option form-control input-small">
<option value="left" selected="selected">Left</option>
<option value="right">Right</option>
</select>
</div>
<div class="theme-option">
<span>
Footer </span>
<select class="page-footer-option form-control input-small">
<option value="fixed">Fixed</option>
<option value="default" selected="selected">Default</option>
</select>
</div>
</div>
</div>
<!-- END STYLE CUSTOMIZER -->
<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
About Us <small>about us page</small>
</h3>
<div class="page-bar">
<ul class="page-breadcrumb">
<li>
<i class="fa fa-home"></i>
<a href="index.html">Home</a>
<i class="fa fa-angle-right"></i>
</li>
<li>
<a href="#">Extra</a>
<i class="fa fa-angle-right"></i>
</li>
<li>
<a href="#">About Us</a>
</li>
</ul>
<div class="page-toolbar">
<div class="btn-group pull-right">
<button type="button" class="btn btn-fit-height grey-salt dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true">
Actions <i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right" role="menu">
<li>
<a href="#">Action</a>
</li>
<li>
<a href="#">Another action</a>
</li>
<li>
<a href="#">Something else here</a>
</li>
<li class="divider">
</li>
<li>
<a href="#">Separated link</a>
</li>
</ul>
</div>
</div>
</div>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div class="portlet light">
<div class="portlet-body">
<div class="row margin-bottom-30">
<div class="col-md-6">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
</p>
<ul class="list-unstyled margin-top-10 margin-bottom-10">
<li>
<i class="fa fa-check icon-default"></i> Nam liber tempor cum soluta
</li>
<li>
<i class="fa fa-check icon-success"></i> Mirum est notare quam
</li>
<li>
<i class="fa fa-check icon-info"></i> Lorem ipsum dolor sit amet
</li>
<li>
<i class="fa fa-check icon-danger"></i> Mirum est notare quam
</li>
<li>
<i class="fa fa-check icon-warning"></i> Mirum est notare quam
</li>
</ul>
<!-- Blockquotes -->
<blockquote class="hero">
<p>
Lorem ipsum dolor sit amet, consectetuer sed diam nonummy nibh euismod tincidunt.
</p>
<small>Bob Nilson</small>
</blockquote>
</div>
<div class="col-md-6">
<iframe src="http://player.vimeo.com/video/22439234" style="width:100%; height:327px;border:0" allowfullscreen>
</iframe>
</div>
</div>
<!--/row-->
<!-- Meer Our Team -->
<div class="headline">
<h3>Meet Our Team</h3>
</div>
<div class="row thumbnails">
<div class="col-md-3">
<div class="meet-our-team">
<h3>Bob Nilson <small>Chief Executive Officer / CEO</small></h3>
<img src="../../assets/admin/pages/media/pages/2.jpg" alt="" class="img-responsive"/>
<div class="team-info">
<p>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, justo sit amet risus etiam porta sem...
</p>
<ul class="social-icons pull-right">
<li>
<a href="javascript:;" data-original-title="twitter" class="twitter">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="facebook" class="facebook">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="linkedin" class="linkedin">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="Goole Plus" class="googleplus">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="skype" class="skype">
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-3">
<div class="meet-our-team">
<h3>Marta Doe <small>Project Manager</small></h3>
<img src="../../assets/admin/pages/media/pages/3.jpg" alt="" class="img-responsive"/>
<div class="team-info">
<p>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, justo sit amet risus etiam porta sem...
</p>
<ul class="social-icons pull-right">
<li>
<a href="javascript:;" data-original-title="twitter" class="twitter">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="facebook" class="facebook">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="linkedin" class="linkedin">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="Goole Plus" class="googleplus">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="skype" class="skype">
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-3">
<div class="meet-our-team">
<h3>Bob Nilson <small>Chief Executive Officer / CEO</small></h3>
<img src="../../assets/admin/pages/media/pages/2.jpg" alt="" class="img-responsive"/>
<div class="team-info">
<p>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, justo sit amet risus etiam porta sem...
</p>
<ul class="social-icons pull-right">
<li>
<a href="javascript:;" data-original-title="twitter" class="twitter">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="facebook" class="facebook">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="linkedin" class="linkedin">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="Goole Plus" class="googleplus">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="skype" class="skype">
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-3">
<div class="meet-our-team">
<h3>Marta Doe <small>Project Manager</small></h3>
<img src="../../assets/admin/pages/media/pages/3.jpg" alt="" class="img-responsive"/>
<div class="team-info">
<p>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, justo sit amet risus etiam porta sem...
</p>
<ul class="social-icons pull-right">
<li>
<a href="javascript:;" data-original-title="twitter" class="twitter">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="facebook" class="facebook">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="linkedin" class="linkedin">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="Goole Plus" class="googleplus">
</a>
</li>
<li>
<a href="javascript:;" data-original-title="skype" class="skype">
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!--/thumbnails-->
<!-- //End Meer Our Team -->
</div>
</div>
<!-- END PAGE CONTENT-->
</div>
</div>
<!-- END CONTENT -->
<!-- BEGIN QUICK SIDEBAR -->
<!--Cooming Soon...-->
<!-- END QUICK SIDEBAR -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<div class="page-footer">
<div class="page-footer-inner">
2014 © Metronic by keenthemes. <a href="http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes" title="Purchase Metronic just for 27$ and get lifetime updates for free" target="_blank">Purchase Metronic!</a>
</div>
<div class="scroll-to-top">
<i class="icon-arrow-up"></i>
</div>
</div>
<!-- END FOOTER -->
</div>
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<!--[if lt IE 9]>
<script src="../../assets/global/plugins/respond.min.js"></script>
<script src="../../assets/global/plugins/excanvas.min.js"></script>
<![endif]-->
<script src="../../assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
<!-- IMPORTANT! Load jquery-ui.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
<script src="../../assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<script src="../../assets/global/scripts/metronic.js" type="text/javascript"></script>
<script src="../../assets/admin/layout2/scripts/layout.js" type="text/javascript"></script>
<script src="../../assets/admin/layout2/scripts/demo.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function() {
Metronic.init(); // init metronic core components
Layout.init(); // init current layout
Demo.init(); // init demo features
});
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html> | {
"content_hash": "5e6f15934528863f712c13b49c4bbb12",
"timestamp": "",
"source": "github",
"line_count": 1552,
"max_line_length": 553,
"avg_line_length": 35.274484536082475,
"alnum_prop": 0.5184123040952764,
"repo_name": "wtfckkk/crm-admision",
"id": "4c7e2996687e4ab7390041be66fc356e065ed69b",
"size": "54746",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/metronic/theme_rtl/templates/admin2_material_design/page_about.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "596"
},
{
"name": "ApacheConf",
"bytes": "1643"
},
{
"name": "CSS",
"bytes": "10702631"
},
{
"name": "CoffeeScript",
"bytes": "167262"
},
{
"name": "HTML",
"bytes": "157354350"
},
{
"name": "JavaScript",
"bytes": "28206081"
},
{
"name": "PHP",
"bytes": "792194"
},
{
"name": "Shell",
"bytes": "888"
}
],
"symlink_target": ""
} |
function isStorageTypeSupported(storageType) {
return window[storageType] !== undefined;
}
function storageProxy(storageType, storageKey, defaultValue) {
if (!isStorageTypeSupported(storageType)) {
console.warn('Browser does not support %s', storageType);
window[storageType] = {};
}
return {
get(propertyName) {
var key = storageKey === undefined ? propertyName : storageKey;
if (!(key in window[storageType])) {
window[storageType][key] = JSON.stringify(defaultValue);
}
if (window[storageType][key] === 'undefined') {
return undefined;
}
return JSON.parse(window[storageType][key]);
},
set(propertyName, value) {
var key = storageKey === undefined ? propertyName : storageKey;
window[storageType][key] = JSON.stringify(value);
return value;
}
};
}
export const isLocalStorageSupported =
isStorageTypeSupported('localStorage');
export const localStorageProxy =
storageProxy.bind(window, 'localStorage');
export const isSessionStorageSupported =
isStorageTypeSupported('sessionStorage');
export const sessionStorageProxy =
storageProxy.bind(window, 'sessionStorage');
| {
"content_hash": "1bf3bdc8893b48e727365080ecd496f4",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 69,
"avg_line_length": 29.675,
"alnum_prop": 0.6941870261162595,
"repo_name": "jichu4n/ember-local-storage-proxy",
"id": "6133cf87b6a3b0b61a3c805b8d15516e007dba2e",
"size": "2925",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "addon/storage-proxy.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1680"
},
{
"name": "JavaScript",
"bytes": "10038"
}
],
"symlink_target": ""
} |
from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
from django.template import Context
from django.template.loader import get_template
def main_page(request):
template = get_template('main_page.html')
variables = Context({
'head_title': 'Django Bookmarks',
'page_title': 'Welcome to Django Bookmarks',
'page_body': 'Where you can store and share bookmarks!'
})
output = template.render(variables)
return HttpResponse(output)
def user_page(request, username):
try:
user = User.objects.get(username=username)
except:
raise Http404('Requested user not found.')
bookmarks = user.bookmark_set.all()
template = get_template('user_page.html')
variables = Context({
'username': username,
'bookmarks': bookmarks
})
output = template.render(variables)
return HttpResponse(output)
| {
"content_hash": "1c7e58a82f77184fbe346a91de28b84e",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 58,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.7420454545454546,
"repo_name": "westinedu/sovleit",
"id": "c561d70e7dfbcfc221b3e938f40a47bccf52660e",
"size": "880",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bookmarks/views.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "149426"
},
{
"name": "Python",
"bytes": "4239736"
},
{
"name": "Shell",
"bytes": "1355"
}
],
"symlink_target": ""
} |
package kiang.teb;
import java.io.*;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryPoolMXBean;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
public final class Performer implements Runnable {
private Map data;
private File file;
private int period;
private int looped;
private String encoding;
private TebEngine engine;
private boolean binary;
@Override
public void run() {
try {
long launch, finish;
TebEngine engine = this.engine;
Map data = this.data;
long[] ms = new long[this.looped / period + 1];
if (this.binary) {
if (engine.isBinarySupport()) {
ByteStream loopStream = new ByteStream();
launch = System.currentTimeMillis();
for (int i = 0, n = this.looped; i < n; i++) {
engine.test(data, loopStream);
if (i % period == 0) {
ms[i / period] = getMemory();
}
}
loopStream.flush();
finish = System.currentTimeMillis();
loopStream.close();
} else {
LinkStream loopStream = new LinkStream(this.encoding);
launch = System.currentTimeMillis();
for (int i = 0, n = this.looped; i < n; i++) {
engine.test(data, loopStream);
if (i % period == 0) {
ms[i / period] = getMemory();
}
}
loopStream.flush();
finish = System.currentTimeMillis();
loopStream.close();
}
} else {
CharStream loopStream = new CharStream(this.encoding);
launch = System.currentTimeMillis();
for (int i = 0, n = this.looped; i < n; i++) {
engine.test(data, loopStream);
if (i % period == 0) {
ms[i / period] = getMemory();
}
}
loopStream.flush();
finish = System.currentTimeMillis();
loopStream.close();
}
TebUtilities.println(this.file, "bot:" + launch, "eot:" + finish);
for (int i = 0, n = ms.length; i < n; i++) {
TebUtilities.println(this.file, "mfs:" + ms[i]);
}
TebUtilities.println(this.file, "mfs:" + getMemory());
} catch (Throwable e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
public static void main(String args[]) throws Exception {
test(new String[]{
System.getenv("binary"),
System.getenv("thread"),
System.getenv("record"),
System.getenv("period"),
System.getenv("warmed"),
System.getenv("looped"),
System.getenv("locate"),
System.getenv("source"),
System.getenv("target"),
System.getenv("tester"),
System.getenv("simple"),
System.getenv("debug")
});
System.out.println();
}
public static void test(String args[]) throws Exception {
boolean binary = Boolean.parseBoolean(args[0]);
int thread = Integer.parseInt(args[1]);
int record = Integer.parseInt(args[2]);
int period = Integer.parseInt(args[3]);
int warmed = Integer.parseInt(args[4]);
int looped = Integer.parseInt(args[5]);
String locate = args[6];
String source = args[7];
String target = args[8];
String tester = args[9];
String simple = args[10];
boolean debug = Boolean.parseBoolean(args[11]);
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
TebEngine engine = (TebEngine) classLoader.loadClass(simple).newInstance();
Properties properties = new Properties();
properties.setProperty("source", source);
properties.setProperty("target", target);
properties.setProperty("binary", String.valueOf(binary));
properties.setProperty("debug", String.valueOf(debug));
engine.init(properties);
Map data = new HashMap();
data.put("target", target);
data.put("models", TebModel.dummyModels(record));
long onceIo, onceOut;
if (binary) {
if (engine.isBinarySupport()) {
ByteStream warmStream = new ByteStream();
for (int i = 0; i < warmed; i++) {
engine.test(data, warmStream);
}
warmStream.flush();
warmStream.close();
onceIo = warmed == 0 ? 0 : warmStream.count() / warmed;
onceOut = warmed == 0 ? 0 : warmStream.size() / warmed;
} else {
LinkStream warmStream = new LinkStream(target);
for (int i = 0; i < warmed; i++) {
engine.test(data, warmStream);
}
warmStream.flush();
warmStream.close();
onceIo = warmed == 0 ? 0 : warmStream.count() / warmed;
onceOut = warmed == 0 ? 0 : warmStream.size() / warmed;
}
} else {
CharStream warmStream = new CharStream(target);
for (int i = 0; i < warmed; i++) {
engine.test(data, warmStream);
}
warmStream.flush();
warmStream.close();
onceIo = warmed == 0 ? 0 : warmStream.count() / warmed;
onceOut = warmed == 0 ? 0 : warmStream.size() / warmed;
}
long massIo = onceIo * looped * thread;
long massOut = onceOut * looped * thread;
File file = new File(locate, tester + ".txt");
TebUtilities.println(file, "oio:" + onceIo, "mio:" + massIo);
TebUtilities.println(file, "obs:" + onceOut, "mbs:" + massOut);
File tot = new File(locate, "TOT-" + tester + ".html");
OutputStream output = new FileOutputStream(tot);
if (binary && engine.isBinarySupport()) {
engine.test(data, output);
output.flush();
output.close();
} else {
Writer writer = new OutputStreamWriter(output, target);
engine.test(data, writer);
writer.flush();
writer.close();
}
Performer performer;
if (thread == 1) {
performer = new Performer();
performer.data = data;
performer.file = file;
performer.looped = looped;
performer.period = period;
performer.binary = binary;
performer.engine = engine;
performer.encoding = target;
performer.run();
engine.shut();
return;
}
ExecutorService threadPool = Executors.newFixedThreadPool(Math.min(thread, 200));
for (int i = 0; i < thread; i++) {
performer = new Performer();
performer.data = data;
performer.file = file;
performer.period = period;
performer.looped = looped;
performer.binary = binary;
performer.engine = engine;
performer.encoding = target;
threadPool.execute(performer);
}
threadPool.shutdown();
// wait thread pool finish.
while (!threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS)) ;
engine.shut();
}
private static long getMemory() {
long used = 0;
String name;
MemoryPoolMXBean bean;
List<MemoryPoolMXBean> mms = ManagementFactory.getMemoryPoolMXBeans();
for (int i = 0, n = mms.size(); i < n; i++) {
bean = mms.get(i);
name = bean.getName();
if (!name.contains("Eden")) {
used += bean.getUsage().getUsed();
}
}
return used;
}
}
| {
"content_hash": "e4b83fcf0e2ba53c28b65e1ceb8ca835",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 89,
"avg_line_length": 37.950450450450454,
"alnum_prop": 0.5072997032640949,
"repo_name": "djyin4op/tebpm",
"id": "5a7d89365e00e5ba409d45c615dcbc5920550ee8",
"size": "8503",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/kiang/teb/Performer.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "76778"
},
{
"name": "Shell",
"bytes": "940"
}
],
"symlink_target": ""
} |
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Renci.SshNet.Sftp;
using Renci.SshNet.Tests.Common;
namespace Renci.SshNet.Tests.Classes.Sftp
{
/// <summary>
///This is a test class for SftpSynchronizeDirectoriesAsyncResultTest and is intended
///to contain all SftpSynchronizeDirectoriesAsyncResultTest Unit Tests
///</summary>
[TestClass]
public class SftpSynchronizeDirectoriesAsyncResultTest : TestBase
{
/// <summary>
///A test for SftpSynchronizeDirectoriesAsyncResult Constructor
///</summary>
[TestMethod]
[Ignore] // placeholder
public void SftpSynchronizeDirectoriesAsyncResultConstructorTest()
{
AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
object state = null; // TODO: Initialize to an appropriate value
SftpSynchronizeDirectoriesAsyncResult target = new SftpSynchronizeDirectoriesAsyncResult(asyncCallback, state);
Assert.Inconclusive("TODO: Implement code to verify target");
}
}
}
| {
"content_hash": "b12559df177887d3a0b77d8ff4b2f0ab",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 123,
"avg_line_length": 39.357142857142854,
"alnum_prop": 0.7078039927404719,
"repo_name": "miniter/SSH.NET",
"id": "a2230ea0553d20e4c7c5c3a28b9e85fef80fc08b",
"size": "1104",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "src/Renci.SshNet.Tests/Classes/Sftp/SftpSynchronizeDirectoriesAsyncResultTest.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "426"
},
{
"name": "C#",
"bytes": "3870288"
}
],
"symlink_target": ""
} |
package es.ujaen.rlc00008.gnbwallet.ui.fragments.logged;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
import butterknife.BindView;
import butterknife.OnClick;
import es.ujaen.rlc00008.gnbwallet.R;
import es.ujaen.rlc00008.gnbwallet.domain.interactors.SetFavoriteInteractor;
import es.ujaen.rlc00008.gnbwallet.domain.interactors.UnsetFavoriteInteractor;
import es.ujaen.rlc00008.gnbwallet.domain.model.Card;
import es.ujaen.rlc00008.gnbwallet.domain.model.CreditCard;
import es.ujaen.rlc00008.gnbwallet.domain.model.DebitCard;
import es.ujaen.rlc00008.gnbwallet.domain.model.PrepaidCard;
import es.ujaen.rlc00008.gnbwallet.ui.adapters.pagers.CardsPagerAdapter;
import es.ujaen.rlc00008.gnbwallet.ui.base.BaseFragment;
import es.ujaen.rlc00008.gnbwallet.ui.fragments.dialogs.GenericDialogFragment;
import es.ujaen.rlc00008.gnbwallet.ui.utils.BranchImages;
import es.ujaen.rlc00008.gnbwallet.ui.views.ZoomOutPageTransformer;
/**
* Created by Ricardo on 4/6/16.
*/
public class HomeFragment extends BaseFragment implements
GenericDialogFragment.GenericDialogListener {
public interface HomeListener {
void homeLogout();
void homeDetailSelected(Card card);
void homeSeeCCV(Card card);
void homeSeePin(Card card);
void homeActivateCard(Card card);
void homeDeactivateCard(Card card);
void homeTransactionsSelected(Card card);
void homePay(Card card);
}
private HomeListener callback;
private List<Card> cards;
private int selectedIndex;
private CardsPagerAdapter mAdapter;
@BindView(R.id.toolbar_logout_imageview) ImageView logoutImageView;
@BindView(R.id.home_cards_viewpager) ViewPager viewPager;
@BindView(R.id.home_card_alias_textview) TextView aliasTextView;
@BindView(R.id.home_card_branch_imageview) ImageView branchImageView;
@BindView(R.id.home_activation_clickable_view) View activationClickableView;
@BindView(R.id.home_activation_icon_imageview) ImageView activationIconImageView;
@BindView(R.id.home_activation_textview) TextView activationTextView;
@BindView(R.id.home_transactions_clickable_view) View transactionsClickableView;
@BindView(R.id.home_transactions_icon_imageview) ImageView transactionsIconImageView;
@BindView(R.id.home_transactions_textview) TextView transactionsTextView;
@BindView(R.id.home_favorite_clickable_view) View favoriteClickableView;
@BindView(R.id.home_favorite_icon_imageview) ImageView favoriteIconImageView;
@BindView(R.id.home_favorite_textview) TextView favoriteTextView;
@BindView(R.id.home_activate_button) Button activateButton;
@BindView(R.id.home_debit_textview) TextView debitTextView;
@BindView(R.id.home_credit_balance_imageview) ImageView creditBalanceImageView;
@BindView(R.id.home_prepaid_view) View prepaidView;
@BindView(R.id.home_prepaid_textview) TextView prepaidTextView;
@BindView(R.id.home_pay_button) Button payButton;
public static HomeFragment newInstance(Card initialCard) {
Bundle bundle = new Bundle();
bundle.putParcelable("initialCard", initialCard);
HomeFragment fragment = new HomeFragment();
fragment.setArguments(bundle);
return fragment;
}
@Override
public void onAttach(Context context) {
try {
callback = (HomeListener) context;
} catch (ClassCastException e) {
throw new RuntimeException(context + " must implement HomeListener!");
}
super.onAttach(context);
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
cards = loggedDataInteractor.getCards();
if (savedInstanceState != null) {
selectedIndex = savedInstanceState.getInt("selectedIndex");
} else {
Card initialCard = getArguments().getParcelable("initialCard");
if (initialCard != null) {
selectedIndex = cards.indexOf(initialCard);
} else {
selectedIndex = 0;
}
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
outState.putInt("selectedIndex", selectedIndex);
super.onSaveInstanceState(outState);
}
@Override
protected int getContentView() {
return R.layout.fragment_home;
}
@Override
protected void prepareInterface(View mainView) {
logoutImageView.setVisibility(View.VISIBLE);
mAdapter = new CardsPagerAdapter(cards, getChildFragmentManager());
viewPager.setPageTransformer(true, new ZoomOutPageTransformer());
viewPager.setOffscreenPageLimit(2);
int margin = (int) getResources().getDimension(R.dimen.cards_view_box_padding) * 2;
viewPager.setPageMargin(-margin);
viewPager.setAdapter(mAdapter);
viewPager.setCurrentItem(selectedIndex, false);
selectCard(getSelectedCard());
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
//
}
@Override
public void onPageSelected(int position) {
selectedIndex = position;
selectCard(getSelectedCard());
}
@Override
public void onPageScrollStateChanged(int state) {
//
}
});
}
@OnClick(R.id.toolbar_logout_imageview)
void logoutClick() {
callback.homeLogout();
}
@OnClick(R.id.home_detail_textview)
void detailClick() {
callback.homeDetailSelected(getSelectedCard());
}
@OnClick(R.id.home_ccv_textview)
void ccvClick() {
callback.homeSeeCCV(getSelectedCard());
}
@OnClick(R.id.home_pin_textview)
void pinClick() {
callback.homeSeePin(getSelectedCard());
}
@OnClick(R.id.home_activation_clickable_view)
void activationClick() {
Card selectedCard = getSelectedCard();
if (getSelectedCard().isEnabled()) {
callback.homeDeactivateCard(selectedCard);
} else {
callback.homeActivateCard(selectedCard);
}
}
@OnClick(R.id.home_transactions_clickable_view)
void transactionsClick() {
callback.homeTransactionsSelected(getSelectedCard());
}
@OnClick(R.id.home_activate_button)
void activateClick() {
callback.homeActivateCard(getSelectedCard());
}
@OnClick(R.id.home_favorite_clickable_view)
void favoriteClick() {
Card selectedCard = getSelectedCard();
if (!selectedCard.isEnabled()) {
showErrorFragment(getString(R.string.home_error_activate_before_favorite));
} else if (selectedCard.isFavorite()) {
unsetFavorite();
} else {
setFavorite();
}
}
@OnClick(R.id.home_pay_button)
void payClick() {
callback.homePay(getSelectedCard());
}
private Card getSelectedCard() {
return cards.get(selectedIndex);
}
private void selectCard(Card card) {
aliasTextView.setText(card.getAlias());
branchImageView.setImageResource(BranchImages.getResId(card));
if (card.isEnabled()) {
activationIconImageView.setImageResource(R.drawable.icn_deactivate);
activationTextView.setText(R.string.home_deactivate);
activateButton.setVisibility(View.GONE);
if (card.isNfc()) {
payButton.setVisibility(View.VISIBLE);
} else {
payButton.setVisibility(View.GONE);
}
} else {
activationIconImageView.setImageResource(R.drawable.icn_activate);
activationTextView.setText(R.string.home_activate);
activateButton.setVisibility(View.VISIBLE);
payButton.setVisibility(View.GONE);
}
if (card.isNfc()) {
favoriteClickableView.setVisibility(View.VISIBLE);
} else {
favoriteClickableView.setVisibility(View.GONE);
}
if (card.isFavorite()) {
favoriteIconImageView.setImageResource(R.drawable.icn_favs_on);
} else {
favoriteIconImageView.setImageResource(R.drawable.icn_favs_off);
}
if (card instanceof DebitCard) {
setDebitCardView((DebitCard) card);
} else if (card instanceof CreditCard) {
setCreditCardView((CreditCard) card);
} else if (card instanceof PrepaidCard) {
setPrepaidCardView((PrepaidCard) card);
}
}
private void setDebitCardView(DebitCard debitCard) {
creditBalanceImageView.setVisibility(View.GONE);
prepaidView.setVisibility(View.GONE);
debitTextView.setVisibility(View.VISIBLE);
}
private void setCreditCardView(CreditCard creditCard) {
debitTextView.setVisibility(View.GONE);
prepaidView.setVisibility(View.GONE);
double ratio = creditCard.getCurrentBalance().getAmountValue() / creditCard.getCreditLimit().getAmountValue();
final int imageResId;
if (ratio < 0.2) {
imageResId = R.drawable.bground_progress_0;
} else if (ratio < 0.4) {
imageResId = R.drawable.bground_progress_1;
} else if (ratio < 0.6) {
imageResId = R.drawable.bground_progress_2;
} else if (ratio < 0.8) {
imageResId = R.drawable.bground_progress_3;
} else {
imageResId = R.drawable.bground_progress_4;
}
creditBalanceImageView.setImageResource(imageResId);
creditBalanceImageView.setVisibility(View.VISIBLE);
}
private void setPrepaidCardView(PrepaidCard prepaidCard) {
debitTextView.setVisibility(View.GONE);
creditBalanceImageView.setVisibility(View.GONE);
prepaidTextView.setText(prepaidCard.getBalance().getAmountFormatted());
prepaidView.setVisibility(View.VISIBLE);
}
private void setFavorite() {
showLoading();
setFavoriteInteractor.setFavorite(getSelectedCard(), new SetFavoriteInteractor.SetFavoriteCallback() {
@Override
public void setFavoriteOk(Card card) {
cards = loggedDataInteractor.getCards();
mAdapter.refreshList(cards);
selectCard(getSelectedCard());
hideLoading();
}
@Override
public void setFavoriteOkWithWarning(Card card, String message) {
cards = loggedDataInteractor.getCards();
mAdapter.refreshList(cards);
selectCard(getSelectedCard());
hideLoading();
showErrorFragment(message);
}
@Override
public void operativeError(String message) {
hideLoading();
showErrorFragment(message);
}
});
}
private void unsetFavorite() {
showLoading();
unsetFavoriteInteractor.unsetFavorite(getSelectedCard(), new UnsetFavoriteInteractor.UnsetFavoriteCallback() {
@Override
public void unsetFavoriteOk(Card card) {
cards = loggedDataInteractor.getCards();
mAdapter.refreshList(cards);
selectCard(getSelectedCard());
hideLoading();
}
@Override
public void operativeError(String message) {
hideLoading();
showErrorFragment(message);
}
});
}
}
| {
"content_hash": "57892e9c6ac29f60d99ba13d5423e88e",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 112,
"avg_line_length": 29.46857142857143,
"alnum_prop": 0.7597440372309482,
"repo_name": "Ricardo-Lechuga/gnb-wallet",
"id": "23ed7e062b7b4e2b860dd502f579262580343d30",
"size": "10314",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "app/src/main/java/es/ujaen/rlc00008/gnbwallet/ui/fragments/logged/HomeFragment.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "221180"
}
],
"symlink_target": ""
} |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.payments;
import androidx.test.filters.MediumTest;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.payments.PaymentRequestTestRule.AppPresence;
import org.chromium.chrome.browser.payments.PaymentRequestTestRule.AppSpeed;
import org.chromium.chrome.browser.payments.PaymentRequestTestRule.FactorySpeed;
import org.chromium.chrome.browser.payments.PaymentRequestTestRule.MainActivityStartCallback;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import java.util.concurrent.TimeoutException;
/**
* A payment integration test for the show promise with digital goods.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
public class PaymentRequestShowPromiseDigitalGoodsTest implements MainActivityStartCallback {
@Rule
public PaymentRequestTestRule mRule =
new PaymentRequestTestRule("show_promise/digital_goods.html", this);
@Override
public void onMainActivityStarted() {}
// The initial total in digital_goods.js is 99.99 while the final total is 1.00. Transaction
// amount metrics must record the final total rather than the initial one. The final total falls
// into the micro transaction category.
private static final int sMicroTransaction = 1;
@Test
@MediumTest
@Feature({"Payments"})
@CommandLineFlags.Add({"enable-features=PaymentRequestBasicCard"})
public void testDigitalGoodsFastApp_WithBasicCardEnabled() throws TimeoutException {
mRule.addPaymentAppFactory("basic-card", AppPresence.HAVE_APPS, FactorySpeed.FAST_FACTORY);
mRule.openPage();
mRule.executeJavaScriptAndWaitForResult("create('basic-card');");
mRule.triggerUIAndWait(mRule.getReadyToPay());
Assert.assertEquals("USD $1.00", mRule.getOrderSummaryTotal());
mRule.clickAndWait(R.id.button_primary, mRule.getDismissed());
mRule.expectResultContains(new String[] {"\"total\":\"1.00\""});
Assert.assertEquals(1,
RecordHistogram.getHistogramValueCountForTesting(
"PaymentRequest.TransactionAmount.Triggered", sMicroTransaction));
Assert.assertEquals(1,
RecordHistogram.getHistogramValueCountForTesting(
"PaymentRequest.TransactionAmount.Completed", sMicroTransaction));
}
@Test
@MediumTest
@Feature({"Payments"})
@CommandLineFlags.Add({"disable-features=PaymentRequestBasicCard"})
public void testDigitalGoodsFastApp() throws TimeoutException {
mRule.addPaymentAppFactory(
"https://bobpay.com", AppPresence.HAVE_APPS, FactorySpeed.FAST_FACTORY);
mRule.openPage();
mRule.executeJavaScriptAndWaitForResult("create('https://bobpay.com');");
mRule.triggerUIAndWait(mRule.getResultReady());
mRule.expectResultContains(new String[] {"\"total\":\"1.00\""});
Assert.assertEquals(1,
RecordHistogram.getHistogramValueCountForTesting(
"PaymentRequest.TransactionAmount.Triggered", sMicroTransaction));
Assert.assertEquals(1,
RecordHistogram.getHistogramValueCountForTesting(
"PaymentRequest.TransactionAmount.Completed", sMicroTransaction));
}
@Test
@MediumTest
@Feature({"Payments"})
@CommandLineFlags.Add({"enable-features=PaymentRequestBasicCard"})
public void testDigitalGoodsSlowApp_WithBasicCardEnabled() throws TimeoutException {
mRule.addPaymentAppFactory(
"basic-card", AppPresence.HAVE_APPS, FactorySpeed.SLOW_FACTORY, AppSpeed.SLOW_APP);
mRule.openPage();
mRule.executeJavaScriptAndWaitForResult("create('basic-card');");
mRule.triggerUIAndWait(mRule.getReadyToPay());
Assert.assertEquals("USD $1.00", mRule.getOrderSummaryTotal());
mRule.clickAndWait(R.id.button_primary, mRule.getDismissed());
mRule.expectResultContains(new String[] {"\"total\":\"1.00\""});
Assert.assertEquals(1,
RecordHistogram.getHistogramValueCountForTesting(
"PaymentRequest.TransactionAmount.Triggered", sMicroTransaction));
Assert.assertEquals(1,
RecordHistogram.getHistogramValueCountForTesting(
"PaymentRequest.TransactionAmount.Completed", sMicroTransaction));
}
@Test
@MediumTest
@Feature({"Payments"})
@CommandLineFlags.Add({"disable-features=PaymentRequestBasicCard"})
public void testDigitalGoodsSlowApp() throws TimeoutException {
mRule.addPaymentAppFactory("https://bobpay.com", AppPresence.HAVE_APPS,
FactorySpeed.SLOW_FACTORY, AppSpeed.SLOW_APP);
mRule.openPage();
mRule.executeJavaScriptAndWaitForResult("create('https://bobpay.com');");
mRule.triggerUIAndWait(mRule.getResultReady());
mRule.expectResultContains(new String[] {"\"total\":\"1.00\""});
Assert.assertEquals(1,
RecordHistogram.getHistogramValueCountForTesting(
"PaymentRequest.TransactionAmount.Triggered", sMicroTransaction));
Assert.assertEquals(1,
RecordHistogram.getHistogramValueCountForTesting(
"PaymentRequest.TransactionAmount.Completed", sMicroTransaction));
}
@Test
@MediumTest
@Feature({"Payments"})
@CommandLineFlags.Add({"enable-features=PaymentRequestBasicCard"})
public void testSkipUIFastApp_WithBasicCardEnabled() throws TimeoutException {
mRule.addPaymentAppFactory("basic-card", AppPresence.HAVE_APPS, FactorySpeed.FAST_FACTORY);
mRule.openPage();
mRule.executeJavaScriptAndWaitForResult("create('basic-card');");
mRule.enableSkipUIForBasicCard();
mRule.openPageAndClickNodeAndWait("buy", mRule.getDismissed());
mRule.expectResultContains(new String[] {"\"total\":\"1.00\""});
}
@Test
@MediumTest
@Feature({"Payments"})
@CommandLineFlags.Add({"disable-features=PaymentRequestBasicCard"})
public void testSkipUIFastApp() throws TimeoutException {
mRule.addPaymentAppFactory(
"https://bobpay.com", AppPresence.HAVE_APPS, FactorySpeed.FAST_FACTORY);
mRule.openPage();
mRule.executeJavaScriptAndWaitForResult("create('https://bobpay.com');");
mRule.enableSkipUIForBasicCard();
mRule.openPageAndClickNodeAndWait("buy", mRule.getDismissed());
mRule.expectResultContains(new String[] {"\"total\":\"1.00\""});
}
@Test
@MediumTest
@Feature({"Payments"})
@CommandLineFlags.Add({"enable-features=PaymentRequestBasicCard"})
public void testSkipUISlowApp_WithBasicCardEnabled() throws TimeoutException {
mRule.addPaymentAppFactory(
"basic-card", AppPresence.HAVE_APPS, FactorySpeed.SLOW_FACTORY, AppSpeed.SLOW_APP);
mRule.openPage();
mRule.executeJavaScriptAndWaitForResult("create('basic-card');");
mRule.enableSkipUIForBasicCard();
mRule.openPageAndClickNodeAndWait("buy", mRule.getDismissed());
mRule.expectResultContains(new String[] {"\"total\":\"1.00\""});
}
@Test
@MediumTest
@Feature({"Payments"})
@CommandLineFlags.Add({"disable-features=PaymentRequestBasicCard"})
public void testSkipUISlowApp() throws TimeoutException {
mRule.addPaymentAppFactory("https://bobpay.com", AppPresence.HAVE_APPS,
FactorySpeed.SLOW_FACTORY, AppSpeed.SLOW_APP);
mRule.openPage();
mRule.executeJavaScriptAndWaitForResult("create('https://bobpay.com');");
mRule.enableSkipUIForBasicCard();
mRule.openPageAndClickNodeAndWait("buy", mRule.getDismissed());
mRule.expectResultContains(new String[] {"\"total\":\"1.00\""});
}
}
| {
"content_hash": "fc954c618a6f03050b3ae4e3efa1744a",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 100,
"avg_line_length": 43.118556701030926,
"alnum_prop": 0.7013747758517633,
"repo_name": "scheib/chromium",
"id": "f19e88c0599e655181350311a86edbb7ab914268",
"size": "8365",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShowPromiseDigitalGoodsTest.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package cz.zcu.kiv.formgen.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This annotation is used to mark several POJO classes for which the tool will generate
* just one (multiple) form. Note the diference from {@link Form} which maps one class
* to one form.
*
* @author Jakub Krauz
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface MultiForm {
/**
* Name of the form. It identifies the form, i.e. it must have exactly the same
* value for all classes that will be included in the same form.
* @return the name
*/
String value();
/**
* Label of the form.
* @return the label
*/
String label() default "";
}
| {
"content_hash": "13cd9b0df6e9134390ec501419dc9999",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 88,
"avg_line_length": 24.228571428571428,
"alnum_prop": 0.6863207547169812,
"repo_name": "NEUROINFORMATICS-GROUP-FAV-KIV-ZCU/layout-generator",
"id": "2347f0a884a7bce87b530cbf99f4a88cbb3d2fe7",
"size": "2135",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/cz/zcu/kiv/formgen/annotation/MultiForm.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "296456"
}
],
"symlink_target": ""
} |
import re
from itertools import chain
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _, ugettext_lazy, get_language
from django.utils.safestring import mark_safe
try: #Django 1.7+
from django.contrib.admin.options import TO_FIELD_VAR #@UnresolvedImport
except:
TO_FIELD_VAR = 't'
try: #Django 1.6+
from django.contrib.admin.options import IS_POPUP_VAR #@UnresolvedImport
except:
IS_POPUP_VAR = 'pop'
class ContentTypeSelect(forms.Select):
def __init__(self, object_id, attrs=None, choices=()):
self.object_id = 'id_%s' % object_id
super(ContentTypeSelect, self).__init__(attrs, choices)
def render(self, name, value, attrs=None, choices=()):
output = super(ContentTypeSelect, self).render(name, value, attrs, choices)
choiceoutput = ' var %s_choice_urls = {' % (attrs['id'],)
for ctype in ContentType.objects.filter(pk__in=[int(c[0])for c in chain(self.choices, choices) if c[0]]):
choiceoutput += ' \'%s\' : \'../../../%s/%s?%s=%s\',' % ( str(ctype.pk),
ctype.app_label, ctype.model,
TO_FIELD_VAR, ctype.model_class()._meta.pk.name)
choiceoutput += '};'
output += ('<script>'
'(function($) {'
' $(document).ready( function() {'
'%(choiceoutput)s'
' $(\'#%(id)s\').change(function (){'
' $(\'#%(fk_id)s\').val(\'\');'
' $(\'#lookup_%(fk_id)s\').attr(\'href\',%(id)s_choice_urls[$(this).val()]+"&%(popup_var)s=1").siblings(\'strong\').html(\'\');'
' });'
' });'
'})(yawdadmin.jQuery);'
'</script>' % { 'choiceoutput' : choiceoutput,
'id' : attrs['id'],
'fk_id' : self.object_id,
'popup_var': IS_POPUP_VAR
})
return mark_safe(u''.join(output))
class AutoCompleteTextInput(forms.TextInput):
def __init__(self, *args, **kwargs):
if 'source' in kwargs:
self.source = kwargs['source']
del kwargs['source']
else:
self.source = None
super(AutoCompleteTextInput, self).__init__(*args, **kwargs)
def render(self, name, value, attrs=None):
if self.source:
attrs['autocomplete'] = 'off'
output = super(AutoCompleteTextInput, self).render(name, value, attrs)
if self.source:
js = '<script>(function($){$("#%(id)s").typeahead({source: ' \
'function(query, process) { $.get("%(source)s", {query: ' \
'query},function(data) { return typeof data.results == ' \
'"undefined" ? false : process(data.results); }, "json") ' \
'}});})(yawdadmin.jQuery);</script>' % {'id': attrs['id'],
'source': self.source}
return output + mark_safe(js)
class BootstrapRadioRenderer(forms.RadioSelect.renderer):
def render(self):
return mark_safe(u'\n'.join([u'%s\n' % unicode(w).replace('<label ', '<label class="radio inline" ') for w in self])+' ')
class Select2MultipleWidget(forms.SelectMultiple):
"""
Custom multiple selection widget based on http://ivaynberg.github.io/select2/
Note that the resulting JavaScript assumes that the jsi18n
catalog has been loaded in the page
"""
def _media(self):
"""
Set the widget's javascript and css
"""
return forms.Media(css = {'all': ('yawd-admin/css/select2/select2.css',)},
js = ('yawd-admin/css/select2/select2.min.js',
'yawd-admin/css/select2/select2_locale_'+
get_language()+'.js'))
media = property(_media)
def render(self, name, value, attrs=None, choices=()):
result = super(Select2MultipleWidget, self).render(name, value, attrs, choices)
return result + mark_safe('<script>(function($){'\
'$(\'#%s\').select2();'\
'})(yawdadmin.jQuery);</script>' % attrs['id'])
class Select2Widget(forms.Select):
"""
Custom selection widget based on http://ivaynberg.github.io/select2/
Note that the resulting JavaScript assumes that the jsi18n
catalog has been loaded in the page
"""
select2_options = ''
def _media(self):
"""
Set the widget's javascript and css
"""
return forms.Media(css = {'all': ('yawd-admin/css/select2/select2.css',)},
js = ('yawd-admin/css/select2/select2.min.js',
'yawd-admin/css/select2/select2_locale_'+
get_language()+'.js'))
media = property(_media)
def render(self, name, value, attrs=None, choices=()):
result = super(Select2Widget, self).render(name, value, attrs, choices)
#read-only mode
ro = ''
if self.attrs and 'readonly' in self.attrs and self.attrs['readonly']:
ro = '.select2("readonly", true)'
return result + mark_safe('<script>(function($){'\
'$(\'#%s\').select2(%s)%s;'\
'})(yawdadmin.jQuery);</script>' % (attrs['id'],
self.select2_options,
ro))
class SwitchWidget(forms.CheckboxInput):
class Media:
js = ('yawd-admin/js/bootstrap.switch.min.js',)
def render(self, name, value, attrs=None):
switch_defaults = {
'data-on-label': ugettext_lazy('YES'),
'data-off-label': ugettext_lazy('NO'),
'data-on': 'success',
'data-off': 'danger'
}
switch_defaults.update(self.attrs)
self.attrs = switch_defaults
return super(SwitchWidget, self).render(name, value, attrs) + \
mark_safe("<script>yawdadmin.jQuery('#%s').bootstrapSwitch();</script>" \
% attrs['id'])
| {
"content_hash": "513dea0ae23ee46968b2b0d92fd2041a",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 154,
"avg_line_length": 40.88461538461539,
"alnum_prop": 0.5156788962057072,
"repo_name": "mwolff44/yawd-admin",
"id": "88dd353a39474666ff16dcc2ff97676d2eaf8f67",
"size": "6402",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "yawdadmin/widgets.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "101359"
},
{
"name": "HTML",
"bytes": "136034"
},
{
"name": "JavaScript",
"bytes": "325370"
},
{
"name": "Python",
"bytes": "113943"
},
{
"name": "Shell",
"bytes": "1383"
}
],
"symlink_target": ""
} |
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.sf.cglib.proxy;
import net.sf.cglib.core.ReflectUtils;
import java.lang.reflect.Method;
import java.util.*;
/**
* @version $Id: CallbackHelper.java,v 1.2 2004/06/24 21:15:20 herbyderby Exp $
*/
abstract public class CallbackHelper
implements CallbackFilter
{
private Map methodMap = new HashMap();
private List callbacks = new ArrayList();
public CallbackHelper(Class superclass, Class[] interfaces)
{
List methods = new ArrayList();
Enhancer.getMethods(superclass, interfaces, methods);
Map indexes = new HashMap();
for (int i = 0, size = methods.size(); i < size; i++) {
Method method = (Method)methods.get(i);
Object callback = getCallback(method);
if (callback == null)
throw new IllegalStateException("getCallback cannot return null");
boolean isCallback = callback instanceof Callback;
if (!(isCallback || (callback instanceof Class)))
throw new IllegalStateException("getCallback must return a Callback or a Class");
if (i > 0 && ((callbacks.get(i - 1) instanceof Callback) ^ isCallback))
throw new IllegalStateException("getCallback must return a Callback or a Class consistently for every Method");
Integer index = (Integer)indexes.get(callback);
if (index == null) {
index = new Integer(callbacks.size());
indexes.put(callback, index);
}
methodMap.put(method, index);
callbacks.add(callback);
}
}
abstract protected Object getCallback(Method method);
public Callback[] getCallbacks()
{
if (callbacks.size() == 0)
return new Callback[0];
if (callbacks.get(0) instanceof Callback) {
return (Callback[])callbacks.toArray(new Callback[callbacks.size()]);
} else {
throw new IllegalStateException("getCallback returned classes, not callbacks; call getCallbackTypes instead");
}
}
public Class[] getCallbackTypes()
{
if (callbacks.size() == 0)
return new Class[0];
if (callbacks.get(0) instanceof Callback) {
return ReflectUtils.getClasses(getCallbacks());
} else {
return (Class[])callbacks.toArray(new Class[callbacks.size()]);
}
}
public int accept(Method method)
{
return ((Integer)methodMap.get(method)).intValue();
}
public int hashCode()
{
return methodMap.hashCode();
}
public boolean equals(Object o)
{
if (o == null)
return false;
if (!(o instanceof CallbackHelper))
return false;
return methodMap.equals(((CallbackHelper)o).methodMap);
}
}
| {
"content_hash": "79c094872ae99ca4a0c3841150abdb73",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 127,
"avg_line_length": 34.74747474747475,
"alnum_prop": 0.6267441860465116,
"repo_name": "florianerhard/gedi",
"id": "42c9b2444838aeba24b87a4a1cbee8c03a1a7ed2",
"size": "4067",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cglib/src/net/sf/cglib/proxy/CallbackHelper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2123"
},
{
"name": "Component Pascal",
"bytes": "5859"
},
{
"name": "HTML",
"bytes": "205503"
},
{
"name": "Java",
"bytes": "7560272"
},
{
"name": "JavaScript",
"bytes": "151047"
},
{
"name": "Perl",
"bytes": "1858"
},
{
"name": "R",
"bytes": "21668"
},
{
"name": "Shell",
"bytes": "40603"
}
],
"symlink_target": ""
} |
using namespace swift;
using namespace llvm::opt;
// Constructors
FrontendInputsAndOutputs::FrontendInputsAndOutputs(
const FrontendInputsAndOutputs &other) {
for (InputFile input : other.AllInputs)
addInput(input);
IsSingleThreadedWMO = other.IsSingleThreadedWMO;
}
FrontendInputsAndOutputs &FrontendInputsAndOutputs::
operator=(const FrontendInputsAndOutputs &other) {
clearInputs();
for (InputFile input : other.AllInputs)
addInput(input);
IsSingleThreadedWMO = other.IsSingleThreadedWMO;
return *this;
}
// All inputs:
std::vector<std::string> FrontendInputsAndOutputs::getInputFilenames() const {
std::vector<std::string> filenames;
for (auto &input : AllInputs) {
filenames.push_back(input.file());
}
return filenames;
}
bool FrontendInputsAndOutputs::isReadingFromStdin() const {
return hasSingleInput() && getFilenameOfFirstInput() == "-";
}
const std::string &FrontendInputsAndOutputs::getFilenameOfFirstInput() const {
assert(hasInputs());
const InputFile &inp = AllInputs[0];
const std::string &f = inp.file();
assert(!f.empty());
return f;
}
bool FrontendInputsAndOutputs::forEachInput(
llvm::function_ref<bool(const InputFile &)> fn) const {
for (const InputFile &input : AllInputs)
if (fn(input))
return true;
return false;
}
// Primaries:
const InputFile &FrontendInputsAndOutputs::firstPrimaryInput() const {
assert(!PrimaryInputsInOrder.empty());
return AllInputs[PrimaryInputsInOrder.front()];
}
const InputFile &FrontendInputsAndOutputs::lastPrimaryInput() const {
assert(!PrimaryInputsInOrder.empty());
return AllInputs[PrimaryInputsInOrder.back()];
}
bool FrontendInputsAndOutputs::forEachPrimaryInput(
llvm::function_ref<bool(const InputFile &)> fn) const {
for (unsigned i : PrimaryInputsInOrder)
if (fn(AllInputs[i]))
return true;
return false;
}
bool FrontendInputsAndOutputs::forEachNonPrimaryInput(
llvm::function_ref<bool(const InputFile &)> fn) const {
return forEachInput([&](const InputFile &f) -> bool {
return f.isPrimary() ? false : fn(f);
});
}
void FrontendInputsAndOutputs::assertMustNotBeMoreThanOnePrimaryInput() const {
assert(!hasMultiplePrimaryInputs() &&
"have not implemented >1 primary input yet");
}
void FrontendInputsAndOutputs::
assertMustNotBeMoreThanOnePrimaryInputUnlessBatchModeChecksHaveBeenBypassed()
const {
if (!areBatchModeChecksBypassed())
assertMustNotBeMoreThanOnePrimaryInput();
}
const InputFile *FrontendInputsAndOutputs::getUniquePrimaryInput() const {
assertMustNotBeMoreThanOnePrimaryInput();
return PrimaryInputsInOrder.empty()
? nullptr
: &AllInputs[PrimaryInputsInOrder.front()];
}
const InputFile &
FrontendInputsAndOutputs::getRequiredUniquePrimaryInput() const {
if (const auto *input = getUniquePrimaryInput())
return *input;
llvm_unreachable("No primary when one is required");
}
std::string FrontendInputsAndOutputs::getStatsFileMangledInputName() const {
// Use the first primary, even if there are multiple primaries.
// That's enough to keep the file names unique.
return isWholeModule() ? "all" : firstPrimaryInput().file();
}
bool FrontendInputsAndOutputs::isInputPrimary(StringRef file) const {
return primaryInputNamed(file) != nullptr;
}
unsigned FrontendInputsAndOutputs::numberOfPrimaryInputsEndingWith(
StringRef extension) const {
unsigned n = 0;
(void)forEachPrimaryInput([&](const InputFile &input) -> bool {
if (llvm::sys::path::extension(input.file()).endswith(extension))
++n;
return false;
});
return n;
}
// Input queries
bool FrontendInputsAndOutputs::shouldTreatAsLLVM() const {
if (hasSingleInput()) {
StringRef Input(getFilenameOfFirstInput());
return llvm::sys::path::extension(Input).endswith(LLVM_BC_EXTENSION) ||
llvm::sys::path::extension(Input).endswith(LLVM_IR_EXTENSION);
}
return false;
}
bool FrontendInputsAndOutputs::shouldTreatAsSIL() const {
if (hasSingleInput()) {
// If we have exactly one input filename, and its extension is "sil",
// treat the input as SIL.
const std::string &Input(getFilenameOfFirstInput());
return llvm::sys::path::extension(Input).endswith(SIL_EXTENSION);
}
// If we have one primary input and it's a filename with extension "sil",
// treat the input as SIL.
unsigned silPrimaryCount = numberOfPrimaryInputsEndingWith(SIL_EXTENSION);
if (silPrimaryCount == 0)
return false;
if (silPrimaryCount == primaryInputCount()) {
// Not clear what to do someday with multiple primaries
assertMustNotBeMoreThanOnePrimaryInput();
return true;
}
llvm_unreachable("Either all primaries or none must end with .sil");
}
bool FrontendInputsAndOutputs::areAllNonPrimariesSIB() const {
for (const InputFile &input : AllInputs) {
if (input.isPrimary())
continue;
if (!llvm::sys::path::extension(input.file()).endswith(SIB_EXTENSION)) {
return false;
}
}
return true;
}
bool FrontendInputsAndOutputs::verifyInputs(DiagnosticEngine &diags,
bool treatAsSIL,
bool isREPLRequested,
bool isNoneRequested) const {
if (isREPLRequested) {
if (hasInputs()) {
diags.diagnose(SourceLoc(), diag::error_repl_requires_no_input_files);
return true;
}
} else if (treatAsSIL) {
if (isWholeModule()) {
if (inputCount() != 1) {
diags.diagnose(SourceLoc(), diag::error_mode_requires_one_input_file);
return true;
}
} else {
assertMustNotBeMoreThanOnePrimaryInput();
// If we have the SIL as our primary input, we can waive the one file
// requirement as long as all the other inputs are SIBs.
if (!areAllNonPrimariesSIB()) {
diags.diagnose(SourceLoc(),
diag::error_mode_requires_one_sil_multi_sib);
return true;
}
}
} else if (!isNoneRequested && !hasInputs()) {
diags.diagnose(SourceLoc(), diag::error_mode_requires_an_input_file);
return true;
}
return false;
}
// Changing inputs
void FrontendInputsAndOutputs::clearInputs() {
AllInputs.clear();
PrimaryInputsByName.clear();
PrimaryInputsInOrder.clear();
}
void FrontendInputsAndOutputs::addInput(const InputFile &input) {
const unsigned index = AllInputs.size();
AllInputs.push_back(input);
if (input.isPrimary()) {
PrimaryInputsInOrder.push_back(index);
PrimaryInputsByName.insert(std::make_pair(AllInputs.back().file(), index));
}
}
void FrontendInputsAndOutputs::addInputFile(StringRef file,
llvm::MemoryBuffer *buffer) {
addInput(InputFile(file, false, buffer));
}
void FrontendInputsAndOutputs::addPrimaryInputFile(StringRef file,
llvm::MemoryBuffer *buffer) {
addInput(InputFile(file, true, buffer));
}
// Outputs
unsigned FrontendInputsAndOutputs::countOfInputsProducingMainOutputs() const {
return isSingleThreadedWMO()
? 1
: hasPrimaryInputs() ? primaryInputCount() : inputCount();
}
const InputFile &FrontendInputsAndOutputs::firstInputProducingOutput() const {
return isSingleThreadedWMO()
? firstInput()
: hasPrimaryInputs() ? firstPrimaryInput() : firstInput();
}
const InputFile &FrontendInputsAndOutputs::lastInputProducingOutput() const {
return isSingleThreadedWMO()
? firstInput()
: hasPrimaryInputs() ? lastPrimaryInput() : lastInput();
}
bool FrontendInputsAndOutputs::forEachInputProducingAMainOutputFile(
llvm::function_ref<bool(const InputFile &)> fn) const {
return isSingleThreadedWMO()
? fn(firstInput())
: hasPrimaryInputs() ? forEachPrimaryInput(fn) : forEachInput(fn);
}
void FrontendInputsAndOutputs::setMainAndSupplementaryOutputs(
ArrayRef<std::string> outputFiles,
ArrayRef<SupplementaryOutputPaths> supplementaryOutputs) {
if (AllInputs.empty()) {
assert(outputFiles.empty() && "Cannot have outputs without inputs");
assert(supplementaryOutputs.empty() &&
"Cannot have supplementary outputs without inputs");
return;
}
if (hasPrimaryInputs()) {
const auto N = primaryInputCount();
assert(outputFiles.size() == N && "Must have one main output per primary");
assert(supplementaryOutputs.size() == N &&
"Must have one set of supplementary outputs per primary");
unsigned i = 0;
for (auto &input : AllInputs) {
if (input.isPrimary()) {
input.setPrimarySpecificPaths(PrimarySpecificPaths(
outputFiles[i], input.file(), supplementaryOutputs[i]));
++i;
}
}
return;
}
assert(supplementaryOutputs.size() == 1 &&
"WMO only ever produces one set of supplementary outputs");
if (outputFiles.size() == 1) {
AllInputs.front().setPrimarySpecificPaths(PrimarySpecificPaths(
outputFiles.front(), firstInputProducingOutput().file(),
supplementaryOutputs.front()));
return;
}
assert(outputFiles.size() == AllInputs.size() &&
"Multi-threaded WMO requires one main output per input");
for (auto i : indices(AllInputs))
AllInputs[i].setPrimarySpecificPaths(PrimarySpecificPaths(
outputFiles[i], outputFiles[i],
i == 0 ? supplementaryOutputs.front() : SupplementaryOutputPaths()));
}
std::vector<std::string> FrontendInputsAndOutputs::copyOutputFilenames() const {
std::vector<std::string> outputs;
(void)forEachInputProducingAMainOutputFile(
[&](const InputFile &input) -> bool {
outputs.push_back(input.outputFilename());
return false;
});
return outputs;
}
void FrontendInputsAndOutputs::forEachOutputFilename(
llvm::function_ref<void(StringRef)> fn) const {
(void)forEachInputProducingAMainOutputFile(
[&](const InputFile &input) -> bool {
fn(input.outputFilename());
return false;
});
}
std::string FrontendInputsAndOutputs::getSingleOutputFilename() const {
assertMustNotBeMoreThanOnePrimaryInputUnlessBatchModeChecksHaveBeenBypassed();
return hasInputs() ? lastInputProducingOutput().outputFilename()
: std::string();
}
bool FrontendInputsAndOutputs::isOutputFilenameStdout() const {
return getSingleOutputFilename() == "-";
}
bool FrontendInputsAndOutputs::isOutputFileDirectory() const {
return hasNamedOutputFile() &&
llvm::sys::fs::is_directory(getSingleOutputFilename());
}
bool FrontendInputsAndOutputs::hasNamedOutputFile() const {
return hasInputs() && !isOutputFilenameStdout();
}
// Supplementary outputs
unsigned
FrontendInputsAndOutputs::countOfFilesProducingSupplementaryOutput() const {
return hasPrimaryInputs() ? primaryInputCount() : hasInputs() ? 1 : 0;
}
bool FrontendInputsAndOutputs::forEachInputProducingSupplementaryOutput(
llvm::function_ref<bool(const InputFile &)> fn) const {
return hasPrimaryInputs() ? forEachPrimaryInput(fn)
: hasInputs() ? fn(firstInput()) : false;
}
bool FrontendInputsAndOutputs::hasSupplementaryOutputPath(
llvm::function_ref<const std::string &(const SupplementaryOutputPaths &)>
extractorFn) const {
return forEachInputProducingSupplementaryOutput([&](const InputFile &input)
-> bool {
return !extractorFn(input.getPrimarySpecificPaths().SupplementaryOutputs)
.empty();
});
}
bool FrontendInputsAndOutputs::hasDependenciesPath() const {
return hasSupplementaryOutputPath(
[](const SupplementaryOutputPaths &outs) -> const std::string & {
return outs.DependenciesFilePath;
});
}
bool FrontendInputsAndOutputs::hasReferenceDependenciesPath() const {
return hasSupplementaryOutputPath(
[](const SupplementaryOutputPaths &outs) -> const std::string & {
return outs.ReferenceDependenciesFilePath;
});
}
bool FrontendInputsAndOutputs::hasObjCHeaderOutputPath() const {
return hasSupplementaryOutputPath(
[](const SupplementaryOutputPaths &outs) -> const std::string & {
return outs.ObjCHeaderOutputPath;
});
}
bool FrontendInputsAndOutputs::hasLoadedModuleTracePath() const {
return hasSupplementaryOutputPath(
[](const SupplementaryOutputPaths &outs) -> const std::string & {
return outs.LoadedModuleTracePath;
});
}
bool FrontendInputsAndOutputs::hasModuleOutputPath() const {
return hasSupplementaryOutputPath(
[](const SupplementaryOutputPaths &outs) -> const std::string & {
return outs.ModuleOutputPath;
});
}
bool FrontendInputsAndOutputs::hasModuleDocOutputPath() const {
return hasSupplementaryOutputPath(
[](const SupplementaryOutputPaths &outs) -> const std::string & {
return outs.ModuleDocOutputPath;
});
}
bool FrontendInputsAndOutputs::hasTBDPath() const {
return hasSupplementaryOutputPath(
[](const SupplementaryOutputPaths &outs) -> const std::string & {
return outs.TBDPath;
});
}
bool FrontendInputsAndOutputs::hasDependencyTrackerPath() const {
return hasDependenciesPath() || hasReferenceDependenciesPath() ||
hasLoadedModuleTracePath();
}
const PrimarySpecificPaths &
FrontendInputsAndOutputs::getPrimarySpecificPathsForAtMostOnePrimary() const {
assertMustNotBeMoreThanOnePrimaryInputUnlessBatchModeChecksHaveBeenBypassed();
static auto emptyPaths = PrimarySpecificPaths();
return hasInputs() ? firstInputProducingOutput().getPrimarySpecificPaths()
: emptyPaths;
}
const PrimarySpecificPaths &
FrontendInputsAndOutputs::getPrimarySpecificPathsForPrimary(
StringRef filename) const {
const InputFile *f = primaryInputNamed(filename);
return f->getPrimarySpecificPaths();
}
const InputFile *
FrontendInputsAndOutputs::primaryInputNamed(StringRef name) const {
assert(!name.empty() && "input files have names");
StringRef correctedFile =
InputFile::convertBufferNameFromLLVM_getFileOrSTDIN_toSwiftConventions(
name);
auto iterator = PrimaryInputsByName.find(correctedFile);
if (iterator == PrimaryInputsByName.end())
return nullptr;
const InputFile *f = &AllInputs[iterator->second];
assert(f->isPrimary() && "PrimaryInputsByName should only include primries");
return f;
}
| {
"content_hash": "120d0301d1a569aed2f30bf5fae9210c",
"timestamp": "",
"source": "github",
"line_count": 431,
"max_line_length": 81,
"avg_line_length": 33.522041763341065,
"alnum_prop": 0.7023809523809523,
"repo_name": "huonw/swift",
"id": "fad6b90633b0fd63861d9a3d63b596aab0e96fe1",
"size": "15489",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/Frontend/FrontendInputsAndOutputs.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "34"
},
{
"name": "C",
"bytes": "200369"
},
{
"name": "C++",
"bytes": "29277385"
},
{
"name": "CMake",
"bytes": "462532"
},
{
"name": "D",
"bytes": "1107"
},
{
"name": "DTrace",
"bytes": "2438"
},
{
"name": "Emacs Lisp",
"bytes": "57358"
},
{
"name": "LLVM",
"bytes": "67650"
},
{
"name": "Makefile",
"bytes": "1841"
},
{
"name": "Objective-C",
"bytes": "369708"
},
{
"name": "Objective-C++",
"bytes": "232830"
},
{
"name": "Perl",
"bytes": "2211"
},
{
"name": "Python",
"bytes": "1180644"
},
{
"name": "Ruby",
"bytes": "2091"
},
{
"name": "Shell",
"bytes": "206022"
},
{
"name": "Swift",
"bytes": "24216920"
},
{
"name": "Vim script",
"bytes": "15654"
}
],
"symlink_target": ""
} |
package object
import (
"bytes"
"fmt"
"jacob/dusk/pkg/ast"
"jacob/dusk/pkg/token"
"strings"
)
// Type is a flag for the type of object
type Type int
const (
// NilType nil
NilType Type = iota
// IntType int64
IntType
// FloatType float64
FloatType
// BooleanType bool
BooleanType
// StringType string
StringType
// ReturnType value
ReturnType
// ErrorType runtime error
ErrorType
// FunctionType is a closure
FunctionType
// BuiltinType is a function in go
BuiltinType
// ArrayType is an array of any objects
ArrayType
)
// String for type
func (t Type) String() string {
switch t {
case IntType:
return "int"
case FloatType:
return "float"
case BooleanType:
return "bool"
case StringType:
return "string"
case ReturnType:
return "return_value"
case ErrorType:
return "error"
case FunctionType:
return "function"
case BuiltinType:
return "builtin"
case ArrayType:
return "array"
default:
return "unknown"
}
}
// Object is the base interface of all objects
type Object interface {
Type() Type
String() string
CanApply(token.Type, Type) bool
}
// Integer is a int64
type Integer struct {
Value int64
}
// String for Integer
func (i *Integer) String() string {
return fmt.Sprintf("%d", i.Value)
}
// Type for Integer
func (i *Integer) Type() Type {
return IntType
}
// CanApply for this type
func (i *Integer) CanApply(op token.Type, t Type) bool {
switch t {
case IntType, FloatType:
return true
default:
if op == token.Equal || op == token.NotEqual {
return true
}
return false
}
}
// Float is a float64
type Float struct {
Value float64
}
// String for Float
func (f *Float) String() string {
return fmt.Sprintf("%f", f.Value)
}
// Type for Float
func (f *Float) Type() Type {
return FloatType
}
// CanApply for this type
func (f *Float) CanApply(op token.Type, t Type) bool {
switch t {
case IntType, FloatType:
return true
default:
return false
}
}
// Boolean is a int64
type Boolean struct {
Value bool
}
// String for Boolean
func (b *Boolean) String() string {
return fmt.Sprintf("%t", b.Value)
}
// Type for Boolean
func (b *Boolean) Type() Type {
return BooleanType
}
// CanApply for this type
func (b *Boolean) CanApply(op token.Type, t Type) bool {
switch op {
case token.Equal, token.NotEqual:
return true
default:
return false
}
}
// String is a string
type String struct {
Value string
}
// String for String
func (s *String) String() string {
return s.Value
}
// Type for String
func (s *String) Type() Type {
return StringType
}
// CanApply for this type
func (s *String) CanApply(op token.Type, t Type) bool {
switch op {
case token.Equal, token.NotEqual:
return true
case token.Plus:
if t == StringType {
return true
}
return false
default:
return false
}
}
// Nil - No value
type Nil struct{}
// String for Boolean
func (n *Nil) String() string {
return "nil"
}
// Type for Nil
func (n *Nil) Type() Type {
return NilType
}
// CanApply for this type
func (n *Nil) CanApply(op token.Type, t Type) bool {
return false
}
// ReturnValue wrapper for a value returned
type ReturnValue struct {
Value Object
}
// String for Return
func (r *ReturnValue) String() string {
return r.Value.String()
}
// Type for Return
func (r *ReturnValue) Type() Type {
return ReturnType
}
// CanApply for this type
func (r *ReturnValue) CanApply(op token.Type, t Type) bool {
return r.Value.CanApply(op, t)
}
// Error for runrime error
type Error struct {
Message string
Pos token.Position
}
// String for Error
func (e *Error) String() string {
return fmt.Sprintf("%s: %s", e.Pos, e.Message)
}
// Type for Error
func (e *Error) Type() Type {
return ErrorType
}
// CanApply for this type
func (e *Error) CanApply(op token.Type, t Type) bool {
return false
}
// Function contains a function and current environment
type Function struct {
Params []*ast.Identifier
Body *ast.BlockStatement
Env *Environment
}
// String for Function
func (f *Function) String() string {
var b bytes.Buffer
params := []string{}
for _, p := range f.Params {
params = append(params, p.String())
}
b.WriteByte('|')
b.WriteString(strings.Join(params, ", "))
b.WriteString("| {\n")
b.WriteString(f.Body.String())
b.WriteString("\n}")
return b.String()
}
// Type for Function
func (f *Function) Type() Type {
return FunctionType
}
// CanApply for this type
func (f *Function) CanApply(op token.Type, t Type) bool {
return false
}
// BuiltinFunction is a function with n args
type BuiltinFunction func(args ...Object) Object
// Builtin is a builtin go function
type Builtin struct {
Fn BuiltinFunction
}
// Type for Builtin
func (b *Builtin) Type() Type {
return BuiltinType
}
// String for Builtin
func (b *Builtin) String() string {
return "builtin function"
}
// CanApply for this type
func (b *Builtin) CanApply(op token.Type, t Type) bool {
return false
}
// Array holds n objects
type Array struct {
Elements []Object
}
// String for Array
func (a *Array) String() string {
var b bytes.Buffer
elements := []string{}
for _, e := range a.Elements {
elements = append(elements, e.String())
}
b.WriteString("[")
b.WriteString(strings.Join(elements, ", "))
b.WriteString("]")
return b.String()
}
// Type for Array
func (a *Array) Type() Type {
return ArrayType
}
// CanApply for this type
func (a *Array) CanApply(op token.Type, t Type) bool {
switch op {
case token.Equal, token.NotEqual:
return true
case token.Plus:
if t == ArrayType {
return true
}
return false
default:
return false
}
}
| {
"content_hash": "58a9e9c0f7230e82f893aa556a154419",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 60,
"avg_line_length": 16.769461077844312,
"alnum_prop": 0.6838064631315837,
"repo_name": "Jacobious52/Dusk-lang",
"id": "6ae5480e4c26368363f223af5291692687b931d3",
"size": "5601",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pkg/object/object.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "240"
},
{
"name": "Go",
"bytes": "115518"
}
],
"symlink_target": ""
} |
package validation
import (
"bytes"
"fmt"
"net"
"strings"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
// IsIPAddress is a SchemaValidateFunc which tests if the provided value is of type string and is a single IP (v4 or v6)
func IsIPAddress(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %q to be string", k))
return warnings, errors
}
ip := net.ParseIP(v)
if ip == nil {
errors = append(errors, fmt.Errorf("expected %s to contain a valid IP, got: %s", k, v))
}
return warnings, errors
}
// IsIPv6Address is a SchemaValidateFunc which tests if the provided value is of type string and a valid IPv6 address
func IsIPv6Address(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %q to be string", k))
return warnings, errors
}
ip := net.ParseIP(v)
if six := ip.To16(); six == nil {
errors = append(errors, fmt.Errorf("expected %s to contain a valid IPv6 address, got: %s", k, v))
}
return warnings, errors
}
// IsIPv4Address is a SchemaValidateFunc which tests if the provided value is of type string and a valid IPv4 address
func IsIPv4Address(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %q to be string", k))
return warnings, errors
}
ip := net.ParseIP(v)
if four := ip.To4(); four == nil {
errors = append(errors, fmt.Errorf("expected %s to contain a valid IPv4 address, got: %s", k, v))
}
return warnings, errors
}
// IsIPv4Range is a SchemaValidateFunc which tests if the provided value is of type string, and in valid IP range
func IsIPv4Range(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %s to be string", k))
return warnings, errors
}
ips := strings.Split(v, "-")
if len(ips) != 2 {
errors = append(errors, fmt.Errorf("expected %s to contain a valid IP range, got: %s", k, v))
return warnings, errors
}
ip1 := net.ParseIP(ips[0])
ip2 := net.ParseIP(ips[1])
if ip1 == nil || ip2 == nil || bytes.Compare(ip1, ip2) > 0 {
errors = append(errors, fmt.Errorf("expected %s to contain a valid IP range, got: %s", k, v))
}
return warnings, errors
}
// IsCIDR is a SchemaValidateFunc which tests if the provided value is of type string and a valid CIDR
func IsCIDR(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %s to be string", k))
return warnings, errors
}
if _, _, err := net.ParseCIDR(v); err != nil {
errors = append(errors, fmt.Errorf("expected %q to be a valid IPv4 Value, got %v: %v", k, i, err))
}
return warnings, errors
}
// IsCIDRNetwork returns a SchemaValidateFunc which tests if the provided value
// is of type string, is in valid Value network notation, and has significant bits between min and max (inclusive)
func IsCIDRNetwork(min, max int) schema.SchemaValidateFunc {
return func(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %s to be string", k))
return warnings, errors
}
_, ipnet, err := net.ParseCIDR(v)
if err != nil {
errors = append(errors, fmt.Errorf("expected %s to contain a valid Value, got: %s with err: %s", k, v, err))
return warnings, errors
}
if ipnet == nil || v != ipnet.String() {
errors = append(errors, fmt.Errorf("expected %s to contain a valid network Value, expected %s, got %s",
k, ipnet, v))
}
sigbits, _ := ipnet.Mask.Size()
if sigbits < min || sigbits > max {
errors = append(errors, fmt.Errorf("expected %q to contain a network Value with between %d and %d significant bits, got: %d", k, min, max, sigbits))
}
return warnings, errors
}
}
// IsMACAddress is a SchemaValidateFunc which tests if the provided value is of type string and a valid MAC address
func IsMACAddress(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %q to be string", k))
return warnings, errors
}
if _, err := net.ParseMAC(v); err != nil {
errors = append(errors, fmt.Errorf("expected %q to be a valid MAC address, got %v: %v", k, i, err))
}
return warnings, errors
}
// IsPortNumber is a SchemaValidateFunc which tests if the provided value is of type string and a valid TCP Port Number
func IsPortNumber(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(int)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %q to be integer", k))
return warnings, errors
}
if 1 > v || v > 65535 {
errors = append(errors, fmt.Errorf("expected %q to be a valid port number, got: %v", k, v))
}
return warnings, errors
}
// IsPortNumberOrZero is a SchemaValidateFunc which tests if the provided value is of type string and a valid TCP Port Number or zero
func IsPortNumberOrZero(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(int)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %q to be integer", k))
return warnings, errors
}
if 0 > v || v > 65535 {
errors = append(errors, fmt.Errorf("expected %q to be a valid port number or 0, got: %v", k, v))
}
return warnings, errors
}
| {
"content_hash": "05ae0229d44c8f0186a7adc5c92a9735",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 151,
"avg_line_length": 32.47953216374269,
"alnum_prop": 0.6748289521065899,
"repo_name": "Cox-Automotive/terraform-provider-alks",
"id": "8aa7139a004cf50bf09425765ce20a1d5b144a23",
"size": "5554",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/network.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "97953"
},
{
"name": "Makefile",
"bytes": "3237"
}
],
"symlink_target": ""
} |
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright © 2013-2015 The Nxt Core Developers. ~
~ ~
~ See the AUTHORS.txt, DEVELOPER-AGREEMENT.txt and LICENSE.txt files at ~
~ the top-level directory of this distribution for the individual copyright ~
~ holder information and the developer policies on copyright and licensing. ~
~ ~
~ Unless otherwise agreed in a custom licensing agreement, no part of the ~
~ Nxt software, including this file, may be copied, modified, propagated, ~
~ or distributed except according to the terms contained in the LICENSE.txt ~
~ file. ~
~ ~
~ Removal or modification of this copyright notice is prohibited. ~
~ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<div class="modal fade" id="mgw_coin_asset_details_modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">mgw<span id="mgw_coin16"></span> Asset Details</h4>
</div>
<div class="modal-body">
<div>
<ul class="nav nav-pills nav-justified" style="margin-bottom:10px">
<li class="active"><a href="#">Info</a></li>
</ul>
</div>
<table class="table table-striped" style="margin-bottom:0;table-layout:fixed;">
<tbody>
<tr>
<td style="font-weight: bold">Balance:</td>
<td><span id="mgw_coin_balance"></span> mgw<span id="mgw_coin17"></span></td>
</tr>
<tr>
<td style="font-weight: bold">Available Balance:</td>
<td><span id="mgw_coin_unconfirmed_balance"></span> mgw<span id="mgw_coin18"></span></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer" style="margin-top:0;">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="mgw_gen_deposit_addr_modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Multigateway - Generate Deposit Address</h4>
</div>
<div class="modal-body">
<form role="form" id="mgw_gen_deposit_form">
<div class="callout callout-danger error_message" style="display:none"></div>
<div class="form-group">
<label for="mgw_gen_deposit_addr_recipient">RECIPIENT</label>
<input type="hidden" name="message" id="mgw_gen_deposit_addr_msg" value="" />
<input type="text" class="form-control" name="recipient" id="mgw_gen_deposit_addr_recipient" tabindex="1" disabled />
</div>
<div class="row advanced">
<div class="col-xs-6 col-sm-6 col-md-6">
<div class="form-group">
<label for="mgw_gen_deposit_addr_fee">FEE</label>
<div class="input-group">
<input type="number" name="feeNXT" id="mgw_gen_deposit_addr_fee" class="form-control" step="any" min="1" placeholder="Fee" data-default="1" value="1" tabindex="2">
<span class="input-group-addon">NXT</span>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<div class="form-group">
<label for="mgw_gen_deposit_addr_deadline">DEADLINE (HOURS)</label>
<input type="number" name="deadline" id="mgw_gen_deposit_addr_deadline" class="form-control" placeholder="Deadline" min="1" data-default="24" value="24" tabindex="3">
</div>
</div>
</div>
<div class="form-group secret_phrase">
<label for="mgw_gen_deposit_addr_password">PASSPHRASE</label>
<input type="password" name="secretPhrase" id="mgw_gen_deposit_addr_password" class="form-control" tabindex="4">
</div>
<div data-replace-with-modal-template="jay_tx_modal_template"></div>
<input type="hidden" name="success_message" value="Your deposit address will be generated in 15 blocks." />
<input type="hidden" name="failure_message" value="An unknown error occured! Deposit address may or may not be generated." />
<input type="hidden" name="converted_account_id" value="" />
</form>
</div>
<div class="modal-footer" style="margin-top:0;">
<div class="advanced_info"><strong>Fee</strong>: <span class="advanced_fee">1 NXT</span> <a href="#" style="display:none" >advanced</a></div>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" data-loading-text="Submitting..." onclick="NRS.mgwSendMessage();">Generate</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="mgw_withdraw_modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><img id="mgw_coin_withdraw_confirmation" /> <span id="mgw_coin19"></span> Withdrawal Confirmation</h4>
</div>
<div class="modal-body">
<form role="form" autocomplete="off">
<div class="callout callout-danger error_message" style="display:none"></div>
<div class="form-group">
<label>WITHDRAW ADDRESS</label>
<p id="mgw_withdraw_modal_address"></p>
<input type="checkbox" style="display:none" name="add_message" class="add_message" checked="checked" id="mgw_withdraw_modal_add_message" />
<input type="hidden" name="message" id="mgw_withdraw_modal_message" value="" />
<input type="hidden" name="comment" id="mgw_withdraw_modal_comment" value="" />
<input type="hidden" name="recipient" id="mgw_withdraw_modal_recipient" value="" />
<input type="hidden" name="asset" id="mgw_withdraw_modal_asset" value="" />
<input type="hidden" name="quantityQNT" id="mgw_withdraw_modal_quantityQNT" value="" />
<input type="hidden" name="deadline" id="mgw_withdraw_modal_deadline" value="24" />
<input type="hidden" name="merchant_info" value="" data-default="" />
</div>
<div class="form-group">
<label>TOTAL RECEIVED</label>
<p id="mgw_withdraw_modal_total_received"></p>
</div>
<div class="row advanced">
<div class="col-xs-6 col-sm-6 col-md-6">
<div class="form-group">
<label for="mgw_withdraw_modal_feeNXT">FEE</label>
<div class="input-group">
<input type="number" name="feeNXT" id="mgw_withdraw_modal_feeNXT" class="form-control" step="any" min="1" placeholder="Fee" data-default="1" value="1" tabindex="1">
<span class="input-group-addon">NXT</span>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<div class="form-group">
<label for="mgw_withdraw_modal_deadline">DEADLINE (HOURS)</label>
<input type="number" name="deadline" id="mgw_withdraw_modal_deadline" class="form-control" placeholder="Deadline" min="1" data-default="24" value="1" tabindex="2">
</div>
</div>
</div>
<div class="form-group secret_phrase">
<label for="mgw_withdraw_modal_password">PASSPHRASE</label>
<input type="password" name="secretPhrase" id="mgw_withdraw_modal_password" class="form-control" placeholder="" tabindex="3">
</div>
<div data-replace-with-modal-template="jay_tx_modal_template"></div>
<input type="hidden" name="success_message" value="Your withdrawal has been submitted." />
<input type="hidden" name="error_message" value="An unknown error occured! Your withdrawal may or may not have gone through." />
<input type="hidden" name="request_type" value="mgwTransferAsset" data-default="mgwTransferAsset" />
<input type="hidden" name="converted_account_id" value="" />
</form>
</div>
<div class="modal-footer" style="margin-top:0;">
<div class="advanced_info"><strong>Fee:</strong> <span class="advanced_fee">1 NXT</span> <a href="#" style="display:none">advanced</a></div>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" data-loading-text="Submitting..." onclick="NRS.mgwTransferAsset();">Withdraw</button>
</div>
</div>
</div>
</div> | {
"content_hash": "625737ed24e9f5945ad0155265d79af6",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 200,
"avg_line_length": 67.75776397515529,
"alnum_prop": 0.490695755797965,
"repo_name": "jonesnxt/Jay-NRS",
"id": "3ef02f26c9360c5c9af793c229e0a7e87bcf8496",
"size": "10910",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugins/multigateway/html/modals/multigateway.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "230311"
},
{
"name": "HTML",
"bytes": "520991"
},
{
"name": "JavaScript",
"bytes": "1309241"
}
],
"symlink_target": ""
} |
layout: page
title: Hancock Aerospace Party
date: 2016-05-24
author: Eric Sanchez
tags: weekly links, java
status: published
summary: Vivamus id bibendum lectus, sed auctor felis.
banner: images/banner/leisure-03.jpg
booking:
startDate: 04/03/2017
endDate: 04/07/2017
ctyhocn: BLAPAHX
groupCode: HAP
published: true
---
Vestibulum turpis risus, laoreet at nulla quis, vehicula mollis felis. Vivamus sed justo massa. Donec eget congue turpis, ut commodo orci. In ut tellus in ligula consectetur dapibus. Phasellus bibendum dictum dui, eget pharetra purus facilisis quis. Pellentesque laoreet nisi laoreet arcu gravida facilisis eu et eros. Suspendisse id ultrices enim, quis imperdiet odio. Nullam nec sollicitudin nibh. Nullam vehicula arcu odio, a efficitur lectus pretium ultricies. Phasellus nec auctor eros, sit amet dignissim lacus. Praesent porta orci vitae felis efficitur porttitor. Nam consectetur neque ut quam ultrices maximus. Sed mattis lacinia gravida. Nullam iaculis, mauris vitae egestas malesuada, ante lorem rhoncus arcu, sit amet maximus dolor tellus vel lectus. Sed congue mollis rutrum. Nunc tempus ornare enim.
1 Ut et lorem rhoncus, euismod nisl commodo, feugiat ipsum
1 Suspendisse volutpat sem placerat dolor facilisis, ac maximus nisl molestie
1 Quisque non turpis eget ex iaculis rhoncus quis vel sem
1 Vivamus dapibus odio sed erat viverra tempus
1 Vivamus eu neque a nisl consectetur tristique eget non mi.
Curabitur fringilla nibh pretium orci hendrerit viverra. Mauris tincidunt neque sed nibh efficitur iaculis. Nullam dui leo, congue sed aliquam id, ornare eu nisl. Sed sollicitudin enim consectetur, ornare enim at, dictum massa. Maecenas pellentesque id mauris id viverra. Nam fringilla nisi quis est hendrerit tempor. Etiam ultricies placerat augue, at mollis mauris rhoncus quis. Praesent eros sem, vestibulum vitae tristique ut, porttitor ut magna. Aenean ac bibendum augue. Vivamus quis tempus augue, eu sollicitudin erat. Sed ultricies id augue ut tempus. Phasellus fermentum nibh mi, eget molestie ipsum porta a. Nullam odio leo, auctor quis ligula ac, posuere consequat sem.
| {
"content_hash": "90f3962ef1fa2bd61c0569c7aebf67bf",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 812,
"avg_line_length": 88.625,
"alnum_prop": 0.8105312646920545,
"repo_name": "KlishGroup/prose-pogs",
"id": "aea96f2a4c27bd975bb646921bdc4a441a9eb8e0",
"size": "2131",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "pogs/B/BLAPAHX/HAP/index.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
历史上只能用C++/Vc/Delphi/.net开发PC桌面应用,如今用HTML/CSS/JS也以,因为随着技术的发展,技术的易用性的重要性的比硬件性能的重要性更加凸显了。目前主流的都是实用Node-webkit和atom shell。看看还有哪些技术解决方案
1,heX 项目介绍
heX 提供了一种全新的构建桌面应用的方式,可以使用 web 技术快速构建跨平台的桌面应用。heX 基于 CEF 并且融合了 Chromium 与 Node.js,所以我们可以在 web 页面中使用各种 Node.js 原生模块及第三方扩展,同时在这些模块及扩展中还可以访问到 HTML 中的 DOM 元素。此外,heX 甚至可以以一种 web 容器的方式嵌入到桌面应用的工程中。
heX 首页:http://hex.youdao.com
源代码:https://github.com/netease-youdao/hex
邮件组:https://groups.google.com/group/youdao_hex
Blog:http://hex.youdao.com/blog
Wiki:https://github.com/netease-youdao/hex/wiki
问题:https://github.com/netease-youdao/hex/issues
2.APPJS
Using AppJS you don't need to be worry about coding cross-platform or learning new languages and tools. You are already familiar with HTML, CSS and Javascript. What is better than this stack for application development? Beside, AppJS uses Chromium at the core so you get latest HTML 5 APIs working. So relax and focus on the task your application should do.
The below packages include everything needed to get started with AppJS, including Node.js, all dependencies, binaries, and a launcher ready to go out of the box. 1.) Extract to a folder. 2.) Double click on launch. 3.) Hello World.
AppJS 0.0.20 Distributables:
Windows
Linux 32 bit / 64 bit
Mac OS X
For Node.js users, AppJS can be also be installed via npm.
>npm install appjs
AppJS requires 32bit Node on OS X. It works on 64bit OS X but Node must be 32bit. We're working on solving this, but it's a limitation of Chrome itself so it's a work in progress. Help us gain traction by starring this chromium issue.
// load appjs
var appjs = require('appjs');
// serve static files from a directory
appjs.serveFilesFrom(__dirname + '/content');
// handle requests from the browser appjs.router.post('/',
function(request, response, next){
response.send('Hey! How are you'+request.post('firstname'));
})
// create a window
var window = appjs.createWindow({
width: 640,
height: 460,
alpha: false,
});
// prepare the window when first created
window.on('create', function(){
console.log("Window Created");
// window.frame controls the desktop window
window.frame.show().center();
});
// the window is ready when the DOM is loaded
window.on('ready', function(){
console.log("Window Ready");
// directly interact with the DOM
window.process = process;
window.module = module;
window.addEventListener('keydown', function(e){
// show chrome devtools on f12 or commmand+option+j
if (e.keyIdentifier === 'F12' || e.keyCode === 74 &&
e.metaKey && e.altKey) {
window.frame.openDevTools();
}
});
});
// cleanup code when window is closed
window.on('close', function(){
console.log("Window Closed");
});
<!doctype html>
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<form action="/" method="POST">
<input name="firstname" type="text" placeholder="Firstname"/>
<input name="lastname" type="text" placeholder="Lastname"/> <input type="submit"/>
</form>
</body>
</html>
3,CEF
CEF(Chromium Embedded Framework) 是什么?
CEF 的官网介绍的很简洁:A simple framework for embedding chromium browser windows in other applications. 具体地说就是一个可以将浏览器功能(页面渲染,JS 执行)嵌入到其他应用程序的框架。
CEF 的应用场景
CEF 作为嵌入式浏览器框架最适合的应用场景应该是 HTML 页面渲染,所以很多程序都基于 CEF 来为应用程序提供 HTML 页面渲染的功能,如有道笔记,Evernote,GitHub Window Client,Q+,Adobe Brackets 等。此外还有一些基于 Web 的桌面应用也使用了 CEF,更多的应用你可以 Google 一下。 | {
"content_hash": "4628e077341bdc01387e5b06ba2de7ed",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 357,
"avg_line_length": 38.05714285714286,
"alnum_prop": 0.6241241241241241,
"repo_name": "Vincent2015/myblog",
"id": "d1c39c5302402741316ac5519685e2cf2160a0a2",
"size": "4730",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "2016-10/桌面应用解决方案集锦.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "32474"
},
{
"name": "GCC Machine Description",
"bytes": "9253"
},
{
"name": "HTML",
"bytes": "41209"
},
{
"name": "JavaScript",
"bytes": "20537"
}
],
"symlink_target": ""
} |
<h1>Chef Login</h1>
<div class="row-fluid">
<div class="span8">
<?php echo Form::open('user/complete_login') ?>
<div class="field">
<label for="chef_email">Email</label>
<?php echo Form::input('email','',array('id' => 'email')) ?>
</div>
<div class="field">
<label for="chef_password">Password</label>
<?php echo Form::password('password','',array('id' => 'password')) ?>
</div>
<div class="actions">
<?php echo Form::submit('submit','Login') ?>
</div>
</div>
</div>
| {
"content_hash": "0ff5dd6182d22a8d798f460452d326d7",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 73,
"avg_line_length": 30.705882352941178,
"alnum_prop": 0.5613026819923371,
"repo_name": "michiphung/freshcook",
"id": "f9d60b44c0c2ecd062fbdcd31e3bd2858a48632f",
"size": "522",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/views/user/login.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "33091"
},
{
"name": "JavaScript",
"bytes": "33204"
},
{
"name": "PHP",
"bytes": "1292081"
},
{
"name": "Shell",
"bytes": "1670"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.